@platforma-sdk/ui-vue 1.42.3 → 1.42.5

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 (45) hide show
  1. package/.turbo/turbo-build.log +16 -16
  2. package/.turbo/turbo-type-check.log +1 -1
  3. package/CHANGELOG.md +15 -0
  4. package/dist/aggrid.js +4 -4
  5. package/dist/components/PlAgDataTable/PlAgDataTableSheets.vue2.js +7 -7
  6. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js +13 -13
  7. package/dist/components/PlAgDataTable/sources/table-source-v2.d.ts.map +1 -1
  8. package/dist/components/PlAgDataTable/sources/table-source-v2.js +88 -85
  9. package/dist/components/PlAgDataTable/sources/table-source-v2.js.map +1 -1
  10. package/dist/components/PlAgDataTable/sources/table-state-v2.js +6 -6
  11. package/dist/components/PlAnnotations/components/DynamicForm.vue2.js +10 -10
  12. package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js +2 -2
  13. package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue.d.ts.map +1 -1
  14. package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue2.js +37 -29
  15. package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue2.js.map +1 -1
  16. package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue3.js +18 -14
  17. package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue3.js.map +1 -1
  18. package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue.d.ts.map +1 -1
  19. package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue2.js +100 -98
  20. package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue2.js.map +1 -1
  21. package/dist/components/PlMultiSequenceAlignment/data.d.ts +1 -1
  22. package/dist/components/PlMultiSequenceAlignment/data.js +41 -41
  23. package/dist/components/PlMultiSequenceAlignment/data.js.map +1 -1
  24. package/dist/components/PlTableFilters/filters-state.js +2 -2
  25. package/dist/defineApp.js +16 -16
  26. package/dist/internal/createAppV2.js +9 -9
  27. package/dist/lib/model/common/dist/index.js +329 -317
  28. package/dist/lib/model/common/dist/index.js.map +1 -1
  29. package/dist/lib/ui/uikit/dist/components/PlAccordion/{ExpandTransition.vue2.js → ExpandTransition.vue.js} +1 -1
  30. package/dist/lib/ui/uikit/dist/components/PlAccordion/ExpandTransition.vue.js.map +1 -0
  31. package/dist/lib/ui/uikit/dist/components/PlAccordion/PlAccordionSection.vue2.js +1 -1
  32. package/dist/lib/ui/uikit/dist/components/PlFileInput/PlFileInput.vue.js +16 -16
  33. package/dist/lib/ui/uikit/dist/components/PlFileInput/PlFileInput.vue.js.map +1 -1
  34. package/dist/lib/ui/uikit/dist/lib/model/common/dist/index.js +8 -8
  35. package/dist/lib/ui/uikit/dist/lib/model/common/dist/index.js.map +1 -1
  36. package/dist/lib/ui/uikit/dist/sdk/model/dist/index.js +18 -18
  37. package/dist/lib/ui/uikit/dist/sdk/model/dist/index.js.map +1 -1
  38. package/dist/sdk/model/dist/index.js +198 -206
  39. package/dist/sdk/model/dist/index.js.map +1 -1
  40. package/package.json +5 -5
  41. package/src/components/PlAgDataTable/sources/table-source-v2.ts +9 -6
  42. package/src/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue +65 -18
  43. package/src/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue +16 -11
  44. package/src/components/PlMultiSequenceAlignment/data.ts +10 -10
  45. package/dist/lib/ui/uikit/dist/components/PlAccordion/ExpandTransition.vue2.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/ui-vue",
3
- "version": "1.42.3",
3
+ "version": "1.42.5",
4
4
  "type": "module",
5
5
  "main": "dist/lib.js",
6
6
  "styles": "dist/lib.js",
@@ -25,9 +25,9 @@
25
25
  "@vueuse/integrations": "^13.3.0",
26
26
  "d3-format": "^3.1.0",
27
27
  "zod": "~3.23.8",
28
- "@platforma-sdk/model": "~1.42.1",
29
- "@milaboratories/uikit": "2.3.26",
30
- "@milaboratories/biowasm-tools": "^1.1.0"
28
+ "@milaboratories/uikit": "2.3.27",
29
+ "@milaboratories/biowasm-tools": "^1.1.0",
30
+ "@platforma-sdk/model": "~1.42.4"
31
31
  },
