@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
@@ -161,6 +161,9 @@ function configureTableActions(env) {
161
161
  env.registerVariable("selected", "list<dyn>", {
162
162
  description: "\u5F53\u524D\u5DF2\u52FE\u9009\u7684\u6240\u6709\u884C\uFF08`row` \u7684\u6570\u7EC4\uFF09"
163
163
  });
164
+ env.registerVariable("query", "dyn", {
165
+ description: "\u6E32\u67D3\u5728\u8868\u683C\u4E0A\u65B9\u7684\u641C\u7D22\u6761\u4EF6\u8868\u5355\u5F53\u524D\u72B6\u6001\uFF1B\u672A\u914D\u7F6E\u65F6\u4E3A\u7A7A\u5BF9\u8C61"
166
+ });
164
167
  }
165
168
  function configureTableQuery(env) {
166
169
  configure(env);
@@ -27,6 +27,7 @@ import ShwfedActions from "../actions/components/group.vue";
27
27
  import ShwfedForm from "../form/index.vue";
28
28
  import { evaluateInitial } from "../form/utils/initial";
29
29
  import { provideTableInstanceId } from "./utils/instance";
30
+ import { provideSharedFetchLayer } from "./utils/shared-fetch";
30
31
  import { provideEventTarget } from "../../share/event-bus";
31
32
  import { findColumn } from "./utils/resolve";
32
33
  import { interpolateMarkdown } from "./utils/runtime";
@@ -257,6 +258,7 @@ provideCELContext({
257
258
  }
258
259
  }
259
260
  });
261
+ provideSharedFetchLayer();
260
262
  const hasDragHandleColumn = computed(() => (config.value?.columns ?? []).some((c) => c.type === DRAG_HANDLE_COLUMN_TYPE));
