@milaboratories/milaboratories.ui-examples.model 1.0.35 → 1.0.37

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.0.35",
3
+ "version": "1.0.37",
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.10.2"
11
+ "@platforma-sdk/model": "1.10.12"
12
12
  },
13
13
  "devDependencies": {
14
14
  "typescript": "~5.5.4",
package/src/index.ts CHANGED
@@ -40,7 +40,7 @@ export type UiState = {
40
40
 
41
41
  export const platforma = BlockModel.create('Heavy')
42
42
 
43
- .withArgs<BlockArgs>({ numbers: [] })
43
+ .withArgs<BlockArgs>({ numbers: [1, 2, 3] })
44
44
 
45
45
  .withUiState<UiState>({ dataTableState: undefined })
46
46
 
@@ -73,37 +73,39 @@ export const platforma = BlockModel.create('Heavy')
73
73
  const columns = collection.entries.map(({ obj }) => obj).filter(isPColumn);
74
74
  if (columns.length === 0) return undefined;
75
75
 
76
- try {
77
- return ctx.createPTable({
78
- src: mapJoinEntry(join, (idAndSpec) => {
79
- const column = columns.find((it) => it.id === idAndSpec.columnId);
80
- if (!column) throw Error(`column '${column}' not ready`);
81
- return column;
82
- }),
83
- filters: ctx.uiState.dataTableState?.tableState.pTableParams?.filters ?? [],
84
- sorting: ctx.uiState.dataTableState?.tableState.pTableParams?.sorting ?? []
85
- });
86
- } catch (err) {
87
- return undefined;
88
- }
76
+ let columnMissing = false;
77
+ const src = mapJoinEntry(join, (idAndSpec) => {
78
+ const column = columns.find((it) => it.id === idAndSpec.columnId);
79
+ if (!column) columnMissing = true;
80
+ return column!;
81
+ });
82
+
83
+ if (columnMissing) return undefined;
84
+
85
+ return ctx.createPTable({
86
+ src,
87
+ filters: ctx.uiState.dataTableState?.tableState.pTableParams?.filters ?? [],
88
+ sorting: ctx.uiState.dataTableState?.tableState.pTableParams?.sorting ?? []
89
+ });
89
90
  })
90
91
 
91
92
  .sections((ctx) => {
92
93
  return [
93
- { type: 'link', href: '/', label: 'Icons/Masks' },
94
- { type: 'link', href: '/log-view', label: 'PlLogView' },
94
+ { type: 'link', href: '/', label: 'Icons/Masks' },
95
+ { type: 'link', href: '/form-components', label: 'Form Components' },
96
+ { type: 'link', href: '/log-view', label: 'PlLogView' },
95
97
  { type: 'link', href: '/modals', label: 'Modals' },
96
98
  { type: 'link', href: '/select-files', label: 'Select Files' },
97
99
  { type: 'link', href: '/inject-env', label: 'Inject env' },
98
100
  { type: 'link', href: '/dropdowns', label: 'Dropdowns' },
99
101
  { type: 'link', href: '/use-watch-fetch', label: 'useWatchFetch' },
100
- { type: 'link', href: '/form-components', label: 'Form Components' },
101
102
  { type: 'link', href: '/typography', label: 'Typography' },
102
103
  { type: 'link', href: '/ag-grid-vue', label: 'AgGridVue' },
103
104
  { type: 'link', href: '/pl-ag-data-table', label: 'PlAgDataTable' },
104
105
  { type: 'link', href: '/errors', label: 'Errors' },
105
106
  { type: 'link', href: '/text-fields', label: 'PlTextField' },
106
107
  { type: 'link', href: '/tabs', label: 'PlTabs' },
108
+ { type: 'link', href: '/drafts', label: 'Drafts' },
107
109
  ];
108
110
  })
109
111