@stonecrop/aform 0.58.3 → 0.58.4

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
@@ -891,8 +891,8 @@ var _hoisted_12$4 = {
891
891
  "aria-hidden": "true"
892
892
  };
893
893
  var _hoisted_13$2 = ["value"];
894
- var _hoisted_14$1 = ["id"];
895
- var _hoisted_15 = ["id"];
894
+ var _hoisted_14$2 = ["id"];
895
+ var _hoisted_15$1 = ["id"];
896
896
  // src/components/form/ACurrencyInput.vue
897
897
  var ACurrencyInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
898
898
  __name: "ACurrencyInput",
@@ -1182,12 +1182,12 @@ var ACurrencyInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
1182
1182
  key: 0,
1183
1183
  id: helperId.value,
1184
1184
  class: "acurrency__helper"
1185
- }, toDisplayString(conversionHelperText.value), 9, _hoisted_14$1)) : createCommentVNode("", true),
1185
+ }, toDisplayString(conversionHelperText.value), 9, _hoisted_14$2)) : createCommentVNode("", true),
1186
1186
  withDirectives(createElementVNode("p", {
1187
1187
  id: unref(errorId),
1188
1188
  class: "aform_error",
1189
1189
  role: "alert"
1190
- }, toDisplayString(errorText.value), 9, _hoisted_15), [[vShow, errorText.value]])
1190
+ }, toDisplayString(errorText.value), 9, _hoisted_15$1), [[vShow, errorText.value]])
1191
1191
  ], 64))]);
1192
1192
  };
1193
1193
  }
@@ -1256,7 +1256,7 @@ var _hoisted_13$1 = [
1256
1256
  "onKeydown",
1257
1257
  "onMouseover"
1258
1258
  ];
1259
- var _hoisted_14 = ["id"];
1259
+ var _hoisted_14$1 = ["id"];
1260
1260
  var numberOfRows = 6;
1261
1261
  var numberOfColumns = 7;
1262
1262
  // src/components/form/ADatePicker.vue
@@ -1566,7 +1566,7 @@ var ADatePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
1566
1566
  id: unref(errorId),
1567
1567
  class: "aform_error",
1568
1568
  role: "alert"
1569
- }, toDisplayString(errorText.value), 9, _hoisted_14), [[vShow, errorText.value]])], 64));
1569
+ }, toDisplayString(errorText.value), 9, _hoisted_14$1), [[vShow, errorText.value]])], 64));
1570
1570
  };
1571
1571
  }
1572
1572
  }), [["__scopeId", "data-v-d0133599"]]);
@@ -3010,38 +3010,42 @@ var _hoisted_2$8 = {
3010
3010
  };
3011
3011
  var _hoisted_3$6 = { class: "aform_form-link-wrapper" };
3012
3012
  var _hoisted_4$6 = { class: "input-group" };
