@shwfed/config 2.3.17 → 2.3.19

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 (80) hide show
  1. package/dist/mcp.mjs +1171 -601
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{config-CAUy5OIr.js → config-B8qIrXw4.js} +1 -1
  4. package/dist/preview/assets/{config-B_D_DLrg.js → config-BERbwRqR.js} +1 -1
  5. package/dist/preview/assets/{config-CDcbWHz1.js → config-BQDXm2N4.js} +1 -1
  6. package/dist/preview/assets/{config-CAzy2oY1.js → config-BZrnB31E.js} +1 -1
  7. package/dist/preview/assets/{config-lCt8xg5R.js → config-BfiDa6j3.js} +1 -1
  8. package/dist/preview/assets/{config-DkE2KJox.js → config-BmzbCaL9.js} +1 -1
  9. package/dist/preview/assets/config-CI4d63Pa.js +1 -0
  10. package/dist/preview/assets/{config-D9wKVRfv.js → config-CrffMahT.js} +1 -1
  11. package/dist/preview/assets/{config-DReApS3g.js → config-RIqYuUkC.js} +1 -1
  12. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-CvzBdDHI.js → definition.vue_vue_type_script_setup_true_lang-DP6_YUR7.js} +1 -1
  13. package/dist/preview/assets/index-CT6yD2gM.js +1 -0
  14. package/dist/preview/assets/{index-BUyz4nJb.css → index-DomLsyPH.css} +1 -1
  15. package/dist/preview/assets/index-X6To2gmZ.js +643 -0
  16. package/dist/preview/assets/{runtime-CNI--nfZ.js → runtime-BQsuM5NY.js} +1 -1
  17. package/dist/preview/assets/{runtime-eRS_ur88.js → runtime-CKWbV48T.js} +1 -1
  18. package/dist/preview/assets/{runtime-Dg8BS7Rt.js → runtime-CQPoA4Wr.js} +1 -1
  19. package/dist/preview/assets/runtime-CpsOFZJU.js +1 -0
  20. package/dist/preview/assets/{runtime-C7iG_6_s.js → runtime-DLe-_bzP.js} +1 -1
  21. package/dist/preview/assets/runtime-DY65pO8M.js +1 -0
  22. package/dist/preview/assets/runtime-DyCSllvl.js +1 -0
  23. package/dist/preview/assets/runtime-ZprvETkX.js +1 -0
  24. package/dist/preview/assets/runtime-pkc99x6z.js +1 -0
  25. package/dist/preview/index.html +2 -2
  26. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.d.vue.ts +27 -0
  27. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.vue +68 -0
  28. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.vue.d.ts +27 -0
  29. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/runtime.d.vue.ts +8 -0
  30. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/runtime.vue +52 -0
  31. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/runtime.vue.d.ts +8 -0
  32. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/schema.d.ts +18 -0
  33. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/schema.js +35 -0
  34. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.d.vue.ts +107 -0
  35. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.vue +493 -0
  36. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.vue.d.ts +107 -0
  37. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/runtime.d.vue.ts +8 -0
  38. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/runtime.vue +123 -0
  39. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/runtime.vue.d.ts +8 -0
  40. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.d.ts +79 -0
  41. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.js +78 -0
  42. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +125 -0
  43. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue +645 -0
  44. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +125 -0
  45. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/runtime.d.vue.ts +8 -0
  46. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/runtime.vue +155 -0
  47. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/runtime.vue.d.ts +8 -0
  48. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.d.ts +90 -0
  49. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.js +100 -0
  50. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +109 -0
  51. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue +426 -0
  52. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +109 -0
  53. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/runtime.d.vue.ts +9 -0
  54. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/runtime.vue +337 -0
  55. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/runtime.vue.d.ts +9 -0
  56. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.d.ts +85 -0
  57. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.js +146 -0
  58. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +137 -0
  59. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue +586 -0
  60. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +137 -0
  61. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/runtime.d.vue.ts +9 -0
  62. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/runtime.vue +268 -0
  63. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/runtime.vue.d.ts +9 -0
  64. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.d.ts +126 -0
  65. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.js +124 -0
  66. package/dist/runtime/components/table/config.vue +3 -0
  67. package/dist/runtime/components/table/index.vue +2 -0
  68. package/dist/runtime/components/table/utils/shared-fetch.d.ts +30 -0
  69. package/dist/runtime/components/table/utils/shared-fetch.js +42 -0
  70. package/dist/runtime/components/ui/calendar/Calendar.vue +9 -4
  71. package/dist/runtime/components/ui/date-range-picker/DateRangePickerMonthPanel.vue +4 -1
  72. package/dist/runtime/components/ui/date-range-picker/DateRangePickerYearPanel.vue +4 -1
  73. package/dist/runtime/components/ui/range-calendar/RangeCalendar.vue +3 -1
  74. package/package.json +1 -1
  75. package/dist/preview/assets/index-DOUzPsqV.js +0 -639
  76. package/dist/preview/assets/index-DUZhCCDY.js +0 -1
  77. package/dist/preview/assets/runtime-CEymLc8o.js +0 -1
  78. package/dist/preview/assets/runtime-CWwZuZQ7.js +0 -1
  79. package/dist/preview/assets/runtime-Dj39BqNd.js +0 -1
  80. package/dist/preview/assets/runtime-TUjKxXEj.js +0 -1
