@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/cjs/index.js CHANGED
@@ -49,16 +49,18 @@ var __privateSet = (obj, member, value, setter) => {
49
49
  var src_exports = {};
50
50
  __export(src_exports, {
51
51
  ColumnExpressionInput: () => ColumnExpressionInput,
52
+ ColumnList: () => ColumnList,
52
53
  ColumnNamedTerms: () => ColumnNamedTerms,
53
- ColumnSettingsPanel: () => ColumnSettingsPanel2,
54
54
  DataSourceStats: () => DataSourceStats,
55
55
  DatagridSettingsPanel: () => DatagridSettingsPanel,
56
+ TableSettingsPanel: () => TableSettingsPanel,
56
57
  columnExpressionLanguageSupport: () => columnExpressionLanguageSupport,
57
58
  isCompleteExpression: () => isCompleteExpression,
58
59
  isCompleteRelationalExpression: () => isCompleteRelationalExpression,
59
60
  lastNamedChild: () => lastNamedChild,
60
61
  useColumnExpressionEditor: () => useColumnExpressionEditor,
61
62
  useColumnExpressionSuggestionProvider: () => useColumnExpressionSuggestionProvider,
63
+ useTableSettings: () => useTableSettings,
62
64
  walkTree: () => walkTree
63
65
  });
64
66
  module.exports = __toCommonJS(src_exports);
@@ -172,10 +174,95 @@ var ProgressCell = ({ column, columnMap, row }) => {
172
174
  serverDataType: ["long", "int", "double"]
173
175
  });
174
176
 
177
+ // src/column-list/ColumnList.tsx
178
+ var import_vuu_ui_controls = require("@vuu-ui/vuu-ui-controls");
179
+ var import_core = require("@salt-ds/core");
180
+ var import_lab = require("@salt-ds/lab");
181
+ var import_classnames3 = __toESM(require("classnames"), 1);
182
+ var import_react2 = require("react");
183
+ var import_jsx_runtime3 = require("react/jsx-runtime");
184
+ var classBase3 = "vuuColumnList";
185
+ var classBaseListItem = "vuuColumnListItem";
186
+ var ColumnListItem = ({
187
+ className: classNameProp,
188
+ item,
189
+ ...listItemProps
190
+ }) => {
191
+ var _a;
192
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
193
+ import_vuu_ui_controls.ListItem,
194
+ {
195
+ ...listItemProps,
196
+ className: (0, import_classnames3.default)(classNameProp, classBaseListItem),
197
+ "data-name": item == null ? void 0 : item.name,
198
+ children: [
199
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lab.Switch, { className: `${classBase3}-switch`, checked: item == null ? void 0 : item.subscribed }),
200
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: `${classBase3}-text`, children: (_a = item == null ? void 0 : item.label) != null ? _a : item == null ? void 0 : item.name }),
201
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
202
+ import_core.Checkbox,
203
+ {
204
+ className: `${classBase3}-checkBox`,
205
+ checked: (item == null ? void 0 : item.hidden) !== true,
206
+ disabled: (item == null ? void 0 : item.subscribed) !== true
207
+ }
208
+ )
209
+ ]
210
+ }
211
+ );
212
+ };
213
+ var ColumnList = ({
214
+ columnItems,
215
+ onChange,
216
+ onMoveListItem,
217
+ ...htmlAttributes
218
+ }) => {
219
+ const handleChange = (0, import_react2.useCallback)(
220
+ (evt) => {
221
+ const input = evt.target;
222
+ const listItem = input.closest(`.${classBaseListItem}`);
223
+ const {
224
+ dataset: { name }
225
+ } = listItem;
226
+ if (name) {
227
+ const saltSwitch = input.closest(`.${classBase3}-switch`);
228
+ const saltCheckbox = input.closest(
229
+ `.${classBase3}-checkBox`
230
+ );
231
+ if (saltSwitch) {
232
+ onChange(name, "subscribed", input.checked);
233
+ } else if (saltCheckbox) {
234
+ onChange(name, "hidden", input.checked === false);
235
+ }
236
+ }
237
+ },
238
+ [onChange]
239
+ );
240
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { ...htmlAttributes, className: classBase3, children: [
241
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: `${classBase3}-header`, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Column Selection" }) }),
242
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: `${classBase3}-colHeadings`, children: [
243
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Column subscription" }),
244
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Visibility" })
245
+ ] }),
246
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
247
+ import_vuu_ui_controls.List,
248
+ {
249
+ ListItem: ColumnListItem,
250
+ allowDragDrop: true,
251
+ height: "100%",
252
+ onChange: handleChange,
253
+ onMoveListItem,
254
+ selectionStrategy: "none",
255
+ source: columnItems,
256
+ itemHeight: 33
257
+ }
258
+ )
259
+ ] });
260
+ };
261
+
175
262
  // src/column-expression-input/useColumnExpressionEditor.ts
176
263
  var import_vuu_codemirror5 = require("@vuu-ui/vuu-codemirror");
177
264
  var import_vuu_utils4 = require("@vuu-ui/vuu-utils");
178
- var import_react3 = require("react");
265
+ var import_react4 = require("react");
179
266
 
180
267
  // src/column-expression-input/column-language-parser/ColumnExpressionLanguage.ts
181
268
  var import_vuu_codemirror = require("@vuu-ui/vuu-codemirror");
