@shwfed/config 2.4.1 → 2.5.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 (166) hide show
  1. package/dist/mcp.mjs +222 -45
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{config-ByTxMBcK.js → config-2hrRmW-I.js} +1 -1
  4. package/dist/preview/assets/{config-Q86AhjHq.js → config-BfzthOw9.js} +1 -1
  5. package/dist/preview/assets/{config-C7xYpB3N.js → config-BsgSoDjY.js} +1 -1
  6. package/dist/preview/assets/{config-CH9wsYX8.js → config-CaLzEMyt.js} +1 -1
  7. package/dist/preview/assets/{config-D50Rl2n_.js → config-DKtPKn2s.js} +1 -1
  8. package/dist/preview/assets/{config-BovRv7Mw.js → config-DdgZWox9.js} +1 -1
  9. package/dist/preview/assets/{config-Ch5dL5lp.js → config-h_LH1CT_.js} +1 -1
  10. package/dist/preview/assets/{config-DiwVK32V.js → config-nsiwkAq8.js} +1 -1
  11. package/dist/preview/assets/{config-EKVeWrbS.js → config-zxVo1EOM.js} +1 -1
  12. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-D8NPPbjZ.js → definition.vue_vue_type_script_setup_true_lang-CLpbGZ37.js} +1 -1
  13. package/dist/preview/assets/index-C0NJ1FZp.js +1 -0
  14. package/dist/preview/assets/index-C5dK4QAf.js +668 -0
  15. package/dist/preview/assets/{index-65eB1l4r.css → index-nvAUAYGM.css} +1 -1
  16. package/dist/preview/assets/{runtime-D34aQN00.js → runtime-527oKJb4.js} +1 -1
  17. package/dist/preview/assets/{runtime-BP7zXnyG.js → runtime-BLhH77F7.js} +1 -1
  18. package/dist/preview/assets/{runtime-a9TOQRwD.js → runtime-BRWnAaFs.js} +1 -1
  19. package/dist/preview/assets/{runtime-BwR_BbTu.js → runtime-CEXA5ttw.js} +1 -1
  20. package/dist/preview/assets/{runtime-Cunk4vOs.js → runtime-CZZWuLu9.js} +1 -1
  21. package/dist/preview/assets/{runtime-Ch3JIgUQ.js → runtime-DOLtY37Y.js} +1 -1
  22. package/dist/preview/assets/{runtime-BQSwNpLC.js → runtime-DZqXButD.js} +1 -1
  23. package/dist/preview/assets/{runtime-aPt-bW3F.js → runtime-MJo092Ed.js} +1 -1
  24. package/dist/preview/assets/{runtime-CjvZcU7X.js → runtime-i3-6DCWP.js} +1 -1
  25. package/dist/preview/index.html +2 -2
  26. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +1 -1
  27. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +2 -2
  28. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +2 -2
  29. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +2 -2
  30. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +2 -2
  31. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +2 -2
  32. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +2 -2
  33. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +20 -20
  34. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +20 -20
  35. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +20 -20
  36. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +20 -20
  37. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +20 -20
  38. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +20 -20
  39. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +20 -20
  40. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +20 -20
  41. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +20 -20
  42. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +20 -20
  43. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +20 -20
  44. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +20 -20
  45. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +20 -20
  46. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +20 -20
  47. package/dist/runtime/components/form/index.vue +5 -18
  48. package/dist/runtime/components/form/schema.d.ts +2 -10
  49. package/dist/runtime/components/form/schema.js +2 -5
  50. package/dist/runtime/components/form/utils/cel-scope.d.ts +12 -3
  51. package/dist/runtime/components/form/utils/cel-scope.js +17 -18
  52. package/dist/runtime/components/form/utils/form-vars.d.ts +19 -0
  53. package/dist/runtime/components/form/utils/form-vars.js +5 -0
  54. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.actions/schema.d.ts +1 -0
  55. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.actions/schema.js +8 -0
  56. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/config.vue +20 -8
  57. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/schema.d.ts +2 -0
  58. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/schema.js +8 -0
  59. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/config.vue +21 -8
  60. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/schema.d.ts +2 -0
  61. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/schema.js +7 -0
  62. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/schema.d.ts +1 -0
  63. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/schema.js +7 -0
  64. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/config.vue +21 -8
  65. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/schema.d.ts +2 -0
  66. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/schema.js +8 -0
  67. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.d.ts +1 -0
  68. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.js +5 -0
  69. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/config.vue +21 -8
  70. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.d.ts +2 -0
  71. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.js +7 -0
  72. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/config.vue +21 -8
  73. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts +1 -0
  74. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/config.vue +21 -8
  75. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.d.ts +2 -0
  76. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.js +7 -0
  77. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -0
  78. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue +20 -8
  79. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -0
  80. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/schema.d.ts +1 -0
  81. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.vue +20 -7
  82. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.d.ts +2 -0
  83. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.js +7 -0
  84. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/config.vue +20 -8
  85. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/schema.d.ts +1 -0
  86. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/config.vue +20 -8
  87. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.d.ts +2 -0
  88. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.js +7 -0
  89. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.vue +20 -8
  90. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.d.ts +2 -0
  91. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.js +7 -0
  92. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +6 -4
  93. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue +21 -8
  94. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +6 -4
  95. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.d.ts +1 -0
  96. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +4 -2
  97. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue +20 -8
  98. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +4 -2
  99. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.d.ts +1 -0
  100. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -0
  101. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue +20 -8
  102. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -0
  103. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/schema.d.ts +1 -0
  104. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +6 -4
  105. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue +21 -8
  106. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +6 -4
  107. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.d.ts +1 -0
  108. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +4 -2
  109. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue +20 -8
  110. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +4 -2
  111. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.d.ts +1 -0
  112. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +4 -2
  113. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue +20 -8
  114. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +4 -2
  115. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.d.ts +1 -0
  116. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +6 -4
  117. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue +20 -8
  118. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +6 -4
  119. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.d.ts +1 -0
  120. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.d.vue.ts +4 -2
  121. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue +20 -8
  122. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue.d.ts +4 -2
  123. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/schema.d.ts +1 -0
  124. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +6 -4
  125. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue +20 -8
  126. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +6 -4
  127. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.d.ts +1 -0
  128. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +8 -6
  129. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue +20 -7
  130. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +8 -6
  131. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +1 -0
  132. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +6 -4
  133. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue +20 -7
  134. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +6 -4
  135. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/schema.d.ts +1 -0
  136. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +6 -4
  137. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue +20 -8
  138. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +6 -4
  139. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.d.ts +2 -0
  140. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.js +10 -1
  141. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +6 -4
  142. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue +20 -8
  143. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +6 -4
  144. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.d.ts +2 -0
  145. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.js +10 -1
  146. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +8 -6
  147. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue +20 -7
  148. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +8 -6
  149. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +1 -0
  150. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.js +3 -0
  151. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +6 -4
  152. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue +20 -7
  153. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +6 -4
  154. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.d.ts +1 -0
  155. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.js +3 -0
  156. package/dist/runtime/components/table/config.vue +24 -103
  157. package/dist/runtime/components/table/index.vue +22 -2
  158. package/dist/runtime/components/table/schema.d.ts +4 -2
  159. package/dist/runtime/components/table/schema.js +69 -13
  160. package/dist/runtime/components/table/utils/resolve.d.ts +14 -0
  161. package/dist/runtime/components/table/utils/resolve.js +2 -1
  162. package/dist/runtime/components/table/utils/shared.d.ts +2 -0
  163. package/dist/runtime/components/table/utils/shared.js +10 -2
  164. package/package.json +1 -1
  165. package/dist/preview/assets/index-CIrlYN0M.js +0 -1
  166. package/dist/preview/assets/index-DUDlWaQI.js +0 -661
