@milaboratories/milaboratories.ui-examples.ui 1.4.16 → 1.4.17

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/dist/index.html CHANGED
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta http-equiv="Content-Security-Policy" content="script-src 'self' blob: data: 'unsafe-eval';">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <script type="module" crossorigin src="./assets/index-3D9sE0hD.js"></script>
8
- <link rel="stylesheet" crossorigin href="./assets/index-Cxit5NJ-.css">
7
+ <script type="module" crossorigin src="./assets/index-LWaaV64j.js"></script>
8
+ <link rel="stylesheet" crossorigin href="./assets/index-C0RYhQz_.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="app"></div>
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@milaboratories/milaboratories.ui-examples.ui",
3
- "version": "1.4.16",
3
+ "version": "1.4.17",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "vue": "^3.5.13",
7
- "@platforma-sdk/model": "^1.34.10",
8
- "@milaboratories/milaboratories.ui-examples.model": "1.1.74"
7
+ "@milaboratories/milaboratories.ui-examples.model": "1.1.75",
8
+ "@platforma-sdk/model": "^1.37.0"
9
9
  },
10
10
  "devDependencies": {
11
11
  "@vitejs/plugin-vue": "^5.2.3",
@@ -14,12 +14,12 @@
14
14
  "vue-tsc": "^2.1.10",
15
15
  "@faker-js/faker": "^9.2.0",
16
16
  "zod": "~3.23.8",
17
- "ag-grid-enterprise": "^33.0.4",
18
- "ag-grid-vue3": "^33.0.4",
17
+ "ag-grid-enterprise": "^33.3.2",
18
+ "ag-grid-vue3": "^33.3.2",
19
19
  "rollup-plugin-sourcemaps2": "^0.5.2",
20
- "@platforma-sdk/ui-vue": "^1.34.17",
21
- "@milaboratories/helpers": "^1.6.13",
22
- "@milaboratories/uikit": "^2.2.87"
20
+ "@milaboratories/uikit": "^2.2.90",
21
+ "@milaboratories/helpers": "^1.6.14",
22
+ "@platforma-sdk/ui-vue": "^1.37.0"
23
23
  },
24
24
  "scripts": {
25
25
  "dev": "vite",
@@ -46,7 +46,7 @@ const columns = ref<PTableColumnSpec[]>([]);
46
46
  :settings="tableSettings"
47
47
  show-columns-panel
48
48
  show-export-button
49
- @columns-changed="(newColumns) => (columns = newColumns)"
49
+ @columns-changed="(info) => (columns = info.columns)"
50
50
  >
51
51
  <template #before-sheets>
52
52
  Table controls could be placed here
@@ -1,42 +1,58 @@
1
1
  <script setup lang="ts">
2
- import { computed, ref } from 'vue';
3
2
  import {
4
- type PlAgDataTableSettings,
3
+ computed,
4
+ ref,
5
+ watch,
6
+ toValue,
7
+ } from 'vue';
8
+ import type {
9
+ PlDataTableSettingsV2,
10
+ } from '@platforma-sdk/ui-vue';
11
+ import {
5
12
  PlAgDataTableToolsPanel,
6
13
  PlTableFilters,
7
14
  PlBlockPage,
8
15
  PlAgDataTableV2,
9
16
  PlNumberField,
10
17
  PlCheckbox,
18
+ PlDropdown,
11
19
  } from '@platforma-sdk/ui-vue';
12
- import { useApp } from '../app';
13
- import type { PTableColumnSpec } from '@platforma-sdk/model';
14
- import type { ICellRendererParams } from 'ag-grid-enterprise';
20
+ import {
21
+ useApp,
22
+ } from '../app';
23
+ import type {
24
+ PlSelectionModel,
25
+ PTableColumnSpec,
26
+ } from '@platforma-sdk/model';
27
+ import type {
28
+ ICellRendererParams,
29
+ } from 'ag-grid-enterprise';
30
+
15
31
  const app = useApp();
16
32
 
17
- if (!app.model.ui?.dataTableState) {
18
- app.model.ui.dataTableState = {
19
- tableState: {
20
- gridState: {},
21
- },
22
- filterModel: {},
33
+ const sources = [...new Array(10)].map((_, i) => {
34
+ return {
35
+ label: `Source ${1 + i}`,
36
+ value: `source_${i}`,
23
37
  };
24
- }
38
+ });
39
+ const activeSource = ref(sources[0].value);
25
40
 
26
- const tableSettings = computed<PlAgDataTableSettings>(() => (
27
- {
28
- sourceType: 'ptable',
29
- model: app.model.outputs.ptV2,
30
- sheets: [],
31
- }
41
+ const tableSettings = computed<PlDataTableSettingsV2>(() => (
42
+ activeSource.value && app.model.outputs.ptV2Sheets
43
+ ? {
44
+ sourceId: activeSource.value,
45
+ sheets: app.model.outputs.ptV2Sheets,
46
+ model: app.model.outputs.ptV2,
47
+ }
48
+ : { sourceId: null }
32
49
  ));
50
+
33
51
  const columns = ref<PTableColumnSpec[]>([]);
34
52
 
35
53
  const verbose = ref(false);
36
-
37
54
  const cellRendererSelector = computed(() => {
38
55
  if (!verbose.value) return;
39
-
40
56
  return (params: ICellRendererParams) => {
41
57
  if (params.colDef?.cellDataType === 'number') {
42
58
  return ({
@@ -45,6 +61,15 @@ const cellRendererSelector = computed(() => {
45
61
  }
46
62
  };
47
63
  });
64
+
65
+ const selection = ref<PlSelectionModel>({
66
+ axesSpec: [],
67
+ selectedKeys: [],
68
+ });
69
+ watch(
70
+ () => selection.value,
71
+ (selection) => console.log(`selection changed`, toValue(selection)),
72
+ );
48
73
  </script>
49
74
 
50
75
  <template>
@@ -52,22 +77,23 @@ const cellRendererSelector = computed(() => {
52
77
  <template #title>PlAgDataTable V2</template>
53
78
  <template #append>
54
79
  <PlAgDataTableToolsPanel>
55
- <PlTableFilters v-model="app.model.ui.dataTableState!.filterModel" :columns="columns" />
80
+ <PlTableFilters v-model="app.model.ui.dataTableStateV2.filterModel" :columns="columns" />
56
81
  </PlAgDataTableToolsPanel>
57
82
  </template>
58
83
  <PlAgDataTableV2
59
84
  ref="tableInstance"
60
- v-model="app.model.ui.dataTableState!.tableState"
85
+ v-model="app.model.ui.dataTableStateV2.tableState"
86
+ v-model:selection="selection"
61
87
  :settings="tableSettings"
62
88
  :cell-renderer-selector="cellRendererSelector"
63
89
  show-columns-panel
64
90
  show-export-button
65
- @columns-changed="(newColumns) => (columns = newColumns)"
91
+ @columns-changed="(info) => (columns = info.columns)"
66
92
  >
67
93
  <template #before-sheets>
68
- Table controls could be placed here
69
94
  <PlNumberField v-model="app.model.args.tableNumRows" />
70
95
  <PlCheckbox v-model="verbose">Use custom cell renderer for numbers</PlCheckbox>
96
+ <PlDropdown v-model="activeSource" :options="sources" clearable />
71
97
  </template>
72
98
  </PlAgDataTableV2>
73
99
  </PlBlockPage>