@platforma-sdk/model 1.15.4 → 1.18.0
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/components/PlDataTable.d.ts +5 -6
- package/dist/components/PlDataTable.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -30
- package/dist/index.mjs.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/PlDataTable.ts +6 -7
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var ce = Object.defineProperty;
|
|
2
2
|
var de = (t, e, n) => e in t ? ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var v = (t, e, n) => de(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { isPColumn as
|
|
4
|
+
import { isPColumn as H, mapPObjectData as L, mapValueInVOE as pe, ensurePColumn as fe, isPColumnSpec as he, mapPTableDef as ge, getAxisId as Y, matchAxisId as me } from "@milaboratories/pl-model-common";
|
|
5
5
|
export * from "@milaboratories/pl-model-common";
|
|
6
6
|
import { z as P } from "zod";
|
|
7
7
|
class ye extends Error {
|
|
@@ -333,7 +333,7 @@ class S {
|
|
|
333
333
|
getPColumns(e = !1, n = "") {
|
|
334
334
|
const r = this.parsePObjectCollection(e, n);
|
|
335
335
|
return r === void 0 ? void 0 : Object.entries(r).map(([, i]) => {
|
|
336
|
-
if (!
|
|
336
|
+
if (!H(i)) throw new Error(`not a PColumn (kind = ${i.spec.kind})`);
|
|
337
337
|
return i;
|
|
338
338
|
});
|
|
339
339
|
}
|
|
@@ -442,19 +442,19 @@ const se = "staging", ie = "main";
|
|
|
442
442
|
function oe(t) {
|
|
443
443
|
return typeof t == "object" && t !== null && "__awaited_futures__" in t;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function J(t, e, n) {
|
|
446
446
|
if (e.has(n)) return;
|
|
447
447
|
if (e.add(n), typeof n === "object")
|
|
448
448
|
if (oe(n)) n.__awaited_futures__.forEach((s) => t.add(s));
|
|
449
449
|
else if (Array.isArray(n))
|
|
450
|
-
for (const s of n)
|
|
450
|
+
for (const s of n) J(t, e, s);
|
|
451
451
|
else
|
|
452
452
|
for (const [, s] of Object.entries(n))
|
|
453
|
-
s !== n &&
|
|
453
|
+
s !== n && J(t, e, s);
|
|
454
454
|
}
|
|
455
455
|
function Se(t) {
|
|
456
456
|
const e = /* @__PURE__ */ new Set();
|
|
457
|
-
return
|
|
457
|
+
return J(e, /* @__PURE__ */ new Set(), t), e;
|
|
458
458
|
}
|
|
459
459
|
const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
460
460
|
__proto__: null,
|
|
@@ -470,16 +470,16 @@ const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
470
470
|
}), Ce = P.array(Ie), Re = 1e-3, Te = "__LABEL__", Q = "__LABEL__@1";
|
|
471
471
|
function Fe(t, e, n = {}) {
|
|
472
472
|
const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = t.map((d) => {
|
|
473
|
-
var
|
|
474
|
-
const m = e(d), y = (
|
|
473
|
+
var q, z;
|
|
474
|
+
const m = e(d), y = (q = m.annotations) == null ? void 0 : q[Ae], F = (z = m.annotations) == null ? void 0 : z[Pe], b = (F ? Ce.safeParse(JSON.parse(F)).data : void 0) ?? [];
|
|
475
475
|
if (y) {
|
|
476
476
|
const _ = { label: y, type: Te, importance: -2 };
|
|
477
477
|
n.addLabelAsSuffix ? b.push(_) : b.splice(0, 0, _);
|
|
478
478
|
}
|
|
479
|
-
const E = [],
|
|
479
|
+
const E = [], W = /* @__PURE__ */ new Map();
|
|
480
480
|
for (let _ = b.length - 1; _ >= 0; --_) {
|
|
481
|
-
const { type: V } = b[_], ue = b[_].importance ?? 0, j = (
|
|
482
|
-
|
|
481
|
+
const { type: V } = b[_], ue = b[_].importance ?? 0, j = (W.get(V) ?? 0) + 1;
|
|
482
|
+
W.set(V, j);
|
|
483
483
|
const I = `${V}@${j}`;
|
|
484
484
|
s.set(I, (s.get(I) ?? 0) + 1), r.set(
|
|
485
485
|
I,
|
|
@@ -637,10 +637,10 @@ class Oe {
|
|
|
637
637
|
if (!he(r.obj.spec))
|
|
638
638
|
continue;
|
|
639
639
|
const s = r.obj.spec;
|
|
640
|
-
if (e.name === s.name && e.valueType === s.valueType && e.axesSpec.length === s.axesSpec.length &&
|
|
640
|
+
if (e.name === s.name && e.valueType === s.valueType && e.axesSpec.length === s.axesSpec.length && $(e.domain, s.domain)) {
|
|
641
641
|
for (let i = 0; i < e.axesSpec.length; ++i) {
|
|
642
642
|
const o = e.axesSpec[i], a = s.axesSpec[i];
|
|
643
|
-
if (o.name !== a.name || o.type !== a.type ||
|
|
643
|
+
if (o.name !== a.name || o.type !== a.type || !$(o.domain, a.domain))
|
|
644
644
|
continue e;
|
|
645
645
|
}
|
|
646
646
|
n.push(r.obj);
|
|
@@ -649,7 +649,7 @@ class Oe {
|
|
|
649
649
|
return n;
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function $(t, e) {
|
|
653
653
|
if (t === void 0) return e === void 0;
|
|
654
654
|
if (e === void 0) return !0;
|
|
655
655
|
for (const n in e)
|
|
@@ -699,9 +699,9 @@ class D {
|
|
|
699
699
|
findLabels(e) {
|
|
700
700
|
const n = this.resultPool.getData();
|
|
701
701
|
for (const r of n.entries) {
|
|
702
|
-
if (!
|
|
702
|
+
if (!H(r.obj)) continue;
|
|
703
703
|
const s = r.obj.spec;
|
|
704
|
-
if (s.name === "pl7.app/label" && s.axesSpec.length === 1 && s.axesSpec[0].name === e.name && s.axesSpec[0].type === e.type &&
|
|
704
|
+
if (s.name === "pl7.app/label" && s.axesSpec.length === 1 && s.axesSpec[0].name === e.name && s.axesSpec[0].type === e.type && $(e.domain, s.axesSpec[0].domain)) {
|
|
705
705
|
if (r.obj.data.resourceType.name !== "PColumnData/Json")
|
|
706
706
|
throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
|
|
707
707
|
return new Map(
|
|
@@ -735,11 +735,11 @@ class D {
|
|
|
735
735
|
return this.ctx.getCurrentUnstableMarker();
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
const T = "PColumnData/",
|
|
738
|
+
const T = "PColumnData/", K = T + "ResourceMap", G = T + "Partitioned/ResourceMap", Z = T + "JsonPartitioned", M = T + "BinaryPartitioned", ae = T + "Partitioned/", ee = ae + "JsonPartitioned", B = ae + "BinaryPartitioned";
|
|
739
739
|
function le(t, e, n, r = [], s) {
|
|
740
740
|
if (t === void 0) return !1;
|
|
741
741
|
switch (t.resourceType.name) {
|
|
742
|
-
case
|
|
742
|
+
case K: {
|
|
743
743
|
let i = t.getInputsLocked();
|
|
744
744
|
for (const o of t.listInputFields()) {
|
|
745
745
|
const a = t.resolve({ field: o, assertFieldType: "Input" }), l = [...r, ...JSON.parse(o)], c = a === void 0 ? void 0 : e(a);
|
|
@@ -747,7 +747,7 @@ function le(t, e, n, r = [], s) {
|
|
|
747
747
|
}
|
|
748
748
|
return i;
|
|
749
749
|
}
|
|
750
|
-
case
|
|
750
|
+
case G: {
|
|
751
751
|
let i = t.getInputsLocked();
|
|
752
752
|
for (const o of t.listInputFields()) {
|
|
753
753
|
const a = t.resolve({ field: o, assertFieldType: "Input" });
|
|
@@ -785,10 +785,10 @@ function De(t) {
|
|
|
785
785
|
const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
|
|
786
786
|
let s = 0;
|
|
787
787
|
switch (e) {
|
|
788
|
-
case
|
|
788
|
+
case K:
|
|
789
789
|
s = n.keyLength;
|
|
790
790
|
break;
|
|
791
|
-
case
|
|
791
|
+
case G:
|
|
792
792
|
s = n.partitionKeyLength + n.keyLength;
|
|
793
793
|
break;
|
|
794
794
|
case Z:
|
|
@@ -801,7 +801,7 @@ function De(t) {
|
|
|
801
801
|
break;
|
|
802
802
|
}
|
|
803
803
|
switch (e) {
|
|
804
|
-
case
|
|
804
|
+
case K:
|
|
805
805
|
case Z:
|
|
806
806
|
case M:
|
|
807
807
|
for (let i of t.listInputFields()) {
|
|
@@ -814,7 +814,7 @@ function De(t) {
|
|
|
814
814
|
r.push(o);
|
|
815
815
|
}
|
|
816
816
|
break;
|
|
817
|
-
case
|
|
817
|
+
case G:
|
|
818
818
|
case B:
|
|
819
819
|
case ee:
|
|
820
820
|
for (const i of t.listInputFields()) {
|
|
@@ -848,7 +848,7 @@ function pt(t) {
|
|
|
848
848
|
}
|
|
849
849
|
return s.map((i) => Array.from(i.values()));
|
|
850
850
|
}
|
|
851
|
-
const C = "1.
|
|
851
|
+
const C = "1.18.0";
|
|
852
852
|
function ke(t) {
|
|
853
853
|
return t.__renderLambda === !0;
|
|
854
854
|
}
|
|
@@ -1107,12 +1107,12 @@ class h {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
function ht(t, e, n, r) {
|
|
1109
1109
|
var o, a;
|
|
1110
|
-
const s = t.resultPool.getData().entries.map((l) => l.obj).filter(
|
|
1110
|
+
const s = t.resultPool.getData().entries.map((l) => l.obj).filter(H).filter((l) => l.spec.name === "pl7.app/label" && l.spec.axesSpec.length === 1), i = /* @__PURE__ */ new Map();
|
|
1111
1111
|
for (const l of e)
|
|
1112
1112
|
for (const c of l.spec.axesSpec) {
|
|
1113
|
-
const f =
|
|
1113
|
+
const f = Y(c);
|
|
1114
1114
|
for (const w of s)
|
|
1115
|
-
me(f,
|
|
1115
|
+
me(f, Y(w.spec.axesSpec[0])) && i.set(w.id, w);
|
|
1116
1116
|
}
|
|
1117
1117
|
if (![...e, ...i.values()].find((l) => !l.data.getIsReadyOrError()))
|
|
1118
1118
|
return t.createPTable({
|
|
@@ -1131,7 +1131,7 @@ function ht(t, e, n, r) {
|
|
|
1131
1131
|
function gt(t, e, n) {
|
|
1132
1132
|
const r = t.findLabels(e);
|
|
1133
1133
|
return {
|
|
1134
|
-
axis:
|
|
1134
|
+
axis: e,
|
|
1135
1135
|
options: n.map((s) => ({
|
|
1136
1136
|
value: s,
|
|
1137
1137
|
label: (r == null ? void 0 : r.get(s)) ?? s.toString()
|
|
@@ -1198,8 +1198,8 @@ export {
|
|
|
1198
1198
|
B as RT_BINARY_SUPER_PARTITIONED,
|
|
1199
1199
|
Z as RT_JSON_PARTITIONED,
|
|
1200
1200
|
ee as RT_JSON_SUPER_PARTITIONED,
|
|
1201
|
-
|
|
1202
|
-
|
|
1201
|
+
K as RT_RESOURCE_MAP,
|
|
1202
|
+
G as RT_RESOURCE_MAP_PARTITIONED,
|
|
1203
1203
|
D as RenderCtx,
|
|
1204
1204
|
Oe as ResultPool,
|
|
1205
1205
|
Je as StagingOutputs,
|