@stonecrop/aform 0.60.0 → 0.60.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/aform.js CHANGED
@@ -1,4 +1,4 @@
1
- import { hasBadgeOptions, isBadgeDescriptor, lookupBadge, partsPatch, readParts, selectChoices } from "@stonecrop/schema";
1
+ import { flattenFields, hasBadgeOptions, isBadgeDescriptor, lookupBadge, partsPatch, readParts, selectChoices } from "@stonecrop/schema";
2
2
  import { TABLE_TUPLE_CURRENCY_PICKER, TABLE_TUPLE_QUANTITY_PICKER, install as install$1, isTableTuplePickerModal } from "@stonecrop/atable";
3
3
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, inject, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, toHandlers, unref, useId, useModel, useTemplateRef, vModelCheckbox, vModelRadio, vModelSelect, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
4
4
  import { currencyAmountEntryPattern, currencyAmountSeparators, currencyInputFractionDigits, formatCurrencyAmount, formatCurrencyAmountInput, formatCurrencySymbol, fromISODate, isSemver, isSemverPrefix, parseCurrencyAmountInput, roundToPrecision, useArithmeticInput } from "@stonecrop/utilities";
@@ -114,6 +114,15 @@ function resolvedFieldsToColumns(fields) {
114
114
  return columns;
115
115
  }
116
116
  // src/composables/fieldErrorA11y.ts
117
+ /**
118
+ * The message a field shows: the errors it is handed, joined, and nothing when it is handed none.
119
+ *
120
+ * A field only shows; it never words. Wording an error reported without a message is AForm's job
121
+ * (see `wordErrors`), since only the form knows which field each error came from.
122
+ */
123
+ function fieldErrorText(errors) {
124
+ return (errors ?? []).filter(Boolean).join("; ");
125
+ }
117
126
  function fieldErrorA11y(uuid, errorText, extraDescribedBy) {
118
127
  const errorId = computed(() => uuid ? `${uuid}-error` : void 0);
119
128
  const hasError = computed(() => Boolean(errorText.value));
@@ -151,7 +160,7 @@ var ACheckbox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
151
160
  required: { type: Boolean },
152
161
  mode: {},
153
162
  uuid: {},
154
- validation: { default: () => ({ errorMessage: "" }) },
163
+ validation: {},
155
164
  errors: {}
156
165
  }, {
157
166
  "modelValue": { type: [
@@ -164,7 +173,7 @@ var ACheckbox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
164
173
  }),
165
174
  emits: ["update:modelValue"],
166
175
  setup(__props) {
167
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
176
+ const errorText = computed(() => fieldErrorText(__props.errors));
168
177
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
169
178
  const checkbox = useModel(__props, "modelValue");
170
179
  return (_ctx, _cache) => {
@@ -199,7 +208,7 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
199
208
  return target;
200
209
  };
201
210
  // src/components/form/ACheckbox.vue
202
- var ACheckbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ACheckbox_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-f28e7db6"]]);
211
+ var ACheckbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ACheckbox_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-fd79e86d"]]);
203
212
  // src/utils/linkValue.ts
204
213
  function linkId(value) {
205
214
  if (value == null) return void 0;
@@ -461,7 +470,7 @@ var ADropdown_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
461
470
  required: { type: Boolean },
462
471
  mode: {},
463
472
  uuid: {},
464
- validation: { default: () => ({ errorMessage: "" }) },
473
+ validation: {},
465
474
  errors: {},
466
475
  options: { default: () => [] },
467
476
  format: {},
@@ -510,7 +519,7 @@ var ADropdown_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
510
519
  const badgeDescriptor = computed(() => linkPicker.value ? null : resolveFieldBadge(search.value, __props.options, formatFn.value));
511
520
  const inputAccentStyle = computed(() => badgeInputAccentStyle(badgeDescriptor.value ?? void 0));
512
521
  const displayAccentStyle = computed(() => badgeInputAccentStyle(badgeDescriptor.value ?? void 0));
513
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
522
+ const errorText = computed(() => fieldErrorText(__props.errors));
514
523
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
515
524
  const modelValue = useModel(__props, "modelValue");
516
525
  const linkModel = useModel(__props, "linkValue");
@@ -854,7 +863,7 @@ var ADropdown_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
854
863
  }, toDisplayString(errorText.value), 9, _hoisted_11$5)), [[vShow, errorText.value]]) : createCommentVNode("", true)], 64))], 2);