@@ -794,7 +881,7 @@ var vuuTheme = import_vuu_codemirror3.EditorView.theme(
794
881
 
795
882
  // src/column-expression-input/useColumnAutoComplete.ts
796
883
  var import_vuu_codemirror4 = require("@vuu-ui/vuu-codemirror");
797
- var import_react2 = require("react");
884
+ var import_react3 = require("react");
798
885
  var applyPrefix = (completions, prefix) => prefix ? completions.map((completion) => {
799
886
  var _a;
800
887
  return {
@@ -914,7 +1001,7 @@ var promptToSave = (context, onSubmit) => {
914
1001
  return { from: context.pos, options };
915
1002
  };
916
1003
  var useColumnAutoComplete = (suggestionProvider, onSubmit) => {
917
- const makeSuggestions2 = (0, import_react2.useCallback)(
1004
+ const makeSuggestions2 = (0, import_react3.useCallback)(
918
1005
  async (context, suggestionType, optionalArgs = {}) => {
919
1006
  const options = await suggestionProvider.getSuggestions(
920
1007
  suggestionType,
@@ -925,7 +1012,7 @@ var useColumnAutoComplete = (suggestionProvider, onSubmit) => {
925
1012
  },
926
1013
  [suggestionProvider]
927
1014
  );
928
- return (0, import_react2.useCallback)(
1015
+ return (0, import_react3.useCallback)(
929
1016
  async (context) => {
930
1017
  var _a, _b;
931
1018
  const { state, pos } = context;
@@ -1224,11 +1311,11 @@ var useColumnExpressionEditor = ({
1224
1311
  onSubmitExpression,
1225
1312
  suggestionProvider
1226
1313
  }) => {
1227
- const editorRef = (0, import_react3.useRef)(null);
1228
- const onSubmit = (0, import_react3.useRef)(noop);
1229
- const viewRef = (0, import_react3.useRef)();
1314
+ const editorRef = (0, import_react4.useRef)(null);
1315
+ const onSubmit = (0, import_react4.useRef)(noop);
1316
+ const viewRef = (0, import_react4.useRef)();
1230
1317
  const completionFn = useColumnAutoComplete(suggestionProvider, onSubmit);
1231
- const [createState, clearInput] = (0, import_react3.useMemo)(() => {
1318
+ const [createState, clearInput] = (0, import_react4.useMemo)(() => {
1232
1319
  const parseExpression = () => {
1233
1320
  const view = getView(viewRef);
1234
1321
  const source = view.state.doc.toString();
@@ -1312,7 +1399,7 @@ var useColumnExpressionEditor = ({
1312
1399
  };
1313
1400
  return [createState2, clearInput2];
1314
1401
  }, [completionFn, onChange, onSubmitExpression]);
1315
- (0, import_react3.useEffect)(() => {
1402
+ (0, import_react4.useEffect)(() => {
1316
1403
  if (!editorRef.current) {
1317
1404
  throw Error("editor not in dom");
1318
1405
  }
@@ -1329,8 +1416,8 @@ var useColumnExpressionEditor = ({
1329
1416
  };
1330
1417
 
1331
1418
  // src/column-expression-input/ColumnExpressionInput.tsx
1332
- var import_jsx_runtime3 = require("react/jsx-runtime");
1333
- var classBase3 = "vuuColumnExpressionInput";
1419
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1420
+ var classBase4 = "vuuColumnExpressionInput";
1334
1421
  var ColumnExpressionInput = ({
1335
1422
  onChange,
1336
1423
  onSubmitExpression,
@@ -1341,14 +1428,14 @@ var ColumnExpressionInput = ({
1341
1428
  onSubmitExpression,
1342
1429
  suggestionProvider
1343
1430
  });
1344
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: `${classBase3}`, ref: editorRef });
1431
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: `${classBase4}`, ref: editorRef });
1345
1432
  };
1346
1433
 
1347
1434
  // src/column-expression-input/useColumnExpressionSuggestionProvider.ts
1348
1435
  var import_vuu_codemirror6 = require("@vuu-ui/vuu-codemirror");
1349
1436
  var import_vuu_data_react = require("@vuu-ui/vuu-data-react");
1350
1437
  var import_vuu_utils6 = require("@vuu-ui/vuu-utils");
1351
- var import_react4 = require("react");
1438
+ var import_react5 = require("react");
1352
1439
 
1353
1440
  // src/column-expression-input/column-function-descriptors.ts
1354
1441
  var columnFunctionDescriptors = [
@@ -1769,13 +1856,13 @@ var useColumnExpressionSuggestionProvider = ({
1769
1856
  columns,
1770
1857
  table
1771
1858
  }) => {
1772
- const findColumn = (0, import_react4.useCallback)(
1859
+ const findColumn3 = (0, import_react5.useCallback)(
1773
1860
  (name) => name ? columns.find((col) => col.name === name) : void 0,
1774
1861
  [columns]
1775
1862
  );
1776
- const latestSuggestionsRef = (0, import_react4.useRef)();
1863
+ const latestSuggestionsRef = (0, import_react5.useRef)();
1777
1864
  const getTypeaheadSuggestions = (0, import_vuu_data_react.useTypeaheadSuggestions)();
1778
- const getSuggestions = (0, import_react4.useCallback)(
1865
+ const getSuggestions = (0, import_react5.useCallback)(
1779
1866
  async (suggestionType, options = NONE) => {
1780
1867
  const { columnName, functionName, operator, prefix } = options;
1781
1868
  switch (suggestionType) {
@@ -1790,18 +1877,18 @@ var useColumnExpressionSuggestionProvider = ({
1790
1877
  return latestSuggestionsRef.current = withApplySpace(suggestions);
1791
1878
  }
1792
1879
  case "operator": {
1793
- const suggestions = await getOperators(findColumn(columnName));
1880
+ const suggestions = await getOperators(findColumn3(columnName));
1794
1881
  return latestSuggestionsRef.current = withApplySpace(suggestions);
1795
1882
  }
1796
1883
  case "relational-operator": {
1797
1884
  const suggestions = await (0, import_vuu_codemirror6.getRelationalOperators)(
1798
- findColumn(columnName)
1885
+ findColumn3(columnName)
1799
1886
  );
1800
1887
  return latestSuggestionsRef.current = withApplySpace(suggestions);
1801
1888
  }
1802
1889
  case "condition-operator":
1803
1890
  {
1804
- const column = findColumn(columnName);
1891
+ const column = findColumn3(columnName);
1805
1892
  if (column) {
1806
1893
  const suggestions = await getConditionOperators(column);
1807
1894
  if (suggestions) {
@@ -1838,9 +1925,9 @@ var useColumnExpressionSuggestionProvider = ({
1838
1925
  }
1839
1926
  return [];
1840
1927
  },
1841
- [columns, findColumn, getTypeaheadSuggestions, table]
1928
+ [columns, findColumn3, getTypeaheadSuggestions, table]
1842
1929
  );
1843
- const isPartialMatch = (0, import_react4.useCallback)(
1930
+ const isPartialMatch = (0, import_react5.useCallback)(
1844
1931
  async (valueType, columnName, pattern) => {
1845
1932
  const { current: latestSuggestions } = latestSuggestionsRef;
1846
1933
  let maybe = false;
@@ -1869,216 +1956,25 @@ var import_core7 = require("@salt-ds/core");
1869
1956
  var import_classnames6 = __toESM(require("classnames"), 1);
1870
1957
  var import_react12 = require("react");
1871
1958
 
1872
- // src/datagrid-configuration-ui/column-picker/ColumnPicker.tsx
1873
- var import_lab2 = require("@salt-ds/lab");
1874
- var import_core = require("@salt-ds/core");
1875
- var import_react5 = require("react");
1876
-
1877
- // src/datagrid-configuration-ui/column-picker/ColumnListItem.tsx
1878
- var import_lab = require("@salt-ds/lab");
1879
- var import_classnames3 = __toESM(require("classnames"), 1);
1880
- var import_jsx_runtime4 = require("react/jsx-runtime");
1881
- var classBase4 = "vuuColumnListItem";
1882
- var ColumnListItem = ({
1883
- className: classNameProp,
1884
- item,
1885
- label,
1886
- style: styleProp,
1887
- ...restProps
1888
- }) => {
1889
- const className = (0, import_classnames3.default)(classBase4, classNameProp, {
1890
- [`${classBase4}-calculated`]: item == null ? void 0 : item.expression,
1891
- [`${classBase4}-hidden`]: item == null ? void 0 : item.hidden
1892
- });
1893
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_lab.ListItem, { className, ...restProps, children: [
1894
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${classBase4}-iconType` }),
1895
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { className: `${classBase4}-label`, children: label }),
1896
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${classBase4}-iconHidden` })
1897
- ] });
1898
- };
1899
-
1900
- // src/datagrid-configuration-ui/column-picker/ColumnPicker.tsx
1901
- var import_jsx_runtime5 = require("react/jsx-runtime");
1902
- var classBase5 = "vuuColumnPicker";
1903
- var removeSelectedColumns = (availableColumns, selectedColumns) => {
1904
- return availableColumns.filter(
1905
- (column) => selectedColumns.find((col) => col.name === column.name) == null
1906
- );
1907
- };
1908
- var ColumnPicker = ({
1909
- availableColumns,
1910
- id: idProp,
1911
- dispatchColumnAction: dispatch,
1912
- onAddCalculatedColumnClick,
1913
- onSelectionChange,
1914
- chosenColumns,
1915
- selectedColumn
1916
- }) => {
1917
- const [selected1, setSelected1] = (0, import_react5.useState)([]);
1918
- const id = (0, import_core.useIdMemo)(idProp);
1919
- const unusedColumns = removeSelectedColumns(availableColumns, chosenColumns);
1920
- const addColumn2 = (0, import_react5.useCallback)(() => {
1921
- if (selected1.length > 0) {
1922
- setSelected1([]);
1923
- dispatch({ type: "addColumn", columns: selected1 });
1924
- }
1925
- }, [dispatch, selected1]);
1926
- const removeColumn2 = (0, import_react5.useCallback)(
1927
- () => selectedColumn && dispatch({ type: "removeColumn", column: selectedColumn }),
1928
- [selectedColumn, dispatch]
1929
- );
1930
- const moveColumnUp = (0, import_react5.useCallback)(
1931
- () => selectedColumn && dispatch({ type: "moveColumn", column: selectedColumn, moveBy: -1 }),
1932
- [dispatch, selectedColumn]
1933
- );
1934
- const moveColumnDown = (0, import_react5.useCallback)(
1935
- () => selectedColumn && dispatch({ type: "moveColumn", column: selectedColumn, moveBy: 1 }),
1936
- [dispatch, selectedColumn]
1937
- );
1938
- const handleSelectionChange1 = (0, import_react5.useCallback)(
1939
- (evt, selected) => setSelected1(selected),
1940
- []
1941
- );
1942
- const handleSelectionChange2 = (0, import_react5.useCallback)(
1943
- (evt, selected) => onSelectionChange == null ? void 0 : onSelectionChange(selected),
1944
- [onSelectionChange]
1945
- );
1946
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: classBase5, id, children: [
1947
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: `${classBase5}-listColumn`, children: [
1948
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `available-${id}`, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core.Text, { as: "h4", children: "Available Columns" }) }),
1949
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1950
- "div",
1951
- {
1952
- className: `${classBase5}-listContainer`,
1953
- style: { flex: 1, overflow: "hidden" },
1954
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1955
- import_lab2.List,
1956
- {
1957
- borderless: true,
1958
- checkable: false,
1959
- height: "100%",
1960
- id: `available-${id}`,
1961
- itemHeight: 24,
1962
- itemToString: (item) => item.name,
1963
- onSelectionChange: handleSelectionChange1,
1964
- selected: selected1,
1965
- selectionStrategy: "extended",
1966
- source: unusedColumns
1967
- }
1968
- )
1969
- }
1970
- ),
1971
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1972
- "div",
1973
- {
1974
- style: {
1975
- display: "flex",
1976
- alignItems: "center",
1977
- flex: "0 0 32px",
1978
- marginTop: "var(--salt-size-basis-unit)"
1979
- },
1980
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_core.Button, { onClick: addColumn2, disabled: selected1.length === 0, children: [
1981
- "Show",
1982
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "data-icon": "arrow-thin-right", style: { marginLeft: 8 } })
1983
- ] })
1984
- }
1985
- )
1986
- ] }),
1987
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: `${classBase5}-listColumn`, children: [
1988
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `selected-${id}`, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core.Text, { as: "h4", children: "Included Columns" }) }),
1989
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1990
- "div",
1991
- {
1992
- className: `${classBase5}-listContainer`,
1993
- style: { flex: 1, overflow: "hidden" },
1994
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1995
- import_lab2.List,
1996
- {
1997
- ListItem: ColumnListItem,
1998
- borderless: true,
1999
- height: "100%",
2000
- id: `selected-${id}`,
2001
- itemHeight: 24,
2002
- itemToString: (item) => item.name,
2003
- onSelectionChange: handleSelectionChange2,
2004
- selected: selectedColumn,
2005
- style: { flex: 1 },
2006
- source: chosenColumns
2007
- }
2008
- )
2009
- }
2010
- ),
2011
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2012
- "div",
2013
- {
2014
- style: {
2015
- alignItems: "center",
2016
- flex: "0 0 32px",
2017
- display: "flex",
2018
- gap: 6,
2019
- marginTop: "var(--salt-size-basis-unit)"
2020
- },
2021
- children: [
2022
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_core.Button, { onClick: removeColumn2, disabled: selectedColumn === null, children: [
2023
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "data-icon": "arrow-thin-left", style: { marginRight: 8 } }),
2024
- "Hide"
2025
- ] }),
2026
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2027
- import_core.Button,
2028
- {
2029
- "aria-label": "Move column up",
2030
- onClick: moveColumnUp,
2031
- disabled: selectedColumn === null || (chosenColumns == null ? void 0 : chosenColumns.indexOf(selectedColumn)) === 0,
2032
- style: { width: 28 },
2033
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "data-icon": "arrow-thin-up" })
2034
- }
2035
- ),
2036
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2037
- import_core.Button,
2038
- {
2039
- "aria-label": "Move column down",
2040
- onClick: moveColumnDown,
2041
- disabled: selectedColumn === null || chosenColumns.indexOf(selectedColumn) === chosenColumns.length - 1,
2042
- style: { width: 28 },
2043
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "data-icon": "arrow-thin-down" })
2044
- }
2045
- ),
2046
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2047
- import_core.Button,
2048
- {
2049
- "aria-label": "Add calculated column",
2050
- className: `${classBase5}-addCalculatedColumn`,
2051
- onClick: onAddCalculatedColumnClick,
2052
- variant: "primary",
2053
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "data-icon": "add" })
2054
- }
2055
- )
2056
- ]
2057
- }
2058
- )
2059
- ] })
2060
- ] });
2061
- };
2062
-
2063
1959
  // src/datagrid-configuration-ui/column-settings-panel/ColumnSettingsPanel.tsx
2064
1960
  var import_vuu_layout = require("@vuu-ui/vuu-layout");
2065
- var import_lab5 = require("@salt-ds/lab");
1961
+ var import_lab4 = require("@salt-ds/lab");
2066
1962
  var import_core4 = require("@salt-ds/core");
2067
1963
  var import_classnames5 = __toESM(require("classnames"), 1);
2068
1964
  var import_react8 = require("react");
2069
1965
 
2070
1966
  // src/datagrid-configuration-ui/column-type-panel/ColumnTypePanel.tsx
2071
1967
  var import_vuu_utils7 = require("@vuu-ui/vuu-utils");
2072
- var import_lab4 = require("@salt-ds/lab");
1968
+ var import_lab3 = require("@salt-ds/lab");
2073
1969
  var import_core3 = require("@salt-ds/core");
2074
1970
  var import_classnames4 = __toESM(require("classnames"), 1);
2075
1971
  var import_react7 = require("react");
2076
1972
 
2077
1973
  // src/datagrid-configuration-ui/column-type-panel/NumericColumnPanel.tsx
2078
- var import_lab3 = require("@salt-ds/lab");
1974
+ var import_lab2 = require("@salt-ds/lab");
2079
1975
  var import_core2 = require("@salt-ds/core");
2080
1976
  var import_react6 = require("react");
2081
- var import_jsx_runtime6 = require("react/jsx-runtime");
1977
+ var import_jsx_runtime5 = require("react/jsx-runtime");
2082
1978
  var defaultValues = {
2083
1979
  alignOnDecimals: false,
2084
1980
  decimals: 4,
@@ -2120,60 +2016,58 @@ var NumericColumnPanel = ({
2120
2016
  [dispatchUpdate]
2121
2017
  );
2122
2018
  const handleChangeAlignOnDecimals = (0, import_react6.useCallback)(
2123
- (evt, value) => dispatchUpdate({ alignOnDecimals: value }),
2019
+ (evt) => dispatchUpdate({ alignOnDecimals: Boolean(evt.target.value) }),
2124
2020
  [dispatchUpdate]
2125
2021
  );
2126
2022
  const handleChangeZeroPad = (0, import_react6.useCallback)(
2127
- (evt, value) => dispatchUpdate({ zeroPad: value }),
2023
+ (evt) => dispatchUpdate({ zeroPad: Boolean(evt.target.value) }),
2128
2024
  [dispatchUpdate]
2129
2025
  );
2130
2026
  switch (column.serverDataType) {
2131
2027
  case "double":
2132
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
2133
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_core2.FormField, { labelPlacement: "top", children: [
2134
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core2.FormFieldLabel, { children: "No of Decimals" }),
2135
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lab3.StepperInput, { value: decimals, onChange: handleChangeDecimals })
2028
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
2029
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_core2.FormField, { labelPlacement: "top", children: [
2030
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core2.FormFieldLabel, { children: "No of Decimals" }),
2031
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lab2.StepperInput, { value: decimals, onChange: handleChangeDecimals })
2136
2032
  ] }),
2137
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2138
- import_lab3.Switch,
2033
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2034
+ import_lab2.Switch,
2139
2035
  {
2140
2036
  checked: alignOnDecimals,
2141
2037
  label: "Align on decimals",
2142
- LabelProps: { className: "vuuColumnPanelSwitch" },
2143
2038
  onChange: handleChangeAlignOnDecimals
2144
2039
  }
2145
2040
  ),
2146
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2147
- import_lab3.Switch,
2041
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2042
+ import_lab2.Switch,
2148
2043
  {
2149
2044
  checked: zeroPad,
2150
2045
  label: "Zero pad",
2151
- LabelProps: { className: "vuuColumnPanelSwitch" },
2152
2046
  onChange: handleChangeZeroPad
2153
2047
  }
2154
2048
  )
2155
2049
  ] });
2156
2050
  case "long":
2157
2051
  case "int":
