@milaboratories/milaboratories.ui-examples.model 1.2.14 → 1.2.15
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/.turbo/turbo-build.log +13 -13
- package/CHANGELOG.md +8 -0
- package/dist/bundle.js +34 -34
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +2 -2
- package/src/index.ts +5 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/milaboratories.ui-examples.model",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.15",
|
|
4
4
|
"description": "Block model",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"zod": "~3.23.8",
|
|
11
|
-
"@platforma-sdk/model": "1.41.
|
|
11
|
+
"@platforma-sdk/model": "1.41.4"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"typescript": "~5.6.3",
|
package/src/index.ts
CHANGED
|
@@ -42,7 +42,6 @@ export function times<R>(n: number, cb: (i: number) => R): R[] {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export const $BlockArgs = z.object({
|
|
45
|
-
tableNumRows: z.number().default(100),
|
|
46
45
|
numbers: z.array(z.coerce.number()),
|
|
47
46
|
handles: z.array(ImportFileHandleSchema),
|
|
48
47
|
});
|
|
@@ -52,6 +51,7 @@ export type BlockArgs = z.infer<typeof $BlockArgs>;
|
|
|
52
51
|
export type UiState = {
|
|
53
52
|
dataTableV2: {
|
|
54
53
|
sourceId?: string;
|
|
54
|
+
numRows: number;
|
|
55
55
|
state: PlDataTableStateV2;
|
|
56
56
|
};
|
|
57
57
|
dynamicSections: {
|
|
@@ -66,11 +66,12 @@ export type UiState = {
|
|
|
66
66
|
|
|
67
67
|
export const platforma = BlockModel.create('Heavy')
|
|
68
68
|
|
|
69
|
-
.withArgs<BlockArgs>({ numbers: [1, 2, 3, 4],
|
|
69
|
+
.withArgs<BlockArgs>({ numbers: [1, 2, 3, 4], handles: [] })
|
|
70
70
|
|
|
71
71
|
.withUiState<UiState>({
|
|
72
72
|
dataTableV2: {
|
|
73
73
|
sourceId: 'source_1',
|
|
74
|
+
numRows: 200,
|
|
74
75
|
state: createPlDataTableStateV2(),
|
|
75
76
|
},
|
|
76
77
|
dynamicSections: [],
|
|
@@ -94,7 +95,7 @@ export const platforma = BlockModel.create('Heavy')
|
|
|
94
95
|
})
|
|
95
96
|
|
|
96
97
|
.output('ptV2Sheets', (ctx) => {
|
|
97
|
-
const rowCount = ctx.
|
|
98
|
+
const rowCount = ctx.uiState.dataTableV2.numRows ?? 0;
|
|
98
99
|
const sheets = [
|
|
99
100
|
{
|
|
100
101
|
axis: {
|
|
@@ -115,7 +116,7 @@ export const platforma = BlockModel.create('Heavy')
|
|
|
115
116
|
})
|
|
116
117
|
|
|
117
118
|
.output('ptV2', (ctx) => {
|
|
118
|
-
const rowCount = ctx.
|
|
119
|
+
const rowCount = ctx.uiState.dataTableV2.numRows ?? 0;
|
|
119
120
|
const makePartitionId = (rowCount: number, i: number) => Math.floor((2 * i) / (rowCount + 1));
|
|
120
121
|
const columns: PColumn<PColumnValues>[] = [
|
|
121
122
|
{
|