@milaboratories/milaboratories.ui-examples.model 1.1.51 → 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/.turbo/turbo-build.log +13 -13
- package/CHANGELOG.md +6 -0
- package/dist/bundle.js +98 -0
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +56 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -2
- package/dist/index.d.ts +52 -2
- package/dist/index.js +57 -1
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +1 -1
- package/src/index.ts +62 -0
package/package.json
CHANGED
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' },
|