@shwfed/config 2.3.20 → 2.3.22

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.
Files changed (43) hide show
  1. package/dist/mcp.mjs +17 -11
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{config-DYoY63Mh.js → config-B3mv60t8.js} +1 -1
  4. package/dist/preview/assets/{config-DRcqCBNE.js → config-BiFAbTJq.js} +1 -1
  5. package/dist/preview/assets/{config-DzmdQg_R.js → config-CLjwrQXG.js} +1 -1
  6. package/dist/preview/assets/{config-RpiYusco.js → config-Cb9lQXQG.js} +1 -1
  7. package/dist/preview/assets/{config-DWBLNB9W.js → config-CpvkgqGg.js} +1 -1
  8. package/dist/preview/assets/{config-BvTObql_.js → config-D4fS9GYw.js} +1 -1
  9. package/dist/preview/assets/{config-DqfJ6g2l.js → config-DX6QxjI7.js} +1 -1
  10. package/dist/preview/assets/{config-C1OAS71Y.js → config-DY7n8WvE.js} +1 -1
  11. package/dist/preview/assets/{config-BxK2md1E.js → config-DhwLB2Ee.js} +1 -1
  12. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-C1rBrqyI.js → definition.vue_vue_type_script_setup_true_lang-Hx2iV358.js} +1 -1
  13. package/dist/preview/assets/{index--tX2oFUp.js → index-B2gp2q3H.js} +110 -110
  14. package/dist/preview/assets/{index-DomLsyPH.css → index-CDhwf1Dw.css} +1 -1
  15. package/dist/preview/assets/index-Jytc_ICm.js +1 -0
  16. package/dist/preview/assets/{runtime-BkoWPDvV.js → runtime-BXZROm-z.js} +1 -1
  17. package/dist/preview/assets/runtime-BarNw942.js +1 -0
  18. package/dist/preview/assets/{runtime-Hiqp76SC.js → runtime-BazV3vOW.js} +1 -1
  19. package/dist/preview/assets/{runtime-euPIe4uC.js → runtime-CShAGyQk.js} +1 -1
  20. package/dist/preview/assets/{runtime-DOg6e_3A.js → runtime-DIcMvC6H.js} +1 -1
  21. package/dist/preview/assets/{runtime-_bbVL50J.js → runtime-Dl0d8KFj.js} +1 -1
  22. package/dist/preview/assets/runtime-ECoXJ0-J.js +1 -0
  23. package/dist/preview/assets/{runtime-DTh936s0.js → runtime-HQv4w652.js} +1 -1
  24. package/dist/preview/assets/{runtime-Cr5yIEMV.js → runtime-usxovPqT.js} +1 -1
  25. package/dist/preview/index.html +2 -2
  26. package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/runtime.vue +4 -1
  27. package/dist/runtime/components/actions/schema.js +1 -1
  28. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +52 -52
  29. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +52 -52
  30. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +52 -52
  31. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +52 -52
  32. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +26 -26
  33. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.d.ts +1 -1
  34. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.js +3 -2
  35. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.d.ts +1 -1
  36. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.js +3 -2
  37. package/dist/runtime/components/table/config.vue +2 -8
  38. package/dist/runtime/components/table/schema.d.ts +53 -52
  39. package/dist/runtime/components/table/schema.js +12 -6
  40. package/package.json +1 -1
  41. package/dist/preview/assets/index-De3_lDfy.js +0 -1
  42. package/dist/preview/assets/runtime-_Z4Jlev8.js +0 -1
  43. package/dist/preview/assets/runtime-m4H1rd-d.js +0 -1
@@ -44,6 +44,32 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
44
44
  readonly message: string;
45
45
  }[]] | undefined;
46
46
  }[];
47
+ readonly query?: {
48
+ readonly initial?: {
49
+ readonly data: string;
50
+ readonly request?: string | undefined;
51
+ } | undefined;
52
+ readonly kind: "shwfed.component.form";
53
+ readonly fields: readonly any[];
54
+ readonly layouts: readonly {
55
+ readonly name: string;
56
+ readonly layout: {
57
+ readonly style?: string | undefined;
58
+ readonly columns: number;
59
+ readonly gap?: number | undefined;
60
+ readonly rows?: number | undefined;
61
+ readonly placements: {
62
+ readonly [x: string]: {
63
+ readonly area: readonly [readonly [number, number], readonly [number, number]];
64
+ readonly v?: "stretch" | "center" | "end" | "start" | undefined;
65
+ readonly h?: "stretch" | "center" | "end" | "start" | undefined;
66
+ };
67
+ };
68
+ };
69
+ readonly media?: string | undefined;
70
+ }[];
71
+ readonly readonly?: string | undefined;
72
+ } | undefined;
47
73
  readonly dataSource?: {
48
74
  readonly data: string;
49
75
  readonly request?: string | undefined;
@@ -116,32 +142,6 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
116
142
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
117
143
  }[];
