@shwfed/config 2.2.5 → 2.3.1

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 (72) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.d.vue.ts +61 -0
  3. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.vue +187 -0
  4. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.vue.d.ts +61 -0
  5. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/runtime.d.vue.ts +8 -0
  6. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/runtime.vue +62 -0
  7. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/runtime.vue.d.ts +8 -0
  8. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.d.ts +40 -0
  9. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.js +87 -0
  10. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +8 -8
  11. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +8 -8
  12. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +8 -8
  13. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +8 -8
  14. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +9 -15
  15. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.d.vue.ts +2 -2
  16. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.vue +32 -52
  17. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.vue.d.ts +2 -2
  18. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/runtime.vue +19 -8
  19. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.d.ts +2 -2
  20. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.js +4 -3
  21. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/config.vue +25 -0
  22. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/runtime.vue +2 -8
  23. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts +4 -0
  24. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.js +5 -0
  25. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.d.vue.ts +133 -0
  26. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue +533 -0
  27. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue.d.ts +133 -0
  28. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/runtime.d.vue.ts +9 -0
  29. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/runtime.vue +237 -0
  30. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/runtime.vue.d.ts +9 -0
  31. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/schema.d.ts +124 -0
  32. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/schema.js +96 -0
  33. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.d.vue.ts +10 -0
  34. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.vue +475 -0
  35. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.vue.d.ts +10 -0
  36. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/runtime.d.vue.ts +9 -0
  37. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/runtime.vue +156 -0
  38. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/runtime.vue.d.ts +9 -0
  39. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.d.ts +56 -0
  40. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.js +81 -0
  41. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/config.d.vue.ts +10 -0
  42. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/config.vue +310 -0
  43. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/config.vue.d.ts +10 -0
  44. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/runtime.d.vue.ts +9 -0
  45. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/runtime.vue +81 -0
  46. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/runtime.vue.d.ts +9 -0
  47. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/schema.d.ts +57 -0
  48. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/schema.js +59 -0
  49. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.d.vue.ts +10 -0
  50. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.vue +292 -0
  51. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.vue.d.ts +10 -0
  52. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/runtime.d.vue.ts +9 -0
  53. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/runtime.vue +140 -0
  54. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/runtime.vue.d.ts +9 -0
  55. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.d.ts +50 -0
  56. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.js +53 -0
  57. package/dist/runtime/components/table/config.d.vue.ts +2 -0
  58. package/dist/runtime/components/table/config.vue +136 -109
  59. package/dist/runtime/components/table/config.vue.d.ts +2 -0
  60. package/dist/runtime/components/table/index.d.vue.ts +2 -2
  61. package/dist/runtime/components/table/index.vue +46 -53
  62. package/dist/runtime/components/table/index.vue.d.ts +2 -2
  63. package/dist/runtime/components/table/row-provider.d.vue.ts +23 -0
  64. package/dist/runtime/components/table/row-provider.vue +55 -0
  65. package/dist/runtime/components/table/row-provider.vue.d.ts +23 -0
  66. package/dist/runtime/components/table/schema.d.ts +17 -29
  67. package/dist/runtime/components/table/schema.js +22 -18
  68. package/dist/runtime/components/table/utils/shared.d.ts +28 -0
  69. package/dist/runtime/components/table/utils/shared.js +40 -0
  70. package/dist/runtime/components/ui/field/index.js +6 -1
  71. package/dist/runtime/components/ui/input/Input.vue +1 -1
  72. package/package.json +1 -1
@@ -60,15 +60,9 @@ declare const InitialState: Schema.Struct<{
60
60
  rowSelection: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Boolean>>;
61
61
  }>;
62
62
  export declare const Pagination: Schema.Struct<{
63
- pageSizes: Schema.optionalWith<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.Number>>>, {
64
- default: () => number[];
65
- }>;
66
- pageIndex: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
67
- default: () => number;
68
- }>;
69
- pageSize: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
70
- default: () => number;
71
- }>;
63
+ pageSize: Schema.refine<number, Schema.filter<typeof Schema.Number>>;
64
+ pageSizes: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.Number>>>>;
65
+ pageIndex: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
72
66
  left: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
73
67
  locale: Schema.Literal<["zh"]>;
74
68
  message: Schema.SchemaClass<string, string, never>;
@@ -129,11 +123,11 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
129
123
  readonly message: string;
130
124
  }[]] | undefined;
131
125
  }[];
