@shwfed/config 3.0.16 → 3.0.18

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 (111) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/actions/buttons/2026-06-25/com.shwfed.actions.button.state.write/config.d.vue.ts +8 -8
  3. package/dist/runtime/components/actions/buttons/2026-06-25/com.shwfed.actions.button.state.write/config.vue.d.ts +8 -8
  4. package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/config.d.vue.ts +8 -8
  5. package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/config.vue.d.ts +8 -8
  6. package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/runtime.vue +1 -16
  7. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/config.d.vue.ts +6 -6
  8. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/config.vue.d.ts +6 -6
  9. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/runtime.d.vue.ts +6 -6
  10. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/runtime.vue.d.ts +6 -6
  11. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.d.vue.ts +22 -22
  12. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue.d.ts +22 -22
  13. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +22 -22
  14. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +22 -22
  15. package/dist/runtime/components/form/index.vue +57 -2
  16. package/dist/runtime/components/form/schema.d.ts +5 -0
  17. package/dist/runtime/components/form/schema.js +14 -1
  18. package/dist/runtime/components/form/utils/state-write.d.ts +9 -0
  19. package/dist/runtime/components/form/utils/state-write.js +16 -0
  20. package/dist/runtime/components/operations/2026-07-19/com.shwfed.operation.form.state.write/config.d.vue.ts +21 -0
  21. package/dist/runtime/components/operations/2026-07-19/com.shwfed.operation.form.state.write/config.vue +100 -0
  22. package/dist/runtime/components/operations/2026-07-19/com.shwfed.operation.form.state.write/config.vue.d.ts +21 -0
  23. package/dist/runtime/components/operations/2026-07-19/com.shwfed.operation.form.state.write/schema.d.ts +18 -0
  24. package/dist/runtime/components/operations/2026-07-19/com.shwfed.operation.form.state.write/schema.js +47 -0
  25. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -0
  26. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue +32 -0
  27. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -0
  28. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/schema.d.ts +1 -0
  29. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/schema.js +1 -1
  30. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.vue +32 -0
  31. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.d.ts +1 -0
  32. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.js +1 -1
  33. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/config.vue +28 -0
  34. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/schema.d.ts +1 -0
  35. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/schema.js +1 -1
  36. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/config.vue +32 -0
  37. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.d.ts +1 -0
  38. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.js +1 -1
  39. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.vue +32 -0
  40. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.d.ts +1 -0
  41. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.js +1 -1
  42. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -0
  43. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue +32 -0
  44. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -0
  45. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/schema.d.ts +1 -0
  46. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/schema.js +1 -1
  47. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -0
  48. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue +22 -0
  49. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -0
  50. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.d.ts +1 -0
  51. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.js +1 -1
  52. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -0
  53. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue +22 -0
  54. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -0
  55. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/schema.d.ts +1 -0
  56. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/schema.js +1 -1
  57. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +4 -2
  58. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue +22 -0
  59. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +4 -2
  60. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +1 -0
  61. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/schema.js +1 -1
  62. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +4 -2
  63. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue +22 -0
  64. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +4 -2
  65. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/schema.d.ts +1 -0
  66. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/schema.js +1 -1
  67. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +4 -2
  68. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue +22 -0
  69. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +4 -2
  70. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +1 -0
  71. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.js +1 -1
  72. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +4 -2
  73. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue +22 -0
  74. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +4 -2
  75. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.d.ts +1 -0
  76. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.js +1 -1
  77. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -0
  78. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue +22 -0
  79. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -0
  80. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/schema.d.ts +1 -0
  81. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/schema.js +2 -0
  82. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -0
  83. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue +22 -0
  84. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -0
  85. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/schema.d.ts +1 -0
  86. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/schema.js +2 -0
  87. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +4 -2
  88. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue +22 -0
  89. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +4 -2
  90. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +1 -0
  91. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/schema.js +1 -1
  92. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +4 -2
  93. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue +22 -0
  94. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +4 -2
  95. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/schema.d.ts +1 -0
  96. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/schema.js +1 -1
  97. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/config.vue +32 -0
  98. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.d.ts +1 -0
  99. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.js +1 -1
  100. package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/config.vue +32 -0
  101. package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/schema.d.ts +1 -0
  102. package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/schema.js +1 -1
  103. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/config.vue +32 -0
  104. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/schema.d.ts +1 -0
  105. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/schema.js +1 -1
  106. package/dist/runtime/components/table/index.d.vue.ts +1 -0
  107. package/dist/runtime/components/table/index.vue +12 -1
  108. package/dist/runtime/components/table/index.vue.d.ts +1 -0
  109. package/dist/runtime/components/table/utils/shared.d.ts +3 -1
  110. package/dist/runtime/components/table/utils/shared.js +28 -2
  111. package/package.json +1 -1
