@shwfed/config 2.3.28 → 2.4.0

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 (146) hide show
  1. package/dist/mcp.mjs +3128 -1272
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{config-CQHS6cZe.js → config-BcQQl4v6.js} +1 -1
  4. package/dist/preview/assets/{config-fvkC2rB8.js → config-BdFIFUa_.js} +1 -1
  5. package/dist/preview/assets/{config-DDfTl9Cs.js → config-Bi9F-Jdh.js} +1 -1
  6. package/dist/preview/assets/{config-CJHPt8Gx.js → config-Bxkq2ZRm.js} +1 -1
  7. package/dist/preview/assets/{config-D0_1yZdF.js → config-C32yfrlg.js} +1 -1
  8. package/dist/preview/assets/{config--PcXQV_r.js → config-CHHX7vhb.js} +1 -1
  9. package/dist/preview/assets/{config-5KVDXgUF.js → config-CZ0f5xdI.js} +1 -1
  10. package/dist/preview/assets/{config-B5avpKJE.js → config-D9xGgFnF.js} +1 -1
  11. package/dist/preview/assets/{config-CNo3isHa.js → config-Ddh8pxIi.js} +1 -1
  12. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-RM-qDh0R.js → definition.vue_vue_type_script_setup_true_lang-C_cjxvm1.js} +1 -1
  13. package/dist/preview/assets/{index-a2QwAots.css → index-BqOX70Hd.css} +1 -1
  14. package/dist/preview/assets/index-D-VR1i8D.js +659 -0
  15. package/dist/preview/assets/index-ihZGlPdX.js +1 -0
  16. package/dist/preview/assets/{runtime-BPjZQmcY.js → runtime-Bn8mqeDH.js} +1 -1
  17. package/dist/preview/assets/{runtime-DcrzodsN.js → runtime-Cc_Wk3o-.js} +1 -1
  18. package/dist/preview/assets/{runtime-BGTWf-O7.js → runtime-CttAjIgg.js} +1 -1
  19. package/dist/preview/assets/{runtime-Dy4ZmQ-n.js → runtime-Cx4f2UTl.js} +1 -1
  20. package/dist/preview/assets/{runtime-CCbyrqQT.js → runtime-D1dESjXR.js} +1 -1
  21. package/dist/preview/assets/{runtime-C_XX6a0C.js → runtime-DIEP1Xbh.js} +1 -1
  22. package/dist/preview/assets/{runtime-CtqwtTE_.js → runtime-DKceWuBx.js} +1 -1
  23. package/dist/preview/assets/{runtime-Dr_10emf.js → runtime-Dhid9O5c.js} +1 -1
  24. package/dist/preview/assets/{runtime-Bq3fmxeF.js → runtime-YMiqi6WY.js} +1 -1
  25. package/dist/preview/index.html +2 -2
  26. package/dist/runtime/components/block-layout-editor/index.d.vue.ts +10 -2
  27. package/dist/runtime/components/block-layout-editor/index.vue +44 -8
  28. package/dist/runtime/components/block-layout-editor/index.vue.d.ts +10 -2
  29. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/config.d.vue.ts +2 -0
  30. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/config.vue.d.ts +2 -0
  31. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/runtime.d.vue.ts +2 -0
  32. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/runtime.vue.d.ts +2 -0
  33. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/schema.d.ts +2 -0
  34. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +2 -0
  35. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +2 -0
  36. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +2 -0
  37. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +2 -0
  38. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +3 -0
  39. package/dist/runtime/components/config/config.vue +35 -0
  40. package/dist/runtime/components/config/use-editor.d.ts +11 -1
  41. package/dist/runtime/components/config/use-editor.js +27 -1
  42. package/dist/runtime/components/form/config.vue +32 -0
  43. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.d.vue.ts +163 -0
  44. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.vue +745 -0
  45. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.vue.d.ts +163 -0
  46. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.d.vue.ts +8 -0
  47. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +383 -0
  48. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue.d.ts +8 -0
  49. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.d.ts +264 -0
  50. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.js +183 -0
  51. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.d.vue.ts +163 -0
  52. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.vue +745 -0
  53. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.vue.d.ts +163 -0
  54. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.d.vue.ts +8 -0
  55. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +402 -0
  56. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue.d.ts +8 -0
  57. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.d.ts +264 -0
  58. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.js +209 -0
  59. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +129 -0
  60. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue +618 -0
  61. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +129 -0
  62. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.d.vue.ts +8 -0
  63. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +501 -0
  64. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue.d.ts +8 -0
  65. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +99 -0
  66. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.js +133 -0
  67. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +127 -0
  68. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue +550 -0
  69. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +127 -0
  70. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.d.vue.ts +8 -0
  71. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +496 -0
  72. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue.d.ts +8 -0
  73. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.d.ts +96 -0
  74. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.js +125 -0
  75. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +133 -0
  76. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue +605 -0
  77. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +133 -0
  78. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.d.vue.ts +8 -0
  79. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +401 -0
  80. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue.d.ts +8 -0
  81. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.d.ts +102 -0
  82. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.js +142 -0
  83. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +131 -0
  84. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue +560 -0
  85. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +131 -0
  86. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.d.vue.ts +8 -0
  87. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +395 -0
  88. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue.d.ts +8 -0
  89. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.d.ts +96 -0
  90. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.js +118 -0
  91. package/dist/runtime/components/form/fields/2026-05-28/tree-combobox-shared.d.ts +35 -0
  92. package/dist/runtime/components/form/fields/2026-05-28/tree-combobox-shared.js +31 -0
  93. package/dist/runtime/components/form/index.vue +7 -5
  94. package/dist/runtime/components/form/schema.d.ts +4 -0
  95. package/dist/runtime/components/form/schema.js +4 -0
  96. package/dist/runtime/components/form/unit-config.vue +45 -1
  97. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/config.vue +0 -22
  98. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/header.vue +3 -15
  99. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.d.ts +0 -1
  100. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.js +0 -4
  101. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +183 -0
  102. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue +931 -0
  103. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +183 -0
  104. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.d.vue.ts +9 -0
  105. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.vue +463 -0
  106. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.vue.d.ts +9 -0
  107. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.d.ts +283 -0
  108. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.js +275 -0
  109. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +183 -0
  110. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue +931 -0
  111. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +183 -0
  112. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.d.vue.ts +9 -0
  113. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.vue +414 -0
  114. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.vue.d.ts +9 -0
  115. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.d.ts +283 -0
  116. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.js +275 -0
  117. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +133 -0
  118. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue +632 -0
  119. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +133 -0
  120. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.d.vue.ts +9 -0
  121. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.vue +461 -0
  122. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.vue.d.ts +9 -0
  123. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +93 -0
  124. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.js +161 -0
  125. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +131 -0
  126. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue +563 -0
  127. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +131 -0
  128. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.d.vue.ts +9 -0
  129. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.vue +443 -0
  130. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.vue.d.ts +9 -0
  131. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.d.ts +90 -0
  132. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.js +153 -0
  133. package/dist/runtime/components/table/columns/2026-05-28/tree-combobox-shared.d.ts +35 -0
  134. package/dist/runtime/components/table/columns/2026-05-28/tree-combobox-shared.js +31 -0
  135. package/dist/runtime/components/table/config.vue +55 -82
  136. package/dist/runtime/components/table/schema.d.ts +4 -0
  137. package/dist/runtime/components/ui/command/CommandItem.d.vue.ts +7 -0
  138. package/dist/runtime/components/ui/command/CommandItem.vue +13 -4
  139. package/dist/runtime/components/ui/command/CommandItem.vue.d.ts +7 -0
  140. package/dist/runtime/share/clipboard.d.ts +26 -0
  141. package/dist/runtime/share/clipboard.js +82 -0
  142. package/dist/runtime/share/layout.d.ts +4 -0
  143. package/dist/runtime/share/layout.js +35 -0
  144. package/package.json +1 -1
  145. package/dist/preview/assets/index-DNd8J9Zv.js +0 -643
  146. package/dist/preview/assets/index-DrIMqXAa.js +0 -1
