Skip to content

Commit d7edb51

Browse files
authored
Edit session validation (#2155)
* style table edit cells appropriately when in error * main * simple type validation on text editing, refactor VuuModule editing service * chart styling * bump ui version to 2.1.4
1 parent e5e2fa5 commit d7edb51

75 files changed

Lines changed: 1292 additions & 1065 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

vuu-ui/package-lock.json

Lines changed: 233 additions & 233 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vuu-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuu-ui",
3-
"version": "2.1.4",
3+
"version": "2.1.5",
44
"author": "heswell <steve@heswell.com>",
55
"license": "Apache-2.0",
66
"private": true,

vuu-ui/packages/grid-layout/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@heswell/grid-layout",
3-
"version": "2.1.4",
3+
"version": "2.1.5",
44
"description": "VUU Layout Components",
55
"main": "src/index.ts",
66
"author": "heswell",
@@ -12,7 +12,7 @@
1212
},
1313
"types": "src/index.ts",
1414
"dependencies": {
15-
"@vuu-ui/vuu-utils": "2.1.4",
15+
"@vuu-ui/vuu-utils": "2.1.5",
1616
"@salt-ds/core": "1.54.1",
1717
"@salt-ds/lab": "1.0.0-alpha.83",
1818
"@salt-ds/styles": "0.2.1",

vuu-ui/packages/vuu-chart/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vuu-ui/vuu-chart",
3-
"version": "2.1.4",
3+
"version": "2.1.5",
44
"description": "support for apache echarts using vuu data",
55
"main": "src/index.ts",
66
"license": "Apache-2.0",
@@ -10,14 +10,15 @@
1010
"type-defs": "node ../../scripts/build-type-defs.mjs"
1111
},
1212
"devDependencies": {
13-
"@vuu-ui/vuu-data-types": "2.1.4",
14-
"@vuu-ui/vuu-protocol-types": "2.1.4"
13+
"@vuu-ui/vuu-data-types": "2.1.5",
14+
"@vuu-ui/vuu-protocol-types": "2.1.5"
1515
},
1616
"dependencies": {
1717
"@salt-ds/styles": "0.2.1",
1818
"@salt-ds/window": "0.1.1",
19-
"@vuu-ui/vuu-context-menu": "2.1.4",
20-
"@vuu-ui/vuu-utils": "2.1.4"
19+
"@vuu-ui/vuu-context-menu": "2.1.5",
20+
"@vuu-ui/vuu-utils": "2.1.5",
21+
"clsx": "^2.0.0"
2122
},
2223
"peerDependencies": {
2324
"echarts": "6.0.0",
Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1-
.vuuEChart {
2-
background-color: red;;
1+
2+
.vuuChartTooltip {
3+
background-color: var(--salt-container-primary-background) !important;
4+
border-color:var(--salt-selectable-borderColor-selected) !important;
5+
border-radius: 6px !important;
6+
font-family: var(--salt-text-fontFamily) !important;
7+
8+
&> div > div {
9+
&>div:nth-child(1) {
10+
/* Title */
11+
color: var(--salt-content-primary-foreground) !important;
12+
}
13+
14+
&>div:nth-child(2) > div {
15+
&>div {
16+
align-items: center;
17+
display: flex;
18+
/* Line item */
19+
span:nth-child(1){
20+
/* icon */
21+
flex: 0 0 12px
22+
}
23+
span:nth-child(2){
24+
/* label */
25+
color: var(--salt-content-secondary-foreground) !important;
26+
flex: 0 0 auto;
27+
font-size: var(--salt-text-label-fontSize) !important;
28+
text-transform: capitalize;
29+
}
30+
span:nth-child(3){
31+
/* value */
32+
flex: 1 1 auto;
33+
color: var(--salt-content-primary-foreground) !important;
34+
font-size: var(--salt-text-label-fontSize) !important;
35+
text-align: right;
36+
}
37+
}
38+
}
39+
40+
}
341
}

vuu-ui/packages/vuu-chart/src/Chart.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ import { useComponentCssInjection } from "@salt-ds/styles";
44
import { useWindow } from "@salt-ds/window";
55
import { ChartOptionsProps, useChartOptions } from "./useChartOptions";
66
import { useChartContextMenu } from "./useChartContextMenu";
7+
import cx from "clsx";
78

8-
import echartCss from "./Chart.css";
99
import { ItemColorFunction } from "./ChartSeries";
1010

11+
import chartCss from "./Chart.css";
12+
13+
const classBase = "vuuChart";
14+
1115
type OptionSettings = {
1216
notMerge: boolean;
1317
};
@@ -24,23 +28,26 @@ export interface ChartProps
2428
itemColorFunction?: ItemColorFunction;
2529
optionSettings?: OptionSettings;
2630
palette?: string[];
31+
showTooltip?: boolean;
2732
}
2833

2934
export const Chart = ({
3035
categoryColumnName,
3136
chartSettings = { useCoarsePointer: true, renderer: "svg" }, // enables clicking near a line and still highlighting it
37+
className,
3238
dataSource,
3339
itemColorFunction,
3440
optionSettings = { notMerge: true }, // don't merge two options together when updating option
3541
palette,
42+
showTooltip,
3643
style = { width: "100%", height: "100%" },
3744
seriesColumnNames,
3845
...htmlAttributes
3946
}: ChartProps) => {
4047
const targetWindow = useWindow();
4148
useComponentCssInjection({
4249
testId: "vuu-toast-notification",
43-
css: echartCss,
50+
css: chartCss,
4451
window: targetWindow,
4552
});
4653

@@ -52,6 +59,7 @@ export const Chart = ({
5259
palette,
5360
dataSource,
5461
seriesColumnNames,
62+
showTooltip,
5563
});
5664

5765
const onContextMenu = useChartContextMenu({ categoryColumnName });
@@ -102,5 +110,12 @@ export const Chart = ({
102110
}
103111
}, [option, optionSettings]);
104112

105-
return <div {...htmlAttributes} ref={chartRef} style={style} />;
113+
return (
114+
<div
115+
{...htmlAttributes}
116+
className={cx(classBase, className)}
117+
ref={chartRef}
118+
style={style}
119+
/>
120+
);
106121
};

