@milaboratories/milaboratories.ui-examples.model 1.1.7 → 1.1.9
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 +13 -0
- package/dist/bundle.js +349 -339
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -0
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
|
};
|
|
@@ -391,7 +391,7 @@
|
|
|
391
391
|
overrideMap,
|
|
392
392
|
overrideMap === errorMap ? void 0 : errorMap
|
|
393
393
|
// then global default map
|
|
394
|
-
].filter((
|
|
394
|
+
].filter((x2) => !!x2)
|
|
395
395
|
});
|
|
396
396
|
ctx.common.issues.push(issue);
|
|
397
397
|
}
|
|
@@ -454,10 +454,10 @@
|
|
|
454
454
|
});
|
|
455
455
|
const DIRTY = (value) => ({ status: "dirty", value });
|
|
456
456
|
const OK = (value) => ({ status: "valid", value });
|
|
457
|
-
const isAborted = (
|
|
458
|
-
const isDirty = (
|
|
459
|
-
const isValid = (
|
|
460
|
-
const isAsync = (
|
|
457
|
+
const isAborted = (x2) => x2.status === "aborted";
|
|
458
|
+
const isDirty = (x2) => x2.status === "dirty";
|
|
459
|
+
const isValid = (x2) => x2.status === "valid";
|
|
460
|
+
const isAsync = (x2) => typeof Promise !== "undefined" && x2 instanceof Promise;
|
|
461
461
|
function __classPrivateFieldGet(receiver, state, kind, f2) {
|
|
462
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);
|
|
@@ -2787,7 +2787,7 @@
|
|
|
2787
2787
|
if (!schema)
|
|
2788
2788
|
return null;
|
|
2789
2789
|
return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
|
|
2790
|
-
}).filter((
|
|
2790
|
+
}).filter((x2) => !!x2);
|
|
2791
2791
|
if (ctx.common.async) {
|
|
2792
2792
|
return Promise.all(items).then((results) => {
|
|
2793
2793
|
return ParseStatus.mergeArray(status, results);
|
|
@@ -3045,7 +3045,7 @@
|
|
|
3045
3045
|
ctx.schemaErrorMap,
|
|
3046
3046
|
getErrorMap(),
|
|
3047
3047
|
errorMap
|
|
3048
|
-
].filter((
|
|
3048
|
+
].filter((x2) => !!x2),
|
|
3049
3049
|
issueData: {
|
|
3050
3050
|
code: ZodIssueCode.invalid_arguments,
|
|
3051
3051
|
argumentsError: error
|
|
@@ -3061,7 +3061,7 @@
|
|
|
3061
3061
|
ctx.schemaErrorMap,
|
|
3062
3062
|
getErrorMap(),
|
|
3063
3063
|
errorMap
|
|
3064
|
-
].filter((
|
|
3064
|
+
].filter((x2) => !!x2),
|
|
3065
3065
|
issueData: {
|
|
3066
3066
|
code: ZodIssueCode.invalid_return_type,
|
|
3067
3067
|
returnTypeError: error
|
|
@@ -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
|
}
|
|
@@ -3917,7 +3917,7 @@
|
|
|
3917
3917
|
function b$1(t) {
|
|
3918
3918
|
throw new Error("Unexpected object: " + t);
|
|
3919
3919
|
}
|
|
3920
|
-
function J
|
|
3920
|
+
function J(t) {
|
|
3921
3921
|
const { type: n, name: e, domain: r } = t;
|
|
3922
3922
|
return { type: n, name: e, ...r && { domain: r } };
|
|
3923
3923
|
}
|
|
@@ -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":
|
|
@@ -4000,205 +4000,205 @@
|
|
|
4000
4000
|
};
|
|
4001
4001
|
return e(t), [...n.values()];
|
|
4002
4002
|
}
|
|
4003
|
-
function mt(t, n) {
|
|
4003
|
+
function mt$1(t, n) {
|
|
4004
4004
|
return t.ok ? { ok: true, value: n(t.value) } : t;
|
|
4005
4005
|
}
|
|
4006
4006
|
const Q = 24;
|
|
4007
4007
|
z.string().length(Q).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
|
|
4008
|
-
var
|
|
4009
|
-
var
|
|
4010
|
-
var S = (
|
|
4011
|
-
function
|
|
4012
|
-
return { type: "Immediate", value:
|
|
4008
|
+
var de = Object.defineProperty;
|
|
4009
|
+
var pe = (t, e, n) => e in t ? de(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
|
|
4010
|
+
var S = (t, e, n) => pe(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4011
|
+
function E(t) {
|
|
4012
|
+
return { type: "Immediate", value: t };
|
|
4013
4013
|
}
|
|
4014
|
-
function
|
|
4014
|
+
function _e() {
|
|
4015
4015
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
4016
4016
|
}
|
|
4017
|
-
function
|
|
4018
|
-
if (
|
|
4019
|
-
return globalThis.getPlatforma(
|
|
4017
|
+
function ie(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
|
}
|
|
4023
|
-
function
|
|
4023
|
+
function we() {
|
|
4024
4024
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
4025
4025
|
}
|
|
4026
|
-
function
|
|
4026
|
+
function l() {
|
|
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 n =
|
|
4030
|
+
function L(t, e) {
|
|
4031
|
+
const n = we();
|
|
4032
4032
|
if (n === void 0) return false;
|
|
4033
|
-
if (
|
|
4034
|
-
return n.callbackRegistry[
|
|
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
|
|
4040
|
-
|
|
4041
|
-
},
|
|
4036
|
+
const M = /* @__PURE__ */ new Map();
|
|
4037
|
+
function Se(t, e) {
|
|
4038
|
+
t in l().callbackRegistry || (l().callbackRegistry[t] = (n) => {
|
|
4039
|
+
for (const r of M.get(t))
|
|
4040
|
+
r(n);
|
|
4041
|
+
}, M.set(t, [])), M.get(t).push(e);
|
|
4042
4042
|
}
|
|
4043
4043
|
class v {
|
|
4044
|
-
constructor(
|
|
4044
|
+
constructor(e, n = (r) => r) {
|
|
4045
4045
|
S(this, "isResolved", false);
|
|
4046
4046
|
S(this, "resolvedValue");
|
|
4047
|
-
this.handle =
|
|
4048
|
-
this.resolvedValue = n(
|
|
4047
|
+
this.handle = e, this.postProcess = n, Se(e, (r) => {
|
|
4048
|
+
this.resolvedValue = n(r), this.isResolved = true;
|
|
4049
4049
|
});
|
|
4050
4050
|
}
|
|
4051
|
-
map(
|
|
4052
|
-
return new v(this.handle, (n) =>
|
|
4051
|
+
map(e) {
|
|
4052
|
+
return new v(this.handle, (n) => e(this.postProcess(n)));
|
|
4053
4053
|
}
|
|
4054
|
-
mapDefined(
|
|
4054
|
+
mapDefined(e) {
|
|
4055
4055
|
return new v(this.handle, (n) => {
|
|
4056
|
-
const
|
|
4057
|
-
return
|
|
4056
|
+
const r = this.postProcess(n);
|
|
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 K(t, e) {
|
|
4065
|
+
return t === void 0 ? void 0 : e(t);
|
|
4066
4066
|
}
|
|
4067
4067
|
class _ {
|
|
4068
|
-
constructor(
|
|
4069
|
-
this.handle =
|
|
4068
|
+
constructor(e, n) {
|
|
4069
|
+
this.handle = e, this.resolvePath = n;
|
|
4070
4070
|
}
|
|
4071
|
-
resolve(...
|
|
4072
|
-
const n =
|
|
4073
|
-
(
|
|
4071
|
+
resolve(...e) {
|
|
4072
|
+
const n = e.map(
|
|
4073
|
+
(r) => ({
|
|
4074
4074
|
assertFieldType: "Input",
|
|
4075
|
-
...typeof
|
|
4075
|
+
...typeof r == "string" ? { field: r } : r
|
|
4076
4076
|
})
|
|
4077
4077
|
);
|
|
4078
4078
|
return this.resolveWithCommon({}, ...n);
|
|
4079
4079
|
}
|
|
4080
|
-
resolveOutput(...
|
|
4081
|
-
const n =
|
|
4082
|
-
(
|
|
4080
|
+
resolveOutput(...e) {
|
|
4081
|
+
const n = e.map(
|
|
4082
|
+
(r) => ({
|
|
4083
4083
|
assertFieldType: "Output",
|
|
4084
|
-
...typeof
|
|
4084
|
+
...typeof r == "string" ? { field: r } : r
|
|
4085
4085
|
})
|
|
4086
4086
|
);
|
|
4087
4087
|
return this.resolveWithCommon({}, ...n);
|
|
4088
4088
|
}
|
|
4089
|
-
resolveInput(...
|
|
4090
|
-
const n =
|
|
4091
|
-
(
|
|
4089
|
+
resolveInput(...e) {
|
|
4090
|
+
const n = e.map(
|
|
4091
|
+
(r) => ({
|
|
4092
4092
|
assertFieldType: "Input",
|
|
4093
|
-
...typeof
|
|
4093
|
+
...typeof r == "string" ? { field: r } : r
|
|
4094
4094
|
})
|
|
4095
4095
|
);
|
|
4096
4096
|
return this.resolveWithCommon({}, ...n);
|
|
4097
4097
|
}
|
|
4098
|
-
resolveAny(...
|
|
4099
|
-
return this.resolveWithCommon({}, ...
|
|
4098
|
+
resolveAny(...e) {
|
|
4099
|
+
return this.resolveWithCommon({}, ...e);
|
|
4100
4100
|
}
|
|
4101
|
-
resolveWithCommon(
|
|
4102
|
-
const
|
|
4101
|
+
resolveWithCommon(e, ...n) {
|
|
4102
|
+
const r = [
|
|
4103
4103
|
...this.resolvePath,
|
|
4104
4104
|
...n.map((i2) => typeof i2 == "string" ? i2 : i2.field)
|
|
4105
4105
|
];
|
|
4106
|
-
return
|
|
4107
|
-
|
|
4108
|
-
(i2) => new _(i2,
|
|
4106
|
+
return K(
|
|
4107
|
+
l().resolveWithCommon(this.handle, e, ...n),
|
|
4108
|
+
(i2) => new _(i2, r)
|
|
4109
4109
|
);
|
|
4110
4110
|
}
|
|
4111
4111
|
get resourceType() {
|
|
4112
|
-
return
|
|
4112
|
+
return l().getResourceType(this.handle);
|
|
4113
4113
|
}
|
|
4114
4114
|
getInputsLocked() {
|
|
4115
|
-
return
|
|
4115
|
+
return l().getInputsLocked(this.handle);
|
|
4116
4116
|
}
|
|
4117
4117
|
getOutputsLocked() {
|
|
4118
|
-
return
|
|
4118
|
+
return l().getOutputsLocked(this.handle);
|
|
4119
4119
|
}
|
|
4120
4120
|
getIsReadyOrError() {
|
|
4121
|
-
return
|
|
4121
|
+
return l().getIsReadyOrError(this.handle);
|
|
4122
4122
|
}
|
|
4123
4123
|
getIsFinal() {
|
|
4124
|
-
return
|
|
4124
|
+
return l().getIsFinal(this.handle);
|
|
4125
4125
|
}
|
|
4126
4126
|
getError() {
|
|
4127
|
-
const
|
|
4128
|
-
return
|
|
4129
|
-
|
|
4130
|
-
(n) => new _(n,
|
|
4127
|
+
const e = [...this.resolvePath, "error"];
|
|
4128
|
+
return K(
|
|
4129
|
+
l().getError(this.handle),
|
|
4130
|
+
(n) => new _(n, e)
|
|
4131
4131
|
);
|
|
4132
4132
|
}
|
|
4133
4133
|
listInputFields() {
|
|
4134
|
-
return
|
|
4134
|
+
return l().listInputFields(this.handle);
|
|
4135
4135
|
}
|
|
4136
4136
|
listOutputFields() {
|
|
4137
|
-
return
|
|
4137
|
+
return l().listOutputFields(this.handle);
|
|
4138
4138
|
}
|
|
4139
4139
|
listDynamicFields() {
|
|
4140
|
-
return
|
|
4140
|
+
return l().listDynamicFields(this.handle);
|
|
4141
4141
|
}
|
|
4142
|
-
getKeyValueBase64(
|
|
4143
|
-
return
|
|
4142
|
+
getKeyValueBase64(e) {
|
|
4143
|
+
return l().getKeyValueBase64(this.handle, e);
|
|
4144
4144
|
}
|
|
4145
|
-
getKeyValueAsString(
|
|
4146
|
-
return
|
|
4145
|
+
getKeyValueAsString(e) {
|
|
4146
|
+
return l().getKeyValueAsString(this.handle, e);
|
|
4147
4147
|
}
|
|
4148
|
-
getKeyValueAsJson(
|
|
4149
|
-
const n = this.getKeyValueAsString(
|
|
4148
|
+
getKeyValueAsJson(e) {
|
|
4149
|
+
const n = this.getKeyValueAsString(e);
|
|
4150
4150
|
if (n == null) throw new Error("Resource has no content.");
|
|
4151
4151
|
return JSON.parse(n);
|
|
4152
4152
|
}
|
|
4153
4153
|
getDataBase64() {
|
|
4154
|
-
return
|
|
4154
|
+
return l().getDataBase64(this.handle);
|
|
4155
4155
|
}
|
|
4156
4156
|
getDataAsString() {
|
|
4157
|
-
return
|
|
4157
|
+
return l().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, 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(
|
|
4178
|
-
const
|
|
4177
|
+
parsePObjectCollection(e = false, n = "") {
|
|
4178
|
+
const r = l().parsePObjectCollection(
|
|
4179
4179
|
this.handle,
|
|
4180
|
-
|
|
4180
|
+
e,
|
|
4181
4181
|
n,
|
|
4182
4182
|
...this.resolvePath
|
|
4183
4183
|
);
|
|
4184
|
-
if (
|
|
4184
|
+
if (r === void 0) return;
|
|
4185
4185
|
const i2 = {};
|
|
4186
|
-
for (const [
|
|
4187
|
-
const
|
|
4188
|
-
i2[
|
|
4186
|
+
for (const [s, o] of Object.entries(r)) {
|
|
4187
|
+
const a = [...this.resolvePath, s];
|
|
4188
|
+
i2[s] = lt(o, (c) => new _(c, a));
|
|
4189
4189
|
}
|
|
4190
4190
|
return i2;
|
|
4191
4191
|
}
|
|
4192
4192
|
getFileContentAsBase64() {
|
|
4193
|
-
return new v(
|
|
4193
|
+
return new v(l().getBlobContentAsBase64(this.handle));
|
|
4194
4194
|
}
|
|
4195
4195
|
getFileContentAsString() {
|
|
4196
|
-
return new v(
|
|
4196
|
+
return new v(l().getBlobContentAsString(this.handle));
|
|
4197
4197
|
}
|
|
4198
4198
|
getFileContentAsJson() {
|
|
4199
4199
|
return new v(
|
|
4200
|
-
|
|
4201
|
-
).mapDefined((
|
|
4200
|
+
l().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 v(
|
|
4219
|
+
return new v(l().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 v(
|
|
4231
|
+
return new v(l().getOnDemandBlobContentHandle(this.handle));
|
|
4232
4232
|
}
|
|
4233
4233
|
/**
|
|
4234
4234
|
* @deprecated use getRemoteFileHandle
|
|
@@ -4237,19 +4237,19 @@
|
|
|
4237
4237
|
return this.getRemoteFileHandle();
|
|
4238
4238
|
}
|
|
4239
4239
|
getImportProgress() {
|
|
4240
|
-
return new v(
|
|
4240
|
+
return new v(l().getImportProgress(this.handle));
|
|
4241
4241
|
}
|
|
4242
|
-
getLastLogs(
|
|
4243
|
-
return new v(
|
|
4242
|
+
getLastLogs(e) {
|
|
4243
|
+
return new v(l().getLastLogs(this.handle, e));
|
|
4244
4244
|
}
|
|
4245
|
-
getProgressLog(
|
|
4246
|
-
return new v(
|
|
4245
|
+
getProgressLog(e) {
|
|
4246
|
+
return new v(l().getProgressLog(this.handle, e));
|
|
4247
4247
|
}
|
|
4248
4248
|
getLogHandle() {
|
|
4249
|
-
return new v(
|
|
4249
|
+
return new v(l().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
|
(n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
|
|
@@ -4260,102 +4260,102 @@
|
|
|
4260
4260
|
);
|
|
4261
4261
|
}
|
|
4262
4262
|
}
|
|
4263
|
-
mapFields(
|
|
4264
|
-
const { fieldType:
|
|
4263
|
+
mapFields(e, n) {
|
|
4264
|
+
const { fieldType: r, requireLocked: i2, skipUnresolved: s } = {
|
|
4265
4265
|
fieldType: "Input",
|
|
4266
4266
|
requireLocked: true,
|
|
4267
4267
|
skipUnresolved: false,
|
|
4268
4268
|
...n
|
|
4269
|
-
}, o =
|
|
4270
|
-
if (i2 && (
|
|
4269
|
+
}, o = e;
|
|
4270
|
+
if (i2 && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
|
|
4271
4271
|
return;
|
|
4272
|
-
let
|
|
4273
|
-
(
|
|
4272
|
+
let c = (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 s && (c = c.filter((u) => u[1] !== void 0)), c.map(([u, g]) => o(u, g));
|
|
4276
4276
|
}
|
|
4277
4277
|
}
|
|
4278
|
-
const
|
|
4279
|
-
const
|
|
4278
|
+
const se = "staging", oe = "main";
|
|
4279
|
+
const Ae = "pl7.app/label", Ie = "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 w = { label:
|
|
4284
|
+
}), Fe = z.array(Re), Te = 1e-3, Oe = "__LABEL__", Z = "__LABEL__@1";
|
|
4285
|
+
function ke(t, e, n = {}) {
|
|
4286
|
+
const r = /* @__PURE__ */ new Map(), i2 = /* @__PURE__ */ new Map(), s = t.map((p) => {
|
|
4287
|
+
var R, Y;
|
|
4288
|
+
const h = e(p), f2 = (R = h.annotations) == null ? void 0 : R[Ae], C = (Y = h.annotations) == null ? void 0 : Y[Ie], y = (C ? Fe.safeParse(JSON.parse(C)).data : void 0) ?? [];
|
|
4289
|
+
if (f2) {
|
|
4290
|
+
const w = { label: f2, type: Oe, importance: -2 };
|
|
4291
4291
|
n.addLabelAsSuffix ? y.push(w) : y.splice(0, 0, w);
|
|
4292
4292
|
}
|
|
4293
|
-
const
|
|
4293
|
+
const I = [], D = /* @__PURE__ */ new Map();
|
|
4294
4294
|
for (let w = y.length - 1; w >= 0; --w) {
|
|
4295
|
-
const { type:
|
|
4296
|
-
|
|
4297
|
-
const
|
|
4298
|
-
i2.set(
|
|
4299
|
-
|
|
4295
|
+
const { type: B } = y[w], ce = y[w].importance ?? 0, N = (D.get(B) ?? 0) + 1;
|
|
4296
|
+
D.set(B, N);
|
|
4297
|
+
const F = `${B}@${N}`;
|
|
4298
|
+
i2.set(F, (i2.get(F) ?? 0) + 1), r.set(
|
|
4299
|
+
F,
|
|
4300
4300
|
Math.max(
|
|
4301
|
-
|
|
4302
|
-
|
|
4301
|
+
r.get(F) ?? Number.NEGATIVE_INFINITY,
|
|
4302
|
+
ce - (y.length - w) * Te
|
|
4303
4303
|
)
|
|
4304
|
-
),
|
|
4304
|
+
), I.push({ ...y[w], fullType: F, occurenceIndex: N });
|
|
4305
4305
|
}
|
|
4306
|
-
return
|
|
4307
|
-
value:
|
|
4308
|
-
spec:
|
|
4309
|
-
label:
|
|
4310
|
-
fullTrace:
|
|
4306
|
+
return I.reverse(), {
|
|
4307
|
+
value: p,
|
|
4308
|
+
spec: h,
|
|
4309
|
+
label: f2,
|
|
4310
|
+
fullTrace: I
|
|
4311
4311
|
};
|
|
4312
|
-
}), o = [],
|
|
4313
|
-
|
|
4314
|
-
for (const [
|
|
4315
|
-
|
|
4316
|
-
const
|
|
4317
|
-
const
|
|
4312
|
+
}), o = [], a = [], c = [...r];
|
|
4313
|
+
c.sort(([, p], [, h]) => h - p);
|
|
4314
|
+
for (const [p] of c)
|
|
4315
|
+
p.endsWith("@1") || i2.get(p) === t.length ? o.push(p) : a.push(p);
|
|
4316
|
+
const u = (p) => s.map((h) => {
|
|
4317
|
+
const f2 = h.fullTrace.filter((y) => p.has(y.fullType)).map((y) => y.label), C = n.separator ?? " / ";
|
|
4318
4318
|
return {
|
|
4319
|
-
label:
|
|
4320
|
-
value:
|
|
4319
|
+
label: f2.join(C),
|
|
4320
|
+
value: h.value
|
|
4321
4321
|
};
|
|
4322
4322
|
});
|
|
4323
4323
|
if (o.length === 0) {
|
|
4324
|
-
if (
|
|
4325
|
-
return
|
|
4326
|
-
}
|
|
4327
|
-
let
|
|
4328
|
-
for (;
|
|
4329
|
-
const
|
|
4330
|
-
n.includeNativeLabel &&
|
|
4331
|
-
for (let
|
|
4332
|
-
|
|
4333
|
-
const
|
|
4334
|
-
if (new Set(
|
|
4335
|
-
|
|
4336
|
-
}
|
|
4337
|
-
return
|
|
4324
|
+
if (a.length !== 0) throw new Error("Assertion error.");
|
|
4325
|
+
return u(new Set(Z));
|
|
4326
|
+
}
|
|
4327
|
+
let g = 0, d = 0;
|
|
4328
|
+
for (; g < o.length; ) {
|
|
4329
|
+
const p = /* @__PURE__ */ new Set();
|
|
4330
|
+
n.includeNativeLabel && p.add(Z);
|
|
4331
|
+
for (let f2 = 0; f2 < g; ++f2) p.add(o[f2]);
|
|
4332
|
+
p.add(o[d]);
|
|
4333
|
+
const h = u(p);
|
|
4334
|
+
if (new Set(h.map((f2) => f2.label)).size === t.length) return h;
|
|
4335
|
+
d++, d == o.length && (g++, d = g);
|
|
4336
|
+
}
|
|
4337
|
+
return u(/* @__PURE__ */ new Set([...o, ...a]));
|
|
4338
4338
|
}
|
|
4339
|
-
class
|
|
4339
|
+
class De {
|
|
4340
4340
|
constructor() {
|
|
4341
|
-
S(this, "ctx",
|
|
4342
|
-
S(this, "defaultLabelFn", (
|
|
4343
|
-
var
|
|
4344
|
-
return ((
|
|
4341
|
+
S(this, "ctx", l());
|
|
4342
|
+
S(this, "defaultLabelFn", (e, n) => {
|
|
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(
|
|
4350
|
+
calculateOptions(e) {
|
|
4351
|
+
return this.ctx.calculateOptions(e);
|
|
4352
4352
|
}
|
|
4353
|
-
getOptions(
|
|
4354
|
-
const
|
|
4355
|
-
return typeof n == "object" || typeof n > "u" ?
|
|
4353
|
+
getOptions(e, n) {
|
|
4354
|
+
const r = this.getSpecs().entries.filter((i2) => e(i2.obj));
|
|
4355
|
+
return typeof n == "object" || typeof n > "u" ? ke(r, (i2) => i2.obj, n ?? {}).map(({ value: { ref: i2 }, label: s }) => ({
|
|
4356
4356
|
ref: i2,
|
|
4357
|
-
label:
|
|
4358
|
-
})) :
|
|
4357
|
+
label: s
|
|
4358
|
+
})) : r.map((i2) => ({
|
|
4359
4359
|
ref: i2.ref,
|
|
4360
4360
|
label: n(i2.obj, i2.ref)
|
|
4361
4361
|
}));
|
|
@@ -4367,10 +4367,10 @@
|
|
|
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:
|
|
4372
|
+
isComplete: e.isComplete,
|
|
4373
|
+
entries: e.entries.map((n) => ({
|
|
4374
4374
|
ref: n.ref,
|
|
4375
4375
|
obj: {
|
|
4376
4376
|
...n.obj,
|
|
@@ -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:
|
|
4391
|
+
isComplete: e.isComplete,
|
|
4392
|
+
entries: e.entries.map((n) => ({
|
|
4393
4393
|
ref: n.ref,
|
|
4394
4394
|
obj: {
|
|
4395
4395
|
...n.obj,
|
|
4396
|
-
data: mt(
|
|
4396
|
+
data: mt$1(
|
|
4397
4397
|
n.obj.data,
|
|
4398
|
-
(
|
|
4398
|
+
(r) => new _(r, [n.ref.blockId, n.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(
|
|
4417
|
+
getDataByRef(e) {
|
|
4418
4418
|
var n;
|
|
4419
4419
|
return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
|
|
4420
|
-
(
|
|
4420
|
+
(r) => r.ref.blockId === e.blockId && r.ref.name === e.name
|
|
4421
4421
|
)) == null ? void 0 : n.obj : lt(
|
|
4422
|
-
this.ctx.getDataFromResultPoolByRef(
|
|
4423
|
-
(
|
|
4422
|
+
this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
|
|
4423
|
+
(r) => new _(r, [e.blockId, e.name])
|
|
4424
4424
|
);
|
|
4425
4425
|
}
|
|
4426
4426
|
/**
|
|
@@ -4428,18 +4428,18 @@
|
|
|
4428
4428
|
* @param ref a Ref
|
|
4429
4429
|
* @returns p-column associated with the ref
|
|
4430
4430
|
*/
|
|
4431
|
-
getPColumnByRef(
|
|
4432
|
-
const n = this.getDataByRef(
|
|
4431
|
+
getPColumnByRef(e) {
|
|
4432
|
+
const n = this.getDataByRef(e);
|
|
4433
4433
|
if (n)
|
|
4434
|
-
return dt
|
|
4434
|
+
return dt(n);
|
|
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 n = this.getSpecByRef(
|
|
4441
|
+
getPColumnSpecByRef(e) {
|
|
4442
|
+
const n = this.getSpecByRef(e);
|
|
4443
4443
|
if (n) {
|
|
4444
4444
|
if (!i(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
|
|
4445
4445
|
return n;
|
|
@@ -4449,58 +4449,58 @@
|
|
|
4449
4449
|
* @param ref a Ref
|
|
4450
4450
|
* @returns object spec associated with the ref
|
|
4451
4451
|
*/
|
|
4452
|
-
getSpecByRef(
|
|
4452
|
+
getSpecByRef(e) {
|
|
4453
4453
|
var n;
|
|
4454
4454
|
return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
|
|
4455
|
-
(
|
|
4456
|
-
)) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(
|
|
4455
|
+
(r) => r.ref.blockId === e.blockId && r.ref.name === e.name
|
|
4456
|
+
)) == null ? void 0 : n.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(
|
|
4463
|
+
findDataWithCompatibleSpec(e) {
|
|
4464
4464
|
const n = [];
|
|
4465
|
-
|
|
4466
|
-
if (!i(
|
|
4465
|
+
e: for (const r of this.getData().entries) {
|
|
4466
|
+
if (!i(r.obj.spec))
|
|
4467
4467
|
continue;
|
|
4468
|
-
const i$1 =
|
|
4469
|
-
if (
|
|
4470
|
-
for (let
|
|
4471
|
-
const o =
|
|
4472
|
-
if (o.name !==
|
|
4473
|
-
continue
|
|
4468
|
+
const i$1 = r.obj.spec;
|
|
4469
|
+
if (e.name === i$1.name && e.valueType === i$1.valueType && e.axesSpec.length === i$1.axesSpec.length && H(e.domain, i$1.domain)) {
|
|
4470
|
+
for (let s = 0; s < e.axesSpec.length; ++s) {
|
|
4471
|
+
const o = e.axesSpec[s], a = i$1.axesSpec[s];
|
|
4472
|
+
if (o.name !== a.name || o.type !== a.type || !H(o.domain, a.domain))
|
|
4473
|
+
continue e;
|
|
4474
4474
|
}
|
|
4475
|
-
n.push(
|
|
4475
|
+
n.push(r.obj);
|
|
4476
4476
|
}
|
|
4477
4477
|
}
|
|
4478
4478
|
return n;
|
|
4479
4479
|
}
|
|
4480
4480
|
}
|
|
4481
|
-
function
|
|
4482
|
-
if (
|
|
4483
|
-
if (
|
|
4484
|
-
for (const n in
|
|
4485
|
-
if (
|
|
4481
|
+
function H(t, e) {
|
|
4482
|
+
if (t === void 0) return e === void 0;
|
|
4483
|
+
if (e === void 0) return true;
|
|
4484
|
+
for (const n in e)
|
|
4485
|
+
if (t[n] !== e[n]) return false;
|
|
4486
4486
|
return true;
|
|
4487
4487
|
}
|
|
4488
|
-
class
|
|
4488
|
+
class x {
|
|
4489
4489
|
constructor() {
|
|
4490
4490
|
S(this, "ctx");
|
|
4491
4491
|
S(this, "args");
|
|
4492
4492
|
S(this, "uiState");
|
|
4493
|
-
S(this, "resultPool", new
|
|
4494
|
-
this.ctx =
|
|
4493
|
+
S(this, "resultPool", new De());
|
|
4494
|
+
this.ctx = l(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
|
|
4495
4495
|
}
|
|
4496
|
-
getNamedAccessor(
|
|
4497
|
-
return
|
|
4498
|
-
this.ctx.getAccessorHandleByName(
|
|
4499
|
-
(n) => new _(n, [
|
|
4496
|
+
getNamedAccessor(e) {
|
|
4497
|
+
return K(
|
|
4498
|
+
this.ctx.getAccessorHandleByName(e),
|
|
4499
|
+
(n) => new _(n, [e])
|
|
4500
4500
|
);
|
|
4501
4501
|
}
|
|
4502
4502
|
get prerun() {
|
|
4503
|
-
return this.getNamedAccessor(
|
|
4503
|
+
return this.getNamedAccessor(se);
|
|
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(oe);
|
|
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(
|
|
4530
|
+
findLabels(e) {
|
|
4531
4531
|
const n = this.resultPool.getData();
|
|
4532
|
-
for (const
|
|
4533
|
-
if (!W(
|
|
4534
|
-
const i2 =
|
|
4535
|
-
if (i2.name === "pl7.app/label" && i2.axesSpec.length === 1 && i2.axesSpec[0].name ===
|
|
4536
|
-
if (
|
|
4537
|
-
throw Error(`Expected JSON column for labels, got: ${
|
|
4532
|
+
for (const r of n.entries) {
|
|
4533
|
+
if (!W(r.obj)) continue;
|
|
4534
|
+
const i2 = r.obj.spec;
|
|
4535
|
+
if (i2.name === "pl7.app/label" && i2.axesSpec.length === 1 && i2.axesSpec[0].name === e.name && i2.axesSpec[0].type === e.type && H(e.domain, i2.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(
|
|
4546
|
+
verifyInlineColumnsSupport(e) {
|
|
4547
4547
|
var i2;
|
|
4548
|
-
const n =
|
|
4549
|
-
if (n && !
|
|
4548
|
+
const n = e.some((s) => !(s.data instanceof _)), r = ((i2 = this.ctx.featureFlags) == null ? void 0 : i2.inlineColumnsSupport) === true;
|
|
4549
|
+
if (n && !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((n) => lt(n, (r) => r instanceof _ ? r.handle : r))
|
|
4554
4554
|
);
|
|
4555
4555
|
}
|
|
4556
|
-
createPTable(
|
|
4556
|
+
createPTable(e) {
|
|
4557
4557
|
var n;
|
|
4558
|
-
return "columns" in
|
|
4558
|
+
return "columns" in e ? n = {
|
|
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
|
-
} : n =
|
|
4566
|
-
it
|
|
4563
|
+
filters: e.filters ?? [],
|
|
4564
|
+
sorting: e.sorting ?? []
|
|
4565
|
+
} : n = e, this.verifyInlineColumnsSupport(pt(n.src)), this.ctx.createPTable(
|
|
4566
|
+
it(
|
|
4567
4567
|
n,
|
|
4568
|
-
(
|
|
4568
|
+
(r) => lt(r, (i2) => i2 instanceof _ ? i2.handle : i2)
|
|
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.0";
|
|
4582
|
+
function xe(t) {
|
|
4583
|
+
return t.__renderLambda === true;
|
|
4584
4584
|
}
|
|
4585
|
-
function
|
|
4586
|
-
if (
|
|
4587
|
-
return
|
|
4585
|
+
function $(t) {
|
|
4586
|
+
if (t !== void 0)
|
|
4587
|
+
return xe(t) ? t.handle : t;
|
|
4588
4588
|
}
|
|
4589
4589
|
class b {
|
|
4590
|
-
constructor(
|
|
4591
|
-
this._renderingMode =
|
|
4590
|
+
constructor(e, n, r, i2, s, o, a) {
|
|
4591
|
+
this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i2, this._inputsValid = s, this._sections = o, this._title = a;
|
|
4592
4592
|
}
|
|
4593
|
-
static create(
|
|
4593
|
+
static create(e = "Heavy") {
|
|
4594
4594
|
return new b(
|
|
4595
|
-
|
|
4595
|
+
e,
|
|
4596
4596
|
void 0,
|
|
4597
4597
|
{},
|
|
4598
4598
|
{},
|
|
4599
|
-
|
|
4600
|
-
|
|
4599
|
+
E(true),
|
|
4600
|
+
E([]),
|
|
4601
4601
|
void 0
|
|
4602
4602
|
);
|
|
4603
4603
|
}
|
|
4604
|
-
output(
|
|
4604
|
+
output(e, n, r = {}) {
|
|
4605
4605
|
if (typeof n == "function") {
|
|
4606
|
-
const i2 = `output#${
|
|
4607
|
-
return
|
|
4606
|
+
const i2 = `output#${e}`;
|
|
4607
|
+
return L(i2, () => n(new x())), new b(
|
|
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
4615
|
handle: i2,
|
|
4616
|
-
...
|
|
4616
|
+
...r
|
|
4617
4617
|
}
|
|
4618
4618
|
},
|
|
4619
4619
|
this._inputsValid,
|
|
@@ -4627,7 +4627,7 @@
|
|
|
4627
4627
|
this._initialUiState,
|
|
4628
4628
|
{
|
|
4629
4629
|
...this._outputs,
|
|
4630
|
-
[
|
|
4630
|
+
[e]: n
|
|
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, n) {
|
|
4639
|
+
return this.output(e, n, { 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" ? (L("inputsValid", () => e(new x())), new b(
|
|
4647
4647
|
this._renderingMode,
|
|
4648
4648
|
this._initialArgs,
|
|
4649
4649
|
this._initialUiState,
|
|
@@ -4659,16 +4659,16 @@
|
|
|
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(E(e)) : typeof e == "function" ? (L("sections", () => e(new x())), new b(
|
|
4672
4672
|
this._renderingMode,
|
|
4673
4673
|
this._initialArgs,
|
|
4674
4674
|
this._initialUiState,
|
|
@@ -4682,12 +4682,12 @@
|
|
|
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 L("title", () => e(new x())), new b(
|
|
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(
|
|
4704
|
+
initialArgs(e) {
|
|
4705
4705
|
return new b(
|
|
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(
|
|
4716
|
+
withArgs(e) {
|
|
4717
4717
|
return new b(
|
|
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(
|
|
4728
|
+
withUiState(e) {
|
|
4729
4729
|
return new b(
|
|
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,64 +4753,73 @@
|
|
|
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: $(this._inputsValid),
|
|
4760
|
+
sections: $(this._sections),
|
|
4761
4761
|
outputs: Object.fromEntries(
|
|
4762
|
-
Object.entries(this._outputs).map(([n,
|
|
4762
|
+
Object.entries(this._outputs).map(([n, r]) => [n, $(r)])
|
|
4763
4763
|
)
|
|
4764
4764
|
};
|
|
4765
|
-
return
|
|
4765
|
+
return _e() ? ie({ sdkVersion: T }) : { config: e };
|
|
4766
4766
|
}
|
|
4767
4767
|
}
|
|
4768
|
-
function
|
|
4769
|
-
var
|
|
4770
|
-
|
|
4771
|
-
|
|
4768
|
+
function mt(t, e, n, r) {
|
|
4769
|
+
var u, g;
|
|
4770
|
+
Array.isArray(r) && (r = { filters: r });
|
|
4771
|
+
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) => {
|
|
4772
|
+
let h = d.toString();
|
|
4772
4773
|
if (p)
|
|
4773
|
-
for (const
|
|
4774
|
-
|
|
4775
|
-
return
|
|
4774
|
+
for (const f2 in p)
|
|
4775
|
+
h += f2, h += p[f2];
|
|
4776
|
+
return h;
|
|
4776
4777
|
}, o = /* @__PURE__ */ new Map();
|
|
4777
|
-
for (const
|
|
4778
|
-
for (const p of
|
|
4779
|
-
const
|
|
4780
|
-
for (const
|
|
4781
|
-
const
|
|
4782
|
-
if (ot
|
|
4783
|
-
const
|
|
4784
|
-
if (
|
|
4785
|
-
const
|
|
4786
|
-
o.set(
|
|
4787
|
-
id:
|
|
4778
|
+
for (const d of e)
|
|
4779
|
+
for (const p of d.spec.axesSpec) {
|
|
4780
|
+
const h = J(p);
|
|
4781
|
+
for (const f2 of i2) {
|
|
4782
|
+
const C = f2.spec.axesSpec[0], y = J(f2.spec.axesSpec[0]);
|
|
4783
|
+
if (ot(h, y)) {
|
|
4784
|
+
const I = Object.keys(h.domain ?? {}).length, D = Object.keys(y.domain ?? {}).length;
|
|
4785
|
+
if (I > D) {
|
|
4786
|
+
const R = s(f2.id, h.domain);
|
|
4787
|
+
o.set(R, {
|
|
4788
|
+
id: R,
|
|
4788
4789
|
spec: {
|
|
4789
|
-
...
|
|
4790
|
-
axesSpec: [{ ...
|
|
4790
|
+
...f2.spec,
|
|
4791
|
+
axesSpec: [{ ...h, annotations: C.annotations }]
|
|
4791
4792
|
},
|
|
4792
|
-
data:
|
|
4793
|
+
data: f2.data
|
|
4793
4794
|
});
|
|
4794
4795
|
} else
|
|
4795
|
-
o.set(
|
|
4796
|
+
o.set(s(f2.id), f2);
|
|
4796
4797
|
}
|
|
4797
4798
|
}
|
|
4798
4799
|
}
|
|
4799
|
-
if (
|
|
4800
|
-
(
|
|
4800
|
+
if ([...e, ...o.values()].some(
|
|
4801
|
+
(d) => d.data instanceof _ && !d.data.getIsReadyOrError()
|
|
4801
4802
|
))
|
|
4802
|
-
return
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4803
|
+
return;
|
|
4804
|
+
let a = e;
|
|
4805
|
+
const c = [];
|
|
4806
|
+
if (r != null && r.coreColumnPredicate) {
|
|
4807
|
+
a = [];
|
|
4808
|
+
for (const d of e)
|
|
4809
|
+
r.coreColumnPredicate(d.spec) ? a.push(d) : c.push(d);
|
|
4810
|
+
}
|
|
4811
|
+
return c.push(...o.values()), t.createPTable({
|
|
4812
|
+
src: {
|
|
4813
|
+
type: "outer",
|
|
4814
|
+
primary: {
|
|
4815
|
+
type: (r == null ? void 0 : r.coreJoinType) ?? "full",
|
|
4816
|
+
entries: a.map((d) => ({ type: "column", column: d }))
|
|
4810
4817
|
},
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4818
|
+
secondary: c.map((d) => ({ type: "column", column: d }))
|
|
4819
|
+
},
|
|
4820
|
+
filters: [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []],
|
|
4821
|
+
sorting: ((g = n == null ? void 0 : n.pTableParams) == null ? void 0 : g.sorting) ?? []
|
|
4822
|
+
});
|
|
4814
4823
|
}
|
|
4815
4824
|
const $BlockArgs = z.object({
|
|
4816
4825
|
numbers: z.array(z.coerce.number())
|
|
@@ -4819,9 +4828,9 @@
|
|
|
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
|
-
var _a, _b, _c, _d,
|
|
4831
|
+
var _a, _b, _c, _d, _e2;
|
|
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 mt(ctx, [
|
|
4825
4834
|
{
|
|
4826
4835
|
id: "example",
|
|
4827
4836
|
spec: {
|
|
@@ -4848,10 +4857,11 @@
|
|
|
4848
4857
|
}
|
|
4849
4858
|
], ctx.uiState.dataTableState.tableState, [
|
|
4850
4859
|
...(_d = ctx.uiState.dataTableState.tableState.pTableParams) == null ? void 0 : _d.filters,
|
|
4851
|
-
...((
|
|
4860
|
+
...((_e2 = ctx.uiState.dataTableState.filterModel) == null ? void 0 : _e2.filters) ?? []
|
|
4852
4861
|
]);
|
|
4853
4862
|
}).sections((ctx) => {
|
|
4854
4863
|
return [
|
|
4864
|
+
{ type: "link", href: "/loaders", label: "Loaders" },
|
|
4855
4865
|
{ type: "link", href: "/", label: "Icons/Masks" },
|
|
4856
4866
|
{ type: "link", href: "/layout", label: "Layout" },
|
|
4857
4867
|
{ type: "link", href: "/form-components", label: "Form Components" },
|