@@ -0,0 +1,183 @@
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-single";
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-28";
27
+ readonly groupId?: string | undefined;
28
+ readonly placeholder?: readonly [{
29
+ readonly locale: "zh";
30
+ readonly message: string;
31
+ }, ...{
32
+ readonly locale: "en" | "ja" | "ko";
33
+ readonly message: string;
34
+ }[]] | undefined;
35
+ readonly readonly?: string | undefined;
36
+ readonly write: {
37
+ readonly kind: "binding";
38
+ readonly binding: string;
39
+ } | {
40
+ readonly onChange?: string | undefined;
41
+ readonly kind: "remote";
42
+ readonly triggers?: readonly {
43
+ readonly target: string;
44
+ readonly operation: string;
45
+ }[] | undefined;
46
+ readonly accessor: string;
47
+ readonly successMessage?: string | undefined;
48
+ };
49
+ readonly grow?: boolean | undefined;
50
+ readonly options: {
51
+ readonly kind: "remote";
52
+ readonly request: string;
53
+ readonly options: string;
54
+ readonly optionValue: string;
55
+ readonly optionLabel: readonly [{
56
+ readonly locale: "zh";
57
+ readonly message: string;
58
+ }, ...{
59
+ readonly locale: "en" | "ja" | "ko";
60
+ readonly message: string;
61
+ }[]];
62
+ readonly optionKeywords?: string | undefined;
63
+ } | {
64
+ readonly kind: "static";
65
+ readonly items: readonly {
66
+ readonly label: readonly [{
67
+ readonly locale: "zh";
68
+ readonly message: string;
69
+ }, ...{
70
+ readonly locale: "en" | "ja" | "ko";
71
+ readonly message: string;
72
+ }[]];
73
+ readonly id: string;
74
+ readonly tooltip?: readonly [{
75
+ readonly locale: "zh";
76
+ readonly message: string;
77
+ }, ...{
78
+ readonly locale: "en" | "ja" | "ko";
79
+ readonly message: string;
80
+ }[]] | undefined;
81
+ readonly value: {
82
+ readonly value: string;
83
+ readonly kind: "text";
84
+ } | {
85
+ readonly value: number;
86
+ readonly kind: "number";
87
+ };
88
+ readonly keywords?: readonly string[] | undefined;
89
+ }[];
90
+ };
91
+ readonly enableSorting?: boolean | undefined;
92
+ }) => any;
93
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
94
+ "onUpdate:modelValue"?: ((value: {
95
+ readonly size?: number | undefined;
96
+ readonly disabled?: string | undefined;
97
+ readonly type: "com.shwfed.table.column.combobox-single";
98
+ readonly id: string;
99
+ readonly title: readonly [{
100
+ readonly locale: "zh";
101
+ readonly message: string;
102
+ }, ...{
103
+ readonly locale: "en" | "ja" | "ko";
104
+ readonly message: string;
105
+ }[]];
106
+ readonly hidden?: string | undefined;
107
+ readonly tooltip?: readonly [{
108
+ readonly locale: "zh";
109
+ readonly message: string;
110
+ }, ...{
111
+ readonly locale: "en" | "ja" | "ko";
112
+ readonly message: string;
113
+ }[]] | undefined;
114
+ readonly compatibilityDate: "2026-05-28";
115
+ readonly groupId?: string | undefined;
116
+ readonly placeholder?: readonly [{
117
+ readonly locale: "zh";
118
+ readonly message: string;
119
+ }, ...{
120
+ readonly locale: "en" | "ja" | "ko";
121
+ readonly message: string;
122
+ }[]] | undefined;
123
+ readonly readonly?: string | undefined;
124
+ readonly write: {
125
+ readonly kind: "binding";
126
+ readonly binding: string;
127
+ } | {
128
+ readonly onChange?: string | undefined;
129
+ readonly kind: "remote";
130
+ readonly triggers?: readonly {
131
+ readonly target: string;
132
+ readonly operation: string;
133
+ }[] | undefined;
134
+ readonly accessor: string;
135
+ readonly successMessage?: string | undefined;
136
+ };
137
+ readonly grow?: boolean | undefined;
138
+ readonly options: {
139
+ readonly kind: "remote";
140
+ readonly request: string;
141
+ readonly options: string;
142
+ readonly optionValue: string;
143
+ readonly optionLabel: readonly [{
144
+ readonly locale: "zh";
145
+ readonly message: string;
146
+ }, ...{
147
+ readonly locale: "en" | "ja" | "ko";
148
+ readonly message: string;
149
+ }[]];
150
+ readonly optionKeywords?: string | undefined;
151
+ } | {
152
+ readonly kind: "static";
153
+ readonly items: readonly {
154
+ readonly label: readonly [{
155
+ readonly locale: "zh";
156
+ readonly message: string;
157
+ }, ...{
158
+ readonly locale: "en" | "ja" | "ko";
159
+ readonly message: string;
160
+ }[]];
161
+ readonly id: string;
162
+ readonly tooltip?: readonly [{
163
+ readonly locale: "zh";
164
+ readonly message: string;
165
+ }, ...{
166
+ readonly locale: "en" | "ja" | "ko";
167
+ readonly message: string;
168
+ }[]] | undefined;
169
+ readonly value: {
170
+ readonly value: string;
171
+ readonly kind: "text";
172
+ } | {
173
+ readonly value: number;
174
+ readonly kind: "number";
175
+ };
176
+ readonly keywords?: readonly string[] | undefined;
177
+ }[];
178
+ };
179
+ readonly enableSorting?: boolean | undefined;
180
+ }) => any) | undefined;
181
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
182
+ declare const _default: typeof __VLS_export;
183
+ 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,414 @@
1
+ <script setup>
2
+ import { Icon } from "@iconify/vue";
3
+ import { Effect } from "effect";
4
+ import { Fetch } from "fx-fetch";
5
+ import { watchDebounced } from "@vueuse/core";
6
+ import { toast } from "vue-sonner";
7
+ import { computed, nextTick, ref, watch } from "vue";
8
+ import { useI18n } from "vue-i18n";
9
+ import { cel as _rawCel } from "../../../../../utils/cel";
10
+ import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
11
+ import { getLocalizedText } from "../../../../../share/locale";
12
+ import { dispatchTriggers, useEventChannel } from "../../../../../share/event-bus";
13
+ import {
14
+ Command,
15
+ CommandEmpty,
16
+ CommandGroup,
17
+ CommandInput,
18
+ CommandItem,
19
+ CommandList
20
+ } from "../../../../ui/command";
21
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../../../../ui/input-group";
22
+ import { Markdown } from "../../../../ui/markdown";
23
+ import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "../../../../ui/popover";
24
+ import { useFormState } from "../../../../form/utils/state";
25
+ import { interpolateMarkdown } from "../../../utils/runtime";
26
+ import { useSharedFetchLayer } from "../../../utils/shared-fetch";
27
+ defineOptions({ name: "ShwfedTableComboboxSingleRuntime" });
28
+ const props = defineProps({
29
+ column: { type: null, required: true },
30
+ ctx: { type: Object, required: true }
31
+ });
32
+ const { locale, t } = useI18n({
33
+ inheritLocale: true,
34
+ messages: {
35
+ zh: {
36
+ "combobox-single-placeholder": "\u8BF7\u9009\u62E9",
37
+ "combobox-single-search-placeholder": "\u641C\u7D22\u2026",
38
+ "combobox-single-empty": "\u65E0\u5339\u914D\u9879",
39
+ "combobox-single-loading": "\u52A0\u8F7D\u4E2D\u2026"
40
+ },
41
+ en: {
42
+ "combobox-single-placeholder": "Select\u2026",
43
+ "combobox-single-search-placeholder": "Search\u2026",
44
+ "combobox-single-empty": "No matches",
45
+ "combobox-single-loading": "Loading\u2026"
46
+ },
47
+ ja: {
48
+ "combobox-single-placeholder": "\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",
49
+ "combobox-single-search-placeholder": "\u691C\u7D22\u2026",
50
+ "combobox-single-empty": "\u4E00\u81F4\u306A\u3057",
51
+ "combobox-single-loading": "\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"
52
+ }
53
+ }
54
+ });
55
+ const formState = useFormState();
56
+ const inherited = injectCELContext();
57
+ const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
58
+ const eventChannel = useEventChannel();
59
+ const sharedFetchLayer = useSharedFetchLayer();
60
+ const row = computed(() => props.ctx.row.original);
61
+ const rowIndex = computed(() => props.ctx.row.index);
62
+ const placeholderText = computed(
63
+ () => props.column.placeholder ? getLocalizedText(props.column.placeholder, locale.value) : t("combobox-single-placeholder")
64
+ );
65
+ function evalBool(expression, label) {
66
+ if (!expression) return false;
67
+ try {
68
+ return Effect.runSync($cel(expression, { row: row.value, index: rowIndex.value })) === true;
69
+ } catch (e) {
70
+ console.error(`[shwfed-table] combobox-single ${label} failed`, e);
71
+ return false;
72
+ }
73
+ }
74
+ const isHidden = computed(() => evalBool(props.column.hidden, "hidden"));
75
+ const isDisabledByConfig = computed(() => evalBool(props.column.disabled, "disabled"));
76
+ const isReadonly = computed(() => evalBool(props.column.readonly, "readonly"));
77
+ const isInteractive = computed(
78
+ () => props.column.write.kind === "binding" || !!props.column.write.onChange
79
+ );
80
+ const pending = ref(false);
81
+ function safeInterpolate(tpl, context) {
82
+ try {
83
+ return interpolateMarkdown(tpl, $cel, context);
84
+ } catch (e) {
85
+ console.error("[shwfed-table] combobox-single label interpolation failed", e);
86
+ return tpl;
87
+ }
88
+ }
89
+ const staticEntries = computed(() => {
90
+ if (props.column.options.kind !== "static") return [];
91
+ return props.column.options.items.map((item) => {
92
+ const labelTpl = getLocalizedText(item.label, locale.value) ?? "";
93
+ const tooltipTpl = item.tooltip ? getLocalizedText(item.tooltip, locale.value) : void 0;
94
+ return {
95
+ key: item.id,
96
+ value: item.value.value,
97
+ label: labelTpl ? safeInterpolate(labelTpl, {}) : "",
98
+ tooltip: tooltipTpl ? safeInterpolate(tooltipTpl, {}) : void 0,
99
+ keywords: (item.keywords ?? []).join(" ")
100
+ };
101
+ });
102
+ });
103
+ const remoteJson = ref(null);
104
+ const remoteLoading = ref(false);
105
+ let fetchSeq = 0;
106
+ const requestSignature = computed(() => {
107
+ if (props.column.options.kind !== "remote") return null;
108
+ const expr = props.column.options.request;
109
+ if (!expr) return null;
110
+ try {
111
+ const builder = Effect.runSync(
112
+ $cel(expr, { row: row.value, index: rowIndex.value })
113
+ );
114
+ return JSON.stringify(builder.describe());
115
+ } catch {
116
+ return null;
117
+ }
118
+ });
119
+ async function fetchOptions() {
120
+ const seq = ++fetchSeq;
121
+ if (props.column.options.kind !== "remote" || requestSignature.value == null) {
122
+ remoteJson.value = null;
123
+ remoteLoading.value = false;
124
+ return;
125
+ }
126
+ const expr = props.column.options.request;
127
+ remoteLoading.value = true;
128
+ const program = Effect.gen(function* () {
129
+ const builder = yield* $cel(expr, { row: row.value, index: rowIndex.value });
130
+ return yield* builder.json();
131
+ });
132
+ try {
133
+ const result = await Effect.runPromise(Effect.provide(program, sharedFetchLayer));
134
+ if (seq === fetchSeq) remoteJson.value = result;
135
+ } catch {
136
+ if (seq === fetchSeq) remoteJson.value = null;
137
+ } finally {
138
+ if (seq === fetchSeq) remoteLoading.value = false;
139
+ }
140
+ }
141
+ watchDebounced(
142
+ requestSignature,
143
+ () => {
144
+ void fetchOptions();
145
+ },
146
+ { debounce: 200, immediate: true }
147
+ );
148
+ function valueOf(option) {
149
+ if (props.column.options.kind !== "remote") return void 0;
150
+ try {
151
+ return Effect.runSync($cel(props.column.options.optionValue, {
152
+ row: row.value,
153
+ index: rowIndex.value,
154
+ option
155
+ }));
156
+ } catch (e) {
157
+ console.error("[shwfed-table] combobox-single optionValue failed", e);
158
+ return void 0;
159
+ }
160
+ }
161
+ function labelOf(option) {
162
+ if (props.column.options.kind !== "remote") return "";
163
+ const tpl = getLocalizedText(props.column.options.optionLabel, locale.value) ?? "";
164
+ if (!tpl) return "";
165
+ try {
166
+ return interpolateMarkdown(tpl, $cel, { row: row.value, index: rowIndex.value, option });
167
+ } catch (e) {
168
+ console.error("[shwfed-table] combobox-single optionLabel failed", e);
169
+ return "";
170
+ }
171
+ }
172
+ function keywordsOf(option) {
173
+ if (props.column.options.kind !== "remote") return "";
174
+ const expr = props.column.options.optionKeywords;
175
+ if (!expr) return "";
176
+ try {
177
+ const raw = Effect.runSync($cel(expr, {
178
+ row: row.value,
179
+ index: rowIndex.value,
180
+ option
181
+ }));
182
+ if (!Array.isArray(raw)) return "";
183
+ return raw.map((k) => String(k ?? "")).filter((k) => k.length > 0).join(" ");
184
+ } catch (e) {
185
+ console.error("[shwfed-table] combobox-single optionKeywords failed", e);
186
+ return "";
187
+ }
188
+ }
189
+ const remoteEntries = computed(() => {
190
+ if (props.column.options.kind !== "remote") return [];
191
+ let raw;
192
+ try {
193
+ raw = Effect.runSync($cel(props.column.options.options, {
194
+ row: row.value,
195
+ index: rowIndex.value,
196
+ json: remoteJson.value
197
+ }));
198
+ } catch (e) {
199
+ console.error("[shwfed-table] combobox-single options failed", e);
200
+ return [];
201
+ }
202
+ if (!Array.isArray(raw)) return [];
203
+ return raw.map((option, idx) => ({
204
+ key: String(idx),
205
+ label: labelOf(option),
206
+ value: valueOf(option),
207
+ keywords: keywordsOf(option)
208
+ }));
209
+ });
210
+ const entries = computed(
211
+ () => props.column.options.kind === "static" ? staticEntries.value : remoteEntries.value
212
+ );
213
+ const isLoading = computed(() => props.column.options.kind === "remote" && remoteLoading.value);
214
+ const cellValue = computed(
215
+ () => props.column.write.kind === "binding" ? formState.getAt(props.column.write.binding) : props.ctx.cell.getValue()
216
+ );
217
+ function isEqual(a, b) {
218
+ if (a === b) return true;
219
+ if (a == null || b == null) return false;
220
+ if (typeof a === "object" && typeof b === "object") {
221
+ try {
222
+ return JSON.stringify(a) === JSON.stringify(b);
223
+ } catch {
224
+ return false;
225
+ }
226
+ }
227
+ return false;
228
+ }
229
+ const selectedEntry = computed(
230
+ () => entries.value.find((entry) => isEqual(entry.value, cellValue.value))
231
+ );
232
+ const selectedKey = computed(() => selectedEntry.value?.key);
233
+ const selectedLabel = computed(() => selectedEntry.value?.label ?? "");
234
+ const open = ref(false);
235
+ const isDisabled = computed(
236
+ () => !isInteractive.value || isDisabledByConfig.value || pending.value
237
+ );
238
+ async function submit(next) {
239
+ const write = props.column.write;
240
+ if (write.kind === "binding") {
241
+ formState.setAt(write.binding, next);
242
+ return;
243
+ }
244
+ const { onChange, successMessage, triggers } = write;
245
+ if (!onChange) return;
246
+ pending.value = true;
247
+ const program = Effect.gen(function* () {
248
+ const builder = yield* $cel(onChange, {
249
+ row: row.value,
250
+ index: rowIndex.value,
251
+ value: next
252
+ });
253
+ return yield* builder.json();
254
+ });
255
+ try {
256
+ const body = await Effect.runPromise(Effect.provide(program, Fetch.layer));
257
+ if (successMessage) {
258
+ try {
259
+ const message = Effect.runSync($cel(successMessage, { json: body }));
260
+ if (message) toast.success(message);
261
+ } catch (e) {
262
+ console.error("[shwfed-table] combobox-single successMessage failed", e);
263
+ }
264
+ }
265
+ await Effect.runPromise(dispatchTriggers(eventChannel, triggers));
266
+ } catch (e) {
267
+ console.error("[shwfed-table] combobox-single onChange failed", e);
268
+ toast.error("\u8BF7\u6C42\u5931\u8D25");
269
+ } finally {
270
+ pending.value = false;
271
+ }
272
+ }
273
+ function handleSelect(key) {
274
+ if (typeof key !== "string") return;
275
+ const entry = entries.value.find((e) => e.key === key);
276
+ if (!entry) return;
277
+ void nextTick().then(() => {
278
+ open.value = false;
279
+ });
280
+ void submit(entry.value);
281
+ }
282
+ const showClear = computed(
283
+ () => !isDisabled.value && selectedEntry.value !== void 0
284
+ );
285
+ function handleClear() {
286
+ open.value = false;
287
+ void submit(null);
288
+ }
289
+ const hoveredKey = ref(null);
290
+ watch(open, (isOpen) => {
291
+ hoveredKey.value = isOpen ? entries.value[0]?.key ?? null : null;
292
+ });
293
+ const hoveredEntry = computed(
294
+ () => entries.value.find((e) => e.key === hoveredKey.value)
295
+ );
296
+ const hoveredTooltip = computed(() => hoveredEntry.value?.tooltip);
297
+ const anyHasTooltip = computed(
298
+ () => entries.value.some((e) => e.tooltip != null && e.tooltip.length > 0)
299
+ );
300
+ </script>
301
+
302
+ <template>
303
+ <div class="p-[0.125rem] w-full">
304
+ <span
305
+ v-if="isHidden"
306
+ class="block h-7 w-full"
307
+ />
308
+ <span
309
+ v-else-if="isReadonly || !isInteractive"
310
+ class="flex items-center h-7 w-full px-2 text-[0.75rem] text-zinc-700 truncate"
311
+ >
312
+ {{ selectedLabel || "\u2014" }}
313
+ </span>
314
+ <Popover
315
+ v-else
316
+ v-model:open="open"
317
+ >
318
+ <PopoverAnchor as-child>
319
+ <InputGroup
320
+ 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"
321
+ :data-disabled="isDisabled ? 'true' : void 0"
322
+ >
323
+ <PopoverTrigger as-child>
324
+ <InputGroupInput
325
+ :model-value="selectedLabel"
326
+ :disabled="isDisabled"
327
+ :placeholder="placeholderText"
328
+ class="h-7 text-[0.75rem] md:text-[0.75rem] px-2 cursor-pointer text-left"
329
+ readonly
330
+ />
331
+ </PopoverTrigger>
332
+ <InputGroupAddon
333
+ v-if="pending || isLoading"
334
+ align="inline-end"
335
+ class="text-zinc-400"
336
+ >
337
+ <Icon
338
+ icon="fluent:spinner-ios-20-regular"
339
+ class="size-3 animate-spin"
340
+ />
341
+ </InputGroupAddon>
342
+ <InputGroupAddon
343
+ v-else-if="showClear"
344
+ align="inline-end"
345
+ class="[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-single:opacity-100 focus-within:opacity-100"
346
+ >
347
+ <InputGroupButton
348
+ size="icon-xs"
349
+ data-slot="combobox-single-clear"
350
+ class="size-4 text-zinc-500 hover:text-zinc-700"
351
+ tabindex="-1"
352
+ @mousedown.prevent
353
+ @click.stop="handleClear"
354
+ >
355
+ <Icon
356
+ icon="fluent:dismiss-20-regular"
357
+ class="size-3"
358
+ />
359
+ </InputGroupButton>
360
+ </InputGroupAddon>
361
+ </InputGroup>
362
+ </PopoverAnchor>
363
+ <PopoverContent
364
+ 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]"
365
+ :style="{ width: 'var(--reka-popover-trigger-width)' }"
366
+ >
367
+ <Command
368
+ :model-value="selectedKey"
369
+ :disabled="isDisabled"
370
+ selection-behavior="toggle"
371
+ @update:model-value="handleSelect"
372
+ >
373
+ <CommandInput :placeholder="t('combobox-single-search-placeholder')" />
374
+ <CommandList>
375
+ <div
376
+ v-if="entries.length === 0"
377
+ data-slot="combobox-single-empty"
378
+ class="py-3 text-center text-[0.75rem] text-zinc-500"
379
+ >
380
+ {{ isLoading ? t("combobox-single-loading") : t("combobox-single-empty") }}
381
+ </div>
382
+ <template v-else>
383
+ <CommandEmpty class="py-3 text-center text-[0.75rem] text-zinc-500">
384
+ {{ t("combobox-single-empty") }}
385
+ </CommandEmpty>
386
+ <CommandGroup>
387
+ <CommandItem
388
+ v-for="entry in entries"
389
+ :key="entry.key"
390
+ :value="entry.key"
391
+ :keywords="entry.keywords || void 0"
392
+ @mouseenter="hoveredKey = entry.key"
393
+ @focus="hoveredKey = entry.key"
394
+ >
395
+ <span class="flex-1"><Markdown :source="entry.label" /></span>
396
+ </CommandItem>
397
+ </CommandGroup>
398
+ </template>
399
+ </CommandList>
400
+ <div
401
+ v-if="anyHasTooltip && hoveredTooltip"
402
+ class="border-t border-zinc-200 px-2 py-1.5"
403
+ >
404
+ <Markdown
405
+ :source="hoveredTooltip"
406
+ block
407
+ class="prose prose-xs prose-zinc"
408
+ />
409
+ </div>
410
+ </Command>
411
+ </PopoverContent>
412
+ </Popover>
413
+ </div>
414
+ </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;