@stonecrop/aform 0.42.0 → 0.44.0

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 (38) hide show
  1. package/dist/aform.js +1720 -849
  2. package/dist/aform.js.map +1 -1
  3. package/dist/assets/index.css +396 -258
  4. package/dist/src/components/AForm.vue.d.ts.map +1 -1
  5. package/dist/src/components/form/ACurrencyInput.vue.d.ts +2 -5
  6. package/dist/src/components/form/ACurrencyInput.vue.d.ts.map +1 -1
  7. package/dist/src/components/form/ADropdown.vue.d.ts +36 -2
  8. package/dist/src/components/form/ADropdown.vue.d.ts.map +1 -1
  9. package/dist/src/components/form/ADropdownList.vue.d.ts +26 -0
  10. package/dist/src/components/form/ADropdownList.vue.d.ts.map +1 -0
  11. package/dist/src/components/form/AFormLink.vue.d.ts +2 -2
  12. package/dist/src/components/form/AFormLink.vue.d.ts.map +1 -1
  13. package/dist/src/components/form/AQuantityInput.vue.d.ts +2 -5
  14. package/dist/src/components/form/AQuantityInput.vue.d.ts.map +1 -1
  15. package/dist/src/components/table/ATableTupleCurrencyPicker.vue.d.ts +8 -0
  16. package/dist/src/components/table/ATableTupleCurrencyPicker.vue.d.ts.map +1 -0
  17. package/dist/src/components/table/ATableTupleQuantityPicker.vue.d.ts +8 -0
  18. package/dist/src/components/table/ATableTupleQuantityPicker.vue.d.ts.map +1 -0
  19. package/dist/src/components/table/ATupleCellEditor.vue.d.ts +22 -0
  20. package/dist/src/components/table/ATupleCellEditor.vue.d.ts.map +1 -0
  21. package/dist/src/components/table/ATupleCellShell.vue.d.ts +24 -0
  22. package/dist/src/components/table/ATupleCellShell.vue.d.ts.map +1 -0
  23. package/dist/src/composables/dropdownList.d.ts.map +1 -1
  24. package/dist/src/composables/fieldErrorA11y.d.ts +1 -1
  25. package/dist/src/composables/fieldErrorA11y.d.ts.map +1 -1
  26. package/dist/src/composables/useTableModalDropdownList.d.ts +18 -0
  27. package/dist/src/composables/useTableModalDropdownList.d.ts.map +1 -0
  28. package/dist/src/index.d.ts +5 -1
  29. package/dist/src/index.d.ts.map +1 -1
  30. package/dist/src/types/index.d.ts +6 -0
  31. package/dist/src/types/index.d.ts.map +1 -1
  32. package/dist/src/utils/currencyValue.d.ts +10 -0
  33. package/dist/src/utils/currencyValue.d.ts.map +1 -0
  34. package/dist/src/utils/linkValue.d.ts +5 -0
  35. package/dist/src/utils/linkValue.d.ts.map +1 -0
  36. package/dist/src/utils/quantityValue.d.ts +8 -0
  37. package/dist/src/utils/quantityValue.d.ts.map +1 -0
  38. package/package.json +9 -9
package/dist/aform.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { hasBadgeOptions, isBadgeDescriptor, lookupBadge, selectChoices } from "@stonecrop/schema";
2
- import { install as install$1 } from "@stonecrop/atable";
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, unref, useId, useModel, useTemplateRef, vModelCheckbox, vModelRadio, vModelSelect, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
4
+ import { currencyAmountEntryPattern, currencyInputFractionDigits, formatCurrencyAmount, formatCurrencyAmountInput, fromISODate, isSemver, isSemverPrefix, parseCurrencyAmountInput } from "@stonecrop/utilities";
4
5
  import { vOnClickOutside } from "@vueuse/components";
5
- import { fromISODate, isSemver, isSemverPrefix } from "@stonecrop/utilities";
6
6
  import { Temporal } from "temporal-polyfill";
7
- import { onClickOutside, useFileDialog } from "@vueuse/core";
7
+ import { onClickOutside, useElementBounding, useFileDialog } from "@vueuse/core";
8
8
  import './assets/index.css';//#region src/utils/deserialize.ts
9
9
  /**
10
10
  * Deserializes a stringified function expression into a typed callable.
@@ -118,20 +118,23 @@ function resolvedFieldsToColumns(fields) {
118
118
  }
119
119
  //#endregion
120
120
  //#region src/composables/fieldErrorA11y.ts
121
- function fieldErrorA11y(uuid, errorText) {
121
+ function fieldErrorA11y(uuid, errorText, extraDescribedBy) {
122
122
  const errorId = computed(() => uuid ? `${uuid}-error` : void 0);
123
123
  const hasError = computed(() => Boolean(errorText.value));
124
124
  return {
125
125
  errorId,
126
126
  hasError,
127
- describedBy: computed(() => hasError.value && errorId.value ? errorId.value : void 0),
127
+ describedBy: computed(() => {
128
+ if (hasError.value && errorId.value) return errorId.value;
129
+ return extraDescribedBy?.value;
130
+ }),
128
131
  invalid: computed(() => hasError.value ? true : void 0)
129
132
  };
130
133
  }
131
134
  //#endregion
132
135
  //#region src/components/form/ACheckbox.vue?vue&type=script&setup=true&lang.ts
133
- var _hoisted_1$21 = { class: "aform_form-element" };
134
- var _hoisted_2$20 = { class: "aform_field-label" };
136
+ var _hoisted_1$26 = { class: "aform_form-element" };
137
+ var _hoisted_2$21 = { class: "aform_field-label" };
135
138
  var _hoisted_3$18 = { class: "aform_display-value" };
136
139
  var _hoisted_4$18 = ["for"];
137
140
  var _hoisted_5$17 = { class: "aform_checkbox-container aform_input-field" };
@@ -170,7 +173,7 @@ var ACheckbox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
170
173
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
171
174
  const checkbox = useModel(__props, "modelValue");
172
175
  return (_ctx, _cache) => {
173
- return openBlock(), createElementBlock("div", _hoisted_1$21, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("label", _hoisted_2$20, toDisplayString(__props.label), 1), createElementVNode("span", _hoisted_3$18, toDisplayString(checkbox.value ? "✓" : "✗"), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
176
+ return openBlock(), createElementBlock("div", _hoisted_1$26, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("label", _hoisted_2$21, toDisplayString(__props.label), 1), createElementVNode("span", _hoisted_3$18, toDisplayString(checkbox.value ? "✓" : "✗"), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
174
177
  createElementVNode("label", {
175
178
  class: "aform_field-label",
176
179
  for: __props.uuid
@@ -205,6 +208,66 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
205
208
  //#region src/components/form/ACheckbox.vue
206
209
  var ACheckbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ACheckbox_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-f28e7db6"]]);
207
210
  //#endregion
211
+ //#region src/utils/currencyValue.ts
212
+ var FLOAT_NOISE_DECIMALS = 6;
213
+ function normalizeBaseCurrency(options, current) {
214
+ const base = options.baseCurrency ?? current?.baseCurrency;
215
+ if (!base) return { id: "" };
216
+ return typeof base === "string" ? { id: base } : base;
217
+ }
218
+ function baseAmountDecimals(options) {
219
+ const { precision } = options;
220
+ if (precision === void 0) return FLOAT_NOISE_DECIMALS;
221
+ return Number.isInteger(precision) && precision >= 0 && precision <= 100 ? precision : FLOAT_NOISE_DECIMALS;
222
+ }
223
+ function resolveCurrencyExchangeRate(currencyId, options, baseCurrency, current) {
224
+ const baseId = baseCurrency.id;
225
+ if (!currencyId || String(currencyId) === String(baseId)) return 1;
226
+ if (String(currencyId) === String(current?.currency?.id)) return current?.exchangeRate ?? options.exchangeRates?.[String(currencyId)] ?? 1;
227
+ return options.exchangeRates?.[String(currencyId)] ?? 1;
228
+ }
229
+ var roundAmount = (value, decimals) => Number(value.toFixed(decimals));
230
+ function recomputeCurrencyValue(amount, currencyValue, options, baseCurrency, current) {
231
+ const exchangeRate = resolveCurrencyExchangeRate(currencyValue.id, options, baseCurrency, current);
232
+ const decimals = baseAmountDecimals(options);
233
+ return {
234
+ amount,
235
+ currency: currencyValue,
236
+ exchangeRate,
237
+ baseCurrency,
238
+ baseAmount: amount === null ? null : roundAmount(amount * exchangeRate, decimals)
239
+ };
240
+ }
241
+ function patchCurrencyAmount(current, amount, options, baseCurrency) {
242
+ return recomputeCurrencyValue(amount, current?.currency ?? { id: "" }, options, baseCurrency, current);
243
+ }
244
+ function patchCurrencyCurrency(current, currencyValue, options, baseCurrency) {
245
+ return recomputeCurrencyValue(current?.amount ?? null, currencyValue, options, baseCurrency, current);
246
+ }
247
+ /** Static currency choices when no async filterFunction is configured (base + exchangeRates keys). */
248
+ function staticCurrencyChoices(options, current) {
249
+ const base = normalizeBaseCurrency(options, current);
250
+ const seen = /* @__PURE__ */ new Set();
251
+ const choices = [];
252
+ if (base.id) {
253
+ choices.push(base);
254
+ seen.add(String(base.id));
255
+ }
256
+ const currentCur = current?.currency;
257
+ if (currentCur?.id && !seen.has(String(currentCur.id))) {
258
+ choices.push(currentCur);
259
+ seen.add(String(currentCur.id));
260
+ }
261
+ for (const id of Object.keys(options.exchangeRates ?? {})) if (!seen.has(id)) {
262
+ choices.push({
263
+ id,
264
+ displayText: id
265
+ });
266
+ seen.add(id);
267
+ }
268
+ return choices;
269
+ }
270
+ //#endregion
208
271
  //#region src/utils/emptiedBox.ts
