@milaboratories/milaboratories.ui-examples.model 1.0.24 → 1.0.26
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 -14
- package/CHANGELOG.md +12 -0
- package/dist/bundle.js +36 -3
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +35 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -3
- package/dist/index.d.ts +21 -3
- package/dist/index.js +36 -4
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +2 -2
- package/src/index.ts +77 -3
package/dist/index.cjs
CHANGED
|
@@ -9,8 +9,38 @@ var $BlockArgs = zod.z.object({
|
|
|
9
9
|
});
|
|
10
10
|
var platforma = model.BlockModel.create("Heavy").initialArgs({ numbers: [] }).output(
|
|
11
11
|
"numbers",
|
|
12
|
-
(ctx) => ctx.
|
|
13
|
-
).
|
|
12
|
+
(ctx) => ctx.outputs?.resolve("numbers")?.getDataAsJson()
|
|
13
|
+
).output("pFrame", (ctx) => {
|
|
14
|
+
const collection = ctx.resultPool.getData();
|
|
15
|
+
if (collection === void 0 || !collection.isComplete) return void 0;
|
|
16
|
+
const valueTypes = ["Int", "Long", "Float", "Double", "String", "Bytes"];
|
|
17
|
+
const columns = collection.entries.map(({ obj }) => obj).filter(model.isPColumn).filter((column) => valueTypes.find((valueType) => valueType === column.spec.valueType));
|
|
18
|
+
try {
|
|
19
|
+
return ctx.createPFrame(columns);
|
|
20
|
+
} catch (err) {
|
|
21
|
+
return void 0;
|
|
22
|
+
}
|
|
23
|
+
}).output("pTable", (ctx) => {
|
|
24
|
+
const join = ctx.uiState?.dataTableState?.tableState.pTableParams?.join;
|
|
25
|
+
if (!join) return void 0;
|
|
26
|
+
const collection = ctx.resultPool.getData();
|
|
27
|
+
if (!collection || !collection.isComplete) return void 0;
|
|
28
|
+
const columns = collection.entries.map(({ obj }) => obj).filter(model.isPColumn);
|
|
29
|
+
if (columns.length === 0) return void 0;
|
|
30
|
+
try {
|
|
31
|
+
return ctx.createPTable({
|
|
32
|
+
src: model.mapJoinEntry(join, (idAndSpec) => {
|
|
33
|
+
const column = columns.find((it) => it.id === idAndSpec.columnId);
|
|
34
|
+
if (!column) throw Error(`column '${column}' not ready`);
|
|
35
|
+
return column;
|
|
36
|
+
}),
|
|
37
|
+
filters: ctx.uiState.dataTableState?.tableState.pTableParams?.filters ?? [],
|
|
38
|
+
sorting: ctx.uiState.dataTableState?.tableState.pTableParams?.sorting ?? []
|
|
39
|
+
});
|
|
40
|
+
} catch (err) {
|
|
41
|
+
return void 0;
|
|
42
|
+
}
|
|
43
|
+
}).sections((ctx) => {
|
|
14
44
|
return [
|
|
15
45
|
{ type: "link", href: "/", label: "PlLogView" },
|
|
16
46
|
{ type: "link", href: "/modals", label: "Modals" },
|
|
@@ -20,7 +50,9 @@ var platforma = model.BlockModel.create("Heavy").initialArgs({ numbers: [] }).ou
|
|
|
20
50
|
{ type: "link", href: "/use-watch-fetch", label: "useWatchFetch" },
|
|
21
51
|
{ type: "link", href: "/form-components", label: "Form Components" },
|
|
22
52
|
{ type: "link", href: "/typography", label: "Typography" },
|
|
23
|
-
{ type: "link", href: "/ag-grid-vue", label: "AgGridVue" }
|
|
53
|
+
{ type: "link", href: "/ag-grid-vue", label: "AgGridVue" },
|
|
54
|
+
{ type: "link", href: "/pl-ag-data-table", label: "PlAgDataTable" },
|
|
55
|
+
{ type: "link", href: "/errors", label: "Errors" }
|
|
24
56
|
];
|
|
25
57
|
}).done();
|
|
26
58
|
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["z","BlockModel"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["z","BlockModel","isPColumn","mapJoinEntry"],"mappings":";;;;;;AAgBa,IAAA,UAAA,GAAaA,MAAE,MAAO,CAAA;AAAA,EACjC,SAASA,K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AAY,EAAA;AAAA,IAC9C,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,SAAA,EAAW,OAAO,QAAS,EAAA;AAAA,IACjD,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,eAAA,EAAiB,OAAO,cAAe,EAAA;AAAA,IAC7D,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,aAAA,EAAe,OAAO,YAAa,EAAA;AAAA,IACzD,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,YAAA,EAAc,OAAO,WAAY,EAAA;AAAA,IACvD,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,kBAAA,EAAoB,OAAO,eAAgB,EAAA;AAAA,IACjE,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,kBAAA,EAAoB,OAAO,iBAAkB,EAAA;AAAA,IACnE,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,aAAA,EAAe,OAAO,YAAa,EAAA;AAAA,IACzD,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,cAAA,EAAgB,OAAO,WAAY,EAAA;AAAA,IACzD,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,mBAAA,EAAqB,OAAO,eAAgB,EAAA;AAAA,IAClE,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,SAAA,EAAW,OAAO,QAAS,EAAA;AAAA,GACnD,CAAA;AACF,CAAC,EAEA,IAAK","file":"index.cjs","sourcesContent":["import { \n BlockModel, \n InferHrefType, \n InferOutputsType, \n mapJoinEntry, \n PColumnIdAndSpec, \n AxisSpec, \n JoinEntry, \n AxisId, \n PlDataTableState, \n ValueType, \n isPColumn,\n PlDataTableGridState \n} from '@platforma-sdk/model';\nimport {z} from 'zod';\n\nexport const $BlockArgs = z.object({\n numbers: z.array(z.coerce.number())\n});\n\nexport type BlockArgs = z.infer<typeof $BlockArgs>;\n\nexport type TableState = {\n settingsOpened: boolean;\n gridState: PlDataTableGridState;\n group: {\n mainColumn?: PColumnIdAndSpec;\n additionalColumns: PColumnIdAndSpec[];\n enrichmentColumns: PColumnIdAndSpec[];\n possiblePartitioningAxes: AxisSpec[];\n join?: JoinEntry<PColumnIdAndSpec>;\n };\n partitioningAxes: AxisId[];\n tableState: PlDataTableState;\n};\n\nexport type UiState = {\n dataTableState: TableState | undefined,\n};\n\nexport const platforma = BlockModel.create<BlockArgs, UiState>('Heavy')\n\n .initialArgs({ numbers: [] })\n\n .output('numbers', (ctx) =>\n ctx.outputs?.resolve('numbers')?.getDataAsJson<number[]>()\n )\n\n .output('pFrame', (ctx) => {\n const collection = ctx.resultPool.getData();\n if (collection === undefined || !collection.isComplete) return undefined;\n\n const valueTypes = ['Int', 'Long', 'Float', 'Double', 'String', 'Bytes'] as ValueType[];\n const columns = collection.entries\n .map(({ obj }) => obj)\n .filter(isPColumn)\n .filter((column) => valueTypes.find((valueType) => valueType === column.spec.valueType));\n\n try {\n return ctx.createPFrame(columns);\n } catch (err) {\n return undefined;\n }\n })\n .output('pTable', (ctx) => {\n const join = ctx.uiState?.dataTableState?.tableState.pTableParams?.join;\n if (!join) return undefined;\n\n const collection = ctx.resultPool.getData();\n if (!collection || !collection.isComplete) return undefined;\n\n const columns = collection.entries.map(({ obj }) => obj).filter(isPColumn);\n if (columns.length === 0) return undefined;\n\n try {\n return ctx.createPTable({\n src: mapJoinEntry(join, (idAndSpec) => {\n const column = columns.find(it => it.id === idAndSpec.columnId);\n if (!column) throw Error(`column '${column}' not ready`);\n return column;\n }),\n filters: ctx.uiState.dataTableState?.tableState.pTableParams?.filters ?? [],\n sorting: ctx.uiState.dataTableState?.tableState.pTableParams?.sorting ?? []\n });\n } catch (err) {\n return undefined;\n }\n })\n\n .sections((ctx) => {\n return [\n { type: 'link', href: '/', label: 'PlLogView' }, \n { type: 'link', href: '/modals', label: 'Modals' },\n { type: 'link', href: '/select-files', label: 'Select Files' },\n { type: 'link', href: '/inject-env', label: 'Inject env' },\n { type: 'link', href: '/dropdowns', label: 'Dropdowns' },\n { type: 'link', href: '/use-watch-fetch', label: 'useWatchFetch' },\n { type: 'link', href: '/form-components', label: 'Form Components' },\n { type: 'link', href: '/typography', label: 'Typography' },\n { type: 'link', href: '/ag-grid-vue', label: 'AgGridVue' },\n { type: 'link', href: '/pl-ag-data-table', label: 'PlAgDataTable' },\n { type: 'link', href: '/errors', label: 'Errors' },\n ];\n })\n\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof platforma>;\nexport type Href = InferHrefType<typeof platforma>;\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _platforma_sdk_model from '@platforma-sdk/model';
|
|
2
|
-
import { InferOutputsType, InferHrefType } from '@platforma-sdk/model';
|
|
2
|
+
import { PlDataTableGridState, PColumnIdAndSpec, AxisSpec, JoinEntry, AxisId, PlDataTableState, InferOutputsType, InferHrefType } from '@platforma-sdk/model';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const $BlockArgs: z.ZodObject<{
|
|
@@ -10,12 +10,30 @@ declare const $BlockArgs: z.ZodObject<{
|
|
|
10
10
|
numbers: number[];
|
|
11
11
|
}>;
|
|
12
12
|
type BlockArgs = z.infer<typeof $BlockArgs>;
|
|
13
|
+
type TableState = {
|
|
14
|
+
settingsOpened: boolean;
|
|
15
|
+
gridState: PlDataTableGridState;
|
|
16
|
+
group: {
|
|
17
|
+
mainColumn?: PColumnIdAndSpec;
|
|
18
|
+
additionalColumns: PColumnIdAndSpec[];
|
|
19
|
+
enrichmentColumns: PColumnIdAndSpec[];
|
|
20
|
+
possiblePartitioningAxes: AxisSpec[];
|
|
21
|
+
join?: JoinEntry<PColumnIdAndSpec>;
|
|
22
|
+
};
|
|
23
|
+
partitioningAxes: AxisId[];
|
|
24
|
+
tableState: PlDataTableState;
|
|
25
|
+
};
|
|
26
|
+
type UiState = {
|
|
27
|
+
dataTableState: TableState | undefined;
|
|
28
|
+
};
|
|
13
29
|
declare const platforma: _platforma_sdk_model.Platforma<{
|
|
14
30
|
numbers: number[];
|
|
15
31
|
}, {
|
|
16
32
|
numbers: _platforma_sdk_model.ValueOrErrors<number[] | undefined>;
|
|
17
|
-
|
|
33
|
+
pFrame: _platforma_sdk_model.ValueOrErrors<_platforma_sdk_model.PFrameHandle | undefined>;
|
|
34
|
+
pTable: _platforma_sdk_model.ValueOrErrors<_platforma_sdk_model.PTableHandle | undefined>;
|
|
35
|
+
}, UiState, "/" | "/modals" | "/select-files" | "/inject-env" | "/dropdowns" | "/use-watch-fetch" | "/form-components" | "/typography" | "/ag-grid-vue" | "/pl-ag-data-table" | "/errors">;
|
|
18
36
|
type BlockOutputs = InferOutputsType<typeof platforma>;
|
|
19
37
|
type Href = InferHrefType<typeof platforma>;
|
|
20
38
|
|
|
21
|
-
export { $BlockArgs, type BlockArgs, type BlockOutputs, type Href, platforma };
|
|
39
|
+
export { $BlockArgs, type BlockArgs, type BlockOutputs, type Href, type TableState, type UiState, platforma };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _platforma_sdk_model from '@platforma-sdk/model';
|
|
2
|
-
import { InferOutputsType, InferHrefType } from '@platforma-sdk/model';
|
|
2
|
+
import { PlDataTableGridState, PColumnIdAndSpec, AxisSpec, JoinEntry, AxisId, PlDataTableState, InferOutputsType, InferHrefType } from '@platforma-sdk/model';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const $BlockArgs: z.ZodObject<{
|
|
@@ -10,12 +10,30 @@ declare const $BlockArgs: z.ZodObject<{
|
|
|
10
10
|
numbers: number[];
|
|
11
11
|
}>;
|
|
12
12
|
type BlockArgs = z.infer<typeof $BlockArgs>;
|
|
13
|
+
type TableState = {
|
|
14
|
+
settingsOpened: boolean;
|
|
15
|
+
gridState: PlDataTableGridState;
|
|
16
|
+
group: {
|
|
17
|
+
mainColumn?: PColumnIdAndSpec;
|
|
18
|
+
additionalColumns: PColumnIdAndSpec[];
|
|
19
|
+
enrichmentColumns: PColumnIdAndSpec[];
|
|
20
|
+
possiblePartitioningAxes: AxisSpec[];
|
|
21
|
+
join?: JoinEntry<PColumnIdAndSpec>;
|
|
22
|
+
};
|
|
23
|
+
partitioningAxes: AxisId[];
|
|
24
|
+
tableState: PlDataTableState;
|
|
25
|
+
};
|
|
26
|
+
type UiState = {
|
|
27
|
+
dataTableState: TableState | undefined;
|
|
28
|
+
};
|
|
13
29
|
declare const platforma: _platforma_sdk_model.Platforma<{
|
|
14
30
|
numbers: number[];
|
|
15
31
|
}, {
|
|
16
32
|
numbers: _platforma_sdk_model.ValueOrErrors<number[] | undefined>;
|
|
17
|
-
|
|
33
|
+
pFrame: _platforma_sdk_model.ValueOrErrors<_platforma_sdk_model.PFrameHandle | undefined>;
|
|
34
|
+
pTable: _platforma_sdk_model.ValueOrErrors<_platforma_sdk_model.PTableHandle | undefined>;
|
|
35
|
+
}, UiState, "/" | "/modals" | "/select-files" | "/inject-env" | "/dropdowns" | "/use-watch-fetch" | "/form-components" | "/typography" | "/ag-grid-vue" | "/pl-ag-data-table" | "/errors">;
|
|
18
36
|
type BlockOutputs = InferOutputsType<typeof platforma>;
|
|
19
37
|
type Href = InferHrefType<typeof platforma>;
|
|
20
38
|
|
|
21
|
-
export { $BlockArgs, type BlockArgs, type BlockOutputs, type Href, platforma };
|
|
39
|
+
export { $BlockArgs, type BlockArgs, type BlockOutputs, type Href, type TableState, type UiState, platforma };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockModel } from '@platforma-sdk/model';
|
|
1
|
+
import { BlockModel, isPColumn, mapJoinEntry } from '@platforma-sdk/model';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
// src/index.ts
|
|
@@ -7,8 +7,38 @@ var $BlockArgs = z.object({
|
|
|
7
7
|
});
|
|
8
8
|
var platforma = BlockModel.create("Heavy").initialArgs({ numbers: [] }).output(
|
|
9
9
|
"numbers",
|
|
10
|
-
(ctx) => ctx.
|
|
11
|
-
).
|
|
10
|
+
(ctx) => ctx.outputs?.resolve("numbers")?.getDataAsJson()
|
|
11
|
+
).output("pFrame", (ctx) => {
|
|
12
|
+
const collection = ctx.resultPool.getData();
|
|
13
|
+
if (collection === void 0 || !collection.isComplete) return void 0;
|
|
14
|
+
const valueTypes = ["Int", "Long", "Float", "Double", "String", "Bytes"];
|
|
15
|
+
const columns = collection.entries.map(({ obj }) => obj).filter(isPColumn).filter((column) => valueTypes.find((valueType) => valueType === column.spec.valueType));
|
|
16
|
+
try {
|
|
17
|
+
return ctx.createPFrame(columns);
|
|
18
|
+
} catch (err) {
|
|
19
|
+
return void 0;
|
|
20
|
+
}
|
|
21
|
+
}).output("pTable", (ctx) => {
|
|
22
|
+
const join = ctx.uiState?.dataTableState?.tableState.pTableParams?.join;
|
|
23
|
+
if (!join) return void 0;
|
|
24
|
+
const collection = ctx.resultPool.getData();
|
|
25
|
+
if (!collection || !collection.isComplete) return void 0;
|
|
26
|
+
const columns = collection.entries.map(({ obj }) => obj).filter(isPColumn);
|
|
27
|
+
if (columns.length === 0) return void 0;
|
|
28
|
+
try {
|
|
29
|
+
return ctx.createPTable({
|
|
30
|
+
src: mapJoinEntry(join, (idAndSpec) => {
|
|
31
|
+
const column = columns.find((it) => it.id === idAndSpec.columnId);
|
|
32
|
+
if (!column) throw Error(`column '${column}' not ready`);
|
|
33
|
+
return column;
|
|
34
|
+
}),
|
|
35
|
+
filters: ctx.uiState.dataTableState?.tableState.pTableParams?.filters ?? [],
|
|
36
|
+
sorting: ctx.uiState.dataTableState?.tableState.pTableParams?.sorting ?? []
|
|
37
|
+
});
|
|
38
|
+
} catch (err) {
|
|
39
|
+
return void 0;
|
|
40
|
+
}
|
|
41
|
+
}).sections((ctx) => {
|
|
12
42
|
return [
|
|
13
43
|
{ type: "link", href: "/", label: "PlLogView" },
|
|
14
44
|
{ type: "link", href: "/modals", label: "Modals" },
|
|
@@ -18,7 +48,9 @@ var platforma = BlockModel.create("Heavy").initialArgs({ numbers: [] }).output(
|
|
|
18
48
|
{ type: "link", href: "/use-watch-fetch", label: "useWatchFetch" },
|
|
19
49
|
{ type: "link", href: "/form-components", label: "Form Components" },
|
|
20
50
|
{ type: "link", href: "/typography", label: "Typography" },
|
|
21
|
-
{ type: "link", href: "/ag-grid-vue", label: "AgGridVue" }
|
|
51
|
+
{ type: "link", href: "/ag-grid-vue", label: "AgGridVue" },
|
|
52
|
+
{ type: "link", href: "/pl-ag-data-table", label: "PlAgDataTable" },
|
|
53
|
+
{ type: "link", href: "/errors", label: "Errors" }
|
|
22
54
|
];
|
|
23
55
|
}).done();
|
|
24
56
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;AAgBa,IAAA,UAAA,GAAa,EAAE,MAAO,CAAA;AAAA,EACjC,SAAS,CAAE,CAAA,KAAA,CAAM,CAAE,CAAA,MAAA,CAAO,QAAQ,CAAA;AACpC,CAAC,EAAA;AAsBY,IAAA,SAAA,GAAY,UAAW,CAAA,MAAA,CAA2B,OAAO,CAAA,CAEnE,WAAY,CAAA,EAAE,OAAS,EAAA,EAAG,EAAC,CAE3B,CAAA,MAAA;AAAA,EAAO,SAAA;AAAA,EAAW,CAAC,GAClB,KAAA,GAAA,CAAI,SAAS,OAAQ,CAAA,SAAS,GAAG,aAAwB,EAAA;AAC3D,CAEC,CAAA,MAAA,CAAO,QAAU,EAAA,CAAC,GAAQ,KAAA;AACzB,EAAM,MAAA,UAAA,GAAa,GAAI,CAAA,UAAA,CAAW,OAAQ,EAAA,CAAA;AAC1C,EAAA,IAAI,UAAe,KAAA,KAAA,CAAA,IAAa,CAAC,UAAA,CAAW,YAAmB,OAAA,KAAA,CAAA,CAAA;AAE/D,EAAA,MAAM,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,IAAM,EAAA,aAAA,EAAe,OAAO,YAAa,EAAA;AAAA,IACzD,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,cAAA,EAAgB,OAAO,WAAY,EAAA;AAAA,IACzD,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,mBAAA,EAAqB,OAAO,eAAgB,EAAA;AAAA,IAClE,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,SAAA,EAAW,OAAO,QAAS,EAAA;AAAA,GACnD,CAAA;AACF,CAAC,EAEA,IAAK","file":"index.js","sourcesContent":["import { \n BlockModel, \n InferHrefType, \n InferOutputsType, \n mapJoinEntry, \n PColumnIdAndSpec, \n AxisSpec, \n JoinEntry, \n AxisId, \n PlDataTableState, \n ValueType, \n isPColumn,\n PlDataTableGridState \n} from '@platforma-sdk/model';\nimport {z} from 'zod';\n\nexport const $BlockArgs = z.object({\n numbers: z.array(z.coerce.number())\n});\n\nexport type BlockArgs = z.infer<typeof $BlockArgs>;\n\nexport type TableState = {\n settingsOpened: boolean;\n gridState: PlDataTableGridState;\n group: {\n mainColumn?: PColumnIdAndSpec;\n additionalColumns: PColumnIdAndSpec[];\n enrichmentColumns: PColumnIdAndSpec[];\n possiblePartitioningAxes: AxisSpec[];\n join?: JoinEntry<PColumnIdAndSpec>;\n };\n partitioningAxes: AxisId[];\n tableState: PlDataTableState;\n};\n\nexport type UiState = {\n dataTableState: TableState | undefined,\n};\n\nexport const platforma = BlockModel.create<BlockArgs, UiState>('Heavy')\n\n .initialArgs({ numbers: [] })\n\n .output('numbers', (ctx) =>\n ctx.outputs?.resolve('numbers')?.getDataAsJson<number[]>()\n )\n\n .output('pFrame', (ctx) => {\n const collection = ctx.resultPool.getData();\n if (collection === undefined || !collection.isComplete) return undefined;\n\n const valueTypes = ['Int', 'Long', 'Float', 'Double', 'String', 'Bytes'] as ValueType[];\n const columns = collection.entries\n .map(({ obj }) => obj)\n .filter(isPColumn)\n .filter((column) => valueTypes.find((valueType) => valueType === column.spec.valueType));\n\n try {\n return ctx.createPFrame(columns);\n } catch (err) {\n return undefined;\n }\n })\n .output('pTable', (ctx) => {\n const join = ctx.uiState?.dataTableState?.tableState.pTableParams?.join;\n if (!join) return undefined;\n\n const collection = ctx.resultPool.getData();\n if (!collection || !collection.isComplete) return undefined;\n\n const columns = collection.entries.map(({ obj }) => obj).filter(isPColumn);\n if (columns.length === 0) return undefined;\n\n try {\n return ctx.createPTable({\n src: mapJoinEntry(join, (idAndSpec) => {\n const column = columns.find(it => it.id === idAndSpec.columnId);\n if (!column) throw Error(`column '${column}' not ready`);\n return column;\n }),\n filters: ctx.uiState.dataTableState?.tableState.pTableParams?.filters ?? [],\n sorting: ctx.uiState.dataTableState?.tableState.pTableParams?.sorting ?? []\n });\n } catch (err) {\n return undefined;\n }\n })\n\n .sections((ctx) => {\n return [\n { type: 'link', href: '/', label: 'PlLogView' }, \n { type: 'link', href: '/modals', label: 'Modals' },\n { type: 'link', href: '/select-files', label: 'Select Files' },\n { type: 'link', href: '/inject-env', label: 'Inject env' },\n { type: 'link', href: '/dropdowns', label: 'Dropdowns' },\n { type: 'link', href: '/use-watch-fetch', label: 'useWatchFetch' },\n { type: 'link', href: '/form-components', label: 'Form Components' },\n { type: 'link', href: '/typography', label: 'Typography' },\n { type: 'link', href: '/ag-grid-vue', label: 'AgGridVue' },\n { type: 'link', href: '/pl-ag-data-table', label: 'PlAgDataTable' },\n { type: 'link', href: '/errors', label: 'Errors' },\n ];\n })\n\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof platforma>;\nexport type Href = InferHrefType<typeof platforma>;\n"]}
|