@platforma-sdk/ui-vue 1.40.4 → 1.40.6

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.
Files changed (154) hide show
  1. package/.turbo/turbo-build.log +60 -33
  2. package/.turbo/turbo-type-check.log +1 -1
  3. package/CHANGELOG.md +18 -0
  4. package/dist/AgGridVue/useAgGridOptions.js +1 -1
  5. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts +1 -4
  6. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts.map +1 -1
  7. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js +150 -167
  8. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js.map +1 -1
  9. package/dist/components/PlAgDataTable/PlAgRowCount.vue.js +1 -1
  10. package/dist/components/PlAgDataTable/sources/table-source-v2.d.ts +2 -2
  11. package/dist/components/PlAgDataTable/sources/table-source-v2.d.ts.map +1 -1
  12. package/dist/components/PlAgDataTable/sources/table-source-v2.js +114 -109
  13. package/dist/components/PlAgDataTable/sources/table-source-v2.js.map +1 -1
  14. package/dist/components/PlAgDataTable/types.d.ts +27 -43
  15. package/dist/components/PlAgDataTable/types.d.ts.map +1 -1
  16. package/dist/components/PlAgDataTable/types.js +32 -43
  17. package/dist/components/PlAgDataTable/types.js.map +1 -1
  18. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue.js +6 -6
  19. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.js +1 -1
  20. package/dist/components/PlAgRowNumHeader.vue.js +1 -1
  21. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue.d.ts +17 -0
  22. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue.d.ts.map +1 -0
  23. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue.js +10 -0
  24. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue.js.map +1 -0
  25. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js +99 -0
  26. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js.map +1 -0
  27. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue3.js +15 -0
  28. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue3.js.map +1 -0
  29. package/dist/components/PlAnnotations/components/DynamicForm.vue.d.ts +25 -0
  30. package/dist/components/PlAnnotations/components/DynamicForm.vue.d.ts.map +1 -0
  31. package/dist/components/PlAnnotations/components/DynamicForm.vue.js +10 -0
  32. package/dist/components/PlAnnotations/components/DynamicForm.vue.js.map +1 -0
  33. package/dist/components/PlAnnotations/components/DynamicForm.vue2.js +110 -0
  34. package/dist/components/PlAnnotations/components/DynamicForm.vue2.js.map +1 -0
  35. package/dist/components/PlAnnotations/components/DynamicForm.vue3.js +9 -0
  36. package/dist/components/PlAnnotations/components/DynamicForm.vue3.js.map +1 -0
  37. package/dist/components/PlAnnotations/components/FilterSidebar.vue.d.ts +20 -0
  38. package/dist/components/PlAnnotations/components/FilterSidebar.vue.d.ts.map +1 -0
  39. package/dist/components/PlAnnotations/components/FilterSidebar.vue.js +10 -0
  40. package/dist/components/PlAnnotations/components/FilterSidebar.vue.js.map +1 -0
  41. package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js +124 -0
  42. package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js.map +1 -0
  43. package/dist/components/PlAnnotations/components/FilterSidebar.vue3.js +13 -0
  44. package/dist/components/PlAnnotations/components/FilterSidebar.vue3.js.map +1 -0
  45. package/dist/components/PlAnnotations/components/PlAnnotationCreateDialog.vue.d.ts +19 -0
  46. package/dist/components/PlAnnotations/components/PlAnnotationCreateDialog.vue.d.ts.map +1 -0
  47. package/dist/components/PlAnnotations/components/PlAnnotationCreateDialog.vue.js +78 -0
  48. package/dist/components/PlAnnotations/components/PlAnnotationCreateDialog.vue.js.map +1 -0
  49. package/dist/components/PlAnnotations/components/PlAnnotationCreateDialog.vue2.js +5 -0
  50. package/dist/components/PlAnnotations/components/PlAnnotationCreateDialog.vue2.js.map +1 -0
  51. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue.d.ts +23 -0
  52. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue.d.ts.map +1 -0
  53. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue.js +10 -0
  54. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue.js.map +1 -0
  55. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue2.js +97 -0
  56. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue2.js.map +1 -0
  57. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue3.js +13 -0
  58. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue3.js.map +1 -0
  59. package/dist/components/PlAnnotations/index.d.ts +2 -0
  60. package/dist/components/PlAnnotations/index.d.ts.map +1 -0
  61. package/dist/components/PlAnnotations/types.d.ts +8 -0
  62. package/dist/components/PlAnnotations/types.d.ts.map +1 -0
  63. package/dist/components/PlAnnotations/utils.d.ts +6 -0
  64. package/dist/components/PlAnnotations/utils.d.ts.map +1 -0
  65. package/dist/components/PlAnnotations/utils.js +29 -0
  66. package/dist/components/PlAnnotations/utils.js.map +1 -0
  67. package/dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.vue.js +8 -8
  68. package/dist/components/PlMultiSequenceAlignment/Toolbar.vue2.js +5 -5
  69. package/dist/components/PlMultiSequenceAlignment/data.js +62 -62
  70. package/dist/components/PlTableFilters/PlTableAddFilterV2.vue.js +8 -8
  71. package/dist/defineApp.js +6 -6
  72. package/dist/lib/model/common/dist/index.js.map +1 -1
  73. package/dist/lib/ui/uikit/dist/components/DataTable/TableComponent.vue.js +22 -22
  74. package/dist/lib/ui/uikit/dist/components/PlAccordion/{ExpandTransition.vue2.js → ExpandTransition.vue.js} +1 -1
  75. package/dist/lib/ui/uikit/dist/components/PlAccordion/ExpandTransition.vue.js.map +1 -0
  76. package/dist/lib/ui/uikit/dist/components/PlAccordion/PlAccordionSection.vue2.js +1 -1
  77. package/dist/lib/ui/uikit/dist/components/PlAutocomplete/PlAutocomplete.vue.js +1 -1
  78. package/dist/lib/ui/uikit/dist/components/PlBtnGhost/PlBtnGhost.vue.js +3 -3
  79. package/dist/lib/ui/uikit/dist/components/PlConfirmDialog.vue.js +63 -0
  80. package/dist/lib/ui/uikit/dist/components/PlConfirmDialog.vue.js.map +1 -0
  81. package/dist/lib/ui/uikit/dist/components/PlDialogModal/PlDialogModal.vue.js +37 -37
  82. package/dist/lib/ui/uikit/dist/components/PlDialogModal/PlDialogModal.vue.js.map +1 -1
  83. package/dist/lib/ui/uikit/dist/components/PlDropdown/PlDropdown.vue.js +1 -1
  84. package/dist/lib/ui/uikit/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js +1 -1
  85. package/dist/lib/ui/uikit/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js +1 -1
  86. package/dist/lib/ui/uikit/dist/components/PlEditableTitle/PlEditableTitle.vue.js +42 -38
  87. package/dist/lib/ui/uikit/dist/components/PlEditableTitle/PlEditableTitle.vue.js.map +1 -1
  88. package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementList.vue2.js +20 -16
  89. package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementList.vue2.js.map +1 -1
  90. package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue.js +2 -2
  91. package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue2.js +17 -16
  92. package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue2.js.map +1 -1
  93. package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue3.js +27 -27
  94. package/dist/lib/ui/uikit/dist/components/PlElementList/utils.js +7 -6
  95. package/dist/lib/ui/uikit/dist/components/PlElementList/utils.js.map +1 -1
  96. package/dist/lib/ui/uikit/dist/components/PlFileDialog/PlFileDialog.vue.js +19 -19
  97. package/dist/lib/ui/uikit/dist/components/PlFileInput/PlFileInput.vue.js +1 -1
  98. package/dist/lib/ui/uikit/dist/components/PlSidebar/PlSidebarGroup.vue.js +10 -0
  99. package/dist/lib/ui/uikit/dist/components/PlSidebar/PlSidebarGroup.vue.js.map +1 -0
  100. package/dist/lib/ui/uikit/dist/components/PlSidebar/PlSidebarGroup.vue2.js +21 -0
  101. package/dist/lib/ui/uikit/dist/components/PlSidebar/PlSidebarGroup.vue2.js.map +1 -0
  102. package/dist/lib/ui/uikit/dist/components/PlSidebar/PlSidebarGroup.vue3.js +20 -0
  103. package/dist/lib/ui/uikit/dist/components/PlSidebar/PlSidebarGroup.vue3.js.map +1 -0
  104. package/dist/lib/ui/uikit/dist/components/PlSidebar/PlSidebarItem.vue.js +10 -0
  105. package/dist/lib/ui/uikit/dist/components/PlSidebar/PlSidebarItem.vue.js.map +1 -0
  106. package/dist/lib/ui/uikit/dist/components/PlSidebar/PlSidebarItem.vue2.js +39 -0
  107. package/dist/lib/ui/uikit/dist/components/PlSidebar/PlSidebarItem.vue2.js.map +1 -0
  108. package/dist/lib/ui/uikit/dist/components/PlSidebar/PlSidebarItem.vue3.js +26 -0
  109. package/dist/lib/ui/uikit/dist/components/PlSidebar/PlSidebarItem.vue3.js.map +1 -0
  110. package/dist/lib/ui/uikit/dist/components/PlSlideModal/PlPureSlideModal.vue.js +116 -0
  111. package/dist/lib/ui/uikit/dist/components/PlSlideModal/PlPureSlideModal.vue.js.map +1 -0
  112. package/dist/lib/ui/uikit/dist/components/PlSlideModal/PlSlideModal.vue.js +7 -128
  113. package/dist/lib/ui/uikit/dist/components/PlSlideModal/PlSlideModal.vue.js.map +1 -1
  114. package/dist/lib/ui/uikit/dist/components/PlSlideModal/PlSlideModal.vue2.js +56 -0
  115. package/dist/lib/ui/uikit/dist/components/PlSlideModal/PlSlideModal.vue2.js.map +1 -0
  116. package/dist/lib/ui/uikit/dist/components/PlSlideModal/PlSlideModal.vue3.js +18 -0
  117. package/dist/lib/ui/uikit/dist/components/PlSlideModal/PlSlideModal.vue3.js.map +1 -0
  118. package/dist/lib/ui/uikit/dist/components/PlSlideModal/props.js +10 -0
  119. package/dist/lib/ui/uikit/dist/components/PlSlideModal/props.js.map +1 -0
  120. package/dist/lib/ui/uikit/dist/components/PlTextArea/PlTextArea.vue.js +1 -1
  121. package/dist/lib/ui/uikit/dist/components/PlTextField/PlTextField.vue.js +1 -1
  122. package/dist/lib/ui/uikit/dist/composition/useConfirm.js +23 -0
  123. package/dist/lib/ui/uikit/dist/composition/useConfirm.js.map +1 -0
  124. package/dist/lib/ui/uikit/dist/generated/components/svg/images/{SvgRequired.vue.js → SvgRequired.vue2.js} +1 -1
  125. package/dist/lib/ui/uikit/dist/generated/components/svg/images/SvgRequired.vue2.js.map +1 -0
  126. package/dist/lib/ui/uikit/dist/index.js +92 -88
  127. package/dist/lib/ui/uikit/dist/index.js.map +1 -1
  128. package/dist/lib/ui/uikit/dist/lib/model/common/dist/index.js +5 -5
  129. package/dist/lib/ui/uikit/dist/sdk/model/dist/index.js +42 -42
  130. package/dist/lib/ui/uikit/dist/sdk/model/dist/index.js.map +1 -1
  131. package/dist/lib/util/helpers/dist/index.js +60 -50
  132. package/dist/lib/util/helpers/dist/index.js.map +1 -1
  133. package/dist/lib.d.ts +1 -0
  134. package/dist/lib.d.ts.map +1 -1
  135. package/dist/lib.js +261 -251
  136. package/dist/lib.js.map +1 -1
  137. package/dist/plugins/Monetization/MonetizationSidebar.vue.js +9 -9
  138. package/dist/sdk/model/dist/index.js +926 -539
  139. package/dist/sdk/model/dist/index.js.map +1 -1
  140. package/package.json +6 -8
  141. package/src/components/PlAgDataTable/PlAgDataTableV2.vue +20 -74
  142. package/src/components/PlAgDataTable/sources/table-source-v2.ts +29 -29
  143. package/src/components/PlAgDataTable/types.ts +42 -70
  144. package/src/components/PlAnnotations/components/AnnotationsSidebar.vue +103 -0
  145. package/src/components/PlAnnotations/components/DynamicForm.vue +144 -0
  146. package/src/components/PlAnnotations/components/FilterSidebar.vue +143 -0
  147. package/src/components/PlAnnotations/components/PlAnnotationCreateDialog.vue +64 -0
  148. package/src/components/PlAnnotations/components/PlAnnotationsModal.vue +114 -0
  149. package/src/components/PlAnnotations/index.ts +1 -0
  150. package/src/components/PlAnnotations/types.ts +9 -0
  151. package/src/components/PlAnnotations/utils.ts +25 -0
  152. package/src/lib.ts +2 -0
  153. package/dist/lib/ui/uikit/dist/components/PlAccordion/ExpandTransition.vue2.js.map +0 -1
  154. package/dist/lib/ui/uikit/dist/generated/components/svg/images/SvgRequired.vue.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/ui-vue",
