@vuu-ui/vuu-table-extras 0.7.6-debug → 0.8.0-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.
- package/cjs/index.js +388 -39
- package/cjs/index.js.map +4 -4
- package/esm/index.js +369 -6
- package/esm/index.js.map +4 -4
- package/index.css +45 -0
- package/index.css.map +3 -3
- package/package.json +14 -11
- package/types/cell-renderers/background-cell/BackgroundCell.d.ts +2 -0
- package/types/cell-renderers/background-cell/index.d.ts +1 -0
- package/types/cell-renderers/background-cell/useDirection.d.ts +3 -0
- package/types/cell-renderers/index.d.ts +2 -0
- package/types/cell-renderers/progress-cell/ProgressCell.d.ts +1 -0
- package/types/cell-renderers/progress-cell/index.d.ts +1 -0
- package/types/column-expression-input/ColumnExpressionInput.d.ts +9 -0
- package/types/column-expression-input/column-function-descriptors.d.ts +15 -0
- package/types/column-expression-input/column-language-parser/ColumnExpressionLanguage.d.ts +2 -0
- package/types/column-expression-input/column-language-parser/ColumnExpressionTreeWalker.d.ts +58 -0
- package/types/column-expression-input/column-language-parser/column-expression-parse-utils.d.ts +5 -0
- package/types/column-expression-input/column-language-parser/generated/column-parser.d.ts +2 -0
- package/types/column-expression-input/column-language-parser/generated/column-parser.terms.d.ts +24 -0
- package/types/column-expression-input/column-language-parser/index.d.ts +3 -0
- package/types/column-expression-input/column-language-parser/test.d.mts +1 -0
- package/types/column-expression-input/functionDocInfo.d.ts +2 -0
- package/types/column-expression-input/highlighting.d.ts +1 -0
- package/types/column-expression-input/index.d.ts +4 -0
- package/types/column-expression-input/theme.d.ts +1 -0
- package/types/column-expression-input/useColumnAutoComplete.d.ts +6 -0
- package/types/column-expression-input/useColumnExpressionEditor.d.ts +29 -0
- package/types/column-expression-input/useColumnExpressionSuggestionProvider.d.ts +8 -0
- package/types/datagrid-configuration-ui/calculated-column-panel/CalculatedColumnPanel.d.ts +11 -0
- package/types/datagrid-configuration-ui/calculated-column-panel/index.d.ts +1 -0
- package/types/datagrid-configuration-ui/column-picker/ColumnListItem.d.ts +4 -0
- package/types/datagrid-configuration-ui/column-picker/ColumnPicker.d.ts +13 -0
- package/types/datagrid-configuration-ui/column-picker/index.d.ts +1 -0
- package/types/datagrid-configuration-ui/column-settings-panel/ColumnSettingsPanel.d.ts +9 -0
- package/types/datagrid-configuration-ui/column-settings-panel/index.d.ts +1 -0
- package/types/datagrid-configuration-ui/column-type-panel/ColumnTypePanel.d.ts +10 -0
- package/types/datagrid-configuration-ui/column-type-panel/NumericColumnPanel.d.ts +4 -0
- package/types/datagrid-configuration-ui/column-type-panel/StringColumnPanel.d.ts +4 -0
- package/types/datagrid-configuration-ui/column-type-panel/index.d.ts +1 -0
- package/types/datagrid-configuration-ui/index.d.ts +1 -0
- package/types/datagrid-configuration-ui/settings-panel/DatagridSettingsPanel.d.ts +10 -0
- package/types/datagrid-configuration-ui/settings-panel/GridSettingsPanel.d.ts +9 -0
- package/types/datagrid-configuration-ui/settings-panel/index.d.ts +1 -0
- package/types/datagrid-configuration-ui/settings-panel/useGridSettings.d.ts +59 -0
- package/types/datasource-stats/DatasourceStats.d.ts +8 -0
- package/types/datasource-stats/index.d.ts +1 -0
- package/types/index.d.ts +5 -0
- package/types/table-settings/calculated-column-panel/CalculatedColumnPanel.d.ts +11 -0
- package/types/table-settings/calculated-column-panel/index.d.ts +1 -0
- package/types/table-settings/column-picker/ColumnListItem.d.ts +4 -0
- package/types/table-settings/column-picker/ColumnPicker.d.ts +13 -0
- package/types/table-settings/column-picker/index.d.ts +1 -0
- package/types/table-settings/column-settings-panel/ColumnSettingsPanel.d.ts +9 -0
- package/types/table-settings/column-settings-panel/index.d.ts +1 -0
- package/types/table-settings/column-type-panel/ColumnTypePanel.d.ts +10 -0
- package/types/table-settings/column-type-panel/NumericColumnPanel.d.ts +4 -0
- package/types/table-settings/column-type-panel/StringColumnPanel.d.ts +4 -0
- package/types/table-settings/column-type-panel/index.d.ts +1 -0
- package/types/table-settings/index.d.ts +1 -0
- package/types/table-settings/settings-panel/DatagridSettingsPanel.d.ts +10 -0
- package/types/table-settings/settings-panel/GridSettingsPanel.d.ts +9 -0
- package/types/table-settings/settings-panel/index.d.ts +1 -0
- package/types/table-settings/settings-panel/useGridSettings.d.ts +59 -0
- package/LICENSE +0 -201
package/cjs/index.js
CHANGED
|
@@ -50,6 +50,7 @@ var src_exports = {};
|
|
|
50
50
|
__export(src_exports, {
|
|
51
51
|
ColumnExpressionInput: () => ColumnExpressionInput,
|
|
52
52
|
ColumnNamedTerms: () => ColumnNamedTerms,
|
|
53
|
+
ColumnSettingsPanel: () => ColumnSettingsPanel2,
|
|
53
54
|
DataSourceStats: () => DataSourceStats,
|
|
54
55
|
DatagridSettingsPanel: () => DatagridSettingsPanel,
|
|
55
56
|
columnExpressionLanguageSupport: () => columnExpressionLanguageSupport,
|
|
@@ -63,13 +64,12 @@ __export(src_exports, {
|
|
|
63
64
|
module.exports = __toCommonJS(src_exports);
|
|
64
65
|
|
|
65
66
|
// src/cell-renderers/background-cell/BackgroundCell.tsx
|
|
66
|
-
var
|
|
67
|
+
var import_vuu_utils2 = require("@vuu-ui/vuu-utils");
|
|
67
68
|
var import_classnames = __toESM(require("classnames"), 1);
|
|
68
69
|
|
|
69
70
|
// src/cell-renderers/background-cell/useDirection.ts
|
|
70
|
-
var import_react = require("react");
|
|
71
71
|
var import_vuu_utils = require("@vuu-ui/vuu-utils");
|
|
72
|
-
var
|
|
72
|
+
var import_react = require("react");
|
|
73
73
|
var INITIAL_VALUE = [void 0, void 0, void 0, void 0];
|
|
74
74
|
function useDirection(key, value, column) {
|
|
75
75
|
var _a;
|
|
@@ -77,7 +77,7 @@ function useDirection(key, value, column) {
|
|
|
77
77
|
const [prevKey, prevValue, prevColumn, prevDirection] = ref.current || INITIAL_VALUE;
|
|
78
78
|
const { type: dataType } = column;
|
|
79
79
|
const decimals = (0, import_vuu_utils.isTypeDescriptor)(dataType) ? (_a = dataType.formatting) == null ? void 0 : _a.decimals : void 0;
|
|
80
|
-
const direction = key === prevKey && (0,
|
|
80
|
+
const direction = key === prevKey && (0, import_vuu_utils.isValidNumber)(value) && (0, import_vuu_utils.isValidNumber)(prevValue) && column === prevColumn ? (0, import_vuu_utils.getMovingValueDirection)(value, prevDirection, prevValue, decimals) : "";
|
|
81
81
|
(0, import_react.useEffect)(() => {
|
|
82
82
|
ref.current = [key, value, column, direction];
|
|
83
83
|
});
|
|
@@ -88,7 +88,7 @@ function useDirection(key, value, column) {
|
|
|
88
88
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
89
89
|
var CHAR_ARROW_UP = String.fromCharCode(11014);
|
|
90
90
|
var CHAR_ARROW_DOWN = String.fromCharCode(11015);
|
|
91
|
-
var { KEY } =
|
|
91
|
+
var { KEY } = import_vuu_utils2.metadataKeys;
|
|
92
92
|
var classBase = "vuuBackgroundCell";
|
|
93
93
|
var FlashStyle = {
|
|
94
94
|
ArrowOnly: "arrow",
|
|
@@ -96,7 +96,7 @@ var FlashStyle = {
|
|
|
96
96
|
ArrowBackground: "arrow-bg"
|
|
97
97
|
};
|
|
98
98
|
var getFlashStyle = (colType) => {
|
|
99
|
-
if ((0,
|
|
99
|
+
if ((0, import_vuu_utils2.isTypeDescriptor)(colType) && colType.renderer) {
|
|
100
100
|
if ("flashStyle" in colType.renderer) {
|
|
101
101
|
return colType.renderer["flashStyle"];
|
|
102
102
|
}
|
|
@@ -108,7 +108,7 @@ var BackgroundCell = ({ column, row }) => {
|
|
|
108
108
|
const value = row[key];
|
|
109
109
|
const flashStyle = getFlashStyle(type);
|
|
110
110
|
const direction = useDirection(row[KEY], value, column);
|
|
111
|
-
const arrow = flashStyle === FlashStyle.ArrowOnly || flashStyle === FlashStyle.ArrowBackground ? direction ===
|
|
111
|
+
const arrow = flashStyle === FlashStyle.ArrowOnly || flashStyle === FlashStyle.ArrowBackground ? direction === import_vuu_utils2.UP1 || direction === import_vuu_utils2.UP2 ? CHAR_ARROW_UP : direction === import_vuu_utils2.DOWN1 || direction === import_vuu_utils2.DOWN2 ? CHAR_ARROW_DOWN : null : null;
|
|
112
112
|
const dirClass = direction ? ` ` + direction : "";
|
|
113
113
|
const className = (0, import_classnames.default)(classBase, dirClass, {
|
|
114
114
|
[`${classBase}-arrowOnly`]: flashStyle === FlashStyle.ArrowOnly,
|
|
@@ -119,12 +119,12 @@ var BackgroundCell = ({ column, row }) => {
|
|
|
119
119
|
valueFormatter(row[column.key])
|
|
120
120
|
] });
|
|
121
121
|
};
|
|
122
|
-
(0,
|
|
122
|
+
(0, import_vuu_utils2.registerComponent)("background", BackgroundCell, "cell-renderer", {
|
|
123
123
|
serverDataType: ["long", "int", "double"]
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
// src/cell-renderers/progress-cell/ProgressCell.tsx
|
|
127
|
-
var
|
|
127
|
+
var import_vuu_utils3 = require("@vuu-ui/vuu-utils");
|
|
128
128
|
var import_classnames2 = __toESM(require("classnames"), 1);
|
|
129
129
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
130
130
|
var classBase2 = "vuuProgressCell";
|
|
@@ -133,7 +133,7 @@ var ProgressCell = ({ column, columnMap, row }) => {
|
|
|
133
133
|
const value = row[column.key];
|
|
134
134
|
let showProgress = false;
|
|
135
135
|
let percentage = 0;
|
|
136
|
-
if ((0,
|
|
136
|
+
if ((0, import_vuu_utils3.isTypeDescriptor)(type) && (0, import_vuu_utils3.isColumnTypeRenderer)(type.renderer)) {
|
|
137
137
|
const { associatedField } = type.renderer;
|
|
138
138
|
const associatedValue = row[columnMap[associatedField]];
|
|
139
139
|
if (typeof value === "number" && typeof associatedValue === "number") {
|
|
@@ -168,13 +168,13 @@ var ProgressCell = ({ column, columnMap, row }) => {
|
|
|
168
168
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `${classBase2}-text`, children: `${percentage} %` })
|
|
169
169
|
] });
|
|
170
170
|
};
|
|
171
|
-
(0,
|
|
171
|
+
(0, import_vuu_utils3.registerComponent)("vuu.progress", ProgressCell, "cell-renderer", {
|
|
172
172
|
serverDataType: ["long", "int", "double"]
|
|
173
173
|
});
|
|
174
174
|
|
|
175
175
|
// src/column-expression-input/useColumnExpressionEditor.ts
|
|
176
176
|
var import_vuu_codemirror5 = require("@vuu-ui/vuu-codemirror");
|
|
177
|
-
var
|
|
177
|
+
var import_vuu_utils4 = require("@vuu-ui/vuu-utils");
|
|
178
178
|
var import_react3 = require("react");
|
|
179
179
|
|
|
180
180
|
// src/column-expression-input/column-language-parser/ColumnExpressionLanguage.ts
|
|
@@ -1210,8 +1210,8 @@ var noop = () => console.log("noooop");
|
|
|
1210
1210
|
var hasExpressionType = (completion) => "expressionType" in completion;
|
|
1211
1211
|
var injectOptionContent = (completion) => {
|
|
1212
1212
|
if (hasExpressionType(completion)) {
|
|
1213
|
-
const div = (0,
|
|
1214
|
-
const span = (0,
|
|
1213
|
+
const div = (0, import_vuu_utils4.createEl)("div", "expression-type-container");
|
|
1214
|
+
const span = (0, import_vuu_utils4.createEl)("span", "expression-type", completion.expressionType);
|
|
1215
1215
|
div.appendChild(span);
|
|
1216
1216
|
return div;
|
|
1217
1217
|
} else {
|
|
@@ -1345,8 +1345,8 @@ var ColumnExpressionInput = ({
|
|
|
1345
1345
|
|
|
1346
1346
|
// src/column-expression-input/useColumnExpressionSuggestionProvider.ts
|
|
1347
1347
|
var import_vuu_codemirror6 = require("@vuu-ui/vuu-codemirror");
|
|
1348
|
-
var
|
|
1349
|
-
var
|
|
1348
|
+
var import_vuu_data_react = require("@vuu-ui/vuu-data-react");
|
|
1349
|
+
var import_vuu_utils6 = require("@vuu-ui/vuu-utils");
|
|
1350
1350
|
var import_react4 = require("react");
|
|
1351
1351
|
|
|
1352
1352
|
// src/column-expression-input/column-function-descriptors.ts
|
|
@@ -1622,7 +1622,7 @@ var columnFunctionDescriptors = [
|
|
|
1622
1622
|
];
|
|
1623
1623
|
|
|
1624
1624
|
// src/column-expression-input/functionDocInfo.ts
|
|
1625
|
-
var
|
|
1625
|
+
var import_vuu_utils5 = require("@vuu-ui/vuu-utils");
|
|
1626
1626
|
var functionDocInfo = ({
|
|
1627
1627
|
name,
|
|
1628
1628
|
description,
|
|
@@ -1630,25 +1630,25 @@ var functionDocInfo = ({
|
|
|
1630
1630
|
params,
|
|
1631
1631
|
type
|
|
1632
1632
|
}) => {
|
|
1633
|
-
const rootElement = (0,
|
|
1634
|
-
const headingElement = (0,
|
|
1635
|
-
const nameElement = (0,
|
|
1636
|
-
const paramElement = (0,
|
|
1637
|
-
const typeElement = (0,
|
|
1633
|
+
const rootElement = (0, import_vuu_utils5.createEl)("div", "vuuFunctionDoc");
|
|
1634
|
+
const headingElement = (0, import_vuu_utils5.createEl)("div", "function-heading");
|
|
1635
|
+
const nameElement = (0, import_vuu_utils5.createEl)("span", "function-name", name);
|
|
1636
|
+
const paramElement = (0, import_vuu_utils5.createEl)("span", "param-list", params.description);
|
|
1637
|
+
const typeElement = (0, import_vuu_utils5.createEl)("span", "function-type", type);
|
|
1638
1638
|
headingElement.appendChild(nameElement);
|
|
1639
1639
|
headingElement.appendChild(paramElement);
|
|
1640
1640
|
headingElement.appendChild(typeElement);
|
|
1641
|
-
const child2 = (0,
|
|
1641
|
+
const child2 = (0, import_vuu_utils5.createEl)("p", void 0, description);
|
|
1642
1642
|
rootElement.appendChild(headingElement);
|
|
1643
1643
|
rootElement.appendChild(child2);
|
|
1644
1644
|
if (example) {
|
|
1645
|
-
const exampleElement = (0,
|
|
1646
|
-
const expressionElement = (0,
|
|
1645
|
+
const exampleElement = (0, import_vuu_utils5.createEl)("div", "example-container", "Example:");
|
|
1646
|
+
const expressionElement = (0, import_vuu_utils5.createEl)(
|
|
1647
1647
|
"div",
|
|
1648
1648
|
"example-expression",
|
|
1649
1649
|
example.expression
|
|
1650
1650
|
);
|
|
1651
|
-
const resultElement = (0,
|
|
1651
|
+
const resultElement = (0, import_vuu_utils5.createEl)("div", "example-result", example.result);
|
|
1652
1652
|
exampleElement.appendChild(expressionElement);
|
|
1653
1653
|
exampleElement.appendChild(resultElement);
|
|
1654
1654
|
rootElement.appendChild(exampleElement);
|
|
@@ -1667,15 +1667,15 @@ var withApplySpace = (suggestions) => suggestions.map((suggestion) => {
|
|
|
1667
1667
|
});
|
|
1668
1668
|
var getValidColumns = (columns, { functionName, operator }) => {
|
|
1669
1669
|
if (operator) {
|
|
1670
|
-
return columns.filter(
|
|
1670
|
+
return columns.filter(import_vuu_utils6.isNumericColumn);
|
|
1671
1671
|
} else if (functionName) {
|
|
1672
1672
|
const fn = columnFunctionDescriptors.find((f) => f.name === functionName);
|
|
1673
1673
|
if (fn) {
|
|
1674
1674
|
switch (fn.accepts) {
|
|
1675
1675
|
case "string":
|
|
1676
|
-
return columns.filter(
|
|
1676
|
+
return columns.filter(import_vuu_utils6.isTextColumn);
|
|
1677
1677
|
case "number":
|
|
1678
|
-
return columns.filter(
|
|
1678
|
+
return columns.filter(import_vuu_utils6.isNumericColumn);
|
|
1679
1679
|
default:
|
|
1680
1680
|
return columns;
|
|
1681
1681
|
}
|
|
@@ -1704,7 +1704,7 @@ var arithmeticOperators = [
|
|
|
1704
1704
|
{ apply: "- ", boost: 2, label: "-", type: "operator" }
|
|
1705
1705
|
];
|
|
1706
1706
|
var getOperators = (column) => {
|
|
1707
|
-
if (column === void 0 || (0,
|
|
1707
|
+
if (column === void 0 || (0, import_vuu_utils6.isNumericColumn)(column)) {
|
|
1708
1708
|
return arithmeticOperators;
|
|
1709
1709
|
} else {
|
|
1710
1710
|
return NO_OPERATORS;
|
|
@@ -1773,7 +1773,7 @@ var useColumnExpressionSuggestionProvider = ({
|
|
|
1773
1773
|
[columns]
|
|
1774
1774
|
);
|
|
1775
1775
|
const latestSuggestionsRef = (0, import_react4.useRef)();
|
|
1776
|
-
const getTypeaheadSuggestions = (0,
|
|
1776
|
+
const getTypeaheadSuggestions = (0, import_vuu_data_react.useTypeaheadSuggestions)();
|
|
1777
1777
|
const getSuggestions = (0, import_react4.useCallback)(
|
|
1778
1778
|
async (suggestionType, options = NONE) => {
|
|
1779
1779
|
const { columnName, functionName, operator, prefix } = options;
|
|
@@ -1811,7 +1811,7 @@ var useColumnExpressionSuggestionProvider = ({
|
|
|
1811
1811
|
break;
|
|
1812
1812
|
case "columnValue":
|
|
1813
1813
|
if (columnName && operator) {
|
|
1814
|
-
const params = (0,
|
|
1814
|
+
const params = (0, import_vuu_data_react.getTypeaheadParams)(
|
|
1815
1815
|
table,
|
|
1816
1816
|
columnName
|
|
1817
1817
|
/*, startsWith*/
|
|
@@ -2075,7 +2075,7 @@ var import_classnames5 = __toESM(require("classnames"), 1);
|
|
|
2075
2075
|
var import_react8 = require("react");
|
|
2076
2076
|
|
|
2077
2077
|
// src/datagrid-configuration-ui/column-type-panel/ColumnTypePanel.tsx
|
|
2078
|
-
var
|
|
2078
|
+
var import_vuu_utils7 = require("@vuu-ui/vuu-utils");
|
|
2079
2079
|
var import_salt_lab4 = require("@heswell/salt-lab");
|
|
2080
2080
|
var import_core3 = require("@salt-ds/core");
|
|
2081
2081
|
var import_classnames4 = __toESM(require("classnames"), 1);
|
|
@@ -2171,7 +2171,8 @@ var StringColumnPanel = ({
|
|
|
2171
2171
|
column,
|
|
2172
2172
|
dispatchColumnAction
|
|
2173
2173
|
}) => {
|
|
2174
|
-
|
|
2174
|
+
console.log({ column, dispatchColumnAction });
|
|
2175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: "what" });
|
|
2175
2176
|
};
|
|
2176
2177
|
|
|
2177
2178
|
// src/datagrid-configuration-ui/column-type-panel/ColumnTypePanel.tsx
|
|
@@ -2181,7 +2182,7 @@ var integerCellRenderers = ["Default Renderer (int, long)"];
|
|
|
2181
2182
|
var doubleCellRenderers = ["Default Renderer (double)"];
|
|
2182
2183
|
var stringCellRenderers = ["Default Renderer (string)"];
|
|
2183
2184
|
var getAvailableCellRenderers = (column) => {
|
|
2184
|
-
const customCellRenderers = (0,
|
|
2185
|
+
const customCellRenderers = (0, import_vuu_utils7.getRegisteredCellRenderers)(column.serverDataType);
|
|
2185
2186
|
const customRendererNames = customCellRenderers.map((r) => r.name);
|
|
2186
2187
|
console.log({ customRendererNames });
|
|
2187
2188
|
switch (column.serverDataType) {
|
|
@@ -2494,7 +2495,7 @@ var GridSettingsPanel = ({
|
|
|
2494
2495
|
// src/datagrid-configuration-ui/settings-panel/useGridSettings.ts
|
|
2495
2496
|
var import_react10 = require("react");
|
|
2496
2497
|
var import_salt_lab7 = require("@heswell/salt-lab");
|
|
2497
|
-
var
|
|
2498
|
+
var import_vuu_utils8 = require("@vuu-ui/vuu-utils");
|
|
2498
2499
|
var gridSettingsReducer = (state, action) => {
|
|
2499
2500
|
console.log(`gridSettingsReducer ${action.type}`);
|
|
2500
2501
|
switch (action.type) {
|
|
@@ -2611,7 +2612,7 @@ function updateColumnTypeFormatting(state, {
|
|
|
2611
2612
|
if (targetColumn) {
|
|
2612
2613
|
const {
|
|
2613
2614
|
serverDataType = "string",
|
|
2614
|
-
type: columnType = (0,
|
|
2615
|
+
type: columnType = (0, import_vuu_utils8.fromServerDataType)(serverDataType)
|
|
2615
2616
|
} = column;
|
|
2616
2617
|
const type = typeof columnType === "string" ? {
|
|
2617
2618
|
name: columnType
|
|
@@ -2760,7 +2761,7 @@ var DatagridSettingsPanel = ({
|
|
|
2760
2761
|
[handleApply]
|
|
2761
2762
|
);
|
|
2762
2763
|
const selectedColumn = selectedColumnName === null ? null : (_a = gridSettings.columns.find((col) => col.name === selectedColumnName)) != null ? _a : null;
|
|
2763
|
-
const
|
|
2764
|
+
const tabstripProps3 = {
|
|
2764
2765
|
activeTabIndex: selectedTabIndex,
|
|
2765
2766
|
enableRenameTab: false,
|
|
2766
2767
|
orientation: "vertical"
|
|
@@ -2774,7 +2775,7 @@ var DatagridSettingsPanel = ({
|
|
|
2774
2775
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2775
2776
|
import_vuu_layout2.Stack,
|
|
2776
2777
|
{
|
|
2777
|
-
TabstripProps:
|
|
2778
|
+
TabstripProps: tabstripProps3,
|
|
2778
2779
|
className: `${classBase9}-stack`,
|
|
2779
2780
|
getTabIcon,
|
|
2780
2781
|
getTabLabel,
|
|
@@ -2859,4 +2860,352 @@ var DataSourceStats = ({
|
|
|
2859
2860
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: `${classBase10}-size`, children: value })
|
|
2860
2861
|
] });
|
|
2861
2862
|
};
|
|
2863
|
+
|
|
2864
|
+
// src/table-settings/column-settings-panel/ColumnSettingsPanel.tsx
|
|
2865
|
+
var import_vuu_layout3 = require("@vuu-ui/vuu-layout");
|
|
2866
|
+
var import_salt_lab11 = require("@heswell/salt-lab");
|
|
2867
|
+
var import_core10 = require("@salt-ds/core");
|
|
2868
|
+
var import_classnames9 = __toESM(require("classnames"), 1);
|
|
2869
|
+
var import_react16 = require("react");
|
|
2870
|
+
|
|
2871
|
+
// src/table-settings/column-type-panel/ColumnTypePanel.tsx
|
|
2872
|
+
var import_vuu_utils9 = require("@vuu-ui/vuu-utils");
|
|
2873
|
+
var import_salt_lab10 = require("@heswell/salt-lab");
|
|
2874
|
+
var import_core9 = require("@salt-ds/core");
|
|
2875
|
+
var import_classnames8 = __toESM(require("classnames"), 1);
|
|
2876
|
+
var import_react15 = require("react");
|
|
2877
|
+
|
|
2878
|
+
// src/table-settings/column-type-panel/NumericColumnPanel.tsx
|
|
2879
|
+
var import_salt_lab9 = require("@heswell/salt-lab");
|
|
2880
|
+
var import_core8 = require("@salt-ds/core");
|
|
2881
|
+
var import_react14 = require("react");
|
|
2882
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2883
|
+
var defaultValues2 = {
|
|
2884
|
+
alignOnDecimals: false,
|
|
2885
|
+
decimals: 4,
|
|
2886
|
+
zeroPad: false
|
|
2887
|
+
};
|
|
2888
|
+
var getColumnValues2 = (columnType, gridDefaultValues) => {
|
|
2889
|
+
const columnValue = typeof columnType === "object" && columnType.formatting ? columnType.formatting : {};
|
|
2890
|
+
const properties = ["alignOnDecimals", "decimals", "zeroPad"];
|
|
2891
|
+
return properties.reduce((configValues, property) => {
|
|
2892
|
+
if (columnValue[property] !== void 0) {
|
|
2893
|
+
return {
|
|
2894
|
+
...configValues,
|
|
2895
|
+
[property]: columnValue[property]
|
|
2896
|
+
};
|
|
2897
|
+
} else if ((gridDefaultValues == null ? void 0 : gridDefaultValues[property]) !== void 0) {
|
|
2898
|
+
return {
|
|
2899
|
+
...configValues,
|
|
2900
|
+
[property]: gridDefaultValues[property]
|
|
2901
|
+
};
|
|
2902
|
+
}
|
|
2903
|
+
return configValues;
|
|
2904
|
+
}, defaultValues2);
|
|
2905
|
+
};
|
|
2906
|
+
var NumericColumnPanel2 = ({
|
|
2907
|
+
column,
|
|
2908
|
+
dispatchColumnAction
|
|
2909
|
+
}) => {
|
|
2910
|
+
const { decimals, alignOnDecimals, zeroPad } = getColumnValues2(column == null ? void 0 : column.type);
|
|
2911
|
+
const dispatchUpdate = (0, import_react14.useCallback)(
|
|
2912
|
+
(values) => dispatchColumnAction({
|
|
2913
|
+
type: "updateColumnTypeFormatting",
|
|
2914
|
+
column,
|
|
2915
|
+
...values
|
|
2916
|
+
}),
|
|
2917
|
+
[column, dispatchColumnAction]
|
|
2918
|
+
);
|
|
2919
|
+
const handleChangeDecimals = (0, import_react14.useCallback)(
|
|
2920
|
+
(value) => dispatchUpdate({ decimals: parseInt(value.toString(), 10) }),
|
|
2921
|
+
[dispatchUpdate]
|
|
2922
|
+
);
|
|
2923
|
+
const handleChangeAlignOnDecimals = (0, import_react14.useCallback)(
|
|
2924
|
+
(evt, value) => dispatchUpdate({ alignOnDecimals: value }),
|
|
2925
|
+
[dispatchUpdate]
|
|
2926
|
+
);
|
|
2927
|
+
const handleChangeZeroPad = (0, import_react14.useCallback)(
|
|
2928
|
+
(evt, value) => dispatchUpdate({ zeroPad: value }),
|
|
2929
|
+
[dispatchUpdate]
|
|
2930
|
+
);
|
|
2931
|
+
switch (column.serverDataType) {
|
|
2932
|
+
case "double":
|
|
2933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
2934
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_salt_lab9.FormField, { label: "No of Decimals", labelPlacement: "top", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_salt_lab9.StepperInput, { value: decimals, onChange: handleChangeDecimals }) }),
|
|
2935
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2936
|
+
import_salt_lab9.Switch,
|
|
2937
|
+
{
|
|
2938
|
+
checked: alignOnDecimals,
|
|
2939
|
+
label: "Align on decimals",
|
|
2940
|
+
LabelProps: { className: "vuuColumnPanelSwitch" },
|
|
2941
|
+
onChange: handleChangeAlignOnDecimals
|
|
2942
|
+
}
|
|
2943
|
+
),
|
|
2944
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2945
|
+
import_salt_lab9.Switch,
|
|
2946
|
+
{
|
|
2947
|
+
checked: zeroPad,
|
|
2948
|
+
label: "Zero pad",
|
|
2949
|
+
LabelProps: { className: "vuuColumnPanelSwitch" },
|
|
2950
|
+
onChange: handleChangeZeroPad
|
|
2951
|
+
}
|
|
2952
|
+
)
|
|
2953
|
+
] });
|
|
2954
|
+
case "long":
|
|
2955
|
+
case "int":
|
|
2956
|
+
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" }) });
|
|
2957
|
+
default:
|
|
2958
|
+
return null;
|
|
2959
|
+
}
|
|
2960
|
+
};
|
|
2961
|
+
|
|
2962
|
+
// src/table-settings/column-type-panel/StringColumnPanel.tsx
|
|
2963
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2964
|
+
var StringColumnPanel2 = ({
|
|
2965
|
+
column,
|
|
2966
|
+
dispatchColumnAction
|
|
2967
|
+
}) => {
|
|
2968
|
+
console.log(column, dispatchColumnAction);
|
|
2969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: "what" });
|
|
2970
|
+
};
|
|
2971
|
+
|
|
2972
|
+
// src/table-settings/column-type-panel/ColumnTypePanel.tsx
|
|
2973
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2974
|
+
var classBase11 = "vuuColumnTypePanel";
|
|
2975
|
+
var integerCellRenderers2 = ["Default Renderer (int, long)"];
|
|
2976
|
+
var doubleCellRenderers2 = ["Default Renderer (double)"];
|
|
2977
|
+
var stringCellRenderers2 = ["Default Renderer (string)"];
|
|
2978
|
+
var getAvailableCellRenderers2 = (column) => {
|
|
2979
|
+
const customCellRenderers = (0, import_vuu_utils9.getRegisteredCellRenderers)(column.serverDataType);
|
|
2980
|
+
const customRendererNames = customCellRenderers.map((r) => r.name);
|
|
2981
|
+
console.log({ customRendererNames });
|
|
2982
|
+
switch (column.serverDataType) {
|
|
2983
|
+
case "char":
|
|
2984
|
+
case "string":
|
|
2985
|
+
return stringCellRenderers2;
|
|
2986
|
+
case "int":
|
|
2987
|
+
case "long":
|
|
2988
|
+
return integerCellRenderers2;
|
|
2989
|
+
case "double":
|
|
2990
|
+
return doubleCellRenderers2.concat(customRendererNames);
|
|
2991
|
+
default:
|
|
2992
|
+
return stringCellRenderers2;
|
|
2993
|
+
}
|
|
2994
|
+
};
|
|
2995
|
+
var ColumnTypePanel2 = ({
|
|
2996
|
+
className,
|
|
2997
|
+
column,
|
|
2998
|
+
dispatchColumnAction,
|
|
2999
|
+
...props
|
|
3000
|
+
}) => {
|
|
3001
|
+
const content = (0, import_react15.useMemo)(() => {
|
|
3002
|
+
switch (column.serverDataType) {
|
|
3003
|
+
case "double":
|
|
3004
|
+
case "int":
|
|
3005
|
+
case "long":
|
|
3006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3007
|
+
NumericColumnPanel2,
|
|
3008
|
+
{
|
|
3009
|
+
column,
|
|
3010
|
+
dispatchColumnAction
|
|
3011
|
+
}
|
|
3012
|
+
);
|
|
3013
|
+
default:
|
|
3014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3015
|
+
StringColumnPanel2,
|
|
3016
|
+
{
|
|
3017
|
+
column,
|
|
3018
|
+
dispatchColumnAction
|
|
3019
|
+
}
|
|
3020
|
+
);
|
|
3021
|
+
}
|
|
3022
|
+
}, [column, dispatchColumnAction]);
|
|
3023
|
+
const { serverDataType = "string" } = column;
|
|
3024
|
+
const availableRenderers = getAvailableCellRenderers2(column);
|
|
3025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
3026
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3027
|
+
import_salt_lab10.Dropdown,
|
|
3028
|
+
{
|
|
3029
|
+
className: (0, import_classnames8.default)(`${classBase11}-renderer`),
|
|
3030
|
+
fullWidth: true,
|
|
3031
|
+
selected: availableRenderers[0],
|
|
3032
|
+
source: availableRenderers
|
|
3033
|
+
}
|
|
3034
|
+
),
|
|
3035
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3036
|
+
import_core9.Panel,
|
|
3037
|
+
{
|
|
3038
|
+
...props,
|
|
3039
|
+
className: (0, import_classnames8.default)(classBase11, className, `${classBase11}-${serverDataType}`),
|
|
3040
|
+
children: content
|
|
3041
|
+
}
|
|
3042
|
+
)
|
|
3043
|
+
] });
|
|
3044
|
+
};
|
|
3045
|
+
|
|
3046
|
+
// src/table-settings/column-settings-panel/ColumnSettingsPanel.tsx
|
|
3047
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3048
|
+
var classBase12 = "vuuColumnSettingsPanel";
|
|
3049
|
+
var tabstripProps2 = {
|
|
3050
|
+
className: "salt-density-high"
|
|
3051
|
+
};
|
|
3052
|
+
var NullActivationIndicator3 = () => null;
|
|
3053
|
+
var ColumnSettingsPanel2 = ({
|
|
3054
|
+
column,
|
|
3055
|
+
dispatchColumnAction,
|
|
3056
|
+
style: styleProp,
|
|
3057
|
+
...props
|
|
3058
|
+
}) => {
|
|
3059
|
+
var _a, _b, _c, _d;
|
|
3060
|
+
const [activeTab, setActiveTab] = (0, import_react16.useState)(0);
|
|
3061
|
+
const dispatchUpdate = (0, import_react16.useCallback)(
|
|
3062
|
+
(values) => dispatchColumnAction({
|
|
3063
|
+
type: "updateColumnProp",
|
|
3064
|
+
column,
|
|
3065
|
+
...values
|
|
3066
|
+
}),
|
|
3067
|
+
[column, dispatchColumnAction]
|
|
3068
|
+
);
|
|
3069
|
+
const handleChangeAlign = (0, import_react16.useCallback)(
|
|
3070
|
+
(evt) => dispatchUpdate({ align: evt.target.value }),
|
|
3071
|
+
[dispatchUpdate]
|
|
3072
|
+
);
|
|
3073
|
+
const handleChangePin = (0, import_react16.useCallback)(
|
|
3074
|
+
(evt) => dispatchUpdate({ pin: evt.target.value }),
|
|
3075
|
+
[dispatchUpdate]
|
|
3076
|
+
);
|
|
3077
|
+
const handleChangeHidden = (0, import_react16.useCallback)(
|
|
3078
|
+
(evt, value) => dispatchUpdate({ hidden: value }),
|
|
3079
|
+
[dispatchUpdate]
|
|
3080
|
+
);
|
|
3081
|
+
const handleChangeLabel = (0, import_react16.useCallback)(
|
|
3082
|
+
(evt, value) => dispatchUpdate({ label: value }),
|
|
3083
|
+
[dispatchUpdate]
|
|
3084
|
+
);
|
|
3085
|
+
const handleChangeWidth = (0, import_react16.useCallback)(
|
|
3086
|
+
(value) => dispatchUpdate({ width: parseInt(value.toString(), 10) }),
|
|
3087
|
+
[dispatchUpdate]
|
|
3088
|
+
);
|
|
3089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3090
|
+
"div",
|
|
3091
|
+
{
|
|
3092
|
+
className: classBase12,
|
|
3093
|
+
...props,
|
|
3094
|
+
style: {
|
|
3095
|
+
...styleProp
|
|
3096
|
+
},
|
|
3097
|
+
children: [
|
|
3098
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core10.Text, { as: "h4", children: "Column Settings" }),
|
|
3099
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3100
|
+
import_vuu_layout3.Stack,
|
|
3101
|
+
{
|
|
3102
|
+
active: activeTab,
|
|
3103
|
+
showTabs: true,
|
|
3104
|
+
className: (0, import_classnames9.default)(`${classBase12}-columnTabs`),
|
|
3105
|
+
onTabSelectionChanged: setActiveTab,
|
|
3106
|
+
TabstripProps: tabstripProps2,
|
|
3107
|
+
children: [
|
|
3108
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core10.Panel, { title: "Column", children: [
|
|
3109
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_salt_lab11.FormField, { label: "Hidden", labelPlacement: "left", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3110
|
+
import_salt_lab11.Checkbox,
|
|
3111
|
+
{
|
|
3112
|
+
checked: column.hidden === true,
|
|
3113
|
+
onChange: handleChangeHidden
|
|
3114
|
+
}
|
|
3115
|
+
) }),
|
|
3116
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_salt_lab11.FormField, { label: "Label", labelPlacement: "left", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3117
|
+
import_salt_lab11.Input,
|
|
3118
|
+
{
|
|
3119
|
+
value: (_a = column.label) != null ? _a : column.name,
|
|
3120
|
+
onChange: handleChangeLabel
|
|
3121
|
+
}
|
|
3122
|
+
) }),
|
|
3123
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_salt_lab11.FormField, { label: "Width", labelPlacement: "left", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3124
|
+
import_salt_lab11.StepperInput,
|
|
3125
|
+
{
|
|
3126
|
+
value: (_b = column.width) != null ? _b : 100,
|
|
3127
|
+
onChange: handleChangeWidth
|
|
3128
|
+
}
|
|
3129
|
+
) }),
|
|
3130
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3131
|
+
import_salt_lab11.FormField,
|
|
3132
|
+
{
|
|
3133
|
+
label: "Align",
|
|
3134
|
+
labelPlacement: "left",
|
|
3135
|
+
ActivationIndicatorComponent: NullActivationIndicator3,
|
|
3136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3137
|
+
import_salt_lab11.RadioButtonGroup,
|
|
3138
|
+
{
|
|
3139
|
+
"aria-label": "Column Align",
|
|
3140
|
+
value: (_c = column.align) != null ? _c : "left",
|
|
3141
|
+
legend: "Align",
|
|
3142
|
+
onChange: handleChangeAlign,
|
|
3143
|
+
children: [
|
|
3144
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_salt_lab11.RadioButton, { label: "Left", value: "left" }),
|
|
3145
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_salt_lab11.RadioButton, { label: "Right", value: "right" })
|
|
3146
|
+
]
|
|
3147
|
+
}
|
|
3148
|
+
)
|
|
3149
|
+
}
|
|
3150
|
+
),
|
|
3151
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3152
|
+
import_salt_lab11.FormField,
|
|
3153
|
+
{
|
|
3154
|
+
label: "Pin Column",
|
|
3155
|
+
labelPlacement: "left",
|
|
3156
|
+
ActivationIndicatorComponent: NullActivationIndicator3,
|
|
3157
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3158
|
+
import_salt_lab11.RadioButtonGroup,
|
|
3159
|
+
{
|
|
3160
|
+
"aria-label": "Pin Column",
|
|
3161
|
+
value: (_d = column.pin) != null ? _d : "",
|
|
3162
|
+
legend: "Pin Column",
|
|
3163
|
+
onChange: handleChangePin,
|
|
3164
|
+
children: [
|
|
3165
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_salt_lab11.RadioButton, { label: "Do not pin", value: "" }),
|
|
3166
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_salt_lab11.RadioButton, { label: "Left", value: "left" }),
|
|
3167
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_salt_lab11.RadioButton, { label: "Right", value: "right" })
|
|
3168
|
+
]
|
|
3169
|
+
}
|
|
3170
|
+
)
|
|
3171
|
+
}
|
|
3172
|
+
)
|
|
3173
|
+
] }),
|
|
3174
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3175
|
+
ColumnTypePanel2,
|
|
3176
|
+
{
|
|
3177
|
+
column,
|
|
3178
|
+
dispatchColumnAction,
|
|
3179
|
+
title: "Data Cell"
|
|
3180
|
+
}
|
|
3181
|
+
),
|
|
3182
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core10.Panel, { title: "Vuu", variant: "secondary", children: [
|
|
3183
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3184
|
+
import_salt_lab11.FormField,
|
|
3185
|
+
{
|
|
3186
|
+
label: "Name",
|
|
3187
|
+
labelPlacement: "top",
|
|
3188
|
+
readOnly: true,
|
|
3189
|
+
variant: "secondary",
|
|
3190
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_salt_lab11.Input, { value: column.name })
|
|
3191
|
+
}
|
|
3192
|
+
),
|
|
3193
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3194
|
+
import_salt_lab11.FormField,
|
|
3195
|
+
{
|
|
3196
|
+
label: "Vuu type",
|
|
3197
|
+
labelPlacement: "top",
|
|
3198
|
+
readOnly: true,
|
|
3199
|
+
variant: "secondary",
|
|
3200
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_salt_lab11.Input, { value: column.serverDataType })
|
|
3201
|
+
}
|
|
3202
|
+
)
|
|
3203
|
+
] })
|
|
3204
|
+
]
|
|
3205
|
+
}
|
|
3206
|
+
)
|
|
3207
|
+
]
|
|
3208
|
+
}
|
|
3209
|
+
);
|
|
3210
|
+
};
|
|
2862
3211
|
//# sourceMappingURL=index.js.map
|