@milaboratories/milaboratories.ui-examples.model 1.1.8 → 1.1.10
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 +14 -0
- package/dist/bundle.js +391 -382
- package/dist/bundle.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +2 -2
package/dist/bundle.js
CHANGED
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
return obj;
|
|
21
21
|
};
|
|
22
22
|
util2.getValidEnumValues = (obj) => {
|
|
23
|
-
const validKeys = util2.objectKeys(obj).filter((
|
|
23
|
+
const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
|
|
24
24
|
const filtered = {};
|
|
25
|
-
for (const
|
|
26
|
-
filtered[
|
|
25
|
+
for (const k of validKeys) {
|
|
26
|
+
filtered[k] = obj[k];
|
|
27
27
|
}
|
|
28
28
|
return util2.objectValues(filtered);
|
|
29
29
|
};
|
|
@@ -3071,29 +3071,29 @@
|
|
|
3071
3071
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
3072
3072
|
const fn = ctx.data;
|
|
3073
3073
|
if (this._def.returns instanceof ZodPromise) {
|
|
3074
|
-
const
|
|
3074
|
+
const me = this;
|
|
3075
3075
|
return OK(async function(...args) {
|
|
3076
3076
|
const error = new ZodError([]);
|
|
3077
|
-
const parsedArgs = await
|
|
3077
|
+
const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
|
|
3078
3078
|
error.addIssue(makeArgsIssue(args, e));
|
|
3079
3079
|
throw error;
|
|
3080
3080
|
});
|
|
3081
3081
|
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
3082
|
-
const parsedReturns = await
|
|
3082
|
+
const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
|
3083
3083
|
error.addIssue(makeReturnsIssue(result, e));
|
|
3084
3084
|
throw error;
|
|
3085
3085
|
});
|
|
3086
3086
|
return parsedReturns;
|
|
3087
3087
|
});
|
|
3088
3088
|
} else {
|
|
3089
|
-
const
|
|
3089
|
+
const me = this;
|
|
3090
3090
|
return OK(function(...args) {
|
|
3091
|
-
const parsedArgs =
|
|
3091
|
+
const parsedArgs = me._def.args.safeParse(args, params);
|
|
3092
3092
|
if (!parsedArgs.success) {
|
|
3093
3093
|
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
3094
3094
|
}
|
|
3095
3095
|
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
3096
|
-
const parsedReturns =
|
|
3096
|
+
const parsedReturns = me._def.returns.safeParse(result, params);
|
|
3097
3097
|
if (!parsedReturns.success) {
|
|
3098
3098
|
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
3099
3099
|
}
|
|
@@ -3928,10 +3928,10 @@
|
|
|
3928
3928
|
if (t[e] !== n[e]) return false;
|
|
3929
3929
|
return true;
|
|
3930
3930
|
}
|
|
3931
|
-
function ot
|
|
3931
|
+
function ot(t, n) {
|
|
3932
3932
|
return t.name === n.name && _$1(t.domain, n.domain);
|
|
3933
3933
|
}
|
|
3934
|
-
function it
|
|
3934
|
+
function it(t, n) {
|
|
3935
3935
|
return { ...t, src: f(t.src, n) };
|
|
3936
3936
|
}
|
|
3937
3937
|
function f(t, n) {
|
|
@@ -3970,7 +3970,7 @@
|
|
|
3970
3970
|
function W(t) {
|
|
3971
3971
|
return i(t.spec);
|
|
3972
3972
|
}
|
|
3973
|
-
function dt
|
|
3973
|
+
function dt(t) {
|
|
3974
3974
|
if (!W(t)) throw new Error(`not a PColumn (kind = ${t.spec.kind})`);
|
|
3975
3975
|
return t;
|
|
3976
3976
|
}
|
|
@@ -3980,7 +3980,7 @@
|
|
|
3980
3980
|
data: n(t.data)
|
|
3981
3981
|
};
|
|
3982
3982
|
}
|
|
3983
|
-
function pt
|
|
3983
|
+
function pt(t) {
|
|
3984
3984
|
const n = /* @__PURE__ */ new Map(), e = (r) => {
|
|
3985
3985
|
switch (r.type) {
|
|
3986
3986
|
case "column":
|
|
@@ -4005,200 +4005,200 @@
|
|
|
4005
4005
|
}
|
|
4006
4006
|
const Q = 24;
|
|
4007
4007
|
z.string().length(Q).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
|
|
4008
|
-
var
|
|
4009
|
-
var
|
|
4010
|
-
var
|
|
4011
|
-
function
|
|
4012
|
-
return { type: "Immediate", value:
|
|
4008
|
+
var fe = Object.defineProperty;
|
|
4009
|
+
var he = (n, e, t) => e in n ? fe(n, e, { enumerable: true, configurable: true, writable: true, value: t }) : n[e] = t;
|
|
4010
|
+
var w = (n, e, t) => he(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4011
|
+
function V(n) {
|
|
4012
|
+
return { type: "Immediate", value: n };
|
|
4013
4013
|
}
|
|
4014
|
-
function
|
|
4014
|
+
function Se() {
|
|
4015
4015
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
4016
4016
|
}
|
|
4017
|
-
function
|
|
4018
|
-
if (
|
|
4019
|
-
return globalThis.getPlatforma(
|
|
4017
|
+
function oe(n) {
|
|
4018
|
+
if (n && typeof globalThis.getPlatforma == "function")
|
|
4019
|
+
return globalThis.getPlatforma(n);
|
|
4020
4020
|
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
4021
4021
|
throw new Error("Can't get platforma instance.");
|
|
4022
4022
|
}
|
|
4023
|
-
function
|
|
4023
|
+
function we() {
|
|
4024
4024
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
4025
4025
|
}
|
|
4026
|
-
function
|
|
4026
|
+
function c() {
|
|
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 E(n, e) {
|
|
4031
|
+
const t = we();
|
|
4032
|
+
if (t === void 0) return false;
|
|
4033
|
+
if (n in t.callbackRegistry) throw new Error(`Callback with key ${n} already registered.`);
|
|
4034
|
+
return t.callbackRegistry[n] = e, true;
|
|
4035
4035
|
}
|
|
4036
|
-
const
|
|
4037
|
-
function
|
|
4038
|
-
|
|
4039
|
-
for (const
|
|
4040
|
-
|
|
4041
|
-
},
|
|
4036
|
+
const J = /* @__PURE__ */ new Map();
|
|
4037
|
+
function Ce(n, e) {
|
|
4038
|
+
n in c().callbackRegistry || (c().callbackRegistry[n] = (t) => {
|
|
4039
|
+
for (const r of J.get(n))
|
|
4040
|
+
r(t);
|
|
4041
|
+
}, J.set(n, [])), J.get(n).push(e);
|
|
4042
4042
|
}
|
|
4043
|
-
class
|
|
4044
|
-
constructor(
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
this.handle =
|
|
4048
|
-
this.resolvedValue =
|
|
4043
|
+
class _ {
|
|
4044
|
+
constructor(e, t = (r) => r) {
|
|
4045
|
+
w(this, "isResolved", false);
|
|
4046
|
+
w(this, "resolvedValue");
|
|
4047
|
+
this.handle = e, this.postProcess = t, Ce(e, (r) => {
|
|
4048
|
+
this.resolvedValue = t(r), this.isResolved = true;
|
|
4049
4049
|
});
|
|
4050
4050
|
}
|
|
4051
|
-
map(
|
|
4052
|
-
return new
|
|
4051
|
+
map(e) {
|
|
4052
|
+
return new _(this.handle, (t) => e(this.postProcess(t)));
|
|
4053
4053
|
}
|
|
4054
|
-
mapDefined(
|
|
4055
|
-
return new
|
|
4056
|
-
const
|
|
4057
|
-
return
|
|
4054
|
+
mapDefined(e) {
|
|
4055
|
+
return new _(this.handle, (t) => {
|
|
4056
|
+
const r = this.postProcess(t);
|
|
4057
|
+
return r ? e(r) : void 0;
|
|
4058
4058
|
});
|
|
4059
4059
|
}
|
|
4060
4060
|
toJSON() {
|
|
4061
4061
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
4062
4062
|
}
|
|
4063
4063
|
}
|
|
4064
|
-
function
|
|
4065
|
-
return
|
|
4064
|
+
function H(n, e) {
|
|
4065
|
+
return n === void 0 ? void 0 : e(n);
|
|
4066
4066
|
}
|
|
4067
|
-
class
|
|
4068
|
-
constructor(
|
|
4069
|
-
this.handle =
|
|
4067
|
+
class b {
|
|
4068
|
+
constructor(e, t) {
|
|
4069
|
+
this.handle = e, this.resolvePath = t;
|
|
4070
4070
|
}
|
|
4071
|
-
resolve(...
|
|
4072
|
-
const
|
|
4073
|
-
(
|
|
4071
|
+
resolve(...e) {
|
|
4072
|
+
const t = e.map(
|
|
4073
|
+
(r) => ({
|
|
4074
4074
|
assertFieldType: "Input",
|
|
4075
|
-
...typeof
|
|
4075
|
+
...typeof r == "string" ? { field: r } : r
|
|
4076
4076
|
})
|
|
4077
4077
|
);
|
|
4078
|
-
return this.resolveWithCommon({}, ...
|
|
4078
|
+
return this.resolveWithCommon({}, ...t);
|
|
4079
4079
|
}
|
|
4080
|
-
resolveOutput(...
|
|
4081
|
-
const
|
|
4082
|
-
(
|
|
4080
|
+
resolveOutput(...e) {
|
|
4081
|
+
const t = e.map(
|
|
4082
|
+
(r) => ({
|
|
4083
4083
|
assertFieldType: "Output",
|
|
4084
|
-
...typeof
|
|
4084
|
+
...typeof r == "string" ? { field: r } : r
|
|
4085
4085
|
})
|
|
4086
4086
|
);
|
|
4087
|
-
return this.resolveWithCommon({}, ...
|
|
4087
|
+
return this.resolveWithCommon({}, ...t);
|
|
4088
4088
|
}
|
|
4089
|
-
resolveInput(...
|
|
4090
|
-
const
|
|
4091
|
-
(
|
|
4089
|
+
resolveInput(...e) {
|
|
4090
|
+
const t = e.map(
|
|
4091
|
+
(r) => ({
|
|
4092
4092
|
assertFieldType: "Input",
|
|
4093
|
-
...typeof
|
|
4093
|
+
...typeof r == "string" ? { field: r } : r
|
|
4094
4094
|
})
|
|
4095
4095
|
);
|
|
4096
|
-
return this.resolveWithCommon({}, ...n);
|
|
4097
|
-
}
|
|
4098
|
-
resolveAny(...t) {
|
|
4099
4096
|
return this.resolveWithCommon({}, ...t);
|
|
4100
4097
|
}
|
|
4101
|
-
|
|
4102
|
-
|
|
4098
|
+
resolveAny(...e) {
|
|
4099
|
+
return this.resolveWithCommon({}, ...e);
|
|
4100
|
+
}
|
|
4101
|
+
resolveWithCommon(e, ...t) {
|
|
4102
|
+
const r = [
|
|
4103
4103
|
...this.resolvePath,
|
|
4104
|
-
...
|
|
4104
|
+
...t.map((s) => typeof s == "string" ? s : s.field)
|
|
4105
4105
|
];
|
|
4106
|
-
return
|
|
4107
|
-
|
|
4108
|
-
(
|
|
4106
|
+
return H(
|
|
4107
|
+
c().resolveWithCommon(this.handle, e, ...t),
|
|
4108
|
+
(s) => new b(s, r)
|
|
4109
4109
|
);
|
|
4110
4110
|
}
|
|
4111
4111
|
get resourceType() {
|
|
4112
|
-
return
|
|
4112
|
+
return c().getResourceType(this.handle);
|
|
4113
4113
|
}
|
|
4114
4114
|
getInputsLocked() {
|
|
4115
|
-
return
|
|
4115
|
+
return c().getInputsLocked(this.handle);
|
|
4116
4116
|
}
|
|
4117
4117
|
getOutputsLocked() {
|
|
4118
|
-
return
|
|
4118
|
+
return c().getOutputsLocked(this.handle);
|
|
4119
4119
|
}
|
|
4120
4120
|
getIsReadyOrError() {
|
|
4121
|
-
return
|
|
4121
|
+
return c().getIsReadyOrError(this.handle);
|
|
4122
4122
|
}
|
|
4123
4123
|
getIsFinal() {
|
|
4124
|
-
return
|
|
4124
|
+
return c().getIsFinal(this.handle);
|
|
4125
4125
|
}
|
|
4126
4126
|
getError() {
|
|
4127
|
-
const
|
|
4128
|
-
return
|
|
4129
|
-
|
|
4130
|
-
(
|
|
4127
|
+
const e = [...this.resolvePath, "error"];
|
|
4128
|
+
return H(
|
|
4129
|
+
c().getError(this.handle),
|
|
4130
|
+
(t) => new b(t, e)
|
|
4131
4131
|
);
|
|
4132
4132
|
}
|
|
4133
4133
|
listInputFields() {
|
|
4134
|
-
return
|
|
4134
|
+
return c().listInputFields(this.handle);
|
|
4135
4135
|
}
|
|
4136
4136
|
listOutputFields() {
|
|
4137
|
-
return
|
|
4137
|
+
return c().listOutputFields(this.handle);
|
|
4138
4138
|
}
|
|
4139
4139
|
listDynamicFields() {
|
|
4140
|
-
return
|
|
4140
|
+
return c().listDynamicFields(this.handle);
|
|
4141
4141
|
}
|
|
4142
|
-
getKeyValueBase64(
|
|
4143
|
-
return
|
|
4142
|
+
getKeyValueBase64(e) {
|
|
4143
|
+
return c().getKeyValueBase64(this.handle, e);
|
|
4144
4144
|
}
|
|
4145
|
-
getKeyValueAsString(
|
|
4146
|
-
return
|
|
4145
|
+
getKeyValueAsString(e) {
|
|
4146
|
+
return c().getKeyValueAsString(this.handle, e);
|
|
4147
4147
|
}
|
|
4148
|
-
getKeyValueAsJson(
|
|
4149
|
-
const
|
|
4150
|
-
if (
|
|
4151
|
-
return JSON.parse(
|
|
4148
|
+
getKeyValueAsJson(e) {
|
|
4149
|
+
const t = this.getKeyValueAsString(e);
|
|
4150
|
+
if (t == null) throw new Error("Resource has no content.");
|
|
4151
|
+
return JSON.parse(t);
|
|
4152
4152
|
}
|
|
4153
4153
|
getDataBase64() {
|
|
4154
|
-
return
|
|
4154
|
+
return c().getDataBase64(this.handle);
|
|
4155
4155
|
}
|
|
4156
4156
|
getDataAsString() {
|
|
4157
|
-
return
|
|
4157
|
+
return c().getDataAsString(this.handle);
|
|
4158
4158
|
}
|
|
4159
4159
|
getDataAsJson() {
|
|
4160
|
-
const
|
|
4161
|
-
if (
|
|
4162
|
-
return JSON.parse(
|
|
4160
|
+
const e = this.getDataAsString();
|
|
4161
|
+
if (e == null) throw new Error("Resource has no content.");
|
|
4162
|
+
return JSON.parse(e);
|
|
4163
4163
|
}
|
|
4164
4164
|
/**
|
|
4165
4165
|
*
|
|
4166
4166
|
*/
|
|
4167
|
-
getPColumns(
|
|
4168
|
-
const
|
|
4169
|
-
return
|
|
4170
|
-
if (!W(
|
|
4171
|
-
return
|
|
4167
|
+
getPColumns(e = false, t = "") {
|
|
4168
|
+
const r = this.parsePObjectCollection(e, t);
|
|
4169
|
+
return r === void 0 ? void 0 : Object.entries(r).map(([, i2]) => {
|
|
4170
|
+
if (!W(i2)) throw new Error(`not a PColumn (kind = ${i2.spec.kind})`);
|
|
4171
|
+
return i2;
|
|
4172
4172
|
});
|
|
4173
4173
|
}
|
|
4174
4174
|
/**
|
|
4175
4175
|
*
|
|
4176
4176
|
*/
|
|
4177
|
-
parsePObjectCollection(
|
|
4178
|
-
const
|
|
4177
|
+
parsePObjectCollection(e = false, t = "") {
|
|
4178
|
+
const r = c().parsePObjectCollection(
|
|
4179
4179
|
this.handle,
|
|
4180
|
+
e,
|
|
4180
4181
|
t,
|
|
4181
|
-
n,
|
|
4182
4182
|
...this.resolvePath
|
|
4183
4183
|
);
|
|
4184
|
-
if (
|
|
4185
|
-
const
|
|
4186
|
-
for (const [
|
|
4187
|
-
const l = [...this.resolvePath,
|
|
4188
|
-
i2
|
|
4184
|
+
if (r === void 0) return;
|
|
4185
|
+
const s = {};
|
|
4186
|
+
for (const [i2, o] of Object.entries(r)) {
|
|
4187
|
+
const l = [...this.resolvePath, i2];
|
|
4188
|
+
s[i2] = lt(o, (a) => new b(a, l));
|
|
4189
4189
|
}
|
|
4190
|
-
return
|
|
4190
|
+
return s;
|
|
4191
4191
|
}
|
|
4192
4192
|
getFileContentAsBase64() {
|
|
4193
|
-
return new
|
|
4193
|
+
return new _(c().getBlobContentAsBase64(this.handle));
|
|
4194
4194
|
}
|
|
4195
4195
|
getFileContentAsString() {
|
|
4196
|
-
return new
|
|
4196
|
+
return new _(c().getBlobContentAsString(this.handle));
|
|
4197
4197
|
}
|
|
4198
4198
|
getFileContentAsJson() {
|
|
4199
|
-
return new
|
|
4200
|
-
|
|
4201
|
-
).mapDefined((
|
|
4199
|
+
return new _(
|
|
4200
|
+
c().getBlobContentAsString(this.handle)
|
|
4201
|
+
).mapDefined((e) => JSON.parse(e));
|
|
4202
4202
|
}
|
|
4203
4203
|
/**
|
|
4204
4204
|
* @deprecated use getFileContentAsBase64
|
|
@@ -4216,7 +4216,7 @@
|
|
|
4216
4216
|
* @returns downloaded file handle
|
|
4217
4217
|
*/
|
|
4218
4218
|
getFileHandle() {
|
|
4219
|
-
return new
|
|
4219
|
+
return new _(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 _(c().getOnDemandBlobContentHandle(this.handle));
|
|
4232
4232
|
}
|
|
4233
4233
|
/**
|
|
4234
4234
|
* @deprecated use getRemoteFileHandle
|
|
@@ -4237,127 +4237,127 @@
|
|
|
4237
4237
|
return this.getRemoteFileHandle();
|
|
4238
4238
|
}
|
|
4239
4239
|
getImportProgress() {
|
|
4240
|
-
return new
|
|
4240
|
+
return new _(c().getImportProgress(this.handle));
|
|
4241
4241
|
}
|
|
4242
|
-
getLastLogs(
|
|
4243
|
-
return new
|
|
4242
|
+
getLastLogs(e) {
|
|
4243
|
+
return new _(c().getLastLogs(this.handle, e));
|
|
4244
4244
|
}
|
|
4245
|
-
getProgressLog(
|
|
4246
|
-
return new
|
|
4245
|
+
getProgressLog(e) {
|
|
4246
|
+
return new _(c().getProgressLog(this.handle, e));
|
|
4247
4247
|
}
|
|
4248
4248
|
getLogHandle() {
|
|
4249
|
-
return new
|
|
4249
|
+
return new _(c().getLogHandle(this.handle));
|
|
4250
4250
|
}
|
|
4251
|
-
allFieldsResolved(
|
|
4252
|
-
switch (
|
|
4251
|
+
allFieldsResolved(e = "Input") {
|
|
4252
|
+
switch (e) {
|
|
4253
4253
|
case "Input":
|
|
4254
4254
|
return this.getInputsLocked() && this.listInputFields().every(
|
|
4255
|
-
(
|
|
4255
|
+
(t) => this.resolve({ field: t, assertFieldType: "Input" }) !== void 0
|
|
4256
4256
|
);
|
|
4257
4257
|
case "Output":
|
|
4258
4258
|
return this.getOutputsLocked() && this.listOutputFields().every(
|
|
4259
|
-
(
|
|
4259
|
+
(t) => this.resolve({ field: t, assertFieldType: "Output" }) !== void 0
|
|
4260
4260
|
);
|
|
4261
4261
|
}
|
|
4262
4262
|
}
|
|
4263
|
-
mapFields(
|
|
4264
|
-
const { fieldType:
|
|
4263
|
+
mapFields(e, t) {
|
|
4264
|
+
const { fieldType: r, requireLocked: s, skipUnresolved: i2 } = {
|
|
4265
4265
|
fieldType: "Input",
|
|
4266
4266
|
requireLocked: true,
|
|
4267
4267
|
skipUnresolved: false,
|
|
4268
|
-
...
|
|
4269
|
-
}, o =
|
|
4270
|
-
if (
|
|
4268
|
+
...t
|
|
4269
|
+
}, o = e;
|
|
4270
|
+
if (s && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
|
|
4271
4271
|
return;
|
|
4272
|
-
let
|
|
4273
|
-
(
|
|
4272
|
+
let a = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
4273
|
+
(u) => [u, this.resolve({ field: u, assertFieldType: r })]
|
|
4274
4274
|
);
|
|
4275
|
-
return
|
|
4275
|
+
return i2 && (a = a.filter((u) => u[1] !== void 0)), a.map(([u, h]) => o(u, h));
|
|
4276
4276
|
}
|
|
4277
4277
|
}
|
|
4278
|
-
const
|
|
4279
|
-
const
|
|
4278
|
+
const ae = "staging", le = "main";
|
|
4279
|
+
const Ie = "pl7.app/label", Fe = "pl7.app/trace", Re = z.object({
|
|
4280
4280
|
type: z.string(),
|
|
4281
4281
|
importance: z.number().optional(),
|
|
4282
4282
|
id: z.string().optional(),
|
|
4283
4283
|
label: z.string()
|
|
4284
|
-
}),
|
|
4285
|
-
function
|
|
4286
|
-
const
|
|
4287
|
-
var
|
|
4288
|
-
const
|
|
4289
|
-
if (
|
|
4290
|
-
const
|
|
4291
|
-
|
|
4284
|
+
}), Oe = z.array(Re), Te = 1e-3, ke = "__LABEL__", ee = "__LABEL__@1";
|
|
4285
|
+
function xe(n, e, t = {}) {
|
|
4286
|
+
const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i2 = n.map((p) => {
|
|
4287
|
+
var F, Q2;
|
|
4288
|
+
const g = e(p), f2 = (F = g.annotations) == null ? void 0 : F[Ie], C = (Q2 = g.annotations) == null ? void 0 : Q2[Fe], y = (C ? Oe.safeParse(JSON.parse(C)).data : void 0) ?? [];
|
|
4289
|
+
if (f2) {
|
|
4290
|
+
const S = { label: f2, type: ke, importance: -2 };
|
|
4291
|
+
t.addLabelAsSuffix ? y.push(S) : y.splice(0, 0, S);
|
|
4292
4292
|
}
|
|
4293
|
-
const
|
|
4294
|
-
for (let
|
|
4295
|
-
const { type:
|
|
4296
|
-
|
|
4297
|
-
const R = `${
|
|
4298
|
-
|
|
4293
|
+
const I = [], D = /* @__PURE__ */ new Map();
|
|
4294
|
+
for (let S = y.length - 1; S >= 0; --S) {
|
|
4295
|
+
const { type: M } = y[S], pe = y[S].importance ?? 0, U = (D.get(M) ?? 0) + 1;
|
|
4296
|
+
D.set(M, U);
|
|
4297
|
+
const R = `${M}@${U}`;
|
|
4298
|
+
s.set(R, (s.get(R) ?? 0) + 1), r.set(
|
|
4299
4299
|
R,
|
|
4300
4300
|
Math.max(
|
|
4301
|
-
|
|
4302
|
-
|
|
4301
|
+
r.get(R) ?? Number.NEGATIVE_INFINITY,
|
|
4302
|
+
pe - (y.length - S) * Te
|
|
4303
4303
|
)
|
|
4304
|
-
),
|
|
4304
|
+
), I.push({ ...y[S], fullType: R, occurenceIndex: U });
|
|
4305
4305
|
}
|
|
4306
|
-
return
|
|
4307
|
-
value:
|
|
4308
|
-
spec:
|
|
4309
|
-
label:
|
|
4310
|
-
fullTrace:
|
|
4306
|
+
return I.reverse(), {
|
|
4307
|
+
value: p,
|
|
4308
|
+
spec: g,
|
|
4309
|
+
label: f2,
|
|
4310
|
+
fullTrace: I
|
|
4311
4311
|
};
|
|
4312
|
-
}), o = [], l = [],
|
|
4313
|
-
|
|
4314
|
-
for (const [
|
|
4315
|
-
|
|
4316
|
-
const
|
|
4317
|
-
const
|
|
4312
|
+
}), o = [], l = [], a = [...r];
|
|
4313
|
+
a.sort(([, p], [, g]) => g - p);
|
|
4314
|
+
for (const [p] of a)
|
|
4315
|
+
p.endsWith("@1") || s.get(p) === n.length ? o.push(p) : l.push(p);
|
|
4316
|
+
const u = (p) => i2.map((g) => {
|
|
4317
|
+
const f2 = g.fullTrace.filter((y) => p.has(y.fullType)).map((y) => y.label), C = t.separator ?? " / ";
|
|
4318
4318
|
return {
|
|
4319
|
-
label:
|
|
4320
|
-
value:
|
|
4319
|
+
label: f2.join(C),
|
|
4320
|
+
value: g.value
|
|
4321
4321
|
};
|
|
4322
4322
|
});
|
|
4323
4323
|
if (o.length === 0) {
|
|
4324
4324
|
if (l.length !== 0) throw new Error("Assertion error.");
|
|
4325
|
-
return
|
|
4326
|
-
}
|
|
4327
|
-
let
|
|
4328
|
-
for (;
|
|
4329
|
-
const
|
|
4330
|
-
|
|
4331
|
-
for (let
|
|
4332
|
-
|
|
4333
|
-
const
|
|
4334
|
-
if (new Set(
|
|
4335
|
-
|
|
4336
|
-
}
|
|
4337
|
-
return
|
|
4325
|
+
return u(new Set(ee));
|
|
4326
|
+
}
|
|
4327
|
+
let h = 0, d = 0;
|
|
4328
|
+
for (; h < o.length; ) {
|
|
4329
|
+
const p = /* @__PURE__ */ new Set();
|
|
4330
|
+
t.includeNativeLabel && p.add(ee);
|
|
4331
|
+
for (let f2 = 0; f2 < h; ++f2) p.add(o[f2]);
|
|
4332
|
+
p.add(o[d]);
|
|
4333
|
+
const g = u(p);
|
|
4334
|
+
if (new Set(g.map((f2) => f2.label)).size === n.length) return g;
|
|
4335
|
+
d++, d == o.length && (h++, d = h);
|
|
4336
|
+
}
|
|
4337
|
+
return u(/* @__PURE__ */ new Set([...o, ...l]));
|
|
4338
4338
|
}
|
|
4339
|
-
class
|
|
4339
|
+
class De {
|
|
4340
4340
|
constructor() {
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
var
|
|
4344
|
-
return ((
|
|
4341
|
+
w(this, "ctx", c());
|
|
4342
|
+
w(this, "defaultLabelFn", (e, t) => {
|
|
4343
|
+
var r;
|
|
4344
|
+
return ((r = e.annotations) == null ? void 0 : r["pl7.app/label"]) ?? "Unlabelled";
|
|
4345
4345
|
});
|
|
4346
4346
|
}
|
|
4347
4347
|
/**
|
|
4348
4348
|
* @deprecated use getOptions()
|
|
4349
4349
|
*/
|
|
4350
|
-
calculateOptions(
|
|
4351
|
-
return this.ctx.calculateOptions(
|
|
4352
|
-
}
|
|
4353
|
-
getOptions(
|
|
4354
|
-
const
|
|
4355
|
-
return typeof
|
|
4356
|
-
ref:
|
|
4357
|
-
label:
|
|
4358
|
-
})) :
|
|
4359
|
-
ref:
|
|
4360
|
-
label:
|
|
4350
|
+
calculateOptions(e) {
|
|
4351
|
+
return this.ctx.calculateOptions(e);
|
|
4352
|
+
}
|
|
4353
|
+
getOptions(e, t) {
|
|
4354
|
+
const r = this.getSpecs().entries.filter((s) => e(s.obj));
|
|
4355
|
+
return typeof t == "object" || typeof t > "u" ? xe(r, (s) => s.obj, t ?? {}).map(({ value: { ref: s }, label: i2 }) => ({
|
|
4356
|
+
ref: s,
|
|
4357
|
+
label: i2
|
|
4358
|
+
})) : r.map((s) => ({
|
|
4359
|
+
ref: s.ref,
|
|
4360
|
+
label: t(s.obj, s.ref)
|
|
4361
4361
|
}));
|
|
4362
4362
|
}
|
|
4363
4363
|
/**
|
|
@@ -4367,14 +4367,14 @@
|
|
|
4367
4367
|
return this.getData();
|
|
4368
4368
|
}
|
|
4369
4369
|
getData() {
|
|
4370
|
-
const
|
|
4370
|
+
const e = this.ctx.getDataFromResultPool();
|
|
4371
4371
|
return {
|
|
4372
|
-
isComplete:
|
|
4373
|
-
entries:
|
|
4374
|
-
ref:
|
|
4372
|
+
isComplete: e.isComplete,
|
|
4373
|
+
entries: e.entries.map((t) => ({
|
|
4374
|
+
ref: t.ref,
|
|
4375
4375
|
obj: {
|
|
4376
|
-
...
|
|
4377
|
-
data: new
|
|
4376
|
+
...t.obj,
|
|
4377
|
+
data: new b(t.obj.data, [t.ref.blockId, t.ref.name])
|
|
4378
4378
|
}
|
|
4379
4379
|
}))
|
|
4380
4380
|
};
|
|
@@ -4386,16 +4386,16 @@
|
|
|
4386
4386
|
return this.getDataWithErrors();
|
|
4387
4387
|
}
|
|
4388
4388
|
getDataWithErrors() {
|
|
4389
|
-
const
|
|
4389
|
+
const e = this.ctx.getDataWithErrorsFromResultPool();
|
|
4390
4390
|
return {
|
|
4391
|
-
isComplete:
|
|
4392
|
-
entries:
|
|
4393
|
-
ref:
|
|
4391
|
+
isComplete: e.isComplete,
|
|
4392
|
+
entries: e.entries.map((t) => ({
|
|
4393
|
+
ref: t.ref,
|
|
4394
4394
|
obj: {
|
|
4395
|
-
...
|
|
4395
|
+
...t.obj,
|
|
4396
4396
|
data: mt(
|
|
4397
|
-
|
|
4398
|
-
(
|
|
4397
|
+
t.obj.data,
|
|
4398
|
+
(r) => new b(r, [t.ref.blockId, t.ref.name])
|
|
4399
4399
|
)
|
|
4400
4400
|
}
|
|
4401
4401
|
}))
|
|
@@ -4414,13 +4414,13 @@
|
|
|
4414
4414
|
* @param ref a Ref
|
|
4415
4415
|
* @returns data associated with the ref
|
|
4416
4416
|
*/
|
|
4417
|
-
getDataByRef(
|
|
4418
|
-
var
|
|
4419
|
-
return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (
|
|
4420
|
-
(
|
|
4421
|
-
)) == null ? void 0 :
|
|
4422
|
-
this.ctx.getDataFromResultPoolByRef(
|
|
4423
|
-
(
|
|
4417
|
+
getDataByRef(e) {
|
|
4418
|
+
var t;
|
|
4419
|
+
return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (t = this.getData().entries.find(
|
|
4420
|
+
(r) => r.ref.blockId === e.blockId && r.ref.name === e.name
|
|
4421
|
+
)) == null ? void 0 : t.obj : lt(
|
|
4422
|
+
this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
|
|
4423
|
+
(r) => new b(r, [e.blockId, e.name])
|
|
4424
4424
|
);
|
|
4425
4425
|
}
|
|
4426
4426
|
/**
|
|
@@ -4428,79 +4428,79 @@
|
|
|
4428
4428
|
* @param ref a Ref
|
|
4429
4429
|
* @returns p-column associated with the ref
|
|
4430
4430
|
*/
|
|
4431
|
-
getPColumnByRef(
|
|
4432
|
-
const
|
|
4433
|
-
if (
|
|
4434
|
-
return dt
|
|
4431
|
+
getPColumnByRef(e) {
|
|
4432
|
+
const t = this.getDataByRef(e);
|
|
4433
|
+
if (t)
|
|
4434
|
+
return dt(t);
|
|
4435
4435
|
}
|
|
4436
4436
|
/**
|
|
4437
4437
|
* Returns spec associated with the ref ensuring that it is a p-column spec.
|
|
4438
4438
|
* @param ref a Ref
|
|
4439
4439
|
* @returns p-column spec associated with the ref
|
|
4440
4440
|
*/
|
|
4441
|
-
getPColumnSpecByRef(
|
|
4442
|
-
const
|
|
4443
|
-
if (
|
|
4444
|
-
if (!i(
|
|
4445
|
-
return
|
|
4441
|
+
getPColumnSpecByRef(e) {
|
|
4442
|
+
const t = this.getSpecByRef(e);
|
|
4443
|
+
if (t) {
|
|
4444
|
+
if (!i(t)) throw new Error(`not a PColumn spec (kind = ${t.kind})`);
|
|
4445
|
+
return t;
|
|
4446
4446
|
}
|
|
4447
4447
|
}
|
|
4448
4448
|
/**
|
|
4449
4449
|
* @param ref a Ref
|
|
4450
4450
|
* @returns object spec associated with the ref
|
|
4451
4451
|
*/
|
|
4452
|
-
getSpecByRef(
|
|
4453
|
-
var
|
|
4454
|
-
return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (
|
|
4455
|
-
(
|
|
4456
|
-
)) == null ? void 0 :
|
|
4452
|
+
getSpecByRef(e) {
|
|
4453
|
+
var t;
|
|
4454
|
+
return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (t = this.getSpecs().entries.find(
|
|
4455
|
+
(r) => r.ref.blockId === e.blockId && r.ref.name === e.name
|
|
4456
|
+
)) == null ? void 0 : t.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
|
|
4457
4457
|
}
|
|
4458
4458
|
/**
|
|
4459
4459
|
* @param spec object specification
|
|
4460
4460
|
* @returns array of data objects with compatible specs
|
|
4461
4461
|
* @deprecated delete this method after Jan 1, 2025
|
|
4462
4462
|
*/
|
|
4463
|
-
findDataWithCompatibleSpec(
|
|
4464
|
-
const
|
|
4465
|
-
|
|
4466
|
-
if (!i(
|
|
4463
|
+
findDataWithCompatibleSpec(e) {
|
|
4464
|
+
const t = [];
|
|
4465
|
+
e: for (const r of this.getData().entries) {
|
|
4466
|
+
if (!i(r.obj.spec))
|
|
4467
4467
|
continue;
|
|
4468
|
-
const
|
|
4469
|
-
if (
|
|
4470
|
-
for (let
|
|
4471
|
-
const o =
|
|
4472
|
-
if (o.name !== l.name || o.type !== l.type || !
|
|
4473
|
-
continue
|
|
4468
|
+
const s = r.obj.spec;
|
|
4469
|
+
if (e.name === s.name && e.valueType === s.valueType && e.axesSpec.length === s.axesSpec.length && q(e.domain, s.domain)) {
|
|
4470
|
+
for (let i2 = 0; i2 < e.axesSpec.length; ++i2) {
|
|
4471
|
+
const o = e.axesSpec[i2], l = s.axesSpec[i2];
|
|
4472
|
+
if (o.name !== l.name || o.type !== l.type || !q(o.domain, l.domain))
|
|
4473
|
+
continue e;
|
|
4474
4474
|
}
|
|
4475
|
-
|
|
4475
|
+
t.push(r.obj);
|
|
4476
4476
|
}
|
|
4477
4477
|
}
|
|
4478
|
-
return
|
|
4478
|
+
return t;
|
|
4479
4479
|
}
|
|
4480
4480
|
}
|
|
4481
|
-
function
|
|
4482
|
-
if (
|
|
4483
|
-
if (
|
|
4484
|
-
for (const
|
|
4485
|
-
if (
|
|
4481
|
+
function q(n, e) {
|
|
4482
|
+
if (n === void 0) return e === void 0;
|
|
4483
|
+
if (e === void 0) return true;
|
|
4484
|
+
for (const t in e)
|
|
4485
|
+
if (n[t] !== e[t]) return false;
|
|
4486
4486
|
return true;
|
|
4487
4487
|
}
|
|
4488
|
-
class
|
|
4488
|
+
class L {
|
|
4489
4489
|
constructor() {
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
this.ctx =
|
|
4495
|
-
}
|
|
4496
|
-
getNamedAccessor(
|
|
4497
|
-
return
|
|
4498
|
-
this.ctx.getAccessorHandleByName(
|
|
4499
|
-
(
|
|
4490
|
+
w(this, "ctx");
|
|
4491
|
+
w(this, "args");
|
|
4492
|
+
w(this, "uiState");
|
|
4493
|
+
w(this, "resultPool", new De());
|
|
4494
|
+
this.ctx = c(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
|
|
4495
|
+
}
|
|
4496
|
+
getNamedAccessor(e) {
|
|
4497
|
+
return H(
|
|
4498
|
+
this.ctx.getAccessorHandleByName(e),
|
|
4499
|
+
(t) => new b(t, [e])
|
|
4500
4500
|
);
|
|
4501
4501
|
}
|
|
4502
4502
|
get prerun() {
|
|
4503
|
-
return this.getNamedAccessor(
|
|
4503
|
+
return this.getNamedAccessor(ae);
|
|
4504
4504
|
}
|
|
4505
4505
|
/**
|
|
4506
4506
|
* @deprecated use prerun
|
|
@@ -4515,7 +4515,7 @@
|
|
|
4515
4515
|
return this.precalc;
|
|
4516
4516
|
}
|
|
4517
4517
|
get outputs() {
|
|
4518
|
-
return this.getNamedAccessor(
|
|
4518
|
+
return this.getNamedAccessor(le);
|
|
4519
4519
|
}
|
|
4520
4520
|
/**
|
|
4521
4521
|
* @deprecated use outputs
|
|
@@ -4527,93 +4527,93 @@
|
|
|
4527
4527
|
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
4528
4528
|
* @returns a map of axis value => label
|
|
4529
4529
|
*/
|
|
4530
|
-
findLabels(
|
|
4531
|
-
const
|
|
4532
|
-
for (const
|
|
4533
|
-
if (!W(
|
|
4534
|
-
const
|
|
4535
|
-
if (
|
|
4536
|
-
if (
|
|
4537
|
-
throw Error(`Expected JSON column for labels, got: ${
|
|
4530
|
+
findLabels(e) {
|
|
4531
|
+
const t = this.resultPool.getData();
|
|
4532
|
+
for (const r of t.entries) {
|
|
4533
|
+
if (!W(r.obj)) continue;
|
|
4534
|
+
const s = r.obj.spec;
|
|
4535
|
+
if (s.name === "pl7.app/label" && s.axesSpec.length === 1 && s.axesSpec[0].name === e.name && s.axesSpec[0].type === e.type && q(e.domain, s.axesSpec[0].domain)) {
|
|
4536
|
+
if (r.obj.data.resourceType.name !== "PColumnData/Json")
|
|
4537
|
+
throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
|
|
4538
4538
|
return Object.fromEntries(
|
|
4539
4539
|
Object.entries(
|
|
4540
|
-
|
|
4540
|
+
r.obj.data.getDataAsJson().data
|
|
4541
4541
|
).map((o) => [JSON.parse(o[0])[0], o[1]])
|
|
4542
4542
|
);
|
|
4543
4543
|
}
|
|
4544
4544
|
}
|
|
4545
4545
|
}
|
|
4546
|
-
verifyInlineColumnsSupport(
|
|
4547
|
-
var
|
|
4548
|
-
const
|
|
4549
|
-
if (
|
|
4546
|
+
verifyInlineColumnsSupport(e) {
|
|
4547
|
+
var s;
|
|
4548
|
+
const t = e.some((i2) => !(i2.data instanceof b)), r = ((s = this.ctx.featureFlags) == null ? void 0 : s.inlineColumnsSupport) === true;
|
|
4549
|
+
if (t && !r) throw Error("inline columns not supported");
|
|
4550
4550
|
}
|
|
4551
|
-
createPFrame(
|
|
4552
|
-
return this.verifyInlineColumnsSupport(
|
|
4553
|
-
|
|
4551
|
+
createPFrame(e) {
|
|
4552
|
+
return this.verifyInlineColumnsSupport(e), this.ctx.createPFrame(
|
|
4553
|
+
e.map((t) => lt(t, (r) => r instanceof b ? r.handle : r))
|
|
4554
4554
|
);
|
|
4555
4555
|
}
|
|
4556
|
-
createPTable(
|
|
4557
|
-
var
|
|
4558
|
-
return "columns" in
|
|
4556
|
+
createPTable(e) {
|
|
4557
|
+
var t;
|
|
4558
|
+
return "columns" in e ? t = {
|
|
4559
4559
|
src: {
|
|
4560
4560
|
type: "full",
|
|
4561
|
-
entries:
|
|
4561
|
+
entries: e.columns.map((r) => ({ type: "column", column: r }))
|
|
4562
4562
|
},
|
|
4563
|
-
filters:
|
|
4564
|
-
sorting:
|
|
4565
|
-
} :
|
|
4566
|
-
it
|
|
4567
|
-
|
|
4568
|
-
(
|
|
4563
|
+
filters: e.filters ?? [],
|
|
4564
|
+
sorting: e.sorting ?? []
|
|
4565
|
+
} : t = e, this.verifyInlineColumnsSupport(pt(t.src)), this.ctx.createPTable(
|
|
4566
|
+
it(
|
|
4567
|
+
t,
|
|
4568
|
+
(r) => lt(r, (s) => s instanceof b ? s.handle : s)
|
|
4569
4569
|
)
|
|
4570
4570
|
);
|
|
4571
4571
|
}
|
|
4572
4572
|
/** @deprecated scheduled for removal from SDK */
|
|
4573
|
-
getBlockLabel(
|
|
4574
|
-
return this.ctx.getBlockLabel(
|
|
4573
|
+
getBlockLabel(e) {
|
|
4574
|
+
return this.ctx.getBlockLabel(e);
|
|
4575
4575
|
}
|
|
4576
4576
|
getCurrentUnstableMarker() {
|
|
4577
4577
|
if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
|
|
4578
4578
|
return this.ctx.getCurrentUnstableMarker();
|
|
4579
4579
|
}
|
|
4580
4580
|
}
|
|
4581
|
-
const
|
|
4582
|
-
function
|
|
4583
|
-
return
|
|
4581
|
+
const T = "1.21.10";
|
|
4582
|
+
function Le(n) {
|
|
4583
|
+
return n.__renderLambda === true;
|
|
4584
4584
|
}
|
|
4585
|
-
function
|
|
4586
|
-
if (
|
|
4587
|
-
return
|
|
4585
|
+
function G(n) {
|
|
4586
|
+
if (n !== void 0)
|
|
4587
|
+
return Le(n) ? n.handle : n;
|
|
4588
4588
|
}
|
|
4589
|
-
class
|
|
4590
|
-
constructor(t,
|
|
4591
|
-
this._renderingMode =
|
|
4589
|
+
class v {
|
|
4590
|
+
constructor(e, t, r, s, i2, o, l) {
|
|
4591
|
+
this._renderingMode = e, this._initialArgs = t, this._initialUiState = r, this._outputs = s, this._inputsValid = i2, this._sections = o, this._title = l;
|
|
4592
4592
|
}
|
|
4593
|
-
static create(
|
|
4594
|
-
return new
|
|
4595
|
-
|
|
4593
|
+
static create(e = "Heavy") {
|
|
4594
|
+
return new v(
|
|
4595
|
+
e,
|
|
4596
4596
|
void 0,
|
|
4597
4597
|
{},
|
|
4598
4598
|
{},
|
|
4599
|
-
|
|
4600
|
-
|
|
4599
|
+
V(true),
|
|
4600
|
+
V([]),
|
|
4601
4601
|
void 0
|
|
4602
4602
|
);
|
|
4603
4603
|
}
|
|
4604
|
-
output(
|
|
4605
|
-
if (typeof
|
|
4606
|
-
const
|
|
4607
|
-
return
|
|
4604
|
+
output(e, t, r = {}) {
|
|
4605
|
+
if (typeof t == "function") {
|
|
4606
|
+
const s = `output#${e}`;
|
|
4607
|
+
return E(s, () => t(new L())), new v(
|
|
4608
4608
|
this._renderingMode,
|
|
4609
4609
|
this._initialArgs,
|
|
4610
4610
|
this._initialUiState,
|
|
4611
4611
|
{
|
|
4612
4612
|
...this._outputs,
|
|
4613
|
-
[
|
|
4613
|
+
[e]: {
|
|
4614
4614
|
__renderLambda: true,
|
|
4615
|
-
handle:
|
|
4616
|
-
...
|
|
4615
|
+
handle: s,
|
|
4616
|
+
...r
|
|
4617
4617
|
}
|
|
4618
4618
|
},
|
|
4619
4619
|
this._inputsValid,
|
|
@@ -4621,13 +4621,13 @@
|
|
|
4621
4621
|
this._title
|
|
4622
4622
|
);
|
|
4623
4623
|
} else
|
|
4624
|
-
return new
|
|
4624
|
+
return new v(
|
|
4625
4625
|
this._renderingMode,
|
|
4626
4626
|
this._initialArgs,
|
|
4627
4627
|
this._initialUiState,
|
|
4628
4628
|
{
|
|
4629
4629
|
...this._outputs,
|
|
4630
|
-
[
|
|
4630
|
+
[e]: t
|
|
4631
4631
|
},
|
|
4632
4632
|
this._inputsValid,
|
|
4633
4633
|
this._sections,
|
|
@@ -4635,15 +4635,15 @@
|
|
|
4635
4635
|
);
|
|
4636
4636
|
}
|
|
4637
4637
|
/** Shortcut for {@link output} with retentive flag set to true. */
|
|
4638
|
-
retentiveOutput(
|
|
4639
|
-
return this.output(
|
|
4638
|
+
retentiveOutput(e, t) {
|
|
4639
|
+
return this.output(e, t, { retentive: true });
|
|
4640
4640
|
}
|
|
4641
4641
|
/** @deprecated */
|
|
4642
|
-
canRun(
|
|
4643
|
-
return this.inputsValid(
|
|
4642
|
+
canRun(e) {
|
|
4643
|
+
return this.inputsValid(e);
|
|
4644
4644
|
}
|
|
4645
|
-
argsValid(
|
|
4646
|
-
return typeof
|
|
4645
|
+
argsValid(e) {
|
|
4646
|
+
return typeof e == "function" ? (E("inputsValid", () => e(new L())), new v(
|
|
4647
4647
|
this._renderingMode,
|
|
4648
4648
|
this._initialArgs,
|
|
4649
4649
|
this._initialUiState,
|
|
@@ -4654,21 +4654,21 @@
|
|
|
4654
4654
|
},
|
|
4655
4655
|
this._sections,
|
|
4656
4656
|
this._title
|
|
4657
|
-
)) : new
|
|
4657
|
+
)) : new v(
|
|
4658
4658
|
this._renderingMode,
|
|
4659
4659
|
this._initialArgs,
|
|
4660
4660
|
this._initialUiState,
|
|
4661
4661
|
this._outputs,
|
|
4662
|
-
|
|
4662
|
+
e,
|
|
4663
4663
|
this._sections,
|
|
4664
4664
|
this._title
|
|
4665
4665
|
);
|
|
4666
4666
|
}
|
|
4667
|
-
inputsValid(
|
|
4668
|
-
return this.argsValid(
|
|
4667
|
+
inputsValid(e) {
|
|
4668
|
+
return this.argsValid(e);
|
|
4669
4669
|
}
|
|
4670
|
-
sections(
|
|
4671
|
-
return Array.isArray(
|
|
4670
|
+
sections(e) {
|
|
4671
|
+
return Array.isArray(e) ? this.sections(V(e)) : typeof e == "function" ? (E("sections", () => e(new L())), new v(
|
|
4672
4672
|
this._renderingMode,
|
|
4673
4673
|
this._initialArgs,
|
|
4674
4674
|
this._initialUiState,
|
|
@@ -4676,18 +4676,18 @@
|
|
|
4676
4676
|
this._inputsValid,
|
|
4677
4677
|
{ __renderLambda: true, handle: "sections" },
|
|
4678
4678
|
this._title
|
|
4679
|
-
)) : new
|
|
4679
|
+
)) : new v(
|
|
4680
4680
|
this._renderingMode,
|
|
4681
4681
|
this._initialArgs,
|
|
4682
4682
|
this._initialUiState,
|
|
4683
4683
|
this._outputs,
|
|
4684
4684
|
this._inputsValid,
|
|
4685
|
-
|
|
4685
|
+
e,
|
|
4686
4686
|
this._title
|
|
4687
4687
|
);
|
|
4688
4688
|
}
|
|
4689
|
-
title(
|
|
4690
|
-
return
|
|
4689
|
+
title(e) {
|
|
4690
|
+
return E("title", () => e(new L())), new v(
|
|
4691
4691
|
this._renderingMode,
|
|
4692
4692
|
this._initialArgs,
|
|
4693
4693
|
this._initialUiState,
|
|
@@ -4701,10 +4701,10 @@
|
|
|
4701
4701
|
* Sets initial args for the block, this value must be specified.
|
|
4702
4702
|
* @deprecated use {@link withArgs}
|
|
4703
4703
|
* */
|
|
4704
|
-
initialArgs(
|
|
4705
|
-
return new
|
|
4704
|
+
initialArgs(e) {
|
|
4705
|
+
return new v(
|
|
4706
4706
|
this._renderingMode,
|
|
4707
|
-
|
|
4707
|
+
e,
|
|
4708
4708
|
this._initialUiState,
|
|
4709
4709
|
this._outputs,
|
|
4710
4710
|
this._inputsValid,
|
|
@@ -4713,10 +4713,10 @@
|
|
|
4713
4713
|
);
|
|
4714
4714
|
}
|
|
4715
4715
|
/** Sets initial args for the block, this value must be specified. */
|
|
4716
|
-
withArgs(
|
|
4717
|
-
return new
|
|
4716
|
+
withArgs(e) {
|
|
4717
|
+
return new v(
|
|
4718
4718
|
this._renderingMode,
|
|
4719
|
-
|
|
4719
|
+
e,
|
|
4720
4720
|
this._initialUiState,
|
|
4721
4721
|
this._outputs,
|
|
4722
4722
|
this._inputsValid,
|
|
@@ -4725,11 +4725,11 @@
|
|
|
4725
4725
|
);
|
|
4726
4726
|
}
|
|
4727
4727
|
/** Defines type and sets initial value for block UiState. */
|
|
4728
|
-
withUiState(
|
|
4729
|
-
return new
|
|
4728
|
+
withUiState(e) {
|
|
4729
|
+
return new v(
|
|
4730
4730
|
this._renderingMode,
|
|
4731
4731
|
this._initialArgs,
|
|
4732
|
-
|
|
4732
|
+
e,
|
|
4733
4733
|
this._outputs,
|
|
4734
4734
|
this._inputsValid,
|
|
4735
4735
|
this._sections,
|
|
@@ -4741,9 +4741,9 @@
|
|
|
4741
4741
|
* other features provided by the platforma to the block. */
|
|
4742
4742
|
done() {
|
|
4743
4743
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
4744
|
-
const
|
|
4744
|
+
const e = {
|
|
4745
4745
|
v3: {
|
|
4746
|
-
sdkVersion:
|
|
4746
|
+
sdkVersion: T,
|
|
4747
4747
|
renderingMode: this._renderingMode,
|
|
4748
4748
|
initialArgs: this._initialArgs,
|
|
4749
4749
|
initialUiState: this._initialUiState,
|
|
@@ -4753,75 +4753,84 @@
|
|
|
4753
4753
|
outputs: this._outputs
|
|
4754
4754
|
},
|
|
4755
4755
|
// fields below are added to allow previous desktop versions read generated configs
|
|
4756
|
-
sdkVersion:
|
|
4756
|
+
sdkVersion: T,
|
|
4757
4757
|
renderingMode: this._renderingMode,
|
|
4758
4758
|
initialArgs: this._initialArgs,
|
|
4759
|
-
inputsValid:
|
|
4760
|
-
sections:
|
|
4759
|
+
inputsValid: G(this._inputsValid),
|
|
4760
|
+
sections: G(this._sections),
|
|
4761
4761
|
outputs: Object.fromEntries(
|
|
4762
|
-
Object.entries(this._outputs).map(([
|
|
4762
|
+
Object.entries(this._outputs).map(([t, r]) => [t, G(r)])
|
|
4763
4763
|
)
|
|
4764
4764
|
};
|
|
4765
|
-
return
|
|
4765
|
+
return Se() ? oe({ sdkVersion: T }) : { config: e };
|
|
4766
4766
|
}
|
|
4767
4767
|
}
|
|
4768
|
-
function
|
|
4769
|
-
var
|
|
4770
|
-
|
|
4771
|
-
|
|
4768
|
+
function _t(n, e, t, r) {
|
|
4769
|
+
var u, h;
|
|
4770
|
+
Array.isArray(r) && (r = { filters: r });
|
|
4771
|
+
const s = n.resultPool.getData().entries.map((d) => d.obj).filter(W).filter((d) => d.spec.name === "pl7.app/label" && d.spec.axesSpec.length === 1), i2 = (d, p) => {
|
|
4772
|
+
let g = d.toString();
|
|
4772
4773
|
if (p)
|
|
4773
|
-
for (const
|
|
4774
|
-
g +=
|
|
4774
|
+
for (const f2 in p)
|
|
4775
|
+
g += f2, g += p[f2];
|
|
4775
4776
|
return g;
|
|
4776
4777
|
}, o = /* @__PURE__ */ new Map();
|
|
4777
|
-
for (const
|
|
4778
|
-
for (const p of
|
|
4778
|
+
for (const d of e)
|
|
4779
|
+
for (const p of d.spec.axesSpec) {
|
|
4779
4780
|
const g = J$1(p);
|
|
4780
|
-
for (const
|
|
4781
|
-
const
|
|
4782
|
-
if (ot
|
|
4783
|
-
const
|
|
4784
|
-
if (
|
|
4785
|
-
const
|
|
4786
|
-
o.set(
|
|
4787
|
-
id:
|
|
4781
|
+
for (const f2 of s) {
|
|
4782
|
+
const C = f2.spec.axesSpec[0], y = J$1(f2.spec.axesSpec[0]);
|
|
4783
|
+
if (ot(g, y)) {
|
|
4784
|
+
const I = Object.keys(g.domain ?? {}).length, D = Object.keys(y.domain ?? {}).length;
|
|
4785
|
+
if (I > D) {
|
|
4786
|
+
const F = i2(f2.id, g.domain);
|
|
4787
|
+
o.set(F, {
|
|
4788
|
+
id: F,
|
|
4788
4789
|
spec: {
|
|
4789
|
-
...
|
|
4790
|
-
axesSpec: [{ ...g, annotations:
|
|
4790
|
+
...f2.spec,
|
|
4791
|
+
axesSpec: [{ ...g, annotations: C.annotations }]
|
|
4791
4792
|
},
|
|
4792
|
-
data:
|
|
4793
|
+
data: f2.data
|
|
4793
4794
|
});
|
|
4794
4795
|
} else
|
|
4795
|
-
o.set(
|
|
4796
|
+
o.set(i2(f2.id), f2);
|
|
4796
4797
|
}
|
|
4797
4798
|
}
|
|
4798
4799
|
}
|
|
4799
|
-
if (
|
|
4800
|
-
(
|
|
4800
|
+
if ([...e, ...o.values()].some(
|
|
4801
|
+
(d) => d.data instanceof b && !d.data.getIsReadyOrError()
|
|
4801
4802
|
))
|
|
4802
|
-
return
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4803
|
+
return;
|
|
4804
|
+
let l = e;
|
|
4805
|
+
const a = [];
|
|
4806
|
+
if (r != null && r.coreColumnPredicate) {
|
|
4807
|
+
l = [];
|
|
4808
|
+
for (const d of e)
|
|
4809
|
+
r.coreColumnPredicate(d.spec) ? l.push(d) : a.push(d);
|
|
4810
|
+
}
|
|
4811
|
+
return a.push(...o.values()), n.createPTable({
|
|
4812
|
+
src: {
|
|
4813
|
+
type: "outer",
|
|
4814
|
+
primary: {
|
|
4815
|
+
type: (r == null ? void 0 : r.coreJoinType) ?? "full",
|
|
4816
|
+
entries: l.map((d) => ({ type: "column", column: d }))
|
|
4810
4817
|
},
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4818
|
+
secondary: a.map((d) => ({ type: "column", column: d }))
|
|
4819
|
+
},
|
|
4820
|
+
filters: [...(r == null ? void 0 : r.filters) ?? [], ...((u = t == null ? void 0 : t.pTableParams) == null ? void 0 : u.filters) ?? []],
|
|
4821
|
+
sorting: ((h = t == null ? void 0 : t.pTableParams) == null ? void 0 : h.sorting) ?? []
|
|
4822
|
+
});
|
|
4814
4823
|
}
|
|
4815
4824
|
const $BlockArgs = z.object({
|
|
4816
4825
|
numbers: z.array(z.coerce.number())
|
|
4817
4826
|
});
|
|
4818
|
-
const platforma =
|
|
4827
|
+
const platforma = v.create("Heavy").withArgs({ numbers: [1, 2, 3] }).withUiState({ dataTableState: void 0 }).output("numbers", (ctx) => {
|
|
4819
4828
|
var _a, _b;
|
|
4820
4829
|
return (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("numbers")) == null ? void 0 : _b.getDataAsJson();
|
|
4821
4830
|
}).output("pt", (ctx) => {
|
|
4822
4831
|
var _a, _b, _c, _d, _e;
|
|
4823
4832
|
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;
|
|
4824
|
-
return
|
|
4833
|
+
return _t(ctx, [
|
|
4825
4834
|
{
|
|
4826
4835
|
id: "example",
|
|
4827
4836
|
spec: {
|