855
864
  };
856
865
  }
857
- }), [["__scopeId", "data-v-a96ab394"]]);
866
+ }), [["__scopeId", "data-v-486dd9d1"]]);
858
867
  // src/components/form/ACurrencyInput.vue?vue&type=script&setup=true&lang.ts
859
868
  var _hoisted_1$23 = { class: "aform_form-element acurrency" };
860
869
  var _hoisted_2$19 = { class: "aform_display-value" };
@@ -904,7 +913,7 @@ var ACurrencyInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
904
913
  required: { type: Boolean },
905
914
  mode: {},
906
915
  uuid: {},
907
- validation: { default: () => ({ errorMessage: "" }) },
916
+ validation: {},
908
917
  errors: {},
909
918
  options: { default: () => ({}) },
910
919
  currencyLabel: { default: "Currency" }
@@ -914,7 +923,7 @@ var ACurrencyInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
914
923
  }),
915
924
  emits: ["update:modelValue"],
916
925
  setup(__props) {
917
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
926
+ const errorText = computed(() => fieldErrorText(__props.errors));
918
927
  const helperId = computed(() => __props.uuid ? `${__props.uuid}-helper` : void 0);
919
928
  const modelValue = useModel(__props, "modelValue");
920
929
  const shown = computed(() => {
@@ -1191,7 +1200,7 @@ var ACurrencyInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
1191
1200
  ], 64))]);
1192
1201
  };
1193
1202
  }
1194
- }), [["__scopeId", "data-v-c18d0c0d"]]);
1203
+ }), [["__scopeId", "data-v-2aebb435"]]);
1195
1204
  // src/utils/typedDay.ts
1196
1205
  var TYPED_DAY_FORMAT = {
1197
1206
  calendar: "gregory",
@@ -1273,7 +1282,7 @@ var ADatePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
1273
1282
  required: { type: Boolean },
1274
1283
  mode: {},
1275
1284
  uuid: {},
1276
- validation: { default: () => ({ errorMessage: "" }) },
1285
+ validation: {},
1277
1286
  errors: {}
1278
1287
  }, {
1279
1288
  "modelValue": {},
@@ -1281,7 +1290,7 @@ var ADatePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
1281
1290
  }),
1282
1291
  emits: /*@__PURE__*/ mergeModels(["get-date"], ["update:modelValue"]),
1283
1292
  setup(__props, { expose: __expose, emit: __emit }) {
1284
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
1293
+ const errorText = computed(() => fieldErrorText(__props.errors));
1285
1294
  const { errorId } = fieldErrorA11y(__props.uuid, errorText);
1286
1295
  const date = useModel(__props, "modelValue");
1287
1296
  const selectedDate = ref(fromISODate(date.value ?? "") ?? Temporal.Now.plainDateISO());
@@ -1569,7 +1578,7 @@ var ADatePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
1569
1578
  }, toDisplayString(errorText.value), 9, _hoisted_14$1), [[vShow, errorText.value]])], 64));
1570
1579
  };
1571
1580
  }
1572
- }), [["__scopeId", "data-v-d0133599"]]);
1581
+ }), [["__scopeId", "data-v-2d02eab2"]]);
1573
1582
  // src/components/form/ADateTimeInput.vue?vue&type=script&setup=true&lang.ts
1574
1583
  var _hoisted_1$21 = { class: "adate_time" };
