@stonecrop/aform 0.58.2 → 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 +37 -24
- package/dist/aform.js.map +1 -1
- package/dist/assets/index.css +24 -11
- package/dist/src/components/form/AFormLink.vue.d.ts.map +1 -1
- package/package.json +5 -5
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$
|
|
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$
|
|
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
|
|
3024
|
-
var
|
|
3025
|
-
var
|
|
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
|
|
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
|
|
3034
|
-
var
|
|
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
|
|
3042
|
+
var _hoisted_14 = [
|
|
3039
3043
|
"id",
|
|
3040
3044
|
"aria-selected",
|
|
3041
3045
|
"onMousedown",
|
|
3042
3046
|
"onMouseenter"
|
|
3043
3047
|
];
|
|
3044
|
-
var
|
|
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();
|
|
@@ -3117,6 +3123,7 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
3117
3123
|
const dropdownResults = ref([]);
|
|
3118
3124
|
const activeIndex = ref(null);
|
|
3119
3125
|
const navigator = inject("aformLinkNavigator", null);
|
|
3126
|
+
const canNavigate = computed(() => hasValidId.value && !!__props.doctype && !!navigator);
|
|
3120
3127
|
const resolver = inject("aformLinkResolver", null);
|
|
3121
3128
|
watch(() => linkId(modelValue.value), async (id) => {
|
|
3122
3129
|
if (id && linkDisplayText(shownLink.value)) {
|
|
@@ -3149,7 +3156,6 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
3149
3156
|
const handleNavigate = () => {
|
|
3150
3157
|
const id = linkId(modelValue.value);
|
|
3151
3158
|
if (navigator && __props.doctype && id !== void 0) navigator.navigate(__props.doctype, id);
|
|
3152
|
-
else if (navigator && !__props.doctype) console.warn("[AFormLink] Navigation requested but `doctype` prop is missing. Add `options` (or `doctype`) to the Link field definition to enable navigation.");
|
|
3153
3159
|
};
|
|
3154
3160
|
const isResultSelected = (option) => {
|
|
3155
3161
|
const id = linkId(modelValue.value);
|
|
@@ -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,
|
|
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",
|
|
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",
|
|
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,
|
|
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",
|
|
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-
|
|
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" };
|