3
- "version": "1.40.4",
3
+ "version": "1.40.6",
4
4
  "type": "module",
5
5
  "main": "dist/lib.js",
6
6
  "styles": "dist/lib.js",
@@ -14,7 +14,6 @@
14
14
  "dependencies": {
15
15
  "@types/node": "~20.16.15",
16
16
  "@types/semver": "^7.7.0",
17
- "@types/sortablejs": "^1.15.6",
18
17
  "@types/d3-format": "^3.0.4",
19
18
  "@milaboratories/miplots4": "^1.0.123",
20
19
  "ag-grid-enterprise": "^33.3.2",
@@ -24,12 +23,11 @@
24
23
  "vue": "^3.5.13",
25
24
  "@vueuse/core": "^13.3.0",
26
25
  "@vueuse/integrations": "^13.3.0",
27
- "sortablejs": "^1.15.6",
28
26
  "d3-format": "^3.1.0",
29
27
  "zod": "~3.23.8",
30
28
  "@milaboratories/biowasm-tools": "^1.1.0",
31
- "@milaboratories/uikit": "2.3.13",
32
- "@platforma-sdk/model": "~1.40.1"
29
+ "@milaboratories/uikit": "2.3.15",
30
+ "@platforma-sdk/model": "~1.40.6"
33
31
  },