1575
1584
  var _hoisted_2$17 = { class: "adate_time_fields" };
@@ -1970,7 +1979,7 @@ var ADate_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
1970
1979
  required: { type: Boolean },
1971
1980
  mode: {},
1972
1981
  uuid: {},
1973
- validation: { default: () => ({ errorMessage: "" }) },
1982
+ validation: {},
1974
1983
  errors: {}
1975
1984
  }, {
1976
1985
  "modelValue": {},
@@ -1978,7 +1987,7 @@ var ADate_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
1978
1987
  }),
1979
1988
  emits: ["update:modelValue"],
1980
1989
  setup(__props) {
1981
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
1990
+ const errorText = computed(() => fieldErrorText(__props.errors));
1982
1991
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
1983
1992
  const modelValue = useModel(__props, "modelValue");
1984
1993
  const boxDay = computed({
@@ -2043,7 +2052,7 @@ var ADate_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
2043
2052
  ], 64))], 32);
2044
2053
  };
2045
2054
  }
2046
- }), [["__scopeId", "data-v-16f8f8f2"]]);
2055
+ }), [["__scopeId", "data-v-ea25d026"]]);
2047
2056
  // src/components/form/ABadge.vue
2048
2057
  var ABadge_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
2049
2058
  __name: "ABadge",
@@ -2131,7 +2140,7 @@ var ASegmentedControl_default = /*#__PURE__*/ _plugin_vue_export_helper_default(
2131
2140
  required: { type: Boolean },
2132
2141
  mode: {},
2133
2142
  uuid: {},
2134
- validation: { default: () => ({ errorMessage: "" }) },
2143
+ validation: {},
2135
2144
  errors: {},
2136
2145
  options: { default: () => void 0 },
2137
2146
  size: { default: "sm" },
@@ -2165,7 +2174,7 @@ var ASegmentedControl_default = /*#__PURE__*/ _plugin_vue_export_helper_default(
2165
2174
  selected.value = value;
2166
2175
  }
2167
2176
  });
2168
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
2177
+ const errorText = computed(() => fieldErrorText(__props.errors));
2169
2178
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
2170
2179
  const fallbackId = useId();
2171
2180
  const groupName = computed(() => __props.uuid ?? `aform-segmented-${fallbackId}`);
@@ -2270,7 +2279,7 @@ var ASegmentedControl_default = /*#__PURE__*/ _plugin_vue_export_helper_default(
2270
2279
  ], 64))], 2);
2271
2280
  };
2272
2281
  }
2273
- }), [["__scopeId", "data-v-8b740fd8"]]);
2282
+ }), [["__scopeId", "data-v-07144f65"]]);
2274
2283
  // src/components/form/ADateTime.vue?vue&type=script&setup=true&lang.ts
2275
2284
  var _hoisted_1$17 = { class: "aform_display-value" };
2276
2285
  var _hoisted_2$13 = { class: "aform_field-label" };
@@ -2296,7 +2305,7 @@ var ADateTime_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
2296
2305
  required: { type: Boolean },
2297
2306
  mode: {},
2298
2307
  uuid: {},
2299
- validation: { default: () => ({ errorMessage: "" }) },
2308
+ validation: {},
2300
2309
  errors: {},
2301
2310
  allowMilitaryTime: {
2302
2311
  type: Boolean,
@@ -2312,7 +2321,7 @@ var ADateTime_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
2312
2321
  }),
2313
2322
  emits: ["update:modelValue"],
2314
2323
  setup(__props) {
2315
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
2324
+ const errorText = computed(() => fieldErrorText(__props.errors));
2316
2325
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
2317
2326
  const modelValue = useModel(__props, "modelValue");
2318
2327
  /** Now, cut down to the smallest unit the picker shows, so a pick that leaves the time alone saves the time shown. */
@@ -2450,7 +2459,7 @@ var ADateTime_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
2450
2459
  ], 64))], 32);
2451
2460
  };
