@milaboratories/milaboratories.ui-examples.model 1.0.49 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +13 -13
- package/CHANGELOG.md +17 -0
- package/dist/bundle.js +357 -402
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +28 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -28
- package/dist/index.d.ts +1 -28
- package/dist/index.js +29 -19
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +3 -3
- package/src/index.ts +31 -35
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 = (_2, value) => {
|
|
57
57
|
if (typeof value === "bigint") {
|
|
58
58
|
return value.toString();
|
|
59
59
|
}
|
|
@@ -409,12 +409,12 @@
|
|
|
409
409
|
}
|
|
410
410
|
static mergeArray(status, results) {
|
|
411
411
|
const arrayValue = [];
|
|
412
|
-
for (const
|
|
413
|
-
if (
|
|
412
|
+
for (const s of results) {
|
|
413
|
+
if (s.status === "aborted")
|
|
414
414
|
return INVALID;
|
|
415
|
-
if (
|
|
415
|
+
if (s.status === "dirty")
|
|
416
416
|
status.dirty();
|
|
417
|
-
arrayValue.push(
|
|
417
|
+
arrayValue.push(s.value);
|
|
418
418
|
}
|
|
419
419
|
return { status: status.value, value: arrayValue };
|
|
420
420
|
}
|
|
@@ -458,12 +458,12 @@
|
|
|
458
458
|
const isDirty = (x) => x.status === "dirty";
|
|
459
459
|
const isValid = (x) => x.status === "valid";
|
|
460
460
|
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
461
|
-
function __classPrivateFieldGet(receiver, state, kind,
|
|
462
|
-
if (typeof state === "function" ? receiver !== state || !
|
|
461
|
+
function __classPrivateFieldGet(receiver, state, kind, f2) {
|
|
462
|
+
if (typeof state === "function" ? receiver !== state || !f2 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
463
463
|
return state.get(receiver);
|
|
464
464
|
}
|
|
465
|
-
function __classPrivateFieldSet(receiver, state, value, kind,
|
|
466
|
-
if (typeof state === "function" ? receiver !== state || !
|
|
465
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f2) {
|
|
466
|
+
if (typeof state === "function" ? receiver !== state || !f2 : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
467
467
|
return state.set(receiver, value), value;
|
|
468
468
|
}
|
|
469
469
|
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
@@ -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 me2 = this;
|
|
3075
3075
|
return OK(async function(...args) {
|
|
3076
3076
|
const error = new ZodError([]);
|
|
3077
|
-
const parsedArgs = await
|
|
3077
|
+
const parsedArgs = await me2._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 me2._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 me2 = this;
|
|
3090
3090
|
return OK(function(...args) {
|
|
3091
|
-
const parsedArgs =
|
|
3091
|
+
const parsedArgs = me2._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 = me2._def.returns.safeParse(result, params);
|
|
3097
3097
|
if (!parsedReturns.success) {
|
|
3098
3098
|
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
3099
3099
|
}
|
|
@@ -3798,7 +3798,7 @@
|
|
|
3798
3798
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
3799
3799
|
};
|
|
3800
3800
|
const NEVER = INVALID;
|
|
3801
|
-
var z = /* @__PURE__ */ Object.freeze({
|
|
3801
|
+
var z$1 = /* @__PURE__ */ Object.freeze({
|
|
3802
3802
|
__proto__: null,
|
|
3803
3803
|
defaultErrorMap: errorMap,
|
|
3804
3804
|
setErrorMap,
|
|
@@ -3914,27 +3914,27 @@
|
|
|
3914
3914
|
quotelessJson,
|
|
3915
3915
|
ZodError
|
|
3916
3916
|
});
|
|
3917
|
-
function
|
|
3917
|
+
function f(t) {
|
|
3918
3918
|
throw new Error("Unexpected object: " + t);
|
|
3919
3919
|
}
|
|
3920
|
-
function
|
|
3920
|
+
function S(t) {
|
|
3921
3921
|
const { type: n, name: r, domain: e } = t;
|
|
3922
3922
|
return { type: n, name: r, ...e && { domain: e } };
|
|
3923
3923
|
}
|
|
3924
|
-
function
|
|
3924
|
+
function B(t, n) {
|
|
3925
3925
|
if (t === void 0) return n === void 0;
|
|
3926
3926
|
if (n === void 0) return true;
|
|
3927
3927
|
for (const r in n)
|
|
3928
3928
|
if (t[r] !== n[r]) return false;
|
|
3929
3929
|
return true;
|
|
3930
3930
|
}
|
|
3931
|
-
function
|
|
3932
|
-
return t.name === n.name &&
|
|
3931
|
+
function z(t, n) {
|
|
3932
|
+
return t.name === n.name && B(t.domain, n.domain);
|
|
3933
3933
|
}
|
|
3934
|
-
function
|
|
3935
|
-
return { ...t, src:
|
|
3934
|
+
function M(t, n) {
|
|
3935
|
+
return { ...t, src: u$1(t.src, n) };
|
|
3936
3936
|
}
|
|
3937
|
-
function
|
|
3937
|
+
function u$1(t, n) {
|
|
3938
3938
|
switch (t.type) {
|
|
3939
3939
|
case "column":
|
|
3940
3940
|
return {
|
|
@@ -3945,139 +3945,159 @@
|
|
|
3945
3945
|
case "full":
|
|
3946
3946
|
return {
|
|
3947
3947
|
type: t.type,
|
|
3948
|
-
entries: t.entries.map((r) =>
|
|
3948
|
+
entries: t.entries.map((r) => u$1(r, n))
|
|
3949
3949
|
};
|
|
3950
3950
|
case "outer":
|
|
3951
3951
|
return {
|
|
3952
3952
|
type: "outer",
|
|
3953
|
-
primary:
|
|
3954
|
-
secondary: t.secondary.map((r) =>
|
|
3953
|
+
primary: u$1(t.primary, n),
|
|
3954
|
+
secondary: t.secondary.map((r) => u$1(r, n))
|
|
3955
3955
|
};
|
|
3956
3956
|
default:
|
|
3957
|
-
|
|
3957
|
+
f(t);
|
|
3958
3958
|
}
|
|
3959
3959
|
}
|
|
3960
|
-
z.object({
|
|
3961
|
-
__isRef: z.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
3962
|
-
blockId: z.string().describe("Upstream block id"),
|
|
3963
|
-
name: z.string().describe("Name of the output provided to the upstream block's output context")
|
|
3960
|
+
z$1.object({
|
|
3961
|
+
__isRef: z$1.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
3962
|
+
blockId: z$1.string().describe("Upstream block id"),
|
|
3963
|
+
name: z$1.string().describe("Name of the output provided to the upstream block's output context")
|
|
3964
3964
|
}).describe(
|
|
3965
3965
|
"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."
|
|
3966
3966
|
).strict().readonly();
|
|
3967
3967
|
function o(t) {
|
|
3968
3968
|
return t.kind === "PColumn";
|
|
3969
3969
|
}
|
|
3970
|
-
function
|
|
3970
|
+
function U$1(t) {
|
|
3971
3971
|
return o(t.spec);
|
|
3972
3972
|
}
|
|
3973
|
-
function
|
|
3974
|
-
if (!
|
|
3973
|
+
function Y(t) {
|
|
3974
|
+
if (!U$1(t)) throw new Error(`not a PColumn (kind = ${t.spec.kind})`);
|
|
3975
3975
|
return t;
|
|
3976
3976
|
}
|
|
3977
|
-
function
|
|
3977
|
+
function Z(t, n) {
|
|
3978
3978
|
return t === void 0 ? void 0 : {
|
|
3979
3979
|
...t,
|
|
3980
3980
|
data: n(t.data)
|
|
3981
3981
|
};
|
|
3982
3982
|
}
|
|
3983
|
-
function
|
|
3983
|
+
function T(t) {
|
|
3984
|
+
const n = /* @__PURE__ */ new Map(), r = (e) => {
|
|
3985
|
+
switch (e.type) {
|
|
3986
|
+
case "column":
|
|
3987
|
+
n.set(e.column.id, e.column);
|
|
3988
|
+
return;
|
|
3989
|
+
case "full":
|
|
3990
|
+
case "inner":
|
|
3991
|
+
for (const i of e.entries) r(i);
|
|
3992
|
+
return;
|
|
3993
|
+
case "outer":
|
|
3994
|
+
r(e.primary);
|
|
3995
|
+
for (const i of e.secondary) r(i);
|
|
3996
|
+
return;
|
|
3997
|
+
default:
|
|
3998
|
+
f(e);
|
|
3999
|
+
}
|
|
4000
|
+
};
|
|
4001
|
+
return r(t), [...n.values()];
|
|
4002
|
+
}
|
|
4003
|
+
function v(t, n) {
|
|
3984
4004
|
return t.ok ? { ok: true, value: n(t.value) } : t;
|
|
3985
4005
|
}
|
|
3986
|
-
var
|
|
3987
|
-
var
|
|
3988
|
-
var
|
|
3989
|
-
function k(
|
|
3990
|
-
return { type: "Immediate", value:
|
|
4006
|
+
var ct = Object.defineProperty;
|
|
4007
|
+
var pt = (e, t, n) => t in e ? ct(e, t, { enumerable: true, configurable: true, writable: true, value: n }) : e[t] = n;
|
|
4008
|
+
var w = (e, t, n) => pt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4009
|
+
function k(e) {
|
|
4010
|
+
return { type: "Immediate", value: e };
|
|
3991
4011
|
}
|
|
3992
|
-
function
|
|
4012
|
+
function vt() {
|
|
3993
4013
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
3994
4014
|
}
|
|
3995
|
-
function
|
|
3996
|
-
if (
|
|
3997
|
-
return globalThis.getPlatforma(
|
|
4015
|
+
function st(e) {
|
|
4016
|
+
if (e && typeof globalThis.getPlatforma == "function")
|
|
4017
|
+
return globalThis.getPlatforma(e);
|
|
3998
4018
|
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
3999
4019
|
throw new Error("Can't get platforma instance.");
|
|
4000
4020
|
}
|
|
4001
|
-
function
|
|
4021
|
+
function wt() {
|
|
4002
4022
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
4003
4023
|
}
|
|
4004
4024
|
function u() {
|
|
4005
4025
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
4006
4026
|
throw new Error("Not in config rendering context");
|
|
4007
4027
|
}
|
|
4008
|
-
function O(
|
|
4009
|
-
const n =
|
|
4028
|
+
function O(e, t) {
|
|
4029
|
+
const n = wt();
|
|
4010
4030
|
if (n === void 0) return false;
|
|
4011
|
-
if (
|
|
4012
|
-
return n.callbackRegistry[
|
|
4031
|
+
if (e in n.callbackRegistry) throw new Error(`Callback with key ${e} already registered.`);
|
|
4032
|
+
return n.callbackRegistry[e] = t, true;
|
|
4013
4033
|
}
|
|
4014
4034
|
const N = /* @__PURE__ */ new Map();
|
|
4015
|
-
function
|
|
4016
|
-
|
|
4017
|
-
for (const
|
|
4018
|
-
|
|
4019
|
-
}, N.set(
|
|
4035
|
+
function St(e, t) {
|
|
4036
|
+
e in u().callbackRegistry || (u().callbackRegistry[e] = (n) => {
|
|
4037
|
+
for (const s of N.get(e))
|
|
4038
|
+
s(n);
|
|
4039
|
+
}, N.set(e, [])), N.get(e).push(t);
|
|
4020
4040
|
}
|
|
4021
4041
|
class g {
|
|
4022
|
-
constructor(
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
this.handle =
|
|
4026
|
-
this.resolvedValue = n(
|
|
4042
|
+
constructor(t, n = (s) => s) {
|
|
4043
|
+
w(this, "isResolved", false);
|
|
4044
|
+
w(this, "resolvedValue");
|
|
4045
|
+
this.handle = t, this.postProcess = n, St(t, (s) => {
|
|
4046
|
+
this.resolvedValue = n(s), this.isResolved = true;
|
|
4027
4047
|
});
|
|
4028
4048
|
}
|
|
4029
|
-
map(
|
|
4030
|
-
return new g(this.handle, (n) =>
|
|
4049
|
+
map(t) {
|
|
4050
|
+
return new g(this.handle, (n) => t(this.postProcess(n)));
|
|
4031
4051
|
}
|
|
4032
|
-
mapDefined(
|
|
4052
|
+
mapDefined(t) {
|
|
4033
4053
|
return new g(this.handle, (n) => {
|
|
4034
|
-
const
|
|
4035
|
-
return
|
|
4054
|
+
const s = this.postProcess(n);
|
|
4055
|
+
return s ? t(s) : void 0;
|
|
4036
4056
|
});
|
|
4037
4057
|
}
|
|
4038
4058
|
toJSON() {
|
|
4039
4059
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
4040
4060
|
}
|
|
4041
4061
|
}
|
|
4042
|
-
function X(
|
|
4043
|
-
return
|
|
4062
|
+
function X(e) {
|
|
4063
|
+
return e === void 0 ? void 0 : new _(e);
|
|
4044
4064
|
}
|
|
4045
|
-
class
|
|
4046
|
-
constructor(
|
|
4047
|
-
this.handle =
|
|
4065
|
+
class _ {
|
|
4066
|
+
constructor(t) {
|
|
4067
|
+
this.handle = t;
|
|
4048
4068
|
}
|
|
4049
|
-
resolve(...
|
|
4050
|
-
const n =
|
|
4051
|
-
(
|
|
4069
|
+
resolve(...t) {
|
|
4070
|
+
const n = t.map(
|
|
4071
|
+
(s) => ({
|
|
4052
4072
|
assertFieldType: "Input",
|
|
4053
|
-
...typeof
|
|
4073
|
+
...typeof s == "string" ? { field: s } : s
|
|
4054
4074
|
})
|
|
4055
4075
|
);
|
|
4056
4076
|
return this.resolveWithCommon({}, ...n);
|
|
4057
4077
|
}
|
|
4058
|
-
resolveOutput(...
|
|
4059
|
-
const n =
|
|
4060
|
-
(
|
|
4078
|
+
resolveOutput(...t) {
|
|
4079
|
+
const n = t.map(
|
|
4080
|
+
(s) => ({
|
|
4061
4081
|
assertFieldType: "Output",
|
|
4062
|
-
...typeof
|
|
4082
|
+
...typeof s == "string" ? { field: s } : s
|
|
4063
4083
|
})
|
|
4064
4084
|
);
|
|
4065
4085
|
return this.resolveWithCommon({}, ...n);
|
|
4066
4086
|
}
|
|
4067
|
-
resolveInput(...
|
|
4068
|
-
const n =
|
|
4069
|
-
(
|
|
4087
|
+
resolveInput(...t) {
|
|
4088
|
+
const n = t.map(
|
|
4089
|
+
(s) => ({
|
|
4070
4090
|
assertFieldType: "Input",
|
|
4071
|
-
...typeof
|
|
4091
|
+
...typeof s == "string" ? { field: s } : s
|
|
4072
4092
|
})
|
|
4073
4093
|
);
|
|
4074
4094
|
return this.resolveWithCommon({}, ...n);
|
|
4075
4095
|
}
|
|
4076
|
-
resolveAny(...
|
|
4077
|
-
return this.resolveWithCommon({}, ...
|
|
4096
|
+
resolveAny(...t) {
|
|
4097
|
+
return this.resolveWithCommon({}, ...t);
|
|
4078
4098
|
}
|
|
4079
|
-
resolveWithCommon(
|
|
4080
|
-
return X(u().resolveWithCommon(this.handle,
|
|
4099
|
+
resolveWithCommon(t, ...n) {
|
|
4100
|
+
return X(u().resolveWithCommon(this.handle, t, ...n));
|
|
4081
4101
|
}
|
|
4082
4102
|
get resourceType() {
|
|
4083
4103
|
return u().getResourceType(this.handle);
|
|
@@ -4106,14 +4126,14 @@
|
|
|
4106
4126
|
listDynamicFields() {
|
|
4107
4127
|
return u().listDynamicFields(this.handle);
|
|
4108
4128
|
}
|
|
4109
|
-
getKeyValueBase64(
|
|
4110
|
-
return u().getKeyValueBase64(this.handle,
|
|
4129
|
+
getKeyValueBase64(t) {
|
|
4130
|
+
return u().getKeyValueBase64(this.handle, t);
|
|
4111
4131
|
}
|
|
4112
|
-
getKeyValueAsString(
|
|
4113
|
-
return u().getKeyValueAsString(this.handle,
|
|
4132
|
+
getKeyValueAsString(t) {
|
|
4133
|
+
return u().getKeyValueAsString(this.handle, t);
|
|
4114
4134
|
}
|
|
4115
|
-
getKeyValueAsJson(
|
|
4116
|
-
const n = this.getKeyValueAsString(
|
|
4135
|
+
getKeyValueAsJson(t) {
|
|
4136
|
+
const n = this.getKeyValueAsString(t);
|
|
4117
4137
|
if (n == null) throw new Error("Resource has no content.");
|
|
4118
4138
|
return JSON.parse(n);
|
|
4119
4139
|
}
|
|
@@ -4124,34 +4144,34 @@
|
|
|
4124
4144
|
return u().getDataAsString(this.handle);
|
|
4125
4145
|
}
|
|
4126
4146
|
getDataAsJson() {
|
|
4127
|
-
const
|
|
4128
|
-
if (
|
|
4129
|
-
return JSON.parse(
|
|
4147
|
+
const t = this.getDataAsString();
|
|
4148
|
+
if (t == null) throw new Error("Resource has no content.");
|
|
4149
|
+
return JSON.parse(t);
|
|
4130
4150
|
}
|
|
4131
4151
|
/**
|
|
4132
4152
|
*
|
|
4133
4153
|
*/
|
|
4134
|
-
getPColumns(
|
|
4135
|
-
const
|
|
4136
|
-
return
|
|
4137
|
-
if (!
|
|
4154
|
+
getPColumns(t = false, n = "") {
|
|
4155
|
+
const s = this.parsePObjectCollection(t, n);
|
|
4156
|
+
return s === void 0 ? void 0 : Object.entries(s).map(([, i]) => {
|
|
4157
|
+
if (!U$1(i)) throw new Error(`not a PColumn (kind = ${i.spec.kind})`);
|
|
4138
4158
|
return i;
|
|
4139
4159
|
});
|
|
4140
4160
|
}
|
|
4141
4161
|
/**
|
|
4142
4162
|
*
|
|
4143
4163
|
*/
|
|
4144
|
-
parsePObjectCollection(
|
|
4145
|
-
const
|
|
4164
|
+
parsePObjectCollection(t = false, n = "") {
|
|
4165
|
+
const s = u().parsePObjectCollection(
|
|
4146
4166
|
this.handle,
|
|
4147
|
-
|
|
4167
|
+
t,
|
|
4148
4168
|
n
|
|
4149
4169
|
);
|
|
4150
|
-
if (
|
|
4151
|
-
const
|
|
4152
|
-
for (const [i, o2] of Object.entries(
|
|
4153
|
-
|
|
4154
|
-
return
|
|
4170
|
+
if (s === void 0) return;
|
|
4171
|
+
const r = {};
|
|
4172
|
+
for (const [i, o2] of Object.entries(s))
|
|
4173
|
+
r[i] = Z(o2, (l) => new _(l));
|
|
4174
|
+
return r;
|
|
4155
4175
|
}
|
|
4156
4176
|
getFileContentAsBase64() {
|
|
4157
4177
|
return new g(u().getBlobContentAsBase64(this.handle));
|
|
@@ -4162,7 +4182,7 @@
|
|
|
4162
4182
|
getFileContentAsJson() {
|
|
4163
4183
|
return new g(
|
|
4164
4184
|
u().getBlobContentAsString(this.handle)
|
|
4165
|
-
).mapDefined((
|
|
4185
|
+
).mapDefined((t) => JSON.parse(t));
|
|
4166
4186
|
}
|
|
4167
4187
|
/**
|
|
4168
4188
|
* @deprecated use getFileContentAsBase64
|
|
@@ -4203,17 +4223,17 @@
|
|
|
4203
4223
|
getImportProgress() {
|
|
4204
4224
|
return new g(u().getImportProgress(this.handle));
|
|
4205
4225
|
}
|
|
4206
|
-
getLastLogs(
|
|
4207
|
-
return new g(u().getLastLogs(this.handle,
|
|
4226
|
+
getLastLogs(t) {
|
|
4227
|
+
return new g(u().getLastLogs(this.handle, t));
|
|
4208
4228
|
}
|
|
4209
|
-
getProgressLog(
|
|
4210
|
-
return new g(u().getProgressLog(this.handle,
|
|
4229
|
+
getProgressLog(t) {
|
|
4230
|
+
return new g(u().getProgressLog(this.handle, t));
|
|
4211
4231
|
}
|
|
4212
4232
|
getLogHandle() {
|
|
4213
4233
|
return new g(u().getLogHandle(this.handle));
|
|
4214
4234
|
}
|
|
4215
|
-
allFieldsResolved(
|
|
4216
|
-
switch (
|
|
4235
|
+
allFieldsResolved(t = "Input") {
|
|
4236
|
+
switch (t) {
|
|
4217
4237
|
case "Input":
|
|
4218
4238
|
return this.getInputsLocked() && this.listInputFields().every(
|
|
4219
4239
|
(n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
|
|
@@ -4224,104 +4244,104 @@
|
|
|
4224
4244
|
);
|
|
4225
4245
|
}
|
|
4226
4246
|
}
|
|
4227
|
-
mapFields(
|
|
4228
|
-
const { fieldType:
|
|
4247
|
+
mapFields(t, n) {
|
|
4248
|
+
const { fieldType: s, requireLocked: r, skipUnresolved: i } = {
|
|
4229
4249
|
fieldType: "Input",
|
|
4230
4250
|
requireLocked: true,
|
|
4231
4251
|
skipUnresolved: false,
|
|
4232
4252
|
...n
|
|
4233
|
-
}, o2 =
|
|
4234
|
-
if (
|
|
4253
|
+
}, o2 = t;
|
|
4254
|
+
if (r && (s === "Input" && !this.getInputsLocked() || s === "Output" && !this.getOutputsLocked()))
|
|
4235
4255
|
return;
|
|
4236
|
-
let
|
|
4237
|
-
(
|
|
4256
|
+
let a = (s === "Input" ? this.listInputFields() : s === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
4257
|
+
(c) => [c, this.resolve({ field: c, assertFieldType: s })]
|
|
4238
4258
|
);
|
|
4239
|
-
return i && (
|
|
4259
|
+
return i && (a = a.filter((c) => c[1] !== void 0)), a.map(([c, f2]) => o2(c, f2));
|
|
4240
4260
|
}
|
|
4241
4261
|
}
|
|
4242
|
-
const
|
|
4243
|
-
const
|
|
4244
|
-
type: z.string(),
|
|
4245
|
-
importance: z.number().optional(),
|
|
4246
|
-
id: z.string().optional(),
|
|
4247
|
-
label: z.string()
|
|
4248
|
-
}),
|
|
4249
|
-
function
|
|
4250
|
-
const
|
|
4262
|
+
const rt = "staging", it = "main";
|
|
4263
|
+
const It = "pl7.app/label", Pt = "pl7.app/trace", Rt = z$1.object({
|
|
4264
|
+
type: z$1.string(),
|
|
4265
|
+
importance: z$1.number().optional(),
|
|
4266
|
+
id: z$1.string().optional(),
|
|
4267
|
+
label: z$1.string()
|
|
4268
|
+
}), Ft = z$1.array(Rt), Tt = 1e-3, Ot = "__LABEL__", Q = "__LABEL__@1";
|
|
4269
|
+
function Dt(e, t, n = {}) {
|
|
4270
|
+
const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = e.map((p) => {
|
|
4251
4271
|
var q, z2;
|
|
4252
|
-
const m =
|
|
4272
|
+
const m = t(p), y = (q = m.annotations) == null ? void 0 : q[It], T2 = (z2 = m.annotations) == null ? void 0 : z2[Pt], b = (T2 ? Ft.safeParse(JSON.parse(T2)).data : void 0) ?? [];
|
|
4253
4273
|
if (y) {
|
|
4254
|
-
const
|
|
4255
|
-
n.addLabelAsSuffix ? b.push(
|
|
4274
|
+
const v2 = { label: y, type: Ot, importance: -2 };
|
|
4275
|
+
n.addLabelAsSuffix ? b.push(v2) : b.splice(0, 0, v2);
|
|
4256
4276
|
}
|
|
4257
4277
|
const E = [], W = /* @__PURE__ */ new Map();
|
|
4258
|
-
for (let
|
|
4259
|
-
const { type: V } = b[
|
|
4278
|
+
for (let v2 = b.length - 1; v2 >= 0; --v2) {
|
|
4279
|
+
const { type: V } = b[v2], ut = b[v2].importance ?? 0, j = (W.get(V) ?? 0) + 1;
|
|
4260
4280
|
W.set(V, j);
|
|
4261
4281
|
const I = `${V}@${j}`;
|
|
4262
|
-
|
|
4282
|
+
r.set(I, (r.get(I) ?? 0) + 1), s.set(
|
|
4263
4283
|
I,
|
|
4264
4284
|
Math.max(
|
|
4265
|
-
|
|
4266
|
-
|
|
4285
|
+
s.get(I) ?? Number.NEGATIVE_INFINITY,
|
|
4286
|
+
ut - (b.length - v2) * Tt
|
|
4267
4287
|
)
|
|
4268
|
-
), E.push({ ...b[
|
|
4288
|
+
), E.push({ ...b[v2], fullType: I, occurenceIndex: j });
|
|
4269
4289
|
}
|
|
4270
4290
|
return E.reverse(), {
|
|
4271
|
-
value:
|
|
4291
|
+
value: p,
|
|
4272
4292
|
spec: m,
|
|
4273
4293
|
label: y,
|
|
4274
4294
|
fullTrace: E
|
|
4275
4295
|
};
|
|
4276
|
-
}), o2 = [],
|
|
4277
|
-
|
|
4278
|
-
for (const [
|
|
4279
|
-
|
|
4280
|
-
const
|
|
4281
|
-
const y = m.fullTrace.filter((b) =>
|
|
4296
|
+
}), o2 = [], l = [], a = [...s];
|
|
4297
|
+
a.sort(([, p], [, m]) => m - p);
|
|
4298
|
+
for (const [p] of a)
|
|
4299
|
+
p.endsWith("@1") || r.get(p) === e.length ? o2.push(p) : l.push(p);
|
|
4300
|
+
const c = (p) => i.map((m) => {
|
|
4301
|
+
const y = m.fullTrace.filter((b) => p.has(b.fullType)).map((b) => b.label), T2 = n.separator ?? " / ";
|
|
4282
4302
|
return {
|
|
4283
|
-
label: y.join(
|
|
4303
|
+
label: y.join(T2),
|
|
4284
4304
|
value: m.value
|
|
4285
4305
|
};
|
|
4286
4306
|
});
|
|
4287
4307
|
if (o2.length === 0) {
|
|
4288
|
-
if (
|
|
4289
|
-
return
|
|
4290
|
-
}
|
|
4291
|
-
let
|
|
4292
|
-
for (;
|
|
4293
|
-
const
|
|
4294
|
-
n.includeNativeLabel &&
|
|
4295
|
-
for (let y = 0; y <
|
|
4296
|
-
|
|
4297
|
-
const m =
|
|
4298
|
-
if (new Set(m.map((y) => y.label)).size ===
|
|
4299
|
-
|
|
4300
|
-
}
|
|
4301
|
-
return
|
|
4308
|
+
if (l.length !== 0) throw new Error("Assertion error.");
|
|
4309
|
+
return c(new Set(Q));
|
|
4310
|
+
}
|
|
4311
|
+
let f2 = 0, S2 = 0;
|
|
4312
|
+
for (; f2 < o2.length; ) {
|
|
4313
|
+
const p = /* @__PURE__ */ new Set();
|
|
4314
|
+
n.includeNativeLabel && p.add(Q);
|
|
4315
|
+
for (let y = 0; y < f2; ++y) p.add(o2[y]);
|
|
4316
|
+
p.add(o2[S2]);
|
|
4317
|
+
const m = c(p);
|
|
4318
|
+
if (new Set(m.map((y) => y.label)).size === e.length) return m;
|
|
4319
|
+
S2++, S2 == o2.length && (f2++, S2 = f2);
|
|
4320
|
+
}
|
|
4321
|
+
return c(/* @__PURE__ */ new Set([...o2, ...l]));
|
|
4302
4322
|
}
|
|
4303
|
-
class
|
|
4323
|
+
class kt {
|
|
4304
4324
|
constructor() {
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
var
|
|
4308
|
-
return ((
|
|
4325
|
+
w(this, "ctx", u());
|
|
4326
|
+
w(this, "defaultLabelFn", (t, n) => {
|
|
4327
|
+
var s;
|
|
4328
|
+
return ((s = t.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
|
|
4309
4329
|
});
|
|
4310
4330
|
}
|
|
4311
4331
|
/**
|
|
4312
4332
|
* @deprecated use getOptions()
|
|
4313
4333
|
*/
|
|
4314
|
-
calculateOptions(
|
|
4315
|
-
return this.ctx.calculateOptions(
|
|
4334
|
+
calculateOptions(t) {
|
|
4335
|
+
return this.ctx.calculateOptions(t);
|
|
4316
4336
|
}
|
|
4317
|
-
getOptions(
|
|
4318
|
-
const
|
|
4319
|
-
return typeof n == "object" || typeof n > "u" ?
|
|
4320
|
-
ref:
|
|
4337
|
+
getOptions(t, n) {
|
|
4338
|
+
const s = this.getSpecs().entries.filter((r) => t(r.obj));
|
|
4339
|
+
return typeof n == "object" || typeof n > "u" ? Dt(s, (r) => r.obj, n ?? {}).map(({ value: { ref: r }, label: i }) => ({
|
|
4340
|
+
ref: r,
|
|
4321
4341
|
label: i
|
|
4322
|
-
})) :
|
|
4323
|
-
ref:
|
|
4324
|
-
label: n(
|
|
4342
|
+
})) : s.map((r) => ({
|
|
4343
|
+
ref: r.ref,
|
|
4344
|
+
label: n(r.obj, r.ref)
|
|
4325
4345
|
}));
|
|
4326
4346
|
}
|
|
4327
4347
|
/**
|
|
@@ -4331,14 +4351,14 @@
|
|
|
4331
4351
|
return this.getData();
|
|
4332
4352
|
}
|
|
4333
4353
|
getData() {
|
|
4334
|
-
const
|
|
4354
|
+
const t = this.ctx.getDataFromResultPool();
|
|
4335
4355
|
return {
|
|
4336
|
-
isComplete:
|
|
4337
|
-
entries:
|
|
4356
|
+
isComplete: t.isComplete,
|
|
4357
|
+
entries: t.entries.map((n) => ({
|
|
4338
4358
|
ref: n.ref,
|
|
4339
4359
|
obj: {
|
|
4340
4360
|
...n.obj,
|
|
4341
|
-
data: new
|
|
4361
|
+
data: new _(n.obj.data)
|
|
4342
4362
|
}
|
|
4343
4363
|
}))
|
|
4344
4364
|
};
|
|
@@ -4350,14 +4370,14 @@
|
|
|
4350
4370
|
return this.getDataWithErrors();
|
|
4351
4371
|
}
|
|
4352
4372
|
getDataWithErrors() {
|
|
4353
|
-
const
|
|
4373
|
+
const t = this.ctx.getDataWithErrorsFromResultPool();
|
|
4354
4374
|
return {
|
|
4355
|
-
isComplete:
|
|
4356
|
-
entries:
|
|
4375
|
+
isComplete: t.isComplete,
|
|
4376
|
+
entries: t.entries.map((n) => ({
|
|
4357
4377
|
ref: n.ref,
|
|
4358
4378
|
obj: {
|
|
4359
4379
|
...n.obj,
|
|
4360
|
-
data:
|
|
4380
|
+
data: v(n.obj.data, (s) => new _(s))
|
|
4361
4381
|
}
|
|
4362
4382
|
}))
|
|
4363
4383
|
};
|
|
@@ -4375,13 +4395,13 @@
|
|
|
4375
4395
|
* @param ref a Ref
|
|
4376
4396
|
* @returns data associated with the ref
|
|
4377
4397
|
*/
|
|
4378
|
-
getDataByRef(
|
|
4398
|
+
getDataByRef(t) {
|
|
4379
4399
|
var n;
|
|
4380
4400
|
return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
|
|
4381
|
-
(
|
|
4382
|
-
)) == null ? void 0 : n.obj :
|
|
4383
|
-
this.ctx.getDataFromResultPoolByRef(
|
|
4384
|
-
(
|
|
4401
|
+
(s) => s.ref.blockId === t.blockId && s.ref.name === t.name
|
|
4402
|
+
)) == null ? void 0 : n.obj : Z(
|
|
4403
|
+
this.ctx.getDataFromResultPoolByRef(t.blockId, t.name),
|
|
4404
|
+
(s) => new _(s)
|
|
4385
4405
|
);
|
|
4386
4406
|
}
|
|
4387
4407
|
/**
|
|
@@ -4389,65 +4409,65 @@
|
|
|
4389
4409
|
* @param ref a Ref
|
|
4390
4410
|
* @returns p-column associated with the ref
|
|
4391
4411
|
*/
|
|
4392
|
-
getPColumnByRef(
|
|
4393
|
-
const n = this.getDataByRef(
|
|
4412
|
+
getPColumnByRef(t) {
|
|
4413
|
+
const n = this.getDataByRef(t);
|
|
4394
4414
|
if (n)
|
|
4395
|
-
return
|
|
4415
|
+
return Y(n);
|
|
4396
4416
|
}
|
|
4397
4417
|
/**
|
|
4398
4418
|
* @param ref a Ref
|
|
4399
4419
|
* @returns object spec associated with the ref
|
|
4400
4420
|
*/
|
|
4401
|
-
getSpecByRef(
|
|
4421
|
+
getSpecByRef(t) {
|
|
4402
4422
|
var n;
|
|
4403
4423
|
return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
|
|
4404
|
-
(
|
|
4405
|
-
)) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(
|
|
4424
|
+
(s) => s.ref.blockId === t.blockId && s.ref.name === t.name
|
|
4425
|
+
)) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(t.blockId, t.name);
|
|
4406
4426
|
}
|
|
4407
4427
|
/**
|
|
4408
4428
|
* @param spec object specification
|
|
4409
4429
|
* @returns array of data objects with compatible specs
|
|
4410
4430
|
* @deprecated delete this method after Jan 1, 2025
|
|
4411
4431
|
*/
|
|
4412
|
-
findDataWithCompatibleSpec(
|
|
4432
|
+
findDataWithCompatibleSpec(t) {
|
|
4413
4433
|
const n = [];
|
|
4414
|
-
|
|
4415
|
-
if (!o(
|
|
4434
|
+
t: for (const s of this.getData().entries) {
|
|
4435
|
+
if (!o(s.obj.spec))
|
|
4416
4436
|
continue;
|
|
4417
|
-
const
|
|
4418
|
-
if (
|
|
4419
|
-
for (let i = 0; i <
|
|
4420
|
-
const o2 =
|
|
4421
|
-
if (o2.name !==
|
|
4422
|
-
continue
|
|
4437
|
+
const r = s.obj.spec;
|
|
4438
|
+
if (t.name === r.name && t.valueType === r.valueType && t.axesSpec.length === r.axesSpec.length && $(t.domain, r.domain)) {
|
|
4439
|
+
for (let i = 0; i < t.axesSpec.length; ++i) {
|
|
4440
|
+
const o2 = t.axesSpec[i], l = r.axesSpec[i];
|
|
4441
|
+
if (o2.name !== l.name || o2.type !== l.type || !$(o2.domain, l.domain))
|
|
4442
|
+
continue t;
|
|
4423
4443
|
}
|
|
4424
|
-
n.push(
|
|
4444
|
+
n.push(s.obj);
|
|
4425
4445
|
}
|
|
4426
4446
|
}
|
|
4427
4447
|
return n;
|
|
4428
4448
|
}
|
|
4429
4449
|
}
|
|
4430
|
-
function $(
|
|
4431
|
-
if (
|
|
4432
|
-
if (
|
|
4433
|
-
for (const n in
|
|
4434
|
-
if (
|
|
4450
|
+
function $(e, t) {
|
|
4451
|
+
if (e === void 0) return t === void 0;
|
|
4452
|
+
if (t === void 0) return true;
|
|
4453
|
+
for (const n in t)
|
|
4454
|
+
if (e[n] !== t[n]) return false;
|
|
4435
4455
|
return true;
|
|
4436
4456
|
}
|
|
4437
4457
|
class D {
|
|
4438
4458
|
constructor() {
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4459
|
+
w(this, "ctx");
|
|
4460
|
+
w(this, "args");
|
|
4461
|
+
w(this, "uiState");
|
|
4462
|
+
w(this, "resultPool", new kt());
|
|
4443
4463
|
this.ctx = u(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
|
|
4444
4464
|
}
|
|
4445
|
-
getNamedAccessor(
|
|
4446
|
-
const n = this.ctx.getAccessorHandleByName(
|
|
4447
|
-
return n ? new
|
|
4465
|
+
getNamedAccessor(t) {
|
|
4466
|
+
const n = this.ctx.getAccessorHandleByName(t);
|
|
4467
|
+
return n ? new _(n) : void 0;
|
|
4448
4468
|
}
|
|
4449
4469
|
get prerun() {
|
|
4450
|
-
return this.getNamedAccessor(
|
|
4470
|
+
return this.getNamedAccessor(rt);
|
|
4451
4471
|
}
|
|
4452
4472
|
/**
|
|
4453
4473
|
* @deprecated use prerun
|
|
@@ -4462,7 +4482,7 @@
|
|
|
4462
4482
|
return this.precalc;
|
|
4463
4483
|
}
|
|
4464
4484
|
get outputs() {
|
|
4465
|
-
return this.getNamedAccessor(
|
|
4485
|
+
return this.getNamedAccessor(it);
|
|
4466
4486
|
}
|
|
4467
4487
|
/**
|
|
4468
4488
|
* @deprecated use outputs
|
|
@@ -4474,136 +4494,71 @@
|
|
|
4474
4494
|
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
4475
4495
|
* @returns a map of axis value => label
|
|
4476
4496
|
*/
|
|
4477
|
-
findLabels(
|
|
4497
|
+
findLabels(t) {
|
|
4478
4498
|
const n = this.resultPool.getData();
|
|
4479
|
-
for (const
|
|
4480
|
-
if (!
|
|
4481
|
-
const
|
|
4482
|
-
if (
|
|
4483
|
-
if (
|
|
4484
|
-
throw Error(`Expected JSON column for labels, got: ${
|
|
4499
|
+
for (const s of n.entries) {
|
|
4500
|
+
if (!U$1(s.obj)) continue;
|
|
4501
|
+
const r = s.obj.spec;
|
|
4502
|
+
if (r.name === "pl7.app/label" && r.axesSpec.length === 1 && r.axesSpec[0].name === t.name && r.axesSpec[0].type === t.type && $(t.domain, r.axesSpec[0].domain)) {
|
|
4503
|
+
if (s.obj.data.resourceType.name !== "PColumnData/Json")
|
|
4504
|
+
throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);
|
|
4485
4505
|
return new Map(
|
|
4486
4506
|
Object.entries(
|
|
4487
|
-
|
|
4507
|
+
s.obj.data.getDataAsJson().data
|
|
4488
4508
|
).map((o2) => [JSON.parse(o2[0])[0], o2[1]])
|
|
4489
4509
|
);
|
|
4490
4510
|
}
|
|
4491
4511
|
}
|
|
4492
4512
|
}
|
|
4493
|
-
|
|
4494
|
-
|
|
4513
|
+
verifyInlineColumnsSupport(t) {
|
|
4514
|
+
var r;
|
|
4515
|
+
const n = t.some((i) => !(i.data instanceof _)), s = ((r = this.ctx.featureFlags) == null ? void 0 : r.inlineColumnsSupport) === true;
|
|
4516
|
+
if (n && !s) throw Error("inline columns not supported");
|
|
4495
4517
|
}
|
|
4496
|
-
|
|
4518
|
+
createPFrame(t) {
|
|
4519
|
+
return this.verifyInlineColumnsSupport(t), this.ctx.createPFrame(t.map((n) => Z(
|
|
4520
|
+
n,
|
|
4521
|
+
(s) => s instanceof _ ? s.handle : s
|
|
4522
|
+
)));
|
|
4523
|
+
}
|
|
4524
|
+
createPTable(t) {
|
|
4497
4525
|
var n;
|
|
4498
|
-
return "columns" in
|
|
4526
|
+
return "columns" in t ? n = {
|
|
4499
4527
|
src: {
|
|
4500
4528
|
type: "full",
|
|
4501
|
-
entries:
|
|
4529
|
+
entries: t.columns.map((s) => ({ type: "column", column: s }))
|
|
4502
4530
|
},
|
|
4503
|
-
filters:
|
|
4504
|
-
sorting:
|
|
4505
|
-
} : n =
|
|
4531
|
+
filters: t.filters ?? [],
|
|
4532
|
+
sorting: t.sorting ?? []
|
|
4533
|
+
} : n = t, this.verifyInlineColumnsSupport(T(n.src)), this.ctx.createPTable(M(n, (s) => Z(
|
|
4534
|
+
s,
|
|
4535
|
+
(r) => r instanceof _ ? r.handle : r
|
|
4536
|
+
)));
|
|
4506
4537
|
}
|
|
4507
4538
|
/** @deprecated scheduled for removal from SDK */
|
|
4508
|
-
getBlockLabel(
|
|
4509
|
-
return this.ctx.getBlockLabel(
|
|
4539
|
+
getBlockLabel(t) {
|
|
4540
|
+
return this.ctx.getBlockLabel(t);
|
|
4510
4541
|
}
|
|
4511
4542
|
getCurrentUnstableMarker() {
|
|
4512
4543
|
if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
|
|
4513
4544
|
return this.ctx.getCurrentUnstableMarker();
|
|
4514
4545
|
}
|
|
4515
4546
|
}
|
|
4516
|
-
const
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
if (t.endsWith(".values"))
|
|
4520
|
-
return t.substring(0, t.length - 7);
|
|
4521
|
-
throw Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
|
|
4522
|
-
}
|
|
4523
|
-
};
|
|
4524
|
-
function De(t) {
|
|
4525
|
-
if (!t) return;
|
|
4526
|
-
const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
|
|
4527
|
-
let s2 = 0;
|
|
4528
|
-
switch (e) {
|
|
4529
|
-
case K:
|
|
4530
|
-
s2 = n.keyLength;
|
|
4531
|
-
break;
|
|
4532
|
-
case G:
|
|
4533
|
-
s2 = n.partitionKeyLength + n.keyLength;
|
|
4534
|
-
break;
|
|
4535
|
-
case Z:
|
|
4536
|
-
case M:
|
|
4537
|
-
s2 = n.partitionKeyLength;
|
|
4538
|
-
break;
|
|
4539
|
-
case B:
|
|
4540
|
-
case ee:
|
|
4541
|
-
s2 = n.superPartitionKeyLength + n.partitionKeyLength;
|
|
4542
|
-
break;
|
|
4543
|
-
}
|
|
4544
|
-
switch (e) {
|
|
4545
|
-
case K:
|
|
4546
|
-
case Z:
|
|
4547
|
-
case M:
|
|
4548
|
-
for (let i of t.listInputFields()) {
|
|
4549
|
-
if (e === M) {
|
|
4550
|
-
const a = te(i);
|
|
4551
|
-
if (a) i = a;
|
|
4552
|
-
else continue;
|
|
4553
|
-
}
|
|
4554
|
-
const o2 = [...JSON.parse(i)];
|
|
4555
|
-
r.push(o2);
|
|
4556
|
-
}
|
|
4557
|
-
break;
|
|
4558
|
-
case G:
|
|
4559
|
-
case B:
|
|
4560
|
-
case ee:
|
|
4561
|
-
for (const i of t.listInputFields()) {
|
|
4562
|
-
const o2 = [...JSON.parse(i)], a = t.resolve({ field: i, assertFieldType: "Input" });
|
|
4563
|
-
if (a !== void 0)
|
|
4564
|
-
for (let l of a.listInputFields()) {
|
|
4565
|
-
if (e === B) {
|
|
4566
|
-
const f = te(l);
|
|
4567
|
-
if (f) l = f;
|
|
4568
|
-
else continue;
|
|
4569
|
-
}
|
|
4570
|
-
const c2 = [...o2, ...JSON.parse(l)];
|
|
4571
|
-
r.push(c2);
|
|
4572
|
-
}
|
|
4573
|
-
}
|
|
4574
|
-
break;
|
|
4575
|
-
}
|
|
4576
|
-
return { data: r, keyLength: s2 };
|
|
4577
|
-
}
|
|
4578
|
-
function pt(t) {
|
|
4579
|
-
const e = De(t);
|
|
4580
|
-
if (!e) return;
|
|
4581
|
-
const { data: n, keyLength: r } = e, s2 = [];
|
|
4582
|
-
for (let i = 0; i < r; ++i)
|
|
4583
|
-
s2.push(/* @__PURE__ */ new Set());
|
|
4584
|
-
for (const i of n) {
|
|
4585
|
-
if (i.length !== r)
|
|
4586
|
-
throw new Error("key length does not match partition length");
|
|
4587
|
-
for (let o2 = 0; o2 < r; ++o2)
|
|
4588
|
-
s2[o2].add(i[o2]);
|
|
4589
|
-
}
|
|
4590
|
-
return s2.map((i) => Array.from(i.values()));
|
|
4591
|
-
}
|
|
4592
|
-
const C = "1.17.0";
|
|
4593
|
-
function ke(t) {
|
|
4594
|
-
return t.__renderLambda === true;
|
|
4547
|
+
const P = "1.19.0";
|
|
4548
|
+
function xt(e) {
|
|
4549
|
+
return e.__renderLambda === true;
|
|
4595
4550
|
}
|
|
4596
|
-
function U(
|
|
4597
|
-
if (
|
|
4598
|
-
return
|
|
4551
|
+
function U(e) {
|
|
4552
|
+
if (e !== void 0)
|
|
4553
|
+
return xt(e) ? e.handle : e;
|
|
4599
4554
|
}
|
|
4600
4555
|
class h {
|
|
4601
|
-
constructor(
|
|
4602
|
-
this._renderingMode =
|
|
4556
|
+
constructor(t, n, s, r, i, o2, l) {
|
|
4557
|
+
this._renderingMode = t, this._initialArgs = n, this._initialUiState = s, this._outputs = r, this._inputsValid = i, this._sections = o2, this._title = l;
|
|
4603
4558
|
}
|
|
4604
|
-
static create(
|
|
4559
|
+
static create(t = "Heavy") {
|
|
4605
4560
|
return new h(
|
|
4606
|
-
|
|
4561
|
+
t,
|
|
4607
4562
|
void 0,
|
|
4608
4563
|
{},
|
|
4609
4564
|
{},
|
|
@@ -4612,19 +4567,19 @@
|
|
|
4612
4567
|
void 0
|
|
4613
4568
|
);
|
|
4614
4569
|
}
|
|
4615
|
-
output(
|
|
4570
|
+
output(t, n, s = {}) {
|
|
4616
4571
|
if (typeof n == "function") {
|
|
4617
|
-
const
|
|
4618
|
-
return O(
|
|
4572
|
+
const r = `output#${t}`;
|
|
4573
|
+
return O(r, () => n(new D())), new h(
|
|
4619
4574
|
this._renderingMode,
|
|
4620
4575
|
this._initialArgs,
|
|
4621
4576
|
this._initialUiState,
|
|
4622
4577
|
{
|
|
4623
4578
|
...this._outputs,
|
|
4624
|
-
[
|
|
4579
|
+
[t]: {
|
|
4625
4580
|
__renderLambda: true,
|
|
4626
|
-
handle:
|
|
4627
|
-
...
|
|
4581
|
+
handle: r,
|
|
4582
|
+
...s
|
|
4628
4583
|
}
|
|
4629
4584
|
},
|
|
4630
4585
|
this._inputsValid,
|
|
@@ -4638,7 +4593,7 @@
|
|
|
4638
4593
|
this._initialUiState,
|
|
4639
4594
|
{
|
|
4640
4595
|
...this._outputs,
|
|
4641
|
-
[
|
|
4596
|
+
[t]: n
|
|
4642
4597
|
},
|
|
4643
4598
|
this._inputsValid,
|
|
4644
4599
|
this._sections,
|
|
@@ -4646,15 +4601,15 @@
|
|
|
4646
4601
|
);
|
|
4647
4602
|
}
|
|
4648
4603
|
/** Shortcut for {@link output} with retentive flag set to true. */
|
|
4649
|
-
retentiveOutput(
|
|
4650
|
-
return this.output(
|
|
4604
|
+
retentiveOutput(t, n) {
|
|
4605
|
+
return this.output(t, n, { retentive: true });
|
|
4651
4606
|
}
|
|
4652
4607
|
/** @deprecated */
|
|
4653
|
-
canRun(
|
|
4654
|
-
return this.inputsValid(
|
|
4608
|
+
canRun(t) {
|
|
4609
|
+
return this.inputsValid(t);
|
|
4655
4610
|
}
|
|
4656
|
-
argsValid(
|
|
4657
|
-
return typeof
|
|
4611
|
+
argsValid(t) {
|
|
4612
|
+
return typeof t == "function" ? (O("inputsValid", () => t(new D())), new h(
|
|
4658
4613
|
this._renderingMode,
|
|
4659
4614
|
this._initialArgs,
|
|
4660
4615
|
this._initialUiState,
|
|
@@ -4670,16 +4625,16 @@
|
|
|
4670
4625
|
this._initialArgs,
|
|
4671
4626
|
this._initialUiState,
|
|
4672
4627
|
this._outputs,
|
|
4673
|
-
|
|
4628
|
+
t,
|
|
4674
4629
|
this._sections,
|
|
4675
4630
|
this._title
|
|
4676
4631
|
);
|
|
4677
4632
|
}
|
|
4678
|
-
inputsValid(
|
|
4679
|
-
return this.argsValid(
|
|
4633
|
+
inputsValid(t) {
|
|
4634
|
+
return this.argsValid(t);
|
|
4680
4635
|
}
|
|
4681
|
-
sections(
|
|
4682
|
-
return Array.isArray(
|
|
4636
|
+
sections(t) {
|
|
4637
|
+
return Array.isArray(t) ? this.sections(k(t)) : typeof t == "function" ? (O("sections", () => t(new D())), new h(
|
|
4683
4638
|
this._renderingMode,
|
|
4684
4639
|
this._initialArgs,
|
|
4685
4640
|
this._initialUiState,
|
|
@@ -4693,12 +4648,12 @@
|
|
|
4693
4648
|
this._initialUiState,
|
|
4694
4649
|
this._outputs,
|
|
4695
4650
|
this._inputsValid,
|
|
4696
|
-
|
|
4651
|
+
t,
|
|
4697
4652
|
this._title
|
|
4698
4653
|
);
|
|
4699
4654
|
}
|
|
4700
|
-
title(
|
|
4701
|
-
return O("title", () =>
|
|
4655
|
+
title(t) {
|
|
4656
|
+
return O("title", () => t(new D())), new h(
|
|
4702
4657
|
this._renderingMode,
|
|
4703
4658
|
this._initialArgs,
|
|
4704
4659
|
this._initialUiState,
|
|
@@ -4712,10 +4667,10 @@
|
|
|
4712
4667
|
* Sets initial args for the block, this value must be specified.
|
|
4713
4668
|
* @deprecated use {@link withArgs}
|
|
4714
4669
|
* */
|
|
4715
|
-
initialArgs(
|
|
4670
|
+
initialArgs(t) {
|
|
4716
4671
|
return new h(
|
|
4717
4672
|
this._renderingMode,
|
|
4718
|
-
|
|
4673
|
+
t,
|
|
4719
4674
|
this._initialUiState,
|
|
4720
4675
|
this._outputs,
|
|
4721
4676
|
this._inputsValid,
|
|
@@ -4724,10 +4679,10 @@
|
|
|
4724
4679
|
);
|
|
4725
4680
|
}
|
|
4726
4681
|
/** Sets initial args for the block, this value must be specified. */
|
|
4727
|
-
withArgs(
|
|
4682
|
+
withArgs(t) {
|
|
4728
4683
|
return new h(
|
|
4729
4684
|
this._renderingMode,
|
|
4730
|
-
|
|
4685
|
+
t,
|
|
4731
4686
|
this._initialUiState,
|
|
4732
4687
|
this._outputs,
|
|
4733
4688
|
this._inputsValid,
|
|
@@ -4736,11 +4691,11 @@
|
|
|
4736
4691
|
);
|
|
4737
4692
|
}
|
|
4738
4693
|
/** Defines type and sets initial value for block UiState. */
|
|
4739
|
-
withUiState(
|
|
4694
|
+
withUiState(t) {
|
|
4740
4695
|
return new h(
|
|
4741
4696
|
this._renderingMode,
|
|
4742
4697
|
this._initialArgs,
|
|
4743
|
-
|
|
4698
|
+
t,
|
|
4744
4699
|
this._outputs,
|
|
4745
4700
|
this._inputsValid,
|
|
4746
4701
|
this._sections,
|
|
@@ -4752,9 +4707,9 @@
|
|
|
4752
4707
|
* other features provided by the platforma to the block. */
|
|
4753
4708
|
done() {
|
|
4754
4709
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
4755
|
-
const
|
|
4710
|
+
const t = {
|
|
4756
4711
|
v3: {
|
|
4757
|
-
sdkVersion:
|
|
4712
|
+
sdkVersion: P,
|
|
4758
4713
|
renderingMode: this._renderingMode,
|
|
4759
4714
|
initialArgs: this._initialArgs,
|
|
4760
4715
|
initialUiState: this._initialUiState,
|
|
@@ -4764,80 +4719,80 @@
|
|
|
4764
4719
|
outputs: this._outputs
|
|
4765
4720
|
},
|
|
4766
4721
|
// fields below are added to allow previous desktop versions read generated configs
|
|
4767
|
-
sdkVersion:
|
|
4722
|
+
sdkVersion: P,
|
|
4768
4723
|
renderingMode: this._renderingMode,
|
|
4769
4724
|
initialArgs: this._initialArgs,
|
|
4770
4725
|
inputsValid: U(this._inputsValid),
|
|
4771
4726
|
sections: U(this._sections),
|
|
4772
4727
|
outputs: Object.fromEntries(
|
|
4773
|
-
Object.entries(this._outputs).map(([n,
|
|
4728
|
+
Object.entries(this._outputs).map(([n, s]) => [n, U(s)])
|
|
4774
4729
|
)
|
|
4775
4730
|
};
|
|
4776
|
-
return
|
|
4731
|
+
return vt() ? st({ sdkVersion: P }) : { config: t };
|
|
4777
4732
|
}
|
|
4778
4733
|
}
|
|
4779
|
-
function
|
|
4780
|
-
var o2,
|
|
4781
|
-
const
|
|
4782
|
-
for (const
|
|
4783
|
-
for (const
|
|
4784
|
-
const
|
|
4785
|
-
for (const
|
|
4786
|
-
|
|
4734
|
+
function me(e, t, n, s) {
|
|
4735
|
+
var o2, l;
|
|
4736
|
+
const r = e.resultPool.getData().entries.map((a) => a.obj).filter(U$1).filter((a) => a.spec.name === "pl7.app/label" && a.spec.axesSpec.length === 1), i = /* @__PURE__ */ new Map();
|
|
4737
|
+
for (const a of t)
|
|
4738
|
+
for (const c of a.spec.axesSpec) {
|
|
4739
|
+
const f2 = S(c);
|
|
4740
|
+
for (const S$1 of r)
|
|
4741
|
+
z(f2, S(S$1.spec.axesSpec[0])) && i.set(S$1.id, S$1);
|
|
4787
4742
|
}
|
|
4788
|
-
if (![...
|
|
4789
|
-
|
|
4743
|
+
if (![...t, ...i.values()].some(
|
|
4744
|
+
(a) => a.data instanceof _ && !a.data.getIsReadyOrError()
|
|
4745
|
+
))
|
|
4746
|
+
return e.createPTable({
|
|
4790
4747
|
src: {
|
|
4791
4748
|
type: "outer",
|
|
4792
4749
|
primary: {
|
|
4793
4750
|
type: "full",
|
|
4794
|
-
entries:
|
|
4751
|
+
entries: t.map((a) => ({ type: "column", column: a }))
|
|
4795
4752
|
},
|
|
4796
|
-
secondary:
|
|
4753
|
+
secondary: [...i.values()].map((a) => ({ type: "column", column: a }))
|
|
4797
4754
|
},
|
|
4798
|
-
filters: [...((o2 = n == null ? void 0 : n.pTableParams) == null ? void 0 : o2.filters) ?? [], ...
|
|
4799
|
-
sorting: ((
|
|
4755
|
+
filters: [...((o2 = n == null ? void 0 : n.pTableParams) == null ? void 0 : o2.filters) ?? [], ...s ?? []],
|
|
4756
|
+
sorting: ((l = n == null ? void 0 : n.pTableParams) == null ? void 0 : l.sorting) ?? []
|
|
4800
4757
|
});
|
|
4801
4758
|
}
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
return {
|
|
4805
|
-
axis: e,
|
|
4806
|
-
options: n.map((s2) => ({
|
|
4807
|
-
value: s2,
|
|
4808
|
-
label: (r == null ? void 0 : r.get(s2)) ?? s2.toString()
|
|
4809
|
-
})),
|
|
4810
|
-
defaultValue: n[0]
|
|
4811
|
-
};
|
|
4812
|
-
}
|
|
4813
|
-
const $BlockArgs = z.object({
|
|
4814
|
-
numbers: z.array(z.coerce.number())
|
|
4759
|
+
const $BlockArgs = z$1.object({
|
|
4760
|
+
numbers: z$1.array(z$1.coerce.number())
|
|
4815
4761
|
});
|
|
4816
4762
|
const platforma = h.create("Heavy").withArgs({ numbers: [1, 2, 3] }).withUiState({ dataTableState: void 0 }).output("numbers", (ctx) => {
|
|
4817
4763
|
var _a, _b;
|
|
4818
4764
|
return (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("numbers")) == null ? void 0 : _b.getDataAsJson();
|
|
4819
|
-
}).retentiveOutput("inputOptions", (ctx) => {
|
|
4820
|
-
return ctx.resultPool.getOptions((spec) => o(spec));
|
|
4821
|
-
}).output("sheets", (ctx) => {
|
|
4822
|
-
var _a, _b;
|
|
4823
|
-
if (!((_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.anchorColumn)) return void 0;
|
|
4824
|
-
const anchor = ctx.resultPool.getPColumnByRef(ctx.uiState.dataTableState.anchorColumn);
|
|
4825
|
-
if (!anchor) return void 0;
|
|
4826
|
-
const r = pt(anchor.data);
|
|
4827
|
-
if (!r) return void 0;
|
|
4828
|
-
return r.map((values, i) => gt(ctx, anchor.spec.axesSpec[i], values));
|
|
4829
4765
|
}).output("pt", (ctx) => {
|
|
4830
|
-
var _a, _b, _c, _d,
|
|
4831
|
-
if (((_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4766
|
+
var _a, _b, _c, _d, _e;
|
|
4767
|
+
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;
|
|
4768
|
+
return me(ctx, [
|
|
4769
|
+
{
|
|
4770
|
+
id: "example",
|
|
4771
|
+
spec: {
|
|
4772
|
+
kind: "PColumn",
|
|
4773
|
+
valueType: "String",
|
|
4774
|
+
name: "example",
|
|
4775
|
+
annotations: {
|
|
4776
|
+
"pl7.app/label": "String column"
|
|
4777
|
+
},
|
|
4778
|
+
axesSpec: [
|
|
4779
|
+
{
|
|
4780
|
+
type: "Int",
|
|
4781
|
+
name: "index",
|
|
4782
|
+
annotations: {
|
|
4783
|
+
"pl7.app/label": "Int axis"
|
|
4784
|
+
}
|
|
4785
|
+
}
|
|
4786
|
+
]
|
|
4787
|
+
},
|
|
4788
|
+
data: [
|
|
4789
|
+
{ key: [1], val: "1" },
|
|
4790
|
+
{ key: [2], val: "2" }
|
|
4791
|
+
]
|
|
4792
|
+
}
|
|
4793
|
+
], ctx.uiState.dataTableState.tableState, [
|
|
4839
4794
|
...(_d = ctx.uiState.dataTableState.tableState.pTableParams) == null ? void 0 : _d.filters,
|
|
4840
|
-
...((
|
|
4795
|
+
...((_e = ctx.uiState.dataTableState.filterModel) == null ? void 0 : _e.filters) ?? []
|
|
4841
4796
|
]);
|
|
4842
4797
|
}).sections((ctx) => {
|
|
4843
4798
|
return [
|