@platforma-sdk/ui-vue 1.40.0 → 1.40.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.
Files changed (69) hide show
  1. package/.turbo/turbo-build.log +27 -30
  2. package/.turbo/turbo-type-check.log +1 -1
  3. package/CHANGELOG.md +9 -0
  4. package/dist/AgGridVue/selection.d.ts.map +1 -1
  5. package/dist/AgGridVue/selection.js +11 -10
  6. package/dist/AgGridVue/selection.js.map +1 -1
  7. package/dist/AgGridVue/useAgGridOptions.js +53 -54
  8. package/dist/AgGridVue/useAgGridOptions.js.map +1 -1
  9. package/dist/_virtual/_commonjsHelpers.js +3 -5
  10. package/dist/_virtual/_commonjsHelpers.js.map +1 -1
  11. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts +4 -1
  12. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts.map +1 -1
  13. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js +185 -156
  14. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js.map +1 -1
  15. package/dist/components/PlAgDataTable/PlAgRowCount.vue.js +6 -7
  16. package/dist/components/PlAgDataTable/PlAgRowCount.vue.js.map +1 -1
  17. package/dist/components/PlAgDataTable/sources/focus-row.d.ts +5 -6
  18. package/dist/components/PlAgDataTable/sources/focus-row.d.ts.map +1 -1
  19. package/dist/components/PlAgDataTable/sources/focus-row.js +23 -27
  20. package/dist/components/PlAgDataTable/sources/focus-row.js.map +1 -1
  21. package/dist/components/PlAgDataTable/sources/menu-items.js +1 -1
  22. package/dist/components/PlAgDataTable/sources/menu-items.js.map +1 -1
  23. package/dist/components/PlAgDataTable/sources/table-source-v2.d.ts +13 -6
  24. package/dist/components/PlAgDataTable/sources/table-source-v2.d.ts.map +1 -1
  25. package/dist/components/PlAgDataTable/sources/table-source-v2.js +121 -113
  26. package/dist/components/PlAgDataTable/sources/table-source-v2.js.map +1 -1
  27. package/dist/components/PlAgDataTable/sources/table-state-v2.d.ts +1 -1
  28. package/dist/components/PlAgDataTable/sources/table-state-v2.d.ts.map +1 -1
  29. package/dist/components/PlAgDataTable/sources/table-state-v2.js +47 -47
  30. package/dist/components/PlAgDataTable/sources/table-state-v2.js.map +1 -1
  31. package/dist/components/PlAgDataTable/types.d.ts +18 -5
  32. package/dist/components/PlAgDataTable/types.d.ts.map +1 -1
  33. package/dist/components/PlAgDataTable/types.js.map +1 -1
  34. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.js +9 -10
  35. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.js.map +1 -1
  36. package/dist/components/PlAgRowNumHeader.vue.js +2 -3
  37. package/dist/components/PlAgRowNumHeader.vue.js.map +1 -1
  38. package/dist/lib/ui/uikit/dist/components/PlAutocomplete/PlAutocomplete.vue.js +1 -1
  39. package/dist/lib/ui/uikit/dist/components/PlDropdown/PlDropdown.vue.js +1 -1
  40. package/dist/lib/ui/uikit/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js +1 -1
  41. package/dist/lib/ui/uikit/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js +1 -1
  42. package/dist/lib/ui/uikit/dist/components/PlFileInput/PlFileInput.vue.js +1 -1
  43. package/dist/lib/ui/uikit/dist/components/PlTextArea/PlTextArea.vue.js +1 -1
  44. package/dist/lib/ui/uikit/dist/components/PlTextField/PlTextField.vue.js +1 -1
  45. package/dist/lib/ui/uikit/dist/generated/components/svg/images/{SvgRequired.vue.js → SvgRequired.vue2.js} +1 -1
  46. package/dist/lib/ui/uikit/dist/generated/components/svg/images/SvgRequired.vue2.js.map +1 -0
  47. package/dist/lib/ui/uikit/dist/sdk/model/dist/index.js +1 -1
  48. package/dist/lib/ui/uikit/dist/sdk/model/dist/index.js.map +1 -1
  49. package/dist/lib.js +256 -257
  50. package/dist/sdk/model/dist/index.js +111 -111
  51. package/dist/sdk/model/dist/index.js.map +1 -1
  52. package/package.json +5 -7
  53. package/src/AgGridVue/selection.ts +12 -10
  54. package/src/components/PlAgDataTable/PlAgDataTableV2.vue +66 -27
  55. package/src/components/PlAgDataTable/sources/focus-row.ts +26 -33
  56. package/src/components/PlAgDataTable/sources/menu-items.ts +1 -1
  57. package/src/components/PlAgDataTable/sources/table-source-v2.ts +75 -47
  58. package/src/components/PlAgDataTable/sources/table-state-v2.ts +30 -32
  59. package/src/components/PlAgDataTable/types.ts +20 -5
  60. package/dist/_virtual/lodash.js +0 -6
  61. package/dist/_virtual/lodash.js.map +0 -1
  62. package/dist/_virtual/lodash2.js +0 -5
  63. package/dist/_virtual/lodash2.js.map +0 -1
  64. package/dist/components/PlAgDataTable/sources/file-source.d.ts +0 -7
  65. package/dist/components/PlAgDataTable/sources/file-source.d.ts.map +0 -1
  66. package/dist/lib/ui/uikit/dist/generated/components/svg/images/SvgRequired.vue.js.map +0 -1
  67. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js +0 -3678
  68. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js.map +0 -1
  69. package/src/components/PlAgDataTable/sources/file-source.ts +0 -23
