@platforma-sdk/model 1.37.2 → 1.37.11

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/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const PlatformaSDKVersion = "1.37.2";
1
+ export declare const PlatformaSDKVersion = "1.37.11";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,WAAW,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/model",
3
- "version": "1.37.2",
3
+ "version": "1.37.11",
4
4
  "description": "Platforma.bio SDK / Block Model",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -669,9 +669,10 @@ export function uniqueBy<T>(array: T[], makeId: (entry: T) => string): T[] {
669
669
  export function createPlDataTableV2<A, U>(
670
670
  ctx: RenderCtx<A, U>,
671
671
  inputColumns: PColumn<TreeNodeAccessor | PColumnValues | DataInfo<TreeNodeAccessor>>[],
672
- tableState: PlDataTableStateV2 | undefined,
672
+ tableState: PlDataTableStateV2,
673
673
  ops?: CreatePlDataTableOps,
674
674
  ): PlDataTableModel | undefined {
675
+ if (inputColumns.length === 0) return undefined;
675
676
  const tableStateNormalized = upgradePlDataTableStateV2(tableState ?? createPlDataTableStateV2());
676
677
 
677
678
  const coreJoinType = ops?.coreJoinType ?? 'full';
@@ -706,6 +707,11 @@ export function createPlDataTableV2<A, U>(
706
707
  .map((c) => c.id);
707
708
  })());
708
709
 
710
+ // Preserve linker columns
711
+ columns
712
+ .filter((c) => c.spec.annotations?.['pl7.app/isLinkerColumn'] === 'true')
713
+ .forEach((c) => hiddenColumns.delete(c.id));
714
+
709
715
  // Preserve core columns as they change the shape of join.
710
716
  if (ops?.coreColumnPredicate) {
711
717
  const coreColumns = columns.flatMap((c) => ops?.coreColumnPredicate?.(c.spec) ? [c.id] : []);
@@ -715,7 +721,7 @@ export function createPlDataTableV2<A, U>(
715
721
  // Filters decrease the number of result rows, sorting changes the order of result rows
716
722
  [...filters.map((f) => f.column), ...sorting.map((s) => s.column)]
717
723
  .filter((c): c is PTableColumnIdColumn => c.type === 'column')
718
- .map((c) => hiddenColumns.delete(c.id));
724
+ .forEach((c) => hiddenColumns.delete(c.id));
719
725
 
720
726
  const visibleColumns = columns.filter((c) => !hiddenColumns.has(c.id));
721
727
  const visibleLabelColumns = getMatchingLabelColumns(visibleColumns.map(getColumnIdAndSpec), allLabelColumns);