@atscript/vue-form 0.1.189 → 0.1.191

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 (203) hide show
  1. package/dist/{_shape-C-TxQCFa.cjs → _shape-BDO-1MzF.cjs} +34 -0
  2. package/dist/{_shape-bdsPEB8P.mjs → _shape-DhwW2SvD.mjs} +23 -1
  3. package/dist/{as-action-B_vPR2YE.cjs → as-action-B3NIgGTV.cjs} +4 -0
  4. package/dist/{as-action-BzdLJvyy.mjs → as-action-B69WsGIB.mjs} +4 -0
  5. package/dist/as-action.cjs +1 -1
  6. package/dist/as-action.d.cts +1 -1
  7. package/dist/as-action.d.mts +1 -1
  8. package/dist/as-action.mjs +1 -1
  9. package/dist/{as-action.vue-BmHLq5PU.d.cts → as-action.vue-DW10afXf.d.cts} +1 -1
  10. package/dist/{as-action.vue-BskkSynK.d.mts → as-action.vue-FAmO9MMw.d.mts} +1 -1
  11. package/dist/{as-array-BKC7bBXf.mjs → as-array-B0wekrwk.mjs} +12 -8
  12. package/dist/{as-array-C4Vv6k5I.cjs → as-array-BJYlPXad.cjs} +12 -8
  13. package/dist/{as-array-clear-btn-ConR3zxV.mjs → as-array-clear-btn-Bi4wDHOv.mjs} +2 -2
  14. package/dist/{as-array-clear-btn-DeWeUqoX.cjs → as-array-clear-btn-CzojQsEk.cjs} +2 -2
  15. package/dist/as-array.cjs +1 -1
  16. package/dist/as-array.d.cts +1 -1
  17. package/dist/as-array.d.mts +1 -1
  18. package/dist/as-array.mjs +1 -1
  19. package/dist/{as-array.vue-BWUhWKKn.d.cts → as-array.vue-DetU1gZz.d.cts} +1 -1
  20. package/dist/{as-array.vue-C4mSQIUB.d.mts → as-array.vue-Q8eE5Ut1.d.mts} +1 -1
  21. package/dist/{as-checkbox-Dux-KJVN.mjs → as-checkbox-BKQPJbiW.mjs} +7 -3
  22. package/dist/{as-checkbox-NjLPm4Kk.cjs → as-checkbox-Dg4CqOYy.cjs} +7 -3
  23. package/dist/as-checkbox.cjs +1 -1
  24. package/dist/as-checkbox.d.cts +1 -1
  25. package/dist/as-checkbox.d.mts +1 -1
  26. package/dist/as-checkbox.mjs +1 -1
  27. package/dist/{as-checkbox.vue-B_LntkDl.d.cts → as-checkbox.vue-BCZqbPZs.d.cts} +1 -1
  28. package/dist/{as-checkbox.vue-CPLwFPve.d.mts → as-checkbox.vue-D3PPVWiS.d.mts} +1 -1
  29. package/dist/{as-collapsible-FoPTu4lF.mjs → as-collapsible-DJqAZXR7.mjs} +2 -2
  30. package/dist/{as-collapsible-BXQ481-h.cjs → as-collapsible-Dtt4QN7s.cjs} +2 -2
  31. package/dist/as-collapsible.cjs +1 -1
  32. package/dist/as-collapsible.d.cts +1 -1
  33. package/dist/as-collapsible.d.mts +1 -1
  34. package/dist/as-collapsible.mjs +1 -1
  35. package/dist/{as-collapsible.vue-9XMYb39s.d.cts → as-collapsible.vue-Bxenwlh8.d.cts} +1 -1
  36. package/dist/{as-collapsible.vue-BtUZuqGF.d.mts → as-collapsible.vue-lYcXVC_E.d.mts} +1 -1
  37. package/dist/{as-date-DSvDDvwH.cjs → as-date-BKR1O5BR.cjs} +7 -3
  38. package/dist/{as-date-DUUpb8ph.mjs → as-date-BoBkff96.mjs} +7 -3
  39. package/dist/as-date.cjs +1 -1
  40. package/dist/as-date.d.cts +1 -1
  41. package/dist/as-date.d.mts +1 -1
  42. package/dist/as-date.mjs +1 -1
  43. package/dist/{as-date.vue-CQZp-yqF.d.mts → as-date.vue-ByntHQIq.d.mts} +1 -1
  44. package/dist/{as-date.vue-DQVHGLMc.d.cts → as-date.vue-CS14s3fE.d.cts} +1 -1
  45. package/dist/{as-datetime-Dy1tGMrO.mjs → as-datetime-Ci3H4Fjy.mjs} +7 -3
  46. package/dist/{as-datetime-DZBCBpov.cjs → as-datetime-DH5tE6dB.cjs} +7 -3
  47. package/dist/as-datetime.cjs +1 -1
  48. package/dist/as-datetime.d.cts +1 -1
  49. package/dist/as-datetime.d.mts +1 -1
  50. package/dist/as-datetime.mjs +1 -1
  51. package/dist/{as-datetime.vue-DrWth1Pe.d.mts → as-datetime.vue-B-O9jSjL.d.mts} +1 -1
  52. package/dist/{as-datetime.vue-TMgV54Z5.d.cts → as-datetime.vue-BJAZj8Pi.d.cts} +1 -1
  53. package/dist/{as-decimal-DYBEUokN.cjs → as-decimal-BuvchyCs.cjs} +7 -3
  54. package/dist/{as-decimal-HvUQANde.mjs → as-decimal-CseZXB7F.mjs} +7 -3
  55. package/dist/as-decimal.cjs +1 -1
  56. package/dist/as-decimal.d.cts +1 -1
  57. package/dist/as-decimal.d.mts +1 -1
  58. package/dist/as-decimal.mjs +1 -1
  59. package/dist/{as-decimal.vue-Bw9vY0br.d.mts → as-decimal.vue-CQXnsDs9.d.mts} +1 -1
  60. package/dist/{as-decimal.vue-D-C_ywhy.d.cts → as-decimal.vue-F9YMotuz.d.cts} +1 -1
  61. package/dist/{as-field-C3lIiHCI.cjs → as-field-BHUA1YpM.cjs} +93 -57
  62. package/dist/{as-field-R3KYssad.mjs → as-field-CvjOHQ9H.mjs} +94 -52
  63. package/dist/{as-field-shell-BQPySL71.mjs → as-field-shell-CSxqm12l.mjs} +8 -4
  64. package/dist/{as-field-shell-BOeyo1FP.cjs → as-field-shell-P7p47Pbr.cjs} +8 -4
  65. package/dist/as-field-shell.cjs +1 -1
  66. package/dist/as-field-shell.d.cts +1 -1
  67. package/dist/as-field-shell.d.mts +1 -1
  68. package/dist/as-field-shell.mjs +1 -1
  69. package/dist/{as-field-shell.vue-CouocQ2f.d.cts → as-field-shell.vue-CQSSK4hh.d.mts} +1 -1
  70. package/dist/{as-field-shell.vue-DIYpxzud.d.mts → as-field-shell.vue-DsYdUv7b.d.cts} +1 -1
  71. package/dist/as-field.cjs +1 -1
  72. package/dist/as-field.mjs +1 -1
  73. package/dist/{as-form-CRDqdXnl.mjs → as-form-BYi1rubO.mjs} +5 -5
  74. package/dist/{as-form-BTNctHb9.cjs → as-form-rI4daFP2.cjs} +5 -5
  75. package/dist/as-form.cjs +1 -1
  76. package/dist/as-form.d.cts +1 -1
  77. package/dist/as-form.d.mts +1 -1
  78. package/dist/as-form.mjs +1 -1
  79. package/dist/{as-form.vue-BI5mC0o7.d.cts → as-form.vue-C7yj7eRt.d.cts} +34 -3
  80. package/dist/{as-form.vue-BJ79OYA6.d.mts → as-form.vue-xvFFkRdo.d.mts} +34 -3
  81. package/dist/{as-input-BRJYoNF0.cjs → as-input-DNIY5kGw.cjs} +6 -2
  82. package/dist/{as-input-C3MkFToh.mjs → as-input-DVeDzKkd.mjs} +6 -2
  83. package/dist/{as-input-control-DAbaW7GG.cjs → as-input-control-D8xoJfr7.cjs} +7 -3
  84. package/dist/{as-input-control-B3h--Qe0.mjs → as-input-control-Wygcey6h.mjs} +7 -3
  85. package/dist/as-input.cjs +1 -1
  86. package/dist/as-input.d.cts +1 -1
  87. package/dist/as-input.d.mts +1 -1
  88. package/dist/as-input.mjs +1 -1
  89. package/dist/{as-input.vue-D4UQSSmo.d.cts → as-input.vue-BE5H25Xa.d.mts} +1 -1
  90. package/dist/{as-input.vue-Q5EXxW3x.d.mts → as-input.vue-DsSCA6KN.d.cts} +1 -1
  91. package/dist/{as-iterator-Bd1fXGs6.mjs → as-iterator-BTJ37tre.mjs} +2 -2
  92. package/dist/{as-iterator-BB7DB04y.cjs → as-iterator-rF5FyWGS.cjs} +2 -2
  93. package/dist/as-iterator.cjs +1 -1
  94. package/dist/as-iterator.mjs +1 -1
  95. package/dist/{as-multi-select-DPpAKUzQ.cjs → as-multi-select-CXFofdQ1.cjs} +6 -2
  96. package/dist/{as-multi-select-4awmF8mN.mjs → as-multi-select-CkMSlX1e.mjs} +6 -2
  97. package/dist/as-multi-select.cjs +1 -1
  98. package/dist/as-multi-select.d.cts +1 -1
  99. package/dist/as-multi-select.d.mts +1 -1
  100. package/dist/as-multi-select.mjs +1 -1
  101. package/dist/{as-multi-select.vue-Ce-V2A81.d.mts → as-multi-select.vue-BDt4AtNm.d.mts} +1 -1
  102. package/dist/{as-multi-select.vue-Iy3G3eu8.d.cts → as-multi-select.vue-CpuSkukC.d.cts} +1 -1
  103. package/dist/{as-number-CAVTkGcp.cjs → as-number-BwzyMxl4.cjs} +8 -4
  104. package/dist/{as-number-WcRwaMOt.mjs → as-number-mQHbJDoh.mjs} +8 -4
  105. package/dist/as-number.cjs +1 -1
  106. package/dist/as-number.d.cts +1 -1
  107. package/dist/as-number.d.mts +1 -1
  108. package/dist/as-number.mjs +1 -1
  109. package/dist/{as-number.vue-FKc6UVot.d.mts → as-number.vue-89e-jfVe.d.cts} +1 -1
  110. package/dist/{as-number.vue-PH0wnd3B.d.cts → as-number.vue-CCTMDQYH.d.mts} +1 -1
  111. package/dist/{as-object-Bnyck833.cjs → as-object-DIj1yGSZ.cjs} +9 -5
  112. package/dist/{as-object-3Tlk8bjl.mjs → as-object-JuruOEiL.mjs} +9 -5
  113. package/dist/as-object.cjs +1 -1
  114. package/dist/as-object.d.cts +1 -1
  115. package/dist/as-object.d.mts +1 -1
  116. package/dist/as-object.mjs +1 -1
  117. package/dist/{as-object.vue-B0qKMWPB.d.cts → as-object.vue-CVpEmBqS.d.mts} +1 -1
  118. package/dist/{as-object.vue-DLCEWLe4.d.mts → as-object.vue-tIaVshqY.d.cts} +1 -1
  119. package/dist/{as-paragraph-CQCdz9FR.mjs → as-paragraph-B49pXlhP.mjs} +4 -0
  120. package/dist/{as-paragraph-0opsr433.cjs → as-paragraph-wAHRsd_e.cjs} +4 -0
  121. package/dist/as-paragraph.cjs +1 -1
  122. package/dist/as-paragraph.d.cts +1 -1
  123. package/dist/as-paragraph.d.mts +1 -1
  124. package/dist/as-paragraph.mjs +1 -1
  125. package/dist/{as-paragraph.vue-BIrekTzU.d.mts → as-paragraph.vue-BUdQBjDf.d.cts} +1 -1
  126. package/dist/{as-paragraph.vue-C8JeTZ1s.d.cts → as-paragraph.vue-CS_GUIlF.d.mts} +1 -1
  127. package/dist/{as-radio-8udWHC-l.mjs → as-radio-C5mVvsVH.mjs} +7 -3
  128. package/dist/{as-radio-P9rzMYNp.cjs → as-radio-DQO5uQL3.cjs} +7 -3
  129. package/dist/as-radio.cjs +1 -1
  130. package/dist/as-radio.d.cts +1 -1
  131. package/dist/as-radio.d.mts +1 -1
  132. package/dist/as-radio.mjs +1 -1
  133. package/dist/{as-radio.vue-Rwknlgr7.d.mts → as-radio.vue-BcTgNQsc.d.mts} +1 -1
  134. package/dist/{as-radio.vue-jeHiMfc7.d.cts → as-radio.vue-BmmP8H-m.d.cts} +1 -1
  135. package/dist/as-ref-BWcpK0lg.mjs +454 -0
  136. package/dist/as-ref-DctAXQ2K.cjs +459 -0
  137. package/dist/as-ref.cjs +1 -1
  138. package/dist/as-ref.d.cts +1 -1
  139. package/dist/as-ref.d.mts +1 -1
  140. package/dist/as-ref.mjs +1 -1
  141. package/dist/as-ref.vue-DZeTp8EO.d.cts +19 -0
  142. package/dist/as-ref.vue-Gwv8EEKY.d.mts +19 -0
  143. package/dist/{as-select-DVbegHcv.cjs → as-select-B_ZB1_a5.cjs} +20 -7
  144. package/dist/{as-select-3fZCzWku.mjs → as-select-C1lqeKqt.mjs} +21 -8
  145. package/dist/as-select.cjs +1 -1
  146. package/dist/as-select.d.cts +1 -1
  147. package/dist/as-select.d.mts +1 -1
  148. package/dist/as-select.mjs +1 -1
  149. package/dist/{as-select.vue-BIpvu4ba.d.mts → as-select.vue-BMNGb5eH.d.mts} +1 -1
  150. package/dist/{as-select.vue-eMp1zUQE.d.cts → as-select.vue-C3NvSQ2N.d.cts} +1 -1
  151. package/dist/{as-time-W1ExfNxT.cjs → as-time-D7oluFpZ.cjs} +7 -3
  152. package/dist/{as-time-BtTiGWOr.mjs → as-time-D9VTZzsD.mjs} +7 -3
  153. package/dist/as-time.cjs +1 -1
  154. package/dist/as-time.d.cts +1 -1
  155. package/dist/as-time.d.mts +1 -1
  156. package/dist/as-time.mjs +1 -1
  157. package/dist/{as-time.vue-DAeXJ0Zv.d.cts → as-time.vue-CcEfdWI8.d.cts} +1 -1
  158. package/dist/{as-time.vue-DudhL8yx.d.mts → as-time.vue-Dc5ruv4m.d.mts} +1 -1
  159. package/dist/{as-tuple-dfvCxm4R.cjs → as-tuple--4iQOc9p.cjs} +10 -6
  160. package/dist/{as-tuple-CBOp5N1c.mjs → as-tuple-DwP6bvW7.mjs} +10 -6
  161. package/dist/as-tuple.cjs +1 -1
  162. package/dist/as-tuple.d.cts +1 -1
  163. package/dist/as-tuple.d.mts +1 -1
  164. package/dist/as-tuple.mjs +1 -1
  165. package/dist/{as-tuple.vue-C2KTK2RH.d.cts → as-tuple.vue-Cyzfh6Z0.d.mts} +1 -1
  166. package/dist/{as-tuple.vue-CLIDqVFv.d.mts → as-tuple.vue-DzC4tINc.d.cts} +1 -1
  167. package/dist/{as-union-B0h0AlsZ.cjs → as-union-CvSnU1YB.cjs} +9 -5
  168. package/dist/{as-union-izUcMyQt.mjs → as-union-Cy7zefJl.mjs} +9 -5
  169. package/dist/as-union.cjs +1 -1
  170. package/dist/as-union.d.cts +1 -1
  171. package/dist/as-union.d.mts +1 -1
  172. package/dist/as-union.mjs +1 -1
  173. package/dist/{as-union.vue-43Gq2Lh0.d.cts → as-union.vue-CvN-SR9q.d.cts} +1 -1
  174. package/dist/{as-union.vue-CllUYjuh.d.mts → as-union.vue-CwNJYhKj.d.mts} +1 -1
  175. package/dist/{as-variant-picker-D0I5qR2w.mjs → as-variant-picker-3P9wXCUf.mjs} +3 -3
  176. package/dist/{as-variant-picker-oELBST6P.cjs → as-variant-picker-BYrf1YUe.cjs} +3 -3
  177. package/dist/index.cjs +29 -29
  178. package/dist/index.d.cts +22 -22
  179. package/dist/index.d.mts +22 -22
  180. package/dist/index.mjs +28 -28
  181. package/dist/locale.cjs +1 -1
  182. package/dist/locale.mjs +1 -1
  183. package/dist/{types-BbGuPzZk.d.cts → types-COv2t_de.d.cts} +32 -2
  184. package/dist/{types-DxmDaJXr.d.mts → types-DSXbJndw.d.mts} +32 -2
  185. package/dist/{use-as-date-DFcdIfyr.cjs → use-as-date-CAmqx1O7.cjs} +4 -0
  186. package/dist/{use-as-date-DgPRL0O2.mjs → use-as-date-CpXG9klN.mjs} +4 -0
  187. package/dist/{use-as-model-texts-CLzPZ6Go.cjs → use-as-model-texts-DtqNcugR.cjs} +2 -2
  188. package/dist/{use-as-model-texts-D3uf3X8L.mjs → use-as-model-texts-Duq04LpS.mjs} +2 -2
  189. package/dist/{use-as-value-help-BWiBDup3.mjs → use-as-value-help-D16evDGm.mjs} +93 -10
  190. package/dist/{use-as-value-help-BG6aN4yQ.cjs → use-as-value-help-XPeNhfJY.cjs} +97 -8
  191. package/dist/{use-form-context-C5Q9Gznl.cjs → use-form-context-7CK50mTi.cjs} +1 -1
  192. package/dist/{use-form-context-Cw-ETG8f.mjs → use-form-context-ba0N--m6.mjs} +1 -1
  193. package/package.json +9 -9
  194. package/dist/as-ref-BvPM3G73.cjs +0 -353
  195. package/dist/as-ref-C-U7wotf.mjs +0 -348
  196. package/dist/as-ref.vue-D0A4vPXL.d.mts +0 -9
  197. package/dist/as-ref.vue-WufE6ltR.d.cts +0 -9
  198. /package/dist/{_editing-hold-ChPIf1ZC.cjs → _editing-hold-Bj0kZjCr.cjs} +0 -0
  199. /package/dist/{_editing-hold-DVfB2wc_.mjs → _editing-hold-C6emgUTM.mjs} +0 -0
  200. /package/dist/{use-as-locale-WBFjL_OO.mjs → use-as-locale-CznDr-7i.mjs} +0 -0
  201. /package/dist/{use-as-locale-BHltz8Wp.cjs → use-as-locale-eo7FyfaZ.cjs} +0 -0
  202. /package/dist/{variant-label-zYWRiOjJ.mjs → variant-label-CmzTQC2B.mjs} +0 -0
  203. /package/dist/{variant-label-CYIvHn4B.cjs → variant-label-_GLezszT.cjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { Component, ComputedRef, Ref } from "vue";
2
- import { ClientFactory, FormDef, FormDiffOptions, FormFieldChange, FormFieldDef, FormRebaseOptions, FormUnionVariant, TFormAction, TFormEntryOptions, ValueHelpInfo } from "@atscript/ui";
2
+ import { ClientFactory, FormDef, FormDiffOptions, FormFieldChange, FormFieldDef, FormRebaseOptions, FormUnionVariant, TFormAction, TFormEntryOptions, ValueHelpInfo, ValueHelpScope } from "@atscript/ui";
3
3
 
4
4
  //#region src/composables/use-as-form-patch.d.ts
5
5
  /**
@@ -455,6 +455,14 @@ interface TAsComponentProps<V = unknown> extends TAsBaseComponentProps {
455
455
  path: string;
456
456
  /** Resolved value-help descriptor for FK ref fields (`@db.rel.FK` → `@db.http.path`). */
457
457
  valueHelp?: ValueHelpInfo;
458
+ /**
459
+ * The value as `@ui.valueLabel` shows it: the code with the text of the
460
+ * sibling field the annotation names, arranged (`Berlin (BER)`). Shown by
461
+ * read-only text fields and by the reference field while it is not focused;
462
+ * an edited field shows the code. `undefined` without the annotation or
463
+ * while the value is empty. Since 0.1.190.
464
+ */
465
+ valueLabel?: string;
458
466
  /** Singular label for array fields (`@ui.form.label.singular`) — used in "Add <singular>" affordances. */
459
467
  singularLabel?: string;
460
468
  /** Stable input element id, suitable for `<label :for>`. Co-resolved with `errorId` / `descId` so a11y wiring is consistent. Always populated by AsField. */
@@ -565,6 +573,28 @@ interface TAsComponentProps<V = unknown> extends TAsBaseComponentProps {
565
573
  */
566
574
  isDirty?: boolean;
567
575
  }
576
+ /**
577
+ * What `AsRef`'s `trailing` slot (after the input) and `list-end` slot (after
578
+ * the list) receive: enough for another picker of the same field — a dialog,
579
+ * say — to commit through the field's one pick path. Since 0.1.190.
580
+ */
581
+ interface TAsRefSlotProps {
582
+ /** The text typed into the input; empty once the list closed. */
583
+ searchText: string;
584
+ /**
585
+ * The one pick path: commits `row[targetField]`, writes the binding's fills
586
+ * and validates the field. Hand it the row the user picked.
587
+ */
588
+ selectItem: (row: Record<string, unknown>) => void;
589
+ /** The scope the field's picker searches with: the filter with the form's host values. */
590
+ scope: ValueHelpScope;
591
+ /** The client factory of the form (`<AsForm :client-factory>`), when it has one. */
592
+ clientFactory?: ClientFactory;
593
+ /** Closes the list (and puts the value's text back into the input). */
594
+ close: () => void;
595
+ /** Focuses the input without opening the list (e.g. when a dialog it opened closes). */
596
+ focus: () => void;
597
+ }
568
598
  /**
569
599
  * Public emits contract for custom field components used with `AsForm` /
570
600
  * `AsField`. Type your `defineEmits` against this interface so the
@@ -702,4 +732,4 @@ interface AsFormExposed<TFormData = any> extends Pick<AsFormPatchHandle, "getPat
702
732
  readonly changes: readonly FormFieldChange[];
703
733
  }
704
734
  //#endregion
705
- export { useAsFormPatch as S, TFormFieldRegistration as _, TAsCollapsibleSlots as a, AsFormPatchHandle as b, TAsTypeComponents as c, TAsFormValue as d, UseAsFormOptions as f, TFormFieldCallbacks as g, TAsFormError as h, TAsCollapsibleProps as i, TAsUnionContext as l, useAsForm as m, TAsBaseComponentProps as n, TAsComponentEmits as o, UseAsFormReturn as p, TAsChangeType as r, TAsComponentProps as s, AsFormExposed as t, TAsFormSubmitResult as u, TFormRule as v, RebaseOntoResult as x, TFormState as y };
735
+ export { useAsFormPatch as C, RebaseOntoResult as S, TFormFieldCallbacks as _, TAsCollapsibleSlots as a, TFormState as b, TAsRefSlotProps as c, TAsFormSubmitResult as d, TAsFormValue as f, TAsFormError as g, useAsForm as h, TAsCollapsibleProps as i, TAsTypeComponents as l, UseAsFormReturn as m, TAsBaseComponentProps as n, TAsComponentEmits as o, UseAsFormOptions as p, TAsChangeType as r, TAsComponentProps as s, AsFormExposed as t, TAsUnionContext as u, TFormFieldRegistration as v, AsFormPatchHandle as x, TFormRule as y };
@@ -1,5 +1,5 @@
1
1
  import { Component, ComputedRef, Ref } from "vue";
2
- import { ClientFactory, FormDef, FormDiffOptions, FormFieldChange, FormFieldDef, FormRebaseOptions, FormUnionVariant, TFormAction, TFormEntryOptions, ValueHelpInfo } from "@atscript/ui";
2
+ import { ClientFactory, FormDef, FormDiffOptions, FormFieldChange, FormFieldDef, FormRebaseOptions, FormUnionVariant, TFormAction, TFormEntryOptions, ValueHelpInfo, ValueHelpScope } from "@atscript/ui";
3
3
 
4
4
  //#region src/composables/use-as-form-patch.d.ts
5
5
  /**
@@ -455,6 +455,14 @@ interface TAsComponentProps<V = unknown> extends TAsBaseComponentProps {
455
455
  path: string;
456
456
  /** Resolved value-help descriptor for FK ref fields (`@db.rel.FK` → `@db.http.path`). */
457
457
  valueHelp?: ValueHelpInfo;
458
+ /**
459
+ * The value as `@ui.valueLabel` shows it: the code with the text of the
460
+ * sibling field the annotation names, arranged (`Berlin (BER)`). Shown by
461
+ * read-only text fields and by the reference field while it is not focused;
462
+ * an edited field shows the code. `undefined` without the annotation or
463
+ * while the value is empty. Since 0.1.190.
464
+ */
465
+ valueLabel?: string;
458
466
  /** Singular label for array fields (`@ui.form.label.singular`) — used in "Add <singular>" affordances. */
459
467
  singularLabel?: string;
460
468
  /** Stable input element id, suitable for `<label :for>`. Co-resolved with `errorId` / `descId` so a11y wiring is consistent. Always populated by AsField. */
@@ -565,6 +573,28 @@ interface TAsComponentProps<V = unknown> extends TAsBaseComponentProps {
565
573
  */
566
574
  isDirty?: boolean;
567
575
  }
576
+ /**
577
+ * What `AsRef`'s `trailing` slot (after the input) and `list-end` slot (after
578
+ * the list) receive: enough for another picker of the same field — a dialog,
579
+ * say — to commit through the field's one pick path. Since 0.1.190.
580
+ */
581
+ interface TAsRefSlotProps {
582
+ /** The text typed into the input; empty once the list closed. */
583
+ searchText: string;
584
+ /**
585
+ * The one pick path: commits `row[targetField]`, writes the binding's fills
586
+ * and validates the field. Hand it the row the user picked.
587
+ */
588
+ selectItem: (row: Record<string, unknown>) => void;
589
+ /** The scope the field's picker searches with: the filter with the form's host values. */
590
+ scope: ValueHelpScope;
591
+ /** The client factory of the form (`<AsForm :client-factory>`), when it has one. */
592
+ clientFactory?: ClientFactory;
593
+ /** Closes the list (and puts the value's text back into the input). */
594
+ close: () => void;
595
+ /** Focuses the input without opening the list (e.g. when a dialog it opened closes). */
596
+ focus: () => void;
597
+ }
568
598
  /**
569
599
  * Public emits contract for custom field components used with `AsForm` /
570
600
  * `AsField`. Type your `defineEmits` against this interface so the
@@ -702,4 +732,4 @@ interface AsFormExposed<TFormData = any> extends Pick<AsFormPatchHandle, "getPat
702
732
  readonly changes: readonly FormFieldChange[];
703
733
  }
704
734
  //#endregion
705
- export { useAsFormPatch as S, TFormFieldRegistration as _, TAsCollapsibleSlots as a, AsFormPatchHandle as b, TAsTypeComponents as c, TAsFormValue as d, UseAsFormOptions as f, TFormFieldCallbacks as g, TAsFormError as h, TAsCollapsibleProps as i, TAsUnionContext as l, useAsForm as m, TAsBaseComponentProps as n, TAsComponentEmits as o, UseAsFormReturn as p, TAsChangeType as r, TAsComponentProps as s, AsFormExposed as t, TAsFormSubmitResult as u, TFormRule as v, RebaseOntoResult as x, TFormState as y };
735
+ export { useAsFormPatch as C, RebaseOntoResult as S, TFormFieldCallbacks as _, TAsCollapsibleSlots as a, TFormState as b, TAsRefSlotProps as c, TAsFormSubmitResult as d, TAsFormValue as f, TAsFormError as g, useAsForm as h, TAsCollapsibleProps as i, TAsTypeComponents as l, UseAsFormReturn as m, TAsBaseComponentProps as n, TAsComponentEmits as o, UseAsFormOptions as p, TAsChangeType as r, TAsComponentProps as s, AsFormExposed as t, TAsUnionContext as u, TFormFieldRegistration as v, AsFormPatchHandle as x, TFormRule as y };
@@ -145,6 +145,10 @@ var as_date_control_default = /* @__PURE__ */ (0, vue.defineComponent)({
145
145
  type: Object,
146
146
  required: false
147
147
  },
148
+ valueLabel: {
149
+ type: String,
150
+ required: false
151
+ },
148
152
  singularLabel: {
149
153
  type: String,
150
154
  required: false
@@ -145,6 +145,10 @@ var as_date_control_default = /* @__PURE__ */ defineComponent({
145
145
  type: Object,
146
146
  required: false
147
147
  },
148
+ valueLabel: {
149
+ type: String,
150
+ required: false
151
+ },
148
152
  singularLabel: {
149
153
  type: String,
150
154
  required: false
@@ -1,5 +1,5 @@
1
- const require_use_form_context = require("./use-form-context-C5Q9Gznl.cjs");
2
- const require_use_as_locale = require("./use-as-locale-BHltz8Wp.cjs");
1
+ const require_use_form_context = require("./use-form-context-7CK50mTi.cjs");
2
+ const require_use_as_locale = require("./use-as-locale-eo7FyfaZ.cjs");
3
3
  let vue = require("vue");
4
4
  //#region src/composables/use-as-model-texts.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { g as MODEL_TEXTS_KEY } from "./use-form-context-Cw-ETG8f.mjs";
2
- import { o as useAsTexts } from "./use-as-locale-WBFjL_OO.mjs";
1
+ import { g as MODEL_TEXTS_KEY } from "./use-form-context-ba0N--m6.mjs";
2
+ import { o as useAsTexts } from "./use-as-locale-CznDr-7i.mjs";
3
3
  import { inject } from "vue";
4
4
  //#region src/composables/use-as-model-texts.ts
5
5
  /**
@@ -1,12 +1,76 @@
1
- import { o as useAsTexts, s as useUiLocaleKey } from "./use-as-locale-WBFjL_OO.mjs";
1
+ import { _ as PATH_PREFIX_KEY, a as CHANGE_HANDLER_KEY, v as ROOT_DATA_KEY } from "./use-form-context-ba0N--m6.mjs";
2
+ import { o as useAsTexts, s as useUiLocaleKey } from "./use-as-locale-CznDr-7i.mjs";
2
3
  import { computed, getCurrentScope, inject, onMounted, onScopeDispose, onUnmounted, ref, shallowRef, watch } from "vue";
3
- import { ValueHelpClient, getMetaEntry, resolveValueHelp, retainMetaEntry } from "@atscript/ui";
4
+ import { ValueHelpClient, getByPath, getMetaEntry, joinPath, resolveValueHelp, retainMetaEntry, setByPath, valueHelpFills, valueHelpScope } from "@atscript/ui";
5
+ //#region src/composables/use-as-data.ts
6
+ const EMPTY_PATH = computed(() => "");
7
+ const EMPTY_DATA = computed(() => void 0);
8
+ /**
9
+ * Reactive access to form data at any point in the `<AsForm>` tree: readers
10
+ * plus `setValueAt` / `setSibling` writers. Outside a form, all readers
11
+ * return `undefined` and the writers do nothing.
12
+ *
13
+ * Call sites get a `ComputedRef` so they can compose it directly with
14
+ * other reactive primitives without an extra `computed()` wrapper.
15
+ */
16
+ function useAsData() {
17
+ const wrapped = inject(ROOT_DATA_KEY, EMPTY_DATA);
18
+ const pathPrefix = inject(PATH_PREFIX_KEY, EMPTY_PATH);
19
+ const handleChange = inject(CHANGE_HANDLER_KEY, void 0);
20
+ const rootData = computed(() => {
21
+ return wrapped.value?.value;
22
+ });
23
+ function getValueAt(path) {
24
+ return computed(() => {
25
+ const w = wrapped.value;
26
+ if (!w) return void 0;
27
+ return getByPath(w, path);
28
+ });
29
+ }
30
+ function siblingValue(name) {
31
+ return computed(() => {
32
+ const w = wrapped.value;
33
+ if (!w) return void 0;
34
+ return getByPath(w, joinPath(pathPrefix.value, name));
35
+ });
36
+ }
37
+ function setValueAt(path, value) {
38
+ const w = wrapped.value;
39
+ if (!w) return;
40
+ setByPath(w, path, value);
41
+ handleChange?.("update", path, value);
42
+ }
43
+ function setSibling(name, value) {
44
+ setValueAt(joinPath(pathPrefix.value, name), value);
45
+ }
46
+ return {
47
+ rootData,
48
+ getValueAt,
49
+ siblingValue,
50
+ setValueAt,
51
+ setSibling
52
+ };
53
+ }
54
+ //#endregion
4
55
  //#region src/composables/use-as-value-help.ts
5
56
  /** Vue inject key used by `AsForm` to publish a per-form `ClientFactory` override. */
6
57
  const CLIENT_FACTORY_KEY = Symbol("as-client-factory");
7
58
  const DEBOUNCE_MS = 300;
8
59
  function useAsValueHelp(options) {
9
- const { info, model, onBlur } = options;
60
+ const { info, model, onBlur, open, readonly } = options;
61
+ const limit = options.limit ?? 20;
62
+ const data = useAsData();
63
+ const siblings = /* @__PURE__ */ new Map();
64
+ const readSibling = (local) => {
65
+ let value = siblings.get(local);
66
+ if (!value) siblings.set(local, value = data.siblingValue(local));
67
+ return value.value;
68
+ };
69
+ const scope = computed(() => valueHelpScope(info, readSibling));
70
+ /** Siblings the binding reads as host values: a clear never empties them. */
71
+ const hostLocals = new Set(info.hostFilter?.map((h) => h.local));
72
+ /** What this field's last pick wrote into each fill target. */
73
+ const written = /* @__PURE__ */ new Map();
10
74
  const injectedFactory = inject(CLIENT_FACTORY_KEY, null) ?? void 0;
11
75
  const texts = useAsTexts();
12
76
  const scoped = !!getCurrentScope();
@@ -84,9 +148,9 @@ function useAsValueHelp(options) {
84
148
  const result = await vhClient.search(r, {
85
149
  text: text || void 0,
86
150
  mode: "form",
87
- limit: 20,
88
- filter: info.filter,
89
- valueField: info.targetField
151
+ limit,
152
+ filter: scope.value.filter,
153
+ info
90
154
  });
91
155
  if (mine === searchSeq) results.value = result.items;
92
156
  } catch {
@@ -99,17 +163,34 @@ function useAsValueHelp(options) {
99
163
  if (resolved.value) scheduleSearch(text);
100
164
  });
101
165
  watch(resolved, (r) => {
102
- if (r) doSearch(searchText.value);
166
+ if (r && !readonly?.()) doSearch(searchText.value);
167
+ });
168
+ if (info.hostFilter?.length) watch(scope, () => {
169
+ lastSearchedText = void 0;
170
+ if (resolved.value && (!open || open.value)) doSearch(searchText.value);
171
+ });
172
+ if (open) watch(open, (isOpen) => {
173
+ if (isOpen && resolved.value && lastSearchedText === void 0) doSearch(searchText.value);
103
174
  });
104
175
  onMounted(() => {
105
176
  kickoff();
106
177
  });
107
178
  function selectItem(item) {
108
179
  model.value = item[info.targetField];
180
+ written.clear();
181
+ for (const fill of valueHelpFills(info, item)) {
182
+ written.set(fill.local, fill.value);
183
+ if (!Object.is(readSibling(fill.local), fill.value)) data.setSibling(fill.local, fill.value);
184
+ }
109
185
  onBlur();
110
186
  }
111
- function clear(value) {
187
+ function commitValue(value) {
112
188
  model.value = value;
189
+ for (const [local, wrote] of written) if (wrote !== void 0 && !hostLocals.has(local) && Object.is(readSibling(local), wrote)) data.setSibling(local, void 0);
190
+ written.clear();
191
+ }
192
+ function clear(value) {
193
+ commitValue(value);
113
194
  searchText.value = "";
114
195
  doSearch("");
115
196
  }
@@ -122,8 +203,10 @@ function useAsValueHelp(options) {
122
203
  labelIsFkValue,
123
204
  kickoff,
124
205
  selectItem,
125
- clear
206
+ clear,
207
+ commitValue,
208
+ scope
126
209
  };
127
210
  }
128
211
  //#endregion
129
- export { useAsValueHelp as n, CLIENT_FACTORY_KEY as t };
212
+ export { useAsValueHelp as n, useAsData as r, CLIENT_FACTORY_KEY as t };
@@ -1,12 +1,76 @@
1
- const require_use_as_locale = require("./use-as-locale-BHltz8Wp.cjs");
1
+ const require_use_form_context = require("./use-form-context-7CK50mTi.cjs");
2
+ const require_use_as_locale = require("./use-as-locale-eo7FyfaZ.cjs");
2
3
  let vue = require("vue");
3
4
  let _atscript_ui = require("@atscript/ui");
5
+ //#region src/composables/use-as-data.ts
6
+ const EMPTY_PATH = (0, vue.computed)(() => "");
7
+ const EMPTY_DATA = (0, vue.computed)(() => void 0);
8
+ /**
9
+ * Reactive access to form data at any point in the `<AsForm>` tree: readers
10
+ * plus `setValueAt` / `setSibling` writers. Outside a form, all readers
11
+ * return `undefined` and the writers do nothing.
12
+ *
13
+ * Call sites get a `ComputedRef` so they can compose it directly with
14
+ * other reactive primitives without an extra `computed()` wrapper.
15
+ */
16
+ function useAsData() {
17
+ const wrapped = (0, vue.inject)(require_use_form_context.ROOT_DATA_KEY, EMPTY_DATA);
18
+ const pathPrefix = (0, vue.inject)(require_use_form_context.PATH_PREFIX_KEY, EMPTY_PATH);
19
+ const handleChange = (0, vue.inject)(require_use_form_context.CHANGE_HANDLER_KEY, void 0);
20
+ const rootData = (0, vue.computed)(() => {
21
+ return wrapped.value?.value;
22
+ });
23
+ function getValueAt(path) {
24
+ return (0, vue.computed)(() => {
25
+ const w = wrapped.value;
26
+ if (!w) return void 0;
27
+ return (0, _atscript_ui.getByPath)(w, path);
28
+ });
29
+ }
30
+ function siblingValue(name) {
31
+ return (0, vue.computed)(() => {
32
+ const w = wrapped.value;
33
+ if (!w) return void 0;
34
+ return (0, _atscript_ui.getByPath)(w, (0, _atscript_ui.joinPath)(pathPrefix.value, name));
35
+ });
36
+ }
37
+ function setValueAt(path, value) {
38
+ const w = wrapped.value;
39
+ if (!w) return;
40
+ (0, _atscript_ui.setByPath)(w, path, value);
41
+ handleChange?.("update", path, value);
42
+ }
43
+ function setSibling(name, value) {
44
+ setValueAt((0, _atscript_ui.joinPath)(pathPrefix.value, name), value);
45
+ }
46
+ return {
47
+ rootData,
48
+ getValueAt,
49
+ siblingValue,
50
+ setValueAt,
51
+ setSibling
52
+ };
53
+ }
54
+ //#endregion
4
55
  //#region src/composables/use-as-value-help.ts
5
56
  /** Vue inject key used by `AsForm` to publish a per-form `ClientFactory` override. */
6
57
  const CLIENT_FACTORY_KEY = Symbol("as-client-factory");
7
58
  const DEBOUNCE_MS = 300;
8
59
  function useAsValueHelp(options) {
9
- const { info, model, onBlur } = options;
60
+ const { info, model, onBlur, open, readonly } = options;
61
+ const limit = options.limit ?? 20;
62
+ const data = useAsData();
63
+ const siblings = /* @__PURE__ */ new Map();
64
+ const readSibling = (local) => {
65
+ let value = siblings.get(local);
66
+ if (!value) siblings.set(local, value = data.siblingValue(local));
67
+ return value.value;
68
+ };
69
+ const scope = (0, vue.computed)(() => (0, _atscript_ui.valueHelpScope)(info, readSibling));
70
+ /** Siblings the binding reads as host values: a clear never empties them. */
71
+ const hostLocals = new Set(info.hostFilter?.map((h) => h.local));
72
+ /** What this field's last pick wrote into each fill target. */
73
+ const written = /* @__PURE__ */ new Map();
10
74
  const injectedFactory = (0, vue.inject)(CLIENT_FACTORY_KEY, null) ?? void 0;
11
75
  const texts = require_use_as_locale.useAsTexts();
12
76
  const scoped = !!(0, vue.getCurrentScope)();
@@ -84,9 +148,9 @@ function useAsValueHelp(options) {
84
148
  const result = await vhClient.search(r, {
85
149
  text: text || void 0,
86
150
  mode: "form",
87
- limit: 20,
88
- filter: info.filter,
89
- valueField: info.targetField
151
+ limit,
152
+ filter: scope.value.filter,
153
+ info
90
154
  });
91
155
  if (mine === searchSeq) results.value = result.items;
92
156
  } catch {
@@ -99,17 +163,34 @@ function useAsValueHelp(options) {
99
163
  if (resolved.value) scheduleSearch(text);
100
164
  });
101
165
  (0, vue.watch)(resolved, (r) => {
102
- if (r) doSearch(searchText.value);
166
+ if (r && !readonly?.()) doSearch(searchText.value);
167
+ });
168
+ if (info.hostFilter?.length) (0, vue.watch)(scope, () => {
169
+ lastSearchedText = void 0;
170
+ if (resolved.value && (!open || open.value)) doSearch(searchText.value);
171
+ });
172
+ if (open) (0, vue.watch)(open, (isOpen) => {
173
+ if (isOpen && resolved.value && lastSearchedText === void 0) doSearch(searchText.value);
103
174
  });
104
175
  (0, vue.onMounted)(() => {
105
176
  kickoff();
106
177
  });
107
178
  function selectItem(item) {
108
179
  model.value = item[info.targetField];
180
+ written.clear();
181
+ for (const fill of (0, _atscript_ui.valueHelpFills)(info, item)) {
182
+ written.set(fill.local, fill.value);
183
+ if (!Object.is(readSibling(fill.local), fill.value)) data.setSibling(fill.local, fill.value);
184
+ }
109
185
  onBlur();
110
186
  }
111
- function clear(value) {
187
+ function commitValue(value) {
112
188
  model.value = value;
189
+ for (const [local, wrote] of written) if (wrote !== void 0 && !hostLocals.has(local) && Object.is(readSibling(local), wrote)) data.setSibling(local, void 0);
190
+ written.clear();
191
+ }
192
+ function clear(value) {
193
+ commitValue(value);
113
194
  searchText.value = "";
114
195
  doSearch("");
115
196
  }
@@ -122,7 +203,9 @@ function useAsValueHelp(options) {
122
203
  labelIsFkValue,
123
204
  kickoff,
124
205
  selectItem,
125
- clear
206
+ clear,
207
+ commitValue,
208
+ scope
126
209
  };
127
210
  }
128
211
  //#endregion
@@ -132,6 +215,12 @@ Object.defineProperty(exports, "CLIENT_FACTORY_KEY", {
132
215
  return CLIENT_FACTORY_KEY;
133
216
  }
134
217
  });
218
+ Object.defineProperty(exports, "useAsData", {
219
+ enumerable: true,
220
+ get: function() {
221
+ return useAsData;
222
+ }
223
+ });
135
224
  Object.defineProperty(exports, "useAsValueHelp", {
136
225
  enumerable: true,
137
226
  get: function() {
@@ -1,4 +1,4 @@
1
- const require_use_as_locale = require("./use-as-locale-BHltz8Wp.cjs");
1
+ const require_use_as_locale = require("./use-as-locale-eo7FyfaZ.cjs");
2
2
  let vue = require("vue");
3
3
  let _atscript_ui = require("@atscript/ui");
4
4
  //#region src/composables/internal-keys.ts
@@ -1,4 +1,4 @@
1
- import { o as useAsTexts } from "./use-as-locale-WBFjL_OO.mjs";
1
+ import { o as useAsTexts } from "./use-as-locale-CznDr-7i.mjs";
2
2
  import { computed, inject, provide } from "vue";
3
3
  import { createFormData, createFormValueResolver, getByPath, joinPath, setByPath } from "@atscript/ui";
4
4
  //#region src/composables/internal-keys.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/vue-form",
3
- "version": "0.1.189",
3
+ "version": "0.1.191",
4
4
  "description": "Type-driven form rendering for Atscript with Vue 3",
5
5
  "keywords": [
6
6
  "atscript",
@@ -165,27 +165,27 @@
165
165
  "access": "public"
166
166
  },
167
167
  "dependencies": {
168
- "@atscript/ui": "^0.1.189",
169
- "@atscript/ui-fns": "^0.1.189"
168
+ "@atscript/ui": "^0.1.191",
169
+ "@atscript/ui-fns": "^0.1.191"
170
170
  },
171
171
  "devDependencies": {
172
- "@atscript/core": "^0.2.22",
173
- "@atscript/db-client": "^0.1.195",
174
- "@atscript/typescript": "^0.2.22",
172
+ "@atscript/core": "^0.2.23",
173
+ "@atscript/db-client": "^0.1.196",
174
+ "@atscript/typescript": "^0.2.23",
175
175
  "@tsdown/css": "^0.21.4",
176
176
  "@vitejs/plugin-vue": "^6",
177
177
  "@vue/test-utils": "^2",
178
178
  "happy-dom": "^18",
179
179
  "reka-ui": "^2.9.8",
180
- "unplugin-atscript": "^0.2.22",
180
+ "unplugin-atscript": "^0.2.23",
181
181
  "vitest": "npm:@voidzero-dev/vite-plus-test@0.1.14",
182
182
  "vue": "^3",
183
183
  "vue-tsc": "~3.2.9",
184
184
  "vunor": "^0.4.5"
185
185
  },
186
186
  "peerDependencies": {
187
- "@atscript/db-client": "^0.1.195",
188
- "@atscript/typescript": "^0.2.22",
187
+ "@atscript/db-client": "^0.1.196",
188
+ "@atscript/typescript": "^0.2.23",
189
189
  "reka-ui": "^2.9.8",
190
190
  "vue": "^3"
191
191
  },