@@ -0,0 +1,137 @@
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 onChange?: string | undefined;
9
+ readonly disabled?: string | undefined;
10
+ readonly type: "com.shwfed.table.column.combobox-single.remote.options-static";
11
+ readonly id: string;
12
+ readonly title: readonly [{
13
+ readonly locale: "zh";
14
+ readonly message: string;
15
+ }, ...{
16
+ readonly locale: "en" | "ja" | "ko";
17
+ readonly message: string;
18
+ }[]];
19
+ readonly hidden?: string | undefined;
20
+ readonly tooltip?: readonly [{
21
+ readonly locale: "zh";
22
+ readonly message: string;
23
+ }, ...{
24
+ readonly locale: "en" | "ja" | "ko";
25
+ readonly message: string;
26
+ }[]] | undefined;
27
+ readonly compatibilityDate: "2026-05-24";
28
+ readonly items: readonly {
29
+ readonly label: readonly [{
30
+ readonly locale: "zh";
31
+ readonly message: string;
32
+ }, ...{
33
+ readonly locale: "en" | "ja" | "ko";
34
+ readonly message: string;
35
+ }[]];
36
+ readonly id: string;
37
+ readonly tooltip?: readonly [{
38
+ readonly locale: "zh";
39
+ readonly message: string;
40
+ }, ...{
41
+ readonly locale: "en" | "ja" | "ko";
42
+ readonly message: string;
43
+ }[]] | undefined;
44
+ readonly value: {
45
+ readonly value: string;
46
+ readonly kind: "text";
47
+ } | {
48
+ readonly value: number;
49
+ readonly kind: "number";
50
+ };
51
+ }[];
52
+ readonly triggers?: readonly {
53
+ readonly target: string;
54
+ readonly operation: string;
55
+ }[] | undefined;
56
+ readonly groupId?: string | undefined;
57
+ readonly placeholder?: readonly [{
58
+ readonly locale: "zh";
59
+ readonly message: string;
60
+ }, ...{
61
+ readonly locale: "en" | "ja" | "ko";
62
+ readonly message: string;
63
+ }[]] | undefined;
64
+ readonly readonly?: string | undefined;
65
+ readonly grow?: boolean | undefined;
66
+ readonly accessor: string;
67
+ readonly enableSorting?: boolean | undefined;
68
+ readonly successMessage?: string | undefined;
69
+ }) => any;
70
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
71
+ "onUpdate:modelValue"?: ((value: {
72
+ readonly size?: number | undefined;
73
+ readonly onChange?: string | undefined;
74
+ readonly disabled?: string | undefined;
75
+ readonly type: "com.shwfed.table.column.combobox-single.remote.options-static";
76
+ readonly id: string;
77
+ readonly title: readonly [{
78
+ readonly locale: "zh";
79
+ readonly message: string;
80
+ }, ...{
81
+ readonly locale: "en" | "ja" | "ko";
82
+ readonly message: string;
83
+ }[]];
84
+ readonly hidden?: string | undefined;
85
+ readonly tooltip?: readonly [{
86
+ readonly locale: "zh";
87
+ readonly message: string;
88
+ }, ...{
89
+ readonly locale: "en" | "ja" | "ko";
90
+ readonly message: string;
91
+ }[]] | undefined;
92
+ readonly compatibilityDate: "2026-05-24";
93
+ readonly items: readonly {
94
+ readonly label: readonly [{
95
+ readonly locale: "zh";
96
+ readonly message: string;
97
+ }, ...{
98
+ readonly locale: "en" | "ja" | "ko";
99
+ readonly message: string;
100
+ }[]];
101
+ readonly id: string;
102
+ readonly tooltip?: readonly [{
103
+ readonly locale: "zh";
104
+ readonly message: string;
105
+ }, ...{
106
+ readonly locale: "en" | "ja" | "ko";
107
+ readonly message: string;
108
+ }[]] | undefined;
109
+ readonly value: {
110
+ readonly value: string;
111
+ readonly kind: "text";
112
+ } | {
113
+ readonly value: number;
114
+ readonly kind: "number";
115
+ };
116
+ }[];
117
+ readonly triggers?: readonly {
118
+ readonly target: string;
119
+ readonly operation: string;
120
+ }[] | undefined;
121
+ readonly groupId?: string | undefined;
122
+ readonly placeholder?: readonly [{
123
+ readonly locale: "zh";
124
+ readonly message: string;
125
+ }, ...{
126
+ readonly locale: "en" | "ja" | "ko";
127
+ readonly message: string;
128
+ }[]] | undefined;
129
+ readonly readonly?: string | undefined;
130
+ readonly grow?: boolean | undefined;
131
+ readonly accessor: string;
132
+ readonly enableSorting?: boolean | undefined;
133
+ readonly successMessage?: string | undefined;
134
+ }) => any) | undefined;
135
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
136
+ declare const _default: typeof __VLS_export;
137
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import type { CellContext } from '@tanstack/vue-table';
2
+ import type { Value } from './schema.js';
3
+ type __VLS_Props = {
4
+ column: Value;
5
+ ctx: CellContext<unknown, unknown>;
6
+ };
7
+ 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>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
@@ -0,0 +1,268 @@
1
+ <script setup>
2
+ import { Icon } from "@iconify/vue";
3
+ import { Effect } from "effect";
4
+ import { Fetch } from "fx-fetch";
5
+ import { toast } from "vue-sonner";
6
+ import { computed, nextTick, ref, watch } from "vue";
7
+ import { useI18n } from "vue-i18n";
8
+ import { cel as _rawCel } from "../../../../../utils/cel";
9
+ import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
10
+ import { getLocalizedText } from "../../../../../share/locale";
11
+ import { dispatchTriggers, useEventChannel } from "../../../../../share/event-bus";
12
+ import {
13
+ Command,
14
+ CommandEmpty,
15
+ CommandGroup,
16
+ CommandInput,
17
+ CommandItem,
18
+ CommandList
19
+ } from "../../../../ui/command";
20
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../../../../ui/input-group";
21
+ import { Markdown } from "../../../../ui/markdown";
22
+ import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "../../../../ui/popover";
23
+ import { interpolateMarkdown } from "../../../utils/runtime";
24
+ defineOptions({ name: "ShwfedTableComboboxSingleRemoteOptionsStaticRuntime" });
25
+ const props = defineProps({
26
+ column: { type: null, required: true },
27
+ ctx: { type: Object, required: true }
28
+ });
29
+ const { locale, t } = useI18n({
30
+ inheritLocale: true,
31
+ messages: {
32
+ zh: {
33
+ "combobox-single-placeholder": "\u8BF7\u9009\u62E9",
34
+ "combobox-single-search-placeholder": "\u641C\u7D22\u2026",
35
+ "combobox-single-empty": "\u65E0\u5339\u914D\u9879"
36
+ },
37
+ en: {
38
+ "combobox-single-placeholder": "Select\u2026",
39
+ "combobox-single-search-placeholder": "Search\u2026",
40
+ "combobox-single-empty": "No matches"
41
+ },
42
+ ja: {
43
+ "combobox-single-placeholder": "\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",
44
+ "combobox-single-search-placeholder": "\u691C\u7D22\u2026",
45
+ "combobox-single-empty": "\u4E00\u81F4\u306A\u3057"
46
+ }
47
+ }
48
+ });
49
+ const inherited = injectCELContext();
50
+ const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
51
+ const eventChannel = useEventChannel();
52
+ const placeholderText = computed(
53
+ () => props.column.placeholder ? getLocalizedText(props.column.placeholder, locale.value) : t("combobox-single-placeholder")
54
+ );
55
+ function evalBool(expression, label) {
56
+ if (!expression) return false;
57
+ try {
58
+ return Effect.runSync($cel(expression)) === true;
59
+ } catch (e) {
60
+ console.error(`[shwfed-table] combobox-single.remote.options-static ${label} failed`, e);
61
+ return false;
62
+ }
63
+ }
64
+ const isHidden = computed(() => evalBool(props.column.hidden, "hidden"));
65
+ const isDisabledByConfig = computed(() => evalBool(props.column.disabled, "disabled"));
66
+ const isReadonly = computed(() => evalBool(props.column.readonly, "readonly"));
67
+ const isInteractive = computed(() => !!props.column.onChange);
68
+ const pending = ref(false);
69
+ function safeInterpolate(tpl) {
70
+ try {
71
+ return interpolateMarkdown(tpl, $cel, {});
72
+ } catch (e) {
73
+ console.error("[shwfed-table] combobox-single.remote.options-static label interpolation failed", e);
74
+ return tpl;
75
+ }
76
+ }
77
+ const entries = computed(
78
+ () => (props.column.items ?? []).map((item) => {
79
+ const labelTpl = getLocalizedText(item.label, locale.value) ?? "";
80
+ const tooltipTpl = item.tooltip ? getLocalizedText(item.tooltip, locale.value) : void 0;
81
+ return {
82
+ key: item.id,
83
+ value: item.value.value,
84
+ label: labelTpl ? safeInterpolate(labelTpl) : "",
85
+ tooltip: tooltipTpl ? safeInterpolate(tooltipTpl) : void 0
86
+ };
87
+ })
88
+ );
89
+ const cellValue = computed(() => props.ctx.cell.getValue());
90
+ function isEqual(a, b) {
91
+ if (a === b) return true;
92
+ if (a == null || b == null) return false;
93
+ if (typeof a === "object" && typeof b === "object") {
94
+ try {
95
+ return JSON.stringify(a) === JSON.stringify(b);
96
+ } catch {
97
+ return false;
98
+ }
99
+ }
100
+ return false;
101
+ }
102
+ const selectedEntry = computed(
103
+ () => entries.value.find((entry) => isEqual(entry.value, cellValue.value))
104
+ );
105
+ const selectedKey = computed(() => selectedEntry.value?.key);
106
+ const selectedLabel = computed(() => selectedEntry.value?.label ?? "");
107
+ const open = ref(false);
108
+ const isDisabled = computed(
109
+ () => !isInteractive.value || isDisabledByConfig.value || pending.value
110
+ );
111
+ async function submit(next) {
112
+ const { onChange, successMessage } = props.column;
113
+ if (!onChange) return;
114
+ pending.value = true;
115
+ const program = Effect.gen(function* () {
116
+ const builder = yield* $cel(onChange, { value: next });
117
+ return yield* builder.json();
118
+ });
119
+ try {
120
+ const body = await Effect.runPromise(Effect.provide(program, Fetch.layer));
121
+ if (successMessage) {
122
+ try {
123
+ const message = Effect.runSync($cel(successMessage, { json: body }));
124
+ if (message) toast.success(message);
125
+ } catch (e) {
126
+ console.error("[shwfed-table] combobox-single.remote.options-static successMessage failed", e);
127
+ }
128
+ }
129
+ await Effect.runPromise(dispatchTriggers(eventChannel, props.column.triggers));
130
+ } catch (e) {
131
+ console.error("[shwfed-table] combobox-single.remote.options-static onChange failed", e);
132
+ toast.error("\u8BF7\u6C42\u5931\u8D25");
133
+ } finally {
134
+ pending.value = false;
135
+ }
136
+ }
137
+ function handleSelect(key) {
138
+ if (typeof key !== "string") return;
139
+ const entry = entries.value.find((e) => e.key === key);
140
+ if (!entry) return;
141
+ void nextTick().then(() => {
142
+ open.value = false;
143
+ });
144
+ void submit(entry.value);
145
+ }
146
+ const showClear = computed(
147
+ () => !isDisabled.value && selectedEntry.value !== void 0
148
+ );
149
+ function handleClear() {
150
+ open.value = false;
151
+ void submit(null);
152
+ }
153
+ const hoveredKey = ref(null);
154
+ watch(open, (isOpen) => {
155
+ hoveredKey.value = isOpen ? entries.value[0]?.key ?? null : null;
156
+ });
157
+ const hoveredEntry = computed(
158
+ () => entries.value.find((e) => e.key === hoveredKey.value)
159
+ );
160
+ const hoveredTooltip = computed(() => hoveredEntry.value?.tooltip);
161
+ const anyHasTooltip = computed(
162
+ () => entries.value.some((e) => e.tooltip != null && e.tooltip.length > 0)
163
+ );
164
+ </script>
165
+
166
+ <template>
167
+ <div class="p-[0.125rem] w-full">
168
+ <span
169
+ v-if="isHidden"
170
+ class="block h-7 w-full"
171
+ />
172
+ <span
173
+ v-else-if="isReadonly || !isInteractive"
174
+ class="flex items-center h-7 w-full px-2 text-[0.75rem] text-zinc-700 truncate"
175
+ >
176
+ {{ selectedLabel || "\u2014" }}
177
+ </span>
178
+ <Popover
179
+ v-else
180
+ v-model:open="open"
181
+ >
182
+ <PopoverAnchor as-child>
183
+ <InputGroup
184
+ class="group/combobox-single h-7 rounded border-zinc-200/30 hover:border-zinc-200 focus-within:border-zinc-200 transition-colors ease-out duration-180"
185
+ :data-disabled="isDisabled ? 'true' : void 0"
186
+ >
187
+ <PopoverTrigger as-child>
188
+ <InputGroupInput
189
+ :model-value="selectedLabel"
190
+ :disabled="isDisabled"
191
+ :placeholder="placeholderText"
192
+ class="h-7 text-[0.75rem] md:text-[0.75rem] px-2 cursor-pointer text-left"
193
+ readonly
194
+ />
195
+ </PopoverTrigger>
196
+ <InputGroupAddon
197
+ v-if="pending"
198
+ align="inline-end"
199
+ class="text-zinc-400"
200
+ >
201
+ <Icon
202
+ icon="fluent:spinner-ios-20-regular"
203
+ class="size-3 animate-spin"
204
+ />
205
+ </InputGroupAddon>
206
+ <InputGroupAddon
207
+ v-else-if="showClear"
208
+ align="inline-end"
209
+ class="[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-single:opacity-100 focus-within:opacity-100"
210
+ >
211
+ <InputGroupButton
212
+ size="icon-xs"
213
+ data-slot="combobox-single-clear"
214
+ class="size-4 text-zinc-500 hover:text-zinc-700"
215
+ tabindex="-1"
216
+ @mousedown.prevent
217
+ @click.stop="handleClear"
218
+ >
219
+ <Icon
220
+ icon="fluent:dismiss-20-regular"
221
+ class="size-3"
222
+ />
223
+ </InputGroupButton>
224
+ </InputGroupAddon>
225
+ </InputGroup>
226
+ </PopoverAnchor>
227
+ <PopoverContent
228
+ class="w-auto p-0 [&_[data-slot=command-input-wrapper]]:h-7 [&_[data-slot=command-input-wrapper]]:px-2 [&_[data-slot=command-input-wrapper]_svg]:size-3 [&_[data-slot=command-input]]:h-7 [&_[data-slot=command-input]]:py-0 [&_[data-slot=command-input]]:text-[0.75rem] [&_[data-slot=command-item]]:px-2 [&_[data-slot=command-item]]:py-1 [&_[data-slot=command-item]]:text-[0.75rem]"
229
+ :style="{ width: 'var(--reka-popover-trigger-width)' }"
230
+ >
231
+ <Command
232
+ :model-value="selectedKey"
233
+ :disabled="isDisabled"
234
+ selection-behavior="toggle"
235
+ @update:model-value="handleSelect"
236
+ >
237
+ <CommandInput :placeholder="t('combobox-single-search-placeholder')" />
238
+ <CommandList>
239
+ <CommandEmpty class="py-3 text-center text-[0.75rem] text-zinc-500">
240
+ {{ t("combobox-single-empty") }}
241
+ </CommandEmpty>
242
+ <CommandGroup>
243
+ <CommandItem
244
+ v-for="entry in entries"
245
+ :key="entry.key"
246
+ :value="entry.key"
247
+ @mouseenter="hoveredKey = entry.key"
248
+ @focus="hoveredKey = entry.key"
249
+ >
250
+ {{ entry.label }}
251
+ </CommandItem>
252
+ </CommandGroup>
253
+ </CommandList>
254
+ <div
255
+ v-if="anyHasTooltip && hoveredTooltip"
256
+ class="border-t border-zinc-200 px-2 py-1.5"
257
+ >
258
+ <Markdown
259
+ :source="hoveredTooltip"
260
+ block
261
+ class="prose prose-xs prose-zinc"
262
+ />
263
+ </div>
264
+ </Command>
265
+ </PopoverContent>
266
+ </Popover>
267
+ </div>
268
+ </template>
@@ -0,0 +1,9 @@
1
+ import type { CellContext } from '@tanstack/vue-table';
2
+ import type { Value } from './schema.js';
3
+ type __VLS_Props = {
4
+ column: Value;
5
+ ctx: CellContext<unknown, unknown>;
6
+ };
7
+ 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>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
@@ -0,0 +1,126 @@
1
+ import { Schema } from 'effect';
2
+ import type { ColumnDef } from '@tanstack/vue-table';
3
+ import type { Environment } from '../../../../../vendor/cel-js/lib/index.js';
4
+ import type { ColumnDefDeps } from '../../../utils/resolve.js';
5
+ export declare const type: "com.shwfed.table.column.combobox-single.remote.options-static";
6
+ export declare const compatibilityDate: "2026-05-24";
7
+ export declare const metadata: {
8
+ readonly name: "下拉单选(远程·静态选项)";
9
+ readonly icon: "fluent:chevron-down-20-regular";
10
+ };
11
+ export declare function itemSchema(configure: (env: Environment) => void): Schema.Struct<{
12
+ id: Schema.refine<string, typeof Schema.String>;
13
+ label: Schema.refine<readonly [{
14
+ readonly locale: "zh";
15
+ readonly message: string;
16
+ }, ...{
17
+ readonly locale: "en" | "ja" | "ko";
18
+ readonly message: string;
19
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
20
+ locale: Schema.Literal<["zh"]>;
21
+ message: Schema.SchemaClass<string, string, never>;
22
+ }>], [Schema.Struct<{
23
+ locale: Schema.Literal<["ja", "en", "ko"]>;
24
+ message: Schema.SchemaClass<string, string, never>;
25
+ }>]>>;
26
+ value: Schema.Union<[Schema.Struct<{
27
+ kind: Schema.Literal<["text"]>;
28
+ value: typeof Schema.String;
29
+ }>, Schema.Struct<{
30
+ kind: Schema.Literal<["number"]>;
31
+ value: typeof Schema.Number;
32
+ }>]>;
33
+ tooltip: Schema.optional<Schema.refine<readonly [{
34
+ readonly locale: "zh";
35
+ readonly message: string;
36
+ }, ...{
37
+ readonly locale: "en" | "ja" | "ko";
38
+ readonly message: string;
39
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
40
+ locale: Schema.Literal<["zh"]>;
41
+ message: Schema.SchemaClass<string, string, never>;
42
+ }>], [Schema.Struct<{
43
+ locale: Schema.Literal<["ja", "en", "ko"]>;
44
+ message: Schema.SchemaClass<string, string, never>;
45
+ }>]>>>;
46
+ }>;
47
+ export declare function schema(configure: (env: Environment) => void): Schema.Struct<{
48
+ placeholder: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
49
+ locale: Schema.Literal<["zh"]>;
50
+ message: Schema.SchemaClass<string, string, never>;
51
+ }>], [Schema.Struct<{
52
+ locale: Schema.Literal<["ja", "en", "ko"]>;
53
+ message: Schema.SchemaClass<string, string, never>;
54
+ }>]>>;
55
+ hidden: Schema.optional<Schema.Schema<string, string, never>>;
56
+ disabled: Schema.optional<Schema.Schema<string, string, never>>;
57
+ readonly: Schema.optional<Schema.Schema<string, string, never>>;
58
+ items: Schema.optionalWith<Schema.Array$<Schema.Struct<{
59
+ id: Schema.refine<string, typeof Schema.String>;
60
+ label: Schema.refine<readonly [{
61
+ readonly locale: "zh";
62
+ readonly message: string;
63
+ }, ...{
64
+ readonly locale: "en" | "ja" | "ko";
65
+ readonly message: string;
66
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
67
+ locale: Schema.Literal<["zh"]>;
68
+ message: Schema.SchemaClass<string, string, never>;
69
+ }>], [Schema.Struct<{
70
+ locale: Schema.Literal<["ja", "en", "ko"]>;
71
+ message: Schema.SchemaClass<string, string, never>;
72
+ }>]>>;
73
+ value: Schema.Union<[Schema.Struct<{
74
+ kind: Schema.Literal<["text"]>;
75
+ value: typeof Schema.String;
76
+ }>, Schema.Struct<{
77
+ kind: Schema.Literal<["number"]>;
78
+ value: typeof Schema.Number;
79
+ }>]>;
80
+ tooltip: Schema.optional<Schema.refine<readonly [{
81
+ readonly locale: "zh";
82
+ readonly message: string;
83
+ }, ...{
84
+ readonly locale: "en" | "ja" | "ko";
85
+ readonly message: string;
86
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
87
+ locale: Schema.Literal<["zh"]>;
88
+ message: Schema.SchemaClass<string, string, never>;
89
+ }>], [Schema.Struct<{
90
+ locale: Schema.Literal<["ja", "en", "ko"]>;
91
+ message: Schema.SchemaClass<string, string, never>;
92
+ }>]>>>;
93
+ }>>, {
94
+ default: () => readonly [];
95
+ }>;
96
+ onChange: Schema.optional<Schema.Schema<string, string, never>>;
97
+ successMessage: Schema.optional<Schema.Schema<string, string, never>>;
98
+ triggers: Schema.optional<Schema.Array$<Schema.Struct<{
99
+ target: Schema.refine<string, typeof Schema.String>;
100
+ operation: Schema.SchemaClass<string, string, never>;
101
+ }>>>;
102
+ title: Schema.TupleType<readonly [Schema.Struct<{
103
+ locale: Schema.Literal<["zh"]>;
104
+ message: Schema.SchemaClass<string, string, never>;
105
+ }>], [Schema.Struct<{
106
+ locale: Schema.Literal<["ja", "en", "ko"]>;
107
+ message: Schema.SchemaClass<string, string, never>;
108
+ }>]>;
109
+ accessor: Schema.Schema<string, string, never>;
110
+ enableSorting: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
111
+ size: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
112
+ grow: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
113
+ tooltip: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
114
+ locale: Schema.Literal<["zh"]>;
115
+ message: Schema.SchemaClass<string, string, never>;
116
+ }>], [Schema.Struct<{
117
+ locale: Schema.Literal<["ja", "en", "ko"]>;
118
+ message: Schema.SchemaClass<string, string, never>;
119
+ }>]>>;
120
+ id: Schema.refine<string, typeof Schema.String>;
121
+ groupId: Schema.optional<typeof Schema.UUID>;
122
+ type: Schema.Literal<["com.shwfed.table.column.combobox-single.remote.options-static"]>;
123
+ compatibilityDate: Schema.Literal<["2026-05-24"]>;
124
+ }>;
125
+ export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
126
+ export declare function toColumnDef(value: Value, { getLocaleText, $cel, inheritedContext }: ColumnDefDeps): Partial<ColumnDef<unknown, unknown>>;
@@ -0,0 +1,124 @@
1
+ import { Effect, Schema } from "effect";
2
+ import { Locale } from "../../../../../share/locale.js";
3
+ import { Expression } from "../../../../../share/expression.js";
4
+ import { Triggers } from "../../../../../share/event-bus.js";
5
+ import {
6
+ CelRowAccess,
7
+ columnFields,
8
+ LocaleMarkdownWithRow,
9
+ registerRowVariablesIfAbsent
10
+ } from "../../../utils/shared.js";
11
+ export const type = "com.shwfed.table.column.combobox-single.remote.options-static";
12
+ export const compatibilityDate = "2026-05-24";
13
+ export const metadata = {
14
+ name: "\u4E0B\u62C9\u5355\u9009\uFF08\u8FDC\u7A0B\xB7\u9759\u6001\u9009\u9879\uFF09",
15
+ icon: "fluent:chevron-down-20-regular"
16
+ };
17
+ export function itemSchema(configure) {
18
+ const LocaleMd = LocaleMarkdownWithRow(configure);
19
+ const TextValue = Schema.Struct({
20
+ kind: Schema.Literal("text"),
21
+ value: Schema.String
22
+ });
23
+ const NumberValue = Schema.Struct({
24
+ kind: Schema.Literal("number"),
25
+ value: Schema.Number
26
+ });
27
+ const ItemValue = Schema.Union(TextValue, NumberValue).annotations({
28
+ title: "\u503C",
29
+ description: "\u9009\u9879\u7ED1\u5B9A\u7684\u503C\uFF0C\u53EF\u4EE5\u662F\u6587\u672C\u6216\u6570\u5B57"
30
+ });
31
+ return Schema.Struct({
32
+ id: Schema.UUID.annotations({ description: "\u9009\u9879\u552F\u4E00\u6807\u8BC6\uFF0C\u7528\u4E8E\u7A33\u5B9A\u7684 v-for key" }),
33
+ label: LocaleMd.annotations({
34
+ title: "\u6807\u7B7E",
35
+ description: "\u9009\u9879\u5C55\u793A\u7684\u672C\u5730\u5316\u6587\u672C\uFF0C\u652F\u6301 Markdown \u4E0E `{{ row.foo }}` / `{{ form.bar }}` \u63D2\u503C"
36
+ }),
37
+ value: ItemValue,
38
+ tooltip: Schema.optional(LocaleMd.annotations({
39
+ title: "\u63D0\u793A",
40
+ description: "\u9F20\u6807\u60AC\u505C\u5728\u9009\u9879\u4E0A\u65F6\u5C55\u793A\u7684\u672C\u5730\u5316\u63D0\u793A\uFF0C\u652F\u6301 Markdown"
41
+ }))
42
+ }).annotations({
43
+ title: "ComboboxSingleRemoteOptionsStaticItem"
44
+ });
45
+ }
46
+ export function schema(configure) {
47
+ const CelBool = CelRowAccess(configure, { resultType: "bool" });
48
+ const Item = itemSchema(configure);
49
+ const CelOnChange = Expression({
50
+ configure: (env) => {
51
+ configure(env);
52
+ registerRowVariablesIfAbsent(env);
53
+ env.registerVariable("value", "dyn", { description: "\u7528\u6237\u9009\u4E2D\u7684\u65B0\u503C\uFF08\u4E0E\u6240\u9009\u9879\u7684 `value` \u4E00\u81F4\uFF1B\u6E05\u7A7A\u65F6\u4E3A `null`\uFF09" });
54
+ },
55
+ resultType: "HttpRequest"
56
+ });
57
+ const CelMessage = Expression({
58
+ configure: (env) => {
59
+ configure(env);
60
+ env.registerVariable("json", "dyn", { description: "HTTP \u54CD\u5E94\u4F53\uFF08\u5DF2\u89E3\u6790 JSON\uFF09" });
61
+ },
62
+ resultType: "string"
63
+ });
64
+ return Schema.Struct({
65
+ type: Schema.Literal(type),
66
+ compatibilityDate: Schema.Literal(compatibilityDate),
67
+ ...columnFields(configure),
68
+ placeholder: Schema.optional(Locale.annotations({
69
+ title: "\u5360\u4F4D\u7B26",
70
+ description: "\u672A\u9009\u4E2D\u4EFB\u4F55\u9009\u9879\u65F6\u8F93\u5165\u6846\u4E2D\u7684\u5360\u4F4D\u6587\u672C"
71
+ })),
72
+ hidden: Schema.optional(CelBool.annotations({
73
+ title: "\u9690\u85CF\u6761\u4EF6",
74
+ description: "\u8FD4\u56DE `true` \u65F6\u8BE5\u884C\u7684\u4E0B\u62C9\u6846\u4E0D\u6E32\u67D3\uFF08\u5176\u4F59\u884C\u4E0D\u53D7\u5F71\u54CD\uFF09"
75
+ })),
76
+ disabled: Schema.optional(CelBool.annotations({
77
+ title: "\u7981\u7528\u6761\u4EF6",
78
+ description: "\u8FD4\u56DE `true` \u65F6\u4E0B\u62C9\u6846\u4ECD\u7136\u6E32\u67D3\u4F46\u4E0D\u53EF\u9009\u62E9"
79
+ })),
80
+ readonly: Schema.optional(CelBool.annotations({
81
+ title: "\u53EA\u8BFB\u6761\u4EF6",
82
+ description: "\u8FD4\u56DE `true` \u65F6\u4EC5\u4EE5\u7EAF\u6587\u672C\u5C55\u793A\u5F53\u524D\u9009\u9879\u7684\u6807\u7B7E"
83
+ })),
84
+ items: Schema.optionalWith(Schema.Array(Item).annotations({
85
+ title: "\u9009\u9879",
86
+ description: "\u4E0B\u62C9\u6846\u53EF\u9009\u9879\u5217\u8868"
87
+ }), { default: () => [] }),
88
+ onChange: Schema.optional(CelOnChange.annotations({
89
+ title: "\u5207\u6362\u8BF7\u6C42",
90
+ description: "\u7528\u6237\u9009\u62E9\u540E\u7ACB\u5373\u6C42\u503C\u5E76\u53D1\u8D77\u7684 HTTP \u8BF7\u6C42\uFF1B`value` \u4E3A\u65B0\u503C\u3002\u672A\u914D\u7F6E\u65F6\u4E0B\u62C9\u6846\u53EA\u8BFB"
91
+ })),
92
+ successMessage: Schema.optional(CelMessage.annotations({
93
+ title: "\u6210\u529F\u6D88\u606F",
94
+ description: "\u8BF7\u6C42\u6210\u529F\u540E\u5F39\u51FA\u7684 toast \u5185\u5BB9\uFF1B\u672A\u914D\u7F6E\u5219\u9759\u9ED8"
95
+ })),
96
+ triggers: Schema.optional(Triggers.annotations({
97
+ title: "\u6210\u529F\u540E\u89E6\u53D1",
98
+ description: "\u8BF7\u6C42\u6210\u529F\u540E\u6309\u5217\u8868\u987A\u5E8F\u5192\u6CE1\u7684\u64CD\u4F5C\u8BF7\u6C42\uFF1B\u672A\u914D\u7F6E\u5219\u4EC0\u4E48\u90FD\u4E0D\u505A"
99
+ }))
100
+ }).annotations({
101
+ title: "ComboboxSingleRemoteOptionsStaticRenderer",
102
+ description: "\u4E0B\u62C9\u5355\u9009\u6E32\u67D3\u5668\uFF08\u8FDC\u7A0B\u5199\u5165\xB7\u9759\u6001\u9009\u9879\uFF09"
103
+ });
104
+ }
105
+ export function toColumnDef(value, { getLocaleText, $cel, inheritedContext }) {
106
+ return {
107
+ header: getLocaleText(value.title),
108
+ accessorFn: (row, index) => {
109
+ try {
110
+ return Effect.runSync($cel(value.accessor, { ...inheritedContext, row, index }));
111
+ } catch (e) {
112
+ console.error("[shwfed-table] combobox-single.remote.options-static accessor failed", e);
113
+ return void 0;
114
+ }
115
+ },
116
+ enableSorting: value.enableSorting ?? false,
117
+ sortingFn: "basic",
118
+ size: value.size,
119
+ meta: {
120
+ grow: value.grow ?? false,
121
+ tooltip: getLocaleText(value.tooltip)
122
+ }
123
+ };
124
+ }