@milaboratories/milaboratories.ui-examples.model 1.1.14 → 1.1.15
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 +9 -9
- package/CHANGELOG.md +8 -0
- package/dist/bundle.js +208 -202
- package/dist/bundle.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +3 -3
package/dist/bundle.js
CHANGED
|
@@ -3917,7 +3917,7 @@
|
|
|
3917
3917
|
function b$1(t) {
|
|
3918
3918
|
throw new Error("Unexpected object: " + t);
|
|
3919
3919
|
}
|
|
3920
|
-
function J(t) {
|
|
3920
|
+
function J$1(t) {
|
|
3921
3921
|
const { type: n, name: e, domain: r } = t;
|
|
3922
3922
|
return { type: n, name: e, ...r && { domain: r } };
|
|
3923
3923
|
}
|
|
@@ -4006,17 +4006,17 @@
|
|
|
4006
4006
|
const Q = 24;
|
|
4007
4007
|
z.string().length(Q).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
|
|
4008
4008
|
var fe = Object.defineProperty;
|
|
4009
|
-
var he = (
|
|
4010
|
-
var S = (
|
|
4011
|
-
function V(
|
|
4012
|
-
return { type: "Immediate", value:
|
|
4009
|
+
var he = (t, e, n) => e in t ? fe(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
|
|
4010
|
+
var S = (t, e, n) => he(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4011
|
+
function V(t) {
|
|
4012
|
+
return { type: "Immediate", value: t };
|
|
4013
4013
|
}
|
|
4014
4014
|
function Se() {
|
|
4015
4015
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
4016
4016
|
}
|
|
4017
|
-
function oe(
|
|
4018
|
-
if (
|
|
4019
|
-
return globalThis.getPlatforma(
|
|
4017
|
+
function oe(t) {
|
|
4018
|
+
if (t && typeof globalThis.getPlatforma == "function")
|
|
4019
|
+
return globalThis.getPlatforma(t);
|
|
4020
4020
|
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
4021
4021
|
throw new Error("Can't get platforma instance.");
|
|
4022
4022
|
}
|
|
@@ -4027,33 +4027,33 @@
|
|
|
4027
4027
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
4028
4028
|
throw new Error("Not in config rendering context");
|
|
4029
4029
|
}
|
|
4030
|
-
function
|
|
4031
|
-
const
|
|
4032
|
-
if (
|
|
4033
|
-
if (
|
|
4034
|
-
return
|
|
4030
|
+
function L(t, e) {
|
|
4031
|
+
const n = we();
|
|
4032
|
+
if (n === void 0) return false;
|
|
4033
|
+
if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
|
|
4034
|
+
return n.callbackRegistry[t] = e, true;
|
|
4035
4035
|
}
|
|
4036
|
-
const
|
|
4037
|
-
function
|
|
4038
|
-
|
|
4039
|
-
for (const r of
|
|
4040
|
-
r(
|
|
4041
|
-
},
|
|
4036
|
+
const J = /* @__PURE__ */ new Map();
|
|
4037
|
+
function Ae(t, e) {
|
|
4038
|
+
t in c().callbackRegistry || (c().callbackRegistry[t] = (n) => {
|
|
4039
|
+
for (const r of J.get(t))
|
|
4040
|
+
r(n);
|
|
4041
|
+
}, J.set(t, [])), J.get(t).push(e);
|
|
4042
4042
|
}
|
|
4043
|
-
class
|
|
4044
|
-
constructor(e,
|
|
4043
|
+
class b {
|
|
4044
|
+
constructor(e, n = (r) => r) {
|
|
4045
4045
|
S(this, "isResolved", false);
|
|
4046
4046
|
S(this, "resolvedValue");
|
|
4047
|
-
this.handle = e, this.postProcess =
|
|
4048
|
-
this.resolvedValue =
|
|
4047
|
+
this.handle = e, this.postProcess = n, Ae(e, (r) => {
|
|
4048
|
+
this.resolvedValue = n(r), this.isResolved = true;
|
|
4049
4049
|
});
|
|
4050
4050
|
}
|
|
4051
4051
|
map(e) {
|
|
4052
|
-
return new
|
|
4052
|
+
return new b(this.handle, (n) => e(this.postProcess(n)));
|
|
4053
4053
|
}
|
|
4054
4054
|
mapDefined(e) {
|
|
4055
|
-
return new
|
|
4056
|
-
const r = this.postProcess(
|
|
4055
|
+
return new b(this.handle, (n) => {
|
|
4056
|
+
const r = this.postProcess(n);
|
|
4057
4057
|
return r ? e(r) : void 0;
|
|
4058
4058
|
});
|
|
4059
4059
|
}
|
|
@@ -4061,51 +4061,51 @@
|
|
|
4061
4061
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
4062
4062
|
}
|
|
4063
4063
|
}
|
|
4064
|
-
function H(
|
|
4065
|
-
return
|
|
4064
|
+
function H(t, e) {
|
|
4065
|
+
return t === void 0 ? void 0 : e(t);
|
|
4066
4066
|
}
|
|
4067
|
-
class
|
|
4068
|
-
constructor(e,
|
|
4069
|
-
this.handle = e, this.resolvePath =
|
|
4067
|
+
class v {
|
|
4068
|
+
constructor(e, n) {
|
|
4069
|
+
this.handle = e, this.resolvePath = n;
|
|
4070
4070
|
}
|
|
4071
4071
|
resolve(...e) {
|
|
4072
|
-
const
|
|
4072
|
+
const n = e.map(
|
|
4073
4073
|
(r) => ({
|
|
4074
4074
|
assertFieldType: "Input",
|
|
4075
4075
|
...typeof r == "string" ? { field: r } : r
|
|
4076
4076
|
})
|
|
4077
4077
|
);
|
|
4078
|
-
return this.resolveWithCommon({}, ...
|
|
4078
|
+
return this.resolveWithCommon({}, ...n);
|
|
4079
4079
|
}
|
|
4080
4080
|
resolveOutput(...e) {
|
|
4081
|
-
const
|
|
4081
|
+
const n = e.map(
|
|
4082
4082
|
(r) => ({
|
|
4083
4083
|
assertFieldType: "Output",
|
|
4084
4084
|
...typeof r == "string" ? { field: r } : r
|
|
4085
4085
|
})
|
|
4086
4086
|
);
|
|
4087
|
-
return this.resolveWithCommon({}, ...
|
|
4087
|
+
return this.resolveWithCommon({}, ...n);
|
|
4088
4088
|
}
|
|
4089
4089
|
resolveInput(...e) {
|
|
4090
|
-
const
|
|
4090
|
+
const n = e.map(
|
|
4091
4091
|
(r) => ({
|
|
4092
4092
|
assertFieldType: "Input",
|
|
4093
4093
|
...typeof r == "string" ? { field: r } : r
|
|
4094
4094
|
})
|
|
4095
4095
|
);
|
|
4096
|
-
return this.resolveWithCommon({}, ...
|
|
4096
|
+
return this.resolveWithCommon({}, ...n);
|
|
4097
4097
|
}
|
|
4098
4098
|
resolveAny(...e) {
|
|
4099
4099
|
return this.resolveWithCommon({}, ...e);
|
|
4100
4100
|
}
|
|
4101
|
-
resolveWithCommon(e, ...
|
|
4101
|
+
resolveWithCommon(e, ...n) {
|
|
4102
4102
|
const r = [
|
|
4103
4103
|
...this.resolvePath,
|
|
4104
|
-
...
|
|
4104
|
+
...n.map((i2) => typeof i2 == "string" ? i2 : i2.field)
|
|
4105
4105
|
];
|
|
4106
4106
|
return H(
|
|
4107
|
-
c().resolveWithCommon(this.handle, e, ...
|
|
4108
|
-
(
|
|
4107
|
+
c().resolveWithCommon(this.handle, e, ...n),
|
|
4108
|
+
(i2) => new v(i2, r)
|
|
4109
4109
|
);
|
|
4110
4110
|
}
|
|
4111
4111
|
get resourceType() {
|
|
@@ -4127,7 +4127,7 @@
|
|
|
4127
4127
|
const e = [...this.resolvePath, "error"];
|
|
4128
4128
|
return H(
|
|
4129
4129
|
c().getError(this.handle),
|
|
4130
|
-
(
|
|
4130
|
+
(n) => new v(n, e)
|
|
4131
4131
|
);
|
|
4132
4132
|
}
|
|
4133
4133
|
listInputFields() {
|
|
@@ -4146,9 +4146,9 @@
|
|
|
4146
4146
|
return c().getKeyValueAsString(this.handle, e);
|
|
4147
4147
|
}
|
|
4148
4148
|
getKeyValueAsJson(e) {
|
|
4149
|
-
const
|
|
4150
|
-
if (
|
|
4151
|
-
return JSON.parse(
|
|
4149
|
+
const n = this.getKeyValueAsString(e);
|
|
4150
|
+
if (n == null) throw new Error("Resource has no content.");
|
|
4151
|
+
return JSON.parse(n);
|
|
4152
4152
|
}
|
|
4153
4153
|
getDataBase64() {
|
|
4154
4154
|
return c().getDataBase64(this.handle);
|
|
@@ -4164,39 +4164,39 @@
|
|
|
4164
4164
|
/**
|
|
4165
4165
|
*
|
|
4166
4166
|
*/
|
|
4167
|
-
getPColumns(e = false,
|
|
4168
|
-
const r = this.parsePObjectCollection(e,
|
|
4169
|
-
return r === void 0 ? void 0 : Object.entries(r).map(([,
|
|
4170
|
-
if (!W(
|
|
4171
|
-
return
|
|
4167
|
+
getPColumns(e = false, n = "") {
|
|
4168
|
+
const r = this.parsePObjectCollection(e, n);
|
|
4169
|
+
return r === void 0 ? void 0 : Object.entries(r).map(([, s]) => {
|
|
4170
|
+
if (!W(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
|
|
4171
|
+
return s;
|
|
4172
4172
|
});
|
|
4173
4173
|
}
|
|
4174
4174
|
/**
|
|
4175
4175
|
*
|
|
4176
4176
|
*/
|
|
4177
|
-
parsePObjectCollection(e = false,
|
|
4177
|
+
parsePObjectCollection(e = false, n = "") {
|
|
4178
4178
|
const r = c().parsePObjectCollection(
|
|
4179
4179
|
this.handle,
|
|
4180
4180
|
e,
|
|
4181
|
-
|
|
4181
|
+
n,
|
|
4182
4182
|
...this.resolvePath
|
|
4183
4183
|
);
|
|
4184
4184
|
if (r === void 0) return;
|
|
4185
|
-
const
|
|
4186
|
-
for (const [
|
|
4187
|
-
const l = [...this.resolvePath,
|
|
4188
|
-
s
|
|
4185
|
+
const i2 = {};
|
|
4186
|
+
for (const [s, o] of Object.entries(r)) {
|
|
4187
|
+
const l = [...this.resolvePath, s];
|
|
4188
|
+
i2[s] = lt(o, (a) => new v(a, l));
|
|
4189
4189
|
}
|
|
4190
|
-
return
|
|
4190
|
+
return i2;
|
|
4191
4191
|
}
|
|
4192
4192
|
getFileContentAsBase64() {
|
|
4193
|
-
return new
|
|
4193
|
+
return new b(c().getBlobContentAsBase64(this.handle));
|
|
4194
4194
|
}
|
|
4195
4195
|
getFileContentAsString() {
|
|
4196
|
-
return new
|
|
4196
|
+
return new b(c().getBlobContentAsString(this.handle));
|
|
4197
4197
|
}
|
|
4198
4198
|
getFileContentAsJson() {
|
|
4199
|
-
return new
|
|
4199
|
+
return new b(
|
|
4200
4200
|
c().getBlobContentAsString(this.handle)
|
|
4201
4201
|
).mapDefined((e) => JSON.parse(e));
|
|
4202
4202
|
}
|
|
@@ -4216,7 +4216,7 @@
|
|
|
4216
4216
|
* @returns downloaded file handle
|
|
4217
4217
|
*/
|
|
4218
4218
|
getFileHandle() {
|
|
4219
|
-
return new
|
|
4219
|
+
return new b(c().getDownloadedBlobContentHandle(this.handle));
|
|
4220
4220
|
}
|
|
4221
4221
|
/**
|
|
4222
4222
|
* @deprecated use getFileHandle
|
|
@@ -4228,7 +4228,7 @@
|
|
|
4228
4228
|
* @returns downloaded file handle
|
|
4229
4229
|
*/
|
|
4230
4230
|
getRemoteFileHandle() {
|
|
4231
|
-
return new
|
|
4231
|
+
return new b(c().getOnDemandBlobContentHandle(this.handle));
|
|
4232
4232
|
}
|
|
4233
4233
|
/**
|
|
4234
4234
|
* @deprecated use getRemoteFileHandle
|
|
@@ -4236,72 +4236,78 @@
|
|
|
4236
4236
|
getOnDemandBlobHandle() {
|
|
4237
4237
|
return this.getRemoteFileHandle();
|
|
4238
4238
|
}
|
|
4239
|
+
/**
|
|
4240
|
+
* @returns the url to the extracted folder
|
|
4241
|
+
*/
|
|
4242
|
+
extractArchiveAndGetURL(e) {
|
|
4243
|
+
return new b(c().extractArchiveAndGetURL(this.handle, e));
|
|
4244
|
+
}
|
|
4239
4245
|
getImportProgress() {
|
|
4240
|
-
return new
|
|
4246
|
+
return new b(c().getImportProgress(this.handle));
|
|
4241
4247
|
}
|
|
4242
4248
|
getLastLogs(e) {
|
|
4243
|
-
return new
|
|
4249
|
+
return new b(c().getLastLogs(this.handle, e));
|
|
4244
4250
|
}
|
|
4245
4251
|
getProgressLog(e) {
|
|
4246
|
-
return new
|
|
4252
|
+
return new b(c().getProgressLog(this.handle, e));
|
|
4247
4253
|
}
|
|
4248
4254
|
getLogHandle() {
|
|
4249
|
-
return new
|
|
4255
|
+
return new b(c().getLogHandle(this.handle));
|
|
4250
4256
|
}
|
|
4251
4257
|
allFieldsResolved(e = "Input") {
|
|
4252
4258
|
switch (e) {
|
|
4253
4259
|
case "Input":
|
|
4254
4260
|
return this.getInputsLocked() && this.listInputFields().every(
|
|
4255
|
-
(
|
|
4261
|
+
(n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
|
|
4256
4262
|
);
|
|
4257
4263
|
case "Output":
|
|
4258
4264
|
return this.getOutputsLocked() && this.listOutputFields().every(
|
|
4259
|
-
(
|
|
4265
|
+
(n) => this.resolve({ field: n, assertFieldType: "Output" }) !== void 0
|
|
4260
4266
|
);
|
|
4261
4267
|
}
|
|
4262
4268
|
}
|
|
4263
|
-
mapFields(e,
|
|
4264
|
-
const { fieldType: r, requireLocked:
|
|
4269
|
+
mapFields(e, n) {
|
|
4270
|
+
const { fieldType: r, requireLocked: i2, skipUnresolved: s } = {
|
|
4265
4271
|
fieldType: "Input",
|
|
4266
4272
|
requireLocked: true,
|
|
4267
4273
|
skipUnresolved: false,
|
|
4268
|
-
...
|
|
4274
|
+
...n
|
|
4269
4275
|
}, o = e;
|
|
4270
|
-
if (
|
|
4276
|
+
if (i2 && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
|
|
4271
4277
|
return;
|
|
4272
4278
|
let a = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
4273
4279
|
(u) => [u, this.resolve({ field: u, assertFieldType: r })]
|
|
4274
4280
|
);
|
|
4275
|
-
return
|
|
4281
|
+
return s && (a = a.filter((u) => u[1] !== void 0)), a.map(([u, h]) => o(u, h));
|
|
4276
4282
|
}
|
|
4277
4283
|
}
|
|
4278
4284
|
const ae = "staging", le = "main";
|
|
4279
|
-
const Ie = "pl7.app/label",
|
|
4285
|
+
const Ie = "pl7.app/label", Re = "pl7.app/trace", Fe = z.object({
|
|
4280
4286
|
type: z.string(),
|
|
4281
4287
|
importance: z.number().optional(),
|
|
4282
4288
|
id: z.string().optional(),
|
|
4283
4289
|
label: z.string()
|
|
4284
|
-
}),
|
|
4285
|
-
function ke(
|
|
4286
|
-
const r = /* @__PURE__ */ new Map(),
|
|
4287
|
-
var
|
|
4288
|
-
const g = e(p), f2 = (
|
|
4290
|
+
}), xe = z.array(Fe), Te = 1e-3, Oe = "__LABEL__", ee = "__LABEL__@1";
|
|
4291
|
+
function ke(t, e, n = {}) {
|
|
4292
|
+
const r = /* @__PURE__ */ new Map(), i2 = /* @__PURE__ */ new Map(), s = t.map((p) => {
|
|
4293
|
+
var R, Q2;
|
|
4294
|
+
const g = e(p), f2 = (R = g.annotations) == null ? void 0 : R[Ie], A = (Q2 = g.annotations) == null ? void 0 : Q2[Re], y = (A ? xe.safeParse(JSON.parse(A)).data : void 0) ?? [];
|
|
4289
4295
|
if (f2) {
|
|
4290
|
-
const w = { label: f2, type:
|
|
4291
|
-
|
|
4296
|
+
const w = { label: f2, type: Oe, importance: -2 };
|
|
4297
|
+
n.addLabelAsSuffix ? y.push(w) : y.splice(0, 0, w);
|
|
4292
4298
|
}
|
|
4293
4299
|
const I = [], D = /* @__PURE__ */ new Map();
|
|
4294
4300
|
for (let w = y.length - 1; w >= 0; --w) {
|
|
4295
|
-
const { type:
|
|
4296
|
-
D.set(
|
|
4297
|
-
const
|
|
4298
|
-
|
|
4299
|
-
|
|
4301
|
+
const { type: N } = y[w], pe = y[w].importance ?? 0, M = (D.get(N) ?? 0) + 1;
|
|
4302
|
+
D.set(N, M);
|
|
4303
|
+
const F = `${N}@${M}`;
|
|
4304
|
+
i2.set(F, (i2.get(F) ?? 0) + 1), r.set(
|
|
4305
|
+
F,
|
|
4300
4306
|
Math.max(
|
|
4301
|
-
r.get(
|
|
4302
|
-
pe - (y.length - w) *
|
|
4307
|
+
r.get(F) ?? Number.NEGATIVE_INFINITY,
|
|
4308
|
+
pe - (y.length - w) * Te
|
|
4303
4309
|
)
|
|
4304
|
-
), I.push({ ...y[w], fullType:
|
|
4310
|
+
), I.push({ ...y[w], fullType: F, occurenceIndex: M });
|
|
4305
4311
|
}
|
|
4306
4312
|
return I.reverse(), {
|
|
4307
4313
|
value: p,
|
|
@@ -4312,11 +4318,11 @@
|
|
|
4312
4318
|
}), o = [], l = [], a = [...r];
|
|
4313
4319
|
a.sort(([, p], [, g]) => g - p);
|
|
4314
4320
|
for (const [p] of a)
|
|
4315
|
-
p.endsWith("@1") ||
|
|
4316
|
-
const u = (p) =>
|
|
4317
|
-
const f2 = g.fullTrace.filter((y) => p.has(y.fullType)).map((y) => y.label),
|
|
4321
|
+
p.endsWith("@1") || i2.get(p) === t.length ? o.push(p) : l.push(p);
|
|
4322
|
+
const u = (p) => s.map((g) => {
|
|
4323
|
+
const f2 = g.fullTrace.filter((y) => p.has(y.fullType)).map((y) => y.label), A = n.separator ?? " / ";
|
|
4318
4324
|
return {
|
|
4319
|
-
label: f2.join(
|
|
4325
|
+
label: f2.join(A),
|
|
4320
4326
|
value: g.value
|
|
4321
4327
|
};
|
|
4322
4328
|
});
|
|
@@ -4327,11 +4333,11 @@
|
|
|
4327
4333
|
let h = 0, d = 0;
|
|
4328
4334
|
for (; h < o.length; ) {
|
|
4329
4335
|
const p = /* @__PURE__ */ new Set();
|
|
4330
|
-
|
|
4336
|
+
n.includeNativeLabel && p.add(ee);
|
|
4331
4337
|
for (let f2 = 0; f2 < h; ++f2) p.add(o[f2]);
|
|
4332
4338
|
p.add(o[d]);
|
|
4333
4339
|
const g = u(p);
|
|
4334
|
-
if (new Set(g.map((f2) => f2.label)).size ===
|
|
4340
|
+
if (new Set(g.map((f2) => f2.label)).size === t.length) return g;
|
|
4335
4341
|
d++, d == o.length && (h++, d = h);
|
|
4336
4342
|
}
|
|
4337
4343
|
return u(/* @__PURE__ */ new Set([...o, ...l]));
|
|
@@ -4339,7 +4345,7 @@
|
|
|
4339
4345
|
class De {
|
|
4340
4346
|
constructor() {
|
|
4341
4347
|
S(this, "ctx", c());
|
|
4342
|
-
S(this, "defaultLabelFn", (e,
|
|
4348
|
+
S(this, "defaultLabelFn", (e, n) => {
|
|
4343
4349
|
var r;
|
|
4344
4350
|
return ((r = e.annotations) == null ? void 0 : r["pl7.app/label"]) ?? "Unlabelled";
|
|
4345
4351
|
});
|
|
@@ -4350,14 +4356,14 @@
|
|
|
4350
4356
|
calculateOptions(e) {
|
|
4351
4357
|
return this.ctx.calculateOptions(e);
|
|
4352
4358
|
}
|
|
4353
|
-
getOptions(e,
|
|
4354
|
-
const r = this.getSpecs().entries.filter((
|
|
4355
|
-
return typeof
|
|
4356
|
-
ref:
|
|
4357
|
-
label:
|
|
4358
|
-
})) : r.map((
|
|
4359
|
-
ref:
|
|
4360
|
-
label:
|
|
4359
|
+
getOptions(e, n) {
|
|
4360
|
+
const r = this.getSpecs().entries.filter((i2) => e(i2.obj));
|
|
4361
|
+
return typeof n == "object" || typeof n > "u" ? ke(r, (i2) => i2.obj, n ?? {}).map(({ value: { ref: i2 }, label: s }) => ({
|
|
4362
|
+
ref: i2,
|
|
4363
|
+
label: s
|
|
4364
|
+
})) : r.map((i2) => ({
|
|
4365
|
+
ref: i2.ref,
|
|
4366
|
+
label: n(i2.obj, i2.ref)
|
|
4361
4367
|
}));
|
|
4362
4368
|
}
|
|
4363
4369
|
/**
|
|
@@ -4370,11 +4376,11 @@
|
|
|
4370
4376
|
const e = this.ctx.getDataFromResultPool();
|
|
4371
4377
|
return {
|
|
4372
4378
|
isComplete: e.isComplete,
|
|
4373
|
-
entries: e.entries.map((
|
|
4374
|
-
ref:
|
|
4379
|
+
entries: e.entries.map((n) => ({
|
|
4380
|
+
ref: n.ref,
|
|
4375
4381
|
obj: {
|
|
4376
|
-
...
|
|
4377
|
-
data: new
|
|
4382
|
+
...n.obj,
|
|
4383
|
+
data: new v(n.obj.data, [n.ref.blockId, n.ref.name])
|
|
4378
4384
|
}
|
|
4379
4385
|
}))
|
|
4380
4386
|
};
|
|
@@ -4389,13 +4395,13 @@
|
|
|
4389
4395
|
const e = this.ctx.getDataWithErrorsFromResultPool();
|
|
4390
4396
|
return {
|
|
4391
4397
|
isComplete: e.isComplete,
|
|
4392
|
-
entries: e.entries.map((
|
|
4393
|
-
ref:
|
|
4398
|
+
entries: e.entries.map((n) => ({
|
|
4399
|
+
ref: n.ref,
|
|
4394
4400
|
obj: {
|
|
4395
|
-
...
|
|
4401
|
+
...n.obj,
|
|
4396
4402
|
data: mt(
|
|
4397
|
-
|
|
4398
|
-
(r) => new
|
|
4403
|
+
n.obj.data,
|
|
4404
|
+
(r) => new v(r, [n.ref.blockId, n.ref.name])
|
|
4399
4405
|
)
|
|
4400
4406
|
}
|
|
4401
4407
|
}))
|
|
@@ -4415,12 +4421,12 @@
|
|
|
4415
4421
|
* @returns data associated with the ref
|
|
4416
4422
|
*/
|
|
4417
4423
|
getDataByRef(e) {
|
|
4418
|
-
var
|
|
4419
|
-
return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (
|
|
4424
|
+
var n;
|
|
4425
|
+
return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
|
|
4420
4426
|
(r) => r.ref.blockId === e.blockId && r.ref.name === e.name
|
|
4421
|
-
)) == null ? void 0 :
|
|
4427
|
+
)) == null ? void 0 : n.obj : lt(
|
|
4422
4428
|
this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
|
|
4423
|
-
(r) => new
|
|
4429
|
+
(r) => new v(r, [e.blockId, e.name])
|
|
4424
4430
|
);
|
|
4425
4431
|
}
|
|
4426
4432
|
/**
|
|
@@ -4429,9 +4435,9 @@
|
|
|
4429
4435
|
* @returns p-column associated with the ref
|
|
4430
4436
|
*/
|
|
4431
4437
|
getPColumnByRef(e) {
|
|
4432
|
-
const
|
|
4433
|
-
if (
|
|
4434
|
-
return dt(
|
|
4438
|
+
const n = this.getDataByRef(e);
|
|
4439
|
+
if (n)
|
|
4440
|
+
return dt(n);
|
|
4435
4441
|
}
|
|
4436
4442
|
/**
|
|
4437
4443
|
* Returns spec associated with the ref ensuring that it is a p-column spec.
|
|
@@ -4439,10 +4445,10 @@
|
|
|
4439
4445
|
* @returns p-column spec associated with the ref
|
|
4440
4446
|
*/
|
|
4441
4447
|
getPColumnSpecByRef(e) {
|
|
4442
|
-
const
|
|
4443
|
-
if (
|
|
4444
|
-
if (!i(
|
|
4445
|
-
return
|
|
4448
|
+
const n = this.getSpecByRef(e);
|
|
4449
|
+
if (n) {
|
|
4450
|
+
if (!i(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
|
|
4451
|
+
return n;
|
|
4446
4452
|
}
|
|
4447
4453
|
}
|
|
4448
4454
|
/**
|
|
@@ -4450,10 +4456,10 @@
|
|
|
4450
4456
|
* @returns object spec associated with the ref
|
|
4451
4457
|
*/
|
|
4452
4458
|
getSpecByRef(e) {
|
|
4453
|
-
var
|
|
4454
|
-
return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (
|
|
4459
|
+
var n;
|
|
4460
|
+
return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
|
|
4455
4461
|
(r) => r.ref.blockId === e.blockId && r.ref.name === e.name
|
|
4456
|
-
)) == null ? void 0 :
|
|
4462
|
+
)) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
|
|
4457
4463
|
}
|
|
4458
4464
|
/**
|
|
4459
4465
|
* @param spec object specification
|
|
@@ -4461,31 +4467,31 @@
|
|
|
4461
4467
|
* @deprecated delete this method after Jan 1, 2025
|
|
4462
4468
|
*/
|
|
4463
4469
|
findDataWithCompatibleSpec(e) {
|
|
4464
|
-
const
|
|
4470
|
+
const n = [];
|
|
4465
4471
|
e: for (const r of this.getData().entries) {
|
|
4466
4472
|
if (!i(r.obj.spec))
|
|
4467
4473
|
continue;
|
|
4468
|
-
const
|
|
4469
|
-
if (e.name ===
|
|
4470
|
-
for (let
|
|
4471
|
-
const o = e.axesSpec[
|
|
4474
|
+
const i$1 = r.obj.spec;
|
|
4475
|
+
if (e.name === i$1.name && e.valueType === i$1.valueType && e.axesSpec.length === i$1.axesSpec.length && q(e.domain, i$1.domain)) {
|
|
4476
|
+
for (let s = 0; s < e.axesSpec.length; ++s) {
|
|
4477
|
+
const o = e.axesSpec[s], l = i$1.axesSpec[s];
|
|
4472
4478
|
if (o.name !== l.name || o.type !== l.type || !q(o.domain, l.domain))
|
|
4473
4479
|
continue e;
|
|
4474
4480
|
}
|
|
4475
|
-
|
|
4481
|
+
n.push(r.obj);
|
|
4476
4482
|
}
|
|
4477
4483
|
}
|
|
4478
|
-
return
|
|
4484
|
+
return n;
|
|
4479
4485
|
}
|
|
4480
4486
|
}
|
|
4481
|
-
function q(
|
|
4482
|
-
if (
|
|
4487
|
+
function q(t, e) {
|
|
4488
|
+
if (t === void 0) return e === void 0;
|
|
4483
4489
|
if (e === void 0) return true;
|
|
4484
|
-
for (const
|
|
4485
|
-
if (n
|
|
4490
|
+
for (const n in e)
|
|
4491
|
+
if (t[n] !== e[n]) return false;
|
|
4486
4492
|
return true;
|
|
4487
4493
|
}
|
|
4488
|
-
class
|
|
4494
|
+
class E {
|
|
4489
4495
|
constructor() {
|
|
4490
4496
|
S(this, "ctx");
|
|
4491
4497
|
S(this, "args");
|
|
@@ -4510,7 +4516,7 @@
|
|
|
4510
4516
|
getNamedAccessor(e) {
|
|
4511
4517
|
return H(
|
|
4512
4518
|
this.ctx.getAccessorHandleByName(e),
|
|
4513
|
-
(
|
|
4519
|
+
(n) => new v(n, [e])
|
|
4514
4520
|
);
|
|
4515
4521
|
}
|
|
4516
4522
|
get prerun() {
|
|
@@ -4524,11 +4530,11 @@
|
|
|
4524
4530
|
* @returns a map of axis value => label
|
|
4525
4531
|
*/
|
|
4526
4532
|
findLabels(e) {
|
|
4527
|
-
const
|
|
4528
|
-
for (const r of
|
|
4533
|
+
const n = this.resultPool.getData();
|
|
4534
|
+
for (const r of n.entries) {
|
|
4529
4535
|
if (!W(r.obj)) continue;
|
|
4530
|
-
const
|
|
4531
|
-
if (
|
|
4536
|
+
const i2 = r.obj.spec;
|
|
4537
|
+
if (i2.name === "pl7.app/label" && i2.axesSpec.length === 1 && i2.axesSpec[0].name === e.name && i2.axesSpec[0].type === e.type && q(e.domain, i2.axesSpec[0].domain)) {
|
|
4532
4538
|
if (r.obj.data.resourceType.name !== "PColumnData/Json")
|
|
4533
4539
|
throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
|
|
4534
4540
|
return Object.fromEntries(
|
|
@@ -4540,28 +4546,28 @@
|
|
|
4540
4546
|
}
|
|
4541
4547
|
}
|
|
4542
4548
|
verifyInlineColumnsSupport(e) {
|
|
4543
|
-
var
|
|
4544
|
-
const
|
|
4545
|
-
if (
|
|
4549
|
+
var i2;
|
|
4550
|
+
const n = e.some((s) => !(s.data instanceof v)), r = ((i2 = this.ctx.featureFlags) == null ? void 0 : i2.inlineColumnsSupport) === true;
|
|
4551
|
+
if (n && !r) throw Error("inline columns not supported");
|
|
4546
4552
|
}
|
|
4547
4553
|
createPFrame(e) {
|
|
4548
4554
|
return this.verifyInlineColumnsSupport(e), this.ctx.createPFrame(
|
|
4549
|
-
e.map((
|
|
4555
|
+
e.map((n) => lt(n, (r) => r instanceof v ? r.handle : r))
|
|
4550
4556
|
);
|
|
4551
4557
|
}
|
|
4552
4558
|
createPTable(e) {
|
|
4553
|
-
var
|
|
4554
|
-
return "columns" in e ?
|
|
4559
|
+
var n;
|
|
4560
|
+
return "columns" in e ? n = {
|
|
4555
4561
|
src: {
|
|
4556
4562
|
type: "full",
|
|
4557
4563
|
entries: e.columns.map((r) => ({ type: "column", column: r }))
|
|
4558
4564
|
},
|
|
4559
4565
|
filters: e.filters ?? [],
|
|
4560
4566
|
sorting: e.sorting ?? []
|
|
4561
|
-
} :
|
|
4567
|
+
} : n = e, this.verifyInlineColumnsSupport(pt(n.src)), this.ctx.createPTable(
|
|
4562
4568
|
it(
|
|
4563
|
-
|
|
4564
|
-
(r) => lt(r, (
|
|
4569
|
+
n,
|
|
4570
|
+
(r) => lt(r, (i2) => i2 instanceof v ? i2.handle : i2)
|
|
4565
4571
|
)
|
|
4566
4572
|
);
|
|
4567
4573
|
}
|
|
@@ -4574,20 +4580,20 @@
|
|
|
4574
4580
|
return this.ctx.getCurrentUnstableMarker();
|
|
4575
4581
|
}
|
|
4576
4582
|
}
|
|
4577
|
-
const
|
|
4578
|
-
function
|
|
4579
|
-
return
|
|
4583
|
+
const T = "1.22.2";
|
|
4584
|
+
function Ee(t) {
|
|
4585
|
+
return t.__renderLambda === true;
|
|
4580
4586
|
}
|
|
4581
|
-
function
|
|
4582
|
-
if (
|
|
4583
|
-
return
|
|
4587
|
+
function K(t) {
|
|
4588
|
+
if (t !== void 0)
|
|
4589
|
+
return Ee(t) ? t.handle : t;
|
|
4584
4590
|
}
|
|
4585
|
-
class
|
|
4586
|
-
constructor(e,
|
|
4587
|
-
this._renderingMode = e, this._initialArgs =
|
|
4591
|
+
class _ {
|
|
4592
|
+
constructor(e, n, r, i2, s, o, l) {
|
|
4593
|
+
this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i2, this._inputsValid = s, this._sections = o, this._title = l;
|
|
4588
4594
|
}
|
|
4589
4595
|
static create(e = "Heavy") {
|
|
4590
|
-
return new
|
|
4596
|
+
return new _(
|
|
4591
4597
|
e,
|
|
4592
4598
|
void 0,
|
|
4593
4599
|
{},
|
|
@@ -4597,10 +4603,10 @@
|
|
|
4597
4603
|
void 0
|
|
4598
4604
|
);
|
|
4599
4605
|
}
|
|
4600
|
-
output(e,
|
|
4601
|
-
if (typeof
|
|
4602
|
-
const
|
|
4603
|
-
return
|
|
4606
|
+
output(e, n, r = {}) {
|
|
4607
|
+
if (typeof n == "function") {
|
|
4608
|
+
const i2 = `output#${e}`;
|
|
4609
|
+
return L(i2, () => n(new E())), new _(
|
|
4604
4610
|
this._renderingMode,
|
|
4605
4611
|
this._initialArgs,
|
|
4606
4612
|
this._initialUiState,
|
|
@@ -4608,7 +4614,7 @@
|
|
|
4608
4614
|
...this._outputs,
|
|
4609
4615
|
[e]: {
|
|
4610
4616
|
__renderLambda: true,
|
|
4611
|
-
handle:
|
|
4617
|
+
handle: i2,
|
|
4612
4618
|
...r
|
|
4613
4619
|
}
|
|
4614
4620
|
},
|
|
@@ -4617,13 +4623,13 @@
|
|
|
4617
4623
|
this._title
|
|
4618
4624
|
);
|
|
4619
4625
|
} else
|
|
4620
|
-
return new
|
|
4626
|
+
return new _(
|
|
4621
4627
|
this._renderingMode,
|
|
4622
4628
|
this._initialArgs,
|
|
4623
4629
|
this._initialUiState,
|
|
4624
4630
|
{
|
|
4625
4631
|
...this._outputs,
|
|
4626
|
-
[e]:
|
|
4632
|
+
[e]: n
|
|
4627
4633
|
},
|
|
4628
4634
|
this._inputsValid,
|
|
4629
4635
|
this._sections,
|
|
@@ -4631,11 +4637,11 @@
|
|
|
4631
4637
|
);
|
|
4632
4638
|
}
|
|
4633
4639
|
/** Shortcut for {@link output} with retentive flag set to true. */
|
|
4634
|
-
retentiveOutput(e,
|
|
4635
|
-
return this.output(e,
|
|
4640
|
+
retentiveOutput(e, n) {
|
|
4641
|
+
return this.output(e, n, { retentive: true });
|
|
4636
4642
|
}
|
|
4637
4643
|
argsValid(e) {
|
|
4638
|
-
return typeof e == "function" ? (
|
|
4644
|
+
return typeof e == "function" ? (L("inputsValid", () => e(new E())), new _(
|
|
4639
4645
|
this._renderingMode,
|
|
4640
4646
|
this._initialArgs,
|
|
4641
4647
|
this._initialUiState,
|
|
@@ -4646,7 +4652,7 @@
|
|
|
4646
4652
|
},
|
|
4647
4653
|
this._sections,
|
|
4648
4654
|
this._title
|
|
4649
|
-
)) : new
|
|
4655
|
+
)) : new _(
|
|
4650
4656
|
this._renderingMode,
|
|
4651
4657
|
this._initialArgs,
|
|
4652
4658
|
this._initialUiState,
|
|
@@ -4657,7 +4663,7 @@
|
|
|
4657
4663
|
);
|
|
4658
4664
|
}
|
|
4659
4665
|
sections(e) {
|
|
4660
|
-
return Array.isArray(e) ? this.sections(V(e)) : typeof e == "function" ? (
|
|
4666
|
+
return Array.isArray(e) ? this.sections(V(e)) : typeof e == "function" ? (L("sections", () => e(new E())), new _(
|
|
4661
4667
|
this._renderingMode,
|
|
4662
4668
|
this._initialArgs,
|
|
4663
4669
|
this._initialUiState,
|
|
@@ -4665,7 +4671,7 @@
|
|
|
4665
4671
|
this._inputsValid,
|
|
4666
4672
|
{ __renderLambda: true, handle: "sections" },
|
|
4667
4673
|
this._title
|
|
4668
|
-
)) : new
|
|
4674
|
+
)) : new _(
|
|
4669
4675
|
this._renderingMode,
|
|
4670
4676
|
this._initialArgs,
|
|
4671
4677
|
this._initialUiState,
|
|
@@ -4677,7 +4683,7 @@
|
|
|
4677
4683
|
}
|
|
4678
4684
|
/** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
|
|
4679
4685
|
title(e) {
|
|
4680
|
-
return
|
|
4686
|
+
return L("title", () => e(new E())), new _(
|
|
4681
4687
|
this._renderingMode,
|
|
4682
4688
|
this._initialArgs,
|
|
4683
4689
|
this._initialUiState,
|
|
@@ -4692,7 +4698,7 @@
|
|
|
4692
4698
|
* @deprecated use {@link withArgs}
|
|
4693
4699
|
* */
|
|
4694
4700
|
initialArgs(e) {
|
|
4695
|
-
return new
|
|
4701
|
+
return new _(
|
|
4696
4702
|
this._renderingMode,
|
|
4697
4703
|
e,
|
|
4698
4704
|
this._initialUiState,
|
|
@@ -4704,7 +4710,7 @@
|
|
|
4704
4710
|
}
|
|
4705
4711
|
/** Sets initial args for the block, this value must be specified. */
|
|
4706
4712
|
withArgs(e) {
|
|
4707
|
-
return new
|
|
4713
|
+
return new _(
|
|
4708
4714
|
this._renderingMode,
|
|
4709
4715
|
e,
|
|
4710
4716
|
this._initialUiState,
|
|
@@ -4716,7 +4722,7 @@
|
|
|
4716
4722
|
}
|
|
4717
4723
|
/** Defines type and sets initial value for block UiState. */
|
|
4718
4724
|
withUiState(e) {
|
|
4719
|
-
return new
|
|
4725
|
+
return new _(
|
|
4720
4726
|
this._renderingMode,
|
|
4721
4727
|
this._initialArgs,
|
|
4722
4728
|
e,
|
|
@@ -4733,7 +4739,7 @@
|
|
|
4733
4739
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
4734
4740
|
const e = {
|
|
4735
4741
|
v3: {
|
|
4736
|
-
sdkVersion:
|
|
4742
|
+
sdkVersion: T,
|
|
4737
4743
|
renderingMode: this._renderingMode,
|
|
4738
4744
|
initialArgs: this._initialArgs,
|
|
4739
4745
|
initialUiState: this._initialUiState,
|
|
@@ -4743,22 +4749,22 @@
|
|
|
4743
4749
|
outputs: this._outputs
|
|
4744
4750
|
},
|
|
4745
4751
|
// fields below are added to allow previous desktop versions read generated configs
|
|
4746
|
-
sdkVersion:
|
|
4752
|
+
sdkVersion: T,
|
|
4747
4753
|
renderingMode: this._renderingMode,
|
|
4748
4754
|
initialArgs: this._initialArgs,
|
|
4749
|
-
inputsValid:
|
|
4750
|
-
sections:
|
|
4755
|
+
inputsValid: K(this._inputsValid),
|
|
4756
|
+
sections: K(this._sections),
|
|
4751
4757
|
outputs: Object.fromEntries(
|
|
4752
|
-
Object.entries(this._outputs).map(([
|
|
4758
|
+
Object.entries(this._outputs).map(([n, r]) => [n, K(r)])
|
|
4753
4759
|
)
|
|
4754
4760
|
};
|
|
4755
|
-
return Se() ? oe({ sdkVersion:
|
|
4761
|
+
return Se() ? oe({ sdkVersion: T }) : { config: e };
|
|
4756
4762
|
}
|
|
4757
4763
|
}
|
|
4758
|
-
function
|
|
4764
|
+
function St(t, e, n, r) {
|
|
4759
4765
|
var u, h;
|
|
4760
4766
|
Array.isArray(r) && (r = { filters: r });
|
|
4761
|
-
const
|
|
4767
|
+
const i2 = t.resultPool.getData().entries.map((d) => d.obj).filter(W).filter((d) => d.spec.name === "pl7.app/label" && d.spec.axesSpec.length === 1), s = (d, p) => {
|
|
4762
4768
|
let g = d.toString();
|
|
4763
4769
|
if (p)
|
|
4764
4770
|
for (const f2 in p)
|
|
@@ -4767,28 +4773,28 @@
|
|
|
4767
4773
|
}, o = /* @__PURE__ */ new Map();
|
|
4768
4774
|
for (const d of e)
|
|
4769
4775
|
for (const p of d.spec.axesSpec) {
|
|
4770
|
-
const g = J(p);
|
|
4771
|
-
for (const f2 of
|
|
4772
|
-
const
|
|
4776
|
+
const g = J$1(p);
|
|
4777
|
+
for (const f2 of i2) {
|
|
4778
|
+
const A = f2.spec.axesSpec[0], y = J$1(f2.spec.axesSpec[0]);
|
|
4773
4779
|
if (ot(g, y)) {
|
|
4774
4780
|
const I = Object.keys(g.domain ?? {}).length, D = Object.keys(y.domain ?? {}).length;
|
|
4775
4781
|
if (I > D) {
|
|
4776
|
-
const
|
|
4777
|
-
o.set(
|
|
4778
|
-
id:
|
|
4782
|
+
const R = s(f2.id, g.domain);
|
|
4783
|
+
o.set(R, {
|
|
4784
|
+
id: R,
|
|
4779
4785
|
spec: {
|
|
4780
4786
|
...f2.spec,
|
|
4781
|
-
axesSpec: [{ ...g, annotations:
|
|
4787
|
+
axesSpec: [{ ...g, annotations: A.annotations }]
|
|
4782
4788
|
},
|
|
4783
4789
|
data: f2.data
|
|
4784
4790
|
});
|
|
4785
4791
|
} else
|
|
4786
|
-
o.set(
|
|
4792
|
+
o.set(s(f2.id), f2);
|
|
4787
4793
|
}
|
|
4788
4794
|
}
|
|
4789
4795
|
}
|
|
4790
4796
|
if ([...e, ...o.values()].some(
|
|
4791
|
-
(d) => d.data instanceof
|
|
4797
|
+
(d) => d.data instanceof v && !d.data.getIsReadyOrError()
|
|
4792
4798
|
))
|
|
4793
4799
|
return;
|
|
4794
4800
|
let l = e;
|
|
@@ -4798,7 +4804,7 @@
|
|
|
4798
4804
|
for (const d of e)
|
|
4799
4805
|
r.coreColumnPredicate(d.spec) ? l.push(d) : a.push(d);
|
|
4800
4806
|
}
|
|
4801
|
-
return a.push(...o.values()),
|
|
4807
|
+
return a.push(...o.values()), t.createPTable({
|
|
4802
4808
|
src: {
|
|
4803
4809
|
type: "outer",
|
|
4804
4810
|
primary: {
|
|
@@ -4807,20 +4813,20 @@
|
|
|
4807
4813
|
},
|
|
4808
4814
|
secondary: a.map((d) => ({ type: "column", column: d }))
|
|
4809
4815
|
},
|
|
4810
|
-
filters: [...(r == null ? void 0 : r.filters) ?? [], ...((u =
|
|
4811
|
-
sorting: ((h =
|
|
4816
|
+
filters: [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []],
|
|
4817
|
+
sorting: ((h = n == null ? void 0 : n.pTableParams) == null ? void 0 : h.sorting) ?? []
|
|
4812
4818
|
});
|
|
4813
4819
|
}
|
|
4814
4820
|
const $BlockArgs = z.object({
|
|
4815
4821
|
numbers: z.array(z.coerce.number())
|
|
4816
4822
|
});
|
|
4817
|
-
const platforma =
|
|
4823
|
+
const platforma = _.create("Heavy").withArgs({ numbers: [1, 2, 3, 4] }).withUiState({ dataTableState: void 0, dynamicSections: [] }).output("numbers", (ctx) => {
|
|
4818
4824
|
var _a, _b;
|
|
4819
4825
|
return (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("numbers")) == null ? void 0 : _b.getDataAsJson();
|
|
4820
4826
|
}).output("pt", (ctx) => {
|
|
4821
4827
|
var _a, _b, _c, _d, _e;
|
|
4822
4828
|
if (!((_c = (_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.tableState.pTableParams) == null ? void 0 : _c.filters)) return void 0;
|
|
4823
|
-
return
|
|
4829
|
+
return St(ctx, [
|
|
4824
4830
|
{
|
|
4825
4831
|
id: "example",
|
|
4826
4832
|
spec: {
|