3013
- var _hoisted_5$6 = [
3013
+ var _hoisted_5$6 = { class: "aform_form-link-field" };
3014
+ var _hoisted_6$6 = [
3014
3015
  "placeholder",
3015
3016
  "aria-label",
3016
3017
  "required",
3018
+ "aria-invalid",
3019
+ "aria-describedby",
3017
3020
  "aria-expanded",
3018
3021
  "aria-controls",
3019
3022
  "aria-activedescendant",
3020
3023
  "disabled",
3021
3024
  "onKeydown"
3022
3025
  ];
3023
- var _hoisted_6$6 = ["onKeydown"];
3024
- var _hoisted_7$3 = ["data-icon"];
3025
- var _hoisted_8$2 = {
3026
+ var _hoisted_7$3 = ["id"];
3027
+ var _hoisted_8$2 = ["onKeydown"];
3028
+ var _hoisted_9$2 = ["data-icon"];
3029
+ var _hoisted_10$2 = {
3026
3030
  key: 0,
3027
3031
  d: "M6 3.5 10.5 8 6 12.5"
3028
3032
  };
3029
- var _hoisted_9$2 = {
3033
+ var _hoisted_11$2 = {
3030
3034
  key: 1,
3031
3035
  d: "M2.5 8h11M9 3.5 13.5 8 9 12.5"
3032
3036
  };
3033
- var _hoisted_10$2 = { class: "aform_form-btn-name" };
3034
- var _hoisted_11$2 = {
3037
+ var _hoisted_12$2 = { class: "aform_form-btn-name" };
3038
+ var _hoisted_13 = {
3035
3039
  key: 0,
3036
3040
  class: "loading autocomplete-result"
3037
3041
  };
3038
- var _hoisted_12$2 = [
3042
+ var _hoisted_14 = [
3039
3043
  "id",
3040
3044
  "aria-selected",
3041
3045
  "onMousedown",
3042
3046
  "onMouseenter"
3043
3047
  ];
3044
- var _hoisted_13 = {
3048
+ var _hoisted_15 = {
3045
3049
  key: 0,
3046
3050
  class: "aform_field-label"
3047
3051
  };
@@ -3056,7 +3060,7 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3056
3060
  required: { type: Boolean },
3057
3061
  mode: {},
3058
3062
  uuid: {},
3059
- validation: {},
3063
+ validation: { default: () => ({ errorMessage: "" }) },
3060
3064
  errors: {},
3061
3065
  doctype: { default: () => void 0 },
3062
3066
  formatter: {
@@ -3092,6 +3096,8 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3092
3096
  emits: ["update:modelValue"],
3093
3097
  setup(__props) {
3094
3098
  const listboxId = `${__props.uuid ?? `aform-link-${useId()}`}-listbox`;
3099
+ const errorText = computed(() => __props.embedded ? "" : __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
3100
+ const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
3095
3101
  const modelValue = useModel(__props, "modelValue");
3096
3102
  const hasValidId = computed(() => linkId(modelValue.value) !== void 0);
3097
3103
  const knownLink = ref();
@@ -3206,7 +3212,7 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3206
3212
  if (activeIndex.value !== null && dropdownResults.value[activeIndex.value]) selectOption(dropdownResults.value[activeIndex.value]);
3207
3213
  };
3208
3214
  return (_ctx, _cache) => {
3209
- return openBlock(), createElementBlock("div", { class: normalizeClass(["aform_form-element", { "aform_form-element--embedded": __props.embedded }]) }, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_1$12, toDisplayString(displayedText.value), 1), __props.label && !__props.embedded ? (openBlock(), createElementBlock("label", _hoisted_2$8, toDisplayString(__props.label), 1)) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [withDirectives((openBlock(), createElementBlock("div", _hoisted_3$6, [createElementVNode("div", _hoisted_4$6, [withDirectives(createElementVNode("input", {
3215
+ return openBlock(), createElementBlock("div", { class: normalizeClass(["aform_form-element", { "aform_form-element--embedded": __props.embedded }]) }, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_1$12, toDisplayString(displayedText.value), 1), __props.label && !__props.embedded ? (openBlock(), createElementBlock("label", _hoisted_2$8, toDisplayString(__props.label), 1)) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [withDirectives((openBlock(), createElementBlock("div", _hoisted_3$6, [createElementVNode("div", _hoisted_4$6, [createElementVNode("div", _hoisted_5$6, [withDirectives(createElementVNode("input", {
3210
3216
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchText.value = $event),
3211
3217
  type: "text",
3212
3218
  role: "combobox",
@@ -3216,6 +3222,8 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3216
3222
  placeholder: __props.placeholder,
3217
3223
  "aria-label": __props.ariaLabel,
3218
3224
  required: __props.required,
3225
+ "aria-invalid": unref(invalid),
3226
+ "aria-describedby": unref(describedBy),
3219
3227
  "aria-expanded": dropdownOpen.value,
3220
3228
  "aria-controls": dropdownOpen.value ? listboxId : void 0,
3221
3229
  "aria-activedescendant": activeIndex.value === null ? void 0 : `${listboxId}-opt-${activeIndex.value}`,
@@ -3230,7 +3238,12 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3230
3238
  withKeys(closeDropdown, ["esc"]),
3231
3239
  withKeys(leaveField, ["tab"])
3232
3240
  ]
3233
- }, null, 42, _hoisted_5$6), [[vModelText, searchText.value]]), canNavigate.value && !__props.disabled && !__props.embedded ? (openBlock(), createElementBlock("button", {
3241
+ }, null, 42, _hoisted_6$6), [[vModelText, searchText.value]]), !__props.embedded ? withDirectives((openBlock(), createElementBlock("p", {
3242
+ key: 0,
3243
+ id: unref(errorId),
3244
+ class: "aform_error",
3245
+ role: "alert"
3246
+ }, toDisplayString(errorText.value), 9, _hoisted_7$3)), [[vShow, errorText.value]]) : createCommentVNode("", true)]), canNavigate.value && !__props.disabled && !__props.embedded ? (openBlock(), createElementBlock("button", {
3234
3247
  key: 0,
3235
3248
  type: "button",
3236
3249
  class: "aform_form-btn",
@@ -3242,7 +3255,7 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3242
3255
  viewBox: "1.75 2.75 12.5 10.5",
3243
3256
  "aria-hidden": "true",
3244
3257
  focusable: "false"
3245
- }, [__props.icon === "chevron-right" ? (openBlock(), createElementBlock("path", _hoisted_8$2)) : (openBlock(), createElementBlock("path", _hoisted_9$2))], 8, _hoisted_7$3)), createElementVNode("span", _hoisted_10$2, toDisplayString(__props.icon === "chevron-right" ? "›" : "→"), 1)], 40, _hoisted_6$6)) : createCommentVNode("", true)]), __props.mode !== "read" ? (openBlock(), createBlock(ADropdownList_default, {
3258
+ }, [__props.icon === "chevron-right" ? (openBlock(), createElementBlock("path", _hoisted_10$2)) : (openBlock(), createElementBlock("path", _hoisted_11$2))], 8, _hoisted_9$2)), createElementVNode("span", _hoisted_12$2, toDisplayString(__props.icon === "chevron-right" ? "›" : "→"), 1)], 40, _hoisted_8$2)) : createCommentVNode("", true)]), __props.mode !== "read" ? (openBlock(), createBlock(ADropdownList_default, {
3246
3259
  key: 0,
3247
3260
  "listbox-id": listboxId,
3248
3261
  ariaLabel: __props.ariaLabel ?? __props.label ?? "",
@@ -3250,7 +3263,7 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3250
3263
  "option-count": () => dropdownResults.value.length,
3251
3264
  "active-index": () => activeIndex.value
3252
3265
  }, {
3253
- default: withCtx(() => [loading.value ? (openBlock(), createElementBlock("li", _hoisted_11$2, "Loading…")) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(dropdownResults.value, (option, i) => {
3266
+ default: withCtx(() => [loading.value ? (openBlock(), createElementBlock("li", _hoisted_13, "Loading…")) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(dropdownResults.value, (option, i) => {
3254
3267
  return openBlock(), createElementBlock("li", {
3255
3268
  id: `${listboxId}-opt-${i}`,
3256
3269
  key: String(option.id),
@@ -3262,7 +3275,7 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3262
3275
  }]),
3263
3276
  onMousedown: withModifiers(($event) => selectOption(option), ["prevent"]),
3264
3277
  onMouseenter: ($event) => activeIndex.value = i
3265
- }, [renderSlot(_ctx.$slots, "option", { option }, () => [createTextVNode(toDisplayString(option.displayText ?? String(option.id)), 1)], true)], 42, _hoisted_12$2);
3278
+ }, [renderSlot(_ctx.$slots, "option", { option }, () => [createTextVNode(toDisplayString(option.displayText ?? String(option.id)), 1)], true)], 42, _hoisted_14);
3266
3279
  }), 128))]),
3267
3280
  _: 3
3268
3281
  }, 8, [
@@ -3270,10 +3283,10 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
3270
3283
  "open",
3271
3284
  "option-count",
3272
3285
  "active-index"
3273
- ])) : createCommentVNode("", true)])), [[unref(vOnClickOutside), onClickOutside]]), __props.label && !__props.embedded ? (openBlock(), createElementBlock("label", _hoisted_13, toDisplayString(__props.label), 1)) : createCommentVNode("", true)], 64))], 2);
3286
+ ])) : createCommentVNode("", true)])), [[unref(vOnClickOutside), onClickOutside]]), __props.label && !__props.embedded ? (openBlock(), createElementBlock("label", _hoisted_15, toDisplayString(__props.label), 1)) : createCommentVNode("", true)], 64))], 2);
3274
3287
  };
3275
3288
  }
3276
- }), [["__scopeId", "data-v-ade07034"]]);
3289
+ }), [["__scopeId", "data-v-df32226b"]]);
3277
3290
  // src/components/form/ANumericInput.vue?vue&type=script&setup=true&lang.ts
3278
3291
  var _hoisted_1$11 = { class: "aform_form-element" };
3279
3292
  var _hoisted_2$7 = { class: "aform_display-value" };