261
263
  const reorderDisabledReason = computed(() => {
262
264
  if (!hasDragHandleColumn.value) return null;
@@ -0,0 +1,30 @@
1
+ import { Layer } from 'effect';
2
+ import { Fetch } from 'fx-fetch';
3
+ /**
4
+ * Table-scoped `Fetch` Layer. Cells that fetch options through `Fetch.layer`
5
+ * fan out to one request per row; this layer dedupes by request signature so
6
+ * identical GETs collapse to a single in-flight call shared across every cell.
7
+ * Non-GET requests bypass the cache entirely (writes must never dedupe — two
8
+ * rows toggling concurrently must hit the server twice).
9
+ *
10
+ * The signature mirrors `HttpRequestBuilder.describe()`: URL, method, sorted
11
+ * headers. Bodies are intentionally ignored — GETs do not carry them in this
12
+ * codebase, and including them would force a representation choice for the
13
+ * `Promise<Blob>` body that fx-fetch lazy-reads.
14
+ */
15
+ type SharedFetchLayer = Layer.Layer<Fetch.Fetch, never, never>;
16
+ export declare function makeCachedFetchLayer(): SharedFetchLayer;
17
+ /**
18
+ * Mounts a cache instance scoped to the calling component's scope and provides
19
+ * it to descendants. Call once from the table host. The cache is dropped on
20
+ * unmount so a table that remounts starts fresh — no leaked Promises tying
21
+ * the old instance's responses to the new one.
22
+ */
23
+ export declare function provideSharedFetchLayer(): SharedFetchLayer;
24
+ /**
25
+ * Returns the table-scoped shared Fetch layer, or the default `Fetch.layer`
26
+ * when no host has provided one (e.g. a column rendered standalone in a unit
27
+ * test or outside a table). The fallback keeps the runtime self-contained.
28
+ */
29
+ export declare function useSharedFetchLayer(): SharedFetchLayer;
30
+ export {};
@@ -0,0 +1,42 @@
1
+ import { Effect, Layer } from "effect";
2
+ import { Fetch, Request as FxRequest, Url } from "fx-fetch";
3
+ import { inject, onScopeDispose, provide } from "vue";
4
+ const KEY = Symbol("shwfed-table:shared-fetch-layer");
5
+ function signatureOf(request) {
6
+ const headers = FxRequest.toHeadersRecord(request);
7
+ const sortedHeaders = Object.keys(headers).sort().map((name) => [name, headers[name]]);
8
+ return JSON.stringify({
9
+ url: Url.format(FxRequest.getUrl(request)),
10
+ method: request.method,
11
+ headers: sortedHeaders
12
+ });
13
+ }
14
+ export function makeCachedFetchLayer() {
15
+ const cache = /* @__PURE__ */ new Map();
16
+ const service = (request) => {
17
+ if (request.method !== "GET") return Fetch.FetchLive(request);
18
+ const key = signatureOf(request);
19
+ const existing = cache.get(key);
20
+ if (existing) return existing;
21
+ let pending;
22
+ const cached = Effect.async((resume) => {
23
+ if (!pending) pending = Effect.runPromise(Effect.exit(Fetch.FetchLive(request)));
24
+ pending.then((exit) => {
25
+ resume(exit);
26
+ });
27
+ });
28
+ cache.set(key, cached);
29
+ return cached;
30
+ };
31
+ return Layer.succeed(Fetch.Fetch, service);
32
+ }
33
+ export function provideSharedFetchLayer() {
34
+ const layer = makeCachedFetchLayer();
35
+ provide(KEY, layer);
36
+ onScopeDispose(() => {
37
+ });
38
+ return layer;
39
+ }
40
+ export function useSharedFetchLayer() {
41
+ return inject(KEY, Fetch.layer);
42
+ }
@@ -3,7 +3,8 @@ import { CalendarDate, getLocalTimeZone, today } from "@internationalized/date";
3
3
  import { reactiveOmit, useNavigatorLanguage, useVModel } from "@vueuse/core";
4
4
  import { CalendarRoot, useDateFormatter, useForwardPropsEmits } from "reka-ui";
5
5
  import { toDate } from "reka-ui/date";
6
- import { computed } from "vue";
6
+ import { computed, watch } from "vue";
7
+ import { useI18n } from "vue-i18n";
7
8
  import { cn } from "../../../utils/cn";
8
9
  import { buttonVariants } from "../button";
9
10
  import { CalendarCell, CalendarCellTrigger, CalendarGrid, CalendarGridBody, CalendarGridHead, CalendarGridRow, CalendarHeadCell, CalendarHeader, CalendarHeading, CalendarNextButton, CalendarPrevButton } from ".";
@@ -45,8 +46,12 @@ const placeholder = useVModel(props, "placeholder", emits, {
45
46
  defaultValue: props.defaultPlaceholder ?? today(getLocalTimeZone())
46
47
  });
47
48
  const navLocale = useNavigatorLanguage();
48
- const locale = computed(() => props.locale ?? navLocale.language.value ?? "en");
49
+ const { locale: i18nLocale } = useI18n({ useScope: "global", inheritLocale: true });
50
+ const locale = computed(() => props.locale ?? i18nLocale.value ?? navLocale.language.value ?? "en");
49
51
  const formatter = useDateFormatter(locale.value);
52
+ watch(locale, (next) => {
53
+ formatter.setLocale(next);
54
+ });
50
55
  const forwarded = useForwardPropsEmits(delegatedProps, emits);
51
56
  const weekStartsOn = computed(() => {
52
57
  const lang = navLocale.language.value;
@@ -112,7 +117,7 @@ function isPickerDateDisabled(date) {
112
117
  <!-- Month picker grid (month-only / month-and-year) -->
113
118
  <div
114
119
  v-if="layout === 'month'"
115
- class="grid grid-cols-4 gap-1 mt-4"
120
+ class="grid grid-cols-4 gap-1 mt-4 w-full"
116
121
  >
117
122
  <button
118
123
  v-for="m in 12"
@@ -134,7 +139,7 @@ function isPickerDateDisabled(date) {
134
139
  <!-- Year picker grid -->
135
140
  <div
136
141
  v-else-if="layout === 'year'"
137
- class="grid grid-cols-4 gap-1 mt-4"
142
+ class="grid grid-cols-4 gap-1 mt-4 w-full"
138
143
  >
139
144
  <button
140
145
  v-for="i in 12"
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
3
  import { MonthRangePicker } from "reka-ui/namespaced";
4
+ import { useI18n } from "vue-i18n";
4
5
  import { cn } from "../../../utils/cn";
5
6
  defineOptions({ name: "UiDateRangePickerMonthPanel" });
6
7
  const props = defineProps({
@@ -9,6 +10,7 @@ const props = defineProps({
9
10
  class: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true }
10
11
  });
11
12
  const emits = defineEmits(["update:modelValue"]);
13
+ const { locale } = useI18n({ useScope: "global", inheritLocale: true });
12
14
  function handleUpdate(value) {
13
15
  emits("update:modelValue", value);
14
16
  }
@@ -22,6 +24,7 @@ function handleUpdate(value) {
22
24
  :model-value="props.modelValue"
23
25
  :default-placeholder="props.modelValue?.start"
24
26
  :is-month-disabled="props.isDateDisabled"
27
+ :locale="locale"
25
28
  @update:model-value="handleUpdate"
26
29
  >
27
30
  <MonthRangePicker.Header class="pt-2 pb-2 relative">
@@ -36,7 +39,7 @@ function handleUpdate(value) {
36
39
  <MonthRangePicker.Heading class="text-sm font-medium text-center w-full" />
37
40
  </MonthRangePicker.Header>
38
41
 
39
- <MonthRangePicker.Grid class="mt-4">
42
+ <MonthRangePicker.Grid class="mt-4 w-full">
40
43
  <MonthRangePicker.GridBody>
41
44
  <MonthRangePicker.GridRow
42
45
  v-for="(row, rIdx) in grid.rows"
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
3
  import { YearRangePicker } from "reka-ui/namespaced";
4
+ import { useI18n } from "vue-i18n";
4
5
  import { cn } from "../../../utils/cn";
5
6
  defineOptions({ name: "UiDateRangePickerYearPanel" });
6
7
  const props = defineProps({
@@ -9,6 +10,7 @@ const props = defineProps({
9
10
  class: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true }
10
11
  });
11
12
  const emits = defineEmits(["update:modelValue"]);
13
+ const { locale } = useI18n({ useScope: "global", inheritLocale: true });
12
14
  function handleUpdate(value) {
13
15
  emits("update:modelValue", value);
14
16
  }
@@ -22,6 +24,7 @@ function handleUpdate(value) {
22
24
  :model-value="props.modelValue"
23
25
  :default-placeholder="props.modelValue?.start"
24
26
  :is-year-disabled="props.isDateDisabled"
27
+ :locale="locale"
25
28
  @update:model-value="handleUpdate"
26
29
  >
27
30
  <YearRangePicker.Header class="pt-2 pb-2 relative">
@@ -36,7 +39,7 @@ function handleUpdate(value) {
36
39
  <YearRangePicker.Heading class="text-sm font-medium text-center w-full" />
37
40
  </YearRangePicker.Header>
38
41
 
39
- <YearRangePicker.Grid class="mt-4">
42
+ <YearRangePicker.Grid class="mt-4 w-full">
40
43
  <YearRangePicker.GridBody>
41
44
  <YearRangePicker.GridRow
42
45
  v-for="(row, rIdx) in grid.rows"
@@ -2,6 +2,7 @@
2
2
  import { reactiveOmit, useNavigatorLanguage } from "@vueuse/core";
3
3
  import { RangeCalendarRoot, useForwardPropsEmits } from "reka-ui";
4
4
  import { computed } from "vue";
5
+ import { useI18n } from "vue-i18n";
5
6
  import { cn } from "../../../utils/cn";
6
7
  import { RangeCalendarCell, RangeCalendarCellTrigger, RangeCalendarGrid, RangeCalendarGridBody, RangeCalendarGridHead, RangeCalendarGridRow, RangeCalendarHeadCell, RangeCalendarHeader, RangeCalendarHeading, RangeCalendarNextButton, RangeCalendarPrevButton } from ".";
7
8
  const props = defineProps({
@@ -40,7 +41,8 @@ const emits = defineEmits(["update:modelValue", "update:validModelValue", "updat
40
41
  const delegatedProps = reactiveOmit(props, "class");
41
42
  const forwarded = useForwardPropsEmits(delegatedProps, emits);
42
43
  const navLocale = useNavigatorLanguage();
43
- const locale = computed(() => props.locale ?? navLocale.language.value ?? "en");
44
+ const { locale: i18nLocale } = useI18n({ useScope: "global", inheritLocale: true });
45
+ const locale = computed(() => props.locale ?? i18nLocale.value ?? navLocale.language.value ?? "en");
44
46
  </script>
45
47
 
46
48
  <template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/config",
3
- "version": "2.3.17",
3
+ "version": "2.3.19",
4
4
  "description": "Configurable UI for SHWFED",
5
5
  "type": "module",
6
6
  "publishConfig": {