118
144
  } | undefined;
119
- readonly query?: {
120
- readonly initial?: {
121
- readonly data: string;
122
- readonly request?: string | undefined;
123
- } | undefined;
124
- readonly kind: "shwfed.component.form";
125
- readonly fields: readonly any[];
126
- readonly layouts: readonly {
127
- readonly name: string;
128
- readonly layout: {
129
- readonly style?: string | undefined;
130
- readonly columns: number;
131
- readonly gap?: number | undefined;
132
- readonly rows?: number | undefined;
133
- readonly placements: {
134
- readonly [x: string]: {
135
- readonly area: readonly [readonly [number, number], readonly [number, number]];
136
- readonly v?: "stretch" | "center" | "end" | "start" | undefined;
137
- readonly h?: "stretch" | "center" | "end" | "start" | undefined;
138
- };
139
- };
140
- };
141
- readonly media?: string | undefined;
142
- }[];
143
- readonly readonly?: string | undefined;
144
- } | undefined;
145
145
  readonly rowKey?: string | undefined;
146
146
  readonly cellStyle?: string | undefined;
147
147
  readonly pagination?: {
@@ -5,7 +5,7 @@ import type { ColumnDefDeps } from '../../../utils/resolve.js';
5
5
  export declare const type: "com.shwfed.table.column.combobox-single.remote.options-remote";
6
6
  export declare const compatibilityDate: "2026-05-24";
7
7
  export declare const metadata: {
8
- readonly name: "下拉单选(远程·远程选项)";
8
+ readonly name: "远程下拉单选";
9
9
  readonly icon: "fluent:cloud-arrow-down-20-regular";
10
10
  };
11
11
  export declare const OPTION_VAR: {
@@ -5,12 +5,13 @@ import { Triggers } from "../../../../../share/event-bus.js";
5
5
  import {
6
6
  CelRowAccess,
7
7
  columnFields,
8
+ editableHeader,
8
9
  registerRowVariablesIfAbsent
9
10
  } from "../../../utils/shared.js";
10
11
  export const type = "com.shwfed.table.column.combobox-single.remote.options-remote";
11
12
  export const compatibilityDate = "2026-05-24";
12
13
  export const metadata = {
13
- name: "\u4E0B\u62C9\u5355\u9009\uFF08\u8FDC\u7A0B\xB7\u8FDC\u7A0B\u9009\u9879\uFF09",
14
+ name: "\u8FDC\u7A0B\u4E0B\u62C9\u5355\u9009",
14
15
  icon: "fluent:cloud-arrow-down-20-regular"
15
16
  };
16
17
  export const OPTION_VAR = {
@@ -126,7 +127,7 @@ export function schema(configure) {
126
127
  }
127
128
  export function toColumnDef(value, { getLocaleText, $cel, inheritedContext }) {
128
129
  return {
129
- header: getLocaleText(value.title),
130
+ header: editableHeader(getLocaleText(value.title)),
130
131
  accessorFn: (row, index) => {
131
132
  try {
132
133
  return Effect.runSync($cel(value.accessor, { ...inheritedContext, row, index }));
@@ -5,7 +5,7 @@ import type { ColumnDefDeps } from '../../../utils/resolve.js';
5
5
  export declare const type: "com.shwfed.table.column.combobox-single.remote.options-static";
6
6
  export declare const compatibilityDate: "2026-05-24";
7
7
  export declare const metadata: {
8
- readonly name: "下拉单选(远程·静态选项)";
8
+ readonly name: "下拉单选";
9
9
  readonly icon: "fluent:chevron-down-20-regular";
10
10
  };
11
11
  export declare function itemSchema(configure: (env: Environment) => void): Schema.Struct<{
@@ -5,13 +5,14 @@ import { Triggers } from "../../../../../share/event-bus.js";
5
5
  import {
6
6
  CelRowAccess,
7
7
  columnFields,
8
+ editableHeader,
8
9
  LocaleMarkdownWithRow,
9
10
  registerRowVariablesIfAbsent
10
11
  } from "../../../utils/shared.js";
11
12
  export const type = "com.shwfed.table.column.combobox-single.remote.options-static";
12
13
  export const compatibilityDate = "2026-05-24";
13
14
  export const metadata = {
14
- name: "\u4E0B\u62C9\u5355\u9009\uFF08\u8FDC\u7A0B\xB7\u9759\u6001\u9009\u9879\uFF09",
15
+ name: "\u4E0B\u62C9\u5355\u9009",
15
16
  icon: "fluent:chevron-down-20-regular"
16
17
  };
17
18
  export function itemSchema(configure) {
@@ -104,7 +105,7 @@ export function schema(configure) {
104
105
  }
105
106
  export function toColumnDef(value, { getLocaleText, $cel, inheritedContext }) {
106
107
  return {
107
- header: getLocaleText(value.title),
108
+ header: editableHeader(getLocaleText(value.title)),
108
109
  accessorFn: (row, index) => {
109
110
  try {
110
111
  return Effect.runSync($cel(value.accessor, { ...inheritedContext, row, index }));
@@ -5,7 +5,7 @@ import { BREADCRUMB_EXTENSION_KEY } from "../config/breadcrumb-extension";
5
5
  import { TABLE_COLUMN_LAYOUT_KEY } from "./column-layout";
6
6
  import { Icon } from "@iconify/vue";
7
7
  import { ParseResult, Schema } from "effect";
8
- import { TableConfig, Pagination, ColumnGroup, tableDataSource, metadata as tableMetadata } from "./schema";
8
+ import { TableConfig, Pagination, ColumnGroup, tableDataSource, configureTableActionsScope, metadata as tableMetadata } from "./schema";
9
9
  import { COLUMNS, findColumn as findColumnEntry } from "./utils/resolve";
10
10
  import {
11
11
  useTreeDnd
@@ -157,13 +157,7 @@ const props = defineProps({
157
157
  const configure = props.configure ?? (() => {
158
158
  });
159
159
  function configureTableActions(env) {
160
- configure(env);
161
- env.registerVariable("selected", "list<dyn>", {
162
- description: "\u5F53\u524D\u5DF2\u52FE\u9009\u7684\u6240\u6709\u884C\uFF08`row` \u7684\u6570\u7EC4\uFF09"
163
- });
164
- env.registerVariable("query", "dyn", {
165
- description: "\u6E32\u67D3\u5728\u8868\u683C\u4E0A\u65B9\u7684\u641C\u7D22\u6761\u4EF6\u8868\u5355\u5F53\u524D\u72B6\u6001\uFF1B\u672A\u914D\u7F6E\u65F6\u4E3A\u7A7A\u5BF9\u8C61"
166
- });
160
+ configureTableActionsScope(env, configure);
167
161
  }
168
162
  function configureTableQuery(env) {
169
163
  configure(env);
@@ -95,6 +95,7 @@ export declare const ColumnGroup: Schema.Struct<{
95
95
  message: Schema.SchemaClass<string, string, never>;
96
96
  }>]>>;
97
97
  }>;
98
+ export declare function configureTableActionsScope(env: Environment, configure: (env: Environment) => void): void;
98
99
  export declare function DataSource(configure: (env: Environment) => void, extras?: {
99
100
  request?: (env: Environment) => void;
100
101
  data?: (env: Environment) => void;
@@ -130,6 +131,32 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
130
131
  readonly message: string;
131
132
  }[]] | undefined;
132
133
  }[];
134
+ readonly query?: {
135
+ readonly initial?: {
136
+ readonly data: string;
137
+ readonly request?: string | undefined;
138
+ } | undefined;
139
+ readonly kind: "shwfed.component.form";
140
+ readonly fields: readonly any[];
141
+ readonly layouts: readonly {
142
+ readonly name: string;
143
+ readonly layout: {
144
+ readonly style?: string | undefined;
145
+ readonly columns: number;
146
+ readonly gap?: number | undefined;
147
+ readonly rows?: number | undefined;
148
+ readonly placements: {
149
+ readonly [x: string]: {
150
+ readonly area: readonly [readonly [number, number], readonly [number, number]];
151
+ readonly v?: "stretch" | "center" | "end" | "start" | undefined;
152
+ readonly h?: "stretch" | "center" | "end" | "start" | undefined;
153
+ };
154
+ };
155
+ };
156
+ readonly media?: string | undefined;
157
+ }[];
158
+ readonly readonly?: string | undefined;
159
+ } | undefined;
133
160
  readonly dataSource?: {
134
161
  readonly data: string;
135
162
  readonly request?: string | undefined;
@@ -202,32 +229,6 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
202
229
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
203
230
  }[];
204
231
  } | undefined;
205
- readonly query?: {
206
- readonly initial?: {
207
- readonly data: string;
208
- readonly request?: string | undefined;
209
- } | undefined;
210
- readonly kind: "shwfed.component.form";
211
- readonly fields: readonly any[];
212
- readonly layouts: readonly {
213
- readonly name: string;
214
- readonly layout: {
215
- readonly style?: string | undefined;
216
- readonly columns: number;
217
- readonly gap?: number | undefined;
218
- readonly rows?: number | undefined;
219
- readonly placements: {
220
- readonly [x: string]: {
221
- readonly area: readonly [readonly [number, number], readonly [number, number]];
222
- readonly v?: "stretch" | "center" | "end" | "start" | undefined;
223
- readonly h?: "stretch" | "center" | "end" | "start" | undefined;
224
- };
225
- };
226
- };
227
- readonly media?: string | undefined;
228
- }[];
229
- readonly readonly?: string | undefined;
230
- } | undefined;
231
232
  readonly rowKey?: string | undefined;
232
233
  readonly cellStyle?: string | undefined;
233
234
  readonly pagination?: {
@@ -569,6 +570,32 @@ export declare function createTableConfig(body: Omit<Schema.Schema.Type<ReturnTy
569
570
  readonly message: string;
570
571
  }[]] | undefined;
571
572
  }[];
573
+ query?: {
574
+ readonly initial?: {
575
+ readonly data: string;
576
+ readonly request?: string | undefined;
577
+ } | undefined;
578
+ readonly kind: "shwfed.component.form";
579
+ readonly fields: readonly any[];
580
+ readonly layouts: readonly {
581
+ readonly name: string;
582
+ readonly layout: {
583
+ readonly style?: string | undefined;
584
+ readonly columns: number;
585
+ readonly gap?: number | undefined;
586
+ readonly rows?: number | undefined;
587
+ readonly placements: {
588
+ readonly [x: string]: {
589
+ readonly area: readonly [readonly [number, number], readonly [number, number]];
590
+ readonly v?: "stretch" | "center" | "end" | "start" | undefined;
591
+ readonly h?: "stretch" | "center" | "end" | "start" | undefined;
592
+ };
593
+ };
594
+ };
595
+ readonly media?: string | undefined;
596
+ }[];
597
+ readonly readonly?: string | undefined;
598
+ } | undefined;
572
599
  dataSource?: {
573
600
  readonly data: string;
574
601
  readonly request?: string | undefined;
@@ -641,32 +668,6 @@ export declare function createTableConfig(body: Omit<Schema.Schema.Type<ReturnTy
641
668
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
642
669
  }[];
643
670
  } | undefined;
644
- query?: {
645
- readonly initial?: {
646
- readonly data: string;
647
- readonly request?: string | undefined;
648
- } | undefined;
649
- readonly kind: "shwfed.component.form";
650
- readonly fields: readonly any[];
651
- readonly layouts: readonly {
652
- readonly name: string;
653
- readonly layout: {
654
- readonly style?: string | undefined;
655
- readonly columns: number;
656
- readonly gap?: number | undefined;
657
- readonly rows?: number | undefined;
658
- readonly placements: {
659
- readonly [x: string]: {
660
- readonly area: readonly [readonly [number, number], readonly [number, number]];
661
- readonly v?: "stretch" | "center" | "end" | "start" | undefined;
662
- readonly h?: "stretch" | "center" | "end" | "start" | undefined;
663
- };
664
- };
665
- };
666
- readonly media?: string | undefined;
667
- }[];
668
- readonly readonly?: string | undefined;
669
- } | undefined;
670
671
  rowKey?: string | undefined;
671
672
  cellStyle?: string | undefined;
672
673
  pagination?: {
@@ -127,6 +127,17 @@ export const ColumnGroup = Schema.Struct({
127
127
  description: "\u5217\u5206\u7EC4\u5B9A\u4E49"
128
128
  });
129
129
  const QUERY_VAR_DESCRIPTION = "\u641C\u7D22\u6761\u4EF6\u5F53\u524D\u72B6\u6001\uFF1B\u672A\u914D\u7F6E\u641C\u7D22\u6761\u4EF6\u65F6\u4E3A\u7A7A\u5BF9\u8C61";
130
+ export function configureTableActionsScope(env, configure) {
131
+ configure(env);
132
+ env.registerVariable("selected", "list<dyn>", {
133
+ label: "\u5DF2\u9009\u884C",
134
+ description: "\u5F53\u524D\u5DF2\u52FE\u9009\u7684\u6240\u6709\u884C\uFF08`row` \u7684\u6570\u7EC4\uFF09"
135
+ });
136
+ env.registerVariable("query", "dyn", {
137
+ label: "\u641C\u7D22\u6761\u4EF6",
138
+ description: QUERY_VAR_DESCRIPTION
139
+ });
140
+ }
130
141
  export function DataSource(configure, extras) {
131
142
  const CelRequest = Expression({
132
143
  configure: (env) => {
@@ -215,12 +226,7 @@ export function TableConfig(configure) {
215
226
  resultType: (type) => type === "string" || type === "number" || type === "dyn"
216
227
  });
217
228
  const dataSourceSchema = tableDataSource(configure);
218
- const { fields: actionFields } = ActionSchemaFields((env) => {
219
- configure(env);
220
- env.registerVariable("selected", "list<dyn>", {
221
- description: "\u5F53\u524D\u5DF2\u52FE\u9009\u7684\u6240\u6709\u884C\uFF08`row` \u7684\u6570\u7EC4\uFF09"
222
- });
223
- });
229
+ const { fields: actionFields } = ActionSchemaFields((env) => configureTableActionsScope(env, configure));
224
230
  const TableActions = Schema.Struct(actionFields).annotations({
225
231
  title: "TableActions",
226
232
  description: "\u8868\u683C\u7EA7\u64CD\u4F5C\u6309\u94AE"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/config",
3
- "version": "2.3.20",
3
+ "version": "2.3.22",
4
4
  "description": "Configurable UI for SHWFED",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1 +0,0 @@
1
- import{aK as e}from"./index--tX2oFUp.js";import{aL as r,aM as s,aN as t}from"./index--tX2oFUp.js";export{r as TableConfig,s as createTableConfig,e as default,t as getColumnTechnicalKey};
@@ -1 +0,0 @@
1
- import{d as s,ae as B,as as E,af as _,ag as i,at as x,au as p,e as M,w as c,u as d,a0 as N,an as b,ar as k,o as w,f as L,av as T,g as u,aw as I,ax as z,a7 as H,am as S,ay as V,az as $}from"./index--tX2oFUp.js";import{_ as A}from"./definition.vue_vue_type_script_setup_true_lang-C1rBrqyI.js";const K=s({name:"ShwfedModalLayoutActionRuntime",__name:"runtime",props:{buttonId:{},config:{},buttonTitle:{}},setup(t){const a=t,{locale:l}=B(),f=e=>{},r=S(),m=b(),o=N(null),v=E(a.buttonId,{close:()=>k(()=>{o.value?.()})},m),g=s({name:"ModalBoundaryBridge",setup(e,{slots:n}){return z(r),V($,v),()=>n.default?.()}}),h=(e,n)=>H()?.(e,n),C=_(function*(){const e=i(a.config.modalTitle,l.value)??i(a.buttonTitle,l.value)??"",{modal:n,close:y}=yield*x({title:e,width:a.config.modalWidth});o.value=()=>p(y()),yield*n,o.value=null});return(e,n)=>(w(),M(A,{"action-id":t.buttonId,effect:d(C)},{default:c(()=>[L("div",{style:T(t.config.modalMinHeight?`min-height: ${t.config.modalMinHeight}`:void 0)},[u(d(g),null,{default:c(()=>[u(I,{"slot-value":t.config.slot,configure:f,"find-entry":h},null,8,["slot-value"])]),_:1})],4)]),_:1},8,["action-id","effect"]))}});export{K as default};
@@ -1 +0,0 @@
1
- import{d as l,aD as A,ao as g,aq as y,aA as _,e as h,u as S,ak as b,al as k,an as j,aE as C,o as B,am as E}from"./index--tX2oFUp.js";import{_ as O}from"./definition.vue_vue_type_script_setup_true_lang-C1rBrqyI.js";const F=l({name:"ShwfedStateWriteActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(r){const s=r,i=E(),f=(e,t)=>b(e,{...k(i),...t}),n=A(),o=n.kind==="form"&&n.parent?n.parent:n,u=j(),m=C((e,t,a)=>{if(Array.isArray(e[t])&&Array.isArray(a))return e[t]=a,!0});function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e,t){return c(e)&&c(t)?m({...t},e):t}const d=g(()=>y(f(s.config.expression),e=>{for(const t of Object.keys(e)){const a=p(o.getAt(t),e[t]);o.setAt(t,a)}return _(u,s.config.onSuccess)}));return(e,t)=>(B(),h(O,{"action-id":r.buttonId,effect:S(d)},null,8,["action-id","effect"]))}});export{F as default};