2158
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core2.Text, { children: "Work in progress" }) });
2052
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core2.Text, { children: "Work in progress" }) });
2159
2053
  default:
2160
2054
  return null;
2161
2055
  }
2162
2056
  };
2163
2057
 
2164
2058
  // src/datagrid-configuration-ui/column-type-panel/StringColumnPanel.tsx
2165
- var import_jsx_runtime7 = require("react/jsx-runtime");
2059
+ var import_jsx_runtime6 = require("react/jsx-runtime");
2166
2060
  var StringColumnPanel = ({
2167
2061
  column,
2168
2062
  dispatchColumnAction
2169
2063
  }) => {
2170
2064
  console.log({ column, dispatchColumnAction });
2171
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: "what" });
2065
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: "what" });
2172
2066
  };
2173
2067
 
2174
2068
  // src/datagrid-configuration-ui/column-type-panel/ColumnTypePanel.tsx
2175
- var import_jsx_runtime8 = require("react/jsx-runtime");
2176
- var classBase6 = "vuuColumnTypePanel";
2069
+ var import_jsx_runtime7 = require("react/jsx-runtime");
2070
+ var classBase5 = "vuuColumnTypePanel";
2177
2071
  var integerCellRenderers = ["Default Renderer (int, long)"];
2178
2072
  var doubleCellRenderers = ["Default Renderer (double)"];
2179
2073
  var stringCellRenderers = ["Default Renderer (string)"];
@@ -2205,7 +2099,7 @@ var ColumnTypePanel = ({
2205
2099
  case "double":
2206
2100
  case "int":
2207
2101
  case "long":
2208
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2102
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2209
2103
  NumericColumnPanel,
2210
2104
  {
2211
2105
  column,
@@ -2213,7 +2107,7 @@ var ColumnTypePanel = ({
2213
2107
  }
2214
2108
  );
2215
2109
  default:
2216
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2110
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2217
2111
  StringColumnPanel,
2218
2112
  {
2219
2113
  column,
@@ -2224,21 +2118,21 @@ var ColumnTypePanel = ({
2224
2118
  }, [column, dispatchColumnAction]);
2225
2119
  const { serverDataType = "string" } = column;
2226
2120
  const availableRenderers = getAvailableCellRenderers(column);
2227
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
2228
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2229
- import_lab4.Dropdown,
2121
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2122
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2123
+ import_lab3.Dropdown,
2230
2124
  {
2231
- className: (0, import_classnames4.default)(`${classBase6}-renderer`),
2125
+ className: (0, import_classnames4.default)(`${classBase5}-renderer`),
2232
2126
  fullWidth: true,
2233
2127
  selected: availableRenderers[0],
2234
2128
  source: availableRenderers
2235
2129
  }
2236
2130
  ),
2237
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2131
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2238
2132
  import_core3.Panel,
2239
2133
  {
2240
2134
  ...props,
2241
- className: (0, import_classnames4.default)(classBase6, className, `${classBase6}-${serverDataType}`),
2135
+ className: (0, import_classnames4.default)(classBase5, className, `${classBase5}-${serverDataType}`),
2242
2136
  children: content
2243
2137
  }
2244
2138
  )
@@ -2246,8 +2140,8 @@ var ColumnTypePanel = ({
2246
2140
  };
2247
2141
 
2248
2142
  // src/datagrid-configuration-ui/column-settings-panel/ColumnSettingsPanel.tsx
2249
- var import_jsx_runtime9 = require("react/jsx-runtime");
2250
- var classBase7 = "vuuColumnSettingsPanel";
2143
+ var import_jsx_runtime8 = require("react/jsx-runtime");
2144
+ var classBase6 = "vuuColumnSettingsPanel";
2251
2145
  var tabstripProps = {
2252
2146
  className: "salt-density-high"
2253
2147
  };
@@ -2287,28 +2181,28 @@ var ColumnSettingsPanel = ({
2287
2181
  (value) => dispatchUpdate({ width: parseInt(value.toString(), 10) }),
2288
2182
  [dispatchUpdate]
2289
2183
  );
2290
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2184
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2291
2185
  "div",
2292
2186
  {
2293
- className: classBase7,
2187
+ className: classBase6,
2294
2188
  ...props,
2295
2189
  style: {
2296
2190
  ...styleProp
2297
2191
  },
2298
2192
  children: [
2299
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.Text, { as: "h4", children: "Column Settings" }),
2300
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2193
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.Text, { as: "h4", children: "Column Settings" }),
2194
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2301
2195
  import_vuu_layout.Stack,
2302
2196
  {
2303
2197
  active: activeTab,
2304
- className: (0, import_classnames5.default)(`${classBase7}-columnTabs`),
2198
+ className: (0, import_classnames5.default)(`${classBase6}-columnTabs`),
2305
2199
  onTabSelectionChanged: setActiveTab,
2306
2200
  TabstripProps: tabstripProps,
2307
2201
  children: [
2308
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core4.Panel, { title: "Column", children: [
2309
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core4.FormField, { labelPlacement: "left", children: [
2310
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.FormFieldLabel, { children: "Hidden" }),
2311
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2202
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core4.Panel, { title: "Column", children: [
2203
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core4.FormField, { labelPlacement: "left", children: [
2204
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.FormFieldLabel, { children: "Hidden" }),
2205
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2312
2206
  import_core4.Checkbox,
2313
2207
  {
2314
2208
  checked: column.hidden === true,
@@ -2316,9 +2210,9 @@ var ColumnSettingsPanel = ({
2316
2210
  }
2317
2211
  )
2318
2212
  ] }),
2319
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core4.FormField, { labelPlacement: "left", children: [
2320
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.FormFieldLabel, { children: "Label" }),
2321
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2213
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core4.FormField, { labelPlacement: "left", children: [
2214
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.FormFieldLabel, { children: "Label" }),
2215
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2322
2216
  import_core4.Input,
2323
2217
  {
2324
2218
  value: (_a = column.label) != null ? _a : column.name,
@@ -2326,49 +2220,49 @@ var ColumnSettingsPanel = ({
2326
2220
  }
2327
2221
  )
2328
2222
  ] }),
2329
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core4.FormField, { labelPlacement: "left", children: [
2330
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.FormFieldLabel, { children: "Width" }),
2331
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2332
- import_lab5.StepperInput,
2223
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core4.FormField, { labelPlacement: "left", children: [
2224
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.FormFieldLabel, { children: "Width" }),
2225
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2226
+ import_lab4.StepperInput,
2333
2227
  {
2334
2228
  value: (_b = column.width) != null ? _b : 100,
2335
2229
  onChange: handleChangeWidth
2336
2230
  }
2337
2231
  )
2338
2232
  ] }),
2339
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core4.FormField, { labelPlacement: "left", children: [
2340
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.FormFieldLabel, { children: "ALign" }),
2341
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2233
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core4.FormField, { labelPlacement: "left", children: [
2234
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.FormFieldLabel, { children: "ALign" }),
2235
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2342
2236
  import_core4.RadioButtonGroup,
2343
2237
  {
2344
2238
  "aria-label": "Column Align",
2345
2239
  value: (_c = column.align) != null ? _c : "left",
2346
2240
  onChange: handleChangeAlign,
2347
2241
  children: [
2348
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.RadioButton, { label: "Left", value: "left" }),
2349
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.RadioButton, { label: "Right", value: "right" })
2242
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.RadioButton, { label: "Left", value: "left" }),
2243
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.RadioButton, { label: "Right", value: "right" })
2350
2244
  ]
2351
2245
  }
2352
2246
  )
2353
2247
  ] }),
2354
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core4.FormField, { labelPlacement: "left", children: [
2355
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.FormFieldLabel, { children: "Pin Column" }),
2356
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2248
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core4.FormField, { labelPlacement: "left", children: [
2249
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.FormFieldLabel, { children: "Pin Column" }),
2250
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2357
2251
  import_core4.RadioButtonGroup,
2358
2252
  {
2359
2253
  "aria-label": "Pin Column",
2360
2254
  value: (_d = column.pin) != null ? _d : "",
2361
2255
  onChange: handleChangePin,
2362
2256
  children: [
2363
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.RadioButton, { label: "Do not pin", value: "" }),
2364
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.RadioButton, { label: "Left", value: "left" }),
2365
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.RadioButton, { label: "Right", value: "right" })
2257
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.RadioButton, { label: "Do not pin", value: "" }),
2258
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.RadioButton, { label: "Left", value: "left" }),
2259
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.RadioButton, { label: "Right", value: "right" })
2366
2260
  ]
2367
2261
  }
2368
2262
  )
2369
2263
  ] })
2370
2264
  ] }),
2371
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2265
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2372
2266
  ColumnTypePanel,
2373
2267
  {
2374
2268
  column,
@@ -2376,14 +2270,14 @@ var ColumnSettingsPanel = ({
2376
2270
  title: "Data Cell"
2377
2271
  }
2378
2272
  ),
2379
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core4.Panel, { title: "Vuu", variant: "secondary", children: [
2380
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core4.FormField, { labelPlacement: "top", readOnly: true, children: [
2381
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.FormFieldLabel, { children: "Name" }),
2382
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.Input, { value: column.name })
2273
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core4.Panel, { title: "Vuu", variant: "secondary", children: [
2274
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core4.FormField, { labelPlacement: "top", readOnly: true, children: [
2275
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.FormFieldLabel, { children: "Name" }),
2276
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.Input, { value: column.name })
2383
2277
  ] }),
2384
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core4.FormField, { labelPlacement: "top", readOnly: true, children: [
2385
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.FormFieldLabel, { children: "Vuu Type" }),
2386
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.Input, { value: column.serverDataType })
2278
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core4.FormField, { labelPlacement: "top", readOnly: true, children: [
2279
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.FormFieldLabel, { children: "Vuu Type" }),
2280
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core4.Input, { value: column.serverDataType })
2387
2281
  ] })
2388
2282
  ] })
2389
2283
  ]
