@milaboratories/milaboratories.ui-examples.model 1.1.50 → 1.1.52

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.1.50",
3
+ "version": "1.1.52",
4
4
  "description": "Block model",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -8,13 +8,13 @@
8
8
  "types": "dist/index.d.ts",
9
9
  "dependencies": {
10
10
  "zod": "~3.23.8",
11
- "@platforma-sdk/model": "1.29.22"
11
+ "@platforma-sdk/model": "1.30.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "typescript": "~5.5.4",
15
15
  "vite": "^5.4.11",
16
16
  "tsup": "~8.3.5",
17
- "@platforma-sdk/block-tools": "2.5.40"
17
+ "@platforma-sdk/block-tools": "2.5.42"
18
18
  },
19
19
  "tsup": {
20
20
  "entry": [
package/src/index.ts CHANGED
@@ -11,6 +11,8 @@ import type {
11
11
  import {
12
12
  BlockModel,
13
13
  createPlDataTable,
14
+ createPlDataTableV2,
15
+ selectorsToPredicate,
14
16
  } from '@platforma-sdk/model';
15
17
  import { z } from 'zod';
16
18
 
@@ -139,6 +141,65 @@ export const platforma = BlockModel.create('Heavy')
139
141
  );
140
142
  })
141
143
 
144
+ .output('ptV2', (ctx) => {
145
+ if (!ctx.uiState?.dataTableState?.tableState.pTableParams?.filters) return undefined;
146
+
147
+ const data = times(ctx.args.tableNumRows ?? 0, (i) => {
148
+ const v = i + 1;
149
+ return {
150
+ key: [v, v + 0.1],
151
+ val: v.toString(),
152
+ };
153
+ });
154
+
155
+ return createPlDataTableV2(
156
+ ctx,
157
+ [
158
+ {
159
+ id: 'example' as PObjectId,
160
+ spec: {
161
+ kind: 'PColumn',
162
+ valueType: 'String',
163
+ name: 'example',
164
+ annotations: {
165
+ 'pl7.app/label': 'String column',
166
+ 'pl7.app/discreteValues': '["up","down"]',
167
+ },
168
+ axesSpec: [
169
+ {
170
+ type: 'Int',
171
+ name: 'index',
172
+ annotations: {
173
+ 'pl7.app/label': 'Int axis',
174
+ 'pl7.app/discreteValues': '[1,2]',
175
+ },
176
+ },
177
+ {
178
+ type: 'Float',
179
+ name: 'value',
180
+ annotations: {
181
+ 'pl7.app/label': 'Float axis',
182
+ 'pl7.app/table/visibility': 'optional',
183
+ },
184
+ },
185
+ ],
186
+ },
187
+ data,
188
+ } satisfies PColumn<PColumnValues>,
189
+ ],
190
+ selectorsToPredicate({
191
+ name: 'example',
192
+ }),
193
+ ctx.uiState.dataTableState.tableState,
194
+ {
195
+ filters: [
196
+ ...(ctx.uiState.dataTableState.tableState.pTableParams?.filters ?? []),
197
+ ...(ctx.uiState.dataTableState.filterModel?.filters ?? []),
198
+ ],
199
+ },
200
+ );
201
+ })
202
+
142
203
  .title((ctx) => {
143
204
  if (ctx.args.numbers.length === 5) {
144
205
  throw new Error('block title: test error');
@@ -172,6 +233,7 @@ export const platforma = BlockModel.create('Heavy')
172
233
  { type: 'link', href: '/ag-grid-vue', label: 'AgGridVue' },
173
234
  { type: 'link', href: '/ag-grid-vue-with-builder', label: 'AgGridVue with builder' },
174
235
  { type: 'link', href: '/pl-ag-data-table', label: 'PlAgDataTable' },
236
+ { type: 'link', href: '/pl-ag-data-table-v2', label: 'PlAgDataTableV2' },
175
237
  { type: 'link', href: '/pl-splash-page', label: 'PlSplashPage' },
176
238
  { type: 'link', href: '/errors', label: 'Errors' },
177
239
  { type: 'link', href: '/text-fields', label: 'PlTextField' },