2452
2461
  }
2453
- }), [["__scopeId", "data-v-05cbbabe"]]);
2462
+ }), [["__scopeId", "data-v-e0566056"]]);
2454
2463
  // src/components/form/ADuration.vue?vue&type=script&setup=true&lang.ts
2455
2464
  var _hoisted_1$16 = { class: "aduration" };
2456
2465
  var _hoisted_2$12 = { class: "aform_display-value" };
@@ -2561,7 +2570,7 @@ var ADateRange_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
2561
2570
  required: { type: Boolean },
2562
2571
  mode: {},
2563
2572
  uuid: {},
2564
- validation: { default: () => ({ errorMessage: "" }) },
2573
+ validation: {},
2565
2574
  errors: {}
2566
2575
  }, {
2567
2576
  "modelValue": { default: () => ({
@@ -2573,7 +2582,7 @@ var ADateRange_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
2573
2582
  emits: ["update:modelValue"],
2574
2583
  setup(__props) {
2575
2584
  const fmt = (d) => fromISODate(d)?.toLocaleString() ?? "Invalid Date";
2576
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
2585
+ const errorText = computed(() => fieldErrorText(__props.errors));
2577
2586
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
2578
2587
  const modelValue = useModel(__props, "modelValue");
2579
2588
  const readDay = (day) => day ? fromISODate(day) ?? null : null;
@@ -2670,7 +2679,24 @@ var ADateRange_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
2670
2679
  ], 64))], 32);
2671
2680
  };
2672
2681
  }
2673
- }), [["__scopeId", "data-v-ac2c160b"]]);
2682
+ }), [["__scopeId", "data-v-0e870cba"]]);
2683
+ // src/utils/fieldErrors.ts
2684
+ /**
2685
+ * The errors reported on one field, worded for display.
2686
+ *
2687
+ * An error reported without a message (a trigger's `setError(field)`) takes the field's own
2688
+ * `validation.errorMessage`; one with no message and no wording to give it is dropped. A static
2689
+ * message is never an error on its own: a field cannot tell that its value failed validation, so a
2690
+ * message shown with no reported error would sit on every record, valid or not, and mark the input
2691
+ * `aria-invalid` for a screen reader.
2692
+ *
2693
+ * Applied by AForm, the only place that knows which field an error came from: a component bound to
2694
+ * several fields' parts is handed all of their errors and cannot tell whose wording each one needs.
2695
+ */
2696
+ function wordErrors(errors, validation) {
2697
+ const messages = errors.map((error) => error || validation?.errorMessage || "").filter(Boolean);
2698
+ return [...new Set(messages)];
2699
+ }
2674
2700
  // src/components/AForm.vue?vue&type=script&setup=true&lang.ts
2675
2701
  var _hoisted_1$14 = { class: "aform" };
2676
2702
  var _hoisted_2$10 = {
@@ -2782,10 +2808,18 @@ var AForm_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
2782
2808
  return declared === "edit" && !heard.value ? "read" : declared;
2783
2809
  }
2784
2810
  const fieldParts = (field) => field.kind === "field" || field.kind === "table" ? field.parts : void 0;
2811
+ const fieldsByName = computed(() => new Map(flattenFields(__props.schema).map((field) => [field.fieldname, field])));
2812
+ const formErrors = computed(() => {
2813
+ if (!__props.errors) return void 0;
2814
+ return Object.fromEntries(Object.entries(__props.errors).map(([fieldname, list]) => {
2815
+ const field = fieldsByName.value.get(fieldname);
2816
+ return [fieldname, wordErrors(list, field && "validation" in field ? field.validation : void 0)];
2817
+ }));
2818
+ });
2785
2819
  const fieldErrors = (field) => {
2786
2820
  const parts = fieldParts(field);
2787
- if (!parts) return __props.errors?.[field.fieldname];
2788
- return [.../* @__PURE__ */ new Set([field.fieldname, ...Object.values(parts)])].flatMap((fieldname) => __props.errors?.[fieldname] ?? []);
2821
+ if (!parts) return formErrors.value?.[field.fieldname];
2822
+ return [.../* @__PURE__ */ new Set([field.fieldname, ...Object.values(parts)])].flatMap((fieldname) => formErrors.value?.[fieldname] ?? []);
2789
2823
  };