@@ -2396,10 +2290,10 @@ var ColumnSettingsPanel = ({
2396
2290
 
2397
2291
  // src/datagrid-configuration-ui/settings-panel/GridSettingsPanel.tsx
2398
2292
  var import_core5 = require("@salt-ds/core");
2399
- var import_lab6 = require("@salt-ds/lab");
2293
+ var import_lab5 = require("@salt-ds/lab");
2400
2294
  var import_react9 = require("react");
2401
- var import_jsx_runtime10 = require("react/jsx-runtime");
2402
- var classBase8 = "vuuGridSettingsPanel";
2295
+ var import_jsx_runtime9 = require("react/jsx-runtime");
2296
+ var classBase7 = "vuuGridSettingsPanel";
2403
2297
  var GridSettingsPanel = ({
2404
2298
  config,
2405
2299
  dispatchColumnAction,
@@ -2424,37 +2318,37 @@ var GridSettingsPanel = ({
2424
2318
  (value) => dispatchUpdate({ columnDefaultWidth: parseInt(value.toString(), 10) }),
2425
2319
  [dispatchUpdate]
2426
2320
  );
2427
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2321
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2428
2322
  "div",
2429
2323
  {
2430
- className: classBase8,
2324
+ className: classBase7,
2431
2325
  ...props,
2432
2326
  style: {
2433
2327
  ...styleProp
2434
2328
  },
2435
2329
  children: [
2436
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core5.Text, { as: "h4", children: "Grid Settings" }),
2437
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core5.Panel, { children: [
2438
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core5.FormField, { labelPlacement: "left", children: [
2439
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core5.FormFieldLabel, { children: "Format column labels" }),
2440
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2330
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core5.Text, { as: "h4", children: "Grid Settings" }),
2331
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core5.Panel, { children: [
2332
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core5.FormField, { labelPlacement: "left", children: [
2333
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core5.FormFieldLabel, { children: "Format column labels" }),
2334
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2441
2335
  import_core5.RadioButtonGroup,
2442
2336
  {
2443
2337
  "aria-label": "Format column labels",
2444
2338
  value: config.columnFormatHeader,
2445
2339
  onChange: handleChangeLabelFormatting,
2446
2340
  children: [
2447
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core5.RadioButton, { label: "No Formatting", value: void 0 }),
2448
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core5.RadioButton, { label: "Capitalize", value: "capitalize" }),
2449
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core5.RadioButton, { label: "Uppercase", value: "uppercase" })
2341
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core5.RadioButton, { label: "No Formatting", value: void 0 }),
2342
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core5.RadioButton, { label: "Capitalize", value: "capitalize" }),
2343
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core5.RadioButton, { label: "Uppercase", value: "uppercase" })
2450
2344
  ]
2451
2345
  }
2452
2346
  )
2453
2347
  ] }),
2454
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core5.FormField, { labelPlacement: "left", children: [
2455
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core5.FormFieldLabel, { children: "Default Column Width" }),
2456
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2457
- import_lab6.StepperInput,
2348
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core5.FormField, { labelPlacement: "left", children: [
2349
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core5.FormFieldLabel, { children: "Default Column Width" }),
2350
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2351
+ import_lab5.StepperInput,
2458
2352
  {
2459
2353
  value: (_a = config.columnDefaultWidth) != null ? _a : 100,
2460
2354
  onChange: handleChangeWidth
@@ -2469,7 +2363,7 @@ var GridSettingsPanel = ({
2469
2363
 
2470
2364
  // src/datagrid-configuration-ui/settings-panel/useGridSettings.ts
2471
2365
  var import_react10 = require("react");
2472
- var import_vuu_ui_controls = require("@vuu-ui/vuu-ui-controls");
2366
+ var import_vuu_ui_controls2 = require("@vuu-ui/vuu-ui-controls");
2473
2367
  var import_vuu_utils8 = require("@vuu-ui/vuu-utils");
2474
2368
  var gridSettingsReducer = (state, action) => {
2475
2369
  console.log(`gridSettingsReducer ${action.type}`);
@@ -2545,7 +2439,7 @@ function moveColumn(state, { column, moveBy, moveFrom, moveTo }) {
2545
2439
  } else if (typeof moveFrom === "number" && typeof moveTo === "number") {
2546
2440
  return {
2547
2441
  ...state,
2548
- columns: (0, import_vuu_ui_controls.moveItem)(stateColumns, moveFrom, moveTo)
2442
+ columns: (0, import_vuu_ui_controls2.moveItem)(stateColumns, moveFrom, moveTo)
2549
2443
  };
2550
2444
  } else {
2551
2445
  return state;
@@ -2630,7 +2524,7 @@ var import_vuu_layout2 = require("@vuu-ui/vuu-layout");
2630
2524
  // src/datagrid-configuration-ui/calculated-column-panel/CalculatedColumnPanel.tsx
2631
2525
  var import_core6 = require("@salt-ds/core");
2632
2526
  var import_react11 = require("react");
2633
- var import_jsx_runtime11 = require("react/jsx-runtime");
2527
+ var import_jsx_runtime10 = require("react/jsx-runtime");
2634
2528
  var CalculatedColumnPanel = ({
2635
2529
  columns,
2636
2530
  dispatchColumnAction,
@@ -2673,13 +2567,13 @@ var CalculatedColumnPanel = ({
2673
2567
  });
2674
2568
  }
2675
2569
  }, [columnName, dispatchColumnAction]);
2676
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core6.Panel, { className: "vuuCalculatedColumnPanel", title: "Define Computed Column", children: [
2677
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core6.Text, { styleAs: "h4", children: "Define Computed Column" }),
2678
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core6.FormField, { labelPlacement: "left", children: [
2679
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core6.FormFieldLabel, { children: "Column Name" }),
2680
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core6.Input, { value: columnName, onChange: handleChangeName })
2570
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core6.Panel, { className: "vuuCalculatedColumnPanel", title: "Define Computed Column", children: [
2571
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core6.Text, { styleAs: "h4", children: "Define Computed Column" }),
2572
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core6.FormField, { labelPlacement: "left", children: [
2573
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core6.FormFieldLabel, { children: "Column Name" }),
2574
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core6.Input, { value: columnName, onChange: handleChangeName })
2681
2575
  ] }),
2682
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2576
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2683
2577
  ColumnExpressionInput,
2684
2578
  {
2685
2579
  onChange: handleChangeExpression,
@@ -2687,13 +2581,13 @@ var CalculatedColumnPanel = ({
2687
2581
  suggestionProvider
2688
2582
  }
2689
2583
  ),
2690
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core6.Button, { onClick: handleSave, children: "Add Column" }) })
2584
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core6.Button, { onClick: handleSave, children: "Add Column" }) })
2691
2585
  ] });
2692
2586
  };
2693
2587
 
2694
2588
  // src/datagrid-configuration-ui/settings-panel/DatagridSettingsPanel.tsx
2695
- var import_jsx_runtime12 = require("react/jsx-runtime");
2696
- var classBase9 = "vuuDatagridSettingsPanel";
2589
+ var import_jsx_runtime11 = require("react/jsx-runtime");
2590
+ var classBase8 = "vuuDatagridSettingsPanel";
2697
2591
  var getTabLabel = () => void 0;
2698
2592
  var icons = [
2699
2593
  "table-settings",
@@ -2738,7 +2632,7 @@ var DatagridSettingsPanel = ({
2738
2632
  [handleApply]
2739
2633
  );
2740
2634
  const selectedColumn = selectedColumnName === null ? null : (_a = gridSettings.columns.find((col) => col.name === selectedColumnName)) != null ? _a : null;
2741
- const tabstripProps3 = {
2635
+ const tabstripProps2 = {
2742
2636
  activeTabIndex: selectedTabIndex,
2743
2637
  allowRenameTab: false,
2744
2638
  orientation: "vertical"
@@ -2748,47 +2642,34 @@ var DatagridSettingsPanel = ({
2748
2642
  []
2749
2643
  );
2750
2644
  const panelShift = selectedTabIndex === 2 ? "right" : void 0;
2751
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { ...props, className: (0, import_classnames6.default)(classBase9, className), children: [
2752
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2645
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { ...props, className: (0, import_classnames6.default)(classBase8, className), children: [
2646
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2753
2647
  import_vuu_layout2.Stack,
2754
2648
  {
2755
- TabstripProps: tabstripProps3,
2756
- className: `${classBase9}-stack`,
2649
+ TabstripProps: tabstripProps2,
2650
+ className: `${classBase8}-stack`,
2757
2651
  getTabIcon,
2758
2652
  getTabLabel,
2759
2653
  active: selectedTabIndex === 2 ? 1 : selectedTabIndex,
2760
2654
  onTabSelectionChanged: handleTabSelectionChanged,
2761
2655
  children: [
2762
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2656
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2763
2657
  GridSettingsPanel,
2764
2658
  {
2765
2659
  config: gridSettings,
2766
2660
  dispatchColumnAction
2767
2661
  }
2768
2662
  ),
2769
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `${classBase9}-columnPanels`, "data-align": panelShift, children: [
2770
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2771
- ColumnPicker,
2772
- {
2773
- availableColumns,
2774
- chosenColumns: gridSettings.columns,
2775
- dispatchColumnAction,
2776
- onSelectionChange: handleColumnSelected,
2777
- onAddCalculatedColumnClick: handleAddCalculatedColumn,
2778
- selectedColumn
2779
- }
2780
- ),
2781
- selectedColumn === null ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core7.Panel, { className: "vuuColumnSettingsPanel", children: "Select a column" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2782
- ColumnSettingsPanel,
2783
- {
2784
- column: selectedColumn,
2785
- dispatchColumnAction,
2786
- style: { background: "white", flex: "1 0 150px" }
2787
- }
2788
- )
2789
- ] }),
2790
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { title: "Column Settings", children: "Column Settings" }),
2791
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2663
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: `${classBase8}-columnPanels`, "data-align": panelShift, children: selectedColumn === null ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core7.Panel, { className: "vuuColumnSettingsPanel", children: "Select a column" }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2664
+ ColumnSettingsPanel,
2665
+ {
2666
+ column: selectedColumn,
2667
+ dispatchColumnAction,
2668
+ style: { background: "white", flex: "1 0 150px" }
2669
+ }
2670
+ ) }),
2671
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { title: "Column Settings", children: "Column Settings" }),
2672
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2792
2673
  CalculatedColumnPanel,
2793
2674
  {
2794
2675
  columns: gridSettings.columns,
@@ -2799,10 +2680,10 @@ var DatagridSettingsPanel = ({
2799
2680
  ]
2800
2681
  }
2801
2682
  ),
2802
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `${classBase9}-buttonBar`, children: [
2803
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core7.Button, { onClick: onCancel, children: "Cancel" }),
2804
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core7.Button, { onClick: handleApply, children: "Apply" }),
2805
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core7.Button, { onClick: handleSave, children: "Save" })
2683
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: `${classBase8}-buttonBar`, children: [
2684
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core7.Button, { onClick: onCancel, children: "Cancel" }),
2685
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core7.Button, { onClick: handleApply, children: "Apply" }),
2686
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core7.Button, { onClick: handleSave, children: "Save" })
2806
2687
  ] })
2807
2688
  ] });
2808
2689
  };
@@ -2810,8 +2691,8 @@ var DatagridSettingsPanel = ({
2810
2691
  // src/datasource-stats/DatasourceStats.tsx
2811
2692
  var import_react13 = require("react");
2812
2693
  var import_classnames7 = __toESM(require("classnames"), 1);
2813
- var import_jsx_runtime13 = require("react/jsx-runtime");
2814
- var classBase10 = "vuuDatasourceStats";
2694
+ var import_jsx_runtime12 = require("react/jsx-runtime");
2695
+ var classBase9 = "vuuDatasourceStats";
2815
2696
  var numberFormatter = new Intl.NumberFormat();
2816
2697
  var DataSourceStats = ({
2817
2698
  className: classNameProp,
@@ -2824,350 +2705,849 @@ var DataSourceStats = ({
2824
2705
  dataSource.on("resize", setSize);
2825
2706
  dataSource.on("range", setRange);
2826
2707
  }, [dataSource]);
2827
- const className = (0, import_classnames7.default)(classBase10, classNameProp);
2708
+ const className = (0, import_classnames7.default)(classBase9, classNameProp);
2828
2709
  const from = numberFormatter.format(range.from);
2829
2710
  const to = numberFormatter.format(range.to - 1);
2830
2711
  const value = numberFormatter.format(size);
2831
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className, children: [
2832
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Showing rows" }),
2833
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: `${classBase10}-range`, children: from }),
2834
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: `${classBase10}-range`, children: to }),
2835
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "of" }),
2836
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: `${classBase10}-size`, children: value })
2712
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className, children: [
2713
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "Showing rows" }),
2714
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: `${classBase9}-range`, children: from }),
2715
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: `${classBase9}-range`, children: to }),
2716
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "of" }),
2717
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: `${classBase9}-size`, children: value })
2837
2718
  ] });
2838
2719
  };
2839
2720
 
2840
- // src/table-settings/column-settings-panel/ColumnSettingsPanel.tsx
2841
- var import_vuu_layout3 = require("@vuu-ui/vuu-layout");
2842
- var import_lab9 = require("@salt-ds/lab");
2843
- var import_core10 = require("@salt-ds/core");
2844
- var import_classnames9 = __toESM(require("classnames"), 1);
2845
- var import_react16 = require("react");
2721
+ // src/table-settings/TableSettingsPanel.tsx
2722
+ var import_core9 = require("@salt-ds/core");
2723
+
2724
+ // src/table-settings/useTableSettings.ts
2725
+ var import_vuu_layout4 = require("@vuu-ui/vuu-layout");
2846
2726
 
2847
- // src/table-settings/column-type-panel/ColumnTypePanel.tsx
2727
+ // ../vuu-table/src/table/ColumnResizer.tsx
2728
+ var import_react14 = require("react");
2729
+ var import_jsx_runtime13 = require("react/jsx-runtime");
2730
+
2731
+ // ../vuu-table/src/table/context-menu/buildContextMenuDescriptors.ts
2848
2732
  var import_vuu_utils9 = require("@vuu-ui/vuu-utils");
2849
- var import_lab8 = require("@salt-ds/lab");
2850
- var import_core9 = require("@salt-ds/core");
2851
- var import_classnames8 = __toESM(require("classnames"), 1);
2852
- var import_react15 = require("react");
2853
2733
 