132
- readonly dataSource: {
126
+ readonly dataSource?: {
133
127
  readonly data: string;
134
128
  readonly request?: string | undefined;
135
129
  readonly total?: string | undefined;
136
- };
130
+ } | undefined;
137
131
  readonly actions?: {
138
132
  readonly size: "default" | "sm" | "xs";
139
133
  readonly style?: string | undefined;
@@ -242,9 +236,9 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
242
236
  readonly locale: "en" | "ja" | "ko";
243
237
  readonly message: string;
244
238
  }[]] | undefined;
245
- readonly pageSizes: readonly number[];
246
- readonly pageIndex: number;
247
239
  readonly pageSize: number;
240
+ readonly pageSizes?: readonly number[] | undefined;
241
+ readonly pageIndex?: number | undefined;
248
242
  } | undefined;
249
243
  readonly initialState?: {
250
244
  readonly expanded?: boolean | {
@@ -298,11 +292,11 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
298
292
  }>>, {
299
293
  default: () => never[];
300
294
  }>;
301
- dataSource: Schema.Struct<{
295
+ dataSource: Schema.optional<Schema.Struct<{
302
296
  request: Schema.optional<Schema.Schema<string, string, never>>;
303
297
  data: Schema.Schema<string, string, never>;
304
298
  total: Schema.optional<Schema.Schema<string, string, never>>;
305
- }>;
299
+ }>>;
306
300
  actions: Schema.optional<Schema.Struct<{
307
301
  size: Schema.optionalWith<Schema.Literal<["default", "sm", "xs"]>, {
308
302
  default: () => "default";
@@ -444,15 +438,9 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
444
438
  cellStyle: Schema.optional<Schema.Schema<string, string, never>>;
445
439
  style: Schema.optional<typeof Schema.String>;
446
440
  pagination: Schema.optional<Schema.Struct<{
447
- pageSizes: Schema.optionalWith<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.Number>>>, {
448
- default: () => number[];
449
- }>;
450
- pageIndex: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
451
- default: () => number;
452
- }>;
453
- pageSize: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
454
- default: () => number;
455
- }>;
441
+ pageSize: Schema.refine<number, Schema.filter<typeof Schema.Number>>;
442
+ pageSizes: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.Number>>>>;
443
+ pageIndex: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
456
444
  left: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
457
445
  locale: Schema.Literal<["zh"]>;
458
446
  message: Schema.SchemaClass<string, string, never>;
@@ -513,11 +501,11 @@ export declare function createTableConfig(body: Omit<Schema.Schema.Type<ReturnTy
513
501
  readonly message: string;
514
502
  }[]] | undefined;
515
503
  }[];
516
- dataSource: {
504
+ dataSource?: {
517
505
  readonly data: string;
518
506
  readonly request?: string | undefined;
519
507
  readonly total?: string | undefined;
520
- };
508
+ } | undefined;
521
509
  actions?: {
522
510
  readonly size: "default" | "sm" | "xs";
523
511
  readonly style?: string | undefined;
@@ -626,9 +614,9 @@ export declare function createTableConfig(body: Omit<Schema.Schema.Type<ReturnTy
626
614
  readonly locale: "en" | "ja" | "ko";
627
615
  readonly message: string;
628
616
  }[]] | undefined;
629
- readonly pageSizes: readonly number[];
630
- readonly pageIndex: number;
631
617
  readonly pageSize: number;
618
+ readonly pageSizes?: readonly number[] | undefined;
619
+ readonly pageIndex?: number | undefined;
632
620
  } | undefined;