@@ -24,6 +24,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
24
24
  readonly message: string;
25
25
  }[]] | undefined;
26
26
  readonly align: "center" | "left" | "right";
27
+ readonly required?: string | undefined;
27
28
  readonly compatibilityDate: "2026-06-14";
28
29
  readonly grow?: boolean | undefined;
29
30
  readonly groupId?: string | undefined;
@@ -45,10 +46,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
45
46
  readonly mode: "formula" | "prefill";
46
47
  readonly expression: string;
47
48
  } | undefined;
48
- readonly enableSorting?: boolean | undefined;
49
49
  readonly nodeKey: string;
50
50
  readonly nodeChildren: string;
51
51
  readonly nodeLabel: string;
52
+ readonly enableSorting?: boolean | undefined;
52
53
  readonly cascade: "independent" | "cascade-down" | "cascade-both";
53
54
  readonly nodeTooltip?: readonly [{
54
55
  readonly locale: "zh";
@@ -83,6 +84,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
83
84
  readonly message: string;
84
85
  }[]] | undefined;
85
86
  readonly align: "center" | "left" | "right";
87
+ readonly required?: string | undefined;
86
88
  readonly compatibilityDate: "2026-06-14";
87
89
  readonly grow?: boolean | undefined;
88
90
  readonly groupId?: string | undefined;
@@ -104,10 +106,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
104
106
  readonly mode: "formula" | "prefill";
105
107
  readonly expression: string;
106
108
  } | undefined;
107
- readonly enableSorting?: boolean | undefined;
108
109
  readonly nodeKey: string;
109
110
  readonly nodeChildren: string;
110
111
  readonly nodeLabel: string;
112
+ readonly enableSorting?: boolean | undefined;
111
113
  readonly cascade: "independent" | "cascade-down" | "cascade-both";
112
114
  readonly nodeTooltip?: readonly [{
113
115
  readonly locale: "zh";
@@ -99,6 +99,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
99
99
  readonly message: string;
100
100
  }[]], never>>;
101
101
  hidden: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
102
+ required: Schema.optional<Schema.Schema<string, string, never>>;
102
103
  id: Schema.refine<string, typeof Schema.String>;
103
104
  groupId: Schema.optional<typeof Schema.UUID>;
104
105
  type: Schema.Literal<["com.shwfed.table.column.tree-combobox-multi"]>;