2854
- // src/table-settings/column-type-panel/NumericColumnPanel.tsx
2855
- var import_lab7 = require("@salt-ds/lab");
2734
+ // ../vuu-table/src/table/context-menu/useTableContextMenu.ts
2735
+ var import_vuu_utils10 = require("@vuu-ui/vuu-utils");
2736
+ var import_vuu_utils11 = require("@vuu-ui/vuu-utils");
2737
+ var { Average, Count, Distinct, High, Low, Sum } = import_vuu_utils11.AggregationType;
2738
+
2739
+ // ../vuu-table/src/table/Table.tsx
2740
+ var import_vuu_popups4 = require("@vuu-ui/vuu-popups");
2856
2741
  var import_core8 = require("@salt-ds/core");
2857
- var import_react14 = require("react");
2742
+
2743
+ // ../vuu-table/src/table/RowBasedTable.tsx
2744
+ var import_vuu_utils15 = require("@vuu-ui/vuu-utils");
2745
+ var import_react22 = require("react");
2746
+
2747
+ // ../vuu-table/src/table/TableRow.tsx
2748
+ var import_vuu_utils14 = require("@vuu-ui/vuu-utils");
2749
+ var import_classnames9 = __toESM(require("classnames"));
2750
+ var import_react17 = require("react");
2751
+
2752
+ // ../vuu-table/src/table/TableCell.tsx
2753
+ var import_vuu_utils12 = require("@vuu-ui/vuu-utils");
2754
+ var import_vuu_ui_controls3 = require("@vuu-ui/vuu-ui-controls");
2755
+ var import_classnames8 = __toESM(require("classnames"));
2756
+ var import_react15 = require("react");
2858
2757
  var import_jsx_runtime14 = require("react/jsx-runtime");
2859
- var defaultValues2 = {
2860
- alignOnDecimals: false,
2861
- decimals: 4,
2862
- zeroPad: false
2863
- };
2864
- var getColumnValues2 = (columnType, gridDefaultValues) => {
2865
- const columnValue = typeof columnType === "object" && columnType.formatting ? columnType.formatting : {};
2866
- const properties = ["alignOnDecimals", "decimals", "zeroPad"];
2867
- return properties.reduce((configValues, property) => {
2868
- if (columnValue[property] !== void 0) {
2869
- return {
2870
- ...configValues,
2871
- [property]: columnValue[property]
2872
- };
2873
- } else if ((gridDefaultValues == null ? void 0 : gridDefaultValues[property]) !== void 0) {
2874
- return {
2875
- ...configValues,
2876
- [property]: gridDefaultValues[property]
2877
- };
2878
- }
2879
- return configValues;
2880
- }, defaultValues2);
2881
- };
2882
- var NumericColumnPanel2 = ({
2883
- column,
2884
- dispatchColumnAction
2885
- }) => {
2886
- const { decimals, alignOnDecimals, zeroPad } = getColumnValues2(column == null ? void 0 : column.type);
2887
- const dispatchUpdate = (0, import_react14.useCallback)(
2888
- (values) => dispatchColumnAction({
2889
- type: "updateColumnTypeFormatting",
2890
- column,
2891
- ...values
2892
- }),
2893
- [column, dispatchColumnAction]
2894
- );
2895
- const handleChangeDecimals = (0, import_react14.useCallback)(
2896
- (value) => dispatchUpdate({ decimals: parseInt(value.toString(), 10) }),
2897
- [dispatchUpdate]
2898
- );
2899
- const handleChangeAlignOnDecimals = (0, import_react14.useCallback)(
2900
- (evt, value) => dispatchUpdate({ alignOnDecimals: value }),
2901
- [dispatchUpdate]
2902
- );
2903
- const handleChangeZeroPad = (0, import_react14.useCallback)(
2904
- (evt, value) => dispatchUpdate({ zeroPad: value }),
2905
- [dispatchUpdate]
2906
- );
2907
- switch (column.serverDataType) {
2908
- case "double":
2909
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2910
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_core8.FormField, { labelPlacement: "top", children: [
2911
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core8.FormFieldLabel, { children: "No of Decimals" }),
2912
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lab7.StepperInput, { value: decimals, onChange: handleChangeDecimals })
2913
- ] }),
2914
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2915
- import_lab7.Switch,
2916
- {
2917
- checked: alignOnDecimals,
2918
- label: "Align on decimals",
2919
- LabelProps: { className: "vuuColumnPanelSwitch" },
2920
- onChange: handleChangeAlignOnDecimals
2921
- }
2922
- ),
2923
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2924
- import_lab7.Switch,
2758
+ var { KEY: KEY2 } = import_vuu_utils12.metadataKeys;
2759
+ var TableCell = (0, import_react15.memo)(
2760
+ ({
2761
+ className: classNameProp,
2762
+ column,
2763
+ columnMap,
2764
+ onClick,
2765
+ row
2766
+ }) => {
2767
+ const labelFieldRef = (0, import_react15.useRef)(null);
2768
+ const {
2769
+ align,
2770
+ CellRenderer,
2771
+ key,
2772
+ pin,
2773
+ editable,
2774
+ resizing,
2775
+ valueFormatter
2776
+ } = column;
2777
+ const [editing, setEditing] = (0, import_react15.useState)(false);
2778
+ const value = valueFormatter(row[key]);
2779
+ const [editableValue, setEditableValue] = (0, import_react15.useState)(value);
2780
+ const handleTitleMouseDown = () => {
2781
+ var _a;
2782
+ (_a = labelFieldRef.current) == null ? void 0 : _a.focus();
2783
+ };
2784
+ const handleTitleKeyDown = (evt) => {
2785
+ if (evt.key === "Enter") {
2786
+ setEditing(true);
2787
+ }
2788
+ };
2789
+ const handleClick = (0, import_react15.useCallback)(
2790
+ (evt) => {
2791
+ onClick == null ? void 0 : onClick(evt, column);
2792
+ },
2793
+ [column, onClick]
2794
+ );
2795
+ const handleEnterEditMode = () => {
2796
+ setEditing(true);
2797
+ };
2798
+ const handleExitEditMode = (originalValue = "", finalValue = "", allowDeactivation = true, editCancelled = false) => {
2799
+ var _a;
2800
+ setEditing(false);
2801
+ if (editCancelled) {
2802
+ setEditableValue(originalValue);
2803
+ } else if (finalValue !== originalValue) {
2804
+ setEditableValue(finalValue);
2805
+ }
2806
+ if (allowDeactivation === false) {
2807
+ (_a = labelFieldRef.current) == null ? void 0 : _a.focus();
2808
+ }
2809
+ };
2810
+ const className = (0, import_classnames8.default)(classNameProp, {
2811
+ vuuAlignRight: align === "right",
2812
+ vuuPinFloating: pin === "floating",
2813
+ vuuPinLeft: pin === "left",
2814
+ vuuPinRight: pin === "right",
2815
+ "vuuTableCell-resizing": resizing
2816
+ }) || void 0;
2817
+ const style = (0, import_vuu_utils12.getColumnStyle)(column);
2818
+ return editable ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2819
+ "div",
2820
+ {
2821
+ className,
2822
+ "data-editable": true,
2823
+ role: "cell",
2824
+ style,
2825
+ onKeyDown: handleTitleKeyDown,
2826
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2827
+ import_vuu_ui_controls3.EditableLabel,
2925
2828
  {
2926
- checked: zeroPad,
2927
- label: "Zero pad",
2928
- LabelProps: { className: "vuuColumnPanelSwitch" },
2929
- onChange: handleChangeZeroPad
2930
- }
2829
+ editing,
2830
+ value: editableValue,
2831
+ onChange: setEditableValue,
2832
+ onMouseDownCapture: handleTitleMouseDown,
2833
+ onEnterEditMode: handleEnterEditMode,
2834
+ onExitEditMode: handleExitEditMode,
2835
+ onKeyDown: handleTitleKeyDown,
2836
+ ref: labelFieldRef,
2837
+ tabIndex: 0
2838
+ },
2839
+ "title"
2931
2840
  )
2932
- ] });
2933
- case "long":
2934
- case "int":
2935
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core8.Text, { children: "Work in progress" }) });
2936
- default:
2937
- return null;
2938
- }
2939
- };
2841
+ }
2842
+ ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2843
+ "div",
2844
+ {
2845
+ className,
2846
+ role: "cell",
2847
+ style,
2848
+ onClick: handleClick,
2849
+ children: CellRenderer ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CellRenderer, { column, columnMap, row }) : value
2850
+ }
2851
+ );
2852
+ },
2853
+ cellValuesAreEqual
2854
+ );
2855
+ TableCell.displayName = "TableCell";
2856
+ function cellValuesAreEqual(prev, next) {
2857
+ 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];
2858
+ }
2940
2859
 
2941
- // src/table-settings/column-type-panel/StringColumnPanel.tsx
2860
+ // ../vuu-table/src/table/TableGroupCell.tsx
2861
+ var import_vuu_utils13 = require("@vuu-ui/vuu-utils");
2862
+ var import_react16 = require("react");
2942
2863
  var import_jsx_runtime15 = require("react/jsx-runtime");
2943
- var StringColumnPanel2 = ({
2944
- column,
2945
- dispatchColumnAction
2946
- }) => {
2947
- console.log(column, dispatchColumnAction);
2948
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: "what" });
2864
+ var { IS_LEAF } = import_vuu_utils13.metadataKeys;
2865
+ var TableGroupCell = ({ column, onClick, row }) => {
2866
+ const { columns } = column;
2867
+ const [value, offset] = (0, import_vuu_utils13.getGroupValueAndOffset)(columns, row);
2868
+ const handleClick = (0, import_react16.useCallback)(
2869
+ (evt) => {
2870
+ onClick == null ? void 0 : onClick(evt, column);
2871
+ },
2872
+ [column, onClick]
2873
+ );
2874
+ const style = (0, import_vuu_utils13.getColumnStyle)(column);
2875
+ const isLeaf = row[IS_LEAF];
2876
+ const spacers = Array(offset).fill(0).map((n, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "vuuTableGroupCell-spacer" }, i));
2877
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2878
+ "div",
2879
+ {
2880
+ className: "vuuTableGroupCell vuuPinLeft",
2881
+ onClick: isLeaf ? void 0 : handleClick,
2882
+ role: "cell",
2883
+ style,
2884
+ children: [
2885
+ spacers,
2886
+ isLeaf ? null : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "vuuTableGroupCell-toggle", "data-icon": "triangle-right" }),
2887
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: value })
2888
+ ]
2889
+ }
2890
+ );
2949
2891
  };
2950
2892
 
2951
- // src/table-settings/column-type-panel/ColumnTypePanel.tsx
2893
+ // ../vuu-table/src/table/TableRow.tsx
2952
2894
  var import_jsx_runtime16 = require("react/jsx-runtime");