2790
2824
  const childModelsCache = ref([]);
2791
2825
  watchEffect(() => {
@@ -2829,7 +2863,7 @@ var AForm_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
2829
2863
  schema: componentObj.schema,
2830
2864
  label: componentObj.label,
2831
2865
  collapsible: componentObj.collapsible,
2832
- errors: __props.errors
2866
+ errors: formErrors.value
2833
2867
  }, toHandlers(listenersWhenHeard(updateFieldsetData))), null, 16, [
2834
2868
  "data",
2835
2869
  "mode",
@@ -2871,7 +2905,7 @@ var AForm_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
2871
2905
  }), 128))]);
2872
2906
  };
2873
2907
  }
2874
- }), [["__scopeId", "data-v-9065abbb"]]);
2908
+ }), [["__scopeId", "data-v-33120a88"]]);
2875
2909
  // src/components/base/CollapseButton.vue
2876
2910
  var CollapseButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
2877
2911
  __name: "CollapseButton",
@@ -3047,7 +3081,7 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3047
3081
  required: { type: Boolean },
3048
3082
  mode: {},
3049
3083
  uuid: {},
3050
- validation: { default: () => ({ errorMessage: "" }) },
3084
+ validation: {},
3051
3085
  errors: {},
3052
3086
  doctype: { default: () => void 0 },
3053
3087
  formatter: {
@@ -3083,7 +3117,7 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3083
3117
  emits: ["update:modelValue"],
3084
3118
  setup(__props) {
3085
3119
  const listboxId = `${__props.uuid ?? `aform-link-${useId()}`}-listbox`;
3086
- const errorText = computed(() => __props.embedded ? "" : __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
3120
+ const errorText = computed(() => __props.embedded ? "" : fieldErrorText(__props.errors));
3087
3121
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
3088
3122
  const modelValue = useModel(__props, "modelValue");
3089
3123
  const hasValidId = computed(() => linkId(modelValue.value) !== void 0);
@@ -3148,19 +3182,22 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3148
3182
  const id = linkId(modelValue.value);
3149
3183
  return id !== void 0 && String(option.id) === String(id);
3150
3184
  };
3185
+ let latestSearch = 0;
3151
3186
  const openDropdown = async (text) => {
3152
3187
  if (!__props.filterFunction || __props.mode === "read") return;
3188
+ const search = ++latestSearch;
3153
3189
  activeIndex.value = null;
3154
3190
  dropdownOpen.value = true;
3155
3191
  if (__props.isAsync) loading.value = true;
3192
+ let results;
3156
3193
  try {
3157
- const fn = typeof __props.filterFunction === "string" ? deserializeFunction(__props.filterFunction) : __props.filterFunction;
3158
- dropdownResults.value = await fn(text) ?? [];
3194
+ results = await (typeof __props.filterFunction === "string" ? deserializeFunction(__props.filterFunction) : __props.filterFunction)(text) ?? [];
3159
3195
  } catch {
3160
- dropdownResults.value = [];
3161
- } finally {
3162
- loading.value = false;
3196
+ results = [];
3163
3197
  }
3198
+ if (search !== latestSearch) return;
3199
+ dropdownResults.value = results;
3200
+ loading.value = false;
3164
3201
  };
3165
3202
  const closeDropdown = () => {
3166
3203
  dropdownOpen.value = false;
@@ -3185,17 +3222,21 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3185
3222
  dropdownOpen.value = false;
3186
3223
  activeIndex.value = null;
3187
3224
  };
3225
+ const listShown = () => dropdownOpen.value && !loading.value;
3188
3226
  const selectNext = () => {
3227
+ if (!listShown()) return;
3189
3228
  const len = dropdownResults.value.length;
3190
3229
  if (!len) return;
3191
3230
  activeIndex.value = activeIndex.value === null ? 0 : (activeIndex.value + 1) % len;
3192
3231
  };
3193
3232
  const selectPrev = () => {
3233
+ if (!listShown()) return;
3194
3234
  if (!dropdownResults.value.length) return;
3195
3235
  if (activeIndex.value === null || activeIndex.value === 0) activeIndex.value = null;
3196
3236
  else activeIndex.value -= 1;
3197
3237
  };
3198
3238
  const selectCurrent = () => {
3239
+ if (!listShown()) return;
3199
3240
  if (activeIndex.value !== null && dropdownResults.value[activeIndex.value]) selectOption(dropdownResults.value[activeIndex.value]);
3200
3241
  };
3201
3242
  return (_ctx, _cache) => {
@@ -3273,7 +3314,7 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3273
3314
  ])) : createCommentVNode("", true)])), [[unref(vOnClickOutside), onClickOutside]]), __props.label && !__props.embedded ? (openBlock(), createElementBlock("label", _hoisted_15, toDisplayString(__props.label), 1)) : createCommentVNode("", true)], 64))], 2);