@@ -68,7 +68,7 @@ export function schema(configure) {
68
68
  return Schema.Struct({
69
69
  type: Schema.Literal(type),
70
70
  compatibilityDate: Schema.Literal(compatibilityDate),
71
- ...editableColumnFields(),
71
+ ...editableColumnFields(configure),
72
72
  align: Schema.optionalWith(Align.annotations({ title: "\u5BF9\u9F50" }), { default: () => "left" }),
73
73
  placeholder: Schema.optional(Locale.annotations({
74
74
  title: "\u5360\u4F4D\u7B26",
@@ -24,6 +24,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
24
24
  readonly message: string;
25
25
  }[]] | undefined;
26
26
  readonly align: "center" | "left" | "right";
27
+ readonly required?: string | undefined;
27
28
  readonly compatibilityDate: "2026-06-14";
28
29
  readonly grow?: boolean | undefined;
29
30
  readonly groupId?: string | undefined;
@@ -45,10 +46,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
45
46
  readonly mode: "formula" | "prefill";
46
47
  readonly expression: string;
47
48
  } | undefined;
48
- readonly enableSorting?: boolean | undefined;
49
49
  readonly nodeKey: string;
50
50
  readonly nodeChildren: string;
51
51
  readonly nodeLabel: string;
52
+ readonly enableSorting?: boolean | undefined;
52
53
  readonly nodeTooltip?: readonly [{
53
54
  readonly locale: "zh";
54
55
  readonly message: string;
@@ -82,6 +83,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
82
83
  readonly message: string;
83
84
  }[]] | undefined;
84
85
  readonly align: "center" | "left" | "right";
86
+ readonly required?: string | undefined;
85
87
  readonly compatibilityDate: "2026-06-14";
86
88
  readonly grow?: boolean | undefined;
87
89
  readonly groupId?: string | undefined;
@@ -103,10 +105,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
105
  readonly mode: "formula" | "prefill";
104
106
  readonly expression: string;
105
107
  } | undefined;
106
- readonly enableSorting?: boolean | undefined;
107
108
  readonly nodeKey: string;
108
109
  readonly nodeChildren: string;
109
110
  readonly nodeLabel: string;
111
+ readonly enableSorting?: boolean | undefined;
110
112
  readonly nodeTooltip?: readonly [{
111
113
  readonly locale: "zh";
112
114
  readonly message: string;
@@ -533,6 +533,28 @@ const derivedModel = computed({
533
533
  @update:model-value="(v) => setOptionalExpression('readonly', v)"
534
534
  />
535
535
  </Field>
536
+ <Field orientation="vertical">
537
+ <FieldLabel class="text-xs text-zinc-500">
538
+ <template
539
+ v-if="fieldDescription('required')"
540
+ #tooltip
541
+ >
542
+ <Markdown
543
+ :source="fieldDescription('required')"
544
+ block
545
+ class="prose prose-sm prose-zinc"
546
+ />
547
+ </template>
548
+ {{ fieldTitle("required") }}
549
+ </FieldLabel>
550
+ <ExpressionEditor
551
+ :model-value="value.required ?? ''"
552
+ placeholder="例:row.type == 'company'"
553
+ result-type="bool"
554
+ :extra-vars="ROW_VARS"
555
+ @update:model-value="(v) => setOptionalExpression('required', v)"
556
+ />
557
+ </Field>
536
558
  <Field
537
559
  orientation="vertical"
538
560
  class="col-span-2"
@@ -24,6 +24,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
24
24
  readonly message: string;
25
25
  }[]] | undefined;
26
26
  readonly align: "center" | "left" | "right";
27
+ readonly required?: string | undefined;
27
28
  readonly compatibilityDate: "2026-06-14";
28
29
  readonly grow?: boolean | undefined;
29
30
  readonly groupId?: string | undefined;
@@ -45,10 +46,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
45
46
  readonly mode: "formula" | "prefill";
46
47
  readonly expression: string;
47
48
  } | undefined;
48
- readonly enableSorting?: boolean | undefined;
49
49
  readonly nodeKey: string;
50
50
  readonly nodeChildren: string;
51
51
  readonly nodeLabel: string;
52
+ readonly enableSorting?: boolean | undefined;
52
53
  readonly nodeTooltip?: readonly [{
53
54
  readonly locale: "zh";
54
55
  readonly message: string;
@@ -82,6 +83,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
82
83
  readonly message: string;
83
84
  }[]] | undefined;
84
85
  readonly align: "center" | "left" | "right";
86
+ readonly required?: string | undefined;
85
87
  readonly compatibilityDate: "2026-06-14";
86
88
  readonly grow?: boolean | undefined;
87
89
  readonly groupId?: string | undefined;
@@ -103,10 +105,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
105
  readonly mode: "formula" | "prefill";
104
106
  readonly expression: string;
105
107
  } | undefined;
106
- readonly enableSorting?: boolean | undefined;
107
108
  readonly nodeKey: string;
108
109
  readonly nodeChildren: string;
109
110
  readonly nodeLabel: string;
111
+ readonly enableSorting?: boolean | undefined;
110
112
  readonly nodeTooltip?: readonly [{
111
113
  readonly locale: "zh";
112
114
  readonly message: string;
@@ -96,6 +96,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
96
96
  readonly message: string;
97
97
  }[]], never>>;
98
98
  hidden: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
99
+ required: Schema.optional<Schema.Schema<string, string, never>>;
99
100
  id: Schema.refine<string, typeof Schema.String>;
100
101
  groupId: Schema.optional<typeof Schema.UUID>;
101
102
  type: Schema.Literal<["com.shwfed.table.column.tree-combobox-single"]>;
@@ -68,7 +68,7 @@ export function schema(configure) {
68
68
  return Schema.Struct({
69
69
  type: Schema.Literal(type),
70
70
  compatibilityDate: Schema.Literal(compatibilityDate),
71
- ...editableColumnFields(),
71
+ ...editableColumnFields(configure),
72
72
  align: Schema.optionalWith(Align.annotations({ title: "\u5BF9\u9F50" }), { default: () => "left" }),
73
73
  placeholder: Schema.optional(Locale.annotations({
74
74
  title: "\u5360\u4F4D\u7B26",
@@ -202,6 +202,17 @@ const readonlyModel = computed({
202
202
  }
203
203
  }
204
204
  });
205
+ const requiredModel = computed({
206
+ get: () => value.value.required ?? "",
207
+ set: (v) => {
208
+ if (v === "") {
209
+ const { required: _drop, ...rest } = value.value;
210
+ value.value = rest;
211
+ } else {
212
+ value.value = { ...value.value, required: v };
213
+ }
214
+ }
215
+ });
205
216
  const disabledDateModel = computed({
206
217
  get: () => value.value.disabledDate ?? "",
207
218
  set: (v) => {
@@ -473,6 +484,27 @@ const derivedModel = computed({
473
484
  :extra-vars="ROW_VARS"
474
485
  />
475
486
  </Field>
487
+ <Field orientation="vertical">
488
+ <FieldLabel class="text-xs text-zinc-500">
489
+ <template
490
+ v-if="fieldDescription('required')"
491
+ #tooltip
492
+ >
493
+ <Markdown
494
+ :source="fieldDescription('required')"
495
+ block
496
+ class="prose prose-sm prose-zinc"
497
+ />
498
+ </template>
499
+ {{ fieldTitle("required") }}
500
+ </FieldLabel>
501
+ <ExpressionEditor
502
+ v-model="requiredModel"
503
+ placeholder="例:row.type == 'company'"
504
+ result-type="bool"
505
+ :extra-vars="ROW_VARS"
506
+ />
507
+ </Field>
476
508
  <Field orientation="vertical">
477
509
  <FieldLabel class="text-xs text-zinc-500">
478
510
  <template
@@ -233,6 +233,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
233
233
  readonly message: string;
234
234
  }[]], never>>;
235
235
  hidden: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
236
+ required: Schema.optional<Schema.Schema<string, string, never>>;
236
237
  id: Schema.refine<string, typeof Schema.String>;
237
238
  groupId: Schema.optional<typeof Schema.UUID>;
238
239
  type: Schema.Literal<["com.shwfed.table.column.date-input"]>;
@@ -48,7 +48,7 @@ export function schema(configure) {
48
48
  return Schema.Struct({
49
49
  type: Schema.Literal(type),
50
50
  compatibilityDate: Schema.Literal(compatibilityDate),
51
- ...editableColumnFields(),
51
+ ...editableColumnFields(configure),
52
52
  align: Schema.optionalWith(Align.annotations({ title: "\u5BF9\u9F50" }), { default: () => "left" }),
53
53
  placeholder: Schema.optional(Locale.annotations({
54
54
  title: "\u5360\u4F4D\u7B26",
@@ -202,6 +202,17 @@ const readonlyModel = computed({
202
202
  }
203
203
  }
204
204
  });
205
+ const requiredModel = computed({
206
+ get: () => value.value.required ?? "",
207
+ set: (v) => {
208
+ if (v === "") {
209
+ const { required: _drop, ...rest } = value.value;
210
+ value.value = rest;
211
+ } else {
212
+ value.value = { ...value.value, required: v };
213
+ }
214
+ }
215
+ });
205
216
  const disabledDateModel = computed({
206
217
  get: () => value.value.disabledDate ?? "",
207
218
  set: (v) => {
@@ -569,6 +580,27 @@ const derivedModel = computed({
569
580
  :extra-vars="ROW_VARS"
570
581
  />
571
582
  </Field>
583
+ <Field orientation="vertical">
584
+ <FieldLabel class="text-xs text-zinc-500">
585
+ <template
586
+ v-if="fieldDescription('required')"
587
+ #tooltip
588
+ >
589
+ <Markdown
590
+ :source="fieldDescription('required')"
591
+ block
592
+ class="prose prose-sm prose-zinc"
593
+ />
594
+ </template>
595
+ {{ fieldTitle("required") }}
596
+ </FieldLabel>
597
+ <ExpressionEditor
598
+ v-model="requiredModel"
599
+ placeholder="例:row.type == 'company'"
600
+ result-type="bool"
601
+ :extra-vars="ROW_VARS"
602
+ />
603
+ </Field>
572
604
  <Field orientation="vertical">
573
605
  <FieldLabel class="text-xs text-zinc-500">
574
606
  <template
@@ -118,6 +118,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
118
118
  readonly message: string;
119
119
  }[]], never>>;
120
120
  hidden: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
121
+ required: Schema.optional<Schema.Schema<string, string, never>>;
121
122
  id: Schema.refine<string, typeof Schema.String>;
122
123
  groupId: Schema.optional<typeof Schema.UUID>;
123
124
  type: Schema.Literal<["com.shwfed.table.column.date-range-input"]>;
@@ -46,7 +46,7 @@ export function schema(configure) {
46
46
  return Schema.Struct({
47
47
  type: Schema.Literal(type),
48
48
  compatibilityDate: Schema.Literal(compatibilityDate),
49
- ...editableColumnFields(),
49
+ ...editableColumnFields(configure),
50
50
  align: Schema.optionalWith(Align.annotations({ title: "\u5BF9\u9F50" }), { default: () => "left" }),
51
51
  // Swap the inherited single-string `binding` for the range union.
52
52
  binding: bindingSchema,
@@ -79,6 +79,17 @@ const readonlyModel = computed({
79
79
  }
80
80
  }
81
81
  });
82
+ const requiredModel = computed({
83
+ get: () => value.value.required ?? "",
84
+ set: (v) => {
85
+ if (v === "") {
86
+ const { required: _drop, ...rest } = value.value;
87
+ value.value = rest;
88
+ } else {
89
+ value.value = { ...value.value, required: v };
90
+ }
91
+ }
92
+ });
82
93
  function onHiddenChange(v) {
83
94
  if (v) {
84
95
  value.value = { ...value.value, hidden: true };
@@ -746,6 +757,27 @@ const DownloadScope = defineComponent({
746
757
  :extra-vars="ROW_VARS"
747
758
  />
748
759
  </Field>
760
+ <Field orientation="vertical">
761
+ <FieldLabel class="text-xs text-zinc-500">
762
+ <template
763
+ v-if="fieldDescription('required')"
764
+ #tooltip
765
+ >
766
+ <Markdown
767
+ :source="fieldDescription('required')"
768
+ block
769
+ class="prose prose-sm prose-zinc"
770
+ />
771
+ </template>
772
+ {{ fieldTitle("required") }}
773
+ </FieldLabel>
774
+ <ExpressionEditor
775
+ v-model="requiredModel"
776
+ placeholder="例:row.type == 'company'"
777
+ result-type="bool"
778
+ :extra-vars="ROW_VARS"
779
+ />
780
+ </Field>
749
781
  </div>
750
782
 
751
783
  <div class="flex flex-wrap gap-x-8 gap-y-3">
@@ -106,6 +106,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
106
106
  readonly message: string;
107
107
  }[]], never>>;
108
108
  hidden: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
109
+ required: Schema.optional<Schema.Schema<string, string, never>>;
109
110
  id: Schema.refine<string, typeof Schema.String>;
110
111
  groupId: Schema.optional<typeof Schema.UUID>;
111
112
  type: Schema.Literal<["com.shwfed.table.column.upload"]>;
@@ -46,7 +46,7 @@ export function schema(configure) {
46
46
  return Schema.Struct({
47
47
  type: Schema.Literal(type),
48
48
  compatibilityDate: Schema.Literal(compatibilityDate),
49
- ...editableColumnFields(),
49
+ ...editableColumnFields(configure),
50
50
  disabled: Schema.optional(CelBool.annotations({
51
51
  title: "\u7981\u7528\u6761\u4EF6",
52
52
  description: "\u8FD4\u56DE `true` \u65F6\u6DFB\u52A0\u6309\u94AE\u4ECD\u7136\u6E32\u67D3\u4F46\u4E0D\u53EF\u64CD\u4F5C"
@@ -8,6 +8,7 @@ declare module '@tanstack/vue-table' {
8
8
  grow?: boolean;
9
9
  editable?: boolean;
10
10
  readonlyExpr?: string;
11
+ required?: boolean;
11
12
  }
12
13
  }
13
14
  declare const _default: typeof __VLS_export;
@@ -213,9 +213,11 @@ function translateColumn(column) {
213
213
  const contribution = entry.toColumnDef(column, { getLocaleText, $cel, inheritedContext: celBindings(inheritedContext) });
214
214
  const editable = isEditableHeader(contribution.header);
215
215
  const readonlyExpr = editable ? column.readonly : void 0;
216
+ const requiredExpr = editable ? column.required : void 0;
217
+ const required = typeof requiredExpr === "string" && requiredExpr.trim().length > 0;
216
218
  return {
217
219
  ...contribution,
218
- meta: { ...contribution.meta, editable, readonlyExpr },
220
+ meta: { ...contribution.meta, editable, readonlyExpr, required },
219
221
  id: column.id,
220
222
  // `ctx` is the functional-component props object Vue mutates in place on
221
223
  // every update, so its identity stays stable across data refetches.
@@ -998,6 +1000,15 @@ export { TableConfig, createTableConfig, getColumnTechnicalKey } from "./schema"
998
1000
  :props="header.getContext()"
999
1001
  />
1000
1002
 
1003
+ <!-- Required star: shown for editable columns carrying a
1004
+ non-empty `required` expression. Row-agnostic marker,
1005
+ mirrors the field-label star styling. -->
1006
+ <span
1007
+ v-if="!header.isPlaceholder && header.column.columnDef.meta?.required"
1008
+ aria-hidden="true"
1009
+ class="text-red-600"
1010
+ >*</span>
1011
+
1001
1012
  <!-- Edit affordance: marks an editable column, hidden when
1002
1013
  the column reads as readonly (form-wide or its own
1003
1014
  `readonly` condition). -->
@@ -8,6 +8,7 @@ declare module '@tanstack/vue-table' {
8
8
  grow?: boolean;
9
9
  editable?: boolean;
10
10
  readonlyExpr?: string;
11
+ required?: boolean;
11
12
  }
12
13
  }
13
14
  declare const _default: typeof __VLS_export;
@@ -43,7 +43,8 @@ export declare function columnFields(configure: (env: Environment) => void): {
43
43
  id: Schema.refine<string, typeof Schema.String>;
44
44
  groupId: Schema.optional<typeof Schema.UUID>;
45
45
  };
46
- export declare function editableColumnFields(): {
46
+ export declare function editableRequiredField(configure: (env: Environment) => void): Schema.optional<Schema.Schema<string, string, never>>;
47
+ export declare function editableColumnFields(configure: (env: Environment) => void): {
47
48
  title: Schema.suspend<readonly [{
48
49
  readonly locale: "zh";
49
50
  readonly message: string;
@@ -76,6 +77,7 @@ export declare function editableColumnFields(): {
76
77
  readonly message: string;
77
78
  }[]], never>>;
78
79
  hidden: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
80
+ required: Schema.optional<Schema.Schema<string, string, never>>;
79
81
  id: Schema.refine<string, typeof Schema.String>;
80
82
  groupId: Schema.optional<typeof Schema.UUID>;
81
83
  };
@@ -59,7 +59,32 @@ export function columnFields(configure) {
59
59
  }))
60
60
  };
61
61
  }
62
- export function editableColumnFields() {
62
+ function CelColumnRequired(configure) {
63
+ return Expression({
64
+ configure: (env) => {
65
+ configure(env);
66
+ const declared = new Set(env.getDefinitions().variables.map((v) => v.name));
67
+ if (!declared.has("row")) {
68
+ env.registerVariable("row", "dyn", { label: "\u5F53\u524D\u884C", description: "\u5F53\u524D\u884C\u6570\u636E" });
69
+ }
70
+ if (!declared.has("index")) {
71
+ env.registerVariable("index", "number", { label: "\u884C\u5E8F\u53F7", description: "\u884C\u7D22\u5F15" });
72
+ }
73
+ },
74
+ resultType: "bool"
75
+ });
76
+ }
77
+ export function editableRequiredField(configure) {
78
+ return Schema.optional(CelColumnRequired(configure).annotations({
79
+ title: "\u5FC5\u586B",
80
+ description: md`
81
+ 返回 \`true\` 时,该列**表头显示必填星号**。可访问 \`row\` / \`index\` / \`form\`,因此可写「部分行必填」的条件(例如 \`row.type == 'company'\`)。
82
+
83
+ **当前版本星号仅作视觉标识,不会拦截提交**——实际必填校验请在表格字段的「校验规则」中用 CEL 编写(可读整表 \`form.<绑定路径>\`)。后续版本将据此表达式自动完成逐行校验并拦截提交。
84
+ `
85
+ }));
86
+ }
87
+ export function editableColumnFields(configure) {
63
88
  return {
64
89
  ...columnIdentityFields(),
65
90
  title: Locale.annotations({ title: "\u540D\u79F0", description: "\u5217\u6807\u9898" }),
@@ -84,7 +109,8 @@ export function editableColumnFields() {
84
109
  hidden: Schema.optional(Schema.Boolean.annotations({
85
110
  title: "\u9ED8\u8BA4\u9690\u85CF",
86
111
  description: "\u5F00\u542F\u540E\u8BE5\u5217\u9ED8\u8BA4\u9690\u85CF\uFF1B\u4F7F\u7528\u8005\u53EF\u5728\u8868\u683C\u7684\u5217\u8BBE\u7F6E\u4E2D\u91CD\u65B0\u663E\u793A\u3002\u4EC5\u4F5C\u4E3A\u521D\u59CB\u72B6\u6001\uFF0C\u4E0D\u968F\u6570\u636E\u53D8\u5316"
87
- }))
112
+ })),
113
+ required: editableRequiredField(configure)
88
114
  };
89
115
  }
90
116
  const EDITABLE_HEADER_MARKER = Symbol("shwfed-editable-header");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/config",
3
- "version": "3.0.16",
3
+ "version": "3.0.18",
4
4
  "description": "Configurable UI for SHWFED",
5
5
  "type": "module",
6
6
  "publishConfig": {