2953
- var classBase11 = "vuuColumnTypePanel";
2954
- var integerCellRenderers2 = ["Default Renderer (int, long)"];
2955
- var doubleCellRenderers2 = ["Default Renderer (double)"];
2956
- var stringCellRenderers2 = ["Default Renderer (string)"];
2957
- var getAvailableCellRenderers2 = (column) => {
2958
- const customCellRenderers = (0, import_vuu_utils9.getRegisteredCellRenderers)(column.serverDataType);
2959
- const customRendererNames = customCellRenderers.map((r) => r.name);
2960
- console.log({ customRendererNames });
2961
- switch (column.serverDataType) {
2962
- case "char":
2963
- case "string":
2964
- return stringCellRenderers2;
2965
- case "int":
2966
- case "long":
2967
- return integerCellRenderers2;
2968
- case "double":
2969
- return doubleCellRenderers2.concat(customRendererNames);
2970
- default:
2971
- return stringCellRenderers2;
2895
+ var { IDX, IS_EXPANDED, SELECTED } = import_vuu_utils14.metadataKeys;
2896
+ var classBase10 = "vuuTableRow";
2897
+ var TableRow = (0, import_react17.memo)(function Row({
2898
+ columnMap,
2899
+ columns,
2900
+ offset,
2901
+ onClick,
2902
+ onToggleGroup,
2903
+ virtualColSpan = 0,
2904
+ row
2905
+ }) {
2906
+ const {
2907
+ [IDX]: rowIndex,
2908
+ [IS_EXPANDED]: isExpanded,
2909
+ [SELECTED]: isSelected
2910
+ } = row;
2911
+ const className = (0, import_classnames9.default)(classBase10, {
2912
+ [`${classBase10}-even`]: rowIndex % 2 === 0,
2913
+ [`${classBase10}-expanded`]: isExpanded,
2914
+ [`${classBase10}-preSelected`]: isSelected === 2
2915
+ });
2916
+ const handleRowClick = (0, import_react17.useCallback)(
2917
+ (evt) => {
2918
+ const rangeSelect = evt.shiftKey;
2919
+ const keepExistingSelection = evt.ctrlKey || evt.metaKey;
2920
+ onClick == null ? void 0 : onClick(row, rangeSelect, keepExistingSelection);
2921
+ },
2922
+ [onClick, row]
2923
+ );
2924
+ const handleGroupCellClick = (0, import_react17.useCallback)(
2925
+ (evt, column) => {
2926
+ if ((0, import_vuu_utils14.isGroupColumn)(column) || (0, import_vuu_utils14.isJsonGroup)(column, row)) {
2927
+ evt.stopPropagation();
2928
+ onToggleGroup == null ? void 0 : onToggleGroup(row, column);
2929
+ }
2930
+ },
2931
+ [onToggleGroup, row]
2932
+ );
2933
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2934
+ "div",
2935
+ {
2936
+ "aria-selected": isSelected === 1 ? true : void 0,
2937
+ "aria-rowindex": rowIndex,
2938
+ className,
2939
+ onClick: handleRowClick,
2940
+ role: "row",
2941
+ style: {
2942
+ transform: `translate3d(0px, ${offset}px, 0px)`
2943
+ },
2944
+ children: [
2945
+ virtualColSpan > 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { role: "cell", style: { width: virtualColSpan } }) : null,
2946
+ columns.filter(import_vuu_utils14.notHidden).map((column) => {
2947
+ const isGroup = (0, import_vuu_utils14.isGroupColumn)(column);
2948
+ const isJsonCell = (0, import_vuu_utils14.isJsonColumn)(column);
2949
+ const Cell = isGroup ? TableGroupCell : TableCell;
2950
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2951
+ Cell,
2952
+ {
2953
+ column,
2954
+ columnMap,
2955
+ onClick: isGroup || isJsonCell ? handleGroupCellClick : void 0,
2956
+ row
2957
+ },
2958
+ column.name
2959
+ );
2960
+ })
2961
+ ]
2962
+ }
2963
+ );
2964
+ });
2965
+
2966
+ // ../vuu-table/src/table/TableGroupHeaderCell.tsx
2967
+ var import_classnames10 = __toESM(require("classnames"));
2968
+ var import_react19 = require("react");
2969
+
2970
+ // ../vuu-table/src/table/useTableColumnResize.tsx
2971
+ var import_react18 = require("react");
2972
+
2973
+ // ../vuu-table/src/table/TableGroupHeaderCell.tsx
2974
+ var import_jsx_runtime17 = require("react/jsx-runtime");
2975
+
2976
+ // ../vuu-table/src/table/TableHeaderCell.tsx
2977
+ var import_classnames13 = __toESM(require("classnames"));
2978
+ var import_react21 = require("react");
2979
+
2980
+ // ../vuu-table/src/table/SortIndicator.tsx
2981
+ var import_classnames11 = __toESM(require("classnames"));
2982
+ var import_jsx_runtime18 = require("react/jsx-runtime");
2983
+
2984
+ // ../vuu-table/src/table/TableHeaderCell.tsx
2985
+ var import_vuu_popups2 = require("@vuu-ui/vuu-popups");
2986
+
2987
+ // ../vuu-table/src/table/filter-indicator.tsx
2988
+ var import_vuu_popups = require("@vuu-ui/vuu-popups");
2989
+ var import_classnames12 = __toESM(require("classnames"));
2990
+ var import_react20 = require("react");
2991
+ var import_jsx_runtime19 = require("react/jsx-runtime");
2992
+
2993
+ // ../vuu-table/src/table/TableHeaderCell.tsx
2994
+ var import_jsx_runtime20 = require("react/jsx-runtime");
2995
+
2996
+ // ../vuu-table/src/table/RowBasedTable.tsx
2997
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2998
+ var { RENDER_IDX } = import_vuu_utils15.metadataKeys;
2999
+
3000
+ // ../vuu-table/src/table/useTable.ts
3001
+ var import_vuu_popups3 = require("@vuu-ui/vuu-popups");
3002
+ var import_vuu_utils23 = require("@vuu-ui/vuu-utils");
3003
+ var import_react33 = require("react");
3004
+
3005
+ // ../vuu-table/src/table/useDataSource.ts
3006
+ var import_vuu_data_react2 = require("@vuu-ui/vuu-data-react");
3007
+ var import_vuu_utils16 = require("@vuu-ui/vuu-utils");
3008
+ var import_react23 = require("react");
3009
+ var { SELECTED: SELECTED2 } = import_vuu_utils16.metadataKeys;
3010
+
3011
+ // ../vuu-table/src/table/useDraggableColumn.ts
3012
+ var import_vuu_ui_controls4 = require("@vuu-ui/vuu-ui-controls");
3013
+ var import_react24 = require("react");
3014
+
3015
+ // ../vuu-table/src/table/useKeyboardNavigation.ts
3016
+ var import_vuu_utils17 = require("@vuu-ui/vuu-utils");
3017
+ var import_react25 = require("react");
3018
+
3019
+ // ../vuu-table/src/table/keyUtils.ts
3020
+ function union(set1, ...sets) {
3021
+ const result = new Set(set1);
3022
+ for (let set of sets) {
3023
+ for (let element of set) {
3024
+ result.add(element);
3025
+ }
2972
3026
  }
2973
- };
2974
- var ColumnTypePanel2 = ({
2975
- className,
2976
- column,
2977
- dispatchColumnAction,
2978
- ...props
2979
- }) => {
2980
- const content = (0, import_react15.useMemo)(() => {
2981
- switch (column.serverDataType) {
2982
- case "double":
2983
- case "int":
2984
- case "long":
2985
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2986
- NumericColumnPanel2,
2987
- {
2988
- column,
2989
- dispatchColumnAction
2990
- }
2991
- );
2992
- default:
2993
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2994
- StringColumnPanel2,
2995
- {
2996
- column,
2997
- dispatchColumnAction
2998
- }
3027
+ return result;
3028
+ }
3029
+ var ArrowUp = "ArrowUp";
3030
+ var ArrowDown = "ArrowDown";
3031
+ var ArrowLeft = "ArrowLeft";
3032
+ var ArrowRight = "ArrowRight";
3033
+ var Home = "Home";
3034
+ var End = "End";
3035
+ var PageUp = "PageUp";
3036
+ var PageDown = "PageDown";
3037
+ var actionKeys = /* @__PURE__ */ new Set(["Enter", "Delete", " "]);
3038
+ var focusKeys = /* @__PURE__ */ new Set(["Tab"]);
3039
+ var arrowLeftRightKeys = /* @__PURE__ */ new Set(["ArrowRight", "ArrowLeft"]);
3040
+ var navigationKeys = /* @__PURE__ */ new Set([
3041
+ Home,
3042
+ End,
3043
+ PageUp,
3044
+ PageDown,
3045
+ ArrowDown,
3046
+ ArrowLeft,
3047
+ ArrowRight,
3048
+ ArrowUp
3049
+ ]);
3050
+ var functionKeys = /* @__PURE__ */ new Set([
3051
+ "F1",
3052
+ "F2",
3053
+ "F3",
3054
+ "F4",
3055
+ "F5",
3056
+ "F6",
3057
+ "F7",
3058
+ "F8",
3059
+ "F9",
3060
+ "F10",
3061
+ "F11",
3062
+ "F12"
3063
+ ]);
3064
+ var specialKeys = union(
3065
+ actionKeys,
3066
+ navigationKeys,
3067
+ arrowLeftRightKeys,
3068
+ functionKeys,
3069
+ focusKeys
3070
+ );
3071
+
3072
+ // ../vuu-table/src/table/useMeasuredContainer.ts
3073
+ var import_vuu_utils18 = require("@vuu-ui/vuu-utils");
3074
+ var import_react27 = require("react");
3075
+
3076
+ // ../vuu-table/src/table/useResizeObserver.ts
3077
+ var import_react26 = require("react");
3078
+ var observedMap = /* @__PURE__ */ new Map();
3079
+ var getTargetSize = (element, size, dimension) => {
3080
+ switch (dimension) {
3081
+ case "height":
3082
+ return size.height;
3083
+ case "clientHeight":
3084
+ return element.clientHeight;
3085
+ case "clientWidth":
3086
+ return element.clientWidth;
3087
+ case "contentHeight":
3088
+ return size.contentHeight;
3089
+ case "contentWidth":
3090
+ return size.contentWidth;
3091
+ case "scrollHeight":
3092
+ return Math.ceil(element.scrollHeight);
3093
+ case "scrollWidth":
3094
+ return Math.ceil(element.scrollWidth);
3095
+ case "width":
3096
+ return size.width;
3097
+ default:
3098
+ return 0;
3099
+ }
3100
+ };
3101
+ var resizeObserver = new ResizeObserver((entries) => {
3102
+ for (const entry of entries) {
3103
+ const { target, borderBoxSize, contentBoxSize } = entry;
3104
+ const observedTarget = observedMap.get(target);
3105
+ if (observedTarget) {
3106
+ const [{ blockSize: height, inlineSize: width }] = borderBoxSize;
3107
+ const [{ blockSize: contentHeight, inlineSize: contentWidth }] = contentBoxSize;
3108
+ const { onResize, measurements } = observedTarget;
3109
+ let sizeChanged = false;
3110
+ for (const [dimension, size] of Object.entries(measurements)) {
3111
+ const newSize = getTargetSize(
3112
+ target,
3113
+ { height, width, contentHeight, contentWidth },
3114
+ dimension
2999
3115
  );
3000
- }
3001
- }, [column, dispatchColumnAction]);
3002
- const { serverDataType = "string" } = column;
3003
- const availableRenderers = getAvailableCellRenderers2(column);
3004
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
3005
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3006
- import_lab8.Dropdown,
3007
- {
3008
- className: (0, import_classnames8.default)(`${classBase11}-renderer`),
3009
- fullWidth: true,
3010
- selected: availableRenderers[0],
3011
- source: availableRenderers
3116
+ if (newSize !== size) {
3117
+ sizeChanged = true;
3118
+ measurements[dimension] = newSize;
3119
+ }
3012
3120
  }
3013
- ),
3014
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3015
- import_core9.Panel,
3016
- {
3017
- ...props,
3018
- className: (0, import_classnames8.default)(classBase11, className, `${classBase11}-${serverDataType}`),
3019
- children: content
3121
+ if (sizeChanged) {
3122
+ onResize && onResize(measurements);
3020
3123
  }
3021
- )
3022
- ] });
3124
+ }
3125
+ }
3126
+ });
3127
+
3128
+ // ../vuu-table/src/table/useSelection.ts
3129
+ var import_vuu_utils19 = require("@vuu-ui/vuu-utils");
3130
+ var import_react28 = require("react");
3131
+ var { IDX: IDX2 } = import_vuu_utils19.metadataKeys;
3132
+
3133
+ // ../vuu-table/src/table/useTableModel.ts
3134
+ var import_vuu_utils20 = require("@vuu-ui/vuu-utils");
3135
+ var import_react29 = require("react");
3136
+ var KEY_OFFSET = import_vuu_utils20.metadataKeys.count;
3137
+
3138
+ // ../vuu-table/src/table/useTableScroll.ts
3139
+ var import_react30 = require("react");
3140
+
3141
+ // ../vuu-table/src/table/useTableViewport.ts
3142
+ var import_react31 = require("react");
3143
+ var import_vuu_utils21 = require("@vuu-ui/vuu-utils");
3144
+
3145
+ // ../vuu-table/src/table/useVirtualViewport.ts
3146
+ var import_vuu_utils22 = require("@vuu-ui/vuu-utils");
3147
+ var import_react32 = require("react");
3148
+
3149
+ // ../vuu-table/src/table/useTable.ts
3150
+ var { KEY: KEY3, IS_EXPANDED: IS_EXPANDED2, IS_LEAF: IS_LEAF2 } = import_vuu_utils23.metadataKeys;
3151
+
3152
+ // ../vuu-table/src/table/Table.tsx
3153
+ var import_classnames14 = __toESM(require("classnames"));
3154
+ var import_vuu_utils24 = require("@vuu-ui/vuu-utils");
3155
+ var import_jsx_runtime22 = require("react/jsx-runtime");
3156
+
3157
+ // ../vuu-table/src/table/cell-renderers/json-cell/JsonCell.tsx
3158
+ var import_classnames15 = __toESM(require("classnames"));
3159
+ var import_vuu_utils25 = require("@vuu-ui/vuu-utils");
3160
+ var import_jsx_runtime23 = require("react/jsx-runtime");
3161
+ var classBase11 = "vuuJsonCell";
3162
+ var { IS_EXPANDED: IS_EXPANDED3, KEY: KEY4 } = import_vuu_utils25.metadataKeys;
3163
+ var localKey = (key) => {
3164
+ const pos = key.lastIndexOf("|");
3165
+ if (pos === -1) {
3166
+ return "";
3167
+ } else {
3168
+ return key.slice(pos + 1);
3169
+ }
3170
+ };
3171
+ var JsonCell = ({ column, row }) => {
3172
+ const {
3173
+ key: columnKey
3174
+ /*, type, valueFormatter */
3175
+ } = column;
3176
+ let value = row[columnKey];
3177
+ let isToggle = false;
3178
+ if ((0, import_vuu_utils25.isJsonAttribute)(value)) {
3179
+ value = value.slice(0, -1);
3180
+ isToggle = true;
3181
+ }
3182
+ const rowKey = localKey(row[KEY4]);
3183
+ const className = (0, import_classnames15.default)({
3184
+ [`${classBase11}-name`]: rowKey === value,
3185
+ [`${classBase11}-value`]: rowKey !== value,
3186
+ [`${classBase11}-group`]: isToggle
3187
+ });
3188
+ if (isToggle) {
3189
+ const toggleIcon = row[IS_EXPANDED3] ? "minus-box" : "plus-box";
3190
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className, children: [
3191
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: `${classBase11}-value`, children: value }),
3192
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: `${classBase11}-toggle`, "data-icon": toggleIcon })
3193
+ ] });
3194
+ } else if (value) {
3195
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className, children: value });
3196
+ } else {
3197
+ return null;
3198
+ }
3023
3199
  };