@@ -44,6 +44,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
44
44
  readonly data: string;
45
45
  readonly request?: string | undefined;
46
46
  };
47
+ readonly enableSorting?: boolean | undefined;
48
+ readonly cascade: "independent" | "cascade-down" | "cascade-both";
47
49
  readonly nodeKey: string;
48
50
  readonly nodeChildren: string;
49
51
  readonly nodeLabel: readonly [{
@@ -53,9 +55,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
53
55
  readonly locale: "en" | "ja" | "ko";
54
56
  readonly message: string;
55
57
  }[]];
56
- readonly expandAll: boolean;
57
- readonly cascade: "independent" | "cascade-down" | "cascade-both";
58
- readonly enableSorting?: boolean | undefined;
59
58
  readonly nodeTooltip?: readonly [{
60
59
  readonly locale: "zh";
61
60
  readonly message: string;
@@ -64,6 +63,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
64
63
  readonly message: string;
65
64
  }[]] | undefined;
66
65
  readonly nodeSelectable?: string | undefined;
66
+ readonly expandAll: boolean;
67
+ readonly sortKey?: string | undefined;
67
68
  }) => any;
68
69
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
69
70
  "onUpdate:modelValue"?: ((value: {
@@ -107,6 +108,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
107
108
  readonly data: string;
108
109
  readonly request?: string | undefined;
109
110
  };
111
+ readonly enableSorting?: boolean | undefined;
112
+ readonly cascade: "independent" | "cascade-down" | "cascade-both";
110
113
  readonly nodeKey: string;
111
114
  readonly nodeChildren: string;
112
115
  readonly nodeLabel: readonly [{
@@ -116,9 +119,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
116
119
  readonly locale: "en" | "ja" | "ko";
117
120
  readonly message: string;
118
121
  }[]];
119
- readonly expandAll: boolean;
120
- readonly cascade: "independent" | "cascade-down" | "cascade-both";
121
- readonly enableSorting?: boolean | undefined;
122
122
  readonly nodeTooltip?: readonly [{
123
123
  readonly locale: "zh";
124
124
  readonly message: string;
@@ -127,6 +127,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
127
127
  readonly message: string;
128
128
  }[]] | undefined;
129
129
  readonly nodeSelectable?: string | undefined;
130
+ readonly expandAll: boolean;
131
+ readonly sortKey?: string | undefined;
130
132
  }) => any) | undefined;
131
133
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
132
134
  declare const _default: typeof __VLS_export;
@@ -72,6 +72,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
72
72
  }>]>;
73
73
  binding: Schema.refine<string, typeof Schema.String>;