@@ -1,13 +1,3 @@
1
- import type {
2
- PlDataTableFilterState,
3
- PlDataTableStateV2CacheEntry,
4
- PlDataTableStateV2Normalized,
5
- PObjectId,
6
- PTableColumnSpecJson,
7
- PTableParamsV2,
8
- PTableRecordFilter,
9
- PTableSorting,
10
- } from '@platforma-sdk/model';
11
1
  import {
12
2
  makeDefaultPTableParams,
13
3
  parseJson,
@@ -15,21 +5,24 @@ import {
15
5
  type PlDataTableGridStateCore,
16
6
  type PlDataTableSheetState,
17
7
  type PlDataTableStateV2,
8
+ type PlDataTableFilterState,
9
+ type PlDataTableStateV2CacheEntry,
10
+ type PlDataTableStateV2Normalized,
11
+ type PObjectId,
12
+ type PTableParamsV2,
13
+ type PTableRecordFilter,
14
+ type PTableSorting,
18
15
  } from '@platforma-sdk/model';
19
- import type {
20
- Ref,
21
- WritableComputedRef,
22
- } from 'vue';
23
16
  import {
24
17
  computed,
25
18
  watch,
19
+ type Ref,
20
+ type WritableComputedRef,
26
21
  } from 'vue';
27
22
  import type {
28
23
  PlDataTableSettingsV2,
29
24
  } from '../types';
30
- import {
31
- isJsonEqual,
32
- } from '@milaboratories/helpers';
25
+ import { isJsonEqual } from '@milaboratories/helpers';
33
26
  import { makePredicate } from '../../PlTableFilters/filters_logic';
34
27
  import { computedCached } from '@milaboratories/uikit';
35
28
 
@@ -52,8 +45,12 @@ function makeDefaultState(): PlDataTableStateV2CacheEntryNullable {
52
45
  function getHiddenColIds(state: PlDataTableGridStateCore['columnVisibility']): PObjectId[] | null {
53
46
  return state?.hiddenColIds
54
47
  ?.map(parseJson)
55
- .filter((c) => c.type === 'column')
56
- .map((c) => c.id)
48
+ .reduce((acc, c) => {
49
+ if (c.source.type === 'column') {
50
+ acc.push(c.source.id);
51
+ }
52
+ return acc;
53
+ }, [] as PObjectId[])
57
54
  ?? null;
58
55
  }
59
56
 
@@ -73,24 +70,25 @@ function makePartitionFilters(sheetsState: PlDataTableSheetState[]): PTableRecor
73
70
 
74
71
  function makeFilters(columnsState: PlDataTableFilterState[]): PTableRecordFilter[] {
75
72
  return columnsState
76
- .flatMap((s) => {
77
- return !s.filter || s.filter.disabled
78
- ? []
79
- : [{
80
- type: 'bySingleColumnV2',
81
- column: s.id,
82
- predicate: makePredicate(s.alphabetic, s.filter.value),
83
- }];
84
- });
73
+ .reduce((acc, s) => {
74
+ if (!s.filter || s.filter.disabled) {
75
+ return acc;
76
+ }
77
+ acc.push({
78
+ type: 'bySingleColumnV2',
79
+ column: s.id,
80
+ predicate: makePredicate(s.alphabetic, s.filter.value),
81
+ });
82
+ return acc;
83
+ }, [] as PTableRecordFilter[]);
85
84
  }
86
85
 
87
86
  function makeSorting(state: PlDataTableGridStateCore['sort']): PTableSorting[] {
88
87
  return (
89
88
  state?.sortModel.map((item) => {
90
- const { spec, ...column } = parseJson(
91
- item.colId as PTableColumnSpecJson,
92
- );
93
- const _ = spec;
89
+ const { spec: _, ...column } = parseJson(
90
+ item.colId,
91
+ ).labeled;
94
92
  return {
95
93
  column,
96
94
  ascending: item.sort === 'asc',
@@ -192,18 +192,33 @@ export type PlAgDataTableV2Controller = {
192
192
  focusRow: (rowKey: PTableKey) => Promise<void>;
193
193
  };
194
194
 
195
- export type PTableKeyJson = CanonicalizedJson<PTableKey>;
195
+ export type PlTableRowId = {
196
+ /** Axes values */
197
+ axesKey: PTableKey;
198
+ /** Axes key where values of labeled axes are resolved to corresponding labels */
199
+ labeled: PTableKey;
200
+ };
201
+
202
+ export type PlTableRowIdJson = CanonicalizedJson<PlTableRowId>;
196
203
 
197
204
  /** PlAgDataTableV2 row */
198
205
  export type PlAgDataTableV2Row = {
199
- /** Axis key is not present for heterogeneous axes */
200
- key?: PTableKey;
201
- /** Unique row identifier, created as canonicalize(key)! when key is present */
202
- id: PTableKeyJson;
206
+ /** Axes key */
207
+ axesKey: PTableKey;
208
+ /** Unique row identifier */
209
+ id: PlTableRowIdJson;
203
210
  /** Row values by column; sheet axes and labeled axes are excluded */
204
211
  [field: `${number}`]: PTableValue | PTableHidden;
205
212
  };
206
213
 
214
+ /** PlSelectionModel with labeled axes replaced by label columns */
215
+ export type PlTableLabeledSelectionModel = {
216
+ /** Specs for valuess in {@link PTableKey} */
217
+ spec: PTableColumnSpec[];
218
+ /** Row keys (arrays of axes values) of selected rows */
219
+ selectedLabeledKeys: PTableKey[];
220
+ };
221
+
207
222
  export type PlAgOverlayLoadingParams = {
208
223
  /**
209
224
  * Required flag, that shows catInBag icon with message if `true`, shows PlSplash component if `false`.
@@ -1,6 +0,0 @@
1
- import { __require as r } from "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js";
2
- var a = r();
3
- export {
4
- a as l
5
- };
6
- //# sourceMappingURL=lodash.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lodash.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,5 +0,0 @@
1
- var o = { exports: {} };
2
- export {
3
- o as __module
4
- };
5
- //# sourceMappingURL=lodash2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lodash2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,7 +0,0 @@
1
- import { ColDef, IDatasource } from 'ag-grid-enterprise';
2
- import { BlobDriver, LocalBlobHandleAndSize, RemoteBlobHandleAndSize } from '@platforma-sdk/model';
3
- export declare function updateXsvGridOptions(_blobDriver: BlobDriver, _file: LocalBlobHandleAndSize | RemoteBlobHandleAndSize): Promise<{
4
- columnDefs: ColDef[];
5
- datasource: IDatasource;
6
- }>;
7
- //# sourceMappingURL=file-source.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-source.d.ts","sourceRoot":"","sources":["../../../../src/components/PlAgDataTable/sources/file-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAExG,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,UAAU,EACvB,KAAK,EAAE,sBAAsB,GAAG,uBAAuB,GACtD,OAAO,CAAC;IACP,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,WAAW,CAAC;CACzB,CAAC,CAaH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SvgRequired.vue.js","sources":["../../../../../../../../../../../lib/ui/uikit/src/generated/components/svg/images/SvgRequired.vue"],"sourcesContent":["<!-- ⚠️ AUTOGENERATED. DO NOT EDIT. -->\n<script lang=\"ts\">\nimport '../svg-styles.css';\nexport default { name: 'SvgRequired' };\n</script>\n\n<template>\n <div class=\"svg-icon SvgRequired\" style=\"width: 5px; height: 12px\" />\n</template>\n\n<style>\n .SvgRequired { background-image: url(\"data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%225%22%20height%3D%2212%22%20viewBox%3D%220%200%205%2012%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M1.51685%204.8L2.5%203.34159L3.47612%204.8L4.39607%204.12743L3.31461%202.7469L5%202.25133L4.64888%201.16106L3.00562%201.77699L3.06882%200H1.93118L1.99438%201.77699L0.351124%201.16106L0%202.25133L1.68539%202.7469L0.59691%204.12743L1.51685%204.8Z%22%20fill%3D%22%23F1222F%22%2F%3E%3C%2Fsvg%3E\"); }\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;AAOoC,MAAA,IAAA;AAAA,EAAA,OAAA;AAAA;;;;;;"}