3200
+ (0, import_vuu_utils25.registerComponent)("json", JsonCell, "cell-renderer", {});
3024
3201
 
3025
- // src/table-settings/column-settings-panel/ColumnSettingsPanel.tsx
3026
- var import_jsx_runtime17 = require("react/jsx-runtime");
3027
- var classBase12 = "vuuColumnSettingsPanel";
3028
- var tabstripProps2 = {
3029
- className: "salt-density-high"
3202
+ // ../vuu-table/src/table-next/TableNext.tsx
3203
+ var import_vuu_popups7 = require("@vuu-ui/vuu-popups");
3204
+ var import_vuu_utils31 = require("@vuu-ui/vuu-utils");
3205
+
3206
+ // ../vuu-table/src/table-next/HeaderCell.tsx
3207
+ var import_react38 = require("react");
3208
+
3209
+ // ../vuu-table/src/table-next/useCell.ts
3210
+ var import_vuu_utils26 = require("@vuu-ui/vuu-utils");
3211
+ var import_classnames16 = __toESM(require("classnames"));
3212
+ var import_react34 = require("react");
3213
+ var useCell = (column, classBase14, isHeader) => (
3214
+ // TODO measure perf without the memo, might not be worth the cost
3215
+ (0, import_react34.useMemo)(() => {
3216
+ const className = (0, import_classnames16.default)(classBase14, {
3217
+ vuuPinFloating: column.pin === "floating",
3218
+ vuuPinLeft: column.pin === "left",
3219
+ vuuPinRight: column.pin === "right",
3220
+ vuuEndPin: isHeader && column.endPin,
3221
+ [`${classBase14}-resizing`]: column.resizing,
3222
+ [`${classBase14}-right`]: column.align === "right"
3223
+ });
3224
+ const style = (0, import_vuu_utils26.getColumnStyle)(column);
3225
+ return {
3226
+ className,
3227
+ style
3228
+ };
3229
+ }, [column, classBase14, isHeader])
3230
+ );
3231
+
3232
+ // ../vuu-table/src/table-next/ColumnMenu.tsx
3233
+ var import_vuu_popups5 = require("@vuu-ui/vuu-popups");
3234
+ var import_classnames17 = __toESM(require("classnames"));
3235
+ var import_react35 = require("react");
3236
+ var import_jsx_runtime24 = require("react/jsx-runtime");
3237
+
3238
+ // ../vuu-table/src/table-next/column-resizing/ColumnResizer.tsx
3239
+ var import_react36 = require("react");
3240
+ var import_jsx_runtime25 = require("react/jsx-runtime");
3241
+
3242
+ // ../vuu-table/src/table-next/column-resizing/useTableColumnResize.tsx
3243
+ var import_react37 = require("react");
3244
+
3245
+ // ../vuu-table/src/table-next/HeaderCell.tsx
3246
+ var import_jsx_runtime26 = require("react/jsx-runtime");
3247
+
3248
+ // ../vuu-table/src/table-next/Row.tsx
3249
+ var import_vuu_utils28 = require("@vuu-ui/vuu-utils");
3250
+ var import_classnames18 = __toESM(require("classnames"));
3251
+ var import_react40 = require("react");
3252
+
3253
+ // ../vuu-table/src/table-next/TableCell.tsx
3254
+ var import_jsx_runtime27 = require("react/jsx-runtime");
3255
+ var TableCell2 = ({ column, row }) => {
3256
+ const { className, style } = useCell(column, "vuuTableNextCell");
3257
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className, role: "cell", style, children: row[column.key] });
3030
3258
  };
3031
- var ColumnSettingsPanel2 = ({
3032
- column,
3033
- dispatchColumnAction,
3034
- style: styleProp,
3035
- ...props
3036
- }) => {
3037
- var _a, _b, _c, _d;
3038
- const [activeTab, setActiveTab] = (0, import_react16.useState)(0);
3039
- const dispatchUpdate = (0, import_react16.useCallback)(
3040
- (values) => dispatchColumnAction({
3041
- type: "updateColumnProp",
3042
- column,
3043
- ...values
3044
- }),
3045
- [column, dispatchColumnAction]
3046
- );
3047
- const handleChangeAlign = (0, import_react16.useCallback)(
3048
- (evt) => dispatchUpdate({ align: evt.target.value }),
3049
- [dispatchUpdate]
3050
- );
3051
- const handleChangePin = (0, import_react16.useCallback)(
3052
- (evt) => dispatchUpdate({ pin: evt.target.value }),
3053
- [dispatchUpdate]
3054
- );
3055
- const handleChangeHidden = (0, import_react16.useCallback)(
3056
- (evt) => dispatchUpdate({ hidden: evt.target.checked }),
3057
- [dispatchUpdate]
3058
- );
3059
- const handleChangeLabel = (0, import_react16.useCallback)(
3060
- (evt) => dispatchUpdate({ label: evt.target.value }),
3061
- [dispatchUpdate]
3062
- );
3063
- const handleChangeWidth = (0, import_react16.useCallback)(
3064
- (value) => dispatchUpdate({ width: parseInt(value.toString(), 10) }),
3065
- [dispatchUpdate]
3259
+
3260
+ // ../vuu-table/src/table-next/TableGroupCell.tsx
3261
+ var import_vuu_utils27 = require("@vuu-ui/vuu-utils");
3262
+ var import_react39 = require("react");
3263
+ var import_jsx_runtime28 = require("react/jsx-runtime");
3264
+ var { IS_LEAF: IS_LEAF3 } = import_vuu_utils27.metadataKeys;
3265
+ var TableGroupCell2 = ({ column, onClick, row }) => {
3266
+ const { columns } = column;
3267
+ const [value, offset] = (0, import_vuu_utils27.getGroupValueAndOffset)(columns, row);
3268
+ const { className, style } = useCell(column, "vuuTable2-groupCell");
3269
+ const handleClick = (0, import_react39.useCallback)(
3270
+ (evt) => {
3271
+ onClick == null ? void 0 : onClick(evt, column);
3272
+ },
3273
+ [column, onClick]
3066
3274
  );
3067
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
3275
+ const isLeaf = row[IS_LEAF3];
3276
+ const spacers = Array(offset).fill(0).map((n, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "vuuTable2-groupCell-spacer" }, i));
3277
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3068
3278
  "div",
3069
3279
  {
3070
- className: classBase12,
3071
- ...props,
3072
- style: {
3073
- ...styleProp
3074
- },
3280
+ className,
3281
+ role: "cell",
3282
+ style,
3283
+ onClick: isLeaf ? void 0 : handleClick,
3075
3284
  children: [
3076
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.Text, { as: "h4", children: "Column Settings" }),
3077
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
3078
- import_vuu_layout3.Stack,
3285
+ spacers,
3286
+ isLeaf ? null : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3287
+ "span",
3079
3288
  {
3080
- active: activeTab,
3081
- className: (0, import_classnames9.default)(`${classBase12}-columnTabs`),
3082
- onTabSelectionChanged: setActiveTab,
3083
- TabstripProps: tabstripProps2,
3084
- children: [
3085
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core10.Panel, { title: "Column", children: [
3086
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core10.FormField, { labelPlacement: "left", children: [
3087
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.FormFieldLabel, { children: "Hidden" }),
3088
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3089
- import_core10.Checkbox,
3090
- {
3091
- checked: column.hidden === true,
3092
- onChange: handleChangeHidden
3093
- }
3094
- )
3095
- ] }),
3096
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core10.FormField, { labelPlacement: "left", children: [
3097
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.FormFieldLabel, { children: "Label" }),
3098
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3099
- import_core10.Input,
3100
- {
3101
- value: (_a = column.label) != null ? _a : column.name,
3102
- onChange: handleChangeLabel
3103
- }
3104
- )
3105
- ] }),
3106
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core10.FormField, { labelPlacement: "left", children: [
3107
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.FormFieldLabel, { children: "Width" }),
3108
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3109
- import_lab9.StepperInput,
3110
- {
3111
- value: (_b = column.width) != null ? _b : 100,
3112
- onChange: handleChangeWidth
3113
- }
3114
- )
3115
- ] }),
3116
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core10.FormField, { labelPlacement: "left", children: [
3117
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.FormFieldLabel, { children: "Align" }),
3118
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
3119
- import_core10.RadioButtonGroup,
3120
- {
3121
- "aria-label": "Column Align",
3122
- value: (_c = column.align) != null ? _c : "left",
3123
- onChange: handleChangeAlign,
3124
- children: [
3125
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.RadioButton, { label: "Left", value: "left" }),
3126
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.RadioButton, { label: "Right", value: "right" })
3127
- ]
3128
- }
3129
- )
3130
- ] }),
3131
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core10.FormField, { labelPlacement: "left", children: [
3132
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.FormFieldLabel, { children: "Pin Column" }),
3133
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
3134
- import_core10.RadioButtonGroup,
3135
- {
3136
- "aria-label": "Pin Column",
3137
- value: (_d = column.pin) != null ? _d : "",
3138
- onChange: handleChangePin,
3139
- children: [
3140
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.RadioButton, { label: "Do not pin", value: "" }),
3141
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.RadioButton, { label: "Left", value: "left" }),
3142
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.RadioButton, { label: "Right", value: "right" })
3143
- ]
3144
- }
3145
- )
3146
- ] })
3147
- ] }),
3148
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3149
- ColumnTypePanel2,
3150
- {
3151
- column,
3152
- dispatchColumnAction,
3153
- title: "Data Cell"
3154
- }
3155
- ),
3156
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core10.Panel, { title: "Vuu", variant: "secondary", children: [
3157
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core10.FormField, { labelPlacement: "top", readOnly: true, children: [
3158
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.FormFieldLabel, { children: "Name" }),
3159
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.Input, { value: column.name })
3160
- ] }),
3161
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core10.FormField, { labelPlacement: "top", readOnly: true, children: [
3162
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.FormFieldLabel, { children: "Vuu Type" }),
3163
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.Input, { value: column.serverDataType })
3164
- ] })
3165
- ] })
3166
- ]
3289
+ className: "vuuTable2-groupCell-toggle",
3290
+ "data-icon": "vuu-triangle-right"
3167
3291
  }