209
272
  /**
210
273
  * A date box's day as `v-model` hands it back, or null once any part of the box is empty, which the
@@ -221,6 +284,27 @@ function numberFromBox(value) {
221
284
  return value === "" ? null : value;
222
285
  }
223
286
  //#endregion
287
+ //#region src/utils/linkValue.ts
288
+ function linkId(value) {
289
+ if (value == null) return void 0;
290
+ if (typeof value === "string") return value === "" ? void 0 : value;
291
+ if (typeof value === "number") return String(value);
292
+ const id = value.id;
293
+ if (id === null || id === void 0 || id === "") return void 0;
294
+ return String(id);
295
+ }
296
+ function linkDisplayText(value) {
297
+ if (value == null || typeof value !== "object") return void 0;
298
+ const text = value.displayText;
299
+ if (typeof text === "string") return text;
300
+ if (typeof text === "number") return String(text);
301
+ }
302
+ function asLinkValue(value) {
303
+ if (value != null && typeof value === "object") return value;
304
+ const id = linkId(value);
305
+ return id !== void 0 ? { id } : { id: "" };
306
+ }
307
+ //#endregion
224
308
  //#region src/composables/dropdownList.ts
225
309
  var WINDOW_MARGIN = 8;
226
310
  var MIN_ROWS = 4;
@@ -251,67 +335,118 @@ function fitDropdownList(list, state) {
251
335
  window.removeEventListener("scroll", fit, { capture: true });
252
336
  window.removeEventListener("resize", fit);
253
337
  };
254
- watch(state.isOpen, (open) => {
338
+ watch(() => state.isOpen(), (open) => {
255
339
  if (open) return listen();
256
340
  stopListening();
257
341
  if (list.value) list.value.style.maxHeight = "";
258
342
  });
259
343
  watch(() => state.isOpen() && state.optionCount(), () => void nextTick(() => fit()));
260
- watch(state.activeIndex, (index) => {
344
+ watch(() => state.activeIndex(), (index) => {
261
345
  if (index === null || index < 0) return;
262
346
  nextTick(() => list.value?.querySelectorAll("[role=\"option\"]")[index]?.scrollIntoView?.({ block: "nearest" }));
263
347
  }, { flush: "post" });
264
348
  onBeforeUnmount(stopListening);
265
349
  }
266
350
  //#endregion
267
- //#region src/components/form/AFormLink.vue?vue&type=script&setup=true&lang.ts
268
- var _hoisted_1$20 = { class: "aform_display-value" };
269
- var _hoisted_2$19 = {
270
- key: 0,
351
+ //#region src/components/form/ADropdownList.vue?vue&type=script&setup=true&lang.ts
352
+ var _hoisted_1$25 = ["id", "aria-label"];
353
+ //#endregion
354
+ //#region src/components/form/ADropdownList.vue
355
+ var ADropdownList_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
356
+ __name: "ADropdownList",
357
+ props: {
358
+ listboxId: {},
359
+ ariaLabel: {},
360
+ open: { type: Boolean },
361
+ listAnchor: { default: "field" },
362
+ surface: { default: "field" },
363
+ optionCount: { type: Function },
364
+ activeIndex: { type: Function }
365
+ },
366
+ setup(__props, { expose: __expose }) {
367
+ const root = useTemplateRef("root");
368
+ fitDropdownList(root, {
369
+ isOpen: () => __props.open,
370
+ optionCount: __props.optionCount,
371
+ activeIndex: __props.activeIndex
372
+ });
373
+ __expose({ root });
374
+ return (_ctx, _cache) => {
375
+ return withDirectives((openBlock(), createElementBlock("ul", {
376
+ id: __props.listboxId,
377
+ ref_key: "root",
378
+ ref: root,
379
+ class: normalizeClass(["autocomplete-results", {
380
+ "autocomplete-results--anchor-group": __props.listAnchor === "group",
381
+ "autocomplete-results--cell-modal": __props.surface === "cell-modal"
382
+ }]),
383
+ role: "listbox",
384
+ "aria-label": __props.ariaLabel
385
+ }, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 10, _hoisted_1$25)), [[vShow, __props.open]]);
386
+ };
387
+ }
388
+ }), [["__scopeId", "data-v-6939f0bf"]]);
389
+ //#endregion
390
+ //#region src/components/form/ADropdown.vue?vue&type=script&setup=true&lang.ts
391
+ var _hoisted_1$24 = {
392
+ key: 1,
393
+ class: "aform_display-value"
394
+ };
395
+ var _hoisted_2$20 = {
396
+ key: 2,
397
+ class: "aform_display-value"
398
+ };
399
+ var _hoisted_3$17 = {
400
+ key: 3,
271
401
  class: "aform_field-label"
272
402
  };
273
- var _hoisted_3$17 = { class: "aform_form-link-wrapper" };
274
- var _hoisted_4$17 = { class: "input-group" };
275
- var _hoisted_5$16 = [
403
+ var _hoisted_4$17 = [
404
+ "id",
405
+ "disabled",
406
+ "required",
407
+ "aria-label",
408
+ "aria-expanded",
409
+ "aria-controls",
410
+ "aria-activedescendant",
411
+ "onKeydown"
412
+ ];
413
+ var _hoisted_5$16 = { class: "aform_dropdown-button-value" };
414
+ var _hoisted_6$13 = [
415
+ "id",
416
+ "disabled",
417
+ "required",
276
418
  "placeholder",
277
419
  "size",
278
420
  "aria-label",
279
- "required",
280
421
  "aria-expanded",
281
422
  "aria-controls",
282
423
  "aria-activedescendant",
283
- "disabled",
424
+ "aria-invalid",
425
+ "aria-describedby",
284
426
  "onKeydown"
285
427
  ];
286
- var _hoisted_6$13 = ["onKeydown"];
287
- var _hoisted_7$6 = ["data-icon"];
288
- var _hoisted_8$6 = {
428
+ var _hoisted_7$6 = {
289
429
  key: 0,
290
- d: "M6 3.5 10.5 8 6 12.5"
291
- };
292
- var _hoisted_9$5 = {
293
- key: 1,
294
- d: "M2.5 8h11M9 3.5 13.5 8 9 12.5"
295
- };
296
- var _hoisted_10$4 = { class: "aform_form-btn-name" };
297
- var _hoisted_11$4 = ["aria-label"];
298
- var _hoisted_12$4 = {
299
- key: 0,
300
- class: "autocomplete-result loading"
430
+ class: "loading autocomplete-result"
301
431
  };
302
- var _hoisted_13$3 = [
432
+ var _hoisted_8$6 = [
303
433
  "id",
304
434
  "aria-selected",
305
- "onMousedown"
435
+ "onMousedown",
436
+ "onMouseenter"
306
437
  ];
307
- var _hoisted_14$3 = {
308
- key: 0,
309
- class: "aform_field-label"
310
- };
438
+ var _hoisted_9$5 = [
439
+ "id",
440
+ "aria-selected",
441
+ "onMousedown",
442
+ "onMouseenter"
443
+ ];
444
+ var _hoisted_10$5 = ["for"];
445
+ var _hoisted_11$5 = ["id"];
311
446
  //#endregion
312
- //#region src/components/form/AFormLink.vue
313
- var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
314
- __name: "AFormLink",
447
+ //#region src/components/form/ADropdown.vue
448
+ var ADropdown_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
449
+ __name: "ADropdown",
315
450
  props: /*@__PURE__*/ mergeModels({
316
451
  schema: {},
317
452
  label: {},
@@ -320,222 +455,414 @@ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
320
455
  required: { type: Boolean },
321
456
  mode: {},
322
457
  uuid: {},
323
- validation: {},
458
+ validation: { default: () => ({ errorMessage: "" }) },
324
459
  errors: {},
325
- doctype: { default: () => void 0 },
326
- formatter: {
460
+ options: { default: () => [] },
461
+ format: {},
462
+ isAsync: {
463
+ type: Boolean,
464
+ default: false
465
+ },
466
+ filterFunction: {
327
467
  type: Function,
328
468
  default: void 0
329
469
  },
330
- icon: { default: "arrow-right" },
331
- disabled: {
470
+ link: {
332
471
  type: Boolean,
333
472
  default: false
334
473
  },
335
- filterFunction: {
474
+ linkFilterFunction: {
336
475
  type: [String, Function],
337
476
  default: void 0
338
477
  },
339
- isAsync: {
340
- type: Boolean,
341
- default: false
478
+ formatter: {
479
+ type: Function,
480
+ default: void 0
342
481
  },
482
+ doctype: { default: () => void 0 },
343
483
  embedded: {
344
484
  type: Boolean,
345
485
  default: false
346
486
  },
487
+ trigger: { default: "combobox" },
488
+ listAnchor: { default: "field" },
347
489
  placeholder: { default: () => void 0 },
348
490
  ariaLabel: { default: () => void 0 }
349
491
  }, {
350
- "modelValue": { default: () => ({
351
- id: "",
352
- displayText: ""
353
- }) },
354
- "modelModifiers": {}
492
+ "modelValue": {},
493
+ "modelModifiers": {},
494
+ "linkValue": {},
495
+ "linkValueModifiers": {}
355
496
  }),
356
- emits: ["update:modelValue"],
357
- setup(__props) {
358
- const listboxId = `${__props.uuid ?? `aform-link-${useId()}`}-listbox`;
497
+ emits: /*@__PURE__*/ mergeModels(["update:open"], ["update:modelValue", "update:linkValue"]),
498
+ setup(__props, { expose: __expose, emit: __emit }) {
499
+ const emit = __emit;
500
+ const linkPicker = computed(() => __props.link);
501
+ const listboxId = `${__props.uuid ?? `aform-dropdown-${useId()}`}-listbox`;
502
+ const choiceList = computed(() => selectChoices(__props.options));
503
+ const formatFn = computed(() => __props.format ? deserializeFunction(__props.format) : void 0);
504
+ const badgeDescriptor = computed(() => linkPicker.value ? null : resolveFieldBadge(search.value, __props.options, formatFn.value));
505
+ const inputAccentStyle = computed(() => badgeInputAccentStyle(badgeDescriptor.value ?? void 0));
506
+ const displayAccentStyle = computed(() => badgeInputAccentStyle(badgeDescriptor.value ?? void 0));
507
+ const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
508
+ const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
359
509
  const modelValue = useModel(__props, "modelValue");
360
- const hasValidId = computed(() => linkId(modelValue.value) !== void 0);
361
- const displayedText = computed(() => {
362
- const id = linkId(modelValue.value);
363
- if (id === void 0) return "—";
364
- if (__props.formatter) return __props.formatter(asLinkValue(modelValue.value));
365
- return linkDisplayText(modelValue.value) ?? id;
366
- });
367
- const searchText = ref(hasValidId.value ? displayedText.value : "");
368
- const embeddedSize = computed(() => __props.embedded ? Math.max((searchText.value || __props.placeholder || "").length, 1) : void 0);
369
- const dropdownOpen = ref(false);
370
- const loading = ref(false);
371
- const dropdownResults = ref([]);
372
- const activeIndex = ref(null);
373
- fitDropdownList(useTemplateRef("results"), {
374
- isOpen: () => dropdownOpen.value,
375
- optionCount: () => dropdownResults.value.length,
376
- activeIndex: () => activeIndex.value
377
- });
378
- const navigator = inject("aformLinkNavigator", null);
510
+ const linkModel = useModel(__props, "linkValue");
379
511
  const resolver = inject("aformLinkResolver", null);
380
- function linkId(value) {
381
- if (value == null) return void 0;
382
- if (typeof value === "string") return value === "" ? void 0 : value;
383
- if (typeof value === "number") return String(value);
384
- const id = value.id;
385
- if (id === null || id === void 0 || id === "") return void 0;
386
- return String(id);
387
- }
388
- function linkDisplayText(value) {
389
- if (value == null || typeof value !== "object") return void 0;
390
- const text = value.displayText;
391
- return typeof text === "string" || typeof text === "number" ? String(text) : void 0;
392
- }
393
- function asLinkValue(value) {
394
- if (value != null && typeof value === "object") return value;
395
- const id = linkId(value);
396
- return id !== void 0 ? { id } : { id: "" };
397
- }
398
- watch(() => linkId(modelValue.value), async (id) => {
399
- if (id && linkDisplayText(modelValue.value)) {
400
- searchText.value = displayedText.value;
512
+ const dropdown = reactive({
513
+ activeItemIndex: null,
514
+ open: false,
515
+ loading: false,
516
+ results: []
517
+ });
518
+ watch(() => dropdown.open, (open) => emit("update:open", open));
519
+ const linkResults = ref([]);
520
+ const optionCount = () => linkPicker.value ? linkResults.value.length : dropdown.results.length;
521
+ const committedValue = ref(modelValue.value ?? "");
522
+ const linkText = (value) => {
523
+ const record = asLinkValue(value);
524
+ return __props.formatter ? __props.formatter(record) : linkDisplayText(record) ?? String(record.id);
525
+ };
526
+ const linkDisplayedText = computed(() => linkId(linkModel.value) === void 0 ? "—" : linkText(linkModel.value));
527
+ const search = ref("");
528
+ watch(modelValue, (value) => {
529
+ if (linkPicker.value) return;
530
+ const next = value ?? "";
531
+ search.value = next;
532
+ if (next === "" || choiceList.value.includes(next)) committedValue.value = next;
533
+ }, { immediate: true });
534
+ watch(() => linkModel.value, (value) => {
535
+ if (!linkPicker.value) return;
536
+ search.value = linkId(value) ? linkText(value) : "";
537
+ }, { immediate: true });
538
+ watch(() => linkPicker.value ? linkId(linkModel.value) : void 0, async (id) => {
539
+ if (!linkPicker.value || !id) return;
540
+ if (linkDisplayText(linkModel.value)) {
541
+ search.value = linkText(linkModel.value);
401
542
  return;
402
543
  }
403
- if (!id) return;
404
544
  try {
405
545
  let match;
406
546
  let displayText;
407
- if (__props.filterFunction) {
408
- match = (await (typeof __props.filterFunction === "string" ? deserializeFunction(__props.filterFunction) : __props.filterFunction)(String(id))).find((r) => String(r.id) === String(id));
547
+ if (__props.linkFilterFunction) {
548
+ match = (await (typeof __props.linkFilterFunction === "string" ? deserializeFunction(__props.linkFilterFunction) : __props.linkFilterFunction)(String(id))).find((r) => String(r.id) === String(id));
409
549
  displayText = match?.displayText;
410
- if (displayText === void 0) console.warn(`[AFormLink] filterFunction returned no matching result for id "${id}". The function must return an item whose \`id\` exactly matches the search string.`);
411
550
  } else if (resolver && __props.doctype) displayText = await resolver(__props.doctype, id.toString()) ?? void 0;
412
551
  if (displayText) {
413
552
  const resolved = {
414
- ...asLinkValue(modelValue.value),
553
+ ...asLinkValue(linkModel.value),
415
554
  ...match,
416
555
  id,
417
556
  displayText
418
557
  };
419
- searchText.value = __props.formatter ? __props.formatter(resolved) : displayText;
420
- modelValue.value = resolved;
558
+ search.value = linkText(resolved);
559
+ linkModel.value = resolved;
421
560
  }
422
561
  } catch {}
423
562
  }, { immediate: true });
424
- const handleNavigate = () => {
425
- const id = linkId(modelValue.value);
426
- if (navigator && __props.doctype && id !== void 0) navigator.navigate(__props.doctype, id);
427
- 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.");
563
+ const onClickOutside = () => closeDropdown();
564
+ const isChoiceSelected = (result) => !!result && result === (modelValue.value ?? "");
565
+ const isLinkOptionSelected = (option) => {
566
+ const id = linkId(linkModel.value);
567
+ return id !== void 0 && String(option.id) === String(id);
428
568
  };
429
- const openDropdown = async (text) => {
430
- if (!__props.filterFunction || __props.mode === "read") return;
431
- activeIndex.value = null;
432
- dropdownOpen.value = true;
433
- if (__props.isAsync) loading.value = true;
569
+ const embeddedLinkDisplayText = computed(() => linkId(linkModel.value) ? linkText(linkModel.value) : __props.placeholder ?? "");
570
+ const embeddedLinkInputSize = computed(() => {
571
+ if (!__props.embedded || !linkPicker.value) return void 0;
572
+ const text = embeddedLinkDisplayText.value;
573
+ const length = text.length > 0 ? text.length : (__props.placeholder ?? "").length;
574
+ return length > 0 ? length : void 0;
575
+ });
576
+ const filterResults = () => {
577
+ if (!search.value) dropdown.results = choiceList.value;
578
+ else dropdown.results = choiceList.value.filter((item) => item.toLowerCase().includes(search.value.toLowerCase()));
579
+ };
580
+ const openLinkDropdown = async (text) => {
581
+ if (!__props.linkFilterFunction || __props.mode === "read") return;
582
+ dropdown.activeItemIndex = null;
583
+ dropdown.open = true;
584
+ if (__props.isAsync) dropdown.loading = true;
434
585
  try {
435
- const fn = typeof __props.filterFunction === "string" ? deserializeFunction(__props.filterFunction) : __props.filterFunction;
436
- dropdownResults.value = await fn(text) ?? [];
586
+ const fn = typeof __props.linkFilterFunction === "string" ? deserializeFunction(__props.linkFilterFunction) : __props.linkFilterFunction;
587
+ linkResults.value = await fn(text) ?? [];
437
588
  } catch {
438
- dropdownResults.value = [];
589
+ linkResults.value = [];
439
590
  } finally {
440
- loading.value = false;
591
+ dropdown.loading = false;
441
592
  }
442
593
  };
443
- const closeDropdown = () => {
444
- dropdownOpen.value = false;
445
- activeIndex.value = null;
446
- searchText.value = hasValidId.value ? displayedText.value : "";
594
+ const embeddedLinkFilterQuery = () => {
595
+ if (!__props.embedded || !linkPicker.value) return search.value;
596
+ if (linkId(linkModel.value) && __props.formatter) {
597
+ const formatted = __props.formatter(asLinkValue(linkModel.value));
598
+ if (search.value === formatted) return "";
599
+ }
600
+ return search.value;
447
601
  };
448
- const onClickOutside = () => {
449
- if (dropdownOpen.value) closeDropdown();
602
+ const openEmbeddedList = () => {
603
+ if (linkPicker.value && !dropdown.open) openLinkDropdown(embeddedLinkFilterQuery());
450
604
  };
451
- const onFocus = () => openDropdown(searchText.value);
452
- const onInput = () => openDropdown(searchText.value);
453
- const selectOption = (option) => {
454
- modelValue.value = option;
455
- searchText.value = __props.formatter ? __props.formatter(option) : option.displayText ?? String(option.id);
456
- dropdownOpen.value = false;
457
- activeIndex.value = null;
605
+ __expose({ openCurrencyList: openEmbeddedList });
606
+ const filter = async () => {
607
+ dropdown.open = true;
608
+ dropdown.activeItemIndex = null;
609
+ if (__props.filterFunction) {
610
+ if (__props.isAsync) dropdown.loading = true;
611
+ try {
612
+ const filteredResults = await __props.filterFunction(search.value || "");
613
+ dropdown.results = filteredResults || [];
614
+ } catch {
615
+ dropdown.results = [];
616
+ } finally {
617
+ if (__props.isAsync) dropdown.loading = false;
618
+ }
619
+ } else filterResults();
458
620
  };
459
- const selectNext = () => {
460
- const len = dropdownResults.value.length;
461
- if (!len) return;
462
- activeIndex.value = activeIndex.value === null ? 0 : (activeIndex.value + 1) % len;
621
+ const setChoiceResult = (result) => {
622
+ modelValue.value = result;
623
+ search.value = result;
624
+ committedValue.value = result;
625
+ closeDropdown(result);
463
626
  };
464
- const selectPrev = () => {
465
- if (!dropdownResults.value.length) return;
466
- if (activeIndex.value === null || activeIndex.value === 0) activeIndex.value = null;
467
- else activeIndex.value -= 1;
627
+ const selectLinkOption = (option) => {
628
+ linkModel.value = option;
629
+ search.value = linkText(option);
630
+ dropdown.open = false;
631
+ dropdown.activeItemIndex = null;
468
632
  };
469
- const selectCurrent = () => {
470
- if (activeIndex.value !== null && dropdownResults.value[activeIndex.value]) selectOption(dropdownResults.value[activeIndex.value]);
633
+ const openChoiceDropdown = () => {
634
+ const idx = choiceList.value.indexOf(search.value);
635
+ dropdown.activeItemIndex = __props.isAsync ? null : idx >= 0 ? idx : null;
636
+ dropdown.open = true;
637
+ dropdown.results = __props.isAsync ? [] : choiceList.value;
638
+ };
639
+ const closeDropdown = (result) => {
640
+ dropdown.activeItemIndex = null;
641
+ dropdown.open = false;
642
+ if (linkPicker.value) {
643
+ search.value = linkId(linkModel.value) ? linkText(linkModel.value) : "";
644
+ return;
645
+ }
646
+ const typed = result || search.value || "";
647
+ if (choiceList.value.includes(typed)) {
648
+ if (typed !== committedValue.value) {
649
+ modelValue.value = typed;
650
+ committedValue.value = typed;
651
+ }
652
+ } else {
653
+ search.value = committedValue.value;
654
+ modelValue.value = committedValue.value;
655
+ }
656
+ };
657
+ const toggleButtonDropdown = () => {
658
+ if (dropdown.open) closeDropdown();
659
+ else openChoiceDropdown();
660
+ };
661
+ const onComboboxInput = () => {
662
+ if (linkPicker.value) openLinkDropdown(__props.embedded ? embeddedLinkFilterQuery() : search.value);
663
+ else {
664
+ if (search.value === "") {
665
+ modelValue.value = "";
666
+ committedValue.value = "";
667
+ }
668
+ filter();
669
+ }
670
+ };
671
+ const onComboboxFocus = (event) => {
672
+ if (linkPicker.value && __props.embedded) {
673
+ openEmbeddedList();
674
+ const input = event.target;
675
+ if (input) requestAnimationFrame(() => input.select());
676
+ return;
677
+ }
678
+ if (linkPicker.value) openLinkDropdown(search.value);
679
+ else openChoiceDropdown();
680
+ };
681
+ const onEmbeddedComboboxClick = () => {
682
+ if (__props.embedded && linkPicker.value) openEmbeddedList();
683
+ };
684
+ const onEmbeddedComboboxPointerDown = () => {
685
+ if (__props.embedded && linkPicker.value) openEmbeddedList();
686
+ };
687
+ watch(choiceList, (choices) => {
688
+ if (!linkPicker.value) dropdown.results = choices;
689
+ }, { immediate: true });
690
+ const ensureDropdownOpen = () => {
691
+ if (dropdown.open) return;
692
+ if (linkPicker.value) {
693
+ if (__props.embedded) openEmbeddedList();
694
+ else openLinkDropdown(search.value);
695
+ } else openChoiceDropdown();
696
+ };
697
+ const selectNextResult = () => {
698
+ const resultsLength = optionCount();
699
+ if (!resultsLength) return;
700
+ const wasOpen = dropdown.open;
701
+ ensureDropdownOpen();
702
+ if (!wasOpen) {
703
+ if (dropdown.activeItemIndex === null && !__props.isAsync) dropdown.activeItemIndex = 0;
704
+ return;
705
+ }
706
+ if (dropdown.activeItemIndex != null) dropdown.activeItemIndex = (dropdown.activeItemIndex + 1) % resultsLength;
707
+ else dropdown.activeItemIndex = 0;
708
+ };
709
+ const selectPrevResult = () => {
710
+ const resultsLength = optionCount();
711
+ if (!resultsLength) return;
712
+ ensureDropdownOpen();
713
+ if (dropdown.activeItemIndex != null) {
714
+ if (dropdown.activeItemIndex === 0) dropdown.activeItemIndex = __props.trigger === "button" ? resultsLength - 1 : null;
715
+ else dropdown.activeItemIndex = dropdown.activeItemIndex - 1;
716
+ } else dropdown.activeItemIndex = resultsLength - 1;
717
+ };
718
+ const setCurrentResult = () => {
719
+ if (!dropdown.open) {
720
+ ensureDropdownOpen();
721
+ return;
722
+ }
723
+ if (linkPicker.value) {
724
+ if (dropdown.activeItemIndex !== null && linkResults.value[dropdown.activeItemIndex]) selectLinkOption(linkResults.value[dropdown.activeItemIndex]);
725
+ return;
726
+ }
727
+ const result = dropdown.results[dropdown.activeItemIndex ?? 0];
728
+ if (result !== void 0) setChoiceResult(result);
471
729
  };
472
730
  return (_ctx, _cache) => {
473
- 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$20, toDisplayString(displayedText.value), 1), __props.label && !__props.embedded ? (openBlock(), createElementBlock("label", _hoisted_2$19, toDisplayString(__props.label), 1)) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [withDirectives((openBlock(), createElementBlock("div", _hoisted_3$17, [createElementVNode("div", _hoisted_4$17, [withDirectives(createElementVNode("input", {
474
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchText.value = $event),
475
- type: "text",
476
- role: "combobox",
477
- autocomplete: "off",
478
- "aria-autocomplete": "list",
479
- class: normalizeClass(["aform_input-field", { "aform_input-field--embedded": __props.embedded }]),
480
- placeholder: __props.placeholder,
481
- size: embeddedSize.value,
482
- "aria-label": __props.ariaLabel,
483
- required: __props.required,
484
- "aria-expanded": dropdownOpen.value,
485
- "aria-controls": dropdownOpen.value ? listboxId : void 0,
486
- "aria-activedescendant": activeIndex.value === null ? void 0 : `${listboxId}-opt-${activeIndex.value}`,
487
- disabled: __props.disabled || __props.mode === "read",
488
- onInput,
489
- onFocus,
490
- onKeydown: [
491
- withKeys(withModifiers(selectNext, ["prevent"]), ["down"]),
492
- withKeys(withModifiers(selectPrev, ["prevent"]), ["up"]),
493
- withKeys(withModifiers(selectCurrent, ["prevent"]), ["enter"]),
494
- withKeys(closeDropdown, ["esc"]),
495
- withKeys(closeDropdown, ["tab"])
496
- ]
497
- }, null, 42, _hoisted_5$16), [[vModelText, searchText.value]]), hasValidId.value && !__props.disabled && !__props.embedded ? (openBlock(), createElementBlock("button", {
731
+ return openBlock(), createElementBlock("div", { class: normalizeClass(["aform_form-element", {
732
+ "aform_form-element--embedded": __props.embedded,
733
+ "aform_dropdown--anchor-group": __props.listAnchor === "group"
734
+ }]) }, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [!linkPicker.value && badgeDescriptor.value ? (openBlock(), createElementBlock("span", {
498
735
  key: 0,
499
- type: "button",
500
- class: "aform_form-btn",
501
- onClick: handleNavigate,
502
- onKeydown: withKeys(withModifiers(handleNavigate, ["prevent"]), ["enter"])
503
- }, [(openBlock(), createElementBlock("svg", {
504
- class: "aform_form-btn-icon",
505
- "data-icon": __props.icon,
506
- viewBox: "1.75 2.75 12.5 10.5",
507
- "aria-hidden": "true",
508
- focusable: "false"
509
- }, [__props.icon === "chevron-right" ? (openBlock(), createElementBlock("path", _hoisted_8$6)) : (openBlock(), createElementBlock("path", _hoisted_9$5))], 8, _hoisted_7$6)), createElementVNode("span", _hoisted_10$4, toDisplayString(__props.icon === "chevron-right" ? "›" : "→"), 1)], 40, _hoisted_6$13)) : createCommentVNode("", true)]), dropdownOpen.value ? (openBlock(), createElementBlock("ul", {
736
+ class: "aform_display-value",
737
+ style: normalizeStyle(displayAccentStyle.value)
738
+ }, toDisplayString(badgeDescriptor.value.label), 5)) : !linkPicker.value ? (openBlock(), createElementBlock("span", _hoisted_1$24, toDisplayString(search.value), 1)) : (openBlock(), createElementBlock("span", _hoisted_2$20, toDisplayString(linkDisplayedText.value), 1)), __props.label && !__props.embedded ? (openBlock(), createElementBlock("label", _hoisted_3$17, toDisplayString(__props.label), 1)) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [withDirectives((openBlock(), createElementBlock("div", { class: normalizeClass(["autocomplete", { isOpen: dropdown.open }]) }, [
739
+ __props.trigger === "button" ? (openBlock(), createElementBlock("button", {
740
+ key: 0,
741
+ id: __props.uuid,
742
+ type: "button",
743
+ class: "aform_dropdown-button",
744
+ disabled: __props.mode === "read",
745
+ required: __props.required,
746
+ "aria-label": __props.ariaLabel ?? __props.label,
747
+ "aria-haspopup": "listbox",
748
+ "aria-expanded": dropdown.open,
749
+ "aria-controls": dropdown.open ? listboxId : void 0,
750
+ "aria-activedescendant": dropdown.open && dropdown.activeItemIndex !== null ? `${listboxId}-opt-${dropdown.activeItemIndex}` : void 0,
751
+ onClick: toggleButtonDropdown,
752
+ onKeydown: [
753
+ withKeys(withModifiers(selectNextResult, ["prevent"]), ["down"]),
754
+ withKeys(withModifiers(selectPrevResult, ["prevent"]), ["up"]),
755
+ withKeys(withModifiers(setCurrentResult, ["prevent"]), ["enter"]),
756
+ withKeys(onClickOutside, ["esc"])
757
+ ]
758
+ }, [createElementVNode("span", _hoisted_5$16, toDisplayString(search.value || __props.placeholder || ""), 1), _cache[1] || (_cache[1] = createElementVNode("span", {
759
+ class: "aform_dropdown-button-caret",
760
+ "aria-hidden": "true"
761
+ }, null, -1))], 40, _hoisted_4$17)) : withDirectives((openBlock(), createElementBlock("input", {
762
+ key: 1,
763
+ id: __props.uuid,
764
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
765
+ type: "text",
766
+ role: "combobox",
767
+ autocomplete: "off",
768
+ "aria-autocomplete": "list",
769
+ class: normalizeClass(["aform_input-field", { "aform_input-field--embedded": __props.embedded }]),
770
+ disabled: __props.mode === "read",
771
+ required: __props.required,
772
+ placeholder: __props.placeholder,
773
+ size: embeddedLinkInputSize.value,
774
+ "aria-label": __props.ariaLabel,
775
+ style: normalizeStyle(inputAccentStyle.value),
776
+ "aria-expanded": dropdown.open,
777
+ "aria-controls": dropdown.open ? listboxId : void 0,
778
+ "aria-activedescendant": dropdown.activeItemIndex === null ? void 0 : `${listboxId}-opt-${dropdown.activeItemIndex}`,
779
+ "aria-invalid": unref(invalid),
780
+ "aria-describedby": unref(describedBy),
781
+ onInput: onComboboxInput,
782
+ onFocus: onComboboxFocus,
783
+ onClick: onEmbeddedComboboxClick,
784
+ onPointerdown: onEmbeddedComboboxPointerDown,
785
+ onKeydown: [
786
+ withKeys(withModifiers(selectNextResult, ["prevent"]), ["down"]),
787
+ withKeys(withModifiers(selectPrevResult, ["prevent"]), ["up"]),
788
+ withKeys(withModifiers(setCurrentResult, ["prevent"]), ["enter"]),
789
+ withKeys(onClickOutside, ["esc"]),
790
+ withKeys(onClickOutside, ["tab"])
791
+ ]
792
+ }, null, 46, _hoisted_6$13)), [[vModelText, search.value]]),
793
+ createVNode(ADropdownList_default, {
794
+ "listbox-id": listboxId,
795
+ ariaLabel: __props.ariaLabel ?? __props.label ?? "",
796
+ open: dropdown.open,
797
+ "list-anchor": __props.listAnchor,
798
+ "option-count": optionCount,
799
+ "active-index": () => dropdown.activeItemIndex
800
+ }, {
801
+ default: withCtx(() => [dropdown.loading ? (openBlock(), createElementBlock("li", _hoisted_7$6, "Loading results...")) : linkPicker.value ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(linkResults.value, (option, i) => {
802
+ return openBlock(), createElementBlock("li", {
803
+ id: `${listboxId}-opt-${i}`,
804
+ key: String(option.id),
805
+ role: "option",
806
+ "aria-selected": isLinkOptionSelected(option),
807
+ class: normalizeClass(["autocomplete-result", {
808
+ "is-active": i === dropdown.activeItemIndex,
809
+ "is-selected": isLinkOptionSelected(option)
810
+ }]),
811
+ onMousedown: withModifiers(($event) => selectLinkOption(option), ["prevent"]),
812
+ onMouseenter: ($event) => dropdown.activeItemIndex = i
813
+ }, [renderSlot(_ctx.$slots, "option", { option }, () => [createTextVNode(toDisplayString(option.displayText ?? String(option.id)), 1)], true)], 42, _hoisted_8$6);
814
+ }), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(dropdown.results, (result, i) => {
815
+ return openBlock(), createElementBlock("li", {
816
+ id: `${listboxId}-opt-${i}`,
817
+ key: result,
818
+ role: "option",
819
+ "aria-selected": isChoiceSelected(result),
820
+ class: normalizeClass(["autocomplete-result", {
821
+ "is-active": i === dropdown.activeItemIndex,
822
+ "is-selected": isChoiceSelected(result)
823
+ }]),
824
+ onMousedown: withModifiers(($event) => setChoiceResult(result), ["prevent"]),
825
+ onMouseenter: ($event) => dropdown.activeItemIndex = i
826
+ }, toDisplayString(result), 43, _hoisted_9$5);
827
+ }), 128))]),
828
+ _: 3
829
+ }, 8, [
830
+ "ariaLabel",
831
+ "open",
832
+ "list-anchor",
833
+ "active-index"
834
+ ]),
835
+ __props.label && !__props.embedded ? (openBlock(), createElementBlock("label", {
836
+ key: 2,
837
+ class: "aform_field-label",
838
+ for: __props.uuid
839
+ }, toDisplayString(__props.label), 9, _hoisted_10$5)) : createCommentVNode("", true)
840
+ ], 2)), [[unref(vOnClickOutside), onClickOutside]]), !__props.embedded ? withDirectives((openBlock(), createElementBlock("p", {
510
841
  key: 0,
511
- id: listboxId,
512
- ref: "results",
513
- class: "autocomplete-results",
514
- role: "listbox",
515
- "aria-label": __props.ariaLabel
516
- }, [loading.value ? (openBlock(), createElementBlock("li", _hoisted_12$4, "Loading…")) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(dropdownResults.value, (option, i) => {
517
- return openBlock(), createElementBlock("li", {
518
- id: `${listboxId}-opt-${i}`,
519
- key: String(option.id),
520
- role: "option",
521
- "aria-selected": i === activeIndex.value,
522
- class: normalizeClass(["autocomplete-result", { "is-active": i === activeIndex.value }]),
523
- onMousedown: withModifiers(($event) => selectOption(option), ["prevent"])
524
- }, [renderSlot(_ctx.$slots, "option", { option }, () => [createTextVNode(toDisplayString(option.displayText ?? String(option.id)), 1)], true)], 42, _hoisted_13$3);
525
- }), 128))], 8, _hoisted_11$4)) : createCommentVNode("", true)])), [[unref(vOnClickOutside), onClickOutside]]), __props.label && !__props.embedded ? (openBlock(), createElementBlock("label", _hoisted_14$3, toDisplayString(__props.label), 1)) : createCommentVNode("", true)], 64))], 2);
842
+ id: unref(errorId),
843
+ class: "aform_error",
844
+ role: "alert"
845
+ }, toDisplayString(errorText.value), 9, _hoisted_11$5)), [[vShow, errorText.value]]) : createCommentVNode("", true)], 64))], 2);
526
846
  };
527
847
  }
528
- }), [["__scopeId", "data-v-a42cba74"]]);
848
+ }), [["__scopeId", "data-v-32a34889"]]);
529
849
  //#endregion
