@vuu-ui/vuu-data-test 5.0.0-alpha.4 → 5.0.0-alpha.5
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/package.json +7 -7
- package/src/test/TestModule.js +53 -1
- package/types/test/TestModule.d.ts +4 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.0.0-alpha.
|
|
2
|
+
"version": "5.0.0-alpha.5",
|
|
3
3
|
"main": "./src/index.js",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "heswell",
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
"type-defs": "node ../../scripts/build-type-defs.mjs"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@vuu-ui/vuu-data-local": "5.0.0-alpha.
|
|
13
|
-
"@vuu-ui/vuu-utils": "5.0.0-alpha.
|
|
12
|
+
"@vuu-ui/vuu-data-local": "5.0.0-alpha.5",
|
|
13
|
+
"@vuu-ui/vuu-utils": "5.0.0-alpha.5",
|
|
14
14
|
"@heswell/module-admin": "1.1.0",
|
|
15
15
|
"@heswell/user-admin": "1.0.1",
|
|
16
|
-
"@vuu-ui/vuu-data-editing": "5.0.0-alpha.
|
|
16
|
+
"@vuu-ui/vuu-data-editing": "5.0.0-alpha.5"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@vuu-ui/vuu-protocol-types": "5.0.0-alpha.
|
|
20
|
-
"@vuu-ui/vuu-data-types": "5.0.0-alpha.
|
|
21
|
-
"@vuu-ui/vuu-table-types": "5.0.0-alpha.
|
|
19
|
+
"@vuu-ui/vuu-protocol-types": "5.0.0-alpha.5",
|
|
20
|
+
"@vuu-ui/vuu-data-types": "5.0.0-alpha.5",
|
|
21
|
+
"@vuu-ui/vuu-table-types": "5.0.0-alpha.5"
|
|
22
22
|
},
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"files": [
|
package/src/test/TestModule.js
CHANGED
|
@@ -13,6 +13,48 @@ const generateRows = (tableSchema, count)=>{
|
|
|
13
13
|
const columnGenerator = RowGenerator(tableSchema.columns.map((c)=>c.name));
|
|
14
14
|
return new Array(count).fill(1).map((_, i)=>columnGenerator(i));
|
|
15
15
|
};
|
|
16
|
+
const CHART_VARIANT_MAX_SERIES = 50;
|
|
17
|
+
const CHART_VARIANT_PREFIXES = Array.from({
|
|
18
|
+
length: CHART_VARIANT_MAX_SERIES
|
|
19
|
+
}, (_, i)=>`series_${String(i + 1).padStart(2, "0")}`);
|
|
20
|
+
const CHART_VARIANT_SUFFIXES = [
|
|
21
|
+
"set_a",
|
|
22
|
+
"set_b",
|
|
23
|
+
"set_c"
|
|
24
|
+
];
|
|
25
|
+
const chartVariantColumns = [
|
|
26
|
+
{
|
|
27
|
+
name: "id",
|
|
28
|
+
serverDataType: "string"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "date",
|
|
32
|
+
serverDataType: "string"
|
|
33
|
+
},
|
|
34
|
+
...CHART_VARIANT_PREFIXES.flatMap((prefix)=>CHART_VARIANT_SUFFIXES.map((suffix)=>({
|
|
35
|
+
name: `${prefix}_${suffix}`,
|
|
36
|
+
serverDataType: "double"
|
|
37
|
+
})))
|
|
38
|
+
];
|
|
39
|
+
const chartVariantScale = [
|
|
40
|
+
1,
|
|
41
|
+
0.6,
|
|
42
|
+
0.3
|
|
43
|
+
];
|
|
44
|
+
const chartVariantRows = ()=>Array.from({
|
|
45
|
+
length: 25
|
|
46
|
+
}, (_, day)=>{
|
|
47
|
+
const date = new Date(Date.UTC(2026, 3, 2 + day)).toISOString().slice(0, 10);
|
|
48
|
+
const values = CHART_VARIANT_PREFIXES.flatMap((_, p)=>{
|
|
49
|
+
const base = 100 + 20 * p + Math.round(15 * Math.sin((day + 3 * p) / 4));
|
|
50
|
+
return chartVariantScale.map((scale)=>Math.round(base * scale));
|
|
51
|
+
});
|
|
52
|
+
return [
|
|
53
|
+
String(day + 1).padStart(3, "0"),
|
|
54
|
+
date,
|
|
55
|
+
...values
|
|
56
|
+
];
|
|
57
|
+
});
|
|
16
58
|
const testEditColumns = [
|
|
17
59
|
{
|
|
18
60
|
name: "id",
|
|
@@ -164,6 +206,15 @@ class TestModule extends VuuModule {
|
|
|
164
206
|
table: "ChartTable"
|
|
165
207
|
}
|
|
166
208
|
},
|
|
209
|
+
ChartVariantTable: {
|
|
210
|
+
columns: chartVariantColumns,
|
|
211
|
+
key: "id",
|
|
212
|
+
rangeLimits: DEFAULT_RANGE_LIMITS,
|
|
213
|
+
table: {
|
|
214
|
+
module: "TEST",
|
|
215
|
+
table: "ChartVariantTable"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
167
218
|
MaxScrollEndTable: {
|
|
168
219
|
columns: DefaultColumnGenerator(6).map((col)=>toSchemaColumn({
|
|
169
220
|
...col,
|
|
@@ -529,6 +580,7 @@ class TestModule extends VuuModule {
|
|
|
529
580
|
false
|
|
530
581
|
]
|
|
531
582
|
], buildDataColumnMap(this.#schemas, "ChartTable")),
|
|
583
|
+
ChartVariantTable: TableContainer.createTable(this.#schemas.ChartVariantTable, chartVariantRows(), buildDataColumnMap(this.#schemas, "ChartVariantTable")),
|
|
532
584
|
MaxScrollEndTable: TableContainer.createTable(this.#schemas.MaxScrollEndTable, generateRows(this.#schemas.MaxScrollEndTable, 1000), buildDataColumnMap(this.#schemas, "MaxScrollEndTable")),
|
|
533
585
|
TestEditEmpty: TableContainer.createTable(this.#schemas.TestEditEmpty, [], buildDataColumnMap(this.#schemas, "TestEditEmpty")),
|
|
534
586
|
TestEdit: TableContainer.createTable(this.#schemas.TestEdit, [
|
|
@@ -644,4 +696,4 @@ class TestModule extends VuuModule {
|
|
|
644
696
|
}
|
|
645
697
|
}
|
|
646
698
|
const testModule = new TestModule();
|
|
647
|
-
export { TEST_EDIT_VALIDATION_PRICE_MESSAGE, TEST_EDIT_VALIDATION_QUANTITY_MESSAGE, testModule };
|
|
699
|
+
export { CHART_VARIANT_MAX_SERIES, CHART_VARIANT_PREFIXES, CHART_VARIANT_SUFFIXES, TEST_EDIT_VALIDATION_PRICE_MESSAGE, TEST_EDIT_VALIDATION_QUANTITY_MESSAGE, testModule };
|
|
@@ -2,7 +2,10 @@ import { type RpcMenuService, VuuModule } from "../core/module/VuuModule";
|
|
|
2
2
|
import { type Table } from "../Table";
|
|
3
3
|
import type { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
4
4
|
import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
5
|
-
export type TestTableName = "TestDates" | "TwoHundredColumns" | "LinkParent" | "LinkChild" | "ChartTable" | "MaxScrollEndTable" | "TestEditEmpty" | "TestEdit" | "TestEditValidation";
|
|
5
|
+
export type TestTableName = "TestDates" | "TwoHundredColumns" | "LinkParent" | "LinkChild" | "ChartTable" | "ChartVariantTable" | "MaxScrollEndTable" | "TestEditEmpty" | "TestEdit" | "TestEditValidation";
|
|
6
|
+
export declare const CHART_VARIANT_MAX_SERIES = 50;
|
|
7
|
+
export declare const CHART_VARIANT_PREFIXES: string[];
|
|
8
|
+
export declare const CHART_VARIANT_SUFFIXES: string[];
|
|
6
9
|
export declare const TEST_EDIT_VALIDATION_QUANTITY_MESSAGE = "quantity must be between 1 and 1000";
|
|
7
10
|
export declare const TEST_EDIT_VALIDATION_PRICE_MESSAGE = "price must be greater than zero";
|
|
8
11
|
declare class TestModule extends VuuModule<TestTableName> {
|