@milaboratories/milaboratories.ui-examples.model 1.2.6 → 1.2.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/milaboratories.ui-examples.model",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
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.40.0"
11
+ "@platforma-sdk/model": "1.40.1"
12
12
  },
13
13
  "devDependencies": {
14
14
  "typescript": "~5.6.3",
package/src/index.ts CHANGED
@@ -50,7 +50,10 @@ export const $BlockArgs = z.object({
50
50
  export type BlockArgs = z.infer<typeof $BlockArgs>;
51
51
 
52
52
  export type UiState = {
53
- dataTableStateV2: PlDataTableStateV2;
53
+ dataTableV2: {
54
+ sourceId?: string;
55
+ state: PlDataTableStateV2;
56
+ };
54
57
  dynamicSections: {
55
58
  id: string;
56
59
  label: string;
@@ -62,7 +65,10 @@ export const platforma = BlockModel.create('Heavy')
62
65
  .withArgs<BlockArgs>({ numbers: [1, 2, 3, 4], tableNumRows: 100, handles: [] })
63
66
 
64
67
  .withUiState<UiState>({
65
- dataTableStateV2: createPlDataTableStateV2(),
68
+ dataTableV2: {
69
+ sourceId: 'source_1',
70
+ state: createPlDataTableStateV2(),
71
+ },
66
72
  dynamicSections: [],
67
73
  })
68
74
 
@@ -179,6 +185,33 @@ export const platforma = BlockModel.create('Heavy')
179
185
  };
180
186
  }),
181
187
  },
188
+ {
189
+ id: 'labelColumn' as PObjectId,
190
+ spec: {
191
+ kind: 'PColumn',
192
+ valueType: 'Int',
193
+ name: 'pl7.app/label',
194
+ annotations: {
195
+ 'pl7.app/label': 'Int axis labels',
196
+ },
197
+ axesSpec: [
198
+ {
199
+ type: 'Int',
200
+ name: 'index',
201
+ annotations: {
202
+ 'pl7.app/label': 'Int axis',
203
+ },
204
+ },
205
+ ],
206
+ },
207
+ data: times(rowCount, (i) => {
208
+ const v = i + 1;
209
+ return {
210
+ key: [v],
211
+ val: 100000 - v,
212
+ };
213
+ }),
214
+ },
182
215
  ];
183
216
  for (let j = 3; j < 10; ++j) {
184
217
  columns.push({
@@ -213,7 +246,7 @@ export const platforma = BlockModel.create('Heavy')
213
246
  return createPlDataTableV2(
214
247
  ctx,
215
248
  columns,
216
- ctx.uiState.dataTableStateV2,
249
+ ctx.uiState.dataTableV2.state,
217
250
  );
218
251
  })
219
252