@shwfed/config 2.12.0 → 2.12.2

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 (186) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +10 -0
  3. package/dist/runtime/components/form/config.vue +17 -6
  4. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.d.vue.ts +2 -2
  5. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.vue.d.ts +2 -2
  6. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.d.vue.ts +2 -0
  7. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue +22 -0
  8. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue.d.ts +2 -0
  9. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/runtime.vue +5 -0
  10. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.d.ts +1 -0
  11. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.js +12 -0
  12. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +2 -0
  13. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue +22 -0
  14. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +2 -0
  15. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/runtime.vue +5 -0
  16. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.d.ts +1 -0
  17. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.js +12 -0
  18. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +2 -0
  19. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue +22 -0
  20. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +2 -0
  21. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/runtime.vue +5 -0
  22. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.d.ts +1 -0
  23. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.js +12 -0
  24. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +2 -0
  25. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue +22 -0
  26. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +2 -0
  27. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/runtime.vue +5 -0
  28. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.d.ts +1 -0
  29. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.js +12 -0
  30. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.d.vue.ts +2 -2
  31. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue.d.ts +2 -2
  32. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.vue +8 -1
  33. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +24 -24
  34. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +24 -24
  35. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.d.vue.ts +2 -0
  36. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.vue +22 -0
  37. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.vue.d.ts +2 -0
  38. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/runtime.vue +5 -0
  39. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.d.ts +1 -0
  40. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.js +12 -0
  41. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +2 -0
  42. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue +22 -0
  43. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +2 -0
  44. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/runtime.vue +5 -0
  45. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.d.ts +1 -0
  46. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.js +12 -0
  47. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.d.vue.ts +2 -2
  48. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue.d.ts +2 -2
  49. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +24 -24
  50. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +24 -24
  51. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
  52. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
  53. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.d.vue.ts +32 -32
  54. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.vue.d.ts +32 -32
  55. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +9 -1
  56. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.d.vue.ts +32 -32
  57. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.vue.d.ts +32 -32
  58. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +9 -1
  59. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +24 -24
  60. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +24 -24
  61. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +19 -1
  62. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
  63. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
  64. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +19 -1
  65. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +24 -24
  66. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +24 -24
  67. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +20 -1
  68. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +22 -22
  69. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +22 -22
  70. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +20 -1
  71. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/config.d.vue.ts +32 -32
  72. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/config.vue.d.ts +32 -32
  73. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/runtime.vue +9 -1
  74. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/config.d.vue.ts +32 -32
  75. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/config.vue.d.ts +32 -32
  76. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/runtime.vue +9 -1
  77. package/dist/runtime/components/form/index.vue +6 -3
  78. package/dist/runtime/components/form/utils/ai-field-tools.d.ts +11 -0
  79. package/dist/runtime/components/form/utils/ai-field-tools.js +282 -0
  80. package/dist/runtime/components/form/utils/form-vars.js +2 -1
  81. package/dist/runtime/components/form/utils/resolve.d.ts +15 -0
  82. package/dist/runtime/components/form/utils/resolve.js +13 -0
  83. package/dist/runtime/components/head.d.vue.ts +13 -0
  84. package/dist/runtime/components/head.vue +69 -0
  85. package/dist/runtime/components/head.vue.d.ts +13 -0
  86. package/dist/runtime/components/sidebar/config.d.vue.ts +7 -0
  87. package/dist/runtime/components/sidebar/config.vue +302 -0
  88. package/dist/runtime/components/sidebar/config.vue.d.ts +7 -0
  89. package/dist/runtime/components/sidebar/favorites.d.ts +18 -0
  90. package/dist/runtime/components/sidebar/favorites.js +20 -0
  91. package/dist/runtime/components/sidebar/footer.d.vue.ts +11 -0
  92. package/dist/runtime/components/sidebar/footer.vue +49 -0
  93. package/dist/runtime/components/sidebar/footer.vue.d.ts +11 -0
  94. package/dist/runtime/components/sidebar/index.d.vue.ts +50 -0
  95. package/dist/runtime/components/sidebar/index.vue +100 -0
  96. package/dist/runtime/components/sidebar/index.vue.d.ts +50 -0
  97. package/dist/runtime/components/sidebar/node.d.vue.ts +9 -0
  98. package/dist/runtime/components/sidebar/node.vue +102 -0
  99. package/dist/runtime/components/sidebar/node.vue.d.ts +9 -0
  100. package/dist/runtime/components/sidebar/schema.d.ts +72 -0
  101. package/dist/runtime/components/sidebar/schema.js +84 -0
  102. package/dist/runtime/components/sidebar/tree.d.vue.ts +10 -0
  103. package/dist/runtime/components/sidebar/tree.vue +260 -0
  104. package/dist/runtime/components/sidebar/tree.vue.d.ts +10 -0
  105. package/dist/runtime/components/sidebar/types.d.ts +19 -0
  106. package/dist/runtime/components/sidebar/types.js +0 -0
  107. package/dist/runtime/components/sidebar/use-editor.d.ts +18 -0
  108. package/dist/runtime/components/sidebar/use-editor.js +43 -0
  109. package/dist/runtime/components/table/ai-generate.system.md +6 -0
  110. package/dist/runtime/components/table/ai-generate.vue +18 -17
  111. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +4 -4
  112. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +4 -4
  113. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -2
  114. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -2
  115. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +4 -4
  116. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +4 -4
  117. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -2
  118. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -2
  119. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +36 -36
  120. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +36 -36
  121. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +42 -42
  122. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +42 -42
  123. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.d.vue.ts +36 -36
  124. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue.d.ts +36 -36
  125. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +42 -42
  126. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +42 -42
  127. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +4 -4
  128. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +4 -4
  129. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  130. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  131. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +28 -28
  132. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +28 -28
  133. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +28 -28
  134. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +28 -28
  135. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +4 -4
  136. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +4 -4
  137. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  138. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  139. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.d.vue.ts +28 -28
  140. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue.d.ts +28 -28
  141. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.d.vue.ts +28 -28
  142. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue.d.ts +28 -28
  143. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +4 -4
  144. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +4 -4
  145. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  146. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  147. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/config.vue +33 -0
  148. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/runtime.vue +5 -0
  149. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.d.ts +1 -0
  150. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.js +6 -1
  151. package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/config.vue +33 -0
  152. package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/runtime.vue +5 -0
  153. package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/schema.d.ts +1 -0
  154. package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/schema.js +6 -1
  155. package/dist/runtime/components/table/utils/ai-tools.js +50 -1
  156. package/dist/runtime/components/table/utils/shared.d.ts +1 -0
  157. package/dist/runtime/components/table/utils/shared.js +10 -0
  158. package/dist/runtime/components/ui/alert-dialog/AlertDialogCancel.vue +1 -1
  159. package/dist/runtime/components/ui/chat/ChatPrompt.d.vue.ts +11 -1
  160. package/dist/runtime/components/ui/chat/ChatPrompt.vue +10 -0
  161. package/dist/runtime/components/ui/chat/ChatPrompt.vue.d.ts +11 -1
  162. package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.d.vue.ts +1 -0
  163. package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.vue +8 -0
  164. package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.vue.d.ts +1 -0
  165. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.d.vue.ts +3 -2
  166. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +51 -9
  167. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue.d.ts +3 -2
  168. package/dist/runtime/components/ui/expression-editor/option-chip-extension.d.ts +4 -0
  169. package/dist/runtime/components/ui/expression-editor/option-chip-extension.js +119 -0
  170. package/dist/runtime/components/ui/expression-editor/option-refs.d.ts +6 -0
  171. package/dist/runtime/components/ui/expression-editor/option-refs.js +24 -0
  172. package/dist/runtime/components/ui/expression-editor/picker-entries.d.ts +2 -1
  173. package/dist/runtime/components/ui/expression-editor/picker-entries.js +12 -2
  174. package/dist/runtime/share/disabled-date.d.ts +34 -0
  175. package/dist/runtime/share/disabled-date.js +13 -0
  176. package/dist/runtime/utils/ai/index.js +24 -1
  177. package/dist/runtime/utils/cel-context.d.ts +1 -0
  178. package/dist/runtime/utils/cel-context.js +1 -0
  179. package/dist/runtime/utils/disabled-date.d.ts +26 -0
  180. package/dist/runtime/utils/disabled-date.js +21 -0
  181. package/dist/runtime/utils/selections-registry.d.ts +40 -6
  182. package/dist/runtime/utils/selections-registry.js +19 -4
  183. package/dist/runtime/vendor/cel-js/CLAUDE.md +2 -0
  184. package/dist/runtime/vendor/cel-js/PROMPT.md +2 -0
  185. package/dist/runtime/vendor/cel-js/lib/functions.js +33 -0
  186. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shwfed",