530
850
  //#region src/components/form/ACurrencyInput.vue?vue&type=script&setup=true&lang.ts
531
- var _hoisted_1$19 = { class: "aform_form-element acurrency" };
532
- var _hoisted_2$18 = { class: "aform_display-value" };
851
+ var _hoisted_1$23 = { class: "aform_form-element acurrency" };
852
+ var _hoisted_2$19 = { class: "aform_display-value" };
533
853
  var _hoisted_3$16 = { class: "aform_field-label" };
534
854
  var _hoisted_4$16 = { class: "acurrency__row" };
535
855
  var _hoisted_5$15 = { class: "acurrency__field acurrency__field--amount" };
536
856
  var _hoisted_6$12 = { class: "acurrency__group" };
537
- var _hoisted_7$5 = { class: "acurrency__currency" };
538
- var _hoisted_8$5 = { class: "acurrency__amount-wrap" };
857
+ var _hoisted_7$5 = { class: "acurrency__amount-wrap" };
858
+ var _hoisted_8$5 = [
859
+ "id",
860
+ "value",
861
+ "disabled",
862
+ "required",
863
+ "aria-invalid",
864
+ "aria-describedby"
865
+ ];
539
866
  var _hoisted_9$4 = [
540
867
  "id",
541
868
  "disabled",
@@ -543,19 +870,14 @@ var _hoisted_9$4 = [
543
870
  "aria-invalid",
544
871
  "aria-describedby"
545
872
  ];
546
- var _hoisted_10$3 = ["for"];
547
- var _hoisted_11$3 = { class: "acurrency__row acurrency__row--base" };
548
- var _hoisted_12$3 = { class: "acurrency__field acurrency__field--base-currency" };
549
- var _hoisted_13$2 = ["value"];
550
- var _hoisted_14$2 = { class: "aform_field-label" };
551
- var _hoisted_15$1 = { class: "acurrency__field acurrency__field--base-amount" };
552
- var _hoisted_16$1 = ["value"];
553
- var _hoisted_17$1 = { class: "aform_field-label" };
554
- var _hoisted_18$1 = { class: "acurrency__field acurrency__field--exchange-rate" };
555
- var _hoisted_19$1 = ["value"];
556
- var _hoisted_20$1 = { class: "aform_field-label" };
557
- var _hoisted_21$1 = ["id"];
558
- var FLOAT_NOISE_DECIMALS = 6;
873
+ var _hoisted_10$4 = ["for"];
874
+ var _hoisted_11$4 = {
875
+ class: "acurrency__field acurrency__field--base-currency",
876
+ "aria-hidden": "true"
877
+ };
878
+ var _hoisted_12$3 = ["value"];
879
+ var _hoisted_13$2 = ["id"];
880
+ var _hoisted_14$1 = ["id"];
559
881
  //#endregion
560
882
  //#region src/components/form/ACurrencyInput.vue
561
883
  var ACurrencyInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -571,31 +893,50 @@ var ACurrencyInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
571
893
  validation: { default: () => ({ errorMessage: "" }) },
572
894
  errors: {},
573
895
  options: { default: () => ({}) },
574
- currencyLabel: { default: "Currency" },
575
- baseCurrencyLabel: { default: "Base Currency" },
576
- baseAmountLabel: { default: "Base Amount" },
577
- exchangeRateLabel: { default: "Exchange Rate" }
896
+ currencyLabel: { default: "Currency" }
578
897
  }, {
579
- "modelValue": { default: () => ({
580
- amount: null,
581
- currency: { id: "" },
582
- baseAmount: null,
583
- baseCurrency: { id: "" },
584
- exchangeRate: 1
585
- }) },
898
+ "modelValue": {},
586
899
  "modelModifiers": {}
587
900
  }),
588
901
  emits: ["update:modelValue"],
589
902
  setup(__props) {
590
903
  const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
591
- const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
592
- const currencySymbol = (value) => value.symbol ?? value.displayText ?? String(value.id);
904
+ const helperId = computed(() => __props.uuid ? `${__props.uuid}-helper` : void 0);
593
905
  const modelValue = useModel(__props, "modelValue");
594
- const normalizedBaseCurrency = computed(() => {
595
- const base = __props.options.baseCurrency ?? modelValue.value?.baseCurrency;
596
- if (!base) return { id: "" };
597
- return typeof base === "string" ? { id: base } : base;
906
+ const showBase = computed(() => {
907
+ const v = modelValue.value;
908
+ return !!v?.baseCurrency?.id && (v.currency?.id !== v.baseCurrency?.id || v.amount !== v.baseAmount);
909
+ });
910
+ const helperDescribedBy = computed(() => showBase.value && !errorText.value ? helperId.value : void 0);
911
+ const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText, helperDescribedBy);
912
+ const currencySymbol = (value) => value.symbol ?? value.displayText ?? String(value.id);
913
+ const currencyDropdownRef = useTemplateRef("currencyDropdownRef");
914
+ const openCurrencyList = () => {
915
+ currencyDropdownRef.value?.openCurrencyList?.();
916
+ };
917
+ const focusCurrencyPicker = (event) => {
918
+ const root = event.currentTarget;
919
+ if (event.target.closest("input")) {
920
+ openCurrencyList();
921
+ return;
922
+ }
923
+ root.querySelector("input[role=\"combobox\"]")?.focus();
924
+ openCurrencyList();
925
+ };
926
+ const amountMaskEnabled = computed(() => __props.options.amountMask !== false);
927
+ const amountFocused = ref(false);
928
+ const amountText = ref("");
929
+ const selectedCurrencyId = computed(() => String(modelValue.value?.currency?.id ?? ""));
930
+ const syncAmountTextFromModel = () => {
931
+ amountText.value = formatCurrencyAmountInput(modelValue.value?.amount ?? null, selectedCurrencyId.value);
932
+ };
933
+ watch(selectedCurrencyId, () => {
934
+ if (!amountFocused.value) syncAmountTextFromModel();
598
935
  });
936
+ watch(() => modelValue.value?.amount, () => {
937
+ if (!amountFocused.value) syncAmountTextFromModel();
938
+ }, { immediate: true });
939
+ const normalizedBaseCurrency = computed(() => normalizeBaseCurrency(__props.options, modelValue.value));
599
940
  const resolver = inject("aformLinkResolver", null);
600
941
  const resolvedBaseCurrency = ref(normalizedBaseCurrency.value);
601
942
  watch(normalizedBaseCurrency, async (base) => {
@@ -618,35 +959,13 @@ var ACurrencyInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
618
959
  if (!base?.id) return "";
619
960
  return base.displayText ?? String(base.id);
620
961
  });
621
- const resolveExchangeRate = (currencyId) => {
622
- const baseId = resolvedBaseCurrency.value.id;
623
- if (!currencyId || String(currencyId) === String(baseId)) return 1;
624
- if (String(currencyId) === String(modelValue.value?.currency?.id)) return modelValue.value?.exchangeRate ?? __props.options.exchangeRates?.[String(currencyId)] ?? 1;
625
- return __props.options.exchangeRates?.[String(currencyId)] ?? 1;
626
- };
627
- const baseDecimals = computed(() => {
628
- const { precision } = __props.options;
629
- if (precision === void 0) return FLOAT_NOISE_DECIMALS;
630
- return Number.isInteger(precision) && precision >= 0 && precision <= 100 ? precision : FLOAT_NOISE_DECIMALS;
631
- });
632
- const roundAmount = (value) => Number(value.toFixed(baseDecimals.value));
633
- const recompute = (amount, currencyValue) => {
634
- const exchangeRate = resolveExchangeRate(currencyValue.id);
635
- modelValue.value = {
636
- amount,
637
- currency: currencyValue,
638
- exchangeRate,
639
- baseCurrency: resolvedBaseCurrency.value,
640
- baseAmount: amount === null ? null : roundAmount(amount * exchangeRate)
641
- };
642
- };
643
962
  const amount = computed({
644
963
  get: () => modelValue.value?.amount ?? null,
645
- set: (value) => recompute(numberFromBox(value), modelValue.value?.currency ?? { id: "" })
964
+ set: (value) => modelValue.value = patchCurrencyAmount(modelValue.value, numberFromBox(value), __props.options, resolvedBaseCurrency.value)
646
965
  });
647
966
  const currency = computed({
648
967
  get: () => modelValue.value?.currency ?? { id: "" },
649
- set: (value) => recompute(modelValue.value?.amount ?? null, value)
968
+ set: (value) => modelValue.value = patchCurrencyCurrency(modelValue.value, value, __props.options, resolvedBaseCurrency.value)
650
969
  });
651
970
  const amountNavigationKeys = /* @__PURE__ */ new Set([
652
971
  "Backspace",
@@ -674,94 +993,163 @@ var ACurrencyInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
674
993
  const pasted = event.clipboardData?.getData("text") ?? "";
675
994
  if (!/^-?\d*\.?\d*$/.test(pasted)) event.preventDefault();
676
995
  };
677
- const showBase = computed(() => {
996
+ const onAmountFocus = (event) => {
997
+ amountFocused.value = true;
998
+ const input = event.target;
999
+ if (input) requestAnimationFrame(() => input.select());
1000
+ };
1001
+ const onAmountBlur = () => {
1002
+ amountFocused.value = false;
1003
+ const parsed = parseCurrencyAmountInput(amountText.value);
1004
+ modelValue.value = patchCurrencyAmount(modelValue.value, parsed, __props.options, resolvedBaseCurrency.value);
1005
+ syncAmountTextFromModel();
1006
+ };
1007
+ const onAmountInput = (event) => {
1008
+ const input = event.target;
1009
+ amountText.value = input.value;
1010
+ const parsed = parseCurrencyAmountInput(amountText.value);
1011
+ if (amountText.value.trim() === "" || amountText.value.trim() === "-" || parsed !== null) modelValue.value = patchCurrencyAmount(modelValue.value, parsed, __props.options, resolvedBaseCurrency.value);
1012
+ };
1013
+ const onAmountKeydownMasked = (event) => {
1014
+ if (event.ctrlKey || event.metaKey || event.altKey) return;
1015
+ if (amountNavigationKeys.has(event.key)) return;
1016
+ if (/^[0-9]$/.test(event.key)) return;
1017
+ if (event.key === "-") {
1018
+ const input = event.target;
1019
+ if (!input.value.includes("-") && input.selectionStart === 0) return;
1020
+ }
1021
+ if (event.key === "." || event.key === ",") {
1022
+ if (currencyInputFractionDigits(selectedCurrencyId.value) === 0) {
1023
+ event.preventDefault();
1024
+ return;
1025
+ }
1026
+ const input = event.target;
1027
+ if (!input.value.includes(".") && !input.value.includes(",")) return;
1028
+ }
1029
+ const pattern = currencyAmountEntryPattern(selectedCurrencyId.value);
1030
+ const { selectionStart, selectionEnd, value } = event.target;
1031
+ if (selectionStart === null || selectionEnd === null) {
1032
+ event.preventDefault();
1033
+ return;
1034
+ }
1035
+ const next = value.slice(0, selectionStart) + event.key + value.slice(selectionEnd);
1036
+ if (event.key.length === 1 && !pattern.test(next)) event.preventDefault();
1037
+ };
1038
+ const onAmountPasteMasked = (event) => {
1039
+ const input = event.target;
1040
+ const pasted = (event.clipboardData?.getData("text") ?? "").trim();
1041
+ const text = input.value.slice(0, input.selectionStart ?? 0) + pasted + input.value.slice(input.selectionEnd ?? 0);
1042
+ if (!currencyAmountEntryPattern(selectedCurrencyId.value).test(text)) event.preventDefault();
1043
+ };
1044
+ const conversionHelperText = computed(() => {
678
1045
  const v = modelValue.value;
679
- return !!v?.baseCurrency?.id && (v.currency?.id !== v.baseCurrency?.id || v.amount !== v.baseAmount);
1046
+ if (!v || v.baseAmount === null || v.amount === null) return "";
1047
+ const baseLabel = baseCurrencyText.value || String(v.baseCurrency?.id ?? "");
1048
+ const enteredId = String(v.currency?.id ?? "");
1049
+ const rate = v.exchangeRate;
1050
+ return `≈ ${formatCurrencyAmount(v.baseAmount, v.baseCurrency)} · 1 ${enteredId} = ${rate} ${baseLabel}`;
680
1051
  });
681
1052
  const displayText = computed(() => {
682
1053
  const v = modelValue.value;
683
1054
  if (!v || !v.currency?.id || v.amount === null) return "—";
684
- const currencyText = v.currency.displayText ?? String(v.currency.id);
685
- const base = `${v.amount} ${currencyText}`;
1055
+ const base = formatCurrencyAmount(v.amount, v.currency);
686
1056
  if (!showBase.value) return base;
687
- const baseText = v.baseCurrency.displayText ?? String(v.baseCurrency.id);
688
- return `${base} (${v.baseAmount} ${baseText})`;
1057
+ return `${base} (≈ ${formatCurrencyAmount(v.baseAmount, v.baseCurrency)})`;
689
1058
  });
690
1059
  return (_ctx, _cache) => {
691
- return openBlock(), createElementBlock("div", _hoisted_1$19, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$18, toDisplayString(displayText.value), 1), createElementVNode("label", _hoisted_3$16, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
692
- createElementVNode("div", _hoisted_4$16, [createElementVNode("div", _hoisted_5$15, [createElementVNode("div", _hoisted_6$12, [createElementVNode("div", _hoisted_7$5, [createVNode(AFormLink_default, {
693
- modelValue: currency.value,
694
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => currency.value = $event),
695
- mode: __props.mode,
696
- embedded: "",
697
- placeholder: __props.currencyLabel,
698
- "aria-label": __props.currencyLabel,
699
- required: __props.required,
700
- formatter: currencySymbol,
701
- doctype: __props.options.doctype,
702
- "filter-function": __props.options.filterFunction,
703
- "is-async": __props.options.isAsync
704
- }, {
705
- option: withCtx(({ option }) => [createTextVNode(toDisplayString(option.symbol ? `${option.symbol} — ` : "") + toDisplayString(option.displayText ?? option.id), 1)]),
706
- _: 1
707
- }, 8, [
708
- "modelValue",
709
- "mode",
710
- "placeholder",
711
- "aria-label",
712
- "required",
713
- "doctype",
714
- "filter-function",
715
- "is-async"
716
- ])]), createElementVNode("div", _hoisted_8$5, [withDirectives(createElementVNode("input", {
717
- id: __props.uuid,
718
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => amount.value = $event),
719
- class: "acurrency__amount",
720
- type: "number",
721
- disabled: __props.mode === "read",
722
- required: __props.required,
723
- "aria-invalid": unref(invalid),
724
- "aria-describedby": unref(describedBy),
725
- onKeydown: onAmountKeydown,
726
- onPaste: onAmountPaste
727
- }, null, 40, _hoisted_9$4), [[
728
- vModelText,
729
- amount.value,
730
- void 0,
731
- { number: true }
732
- ]]), createElementVNode("label", {
733
- class: "aform_field-label",
734
- for: __props.uuid
735
- }, toDisplayString(__props.label), 9, _hoisted_10$3)])])])]),
736
- createElementVNode("div", _hoisted_11$3, [
737
- createElementVNode("div", _hoisted_12$3, [createElementVNode("input", {
738
- value: baseCurrencyText.value,
739
- class: "aform_input-field acurrency__base-field",
1060
+ return openBlock(), createElementBlock("div", _hoisted_1$23, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$19, toDisplayString(displayText.value), 1), createElementVNode("label", _hoisted_3$16, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1061
+ createElementVNode("div", _hoisted_4$16, [createElementVNode("div", _hoisted_5$15, [createElementVNode("div", _hoisted_6$12, [
1062
+ createElementVNode("div", {
1063
+ class: "acurrency__currency",
1064
+ onClick: focusCurrencyPicker
1065
+ }, [createVNode(ADropdown_default, {
1066
+ ref_key: "currencyDropdownRef",
1067
+ ref: currencyDropdownRef,
1068
+ "link-value": currency.value,
1069
+ "onUpdate:linkValue": _cache[0] || (_cache[0] = ($event) => currency.value = $event),
1070
+ link: "",
1071
+ embedded: "",
1072
+ "list-anchor": "group",
1073
+ mode: __props.mode,
1074
+ required: __props.required,
1075
+ placeholder: __props.currencyLabel,
1076
+ "aria-label": __props.currencyLabel,
1077
+ formatter: currencySymbol,
1078
+ doctype: __props.options.doctype,
1079
+ "link-filter-function": __props.options.filterFunction,
1080
+ "is-async": __props.options.isAsync
1081
+ }, {
1082
+ option: withCtx(({ option }) => [createTextVNode(toDisplayString(option.symbol ? `${option.symbol} — ` : "") + toDisplayString(option.displayText ?? option.id), 1)]),
1083
+ _: 1
1084
+ }, 8, [
1085
+ "link-value",
1086
+ "mode",
1087
+ "required",
1088
+ "placeholder",
1089
+ "aria-label",
1090
+ "doctype",
1091
+ "link-filter-function",
1092
+ "is-async"
1093
+ ])]),
1094
+ createElementVNode("div", _hoisted_7$5, [amountMaskEnabled.value ? (openBlock(), createElementBlock("input", {
1095
+ key: 0,
1096
+ id: __props.uuid,
1097
+ value: amountText.value,
1098
+ class: "acurrency__amount",
740
1099
  type: "text",
741
- disabled: ""
742
- }, null, 8, _hoisted_13$2), createElementVNode("label", _hoisted_14$2, toDisplayString(__props.baseCurrencyLabel), 1)]),
743
- createElementVNode("div", _hoisted_15$1, [createElementVNode("input", {
744
- value: modelValue.value?.baseAmount,
745
- class: "aform_input-field acurrency__base-field",
746
- type: "number",
747
- disabled: ""
748
- }, null, 8, _hoisted_16$1), createElementVNode("label", _hoisted_17$1, toDisplayString(__props.baseAmountLabel), 1)]),
749
- createElementVNode("div", _hoisted_18$1, [createElementVNode("input", {
750
- value: modelValue.value?.exchangeRate,
751
- class: "aform_input-field acurrency__base-field",
1100
+ inputmode: "decimal",
1101
+ autocomplete: "off",
1102
+ disabled: __props.mode === "read",
1103
+ required: __props.required,
1104
+ "aria-invalid": unref(invalid),
1105
+ "aria-describedby": unref(describedBy),
1106
+ onFocus: onAmountFocus,
1107
+ onBlur: onAmountBlur,
1108
+ onInput: onAmountInput,
1109
+ onKeydown: onAmountKeydownMasked,
1110
+ onPaste: onAmountPasteMasked
1111
+ }, null, 40, _hoisted_8$5)) : withDirectives((openBlock(), createElementBlock("input", {
1112
+ key: 1,
1113
+ id: __props.uuid,
1114
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => amount.value = $event),
1115
+ class: "acurrency__amount",
752
1116
  type: "number",
753
- disabled: ""
754
- }, null, 8, _hoisted_19$1), createElementVNode("label", _hoisted_20$1, toDisplayString(__props.exchangeRateLabel), 1)])
755
- ]),
1117
+ disabled: __props.mode === "read",
1118
+ required: __props.required,
1119
+ "aria-invalid": unref(invalid),
1120
+ "aria-describedby": unref(describedBy),
1121
+ onKeydown: onAmountKeydown,
1122
+ onPaste: onAmountPaste
1123
+ }, null, 40, _hoisted_9$4)), [[
1124
+ vModelText,
1125
+ amount.value,
1126
+ void 0,
1127
+ { number: true }
1128
+ ]])]),
1129
+ createElementVNode("label", {
1130
+ class: "aform_field-label",
1131
+ for: __props.uuid
1132
+ }, toDisplayString(__props.label), 9, _hoisted_10$4)
1133
+ ])]), createElementVNode("div", _hoisted_11$4, [createElementVNode("input", {
1134
+ type: "text",
1135
+ readonly: "",
1136
+ tabindex: "-1",
1137
+ value: baseCurrencyText.value
1138
+ }, null, 8, _hoisted_12$3)])]),
1139
+ showBase.value && !errorText.value ? (openBlock(), createElementBlock("p", {
1140
+ key: 0,
1141
+ id: helperId.value,
1142
+ class: "acurrency__helper"
1143
+ }, toDisplayString(conversionHelperText.value), 9, _hoisted_13$2)) : createCommentVNode("", true),
756
1144
  withDirectives(createElementVNode("p", {
757
1145
  id: unref(errorId),
758
1146
  class: "aform_error",
759
1147
  role: "alert"
760
- }, toDisplayString(errorText.value), 9, _hoisted_21$1), [[vShow, errorText.value]])
1148
+ }, toDisplayString(errorText.value), 9, _hoisted_14$1), [[vShow, errorText.value]])
761
1149
  ], 64))]);
762
1150
  };
763
1151
  }
764
- }), [["__scopeId", "data-v-140c66a7"]]);
1152
+ }), [["__scopeId", "data-v-7de4a96e"]]);
765
1153
  //#endregion
766
1154
  //#region src/utils/typedDay.ts
767
1155
  var TYPED_DAY_FORMAT = {
@@ -801,8 +1189,8 @@ function readTypedDay(text, locale) {
801
1189
  }
802
1190
  //#endregion
803
1191
  //#region src/components/form/ADatePicker.vue?vue&type=script&setup=true&lang.ts
804
- var _hoisted_1$18 = { class: "aform_display-value" };
805
- var _hoisted_2$17 = { key: 0 };
1192
+ var _hoisted_1$22 = { class: "aform_display-value" };
1193
+ var _hoisted_2$18 = { key: 0 };
806
1194
  var _hoisted_3$15 = ["id"];
807
1195
  var _hoisted_4$15 = { class: "adatepicker" };
808
1196
  var _hoisted_5$14 = ["aria-label"];
@@ -816,8 +1204,8 @@ var _hoisted_8$4 = {
816
1204
  class: "range-inputs"
817
1205
  };
818
1206
  var _hoisted_9$3 = { class: "date-input" };
819
- var _hoisted_10$2 = ["value"];
820
- var _hoisted_11$2 = ["value"];
1207
+ var _hoisted_10$3 = ["value"];
1208
+ var _hoisted_11$3 = ["value"];
821
1209
  var _hoisted_12$2 = { class: "days-header" };
822
1210
  var _hoisted_13$1 = [
823
1211
  "tabindex",
@@ -828,7 +1216,7 @@ var _hoisted_13$1 = [
828
1216
  "onKeydown",
829
1217
  "onMouseover"
830
1218
  ];
831
- var _hoisted_14$1 = ["id"];
1219
+ var _hoisted_14 = ["id"];
832
1220
  var numberOfRows = 6;
833
1221
  var numberOfColumns = 7;
834
1222
  //#endregion
@@ -1059,8 +1447,8 @@ var ADatePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
1059
1447
  });