3168
- )
3292
+ ),
3293
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: value })
3169
3294
  ]
3170
3295
  }
3171
3296
  );
3172
3297
  };
3298
+
3299
+ // ../vuu-table/src/table-next/Row.tsx
3300
+ var import_jsx_runtime29 = require("react/jsx-runtime");
3301
+ var import_react41 = require("react");
3302
+ var { IDX: IDX3, IS_EXPANDED: IS_EXPANDED4, SELECTED: SELECTED3 } = import_vuu_utils28.metadataKeys;
3303
+ var classBase12 = "vuuTableNextRow";
3304
+ var Row2 = (0, import_react40.memo)(
3305
+ ({
3306
+ className: classNameProp,
3307
+ columnMap,
3308
+ columns,
3309
+ row,
3310
+ offset,
3311
+ onClick,
3312
+ onToggleGroup,
3313
+ ...htmlAttributes
3314
+ }) => {
3315
+ const {
3316
+ [IDX3]: rowIndex,
3317
+ [IS_EXPANDED4]: isExpanded,
3318
+ [SELECTED3]: selectionStatus
3319
+ } = row;
3320
+ const handleRowClick = (0, import_react40.useCallback)(
3321
+ (evt) => {
3322
+ const rangeSelect = evt.shiftKey;
3323
+ const keepExistingSelection = evt.ctrlKey || evt.metaKey;
3324
+ onClick == null ? void 0 : onClick(row, rangeSelect, keepExistingSelection);
3325
+ },
3326
+ [onClick, row]
3327
+ );
3328
+ const { True, First, Last } = import_vuu_utils28.RowSelected;
3329
+ const className = (0, import_classnames18.default)(classBase12, classNameProp, {
3330
+ [`${classBase12}-even`]: rowIndex % 2 === 0,
3331
+ [`${classBase12}-expanded`]: isExpanded,
3332
+ [`${classBase12}-selected`]: selectionStatus & True,
3333
+ [`${classBase12}-selectedStart`]: selectionStatus & First,
3334
+ [`${classBase12}-selectedEnd`]: selectionStatus & Last
3335
+ });
3336
+ const style = typeof offset === "number" ? { transform: `translate3d(0px, ${offset}px, 0px)` } : void 0;
3337
+ return /* @__PURE__ */ (0, import_react41.createElement)(
3338
+ "div",
3339
+ {
3340
+ ...htmlAttributes,
3341
+ key: `row-${row[0]}`,
3342
+ role: "row",
3343
+ className,
3344
+ onClick: handleRowClick,
3345
+ style
3346
+ },
3347
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: `${classBase12}-selectionDecorator vuuStickyLeft` }),
3348
+ columns.filter(import_vuu_utils28.notHidden).map((column) => {
3349
+ const isGroup = (0, import_vuu_utils28.isGroupColumn)(column);
3350
+ const Cell = isGroup ? TableGroupCell2 : TableCell2;
3351
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Cell, { column, row }, column.key);
3352
+ }),
3353
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: `${classBase12}-selectionDecorator vuuStickyRight` })
3354
+ );
3355
+ }
3356
+ );
3357
+ Row2.displayName = "Row";
3358
+
3359
+ // ../vuu-table/src/table-next/useTableNext.ts
3360
+ var import_vuu_layout3 = require("@vuu-ui/vuu-layout");
3361
+ var import_vuu_popups6 = require("@vuu-ui/vuu-popups");
3362
+ var import_vuu_utils30 = require("@vuu-ui/vuu-utils");
3363
+ var import_react47 = require("react");
3364
+
3365
+ // ../vuu-table/src/table-next/table-config.ts
3366
+ var updateTableConfig = (config, action) => {
3367
+ switch (action.type) {
3368
+ case "col-size":
3369
+ return {
3370
+ ...config,
3371
+ columns: config.columns.map(
3372
+ (col) => col.name === action.column.name ? { ...col, width: action.width } : col
3373
+ )
3374
+ };
3375
+ case "column-prop":
3376
+ return {
3377
+ ...config,
3378
+ columns: config.columns.map(
3379
+ (col) => col.name === action.column.name ? { ...col, [action.property]: action.value } : col
3380
+ )
3381
+ };
3382
+ default:
3383
+ return config;
3384
+ }
3385
+ };
3386
+
3387
+ // ../vuu-table/src/table-next/useDataSource.ts
3388
+ var import_react42 = require("react");
3389
+
3390
+ // ../vuu-table/src/table-next/useInitialValue.ts
3391
+ var import_react43 = require("react");
3392
+
3393
+ // ../vuu-table/src/table-next/useTableModel.ts
3394
+ var import_vuu_ui_controls5 = require("@vuu-ui/vuu-ui-controls");
3395
+ var import_vuu_utils29 = require("@vuu-ui/vuu-utils");
3396
+ var import_react44 = require("react");
3397
+ var { info } = (0, import_vuu_utils29.logger)("useTableModel");
3398
+ var KEY_OFFSET2 = import_vuu_utils29.metadataKeys.count;
3399
+
3400
+ // ../vuu-table/src/table-next/useTableScroll.ts
3401
+ var import_react45 = require("react");
3402
+
3403
+ // ../vuu-table/src/table-next/useVirtualViewport.ts
3404
+ var import_react46 = require("react");
3405
+
3406
+ // ../vuu-table/src/table-next/TableNext.tsx
3407
+ var import_jsx_runtime30 = require("react/jsx-runtime");
3408
+ var { IDX: IDX4, RENDER_IDX: RENDER_IDX2 } = import_vuu_utils31.metadataKeys;
3409
+
3410
+ // src/table-settings/useTableSettings.ts
3411
+ var import_react48 = require("react");
3412
+ var buildColumnItems = (availableColumns, configuredColumns) => {
3413
+ return availableColumns.map(({ name, serverDataType }) => {
3414
+ const configuredColumn = configuredColumns.find((col) => col.name === name);
3415
+ return {
3416
+ hidden: configuredColumn == null ? void 0 : configuredColumn.hidden,
3417
+ label: configuredColumn == null ? void 0 : configuredColumn.label,
3418
+ name,
3419
+ serverDataType,
3420
+ subscribed: configuredColumn !== void 0
3421
+ };
3422
+ });
3423
+ };
3424
+ var useTableSettings = ({
3425
+ availableColumns,
3426
+ onConfigChange,
3427
+ tableConfig: tableConfigProp
3428
+ }) => {
3429
+ const [tableConfig, setTableConfig] = (0, import_react48.useState)(tableConfigProp);
3430
+ const columnItems = (0, import_react48.useMemo)(
3431
+ () => buildColumnItems(availableColumns, tableConfig.columns),
3432
+ [availableColumns, tableConfig.columns]
3433
+ );
3434
+ const handleMoveListItem = (0, import_react48.useCallback)(
3435
+ (fromIndex, toIndex) => {
3436
+ console.log(`move list item from ${fromIndex} to ${toIndex}`);
3437
+ },
3438
+ []
3439
+ );
3440
+ const handleColumnChange = (0, import_react48.useCallback)(
3441
+ (name, property, value) => {
3442
+ const columnItem = columnItems.find((col) => col.name === name);
3443
+ if (property === "subscribed") {
3444
+ console.log(`unsubscribe from ${name}`);
3445
+ } else if (columnItem == null ? void 0 : columnItem.subscribed) {
3446
+ const column = tableConfig.columns.find((col) => col.name === name);
3447
+ if (column) {
3448
+ const newConfig = updateTableConfig(tableConfig, {
3449
+ type: "column-prop",
3450
+ property,
3451
+ column,
3452
+ value
3453
+ });
3454
+ setTableConfig(newConfig);
3455
+ }
3456
+ }
3457
+ },
3458
+ [columnItems, tableConfig]
3459
+ );
3460
+ const handleChangeColumnLabels = (0, import_react48.useCallback)((evt) => {
3461
+ const { value } = evt.target;
3462
+ const columnFormatHeader = value === "0" ? void 0 : value === "1" ? "capitalize" : "uppercase";
3463
+ setTableConfig((config) => ({
3464
+ ...config,
3465
+ columnFormatHeader
3466
+ }));
3467
+ }, []);
3468
+ (0, import_vuu_layout4.useLayoutEffectSkipFirst)(() => {
3469
+ onConfigChange == null ? void 0 : onConfigChange(tableConfig);
3470
+ }, [onConfigChange, tableConfig]);
3471
+ const columnLabelsValue = tableConfig.columnFormatHeader === void 0 ? 0 : tableConfig.columnFormatHeader === "capitalize" ? 1 : 2;
3472
+ return {
3473
+ columnItems,
3474
+ columnLabelsValue,
3475
+ onChangeColumnLabels: handleChangeColumnLabels,
3476
+ onColumnChange: handleColumnChange,
3477
+ onMoveListItem: handleMoveListItem
3478
+ };
3479
+ };
3480
+
3481
+ // src/table-settings/TableSettingsPanel.tsx
3482
+ var import_jsx_runtime31 = require("react/jsx-runtime");
3483
+ var classBase13 = "vuuTableSettingsPanel";
3484
+ var TableSettingsPanel = ({
3485
+ availableColumns,
3486
+ onConfigChange,
3487
+ tableConfig,
3488
+ ...htmlAttributes
3489
+ }) => {
3490
+ const {
3491
+ columnItems,
3492
+ columnLabelsValue,
3493
+ onChangeColumnLabels,
3494
+ onColumnChange,
3495
+ onMoveListItem
3496
+ } = useTableSettings({
3497
+ availableColumns,
3498
+ onConfigChange,
3499
+ tableConfig
3500
+ });
3501
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { ...htmlAttributes, className: classBase13, children: [
3502
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_core9.FormField, { children: [
3503
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core9.FormFieldLabel, { children: "Column Labels" }),
3504
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3505
+ import_core9.ToggleButtonGroup,
3506
+ {
3507
+ className: "vuuToggleButtonGroup",
3508
+ onChange: onChangeColumnLabels,
3509
+ value: columnLabelsValue,
3510
+ children: [
3511
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3512
+ import_core9.ToggleButton,
3513
+ {
3514
+ className: "vuuIconToggleButton",
3515
+ "data-icon": "text-strikethrough",
3516
+ value: 0
3517
+ }
3518
+ ),
3519
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3520
+ import_core9.ToggleButton,
3521
+ {
3522
+ className: "vuuIconToggleButton",
3523
+ "data-icon": "text-Tt",
3524
+ value: 1
3525
+ }
3526
+ ),
3527
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3528
+ import_core9.ToggleButton,
3529
+ {
3530
+ className: "vuuIconToggleButton",
3531
+ "data-icon": "text-T",
3532
+ value: 2
3533
+ }
3534
+ )
3535
+ ]
3536
+ }
3537
+ )
3538
+ ] }),
3539
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_core9.FormField, { children: [
3540
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core9.FormFieldLabel, { children: "Default Column Width" }),
3541
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core9.Input, { className: "vuuInput" })
3542
+ ] }),
3543
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3544
+ ColumnList,
3545
+ {
3546
+ columnItems,
3547
+ onChange: onColumnChange,
3548
+ onMoveListItem
3549
+ }
3550
+ )
3551
+ ] });
3552
+ };
3173
3553
  //# sourceMappingURL=index.js.map