@milaboratories/milaboratories.ui-examples.model 1.0.41 → 1.0.43
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/.turbo/turbo-build.log +11 -11
- package/CHANGELOG.md +14 -0
- package/dist/bundle.js +200 -199
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +5 -5
package/dist/bundle.js
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
54
54
|
}
|
|
55
55
|
util2.joinValues = joinValues;
|
|
56
|
-
util2.jsonStringifyReplacer = (
|
|
56
|
+
util2.jsonStringifyReplacer = (_, value) => {
|
|
57
57
|
if (typeof value === "bigint") {
|
|
58
58
|
return value.toString();
|
|
59
59
|
}
|
|
@@ -3917,7 +3917,7 @@
|
|
|
3917
3917
|
function c(n) {
|
|
3918
3918
|
throw new Error("Unexpected object: " + n);
|
|
3919
3919
|
}
|
|
3920
|
-
function
|
|
3920
|
+
function D$1(n, t) {
|
|
3921
3921
|
return { ...n, src: i(n.src, t) };
|
|
3922
3922
|
}
|
|
3923
3923
|
function i(n, t) {
|
|
@@ -3946,96 +3946,94 @@
|
|
|
3946
3946
|
z.object({
|
|
3947
3947
|
__isRef: z.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
3948
3948
|
blockId: z.string().describe("Upstream block id"),
|
|
3949
|
-
name: z.string().describe(
|
|
3950
|
-
"Name of the output provided to the upstream block's output context"
|
|
3951
|
-
)
|
|
3949
|
+
name: z.string().describe("Name of the output provided to the upstream block's output context")
|
|
3952
3950
|
}).describe(
|
|
3953
3951
|
"Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees."
|
|
3954
3952
|
).strict().readonly();
|
|
3955
3953
|
function r(n) {
|
|
3956
3954
|
return n.kind === "PColumn";
|
|
3957
3955
|
}
|
|
3958
|
-
function w
|
|
3956
|
+
function w(n) {
|
|
3959
3957
|
return r(n.spec);
|
|
3960
3958
|
}
|
|
3961
|
-
function
|
|
3962
|
-
if (!w
|
|
3959
|
+
function O$1(n) {
|
|
3960
|
+
if (!w(n)) throw new Error(`not a PColumn (kind = ${n.spec.kind})`);
|
|
3963
3961
|
return n;
|
|
3964
3962
|
}
|
|
3965
|
-
function
|
|
3963
|
+
function J(n, t) {
|
|
3966
3964
|
return n === void 0 ? void 0 : {
|
|
3967
3965
|
...n,
|
|
3968
3966
|
data: t(n.data)
|
|
3969
3967
|
};
|
|
3970
3968
|
}
|
|
3971
|
-
function
|
|
3969
|
+
function W(n, t) {
|
|
3972
3970
|
return n.ok ? { ok: true, value: t(n.value) } : n;
|
|
3973
3971
|
}
|
|
3974
|
-
var
|
|
3975
|
-
var
|
|
3976
|
-
var
|
|
3977
|
-
function k(
|
|
3978
|
-
return { type: "Immediate", value:
|
|
3972
|
+
var ce = Object.defineProperty;
|
|
3973
|
+
var de = (t, e, n) => e in t ? ce(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
|
|
3974
|
+
var v = (t, e, n) => de(t, typeof e != "symbol" ? e + "" : e, n);
|
|
3975
|
+
function k(t) {
|
|
3976
|
+
return { type: "Immediate", value: t };
|
|
3979
3977
|
}
|
|
3980
|
-
function
|
|
3978
|
+
function _e() {
|
|
3981
3979
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
3982
3980
|
}
|
|
3983
|
-
function
|
|
3984
|
-
if (
|
|
3985
|
-
return globalThis.getPlatforma(
|
|
3981
|
+
function re(t) {
|
|
3982
|
+
if (t && typeof globalThis.getPlatforma == "function")
|
|
3983
|
+
return globalThis.getPlatforma(t);
|
|
3986
3984
|
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
3987
3985
|
throw new Error("Can't get platforma instance.");
|
|
3988
3986
|
}
|
|
3989
|
-
function
|
|
3987
|
+
function ve() {
|
|
3990
3988
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
3991
3989
|
}
|
|
3992
3990
|
function u() {
|
|
3993
3991
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
3994
3992
|
throw new Error("Not in config rendering context");
|
|
3995
3993
|
}
|
|
3996
|
-
function O(
|
|
3997
|
-
const n =
|
|
3994
|
+
function O(t, e) {
|
|
3995
|
+
const n = ve();
|
|
3998
3996
|
if (n === void 0) return false;
|
|
3999
|
-
if (
|
|
4000
|
-
return n.callbackRegistry[
|
|
3997
|
+
if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
|
|
3998
|
+
return n.callbackRegistry[t] = e, true;
|
|
4001
3999
|
}
|
|
4002
4000
|
const N = /* @__PURE__ */ new Map();
|
|
4003
|
-
function
|
|
4004
|
-
|
|
4005
|
-
for (const r2 of N.get(
|
|
4001
|
+
function we(t, e) {
|
|
4002
|
+
t in u().callbackRegistry || (u().callbackRegistry[t] = (n) => {
|
|
4003
|
+
for (const r2 of N.get(t))
|
|
4006
4004
|
r2(n);
|
|
4007
|
-
}, N.set(
|
|
4005
|
+
}, N.set(t, [])), N.get(t).push(e);
|
|
4008
4006
|
}
|
|
4009
4007
|
class g {
|
|
4010
|
-
constructor(
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
this.handle =
|
|
4008
|
+
constructor(e, n = (r2) => r2) {
|
|
4009
|
+
v(this, "isResolved", false);
|
|
4010
|
+
v(this, "resolvedValue");
|
|
4011
|
+
this.handle = e, this.postProcess = n, we(e, (r2) => {
|
|
4014
4012
|
this.resolvedValue = n(r2), this.isResolved = true;
|
|
4015
4013
|
});
|
|
4016
4014
|
}
|
|
4017
|
-
map(
|
|
4018
|
-
return new g(this.handle, (n) =>
|
|
4015
|
+
map(e) {
|
|
4016
|
+
return new g(this.handle, (n) => e(this.postProcess(n)));
|
|
4019
4017
|
}
|
|
4020
|
-
mapDefined(
|
|
4018
|
+
mapDefined(e) {
|
|
4021
4019
|
return new g(this.handle, (n) => {
|
|
4022
4020
|
const r2 = this.postProcess(n);
|
|
4023
|
-
return r2 ?
|
|
4021
|
+
return r2 ? e(r2) : void 0;
|
|
4024
4022
|
});
|
|
4025
4023
|
}
|
|
4026
4024
|
toJSON() {
|
|
4027
4025
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
4028
4026
|
}
|
|
4029
4027
|
}
|
|
4030
|
-
function X(
|
|
4031
|
-
return
|
|
4028
|
+
function X(t) {
|
|
4029
|
+
return t === void 0 ? void 0 : new S(t);
|
|
4032
4030
|
}
|
|
4033
|
-
class
|
|
4034
|
-
constructor(
|
|
4035
|
-
this.handle =
|
|
4031
|
+
class S {
|
|
4032
|
+
constructor(e) {
|
|
4033
|
+
this.handle = e;
|
|
4036
4034
|
}
|
|
4037
|
-
resolve(...
|
|
4038
|
-
const n =
|
|
4035
|
+
resolve(...e) {
|
|
4036
|
+
const n = e.map(
|
|
4039
4037
|
(r2) => ({
|
|
4040
4038
|
assertFieldType: "Input",
|
|
4041
4039
|
...typeof r2 == "string" ? { field: r2 } : r2
|
|
@@ -4043,8 +4041,8 @@
|
|
|
4043
4041
|
);
|
|
4044
4042
|
return this.resolveWithCommon({}, ...n);
|
|
4045
4043
|
}
|
|
4046
|
-
resolveOutput(...
|
|
4047
|
-
const n =
|
|
4044
|
+
resolveOutput(...e) {
|
|
4045
|
+
const n = e.map(
|
|
4048
4046
|
(r2) => ({
|
|
4049
4047
|
assertFieldType: "Output",
|
|
4050
4048
|
...typeof r2 == "string" ? { field: r2 } : r2
|
|
@@ -4052,8 +4050,8 @@
|
|
|
4052
4050
|
);
|
|
4053
4051
|
return this.resolveWithCommon({}, ...n);
|
|
4054
4052
|
}
|
|
4055
|
-
resolveInput(...
|
|
4056
|
-
const n =
|
|
4053
|
+
resolveInput(...e) {
|
|
4054
|
+
const n = e.map(
|
|
4057
4055
|
(r2) => ({
|
|
4058
4056
|
assertFieldType: "Input",
|
|
4059
4057
|
...typeof r2 == "string" ? { field: r2 } : r2
|
|
@@ -4061,11 +4059,11 @@
|
|
|
4061
4059
|
);
|
|
4062
4060
|
return this.resolveWithCommon({}, ...n);
|
|
4063
4061
|
}
|
|
4064
|
-
resolveAny(...
|
|
4065
|
-
return this.resolveWithCommon({}, ...
|
|
4062
|
+
resolveAny(...e) {
|
|
4063
|
+
return this.resolveWithCommon({}, ...e);
|
|
4066
4064
|
}
|
|
4067
|
-
resolveWithCommon(
|
|
4068
|
-
return X(u().resolveWithCommon(this.handle,
|
|
4065
|
+
resolveWithCommon(e, ...n) {
|
|
4066
|
+
return X(u().resolveWithCommon(this.handle, e, ...n));
|
|
4069
4067
|
}
|
|
4070
4068
|
get resourceType() {
|
|
4071
4069
|
return u().getResourceType(this.handle);
|
|
@@ -4094,14 +4092,14 @@
|
|
|
4094
4092
|
listDynamicFields() {
|
|
4095
4093
|
return u().listDynamicFields(this.handle);
|
|
4096
4094
|
}
|
|
4097
|
-
getKeyValueBase64(
|
|
4098
|
-
return u().getKeyValueBase64(this.handle,
|
|
4095
|
+
getKeyValueBase64(e) {
|
|
4096
|
+
return u().getKeyValueBase64(this.handle, e);
|
|
4099
4097
|
}
|
|
4100
|
-
getKeyValueAsString(
|
|
4101
|
-
return u().getKeyValueAsString(this.handle,
|
|
4098
|
+
getKeyValueAsString(e) {
|
|
4099
|
+
return u().getKeyValueAsString(this.handle, e);
|
|
4102
4100
|
}
|
|
4103
|
-
getKeyValueAsJson(
|
|
4104
|
-
const n = this.getKeyValueAsString(
|
|
4101
|
+
getKeyValueAsJson(e) {
|
|
4102
|
+
const n = this.getKeyValueAsString(e);
|
|
4105
4103
|
if (n == null) throw new Error("Resource has no content.");
|
|
4106
4104
|
return JSON.parse(n);
|
|
4107
4105
|
}
|
|
@@ -4112,33 +4110,33 @@
|
|
|
4112
4110
|
return u().getDataAsString(this.handle);
|
|
4113
4111
|
}
|
|
4114
4112
|
getDataAsJson() {
|
|
4115
|
-
const
|
|
4116
|
-
if (
|
|
4117
|
-
return JSON.parse(
|
|
4113
|
+
const e = this.getDataAsString();
|
|
4114
|
+
if (e == null) throw new Error("Resource has no content.");
|
|
4115
|
+
return JSON.parse(e);
|
|
4118
4116
|
}
|
|
4119
4117
|
/**
|
|
4120
4118
|
*
|
|
4121
4119
|
*/
|
|
4122
|
-
getPColumns(
|
|
4123
|
-
const r2 = this.parsePObjectCollection(
|
|
4120
|
+
getPColumns(e = false, n = "") {
|
|
4121
|
+
const r2 = this.parsePObjectCollection(e, n);
|
|
4124
4122
|
return r2 === void 0 ? void 0 : Object.entries(r2).map(([, i2]) => {
|
|
4125
|
-
if (!w
|
|
4123
|
+
if (!w(i2)) throw new Error(`not a PColumn (kind = ${i2.spec.kind})`);
|
|
4126
4124
|
return i2;
|
|
4127
4125
|
});
|
|
4128
4126
|
}
|
|
4129
4127
|
/**
|
|
4130
4128
|
*
|
|
4131
4129
|
*/
|
|
4132
|
-
parsePObjectCollection(
|
|
4130
|
+
parsePObjectCollection(e = false, n = "") {
|
|
4133
4131
|
const r2 = u().parsePObjectCollection(
|
|
4134
4132
|
this.handle,
|
|
4135
|
-
|
|
4133
|
+
e,
|
|
4136
4134
|
n
|
|
4137
4135
|
);
|
|
4138
4136
|
if (r2 === void 0) return;
|
|
4139
4137
|
const s = {};
|
|
4140
4138
|
for (const [i2, o] of Object.entries(r2))
|
|
4141
|
-
s[i2] =
|
|
4139
|
+
s[i2] = J(o, (a) => new S(a));
|
|
4142
4140
|
return s;
|
|
4143
4141
|
}
|
|
4144
4142
|
getFileContentAsBase64() {
|
|
@@ -4150,7 +4148,7 @@
|
|
|
4150
4148
|
getFileContentAsJson() {
|
|
4151
4149
|
return new g(
|
|
4152
4150
|
u().getBlobContentAsString(this.handle)
|
|
4153
|
-
).mapDefined((
|
|
4151
|
+
).mapDefined((e) => JSON.parse(e));
|
|
4154
4152
|
}
|
|
4155
4153
|
/**
|
|
4156
4154
|
* @deprecated use getFileContentAsBase64
|
|
@@ -4191,17 +4189,17 @@
|
|
|
4191
4189
|
getImportProgress() {
|
|
4192
4190
|
return new g(u().getImportProgress(this.handle));
|
|
4193
4191
|
}
|
|
4194
|
-
getLastLogs(
|
|
4195
|
-
return new g(u().getLastLogs(this.handle,
|
|
4192
|
+
getLastLogs(e) {
|
|
4193
|
+
return new g(u().getLastLogs(this.handle, e));
|
|
4196
4194
|
}
|
|
4197
|
-
getProgressLog(
|
|
4198
|
-
return new g(u().getProgressLog(this.handle,
|
|
4195
|
+
getProgressLog(e) {
|
|
4196
|
+
return new g(u().getProgressLog(this.handle, e));
|
|
4199
4197
|
}
|
|
4200
4198
|
getLogHandle() {
|
|
4201
4199
|
return new g(u().getLogHandle(this.handle));
|
|
4202
4200
|
}
|
|
4203
|
-
allFieldsResolved(
|
|
4204
|
-
switch (
|
|
4201
|
+
allFieldsResolved(e = "Input") {
|
|
4202
|
+
switch (e) {
|
|
4205
4203
|
case "Input":
|
|
4206
4204
|
return this.getInputsLocked() && this.listInputFields().every(
|
|
4207
4205
|
(n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
|
|
@@ -4212,13 +4210,13 @@
|
|
|
4212
4210
|
);
|
|
4213
4211
|
}
|
|
4214
4212
|
}
|
|
4215
|
-
mapFields(
|
|
4213
|
+
mapFields(e, n) {
|
|
4216
4214
|
const { fieldType: r2, requireLocked: s, skipUnresolved: i2 } = {
|
|
4217
4215
|
fieldType: "Input",
|
|
4218
4216
|
requireLocked: true,
|
|
4219
4217
|
skipUnresolved: false,
|
|
4220
4218
|
...n
|
|
4221
|
-
}, o =
|
|
4219
|
+
}, o = e;
|
|
4222
4220
|
if (s && (r2 === "Input" && !this.getInputsLocked() || r2 === "Output" && !this.getOutputsLocked()))
|
|
4223
4221
|
return;
|
|
4224
4222
|
let l = (r2 === "Input" ? this.listInputFields() : r2 === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
@@ -4227,41 +4225,44 @@
|
|
|
4227
4225
|
return i2 && (l = l.filter((c2) => c2[1] !== void 0)), l.map(([c2, f]) => o(c2, f));
|
|
4228
4226
|
}
|
|
4229
4227
|
}
|
|
4230
|
-
const
|
|
4231
|
-
const
|
|
4228
|
+
const se = "staging", ie = "main";
|
|
4229
|
+
const Ae = "pl7.app/label", Pe = "pl7.app/trace", Ie = z.object({
|
|
4232
4230
|
type: z.string(),
|
|
4233
4231
|
importance: z.number().optional(),
|
|
4234
4232
|
id: z.string().optional(),
|
|
4235
4233
|
label: z.string()
|
|
4236
|
-
}),
|
|
4237
|
-
function
|
|
4238
|
-
const r2 = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i2 =
|
|
4234
|
+
}), Ce = z.array(Ie), Re = 1e-3, Te = "__LABEL__", Q = "__LABEL__@1";
|
|
4235
|
+
function Fe(t, e, n = {}) {
|
|
4236
|
+
const r2 = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i2 = t.map((d) => {
|
|
4239
4237
|
var z2, Y;
|
|
4240
|
-
const m =
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4238
|
+
const m = e(d), y = (z2 = m.annotations) == null ? void 0 : z2[Ae], F = (Y = m.annotations) == null ? void 0 : Y[Pe], b = (F ? Ce.safeParse(JSON.parse(F)).data : void 0) ?? [];
|
|
4239
|
+
if (y) {
|
|
4240
|
+
const _ = { label: y, type: Te, importance: -2 };
|
|
4241
|
+
n.addLabelAsSuffix ? b.push(_) : b.splice(0, 0, _);
|
|
4242
|
+
}
|
|
4243
|
+
const E = [], q = /* @__PURE__ */ new Map();
|
|
4244
|
+
for (let _ = b.length - 1; _ >= 0; --_) {
|
|
4245
|
+
const { type: V } = b[_], ue = b[_].importance ?? 0, j = (q.get(V) ?? 0) + 1;
|
|
4246
|
+
q.set(V, j);
|
|
4247
|
+
const I = `${V}@${j}`;
|
|
4247
4248
|
s.set(I, (s.get(I) ?? 0) + 1), r2.set(
|
|
4248
4249
|
I,
|
|
4249
4250
|
Math.max(
|
|
4250
4251
|
r2.get(I) ?? Number.NEGATIVE_INFINITY,
|
|
4251
|
-
|
|
4252
|
+
ue - (b.length - _) * Re
|
|
4252
4253
|
)
|
|
4253
|
-
),
|
|
4254
|
+
), E.push({ ...b[_], fullType: I, occurenceIndex: j });
|
|
4254
4255
|
}
|
|
4255
|
-
return
|
|
4256
|
+
return E.reverse(), {
|
|
4256
4257
|
value: d,
|
|
4257
4258
|
spec: m,
|
|
4258
4259
|
label: y,
|
|
4259
|
-
fullTrace:
|
|
4260
|
+
fullTrace: E
|
|
4260
4261
|
};
|
|
4261
4262
|
}), o = [], a = [], l = [...r2];
|
|
4262
4263
|
l.sort(([, d], [, m]) => m - d);
|
|
4263
4264
|
for (const [d] of l)
|
|
4264
|
-
d.endsWith("@1") || s.get(d) ===
|
|
4265
|
+
d.endsWith("@1") || s.get(d) === t.length ? o.push(d) : a.push(d);
|
|
4265
4266
|
const c2 = (d) => i2.map((m) => {
|
|
4266
4267
|
const y = m.fullTrace.filter((b) => d.has(b.fullType)).map((b) => b.label), F = n.separator ?? " / ";
|
|
4267
4268
|
return {
|
|
@@ -4273,35 +4274,35 @@
|
|
|
4273
4274
|
if (a.length !== 0) throw new Error("Assertion error.");
|
|
4274
4275
|
return c2(new Set(Q));
|
|
4275
4276
|
}
|
|
4276
|
-
let f = 0,
|
|
4277
|
+
let f = 0, w2 = 0;
|
|
4277
4278
|
for (; f < o.length; ) {
|
|
4278
4279
|
const d = /* @__PURE__ */ new Set();
|
|
4280
|
+
n.includeNativeLabel && d.add(Q);
|
|
4279
4281
|
for (let y = 0; y < f; ++y) d.add(o[y]);
|
|
4280
|
-
d.add(o[
|
|
4282
|
+
d.add(o[w2]);
|
|
4281
4283
|
const m = c2(d);
|
|
4282
|
-
if (new Set(m.map((y) => y.label)).size ===
|
|
4283
|
-
|
|
4284
|
-
v++, v == o.length && (f++, v = f);
|
|
4284
|
+
if (new Set(m.map((y) => y.label)).size === t.length) return m;
|
|
4285
|
+
w2++, w2 == o.length && (f++, w2 = f);
|
|
4285
4286
|
}
|
|
4286
4287
|
return c2(/* @__PURE__ */ new Set([...o, ...a]));
|
|
4287
4288
|
}
|
|
4288
|
-
class
|
|
4289
|
+
class Oe {
|
|
4289
4290
|
constructor() {
|
|
4290
|
-
|
|
4291
|
-
|
|
4291
|
+
v(this, "ctx", u());
|
|
4292
|
+
v(this, "defaultLabelFn", (e, n) => {
|
|
4292
4293
|
var r2;
|
|
4293
|
-
return ((r2 =
|
|
4294
|
+
return ((r2 = e.annotations) == null ? void 0 : r2["pl7.app/label"]) ?? "Unlabelled";
|
|
4294
4295
|
});
|
|
4295
4296
|
}
|
|
4296
4297
|
/**
|
|
4297
4298
|
* @deprecated use getOptions()
|
|
4298
4299
|
*/
|
|
4299
|
-
calculateOptions(
|
|
4300
|
-
return this.ctx.calculateOptions(
|
|
4300
|
+
calculateOptions(e) {
|
|
4301
|
+
return this.ctx.calculateOptions(e);
|
|
4301
4302
|
}
|
|
4302
|
-
getOptions(
|
|
4303
|
-
const r2 = this.getSpecs().entries.filter((s) =>
|
|
4304
|
-
return typeof n == "object" || typeof n > "u" ?
|
|
4303
|
+
getOptions(e, n) {
|
|
4304
|
+
const r2 = this.getSpecs().entries.filter((s) => e(s.obj));
|
|
4305
|
+
return typeof n == "object" || typeof n > "u" ? Fe(r2, (s) => s.obj, n ?? {}).map(
|
|
4305
4306
|
({ value: { ref: s }, label: i2 }) => ({
|
|
4306
4307
|
ref: s,
|
|
4307
4308
|
label: i2
|
|
@@ -4318,14 +4319,14 @@
|
|
|
4318
4319
|
return this.getData();
|
|
4319
4320
|
}
|
|
4320
4321
|
getData() {
|
|
4321
|
-
const
|
|
4322
|
+
const e = this.ctx.getDataFromResultPool();
|
|
4322
4323
|
return {
|
|
4323
|
-
isComplete:
|
|
4324
|
-
entries:
|
|
4324
|
+
isComplete: e.isComplete,
|
|
4325
|
+
entries: e.entries.map((n) => ({
|
|
4325
4326
|
ref: n.ref,
|
|
4326
4327
|
obj: {
|
|
4327
4328
|
...n.obj,
|
|
4328
|
-
data: new
|
|
4329
|
+
data: new S(n.obj.data)
|
|
4329
4330
|
}
|
|
4330
4331
|
}))
|
|
4331
4332
|
};
|
|
@@ -4337,14 +4338,14 @@
|
|
|
4337
4338
|
return this.getDataWithErrors();
|
|
4338
4339
|
}
|
|
4339
4340
|
getDataWithErrors() {
|
|
4340
|
-
const
|
|
4341
|
+
const e = this.ctx.getDataWithErrorsFromResultPool();
|
|
4341
4342
|
return {
|
|
4342
|
-
isComplete:
|
|
4343
|
-
entries:
|
|
4343
|
+
isComplete: e.isComplete,
|
|
4344
|
+
entries: e.entries.map((n) => ({
|
|
4344
4345
|
ref: n.ref,
|
|
4345
4346
|
obj: {
|
|
4346
4347
|
...n.obj,
|
|
4347
|
-
data:
|
|
4348
|
+
data: W(n.obj.data, (r2) => new S(r2))
|
|
4348
4349
|
}
|
|
4349
4350
|
}))
|
|
4350
4351
|
};
|
|
@@ -4362,13 +4363,13 @@
|
|
|
4362
4363
|
* @param ref a Ref
|
|
4363
4364
|
* @returns data associated with the ref
|
|
4364
4365
|
*/
|
|
4365
|
-
getDataByRef(
|
|
4366
|
+
getDataByRef(e) {
|
|
4366
4367
|
var n;
|
|
4367
4368
|
return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
|
|
4368
|
-
(r2) => r2.ref.blockId ===
|
|
4369
|
-
)) == null ? void 0 : n.obj :
|
|
4370
|
-
this.ctx.getDataFromResultPoolByRef(
|
|
4371
|
-
(r2) => new
|
|
4369
|
+
(r2) => r2.ref.blockId === e.blockId && r2.ref.name === e.name
|
|
4370
|
+
)) == null ? void 0 : n.obj : J(
|
|
4371
|
+
this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
|
|
4372
|
+
(r2) => new S(r2)
|
|
4372
4373
|
);
|
|
4373
4374
|
}
|
|
4374
4375
|
/**
|
|
@@ -4376,37 +4377,37 @@
|
|
|
4376
4377
|
* @param ref a Ref
|
|
4377
4378
|
* @returns p-column associated with the ref
|
|
4378
4379
|
*/
|
|
4379
|
-
getPColumnByRef(
|
|
4380
|
-
const n = this.getDataByRef(
|
|
4380
|
+
getPColumnByRef(e) {
|
|
4381
|
+
const n = this.getDataByRef(e);
|
|
4381
4382
|
if (n)
|
|
4382
|
-
return
|
|
4383
|
+
return O$1(n);
|
|
4383
4384
|
}
|
|
4384
4385
|
/**
|
|
4385
4386
|
* @param ref a Ref
|
|
4386
4387
|
* @returns object spec associated with the ref
|
|
4387
4388
|
*/
|
|
4388
|
-
getSpecByRef(
|
|
4389
|
+
getSpecByRef(e) {
|
|
4389
4390
|
var n;
|
|
4390
4391
|
return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
|
|
4391
|
-
(r2) => r2.ref.blockId ===
|
|
4392
|
-
)) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(
|
|
4392
|
+
(r2) => r2.ref.blockId === e.blockId && r2.ref.name === e.name
|
|
4393
|
+
)) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
|
|
4393
4394
|
}
|
|
4394
4395
|
/**
|
|
4395
4396
|
* @param spec object specification
|
|
4396
4397
|
* @returns array of data objects with compatible specs
|
|
4397
4398
|
* @deprecated delete this method after Jan 1, 2025
|
|
4398
4399
|
*/
|
|
4399
|
-
findDataWithCompatibleSpec(
|
|
4400
|
+
findDataWithCompatibleSpec(e) {
|
|
4400
4401
|
const n = [];
|
|
4401
|
-
|
|
4402
|
+
e: for (const r$1 of this.getData().entries) {
|
|
4402
4403
|
if (!r(r$1.obj.spec))
|
|
4403
4404
|
continue;
|
|
4404
4405
|
const s = r$1.obj.spec;
|
|
4405
|
-
if (
|
|
4406
|
-
for (let i2 = 0; i2 <
|
|
4407
|
-
const o =
|
|
4406
|
+
if (e.name === s.name && e.valueType === s.valueType && e.axesSpec.length === s.axesSpec.length && K(e.domain, s.domain)) {
|
|
4407
|
+
for (let i2 = 0; i2 < e.axesSpec.length; ++i2) {
|
|
4408
|
+
const o = e.axesSpec[i2], a = s.axesSpec[i2];
|
|
4408
4409
|
if (o.name !== a.name || o.type !== a.type || !K(o.domain, a.domain))
|
|
4409
|
-
continue
|
|
4410
|
+
continue e;
|
|
4410
4411
|
}
|
|
4411
4412
|
n.push(r$1.obj);
|
|
4412
4413
|
}
|
|
@@ -4414,27 +4415,27 @@
|
|
|
4414
4415
|
return n;
|
|
4415
4416
|
}
|
|
4416
4417
|
}
|
|
4417
|
-
function K(
|
|
4418
|
-
if (
|
|
4419
|
-
if (
|
|
4420
|
-
for (const n in
|
|
4421
|
-
if (
|
|
4418
|
+
function K(t, e) {
|
|
4419
|
+
if (t === void 0) return e === void 0;
|
|
4420
|
+
if (e === void 0) return true;
|
|
4421
|
+
for (const n in e)
|
|
4422
|
+
if (t[n] !== e[n]) return false;
|
|
4422
4423
|
return true;
|
|
4423
4424
|
}
|
|
4424
4425
|
class D {
|
|
4425
4426
|
constructor() {
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4427
|
+
v(this, "ctx");
|
|
4428
|
+
v(this, "args");
|
|
4429
|
+
v(this, "uiState");
|
|
4430
|
+
v(this, "resultPool", new Oe());
|
|
4430
4431
|
this.ctx = u(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
|
|
4431
4432
|
}
|
|
4432
|
-
getNamedAccessor(
|
|
4433
|
-
const n = this.ctx.getAccessorHandleByName(
|
|
4434
|
-
return n ? new
|
|
4433
|
+
getNamedAccessor(e) {
|
|
4434
|
+
const n = this.ctx.getAccessorHandleByName(e);
|
|
4435
|
+
return n ? new S(n) : void 0;
|
|
4435
4436
|
}
|
|
4436
4437
|
get prerun() {
|
|
4437
|
-
return this.getNamedAccessor(
|
|
4438
|
+
return this.getNamedAccessor(se);
|
|
4438
4439
|
}
|
|
4439
4440
|
/**
|
|
4440
4441
|
* @deprecated use prerun
|
|
@@ -4449,7 +4450,7 @@
|
|
|
4449
4450
|
return this.precalc;
|
|
4450
4451
|
}
|
|
4451
4452
|
get outputs() {
|
|
4452
|
-
return this.getNamedAccessor(
|
|
4453
|
+
return this.getNamedAccessor(ie);
|
|
4453
4454
|
}
|
|
4454
4455
|
/**
|
|
4455
4456
|
* @deprecated use outputs
|
|
@@ -4461,12 +4462,12 @@
|
|
|
4461
4462
|
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
4462
4463
|
* @returns a map of axis value => label
|
|
4463
4464
|
*/
|
|
4464
|
-
findLabels(
|
|
4465
|
+
findLabels(e) {
|
|
4465
4466
|
const n = this.resultPool.getData();
|
|
4466
4467
|
for (const r2 of n.entries) {
|
|
4467
|
-
if (!w
|
|
4468
|
+
if (!w(r2.obj)) continue;
|
|
4468
4469
|
const s = r2.obj.spec;
|
|
4469
|
-
if (s.name === "pl7.app/label" && s.axesSpec.length === 1 && s.axesSpec[0].name ===
|
|
4470
|
+
if (s.name === "pl7.app/label" && s.axesSpec.length === 1 && s.axesSpec[0].name === e.name && s.axesSpec[0].type === e.type && K(e.domain, s.axesSpec[0].domain)) {
|
|
4470
4471
|
if (r2.obj.data.resourceType.name !== "PColumnData/Json")
|
|
4471
4472
|
throw Error(`Expected JSON column for labels, got: ${r2.obj.data.resourceType.name}`);
|
|
4472
4473
|
return new Map(
|
|
@@ -4477,44 +4478,44 @@
|
|
|
4477
4478
|
}
|
|
4478
4479
|
}
|
|
4479
4480
|
}
|
|
4480
|
-
createPFrame(
|
|
4481
|
-
return this.ctx.createPFrame(
|
|
4481
|
+
createPFrame(e) {
|
|
4482
|
+
return this.ctx.createPFrame(e.map((n) => J(n, (r2) => r2.handle)));
|
|
4482
4483
|
}
|
|
4483
|
-
createPTable(
|
|
4484
|
+
createPTable(e) {
|
|
4484
4485
|
var n;
|
|
4485
|
-
return "columns" in
|
|
4486
|
+
return "columns" in e ? n = {
|
|
4486
4487
|
src: {
|
|
4487
4488
|
type: "full",
|
|
4488
|
-
entries:
|
|
4489
|
+
entries: e.columns.map((r2) => ({ type: "column", column: r2 }))
|
|
4489
4490
|
},
|
|
4490
|
-
filters:
|
|
4491
|
-
sorting:
|
|
4492
|
-
} : n =
|
|
4491
|
+
filters: e.filters ?? [],
|
|
4492
|
+
sorting: e.sorting ?? []
|
|
4493
|
+
} : n = e, this.ctx.createPTable(D$1(n, (r2) => J(r2, (s) => s.handle)));
|
|
4493
4494
|
}
|
|
4494
4495
|
/** @deprecated scheduled for removal from SDK */
|
|
4495
|
-
getBlockLabel(
|
|
4496
|
-
return this.ctx.getBlockLabel(
|
|
4496
|
+
getBlockLabel(e) {
|
|
4497
|
+
return this.ctx.getBlockLabel(e);
|
|
4497
4498
|
}
|
|
4498
4499
|
getCurrentUnstableMarker() {
|
|
4499
4500
|
if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
|
|
4500
4501
|
return this.ctx.getCurrentUnstableMarker();
|
|
4501
4502
|
}
|
|
4502
4503
|
}
|
|
4503
|
-
const C = "1.13.
|
|
4504
|
-
function
|
|
4505
|
-
return
|
|
4504
|
+
const C = "1.13.15";
|
|
4505
|
+
function ke(t) {
|
|
4506
|
+
return t.__renderLambda === true;
|
|
4506
4507
|
}
|
|
4507
|
-
function U(
|
|
4508
|
-
if (
|
|
4509
|
-
return
|
|
4508
|
+
function U(t) {
|
|
4509
|
+
if (t !== void 0)
|
|
4510
|
+
return ke(t) ? t.handle : t;
|
|
4510
4511
|
}
|
|
4511
4512
|
class h {
|
|
4512
|
-
constructor(
|
|
4513
|
-
this._renderingMode =
|
|
4513
|
+
constructor(e, n, r2, s, i2, o, a) {
|
|
4514
|
+
this._renderingMode = e, this._initialArgs = n, this._initialUiState = r2, this._outputs = s, this._inputsValid = i2, this._sections = o, this._title = a;
|
|
4514
4515
|
}
|
|
4515
|
-
static create(
|
|
4516
|
+
static create(e = "Heavy") {
|
|
4516
4517
|
return new h(
|
|
4517
|
-
|
|
4518
|
+
e,
|
|
4518
4519
|
void 0,
|
|
4519
4520
|
{},
|
|
4520
4521
|
{},
|
|
@@ -4523,16 +4524,16 @@
|
|
|
4523
4524
|
void 0
|
|
4524
4525
|
);
|
|
4525
4526
|
}
|
|
4526
|
-
output(
|
|
4527
|
+
output(e, n, r2 = {}) {
|
|
4527
4528
|
if (typeof n == "function") {
|
|
4528
|
-
const s = `output#${
|
|
4529
|
+
const s = `output#${e}`;
|
|
4529
4530
|
return O(s, () => n(new D())), new h(
|
|
4530
4531
|
this._renderingMode,
|
|
4531
4532
|
this._initialArgs,
|
|
4532
4533
|
this._initialUiState,
|
|
4533
4534
|
{
|
|
4534
4535
|
...this._outputs,
|
|
4535
|
-
[
|
|
4536
|
+
[e]: {
|
|
4536
4537
|
__renderLambda: true,
|
|
4537
4538
|
handle: s,
|
|
4538
4539
|
...r2
|
|
@@ -4549,7 +4550,7 @@
|
|
|
4549
4550
|
this._initialUiState,
|
|
4550
4551
|
{
|
|
4551
4552
|
...this._outputs,
|
|
4552
|
-
[
|
|
4553
|
+
[e]: n
|
|
4553
4554
|
},
|
|
4554
4555
|
this._inputsValid,
|
|
4555
4556
|
this._sections,
|
|
@@ -4557,15 +4558,15 @@
|
|
|
4557
4558
|
);
|
|
4558
4559
|
}
|
|
4559
4560
|
/** Shortcut for {@link output} with retentive flag set to true. */
|
|
4560
|
-
retentiveOutput(
|
|
4561
|
-
return this.output(
|
|
4561
|
+
retentiveOutput(e, n) {
|
|
4562
|
+
return this.output(e, n, { retentive: true });
|
|
4562
4563
|
}
|
|
4563
4564
|
/** @deprecated */
|
|
4564
|
-
canRun(
|
|
4565
|
-
return this.inputsValid(
|
|
4565
|
+
canRun(e) {
|
|
4566
|
+
return this.inputsValid(e);
|
|
4566
4567
|
}
|
|
4567
|
-
argsValid(
|
|
4568
|
-
return typeof
|
|
4568
|
+
argsValid(e) {
|
|
4569
|
+
return typeof e == "function" ? (O("inputsValid", () => e(new D())), new h(
|
|
4569
4570
|
this._renderingMode,
|
|
4570
4571
|
this._initialArgs,
|
|
4571
4572
|
this._initialUiState,
|
|
@@ -4581,16 +4582,16 @@
|
|
|
4581
4582
|
this._initialArgs,
|
|
4582
4583
|
this._initialUiState,
|
|
4583
4584
|
this._outputs,
|
|
4584
|
-
|
|
4585
|
+
e,
|
|
4585
4586
|
this._sections,
|
|
4586
4587
|
this._title
|
|
4587
4588
|
);
|
|
4588
4589
|
}
|
|
4589
|
-
inputsValid(
|
|
4590
|
-
return this.argsValid(
|
|
4590
|
+
inputsValid(e) {
|
|
4591
|
+
return this.argsValid(e);
|
|
4591
4592
|
}
|
|
4592
|
-
sections(
|
|
4593
|
-
return Array.isArray(
|
|
4593
|
+
sections(e) {
|
|
4594
|
+
return Array.isArray(e) ? this.sections(k(e)) : typeof e == "function" ? (O("sections", () => e(new D())), new h(
|
|
4594
4595
|
this._renderingMode,
|
|
4595
4596
|
this._initialArgs,
|
|
4596
4597
|
this._initialUiState,
|
|
@@ -4604,12 +4605,12 @@
|
|
|
4604
4605
|
this._initialUiState,
|
|
4605
4606
|
this._outputs,
|
|
4606
4607
|
this._inputsValid,
|
|
4607
|
-
|
|
4608
|
+
e,
|
|
4608
4609
|
this._title
|
|
4609
4610
|
);
|
|
4610
4611
|
}
|
|
4611
|
-
title(
|
|
4612
|
-
return O("title", () =>
|
|
4612
|
+
title(e) {
|
|
4613
|
+
return O("title", () => e(new D())), new h(
|
|
4613
4614
|
this._renderingMode,
|
|
4614
4615
|
this._initialArgs,
|
|
4615
4616
|
this._initialUiState,
|
|
@@ -4623,10 +4624,10 @@
|
|
|
4623
4624
|
* Sets initial args for the block, this value must be specified.
|
|
4624
4625
|
* @deprecated use {@link withArgs}
|
|
4625
4626
|
* */
|
|
4626
|
-
initialArgs(
|
|
4627
|
+
initialArgs(e) {
|
|
4627
4628
|
return new h(
|
|
4628
4629
|
this._renderingMode,
|
|
4629
|
-
|
|
4630
|
+
e,
|
|
4630
4631
|
this._initialUiState,
|
|
4631
4632
|
this._outputs,
|
|
4632
4633
|
this._inputsValid,
|
|
@@ -4635,10 +4636,10 @@
|
|
|
4635
4636
|
);
|
|
4636
4637
|
}
|
|
4637
4638
|
/** Sets initial args for the block, this value must be specified. */
|
|
4638
|
-
withArgs(
|
|
4639
|
+
withArgs(e) {
|
|
4639
4640
|
return new h(
|
|
4640
4641
|
this._renderingMode,
|
|
4641
|
-
|
|
4642
|
+
e,
|
|
4642
4643
|
this._initialUiState,
|
|
4643
4644
|
this._outputs,
|
|
4644
4645
|
this._inputsValid,
|
|
@@ -4647,11 +4648,11 @@
|
|
|
4647
4648
|
);
|
|
4648
4649
|
}
|
|
4649
4650
|
/** Defines type and sets initial value for block UiState. */
|
|
4650
|
-
withUiState(
|
|
4651
|
+
withUiState(e) {
|
|
4651
4652
|
return new h(
|
|
4652
4653
|
this._renderingMode,
|
|
4653
4654
|
this._initialArgs,
|
|
4654
|
-
|
|
4655
|
+
e,
|
|
4655
4656
|
this._outputs,
|
|
4656
4657
|
this._inputsValid,
|
|
4657
4658
|
this._sections,
|
|
@@ -4663,7 +4664,7 @@
|
|
|
4663
4664
|
* other features provided by the platforma to the block. */
|
|
4664
4665
|
done() {
|
|
4665
4666
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
4666
|
-
const
|
|
4667
|
+
const e = {
|
|
4667
4668
|
v3: {
|
|
4668
4669
|
sdkVersion: C,
|
|
4669
4670
|
renderingMode: this._renderingMode,
|
|
@@ -4684,7 +4685,7 @@
|
|
|
4684
4685
|
Object.entries(this._outputs).map(([n, r2]) => [n, U(r2)])
|
|
4685
4686
|
)
|
|
4686
4687
|
};
|
|
4687
|
-
return
|
|
4688
|
+
return _e() ? re({ sdkVersion: C }) : { config: e };
|
|
4688
4689
|
}
|
|
4689
4690
|
}
|
|
4690
4691
|
const $BlockArgs = z.object({
|
|
@@ -4697,30 +4698,30 @@
|
|
|
4697
4698
|
const collection = ctx.resultPool.getData();
|
|
4698
4699
|
if (collection === void 0 || !collection.isComplete) return void 0;
|
|
4699
4700
|
const valueTypes = ["Int", "Long", "Float", "Double", "String", "Bytes"];
|
|
4700
|
-
const columns = collection.entries.map(({ obj }) => obj).filter(w
|
|
4701
|
+
const columns = collection.entries.map(({ obj }) => obj).filter(w).filter((column) => valueTypes.find((valueType) => valueType === column.spec.valueType));
|
|
4701
4702
|
try {
|
|
4702
4703
|
return ctx.createPFrame(columns);
|
|
4703
4704
|
} catch (err) {
|
|
4704
4705
|
return void 0;
|
|
4705
4706
|
}
|
|
4706
4707
|
}).output("pTable", (ctx) => {
|
|
4707
|
-
var _a, _b, _c, _d,
|
|
4708
|
+
var _a, _b, _c, _d, _e2, _f, _g;
|
|
4708
4709
|
const join = (_c = (_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.tableState.pTableParams) == null ? void 0 : _c.join;
|
|
4709
4710
|
if (!join) return void 0;
|
|
4710
4711
|
const collection = ctx.resultPool.getData();
|
|
4711
4712
|
if (!collection || !collection.isComplete) return void 0;
|
|
4712
|
-
const columns = collection.entries.map(({ obj }) => obj).filter(w
|
|
4713
|
+
const columns = collection.entries.map(({ obj }) => obj).filter(w);
|
|
4713
4714
|
if (columns.length === 0) return void 0;
|
|
4714
4715
|
let columnMissing = false;
|
|
4715
4716
|
const src = i(join, (idAndSpec) => {
|
|
4716
|
-
const column = columns.find((
|
|
4717
|
+
const column = columns.find((it) => it.id === idAndSpec.columnId);
|
|
4717
4718
|
if (!column) columnMissing = true;
|
|
4718
4719
|
return column;
|
|
4719
4720
|
});
|
|
4720
4721
|
if (columnMissing) return void 0;
|
|
4721
4722
|
return ctx.createPTable({
|
|
4722
4723
|
src,
|
|
4723
|
-
filters: ((
|
|
4724
|
+
filters: ((_e2 = (_d = ctx.uiState.dataTableState) == null ? void 0 : _d.tableState.pTableParams) == null ? void 0 : _e2.filters) ?? [],
|
|
4724
4725
|
sorting: ((_g = (_f = ctx.uiState.dataTableState) == null ? void 0 : _f.tableState.pTableParams) == null ? void 0 : _g.sorting) ?? []
|
|
4725
4726
|
});
|
|
4726
4727
|
}).sections((ctx) => {
|