1060
1448
  return (_ctx, _cache) => {
1061
1449
  return __props.mode === "display" || __props.mode === "read" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1062
- createElementVNode("span", _hoisted_1$18, toDisplayString(displayValue.value), 1),
1063
- __props.label ? (openBlock(), createElementBlock("label", _hoisted_2$17, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
1450
+ createElementVNode("span", _hoisted_1$22, toDisplayString(displayValue.value), 1),
1451
+ __props.label ? (openBlock(), createElementBlock("label", _hoisted_2$18, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
1064
1452
  withDirectives(createElementVNode("p", {
1065
1453
  id: unref(errorId),
1066
1454
  class: "aform_error",
@@ -1095,7 +1483,7 @@ var ADatePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
1095
1483
  placeholder: "start date",
1096
1484
  onBlur: _cache[0] || (_cache[0] = ($event) => enterInputDate()),
1097
1485
  onKeydown: enterDate
1098
- }, null, 40, _hoisted_10$2),
1486
+ }, null, 40, _hoisted_10$3),
1099
1487
  _cache[2] || (_cache[2] = createElementVNode("div", null, "-", -1)),
1100
1488
  createElementVNode("input", {
1101
1489
  ref: "end-date-input",
@@ -1105,7 +1493,7 @@ var ADatePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
1105
1493
  placeholder: "end date",
1106
1494
  onBlur: _cache[1] || (_cache[1] = ($event) => enterInputDate()),
1107
1495
  onKeydown: enterDate
1108
- }, null, 40, _hoisted_11$2)
1496
+ }, null, 40, _hoisted_11$3)
1109
1497
  ])])])) : createCommentVNode("", true),
1110
1498
  createElementVNode("tr", _hoisted_12$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(weekdayLetters.value, (letter, weekdayIndex) => {
1111
1499
  return openBlock(), createElementBlock("td", { key: weekdayIndex }, toDisplayString(letter), 1);
@@ -1139,14 +1527,14 @@ var ADatePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
1139
1527
  id: unref(errorId),
1140
1528
  class: "aform_error",
1141
1529
  role: "alert"
1142
- }, toDisplayString(errorText.value), 9, _hoisted_14$1), [[vShow, errorText.value]])], 64));
1530
+ }, toDisplayString(errorText.value), 9, _hoisted_14), [[vShow, errorText.value]])], 64));
1143
1531
  };
1144
1532
  }
1145
1533
  }), [["__scopeId", "data-v-d0133599"]]);
1146
1534
  //#endregion
1147
1535
  //#region src/components/form/ADateTimeInput.vue?vue&type=script&setup=true&lang.ts
1148
- var _hoisted_1$17 = { class: "adate_time" };
1149
- var _hoisted_2$16 = { class: "adate_time_fields" };
1536
+ var _hoisted_1$21 = { class: "adate_time" };
1537
+ var _hoisted_2$17 = { class: "adate_time_fields" };
1150
1538
  var _hoisted_3$14 = ["onKeydown"];
1151
1539
  var _hoisted_4$14 = ["onKeydown"];
1152
1540
  var _hoisted_5$13 = {
@@ -1285,7 +1673,7 @@ var ADateTimeInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
1285
1673
  }
1286
1674
  };
1287
1675
  return (_ctx, _cache) => {
1288
- return openBlock(), createElementBlock("div", _hoisted_1$17, [createElementVNode("div", _hoisted_2$16, [
1676
+ return openBlock(), createElementBlock("div", _hoisted_1$21, [createElementVNode("div", _hoisted_2$17, [
1289
1677
  withDirectives(createElementVNode("input", {
1290
1678
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => timeData.hours = $event),
1291
1679
  type: "text",
@@ -1341,8 +1729,8 @@ var ADateTimeInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
1341
1729
  }), [["__scopeId", "data-v-3a6e48db"]]);
1342
1730
  //#endregion
1343
1731
  //#region src/components/form/ADateSelection.vue?vue&type=script&setup=true&lang.ts
1344
- var _hoisted_1$16 = { class: "adate-selection" };
1345
- var _hoisted_2$15 = {
1732
+ var _hoisted_1$20 = { class: "adate-selection" };
1733
+ var _hoisted_2$16 = {
1346
1734
  key: 3,
1347
1735
  class: "empty"
1348
1736
  };
@@ -1433,7 +1821,7 @@ var ADateSelection_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
1433
1821
  tryEmitRange(data.source ?? "user");
1434
1822
  };
1435
1823
  return (_ctx, _cache) => {
1436
- return openBlock(), createElementBlock("div", _hoisted_1$16, [
1824
+ return openBlock(), createElementBlock("div", _hoisted_1$20, [
1437
1825
  __props.showDate ? (openBlock(), createBlock(ADatePicker_default, {
1438
1826
  key: 0,
1439
1827
  "model-value": __props.defaultDate,
@@ -1473,7 +1861,7 @@ var ADateSelection_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
1473
1861
  "default-meridiem",
1474
1862
  "use-seconds"
1475
1863
  ])], 64)) : createCommentVNode("", true),
1476
- !__props.showTime && !__props.showDate ? (openBlock(), createElementBlock("p", _hoisted_2$15, "empty")) : createCommentVNode("", true)
1864
+ !__props.showTime && !__props.showDate ? (openBlock(), createElementBlock("p", _hoisted_2$16, "empty")) : createCommentVNode("", true)
1477
1865
  ]);
1478
1866
  };
1479
1867
  }
@@ -1526,8 +1914,8 @@ function useFieldCalendar(box, calendar, uuid) {
1526
1914
  }
1527
1915
  //#endregion
1528
1916
  //#region src/components/form/ADate.vue?vue&type=script&setup=true&lang.ts
1529
- var _hoisted_1$15 = { class: "aform_display-value" };
1530
- var _hoisted_2$14 = { class: "aform_field-label" };
1917
+ var _hoisted_1$19 = { class: "aform_display-value" };
1918
+ var _hoisted_2$15 = { class: "aform_field-label" };
1531
1919
  var _hoisted_3$13 = [
1532
1920
  "id",
1533
1921
  "aria-controls",
@@ -1550,282 +1938,80 @@ var ADate_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
1550
1938
  required: { type: Boolean },
1551
1939
  mode: {},
1552
1940
  uuid: {},
1553
- validation: { default: () => ({ errorMessage: "" }) },
1554
- errors: {}
1555
- }, {
1556
- "modelValue": {},
1557
- "modelModifiers": {}
1558
- }),
1559
- emits: ["update:modelValue"],
1560
- setup(__props) {
1561
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
1562
- const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
1563
- const modelValue = useModel(__props, "modelValue");
1564
- const boxDay = computed({
1565
- get: () => modelValue.value,
1566
- set: (text) => modelValue.value = dayFromBox(text)
1567
- });
1568
- const displayValue = computed(() => modelValue.value ? fromISODate(modelValue.value)?.toLocaleString() ?? "Invalid Date" : "");
1569
- const { showPicker, calendarId, closePicker, openFromKey, closeOnEscape, closeWhenFocusLeaves } = useFieldCalendar(useTemplateRef("date"), useTemplateRef("picker"), __props.uuid);
1570
- const openPicker = () => {
1571
- if (__props.mode !== "read") showPicker.value = !showPicker.value;
1572
- };
1573
- const handleDate = (data) => {
1574
- modelValue.value = data.selected;
1575
- closePicker();
1576
- };
1577
- return (_ctx, _cache) => {
1578
- return openBlock(), createElementBlock("div", {
1579
- class: "aform_form-element",
1580
- onFocusout: _cache[2] || (_cache[2] = (...args) => unref(closeWhenFocusLeaves) && unref(closeWhenFocusLeaves)(...args)),
1581
- onKeydown: _cache[3] || (_cache[3] = (...args) => unref(closeOnEscape) && unref(closeOnEscape)(...args))
1582
- }, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_1$15, toDisplayString(displayValue.value), 1), createElementVNode("label", _hoisted_2$14, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1583
- withDirectives(createElementVNode("input", {
1584
- id: __props.uuid,
1585
- ref: "date",
1586
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => boxDay.value = $event),
1587
- class: "aform_input-field",
1588
- type: "date",
1589
- "aria-haspopup": "dialog",
1590
- "aria-controls": unref(showPicker) ? unref(calendarId) : void 0,
1591
- disabled: __props.mode === "read",
1592
- required: __props.required,
1593
- "aria-invalid": unref(invalid),
1594
- "aria-describedby": unref(describedBy),
1595
- onClick: withModifiers(openPicker, ["prevent"]),
1596
- onKeydown: _cache[1] || (_cache[1] = (...args) => unref(openFromKey) && unref(openFromKey)(...args))
1597
- }, null, 40, _hoisted_3$13), [[vModelText, boxDay.value]]),
1598
- createElementVNode("label", {
1599
- class: "aform_field-label",
1600
- for: __props.uuid
1601
- }, toDisplayString(__props.label), 9, _hoisted_4$13),
1602
- withDirectives(createElementVNode("p", {
1603
- id: unref(errorId),
1604
- class: "aform_error",
1605
- role: "alert"
1606
- }, toDisplayString(errorText.value), 9, _hoisted_5$12), [[vShow, errorText.value]]),
1607
- unref(showPicker) ? (openBlock(), createBlock(ADateSelection_default, {
1608
- key: 0,
1609
- id: unref(calendarId),
1610
- ref: "picker",
1611
- class: "adate-picker",
1612
- role: "dialog",
1613
- "aria-label": __props.label,
1614
- "default-date": modelValue.value || void 0,
1615
- "select-range": false,
1616
- "show-time": false,
1617
- onGetDate: handleDate
1618
- }, null, 8, [
1619
- "id",
1620
- "aria-label",
1621
- "default-date"
1622
- ])) : createCommentVNode("", true)
1623
- ], 64))], 32);
1624
- };
1625
- }
1626
- }), [["__scopeId", "data-v-16f8f8f2"]]);
1627
- //#endregion
1628
- //#region src/components/form/ADropdown.vue?vue&type=script&setup=true&lang.ts
1629
- var _hoisted_1$14 = { class: "aform_form-element" };
1630
- var _hoisted_2$13 = {
1631
- key: 1,
1632
- class: "aform_display-value"
1633
- };
1634
- var _hoisted_3$12 = { class: "aform_field-label" };
1635
- var _hoisted_4$12 = [
1636
- "id",
1637
- "disabled",
1638
- "aria-expanded",
1639
- "aria-controls",
1640
- "aria-activedescendant",
1641
- "aria-invalid",
1642
- "aria-describedby",
1643
- "onKeydown"
1644
- ];
1645
- var _hoisted_5$11 = ["id", "aria-label"];
1646
- var _hoisted_6$9 = {
1647
- key: 0,
1648
- class: "loading autocomplete-result"
1649
- };
1650
- var _hoisted_7$3 = [
1651
- "id",
1652
- "aria-selected",
1653
- "onMousedown"
1654
- ];
1655
- var _hoisted_8$3 = ["for"];
1656
- var _hoisted_9$2 = ["id"];
1657
- //#endregion
1658
- //#region src/components/form/ADropdown.vue
1659
- var ADropdown_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
1660
- __name: "ADropdown",
1661
- props: /*@__PURE__*/ mergeModels({
1662
- schema: {},
1663
- label: {},
1664
- selectRange: { type: Boolean },
1665
- mask: {},
1666
- required: { type: Boolean },
1667
- mode: {},
1668
- uuid: {},
1669
- validation: { default: () => ({ errorMessage: "" }) },
1670
- errors: {},
1671
- options: { default: () => [] },
1672
- format: {},
1673
- isAsync: {
1674
- type: Boolean,
1675
- default: false
1676
- },
1677
- filterFunction: {
1678
- type: Function,
1679
- default: void 0
1680
- }
1681
- }, {
1682
- "modelValue": {},
1683
- "modelModifiers": {}
1684
- }),
1685
- emits: ["update:modelValue"],
1686
- setup(__props) {
1687
- const listboxId = useId();
1688
- const choiceList = computed(() => selectChoices(__props.options));
1689
- const formatFn = computed(() => __props.format ? deserializeFunction(__props.format) : void 0);
1690
- const badgeDescriptor = computed(() => resolveFieldBadge(search.value, __props.options, formatFn.value));
1691
- const inputAccentStyle = computed(() => badgeInputAccentStyle(badgeDescriptor.value));
1692
- const displayAccentStyle = computed(() => badgeInputAccentStyle(badgeDescriptor.value));
1693
- const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
1694
- const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
1695
- const search = useModel(__props, "modelValue");
1696
- const committedValue = ref(search.value ?? "");
1697
- const dropdown = reactive({
1698
- activeItemIndex: null,
1699
- open: false,
1700
- loading: false,
1701
- results: []
1702
- });
1703
- fitDropdownList(useTemplateRef("results"), {
1704
- isOpen: () => dropdown.open,
1705
- optionCount: () => dropdown.results.length,
1706
- activeIndex: () => dropdown.activeItemIndex
1707
- });
1708
- watch(choiceList, (choices) => {
1709
- dropdown.results = choices;
1710
- }, { immediate: true });
1711
- const onClickOutside = () => closeDropdown();
1712
- const filter = async () => {
1713
- dropdown.open = true;
1714
- dropdown.activeItemIndex = null;
1715
- if (__props.filterFunction) {
1716
- if (__props.isAsync) dropdown.loading = true;
1717
- try {
1718
- const filteredResults = await __props.filterFunction(search.value || "");
1719
- dropdown.results = filteredResults || [];
1720
- } catch {
1721
- dropdown.results = [];
1722
- } finally {
1723
- if (__props.isAsync) dropdown.loading = false;
1724
- }
1725
- } else filterResults();
1726
- };
1727
- const setResult = (result) => {
1728
- search.value = result;
1729
- committedValue.value = result;
1730
- closeDropdown(result);
1731
- };
1732
- const openDropdown = () => {
1733
- const idx = choiceList.value.indexOf(search.value ?? "");
1734
- dropdown.activeItemIndex = __props.isAsync ? null : idx >= 0 ? idx : null;
1735
- dropdown.open = true;
1736
- dropdown.results = __props.isAsync ? [] : choiceList.value;
1737
- };
1738
- const closeDropdown = (result) => {
1739
- dropdown.activeItemIndex = null;
1740
- dropdown.open = false;
1741
- if (!choiceList.value.includes(result || search.value || "")) search.value = committedValue.value;
1742
- };
1743
- const filterResults = () => {
1744
- if (!search.value) dropdown.results = choiceList.value;
1745
- else dropdown.results = choiceList.value.filter((item) => item.toLowerCase().includes((search.value ?? "").toLowerCase()));
1746
- };
1747
- const selectNextResult = () => {
1748
- const resultsLength = dropdown.results?.length || 0;
1749
- if (dropdown.activeItemIndex != null) {
1750
- const currentIndex = isNaN(dropdown.activeItemIndex) ? 0 : dropdown.activeItemIndex;
1751
- dropdown.activeItemIndex = (currentIndex + 1) % resultsLength;
1752
- } else dropdown.activeItemIndex = 0;
1753
- };
1754
- const selectPrevResult = () => {
1755
- const resultsLength = dropdown.results?.length || 0;
1756
- if (dropdown.activeItemIndex != null) {
1757
- const currentIndex = isNaN(dropdown.activeItemIndex) ? 0 : dropdown.activeItemIndex;
1758
- if (currentIndex === 0) dropdown.activeItemIndex = null;
1759
- else dropdown.activeItemIndex = currentIndex - 1;
1760
- } else dropdown.activeItemIndex = resultsLength - 1;
1941
+ validation: { default: () => ({ errorMessage: "" }) },
1942
+ errors: {}
1943
+ }, {
1944
+ "modelValue": {},
1945
+ "modelModifiers": {}
1946
+ }),
1947
+ emits: ["update:modelValue"],
1948
+ setup(__props) {
1949
+ const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
1950
+ const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
1951
+ const modelValue = useModel(__props, "modelValue");
1952
+ const boxDay = computed({
1953
+ get: () => modelValue.value,
1954
+ set: (text) => modelValue.value = dayFromBox(text)
1955
+ });
1956
+ const displayValue = computed(() => modelValue.value ? fromISODate(modelValue.value)?.toLocaleString() ?? "Invalid Date" : "");
1957
+ const { showPicker, calendarId, closePicker, openFromKey, closeOnEscape, closeWhenFocusLeaves } = useFieldCalendar(useTemplateRef("date"), useTemplateRef("picker"), __props.uuid);
1958
+ const openPicker = () => {
1959
+ if (__props.mode !== "read") showPicker.value = !showPicker.value;
1761
1960
  };
1762
- const setCurrentResult = () => {
1763
- if (dropdown.results) {
1764
- const currentIndex = dropdown.activeItemIndex || 0;
1765
- const result = dropdown.results[currentIndex];
1766
- setResult(result);
1767
- }
1768
- dropdown.activeItemIndex = 0;
1961
+ const handleDate = (data) => {
1962
+ modelValue.value = data.selected;
1963
+ closePicker();
1769
1964
  };
1770
1965
  return (_ctx, _cache) => {
1771
- return openBlock(), createElementBlock("div", _hoisted_1$14, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [badgeDescriptor.value ? (openBlock(), createElementBlock("span", {
1772
- key: 0,
1773
- class: "aform_display-value",
1774
- style: normalizeStyle(displayAccentStyle.value)
1775
- }, toDisplayString(badgeDescriptor.value.label), 5)) : (openBlock(), createElementBlock("span", _hoisted_2$13, toDisplayString(search.value ?? ""), 1)), createElementVNode("label", _hoisted_3$12, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [withDirectives((openBlock(), createElementBlock("div", { class: normalizeClass(["autocomplete", { isOpen: dropdown.open }]) }, [
1966
+ return openBlock(), createElementBlock("div", {
1967
+ class: "aform_form-element",
1968
+ onFocusout: _cache[2] || (_cache[2] = (...args) => unref(closeWhenFocusLeaves) && unref(closeWhenFocusLeaves)(...args)),
1969
+ onKeydown: _cache[3] || (_cache[3] = (...args) => unref(closeOnEscape) && unref(closeOnEscape)(...args))
1970
+ }, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_1$19, toDisplayString(displayValue.value), 1), createElementVNode("label", _hoisted_2$15, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1776
1971
  withDirectives(createElementVNode("input", {
1777
1972
  id: __props.uuid,
1778
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
1779
- type: "text",
1780
- role: "combobox",
1781
- autocomplete: "off",
1782
- "aria-autocomplete": "list",
1973
+ ref: "date",
1974
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => boxDay.value = $event),
1783
1975
  class: "aform_input-field",
1976
+ type: "date",
1977
+ "aria-haspopup": "dialog",
1978
+ "aria-controls": unref(showPicker) ? unref(calendarId) : void 0,
1784
1979
  disabled: __props.mode === "read",
1785
- style: normalizeStyle(inputAccentStyle.value),
1786
- "aria-expanded": dropdown.open,
1787
- "aria-controls": dropdown.open ? unref(listboxId) : void 0,
1788
- "aria-activedescendant": dropdown.activeItemIndex === null ? void 0 : `${unref(listboxId)}-opt-${dropdown.activeItemIndex}`,
1980
+ required: __props.required,
1789
1981
  "aria-invalid": unref(invalid),
1790
1982
  "aria-describedby": unref(describedBy),
1791
- onInput: filter,
1792
- onFocus: openDropdown,
1793
- onKeydown: [
1794
- withKeys(withModifiers(selectNextResult, ["prevent"]), ["down"]),
1795
- withKeys(withModifiers(selectPrevResult, ["prevent"]), ["up"]),
1796
- withKeys(withModifiers(setCurrentResult, ["prevent"]), ["enter"]),
1797
- withKeys(onClickOutside, ["esc"]),
1798
- withKeys(onClickOutside, ["tab"])
1799
- ]
1800
- }, null, 44, _hoisted_4$12), [[vModelText, search.value]]),
1801
- withDirectives(createElementVNode("ul", {
1802
- id: unref(listboxId),
1803
- ref: "results",
1804
- class: "autocomplete-results",
1805
- role: "listbox",
1806
- "aria-label": __props.label
1807
- }, [dropdown.loading ? (openBlock(), createElementBlock("li", _hoisted_6$9, "Loading results...")) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(dropdown.results, (result, i) => {
1808
- return openBlock(), createElementBlock("li", {
1809
- id: `${unref(listboxId)}-opt-${i}`,
1810
- key: result,
1811
- role: "option",
1812
- "aria-selected": i === dropdown.activeItemIndex,
1813
- class: normalizeClass(["autocomplete-result", { "is-active": i === dropdown.activeItemIndex }]),
1814
- onMousedown: withModifiers(($event) => setResult(result), ["prevent"])
1815
- }, toDisplayString(result), 43, _hoisted_7$3);
1816
- }), 128))], 8, _hoisted_5$11), [[vShow, dropdown.open]]),
1983
+ onClick: withModifiers(openPicker, ["prevent"]),
1984
+ onKeydown: _cache[1] || (_cache[1] = (...args) => unref(openFromKey) && unref(openFromKey)(...args))
1985
+ }, null, 40, _hoisted_3$13), [[vModelText, boxDay.value]]),
1817
1986
  createElementVNode("label", {
1818
1987
  class: "aform_field-label",
1819
1988
  for: __props.uuid
1820
- }, toDisplayString(__props.label), 9, _hoisted_8$3)
1821
- ], 2)), [[unref(vOnClickOutside), onClickOutside]]), withDirectives(createElementVNode("p", {
1822
- id: unref(errorId),
1823
- class: "aform_error",
1824
- role: "alert"
1825
- }, toDisplayString(errorText.value), 9, _hoisted_9$2), [[vShow, errorText.value]])], 64))]);
1989
+ }, toDisplayString(__props.label), 9, _hoisted_4$13),
1990
+ withDirectives(createElementVNode("p", {
1991
+ id: unref(errorId),
1992
+ class: "aform_error",
1993
+ role: "alert"
1994
+ }, toDisplayString(errorText.value), 9, _hoisted_5$12), [[vShow, errorText.value]]),
1995
+ unref(showPicker) ? (openBlock(), createBlock(ADateSelection_default, {
1996
+ key: 0,
1997
+ id: unref(calendarId),
1998
+ ref: "picker",
1999
+ class: "adate-picker",
2000
+ role: "dialog",
2001
+ "aria-label": __props.label,
2002
+ "default-date": modelValue.value || void 0,
2003
+ "select-range": false,
2004
+ "show-time": false,
2005
+ onGetDate: handleDate
2006
+ }, null, 8, [
2007
+ "id",
2008
+ "aria-label",
2009
+ "default-date"
2010
+ ])) : createCommentVNode("", true)
2011
+ ], 64))], 32);
1826
2012
  };
