@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
@@ -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;
@@ -165,6 +169,7 @@ const readonlyText = computed(() => {
165
169
  :time-granularity="config.timeGranularity"
166
170
  :hour-cycle="config.hourCycle"
167
171
  :disabled="isDisabled"
172
+ :disabled-date="disabledDate"
168
173
  :shortcuts="shortcuts"
169
174
  />
170
175
  <FieldMessages
@@ -101,6 +101,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
101
101
  binding: Schema.optional<Schema.Union<[Schema.filter<typeof Schema.String>, Schema.filter<Schema.Tuple2<Schema.filter<typeof Schema.String>, Schema.filter<typeof Schema.String>>>]>>;
102
102
  disabled: Schema.optional<Schema.Schema<string, string, never>>;
103
103
  readonly: Schema.optional<Schema.Schema<string, string, never>>;
104
+ disabledDate: Schema.optional<Schema.Schema<string, string, never>>;
104
105
  derived: Schema.optional<Schema.Struct<{
105
106
  mode: Schema.Literal<["formula", "prefill"]>;
106
107
  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";
@@ -52,6 +53,13 @@ export function presetSchema(configure) {
52
53
  }
53
54
  export function schema(configure) {
54
55
  const CelBool = Expression({ configure, resultType: "bool" });
56
+ const DisabledDate = Expression({
57
+ configure: (env) => {
58
+ configure(env);
59
+ registerInputDateIfAbsent(env);
60
+ },
61
+ resultType: DISABLE_DATE_RESULT
62
+ });
55
63
  const Preset = presetSchema(configure);
56
64
  return Schema.Struct({
57
65
  type: Schema.Literal(type),
@@ -83,6 +91,10 @@ export function schema(configure) {
83
91
  title: "\u53EA\u8BFB\u6761\u4EF6",
84
92
  description: "\u8FD4\u56DE `true` \u65F6\u4EC5\u4EE5\u7EAF\u6587\u672C\u5C55\u793A\u5F53\u524D\u503C"
85
93
  })),
94
+ disabledDate: Schema.optional(DisabledDate.annotations({
95
+ title: "\u7981\u7528\u65E5\u671F",
96
+ 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"
97
+ })),
86
98
  derived: derivedField(configure, "dyn"),
87
99
  format: Schema.optional(Schema.String.pipe(Schema.minLength(1)).annotations({
88
100
  title: "\u5C55\u793A\u683C\u5F0F",
@@ -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-05-13";
28
29
  readonly orientation?: "vertical" | "floating" | undefined;
29
30
  readonly placeholder?: readonly [{
@@ -40,7 +41,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
40
41
  readonly mode: "formula" | "prefill";
41
42
  readonly expression: string;
42
43
  } | undefined;
43
- readonly options: string;
44
44
  readonly validations?: readonly {
45
45
  readonly message: readonly [{
46
46
  readonly locale: "zh";
@@ -83,6 +83,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
83
83
  }[]] | undefined;
84
84
  readonly required?: string | undefined;
85
85
  readonly displayName?: string | undefined;
86
+ readonly options: string;
86
87
  readonly compatibilityDate: "2026-05-13";
87
88
  readonly orientation?: "vertical" | "floating" | undefined;
88
89
  readonly placeholder?: readonly [{
@@ -99,7 +100,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
99
100
  readonly mode: "formula" | "prefill";
100
101
  readonly expression: string;
101
102
  } | undefined;
102
- readonly options: string;
103
103
  readonly validations?: readonly {
104
104
  readonly message: readonly [{
105
105
  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-05-13";
28
29
  readonly orientation?: "vertical" | "floating" | undefined;
29
30
  readonly placeholder?: readonly [{
@@ -40,7 +41,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
40
41
  readonly mode: "formula" | "prefill";
41
42
  readonly expression: string;
42
43
  } | undefined;
43
- readonly options: string;
44
44
  readonly validations?: readonly {
45
45
  readonly message: readonly [{
46
46
  readonly locale: "zh";
@@ -83,6 +83,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
83
83
  }[]] | undefined;
84
84
  readonly required?: string | undefined;
85
85
  readonly displayName?: string | undefined;
86
+ readonly options: string;
86
87
  readonly compatibilityDate: "2026-05-13";
87
88
  readonly orientation?: "vertical" | "floating" | undefined;
88
89
  readonly placeholder?: readonly [{
@@ -99,7 +100,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
99
100
  readonly mode: "formula" | "prefill";
100
101
  readonly expression: string;
101
102
  } | undefined;
102
- readonly options: string;
103
103
  readonly validations?: readonly {
104
104
  readonly message: readonly [{
105
105
  readonly locale: "zh";
@@ -5,7 +5,7 @@ import { celBindings, injectCELContext, provideCELContext } from "../../../../..
5
5
  import FormUnitRenderer from "../../../FormUnitRenderer.vue";
6
6
  import { useDerived, useDerivedQuiescence } from "../../../utils/derived";
7
7
  import { provideFormState } from "../../../utils/state";
8
- import { provideSelectionsRegistry } from "../../../../../utils/selections-registry";
8
+ import { provideOptionsRegistry, provideSelectionsRegistry } from "../../../../../utils/selections-registry";
9
9
  defineOptions({ name: "ShwfedListFieldRow" });
10
10
  const state = defineModel({ type: null, ...{ required: true } });
11
11
  const props = defineProps({
@@ -14,6 +14,7 @@ const props = defineProps({
14
14
  });
15
15
  const formState = provideFormState(state, "row");
16
16
  const selections = provideSelectionsRegistry();
17
+ const options = provideOptionsRegistry();
17
18
  provideCELContext({
18
19
  item: {
19
20
  type: "dyn",
@@ -32,6 +33,12 @@ provideCELContext({
32
33
  label: "\u9009\u4E2D\u9879",
33
34
  description: "\u672C\u5217\u8868\u9879\u5404\u9009\u62E9\u5B57\u6BB5\u5F53\u524D\u9009\u4E2D\u9879\u7684\u5B8C\u6574\u5BF9\u8C61\uFF08\u6309\u5B57\u6BB5\u6807\u8BC6\uFF09\u3002",
34
35
  value: () => selections.entries.value
36
+ },
37
+ options: {
38
+ type: "dyn",
39
+ label: "\u5168\u90E8\u9009\u9879",
40
+ description: "\u672C\u5217\u8868\u9879\u5404\u9009\u62E9\u5B57\u6BB5\u5F53\u524D\u5DF2\u52A0\u8F7D\u7684\u5168\u90E8\u9009\u9879\uFF08\u6309\u5B57\u6BB5\u6807\u8BC6\uFF09\u3002",
41
+ value: () => options.entries.value
35
42
  }
36
43
  });
37
44
  const inherited = injectCELContext();
@@ -46,18 +46,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
46
46
  readonly data: string;
47
47
  readonly request?: string | undefined;
48
48
  };
49
- readonly cascade: "independent" | "cascade-down" | "cascade-both";
50
- readonly validations?: readonly {
51
- readonly message: readonly [{
52
- readonly locale: "zh";
53
- readonly message: string;
54
- }, ...{
55
- readonly locale: "en" | "ja" | "ko";
56
- readonly message: string;
57
- }[]];
58
- readonly warning?: boolean | undefined;
59
- readonly when: string;
60
- }[] | undefined;
61
49
  readonly nodeKey: string;
62
50
  readonly nodeChildren: string;
63
51
  readonly nodeLabel: readonly [{
@@ -67,6 +55,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
67
55
  readonly locale: "en" | "ja" | "ko";
68
56
  readonly message: string;
69
57
  }[]];
58
+ readonly cascade: "independent" | "cascade-down" | "cascade-both";
70
59
  readonly nodeTooltip?: readonly [{
71
60
  readonly locale: "zh";
72
61
  readonly message: string;
@@ -76,6 +65,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
76
65
  }[]] | undefined;
77
66
  readonly nodeSelectable?: string | undefined;
78
67
  readonly expandAll: boolean;
68
+ readonly validations?: readonly {
69
+ readonly message: readonly [{
70
+ readonly locale: "zh";
71
+ readonly message: string;
72
+ }, ...{
73
+ readonly locale: "en" | "ja" | "ko";
74
+ readonly message: string;
75
+ }[]];
76
+ readonly warning?: boolean | undefined;
77
+ readonly when: string;
78
+ }[] | undefined;
79
79
  }) => any;
80
80
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
81
81
  "onUpdate:modelValue"?: ((value: {
@@ -121,18 +121,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
121
121
  readonly data: string;
122
122
  readonly request?: string | undefined;
123
123
  };
124
- readonly cascade: "independent" | "cascade-down" | "cascade-both";
125
- readonly validations?: readonly {
126
- readonly message: readonly [{
127
- readonly locale: "zh";
128
- readonly message: string;
129
- }, ...{
130
- readonly locale: "en" | "ja" | "ko";
131
- readonly message: string;
132
- }[]];
133
- readonly warning?: boolean | undefined;
134
- readonly when: string;
135
- }[] | undefined;
136
124
  readonly nodeKey: string;
137
125
  readonly nodeChildren: string;
138
126
  readonly nodeLabel: readonly [{
@@ -142,6 +130,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
142
130
  readonly locale: "en" | "ja" | "ko";
143
131
  readonly message: string;
144
132
  }[]];
133
+ readonly cascade: "independent" | "cascade-down" | "cascade-both";
145
134
  readonly nodeTooltip?: readonly [{
146
135
  readonly locale: "zh";
147
136
  readonly message: string;
@@ -151,6 +140,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
151
140
  }[]] | undefined;
152
141
  readonly nodeSelectable?: string | undefined;
153
142
  readonly expandAll: boolean;
143
+ readonly validations?: readonly {
144
+ readonly message: readonly [{
145
+ readonly locale: "zh";
146
+ readonly message: string;
147
+ }, ...{
148
+ readonly locale: "en" | "ja" | "ko";
149
+ readonly message: string;
150
+ }[]];
151
+ readonly warning?: boolean | undefined;
152
+ readonly when: string;
153
+ }[] | undefined;
154
154
  }) => any) | undefined;
155
155
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
156
156
  declare const _default: typeof __VLS_export;
@@ -46,18 +46,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
46
46
  readonly data: string;
47
47
  readonly request?: string | undefined;
48
48
  };
49
- readonly cascade: "independent" | "cascade-down" | "cascade-both";
50
- readonly validations?: readonly {
51
- readonly message: readonly [{
52
- readonly locale: "zh";
53
- readonly message: string;
54
- }, ...{
55
- readonly locale: "en" | "ja" | "ko";
56
- readonly message: string;
57
- }[]];
58
- readonly warning?: boolean | undefined;
59
- readonly when: string;
60
- }[] | undefined;
61
49
  readonly nodeKey: string;
62
50
  readonly nodeChildren: string;
63
51
  readonly nodeLabel: readonly [{
@@ -67,6 +55,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
67
55
  readonly locale: "en" | "ja" | "ko";
68
56
  readonly message: string;
69
57
  }[]];
58
+ readonly cascade: "independent" | "cascade-down" | "cascade-both";
70
59
  readonly nodeTooltip?: readonly [{
71
60
  readonly locale: "zh";
72
61
  readonly message: string;
@@ -76,6 +65,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
76
65
  }[]] | undefined;
77
66
  readonly nodeSelectable?: string | undefined;
78
67
  readonly expandAll: boolean;
68
+ readonly validations?: readonly {
69
+ readonly message: readonly [{
70
+ readonly locale: "zh";
71
+ readonly message: string;
72
+ }, ...{
73
+ readonly locale: "en" | "ja" | "ko";
74
+ readonly message: string;
75
+ }[]];
76
+ readonly warning?: boolean | undefined;
77
+ readonly when: string;
78
+ }[] | undefined;
79
79
  }) => any;
80
80
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
81
81
  "onUpdate:modelValue"?: ((value: {
@@ -121,18 +121,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
121
121
  readonly data: string;
122
122
  readonly request?: string | undefined;
123
123
  };
124
- readonly cascade: "independent" | "cascade-down" | "cascade-both";
125
- readonly validations?: readonly {
126
- readonly message: readonly [{
127
- readonly locale: "zh";
128
- readonly message: string;
129
- }, ...{
130
- readonly locale: "en" | "ja" | "ko";
131
- readonly message: string;
132
- }[]];
133
- readonly warning?: boolean | undefined;
134
- readonly when: string;
135
- }[] | undefined;
136
124
  readonly nodeKey: string;
137
125
  readonly nodeChildren: string;
138
126
  readonly nodeLabel: readonly [{
@@ -142,6 +130,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
142
130
  readonly locale: "en" | "ja" | "ko";
143
131
  readonly message: string;
144
132
  }[]];
133
+ readonly cascade: "independent" | "cascade-down" | "cascade-both";
145
134
  readonly nodeTooltip?: readonly [{
146
135
  readonly locale: "zh";
147
136
  readonly message: string;
@@ -151,6 +140,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
151
140
  }[]] | undefined;
152
141
  readonly nodeSelectable?: string | undefined;
153
142
  readonly expandAll: boolean;
143
+ readonly validations?: readonly {
144
+ readonly message: readonly [{
145
+ readonly locale: "zh";
146
+ readonly message: string;
147
+ }, ...{
148
+ readonly locale: "en" | "ja" | "ko";
149
+ readonly message: string;
150
+ }[]];
151
+ readonly warning?: boolean | undefined;
152
+ readonly when: string;
153
+ }[] | undefined;
154
154
  }) => any) | undefined;
155
155
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
156
156
  declare const _default: typeof __VLS_export;
@@ -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 < now"
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";
@@ -70,6 +71,9 @@ const shortcuts = computed(() => {
70
71
  }
71
72
  }));
72
73
  });
74
+ const disabledDate = computed(
75
+ () => makeDisabledDatePredicate(props.config.disabledDate, (input) => Effect.runSync($cel(props.config.disabledDate, { form: formScope.state.value ?? {}, input })))
76
+ );
73
77
  const uncontrolled = ref(void 0);
74
78
  const model = computed({
75
79
  get: () => {
@@ -130,6 +134,7 @@ const model = computed({
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\u6708\u4EFD\uFF08\u8BE5\u6708 1 \u53F7\uFF09\u3002\u8FD4\u56DE `true` \u65F6\u7981\u7528\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",
@@ -34,6 +34,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
34
34
  } | undefined;
35
35
  readonly format?: string | undefined;
36
36
  readonly valueFormat?: string | undefined;
37
+ readonly disabledDate?: string | undefined;
37
38
  readonly rangeSeparatorIcon?: string | undefined;
38
39
  readonly startPlaceholder?: readonly [{
39
40
  readonly locale: "zh";
@@ -105,6 +106,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
105
106
  } | undefined;
106
107
  readonly format?: string | undefined;
107
108
  readonly valueFormat?: string | undefined;
109
+ readonly disabledDate?: string | undefined;
108
110
  readonly rangeSeparatorIcon?: string | undefined;
109
111
  readonly startPlaceholder?: readonly [{
110
112
  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";
@@ -644,6 +645,27 @@ const valueFormatExample = computed(() => previewFormat(value.value.valueFormat
644
645
  </Field>
645
646
  </div>
646
647
 
648
+ <Field orientation="vertical">
649
+ <FieldLabel class="text-xs text-zinc-500">
650
+ <template #tooltip>
651
+ <Markdown
652
+ :source="fieldDescription('disabledDate')"
653
+ block
654
+ class="prose prose-sm prose-zinc"
655
+ />
656
+ </template>
657
+ {{ fieldTitle("disabledDate") }}
658
+ </FieldLabel>
659
+ <ExpressionEditor
660
+ :model-value="value.disabledDate ?? ''"
661
+ placeholder="例:input < now"
662
+ :result-type="[...DISABLE_DATE_EDITOR_RESULT]"
663
+ :extra-vars="INPUT_DATE_VARS"
664
+ class="min-h-10"
665
+ @update:model-value="(v) => value = { ...value, disabledDate: v.length > 0 ? v : void 0 }"
666
+ />
667
+ </Field>
668
+
647
669
  <Field orientation="vertical">
648
670
  <FieldLabel class="text-xs text-zinc-500">
649
671
  <template #tooltip>
@@ -34,6 +34,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
34
34
  } | undefined;
35
35
  readonly format?: string | undefined;
36
36
  readonly valueFormat?: string | undefined;
37
+ readonly disabledDate?: string | undefined;
37
38
  readonly rangeSeparatorIcon?: string | undefined;
38
39
  readonly startPlaceholder?: readonly [{
39
40
  readonly locale: "zh";
@@ -105,6 +106,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
105
106
  } | undefined;
106
107
  readonly format?: string | undefined;
107
108
  readonly valueFormat?: string | undefined;
109
+ readonly disabledDate?: string | undefined;
108
110
  readonly rangeSeparatorIcon?: string | undefined;
109
111
  readonly startPlaceholder?: readonly [{
110
112
  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";
@@ -77,6 +78,9 @@ const shortcuts = computed(() => {
77
78
  }
78
79
  }));
79
80
  });
81
+ const disabledDate = computed(
82
+ () => makeDisabledDatePredicate(props.config.disabledDate, (input) => Effect.runSync($cel(props.config.disabledDate, { form: formScope.state.value ?? {}, input })))
83
+ );
80
84
  function asRange(raw) {
81
85
  if (!Array.isArray(raw) || raw.length !== 2) return void 0;
82
86
  const [a, b] = raw;
@@ -162,6 +166,7 @@ const readonlyText = computed(() => {
162
166
  :end-placeholder="endPlaceholderText"
163
167
  :range-separator-icon="config.rangeSeparatorIcon"
164
168
  :disabled="isDisabled"
169
+ :disabled-date="disabledDate"
165
170
  :shortcuts="shortcuts"
166
171
  />
167
172
  <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\u6708\u4EFD\uFF08\u8BE5\u6708 1 \u53F7\uFF09\u3002\u8FD4\u56DE `true` \u65F6\u7981\u7528\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",
@@ -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-05-25";
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-05-25";
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";