3274
3315
  };
3275
3316
  }
3276
- }), [["__scopeId", "data-v-df32226b"]]);
3317
+ }), [["__scopeId", "data-v-7ea13bc7"]]);
3277
3318
  // src/components/form/ANumericInput.vue?vue&type=script&setup=true&lang.ts
3278
3319
  var _hoisted_1$11 = { class: "aform_form-element" };
3279
3320
  var _hoisted_2$7 = { class: "aform_display-value" };
@@ -3305,7 +3346,7 @@ var ANumericInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
3305
3346
  required: { type: Boolean },
3306
3347
  mode: {},
3307
3348
  uuid: {},
3308
- validation: { default: () => ({ errorMessage: "" }) },
3349
+ validation: {},
3309
3350
  errors: {},
3310
3351
  options: { default: () => ({}) }
3311
3352
  }, {
@@ -3314,7 +3355,7 @@ var ANumericInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
3314
3355
  }),
3315
3356
  emits: ["update:modelValue"],
3316
3357
  setup(__props) {
3317
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
3358
+ const errorText = computed(() => fieldErrorText(__props.errors));
3318
3359
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
3319
3360
  const inputNumber = useModel(__props, "modelValue");
3320
3361
  const boxNumber = computed({
@@ -3361,7 +3402,7 @@ var ANumericInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
3361
3402
  ], 64))]);
3362
3403
  };
3363
3404
  }
3364
- }), [["__scopeId", "data-v-d13e377b"]]);
3405
+ }), [["__scopeId", "data-v-21f65960"]]);
3365
3406
  // src/utils/quantityValue.ts
3366
3407
  /** What a quantity box may hold, typed or pasted: digits, one decimal point and a leading minus sign. */
3367
3408
  var quantityEntryPattern = /^-?\d*\.?\d*$/;
@@ -3426,7 +3467,7 @@ var AQuantityInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
3426
3467
  required: { type: Boolean },
3427
3468
  mode: {},
3428
3469
  uuid: {},
3429
- validation: { default: () => ({ errorMessage: "" }) },
3470
+ validation: {},
3430
3471
  errors: {},
3431
3472
  options: { default: () => ({}) },
3432
3473
  uomLabel: { default: "UOM" }
@@ -3436,7 +3477,7 @@ var AQuantityInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
3436
3477
  }),
3437
3478
  emits: ["update:modelValue"],
