@shwfed/config 2.3.22 → 2.3.24
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/mcp.mjs +1503 -645
- package/dist/module.json +1 -1
- package/dist/preview/assets/{config-DhwLB2Ee.js → config-B-6Htwv0.js} +1 -1
- package/dist/preview/assets/{config-BiFAbTJq.js → config-B2KjxFl5.js} +1 -1
- package/dist/preview/assets/{config-B3mv60t8.js → config-B3at5Bue.js} +1 -1
- package/dist/preview/assets/{config-CLjwrQXG.js → config-Bi9uFh4Y.js} +1 -1
- package/dist/preview/assets/{config-D4fS9GYw.js → config-CBHKrOP5.js} +1 -1
- package/dist/preview/assets/{config-CpvkgqGg.js → config-CWZxlCMJ.js} +1 -1
- package/dist/preview/assets/{config-Cb9lQXQG.js → config-CaZpOvHG.js} +1 -1
- package/dist/preview/assets/{config-DY7n8WvE.js → config-D5Kfssb7.js} +1 -1
- package/dist/preview/assets/{config-DX6QxjI7.js → config-DYAEfkYR.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-Hx2iV358.js → definition.vue_vue_type_script_setup_true_lang-8BVrrrak.js} +1 -1
- package/dist/preview/assets/index-B3wadvvl.js +1 -0
- package/dist/preview/assets/{index-CDhwf1Dw.css → index-CJMxrUKZ.css} +1 -1
- package/dist/preview/assets/index-DTsYYECD.js +643 -0
- package/dist/preview/assets/{runtime-BarNw942.js → runtime-C1iENPNJ.js} +1 -1
- package/dist/preview/assets/{runtime-HQv4w652.js → runtime-C5CCMnHt.js} +1 -1
- package/dist/preview/assets/{runtime-usxovPqT.js → runtime-CEP42oTV.js} +1 -1
- package/dist/preview/assets/{runtime-Dl0d8KFj.js → runtime-CRHn61GX.js} +1 -1
- package/dist/preview/assets/{runtime-BazV3vOW.js → runtime-CoRrnGx1.js} +1 -1
- package/dist/preview/assets/{runtime-DIcMvC6H.js → runtime-CqciI2ST.js} +1 -1
- package/dist/preview/assets/{runtime-BXZROm-z.js → runtime-Hvzx1ucy.js} +1 -1
- package/dist/preview/assets/{runtime-CShAGyQk.js → runtime-aBsBSCeg.js} +1 -1
- package/dist/preview/assets/{runtime-ECoXJ0-J.js → runtime-jrsJfwMb.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.d.vue.ts +99 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue +329 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue.d.ts +99 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.vue +265 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.d.ts +79 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.js +71 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.d.vue.ts +133 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue +533 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue.d.ts +133 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.vue +247 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/schema.d.ts +124 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/schema.js +94 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +109 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue +426 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +109 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.vue +356 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.d.ts +85 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.js +147 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +137 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue +586 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +137 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.vue +287 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.d.ts +126 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.js +125 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +163 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue +709 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +163 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.vue +368 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.d.ts +225 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.js +175 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +167 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue +740 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +167 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.vue +402 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.d.ts +227 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.js +227 -0
- package/package.json +1 -1
- package/dist/preview/assets/index-B2gp2q3H.js +0 -643
- package/dist/preview/assets/index-Jytc_ICm.js +0 -1
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { Icon } from "@iconify/vue";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
import { computed, ref } from "vue";
|
|
5
|
+
import { useI18n } from "vue-i18n";
|
|
6
|
+
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
7
|
+
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
8
|
+
import { interpolateMarkdown } from "../../../../table/utils/runtime";
|
|
9
|
+
import { getLocalizedText } from "../../../../../share/locale";
|
|
10
|
+
import {
|
|
11
|
+
Command,
|
|
12
|
+
CommandEmpty,
|
|
13
|
+
CommandGroup,
|
|
14
|
+
CommandInput,
|
|
15
|
+
CommandItem,
|
|
16
|
+
CommandList
|
|
17
|
+
} from "../../../../ui/command";
|
|
18
|
+
import { Field, FieldLabel } from "../../../../ui/field";
|
|
19
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../../../../ui/input-group";
|
|
20
|
+
import { Markdown } from "../../../../ui/markdown";
|
|
21
|
+
import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "../../../../ui/popover";
|
|
22
|
+
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
23
|
+
import { useFormReadonly } from "../../../utils/readonly";
|
|
24
|
+
import { useFormState } from "../../../utils/state";
|
|
25
|
+
defineOptions({ name: "ShwfedComboboxMultiFieldRuntime" });
|
|
26
|
+
const props = defineProps({
|
|
27
|
+
fieldId: { type: String, required: true },
|
|
28
|
+
config: { type: null, required: true }
|
|
29
|
+
});
|
|
30
|
+
const { locale, t } = useI18n({
|
|
31
|
+
inheritLocale: true,
|
|
32
|
+
messages: {
|
|
33
|
+
zh: {
|
|
34
|
+
"combobox-multi-placeholder": "\u8BF7\u9009\u62E9",
|
|
35
|
+
"combobox-multi-search-placeholder": "\u641C\u7D22\u2026",
|
|
36
|
+
"combobox-multi-empty": "\u65E0\u5339\u914D\u9879"
|
|
37
|
+
},
|
|
38
|
+
en: {
|
|
39
|
+
"combobox-multi-placeholder": "Select\u2026",
|
|
40
|
+
"combobox-multi-search-placeholder": "Search\u2026",
|
|
41
|
+
"combobox-multi-empty": "No matches"
|
|
42
|
+
},
|
|
43
|
+
ja: {
|
|
44
|
+
"combobox-multi-placeholder": "\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
45
|
+
"combobox-multi-search-placeholder": "\u691C\u7D22\u2026",
|
|
46
|
+
"combobox-multi-empty": "\u4E00\u81F4\u306A\u3057"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const { state, getAt, setAt } = useFormState();
|
|
51
|
+
const inherited = injectCELContext();
|
|
52
|
+
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
53
|
+
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
54
|
+
const placeholderText = computed(
|
|
55
|
+
() => props.config.placeholder ? getLocalizedText(props.config.placeholder, locale.value) : t("combobox-multi-placeholder")
|
|
56
|
+
);
|
|
57
|
+
const tooltipText = computed(
|
|
58
|
+
() => props.config.tooltip ? getLocalizedText(props.config.tooltip, locale.value) : void 0
|
|
59
|
+
);
|
|
60
|
+
function evalBool(expression, label) {
|
|
61
|
+
if (!expression) return false;
|
|
62
|
+
try {
|
|
63
|
+
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
64
|
+
} catch (err) {
|
|
65
|
+
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const isDisabled = computed(() => evalBool(props.config.disabled, "disabled"));
|
|
70
|
+
const formReadonly = useFormReadonly();
|
|
71
|
+
const isReadonly = computed(
|
|
72
|
+
() => props.config.readonly != null ? evalBool(props.config.readonly, "readonly") : formReadonly.value
|
|
73
|
+
);
|
|
74
|
+
const effectiveReadonly = computed(() => isReadonly.value || props.config.derived?.mode === "formula");
|
|
75
|
+
function valueOf(option) {
|
|
76
|
+
try {
|
|
77
|
+
return Effect.runSync($cel(props.config.optionValue, { form: state.value ?? {}, option }));
|
|
78
|
+
} catch (err) {
|
|
79
|
+
console.error(`[shwfed-form] failed to evaluate optionValue for ${props.fieldId}:`, err);
|
|
80
|
+
return void 0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function labelOf(option) {
|
|
84
|
+
const tpl = getLocalizedText(props.config.optionLabel, locale.value) ?? "";
|
|
85
|
+
if (!tpl) return "";
|
|
86
|
+
return interpolateMarkdown(tpl, $cel, { form: state.value ?? {}, option });
|
|
87
|
+
}
|
|
88
|
+
const entries = computed(() => {
|
|
89
|
+
let raw;
|
|
90
|
+
try {
|
|
91
|
+
raw = Effect.runSync($cel(props.config.options, { form: state.value ?? {} }));
|
|
92
|
+
} catch (err) {
|
|
93
|
+
console.error(`[shwfed-form] failed to evaluate options for ${props.fieldId}:`, err);
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
if (!Array.isArray(raw)) return [];
|
|
97
|
+
return raw.map((option, idx) => ({
|
|
98
|
+
key: String(idx),
|
|
99
|
+
label: labelOf(option),
|
|
100
|
+
value: valueOf(option)
|
|
101
|
+
}));
|
|
102
|
+
});
|
|
103
|
+
const uncontrolled = ref([]);
|
|
104
|
+
const model = computed({
|
|
105
|
+
get: () => {
|
|
106
|
+
const path = props.config.binding;
|
|
107
|
+
const raw = path == null ? uncontrolled.value : getAt(path);
|
|
108
|
+
return Array.isArray(raw) ? raw : [];
|
|
109
|
+
},
|
|
110
|
+
set: (next) => {
|
|
111
|
+
const arr = Array.isArray(next) ? next : [];
|
|
112
|
+
const path = props.config.binding;
|
|
113
|
+
if (path == null) {
|
|
114
|
+
uncontrolled.value = arr;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
setAt(path, arr);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
function isEqual(a, b) {
|
|
121
|
+
if (a === b) return true;
|
|
122
|
+
if (a == null || b == null) return false;
|
|
123
|
+
if (typeof a === "object" && typeof b === "object") {
|
|
124
|
+
try {
|
|
125
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
126
|
+
} catch {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
const selectedEntries = computed(() => {
|
|
133
|
+
const list = [];
|
|
134
|
+
for (const v of model.value) {
|
|
135
|
+
const entry = entries.value.find((e) => isEqual(e.value, v));
|
|
136
|
+
if (entry) list.push(entry);
|
|
137
|
+
}
|
|
138
|
+
return list;
|
|
139
|
+
});
|
|
140
|
+
const selectedKeys = computed(() => selectedEntries.value.map((e) => e.key));
|
|
141
|
+
const selectedKeySet = computed(() => new Set(selectedKeys.value));
|
|
142
|
+
const triggerLabel = computed(() => {
|
|
143
|
+
const arr = selectedEntries.value;
|
|
144
|
+
if (arr.length === 0) return "";
|
|
145
|
+
if (arr.length === 1) return arr[0].label;
|
|
146
|
+
return `${arr[0].label} +${arr.length - 1}`;
|
|
147
|
+
});
|
|
148
|
+
const open = ref(false);
|
|
149
|
+
function handleSelect(next) {
|
|
150
|
+
const keys = Array.isArray(next) ? next.filter((k) => typeof k === "string") : [];
|
|
151
|
+
const mapped = [];
|
|
152
|
+
for (const key of keys) {
|
|
153
|
+
const entry = entries.value.find((e) => e.key === key);
|
|
154
|
+
if (entry) mapped.push(entry.value);
|
|
155
|
+
}
|
|
156
|
+
model.value = mapped;
|
|
157
|
+
}
|
|
158
|
+
const showClear = computed(
|
|
159
|
+
() => !isDisabled.value && selectedEntries.value.length > 0
|
|
160
|
+
);
|
|
161
|
+
function handleClear() {
|
|
162
|
+
model.value = [];
|
|
163
|
+
open.value = false;
|
|
164
|
+
}
|
|
165
|
+
</script>
|
|
166
|
+
|
|
167
|
+
<template>
|
|
168
|
+
<Field
|
|
169
|
+
:orientation="config.orientation ?? DEFAULT_FIELD_ORIENTATION"
|
|
170
|
+
:data-disabled="isDisabled || void 0"
|
|
171
|
+
>
|
|
172
|
+
<FieldLabel
|
|
173
|
+
v-if="labelText"
|
|
174
|
+
:for="fieldId"
|
|
175
|
+
class="text-xs text-zinc-500"
|
|
176
|
+
>
|
|
177
|
+
<template
|
|
178
|
+
v-if="tooltipText"
|
|
179
|
+
#tooltip
|
|
180
|
+
>
|
|
181
|
+
<Markdown
|
|
182
|
+
:source="tooltipText"
|
|
183
|
+
class="prose prose-xs prose-zinc"
|
|
184
|
+
/>
|
|
185
|
+
</template>
|
|
186
|
+
{{ labelText }}
|
|
187
|
+
</FieldLabel>
|
|
188
|
+
<div
|
|
189
|
+
v-if="effectiveReadonly"
|
|
190
|
+
class="min-h-9 py-1.5 text-sm text-zinc-700"
|
|
191
|
+
>
|
|
192
|
+
{{ triggerLabel || "\u2014" }}
|
|
193
|
+
</div>
|
|
194
|
+
<Popover
|
|
195
|
+
v-else
|
|
196
|
+
v-model:open="open"
|
|
197
|
+
>
|
|
198
|
+
<PopoverAnchor as-child>
|
|
199
|
+
<InputGroup
|
|
200
|
+
class="group/combobox-multi"
|
|
201
|
+
:data-disabled="isDisabled ? 'true' : void 0"
|
|
202
|
+
>
|
|
203
|
+
<PopoverTrigger as-child>
|
|
204
|
+
<InputGroupInput
|
|
205
|
+
:id="fieldId"
|
|
206
|
+
:model-value="triggerLabel"
|
|
207
|
+
:disabled="isDisabled"
|
|
208
|
+
:placeholder="placeholderText"
|
|
209
|
+
class="cursor-pointer text-left"
|
|
210
|
+
readonly
|
|
211
|
+
/>
|
|
212
|
+
</PopoverTrigger>
|
|
213
|
+
<InputGroupAddon
|
|
214
|
+
v-if="showClear"
|
|
215
|
+
align="inline-end"
|
|
216
|
+
class="[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-multi:opacity-100 focus-within:opacity-100"
|
|
217
|
+
>
|
|
218
|
+
<InputGroupButton
|
|
219
|
+
size="icon-xs"
|
|
220
|
+
data-slot="combobox-multi-clear"
|
|
221
|
+
class="text-zinc-500 hover:text-zinc-700"
|
|
222
|
+
tabindex="-1"
|
|
223
|
+
@mousedown.prevent
|
|
224
|
+
@click.stop="handleClear"
|
|
225
|
+
>
|
|
226
|
+
<Icon icon="fluent:dismiss-20-regular" />
|
|
227
|
+
</InputGroupButton>
|
|
228
|
+
</InputGroupAddon>
|
|
229
|
+
</InputGroup>
|
|
230
|
+
</PopoverAnchor>
|
|
231
|
+
<PopoverContent
|
|
232
|
+
class="p-0"
|
|
233
|
+
:style="{ width: 'var(--reka-popover-trigger-width)' }"
|
|
234
|
+
>
|
|
235
|
+
<Command
|
|
236
|
+
:model-value="selectedKeys"
|
|
237
|
+
:multiple="true"
|
|
238
|
+
:disabled="isDisabled"
|
|
239
|
+
@update:model-value="handleSelect"
|
|
240
|
+
>
|
|
241
|
+
<CommandInput :placeholder="t('combobox-multi-search-placeholder')" />
|
|
242
|
+
<CommandList>
|
|
243
|
+
<CommandEmpty class="py-6 text-center text-sm text-zinc-500">
|
|
244
|
+
{{ t("combobox-multi-empty") }}
|
|
245
|
+
</CommandEmpty>
|
|
246
|
+
<CommandGroup>
|
|
247
|
+
<CommandItem
|
|
248
|
+
v-for="entry in entries"
|
|
249
|
+
:key="entry.key"
|
|
250
|
+
:value="entry.key"
|
|
251
|
+
>
|
|
252
|
+
<span class="flex-1">{{ entry.label }}</span>
|
|
253
|
+
<Icon
|
|
254
|
+
v-if="selectedKeySet.has(entry.key)"
|
|
255
|
+
icon="fluent:checkmark-20-regular"
|
|
256
|
+
class="size-4 text-zinc-700"
|
|
257
|
+
/>
|
|
258
|
+
</CommandItem>
|
|
259
|
+
</CommandGroup>
|
|
260
|
+
</CommandList>
|
|
261
|
+
</Command>
|
|
262
|
+
</PopoverContent>
|
|
263
|
+
</Popover>
|
|
264
|
+
</Field>
|
|
265
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Value } from './schema.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
fieldId: string;
|
|
4
|
+
config: Value;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import type { Environment } from '../../../../../vendor/cel-js/lib/index.js';
|
|
3
|
+
export declare const type: "com.shwfed.form.field.combobox.multi";
|
|
4
|
+
export declare const compatibilityDate: "2026-05-25";
|
|
5
|
+
export declare const metadata: {
|
|
6
|
+
readonly name: "下拉多选";
|
|
7
|
+
readonly icon: "fluent:chevron-down-20-regular";
|
|
8
|
+
readonly w: {
|
|
9
|
+
readonly initial: 8;
|
|
10
|
+
readonly min: 4;
|
|
11
|
+
readonly max: number;
|
|
12
|
+
};
|
|
13
|
+
readonly h: {
|
|
14
|
+
readonly initial: 2;
|
|
15
|
+
readonly min: 2;
|
|
16
|
+
readonly max: 2;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare function schema(configure: (env: Environment) => void): Schema.Struct<{
|
|
20
|
+
label: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
|
|
21
|
+
locale: Schema.Literal<["zh"]>;
|
|
22
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
23
|
+
}>], [Schema.Struct<{
|
|
24
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
25
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
26
|
+
}>]>>;
|
|
27
|
+
placeholder: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
|
|
28
|
+
locale: Schema.Literal<["zh"]>;
|
|
29
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
30
|
+
}>], [Schema.Struct<{
|
|
31
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
32
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
33
|
+
}>]>>;
|
|
34
|
+
tooltip: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
|
|
35
|
+
locale: Schema.Literal<["zh"]>;
|
|
36
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
37
|
+
}>], [Schema.Struct<{
|
|
38
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
39
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
40
|
+
}>]>>;
|
|
41
|
+
orientation: Schema.optional<Schema.Literal<["vertical", "floating"]>>;
|
|
42
|
+
binding: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
43
|
+
disabled: Schema.optional<Schema.Schema<string, string, never>>;
|
|
44
|
+
readonly: Schema.optional<Schema.Schema<string, string, never>>;
|
|
45
|
+
derived: Schema.optional<Schema.Struct<{
|
|
46
|
+
mode: Schema.Literal<["formula", "prefill"]>;
|
|
47
|
+
expression: Schema.Schema<string, string, never>;
|
|
48
|
+
}>>;
|
|
49
|
+
options: Schema.optionalWith<Schema.Schema<string, string, never>, {
|
|
50
|
+
default: () => string;
|
|
51
|
+
}>;
|
|
52
|
+
optionValue: Schema.optionalWith<Schema.Schema<string, string, never>, {
|
|
53
|
+
default: () => string;
|
|
54
|
+
}>;
|
|
55
|
+
optionLabel: Schema.optionalWith<Schema.refine<readonly [{
|
|
56
|
+
readonly locale: "zh";
|
|
57
|
+
readonly message: string;
|
|
58
|
+
}, ...{
|
|
59
|
+
readonly locale: "en" | "ja" | "ko";
|
|
60
|
+
readonly message: string;
|
|
61
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
62
|
+
locale: Schema.Literal<["zh"]>;
|
|
63
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
64
|
+
}>], [Schema.Struct<{
|
|
65
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
66
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
67
|
+
}>]>>, {
|
|
68
|
+
default: () => readonly [{
|
|
69
|
+
readonly locale: "zh";
|
|
70
|
+
readonly message: "";
|
|
71
|
+
}];
|
|
72
|
+
}>;
|
|
73
|
+
id: Schema.refine<string, typeof Schema.String>;
|
|
74
|
+
displayName: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
75
|
+
hidden: Schema.optional<Schema.Schema<string, string, never>>;
|
|
76
|
+
type: Schema.Literal<["com.shwfed.form.field.combobox.multi"]>;
|
|
77
|
+
compatibilityDate: Schema.Literal<["2026-05-25"]>;
|
|
78
|
+
}>;
|
|
79
|
+
export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
|
|
3
|
+
import { Locale } from "../../../../../share/locale.js";
|
|
4
|
+
import { commonFieldFields, derivedField, FieldOrientationSchema } from "../../../utils/common.js";
|
|
5
|
+
export const type = "com.shwfed.form.field.combobox.multi";
|
|
6
|
+
export const compatibilityDate = "2026-05-25";
|
|
7
|
+
export const metadata = {
|
|
8
|
+
name: "\u4E0B\u62C9\u591A\u9009",
|
|
9
|
+
icon: "fluent:chevron-down-20-regular",
|
|
10
|
+
w: { initial: 8, min: 4, max: Infinity },
|
|
11
|
+
h: { initial: 2, min: 2, max: 2 }
|
|
12
|
+
};
|
|
13
|
+
function configureWithOption(configure) {
|
|
14
|
+
return (env) => {
|
|
15
|
+
configure(env);
|
|
16
|
+
env.registerVariable("option", "dyn", { description: "\u5F53\u524D\u9009\u9879" });
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const isListType = (actual) => actual === "dyn" || actual.startsWith("list");
|
|
20
|
+
export function schema(configure) {
|
|
21
|
+
const CelBool = Expression({ configure, resultType: "bool" });
|
|
22
|
+
const CelOptions = Expression({ configure, resultType: isListType });
|
|
23
|
+
const CelOptionValue = Expression({ configure: configureWithOption(configure), resultType: "dyn" });
|
|
24
|
+
const LocaleOptionLabel = LocaleMarkdown({ configure: configureWithOption(configure) });
|
|
25
|
+
return Schema.Struct({
|
|
26
|
+
type: Schema.Literal(type),
|
|
27
|
+
compatibilityDate: Schema.Literal(compatibilityDate),
|
|
28
|
+
...commonFieldFields(configure),
|
|
29
|
+
label: Schema.optional(Locale.annotations({
|
|
30
|
+
title: "\u6807\u7B7E",
|
|
31
|
+
description: "\u5B57\u6BB5\u524D\u5C55\u793A\u7684\u6587\u672C\uFF1B\u7559\u7A7A\u5219\u4E0D\u6E32\u67D3\u6807\u7B7E"
|
|
32
|
+
})),
|
|
33
|
+
placeholder: Schema.optional(Locale.annotations({
|
|
34
|
+
title: "\u5360\u4F4D\u7B26",
|
|
35
|
+
description: "\u672A\u9009\u4E2D\u4EFB\u4F55\u9009\u9879\u65F6\u8F93\u5165\u6846\u4E2D\u7684\u5360\u4F4D\u6587\u672C"
|
|
36
|
+
})),
|
|
37
|
+
tooltip: Schema.optional(Locale.annotations({
|
|
38
|
+
title: "\u63D0\u793A",
|
|
39
|
+
description: "\u9F20\u6807\u60AC\u505C\u5728\u6807\u7B7E\u4E0A\u65F6\u5C55\u793A\u7684\u8BF4\u660E"
|
|
40
|
+
})),
|
|
41
|
+
orientation: Schema.optional(FieldOrientationSchema),
|
|
42
|
+
binding: Schema.optional(Schema.String.pipe(Schema.minLength(1)).annotations({
|
|
43
|
+
title: "\u7ED1\u5B9A\u8DEF\u5F84",
|
|
44
|
+
description: "\u5199\u5165\u8868\u5355\u72B6\u6001\u7684 `dot-prop` \u8DEF\u5F84\uFF0C\u4F8B\u5982 `user.roles`\uFF1B\u5199\u5165\u503C\u4E3A\u5DF2\u9009\u9879 `value` \u7EC4\u6210\u7684\u6570\u7EC4\uFF1B\u7559\u7A7A\u5219\u4E3A\u975E\u53D7\u63A7\u5B57\u6BB5"
|
|
45
|
+
})),
|
|
46
|
+
disabled: Schema.optional(CelBool.annotations({
|
|
47
|
+
title: "\u7981\u7528\u6761\u4EF6",
|
|
48
|
+
description: "\u8FD4\u56DE `true` \u65F6\u4E0B\u62C9\u6846\u4ECD\u7136\u6E32\u67D3\u4F46\u4E0D\u53EF\u9009\u62E9"
|
|
49
|
+
})),
|
|
50
|
+
readonly: Schema.optional(CelBool.annotations({
|
|
51
|
+
title: "\u53EA\u8BFB\u6761\u4EF6",
|
|
52
|
+
description: "\u8FD4\u56DE `true` \u65F6\u4EC5\u4EE5\u7EAF\u6587\u672C\u5C55\u793A\u5F53\u524D\u5DF2\u9009\u9879\u7684\u6807\u7B7E"
|
|
53
|
+
})),
|
|
54
|
+
derived: derivedField(configure, "dyn"),
|
|
55
|
+
options: Schema.optionalWith(CelOptions.annotations({
|
|
56
|
+
title: "\u9009\u9879",
|
|
57
|
+
description: "\u8FD4\u56DE\u9009\u9879\u6570\u7EC4\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u8BBF\u95EE `form` \u5F53\u524D\u72B6\u6001\uFF1B\u4F8B\uFF1A`[{value: 'a', label: 'A'}]`"
|
|
58
|
+
}), { default: () => "[]" }),
|
|
59
|
+
optionValue: Schema.optionalWith(CelOptionValue.annotations({
|
|
60
|
+
title: "\u9009\u9879\u503C",
|
|
61
|
+
description: "\u4ECE\u5F53\u524D `option` \u63D0\u53D6\u5199\u5165\u7ED1\u5B9A\u7684\u503C\uFF1B\u4F8B\uFF1A`option.value`"
|
|
62
|
+
}), { default: () => "option" }),
|
|
63
|
+
optionLabel: Schema.optionalWith(LocaleOptionLabel.annotations({
|
|
64
|
+
title: "\u9009\u9879\u6807\u7B7E",
|
|
65
|
+
description: "\u6BCF\u4E2A\u9009\u9879\u5C55\u793A\u7684\u672C\u5730\u5316\u6587\u672C\uFF0C\u652F\u6301 `{{ string(option.foo) }}` \u63D2\u503C"
|
|
66
|
+
}), { default: () => [{ locale: "zh", message: "" }] })
|
|
67
|
+
}).annotations({
|
|
68
|
+
title: "ComboboxMultiField",
|
|
69
|
+
description: "\u4E0B\u62C9\u591A\u9009\u8F93\u5165"
|
|
70
|
+
});
|
|
71
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { type Value } from './schema.js';
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue: Value;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: {
|
|
7
|
+
readonly size?: number | undefined;
|
|
8
|
+
readonly disabled?: string | undefined;
|
|
9
|
+
readonly type: "com.shwfed.table.column.combobox-multi";
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly title: readonly [{
|
|
12
|
+
readonly locale: "zh";
|
|
13
|
+
readonly message: string;
|
|
14
|
+
}, ...{
|
|
15
|
+
readonly locale: "en" | "ja" | "ko";
|
|
16
|
+
readonly message: string;
|
|
17
|
+
}[]];
|
|
18
|
+
readonly hidden?: string | undefined;
|
|
19
|
+
readonly tooltip?: readonly [{
|
|
20
|
+
readonly locale: "zh";
|
|
21
|
+
readonly message: string;
|
|
22
|
+
}, ...{
|
|
23
|
+
readonly locale: "en" | "ja" | "ko";
|
|
24
|
+
readonly message: string;
|
|
25
|
+
}[]] | undefined;
|
|
26
|
+
readonly compatibilityDate: "2026-05-25";
|
|
27
|
+
readonly items: readonly {
|
|
28
|
+
readonly label: readonly [{
|
|
29
|
+
readonly locale: "zh";
|
|
30
|
+
readonly message: string;
|
|
31
|
+
}, ...{
|
|
32
|
+
readonly locale: "en" | "ja" | "ko";
|
|
33
|
+
readonly message: string;
|
|
34
|
+
}[]];
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly tooltip?: readonly [{
|
|
37
|
+
readonly locale: "zh";
|
|
38
|
+
readonly message: string;
|
|
39
|
+
}, ...{
|
|
40
|
+
readonly locale: "en" | "ja" | "ko";
|
|
41
|
+
readonly message: string;
|
|
42
|
+
}[]] | undefined;
|
|
43
|
+
readonly value: {
|
|
44
|
+
readonly value: string;
|
|
45
|
+
readonly kind: "text";
|
|
46
|
+
} | {
|
|
47
|
+
readonly value: number;
|
|
48
|
+
readonly kind: "number";
|
|
49
|
+
};
|
|
50
|
+
}[];
|
|
51
|
+
readonly groupId?: string | undefined;
|
|
52
|
+
readonly placeholder?: readonly [{
|
|
53
|
+
readonly locale: "zh";
|
|
54
|
+
readonly message: string;
|
|
55
|
+
}, ...{
|
|
56
|
+
readonly locale: "en" | "ja" | "ko";
|
|
57
|
+
readonly message: string;
|
|
58
|
+
}[]] | undefined;
|
|
59
|
+
readonly readonly?: string | undefined;
|
|
60
|
+
readonly grow?: boolean | undefined;
|
|
61
|
+
readonly binding: string;
|
|
62
|
+
readonly derived?: {
|
|
63
|
+
readonly mode: "formula" | "prefill";
|
|
64
|
+
readonly expression: string;
|
|
65
|
+
} | undefined;
|
|
66
|
+
readonly enableSorting?: boolean | undefined;
|
|
67
|
+
}) => any;
|
|
68
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
69
|
+
"onUpdate:modelValue"?: ((value: {
|
|
70
|
+
readonly size?: number | undefined;
|
|
71
|
+
readonly disabled?: string | undefined;
|
|
72
|
+
readonly type: "com.shwfed.table.column.combobox-multi";
|
|
73
|
+
readonly id: string;
|
|
74
|
+
readonly title: readonly [{
|
|
75
|
+
readonly locale: "zh";
|
|
76
|
+
readonly message: string;
|
|
77
|
+
}, ...{
|
|
78
|
+
readonly locale: "en" | "ja" | "ko";
|
|
79
|
+
readonly message: string;
|
|
80
|
+
}[]];
|
|
81
|
+
readonly hidden?: string | undefined;
|
|
82
|
+
readonly tooltip?: readonly [{
|
|
83
|
+
readonly locale: "zh";
|
|
84
|
+
readonly message: string;
|
|
85
|
+
}, ...{
|
|
86
|
+
readonly locale: "en" | "ja" | "ko";
|
|
87
|
+
readonly message: string;
|
|
88
|
+
}[]] | undefined;
|
|
89
|
+
readonly compatibilityDate: "2026-05-25";
|
|
90
|
+
readonly items: readonly {
|
|
91
|
+
readonly label: readonly [{
|
|
92
|
+
readonly locale: "zh";
|
|
93
|
+
readonly message: string;
|
|
94
|
+
}, ...{
|
|
95
|
+
readonly locale: "en" | "ja" | "ko";
|
|
96
|
+
readonly message: string;
|
|
97
|
+
}[]];
|
|
98
|
+
readonly id: string;
|
|
99
|
+
readonly tooltip?: readonly [{
|
|
100
|
+
readonly locale: "zh";
|
|
101
|
+
readonly message: string;
|
|
102
|
+
}, ...{
|
|
103
|
+
readonly locale: "en" | "ja" | "ko";
|
|
104
|
+
readonly message: string;
|
|
105
|
+
}[]] | undefined;
|
|
106
|
+
readonly value: {
|
|
107
|
+
readonly value: string;
|
|
108
|
+
readonly kind: "text";
|
|
109
|
+
} | {
|
|
110
|
+
readonly value: number;
|
|
111
|
+
readonly kind: "number";
|
|
112
|
+
};
|
|
113
|
+
}[];
|
|
114
|
+
readonly groupId?: string | undefined;
|
|
115
|
+
readonly placeholder?: readonly [{
|
|
116
|
+
readonly locale: "zh";
|
|
117
|
+
readonly message: string;
|
|
118
|
+
}, ...{
|
|
119
|
+
readonly locale: "en" | "ja" | "ko";
|
|
120
|
+
readonly message: string;
|
|
121
|
+
}[]] | undefined;
|
|
122
|
+
readonly readonly?: string | undefined;
|
|
123
|
+
readonly grow?: boolean | undefined;
|
|
124
|
+
readonly binding: string;
|
|
125
|
+
readonly derived?: {
|
|
126
|
+
readonly mode: "formula" | "prefill";
|
|
127
|
+
readonly expression: string;
|
|
128
|
+
} | undefined;
|
|
129
|
+
readonly enableSorting?: boolean | undefined;
|
|
130
|
+
}) => any) | undefined;
|
|
131
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
132
|
+
declare const _default: typeof __VLS_export;
|
|
133
|
+
export default _default;
|