74
74
  enableSorting: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
75
+ sortKey: Schema.optional<Schema.refine<string, typeof Schema.String>>;
75
76
  size: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
76
77
  grow: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
77
78
  tooltip: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
@@ -122,6 +122,9 @@ export function schema(configure) {
122
122
  }
123
123
  export function defaults() {
124
124
  return {
125
+ title: [{ locale: "zh", message: "" }],
126
+ binding: "",
127
+ size: 200,
125
128
  dataSource: { data: "[]" },
126
129
  nodeKey: "string(node.id)",
127
130
  nodeChildren: "has(node.children) ? node.children : null",
@@ -44,6 +44,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
44
44
  readonly data: string;
45
45
  readonly request?: string | undefined;
46
46
  };
47
+ readonly enableSorting?: boolean | undefined;
47
48
  readonly nodeKey: string;
48
49
  readonly nodeChildren: string;
49
50
  readonly nodeLabel: readonly [{
@@ -53,8 +54,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
53
54
  readonly locale: "en" | "ja" | "ko";
54
55
  readonly message: string;
55
56
  }[]];
56
- readonly expandAll: boolean;
57
- readonly enableSorting?: boolean | undefined;
58
57
  readonly nodeTooltip?: readonly [{
59
58
  readonly locale: "zh";
60
59
  readonly message: string;
@@ -63,6 +62,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
63
62
  readonly message: string;
64
63
  }[]] | undefined;
65
64
  readonly nodeSelectable?: string | undefined;
65
+ readonly expandAll: boolean;
66
+ readonly sortKey?: string | undefined;
66
67
  }) => any;
67
68
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
68
69
  "onUpdate:modelValue"?: ((value: {
@@ -106,6 +107,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
106
107
  readonly data: string;
107
108
  readonly request?: string | undefined;
108
109
  };
110
+ readonly enableSorting?: boolean | undefined;
109
111
  readonly nodeKey: string;
110
112
  readonly nodeChildren: string;
111
113
  readonly nodeLabel: readonly [{
@@ -115,8 +117,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
115
117
  readonly locale: "en" | "ja" | "ko";
116
118
  readonly message: string;
117
119
  }[]];
118
- readonly expandAll: boolean;
119
- readonly enableSorting?: boolean | undefined;
120
120
  readonly nodeTooltip?: readonly [{
121
121
  readonly locale: "zh";
122
122
  readonly message: string;
@@ -125,6 +125,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
125
125
  readonly message: string;
126
126
  }[]] | undefined;
127
127
  readonly nodeSelectable?: string | undefined;
128
+ readonly expandAll: boolean;
129
+ readonly sortKey?: string | undefined;
128
130
  }) => any) | undefined;
129
131
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
130
132
  declare const _default: typeof __VLS_export;
@@ -537,14 +537,10 @@ const derivedModel = computed({
537
537
  <Separator />
538
538
  <div class="flex flex-wrap gap-x-8 gap-y-3">
539
539
  <Field
540
- orientation="horizontal"
541
- class="w-auto gap-2"
540
+ orientation="vertical"
541
+ class="w-full max-w-xs"
542
542
  >
543
- <Switch
544
- :model-value="value.enableSorting ?? false"
545
- @update:model-value="(v) => value = { ...value, enableSorting: v }"
546
- />
547
- <FieldLabel class="text-sm text-zinc-600">
543
+ <FieldLabel class="text-xs text-zinc-500">
548
544
  <template
549
545
  v-if="fieldDescription('enableSorting')"
550
546
  #tooltip
@@ -557,6 +553,23 @@ const derivedModel = computed({
557
553
  </template>
558
554
  {{ fieldTitle("enableSorting") }}
559
555
  </FieldLabel>
556
+ <InputGroup>
557
+ <InputGroupInput
558
+ :model-value="value.sortKey"
559
+ placeholder="例:created_at"
560
+ @update:model-value="(v) => value = { ...value, sortKey: v || void 0 }"
561
+ />
562
+ <InputGroupAddon align="inline-end">
563
+ <InputGroupButton
564
+ :variant="value.enableSorting ? 'primary' : 'ghost'"
565
+ size="xs"
566
+ @click="value = { ...value, enableSorting: !value.enableSorting }"
567
+ >
568
+ <Icon :icon="value.enableSorting ? 'fluent:arrow-sort-up-16-regular' : 'fluent:arrow-sort-16-regular'" />
569
+ {{ fieldTitle("enableSorting") }}
570
+ </InputGroupButton>
571
+ </InputGroupAddon>
572
+ </InputGroup>
560
573
  </Field>
561
574
  </div>
562
575
  </div>
@@ -44,6 +44,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
44
44
  readonly data: string;
45
45
  readonly request?: string | undefined;
46
46
  };
47
+ readonly enableSorting?: boolean | undefined;
47
48
  readonly nodeKey: string;
48
49
  readonly nodeChildren: string;
49
50
  readonly nodeLabel: readonly [{
@@ -53,8 +54,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
53
54
  readonly locale: "en" | "ja" | "ko";
54
55
  readonly message: string;
55
56
  }[]];
56
- readonly expandAll: boolean;
57
- readonly enableSorting?: boolean | undefined;
58
57
  readonly nodeTooltip?: readonly [{
59
58
  readonly locale: "zh";
60
59
  readonly message: string;
@@ -63,6 +62,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
63
62
  readonly message: string;
64
63
  }[]] | undefined;
65
64
  readonly nodeSelectable?: string | undefined;
65
+ readonly expandAll: boolean;
66
+ readonly sortKey?: string | undefined;
66
67
  }) => any;
67
68
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
68
69
  "onUpdate:modelValue"?: ((value: {
@@ -106,6 +107,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
106
107
  readonly data: string;
107
108
  readonly request?: string | undefined;
108
109
  };
110
+ readonly enableSorting?: boolean | undefined;
109
111
  readonly nodeKey: string;
110
112
  readonly nodeChildren: string;
111
113
  readonly nodeLabel: readonly [{
@@ -115,8 +117,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
115
117
  readonly locale: "en" | "ja" | "ko";
116
118
  readonly message: string;
117
119
  }[]];
118
- readonly expandAll: boolean;
119
- readonly enableSorting?: boolean | undefined;
120
120
  readonly nodeTooltip?: readonly [{
121
121
  readonly locale: "zh";
122
122
  readonly message: string;
@@ -125,6 +125,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
125
125
  readonly message: string;
126
126
  }[]] | undefined;
127
127
  readonly nodeSelectable?: string | undefined;
128
+ readonly expandAll: boolean;
129
+ readonly sortKey?: string | undefined;
128
130
  }) => any) | undefined;
