@shwfed/config 2.0.2 → 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/config/index.vue +1 -1
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/schema.d.ts +1 -1
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/schema.js +2 -2
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/schema.d.ts +1 -1
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/schema.js +2 -2
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/schema.d.ts +1 -1
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/schema.js +2 -2
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.d.ts +1 -1
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.js +2 -2
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts +1 -1
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.js +2 -2
- package/dist/runtime/components/table/index.vue +8 -6
- package/dist/runtime/components/table/utils/resolve.d.ts +1 -1
- 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);
|
package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/schema.d.ts
CHANGED
|
@@ -37,4 +37,4 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
37
37
|
compatibilityDate: Schema.Literal<["2026-04-14"]>;
|
|
38
38
|
}>;
|
|
39
39
|
export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
|
|
40
|
-
export declare function toColumnDef(value: Value, { getLocaleText, $cel,
|
|
40
|
+
export declare function toColumnDef(value: Value, { getLocaleText, $cel, inheritedContext }: ColumnDefDeps): Partial<ColumnDef<unknown, unknown>>;
|
package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/schema.js
CHANGED
|
@@ -21,12 +21,12 @@ export function schema(configure) {
|
|
|
21
21
|
})
|
|
22
22
|
}).annotations({ title: "DateRenderer", description: "\u65E5\u671F\u6E32\u67D3\u5668" });
|
|
23
23
|
}
|
|
24
|
-
export function toColumnDef(value, { getLocaleText, $cel,
|
|
24
|
+
export function toColumnDef(value, { getLocaleText, $cel, inheritedContext }) {
|
|
25
25
|
return {
|
|
26
26
|
header: getLocaleText(value.title),
|
|
27
27
|
accessorFn: (row, index) => {
|
|
28
28
|
try {
|
|
29
|
-
return Effect.runSync($cel(value.accessor, { ...
|
|
29
|
+
return Effect.runSync($cel(value.accessor, { ...inheritedContext, row, index }));
|
|
30
30
|
} catch (e) {
|
|
31
31
|
console.error("[shwfed-table] accessor failed", e);
|
|
32
32
|
return void 0;
|
package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/schema.d.ts
CHANGED
|
@@ -37,4 +37,4 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
37
37
|
compatibilityDate: Schema.Literal<["2026-04-14"]>;
|
|
38
38
|
}>;
|
|
39
39
|
export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
|
|
40
|
-
export declare function toColumnDef(value: Value, { getLocaleText, $cel,
|
|
40
|
+
export declare function toColumnDef(value: Value, { getLocaleText, $cel, inheritedContext }: ColumnDefDeps): Partial<ColumnDef<unknown, unknown>>;
|
package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/schema.js
CHANGED
|
@@ -24,12 +24,12 @@ export function schema(configure) {
|
|
|
24
24
|
align: Schema.optionalWith(Align.annotations({ title: "\u5BF9\u9F50" }), { default: () => "center" })
|
|
25
25
|
}).annotations({ title: "IconRenderer", description: "\u56FE\u6807\u6E32\u67D3\u5668" });
|
|
26
26
|
}
|
|
27
|
-
export function toColumnDef(value, { getLocaleText, $cel,
|
|
27
|
+
export function toColumnDef(value, { getLocaleText, $cel, inheritedContext }) {
|
|
28
28
|
return {
|
|
29
29
|
header: getLocaleText(value.title),
|
|
30
30
|
accessorFn: (row, index) => {
|
|
31
31
|
try {
|
|
32
|
-
return Effect.runSync($cel(value.accessor, { ...
|
|
32
|
+
return Effect.runSync($cel(value.accessor, { ...inheritedContext, row, index }));
|
|
33
33
|
} catch (e) {
|
|
34
34
|
console.error("[shwfed-table] accessor failed", e);
|
|
35
35
|
return void 0;
|
package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/schema.d.ts
CHANGED
|
@@ -41,4 +41,4 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
41
41
|
compatibilityDate: Schema.Literal<["2026-04-14"]>;
|
|
42
42
|
}>;
|
|
43
43
|
export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
|
|
44
|
-
export declare function toColumnDef(value: Value, { getLocaleText, $cel,
|
|
44
|
+
export declare function toColumnDef(value: Value, { getLocaleText, $cel, inheritedContext }: ColumnDefDeps): Partial<ColumnDef<unknown, unknown>>;
|
package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/schema.js
CHANGED
|
@@ -29,12 +29,12 @@ export function schema(configure) {
|
|
|
29
29
|
}))
|
|
30
30
|
}).annotations({ title: "NumberRenderer", description: "\u6570\u503C\u6E32\u67D3\u5668" });
|
|
31
31
|
}
|
|
32
|
-
export function toColumnDef(value, { getLocaleText, $cel,
|
|
32
|
+
export function toColumnDef(value, { getLocaleText, $cel, inheritedContext }) {
|
|
33
33
|
return {
|
|
34
34
|
header: getLocaleText(value.title),
|
|
35
35
|
accessorFn: (row, index) => {
|
|
36
36
|
try {
|
|
37
|
-
return Effect.runSync($cel(value.accessor, { ...
|
|
37
|
+
return Effect.runSync($cel(value.accessor, { ...inheritedContext, row, index }));
|
|
38
38
|
} catch (e) {
|
|
39
39
|
console.error("[shwfed-table] accessor failed", e);
|
|
40
40
|
return void 0;
|
package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.d.ts
CHANGED
|
@@ -40,4 +40,4 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
40
40
|
compatibilityDate: Schema.Literal<["2026-04-14"]>;
|
|
41
41
|
}>;
|
|
42
42
|
export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
|
|
43
|
-
export declare function toColumnDef(value: Value, { getLocaleText, $cel,
|
|
43
|
+
export declare function toColumnDef(value: Value, { getLocaleText, $cel, inheritedContext }: ColumnDefDeps): Partial<ColumnDef<unknown, unknown>>;
|
package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.js
CHANGED
|
@@ -26,12 +26,12 @@ export function schema(configure) {
|
|
|
26
26
|
}))
|
|
27
27
|
}).annotations({ title: "TextRenderer", description: "\u6587\u672C\u6E32\u67D3\u5668" });
|
|
28
28
|
}
|
|
29
|
-
export function toColumnDef(value, { getLocaleText, $cel,
|
|
29
|
+
export function toColumnDef(value, { getLocaleText, $cel, inheritedContext }) {
|
|
30
30
|
return {
|
|
31
31
|
header: getLocaleText(value.title),
|
|
32
32
|
accessorFn: (row, index) => {
|
|
33
33
|
try {
|
|
34
|
-
return Effect.runSync($cel(value.accessor, { ...
|
|
34
|
+
return Effect.runSync($cel(value.accessor, { ...inheritedContext, row, index }));
|
|
35
35
|
} catch (e) {
|
|
36
36
|
console.error("[shwfed-table] accessor failed", e);
|
|
37
37
|
return void 0;
|
package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts
CHANGED
|
@@ -39,4 +39,4 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
39
39
|
compatibilityDate: Schema.Literal<["2026-05-13"]>;
|
|
40
40
|
}>;
|
|
41
41
|
export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
|
|
42
|
-
export declare function toColumnDef(value: Value, { getLocaleText, $cel,
|
|
42
|
+
export declare function toColumnDef(value: Value, { getLocaleText, $cel, inheritedContext }: ColumnDefDeps): Partial<ColumnDef<unknown, unknown>>;
|
package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.js
CHANGED
|
@@ -43,12 +43,12 @@ export function schema(configure) {
|
|
|
43
43
|
}))
|
|
44
44
|
}).annotations({ title: "SwitchRenderer", description: "\u5F00\u5173\u6E32\u67D3\u5668\uFF08\u53EF\u7F16\u8F91\uFF09" });
|
|
45
45
|
}
|
|
46
|
-
export function toColumnDef(value, { getLocaleText, $cel,
|
|
46
|
+
export function toColumnDef(value, { getLocaleText, $cel, inheritedContext }) {
|
|
47
47
|
return {
|
|
48
48
|
header: getLocaleText(value.title),
|
|
49
49
|
accessorFn: (row, index) => {
|
|
50
50
|
try {
|
|
51
|
-
return Effect.runSync($cel(value.accessor, { ...
|
|
51
|
+
return Effect.runSync($cel(value.accessor, { ...inheritedContext, row, index }));
|
|
52
52
|
} catch (e) {
|
|
53
53
|
console.error("[shwfed-table] switch accessor failed", e);
|
|
54
54
|
return void 0;
|
|
@@ -79,15 +79,17 @@ function translateColumn(column) {
|
|
|
79
79
|
if (!entry) {
|
|
80
80
|
throw new Error(`[shwfed-table] no column registered for ${column.type}@${column.compatibilityDate}`);
|
|
81
81
|
}
|
|
82
|
-
const contribution = entry.toColumnDef(column, {
|
|
83
|
-
getLocaleText,
|
|
84
|
-
$cel,
|
|
85
|
-
getInheritedContext: () => celBindings(inheritedContext)
|
|
86
|
-
});
|
|
82
|
+
const contribution = entry.toColumnDef(column, { getLocaleText, $cel, inheritedContext: celBindings(inheritedContext) });
|
|
87
83
|
return {
|
|
88
84
|
...contribution,
|
|
89
85
|
id: column.id,
|
|
90
|
-
|
|
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 } })
|
|
91
93
|
};
|
|
92
94
|
}
|
|
93
95
|
function makeGroupColumn(group, children) {
|
|
@@ -13,7 +13,7 @@ export type ColumnMetadata = Readonly<{
|
|
|
13
13
|
export type ColumnDefDeps = Readonly<{
|
|
14
14
|
getLocaleText: (value: LocaleValue | undefined) => string | undefined;
|
|
15
15
|
$cel: CelEvaluator;
|
|
16
|
-
|
|
16
|
+
inheritedContext: Record<string, unknown>;
|
|
17
17
|
}>;
|
|
18
18
|
type ToColumnDef = (value: any, deps: ColumnDefDeps) => Partial<ColumnDef<unknown, unknown>>;
|
|
19
19
|
export type ColumnEntry = Readonly<{
|