@vuu-ui/vuu-table-extras 0.6.25-debug → 0.6.26-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 +205 -157
- package/cjs/index.js.map +4 -4
- package/esm/index.js +188 -135
- package/esm/index.js.map +4 -4
- package/index.css +36 -0
- package/index.css.map +3 -3
- package/package.json +9 -9
- package/types/cell-renderers/index.d.ts +1 -0
- package/types/cell-renderers/progress-cell/ProgressCell.d.ts +1 -0
- package/types/cell-renderers/progress-cell/index.d.ts +1 -0
package/cjs/index.js
CHANGED
|
@@ -96,12 +96,12 @@ var FlashStyle = {
|
|
|
96
96
|
ArrowBackground: "arrow-bg"
|
|
97
97
|
};
|
|
98
98
|
var getFlashStyle = (colType) => {
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return renderer && "flashStyle" in renderer || FlashStyle.BackgroundOnly;
|
|
99
|
+
if ((0, import_vuu_utils3.isTypeDescriptor)(colType) && colType.renderer) {
|
|
100
|
+
if ("flashStyle" in colType.renderer) {
|
|
101
|
+
return colType.renderer["flashStyle"];
|
|
102
|
+
}
|
|
104
103
|
}
|
|
104
|
+
return FlashStyle.BackgroundOnly;
|
|
105
105
|
};
|
|
106
106
|
var BackgroundCell = ({ column, row }) => {
|
|
107
107
|
const { key, type, valueFormatter } = column;
|
|
@@ -123,9 +123,58 @@ var BackgroundCell = ({ column, row }) => {
|
|
|
123
123
|
serverDataType: ["long", "int", "double"]
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
+
// src/cell-renderers/progress-cell/ProgressCell.tsx
|
|
127
|
+
var import_vuu_utils4 = require("@vuu-ui/vuu-utils");
|
|
128
|
+
var import_classnames2 = __toESM(require("classnames"), 1);
|
|
129
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
130
|
+
var classBase2 = "vuuProgressCell";
|
|
131
|
+
var ProgressCell = ({ column, columnMap, row }) => {
|
|
132
|
+
const { type } = column;
|
|
133
|
+
const value = row[column.key];
|
|
134
|
+
let showProgress = false;
|
|
135
|
+
let percentage = 0;
|
|
136
|
+
if ((0, import_vuu_utils4.isTypeDescriptor)(type) && (0, import_vuu_utils4.isColumnTypeRenderer)(type.renderer)) {
|
|
137
|
+
const { associatedField } = type.renderer;
|
|
138
|
+
const associatedValue = row[columnMap[associatedField]];
|
|
139
|
+
if (typeof value === "number" && typeof associatedValue === "number") {
|
|
140
|
+
percentage = Math.min(Math.round(value / associatedValue * 100), 100);
|
|
141
|
+
showProgress = isFinite(percentage);
|
|
142
|
+
} else {
|
|
143
|
+
const floatValue = parseFloat(value);
|
|
144
|
+
if (Number.isFinite(floatValue)) {
|
|
145
|
+
const floatOtherValue = parseFloat(associatedValue);
|
|
146
|
+
if (Number.isFinite(floatOtherValue)) {
|
|
147
|
+
percentage = Math.min(
|
|
148
|
+
Math.round(floatValue / floatOtherValue * 100),
|
|
149
|
+
100
|
|
150
|
+
);
|
|
151
|
+
showProgress = isFinite(percentage);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const className = (0, import_classnames2.default)(classBase2, {});
|
|
157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className, tabIndex: -1, children: [
|
|
158
|
+
showProgress ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: `${classBase2}-track`, children: [
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `${classBase2}-bg` }),
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
161
|
+
"span",
|
|
162
|
+
{
|
|
163
|
+
className: `${classBase2}-bar`,
|
|
164
|
+
style: { "--progress-bar-pct": `-${100 - percentage}%` }
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
] }) : null,
|
|
168
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `${classBase2}-text`, children: `${percentage} %` })
|
|
169
|
+
] });
|
|
170
|
+
};
|
|
171
|
+
(0, import_vuu_utils4.registerComponent)("vuu.progress", ProgressCell, "cell-renderer", {
|
|
172
|
+
serverDataType: ["long", "int", "double"]
|
|
173
|
+
});
|
|
174
|
+
|
|
126
175
|
// src/column-expression-input/useColumnExpressionEditor.ts
|
|
127
176
|
var import_vuu_codemirror5 = require("@vuu-ui/vuu-codemirror");
|
|
128
|
-
var
|
|
177
|
+
var import_vuu_utils5 = require("@vuu-ui/vuu-utils");
|
|
129
178
|
var import_react3 = require("react");
|
|
130
179
|
|
|
131
180
|
// src/column-expression-input/column-language-parser/ColumnExpressionLanguage.ts
|
|
@@ -1161,8 +1210,8 @@ var noop = () => console.log("noooop");
|
|
|
1161
1210
|
var hasExpressionType = (completion) => "expressionType" in completion;
|
|
1162
1211
|
var injectOptionContent = (completion) => {
|
|
1163
1212
|
if (hasExpressionType(completion)) {
|
|
1164
|
-
const div = (0,
|
|
1165
|
-
const span = (0,
|
|
1213
|
+
const div = (0, import_vuu_utils5.createEl)("div", "expression-type-container");
|
|
1214
|
+
const span = (0, import_vuu_utils5.createEl)("span", "expression-type", completion.expressionType);
|
|
1166
1215
|
div.appendChild(span);
|
|
1167
1216
|
return div;
|
|
1168
1217
|
} else {
|
|
@@ -1279,8 +1328,8 @@ var useColumnExpressionEditor = ({
|
|
|
1279
1328
|
};
|
|
1280
1329
|
|
|
1281
1330
|
// src/column-expression-input/ColumnExpressionInput.tsx
|
|
1282
|
-
var
|
|
1283
|
-
var
|
|
1331
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1332
|
+
var classBase3 = "vuuColumnExpressionInput";
|
|
1284
1333
|
var ColumnExpressionInput = ({
|
|
1285
1334
|
onChange,
|
|
1286
1335
|
onSubmitExpression,
|
|
@@ -1291,13 +1340,13 @@ var ColumnExpressionInput = ({
|
|
|
1291
1340
|
onSubmitExpression,
|
|
1292
1341
|
suggestionProvider
|
|
1293
1342
|
});
|
|
1294
|
-
return /* @__PURE__ */ (0,
|
|
1343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: `${classBase3}`, ref: editorRef });
|
|
1295
1344
|
};
|
|
1296
1345
|
|
|
1297
1346
|
// src/column-expression-input/useColumnExpressionSuggestionProvider.ts
|
|
1298
1347
|
var import_vuu_codemirror6 = require("@vuu-ui/vuu-codemirror");
|
|
1299
1348
|
var import_vuu_data = require("@vuu-ui/vuu-data");
|
|
1300
|
-
var
|
|
1349
|
+
var import_vuu_utils7 = require("@vuu-ui/vuu-utils");
|
|
1301
1350
|
var import_react4 = require("react");
|
|
1302
1351
|
|
|
1303
1352
|
// src/column-expression-input/column-function-descriptors.ts
|
|
@@ -1573,7 +1622,7 @@ var columnFunctionDescriptors = [
|
|
|
1573
1622
|
];
|
|
1574
1623
|
|
|
1575
1624
|
// src/column-expression-input/functionDocInfo.ts
|
|
1576
|
-
var
|
|
1625
|
+
var import_vuu_utils6 = require("@vuu-ui/vuu-utils");
|
|
1577
1626
|
var functionDocInfo = ({
|
|
1578
1627
|
name,
|
|
1579
1628
|
description,
|
|
@@ -1581,25 +1630,25 @@ var functionDocInfo = ({
|
|
|
1581
1630
|
params,
|
|
1582
1631
|
type
|
|
1583
1632
|
}) => {
|
|
1584
|
-
const rootElement = (0,
|
|
1585
|
-
const headingElement = (0,
|
|
1586
|
-
const nameElement = (0,
|
|
1587
|
-
const paramElement = (0,
|
|
1588
|
-
const typeElement = (0,
|
|
1633
|
+
const rootElement = (0, import_vuu_utils6.createEl)("div", "vuuFunctionDoc");
|
|
1634
|
+
const headingElement = (0, import_vuu_utils6.createEl)("div", "function-heading");
|
|
1635
|
+
const nameElement = (0, import_vuu_utils6.createEl)("span", "function-name", name);
|
|
1636
|
+
const paramElement = (0, import_vuu_utils6.createEl)("span", "param-list", params.description);
|
|
1637
|
+
const typeElement = (0, import_vuu_utils6.createEl)("span", "function-type", type);
|
|
1589
1638
|
headingElement.appendChild(nameElement);
|
|
1590
1639
|
headingElement.appendChild(paramElement);
|
|
1591
1640
|
headingElement.appendChild(typeElement);
|
|
1592
|
-
const child2 = (0,
|
|
1641
|
+
const child2 = (0, import_vuu_utils6.createEl)("p", void 0, description);
|
|
1593
1642
|
rootElement.appendChild(headingElement);
|
|
1594
1643
|
rootElement.appendChild(child2);
|
|
1595
1644
|
if (example) {
|
|
1596
|
-
const exampleElement = (0,
|
|
1597
|
-
const expressionElement = (0,
|
|
1645
|
+
const exampleElement = (0, import_vuu_utils6.createEl)("div", "example-container", "Example:");
|
|
1646
|
+
const expressionElement = (0, import_vuu_utils6.createEl)(
|
|
1598
1647
|
"div",
|
|
1599
1648
|
"example-expression",
|
|
1600
1649
|
example.expression
|
|
1601
1650
|
);
|
|
1602
|
-
const resultElement = (0,
|
|
1651
|
+
const resultElement = (0, import_vuu_utils6.createEl)("div", "example-result", example.result);
|
|
1603
1652
|
exampleElement.appendChild(expressionElement);
|
|
1604
1653
|
exampleElement.appendChild(resultElement);
|
|
1605
1654
|
rootElement.appendChild(exampleElement);
|
|
@@ -1618,15 +1667,15 @@ var withApplySpace = (suggestions) => suggestions.map((suggestion) => {
|
|
|
1618
1667
|
});
|
|
1619
1668
|
var getValidColumns = (columns, { functionName, operator }) => {
|
|
1620
1669
|
if (operator) {
|
|
1621
|
-
return columns.filter(
|
|
1670
|
+
return columns.filter(import_vuu_utils7.isNumericColumn);
|
|
1622
1671
|
} else if (functionName) {
|
|
1623
1672
|
const fn = columnFunctionDescriptors.find((f) => f.name === functionName);
|
|
1624
1673
|
if (fn) {
|
|
1625
1674
|
switch (fn.accepts) {
|
|
1626
1675
|
case "string":
|
|
1627
|
-
return columns.filter(
|
|
1676
|
+
return columns.filter(import_vuu_utils7.isTextColumn);
|
|
1628
1677
|
case "number":
|
|
1629
|
-
return columns.filter(
|
|
1678
|
+
return columns.filter(import_vuu_utils7.isNumericColumn);
|
|
1630
1679
|
default:
|
|
1631
1680
|
return columns;
|
|
1632
1681
|
}
|
|
@@ -1655,7 +1704,7 @@ var arithmeticOperators = [
|
|
|
1655
1704
|
{ apply: "- ", boost: 2, label: "-", type: "operator" }
|
|
1656
1705
|
];
|
|
1657
1706
|
var getOperators = (column) => {
|
|
1658
|
-
if (column === void 0 || (0,
|
|
1707
|
+
if (column === void 0 || (0, import_vuu_utils7.isNumericColumn)(column)) {
|
|
1659
1708
|
return arithmeticOperators;
|
|
1660
1709
|
} else {
|
|
1661
1710
|
return NO_OPERATORS;
|
|
@@ -1816,7 +1865,7 @@ var useColumnExpressionSuggestionProvider = ({
|
|
|
1816
1865
|
|
|
1817
1866
|
// src/datagrid-configuration-ui/settings-panel/DatagridSettingsPanel.tsx
|
|
1818
1867
|
var import_core7 = require("@salt-ds/core");
|
|
1819
|
-
var
|
|
1868
|
+
var import_classnames6 = __toESM(require("classnames"), 1);
|
|
1820
1869
|
var import_react12 = require("react");
|
|
1821
1870
|
|
|
1822
1871
|
// src/datagrid-configuration-ui/column-picker/ColumnPicker.tsx
|
|
@@ -1826,9 +1875,9 @@ var import_react5 = require("react");
|
|
|
1826
1875
|
|
|
1827
1876
|
// src/datagrid-configuration-ui/column-picker/ColumnListItem.tsx
|
|
1828
1877
|
var import_salt_lab = require("@heswell/salt-lab");
|
|
1829
|
-
var
|
|
1830
|
-
var
|
|
1831
|
-
var
|
|
1878
|
+
var import_classnames3 = __toESM(require("classnames"), 1);
|
|
1879
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1880
|
+
var classBase4 = "vuuColumnListItem";
|
|
1832
1881
|
var ColumnListItem = ({
|
|
1833
1882
|
className: classNameProp,
|
|
1834
1883
|
item,
|
|
@@ -1836,20 +1885,20 @@ var ColumnListItem = ({
|
|
|
1836
1885
|
style: styleProp,
|
|
1837
1886
|
...restProps
|
|
1838
1887
|
}) => {
|
|
1839
|
-
const className = (0,
|
|
1840
|
-
[`${
|
|
1841
|
-
[`${
|
|
1888
|
+
const className = (0, import_classnames3.default)(classBase4, classNameProp, {
|
|
1889
|
+
[`${classBase4}-calculated`]: item == null ? void 0 : item.expression,
|
|
1890
|
+
[`${classBase4}-hidden`]: item == null ? void 0 : item.hidden
|
|
1842
1891
|
});
|
|
1843
|
-
return /* @__PURE__ */ (0,
|
|
1844
|
-
/* @__PURE__ */ (0,
|
|
1845
|
-
/* @__PURE__ */ (0,
|
|
1846
|
-
/* @__PURE__ */ (0,
|
|
1892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_salt_lab.ListItem, { className, ...restProps, children: [
|
|
1893
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${classBase4}-iconType` }),
|
|
1894
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { className: `${classBase4}-label`, children: label }),
|
|
1895
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${classBase4}-iconHidden` })
|
|
1847
1896
|
] });
|
|
1848
1897
|
};
|
|
1849
1898
|
|
|
1850
1899
|
// src/datagrid-configuration-ui/column-picker/ColumnPicker.tsx
|
|
1851
|
-
var
|
|
1852
|
-
var
|
|
1900
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1901
|
+
var classBase5 = "vuuColumnPicker";
|
|
1853
1902
|
var removeSelectedColumns = (availableColumns, selectedColumns) => {
|
|
1854
1903
|
return availableColumns.filter(
|
|
1855
1904
|
(column) => selectedColumns.find((col) => col.name === column.name) == null
|
|
@@ -1899,15 +1948,15 @@ var ColumnPicker = ({
|
|
|
1899
1948
|
},
|
|
1900
1949
|
[dispatch]
|
|
1901
1950
|
);
|
|
1902
|
-
return /* @__PURE__ */ (0,
|
|
1903
|
-
/* @__PURE__ */ (0,
|
|
1904
|
-
/* @__PURE__ */ (0,
|
|
1905
|
-
/* @__PURE__ */ (0,
|
|
1951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: classBase5, id, children: [
|
|
1952
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: `${classBase5}-listColumn`, children: [
|
|
1953
|
+
/* @__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" }) }),
|
|
1954
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1906
1955
|
"div",
|
|
1907
1956
|
{
|
|
1908
|
-
className: `${
|
|
1957
|
+
className: `${classBase5}-listContainer`,
|
|
1909
1958
|
style: { flex: 1, overflow: "hidden" },
|
|
1910
|
-
children: /* @__PURE__ */ (0,
|
|
1959
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1911
1960
|
import_salt_lab2.List,
|
|
1912
1961
|
{
|
|
1913
1962
|
borderless: true,
|
|
@@ -1924,7 +1973,7 @@ var ColumnPicker = ({
|
|
|
1924
1973
|
)
|
|
1925
1974
|
}
|
|
1926
1975
|
),
|
|
1927
|
-
/* @__PURE__ */ (0,
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1928
1977
|
"div",
|
|
1929
1978
|
{
|
|
1930
1979
|
style: {
|
|
@@ -1933,21 +1982,21 @@ var ColumnPicker = ({
|
|
|
1933
1982
|
flex: "0 0 32px",
|
|
1934
1983
|
marginTop: "var(--salt-size-basis-unit)"
|
|
1935
1984
|
},
|
|
1936
|
-
children: /* @__PURE__ */ (0,
|
|
1985
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_core.Button, { onClick: addColumn2, disabled: selected1.length === 0, children: [
|
|
1937
1986
|
"Show",
|
|
1938
|
-
/* @__PURE__ */ (0,
|
|
1987
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "data-icon": "arrow-thin-right", style: { marginLeft: 8 } })
|
|
1939
1988
|
] })
|
|
1940
1989
|
}
|
|
1941
1990
|
)
|
|
1942
1991
|
] }),
|
|
1943
|
-
/* @__PURE__ */ (0,
|
|
1944
|
-
/* @__PURE__ */ (0,
|
|
1945
|
-
/* @__PURE__ */ (0,
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: `${classBase5}-listColumn`, children: [
|
|
1993
|
+
/* @__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" }) }),
|
|
1994
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1946
1995
|
"div",
|
|
1947
1996
|
{
|
|
1948
|
-
className: `${
|
|
1997
|
+
className: `${classBase5}-listContainer`,
|
|
1949
1998
|
style: { flex: 1, overflow: "hidden" },
|
|
1950
|
-
children: /* @__PURE__ */ (0,
|
|
1999
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1951
2000
|
import_salt_lab2.List,
|
|
1952
2001
|
{
|
|
1953
2002
|
ListItem: ColumnListItem,
|
|
@@ -1966,7 +2015,7 @@ var ColumnPicker = ({
|
|
|
1966
2015
|
)
|
|
1967
2016
|
}
|
|
1968
2017
|
),
|
|
1969
|
-
/* @__PURE__ */ (0,
|
|
2018
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1970
2019
|
"div",
|
|
1971
2020
|
{
|
|
1972
2021
|
style: {
|
|
@@ -1977,38 +2026,38 @@ var ColumnPicker = ({
|
|
|
1977
2026
|
marginTop: "var(--salt-size-basis-unit)"
|
|
1978
2027
|
},
|
|
1979
2028
|
children: [
|
|
1980
|
-
/* @__PURE__ */ (0,
|
|
1981
|
-
/* @__PURE__ */ (0,
|
|
2029
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_core.Button, { onClick: removeColumn2, disabled: selectedColumn === null, children: [
|
|
2030
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "data-icon": "arrow-thin-left", style: { marginRight: 8 } }),
|
|
1982
2031
|
"Hide"
|
|
1983
2032
|
] }),
|
|
1984
|
-
/* @__PURE__ */ (0,
|
|
2033
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1985
2034
|
import_core.Button,
|
|
1986
2035
|
{
|
|
1987
2036
|
"aria-label": "Move column up",
|
|
1988
2037
|
onClick: moveColumnUp,
|
|
1989
2038
|
disabled: selectedColumn === null || (chosenColumns == null ? void 0 : chosenColumns.indexOf(selectedColumn)) === 0,
|
|
1990
2039
|
style: { width: 28 },
|
|
1991
|
-
children: /* @__PURE__ */ (0,
|
|
2040
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "data-icon": "arrow-thin-up" })
|
|
1992
2041
|
}
|
|
1993
2042
|
),
|
|
1994
|
-
/* @__PURE__ */ (0,
|
|
2043
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1995
2044
|
import_core.Button,
|
|
1996
2045
|
{
|
|
1997
2046
|
"aria-label": "Move column down",
|
|
1998
2047
|
onClick: moveColumnDown,
|
|
1999
2048
|
disabled: selectedColumn === null || chosenColumns.indexOf(selectedColumn) === chosenColumns.length - 1,
|
|
2000
2049
|
style: { width: 28 },
|
|
2001
|
-
children: /* @__PURE__ */ (0,
|
|
2050
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "data-icon": "arrow-thin-down" })
|
|
2002
2051
|
}
|
|
2003
2052
|
),
|
|
2004
|
-
/* @__PURE__ */ (0,
|
|
2053
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2005
2054
|
import_core.Button,
|
|
2006
2055
|
{
|
|
2007
2056
|
"aria-label": "Add calculated column",
|
|
2008
|
-
className: `${
|
|
2057
|
+
className: `${classBase5}-addCalculatedColumn`,
|
|
2009
2058
|
onClick: onAddCalculatedColumnClick,
|
|
2010
2059
|
variant: "primary",
|
|
2011
|
-
children: /* @__PURE__ */ (0,
|
|
2060
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "data-icon": "add" })
|
|
2012
2061
|
}
|
|
2013
2062
|
)
|
|
2014
2063
|
]
|
|
@@ -2022,21 +2071,21 @@ var ColumnPicker = ({
|
|
|
2022
2071
|
var import_vuu_layout = require("@vuu-ui/vuu-layout");
|
|
2023
2072
|
var import_salt_lab5 = require("@heswell/salt-lab");
|
|
2024
2073
|
var import_core4 = require("@salt-ds/core");
|
|
2025
|
-
var
|
|
2074
|
+
var import_classnames5 = __toESM(require("classnames"), 1);
|
|
2026
2075
|
var import_react8 = require("react");
|
|
2027
2076
|
|
|
2028
2077
|
// src/datagrid-configuration-ui/column-type-panel/ColumnTypePanel.tsx
|
|
2029
|
-
var
|
|
2078
|
+
var import_vuu_utils8 = require("@vuu-ui/vuu-utils");
|
|
2030
2079
|
var import_salt_lab4 = require("@heswell/salt-lab");
|
|
2031
2080
|
var import_core3 = require("@salt-ds/core");
|
|
2032
|
-
var
|
|
2081
|
+
var import_classnames4 = __toESM(require("classnames"), 1);
|
|
2033
2082
|
var import_react7 = require("react");
|
|
2034
2083
|
|
|
2035
2084
|
// src/datagrid-configuration-ui/column-type-panel/NumericColumnPanel.tsx
|
|
2036
2085
|
var import_salt_lab3 = require("@heswell/salt-lab");
|
|
2037
2086
|
var import_core2 = require("@salt-ds/core");
|
|
2038
2087
|
var import_react6 = require("react");
|
|
2039
|
-
var
|
|
2088
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2040
2089
|
var defaultValues = {
|
|
2041
2090
|
alignOnDecimals: false,
|
|
2042
2091
|
decimals: 4,
|
|
@@ -2087,9 +2136,9 @@ var NumericColumnPanel = ({
|
|
|
2087
2136
|
);
|
|
2088
2137
|
switch (column.serverDataType) {
|
|
2089
2138
|
case "double":
|
|
2090
|
-
return /* @__PURE__ */ (0,
|
|
2091
|
-
/* @__PURE__ */ (0,
|
|
2092
|
-
/* @__PURE__ */ (0,
|
|
2139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
2140
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_salt_lab3.FormField, { label: "No of Decimals", labelPlacement: "top", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_salt_lab3.StepperInput, { value: decimals, onChange: handleChangeDecimals }) }),
|
|
2141
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2093
2142
|
import_salt_lab3.Switch,
|
|
2094
2143
|
{
|
|
2095
2144
|
checked: alignOnDecimals,
|
|
@@ -2098,7 +2147,7 @@ var NumericColumnPanel = ({
|
|
|
2098
2147
|
onChange: handleChangeAlignOnDecimals
|
|
2099
2148
|
}
|
|
2100
2149
|
),
|
|
2101
|
-
/* @__PURE__ */ (0,
|
|
2150
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2102
2151
|
import_salt_lab3.Switch,
|
|
2103
2152
|
{
|
|
2104
2153
|
checked: zeroPad,
|
|
@@ -2110,29 +2159,29 @@ var NumericColumnPanel = ({
|
|
|
2110
2159
|
] });
|
|
2111
2160
|
case "long":
|
|
2112
2161
|
case "int":
|
|
2113
|
-
return /* @__PURE__ */ (0,
|
|
2162
|
+
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" }) });
|
|
2114
2163
|
default:
|
|
2115
2164
|
return null;
|
|
2116
2165
|
}
|
|
2117
2166
|
};
|
|
2118
2167
|
|
|
2119
2168
|
// src/datagrid-configuration-ui/column-type-panel/StringColumnPanel.tsx
|
|
2120
|
-
var
|
|
2169
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2121
2170
|
var StringColumnPanel = ({
|
|
2122
2171
|
column,
|
|
2123
2172
|
dispatchColumnAction
|
|
2124
2173
|
}) => {
|
|
2125
|
-
return /* @__PURE__ */ (0,
|
|
2174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: "String" });
|
|
2126
2175
|
};
|
|
2127
2176
|
|
|
2128
2177
|
// src/datagrid-configuration-ui/column-type-panel/ColumnTypePanel.tsx
|
|
2129
|
-
var
|
|
2130
|
-
var
|
|
2178
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2179
|
+
var classBase6 = "vuuColumnTypePanel";
|
|
2131
2180
|
var integerCellRenderers = ["Default Renderer (int, long)"];
|
|
2132
2181
|
var doubleCellRenderers = ["Default Renderer (double)"];
|
|
2133
2182
|
var stringCellRenderers = ["Default Renderer (string)"];
|
|
2134
2183
|
var getAvailableCellRenderers = (column) => {
|
|
2135
|
-
const customCellRenderers = (0,
|
|
2184
|
+
const customCellRenderers = (0, import_vuu_utils8.getRegisteredCellRenderers)(column.serverDataType);
|
|
2136
2185
|
const customRendererNames = customCellRenderers.map((r) => r.name);
|
|
2137
2186
|
console.log({ customRendererNames });
|
|
2138
2187
|
switch (column.serverDataType) {
|
|
@@ -2159,7 +2208,7 @@ var ColumnTypePanel = ({
|
|
|
2159
2208
|
case "double":
|
|
2160
2209
|
case "int":
|
|
2161
2210
|
case "long":
|
|
2162
|
-
return /* @__PURE__ */ (0,
|
|
2211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2163
2212
|
NumericColumnPanel,
|
|
2164
2213
|
{
|
|
2165
2214
|
column,
|
|
@@ -2167,7 +2216,7 @@ var ColumnTypePanel = ({
|
|
|
2167
2216
|
}
|
|
2168
2217
|
);
|
|
2169
2218
|
default:
|
|
2170
|
-
return /* @__PURE__ */ (0,
|
|
2219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2171
2220
|
StringColumnPanel,
|
|
2172
2221
|
{
|
|
2173
2222
|
column,
|
|
@@ -2178,21 +2227,21 @@ var ColumnTypePanel = ({
|
|
|
2178
2227
|
}, [column, dispatchColumnAction]);
|
|
2179
2228
|
const { serverDataType = "string" } = column;
|
|
2180
2229
|
const availableRenderers = getAvailableCellRenderers(column);
|
|
2181
|
-
return /* @__PURE__ */ (0,
|
|
2182
|
-
/* @__PURE__ */ (0,
|
|
2230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
2231
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2183
2232
|
import_salt_lab4.Dropdown,
|
|
2184
2233
|
{
|
|
2185
|
-
className: (0,
|
|
2234
|
+
className: (0, import_classnames4.default)(`${classBase6}-renderer`),
|
|
2186
2235
|
fullWidth: true,
|
|
2187
2236
|
selected: availableRenderers[0],
|
|
2188
2237
|
source: availableRenderers
|
|
2189
2238
|
}
|
|
2190
2239
|
),
|
|
2191
|
-
/* @__PURE__ */ (0,
|
|
2240
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2192
2241
|
import_core3.Panel,
|
|
2193
2242
|
{
|
|
2194
2243
|
...props,
|
|
2195
|
-
className: (0,
|
|
2244
|
+
className: (0, import_classnames4.default)(classBase6, className, `${classBase6}-${serverDataType}`),
|
|
2196
2245
|
children: content
|
|
2197
2246
|
}
|
|
2198
2247
|
)
|
|
@@ -2200,8 +2249,8 @@ var ColumnTypePanel = ({
|
|
|
2200
2249
|
};
|
|
2201
2250
|
|
|
2202
2251
|
// src/datagrid-configuration-ui/column-settings-panel/ColumnSettingsPanel.tsx
|
|
2203
|
-
var
|
|
2204
|
-
var
|
|
2252
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2253
|
+
var classBase7 = "vuuColumnSettingsPanel";
|
|
2205
2254
|
var tabstripProps = {
|
|
2206
2255
|
className: "salt-density-high"
|
|
2207
2256
|
};
|
|
@@ -2242,54 +2291,54 @@ var ColumnSettingsPanel = ({
|
|
|
2242
2291
|
(value) => dispatchUpdate({ width: parseInt(value.toString(), 10) }),
|
|
2243
2292
|
[dispatchUpdate]
|
|
2244
2293
|
);
|
|
2245
|
-
return /* @__PURE__ */ (0,
|
|
2294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2246
2295
|
"div",
|
|
2247
2296
|
{
|
|
2248
|
-
className:
|
|
2297
|
+
className: classBase7,
|
|
2249
2298
|
...props,
|
|
2250
2299
|
style: {
|
|
2251
2300
|
...styleProp
|
|
2252
2301
|
},
|
|
2253
2302
|
children: [
|
|
2254
|
-
/* @__PURE__ */ (0,
|
|
2255
|
-
/* @__PURE__ */ (0,
|
|
2303
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core4.Text, { as: "h4", children: "Column Settings" }),
|
|
2304
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2256
2305
|
import_vuu_layout.Stack,
|
|
2257
2306
|
{
|
|
2258
2307
|
active: activeTab,
|
|
2259
2308
|
showTabs: true,
|
|
2260
|
-
className: (0,
|
|
2309
|
+
className: (0, import_classnames5.default)(`${classBase7}-columnTabs`),
|
|
2261
2310
|
onTabSelectionChanged: setActiveTab,
|
|
2262
2311
|
TabstripProps: tabstripProps,
|
|
2263
2312
|
children: [
|
|
2264
|
-
/* @__PURE__ */ (0,
|
|
2265
|
-
/* @__PURE__ */ (0,
|
|
2313
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core4.Panel, { title: "Column", children: [
|
|
2314
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_salt_lab5.FormField, { label: "Hidden", labelPlacement: "left", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2266
2315
|
import_salt_lab5.Checkbox,
|
|
2267
2316
|
{
|
|
2268
2317
|
checked: column.hidden === true,
|
|
2269
2318
|
onChange: handleChangeHidden
|
|
2270
2319
|
}
|
|
2271
2320
|
) }),
|
|
2272
|
-
/* @__PURE__ */ (0,
|
|
2321
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_salt_lab5.FormField, { label: "Label", labelPlacement: "left", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2273
2322
|
import_salt_lab5.Input,
|
|
2274
2323
|
{
|
|
2275
2324
|
value: (_a = column.label) != null ? _a : column.name,
|
|
2276
2325
|
onChange: handleChangeLabel
|
|
2277
2326
|
}
|
|
2278
2327
|
) }),
|
|
2279
|
-
/* @__PURE__ */ (0,
|
|
2328
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_salt_lab5.FormField, { label: "Width", labelPlacement: "left", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2280
2329
|
import_salt_lab5.StepperInput,
|
|
2281
2330
|
{
|
|
2282
2331
|
value: (_b = column.width) != null ? _b : 100,
|
|
2283
2332
|
onChange: handleChangeWidth
|
|
2284
2333
|
}
|
|
2285
2334
|
) }),
|
|
2286
|
-
/* @__PURE__ */ (0,
|
|
2335
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2287
2336
|
import_salt_lab5.FormField,
|
|
2288
2337
|
{
|
|
2289
2338
|
label: "Align",
|
|
2290
2339
|
labelPlacement: "left",
|
|
2291
2340
|
ActivationIndicatorComponent: NullActivationIndicator,
|
|
2292
|
-
children: /* @__PURE__ */ (0,
|
|
2341
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2293
2342
|
import_salt_lab5.RadioButtonGroup,
|
|
2294
2343
|
{
|
|
2295
2344
|
"aria-label": "Column Align",
|
|
@@ -2297,20 +2346,20 @@ var ColumnSettingsPanel = ({
|
|
|
2297
2346
|
legend: "Align",
|
|
2298
2347
|
onChange: handleChangeAlign,
|
|
2299
2348
|
children: [
|
|
2300
|
-
/* @__PURE__ */ (0,
|
|
2301
|
-
/* @__PURE__ */ (0,
|
|
2349
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_salt_lab5.RadioButton, { label: "Left", value: "left" }),
|
|
2350
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_salt_lab5.RadioButton, { label: "Right", value: "right" })
|
|
2302
2351
|
]
|
|
2303
2352
|
}
|
|
2304
2353
|
)
|
|
2305
2354
|
}
|
|
2306
2355
|
),
|
|
2307
|
-
/* @__PURE__ */ (0,
|
|
2356
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2308
2357
|
import_salt_lab5.FormField,
|
|
2309
2358
|
{
|
|
2310
2359
|
label: "Pin Column",
|
|
2311
2360
|
labelPlacement: "left",
|
|
2312
2361
|
ActivationIndicatorComponent: NullActivationIndicator,
|
|
2313
|
-
children: /* @__PURE__ */ (0,
|
|
2362
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2314
2363
|
import_salt_lab5.RadioButtonGroup,
|
|
2315
2364
|
{
|
|
2316
2365
|
"aria-label": "Pin Column",
|
|
@@ -2318,16 +2367,16 @@ var ColumnSettingsPanel = ({
|
|
|
2318
2367
|
legend: "Pin Column",
|
|
2319
2368
|
onChange: handleChangePin,
|
|
2320
2369
|
children: [
|
|
2321
|
-
/* @__PURE__ */ (0,
|
|
2322
|
-
/* @__PURE__ */ (0,
|
|
2323
|
-
/* @__PURE__ */ (0,
|
|
2370
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_salt_lab5.RadioButton, { label: "Do not pin", value: "" }),
|
|
2371
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_salt_lab5.RadioButton, { label: "Left", value: "left" }),
|
|
2372
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_salt_lab5.RadioButton, { label: "Right", value: "right" })
|
|
2324
2373
|
]
|
|
2325
2374
|
}
|
|
2326
2375
|
)
|
|
2327
2376
|
}
|
|
2328
2377
|
)
|
|
2329
2378
|
] }),
|
|
2330
|
-
/* @__PURE__ */ (0,
|
|
2379
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2331
2380
|
ColumnTypePanel,
|
|
2332
2381
|
{
|
|
2333
2382
|
column,
|
|
@@ -2335,25 +2384,25 @@ var ColumnSettingsPanel = ({
|
|
|
2335
2384
|
title: "Data Cell"
|
|
2336
2385
|
}
|
|
2337
2386
|
),
|
|
2338
|
-
/* @__PURE__ */ (0,
|
|
2339
|
-
/* @__PURE__ */ (0,
|
|
2387
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core4.Panel, { title: "Vuu", variant: "secondary", children: [
|
|
2388
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2340
2389
|
import_salt_lab5.FormField,
|
|
2341
2390
|
{
|
|
2342
2391
|
label: "Name",
|
|
2343
2392
|
labelPlacement: "top",
|
|
2344
2393
|
readOnly: true,
|
|
2345
2394
|
variant: "secondary",
|
|
2346
|
-
children: /* @__PURE__ */ (0,
|
|
2395
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_salt_lab5.Input, { value: column.name })
|
|
2347
2396
|
}
|
|
2348
2397
|
),
|
|
2349
|
-
/* @__PURE__ */ (0,
|
|
2398
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2350
2399
|
import_salt_lab5.FormField,
|
|
2351
2400
|
{
|
|
2352
2401
|
label: "Vuu type",
|
|
2353
2402
|
labelPlacement: "top",
|
|
2354
2403
|
readOnly: true,
|
|
2355
2404
|
variant: "secondary",
|
|
2356
|
-
children: /* @__PURE__ */ (0,
|
|
2405
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_salt_lab5.Input, { value: column.serverDataType })
|
|
2357
2406
|
}
|
|
2358
2407
|
)
|
|
2359
2408
|
] })
|
|
@@ -2369,8 +2418,8 @@ var ColumnSettingsPanel = ({
|
|
|
2369
2418
|
var import_salt_lab6 = require("@heswell/salt-lab");
|
|
2370
2419
|
var import_core5 = require("@salt-ds/core");
|
|
2371
2420
|
var import_react9 = require("react");
|
|
2372
|
-
var
|
|
2373
|
-
var
|
|
2421
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2422
|
+
var classBase8 = "vuuGridSettingsPanel";
|
|
2374
2423
|
var NullActivationIndicator2 = () => null;
|
|
2375
2424
|
var GridSettingsPanel = ({
|
|
2376
2425
|
config,
|
|
@@ -2396,25 +2445,24 @@ var GridSettingsPanel = ({
|
|
|
2396
2445
|
(value) => dispatchUpdate({ columnDefaultWidth: parseInt(value.toString(), 10) }),
|
|
2397
2446
|
[dispatchUpdate]
|
|
2398
2447
|
);
|
|
2399
|
-
|
|
2400
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2401
2449
|
"div",
|
|
2402
2450
|
{
|
|
2403
|
-
className:
|
|
2451
|
+
className: classBase8,
|
|
2404
2452
|
...props,
|
|
2405
2453
|
style: {
|
|
2406
2454
|
...styleProp
|
|
2407
2455
|
},
|
|
2408
2456
|
children: [
|
|
2409
|
-
/* @__PURE__ */ (0,
|
|
2410
|
-
/* @__PURE__ */ (0,
|
|
2411
|
-
/* @__PURE__ */ (0,
|
|
2457
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core5.Text, { as: "h4", children: "Grid Settings" }),
|
|
2458
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core5.Panel, { children: [
|
|
2459
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2412
2460
|
import_salt_lab6.FormField,
|
|
2413
2461
|
{
|
|
2414
2462
|
label: "Format column labels",
|
|
2415
2463
|
labelPlacement: "left",
|
|
2416
2464
|
ActivationIndicatorComponent: NullActivationIndicator2,
|
|
2417
|
-
children: /* @__PURE__ */ (0,
|
|
2465
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2418
2466
|
import_salt_lab6.RadioButtonGroup,
|
|
2419
2467
|
{
|
|
2420
2468
|
"aria-label": "Format column labels",
|
|
@@ -2422,15 +2470,15 @@ var GridSettingsPanel = ({
|
|
|
2422
2470
|
legend: "Format column labels",
|
|
2423
2471
|
onChange: handleChangeLabelFormatting,
|
|
2424
2472
|
children: [
|
|
2425
|
-
/* @__PURE__ */ (0,
|
|
2426
|
-
/* @__PURE__ */ (0,
|
|
2427
|
-
/* @__PURE__ */ (0,
|
|
2473
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_salt_lab6.RadioButton, { label: "No Formatting", value: void 0 }),
|
|
2474
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_salt_lab6.RadioButton, { label: "Capitalize", value: "capitalize" }),
|
|
2475
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_salt_lab6.RadioButton, { label: "Uppercase", value: "uppercase" })
|
|
2428
2476
|
]
|
|
2429
2477
|
}
|
|
2430
2478
|
)
|
|
2431
2479
|
}
|
|
2432
2480
|
),
|
|
2433
|
-
/* @__PURE__ */ (0,
|
|
2481
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_salt_lab6.FormField, { label: "Default Column Width", labelPlacement: "left", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2434
2482
|
import_salt_lab6.StepperInput,
|
|
2435
2483
|
{
|
|
2436
2484
|
value: (_a = config.columnDefaultWidth) != null ? _a : 100,
|
|
@@ -2446,7 +2494,7 @@ var GridSettingsPanel = ({
|
|
|
2446
2494
|
// src/datagrid-configuration-ui/settings-panel/useGridSettings.ts
|
|
2447
2495
|
var import_react10 = require("react");
|
|
2448
2496
|
var import_salt_lab7 = require("@heswell/salt-lab");
|
|
2449
|
-
var
|
|
2497
|
+
var import_vuu_utils9 = require("@vuu-ui/vuu-utils");
|
|
2450
2498
|
var gridSettingsReducer = (state, action) => {
|
|
2451
2499
|
console.log(`gridSettingsReducer ${action.type}`);
|
|
2452
2500
|
switch (action.type) {
|
|
@@ -2563,7 +2611,7 @@ function updateColumnTypeFormatting(state, {
|
|
|
2563
2611
|
if (targetColumn) {
|
|
2564
2612
|
const {
|
|
2565
2613
|
serverDataType = "string",
|
|
2566
|
-
type: columnType = (0,
|
|
2614
|
+
type: columnType = (0, import_vuu_utils9.fromServerDataType)(serverDataType)
|
|
2567
2615
|
} = column;
|
|
2568
2616
|
const type = typeof columnType === "string" ? {
|
|
2569
2617
|
name: columnType
|
|
@@ -2607,7 +2655,7 @@ var import_vuu_layout2 = require("@vuu-ui/vuu-layout");
|
|
|
2607
2655
|
var import_salt_lab8 = require("@heswell/salt-lab");
|
|
2608
2656
|
var import_core6 = require("@salt-ds/core");
|
|
2609
2657
|
var import_react11 = require("react");
|
|
2610
|
-
var
|
|
2658
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2611
2659
|
var CalculatedColumnPanel = ({
|
|
2612
2660
|
columns,
|
|
2613
2661
|
dispatchColumnAction,
|
|
@@ -2650,10 +2698,10 @@ var CalculatedColumnPanel = ({
|
|
|
2650
2698
|
});
|
|
2651
2699
|
}
|
|
2652
2700
|
}, [columnName, dispatchColumnAction]);
|
|
2653
|
-
return /* @__PURE__ */ (0,
|
|
2654
|
-
/* @__PURE__ */ (0,
|
|
2655
|
-
/* @__PURE__ */ (0,
|
|
2656
|
-
/* @__PURE__ */ (0,
|
|
2701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core6.Panel, { className: "vuuCalculatedColumnPanel", title: "Define Computed Column", children: [
|
|
2702
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core6.Text, { styleAs: "h4", children: "Define Computed Column" }),
|
|
2703
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_salt_lab8.FormField, { label: "Column Name", labelPlacement: "left", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_salt_lab8.Input, { value: columnName, onChange: handleChangeName }) }),
|
|
2704
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2657
2705
|
ColumnExpressionInput,
|
|
2658
2706
|
{
|
|
2659
2707
|
onChange: handleChangeExpression,
|
|
@@ -2661,13 +2709,13 @@ var CalculatedColumnPanel = ({
|
|
|
2661
2709
|
suggestionProvider
|
|
2662
2710
|
}
|
|
2663
2711
|
),
|
|
2664
|
-
/* @__PURE__ */ (0,
|
|
2712
|
+
/* @__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" }) })
|
|
2665
2713
|
] });
|
|
2666
2714
|
};
|
|
2667
2715
|
|
|
2668
2716
|
// src/datagrid-configuration-ui/settings-panel/DatagridSettingsPanel.tsx
|
|
2669
|
-
var
|
|
2670
|
-
var
|
|
2717
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2718
|
+
var classBase9 = "vuuDatagridSettingsPanel";
|
|
2671
2719
|
var getTabLabel = () => void 0;
|
|
2672
2720
|
var icons = [
|
|
2673
2721
|
"table-settings",
|
|
@@ -2722,27 +2770,27 @@ var DatagridSettingsPanel = ({
|
|
|
2722
2770
|
[]
|
|
2723
2771
|
);
|
|
2724
2772
|
const panelShift = selectedTabIndex === 2 ? "right" : void 0;
|
|
2725
|
-
return /* @__PURE__ */ (0,
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
2773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { ...props, className: (0, import_classnames6.default)(classBase9, className), children: [
|
|
2774
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2727
2775
|
import_vuu_layout2.Stack,
|
|
2728
2776
|
{
|
|
2729
2777
|
TabstripProps: tabstripProps2,
|
|
2730
|
-
className: `${
|
|
2778
|
+
className: `${classBase9}-stack`,
|
|
2731
2779
|
getTabIcon,
|
|
2732
2780
|
getTabLabel,
|
|
2733
2781
|
active: selectedTabIndex === 2 ? 1 : selectedTabIndex,
|
|
2734
2782
|
onTabSelectionChanged: handleTabSelectionChanged,
|
|
2735
2783
|
showTabs: true,
|
|
2736
2784
|
children: [
|
|
2737
|
-
/* @__PURE__ */ (0,
|
|
2785
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2738
2786
|
GridSettingsPanel,
|
|
2739
2787
|
{
|
|
2740
2788
|
config: gridSettings,
|
|
2741
2789
|
dispatchColumnAction
|
|
2742
2790
|
}
|
|
2743
2791
|
),
|
|
2744
|
-
/* @__PURE__ */ (0,
|
|
2745
|
-
/* @__PURE__ */ (0,
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `${classBase9}-columnPanels`, "data-align": panelShift, children: [
|
|
2793
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2746
2794
|
ColumnPicker,
|
|
2747
2795
|
{
|
|
2748
2796
|
availableColumns,
|
|
@@ -2753,7 +2801,7 @@ var DatagridSettingsPanel = ({
|
|
|
2753
2801
|
selectedColumn
|
|
2754
2802
|
}
|
|
2755
2803
|
),
|
|
2756
|
-
selectedColumn === null ? /* @__PURE__ */ (0,
|
|
2804
|
+
selectedColumn === null ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core7.Panel, { className: "vuuColumnSettingsPanel", children: "Select a column" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2757
2805
|
ColumnSettingsPanel,
|
|
2758
2806
|
{
|
|
2759
2807
|
column: selectedColumn,
|
|
@@ -2762,8 +2810,8 @@ var DatagridSettingsPanel = ({
|
|
|
2762
2810
|
}
|
|
2763
2811
|
)
|
|
2764
2812
|
] }),
|
|
2765
|
-
/* @__PURE__ */ (0,
|
|
2766
|
-
/* @__PURE__ */ (0,
|
|
2813
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { title: "Column Settings", children: "Column Settings" }),
|
|
2814
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2767
2815
|
CalculatedColumnPanel,
|
|
2768
2816
|
{
|
|
2769
2817
|
columns: gridSettings.columns,
|
|
@@ -2774,19 +2822,19 @@ var DatagridSettingsPanel = ({
|
|
|
2774
2822
|
]
|
|
2775
2823
|
}
|
|
2776
2824
|
),
|
|
2777
|
-
/* @__PURE__ */ (0,
|
|
2778
|
-
/* @__PURE__ */ (0,
|
|
2779
|
-
/* @__PURE__ */ (0,
|
|
2780
|
-
/* @__PURE__ */ (0,
|
|
2825
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `${classBase9}-buttonBar`, children: [
|
|
2826
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core7.Button, { onClick: onCancel, children: "Cancel" }),
|
|
2827
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core7.Button, { onClick: handleApply, children: "Apply" }),
|
|
2828
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core7.Button, { onClick: handleSave, children: "Save" })
|
|
2781
2829
|
] })
|
|
2782
2830
|
] });
|
|
2783
2831
|
};
|
|
2784
2832
|
|
|
2785
2833
|
// src/datasource-stats/DatasourceStats.tsx
|
|
2786
2834
|
var import_react13 = require("react");
|
|
2787
|
-
var
|
|
2788
|
-
var
|
|
2789
|
-
var
|
|
2835
|
+
var import_classnames7 = __toESM(require("classnames"), 1);
|
|
2836
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2837
|
+
var classBase10 = "vuuDatasourceStats";
|
|
2790
2838
|
var numberFormatter = new Intl.NumberFormat();
|
|
2791
2839
|
var DataSourceStats = ({
|
|
2792
2840
|
className: classNameProp,
|
|
@@ -2804,17 +2852,17 @@ var DataSourceStats = ({
|
|
|
2804
2852
|
dataSource.on("resize", setSize);
|
|
2805
2853
|
dataSource.on("range", setRange);
|
|
2806
2854
|
}, [dataSource]);
|
|
2807
|
-
const className = (0,
|
|
2855
|
+
const className = (0, import_classnames7.default)(classBase10, classNameProp);
|
|
2808
2856
|
const from = numberFormatter.format(range.from);
|
|
2809
2857
|
const to = numberFormatter.format(range.to - 1);
|
|
2810
2858
|
const value = numberFormatter.format(size);
|
|
2811
|
-
return /* @__PURE__ */ (0,
|
|
2812
|
-
/* @__PURE__ */ (0,
|
|
2813
|
-
/* @__PURE__ */ (0,
|
|
2814
|
-
/* @__PURE__ */ (0,
|
|
2815
|
-
/* @__PURE__ */ (0,
|
|
2816
|
-
/* @__PURE__ */ (0,
|
|
2817
|
-
/* @__PURE__ */ (0,
|
|
2859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className, children: [
|
|
2860
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Showing rows" }),
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: `${classBase10}-range`, children: from }),
|
|
2862
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: `${classBase10}-range`, children: to }),
|
|
2863
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "of" }),
|
|
2864
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: `${classBase10}-size`, children: value }),
|
|
2865
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: `${classBase10}-optimize`, children: optimize })
|
|
2818
2866
|
] });
|
|
2819
2867
|
};
|
|
2820
2868
|
//# sourceMappingURL=index.js.map
|