3
3
  "configKey": "shwfed",
4
- "version": "2.12.0",
4
+ "version": "2.12.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -134,6 +134,14 @@ const module$1 = defineNuxtModule({
134
134
  name: "ShwfedConfig",
135
135
  filePath: resolver.resolve("./runtime/components/config/index.vue")
136
136
  });
137
+ addComponent({
138
+ name: "ShwfedHead",
139
+ filePath: resolver.resolve("./runtime/components/head.vue")
140
+ });
141
+ addComponent({
142
+ name: "ShwfedSidebar",
143
+ filePath: resolver.resolve("./runtime/components/sidebar/index.vue")
144
+ });
137
145
  for (const folder of EXPOSED_UI_FOLDERS) {
138
146
  const folderPath = resolver.resolve(`./runtime/components/ui/${folder}`);
139
147
  for (const file of readdirSync(folderPath)) {
@@ -149,6 +157,8 @@ const module$1 = defineNuxtModule({
149
157
  // Type-only auto-import: hosts binding `<ShwfedConfig v-model:config>`
150
158
  // get `PageConfigValue` globally without reaching into `runtime/`.
151
159
  { name: "PageConfigValue", from: resolver.resolve("./runtime/components/config/schema"), type: true },
160
+ // Type-only auto-import for hosts binding `<ShwfedSidebar v-model:config>`.
161
+ { name: "SidebarConfigValue", from: resolver.resolve("./runtime/components/sidebar/schema"), type: true },
152
162
  // `provideCELContext` lets the host app inject CEL variables (e.g. an
153
163
  // auth token) into the config-driven components.
154
164
  { name: "provideCELContext", from: resolver.resolve("./runtime/utils/cel-context") },
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { computed, ref } from "vue";
3
- import { provideCELContext, provideScopeAncestor, SELECTIONS_VAR } from "../../utils/cel-context";
3
+ import { OPTIONS_VAR, provideCELContext, provideScopeAncestor, SELECTIONS_VAR } from "../../utils/cel-context";
4
4
  import { getLocalizedText } from "../../share/locale";
5
5
  import { findField } from "./utils/resolve";
6
6
  import { ExpressionEditor } from "../ui/expression-editor";
@@ -29,6 +29,7 @@ const configure = props.configure ?? (() => {
29
29
  const formConfigSchema = FormConfig(configure);
30
30
  const generalFieldTitle = (f) => getStructFieldTitle(formConfigSchema, f) ?? f;
31
31
  const generalFieldDescription = (f) => getStructFieldDescription(formConfigSchema, f);
32
+ const INITIAL_EXCLUDED_VARS = [SELECTIONS_VAR, OPTIONS_VAR, "undoable", "redoable"];
32
33
  const initialFieldTitle = (f) => getNestedStructFieldTitle(formConfigSchema, "initial", f) ?? f;
33
34
  const initialFieldDescription = (f) => getNestedStructFieldDescription(formConfigSchema, "initial", f);
34
35
  provideCELContext(buildFormCelScope(configure));
@@ -66,6 +67,13 @@ const formScopeAncestor = computed(() => {
66
67
  type: "dyn",
67
68
  description: "\u8BE5\u9009\u62E9\u5B57\u6BB5\u5F53\u524D\u9009\u4E2D\u9879\u7684\u5B8C\u6574\u5BF9\u8C61\uFF08\u542B key \u4EE5\u5916\u7684\u5B57\u6BB5\uFF09"
68
69
  }));
70
+ const optionMembers = config.value.fields.filter((f) => findField(f.type, f.compatibilityDate)?.metadata?.selection).map((f) => ({
71
+ key: `${OPTIONS_VAR}[${JSON.stringify(f.id)}]`,
72
+ shortcut: OPTIONS_VAR,
73
+ label: selectionFieldLabel(f),
74
+ type: "dyn",
75
+ description: "\u8BE5\u9009\u62E9\u5B57\u6BB5\u5F53\u524D\u5DF2\u52A0\u8F7D\u7684\u5168\u90E8\u9009\u9879\uFF08\u5143\u7D20\u4E3A\u9009\u9879\u5B8C\u6574\u5BF9\u8C61\uFF09"
76
+ }));
69
77
  return {
70
78
  id,
71
79
  name: displayName && displayName.length > 0 ? displayName : void 0,
@@ -73,12 +81,13 @@ const formScopeAncestor = computed(() => {
73
81
  typeIcon: formMetadata.icon,
74
82
  members: [
75
83
  { key: "form", label: "\u8868\u5355\u503C", type: "dyn", description: "\u8BE5\u8868\u5355\u7684\u5F53\u524D\u6574\u4F53\u72B6\u6001" },
76
- ...selectionMembers
84
+ ...selectionMembers,
85
+ ...optionMembers
77
86
  ],
78
- // The form unconditionally rebinds both `form` and `selections` for its
79
- // subtree (index.vue), so declare them explicitly rather than deriving from
80
- // `members` — a form with no selection field still shadows `selections`.
81
- shadows: ["form", SELECTIONS_VAR]
87
+ // The form unconditionally rebinds `form`, `selections` and `options` for
88
+ // its subtree (index.vue), so declare them explicitly rather than deriving
89
+ // from `members` — a form with no selection field still shadows all three.
90
+ shadows: ["form", SELECTIONS_VAR, OPTIONS_VAR]
82
91
  };
83
92
  });
84
93
  provideScopeAncestor(formScopeAncestor);
@@ -182,6 +191,7 @@ function updateStyle(value) {
182
191
  result-type="HttpRequest"
183
192
  multiline
184
193
  class="min-h-20"
194
+ :exclude-vars="INITIAL_EXCLUDED_VARS"
185
195
  @update:model-value="(v) => setInitialField('request', v)"
186
196
  />
187
197
  </Field>
@@ -207,6 +217,7 @@ function updateStyle(value) {
207
217
  :extra-vars="{ json: { type: 'optional<dyn>', label: 'HTTP \u54CD\u5E94\u4F53', description: '\u300C\u8BF7\u6C42\u300D\u7684\u54CD\u5E94\u4F53\uFF08\u5DF2\u89E3\u6790 JSON\uFF09\uFF1B\u672A\u914D\u7F6E\u8BF7\u6C42\u65F6\u4E3A none' } }"
208
218
  multiline
209
219
  class="min-h-20"
220
+ :exclude-vars="INITIAL_EXCLUDED_VARS"
210
221
  @update:model-value="(v) => setInitialField('data', v)"
211
222
  />
212
223
  </Field>
@@ -24,6 +24,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
24
24
  }[]] | undefined;
25
25
  readonly required?: string | undefined;
26
26
  readonly displayName?: string | undefined;
27
+ readonly options: string;
27
28
  readonly compatibilityDate: "2026-04-24";
28
29
  readonly orientation?: "vertical" | "floating" | undefined;
29
30
  readonly placeholder?: readonly [{
@@ -39,7 +40,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
39
40
  readonly mode: "formula" | "prefill";
40
41
  readonly expression: string;
41
42
  } | undefined;
42
- readonly options: string;
43
43
  readonly validations?: readonly {
44
44
  readonly message: readonly [{
45
45
  readonly locale: "zh";
@@ -82,6 +82,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
82
82
  }[]] | undefined;
83
83
  readonly required?: string | undefined;
84
84
  readonly displayName?: string | undefined;
85
+ readonly options: string;
85
86
  readonly compatibilityDate: "2026-04-24";
86
87
  readonly orientation?: "vertical" | "floating" | undefined;
87
88
  readonly placeholder?: readonly [{
@@ -97,7 +98,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
97
98
  readonly mode: "formula" | "prefill";
98
99
  readonly expression: string;
99
100
  } | undefined;
100
- readonly options: string;
101
101
  readonly validations?: readonly {
102
102
  readonly message: readonly [{
103
103
  readonly locale: "zh";
@@ -24,6 +24,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
24
24
  }[]] | undefined;
25
25
  readonly required?: string | undefined;
26
26
  readonly displayName?: string | undefined;
27
+ readonly options: string;
27
28
  readonly compatibilityDate: "2026-04-24";
28
29
  readonly orientation?: "vertical" | "floating" | undefined;
29
30
  readonly placeholder?: readonly [{
@@ -39,7 +40,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
39
40
  readonly mode: "formula" | "prefill";
40
41
  readonly expression: string;
41
42
  } | undefined;
42
- readonly options: string;
43
43
  readonly validations?: readonly {
44
44
  readonly message: readonly [{
45
45
  readonly locale: "zh";
@@ -82,6 +82,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
82
82
  }[]] | undefined;
83
83
  readonly required?: string | undefined;
84
84
  readonly displayName?: string | undefined;
85
+ readonly options: string;
85
86
  readonly compatibilityDate: "2026-04-24";
86
87
  readonly orientation?: "vertical" | "floating" | undefined;
87
88
  readonly placeholder?: readonly [{
@@ -97,7 +98,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
97
98
  readonly mode: "formula" | "prefill";
98
99
  readonly expression: string;
99
100
  } | undefined;
100
- readonly options: string;
101
101
  readonly validations?: readonly {
102
102
  readonly message: readonly [{
103
103
  readonly locale: "zh";
@@ -41,6 +41,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
41
41
  } | undefined;
42
42
  readonly format?: string | undefined;
43
43
  readonly valueFormat?: string | undefined;
44
+ readonly disabledDate?: string | undefined;
44
45
  readonly validations?: readonly {
45
46
  readonly message: readonly [{
46
47
  readonly locale: "zh";
@@ -103,6 +104,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
104
  } | undefined;
104
105
  readonly format?: string | undefined;
105
106
  readonly valueFormat?: string | undefined;
107
+ readonly disabledDate?: string | undefined;
106
108
  readonly validations?: readonly {
107
109
  readonly message: readonly [{
108
110
  readonly locale: "zh";
@@ -2,6 +2,7 @@
2
2
  import { Icon } from "@iconify/vue";
3
3
  import { computed } from "vue";
4
4
  import { format as formatDate } from "date-fns";
5
+ import { DISABLE_DATE_EDITOR_RESULT, INPUT_DATE_VARS } from "../../../../../share/disabled-date";
5
6
  import { Button } from "../../../../ui/button";
6
7
  import { ExpressionEditor } from "../../../../ui/expression-editor";
7
8
  import DerivedValueEditor from "../../../DerivedValueEditor.vue";
@@ -492,6 +493,27 @@ const valueFormatExample = computed(() => previewFormat(value.value.valueFormat
492
493
  </Field>
493
494
  </div>
494
495
 
496
+ <Field orientation="vertical">
497
+ <FieldLabel class="text-xs text-zinc-500">
498
+ <template #tooltip>
499
+ <Markdown
500
+ :source="fieldDescription('disabledDate')"
501
+ block
502
+ class="prose prose-sm prose-zinc"
503
+ />
504
+ </template>
505
+ {{ fieldTitle("disabledDate") }}
506
+ </FieldLabel>
507
+ <ExpressionEditor
508
+ :model-value="value.disabledDate ?? ''"
509
+ placeholder="例:input.format('i') == '6' || input.format('i') == '7'"
510
+ :result-type="[...DISABLE_DATE_EDITOR_RESULT]"
511
+ :extra-vars="INPUT_DATE_VARS"
512
+ class="min-h-10"
513
+ @update:model-value="(v) => value = { ...value, disabledDate: v.length > 0 ? v : void 0 }"
514
+ />
515
+ </Field>
516
+
495
517
  <Field orientation="vertical">
496
518
  <FieldLabel class="text-xs text-zinc-500">
497
519
  <template #tooltip>
@@ -41,6 +41,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
41
41
  } | undefined;
42
42
  readonly format?: string | undefined;
43
43
  readonly valueFormat?: string | undefined;
44
+ readonly disabledDate?: string | undefined;
44
45
  readonly validations?: readonly {
45
46
  readonly message: readonly [{
46
47
  readonly locale: "zh";
@@ -103,6 +104,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
104
  } | undefined;
104
105
  readonly format?: string | undefined;
105
106
  readonly valueFormat?: string | undefined;
107
+ readonly disabledDate?: string | undefined;
106
108
  readonly validations?: readonly {
107
109
  readonly message: readonly [{
108
110
  readonly locale: "zh";
@@ -5,6 +5,7 @@ import { computed, ref } from "vue";
5
5
  import { useI18n } from "vue-i18n";
6
6
  import { cel as _rawCel } from "../../../../../utils/cel";
7
7
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
8
+ import { makeDisabledDatePredicate } from "../../../../../utils/disabled-date";
8
9
  import { getLocalizedText } from "../../../../../share/locale";
9
10
  import { DatePicker, DATE_PICKER_DEFAULT_FORMATS } from "../../../../ui/date-picker";
10
11
  import { Field, FieldLabel, FieldMessages } from "../../../../ui/field";
@@ -64,6 +65,9 @@ const shortcuts = computed(() => {
64
65
  }
65
66
  }));
66
67
  });
68
+ const disabledDate = computed(
69
+ () => makeDisabledDatePredicate(props.config.disabledDate, (input) => Effect.runSync($cel(props.config.disabledDate, { form: formScope.state.value ?? {}, input })))
70
+ );
67
71
  const uncontrolled = ref(void 0);
68
72
  const model = computed({
69
73
  get: () => {
@@ -130,6 +134,7 @@ const { isRequired, errors, warnings, visible } = useFieldValidation({
130
134
  :value-format="config.valueFormat"
131
135
  :placeholder="placeholderText"
132
136
  :disabled="isDisabled"
137
+ :disabled-date="disabledDate"
133
138
  :shortcuts="shortcuts"
134
139
  />
135
140
  <FieldMessages
@@ -77,6 +77,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
77
77
  binding: Schema.optional<Schema.refine<string, typeof Schema.String>>;
78
78
  disabled: Schema.optional<Schema.Schema<string, string, never>>;
79
79
  readonly: Schema.optional<Schema.Schema<string, string, never>>;
80
+ disabledDate: Schema.optional<Schema.Schema<string, string, never>>;
80
81
  derived: Schema.optional<Schema.Struct<{
81
82
  mode: Schema.Literal<["formula", "prefill"]>;
82
83
  expression: Schema.Schema<string, string, never>;
@@ -1,4 +1,5 @@
1
1
  import { Schema } from "effect";
2
+ import { DISABLE_DATE_RESULT, registerInputDateIfAbsent } from "../../../../../share/disabled-date.js";
2
3
  import { Expression } from "../../../../../share/expression.js";
3
4
  import { Locale } from "../../../../../share/locale.js";
4
5
  import { commonFieldFields, derivedField, FieldOrientationSchema } from "../../../utils/common.js";
@@ -28,6 +29,13 @@ export function presetSchema(configure) {
28
29
  }
29
30
  export function schema(configure) {
30
31
  const CelBool = Expression({ configure, resultType: "bool" });
32
+ const DisabledDate = Expression({
33
+ configure: (env) => {
34
+ configure(env);
35
+ registerInputDateIfAbsent(env);
36
+ },
37
+ resultType: DISABLE_DATE_RESULT
38
+ });
31
39
  const Preset = presetSchema(configure);
32
40
  return Schema.Struct({
33
41
  type: Schema.Literal(type),
@@ -58,6 +66,10 @@ export function schema(configure) {
58
66
  title: "\u53EA\u8BFB\u6761\u4EF6",
59
67
  description: "\u8FD4\u56DE `true` \u65F6\u4EC5\u4EE5\u7EAF\u6587\u672C\u5C55\u793A\u5F53\u524D\u503C"
60
68
  })),
69
+ disabledDate: Schema.optional(DisabledDate.annotations({
70
+ title: "\u7981\u7528\u65E5\u671F",
71
+ description: "\u9010\u4E2A\u65E5\u671F\u5224\u5B9A\u662F\u5426\u53EF\u9009\uFF1B\u53D8\u91CF `input` \u4E3A\u5019\u9009\u65E5\u671F\u3002\u8FD4\u56DE `true` \u65F6\u7981\u7528\u8BE5\u65E5\u671F\uFF0C\u8FD4\u56DE `false`\u3001\u7A7A\u503C\u6216\u4E0D\u586B\u65F6\u53EF\u9009"
72
+ })),
61
73
  derived: derivedField(configure, "string"),
62
74
  format: Schema.optional(Schema.String.pipe(Schema.minLength(1)).annotations({
63
75
  title: "\u5C55\u793A\u683C\u5F0F",
@@ -35,6 +35,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
35
35
  readonly numberOfMonths?: number | undefined;
36
36
  readonly format?: string | undefined;
37
37
  readonly valueFormat?: string | undefined;
38
+ readonly disabledDate?: string | undefined;
38
39
  readonly rangeSeparatorIcon?: string | undefined;
39
40
  readonly startPlaceholder?: readonly [{
40
41
  readonly locale: "zh";
@@ -107,6 +108,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
107
108
  readonly numberOfMonths?: number | undefined;
108
109
  readonly format?: string | undefined;
109
110
  readonly valueFormat?: string | undefined;
111
+ readonly disabledDate?: string | undefined;
110
112
  readonly rangeSeparatorIcon?: string | undefined;
111
113
  readonly startPlaceholder?: readonly [{
112
114
  readonly locale: "zh";
@@ -2,6 +2,7 @@
2
2
  import { Icon } from "@iconify/vue";
3
3
  import { format as formatDate } from "date-fns";
4
4
  import { computed } from "vue";
5
+ import { DISABLE_DATE_EDITOR_RESULT, INPUT_DATE_VARS } from "../../../../../share/disabled-date";
5
6
  import { Button } from "../../../../ui/button";
6
7
  import { ExpressionEditor } from "../../../../ui/expression-editor";
7
8
  import DerivedValueEditor from "../../../DerivedValueEditor.vue";
@@ -673,6 +674,27 @@ const valueFormatExample = computed(() => previewFormat(value.value.valueFormat
673
674
  </Field>
674
675
  </div>
675
676
 
677
+ <Field orientation="vertical">
678
+ <FieldLabel class="text-xs text-zinc-500">
679
+ <template #tooltip>
680
+ <Markdown
681
+ :source="fieldDescription('disabledDate')"
682
+ block
683
+ class="prose prose-sm prose-zinc"
684
+ />
685
+ </template>
686
+ {{ fieldTitle("disabledDate") }}
687
+ </FieldLabel>
688
+ <ExpressionEditor
689
+ :model-value="value.disabledDate ?? ''"
690
+ placeholder="例:input.format('i') == '6' || input.format('i') == '7'"
691
+ :result-type="[...DISABLE_DATE_EDITOR_RESULT]"
692
+ :extra-vars="INPUT_DATE_VARS"
693
+ class="min-h-10"
694
+ @update:model-value="(v) => value = { ...value, disabledDate: v.length > 0 ? v : void 0 }"
695
+ />
696
+ </Field>
697
+
676
698
  <Field orientation="vertical">
677
699
  <FieldLabel class="text-xs text-zinc-500">
678
700
  <template #tooltip>
@@ -35,6 +35,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
35
35
  readonly numberOfMonths?: number | undefined;
36
36
  readonly format?: string | undefined;
37
37
  readonly valueFormat?: string | undefined;
38
+ readonly disabledDate?: string | undefined;
38
39
  readonly rangeSeparatorIcon?: string | undefined;
39
40
  readonly startPlaceholder?: readonly [{
40
41
  readonly locale: "zh";
@@ -107,6 +108,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
107
108
  readonly numberOfMonths?: number | undefined;
108
109
  readonly format?: string | undefined;
109
110
  readonly valueFormat?: string | undefined;
111
+ readonly disabledDate?: string | undefined;
110
112
  readonly rangeSeparatorIcon?: string | undefined;
111
113
  readonly startPlaceholder?: readonly [{
112
114
  readonly locale: "zh";
@@ -5,6 +5,7 @@ import { computed, ref } from "vue";
5
5
  import { useI18n } from "vue-i18n";
6
6
  import { cel as _rawCel } from "../../../../../utils/cel";
7
7
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
8
+ import { makeDisabledDatePredicate } from "../../../../../utils/disabled-date";
8
9
  import { getLocalizedText } from "../../../../../share/locale";
9
10
  import { DATE_RANGE_PICKER_DEFAULT_FORMATS, DateRangePicker } from "../../../../ui/date-range-picker";
10
11
  import { Field, FieldLabel, FieldMessages } from "../../../../ui/field";
@@ -71,6 +72,9 @@ const shortcuts = computed(() => {
71
72
  }
72
73
  }));
73
74
  });
75
+ const disabledDate = computed(
76
+ () => makeDisabledDatePredicate(props.config.disabledDate, (input) => Effect.runSync($cel(props.config.disabledDate, { form: formScope.state.value ?? {}, input })))
77
+ );
74
78
  function asRange(raw) {
75
79
  if (!Array.isArray(raw) || raw.length !== 2) return void 0;
76
80
  const [a, b] = raw;
@@ -163,6 +167,7 @@ const readonlyText = computed(() => {
163
167
  :range-separator-icon="config.rangeSeparatorIcon"
164
168
  :number-of-months="config.numberOfMonths"
165
169
  :disabled="isDisabled"
170
+ :disabled-date="disabledDate"
166
171
  :shortcuts="shortcuts"
167
172
  />
168
173
  <FieldMessages
@@ -91,6 +91,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
91
91
  binding: Schema.optional<Schema.Union<[Schema.filter<typeof Schema.String>, Schema.filter<Schema.Tuple2<Schema.filter<typeof Schema.String>, Schema.filter<typeof Schema.String>>>]>>;
92
92
  disabled: Schema.optional<Schema.Schema<string, string, never>>;
93
93
  readonly: Schema.optional<Schema.Schema<string, string, never>>;
94
+ disabledDate: Schema.optional<Schema.Schema<string, string, never>>;
94
95
  derived: Schema.optional<Schema.Struct<{
95
96
  mode: Schema.Literal<["formula", "prefill"]>;
96
97
  expression: Schema.Schema<string, string, never>;
@@ -1,4 +1,5 @@
1
1
  import { Schema } from "effect";
2
+ import { DISABLE_DATE_RESULT, registerInputDateIfAbsent } from "../../../../../share/disabled-date.js";
2
3
  import { Expression } from "../../../../../share/expression.js";
3
4
  import { Locale } from "../../../../../share/locale.js";
4
5
  import { commonFieldFields, derivedField, FieldOrientationSchema } from "../../../utils/common.js";
@@ -42,6 +43,13 @@ export function presetSchema(configure) {
42
43
  }
43
44
  export function schema(configure) {
44
45
  const CelBool = Expression({ configure, resultType: "bool" });
46
+ const DisabledDate = Expression({
47
+ configure: (env) => {
48
+ configure(env);
49
+ registerInputDateIfAbsent(env);
50
+ },
51
+ resultType: DISABLE_DATE_RESULT
52
+ });
45
53
  const Preset = presetSchema(configure);
46
54
  return Schema.Struct({
47
55
  type: Schema.Literal(type),
@@ -73,6 +81,10 @@ export function schema(configure) {
73
81
  title: "\u53EA\u8BFB\u6761\u4EF6",
74
82
  description: "\u8FD4\u56DE `true` \u65F6\u4EC5\u4EE5\u7EAF\u6587\u672C\u5C55\u793A\u5F53\u524D\u503C"
75
83
  })),
84
+ disabledDate: Schema.optional(DisabledDate.annotations({
85
+ title: "\u7981\u7528\u65E5\u671F",
86
+ description: "\u9010\u4E2A\u65E5\u671F\u5224\u5B9A\u662F\u5426\u53EF\u9009\uFF1B\u53D8\u91CF `input` \u4E3A\u5019\u9009\u65E5\u671F\u3002\u8FD4\u56DE `true` \u65F6\u7981\u7528\u8BE5\u65E5\u671F\uFF0C\u8FD4\u56DE `false`\u3001\u7A7A\u503C\u6216\u4E0D\u586B\u65F6\u53EF\u9009"
87
+ })),
76
88
  derived: derivedField(configure, "dyn"),
77
89
  format: Schema.optional(Schema.String.pipe(Schema.minLength(1)).annotations({
78
90
  title: "\u5C55\u793A\u683C\u5F0F",
@@ -42,6 +42,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
42
42
  readonly hourCycle?: 12 | 24 | undefined;
43
43
  readonly format?: string | undefined;
44
44
  readonly valueFormat?: string | undefined;
45
+ readonly disabledDate?: string | undefined;
45
46
  readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
46
47
  readonly validations?: readonly {
47
48
  readonly message: readonly [{
@@ -106,6 +107,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
106
107
  readonly hourCycle?: 12 | 24 | undefined;
107
108
  readonly format?: string | undefined;
108
109
  readonly valueFormat?: string | undefined;
110
+ readonly disabledDate?: string | undefined;
109
111
  readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
110
112
  readonly validations?: readonly {
111
113
  readonly message: readonly [{
@@ -2,6 +2,7 @@
2
2
  import { Icon } from "@iconify/vue";
3
3
  import { computed } from "vue";
4
4
  import { format as formatDate } from "date-fns";
5
+ import { DISABLE_DATE_EDITOR_RESULT, INPUT_DATE_VARS } from "../../../../../share/disabled-date";
5
6
  import { Button } from "../../../../ui/button";
6
7
  import { ExpressionEditor } from "../../../../ui/expression-editor";
7
8
  import DerivedValueEditor from "../../../DerivedValueEditor.vue";
@@ -574,6 +575,27 @@ const valueFormatExample = computed(() => previewFormat(value.value.valueFormat
574
575
  </Field>
575
576
  </div>
576
577
 
578
+ <Field orientation="vertical">
579
+ <FieldLabel class="text-xs text-zinc-500">
580
+ <template #tooltip>
581
+ <Markdown
582
+ :source="fieldDescription('disabledDate')"
583
+ block
584
+ class="prose prose-sm prose-zinc"
585
+ />
586
+ </template>
587
+ {{ fieldTitle("disabledDate") }}
588
+ </FieldLabel>
589
+ <ExpressionEditor
590
+ :model-value="value.disabledDate ?? ''"
591
+ placeholder="例:input.format('i') == '6' || input.format('i') == '7'"
592
+ :result-type="[...DISABLE_DATE_EDITOR_RESULT]"
593
+ :extra-vars="INPUT_DATE_VARS"
594
+ class="min-h-10"
595
+ @update:model-value="(v) => value = { ...value, disabledDate: v.length > 0 ? v : void 0 }"
596
+ />
597
+ </Field>
598
+
577
599
  <Field orientation="vertical">
578
600
  <FieldLabel class="text-xs text-zinc-500">
579
601
  <template #tooltip>
@@ -42,6 +42,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
42
42
  readonly hourCycle?: 12 | 24 | undefined;
43
43
  readonly format?: string | undefined;
44
44
  readonly valueFormat?: string | undefined;
45
+ readonly disabledDate?: string | undefined;
45
46
  readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
46
47
  readonly validations?: readonly {
47
48
  readonly message: readonly [{
@@ -106,6 +107,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
106
107
  readonly hourCycle?: 12 | 24 | undefined;
107
108
  readonly format?: string | undefined;
108
109
  readonly valueFormat?: string | undefined;
110
+ readonly disabledDate?: string | undefined;
109
111
  readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
110
112
  readonly validations?: readonly {
111
113
  readonly message: readonly [{
@@ -5,6 +5,7 @@ import { computed, ref } from "vue";
5
5
  import { useI18n } from "vue-i18n";
6
6
  import { cel as _rawCel } from "../../../../../utils/cel";
7
7
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
8
+ import { makeDisabledDatePredicate } from "../../../../../utils/disabled-date";
8
9
  import { getLocalizedText } from "../../../../../share/locale";
9
10
  import { DATE_PICKER_DEFAULT_FORMATS, DatePicker } from "../../../../ui/date-picker";
10
11
  import { Field, FieldLabel, FieldMessages } from "../../../../ui/field";
@@ -64,6 +65,9 @@ const shortcuts = computed(() => {
64
65
  }
65
66
  }));
66
67
  });
68
+ const disabledDate = computed(
69
+ () => makeDisabledDatePredicate(props.config.disabledDate, (input) => Effect.runSync($cel(props.config.disabledDate, { form: formScope.state.value ?? {}, input })))
70
+ );
67
71
  const uncontrolled = ref(void 0);
68
72
  const model = computed({
69
73
  get: () => {
@@ -132,6 +136,7 @@ const { isRequired, errors, warnings, visible } = useFieldValidation({
132
136
  :time-granularity="config.timeGranularity"
133
137
  :hour-cycle="config.hourCycle"
134
138
  :disabled="isDisabled"
139
+ :disabled-date="disabledDate"
135
140
  :shortcuts="shortcuts"
136
141
  />
137
142
  <FieldMessages
@@ -87,6 +87,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
87
87
  binding: Schema.optional<Schema.refine<string, typeof Schema.String>>;
88
88
  disabled: Schema.optional<Schema.Schema<string, string, never>>;
89
89
  readonly: Schema.optional<Schema.Schema<string, string, never>>;
90
+ disabledDate: Schema.optional<Schema.Schema<string, string, never>>;
90
91
  derived: Schema.optional<Schema.Struct<{
91
92
  mode: Schema.Literal<["formula", "prefill"]>;
92
93
  expression: Schema.Schema<string, string, never>;
@@ -1,4 +1,5 @@
1
1
  import { Schema } from "effect";
2
+ import { DISABLE_DATE_RESULT, registerInputDateIfAbsent } from "../../../../../share/disabled-date.js";
2
3
  import { Expression } from "../../../../../share/expression.js";
3
4
  import { Locale } from "../../../../../share/locale.js";
4
5
  import { commonFieldFields, derivedField, FieldOrientationSchema } from "../../../utils/common.js";
@@ -38,6 +39,13 @@ export function presetSchema(configure) {
38
39
  }
39
40
  export function schema(configure) {
40
41
  const CelBool = Expression({ configure, resultType: "bool" });
42
+ const DisabledDate = Expression({
43
+ configure: (env) => {
44
+ configure(env);
45
+ registerInputDateIfAbsent(env);
46
+ },
47
+ resultType: DISABLE_DATE_RESULT
48
+ });
41
49
  const Preset = presetSchema(configure);
42
50
  return Schema.Struct({
43
51
  type: Schema.Literal(type),
@@ -68,6 +76,10 @@ export function schema(configure) {
68
76
  title: "\u53EA\u8BFB\u6761\u4EF6",
69
77
  description: "\u8FD4\u56DE `true` \u65F6\u4EC5\u4EE5\u7EAF\u6587\u672C\u5C55\u793A\u5F53\u524D\u503C"
70
78
  })),
79
+ disabledDate: Schema.optional(DisabledDate.annotations({
80
+ title: "\u7981\u7528\u65E5\u671F",
81
+ description: "\u9010\u4E2A\u65E5\u671F\u5224\u5B9A\u662F\u5426\u53EF\u9009\uFF1B\u53D8\u91CF `input` \u4E3A\u5019\u9009\u65E5\u671F\u3002\u8FD4\u56DE `true` \u65F6\u7981\u7528\u8BE5\u65E5\u671F\uFF0C\u8FD4\u56DE `false`\u3001\u7A7A\u503C\u6216\u4E0D\u586B\u65F6\u53EF\u9009"
82
+ })),
71
83
  derived: derivedField(configure, "string"),
72
84
  format: Schema.optional(Schema.String.pipe(Schema.minLength(1)).annotations({
73
85
  title: "\u5C55\u793A\u683C\u5F0F",
@@ -36,6 +36,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
36
36
  readonly hourCycle?: 12 | 24 | undefined;
37
37
  readonly format?: string | undefined;
38
38
  readonly valueFormat?: string | undefined;
39
+ readonly disabledDate?: string | undefined;
39
40
  readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
40
41
  readonly rangeSeparatorIcon?: string | undefined;
41
42
  readonly startPlaceholder?: readonly [{
@@ -110,6 +111,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
110
111
  readonly hourCycle?: 12 | 24 | undefined;
111
112
  readonly format?: string | undefined;
112
113
  readonly valueFormat?: string | undefined;
114
+ readonly disabledDate?: string | undefined;
113
115
  readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
114
116
  readonly rangeSeparatorIcon?: string | undefined;
115
117
  readonly startPlaceholder?: readonly [{
@@ -2,6 +2,7 @@
2
2
  import { Icon } from "@iconify/vue";
3
3
  import { computed } from "vue";
4
4
  import { format as formatDate } from "date-fns";
5
+ import { DISABLE_DATE_EDITOR_RESULT, INPUT_DATE_VARS } from "../../../../../share/disabled-date";
5
6
  import { Button } from "../../../../ui/button";
6
7
  import { ExpressionEditor } from "../../../../ui/expression-editor";
7
8
  import DerivedValueEditor from "../../../DerivedValueEditor.vue";
@@ -757,6 +758,27 @@ const valueFormatExample = computed(() => previewFormat(value.value.valueFormat
757
758
  </Field>
758
759
  </div>
759
760
 
761
+ <Field orientation="vertical">
762
+ <FieldLabel class="text-xs text-zinc-500">
763
+ <template #tooltip>
764
+ <Markdown
765
+ :source="fieldDescription('disabledDate')"
766
+ block
767
+ class="prose prose-sm prose-zinc"
768
+ />
769
+ </template>
770
+ {{ fieldTitle("disabledDate") }}
771
+ </FieldLabel>
772
+ <ExpressionEditor
773
+ :model-value="value.disabledDate ?? ''"
774
+ placeholder="例:input.format('i') == '6' || input.format('i') == '7'"
775
+ :result-type="[...DISABLE_DATE_EDITOR_RESULT]"
776
+ :extra-vars="INPUT_DATE_VARS"
777
+ class="min-h-10"
778
+ @update:model-value="(v) => value = { ...value, disabledDate: v.length > 0 ? v : void 0 }"
779
+ />
780
+ </Field>
781
+
760
782
  <Field orientation="vertical">
761
783
  <FieldLabel class="text-xs text-zinc-500">
762
784
  <template #tooltip>
@@ -36,6 +36,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
36
36
  readonly hourCycle?: 12 | 24 | undefined;
37
37
  readonly format?: string | undefined;
38
38
  readonly valueFormat?: string | undefined;
39
+ readonly disabledDate?: string | undefined;
39
40
  readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
40
41
  readonly rangeSeparatorIcon?: string | undefined;
41
42
  readonly startPlaceholder?: readonly [{
@@ -110,6 +111,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
110
111
  readonly hourCycle?: 12 | 24 | undefined;
111
112
  readonly format?: string | undefined;
112
113
  readonly valueFormat?: string | undefined;
114
+ readonly disabledDate?: string | undefined;
113
115
  readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
114
116
  readonly rangeSeparatorIcon?: string | undefined;
115
117
  readonly startPlaceholder?: readonly [{