34
32
  "devDependencies": {
35
33
  "happy-dom": "^15.11.7",
@@ -42,10 +40,10 @@
42
40
  "vitest": "^2.1.9",
43
41
  "vue-tsc": "^2.2.10",
44
42
  "yarpm": "^1.2.0",
45
- "@milaboratories/ts-configs": "1.0.4",
46
- "@milaboratories/helpers": "^1.6.17",
47
43
  "@milaboratories/build-configs": "1.0.4",
48
- "@milaboratories/eslint-config": "^1.0.4"
44
+ "@milaboratories/eslint-config": "^1.0.4",
45
+ "@milaboratories/helpers": "^1.6.18",
46
+ "@milaboratories/ts-configs": "1.0.4"
49
47
  },
50
48
  "scripts": {
51
49
  "test": "vitest run --passWithNoTests",
@@ -1,7 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import {
3
- isJsonEqual,
4
- } from '@milaboratories/helpers';
2
+ import { isJsonEqual } from '@milaboratories/helpers';
5
3
  import type {
6
4
  AxisId,
7
5
  AxisSpec,
@@ -12,10 +10,7 @@ import type {
12
10
  PTableColumnSpec,
13
11
  PTableKey,
14
12
  } from '@platforma-sdk/model';
15
- import {
16
- getRawPlatformaInstance,
17
- parseJson,
18
- } from '@platforma-sdk/model';
13
+ import { getRawPlatformaInstance, parseJson } from '@platforma-sdk/model';
19
14
  import type {
20
15
  CellRendererSelectorFunc,
21
16
  ColDef,
@@ -26,41 +21,22 @@ import type {
26
21
  ManagedGridOptionKey,
27
22
  ManagedGridOptions,
28
23
  } from 'ag-grid-enterprise';
29
- import {
30
- AgGridVue,
31
- } from 'ag-grid-vue3';
32
- import {
33
- computed,
34
- ref,
35
- shallowRef,
36
- toRefs,
37
- watch,
38
- } from 'vue';
39
- import {
40
- AgGridTheme,
41
- } from '../../aggrid';
24
+ import { AgGridVue } from 'ag-grid-vue3';
25
+ import { computed, ref, shallowRef, toRefs, watch } from 'vue';
26
+ import { AgGridTheme } from '../../aggrid';
42
27
  import PlAgCsvExporter from '../PlAgCsvExporter/PlAgCsvExporter.vue';
43
- import {
44
- PlAgGridColumnManager,
45
- } from '../PlAgGridColumnManager';
28
+ import { PlAgGridColumnManager } from '../PlAgGridColumnManager';
29
+ import type { PlDataTableFiltersSettings } from '../PlTableFilters';
30
+ import PlTableFiltersV2 from '../PlTableFilters/PlTableFiltersV2.vue';
31
+ import PlAgDataTableSheets from './PlAgDataTableSheets.vue';
46
32
  import PlOverlayLoading from './PlAgOverlayLoading.vue';
47
33
  import PlOverlayNoRows from './PlAgOverlayNoRows.vue';
48
34
  import PlAgRowCount from './PlAgRowCount.vue';
49
- import PlAgDataTableSheets from './PlAgDataTableSheets.vue';
50
- import {
51
- focusRow,
52
- makeOnceTracker,
53
- } from './sources/focus-row';
54
- import {
55
- autoSizeRowNumberColumn,
56
- PlAgDataTableRowNumberColId,
57
- } from './sources/row-number';
58
- import type {
59
- PlAgCellButtonAxisParams,
60
- } from './sources/table-source-v2';
61
- import {
62
- calculateGridOptions,
63
- } from './sources/table-source-v2';
35
+ import { focusRow, makeOnceTracker } from './sources/focus-row';
36
+ import { autoSizeRowNumberColumn, PlAgDataTableRowNumberColId } from './sources/row-number';
37
+ import type { PlAgCellButtonAxisParams } from './sources/table-source-v2';
38
+ import { calculateGridOptions } from './sources/table-source-v2';
39
+ import { useTableState } from './sources/table-state-v2';
64
40
  import type {
65
41
  PlAgDataTableV2Controller,
66
42
  PlAgDataTableV2Row,
@@ -68,21 +44,14 @@ import type {
68
44
  PlAgOverlayNoRowsParams,
69
45
  PlDataTableSettingsV2,
70
46
  PlDataTableSheetsSettings,
71
- PlTableLabeledSelectionModel,
72
47
  PlTableRowIdJson,
73
48
  } from './types';
74
- import {
75
- useTableState,
76
- } from './sources/table-state-v2';
77
- import type { PlDataTableFiltersSettings } from '../PlTableFilters';
78
- import PlTableFiltersV2 from '../PlTableFilters/PlTableFiltersV2.vue';
79
49
  import { watchCached } from '@milaboratories/uikit';
80
50
 
81
51
  const tableState = defineModel<PlDataTableStateV2>({
82
52
  required: true,
83
53
  });
84
54
  const selection = defineModel<PlSelectionModel>('selection');
85
- const selectionLabeled = defineModel<PlTableLabeledSelectionModel>('selectionLabeled');
86
55
  const props = defineProps<{
87
56
  /** Required component settings */
88
57
  settings: Readonly<PlDataTableSettingsV2>;
@@ -184,10 +153,10 @@ const firstDataRenderedTracker = makeOnceTracker<GridApi<PlAgDataTableV2Row>>();
184
153
  const gridOptions = shallowRef<GridOptions<PlAgDataTableV2Row>>({
185
154
  animateRows: false,
186
155
  suppressColumnMoveAnimation: true,
187
- cellSelection: !selection.value && !selectionLabeled.value,
156
+ cellSelection: !selection.value,
188
157
  initialState: gridState.value,
189
158
  autoSizeStrategy: { type: 'fitCellContents' },
190
- rowSelection: selection.value || selectionLabeled.value
159
+ rowSelection: selection.value
191
160
  ? {
192
161
  mode: 'multiRow',
193
162
  selectAll: 'all',
@@ -198,15 +167,11 @@ const gridOptions = shallowRef<GridOptions<PlAgDataTableV2Row>>({
198
167
  }
199
168
  : undefined,
200
169
  onSelectionChanged: (event) => {
201
- const state = event.api.getServerSideSelectionState();
202
170
  if (selection.value) {
203
- const selectedKeys = state?.toggledNodes?.map((nodeId) => parseJson(nodeId as PlTableRowIdJson).axesKey) ?? [];
171
+ const state = event.api.getServerSideSelectionState();
172
+ const selectedKeys = state?.toggledNodes?.map((nodeId) => parseJson(nodeId as PlTableRowIdJson)) ?? [];
204
173
  selection.value = { ...selection.value, selectedKeys };
205
174
  }
206
- if (selectionLabeled.value) {
207
- const selectedLabeledKeys = state?.toggledNodes?.map((nodeId) => parseJson(nodeId as PlTableRowIdJson).labeled) ?? [];
208
- selectionLabeled.value = { ...selectionLabeled.value, selectedLabeledKeys };
209
- }
210
175
  },
211
176
  onRowDoubleClicked: (event) => {
212
177
  if (event.data && event.data.axesKey) emit('rowDoubleClicked', event.data.axesKey);
@@ -385,12 +350,6 @@ watchCached(
385
350
  selectedKeys: [],
386
351
  };
387
352
  }
388
- if (selectionLabeled.value) {
389
- selectionLabeled.value = {
390
- spec: [],
391
- selectedLabeledKeys: [],
392
- };
393
- }
394
353
  } else {
395
354
  const isColDef = (def: ColDef | ColGroupDef): def is ColDef =>
396
355
  !('children' in def);
@@ -415,19 +374,6 @@ watchCached(
415
374
  axesSpec,
416
375
  };
417
376
  }
418
- if (selectionLabeled.value) {
419
- const spec = columns
420
- .reduce((acc, column) => {
421
- if (column.source.type === 'axis') {
422
- acc.push(column.labeled);
423
- }
424
- return acc;
425
- }, [] as PTableColumnSpec[]);
426
- selectionLabeled.value = {
427
- ...selectionLabeled.value,
428
- spec,
429
- };
430
- }
431
377
  }
432
378
  },
433
379
  { immediate: true },
@@ -460,7 +406,7 @@ watch(
460
406
  columnDefs: undefined,
461
407
  serverSideDatasource: undefined,
462
408
  });
463
- if (selection.value || selectionLabeled.value) {
409
+ if (selection.value) {
464
410
  gridApi.setServerSideSelectionState({
465
411
  selectAll: false,
466
412
  toggledNodes: [],
@@ -478,7 +424,7 @@ watch(
478
424
  notReady: false,
479
425
  } satisfies PlAgOverlayLoadingParams,
480
426
  });
481
- if (selection.value || selectionLabeled.value) {
427
+ if (selection.value) {
482
428
  gridApi.setServerSideSelectionState({
483
429
  selectAll: false,
484
430
  toggledNodes: [],
@@ -1,3 +1,5 @@
1
+ import type {
2
+ PTableColumnSpecColumn } from '@platforma-sdk/model';
1
3
  import {
2
4
  canonicalizeJson,
3
5
  getAxisId,
@@ -15,6 +17,7 @@ import {
15
17
  type PlTableColumnId,
16
18
  type PlTableColumnIdJson,
17
19
  isLabelColumn as isLabelColumnSpec,
20
+ isColumnHidden,
18
21
  } from '@platforma-sdk/model';
19
22
  import type {
20
23
  CellStyle,
@@ -39,7 +42,7 @@ import { getColumnRenderingSpec } from './value-rendering';
39
42
  import type { Ref } from 'vue';
40
43
  import { isJsonEqual } from '@milaboratories/helpers';
41
44
 
42
- export function isLabelColumn(column: PTableColumnSpec) {
45
+ export function isLabelColumn(column: PTableColumnSpec): column is PTableColumnSpecColumn {
43
46
  return column.type === 'column' && isLabelColumnSpec(column.spec);
44
47
  }
45
48
 
@@ -48,7 +51,6 @@ function columns2rows(
48
51
  fields: number[],
49
52
  columns: PTableVector[],
50
53
  axes: number[],
51
- labeledAxes: number[],
52
54
  resultMapping: number[],
53
55
  ): PlAgDataTableV2Row[] {
54
56
  const rowData: PlAgDataTableV2Row[] = [];
@@ -58,15 +60,7 @@ function columns2rows(
58
60
  pTableValue(columns[resultMapping[iAxis]], iRow),
59
61
  );
60
62
  });
61
- const labeled = labeledAxes.map((iAxis) => {
62
- return mapPTableValueToAxisKey(
63
- pTableValue(columns[resultMapping[iAxis]], iRow),
64
- );
65
- });
66
- const id = canonicalizeJson<PlTableRowId>({
67
- axesKey,
68
- labeled,
69
- });
63
+ const id = canonicalizeJson<PlTableRowId>(axesKey);
70
64
  const row: PlAgDataTableV2Row = { id, axesKey };
71
65
  fields.forEach((field, iCol) => {
72
66
  row[field.toString() as `${number}`] = resultMapping[iCol] === -1
@@ -118,18 +112,31 @@ export async function calculateGridOptions({
118
112
  if (numberOfAxes === -1) numberOfAxes = specs.length;
119
113
 
120
114
  // column indices in the specs array that we are going to process
121
- const indices = [...specs.keys()]
115
+ const indices = specs.keys()
122
116
  .filter(
123
- (i) =>
124
- !sheets.some(
125
- (sheet) =>
126
- isJsonEqual(getAxisId(sheet.axis), specs[i].id)
127
- || (specs[i].type === 'column'
128
- && specs[i].spec.name === 'pl7.app/label'
129
- && specs[i].spec.axesSpec.length === 1
130
- && isJsonEqual(getAxisId(sheet.axis), getAxisId(specs[i].spec.axesSpec[0]))),
131
- ),
117
+ (i) => {
118
+ const spec = specs[i];
119
+ switch (spec.type) {
120
+ case 'axis':
121
+ {
122
+ return !sheets.some(
123
+ (sheet) => isJsonEqual(getAxisId(sheet.axis), spec.id),
124
+ );
125
+ }
126
+ case 'column':
127
+ {
128
+ if (isLabelColumnSpec(spec.spec)) {
129
+ return !sheets.some(
130
+ (sheet) => isJsonEqual(getAxisId(sheet.axis), getAxisId(spec.spec.axesSpec[0])),
131
+ );
132
+ } else {
133
+ return !isColumnHidden(spec.spec);
134
+ }
135
+ }
136
+ }
137
+ },
132
138
  )
139
+ .toArray()
133
140
  .sort((a, b) => {
134
141
  if (specs[a].type !== specs[b].type) return specs[a].type === 'axis' ? -1 : 1;
135
142
 
@@ -202,13 +209,6 @@ export async function calculateGridOptions({
202
209
  }
203
210
  return r;
204
211
  });
205
- const labeledAxes: number[] = fields
206
- .reduce((acc, field, index) => {
207
- if (specs[field].type === 'axis') {
208
- acc.push(allIndices.indexOf(indices[index]));
209
- }
210
- return acc;
211
- }, [] as number[]);
212
212
 
213
213
  const requestIndices: number[] = [];
214
214
  const resultMapping: number[] = [];
@@ -260,7 +260,7 @@ export async function calculateGridOptions({
260
260
  length,
261
261
  });
262
262
  if (stateGeneration !== generation.value || params.api.isDestroyed()) return params.fail();
263
- rowData = columns2rows(fields, data, axes, labeledAxes, resultMapping);
263
+ rowData = columns2rows(fields, data, axes, resultMapping);
264
264
  }
265
265
  }
266
266
 
@@ -24,9 +24,7 @@ export type PlDataTableFilterConfig = {
24
24
  default?: PlTableFilter;
25
25
  };
26
26
 
27
- /** Data table V2 settings */
28
- export type PlDataTableSettingsV2 =
29
- (
27
+ export type PlDataTableSettingsV2Base =
30
28
  | { sourceId: null }
31
29
  | {
32
30
  /** Unique source id for state caching */
@@ -35,8 +33,10 @@ export type PlDataTableSettingsV2 =
35
33
  sheets: PlDataTableSheet[];
36
34
  /** Result of `createPlDataTableV2` */
37
35
  model: PlDataTableModel | undefined;
38
- }
39
- ) & {
36
+ };
37
+
38
+ /** Data table V2 settings */
39
+ export type PlDataTableSettingsV2 = PlDataTableSettingsV2Base & {
40
40
  /** Callback configuring filters for the table */
41
41
  filtersConfig: (info: {
42
42
  sourceId: string;
@@ -44,45 +44,41 @@ export type PlDataTableSettingsV2 =
44
44
  }) => PlDataTableFilterConfig;
45
45
  };
46
46
 
47
- type OptionsAdvanced<T> = {
48
- /**
49
- * Block property (such as inputAnchor) used to produce the data source.
50
- * Mandatory for cases when the table can change without block run.
51
- * Skip when the table is changed only after block run.
52
- * Ask developers for help if you don't know what to set here.
53
- */
54
- sourceId: MaybeRefOrGetter<T | undefined>;
47
+ type OptionsBasic = {
55
48
  /** Block output created by `createPlDataTableV2` */
56
49
  model: MaybeRefOrGetter<PlDataTableModel | undefined>;
57
50
  /**
58
- * Sheets for partitioned data sources.
59
- * Do not set if data source is never partitioned.
60
- */
51
+ * Sheets for partitioned data sources.
52
+ * Do not set if data source is never partitioned.
53
+ */
61
54
  sheets?: MaybeRefOrGetter<PlDataTableSheet[] | undefined>;
55
+ };
56
+
57
+ type OptionsSimple = OptionsBasic & {
62
58
  /**
63
- * Callback configuring filters for the table.
64
- * If not provided, filtering will be disabled.
65
- * Parameter `sourceId` should be compared using `isJsonEqual` from `@milaboratories/helpers`.
66
- */
59
+ * Callback configuring filters for the table.
60
+ * If not provided, filtering will be disabled.
61
+ */
67
62
  filtersConfig?: (info: {
68
- sourceId: JsonCompatible<T>;
69
63
  column: PTableColumnSpec;
70
64
  }) => PlDataTableFilterConfig;
71
65
  };
72
66
 
73
- type OptionsSimple = {
74
- /** Block output created by `createPlDataTableV2` */
75
- model: MaybeRefOrGetter<PlDataTableModel | undefined>;
67
+ type OptionsAdvanced<T> = OptionsBasic & {
76
68
  /**
77
- * Sheets for partitioned data sources.
78
- * Do not set if data source is never partitioned.
79
- */
80
- sheets?: MaybeRefOrGetter<PlDataTableSheet[] | undefined>;
69
+ * Block property (such as inputAnchor) used to produce the data source.
70
+ * Mandatory for cases when the table can change without block run.
71
+ * Skip when the table is changed only after block run.
72
+ * Ask developers for help if you don't know what to set here.
73
+ */
74
+ sourceId: MaybeRefOrGetter<T | undefined>;
81
75
  /**
82
- * Callback configuring filters for the table.
83
- * If not provided, filtering will be disabled.
84
- */
76
+ * Callback configuring filters for the table.
77
+ * If not provided, filtering will be disabled.
78
+ * Parameter `sourceId` should be compared using `isJsonEqual` from `@milaboratories/helpers`.
79
+ */
85
80
  filtersConfig?: (info: {
81
+ sourceId: JsonCompatible<T>;
86
82
  column: PTableColumnSpec;
87
83
  }) => PlDataTableFilterConfig;
88
84
  };
@@ -109,62 +105,51 @@ export function usePlDataTableSettingsV2<T>(options: OptionsAdvanced<T> | Option
109
105
  : () => ({});
110
106
  return computed(() => {
111
107
  const modelValue = toValue(options.model);
108
+ let settingsBase: PlDataTableSettingsV2Base;
112
109
  if ('sourceId' in options) {
113
110
  const sourceIdValue = deepClone(toValue(options.sourceId));
114
111
  if (options.sheets) {
115
112
  const sheetsValue = deepClone(toValue(options.sheets));
116
- return sourceIdValue && sheetsValue
113
+ settingsBase = sourceIdValue && sheetsValue
117
114
  ? {
118
115
  sourceId: canonicalize(sourceIdValue)!,
119
116
  sheets: sheetsValue,
120
117
  model: modelValue,
121
- filtersConfig: filtersConfigValue,
122
118
  }
123
- : {
124
- sourceId: null,
125
- filtersConfig: filtersConfigValue,
126
- };
119
+ : { sourceId: null };
127
120
  } else {
128
- return sourceIdValue
121
+ settingsBase = sourceIdValue
129
122
  ? {
130
123
  sourceId: canonicalize(sourceIdValue)!,
131
124
  sheets: [],
132
125
  model: modelValue,
133
- filtersConfig: filtersConfigValue,
134
126
  }
135
- : {
136
- sourceId: null,
137
- filtersConfig: filtersConfigValue,
138
- };
127
+ : { sourceId: null };
139
128
  }
140
129
  } else {
141
130
  if (options.sheets) {
142
131
  const sheetsValue = toValue(options.sheets);
143
- return sheetsValue
132
+ settingsBase = sheetsValue
144
133
  ? {
145
134
  sourceId: canonicalize('static')!,
146
135
  sheets: sheetsValue,
147
136
  model: modelValue,
148
- filtersConfig: filtersConfigValue,
149
137
  }
150
- : {
151
- sourceId: null,
152
- filtersConfig: filtersConfigValue,
153
- };
138
+ : { sourceId: null };
154
139
  } else {
155
- return modelValue
140
+ settingsBase = modelValue
156
141
  ? {
157
142
  sourceId: canonicalize('static')!,
158
143
  sheets: [],
159
144
  model: modelValue,
160
- filtersConfig: filtersConfigValue,
161
145
  }
162
- : {
163
- sourceId: null,
164
- filtersConfig: filtersConfigValue,
165
- };
146
+ : { sourceId: null };
166
147
  }
167
148
  }
149
+ return {
150
+ ...settingsBase,
151
+ filtersConfig: filtersConfigValue,
152
+ };
168
153
  });
169
154
  };
170
155
 
@@ -193,14 +178,9 @@ export type PlAgDataTableV2Controller = {
193
178
  focusRow: (rowKey: PTableKey) => Promise<void>;
194
179
  };
195
180
 
196
- export type PlTableRowId = {
197
- /** Axes values */
198
- axesKey: PTableKey;
199
- /** Axes key where values of labeled axes are resolved to corresponding labels */
200
- labeled: PTableKey;
201
- };
181
+ export type PlTableRowId = PTableKey;
202
182
 
203
- export type PlTableRowIdJson = CanonicalizedJson<PlTableRowId>;
183
+ export type PlTableRowIdJson = CanonicalizedJson<PTableKey>;
204
184
 
205
185
  /** PlAgDataTableV2 row */
206
186
  export type PlAgDataTableV2Row = {
@@ -212,14 +192,6 @@ export type PlAgDataTableV2Row = {
212
192
  [field: `${number}`]: PTableValue | PTableHidden;
213
193
  };
214
194
 
215
- /** PlSelectionModel with labeled axes replaced by label columns */
216
- export type PlTableLabeledSelectionModel = {
217
- /** Specs for valuess in {@link PTableKey} */
218
- spec: PTableColumnSpec[];
219
- /** Row keys (arrays of axes values) of selected rows */
220
- selectedLabeledKeys: PTableKey[];
221
- };
222
-
223
195
  export type PlAgOverlayLoadingParams = {
224
196
  /**
225
197
  * Required flag, that shows catInBag icon with message if `true`, shows PlSplash component if `false`.
@@ -0,0 +1,103 @@
1
+ <script setup lang="ts">
2
+ import { randomInt } from '@milaboratories/helpers';
3
+ import {
4
+ PlBtnGhost,
5
+ PlBtnSecondary,
6
+ PlEditableTitle,
7
+ PlElementList,
8
+ PlSidebarItem,
9
+ } from '@milaboratories/uikit';
10
+ import type { AnnotationScriptUi } from '@platforma-sdk/model';
11
+
12
+ // Models
13
+ const annotation = defineModel<AnnotationScriptUi>('annotation', { required: true });
14
+ const selectedStepId = defineModel<undefined | number>('selectedStepId');
15
+ // Emits
16
+ const emits = defineEmits<{
17
+ (e: 'delete-schema'): void;
18
+ }>();
19
+ // Actions
20
+ function handleAddStep() {
21
+ const id = randomInt();
22
+ annotation.value.steps.push({
23
+ id,
24
+ label: `Filter #${annotation.value.steps.length + 1}`,
25
+ filter: {
26
+ type: 'and',
27
+ filters: [],
28
+ },
29
+ });
30
+ selectedStepId.value = id;
31
+ };
32
+ </script>
33
+
34
+ <template>
35
+ <PlSidebarItem>
36
+ <template #header-content>
37
+ <PlEditableTitle
38
+ v-model="annotation.title"
39
+ :max-length="40"
40
+ max-width="600px"
41
+ placeholder="Annotation Name"
42
+ :autofocus="annotation.title.length === 0"
43
+ />
44
+ </template>
45
+ <template v-if="annotation" #body-content>
46
+ <div :class="$style.root">
47
+ <PlBtnSecondary icon="add" @click="handleAddStep">
48
+ Add annotation
49
+ </PlBtnSecondary>
50
+
51
+ <span :class="$style.tip">Lower annotations override the ones above. Rearrange them by dragging.</span>
52
+
53
+ <PlElementList
54
+ v-model:items="annotation.steps"
55
+ :get-item-key="(item) => item.id!"
56
+ :is-active="(item) => item.id === selectedStepId"
57
+ :item-class="$style.stepItem"
58
+ :class="$style.steps"
59
+ @item-click="(item) => selectedStepId = item.id"
60
+ >
61
+ <template #item-title="{ item }">
62
+ {{ item.label }}
63
+ </template>
64
+ </PlElementList>
65
+ </div>
66
+ </template>
67
+ <template #footer-content>
68
+ <PlBtnGhost
69
+ icon="delete-bin"
70
+ reverse
71
+ :disabled="annotation.steps.length === 0"
72
+ @click.stop="emits('delete-schema')"
73
+ >
74
+ Delete Schema
75
+ </PlBtnGhost>
76
+ </template>
77
+ </PlSidebarItem>
78
+ </template>
79
+
80
+ <style lang="scss" module>
81
+ @use '@milaboratories/uikit/styles/variables' as *;
82
+
83
+ .root {
84
+ display: flex;
85
+ flex-direction: column;
86
+ gap: 12px;
87
+ }
88
+
89
+ .tip {
90
+ margin-top: 12px;
91
+ color: var(--txt-03);
92
+ }
93
+
94
+ .steps {
95
+ display: flex;
96
+ flex-direction: column;
97
+ gap: 6px;
98
+ }
99
+
100
+ .stepItem {
101
+ cursor: pointer;
102
+ }
103
+ </style>