129
131
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
130
132
  declare const _default: typeof __VLS_export;
@@ -69,6 +69,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
69
69
  }>]>;
70
70
  binding: Schema.refine<string, typeof Schema.String>;
71
71
  enableSorting: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
72
+ sortKey: Schema.optional<Schema.refine<string, typeof Schema.String>>;
72
73
  size: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
73
74
  grow: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
74
75
  tooltip: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
@@ -115,6 +115,9 @@ export function schema(configure) {
115
115
  }
116
116
  export function defaults() {
117
117
  return {
118
+ title: [{ locale: "zh", message: "" }],
119
+ binding: "",
120
+ size: 200,
118
121
  dataSource: { data: "[]" },
119
122
  nodeKey: "string(node.id)",
120
123
  nodeChildren: "has(node.children) ? node.children : null",
@@ -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, configureTableActionsScope, metadata as tableMetadata } from "./schema";
8
+ import { TableConfig, Pagination, ColumnGroup, tableDataSource, configureTableActionsScope, registerDataSourceRequestVars, registerDataSourceResponseVars, metadata as tableMetadata } from "./schema";
9
9
  import { COLUMNS, findColumn as findColumnEntry } from "./utils/resolve";
10
10
  import {
11
11
  useTreeDnd
@@ -36,6 +36,22 @@ import ShwfedFormConfig from "../form/config.vue";
36
36
  import { defaultFormConfig } from "../form/schema";
37
37
  import { Environment } from "../../vendor/cel-js/lib/index";
38
38
  defineOptions({ name: "ShwfedTableConfig" });
39
+ function probeCELContext(register) {
40
+ const probe = new Environment({ unlistedVariablesAreDyn: false });
41
+ const baseline = new Set(probe.getDefinitions().variables.map((v) => v.name));
42
+ register(probe);
43
+ const out = {};
44
+ for (const v of probe.getDefinitions().variables) {
45
+ if (baseline.has(v.name)) continue;
46
+ out[v.name] = {
47
+ type: v.type,
48
+ label: v.label ?? v.name,
49
+ description: v.description ?? void 0,
50
+ value: void 0
51
+ };
52
+ }
53
+ return out;
54
+ }
39
55
  const RowKeyCELContext = defineComponent({
40
56
  name: "RowKeyCELContext",
41
57
  setup(_, { slots }) {
@@ -97,40 +113,14 @@ const CellStyleCELContext = defineComponent({
97
113
  const RequestCELContext = defineComponent({
98
114
  name: "RequestCELContext",
99
115
  setup(_, { slots }) {
100
- provideCELContext({
101
- pageIndex: {
102
- type: "number",
103
- label: "\u5F53\u524D\u9875\u7801",
104
- description: "\u4ECE `0` \u5F00\u59CB\uFF1B\u672A\u542F\u7528\u5206\u9875\u65F6\u4E3A `0`\u3002",
105
- value: 0
106
- },
107
- pageSize: {
108
- type: "number",
109
- label: "\u6BCF\u9875\u884C\u6570",
110
- description: "\u5F53\u524D\u6BCF\u9875\u884C\u6570\uFF1B\u672A\u542F\u7528\u5206\u9875\u65F6\u4E3A `0`\u3002",
111
- value: 0
112
- },
113
- query: {
114
- type: "dyn",
115
- label: "\u641C\u7D22\u6761\u4EF6",
116
- description: "\u641C\u7D22\u6761\u4EF6\u5F53\u524D\u72B6\u6001\uFF1B\u672A\u914D\u7F6E\u65F6\u4E3A\u7A7A\u5BF9\u8C61\u3002",
117
- value: {}
118
- }
119
- });
116
+ provideCELContext(probeCELContext(registerDataSourceRequestVars));
120
117
  return () => slots.default?.();
121
118
  }
122
119
  });
123
120
  const JsonCELContext = defineComponent({
124
121
  name: "JsonCELContext",
125
122
  setup(_, { slots }) {
126
- provideCELContext({
127
- json: {
128
- type: "optional<dyn>",
129
- label: "HTTP \u54CD\u5E94\u4F53",
130
- description: "\u5DF2\u89E3\u6790\u7684 JSON \u54CD\u5E94\uFF1B\u672A\u914D\u7F6E `request` \u65F6\u4E3A `none`\u3002",
131
- value: void 0
132
- }
133
- });
123
+ provideCELContext(probeCELContext(registerDataSourceResponseVars));
134
124
  return () => slots.default?.();
135
125
  }
136
126
  });
@@ -165,22 +155,7 @@ function configureTableQuery(env) {
165
155
  const tableConfigSchema = TableConfig(configure);
166
156
  const dataSourceSchema = tableDataSource(configure);
167
157
  const pickerEntries = computed(() => COLUMNS.filter((e) => !e.deprecated));
168
- const advertisedHostContext = (() => {
169
- const probe = new Environment({ unlistedVariablesAreDyn: false });
170
- const baseline = new Set(probe.getDefinitions().variables.map((v) => v.name));
171
- configure(probe);
172
- const out = {};
173
- for (const v of probe.getDefinitions().variables) {
174
- if (baseline.has(v.name)) continue;
175
- out[v.name] = {
176
- type: v.type,
177
- label: v.label ?? v.name,
178
- description: v.description ?? void 0,
179
- value: void 0
180
- };
181
- }
182
- return out;
183
- })();
158
+ const advertisedHostContext = probeCELContext(configure);
184
159
  provideCELContext(advertisedHostContext);
185
160
  const generalFieldTitle = (f) => getStructFieldTitle(tableConfigSchema, f) ?? f;
186
161
  const generalFieldDescription = (f) => getStructFieldDescription(tableConfigSchema, f);
@@ -471,62 +446,8 @@ function getColumnTypeLabel(type, compatibilityDate) {
471
446
  return findColumnEntry(type, compatibilityDate)?.metadata.name ?? type;
472
447
  }
473
448
  function getColumnDefaults(id, type, compatibilityDate) {
474
- switch (type) {
475
- case "com.shwfed.table.column.text":
476
- return { id, type, compatibilityDate, title: [{ locale: "zh", message: "" }], accessor: "", size: 120 };
477
- case "com.shwfed.table.column.date":
478
- return { id, type, compatibilityDate, title: [{ locale: "zh", message: "" }], accessor: "", format: "yyyy-MM-dd", size: 120 };
479
- case "com.shwfed.table.column.number":
480
- return { id, type, compatibilityDate, title: [{ locale: "zh", message: "" }], accessor: "", size: 120, align: "right" };
481
- case "com.shwfed.table.column.select":
482
- return { id, type, compatibilityDate, mode: "checkbox" };
483
- case "com.shwfed.table.column.markdown":
484
- return { id, type, compatibilityDate, title: [{ locale: "zh", message: "" }], markdown: [{ locale: "zh", message: "" }], size: 120 };
485
- case "com.shwfed.table.column.actions":
486
- return { id, type, compatibilityDate, title: [{ locale: "zh", message: "" }], size: 200, groups: [], items: [] };
487
- case "com.shwfed.table.column.combobox-multi":
488
- case "com.shwfed.table.column.combobox-single":
489
- return {
490
- id,
491
- type,
492
- compatibilityDate,
493
- title: [{ locale: "zh", message: "" }],
494
- size: 200,
495
- write: { kind: "binding", binding: "" },
496
- options: { kind: "static", items: [] }
497
- };
498
- case "com.shwfed.table.column.tree-combobox-single":
499
- return {
500
- id,
501
- type,
502
- compatibilityDate,
503
- title: [{ locale: "zh", message: "" }],
504
- binding: "",
505
- size: 200,
506
- dataSource: { data: "[]" },
507
- nodeKey: "string(node.id)",
508
- nodeChildren: "has(node.children) ? node.children : null",
509
- nodeLabel: [{ locale: "zh", message: "{{ node.label }}" }],
510
- expandAll: false
511
- };
512
- case "com.shwfed.table.column.tree-combobox-multi":
513
- return {
514
- id,
515
- type,
516
- compatibilityDate,
517
- title: [{ locale: "zh", message: "" }],
518
- binding: "",
519
- size: 200,
520
- dataSource: { data: "[]" },
521
- nodeKey: "string(node.id)",
522
- nodeChildren: "has(node.children) ? node.children : null",
523
- nodeLabel: [{ locale: "zh", message: "{{ node.label }}" }],
524
- cascade: "independent",
525
- expandAll: false
526
- };
527
- default:
528
- return { id, type, compatibilityDate };
529
- }
449
+ const entry = findColumnEntry(type, compatibilityDate);
450
+ return { ...entry?.defaults?.() ?? {}, id, type, compatibilityDate };
530
451
  }
531
452
  function addColumn(columnType, compatibilityDate) {
532
453
  const col = getColumnDefaults(crypto.randomUUID(), columnType, compatibilityDate);
@@ -610,9 +531,9 @@ if (breadcrumbExt) {
610
531
  crumb.dispose();
611
532
  });
612
533
  }
613
- function patchColumn(id, patch) {
534
+ function patchColumn(id, next) {
614
535
  editingColumns.value = editingColumns.value.map(
615
- (c) => c.id === id ? { ...c, ...patch } : c
536
+ (c) => c.id === id ? { ...next, id } : c
616
537
  );
617
538
  }
618
539
  function patchSelectedColumn(next) {
@@ -95,7 +95,13 @@ function getLocaleText(value) {
95
95
  return getLocalizedText(value, locale.value);
96
96
  }
97
97
  function mergeCelContext(local) {
98
- return { ...celBindings(inheritedContext), query: queryState.value, ...local };
98
+ return { ...celBindings(inheritedContext), query: queryState.value, sorts: currentSorts(), ...local };
99
+ }
100
+ function currentSorts() {
101
+ const sortKeyById = new Map(
102
+ (config.value?.columns ?? []).map((c) => [c.id, c.sortKey]).filter((e) => typeof e[1] === "string" && e[1].length > 0)
103
+ );
104
+ return tableApi.getState().sorting.map((s) => ({ key: sortKeyById.get(s.id), mode: s.desc ? "desc" : "asc" })).filter((s) => s.key !== void 0);
99
105
  }
100
106
  function translateColumn(column) {
101
107
  const entry = findColumn(column.type, column.compatibilityDate);
@@ -222,6 +228,11 @@ const tableApi = useVueTable({
222
228
  get manualPagination() {
223
229
  return isManualPagination.value;
224
230
  },
231
+ // Defer to server order under server pagination — the page only holds one
232
+ // server-sorted slice, so client re-sorting it would be wrong.
233
+ get manualSorting() {
234
+ return isManualPagination.value;
235
+ },
225
236
  get rowCount() {
226
237
  return isManualPagination.value ? serverTotal.value : void 0;
227
238
  },
@@ -256,6 +267,14 @@ provideCELContext({
256
267
  get value() {
257
268
  return queryState.value;
258
269
  }
270
+ },
271
+ sorts: {
272
+ type: "list<map<string, string>>",
273
+ label: "\u6392\u5E8F\u72B6\u6001",
274
+ description: '\u5F53\u524D\u6392\u5E8F\u5217\u8868\uFF0C\u6BCF\u9879\u4E3A `{key, mode}`\uFF1B`key` \u53D6\u81EA\u5217\u7684\u300C\u6392\u5E8F\u5B57\u6BB5\u300D(sortKey)\uFF0C`mode` \u4E3A `"asc"`/`"desc"`\uFF1B\u672A\u6392\u5E8F\u65F6\u4E3A\u7A7A\u6570\u7EC4\u3002',
275
+ get value() {
276
+ return currentSorts();
277
+ }
259
278
  }
260
279
  });
261
280
  provideSharedFetchLayer();
@@ -423,7 +442,8 @@ watch(
423
442
  () => {
424
443
  if (!isManualPagination.value) return null;
425
444
  const { pageIndex, pageSize } = tableApi.getState().pagination;
426
- return `${pageIndex}:${pageSize}`;
445
+ const sorting = tableApi.getState().sorting;
446
+ return `${pageIndex}:${pageSize}:${JSON.stringify(sorting)}`;
427
447
  },
428
448
  (next, prev) => {
429
449
  if (next !== null && next !== prev) void fetchDataSource();
@@ -96,6 +96,8 @@ export declare const ColumnGroup: Schema.Struct<{
96
96
  }>]>>;
97
97
  }>;
98
98
  export declare function configureTableActionsScope(env: Environment, configure: (env: Environment) => void): void;
99
+ export declare function registerDataSourceRequestVars(env: Environment): void;
100
+ export declare function registerDataSourceResponseVars(env: Environment): void;
99
101
  export declare function DataSource(configure: (env: Environment) => void, extras?: {
100
102
  request?: (env: Environment) => void;
101
103
  data?: (env: Environment) => void;
@@ -104,9 +106,9 @@ export declare function DataSource(configure: (env: Environment) => void, extras
104
106
  data: Schema.Schema<string, string, never>;
105
107
  }>;
106
108
  export declare function tableDataSource(configure: (env: Environment) => void): Schema.Struct<{
107
- total: Schema.optional<Schema.Schema<string, string, never>>;
108
109
  request: Schema.optional<Schema.Schema<string, string, never>>;
109
110
  data: Schema.Schema<string, string, never>;
111
+ total: Schema.optional<Schema.Schema<string, string, never>>;
110
112
  }>;
111
113
  export declare function TableConfig(configure: (env: Environment) => void): Schema.refine<{
112
114
  readonly style?: string | undefined;
@@ -304,9 +306,9 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
304
306
  default: () => never[];
305
307
  }>;
306
308
  dataSource: Schema.optional<Schema.Struct<{
307
- total: Schema.optional<Schema.Schema<string, string, never>>;
308
309
  request: Schema.optional<Schema.Schema<string, string, never>>;
309
310
  data: Schema.Schema<string, string, never>;
311
+ total: Schema.optional<Schema.Schema<string, string, never>>;
310
312
  }>>;
311
313
  actions: Schema.optional<Schema.Struct<{
312
314
  size: Schema.optionalWith<Schema.Literal<["default", "sm", "xs"]>, {
@@ -1,6 +1,7 @@
1
1
  import { Schema } from "effect";
2
2
  import { Expression } from "../../share/expression.js";
3
3
  import { Locale } from "../../share/locale.js";
4
+ import { md } from "../../share/markdown.js";
4
5
  import { ActionSchemaFields } from "../actions/schema.js";
5
6
  import { FormConfig } from "../form/schema.js";
6
7
  import { allColumnSchemas } from "./utils/resolve.js";
@@ -127,6 +128,15 @@ export const ColumnGroup = Schema.Struct({
127
128
  description: "\u5217\u5206\u7EC4\u5B9A\u4E49"
128
129
  });
129
130
  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";
131
+ const JSON_VAR_DESCRIPTION = "\u5DF2\u89E3\u6790\u7684 JSON \u54CD\u5E94\uFF1B\u672A\u914D\u7F6E `request` \u65F6\u4E3A `none`";
132
+ const SORTS_VAR_DESCRIPTION = md`
133
+ 当前的排序状态,为一个**列表**,每个元素包含两个字段:
134
+
135
+ - \`key: string\` 为该列上配置的键
136
+ - \`mode: 'asc' | 'desc'\` 为该列的排序状态
137
+
138
+ 未排序的字段,**不会出现在这个列表中**。
139
+ `;
130
140
  export function configureTableActionsScope(env, configure) {
131
141
  configure(env);
132
142
  env.registerVariable("selected", "list<dyn>", {
@@ -137,6 +147,38 @@ export function configureTableActionsScope(env, configure) {
137
147
  label: "\u641C\u7D22\u6761\u4EF6",
138
148
  description: QUERY_VAR_DESCRIPTION
139
149
  });
150
+ env.registerVariable("sorts", "list<map<string, string>>", {
151
+ label: "\u6392\u5E8F\u72B6\u6001",
152
+ description: SORTS_VAR_DESCRIPTION
153
+ });
154
+ }
155
+ export function registerDataSourceRequestVars(env) {
156
+ env.registerVariable("pageIndex", "number", {
157
+ label: "\u5F53\u524D\u9875\u7801",
158
+ description: "\u4ECE `0` \u5F00\u59CB\uFF1B\u672A\u542F\u7528\u5206\u9875\u65F6\u4E3A `0`"
159
+ });
160
+ env.registerVariable("pageSize", "number", {
161
+ label: "\u6BCF\u9875\u884C\u6570",
162
+ description: "\u5F53\u524D\u6BCF\u9875\u884C\u6570\uFF1B\u672A\u542F\u7528\u5206\u9875\u65F6\u4E3A `0`"
163
+ });
164
+ env.registerVariable("sorts", "list<map<string, string>>", {
165
+ label: "\u6392\u5E8F\u72B6\u6001",
166
+ description: SORTS_VAR_DESCRIPTION
167
+ });
168
+ env.registerVariable("query", "dyn", {
169
+ label: "\u641C\u7D22\u6761\u4EF6",
170
+ description: QUERY_VAR_DESCRIPTION
171
+ });
172
+ }
173
+ export function registerDataSourceResponseVars(env) {
174
+ env.registerVariable("json", "optional<dyn>", {
175
+ label: "HTTP \u54CD\u5E94\u4F53",
176
+ description: JSON_VAR_DESCRIPTION
177
+ });
178
+ env.registerVariable("query", "dyn", {
179
+ label: "\u641C\u7D22\u6761\u4EF6",
180
+ description: QUERY_VAR_DESCRIPTION
181
+ });
140
182
  }
141
183
  export function DataSource(configure, extras) {
142
184
  const CelRequest = Expression({
@@ -171,28 +213,36 @@ export function DataSource(configure, extras) {
171
213
  });
172
214
  }
173
215
  export function tableDataSource(configure) {
174
- const base = DataSource(configure, {
175
- request: (env) => {
176
- env.registerVariable("pageIndex", "number", { description: "\u5F53\u524D\u9875\u7801\uFF08\u4ECE 0 \u5F00\u59CB\uFF09\uFF1B\u672A\u542F\u7528\u5206\u9875\u65F6\u4E3A 0" });
177
- env.registerVariable("pageSize", "number", { description: "\u6BCF\u9875\u884C\u6570\uFF1B\u672A\u542F\u7528\u5206\u9875\u65F6\u4E3A 0" });
178
- env.registerVariable("query", "dyn", { description: QUERY_VAR_DESCRIPTION });
216
+ const CelRequest = Expression({
217
+ configure: (env) => {
218
+ configure(env);
219
+ registerDataSourceRequestVars(env);
179
220
  },
180
- data: (env) => {
181
- env.registerVariable("query", "dyn", { description: QUERY_VAR_DESCRIPTION });
182
- }
221
+ resultType: "HttpRequest"
222
+ });
223
+ const CelRows = Expression({
224
+ configure: (env) => {
225
+ configure(env);
226
+ registerDataSourceResponseVars(env);
227
+ },
228
+ resultType: (type) => type.startsWith("list") || type === "dyn" || type.startsWith("optional")
183
229
  });
184
230
  const CelTotal = Expression({
185
231
  configure: (env) => {
186
232
  configure(env);
187
- env.registerVariable("json", "optional<dyn>", {
188
- description: "HTTP \u54CD\u5E94\u4F53\uFF08\u5DF2\u89E3\u6790 JSON\uFF09\uFF1B\u672A\u914D\u7F6E request \u65F6\u4E3A none"
189
- });
190
- env.registerVariable("query", "dyn", { description: QUERY_VAR_DESCRIPTION });
233
+ registerDataSourceResponseVars(env);
191
234
  },
192
235
  resultType: (type) => type === "number" || type === "dyn" || type.startsWith("optional")
193
236
  });
194
237
  return Schema.Struct({
195
- ...base.fields,
238
+ request: Schema.optional(CelRequest).annotations({
239
+ title: "\u8BF7\u6C42",
240
+ description: "\u53EF\u9009\u7684 HTTP \u8BF7\u6C42\u8868\u8FBE\u5F0F\uFF1B\u672A\u914D\u7F6E\u65F6\u6570\u636E\u4ECE `data` \u8868\u8FBE\u5F0F\u4E2D\u8BFB\u53D6\uFF08\u901A\u5E38\u5F15\u7528\u4E0A\u4E0B\u6587\u53D8\u91CF\uFF09"
241
+ }),
242
+ data: CelRows.annotations({
243
+ title: "\u6570\u636E",
244
+ description: "\u8FD4\u56DE\u884C\u6570\u636E\u5217\u8868\uFF08`list<dyn>`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u5728\u914D\u7F6E\u4E86 `request` \u65F6\u53EF\u901A\u8FC7 `json` \u5F15\u7528\u54CD\u5E94\u4F53"
245
+ }),
196
246
  total: Schema.optional(CelTotal).annotations({
197
247
  title: "\u603B\u6570",
198
248
  description: "\u8FD4\u56DE\u603B\u884C\u6570\uFF08`number`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u914D\u7F6E\u540E\u542F\u7528\u670D\u52A1\u7AEF\u5206\u9875\uFF0C\u7559\u7A7A\u5219\u8D70\u524D\u7AEF\u5206\u9875"
@@ -283,6 +333,12 @@ export function TableConfig(configure) {
283
333
  if (cfg.dataSource?.total !== void 0 && cfg.pagination === void 0) {
284
334
  return "\u914D\u7F6E\u4E86 dataSource.total \u65F6\u5FC5\u987B\u542F\u7528\u5206\u9875";
285
335
  }
336
+ for (const col of cfg.columns) {
337
+ const c = col;
338
+ if (c.enableSorting === true && (c.sortKey === void 0 || c.sortKey.length === 0)) {
339
+ return "\u542F\u7528\u6392\u5E8F\u7684\u5217\u5FC5\u987B\u586B\u5199\u300C\u6392\u5E8F\u5B57\u6BB5\u300D(sortKey)";
340
+ }
341
+ }
286
342
  return true;
287
343
  })).annotations({
288
344
  title: "TableConfig",
@@ -43,6 +43,14 @@ export type MigrateSource = Readonly<{
43
43
  type: string;
44
44
  compatibilityDate: string;
45
45
  }>;
46
+ /**
47
+ * Optional creation-time defaults factory. Returns a partial config that
48
+ * merges into the seed when the user adds a new column, so newly-added
49
+ * columns arrive with their required fields populated. Schemas remain pure
50
+ * validators — defaults live next to them. Mirrors `FieldDefaults` in the
51
+ * form host's `resolve.ts`.
52
+ */
53
+ export type ColumnDefaults = () => Record<string, any>;
46
54
  export type ColumnEntry = Readonly<{
47
55
  type: string;
48
56
  compatibilityDate: string;
@@ -64,6 +72,12 @@ export type ColumnEntry = Readonly<{
64
72
  supersededBy?: MigrateSource;
65
73
  migrate?: MigrateFn;
66
74
  migrateFrom?: ReadonlyArray<MigrateSource>;
75
+ /**
76
+ * Optional creation-time defaults. The host merges the returned partial
77
+ * onto the seed when the user adds a new column via the picker. Absent →
78
+ * the column is created with only `{ id, type, compatibilityDate }`.
79
+ */
80
+ defaults?: ColumnDefaults;
67
81
  }>;
68
82
  export declare const COLUMNS: ReadonlyArray<ColumnEntry>;
69
83
  export declare function allColumnSchemas(configure: (env: Environment) => void): ReadonlyArray<AnySchema>;
@@ -76,7 +76,8 @@ export const COLUMNS = registry.ENTRIES.map((e) => ({
76
76
  deprecated: e.deprecated,
77
77
  ...e.supersededBy !== void 0 ? { supersededBy: e.supersededBy } : {},
78
78
  ...e.module.migrate !== void 0 ? { migrate: e.module.migrate } : {},
79
- ...e.module.migrateFrom !== void 0 ? { migrateFrom: e.module.migrateFrom } : {}
79
+ ...e.module.migrateFrom !== void 0 ? { migrateFrom: e.module.migrateFrom } : {},
80
+ ...e.module.defaults !== void 0 ? { defaults: e.module.defaults } : {}
80
81
  }));
81
82
  const migrationTargets = (() => {
82
83
  const map = /* @__PURE__ */ new Map();