32
32
  "devDependencies": {
33
33
  "happy-dom": "^15.11.7",
@@ -43,8 +43,8 @@
43
43
  "yarpm": "^1.2.0",
44
44
  "fast-json-patch": "^3.1.1",
45
45
  "@faker-js/faker": "^9.2.0",
46
- "@milaboratories/build-configs": "1.0.5",
47
46
  "@milaboratories/ts-configs": "1.0.5",
47
+ "@milaboratories/build-configs": "1.0.5",
48
48
  "@milaboratories/eslint-config": "^1.0.4",
49
49
  "@milaboratories/helpers": "^1.6.19"
50
50
  },
@@ -3,12 +3,12 @@ import type {
3
3
  PTableColumnId,
4
4
  PTableColumnSpecColumn,
5
5
  PTableValue,
6
+ PTableValueAxis,
6
7
  } from '@platforma-sdk/model';
7
8
  import {
8
9
  canonicalizeJson,
9
10
  getAxisId,
10
11
  isColumnOptional,
11
- mapPTableValueToAxisKey,
12
12
  pTableValue,
13
13
  type PFrameDriver,
14
14
  type PlDataTableSheet,
@@ -22,6 +22,7 @@ import {
22
22
  isLabelColumn as isLabelColumnSpec,
23
23
  isColumnHidden,
24
24
  matchAxisId,
25
+ isPTableValueAxis,
25
26
  } from '@platforma-sdk/model';
26
27
  import type {
27
28
  CellStyle,
@@ -74,11 +75,13 @@ function columns2rows(
74
75
  ): PlAgDataTableV2Row[] {
75
76
  const rowData: PlAgDataTableV2Row[] = [];
76
77
  for (let iRow = 0; iRow < columns[0].data.length; ++iRow) {
77
- const axesKey = axes.map((iAxis) => {
78
- return mapPTableValueToAxisKey(
79
- pTableValue(columns[resultMapping[iAxis]], iRow),
80
- );
81
- });
78
+ const axesKey: PTableValueAxis[] = axes
79
+ .map((iAxis) => {
80
+ const value = pTableValue(columns[resultMapping[iAxis]], iRow);
81
+ if (!isPTableValueAxis(value))
82
+ throw new Error(`axis value is not a PTableValueAxis: ${JSON.stringify(value)}`);
83
+ return value;
84
+ });
82
85
  const id = canonicalizeJson<PlTableRowId>(axesKey);
83
86
  const row: PlAgDataTableV2Row = { id, axesKey };
84
87
  fields.forEach((field, iCol) => {
@@ -36,7 +36,9 @@ const sequenceLengths = computed(() =>
36
36
  <template>
37
37
  <div ref="rootRef" :class="$style.root">
38
38
  <div :class="['pl-scrollable', $style.table]">
39
- <div :class="$style.corner" />
39
+ <div :class="$style.corner">
40
+ <div :class="$style['label-scroll-indicator']" />
41
+ </div>
40
42
  <div :class="$style.header">
41
43
  <div v-if="sequenceNames.length > 1" :class="$style['sequence-names']">
42
44
  <span
@@ -52,15 +54,17 @@ const sequenceLengths = computed(() =>
52
54
  <SeqLogo v-if="widgets.includes('seqLogo')" :residue-counts />
53
55
  </div>
54
56
  <div :class="$style.labels">
55
- <template v-for="(labelRow, rowIndex) of labelRows">
56
- <div
57
- v-for="(label, labelIndex) of labelRow"
58
- :key="labelIndex"
59
- :style="{ gridRow: rowIndex + 1 }"
60
- >
61
- {{ label }}
62
- </div>
63
- </template>
57
+ <div :class="$style['labels-grid']">
58
+ <template v-for="(labelRow, rowIndex) of labelRows">
59
+ <div
60
+ v-for="(label, labelIndex) of labelRow"
61
+ :key="labelIndex"
62
+ :style="{ gridRow: rowIndex + 1 }"
63
+ >
64
+ {{ label }}
65
+ </div>
66
+ </template>
67
+ </div>
64
68
  </div>
65
69
  <div :class="$style.sequences">
66
70
  <div
@@ -86,15 +90,25 @@ const sequenceLengths = computed(() =>
86
90
  min-block-size: 0;
87
91
  -webkit-print-color-adjust: exact;
88
92
  print-color-adjust: exact;
93
+
94
+ &[data-pre-print] {
95
+ .table {
96
+ container-type: unset;
97
+ }
98
+ .labels {
99
+ max-inline-size: unset;
100
+ }
101
+ }
89
102
  }
90
103
 
91
104
  .table {
105
+ container-type: inline-size;
92
106
  display: grid;
93
107
  grid-template-areas:
94
108
  "corner header"
95
109
  "labels sequences";
96
- text-wrap: nowrap;
97
110
  justify-content: start;
111
+ timeline-scope: --msa-labels-scroll;
98
112
  @media print {
99
113
  overflow: visible;
100
114
  }
@@ -102,16 +116,28 @@ const sequenceLengths = computed(() =>
102
116
 
103
117
  .corner {
104
118
  grid-area: corner;
105
- background-color: white;
119
+ background-color: #fff;
106
120
  position: sticky;
107
121
  inset-inline-start: 0;
108
122
  inset-block-start: 0;
109
123
  z-index: 2;
110
124
  }
111
125
 
126
+ .label-scroll-indicator {
127
+ position: absolute;
128
+ inset-inline-end: 0;
129
+ block-size: 100cqb;
130
+ inline-size: 8px;
131
+ animation-name: hide;
132
+ animation-timeline: --msa-labels-scroll;
133
+ visibility: hidden;
134
+ background: #fff;
135
+ box-shadow: -4px 0 4px -2px rgba(0, 0, 0, 0.10);
136
+ }
137
+
112
138
  .header {
113
139
  grid-area: header;
114
- background-color: white;
140
+ background-color: #fff;
115
141
  position: sticky;
116
142
  inset-block-start: 0;
117
143
  z-index: 1;
@@ -127,16 +153,28 @@ const sequenceLengths = computed(() =>
127
153
 
128
154
  .labels {
129
155
  grid-area: labels;
130
- display: grid;
131
- grid-auto-flow: dense;
132
- column-gap: 12px;
133
- background-color: white;
156
+ background-color: #fff;
134
157
  position: sticky;
135
158
  inset-inline-start: 0;
136
159
  z-index: 1;
137
- padding-inline-end: 12px;
160
+ inline-size: max-content;
161
+ max-inline-size: 30cqi;
162
+ overflow: scroll;
163
+ scrollbar-width: none;
164
+ overscroll-behavior-inline: none;
165
+ scroll-timeline: --msa-labels-scroll inline;
166
+ }
167
+
168
+ .labels-grid {
169
+ display: grid;
170
+ grid-auto-flow: dense;
138
171
  font-family: Spline Sans Mono;
139
172
  line-height: 24px;
173
+ text-wrap: nowrap;
174
+
175
+ > * {
176
+ padding-inline-end: 12px;
177
+ }
140
178
  }
141
179
 
142
180
  .sequences {
@@ -153,4 +191,13 @@ const sequenceLengths = computed(() =>
153
191
  background-repeat: no-repeat;
154
192
  background-size: calc(100% - 5.8px) 100%;
155
193
  }
194
+
195
+ @keyframes hide {
196
+ from {
197
+ visibility: visible;
198
+ }
199
+ to {
200
+ visibility: hidden;
201
+ }
202
+ }
156
203
  </style>
@@ -78,7 +78,7 @@ const markupColumns = reactive(useMarkupColumnsOptions(() => ({
78
78
  })));
79
79
 
80
80
  const multipleAlignmentData = reactive(useMultipleAlignmentData(() => ({
81
- pframe: props.pFrame,
81
+ pFrame: props.pFrame,
82
82
  sequenceColumnIds: settings.sequenceColumnIds,
83
83
  labelColumnIds: settings.labelColumnIds,
84
84
  selection: props.selection,
@@ -147,18 +147,20 @@ watchEffect(() => {
147
147
  watchEffect(() => {
148
148
  const settingsToReset: (keyof PlMultiSequenceAlignmentSettings)[] = [];
149
149
  if (
150
- settings.sequenceColumnIds?.some((id) =>
151
- !sequenceColumns.data?.options.some(
152
- ({ value }) => isJsonEqual(value, id),
150
+ !sequenceColumns.isLoading
151
+ && settings.sequenceColumnIds?.some((id) =>
152
+ (sequenceColumns.data?.options ?? []).every(
153
+ ({ value }) => !isJsonEqual(value, id),
153
154
  ),
154
155
  )
155
156
  ) {
156
157
  settingsToReset.push('sequenceColumnIds');
157
158
  }
158
159
  if (
159
- settings.labelColumnIds?.some((id) =>
160
- !labelColumns.data?.options.some(
161
- ({ value }) => isJsonEqual(value, id),
160
+ !labelColumns.isLoading
161
+ && settings.labelColumnIds?.some((id) =>
162
+ (labelColumns.data?.options ?? []).every(
163
+ ({ value }) => !isJsonEqual(value, id),
162
164
  ),
163
165
  )
164
166
  ) {
@@ -170,9 +172,10 @@ watchEffect(() => {
170
172
  : undefined;
171
173
 
172
174
  if (
173
- markupColumnId
174
- && !markupColumns.data?.some(
175
- ({ value }) => isJsonEqual(value, markupColumnId),
175
+ !markupColumns.isLoading
176
+ && markupColumnId
177
+ && (markupColumns.data ?? []).every(
178
+ ({ value }) => !isJsonEqual(value, markupColumnId),
176
179
  )
177
180
  ) {
178
181
  settingsToReset.push('colorScheme');
@@ -209,7 +212,9 @@ async function exportPdf() {
209
212
  position: fixed;
210
213
  }
211
214
  }`);
212
- printTarget.replaceChildren(msaRoot.cloneNode(true));
215
+ const msaClone = msaRoot.cloneNode(true) as HTMLElement;
216
+ msaClone.dataset.prePrint = '';
217
+ printTarget.replaceChildren(msaClone);
213
218
  document.body.appendChild(printTarget);
214
219
  const { height, width } = printTarget.getBoundingClientRect();
215
220
  const margin = CSS.cm(1);
@@ -68,7 +68,7 @@ async function getSequenceColumnsOptions({
68
68
  const options = columns.values()
69
69
  .filter((column) => sequenceColumnPredicate(column))
70
70
  .map(({ spec, columnId }) => ({
71
- label: spec.annotations?.['pl7.app/label'] ?? 'Unlabelled column',
71
+ label: spec.annotations?.['pl7.app/label'] ?? 'Unlabeled column',
72
72
  value: columnId,
73
73
  }))
74
74
  .toArray();
@@ -111,7 +111,7 @@ async function getLabelColumnsOptions({
111
111
  : canonicalizeJson({ type: 'axis', id: axisId }),
112
112
  labelColumn?.spec.annotations?.['pl7.app/label']
113
113
  ?? axisSpec.annotations?.['pl7.app/label']
114
- ?? 'Unlabelled axis',
114
+ ?? 'Unlabeled axis',
115
115
  );
116
116
  }
117
117
 
@@ -128,7 +128,7 @@ async function getLabelColumnsOptions({
128
128
  if (optionMap.has(columnIdJson)) continue;
129
129
  optionMap.set(
130
130
  columnIdJson,
131
- spec.annotations?.['pl7.app/label'] ?? 'Unlabelled column',
131
+ spec.annotations?.['pl7.app/label'] ?? 'Unlabeled column',
132
132
  );
133
133
  }
134
134
 
@@ -175,30 +175,30 @@ async function getMarkupColumnsOptions({
175
175
  ) => column.spec.domain?.[key] === value),
176
176
  ).map(({ columnId, spec }) => ({
177
177
  value: columnId,
178
- label: spec.annotations?.['pl7.app/label'] ?? 'Unlabelled column',
178
+ label: spec.annotations?.['pl7.app/label'] ?? 'Unlabeled column',
179
179
  }))
180
180
  .toArray();
181
181
  }
182
182
 
183
183
  async function getMultipleAlignmentData({
184
- pframe,
184
+ pFrame,
185
185
  sequenceColumnIds,
186
186
  labelColumnIds,
187
187
  selection,
188
188
  colorScheme,
189
189
  alignmentParams,
190
190
  }: {
191
- pframe: PFrameHandle | undefined;
191
+ pFrame: PFrameHandle | undefined;
192
192
  sequenceColumnIds: PObjectId[] | undefined;
193
193
  labelColumnIds: PTableColumnId[] | undefined;
194
194
  selection: PlSelectionModel | undefined;
195
195
  colorScheme: PlMultiSequenceAlignmentColorSchemeOption;
196
196
  alignmentParams: PlMultiSequenceAlignmentSettings['alignmentParams'];
197
197
  }): Promise<MultipleAlignmentData | undefined> {
198
- if (!pframe || !sequenceColumnIds?.length || !labelColumnIds) return;
198
+ if (!pFrame || !sequenceColumnIds?.length || !labelColumnIds) return;
199
199
 
200
200
  const pFrameDriver = getPFrameDriver();
201
- const columns = await pFrameDriver.listColumns(pframe);
201
+ const columns = await pFrameDriver.listColumns(pFrame);
202
202
  const linkerColumns = columns.filter((column) => isLinkerColumn(column.spec));
203
203
 
204
204
  const filterColumn = createRowSelectionColumn({ selection });
@@ -280,7 +280,7 @@ async function getMultipleAlignmentData({
280
280
  };
281
281
 
282
282
  const table = await pFrameDriver.calculateTableData(
283
- pframe,
283
+ pFrame,
284
284
  JSON.parse(JSON.stringify(request)),
285
285
  {
286
286
  offset: 0,
@@ -339,7 +339,7 @@ async function getMultipleAlignmentData({
339
339
  );
340
340
 
341
341
  const sequenceNames = sequenceColumns.map((column) =>
342
- column.spec.spec.annotations?.['pl7.app/label'] ?? 'Unlabelled column',
342
+ column.spec.spec.annotations?.['pl7.app/label'] ?? 'Unlabeled column',
343
343
  );
344
344
 
345
345
  const labels = Array.from(
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpandTransition.vue2.js","sources":["../../../../../../../../../lib/ui/uikit/src/components/PlAccordion/ExpandTransition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nconst onStart = (el: Element) => {\n el.classList.add('expand-collapse-fix');\n (el as HTMLElement).style.setProperty('--component-height', el.scrollHeight + 'px');\n};\n\nconst onAfter = (el: Element) => {\n (el as HTMLElement).style.removeProperty('--component-height');\n el.classList.remove('expand-collapse-fix');\n};\n</script>\n\n<template>\n <Transition name=\"expand-collapse\" @enter=\"onStart\" @leave=\"onStart\" @after-enter=\"onAfter\" @after-leave=\"onAfter\">\n <slot/>\n </Transition>\n</template>\n\n<style>\n.expand-collapse-fix {\n overflow: hidden;\n}\n\n.expand-collapse-enter-active,\n.expand-collapse-leave-active {\n transition:\n height 0.2s ease-in-out,\n opacity 0.2s ease-in-out;\n height: var(--component-height);\n}\n\n.expand-collapse-enter-from,\n.expand-collapse-leave-to {\n opacity: 0.5;\n height: 0;\n}\n</style>\n"],"names":["onStart","el","onAfter"],"mappings":";;;;AACMA,UAAAA,IAAU,CAACC,MAAgB;AAC5BA,QAAA,UAAU,IAAI,qBAAqB,GACrCA,EAAmB,MAAM,YAAY,sBAAsBA,EAAG,eAAe,IAAI;AAAA,IAAA,GAG9EC,IAAU,CAACD,MAAgB;AAC9BA,QAAmB,MAAM,eAAe,oBAAoB,GAC1DA,EAAA,UAAU,OAAO,qBAAqB;AAAA,IAC3C;;;;;;;;;;;;;;;"}