633
621
  initialState?: {
634
622
  readonly expanded?: boolean | {
@@ -681,7 +669,7 @@ export type TableConfigValue = Readonly<{
681
669
  displayName?: string;
682
670
  columns: ReadonlyArray<ColumnValue>;
683
671
  groups: ReadonlyArray<ColumnGroupValue>;
684
- dataSource: DataSourceValue;
672
+ dataSource?: DataSourceValue;
685
673
  actions?: TableActionsValue;
686
674
  query?: FormConfigValue;
687
675
  cellStyle?: string;
@@ -79,25 +79,26 @@ const InitialState = Schema.Struct({
79
79
  description: "\u8868\u683C\u521D\u59CB\u72B6\u6001"
80
80
  });
81
81
  export const Pagination = Schema.Struct({
82
- pageSizes: Schema.optionalWith(
83
- Schema.Array(Schema.Number.pipe(Schema.int(), Schema.positive())),
84
- { default: () => [100, 200, 500, 1e3] }
82
+ // `pageSize` is required so the editor cannot save "pagination on but no
83
+ // page size" — the toggle in config.vue owns the on/off axis, and turning
84
+ // it on initializes `pageSize` explicitly. No `optionalWith(default)`
85
+ // anywhere in this struct: defaults would re-materialize on every decode
86
+ // pass (see use-editor confirm) and undo the user's intent of leaving a
87
+ // field unset.
88
+ pageSize: Schema.Number.pipe(Schema.int(), Schema.positive()).annotations({
89
+ title: "\u521D\u59CB\u6BCF\u9875\u884C\u6570",
90
+ description: "\u521D\u59CB\u6BCF\u9875\u884C\u6570"
91
+ }),
92
+ pageSizes: Schema.optional(
93
+ Schema.Array(Schema.Number.pipe(Schema.int(), Schema.positive()))
85
94
  ).annotations({
86
95
  title: "\u53EF\u9009\u5206\u9875\u5927\u5C0F",
87
- description: "\u53EF\u9009\u5206\u9875\u5927\u5C0F\u5217\u8868"
96
+ description: "\u53EF\u9009\u5206\u9875\u5927\u5C0F\u5217\u8868\uFF1B\u7559\u7A7A\u5219\u4E0D\u663E\u793A\u9875\u5927\u5C0F\u9009\u62E9\u5668"
88
97
  }),
89
- pageIndex: Schema.optionalWith(
90
- Schema.Number.pipe(Schema.int(), Schema.nonNegative()),
91
- { default: () => 0 }
98
+ pageIndex: Schema.optional(
99
+ Schema.Number.pipe(Schema.int(), Schema.nonNegative())
92
100
  ).annotations({
93
- description: "\u521D\u59CB\u9875\u7801\uFF08\u4ECE 0 \u5F00\u59CB\uFF09"
94
- }),
95
- pageSize: Schema.optionalWith(
96
- Schema.Number.pipe(Schema.int(), Schema.positive()),
97
- { default: () => 20 }
98
- ).annotations({
99
- title: "\u521D\u59CB\u6BCF\u9875\u884C\u6570",
100
- description: "\u521D\u59CB\u6BCF\u9875\u884C\u6570"
101
+ description: "\u521D\u59CB\u9875\u7801\uFF08\u4ECE 0 \u5F00\u59CB\uFF09\uFF1B\u7559\u7A7A\u89C6\u4E3A 0"
101
102
  }),
102
103
  left: Schema.optional(Locale).annotations({
103
104
  title: "\u5206\u9875\u680F\u5DE6\u4FA7",
@@ -222,10 +223,13 @@ export function TableConfig(configure) {
222
223
  title: "\u5217\u5206\u7EC4",
223
224
  description: "\u5217\u5206\u7EC4\u5217\u8868"
224
225
  }),
225
- dataSource: dataSourceSchema.annotations({
226
+ // Optional so a host that drives rows directly (the `table` form field's
227
+ // `v-model:rows` binding) can omit it — `fetchDataSource` short-circuits
228
+ // when undefined, leaving rows fully owned by the host's model.
229
+ dataSource: Schema.optional(dataSourceSchema.annotations({
226
230
  title: "\u6570\u636E\u6E90",
227
231
  description: "\u6570\u636E\u6E90\u914D\u7F6E"
228
- }),
232
+ })),
229
233
  actions: Schema.optional(TableActions).annotations({
230
234
  title: "\u64CD\u4F5C",
231
235
  description: "\u8868\u683C\u9876\u90E8\u64CD\u4F5C\u6309\u94AE"
@@ -248,7 +252,7 @@ export function TableConfig(configure) {
248
252
  initialState: Schema.optional(InitialState)
249
253
  }).pipe(Schema.filter((cfg) => {
250
254
  if (cfg.dataSource?.total !== void 0 && cfg.pagination === void 0) {
251
- return "\u914D\u7F6E\u4E86 dataSource.total \u65F6\u5FC5\u987B\u540C\u65F6\u914D\u7F6E\u5206\u9875\uFF08\u81F3\u5C11\u586B\u5199\u6BCF\u9875\u884C\u6570\u6216\u53EF\u9009\u5206\u9875\u5927\u5C0F\uFF09";
255
+ return "\u914D\u7F6E\u4E86 dataSource.total \u65F6\u5FC5\u987B\u542F\u7528\u5206\u9875";
252
256
  }
253
257
  return true;
254
258
  })).annotations({
@@ -1,4 +1,5 @@
1
1
  import { Schema } from 'effect';
2
+ import { type VNode } from 'vue';
2
3
  import type { Environment } from '../../../vendor/cel-js/lib/index.js';
3
4
  import { type ResultType } from '../../../share/expression.js';
4
5
  export declare const Align: Schema.Literal<["left", "center", "right"]>;
@@ -28,6 +29,29 @@ export declare function columnFields(configure: (env: Environment) => void): {
28
29
  id: Schema.refine<string, typeof Schema.String>;
29
30
  groupId: Schema.optional<typeof Schema.UUID>;
30
31
  };
32
+ export declare function editableColumnFields(): {
33
+ title: Schema.TupleType<readonly [Schema.Struct<{
34
+ locale: Schema.Literal<["zh"]>;
35
+ message: Schema.SchemaClass<string, string, never>;
36
+ }>], [Schema.Struct<{
37
+ locale: Schema.Literal<["ja", "en", "ko"]>;
38
+ message: Schema.SchemaClass<string, string, never>;
39
+ }>]>;
40
+ binding: Schema.refine<string, typeof Schema.String>;
41
+ enableSorting: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
42
+ size: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
43
+ grow: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
44
+ tooltip: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
45
+ locale: Schema.Literal<["zh"]>;
46
+ message: Schema.SchemaClass<string, string, never>;
47
+ }>], [Schema.Struct<{
48
+ locale: Schema.Literal<["ja", "en", "ko"]>;
49
+ message: Schema.SchemaClass<string, string, never>;
50
+ }>]>>;
51
+ id: Schema.refine<string, typeof Schema.String>;
52
+ groupId: Schema.optional<typeof Schema.UUID>;
53
+ };
54
+ export declare function editableHeader(titleText: string | undefined): () => VNode;
31
55
  export declare function registerRowVariablesIfAbsent(env: Environment): void;
32
56
  export declare function CelRowAccess(configure: (env: Environment) => void, options?: {
33
57
  resultType?: ResultType;
@@ -39,3 +63,7 @@ export declare function LocaleMarkdownWithRow(configure: (env: Environment) => v
39
63
  locale: Schema.Literal<["ja", "en", "ko"]>;
40
64
  message: Schema.SchemaClass<string, string, never>;
41
65
  }>]>>;
66
+ export declare function derivedRowField(configure: (env: Environment) => void, resultType: ResultType): Schema.optional<Schema.Struct<{
67
+ mode: Schema.Literal<["formula", "prefill"]>;
68
+ expression: Schema.Schema<string, string, never>;
69
+ }>>;
@@ -1,7 +1,10 @@
1
1
  import { Schema } from "effect";
2
+ import { Icon } from "@iconify/vue";
3
+ import { h } from "vue";
2
4
  import { Expression, LocaleMarkdown } from "../../../share/expression.js";
3
5
  import { Locale } from "../../../share/locale.js";
4
6
  import { md } from "../../../share/markdown.js";
7
+ import { derivedField } from "../../form/utils/common.js";
5
8
  export const Align = Schema.Literal("left", "center", "right").annotations({
6
9
  description: "\u5BF9\u9F50\u65B9\u5F0F"
7
10
  });
@@ -44,6 +47,40 @@ export function columnFields(configure) {
44
47
  tooltip: Schema.optional(Locale.annotations({ title: "\u63D0\u793A", description: "\u5217\u6807\u9898\u60AC\u6D6E\u63D0\u793A\uFF0C\u652F\u6301 Markdown" }))
45
48
  };
46
49
  }
50
+ export function editableColumnFields() {
51
+ return {
52
+ ...columnIdentityFields(),
53
+ title: Locale.annotations({ title: "\u540D\u79F0", description: "\u5217\u6807\u9898" }),
54
+ binding: Schema.String.pipe(Schema.minLength(1)).annotations({
55
+ title: "\u7ED1\u5B9A\u8DEF\u5F84",
56
+ description: "\u5355\u5143\u683C\u8BFB\u5199\u7684 `dot-prop` \u8DEF\u5F84\uFF0C\u4F8B\u5982 `name` \u6216 `address.city`\uFF1B\u5199\u5165\u5373\u8986\u76D6\u8BE5\u8DEF\u5F84\u4E0A\u7684\u503C"
57
+ }),
58
+ enableSorting: Schema.optional(Schema.Boolean.annotations({
59
+ title: "\u5141\u8BB8\u6392\u5E8F",
60
+ description: "\u663E\u793A\u6392\u5E8F\u6309\u94AE\uFF1B\u542F\u7528\u5BA2\u6237\u7AEF\u6392\u5E8F\uFF0C\u6309\u5F53\u524D `binding` \u8DEF\u5F84\u4E0A\u7684\u503C\u6392\u5E8F"
61
+ })),
62
+ size: Schema.optional(Schema.Number.pipe(Schema.finite(), Schema.positive()).annotations({
63
+ title: "\u5217\u5BBD",
64
+ description: "\u6307\u5B9A\u4E00\u4E2A\u5408\u9002\u7684\u8868\u683C\u5217\u5BBD\u5EA6\uFF0C\u5F53\u5217\u5185\u5BB9\u957F\u5EA6\u5927\u4E8E\u8FD9\u91CC\u6307\u5B9A\u7684\u5BBD\u5EA6\u540E\uFF0C\u4F1A\u5BFC\u81F4\u8D85\u51FA\u7684\u90E8\u5206\u88AB\u622A\u65AD\u3002"
65
+ })),
66
+ grow: Schema.optional(Schema.Boolean.annotations({ title: "\u5360\u636E\u5269\u4F59\u5BBD\u5EA6", description: "\u5217\u662F\u5426\u5360\u636E\u5269\u4F59\u7A7A\u4F59\u5BBD\u5EA6" })),
67
+ tooltip: Schema.optional(Locale.annotations({ title: "\u63D0\u793A", description: "\u5217\u6807\u9898\u60AC\u6D6E\u63D0\u793A\uFF0C\u652F\u6301 Markdown" }))
68
+ };
69
+ }
70
+ export function editableHeader(titleText) {
71
+ return () => h(
72
+ "span",
73
+ { class: "inline-flex items-center gap-1" },
74
+ [
75
+ titleText ?? "",
76
+ h(Icon, {
77
+ "icon": "fluent:edit-20-regular",
78
+ "class": "size-3 text-zinc-400",
79
+ "aria-hidden": "true"
80
+ })
81
+ ]
82
+ );
83
+ }
47
84
  export function registerRowVariablesIfAbsent(env) {
48
85
  const declared = new Set(env.getDefinitions().variables.map((v) => v.name));
49
86
  if (!declared.has("row")) {
@@ -65,3 +102,6 @@ export function CelRowAccess(configure, options) {
65
102
  export function LocaleMarkdownWithRow(configure) {
66
103
  return LocaleMarkdown({ configure: configureWithRow(configure) });
67
104
  }
105
+ export function derivedRowField(configure, resultType) {
106
+ return derivedField(configureWithRow(configure), resultType);
107
+ }
@@ -34,7 +34,12 @@ export const fieldVariants = cva(
34
34
  "has-data-[value=true]:**:data-[slot=field-label]:text-zinc-700",
35
35
  "data-[disabled=true]:**:data-[slot=field-label]:text-zinc-400",
36
36
  "*:data-[slot=field-label]:left-3",
37
- "has-[[data-slot=input-group-addon][data-align=inline-start]]:**:data-[slot=field-label]:left-7"
37
+ "has-[[data-slot=input-group-addon][data-align=inline-start]]:**:data-[slot=field-label]:left-7",
38
+ // The floating label is notched into the top border, so we nudge the
39
+ // input baseline 0.5 down to keep its caret/text optically centered
40
+ // against the notch. Only applied when a label is actually present —
41
+ // a label-less floating field should sit flush with the border.
42
+ "has-[>[data-slot=field-label]]:**:data-[slot=input]:translate-y-0.5"
38
43
  ],
39
44
  contents: [
40
45
  "contents",
@@ -23,7 +23,7 @@ const modelValue = useVModel(props, "modelValue", emits, {
23
23
  :data-value="!treatEmptyAsDifferentStateFromNull ? !!modelValue : modelValue !== void 0"
24
24
  :placeholder="props.placeholder"
25
25
  :class="cn(
26
- 'file:text-zinc-700 placeholder:text-zinc-300 text-zinc-700 border-zinc-200 h-9 w-full min-w-0 rounded border bg-transparent px-3 py-1 text-base translate-y-0.5 transition-colors ease-out duration-180 outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
26
+ 'file:text-zinc-700 placeholder:text-zinc-300 text-zinc-700 border-zinc-200 h-9 w-full min-w-0 rounded border bg-transparent px-3 py-1 text-base transition-colors ease-out duration-180 outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
27
27
  'aria-invalid:border-red-400 hover:border-zinc-300 focus-visible:border-(--primary)',
28
28
  props.class
29
29
  )"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/config",
3
- "version": "2.2.5",
3
+ "version": "2.3.1",
4
4
  "description": "Configurable UI for SHWFED",
5
5
  "type": "module",
6
6
  "publishConfig": {