1827
2013
  }
1828
- }), [["__scopeId", "data-v-f395a95f"]]);
2014
+ }), [["__scopeId", "data-v-16f8f8f2"]]);
1829
2015
  //#endregion
1830
2016
  //#region src/components/form/ABadge.vue
1831
2017
  var ABadge_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -1878,12 +2064,12 @@ var ABadge_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
1878
2064
  }), [["__scopeId", "data-v-f99dd564"]]);
1879
2065
  //#endregion
1880
2066
  //#region src/components/form/ASegmentedControl.vue?vue&type=script&setup=true&lang.ts
1881
- var _hoisted_1$13 = {
2067
+ var _hoisted_1$18 = {
1882
2068
  key: 1,
1883
2069
  class: "aform_display-value"
1884
2070
  };
1885
- var _hoisted_2$12 = ["id"];
1886
- var _hoisted_3$11 = [
2071
+ var _hoisted_2$14 = ["id"];
2072
+ var _hoisted_3$12 = [
1887
2073
  "role",
1888
2074
  "aria-labelledby",
1889
2075
  "aria-label",
@@ -1891,19 +2077,19 @@ var _hoisted_3$11 = [
1891
2077
  "aria-invalid",
1892
2078
  "aria-describedby"
1893
2079
  ];
1894
- var _hoisted_4$11 = ["data-segment-value"];
1895
- var _hoisted_5$10 = [
2080
+ var _hoisted_4$12 = ["data-segment-value"];
2081
+ var _hoisted_5$11 = [
1896
2082
  "name",
1897
2083
  "value",
1898
2084
  "disabled"
1899
2085
  ];
1900
- var _hoisted_6$8 = [
2086
+ var _hoisted_6$9 = [
1901
2087
  "name",
1902
2088
  "value",
1903
2089
  "disabled"
1904
2090
  ];
1905
- var _hoisted_7$2 = { class: "aform_segmented-label" };
1906
- var _hoisted_8$2 = ["id"];
2091
+ var _hoisted_7$3 = { class: "aform_segmented-label" };
2092
+ var _hoisted_8$3 = ["id"];
1907
2093
  //#endregion
1908
2094
  //#region src/components/form/ASegmentedControl.vue
1909
2095
  var ASegmentedControl_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -2010,11 +2196,11 @@ var ASegmentedControl_default = /*#__PURE__*/ _plugin_vue_export_helper_default(
2010
2196
  value: displayBadgeValue.value,
2011
2197
  options: __props.options,
2012
2198
  presentation: "input-accent"
2013
- }, null, 8, ["value", "options"])) : (openBlock(), createElementBlock("span", _hoisted_1$13, toDisplayString(displayText.value), 1))], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2199
+ }, null, 8, ["value", "options"])) : (openBlock(), createElementBlock("span", _hoisted_1$18, toDisplayString(displayText.value), 1))], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2014
2200
  createElementVNode("label", {
2015
2201
  id: labelId.value,
2016
2202
  class: normalizeClass(["aform_field-label", { "aform_segmented-sr-label": __props.hideLabel }])
2017
- }, toDisplayString(__props.label), 11, _hoisted_2$12),
2203
+ }, toDisplayString(__props.label), 11, _hoisted_2$14),
2018
2204
  createElementVNode("div", {
2019
2205
  role: __props.multiple ? "group" : "radiogroup",
2020
2206
  class: "aform_segmented-track",
@@ -2037,7 +2223,7 @@ var ASegmentedControl_default = /*#__PURE__*/ _plugin_vue_export_helper_default(
2037
2223
  name: groupName.value,
2038
2224
  value: choice,
2039
2225
  disabled: __props.mode === "read"
2040
- }, null, 8, _hoisted_5$10)), [[vModelCheckbox, selectedMany.value]]) : withDirectives((openBlock(), createElementBlock("input", {
2226
+ }, null, 8, _hoisted_5$11)), [[vModelCheckbox, selectedMany.value]]) : withDirectives((openBlock(), createElementBlock("input", {
2041
2227
  key: 1,
2042
2228
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selected.value = $event),
2043
2229
  type: "radio",
@@ -2045,22 +2231,22 @@ var ASegmentedControl_default = /*#__PURE__*/ _plugin_vue_export_helper_default(
2045
2231
  name: groupName.value,
2046
2232
  value: choice,
2047
2233
  disabled: __props.mode === "read"
2048
- }, null, 8, _hoisted_6$8)), [[vModelRadio, selected.value]]), createElementVNode("span", _hoisted_7$2, toDisplayString(segmentLabel(choice)), 1)], 14, _hoisted_4$11);
2049
- }), 128))], 8, _hoisted_3$11),
2234
+ }, null, 8, _hoisted_6$9)), [[vModelRadio, selected.value]]), createElementVNode("span", _hoisted_7$3, toDisplayString(segmentLabel(choice)), 1)], 14, _hoisted_4$12);
2235
+ }), 128))], 8, _hoisted_3$12),
2050
2236
  withDirectives(createElementVNode("p", {
2051
2237
  id: unref(errorId),
2052
2238
  class: "aform_error",
2053
2239
  role: "alert"
2054
- }, toDisplayString(errorText.value), 9, _hoisted_8$2), [[vShow, errorText.value]])
2240
+ }, toDisplayString(errorText.value), 9, _hoisted_8$3), [[vShow, errorText.value]])
2055
2241
  ], 64))], 2);
2056
2242
  };
2057
2243
  }
2058
2244
  }), [["__scopeId", "data-v-8b740fd8"]]);
2059
2245
  //#endregion
2060
2246
  //#region src/components/form/ADateTime.vue?vue&type=script&setup=true&lang.ts
2061
- var _hoisted_1$12 = { class: "aform_display-value" };
2062
- var _hoisted_2$11 = { class: "aform_field-label" };
2063
- var _hoisted_3$10 = [
2247
+ var _hoisted_1$17 = { class: "aform_display-value" };
2248
+ var _hoisted_2$13 = { class: "aform_field-label" };
2249
+ var _hoisted_3$11 = [
2064
2250
  "id",
2065
2251
  "aria-expanded",
2066
2252
  "aria-controls",
@@ -2069,8 +2255,8 @@ var _hoisted_3$10 = [
2069
2255
  "aria-invalid",
2070
2256
  "aria-describedby"
2071
2257
  ];
2072
- var _hoisted_4$10 = ["for"];
2073
- var _hoisted_5$9 = ["id"];
2258
+ var _hoisted_4$11 = ["for"];
2259
+ var _hoisted_5$10 = ["id"];
2074
2260
  //#endregion
2075
2261
  //#region src/components/form/ADateTime.vue
2076
2262
  var ADateTime_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -2176,7 +2362,7 @@ var ADateTime_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
2176
2362
  class: "aform_form-element",
2177
2363
  onFocusout: _cache[1] || (_cache[1] = (...args) => unref(closeWhenFocusLeaves) && unref(closeWhenFocusLeaves)(...args)),
2178
2364
  onKeydown: _cache[2] || (_cache[2] = (...args) => unref(closeOnEscape) && unref(closeOnEscape)(...args))
2179
- }, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_1$12, toDisplayString(displayValue.value), 1), createElementVNode("label", _hoisted_2$11, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2365
+ }, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_1$17, toDisplayString(displayValue.value), 1), createElementVNode("label", _hoisted_2$13, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2180
2366
  createElementVNode("input", {
2181
2367
  id: __props.uuid,
2182
2368
  ref: "box",
@@ -2194,16 +2380,16 @@ var ADateTime_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
2194
2380
  "aria-describedby": unref(describedBy),
2195
2381
  onClick: openPicker,
2196
2382
  onKeydown: _cache[0] || (_cache[0] = (...args) => unref(openFromKey) && unref(openFromKey)(...args))
2197
- }, null, 40, _hoisted_3$10),
2383
+ }, null, 40, _hoisted_3$11),
2198
2384
  createElementVNode("label", {
2199
2385
  class: "aform_field-label",
2200
2386
  for: __props.uuid
2201
- }, toDisplayString(__props.label), 9, _hoisted_4$10),
2387
+ }, toDisplayString(__props.label), 9, _hoisted_4$11),
2202
2388
  withDirectives(createElementVNode("p", {
2203
2389
  id: unref(errorId),
2204
2390
  class: "aform_error",
2205
2391
  role: "alert"
2206
- }, toDisplayString(errorText.value), 9, _hoisted_5$9), [[vShow, errorText.value]]),
2392
+ }, toDisplayString(errorText.value), 9, _hoisted_5$10), [[vShow, errorText.value]]),
2207
2393
  unref(showPicker) ? (openBlock(), createBlock(ADateSelection_default, {
2208
2394
  key: 0,
2209
2395
  id: unref(calendarId),
@@ -2240,15 +2426,15 @@ var ADateTime_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
2240
2426
  }), [["__scopeId", "data-v-05cbbabe"]]);
2241
2427
  //#endregion
2242
2428
  //#region src/components/form/ADuration.vue?vue&type=script&setup=true&lang.ts
2243
- var _hoisted_1$11 = { class: "aduration" };
2244
- var _hoisted_2$10 = { class: "aform_display-value" };
2245
- var _hoisted_3$9 = { class: "aduration__footer" };
2246
- var _hoisted_4$9 = {
2429
+ var _hoisted_1$16 = { class: "aduration" };
2430
+ var _hoisted_2$12 = { class: "aform_display-value" };
2431
+ var _hoisted_3$10 = { class: "aduration__footer" };
2432
+ var _hoisted_4$10 = {
2247
2433
  key: 0,
2248
2434
  class: "aduration__summary"
2249
2435
  };
2250
- var _hoisted_5$8 = { class: "aduration__value" };
2251
- var _hoisted_6$7 = { class: "aduration__held" };
2436
+ var _hoisted_5$9 = { class: "aduration__value" };
2437
+ var _hoisted_6$8 = { class: "aduration__held" };
2252
2438
  //#endregion
2253
2439
  //#region src/components/form/ADuration.vue
2254
2440
  var ADuration_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -2309,7 +2495,7 @@ var ADuration_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
2309
2495
  return heldDuration.value.blank ? "—" : describeDuration(heldDuration.value);
2310
2496
  });
2311
2497
  return (_ctx, _cache) => {
2312
- return openBlock(), createElementBlock("div", _hoisted_1$11, [__props.mode === "display" || __props.mode === "read" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$10, toDisplayString(displayValue.value), 1), createElementVNode("label", null, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(ADateSelection_default, {
2498
+ return openBlock(), createElementBlock("div", _hoisted_1$16, [__props.mode === "display" || __props.mode === "read" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$12, toDisplayString(displayValue.value), 1), createElementVNode("label", null, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(ADateSelection_default, {
2313
2499
  ref: "selectionRef",
2314
2500
  "select-range": true,
2315
2501
  "show-time": true,
@@ -2317,19 +2503,19 @@ var ADuration_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
2317
2503
  "allow-military-time": __props.allowMilitaryTime,
2318
2504
  "use-seconds": __props.useSeconds,
2319
2505
  onGetRange: handleRange
2320
- }, null, 8, ["allow-military-time", "use-seconds"]), createElementVNode("div", _hoisted_3$9, [createElementVNode("label", null, toDisplayString(__props.label), 1), startDatetime.value && endDatetime.value ? (openBlock(), createElementBlock("div", _hoisted_4$9, [
2506
+ }, null, 8, ["allow-military-time", "use-seconds"]), createElementVNode("div", _hoisted_3$10, [createElementVNode("label", null, toDisplayString(__props.label), 1), startDatetime.value && endDatetime.value ? (openBlock(), createElementBlock("div", _hoisted_4$10, [
2321
2507
  _cache[0] || (_cache[0] = createElementVNode("span", { class: "aduration__label" }, "Duration:", -1)),
2322
- createElementVNode("span", _hoisted_5$8, toDisplayString(humanDuration.value), 1),
2323
- createElementVNode("span", _hoisted_6$7, "(" + toDisplayString(modelValue.value) + ")", 1)
2508
+ createElementVNode("span", _hoisted_5$9, toDisplayString(humanDuration.value), 1),
2509
+ createElementVNode("span", _hoisted_6$8, "(" + toDisplayString(modelValue.value) + ")", 1)
2324
2510
  ])) : createCommentVNode("", true)])], 64))]);
2325
2511
  };
2326
2512
  }
2327
2513
  }), [["__scopeId", "data-v-133162a6"]]);
2328
2514
  //#endregion
2329
2515
  //#region src/components/form/ADateRange.vue?vue&type=script&setup=true&lang.ts
2330
- var _hoisted_1$10 = { class: "aform_display-value" };
2331
- var _hoisted_2$9 = { class: "aform_field-label" };
2332
- var _hoisted_3$8 = [
2516
+ var _hoisted_1$15 = { class: "aform_display-value" };
2517
+ var _hoisted_2$11 = { class: "aform_field-label" };
2518
+ var _hoisted_3$9 = [
2333
2519
  "id",
2334
2520
  "aria-expanded",
2335
2521
  "aria-controls",
@@ -2338,8 +2524,8 @@ var _hoisted_3$8 = [
2338
2524
  "aria-invalid",
2339
2525
  "aria-describedby"
2340
2526
  ];
2341
- var _hoisted_4$8 = ["for"];
2342
- var _hoisted_5$7 = ["id"];
2527
+ var _hoisted_4$9 = ["for"];
2528
+ var _hoisted_5$8 = ["id"];
2343
2529
  //#endregion
2344
2530
  //#region src/components/form/ADateRange.vue
2345
2531
  var ADateRange_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -2419,7 +2605,7 @@ var ADateRange_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
2419
2605
  class: "aform_form-element",
2420
2606
  onFocusout: _cache[1] || (_cache[1] = (...args) => unref(closeWhenFocusLeaves) && unref(closeWhenFocusLeaves)(...args)),
2421
2607
  onKeydown: _cache[2] || (_cache[2] = (...args) => unref(closeOnEscape) && unref(closeOnEscape)(...args))
2422
- }, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_1$10, toDisplayString(displayValue.value), 1), createElementVNode("label", _hoisted_2$9, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2608
+ }, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_1$15, toDisplayString(displayValue.value), 1), createElementVNode("label", _hoisted_2$11, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2423
2609
  createElementVNode("input", {
2424
2610
  id: __props.uuid,
2425
2611
  ref: "box",
@@ -2437,16 +2623,16 @@ var ADateRange_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
2437
2623
  "aria-describedby": unref(describedBy),
2438
2624
  onClick: openPicker,
2439
2625
  onKeydown: _cache[0] || (_cache[0] = (...args) => unref(openFromKey) && unref(openFromKey)(...args))
2440
- }, null, 40, _hoisted_3$8),
2626
+ }, null, 40, _hoisted_3$9),
2441
2627
  createElementVNode("label", {
2442
2628
  class: "aform_field-label",
2443
2629
  for: __props.uuid
2444
- }, toDisplayString(__props.label), 9, _hoisted_4$8),
2630
+ }, toDisplayString(__props.label), 9, _hoisted_4$9),
2445
2631
  withDirectives(createElementVNode("p", {
2446
2632
  id: unref(errorId),
2447
2633
  class: "aform_error",
2448
2634
  role: "alert"
2449
- }, toDisplayString(errorText.value), 9, _hoisted_5$7), [[vShow, errorText.value]]),
2635
+ }, toDisplayString(errorText.value), 9, _hoisted_5$8), [[vShow, errorText.value]]),
2450
2636
  unref(showPicker) ? (openBlock(), createBlock(ADateSelection_default, {
2451
2637
  key: 0,
2452
2638
  id: unref(calendarId),
@@ -2464,16 +2650,16 @@ var ADateRange_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
2464
2650
  }), [["__scopeId", "data-v-ac2c160b"]]);
2465
2651
  //#endregion
2466
2652
  //#region src/components/AForm.vue?vue&type=script&setup=true&lang.ts
2467
- var _hoisted_1$9 = { class: "aform" };
2468
- var _hoisted_2$8 = {
2653
+ var _hoisted_1$14 = { class: "aform" };
2654
+ var _hoisted_2$10 = {
2469
2655
  key: 0,
2470
2656
  class: "aform-nested-section"
2471
2657
  };
2472
- var _hoisted_3$7 = {
2658
+ var _hoisted_3$8 = {
2473
2659
  key: 0,
2474
2660
  class: "aform-nested-label"
2475
2661
  };
2476
- var _hoisted_4$7 = {
2662
+ var _hoisted_4$8 = {
2477
2663
  key: 1,
2478
2664
  class: "aform-nested-section"
2479
2665
  };
@@ -2597,8 +2783,8 @@ var AForm_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
2597
2783
  const childModels = computed(() => childModelsCache.value);
2598
2784
  return (_ctx, _cache) => {
2599
2785
  const _component_AForm = resolveComponent("AForm", true);
2600
- return openBlock(), createElementBlock("form", _hoisted_1$9, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.schema, (componentObj, key) => {
2601
- return openBlock(), createElementBlock(Fragment, { key }, [isLinkSection(componentObj) ? (openBlock(), createElementBlock("div", _hoisted_2$8, [componentObj.label ? (openBlock(), createElementBlock("h4", _hoisted_3$7, toDisplayString(componentObj.label), 1)) : createCommentVNode("", true), (openBlock(), createBlock(resolveDynamicComponent(componentObj.component ?? "AForm"), {
2786
+ return openBlock(), createElementBlock("form", _hoisted_1$14, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.schema, (componentObj, key) => {
2787
+ return openBlock(), createElementBlock(Fragment, { key }, [isLinkSection(componentObj) ? (openBlock(), createElementBlock("div", _hoisted_2$10, [componentObj.label ? (openBlock(), createElementBlock("h4", _hoisted_3$8, toDisplayString(componentObj.label), 1)) : createCommentVNode("", true), (openBlock(), createBlock(resolveDynamicComponent(componentObj.component ?? "AForm"), {
2602
2788
  data: nestedData.value[componentObj.fieldname],
2603
2789
  mode: resolvedMode(componentObj),
2604
2790
  schema: componentObj.schema,
@@ -2612,7 +2798,7 @@ var AForm_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
2612
2798
  "label",
2613
2799
  "errors",
2614
2800
  "onUpdate:data"
2615
- ]))])) : isFieldsetSection(componentObj) ? (openBlock(), createElementBlock("div", _hoisted_4$7, [(openBlock(), createBlock(resolveDynamicComponent(componentObj.component ?? "AFieldset"), {
2801
+ ]))])) : isFieldsetSection(componentObj) ? (openBlock(), createElementBlock("div", _hoisted_4$8, [(openBlock(), createBlock(resolveDynamicComponent(componentObj.component ?? "AFieldset"), {
2616
2802
  data: dataModel.value,
2617
2803
  mode: resolvedMode(componentObj),
2618
2804
  schema: componentObj.schema,
@@ -2663,7 +2849,7 @@ var AForm_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
2663
2849
  }), 128))]);
2664
2850
  };
2665
2851
  }
2666
- }), [["__scopeId", "data-v-5055dffc"]]);
2852
+ }), [["__scopeId", "data-v-d4179fed"]]);
2667
2853
  //#endregion
2668
2854
  //#region src/components/base/CollapseButton.vue
2669
2855
  var CollapseButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -2724,21 +2910,21 @@ var AFieldset_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
2724
2910
  }), [["__scopeId", "data-v-8215ff87"]]);
2725
2911
  //#endregion
2726
2912
  //#region src/components/form/AFileAttach.vue?vue&type=script&setup=true&lang.ts
2727
- var _hoisted_1$8 = { class: "aform_form-element aform_file-attach aform__grid--full" };
2728
- var _hoisted_2$7 = {
2913
+ var _hoisted_1$13 = { class: "aform_form-element aform_file-attach aform__grid--full" };
2914
+ var _hoisted_2$9 = {
2729
2915
  key: 0,
2730
2916
  class: "aform_file-attach-feedback"
2731
2917
  };
2732
- var _hoisted_3$6 = {
2918
+ var _hoisted_3$7 = {
2733
2919
  key: 1,
2734
2920
  class: "aform_display-value"
2735
2921
  };
2736
- var _hoisted_4$6 = {
2922
+ var _hoisted_4$7 = {
2737
2923
  key: 0,
2738
2924
  class: "aform_file-attach-feedback"
2739
2925
  };
2740
- var _hoisted_5$6 = ["disabled"];
2741
- var _hoisted_6$6 = ["disabled"];
2926
+ var _hoisted_5$7 = ["disabled"];
2927
+ var _hoisted_6$7 = ["disabled"];
2742
2928
  //#endregion
2743
2929
  //#region src/components/form/AFileAttach.vue
2744
2930
  var AFileAttach_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -2762,10 +2948,10 @@ var AFileAttach_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
2762
2948
  });
2763
2949
  onChange((changedFiles) => changedFiles);
2764
2950
  return (_ctx, _cache) => {
2765
- return openBlock(), createElementBlock("div", _hoisted_1$8, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [unref(files) ? (openBlock(), createElementBlock("div", _hoisted_2$7, [createElementVNode("p", null, [createElementVNode("b", null, toDisplayString(fileLengthText.value), 1)]), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(files), (file) => {
2951
+ return openBlock(), createElementBlock("div", _hoisted_1$13, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [unref(files) ? (openBlock(), createElementBlock("div", _hoisted_2$9, [createElementVNode("p", null, [createElementVNode("b", null, toDisplayString(fileLengthText.value), 1)]), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(files), (file) => {
2766
2952
  return openBlock(), createElementBlock("li", { key: file.name }, toDisplayString(file.name), 1);
2767
- }), 128))])) : (openBlock(), createElementBlock("span", _hoisted_3$6, "No file selected"))], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2768
- unref(files) ? (openBlock(), createElementBlock("div", _hoisted_4$6, [createElementVNode("p", null, [_cache[2] || (_cache[2] = createTextVNode(" You have selected: ", -1)), createElementVNode("b", null, toDisplayString(fileLengthText.value), 1)]), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(files), (file) => {
2953
+ }), 128))])) : (openBlock(), createElementBlock("span", _hoisted_3$7, "No file selected"))], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2954
+ unref(files) ? (openBlock(), createElementBlock("div", _hoisted_4$7, [createElementVNode("p", null, [_cache[2] || (_cache[2] = createTextVNode(" You have selected: ", -1)), createElementVNode("b", null, toDisplayString(fileLengthText.value), 1)]), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(files), (file) => {
2769
2955
  return openBlock(), createElementBlock("li", { key: file.name }, toDisplayString(file.name), 1);
2770
2956
  }), 128))])) : createCommentVNode("", true),
2771
2957
  createElementVNode("button", {
@@ -2773,21 +2959,274 @@ var AFileAttach_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
2773
2959
  class: "aform_form-btn",
2774
2960
  disabled: __props.mode === "read",
2775
2961
  onClick: _cache[0] || (_cache[0] = ($event) => unref(open)())
2776
- }, toDisplayString(__props.label), 9, _hoisted_5$6),
2962
+ }, toDisplayString(__props.label), 9, _hoisted_5$7),
2777
2963
  createElementVNode("button", {
2778
2964
  type: "button",
2779
2965
  disabled: !unref(files) || __props.mode === "read",
2780
2966
  class: "aform_form-btn",
2781
2967
  onClick: _cache[1] || (_cache[1] = ($event) => unref(reset)())
2782
- }, "Reset", 8, _hoisted_6$6)
2968
+ }, "Reset", 8, _hoisted_6$7)
2783
2969
  ], 64))]);