3438
3479
  setup(__props) {
3439
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
3480
+ const errorText = computed(() => fieldErrorText(__props.errors));
3440
3481
  const helperId = computed(() => __props.uuid ? `${__props.uuid}-helper` : void 0);
3441
3482
  const helperDescribedBy = computed(() => showStock.value && !errorText.value ? helperId.value : void 0);
3442
3483
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText, helperDescribedBy);
@@ -3565,7 +3606,7 @@ var AQuantityInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
3565
3606
  ], 64))]);
3566
3607
  };
3567
3608
  }
3568
- }), [["__scopeId", "data-v-72062eb6"]]);
3609
+ }), [["__scopeId", "data-v-c08ba0bf"]]);
3569
3610
  // src/components/form/ASemverInput.vue?vue&type=script&setup=true&lang.ts
3570
3611
  var _hoisted_1$9 = { class: "aform_form-element" };
3571
3612
  var _hoisted_2$5 = { class: "aform_display-value" };
@@ -3591,7 +3632,7 @@ var ASemverInput_default = /* @__PURE__ */ defineComponent({
3591
3632
  required: { type: Boolean },
3592
3633
  mode: {},
3593
3634
  uuid: {},
3594
- validation: { default: () => ({ errorMessage: "" }) },
3635
+ validation: {},
3595
3636
  errors: {}
3596
3637
  }, {
3597
3638
  "modelValue": {},
@@ -3599,7 +3640,7 @@ var ASemverInput_default = /* @__PURE__ */ defineComponent({
3599
3640
  }),
3600
3641
  emits: ["update:modelValue"],
3601
3642
  setup(__props) {
3602
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
3643
+ const errorText = computed(() => fieldErrorText(__props.errors));
3603
3644
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
3604
3645
  const version = useModel(__props, "modelValue");
3605
3646
  const text = ref("");
@@ -3759,7 +3800,7 @@ var ATextInput_default = /* @__PURE__ */ defineComponent({
3759
3800
  required: { type: Boolean },
3760
3801
  mode: {},
3761
3802
  uuid: {},
3762
- validation: { default: () => ({ errorMessage: "" }) },
3803
+ validation: {},
3763
3804
  errors: {}
3764
3805
  }, {
3765
3806
  "modelValue": {},
@@ -3767,7 +3808,7 @@ var ATextInput_default = /* @__PURE__ */ defineComponent({
3767
3808
  }),
3768
3809
  emits: ["update:modelValue"],
3769
3810
  setup(__props) {
3770
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
3811
+ const errorText = computed(() => fieldErrorText(__props.errors));
3771
3812
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
3772
3813
  const maskFilled = ref(true);
3773
3814
  const inputText = useModel(__props, "modelValue");
@@ -3823,7 +3864,7 @@ var ATextboxInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
3823
3864
  required: { type: Boolean },
3824
3865
  mode: {},
3825
3866
  uuid: {},
3826
- validation: { default: () => ({ errorMessage: "" }) },
3867
+ validation: {},
3827
3868
  errors: {},
3828
3869
  placeholder: { default: "" },
3829
3870
  rows: { default: 4 },
@@ -3834,7 +3875,7 @@ var ATextboxInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
3834
3875
  }),
3835
3876
  emits: ["update:modelValue"],
3836
3877
  setup(__props) {
3837
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
3878
+ const errorText = computed(() => fieldErrorText(__props.errors));
3838
3879
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
3839
3880
  const inputText = useModel(__props, "modelValue");
3840
3881
  return (_ctx, _cache) => {
@@ -3863,7 +3904,7 @@ var ATextboxInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
3863
3904
  ], 64))]);
3864
3905
  };
3865
3906
  }
3866
- }), [["__scopeId", "data-v-19e611fa"]]);
3907
+ }), [["__scopeId", "data-v-14b32545"]]);
3867
3908
  // src/components/utilities/Login.vue?vue&type=script&setup=true&lang.ts
3868
3909
  var _hoisted_1$6 = { class: "login-container" };
3869
3910
  var _hoisted_2$2 = { class: "account-container" };