@shwfed/config 2.0.1 → 2.0.3
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/dist/module.json +1 -1
- package/dist/runtime/components/actions/config.vue +1 -1
- package/dist/runtime/components/config/index.vue +1 -1
- package/dist/runtime/components/form/config.vue +1 -1
- package/dist/runtime/components/table/config.vue +1 -1
- package/dist/runtime/components/table/index.vue +7 -1
- package/dist/runtime/vendor/cel-js/lib/registry.d.ts +4 -1
- package/dist/runtime/vendor/cel-js/lib/registry.js +8 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -29,7 +29,7 @@ const mergedConfigure = (env) => {
|
|
|
29
29
|
const existing = new Set(env.getDefinitions().variables.map((v) => v.name));
|
|
30
30
|
for (const [name, v] of Object.entries(inheritedCEL)) {
|
|
31
31
|
if (existing.has(name)) continue;
|
|
32
|
-
env.registerVariable(name, v.type, { description: v.description });
|
|
32
|
+
env.registerVariable(name, v.type, { description: v.description, label: v.label });
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
const editorOpen = ref(false);
|
|
@@ -83,7 +83,13 @@ function translateColumn(column) {
|
|
|
83
83
|
return {
|
|
84
84
|
...contribution,
|
|
85
85
|
id: column.id,
|
|
86
|
-
|
|
86
|
+
// `ctx` is the functional-component props object Vue mutates in place on
|
|
87
|
+
// every update, so its identity stays stable across data refetches.
|
|
88
|
+
// Forwarding it unchanged makes `entry.runtime` see reference-equal props,
|
|
89
|
+
// so `shouldUpdateComponent` skips the update and the cell (and its CEL
|
|
90
|
+
// evaluation) never refreshes after the row data changes. Spread into a
|
|
91
|
+
// fresh object so the child re-renders whenever the context does.
|
|
92
|
+
cell: (ctx) => h(entry.runtime, { column, ctx: { ...ctx } })
|
|
87
93
|
};
|
|
88
94
|
}
|
|
89
95
|
function makeGroupColumn(group, children) {
|
|
@@ -40,9 +40,10 @@ export declare class VariableDeclaration {
|
|
|
40
40
|
name: string;
|
|
41
41
|
type: TypeDeclaration;
|
|
42
42
|
description: string | null;
|
|
43
|
+
label: string | null;
|
|
43
44
|
constant: boolean;
|
|
44
45
|
value: unknown;
|
|
45
|
-
constructor(name: string, type: TypeDeclaration, description?: string | null, value?: unknown);
|
|
46
|
+
constructor(name: string, type: TypeDeclaration, description?: string | null, value?: unknown, label?: string | null);
|
|
46
47
|
}
|
|
47
48
|
export declare class FunctionDeclaration {
|
|
48
49
|
name: string;
|
|
@@ -128,6 +129,7 @@ export declare class Registry {
|
|
|
128
129
|
functionCandidates(rec: boolean, name: string, argLen: number): Candidates;
|
|
129
130
|
registerVariable(name: string | Record<string, unknown>, type?: string | TypeDeclaration | Record<string, unknown>, opts?: {
|
|
130
131
|
description?: string;
|
|
132
|
+
label?: string;
|
|
131
133
|
value?: unknown;
|
|
132
134
|
}): this;
|
|
133
135
|
registerConstant(name: string | Record<string, unknown>, type?: string, value?: unknown): this;
|
|
@@ -155,6 +157,7 @@ export declare class Registry {
|
|
|
155
157
|
variables: {
|
|
156
158
|
name: string;
|
|
157
159
|
description: string | null;
|
|
160
|
+
label: string | null;
|
|
158
161
|
type: string;
|
|
159
162
|
}[];
|
|
160
163
|
functions: {
|
|
@@ -295,12 +295,14 @@ export class VariableDeclaration {
|
|
|
295
295
|
name;
|
|
296
296
|
type;
|
|
297
297
|
description;
|
|
298
|
+
label;
|
|
298
299
|
constant;
|
|
299
300
|
value;
|
|
300
|
-
constructor(name, type, description, value) {
|
|
301
|
+
constructor(name, type, description, value, label) {
|
|
301
302
|
this.name = name;
|
|
302
303
|
this.type = type;
|
|
303
304
|
this.description = description ?? null;
|
|
305
|
+
this.label = label ?? null;
|
|
304
306
|
this.constant = value !== void 0;
|
|
305
307
|
this.value = value;
|
|
306
308
|
objFreeze(this);
|
|
@@ -738,9 +740,11 @@ export class Registry {
|
|
|
738
740
|
registerVariable(name, type, opts) {
|
|
739
741
|
if (this.#locked) throw new Error("Cannot modify frozen registry");
|
|
740
742
|
let description = opts?.description;
|
|
743
|
+
let label = opts?.label;
|
|
741
744
|
let value;
|
|
742
745
|
if (typeof name === "string" && typeof type === "object" && !(type instanceof TypeDeclaration)) {
|
|
743
746
|
description = type.description;
|
|
747
|
+
label = type.label;
|
|
744
748
|
value = type.value;
|
|
745
749
|
if (type.schema) type = this.registerType({ name: `$${name}`, schema: type.schema }).type;
|
|
746
750
|
else type = type.type;
|
|
@@ -748,6 +752,7 @@ export class Registry {
|
|
|
748
752
|
if (name.schema) type = this.registerType({ name: `$${name.name}`, schema: name.schema }).type;
|
|
749
753
|
else type = name.type;
|
|
750
754
|
description = name.description;
|
|
755
|
+
label = name.label;
|
|
751
756
|
value = name.value;
|
|
752
757
|
name = name.name;
|
|
753
758
|
}
|
|
@@ -757,7 +762,7 @@ export class Registry {
|
|
|
757
762
|
if (typeof type === "string") type = this.getType(type);
|
|
758
763
|
else if (!(type instanceof TypeDeclaration)) throw invalidVar(`type is required`);
|
|
759
764
|
this.#ensureOwnVariables();
|
|
760
|
-
this.variables.set(name, new VariableDeclaration(name, type, description, value));
|
|
765
|
+
this.variables.set(name, new VariableDeclaration(name, type, description, value, label));
|
|
761
766
|
return this;
|
|
762
767
|
}
|
|
763
768
|
#registerSchemaAsType(name, schema) {
|
|
@@ -985,6 +990,7 @@ export class Registry {
|
|
|
985
990
|
variables.push({
|
|
986
991
|
name: varDecl.name,
|
|
987
992
|
description: varDecl.description || null,
|
|
993
|
+
label: varDecl.label || null,
|
|
988
994
|
type: varDecl.type.name
|
|
989
995
|
});
|
|
990
996
|
}
|