2784
2970
  };
2785
2971
  }
2786
- }), [["__scopeId", "data-v-79ce33a7"]]);
2972
+ }), [["__scopeId", "data-v-79ce33a7"]]);
2973
+ //#endregion
2974
+ //#region src/components/form/AFormLink.vue?vue&type=script&setup=true&lang.ts
2975
+ var _hoisted_1$12 = { class: "aform_display-value" };
2976
+ var _hoisted_2$8 = {
2977
+ key: 0,
2978
+ class: "aform_field-label"
2979
+ };
2980
+ var _hoisted_3$6 = { class: "aform_form-link-wrapper" };
2981
+ var _hoisted_4$6 = { class: "input-group" };
2982
+ var _hoisted_5$6 = [
2983
+ "placeholder",
2984
+ "aria-label",
2985
+ "required",
2986
+ "aria-expanded",
2987
+ "aria-controls",
2988
+ "aria-activedescendant",
2989
+ "disabled",
2990
+ "onKeydown"
2991
+ ];
2992
+ var _hoisted_6$6 = ["onKeydown"];
2993
+ var _hoisted_7$2 = ["data-icon"];
2994
+ var _hoisted_8$2 = {
2995
+ key: 0,
2996
+ d: "M6 3.5 10.5 8 6 12.5"
2997
+ };
2998
+ var _hoisted_9$2 = {
2999
+ key: 1,
3000
+ d: "M2.5 8h11M9 3.5 13.5 8 9 12.5"
3001
+ };
3002
+ var _hoisted_10$2 = { class: "aform_form-btn-name" };
3003
+ var _hoisted_11$2 = {
3004
+ key: 0,
3005
+ class: "loading autocomplete-result"
3006
+ };
3007
+ var _hoisted_12$1 = [
3008
+ "id",
3009
+ "aria-selected",
3010
+ "onMousedown",
3011
+ "onMouseenter"
3012
+ ];
3013
+ var _hoisted_13 = {
3014
+ key: 0,
3015
+ class: "aform_field-label"
3016
+ };
3017
+ //#endregion
3018
+ //#region src/components/form/AFormLink.vue
3019
+ var AFormLink_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
3020
+ __name: "AFormLink",
3021
+ props: /*@__PURE__*/ mergeModels({
3022
+ schema: {},
3023
+ label: {},
3024
+ selectRange: { type: Boolean },
3025
+ mask: {},
3026
+ required: { type: Boolean },
3027
+ mode: {},
3028
+ uuid: {},
3029
+ validation: {},
3030
+ errors: {},
3031
+ doctype: { default: () => void 0 },
3032
+ formatter: {
3033
+ type: Function,
3034
+ default: void 0
3035
+ },
3036
+ icon: { default: "arrow-right" },
3037
+ disabled: {
3038
+ type: Boolean,
3039
+ default: false
3040
+ },
3041
+ filterFunction: {
3042
+ type: [String, Function],
3043
+ default: void 0
3044
+ },
3045
+ isAsync: {
3046
+ type: Boolean,
3047
+ default: false
3048
+ },
3049
+ embedded: {
3050
+ type: Boolean,
3051
+ default: false
3052
+ },
3053
+ placeholder: { default: () => void 0 },
3054
+ ariaLabel: { default: () => void 0 }
3055
+ }, {
3056
+ "modelValue": { default: () => ({
3057
+ id: "",
3058
+ displayText: ""
3059
+ }) },
3060
+ "modelModifiers": {}
3061
+ }),
3062
+ emits: ["update:modelValue"],
3063
+ setup(__props) {
3064
+ const listboxId = `${__props.uuid ?? `aform-link-${useId()}`}-listbox`;
3065
+ const modelValue = useModel(__props, "modelValue");
3066
+ const hasValidId = computed(() => linkId(modelValue.value) !== void 0);
3067
+ const displayedText = computed(() => {
3068
+ const id = linkId(modelValue.value);
3069
+ if (id === void 0) return "—";
3070
+ if (__props.formatter) return __props.formatter(asLinkValue(modelValue.value));
3071
+ return linkDisplayText(modelValue.value) ?? id;
3072
+ });
3073
+ const searchText = ref(hasValidId.value ? displayedText.value : "");
3074
+ const dropdownOpen = ref(false);
3075
+ const loading = ref(false);
3076
+ const dropdownResults = ref([]);
3077
+ const activeIndex = ref(null);
3078
+ const navigator = inject("aformLinkNavigator", null);
3079
+ const resolver = inject("aformLinkResolver", null);
3080
+ watch(() => linkId(modelValue.value), async (id) => {
3081
+ if (id && linkDisplayText(modelValue.value)) {
3082
+ searchText.value = displayedText.value;
3083
+ return;
3084
+ }
3085
+ if (!id) return;
3086
+ try {
3087
+ let match;
3088
+ let displayText;
3089
+ if (__props.filterFunction) {
3090
+ match = (await (typeof __props.filterFunction === "string" ? deserializeFunction(__props.filterFunction) : __props.filterFunction)(String(id))).find((r) => String(r.id) === String(id));
3091
+ displayText = match?.displayText;
3092
+ if (displayText === void 0) console.warn(`[AFormLink] filterFunction returned no matching result for id "${id}". The function must return an item whose \`id\` exactly matches the search string.`);
3093
+ } else if (resolver && __props.doctype) displayText = await resolver(__props.doctype, id.toString()) ?? void 0;
3094
+ if (displayText) {
3095
+ const resolved = {
3096
+ ...asLinkValue(modelValue.value),
3097
+ ...match,
3098
+ id,
3099
+ displayText
3100
+ };
3101
+ searchText.value = __props.formatter ? __props.formatter(resolved) : displayText;
3102
+ modelValue.value = resolved;
3103
+ }
3104
+ } catch {}
3105
+ }, { immediate: true });
3106
+ const handleNavigate = () => {
3107
+ const id = linkId(modelValue.value);
3108
+ if (navigator && __props.doctype && id !== void 0) navigator.navigate(__props.doctype, id);
3109
+ 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.");
3110
+ };
3111
+ const isResultSelected = (option) => {
3112
+ const id = linkId(modelValue.value);
3113
+ return id !== void 0 && String(option.id) === String(id);
3114
+ };
3115
+ const openDropdown = async (text) => {
3116
+ if (!__props.filterFunction || __props.mode === "read") return;
3117
+ activeIndex.value = null;
3118
+ dropdownOpen.value = true;
3119
+ if (__props.isAsync) loading.value = true;
3120
+ try {
3121
+ const fn = typeof __props.filterFunction === "string" ? deserializeFunction(__props.filterFunction) : __props.filterFunction;
3122
+ dropdownResults.value = await fn(text) ?? [];
3123
+ } catch {
3124
+ dropdownResults.value = [];
3125
+ } finally {
3126
+ loading.value = false;
3127
+ }
3128
+ };
3129
+ const closeDropdown = () => {
3130
+ dropdownOpen.value = false;
3131
+ activeIndex.value = null;
3132
+ searchText.value = hasValidId.value ? displayedText.value : "";
3133
+ };
3134
+ const onClickOutside = () => {
3135
+ if (dropdownOpen.value) closeDropdown();
3136
+ };
3137
+ const onFocus = () => openDropdown(searchText.value);
3138
+ const onInput = () => openDropdown(searchText.value);
3139
+ const selectOption = (option) => {
3140
+ modelValue.value = option;
3141
+ searchText.value = __props.formatter ? __props.formatter(option) : option.displayText ?? String(option.id);
3142
+ dropdownOpen.value = false;
3143
+ activeIndex.value = null;
3144
+ };
3145
+ const selectNext = () => {
3146
+ const len = dropdownResults.value.length;
3147
+ if (!len) return;
3148
+ activeIndex.value = activeIndex.value === null ? 0 : (activeIndex.value + 1) % len;
3149
+ };
3150
+ const selectPrev = () => {
3151
+ if (!dropdownResults.value.length) return;
3152
+ if (activeIndex.value === null || activeIndex.value === 0) activeIndex.value = null;
3153
+ else activeIndex.value -= 1;
3154
+ };
3155
+ const selectCurrent = () => {
3156
+ if (activeIndex.value !== null && dropdownResults.value[activeIndex.value]) selectOption(dropdownResults.value[activeIndex.value]);
3157
+ };
3158
+ return (_ctx, _cache) => {
3159
+ 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", {
3160
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchText.value = $event),
3161
+ type: "text",
3162
+ role: "combobox",
3163
+ autocomplete: "off",
3164
+ "aria-autocomplete": "list",
3165
+ class: normalizeClass(["aform_input-field", { "aform_input-field--embedded": __props.embedded }]),
3166
+ placeholder: __props.placeholder,
3167
+ "aria-label": __props.ariaLabel,
3168
+ required: __props.required,
3169
+ "aria-expanded": dropdownOpen.value,
3170
+ "aria-controls": dropdownOpen.value ? listboxId : void 0,
3171
+ "aria-activedescendant": activeIndex.value === null ? void 0 : `${listboxId}-opt-${activeIndex.value}`,
3172
+ disabled: __props.disabled || __props.mode === "read",
3173
+ onInput,
3174
+ onFocus,
3175
+ onKeydown: [
3176
+ withKeys(withModifiers(selectNext, ["prevent"]), ["down"]),
3177
+ withKeys(withModifiers(selectPrev, ["prevent"]), ["up"]),
3178
+ withKeys(withModifiers(selectCurrent, ["prevent"]), ["enter"]),
3179
+ withKeys(closeDropdown, ["esc"]),
3180
+ withKeys(closeDropdown, ["tab"])
3181
+ ]
3182
+ }, null, 42, _hoisted_5$6), [[vModelText, searchText.value]]), hasValidId.value && !__props.disabled && !__props.embedded ? (openBlock(), createElementBlock("button", {
3183
+ key: 0,
3184
+ type: "button",
3185
+ class: "aform_form-btn",
3186
+ onClick: handleNavigate,
3187
+ onKeydown: withKeys(withModifiers(handleNavigate, ["prevent"]), ["enter"])
3188
+ }, [(openBlock(), createElementBlock("svg", {
3189
+ class: "aform_form-btn-icon",
3190
+ "data-icon": __props.icon,
3191
+ viewBox: "1.75 2.75 12.5 10.5",
3192
+ "aria-hidden": "true",
3193
+ focusable: "false"
3194
+ }, [__props.icon === "chevron-right" ? (openBlock(), createElementBlock("path", _hoisted_8$2)) : (openBlock(), createElementBlock("path", _hoisted_9$2))], 8, _hoisted_7$2)), createElementVNode("span", _hoisted_10$2, toDisplayString(__props.icon === "chevron-right" ? "›" : "→"), 1)], 40, _hoisted_6$6)) : createCommentVNode("", true)]), __props.mode !== "read" ? (openBlock(), createBlock(ADropdownList_default, {
3195
+ key: 0,
3196
+ "listbox-id": listboxId,
3197
+ ariaLabel: __props.ariaLabel ?? __props.label ?? "",
3198
+ open: dropdownOpen.value,
3199
+ "option-count": () => dropdownResults.value.length,
3200
+ "active-index": () => activeIndex.value
3201
+ }, {
3202
+ default: withCtx(() => [loading.value ? (openBlock(), createElementBlock("li", _hoisted_11$2, "Loading…")) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(dropdownResults.value, (option, i) => {
3203
+ return openBlock(), createElementBlock("li", {
3204
+ id: `${listboxId}-opt-${i}`,
3205
+ key: String(option.id),
3206
+ role: "option",
3207
+ "aria-selected": isResultSelected(option),
3208
+ class: normalizeClass(["autocomplete-result", {
3209
+ "is-active": i === activeIndex.value,
3210
+ "is-selected": isResultSelected(option)
3211
+ }]),
3212
+ onMousedown: withModifiers(($event) => selectOption(option), ["prevent"]),
3213
+ onMouseenter: ($event) => activeIndex.value = i
3214
+ }, [renderSlot(_ctx.$slots, "option", { option }, () => [createTextVNode(toDisplayString(option.displayText ?? String(option.id)), 1)], true)], 42, _hoisted_12$1);
3215
+ }), 128))]),
3216
+ _: 3
3217
+ }, 8, [
3218
+ "ariaLabel",
3219
+ "open",
3220
+ "option-count",
3221
+ "active-index"
3222
+ ])) : createCommentVNode("", true)])), [[unref(vOnClickOutside), onClickOutside]]), __props.label && !__props.embedded ? (openBlock(), createElementBlock("label", _hoisted_13, toDisplayString(__props.label), 1)) : createCommentVNode("", true)], 64))], 2);
3223
+ };
3224
+ }
3225
+ }), [["__scopeId", "data-v-e784f691"]]);
2787
3226
  //#endregion
2788
3227
  //#region src/components/form/ANumericInput.vue?vue&type=script&setup=true&lang.ts
2789
- var _hoisted_1$7 = { class: "aform_form-element" };
2790
- var _hoisted_2$6 = { class: "aform_display-value" };
3228
+ var _hoisted_1$11 = { class: "aform_form-element" };
3229
+ var _hoisted_2$7 = { class: "aform_display-value" };
2791
3230
  var _hoisted_3$5 = { class: "aform_field-label" };
2792
3231
  var _hoisted_4$5 = [
2793
3232
  "id",
@@ -2826,7 +3265,7 @@ var ANumericInput_default = /* @__PURE__ */ defineComponent({
2826
3265
  set: (value) => inputNumber.value = numberFromBox(value)
2827
3266
  });
2828
3267
  return (_ctx, _cache) => {
2829
- return openBlock(), createElementBlock("div", _hoisted_1$7, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$6, toDisplayString(inputNumber.value ?? ""), 1), createElementVNode("label", _hoisted_3$5, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3268
+ return openBlock(), createElementBlock("div", _hoisted_1$11, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$7, toDisplayString(inputNumber.value ?? ""), 1), createElementVNode("label", _hoisted_3$5, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2830
3269
  withDirectives(createElementVNode("input", {
2831
3270
  id: __props.uuid,
2832
3271
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => boxNumber.value = $event),
@@ -2851,9 +3290,38 @@ var ANumericInput_default = /* @__PURE__ */ defineComponent({
2851
3290
  }
2852
3291
  });
2853
3292
  //#endregion
3293
+ //#region src/utils/quantityValue.ts
3294
+ /** What a quantity box may hold, typed or pasted: digits, one decimal point and a leading minus sign. */
3295
+ var quantityEntryPattern = /^-?\d*\.?\d*$/;
3296
+ var roundQty = (value) => Number(value.toFixed(6));
3297
+ function resolveQuantityConversionFactor(uom, options, current) {
3298
+ const stockUom = options.stockUom ?? current?.stockUom;
3299
+ if (!uom || uom === stockUom) return 1;
3300
+ const mapped = options.conversionFactors?.[uom];
3301
+ if (mapped !== void 0) return mapped;
3302
+ if (uom === current?.uom) return current.conversionFactor ?? 1;
3303
+ return 1;
3304
+ }
3305
+ function recomputeQuantityValue(qty, uom, options, current) {
3306
+ const conversionFactor = resolveQuantityConversionFactor(uom, options, current);
3307
+ return {
3308
+ qty,
3309
+ uom,
3310
+ conversionFactor,
3311
+ stockUom: options.stockUom ?? current?.stockUom ?? "",
3312
+ stockQty: qty === null ? null : roundQty(qty * conversionFactor)
3313
+ };
3314
+ }
3315
+ function patchQuantityQty(current, qty, options) {
3316
+ return recomputeQuantityValue(qty, current?.uom ?? "", options, current);
3317
+ }
3318
+ function patchQuantityUom(current, uom, options) {
3319
+ return recomputeQuantityValue(current?.qty ?? null, uom, options, current);
3320
+ }
3321
+ //#endregion
2854
3322
  //#region src/components/form/AQuantityInput.vue?vue&type=script&setup=true&lang.ts
2855
- var _hoisted_1$6 = { class: "aform_form-element aquantity" };
2856
- var _hoisted_2$5 = { class: "aform_display-value" };
3323
+ var _hoisted_1$10 = { class: "aform_form-element aquantity" };
3324
+ var _hoisted_2$6 = { class: "aform_display-value" };
2857
3325
  var _hoisted_3$4 = { class: "aform_field-label" };
2858
3326
  var _hoisted_4$4 = { class: "aquantity__row" };
2859
3327
  var _hoisted_5$4 = { class: "aquantity__field aquantity__field--qty" };
@@ -2866,33 +3334,9 @@ var _hoisted_7$1 = [
2866
3334
  "aria-describedby"
2867
3335
  ];
2868
3336
  var _hoisted_8$1 = { class: "aquantity__uom" };
2869
- var _hoisted_9$1 = [
2870
- "id",
2871
- "disabled",
2872
- "aria-expanded",
2873
- "aria-activedescendant",
2874
- "onKeydown"
2875
- ];
2876
- var _hoisted_10$1 = { class: "aquantity__uom-value" };
2877
- var _hoisted_11$1 = ["aria-label"];
2878
- var _hoisted_12$1 = [
2879
- "id",
2880
- "aria-selected",
2881
- "onMouseenter",
2882
- "onClick"
2883
- ];
2884
- var _hoisted_13 = ["for"];
2885
- var _hoisted_14 = { class: "aquantity__row aquantity__row--stock" };
2886
- var _hoisted_15 = { class: "aquantity__field aquantity__field--stock-uom" };
2887
- var _hoisted_16 = ["value"];
2888
- var _hoisted_17 = { class: "aform_field-label" };
2889
- var _hoisted_18 = { class: "aquantity__field aquantity__field--stock-qty" };
2890
- var _hoisted_19 = ["value"];
2891
- var _hoisted_20 = { class: "aform_field-label" };
2892
- var _hoisted_21 = { class: "aquantity__field aquantity__field--conversion" };
2893
- var _hoisted_22 = ["value"];
2894
- var _hoisted_23 = { class: "aform_field-label" };
2895
- var _hoisted_24 = ["id"];
3337
+ var _hoisted_9$1 = ["for"];
3338
+ var _hoisted_10$1 = ["id"];
3339
+ var _hoisted_11$1 = ["id"];
2896
3340
  //#endregion
2897
3341
  //#region src/components/form/AQuantityInput.vue
2898
3342
  var AQuantityInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -2908,52 +3352,26 @@ var AQuantityInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
2908
3352
  validation: { default: () => ({ errorMessage: "" }) },
2909
3353
  errors: {},
2910
3354
  options: { default: () => ({}) },
2911
- uomLabel: { default: "UOM" },
2912
- stockUomLabel: { default: "Stock UOM" },
2913
- stockQtyLabel: { default: "Stock Qty" },
2914
- conversionFactorLabel: { default: "Conversion Factor" }
3355
+ uomLabel: { default: "UOM" }
2915
3356
  }, {
2916
- "modelValue": { default: () => ({
2917
- qty: null,
2918
- uom: "",
2919
- stockQty: null,
2920
- stockUom: "",
2921
- conversionFactor: 1
2922
- }) },
3357
+ "modelValue": {},
2923
3358
  "modelModifiers": {}
2924
3359
  }),
2925
3360
  emits: ["update:modelValue"],
2926
3361
  setup(__props) {
2927
3362
  const errorText = computed(() => __props.errors?.length ? __props.errors.join("; ") : __props.validation.errorMessage ?? "");
2928
- const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
3363
+ const helperId = computed(() => __props.uuid ? `${__props.uuid}-helper` : void 0);
3364
+ const helperDescribedBy = computed(() => showStock.value && !errorText.value ? helperId.value : void 0);
3365
+ const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText, helperDescribedBy);
2929
3366
  const modelValue = useModel(__props, "modelValue");
2930
3367
  const uoms = computed(() => __props.options.uoms ?? []);
2931
- const roundQty = (value) => Number(value.toFixed(6));
2932
- const resolveConversionFactor = (uom) => {
2933
- const stockUom = __props.options.stockUom ?? modelValue.value?.stockUom;
2934
- if (!uom || uom === stockUom) return 1;
2935
- const mapped = __props.options.conversionFactors?.[uom];
2936
- if (mapped !== void 0) return mapped;
2937
- if (uom === modelValue.value?.uom) return modelValue.value.conversionFactor ?? 1;
2938
- return 1;
2939
- };
2940
- const recompute = (qty, uom) => {
2941
- const conversionFactor = resolveConversionFactor(uom);
2942
- modelValue.value = {
2943
- qty,
2944
- uom,
2945
- conversionFactor,
2946
- stockUom: __props.options.stockUom ?? modelValue.value?.stockUom ?? "",
2947
- stockQty: qty === null ? null : roundQty(qty * conversionFactor)
2948
- };
2949
- };
2950
3368
  const qty = computed({
2951
3369
  get: () => modelValue.value?.qty ?? null,
2952
- set: (value) => recompute(numberFromBox(value), modelValue.value?.uom ?? "")
3370
+ set: (value) => modelValue.value = patchQuantityQty(modelValue.value, numberFromBox(value), __props.options)
2953
3371
  });
2954
3372
  const uom = computed({
2955
3373
  get: () => modelValue.value?.uom ?? "",
2956
- set: (value) => recompute(modelValue.value?.qty ?? null, value)
3374
+ set: (value) => modelValue.value = patchQuantityUom(modelValue.value, value, __props.options)
2957
3375
  });
2958
3376
  const qtyNavigationKeys = /* @__PURE__ */ new Set([
2959
3377
  "Backspace",
@@ -2974,57 +3392,23 @@ var AQuantityInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
2974
3392
  if (/^[0-9]$/.test(event.key)) return;
2975
3393
  const input = event.target;
2976
3394
  if (event.key === "." && !input.value.includes(".")) return;
3395
+ if (event.key === "-" && !input.value.includes("-")) return;
2977
3396
  event.preventDefault();
2978
3397
  };
2979
3398
  const onQtyPaste = (event) => {
2980
3399
  const pasted = event.clipboardData?.getData("text") ?? "";
2981
- if (!/^\d*\.?\d*$/.test(pasted)) event.preventDefault();
2982
- };
2983
- const dropdown = reactive({
2984
- open: false,
2985
- activeIndex: -1
2986
- });
2987
- fitDropdownList(useTemplateRef("uomMenu"), {
2988
- isOpen: () => dropdown.open,
2989
- optionCount: () => uoms.value.length,
2990
- activeIndex: () => dropdown.activeIndex
2991
- });
2992
- const openDropdown = () => {
2993
- dropdown.activeIndex = Math.max(uoms.value.indexOf(uom.value), 0);
2994
- dropdown.open = true;
2995
- };
2996
- const closeDropdown = () => {
2997
- dropdown.open = false;
2998
- };
2999
- const toggleDropdown = () => {
3000
- if (dropdown.open) closeDropdown();
3001
- else openDropdown();
3002
- };
3003
- const selectUom = (value) => {
3004
- uom.value = value;
3005
- closeDropdown();
3006
- };
3007
- const moveActive = (delta) => {
3008
- if (!dropdown.open) {
3009
- openDropdown();
3010
- return;
3011
- }
3012
- const length = uoms.value.length;
3013
- if (!length) return;
3014
- dropdown.activeIndex = (dropdown.activeIndex + delta + length) % length;
3015
- };
3016
- const selectActive = () => {
3017
- if (!dropdown.open) {
3018
- openDropdown();
3019
- return;
3020
- }
3021
- const option = uoms.value[dropdown.activeIndex];
3022
- if (option !== void 0) selectUom(option);
3400
+ if (!quantityEntryPattern.test(pasted)) event.preventDefault();
3023
3401
  };
3024
3402
  const showStock = computed(() => {
3025
3403
  const v = modelValue.value;
3026
3404
  return !!v?.stockUom && (v.uom !== v.stockUom || v.qty !== v.stockQty);
3027
3405
  });
3406
+ const conversionHelperText = computed(() => {
3407
+ const v = modelValue.value;
3408
+ if (!v || v.stockQty === null || v.qty === null) return "";
3409
+ const factor = v.conversionFactor;
3410
+ return `= ${v.stockQty} ${v.stockUom} · 1 ${v.uom} = ${factor} ${v.stockUom}`;
3411
+ });
3028
3412
  const displayText = computed(() => {
3029
3413
  const v = modelValue.value;
3030
3414
  if (!v || !v.uom || v.qty === null) return "—";
@@ -3032,7 +3416,7 @@ var AQuantityInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
3032
3416
  return showStock.value ? `${base} (${v.stockQty} ${v.stockUom})` : base;
3033
3417
  });
3034
3418
  return (_ctx, _cache) => {
3035
- return openBlock(), createElementBlock("div", _hoisted_1$6, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$5, toDisplayString(displayText.value), 1), createElementVNode("label", _hoisted_3$4, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3419
+ return openBlock(), createElementBlock("div", _hoisted_1$10, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$6, toDisplayString(displayText.value), 1), createElementVNode("label", _hoisted_3$4, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3036
3420
  createElementVNode("div", _hoisted_4$4, [createElementVNode("div", _hoisted_5$4, [createElementVNode("div", _hoisted_6$4, [
3037
3421
  withDirectives(createElementVNode("input", {
3038
3422
  id: __props.uuid,
@@ -3051,78 +3435,48 @@ var AQuantityInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
3051
3435
  void 0,
3052
3436
  { number: true }
3053
3437
  ]]),
3054
- withDirectives((openBlock(), createElementBlock("div", _hoisted_8$1, [createElementVNode("button", {
3055
- id: `${__props.uuid}-uom`,
3056
- type: "button",
3057
- class: "aquantity__uom-toggle",
3058
- disabled: __props.mode === "read",
3059
- "aria-haspopup": "listbox",
3060
- "aria-expanded": dropdown.open,
3061
- "aria-activedescendant": dropdown.open && dropdown.activeIndex >= 0 ? `${__props.uuid}-uom-opt-${dropdown.activeIndex}` : void 0,
3062
- onClick: toggleDropdown,
3063
- onKeydown: [
3064
- _cache[1] || (_cache[1] = withKeys(withModifiers(($event) => moveActive(1), ["prevent"]), ["down"])),
3065
- _cache[2] || (_cache[2] = withKeys(withModifiers(($event) => moveActive(-1), ["prevent"]), ["up"])),
3066
- withKeys(withModifiers(selectActive, ["prevent"]), ["enter"]),
3067
- withKeys(closeDropdown, ["esc"])
3068
- ]
3069
- }, [createElementVNode("span", _hoisted_10$1, toDisplayString(uom.value || __props.uomLabel), 1), _cache[3] || (_cache[3] = createElementVNode("span", {
3070
- class: "aquantity__caret",
3071
- "aria-hidden": "true"
3072
- }, null, -1))], 40, _hoisted_9$1), withDirectives(createElementVNode("ul", {
3073
- ref: "uomMenu",
3074
- class: "aquantity__uom-menu",
3075
- role: "listbox",
3076
- "aria-label": __props.uomLabel
3077
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(uoms.value, (option, i) => {
3078
- return openBlock(), createElementBlock("li", {
3079
- id: `${__props.uuid}-uom-opt-${i}`,
3080
- key: option,
3081
- role: "option",
3082
- "aria-selected": option === uom.value,
3083
- class: normalizeClass(["aquantity__uom-option", { "is-active": i === dropdown.activeIndex }]),
3084
- onMouseenter: ($event) => dropdown.activeIndex = i,
3085
- onClick: ($event) => selectUom(option)
3086
- }, toDisplayString(option), 43, _hoisted_12$1);
3087
- }), 128))], 8, _hoisted_11$1), [[vShow, dropdown.open]])])), [[unref(vOnClickOutside), closeDropdown]]),
3438
+ createElementVNode("div", _hoisted_8$1, [createVNode(ADropdown_default, {
3439
+ modelValue: uom.value,
3440
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => uom.value = $event),
3441
+ embedded: "",
3442
+ trigger: "button",
3443
+ "list-anchor": "group",
3444
+ options: uoms.value,
3445
+ mode: __props.mode,
3446
+ uuid: __props.uuid ? `${__props.uuid}-uom` : void 0,
3447
+ "aria-label": __props.uomLabel,
3448
+ placeholder: __props.uomLabel
3449
+ }, null, 8, [
3450
+ "modelValue",
3451
+ "options",
3452
+ "mode",
3453
+ "uuid",
3454
+ "aria-label",
3455
+ "placeholder"
3456
+ ])]),
3088
3457
  createElementVNode("label", {
3089
3458
  class: "aform_field-label",
3090
3459
  for: __props.uuid
3091
- }, toDisplayString(__props.label), 9, _hoisted_13)
3460
+ }, toDisplayString(__props.label), 9, _hoisted_9$1)
3092
3461
  ])])]),
3093
- createElementVNode("div", _hoisted_14, [
3094
- createElementVNode("div", _hoisted_15, [createElementVNode("input", {
3095
- value: modelValue.value?.stockUom,
3096
- class: "aform_input-field aquantity__stock-field",
3097
- type: "text",
3098
- disabled: ""
3099
- }, null, 8, _hoisted_16), createElementVNode("label", _hoisted_17, toDisplayString(__props.stockUomLabel), 1)]),
3100
- createElementVNode("div", _hoisted_18, [createElementVNode("input", {
3101
- value: modelValue.value?.stockQty,
3102
- class: "aform_input-field aquantity__stock-field",
3103
- type: "number",
3104
- disabled: ""
3105
- }, null, 8, _hoisted_19), createElementVNode("label", _hoisted_20, toDisplayString(__props.stockQtyLabel), 1)]),
3106
- createElementVNode("div", _hoisted_21, [createElementVNode("input", {
3107
- value: modelValue.value?.conversionFactor,
3108
- class: "aform_input-field aquantity__stock-field",
3109
- type: "number",
3110
- disabled: ""
3111
- }, null, 8, _hoisted_22), createElementVNode("label", _hoisted_23, toDisplayString(__props.conversionFactorLabel), 1)])
3112
- ]),
3462
+ showStock.value && !errorText.value ? (openBlock(), createElementBlock("p", {
3463
+ key: 0,
3464
+ id: helperId.value,
3465
+ class: "aquantity__helper"
3466
+ }, toDisplayString(conversionHelperText.value), 9, _hoisted_10$1)) : createCommentVNode("", true),
3113
3467
  withDirectives(createElementVNode("p", {
3114
3468
  id: unref(errorId),
3115
3469
  class: "aform_error",
3116
3470
  role: "alert"
3117
- }, toDisplayString(errorText.value), 9, _hoisted_24), [[vShow, errorText.value]])
3471
+ }, toDisplayString(errorText.value), 9, _hoisted_11$1), [[vShow, errorText.value]])
3118
3472
  ], 64))]);
