@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/esm/index.js
CHANGED
|
@@ -21,6 +21,7 @@ var __privateSet = (obj, member, value, setter) => {
|
|
|
21
21
|
import {
|
|
22
22
|
DOWN1,
|
|
23
23
|
DOWN2,
|
|
24
|
+
isTypeDescriptor as isTypeDescriptor2,
|
|
24
25
|
metadataKeys,
|
|
25
26
|
registerComponent,
|
|
26
27
|
UP1,
|
|
@@ -61,12 +62,12 @@ var FlashStyle = {
|
|
|
61
62
|
ArrowBackground: "arrow-bg"
|
|
62
63
|
};
|
|
63
64
|
var getFlashStyle = (colType) => {
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return renderer && "flashStyle" in renderer || FlashStyle.BackgroundOnly;
|
|
65
|
+
if (isTypeDescriptor2(colType) && colType.renderer) {
|
|
66
|
+
if ("flashStyle" in colType.renderer) {
|
|
67
|
+
return colType.renderer["flashStyle"];
|
|
68
|
+
}
|
|
69
69
|
}
|
|
70
|
+
return FlashStyle.BackgroundOnly;
|
|
70
71
|
};
|
|
71
72
|
var BackgroundCell = ({ column, row }) => {
|
|
72
73
|
const { key, type, valueFormatter } = column;
|
|
@@ -88,6 +89,59 @@ registerComponent("background", BackgroundCell, "cell-renderer", {
|
|
|
88
89
|
serverDataType: ["long", "int", "double"]
|
|
89
90
|
});
|
|
90
91
|
|
|
92
|
+
// src/cell-renderers/progress-cell/ProgressCell.tsx
|
|
93
|
+
import {
|
|
94
|
+
isColumnTypeRenderer,
|
|
95
|
+
isTypeDescriptor as isTypeDescriptor3,
|
|
96
|
+
registerComponent as registerComponent2
|
|
97
|
+
} from "@vuu-ui/vuu-utils";
|
|
98
|
+
import cx2 from "classnames";
|
|
99
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
100
|
+
var classBase2 = "vuuProgressCell";
|
|
101
|
+
var ProgressCell = ({ column, columnMap, row }) => {
|
|
102
|
+
const { type } = column;
|
|
103
|
+
const value = row[column.key];
|
|
104
|
+
let showProgress = false;
|
|
105
|
+
let percentage = 0;
|
|
106
|
+
if (isTypeDescriptor3(type) && isColumnTypeRenderer(type.renderer)) {
|
|
107
|
+
const { associatedField } = type.renderer;
|
|
108
|
+
const associatedValue = row[columnMap[associatedField]];
|
|
109
|
+
if (typeof value === "number" && typeof associatedValue === "number") {
|
|
110
|
+
percentage = Math.min(Math.round(value / associatedValue * 100), 100);
|
|
111
|
+
showProgress = isFinite(percentage);
|
|
112
|
+
} else {
|
|
113
|
+
const floatValue = parseFloat(value);
|
|
114
|
+
if (Number.isFinite(floatValue)) {
|
|
115
|
+
const floatOtherValue = parseFloat(associatedValue);
|
|
116
|
+
if (Number.isFinite(floatOtherValue)) {
|
|
117
|
+
percentage = Math.min(
|
|
118
|
+
Math.round(floatValue / floatOtherValue * 100),
|
|
119
|
+
100
|
|
120
|
+
);
|
|
121
|
+
showProgress = isFinite(percentage);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const className = cx2(classBase2, {});
|
|
127
|
+
return /* @__PURE__ */ jsxs2("div", { className, tabIndex: -1, children: [
|
|
128
|
+
showProgress ? /* @__PURE__ */ jsxs2("span", { className: `${classBase2}-track`, children: [
|
|
129
|
+
/* @__PURE__ */ jsx2("span", { className: `${classBase2}-bg` }),
|
|
130
|
+
/* @__PURE__ */ jsx2(
|
|
131
|
+
"span",
|
|
132
|
+
{
|
|
133
|
+
className: `${classBase2}-bar`,
|
|
134
|
+
style: { "--progress-bar-pct": `-${100 - percentage}%` }
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
] }) : null,
|
|
138
|
+
/* @__PURE__ */ jsx2("span", { className: `${classBase2}-text`, children: `${percentage} %` })
|
|
139
|
+
] });
|
|
140
|
+
};
|
|
141
|
+
registerComponent2("vuu.progress", ProgressCell, "cell-renderer", {
|
|
142
|
+
serverDataType: ["long", "int", "double"]
|
|
143
|
+
});
|
|
144
|
+
|
|
91
145
|
// src/column-expression-input/useColumnExpressionEditor.ts
|
|
92
146
|
import {
|
|
93
147
|
autocompletion,
|
|
@@ -1268,8 +1322,8 @@ var useColumnExpressionEditor = ({
|
|
|
1268
1322
|
};
|
|
1269
1323
|
|
|
1270
1324
|
// src/column-expression-input/ColumnExpressionInput.tsx
|
|
1271
|
-
import { jsx as
|
|
1272
|
-
var
|
|
1325
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1326
|
+
var classBase3 = "vuuColumnExpressionInput";
|
|
1273
1327
|
var ColumnExpressionInput = ({
|
|
1274
1328
|
onChange,
|
|
1275
1329
|
onSubmitExpression,
|
|
@@ -1280,7 +1334,7 @@ var ColumnExpressionInput = ({
|
|
|
1280
1334
|
onSubmitExpression,
|
|
1281
1335
|
suggestionProvider
|
|
1282
1336
|
});
|
|
1283
|
-
return /* @__PURE__ */
|
|
1337
|
+
return /* @__PURE__ */ jsx3("div", { className: `${classBase3}`, ref: editorRef });
|
|
1284
1338
|
};
|
|
1285
1339
|
|
|
1286
1340
|
// src/column-expression-input/useColumnExpressionSuggestionProvider.ts
|
|
@@ -1811,7 +1865,7 @@ var useColumnExpressionSuggestionProvider = ({
|
|
|
1811
1865
|
|
|
1812
1866
|
// src/datagrid-configuration-ui/settings-panel/DatagridSettingsPanel.tsx
|
|
1813
1867
|
import { Button as Button3, Panel as Panel5 } from "@salt-ds/core";
|
|
1814
|
-
import
|
|
1868
|
+
import cx6 from "classnames";
|
|
1815
1869
|
import {
|
|
1816
1870
|
useCallback as useCallback8,
|
|
1817
1871
|
useState as useState4
|
|
@@ -1824,9 +1878,9 @@ import { useCallback as useCallback3, useState } from "react";
|
|
|
1824
1878
|
|
|
1825
1879
|
// src/datagrid-configuration-ui/column-picker/ColumnListItem.tsx
|
|
1826
1880
|
import { ListItem } from "@heswell/salt-lab";
|
|
1827
|
-
import
|
|
1828
|
-
import { jsx as
|
|
1829
|
-
var
|
|
1881
|
+
import cx3 from "classnames";
|
|
1882
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1883
|
+
var classBase4 = "vuuColumnListItem";
|
|
1830
1884
|
var ColumnListItem = ({
|
|
1831
1885
|
className: classNameProp,
|
|
1832
1886
|
item,
|
|
@@ -1834,20 +1888,20 @@ var ColumnListItem = ({
|
|
|
1834
1888
|
style: styleProp,
|
|
1835
1889
|
...restProps
|
|
1836
1890
|
}) => {
|
|
1837
|
-
const className =
|
|
1838
|
-
[`${
|
|
1839
|
-
[`${
|
|
1891
|
+
const className = cx3(classBase4, classNameProp, {
|
|
1892
|
+
[`${classBase4}-calculated`]: item == null ? void 0 : item.expression,
|
|
1893
|
+
[`${classBase4}-hidden`]: item == null ? void 0 : item.hidden
|
|
1840
1894
|
});
|
|
1841
|
-
return /* @__PURE__ */
|
|
1842
|
-
/* @__PURE__ */
|
|
1843
|
-
/* @__PURE__ */
|
|
1844
|
-
/* @__PURE__ */
|
|
1895
|
+
return /* @__PURE__ */ jsxs3(ListItem, { className, ...restProps, children: [
|
|
1896
|
+
/* @__PURE__ */ jsx4("span", { className: `${classBase4}-iconType` }),
|
|
1897
|
+
/* @__PURE__ */ jsx4("label", { className: `${classBase4}-label`, children: label }),
|
|
1898
|
+
/* @__PURE__ */ jsx4("span", { className: `${classBase4}-iconHidden` })
|
|
1845
1899
|
] });
|
|
1846
1900
|
};
|
|
1847
1901
|
|
|
1848
1902
|
// src/datagrid-configuration-ui/column-picker/ColumnPicker.tsx
|
|
1849
|
-
import { jsx as
|
|
1850
|
-
var
|
|
1903
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1904
|
+
var classBase5 = "vuuColumnPicker";
|
|
1851
1905
|
var removeSelectedColumns = (availableColumns, selectedColumns) => {
|
|
1852
1906
|
return availableColumns.filter(
|
|
1853
1907
|
(column) => selectedColumns.find((col) => col.name === column.name) == null
|
|
@@ -1897,15 +1951,15 @@ var ColumnPicker = ({
|
|
|
1897
1951
|
},
|
|
1898
1952
|
[dispatch]
|
|
1899
1953
|
);
|
|
1900
|
-
return /* @__PURE__ */
|
|
1901
|
-
/* @__PURE__ */
|
|
1902
|
-
/* @__PURE__ */
|
|
1903
|
-
/* @__PURE__ */
|
|
1954
|
+
return /* @__PURE__ */ jsxs4("div", { className: classBase5, id, children: [
|
|
1955
|
+
/* @__PURE__ */ jsxs4("div", { className: `${classBase5}-listColumn`, children: [
|
|
1956
|
+
/* @__PURE__ */ jsx5("label", { htmlFor: `available-${id}`, children: /* @__PURE__ */ jsx5(Text, { as: "h4", children: "Available Columns" }) }),
|
|
1957
|
+
/* @__PURE__ */ jsx5(
|
|
1904
1958
|
"div",
|
|
1905
1959
|
{
|
|
1906
|
-
className: `${
|
|
1960
|
+
className: `${classBase5}-listContainer`,
|
|
1907
1961
|
style: { flex: 1, overflow: "hidden" },
|
|
1908
|
-
children: /* @__PURE__ */
|
|
1962
|
+
children: /* @__PURE__ */ jsx5(
|
|
1909
1963
|
List,
|
|
1910
1964
|
{
|
|
1911
1965
|
borderless: true,
|
|
@@ -1922,7 +1976,7 @@ var ColumnPicker = ({
|
|
|
1922
1976
|
)
|
|
1923
1977
|
}
|
|
1924
1978
|
),
|
|
1925
|
-
/* @__PURE__ */
|
|
1979
|
+
/* @__PURE__ */ jsx5(
|
|
1926
1980
|
"div",
|
|
1927
1981
|
{
|
|
1928
1982
|
style: {
|
|
@@ -1931,21 +1985,21 @@ var ColumnPicker = ({
|
|
|
1931
1985
|
flex: "0 0 32px",
|
|
1932
1986
|
marginTop: "var(--salt-size-basis-unit)"
|
|
1933
1987
|
},
|
|
1934
|
-
children: /* @__PURE__ */
|
|
1988
|
+
children: /* @__PURE__ */ jsxs4(Button, { onClick: addColumn2, disabled: selected1.length === 0, children: [
|
|
1935
1989
|
"Show",
|
|
1936
|
-
/* @__PURE__ */
|
|
1990
|
+
/* @__PURE__ */ jsx5("span", { "data-icon": "arrow-thin-right", style: { marginLeft: 8 } })
|
|
1937
1991
|
] })
|
|
1938
1992
|
}
|
|
1939
1993
|
)
|
|
1940
1994
|
] }),
|
|
1941
|
-
/* @__PURE__ */
|
|
1942
|
-
/* @__PURE__ */
|
|
1943
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ jsxs4("div", { className: `${classBase5}-listColumn`, children: [
|
|
1996
|
+
/* @__PURE__ */ jsx5("label", { htmlFor: `selected-${id}`, children: /* @__PURE__ */ jsx5(Text, { as: "h4", children: "Included Columns" }) }),
|
|
1997
|
+
/* @__PURE__ */ jsx5(
|
|
1944
1998
|
"div",
|
|
1945
1999
|
{
|
|
1946
|
-
className: `${
|
|
2000
|
+
className: `${classBase5}-listContainer`,
|
|
1947
2001
|
style: { flex: 1, overflow: "hidden" },
|
|
1948
|
-
children: /* @__PURE__ */
|
|
2002
|
+
children: /* @__PURE__ */ jsx5(
|
|
1949
2003
|
List,
|
|
1950
2004
|
{
|
|
1951
2005
|
ListItem: ColumnListItem,
|
|
@@ -1964,7 +2018,7 @@ var ColumnPicker = ({
|
|
|
1964
2018
|
)
|
|
1965
2019
|
}
|
|
1966
2020
|
),
|
|
1967
|
-
/* @__PURE__ */
|
|
2021
|
+
/* @__PURE__ */ jsxs4(
|
|
1968
2022
|
"div",
|
|
1969
2023
|
{
|
|
1970
2024
|
style: {
|
|
@@ -1975,38 +2029,38 @@ var ColumnPicker = ({
|
|
|
1975
2029
|
marginTop: "var(--salt-size-basis-unit)"
|
|
1976
2030
|
},
|
|
1977
2031
|
children: [
|
|
1978
|
-
/* @__PURE__ */
|
|
1979
|
-
/* @__PURE__ */
|
|
2032
|
+
/* @__PURE__ */ jsxs4(Button, { onClick: removeColumn2, disabled: selectedColumn === null, children: [
|
|
2033
|
+
/* @__PURE__ */ jsx5("span", { "data-icon": "arrow-thin-left", style: { marginRight: 8 } }),
|
|
1980
2034
|
"Hide"
|
|
1981
2035
|
] }),
|
|
1982
|
-
/* @__PURE__ */
|
|
2036
|
+
/* @__PURE__ */ jsx5(
|
|
1983
2037
|
Button,
|
|
1984
2038
|
{
|
|
1985
2039
|
"aria-label": "Move column up",
|
|
1986
2040
|
onClick: moveColumnUp,
|
|
1987
2041
|
disabled: selectedColumn === null || (chosenColumns == null ? void 0 : chosenColumns.indexOf(selectedColumn)) === 0,
|
|
1988
2042
|
style: { width: 28 },
|
|
1989
|
-
children: /* @__PURE__ */
|
|
2043
|
+
children: /* @__PURE__ */ jsx5("span", { "data-icon": "arrow-thin-up" })
|
|
1990
2044
|
}
|
|
1991
2045
|
),
|
|
1992
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsx5(
|
|
1993
2047
|
Button,
|
|
1994
2048
|
{
|
|
1995
2049
|
"aria-label": "Move column down",
|
|
1996
2050
|
onClick: moveColumnDown,
|
|
1997
2051
|
disabled: selectedColumn === null || chosenColumns.indexOf(selectedColumn) === chosenColumns.length - 1,
|
|
1998
2052
|
style: { width: 28 },
|
|
1999
|
-
children: /* @__PURE__ */
|
|
2053
|
+
children: /* @__PURE__ */ jsx5("span", { "data-icon": "arrow-thin-down" })
|
|
2000
2054
|
}
|
|
2001
2055
|
),
|
|
2002
|
-
/* @__PURE__ */
|
|
2056
|
+
/* @__PURE__ */ jsx5(
|
|
2003
2057
|
Button,
|
|
2004
2058
|
{
|
|
2005
2059
|
"aria-label": "Add calculated column",
|
|
2006
|
-
className: `${
|
|
2060
|
+
className: `${classBase5}-addCalculatedColumn`,
|
|
2007
2061
|
onClick: onAddCalculatedColumnClick,
|
|
2008
2062
|
variant: "primary",
|
|
2009
|
-
children: /* @__PURE__ */
|
|
2063
|
+
children: /* @__PURE__ */ jsx5("span", { "data-icon": "add" })
|
|
2010
2064
|
}
|
|
2011
2065
|
)
|
|
2012
2066
|
]
|
|
@@ -2027,7 +2081,7 @@ import {
|
|
|
2027
2081
|
StepperInput as StepperInput2
|
|
2028
2082
|
} from "@heswell/salt-lab";
|
|
2029
2083
|
import { Panel as Panel2, Text as Text3 } from "@salt-ds/core";
|
|
2030
|
-
import
|
|
2084
|
+
import cx5 from "classnames";
|
|
2031
2085
|
import {
|
|
2032
2086
|
useCallback as useCallback5,
|
|
2033
2087
|
useState as useState2
|
|
@@ -2037,14 +2091,14 @@ import {
|
|
|
2037
2091
|
import { getRegisteredCellRenderers } from "@vuu-ui/vuu-utils";
|
|
2038
2092
|
import { Dropdown } from "@heswell/salt-lab";
|
|
2039
2093
|
import { Panel } from "@salt-ds/core";
|
|
2040
|
-
import
|
|
2094
|
+
import cx4 from "classnames";
|
|
2041
2095
|
import { useMemo as useMemo2 } from "react";
|
|
2042
2096
|
|
|
2043
2097
|
// src/datagrid-configuration-ui/column-type-panel/NumericColumnPanel.tsx
|
|
2044
2098
|
import { FormField, StepperInput, Switch } from "@heswell/salt-lab";
|
|
2045
2099
|
import { Text as Text2 } from "@salt-ds/core";
|
|
2046
2100
|
import { useCallback as useCallback4 } from "react";
|
|
2047
|
-
import { Fragment, jsx as
|
|
2101
|
+
import { Fragment, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2048
2102
|
var defaultValues = {
|
|
2049
2103
|
alignOnDecimals: false,
|
|
2050
2104
|
decimals: 4,
|
|
@@ -2095,9 +2149,9 @@ var NumericColumnPanel = ({
|
|
|
2095
2149
|
);
|
|
2096
2150
|
switch (column.serverDataType) {
|
|
2097
2151
|
case "double":
|
|
2098
|
-
return /* @__PURE__ */
|
|
2099
|
-
/* @__PURE__ */
|
|
2100
|
-
/* @__PURE__ */
|
|
2152
|
+
return /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
2153
|
+
/* @__PURE__ */ jsx6(FormField, { label: "No of Decimals", labelPlacement: "top", children: /* @__PURE__ */ jsx6(StepperInput, { value: decimals, onChange: handleChangeDecimals }) }),
|
|
2154
|
+
/* @__PURE__ */ jsx6(
|
|
2101
2155
|
Switch,
|
|
2102
2156
|
{
|
|
2103
2157
|
checked: alignOnDecimals,
|
|
@@ -2106,7 +2160,7 @@ var NumericColumnPanel = ({
|
|
|
2106
2160
|
onChange: handleChangeAlignOnDecimals
|
|
2107
2161
|
}
|
|
2108
2162
|
),
|
|
2109
|
-
/* @__PURE__ */
|
|
2163
|
+
/* @__PURE__ */ jsx6(
|
|
2110
2164
|
Switch,
|
|
2111
2165
|
{
|
|
2112
2166
|
checked: zeroPad,
|
|
@@ -2118,24 +2172,24 @@ var NumericColumnPanel = ({
|
|
|
2118
2172
|
] });
|
|
2119
2173
|
case "long":
|
|
2120
2174
|
case "int":
|
|
2121
|
-
return /* @__PURE__ */
|
|
2175
|
+
return /* @__PURE__ */ jsx6(Fragment, { children: /* @__PURE__ */ jsx6(Text2, { children: "Work in progress" }) });
|
|
2122
2176
|
default:
|
|
2123
2177
|
return null;
|
|
2124
2178
|
}
|
|
2125
2179
|
};
|
|
2126
2180
|
|
|
2127
2181
|
// src/datagrid-configuration-ui/column-type-panel/StringColumnPanel.tsx
|
|
2128
|
-
import { Fragment as Fragment2, jsx as
|
|
2182
|
+
import { Fragment as Fragment2, jsx as jsx7 } from "react/jsx-runtime";
|
|
2129
2183
|
var StringColumnPanel = ({
|
|
2130
2184
|
column,
|
|
2131
2185
|
dispatchColumnAction
|
|
2132
2186
|
}) => {
|
|
2133
|
-
return /* @__PURE__ */
|
|
2187
|
+
return /* @__PURE__ */ jsx7(Fragment2, { children: "String" });
|
|
2134
2188
|
};
|
|
2135
2189
|
|
|
2136
2190
|
// src/datagrid-configuration-ui/column-type-panel/ColumnTypePanel.tsx
|
|
2137
|
-
import { Fragment as Fragment3, jsx as
|
|
2138
|
-
var
|
|
2191
|
+
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2192
|
+
var classBase6 = "vuuColumnTypePanel";
|
|
2139
2193
|
var integerCellRenderers = ["Default Renderer (int, long)"];
|
|
2140
2194
|
var doubleCellRenderers = ["Default Renderer (double)"];
|
|
2141
2195
|
var stringCellRenderers = ["Default Renderer (string)"];
|
|
@@ -2167,7 +2221,7 @@ var ColumnTypePanel = ({
|
|
|
2167
2221
|
case "double":
|
|
2168
2222
|
case "int":
|
|
2169
2223
|
case "long":
|
|
2170
|
-
return /* @__PURE__ */
|
|
2224
|
+
return /* @__PURE__ */ jsx8(
|
|
2171
2225
|
NumericColumnPanel,
|
|
2172
2226
|
{
|
|
2173
2227
|
column,
|
|
@@ -2175,7 +2229,7 @@ var ColumnTypePanel = ({
|
|
|
2175
2229
|
}
|
|
2176
2230
|
);
|
|
2177
2231
|
default:
|
|
2178
|
-
return /* @__PURE__ */
|
|
2232
|
+
return /* @__PURE__ */ jsx8(
|
|
2179
2233
|
StringColumnPanel,
|
|
2180
2234
|
{
|
|
2181
2235
|
column,
|
|
@@ -2186,21 +2240,21 @@ var ColumnTypePanel = ({
|
|
|
2186
2240
|
}, [column, dispatchColumnAction]);
|
|
2187
2241
|
const { serverDataType = "string" } = column;
|
|
2188
2242
|
const availableRenderers = getAvailableCellRenderers(column);
|
|
2189
|
-
return /* @__PURE__ */
|
|
2190
|
-
/* @__PURE__ */
|
|
2243
|
+
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
2244
|
+
/* @__PURE__ */ jsx8(
|
|
2191
2245
|
Dropdown,
|
|
2192
2246
|
{
|
|
2193
|
-
className:
|
|
2247
|
+
className: cx4(`${classBase6}-renderer`),
|
|
2194
2248
|
fullWidth: true,
|
|
2195
2249
|
selected: availableRenderers[0],
|
|
2196
2250
|
source: availableRenderers
|
|
2197
2251
|
}
|
|
2198
2252
|
),
|
|
2199
|
-
/* @__PURE__ */
|
|
2253
|
+
/* @__PURE__ */ jsx8(
|
|
2200
2254
|
Panel,
|
|
2201
2255
|
{
|
|
2202
2256
|
...props,
|
|
2203
|
-
className:
|
|
2257
|
+
className: cx4(classBase6, className, `${classBase6}-${serverDataType}`),
|
|
2204
2258
|
children: content
|
|
2205
2259
|
}
|
|
2206
2260
|
)
|
|
@@ -2208,8 +2262,8 @@ var ColumnTypePanel = ({
|
|
|
2208
2262
|
};
|
|
2209
2263
|
|
|
2210
2264
|
// src/datagrid-configuration-ui/column-settings-panel/ColumnSettingsPanel.tsx
|
|
2211
|
-
import { jsx as
|
|
2212
|
-
var
|
|
2265
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2266
|
+
var classBase7 = "vuuColumnSettingsPanel";
|
|
2213
2267
|
var tabstripProps = {
|
|
2214
2268
|
className: "salt-density-high"
|
|
2215
2269
|
};
|
|
@@ -2250,54 +2304,54 @@ var ColumnSettingsPanel = ({
|
|
|
2250
2304
|
(value) => dispatchUpdate({ width: parseInt(value.toString(), 10) }),
|
|
2251
2305
|
[dispatchUpdate]
|
|
2252
2306
|
);
|
|
2253
|
-
return /* @__PURE__ */
|
|
2307
|
+
return /* @__PURE__ */ jsxs7(
|
|
2254
2308
|
"div",
|
|
2255
2309
|
{
|
|
2256
|
-
className:
|
|
2310
|
+
className: classBase7,
|
|
2257
2311
|
...props,
|
|
2258
2312
|
style: {
|
|
2259
2313
|
...styleProp
|
|
2260
2314
|
},
|
|
2261
2315
|
children: [
|
|
2262
|
-
/* @__PURE__ */
|
|
2263
|
-
/* @__PURE__ */
|
|
2316
|
+
/* @__PURE__ */ jsx9(Text3, { as: "h4", children: "Column Settings" }),
|
|
2317
|
+
/* @__PURE__ */ jsxs7(
|
|
2264
2318
|
Stack,
|
|
2265
2319
|
{
|
|
2266
2320
|
active: activeTab,
|
|
2267
2321
|
showTabs: true,
|
|
2268
|
-
className:
|
|
2322
|
+
className: cx5(`${classBase7}-columnTabs`),
|
|
2269
2323
|
onTabSelectionChanged: setActiveTab,
|
|
2270
2324
|
TabstripProps: tabstripProps,
|
|
2271
2325
|
children: [
|
|
2272
|
-
/* @__PURE__ */
|
|
2273
|
-
/* @__PURE__ */
|
|
2326
|
+
/* @__PURE__ */ jsxs7(Panel2, { title: "Column", children: [
|
|
2327
|
+
/* @__PURE__ */ jsx9(FormField2, { label: "Hidden", labelPlacement: "left", children: /* @__PURE__ */ jsx9(
|
|
2274
2328
|
Checkbox,
|
|
2275
2329
|
{
|
|
2276
2330
|
checked: column.hidden === true,
|
|
2277
2331
|
onChange: handleChangeHidden
|
|
2278
2332
|
}
|
|
2279
2333
|
) }),
|
|
2280
|
-
/* @__PURE__ */
|
|
2334
|
+
/* @__PURE__ */ jsx9(FormField2, { label: "Label", labelPlacement: "left", children: /* @__PURE__ */ jsx9(
|
|
2281
2335
|
Input,
|
|
2282
2336
|
{
|
|
2283
2337
|
value: (_a = column.label) != null ? _a : column.name,
|
|
2284
2338
|
onChange: handleChangeLabel
|
|
2285
2339
|
}
|
|
2286
2340
|
) }),
|
|
2287
|
-
/* @__PURE__ */
|
|
2341
|
+
/* @__PURE__ */ jsx9(FormField2, { label: "Width", labelPlacement: "left", children: /* @__PURE__ */ jsx9(
|
|
2288
2342
|
StepperInput2,
|
|
2289
2343
|
{
|
|
2290
2344
|
value: (_b = column.width) != null ? _b : 100,
|
|
2291
2345
|
onChange: handleChangeWidth
|
|
2292
2346
|
}
|
|
2293
2347
|
) }),
|
|
2294
|
-
/* @__PURE__ */
|
|
2348
|
+
/* @__PURE__ */ jsx9(
|
|
2295
2349
|
FormField2,
|
|
2296
2350
|
{
|
|
2297
2351
|
label: "Align",
|
|
2298
2352
|
labelPlacement: "left",
|
|
2299
2353
|
ActivationIndicatorComponent: NullActivationIndicator,
|
|
2300
|
-
children: /* @__PURE__ */
|
|
2354
|
+
children: /* @__PURE__ */ jsxs7(
|
|
2301
2355
|
RadioButtonGroup,
|
|
2302
2356
|
{
|
|
2303
2357
|
"aria-label": "Column Align",
|
|
@@ -2305,20 +2359,20 @@ var ColumnSettingsPanel = ({
|
|
|
2305
2359
|
legend: "Align",
|
|
2306
2360
|
onChange: handleChangeAlign,
|
|
2307
2361
|
children: [
|
|
2308
|
-
/* @__PURE__ */
|
|
2309
|
-
/* @__PURE__ */
|
|
2362
|
+
/* @__PURE__ */ jsx9(RadioButton, { label: "Left", value: "left" }),
|
|
2363
|
+
/* @__PURE__ */ jsx9(RadioButton, { label: "Right", value: "right" })
|
|
2310
2364
|
]
|
|
2311
2365
|
}
|
|
2312
2366
|
)
|
|
2313
2367
|
}
|
|
2314
2368
|
),
|
|
2315
|
-
/* @__PURE__ */
|
|
2369
|
+
/* @__PURE__ */ jsx9(
|
|
2316
2370
|
FormField2,
|
|
2317
2371
|
{
|
|
2318
2372
|
label: "Pin Column",
|
|
2319
2373
|
labelPlacement: "left",
|
|
2320
2374
|
ActivationIndicatorComponent: NullActivationIndicator,
|
|
2321
|
-
children: /* @__PURE__ */
|
|
2375
|
+
children: /* @__PURE__ */ jsxs7(
|
|
2322
2376
|
RadioButtonGroup,
|
|
2323
2377
|
{
|
|
2324
2378
|
"aria-label": "Pin Column",
|
|
@@ -2326,16 +2380,16 @@ var ColumnSettingsPanel = ({
|
|
|
2326
2380
|
legend: "Pin Column",
|
|
2327
2381
|
onChange: handleChangePin,
|
|
2328
2382
|
children: [
|
|
2329
|
-
/* @__PURE__ */
|
|
2330
|
-
/* @__PURE__ */
|
|
2331
|
-
/* @__PURE__ */
|
|
2383
|
+
/* @__PURE__ */ jsx9(RadioButton, { label: "Do not pin", value: "" }),
|
|
2384
|
+
/* @__PURE__ */ jsx9(RadioButton, { label: "Left", value: "left" }),
|
|
2385
|
+
/* @__PURE__ */ jsx9(RadioButton, { label: "Right", value: "right" })
|
|
2332
2386
|
]
|
|
2333
2387
|
}
|
|
2334
2388
|
)
|
|
2335
2389
|
}
|
|
2336
2390
|
)
|
|
2337
2391
|
] }),
|
|
2338
|
-
/* @__PURE__ */
|
|
2392
|
+
/* @__PURE__ */ jsx9(
|
|
2339
2393
|
ColumnTypePanel,
|
|
2340
2394
|
{
|
|
2341
2395
|
column,
|
|
@@ -2343,25 +2397,25 @@ var ColumnSettingsPanel = ({
|
|
|
2343
2397
|
title: "Data Cell"
|
|
2344
2398
|
}
|
|
2345
2399
|
),
|
|
2346
|
-
/* @__PURE__ */
|
|
2347
|
-
/* @__PURE__ */
|
|
2400
|
+
/* @__PURE__ */ jsxs7(Panel2, { title: "Vuu", variant: "secondary", children: [
|
|
2401
|
+
/* @__PURE__ */ jsx9(
|
|
2348
2402
|
FormField2,
|
|
2349
2403
|
{
|
|
2350
2404
|
label: "Name",
|
|
2351
2405
|
labelPlacement: "top",
|
|
2352
2406
|
readOnly: true,
|
|
2353
2407
|
variant: "secondary",
|
|
2354
|
-
children: /* @__PURE__ */
|
|
2408
|
+
children: /* @__PURE__ */ jsx9(Input, { value: column.name })
|
|
2355
2409
|
}
|
|
2356
2410
|
),
|
|
2357
|
-
/* @__PURE__ */
|
|
2411
|
+
/* @__PURE__ */ jsx9(
|
|
2358
2412
|
FormField2,
|
|
2359
2413
|
{
|
|
2360
2414
|
label: "Vuu type",
|
|
2361
2415
|
labelPlacement: "top",
|
|
2362
2416
|
readOnly: true,
|
|
2363
2417
|
variant: "secondary",
|
|
2364
|
-
children: /* @__PURE__ */
|
|
2418
|
+
children: /* @__PURE__ */ jsx9(Input, { value: column.serverDataType })
|
|
2365
2419
|
}
|
|
2366
2420
|
)
|
|
2367
2421
|
] })
|
|
@@ -2382,8 +2436,8 @@ import {
|
|
|
2382
2436
|
} from "@heswell/salt-lab";
|
|
2383
2437
|
import { Panel as Panel3, Text as Text4 } from "@salt-ds/core";
|
|
2384
2438
|
import { useCallback as useCallback6 } from "react";
|
|
2385
|
-
import { jsx as
|
|
2386
|
-
var
|
|
2439
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2440
|
+
var classBase8 = "vuuGridSettingsPanel";
|
|
2387
2441
|
var NullActivationIndicator2 = () => null;
|
|
2388
2442
|
var GridSettingsPanel = ({
|
|
2389
2443
|
config,
|
|
@@ -2409,25 +2463,24 @@ var GridSettingsPanel = ({
|
|
|
2409
2463
|
(value) => dispatchUpdate({ columnDefaultWidth: parseInt(value.toString(), 10) }),
|
|
2410
2464
|
[dispatchUpdate]
|
|
2411
2465
|
);
|
|
2412
|
-
|
|
2413
|
-
return /* @__PURE__ */ jsxs7(
|
|
2466
|
+
return /* @__PURE__ */ jsxs8(
|
|
2414
2467
|
"div",
|
|
2415
2468
|
{
|
|
2416
|
-
className:
|
|
2469
|
+
className: classBase8,
|
|
2417
2470
|
...props,
|
|
2418
2471
|
style: {
|
|
2419
2472
|
...styleProp
|
|
2420
2473
|
},
|
|
2421
2474
|
children: [
|
|
2422
|
-
/* @__PURE__ */
|
|
2423
|
-
/* @__PURE__ */
|
|
2424
|
-
/* @__PURE__ */
|
|
2475
|
+
/* @__PURE__ */ jsx10(Text4, { as: "h4", children: "Grid Settings" }),
|
|
2476
|
+
/* @__PURE__ */ jsxs8(Panel3, { children: [
|
|
2477
|
+
/* @__PURE__ */ jsx10(
|
|
2425
2478
|
FormField3,
|
|
2426
2479
|
{
|
|
2427
2480
|
label: "Format column labels",
|
|
2428
2481
|
labelPlacement: "left",
|
|
2429
2482
|
ActivationIndicatorComponent: NullActivationIndicator2,
|
|
2430
|
-
children: /* @__PURE__ */
|
|
2483
|
+
children: /* @__PURE__ */ jsxs8(
|
|
2431
2484
|
RadioButtonGroup2,
|
|
2432
2485
|
{
|
|
2433
2486
|
"aria-label": "Format column labels",
|
|
@@ -2435,15 +2488,15 @@ var GridSettingsPanel = ({
|
|
|
2435
2488
|
legend: "Format column labels",
|
|
2436
2489
|
onChange: handleChangeLabelFormatting,
|
|
2437
2490
|
children: [
|
|
2438
|
-
/* @__PURE__ */
|
|
2439
|
-
/* @__PURE__ */
|
|
2440
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ jsx10(RadioButton2, { label: "No Formatting", value: void 0 }),
|
|
2492
|
+
/* @__PURE__ */ jsx10(RadioButton2, { label: "Capitalize", value: "capitalize" }),
|
|
2493
|
+
/* @__PURE__ */ jsx10(RadioButton2, { label: "Uppercase", value: "uppercase" })
|
|
2441
2494
|
]
|
|
2442
2495
|
}
|
|
2443
2496
|
)
|
|
2444
2497
|
}
|
|
2445
2498
|
),
|
|
2446
|
-
/* @__PURE__ */
|
|
2499
|
+
/* @__PURE__ */ jsx10(FormField3, { label: "Default Column Width", labelPlacement: "left", children: /* @__PURE__ */ jsx10(
|
|
2447
2500
|
StepperInput3,
|
|
2448
2501
|
{
|
|
2449
2502
|
value: (_a = config.columnDefaultWidth) != null ? _a : 100,
|
|
@@ -2624,7 +2677,7 @@ import {
|
|
|
2624
2677
|
useRef as useRef4,
|
|
2625
2678
|
useState as useState3
|
|
2626
2679
|
} from "react";
|
|
2627
|
-
import { jsx as
|
|
2680
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2628
2681
|
var CalculatedColumnPanel = ({
|
|
2629
2682
|
columns,
|
|
2630
2683
|
dispatchColumnAction,
|
|
@@ -2667,10 +2720,10 @@ var CalculatedColumnPanel = ({
|
|
|
2667
2720
|
});
|
|
2668
2721
|
}
|
|
2669
2722
|
}, [columnName, dispatchColumnAction]);
|
|
2670
|
-
return /* @__PURE__ */
|
|
2671
|
-
/* @__PURE__ */
|
|
2672
|
-
/* @__PURE__ */
|
|
2673
|
-
/* @__PURE__ */
|
|
2723
|
+
return /* @__PURE__ */ jsxs9(Panel4, { className: "vuuCalculatedColumnPanel", title: "Define Computed Column", children: [
|
|
2724
|
+
/* @__PURE__ */ jsx11(Text5, { styleAs: "h4", children: "Define Computed Column" }),
|
|
2725
|
+
/* @__PURE__ */ jsx11(FormField4, { label: "Column Name", labelPlacement: "left", children: /* @__PURE__ */ jsx11(Input2, { value: columnName, onChange: handleChangeName }) }),
|
|
2726
|
+
/* @__PURE__ */ jsx11(
|
|
2674
2727
|
ColumnExpressionInput,
|
|
2675
2728
|
{
|
|
2676
2729
|
onChange: handleChangeExpression,
|
|
@@ -2678,13 +2731,13 @@ var CalculatedColumnPanel = ({
|
|
|
2678
2731
|
suggestionProvider
|
|
2679
2732
|
}
|
|
2680
2733
|
),
|
|
2681
|
-
/* @__PURE__ */
|
|
2734
|
+
/* @__PURE__ */ jsx11("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ jsx11(Button2, { onClick: handleSave, children: "Add Column" }) })
|
|
2682
2735
|
] });
|
|
2683
2736
|
};
|
|
2684
2737
|
|
|
2685
2738
|
// src/datagrid-configuration-ui/settings-panel/DatagridSettingsPanel.tsx
|
|
2686
|
-
import { jsx as
|
|
2687
|
-
var
|
|
2739
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2740
|
+
var classBase9 = "vuuDatagridSettingsPanel";
|
|
2688
2741
|
var getTabLabel = () => void 0;
|
|
2689
2742
|
var icons = [
|
|
2690
2743
|
"table-settings",
|
|
@@ -2739,27 +2792,27 @@ var DatagridSettingsPanel = ({
|
|
|
2739
2792
|
[]
|
|
2740
2793
|
);
|
|
2741
2794
|
const panelShift = selectedTabIndex === 2 ? "right" : void 0;
|
|
2742
|
-
return /* @__PURE__ */
|
|
2743
|
-
/* @__PURE__ */
|
|
2795
|
+
return /* @__PURE__ */ jsxs10("div", { ...props, className: cx6(classBase9, className), children: [
|
|
2796
|
+
/* @__PURE__ */ jsxs10(
|
|
2744
2797
|
Stack2,
|
|
2745
2798
|
{
|
|
2746
2799
|
TabstripProps: tabstripProps2,
|
|
2747
|
-
className: `${
|
|
2800
|
+
className: `${classBase9}-stack`,
|
|
2748
2801
|
getTabIcon,
|
|
2749
2802
|
getTabLabel,
|
|
2750
2803
|
active: selectedTabIndex === 2 ? 1 : selectedTabIndex,
|
|
2751
2804
|
onTabSelectionChanged: handleTabSelectionChanged,
|
|
2752
2805
|
showTabs: true,
|
|
2753
2806
|
children: [
|
|
2754
|
-
/* @__PURE__ */
|
|
2807
|
+
/* @__PURE__ */ jsx12(
|
|
2755
2808
|
GridSettingsPanel,
|
|
2756
2809
|
{
|
|
2757
2810
|
config: gridSettings,
|
|
2758
2811
|
dispatchColumnAction
|
|
2759
2812
|
}
|
|
2760
2813
|
),
|
|
2761
|
-
/* @__PURE__ */
|
|
2762
|
-
/* @__PURE__ */
|
|
2814
|
+
/* @__PURE__ */ jsxs10("div", { className: `${classBase9}-columnPanels`, "data-align": panelShift, children: [
|
|
2815
|
+
/* @__PURE__ */ jsx12(
|
|
2763
2816
|
ColumnPicker,
|
|
2764
2817
|
{
|
|
2765
2818
|
availableColumns,
|
|
@@ -2770,7 +2823,7 @@ var DatagridSettingsPanel = ({
|
|
|
2770
2823
|
selectedColumn
|
|
2771
2824
|
}
|
|
2772
2825
|
),
|
|
2773
|
-
selectedColumn === null ? /* @__PURE__ */
|
|
2826
|
+
selectedColumn === null ? /* @__PURE__ */ jsx12(Panel5, { className: "vuuColumnSettingsPanel", children: "Select a column" }) : /* @__PURE__ */ jsx12(
|
|
2774
2827
|
ColumnSettingsPanel,
|
|
2775
2828
|
{
|
|
2776
2829
|
column: selectedColumn,
|
|
@@ -2779,8 +2832,8 @@ var DatagridSettingsPanel = ({
|
|
|
2779
2832
|
}
|
|
2780
2833
|
)
|
|
2781
2834
|
] }),
|
|
2782
|
-
/* @__PURE__ */
|
|
2783
|
-
/* @__PURE__ */
|
|
2835
|
+
/* @__PURE__ */ jsx12("div", { title: "Column Settings", children: "Column Settings" }),
|
|
2836
|
+
/* @__PURE__ */ jsx12(
|
|
2784
2837
|
CalculatedColumnPanel,
|
|
2785
2838
|
{
|
|
2786
2839
|
columns: gridSettings.columns,
|
|
@@ -2791,19 +2844,19 @@ var DatagridSettingsPanel = ({
|
|
|
2791
2844
|
]
|
|
2792
2845
|
}
|
|
2793
2846
|
),
|
|
2794
|
-
/* @__PURE__ */
|
|
2795
|
-
/* @__PURE__ */
|
|
2796
|
-
/* @__PURE__ */
|
|
2797
|
-
/* @__PURE__ */
|
|
2847
|
+
/* @__PURE__ */ jsxs10("div", { className: `${classBase9}-buttonBar`, children: [
|
|
2848
|
+
/* @__PURE__ */ jsx12(Button3, { onClick: onCancel, children: "Cancel" }),
|
|
2849
|
+
/* @__PURE__ */ jsx12(Button3, { onClick: handleApply, children: "Apply" }),
|
|
2850
|
+
/* @__PURE__ */ jsx12(Button3, { onClick: handleSave, children: "Save" })
|
|
2798
2851
|
] })
|
|
2799
2852
|
] });
|
|
2800
2853
|
};
|
|
2801
2854
|
|
|
2802
2855
|
// src/datasource-stats/DatasourceStats.tsx
|
|
2803
2856
|
import { useEffect as useEffect3, useState as useState5 } from "react";
|
|
2804
|
-
import
|
|
2805
|
-
import { jsx as
|
|
2806
|
-
var
|
|
2857
|
+
import cx7 from "classnames";
|
|
2858
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2859
|
+
var classBase10 = "vuuDatasourceStats";
|
|
2807
2860
|
var numberFormatter = new Intl.NumberFormat();
|
|
2808
2861
|
var DataSourceStats = ({
|
|
2809
2862
|
className: classNameProp,
|
|
@@ -2821,17 +2874,17 @@ var DataSourceStats = ({
|
|
|
2821
2874
|
dataSource.on("resize", setSize);
|
|
2822
2875
|
dataSource.on("range", setRange);
|
|
2823
2876
|
}, [dataSource]);
|
|
2824
|
-
const className =
|
|
2877
|
+
const className = cx7(classBase10, classNameProp);
|
|
2825
2878
|
const from = numberFormatter.format(range.from);
|
|
2826
2879
|
const to = numberFormatter.format(range.to - 1);
|
|
2827
2880
|
const value = numberFormatter.format(size);
|
|
2828
|
-
return /* @__PURE__ */
|
|
2829
|
-
/* @__PURE__ */
|
|
2830
|
-
/* @__PURE__ */
|
|
2831
|
-
/* @__PURE__ */
|
|
2832
|
-
/* @__PURE__ */
|
|
2833
|
-
/* @__PURE__ */
|
|
2834
|
-
/* @__PURE__ */
|
|
2881
|
+
return /* @__PURE__ */ jsxs11("div", { className, children: [
|
|
2882
|
+
/* @__PURE__ */ jsx13("span", { children: "Showing rows" }),
|
|
2883
|
+
/* @__PURE__ */ jsx13("span", { className: `${classBase10}-range`, children: from }),
|
|
2884
|
+
/* @__PURE__ */ jsx13("span", { className: `${classBase10}-range`, children: to }),
|
|
2885
|
+
/* @__PURE__ */ jsx13("span", { children: "of" }),
|
|
2886
|
+
/* @__PURE__ */ jsx13("span", { className: `${classBase10}-size`, children: value }),
|
|
2887
|
+
/* @__PURE__ */ jsx13("span", { className: `${classBase10}-optimize`, children: optimize })
|
|
2835
2888
|
] });
|
|
2836
2889
|
};
|
|
2837
2890
|
export {
|