@milaboratories/milaboratories.ui-examples.model 1.0.50 → 1.1.1
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 +18 -0
- package/dist/bundle.js +330 -363
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +28 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -28
- package/dist/index.d.ts +1 -28
- package/dist/index.js +29 -19
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +3 -3
- package/src/index.ts +31 -35
package/dist/index.cjs
CHANGED
|
@@ -7,24 +7,34 @@ var zod = require('zod');
|
|
|
7
7
|
var $BlockArgs = zod.z.object({
|
|
8
8
|
numbers: zod.z.array(zod.z.coerce.number())
|
|
9
9
|
});
|
|
10
|
-
var platforma = model.BlockModel.create("Heavy").withArgs({ numbers: [1, 2, 3] }).withUiState({ dataTableState: void 0 }).output("numbers", (ctx) => ctx.outputs?.resolve("numbers")?.getDataAsJson()).
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
var platforma = model.BlockModel.create("Heavy").withArgs({ numbers: [1, 2, 3] }).withUiState({ dataTableState: void 0 }).output("numbers", (ctx) => ctx.outputs?.resolve("numbers")?.getDataAsJson()).output("pt", (ctx) => {
|
|
11
|
+
if (!ctx.uiState?.dataTableState?.tableState.pTableParams?.filters) return void 0;
|
|
12
|
+
return model.createPlDataTable(ctx, [
|
|
13
|
+
{
|
|
14
|
+
id: "example",
|
|
15
|
+
spec: {
|
|
16
|
+
kind: "PColumn",
|
|
17
|
+
valueType: "String",
|
|
18
|
+
name: "example",
|
|
19
|
+
annotations: {
|
|
20
|
+
"pl7.app/label": "String column"
|
|
21
|
+
},
|
|
22
|
+
axesSpec: [
|
|
23
|
+
{
|
|
24
|
+
type: "Int",
|
|
25
|
+
name: "index",
|
|
26
|
+
annotations: {
|
|
27
|
+
"pl7.app/label": "Int axis"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
data: [
|
|
33
|
+
{ key: [1], val: "1" },
|
|
34
|
+
{ key: [2], val: "2" }
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
], ctx.uiState.dataTableState.tableState, [
|
|
28
38
|
...ctx.uiState.dataTableState.tableState.pTableParams?.filters,
|
|
29
39
|
...ctx.uiState.dataTableState.filterModel?.filters ?? []
|
|
30
40
|
]);
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["z","BlockModel","
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["z","BlockModel","createPlDataTable"],"mappings":";;;;;;AAaa,IAAA,UAAA,GAAaA,MAAE,MAAO,CAAA;AAAA,EACjC,SAASA,KAAE,CAAA,KAAA,CAAMA,KAAE,CAAA,MAAA,CAAO,QAAQ;AACpC,CAAC;AAaM,IAAM,YAAYC,gBAAW,CAAA,MAAA,CAAO,OAAO,CAAA,CAE/C,SAAoB,EAAE,OAAA,EAAS,CAAC,CAAA,EAAG,GAAG,CAAC,CAAA,EAAG,CAAA,CAE1C,YAAqB,EAAE,cAAA,EAAgB,KAAU,CAAA,EAAC,EAElD,MAAO,CAAA,SAAA,EAAW,CAAC,GAAA,KAAQ,IAAI,OAAS,EAAA,OAAA,CAAQ,SAAS,CAAA,EAAG,eAAyB,CAAA,CAErF,MAAO,CAAA,IAAA,EAAM,CAAC,GAAQ,KAAA;AACrB,EAAA,IAAI,CAAC,GAAI,CAAA,OAAA,EAAS,gBAAgB,UAAW,CAAA,YAAA,EAAc,SAAgB,OA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utputsType,\n PlDataTableState,\n createPlDataTable,\n PlTableFiltersModel,\n PColumn,\n PColumnValues,\n PObjectId,\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 tableState: PlDataTableState;\n filterModel: PlTableFiltersModel;\n};\n\nexport type UiState = {\n dataTableState: TableState | undefined;\n};\n\nexport const platforma = BlockModel.create('Heavy')\n\n .withArgs<BlockArgs>({ numbers: [1, 2, 3] })\n\n .withUiState<UiState>({ dataTableState: undefined })\n\n .output('numbers', (ctx) => ctx.outputs?.resolve('numbers')?.getDataAsJson<number[]>())\n\n .output('pt', (ctx) => {\n if (!ctx.uiState?.dataTableState?.tableState.pTableParams?.filters) return undefined;\n return createPlDataTable(ctx, [\n {\n id: \"example\" as PObjectId,\n spec: {\n kind: 'PColumn',\n valueType: 'String',\n name: 'example',\n annotations: {\n 'pl7.app/label': 'String column',\n },\n axesSpec: [\n {\n type: 'Int',\n name: 'index',\n annotations: {\n 'pl7.app/label': 'Int axis',\n },\n }\n ]\n },\n data: [\n { key: [1], val: '1' },\n { key: [2], val: '2' }\n ]\n } satisfies PColumn<PColumnValues>\n ], ctx.uiState.dataTableState.tableState, [\n ...ctx.uiState.dataTableState.tableState.pTableParams?.filters,\n ...(ctx.uiState.dataTableState.filterModel?.filters ?? [])\n ]);\n })\n\n .sections((ctx) => {\n return [\n { type: 'link', href: '/', label: 'Icons/Masks' },\n { type: 'link', href: '/layout', label: 'Layout' },\n { type: 'link', href: '/form-components', label: 'Form Components' },\n { type: 'link', href: '/log-view', 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: '/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 { type: 'link', href: '/text-fields', label: 'PlTextField' },\n { type: 'link', href: '/tabs', label: 'PlTabs' },\n { type: 'link', href: '/drafts', label: 'Drafts' },\n { type: 'link', href: '/buttons', label: 'ButtonsPage' },\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 { PlDataTableState,
|
|
2
|
+
import { PlDataTableState, PlTableFiltersModel, InferOutputsType, InferHrefType } from '@platforma-sdk/model';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const $BlockArgs: z.ZodObject<{
|
|
@@ -12,7 +12,6 @@ declare const $BlockArgs: z.ZodObject<{
|
|
|
12
12
|
type BlockArgs = z.infer<typeof $BlockArgs>;
|
|
13
13
|
type TableState = {
|
|
14
14
|
tableState: PlDataTableState;
|
|
15
|
-
anchorColumn?: PlRef;
|
|
16
15
|
filterModel: PlTableFiltersModel;
|
|
17
16
|
};
|
|
18
17
|
type UiState = {
|
|
@@ -22,32 +21,6 @@ declare const platforma: _platforma_sdk_model.Platforma<{
|
|
|
22
21
|
numbers: number[];
|
|
23
22
|
}, {
|
|
24
23
|
numbers: _platforma_sdk_model.ValueOrErrors<number[] | undefined>;
|
|
25
|
-
inputOptions: _platforma_sdk_model.ValueOrErrors<{
|
|
26
|
-
readonly ref: {
|
|
27
|
-
readonly __isRef: true;
|
|
28
|
-
readonly blockId: string;
|
|
29
|
-
readonly name: string;
|
|
30
|
-
};
|
|
31
|
-
readonly label: string;
|
|
32
|
-
}[]>;
|
|
33
|
-
sheets: _platforma_sdk_model.ValueOrErrors<{
|
|
34
|
-
axis: {
|
|
35
|
-
readonly type: ValueType;
|
|
36
|
-
readonly name: string;
|
|
37
|
-
readonly domain?: {
|
|
38
|
-
[x: string]: string;
|
|
39
|
-
} | undefined;
|
|
40
|
-
readonly annotations?: {
|
|
41
|
-
[x: string]: string;
|
|
42
|
-
} | undefined;
|
|
43
|
-
readonly parentAxes?: number[] | undefined;
|
|
44
|
-
};
|
|
45
|
-
options: {
|
|
46
|
-
value: string | number;
|
|
47
|
-
label: string;
|
|
48
|
-
}[];
|
|
49
|
-
defaultValue?: (string | number) | undefined;
|
|
50
|
-
}[] | undefined>;
|
|
51
24
|
pt: _platforma_sdk_model.ValueOrErrors<_platforma_sdk_model.PTableHandle | undefined>;
|
|
52
25
|
}, UiState, "/" | "/layout" | "/form-components" | "/log-view" | "/modals" | "/select-files" | "/inject-env" | "/dropdowns" | "/use-watch-fetch" | "/typography" | "/ag-grid-vue" | "/pl-ag-data-table" | "/errors" | "/text-fields" | "/tabs" | "/drafts" | "/buttons">;
|
|
53
26
|
type BlockOutputs = InferOutputsType<typeof platforma>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _platforma_sdk_model from '@platforma-sdk/model';
|
|
2
|
-
import { PlDataTableState,
|
|
2
|
+
import { PlDataTableState, PlTableFiltersModel, InferOutputsType, InferHrefType } from '@platforma-sdk/model';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const $BlockArgs: z.ZodObject<{
|
|
@@ -12,7 +12,6 @@ declare const $BlockArgs: z.ZodObject<{
|
|
|
12
12
|
type BlockArgs = z.infer<typeof $BlockArgs>;
|
|
13
13
|
type TableState = {
|
|
14
14
|
tableState: PlDataTableState;
|
|
15
|
-
anchorColumn?: PlRef;
|
|
16
15
|
filterModel: PlTableFiltersModel;
|
|
17
16
|
};
|
|
18
17
|
type UiState = {
|
|
@@ -22,32 +21,6 @@ declare const platforma: _platforma_sdk_model.Platforma<{
|
|
|
22
21
|
numbers: number[];
|
|
23
22
|
}, {
|
|
24
23
|
numbers: _platforma_sdk_model.ValueOrErrors<number[] | undefined>;
|
|
25
|
-
inputOptions: _platforma_sdk_model.ValueOrErrors<{
|
|
26
|
-
readonly ref: {
|
|
27
|
-
readonly __isRef: true;
|
|
28
|
-
readonly blockId: string;
|
|
29
|
-
readonly name: string;
|
|
30
|
-
};
|
|
31
|
-
readonly label: string;
|
|
32
|
-
}[]>;
|
|
33
|
-
sheets: _platforma_sdk_model.ValueOrErrors<{
|
|
34
|
-
axis: {
|
|
35
|
-
readonly type: ValueType;
|
|
36
|
-
readonly name: string;
|
|
37
|
-
readonly domain?: {
|
|
38
|
-
[x: string]: string;
|
|
39
|
-
} | undefined;
|
|
40
|
-
readonly annotations?: {
|
|
41
|
-
[x: string]: string;
|
|
42
|
-
} | undefined;
|
|
43
|
-
readonly parentAxes?: number[] | undefined;
|
|
44
|
-
};
|
|
45
|
-
options: {
|
|
46
|
-
value: string | number;
|
|
47
|
-
label: string;
|
|
48
|
-
}[];
|
|
49
|
-
defaultValue?: (string | number) | undefined;
|
|
50
|
-
}[] | undefined>;
|
|
51
24
|
pt: _platforma_sdk_model.ValueOrErrors<_platforma_sdk_model.PTableHandle | undefined>;
|
|
52
25
|
}, UiState, "/" | "/layout" | "/form-components" | "/log-view" | "/modals" | "/select-files" | "/inject-env" | "/dropdowns" | "/use-watch-fetch" | "/typography" | "/ag-grid-vue" | "/pl-ag-data-table" | "/errors" | "/text-fields" | "/tabs" | "/drafts" | "/buttons">;
|
|
53
26
|
type BlockOutputs = InferOutputsType<typeof platforma>;
|
package/dist/index.js
CHANGED
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
import { BlockModel,
|
|
1
|
+
import { BlockModel, createPlDataTable } from '@platforma-sdk/model';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
// src/index.ts
|
|
5
5
|
var $BlockArgs = z.object({
|
|
6
6
|
numbers: z.array(z.coerce.number())
|
|
7
7
|
});
|
|
8
|
-
var platforma = BlockModel.create("Heavy").withArgs({ numbers: [1, 2, 3] }).withUiState({ dataTableState: void 0 }).output("numbers", (ctx) => ctx.outputs?.resolve("numbers")?.getDataAsJson()).
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
var platforma = BlockModel.create("Heavy").withArgs({ numbers: [1, 2, 3] }).withUiState({ dataTableState: void 0 }).output("numbers", (ctx) => ctx.outputs?.resolve("numbers")?.getDataAsJson()).output("pt", (ctx) => {
|
|
9
|
+
if (!ctx.uiState?.dataTableState?.tableState.pTableParams?.filters) return void 0;
|
|
10
|
+
return createPlDataTable(ctx, [
|
|
11
|
+
{
|
|
12
|
+
id: "example",
|
|
13
|
+
spec: {
|
|
14
|
+
kind: "PColumn",
|
|
15
|
+
valueType: "String",
|
|
16
|
+
name: "example",
|
|
17
|
+
annotations: {
|
|
18
|
+
"pl7.app/label": "String column"
|
|
19
|
+
},
|
|
20
|
+
axesSpec: [
|
|
21
|
+
{
|
|
22
|
+
type: "Int",
|
|
23
|
+
name: "index",
|
|
24
|
+
annotations: {
|
|
25
|
+
"pl7.app/label": "Int axis"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
data: [
|
|
31
|
+
{ key: [1], val: "1" },
|
|
32
|
+
{ key: [2], val: "2" }
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
], ctx.uiState.dataTableState.tableState, [
|
|
26
36
|
...ctx.uiState.dataTableState.tableState.pTableParams?.filters,
|
|
27
37
|
...ctx.uiState.dataTableState.filterModel?.filters ?? []
|
|
28
38
|
]);
|
package/dist/index.js.map
C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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,IACjD,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,cAAA,EAAgB,OAAO,aAAc,EAAA;AAAA,IAC3D,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,OAAA,EAAS,OAAO,QAAS,EAAA;AAAA,IAC/C,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,SAAA,EAAW,OAAO,QAAS,EAAA;AAAA,IACjD,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,UAAA,EAAY,OAAO,aAAc;AAAA,GACzD;AACF,CAAC,EAEA,IAAK","file":"index.js","sourcesContent":["import {\n BlockModel,\n InferHrefType,\n InferOutputsType,\n PlDataTableState,\n createPlDataTable,\n PlTableFiltersModel,\n PColumn,\n PColumnValues,\n PObjectId,\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 tableState: PlDataTableState;\n filterModel: PlTableFiltersModel;\n};\n\nexport type UiState = {\n dataTableState: TableState | undefined;\n};\n\nexport const platforma = BlockModel.create('Heavy')\n\n .withArgs<BlockArgs>({ numbers: [1, 2, 3] })\n\n .withUiState<UiState>({ dataTableState: undefined })\n\n .output('numbers', (ctx) => ctx.outputs?.resolve('numbers')?.getDataAsJson<number[]>())\n\n .output('pt', (ctx) => {\n if (!ctx.uiState?.dataTableState?.tableState.pTableParams?.filters) return undefined;\n return createPlDataTable(ctx, [\n {\n id: \"example\" as PObjectId,\n spec: {\n kind: 'PColumn',\n valueType: 'String',\n name: 'example',\n annotations: {\n 'pl7.app/label': 'String column',\n },\n axesSpec: [\n {\n type: 'Int',\n name: 'index',\n annotations: {\n 'pl7.app/label': 'Int axis',\n },\n }\n ]\n },\n data: [\n { key: [1], val: '1' },\n { key: [2], val: '2' }\n ]\n } satisfies PColumn<PColumnValues>\n ], ctx.uiState.dataTableState.tableState, [\n ...ctx.uiState.dataTableState.tableState.pTableParams?.filters,\n ...(ctx.uiState.dataTableState.filterModel?.filters ?? [])\n ]);\n })\n\n .sections((ctx) => {\n return [\n { type: 'link', href: '/', label: 'Icons/Masks' },\n { type: 'link', href: '/layout', label: 'Layout' },\n { type: 'link', href: '/form-components', label: 'Form Components' },\n { type: 'link', href: '/log-view', 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: '/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 { type: 'link', href: '/text-fields', label: 'PlTextField' },\n { type: 'link', href: '/tabs', label: 'PlTabs' },\n { type: 'link', href: '/drafts', label: 'Drafts' },\n { type: 'link', href: '/buttons', label: 'ButtonsPage' },\n ];\n })\n\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof platforma>;\nexport type Href = InferHrefType<typeof platforma>;\n"]}
|