3119
3473
  };
3120
3474
  }
3121
- }), [["__scopeId", "data-v-05d1da97"]]);
3475
+ }), [["__scopeId", "data-v-3d289084"]]);
3122
3476
  //#endregion
3123
3477
  //#region src/components/form/ASemverInput.vue?vue&type=script&setup=true&lang.ts
3124
- var _hoisted_1$5 = { class: "aform_form-element" };
3125
- var _hoisted_2$4 = { class: "aform_display-value" };
3478
+ var _hoisted_1$9 = { class: "aform_form-element" };
3479
+ var _hoisted_2$5 = { class: "aform_display-value" };
3126
3480
  var _hoisted_3$3 = { class: "aform_field-label" };
3127
3481
  var _hoisted_4$3 = [
3128
3482
  "id",
@@ -3175,7 +3529,7 @@ var ASemverInput_default = /* @__PURE__ */ defineComponent({
3175
3529
  if (next !== (version.value ?? null)) version.value = next;
3176
3530
  };
3177
3531
  return (_ctx, _cache) => {
3178
- return openBlock(), createElementBlock("div", _hoisted_1$5, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$4, toDisplayString(version.value ?? ""), 1), createElementVNode("label", _hoisted_3$3, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3532
+ return openBlock(), createElementBlock("div", _hoisted_1$9, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$5, toDisplayString(version.value ?? ""), 1), createElementVNode("label", _hoisted_3$3, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3179
3533
  createElementVNode("input", {
3180
3534
  id: __props.uuid,
3181
3535
  value: text.value,
@@ -3292,8 +3646,8 @@ function useStringMask(el, binding) {
3292
3646
  }
3293
3647
  //#endregion
3294
3648
  //#region src/components/form/ATextInput.vue?vue&type=script&setup=true&lang.ts
3295
- var _hoisted_1$4 = { class: "aform_form-element" };
3296
- var _hoisted_2$3 = { class: "aform_display-value" };
3649
+ var _hoisted_1$8 = { class: "aform_form-element" };
3650
+ var _hoisted_2$4 = { class: "aform_display-value" };
3297
3651
  var _hoisted_3$2 = { class: "aform_field-label" };
3298
3652
  var _hoisted_4$2 = [
3299
3653
  "id",
@@ -3330,7 +3684,7 @@ var ATextInput_default = /* @__PURE__ */ defineComponent({
3330
3684
  const maskFilled = ref(true);
3331
3685
  const inputText = useModel(__props, "modelValue");
3332
3686
  return (_ctx, _cache) => {
3333
- return openBlock(), createElementBlock("div", _hoisted_1$4, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$3, toDisplayString(inputText.value ?? ""), 1), createElementVNode("label", _hoisted_3$2, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3687
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$4, toDisplayString(inputText.value ?? ""), 1), createElementVNode("label", _hoisted_3$2, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3334
3688
  withDirectives(createElementVNode("input", {
3335
3689
  id: __props.uuid,
3336
3690
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputText.value = $event),
@@ -3356,8 +3710,8 @@ var ATextInput_default = /* @__PURE__ */ defineComponent({
3356
3710
  });
3357
3711
  //#endregion
3358
3712
  //#region src/components/form/ATextboxInput.vue?vue&type=script&setup=true&lang.ts
3359
- var _hoisted_1$3 = { class: "aform_form-element" };
3360
- var _hoisted_2$2 = { class: "aform_display-value aform_textbox-display" };
3713
+ var _hoisted_1$7 = { class: "aform_form-element" };
3714
+ var _hoisted_2$3 = { class: "aform_display-value aform_textbox-display" };
3361
3715
  var _hoisted_3$1 = { class: "aform_field-label" };
3362
3716
  var _hoisted_4$1 = [
3363
3717
  "id",
@@ -3398,7 +3752,7 @@ var ATextboxInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
3398
3752
  const { errorId, describedBy, invalid } = fieldErrorA11y(__props.uuid, errorText);
3399
3753
  const inputText = useModel(__props, "modelValue");
3400
3754
  return (_ctx, _cache) => {
3401
- return openBlock(), createElementBlock("div", _hoisted_1$3, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$2, toDisplayString(inputText.value ?? ""), 1), createElementVNode("label", _hoisted_3$1, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3755
+ return openBlock(), createElementBlock("div", _hoisted_1$7, [__props.mode === "display" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2$3, toDisplayString(inputText.value ?? ""), 1), createElementVNode("label", _hoisted_3$1, toDisplayString(__props.label), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3402
3756
  withDirectives(createElementVNode("textarea", {
3403
3757
  id: __props.uuid,
3404
3758
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputText.value = $event),
@@ -3426,8 +3780,8 @@ var ATextboxInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
3426
3780
  }), [["__scopeId", "data-v-19e611fa"]]);
3427
3781
  //#endregion
3428
3782
  //#region src/components/utilities/Login.vue?vue&type=script&setup=true&lang.ts
3429
- var _hoisted_1$2 = { class: "login-container" };
3430
- var _hoisted_2$1 = { class: "account-container" };
3783
+ var _hoisted_1$6 = { class: "login-container" };
3784
+ var _hoisted_2$2 = { class: "account-container" };
3431
3785
  var _hoisted_3 = { class: "account-header" };
3432
3786
  var _hoisted_4 = { id: "account-title" };
3433
3787
  var _hoisted_5 = { id: "account-subtitle" };
@@ -3468,7 +3822,7 @@ var Login_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
3468
3822
  emit("loginSuccess");
3469
3823
  }
3470
3824
  return (_ctx, _cache) => {
3471
- return openBlock(), createElementBlock("div", _hoisted_1$2, [createElementVNode("div", null, [createElementVNode("div", _hoisted_2$1, [
3825
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [createElementVNode("div", null, [createElementVNode("div", _hoisted_2$2, [
3472
3826
  createElementVNode("div", _hoisted_3, [createElementVNode("h1", _hoisted_4, toDisplayString(__props.headerTitle), 1), createElementVNode("p", _hoisted_5, toDisplayString(__props.headerSubtitle), 1)]),
3473
3827
  createElementVNode("form", { onSubmit }, [createElementVNode("div", _hoisted_6, [
3474
3828
  createElementVNode("div", _hoisted_7, [_cache[2] || (_cache[2] = createElementVNode("label", {
@@ -3517,15 +3871,15 @@ var Login_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
3517
3871
  //#endregion
3518
3872
  //#region src/components/AFormLoading.vue
3519
3873
  var _sfc_main = {};
3520
- var _hoisted_1$1 = { class: "aform-loading" };
3521
- var _hoisted_2 = { class: "aform-loading__label" };
3874
+ var _hoisted_1$5 = { class: "aform-loading" };
3875
+ var _hoisted_2$1 = { class: "aform-loading__label" };
3522
3876
  function _sfc_render(_ctx, _cache) {
3523
- return openBlock(), createElementBlock("div", _hoisted_1$1, [createElementVNode("div", _hoisted_2, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]), _cache[0] || (_cache[0] = createElementVNode("div", { class: "aform-loading__bar" }, null, -1))]);
3877
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [createElementVNode("div", _hoisted_2$1, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]), _cache[0] || (_cache[0] = createElementVNode("div", { class: "aform-loading__bar" }, null, -1))]);
3524
3878
  }
3525
3879
  var AFormLoading_default = /*#__PURE__*/ _plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a8ae13b2"]]);
3526
3880
  //#endregion
3527
3881
  //#region src/components/base/ExpandButton.vue?vue&type=script&setup=true&lang.ts
3528
- var _hoisted_1 = ["aria-expanded", "aria-label"];
3882
+ var _hoisted_1$4 = ["aria-expanded", "aria-label"];
3529
3883
  //#endregion
3530
3884
  //#region src/components/base/ExpandButton.vue
3531
3885
  var ExpandButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -3538,11 +3892,524 @@ var ExpandButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
3538
3892
  class: "expansion-index",
3539
3893
  "aria-expanded": __props.expanded,
3540
3894
  "aria-label": __props.expanded ? "Collapse" : "Expand"
3541
- }, toDisplayString(__props.expanded ? "▼" : "►"), 9, _hoisted_1);
3895
+ }, toDisplayString(__props.expanded ? "▼" : "►"), 9, _hoisted_1$4);
3542
3896
  };
3543
3897
  }
3544
3898
  }), [["__scopeId", "data-v-5ed76a08"]]);
3545
3899
  //#endregion
3900
+ //#region src/composables/useTableModalDropdownList.ts
3901
+ /** Keyboard nav + focus for {@link ADropdownList} hosted in {@link ATableModal}. */
3902
+ function useTableModalDropdownList(options) {
3903
+ const activeIndex = ref(null);
3904
+ const focusPanel = () => {
3905
+ nextTick(() => options.panelRef.value?.focus());
3906
+ };
3907
+ watch(() => options.isOpen(), (open) => {
3908
+ if (open) {
3909
+ activeIndex.value = null;
3910
+ focusPanel();
3911
+ }
3912
+ });
3913
+ onMounted(() => {
3914
+ if (options.isOpen()) focusPanel();
3915
+ });
3916
+ const onKeydown = (event) => {
3917
+ if (event.key === "Escape") {
3918
+ event.preventDefault();
3919
+ event.stopPropagation();
3920
+ options.onClose();
3921
+ return;
3922
+ }
3923
+ const count = options.optionCount();
3924
+ if (!count) return;
3925
+ if (event.key === "ArrowDown") {
3926
+ event.preventDefault();
3927
+ event.stopPropagation();
3928
+ if (activeIndex.value != null) activeIndex.value = (activeIndex.value + 1) % count;
3929
+ else activeIndex.value = 0;
3930
+ return;
3931
+ }
3932
+ if (event.key === "ArrowUp") {
3933
+ event.preventDefault();
3934
+ event.stopPropagation();
3935
+ if (activeIndex.value != null) activeIndex.value = activeIndex.value === 0 ? Math.max(count - 1, 0) : activeIndex.value - 1;
3936
+ else activeIndex.value = Math.max(count - 1, 0);
3937
+ return;
3938
+ }
3939
+ if (event.key === "Enter") {
3940
+ event.preventDefault();
3941
+ event.stopPropagation();
3942
+ const index = activeIndex.value ?? 0;
3943
+ if (index >= 0 && index < count) options.selectAt(index);
3944
+ return;
3945
+ }
3946
+ };
3947
+ const onClickOutside = () => {
3948
+ options.onClose();
3949
+ };
3950
+ const onFocusOut = (event) => {
3951
+ if (event.relatedTarget instanceof Node && options.panelRef.value?.contains(event.relatedTarget)) return;
3952
+ options.onClose();
3953
+ };
3954
+ return {
3955
+ activeIndex,
3956
+ onKeydown,
3957
+ onClickOutside,
3958
+ onFocusOut,
3959
+ focusPanel
3960
+ };
3961
+ }
3962
+ //#endregion
3963
+ //#region src/components/table/ATableTupleCurrencyPicker.vue?vue&type=script&setup=true&lang.ts
3964
+ var _hoisted_1$3 = {
3965
+ key: 0,
3966
+ class: "loading autocomplete-result"
3967
+ };
3968
+ var _hoisted_2 = [
3969
+ "id",
3970
+ "aria-selected",
3971
+ "onMousedown"
3972
+ ];
3973
+ //#endregion
3974
+ //#region src/components/table/ATableTupleCurrencyPicker.vue
3975
+ var ATableTupleCurrencyPicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
3976
+ __name: "ATableTupleCurrencyPicker",
3977
+ props: { store: {} },
3978
+ setup(__props) {
3979
+ const panelRef = useTemplateRef("panelRef");
3980
+ const loading = ref(false);
3981
+ const currencyOptions = ref([]);
3982
+ const open = computed(() => !!__props.store.modal.visible && __props.store.modal.component === TABLE_TUPLE_CURRENCY_PICKER);
3983
+ const colIndex = computed(() => __props.store.modal.colIndex ?? 0);
3984
+ const rowIndex = computed(() => __props.store.modal.rowIndex ?? 0);
3985
+ const column = computed(() => __props.store.columns[colIndex.value]);
3986
+ const currencyFieldOptions = computed(() => column.value?.options ?? {});
3987
+ const cellValue = computed(() => __props.store.getCellData(colIndex.value, rowIndex.value));
3988
+ const listboxId = computed(() => `atable-tuple-cur-${rowIndex.value}-${colIndex.value}`);
3989
+ const isSelected = (option) => String(option.id) === String(cellValue.value?.currency?.id);
3990
+ const loadCurrencyOptions = async () => {
3991
+ const opts = currencyFieldOptions.value;
3992
+ const filterFunction = opts.filterFunction;
3993
+ if (filterFunction) {
3994
+ loading.value = true;
3995
+ try {
3996
+ const fn = typeof filterFunction === "string" ? deserializeFunction(filterFunction) : filterFunction;
3997
+ currencyOptions.value = await fn("") ?? [];
3998
+ } catch {
3999
+ currencyOptions.value = [];
4000
+ } finally {
4001
+ loading.value = false;
4002
+ }
4003
+ return;
4004
+ }
4005
+ currencyOptions.value = staticCurrencyChoices(opts, cellValue.value);
4006
+ };
4007
+ watch(open, (visible) => {
4008
+ if (visible) loadCurrencyOptions();
4009
+ });
4010
+ onMounted(() => {
4011
+ if (open.value) loadCurrencyOptions();
4012
+ });
4013
+ const optionCount = () => loading.value ? 0 : currencyOptions.value.length;
4014
+ const closePicker = () => __props.store.closeTuplePicker();
4015
+ const selectCurrency = (option) => {
4016
+ const opts = currencyFieldOptions.value;
4017
+ const base = normalizeBaseCurrency(opts, cellValue.value);
4018
+ __props.store.setCellData(colIndex.value, rowIndex.value, patchCurrencyCurrency(cellValue.value, option, opts, base));
4019
+ closePicker();
4020
+ };
4021
+ const { activeIndex, onKeydown, onClickOutside, onFocusOut } = useTableModalDropdownList({
4022
+ panelRef,
4023
+ isOpen: () => open.value,
4024
+ optionCount,
4025
+ selectAt: (index) => {
4026
+ const option = currencyOptions.value[index];
4027
+ if (option !== void 0) selectCurrency(option);
4028
+ },
4029
+ onClose: closePicker
4030
+ });
4031
+ return (_ctx, _cache) => {
4032
+ return open.value ? withDirectives((openBlock(), createElementBlock("div", {
4033
+ key: 0,
4034
+ ref_key: "panelRef",
4035
+ ref: panelRef,
4036
+ class: "atable-tuple-picker-modal",
4037
+ tabindex: "-1",
4038
+ onKeydown: _cache[0] || (_cache[0] = (...args) => unref(onKeydown) && unref(onKeydown)(...args)),
4039
+ onFocusout: _cache[1] || (_cache[1] = (...args) => unref(onFocusOut) && unref(onFocusOut)(...args))
4040
+ }, [createVNode(ADropdownList_default, {
4041
+ "listbox-id": listboxId.value,
4042
+ ariaLabel: "Currency",
4043
+ open: true,
4044
+ surface: "cell-modal",
4045
+ "option-count": optionCount,
4046
+ "active-index": () => unref(activeIndex)
4047
+ }, {
4048
+ default: withCtx(() => [loading.value ? (openBlock(), createElementBlock("li", _hoisted_1$3, "Loading…")) : !loading.value ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(currencyOptions.value, (option, i) => {
4049
+ return openBlock(), createElementBlock("li", {
4050
+ id: `${listboxId.value}-opt-${i}`,
4051
+ key: String(option.id),
4052
+ role: "option",
4053
+ "aria-selected": isSelected(option),
4054
+ class: normalizeClass(["autocomplete-result", {
4055
+ "is-active": i === unref(activeIndex),
4056
+ "is-selected": isSelected(option)
4057
+ }]),
4058
+ onMousedown: withModifiers(($event) => selectCurrency(option), ["prevent"])
4059
+ }, toDisplayString(option.symbol ? `${option.symbol} — ` : "") + toDisplayString(option.displayText ?? option.id), 43, _hoisted_2);
4060
+ }), 128)) : createCommentVNode("", true)]),
4061
+ _: 1
4062
+ }, 8, ["listbox-id", "active-index"])], 32)), [[unref(vOnClickOutside), unref(onClickOutside)]]) : createCommentVNode("", true);
4063
+ };
4064
+ }
4065
+ }), [["__scopeId", "data-v-e17b3eb6"]]);
4066
+ //#endregion
4067
+ //#region src/components/table/ATableTupleQuantityPicker.vue?vue&type=script&setup=true&lang.ts
4068
+ var _hoisted_1$2 = [
4069
+ "id",
4070
+ "aria-selected",
4071
+ "onMousedown"
4072
+ ];
4073
+ //#endregion
4074
+ //#region src/components/table/ATableTupleQuantityPicker.vue
4075
+ var ATableTupleQuantityPicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
4076
+ __name: "ATableTupleQuantityPicker",
4077
+ props: { store: {} },
4078
+ setup(__props) {
4079
+ const panelRef = useTemplateRef("panelRef");
4080
+ const open = computed(() => !!__props.store.modal.visible && __props.store.modal.component === TABLE_TUPLE_QUANTITY_PICKER);
4081
+ const colIndex = computed(() => __props.store.modal.colIndex ?? 0);
4082
+ const rowIndex = computed(() => __props.store.modal.rowIndex ?? 0);
4083
+ const column = computed(() => __props.store.columns[colIndex.value]);
4084
+ const uomOptions = computed(() => (column.value?.options)?.uoms ?? []);
4085
+ const cellValue = computed(() => __props.store.getCellData(colIndex.value, rowIndex.value));
4086
+ const selectedUom = computed(() => cellValue.value?.uom ?? "");
4087
+ const listboxId = computed(() => `atable-tuple-qty-${rowIndex.value}-${colIndex.value}`);
4088
+ const optionCount = () => uomOptions.value.length;
4089
+ const closePicker = () => __props.store.closeTuplePicker();
4090
+ const selectUom = (uom) => {
4091
+ const options = column.value?.options ?? {};
4092
+ __props.store.setCellData(colIndex.value, rowIndex.value, patchQuantityUom(cellValue.value, uom, options));
4093
+ closePicker();
4094
+ };
4095
+ const { activeIndex, onKeydown, onClickOutside, onFocusOut } = useTableModalDropdownList({
4096
+ panelRef,
4097
+ isOpen: () => open.value,
4098
+ optionCount,
4099
+ selectAt: (index) => {
4100
+ const uom = uomOptions.value[index];
4101
+ if (uom !== void 0) selectUom(uom);
4102
+ },
4103
+ onClose: closePicker
4104
+ });
4105
+ return (_ctx, _cache) => {
4106
+ return open.value ? withDirectives((openBlock(), createElementBlock("div", {
4107
+ key: 0,
4108
+ ref_key: "panelRef",
4109
+ ref: panelRef,
4110
+ class: "atable-tuple-picker-modal",
4111
+ tabindex: "-1",
4112
+ onKeydown: _cache[0] || (_cache[0] = (...args) => unref(onKeydown) && unref(onKeydown)(...args)),
4113
+ onFocusout: _cache[1] || (_cache[1] = (...args) => unref(onFocusOut) && unref(onFocusOut)(...args))
4114
+ }, [createVNode(ADropdownList_default, {
4115
+ "listbox-id": listboxId.value,
4116
+ ariaLabel: "Unit of measure",
4117
+ open: true,
4118
+ surface: "cell-modal",
4119
+ "option-count": optionCount,
4120
+ "active-index": () => unref(activeIndex)
4121
+ }, {
4122
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(uomOptions.value, (uom, i) => {
4123
+ return openBlock(), createElementBlock("li", {
4124
+ id: `${listboxId.value}-opt-${i}`,
4125
+ key: uom,
4126
+ role: "option",
4127
+ "aria-selected": uom === selectedUom.value,
4128
+ class: normalizeClass(["autocomplete-result", {
4129
+ "is-active": i === unref(activeIndex),
4130
+ "is-selected": uom === selectedUom.value
4131
+ }]),
4132
+ onMousedown: withModifiers(($event) => selectUom(uom), ["prevent"])
4133
+ }, toDisplayString(uom), 43, _hoisted_1$2);
4134
+ }), 128))]),
4135
+ _: 1
4136
+ }, 8, ["listbox-id", "active-index"])], 32)), [[unref(vOnClickOutside), unref(onClickOutside)]]) : createCommentVNode("", true);
4137
+ };
4138
+ }
4139
+ }), [["__scopeId", "data-v-f573d68f"]]);
4140
+ //#endregion
4141
+ //#region src/components/table/ATupleCellShell.vue?vue&type=script&setup=true&lang.ts
4142
+ var _hoisted_1$1 = [
4143
+ "aria-label",
4144
+ "aria-expanded",
4145
+ "aria-hidden"
4146
+ ];
4147
+ //#endregion
4148
+ //#region src/components/table/ATupleCellShell.vue
4149
+ var ATupleCellShell_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
4150
+ __name: "ATupleCellShell",
4151
+ props: {
4152
+ active: { type: Boolean },
4153
+ displayText: {},
4154
+ pickerLabel: {},
4155
+ pickerOpen: { type: Boolean }
4156
+ },
4157
+ emits: ["open-picker"],
4158
+ setup(__props, { emit: __emit }) {
4159
+ const emit = __emit;
4160
+ return (_ctx, _cache) => {
4161
+ return openBlock(), createElementBlock("div", { class: normalizeClass(["atable-tuple-shell", { "atable-tuple-shell--active": __props.active }]) }, [
4162
+ createElementVNode("button", {
4163
+ type: "button",
4164
+ class: normalizeClass(["atable-tuple-shell__handle", { "atable-tuple-shell__handle--visible": __props.active }]),
4165
+ tabindex: "-1",
4166
+ "aria-label": __props.pickerLabel,
4167
+ "aria-haspopup": "listbox",
4168
+ "aria-expanded": __props.pickerOpen,
4169
+ "aria-hidden": !__props.active,
4170
+ onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"])),
4171
+ onClick: _cache[1] || (_cache[1] = withModifiers(($event) => emit("open-picker"), ["stop"]))
4172
+ }, [..._cache[2] || (_cache[2] = [createElementVNode("span", {
4173
+ class: "atable-tuple-shell__caret",
4174
+ "aria-hidden": "true"
4175
+ }, null, -1)])], 42, _hoisted_1$1),
4176
+ withDirectives(createElementVNode("span", { class: "atable-tuple-shell__display" }, toDisplayString(__props.displayText), 513), [[vShow, !__props.active]]),
4177
+ __props.active ? renderSlot(_ctx.$slots, "default", {}, void 0, true, 0) : createCommentVNode("", true)
4178
+ ], 2);
4179
+ };
4180
+ }
4181
+ }), [["__scopeId", "data-v-2746f028"]]);
4182
+ //#endregion
4183
+ //#region src/components/table/ATupleCellEditor.vue?vue&type=script&setup=true&lang.ts
4184
+ var _hoisted_1 = ["id", "aria-label"];
4185
+ //#endregion
4186
+ //#region src/components/table/ATupleCellEditor.vue
4187
+ var ATupleCellEditor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
4188
+ __name: "ATupleCellEditor",
4189
+ props: {
4190
+ category: {},
4191
+ colIndex: {},
4192
+ rowIndex: {},
4193
+ store: {},
4194
+ active: { type: Boolean },
4195
+ displayText: {},
4196
+ inputId: {}
4197
+ },
4198
+ emits: ["deactivate"],
4199
+ setup(__props, { expose: __expose, emit: __emit }) {
4200
+ const emit = __emit;
4201
+ const inputRef = useTemplateRef("inputRef");
4202
+ const draftText = ref("");
4203
+ const selectOnFocus = ref(true);
4204
+ const amountMaskEnabled = computed(() => __props.category === "currency" && options.value.amountMask !== false);
4205
+ const column = computed(() => __props.store.columns[__props.colIndex]);
4206
+ const options = computed(() => column.value?.options ?? {});
4207
+ const cellValue = computed(() => __props.store.getCellData(__props.colIndex, __props.rowIndex));
4208
+ const pickerLabel = computed(() => __props.category === "currency" ? "Choose currency" : "Choose unit");
4209
+ const amountLabel = computed(() => __props.category === "currency" ? "Amount" : "Quantity");
4210
+ const selectedCurrencyId = computed(() => String(cellValue.value?.currency?.id ?? ""));
4211
+ const cellElement = computed(() => {
4212
+ const el = inputRef.value?.closest("td");
4213
+ return el instanceof HTMLTableCellElement ? el : null;
4214
+ });
4215
+ const { left, bottom, width, height } = useElementBounding(cellElement);
4216
+ const pickerOpenForCell = computed(() => isTableTuplePickerModal(__props.store.modal) && __props.store.modal.colIndex === __props.colIndex && __props.store.modal.rowIndex === __props.rowIndex);
4217
+ watch(pickerOpenForCell, (open, wasOpen) => {
4218
+ if (!wasOpen || open) return;
4219
+ setTimeout(() => {
4220
+ if (pickerOpenForCell.value) return;
4221
+ const focused = document.activeElement;
4222
+ if (focused && cellElement.value?.contains(focused)) return;
4223
+ if (!focused || focused === document.body) inputRef.value?.focus();
4224
+ else emit("deactivate");
4225
+ });
4226
+ });
4227
+ const syncDraftFromModel = () => {
4228
+ const v = cellValue.value;
4229
+ if (__props.category === "quantity") {
4230
+ const q = v;
4231
+ draftText.value = q?.qty === null || q?.qty === void 0 ? "" : String(q.qty);
4232
+ return;
4233
+ }
4234
+ const c = v;
4235
+ if (amountMaskEnabled.value) {
4236
+ draftText.value = formatCurrencyAmountInput(c?.amount ?? null, selectedCurrencyId.value);
4237
+ return;
4238
+ }
4239
+ draftText.value = c?.amount === null || c?.amount === void 0 ? "" : String(c.amount);
4240
+ };
4241
+ watch(cellValue, () => {
4242
+ if (document.activeElement !== inputRef.value) syncDraftFromModel();
4243
+ }, { deep: true });
4244
+ watch(() => __props.active, (isActive) => {
4245
+ if (isActive) syncDraftFromModel();
4246
+ });
4247
+ const parseDraftAmount = () => {
4248
+ if (__props.category === "currency" && amountMaskEnabled.value) return parseCurrencyAmountInput(draftText.value);
4249
+ const text = draftText.value.trim();
4250
+ if (text === "" || text === "-") return null;
4251
+ const n = Number(text);
4252
+ return Number.isFinite(n) ? n : null;
4253
+ };
4254
+ const commitNumber = () => {
4255
+ const parsed = parseDraftAmount();
4256
+ if (__props.category === "quantity") {
4257
+ __props.store.setCellData(__props.colIndex, __props.rowIndex, patchQuantityQty(cellValue.value, parsed, options.value));
4258
+ return;
4259
+ }
4260
+ const base = normalizeBaseCurrency(options.value, cellValue.value);
4261
+ __props.store.setCellData(__props.colIndex, __props.rowIndex, patchCurrencyAmount(cellValue.value, parsed, options.value, base));
4262
+ };
4263
+ const onInput = () => {
4264
+ if (__props.category === "currency" && amountMaskEnabled.value) {
4265
+ const parsed = parseCurrencyAmountInput(draftText.value);
4266
+ if (draftText.value.trim() === "" || draftText.value.trim() === "-" || parsed !== null) commitNumber();
4267
+ return;
4268
+ }
4269
+ commitNumber();
4270
+ };
4271
+ const shouldStayActiveAfterBlur = (related) => {
4272
+ if (!(related instanceof Node)) return false;
4273
+ if (document.querySelector(".amodal")?.contains(related)) return true;
4274
+ if (pickerOpenForCell.value) return true;
4275
+ if (!(inputRef.value?.closest("td"))?.contains(related)) return false;
4276
+ if (related instanceof Element && related.closest(".atable-tuple-shell__handle")) return true;
4277
+ if (related === inputRef.value) return true;
4278
+ return false;
4279
+ };
4280
+ const onInputBlur = (event) => {
4281
+ commitNumber();
4282
+ if (__props.category === "currency" && amountMaskEnabled.value) syncDraftFromModel();
4283
+ if (!shouldStayActiveAfterBlur(event.relatedTarget)) emit("deactivate");
4284
+ };
4285
+ const openPicker = () => {
4286
+ const cell = cellElement.value;
4287
+ if (!cell) return;
4288
+ __props.store.openTuplePicker(__props.colIndex, __props.rowIndex, cell, {
4289
+ left: left.value,
4290
+ bottom: bottom.value,
4291
+ width: width.value,
4292
+ height: height.value
4293
+ });
4294
+ };
4295
+ const onKeydown = (event) => {
4296
+ if (event.shiftKey && event.key === "ArrowDown") {
4297
+ event.preventDefault();
4298
+ event.stopPropagation();
4299
+ openPicker();
4300
+ return;
4301
+ }
4302
+ if (__props.category === "currency" && amountMaskEnabled.value && !pickerOpenForCell.value) {
4303
+ if (onCurrencyKeydownMasked(event)) return;
4304
+ }
4305
+ if (__props.category === "quantity" && event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) refuseUnlessQuantity(event, event.key);
4306
+ };
4307
+ const textWith = (input, inserted) => input.value.slice(0, input.selectionStart ?? 0) + inserted + input.value.slice(input.selectionEnd ?? 0);
4308
+ const refuseUnlessQuantity = (event, inserted) => {
4309
+ if (!quantityEntryPattern.test(textWith(event.target, inserted))) event.preventDefault();
4310
+ };
4311
+ const entryPattern = computed(() => {
4312
+ if (__props.category === "quantity") return quantityEntryPattern;
4313
+ return amountMaskEnabled.value ? currencyAmountEntryPattern(selectedCurrencyId.value) : void 0;
4314
+ });
4315
+ const onPaste = (event) => {
4316
+ const pattern = entryPattern.value;
4317
+ if (!pattern) return;
4318
+ event.preventDefault();
4319
+ const input = event.target;
4320
+ const pasted = (event.clipboardData?.getData("text") ?? "").trim();
4321
+ if (!pattern.test(textWith(input, pasted))) return;
4322
+ input.setRangeText(pasted, input.selectionStart ?? 0, input.selectionEnd ?? 0, "end");
4323
+ input.dispatchEvent(new Event("input", { bubbles: true }));
4324
+ };
4325
+ const onCurrencyKeydownMasked = (event) => {
4326
+ if (event.ctrlKey || event.metaKey || event.altKey) return false;
4327
+ if ((/* @__PURE__ */ new Set([
4328
+ "Backspace",
4329
+ "Delete",
4330
+ "Tab",
4331
+ "Escape",
4332
+ "Enter",
4333
+ "ArrowLeft",
4334
+ "ArrowRight",
4335
+ "ArrowUp",
4336
+ "ArrowDown",
4337
+ "Home",
4338
+ "End"
4339
+ ])).has(event.key)) return false;
4340
+ if (/^[0-9]$/.test(event.key)) return false;
4341
+ if (event.key === "-") {
4342
+ const input = event.target;
4343
+ if (!input.value.includes("-") && input.selectionStart === 0) return false;
4344
+ }
4345
+ if (event.key === "." || event.key === ",") {
4346
+ if (currencyInputFractionDigits(selectedCurrencyId.value) === 0) {
4347
+ event.preventDefault();
4348
+ return true;
4349
+ }
4350
+ const input = event.target;
4351
+ if (!input.value.includes(".") && !input.value.includes(",")) return false;
4352
+ }
4353
+ const pattern = currencyAmountEntryPattern(selectedCurrencyId.value);
4354
+ const { selectionStart, selectionEnd, value } = event.target;
4355
+ if (selectionStart === null || selectionEnd === null) {
4356
+ event.preventDefault();
4357
+ return true;
4358
+ }
4359
+ const next = value.slice(0, selectionStart) + event.key + value.slice(selectionEnd);
4360
+ if (event.key.length === 1 && !pattern.test(next)) event.preventDefault();
4361
+ return true;
4362
+ };
4363
+ const onInputFocus = () => {
4364
+ if (selectOnFocus.value) nextTick(() => {
4365
+ inputRef.value?.select();
4366
+ selectOnFocus.value = false;
4367
+ });
4368
+ };
4369
+ const focusInput = () => {
4370
+ selectOnFocus.value = true;
4371
+ nextTick(() => inputRef.value?.focus());
4372
+ };
4373
+ __expose({
4374
+ focusInput,
4375
+ openPicker,
4376
+ commitNumber
4377
+ });
4378
+ return (_ctx, _cache) => {
4379
+ return openBlock(), createBlock(ATupleCellShell_default, {
4380
+ active: __props.active,
4381
+ "display-text": __props.displayText,
4382
+ "picker-label": pickerLabel.value,
4383
+ "picker-open": pickerOpenForCell.value,
4384
+ onOpenPicker: openPicker
4385
+ }, {
4386
+ default: withCtx(() => [withDirectives(createElementVNode("input", {
4387
+ ref_key: "inputRef",
4388
+ ref: inputRef,
4389
+ id: __props.inputId,
4390
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => draftText.value = $event),
4391
+ class: "atable-tuple-shell__input",
4392
+ type: "text",
4393
+ tabindex: "-1",
4394
+ inputmode: "decimal",
4395
+ "aria-label": amountLabel.value,
4396
+ onInput,
4397
+ onKeydown,
4398
+ onPaste,
4399
+ onFocus: onInputFocus,
4400
+ onBlur: onInputBlur
4401
+ }, null, 40, _hoisted_1), [[vModelText, draftText.value]])]),
4402
+ _: 1
4403
+ }, 8, [
4404
+ "active",
4405
+ "display-text",
4406
+ "picker-label",
4407
+ "picker-open"
4408
+ ]);
4409
+ };
4410
+ }
4411
+ }), [["__scopeId", "data-v-ad79f2bc"]]);
4412
+ //#endregion
3546
4413
  //#region src/index.ts
3547
4414
  /**
3548
4415
  * Install all AForm components
@@ -3574,8 +4441,12 @@ function install(app) {
3574
4441
  app.component("ADuration", ADuration_default);
3575
4442
  app.component("AFormLoading", AFormLoading_default);
3576
4443
  app.component("ExpandButton", ExpandButton_default);
4444
+ app.component("ATableTupleQuantityPicker", ATableTupleQuantityPicker_default);
4445
+ app.component("ATableTupleCurrencyPicker", ATableTupleCurrencyPicker_default);
4446
+ app.component("ATupleCellEditor", ATupleCellEditor_default);
4447
+ app.component("ATupleCellShell", ATupleCellShell_default);
3577
4448
  }
3578
4449
  //#endregion
3579
- export { ABadge_default as ABadge, ACheckbox_default as ACheckbox, ACurrencyInput_default as ACurrencyInput, ADate_default as ADate, ADatePicker_default as ADatePicker, ADateRange_default as ADateRange, ADateSelection_default as ADateSelection, ADateTime_default as ADateTime, ADateTimeInput_default as ADateTimeInput, ADropdown_default as ADropdown, ADuration_default as ADuration, AFieldset_default as AFieldset, AFileAttach_default as AFileAttach, AForm_default as AForm, AFormLink_default as AFormLink, AFormLoading_default as AFormLoading, ANumericInput_default as ANumericInput, AQuantityInput_default as AQuantityInput, ASegmentedControl_default as ASegmentedControl, ASemverInput_default as ASemverInput, ATextInput_default as ATextInput, ATextboxInput_default as ATextboxInput, ExpandButton_default as ExpandButton, Login_default as Login, badgeInputAccentStyle, deserializeFunction, install, resolveFieldBadge, resolvedFieldsToColumns };
4450
+ export { ABadge_default as ABadge, ACheckbox_default as ACheckbox, ACurrencyInput_default as ACurrencyInput, ADate_default as ADate, ADatePicker_default as ADatePicker, ADateRange_default as ADateRange, ADateSelection_default as ADateSelection, ADateTime_default as ADateTime, ADateTimeInput_default as ADateTimeInput, ADropdown_default as ADropdown, ADuration_default as ADuration, AFieldset_default as AFieldset, AFileAttach_default as AFileAttach, AForm_default as AForm, AFormLink_default as AFormLink, AFormLoading_default as AFormLoading, ANumericInput_default as ANumericInput, AQuantityInput_default as AQuantityInput, ASegmentedControl_default as ASegmentedControl, ASemverInput_default as ASemverInput, ATableTupleCurrencyPicker_default as ATableTupleCurrencyPicker, ATableTupleQuantityPicker_default as ATableTupleQuantityPicker, ATextInput_default as ATextInput, ATextboxInput_default as ATextboxInput, ATupleCellEditor_default as ATupleCellEditor, ATupleCellShell_default as ATupleCellShell, ExpandButton_default as ExpandButton, Login_default as Login, badgeInputAccentStyle, deserializeFunction, install, resolveFieldBadge, resolvedFieldsToColumns };
3580
4451
 
3581
4452
  //# sourceMappingURL=aform.js.map