@shwfed/config 2.12.0 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +34 -34
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.d.vue.ts +2 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue +22 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue.d.ts +2 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/runtime.vue +5 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.js +12 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +2 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue +22 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +2 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/runtime.vue +5 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.js +12 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +2 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue +22 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +2 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/runtime.vue +5 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.js +12 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +2 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue +22 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +2 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/runtime.vue +5 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.js +12 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.d.vue.ts +2 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.vue +22 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.vue.d.ts +2 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/runtime.vue +5 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.js +12 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +2 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue +22 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +2 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/runtime.vue +5 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.js +12 -0
- package/dist/runtime/components/form/utils/ai-field-tools.d.ts +11 -0
- package/dist/runtime/components/form/utils/ai-field-tools.js +282 -0
- package/dist/runtime/components/form/utils/resolve.d.ts +15 -0
- package/dist/runtime/components/form/utils/resolve.js +13 -0
- package/dist/runtime/components/table/ai-generate.system.md +6 -0
- package/dist/runtime/components/table/ai-generate.vue +18 -17
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/config.vue +33 -0
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/runtime.vue +5 -0
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.js +6 -1
- package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/config.vue +33 -0
- package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/runtime.vue +5 -0
- package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/schema.js +6 -1
- package/dist/runtime/components/table/schema.d.ts +68 -68
- package/dist/runtime/components/table/utils/ai-tools.js +50 -1
- package/dist/runtime/components/table/utils/shared.d.ts +1 -0
- package/dist/runtime/components/table/utils/shared.js +10 -0
- package/dist/runtime/components/ui/alert-dialog/AlertDialogCancel.vue +1 -1
- package/dist/runtime/components/ui/chat/ChatPrompt.d.vue.ts +11 -1
- package/dist/runtime/components/ui/chat/ChatPrompt.vue +10 -0
- package/dist/runtime/components/ui/chat/ChatPrompt.vue.d.ts +11 -1
- package/dist/runtime/share/disabled-date.d.ts +34 -0
- package/dist/runtime/share/disabled-date.js +13 -0
- package/dist/runtime/utils/ai/index.js +24 -1
- package/dist/runtime/utils/disabled-date.d.ts +26 -0
- package/dist/runtime/utils/disabled-date.js +21 -0
- package/package.json +1 -1
|
@@ -47,40 +47,6 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
|
|
|
47
47
|
readonly message: string;
|
|
48
48
|
}[]] | undefined;
|
|
49
49
|
}[];
|
|
50
|
-
readonly query?: {
|
|
51
|
-
readonly style?: string | undefined;
|
|
52
|
-
readonly id?: string | undefined;
|
|
53
|
-
readonly initial?: {
|
|
54
|
-
readonly data: string;
|
|
55
|
-
readonly request?: string | undefined;
|
|
56
|
-
} | undefined;
|
|
57
|
-
readonly displayName?: string | undefined;
|
|
58
|
-
readonly kind: "shwfed.component.form";
|
|
59
|
-
readonly fields: readonly any[];
|
|
60
|
-
readonly layouts: readonly {
|
|
61
|
-
readonly name: string;
|
|
62
|
-
readonly layout: {
|
|
63
|
-
readonly style?: string | undefined;
|
|
64
|
-
readonly columns: number;
|
|
65
|
-
readonly gap?: number | undefined;
|
|
66
|
-
readonly rows?: number | undefined;
|
|
67
|
-
readonly placements: {
|
|
68
|
-
readonly [x: string]: {
|
|
69
|
-
readonly area: readonly [readonly [number, number], readonly [number, number]];
|
|
70
|
-
readonly v?: "stretch" | "center" | "end" | "start" | undefined;
|
|
71
|
-
readonly h?: "stretch" | "center" | "end" | "start" | undefined;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
readonly media?: string | undefined;
|
|
76
|
-
}[];
|
|
77
|
-
readonly readonly?: string | undefined;
|
|
78
|
-
} | undefined;
|
|
79
|
-
readonly dataSource?: {
|
|
80
|
-
readonly data: string;
|
|
81
|
-
readonly total?: string | undefined;
|
|
82
|
-
readonly request?: string | undefined;
|
|
83
|
-
} | undefined;
|
|
84
50
|
readonly actions?: {
|
|
85
51
|
readonly size: "default" | "sm" | "xs";
|
|
86
52
|
readonly style?: string | undefined;
|
|
@@ -148,6 +114,40 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
|
|
|
148
114
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
149
115
|
}[];
|
|
150
116
|
} | undefined;
|
|
117
|
+
readonly query?: {
|
|
118
|
+
readonly style?: string | undefined;
|
|
119
|
+
readonly id?: string | undefined;
|
|
120
|
+
readonly initial?: {
|
|
121
|
+
readonly data: string;
|
|
122
|
+
readonly request?: string | undefined;
|
|
123
|
+
} | undefined;
|
|
124
|
+
readonly displayName?: string | undefined;
|
|
125
|
+
readonly kind: "shwfed.component.form";
|
|
126
|
+
readonly fields: readonly any[];
|
|
127
|
+
readonly layouts: readonly {
|
|
128
|
+
readonly name: string;
|
|
129
|
+
readonly layout: {
|
|
130
|
+
readonly style?: string | undefined;
|
|
131
|
+
readonly columns: number;
|
|
132
|
+
readonly gap?: number | undefined;
|
|
133
|
+
readonly rows?: number | undefined;
|
|
134
|
+
readonly placements: {
|
|
135
|
+
readonly [x: string]: {
|
|
136
|
+
readonly area: readonly [readonly [number, number], readonly [number, number]];
|
|
137
|
+
readonly v?: "stretch" | "center" | "end" | "start" | undefined;
|
|
138
|
+
readonly h?: "stretch" | "center" | "end" | "start" | undefined;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
readonly media?: string | undefined;
|
|
143
|
+
}[];
|
|
144
|
+
readonly readonly?: string | undefined;
|
|
145
|
+
} | undefined;
|
|
146
|
+
readonly dataSource?: {
|
|
147
|
+
readonly data: string;
|
|
148
|
+
readonly total?: string | undefined;
|
|
149
|
+
readonly request?: string | undefined;
|
|
150
|
+
} | undefined;
|
|
151
151
|
readonly bottomActions?: {
|
|
152
152
|
readonly size: "default" | "sm" | "xs";
|
|
153
153
|
readonly style?: string | undefined;
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.d.vue.ts
CHANGED
|
@@ -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";
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue
CHANGED
|
@@ -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>
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue.d.ts
CHANGED
|
@@ -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";
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/runtime.vue
CHANGED
|
@@ -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
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.d.ts
CHANGED
|
@@ -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";
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue
CHANGED
|
@@ -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";
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/runtime.vue
CHANGED
|
@@ -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
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.d.ts
CHANGED
|
@@ -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>;
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.js
CHANGED
|
@@ -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 [{
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue
CHANGED
|
@@ -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 [{
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/runtime.vue
CHANGED
|
@@ -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
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.d.ts
CHANGED
|
@@ -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>;
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.js
CHANGED
|
@@ -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 [{
|
|
@@ -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>;
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.js
CHANGED
|
@@ -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",
|
package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.d.vue.ts
CHANGED
|
@@ -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";
|