vuu-ui/packages/vuu-chart/src/useChartOptions.ts

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface ChartOptionsProps {
1818
itemColorFunction?: ItemColorFunction;
1919
palette?: string[];
2020
seriesColumnNames: string[];
21+
showTooltip?: boolean;
2122
}
2223

2324
export const useChartOptions = ({
@@ -26,6 +27,7 @@ export const useChartOptions = ({
2627
itemColorFunction,
2728
palette = defaultPalette,
2829
seriesColumnNames,
30+
showTooltip = true,
2931
}: ChartOptionsProps) => {
3032
const [, forceRender] = useState({});
3133

@@ -53,6 +55,14 @@ export const useChartOptions = ({
5355
color: palette,
5456
dataZoom: [
5557
{
58+
backgroundColor: "var(--vuuChart-zoom-background, transparent)",
59+
borderColor: "var(--vuuChart-zoom-borderColor, white)",
60+
handleStyle: {
61+
color: "var(--vuuChart-zoom-handleColor, white)",
62+
},
63+
moveHandleStyle: {
64+
color: "var(--vuuChart-zoom-slideColor, white)",
65+
},
5666
type: "slider",
5767
start: 0,
5868
end: 100,
@@ -64,12 +74,25 @@ export const useChartOptions = ({
6474
right: 5,
6575
},
6676
series: chartSeries.series,
67-
tooltip: {
68-
trigger: "axis",
69-
},
77+
tooltip: showTooltip
78+
? {
79+
backgroundColor: "",
80+
borderColor: "",
81+
// borderWidth: "",
82+
className: "vuuChartTooltip",
83+
// padding: "",
84+
trigger: "axis",
85+
}
86+
: undefined,
7087
xAxis: {
7188
data: chartSeries.categories,
7289
},
73-
yAxis: {},
90+
yAxis: {
91+
splitLine: {
92+
lineStyle: {
93+
color: "var(--salt-separable-tertiary-borderColor)",
94+
},
95+
},
96+
},
7497
} as EChartsCoreOption;
7598
};

vuu-ui/packages/vuu-codemirror/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vuu-ui/vuu-codemirror",
3-
"version": "2.1.4",
3+
"version": "2.1.5",
44
"author": "heswell",
55
"main": "src/index.ts",
66
"license": "Apache-2.0",
@@ -11,15 +11,15 @@
1111
"lezer-generate:column": "lezer-generator --output ./src/column-expression-input/column-language-parser/generated/column-parser.js ./src/column-expression-input/column-language-parser/grammar/column.grammar"
1212
},
1313
"devDependencies": {
14-
"@vuu-ui/vuu-table-types": "2.1.4"
14+
"@vuu-ui/vuu-table-types": "2.1.5"
1515
},
1616
"dependencies": {
1717
"@codemirror/autocomplete": "^6.4.2",
1818
"@codemirror/commands": "^6.2.1",
1919
"@codemirror/language": "^6.6.0",
2020
"@codemirror/state": "^6.2.0",
2121
"@codemirror/view": "^6.9.3",
22-
"@vuu-ui/vuu-utils": "2.1.4",
22+
"@vuu-ui/vuu-utils": "2.1.5",
2323
"@lezer/common": "1.2.3",
2424
"@lezer/highlight": "^1.1.3"
2525
},

vuu-ui/packages/vuu-context-menu/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vuu-ui/vuu-context-menu",
3-
"version": "2.1.4",
3+
"version": "2.1.5",
44
"author": "heswell",
55
"main": "src/index.ts",
66
"license": "Apache-2.0",
@@ -10,12 +10,12 @@
1010
"type-defs": "node ../../scripts/build-type-defs.mjs"
1111
},
1212
"devDependencies": {
13-
"@vuu-ui/vuu-data-types": "2.1.4",
14-
"@vuu-ui/vuu-protocol-types": "2.1.4",
15-
"@vuu-ui/vuu-table-types": "2.1.4"
13+
"@vuu-ui/vuu-data-types": "2.1.5",
14+
"@vuu-ui/vuu-protocol-types": "2.1.5",
15+
"@vuu-ui/vuu-table-types": "2.1.5"
1616
},
1717
"dependencies": {
18-
"@vuu-ui/vuu-utils": "2.1.4",
18+
"@vuu-ui/vuu-utils": "2.1.5",
1919
"@salt-ds/core": "1.54.1",
2020
"@salt-ds/styles": "0.2.1",
2121
"@salt-ds/window": "0.1.1"

vuu-ui/packages/vuu-context-menu/src/menu-utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const isGroupMenuItemDescriptor = (
3737
export const isOpenBulkEditResponse = (
3838
rpcResponse: Partial<VuuRpcResponse>,
3939
): rpcResponse is MenuRpcResponse<OpenDialogActionWithSchema> =>
40-
(rpcResponse as MenuRpcResponse).rpcName === "VP_BULK_EDIT_BEGIN_RPC";
40+
(rpcResponse as MenuRpcResponse).rpcName === "beginEditSession";
4141

4242
export const hasShowNotificationAction = (
4343
res: Partial<VuuRpcResponse>,

0 commit comments

Comments
 (0)