@astryx-vue/core 0.12.1 → 0.13.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 (136) hide show
  1. package/dist/AppShell/index.d.ts +1 -1
  2. package/dist/AvatarGroup/index.d.ts +1 -1
  3. package/dist/Banner/index.d.ts +1 -1
  4. package/dist/BottomSheet/index.d.ts +1 -1
  5. package/dist/Button/index.d.ts +1 -1
  6. package/dist/ButtonGroup/index.d.ts +1 -1
  7. package/dist/Calendar/index.d.ts +1 -1
  8. package/dist/Card/index.d.ts +1 -1
  9. package/dist/Carousel/index.d.ts +1 -1
  10. package/dist/Chat/index.d.ts +1 -1
  11. package/dist/CheckboxInput/index.d.ts +1 -1
  12. package/dist/CheckboxList/index.d.ts +1 -1
  13. package/dist/ClickableCard/index.d.ts +1 -1
  14. package/dist/Code/index.d.ts +1 -1
  15. package/dist/Collapsible/index.d.ts +1 -1
  16. package/dist/ComplexSelector/index.d.ts +1 -1
  17. package/dist/ComplexSelector/index.js +1 -1
  18. package/dist/{ComplexSelector-B_5mzJjR.js → ComplexSelector-Dmbep7M7.js} +165 -49
  19. package/dist/ContextMenu/index.d.ts +1 -1
  20. package/dist/DateInput/index.d.ts +1 -1
  21. package/dist/DateRangeInput/index.d.ts +1 -1
  22. package/dist/DateTimeInput/index.d.ts +1 -1
  23. package/dist/Dialog/index.d.ts +1 -1
  24. package/dist/Divider/index.d.ts +1 -1
  25. package/dist/Drawer/index.d.ts +1 -1
  26. package/dist/FileInput/index.d.ts +1 -1
  27. package/dist/HoverCard/index.d.ts +1 -1
  28. package/dist/InfoTip/index.d.ts +1 -1
  29. package/dist/InternationalizationProvider/index.d.ts +1 -1
  30. package/dist/InternationalizationProvider/index.js +1 -1
  31. package/dist/{InternationalizationProvider-CyDjQn5Z.js → InternationalizationProvider-BYU2MRtX.js} +1 -1
  32. package/dist/Link/index.d.ts +1 -1
  33. package/dist/List/index.d.ts +1 -1
  34. package/dist/MetadataList/index.d.ts +1 -1
  35. package/dist/MoreMenu/index.d.ts +1 -1
  36. package/dist/MultiSelector/index.d.ts +1 -1
  37. package/dist/MultiSelector/index.js +1 -1
  38. package/dist/{MultiSelector-BdedjB6u.js → MultiSelector-BXIpOmSU.js} +105 -50
  39. package/dist/NavItem/index.d.ts +1 -1
  40. package/dist/NumberInput/index.d.ts +1 -1
  41. package/dist/OverflowList/index.d.ts +1 -1
  42. package/dist/Overlay/index.d.ts +1 -1
  43. package/dist/Pagination/index.d.ts +1 -1
  44. package/dist/Pagination/index.js +1 -1
  45. package/dist/{Pagination-uttop2ls.js → Pagination-eeM9SNsG.js} +1 -1
  46. package/dist/Popover/index.d.ts +1 -1
  47. package/dist/PowerSearch/index.d.ts +1 -1
  48. package/dist/PowerSearch/index.js +1 -1
  49. package/dist/{PowerSearch-DDuYfvNh.js → PowerSearch-CaqFxaFb.js} +7 -7
  50. package/dist/ProgressBar/index.d.ts +1 -1
  51. package/dist/Radio/index.d.ts +1 -1
  52. package/dist/RadioList/index.d.ts +1 -1
  53. package/dist/ScrollableArea/index.d.ts +1 -1
  54. package/dist/SelectableCard/index.d.ts +1 -1
  55. package/dist/Selector/index.d.ts +1 -1
  56. package/dist/Selector/index.js +1 -1
  57. package/dist/{Selector-OpczmkqS.js → Selector-DP012yul.js} +8 -43
  58. package/dist/SideNav/index.d.ts +1 -1
  59. package/dist/Stepper/index.d.ts +1 -1
  60. package/dist/Switch/index.d.ts +1 -1
  61. package/dist/TabList/index.d.ts +1 -1
  62. package/dist/Table/index.d.ts +1 -1
  63. package/dist/Table/index.js +1 -1
  64. package/dist/{Table-_pSoEiGP.js → Table-YDS_Hj1L.js} +5 -5
  65. package/dist/TextArea/index.d.ts +1 -1
  66. package/dist/TextInput/index.d.ts +1 -1
  67. package/dist/TimeInput/index.d.ts +1 -1
  68. package/dist/Timestamp/index.d.ts +1 -1
  69. package/dist/ToggleButton/index.d.ts +1 -1
  70. package/dist/Token/index.d.ts +1 -1
  71. package/dist/Tokenizer/index.d.ts +1 -1
  72. package/dist/Tokenizer/index.js +1 -1
  73. package/dist/{Tokenizer-BNazaZsP.js → Tokenizer-CY0ymjYr.js} +107 -48
  74. package/dist/Toolbar/index.d.ts +1 -1
  75. package/dist/Tooltip/index.d.ts +1 -1
  76. package/dist/TopNav/index.d.ts +1 -1
  77. package/dist/TreeList/index.d.ts +1 -1
  78. package/dist/Typeahead/index.d.ts +1 -1
  79. package/dist/Typeahead/index.js +2 -2
  80. package/dist/{Typeahead-BgQVQw-0.js → Typeahead-ByeXwX8E.js} +46 -11
  81. package/dist/composables/index.d.ts +2 -1
  82. package/dist/composables/index.js +1 -1
  83. package/dist/{index-Cb-HJUhK.d.ts → index--tm6L1ot.d.ts} +2 -2
  84. package/dist/{index-TXcNH86P.d.ts → index-B1eCxBCY.d.ts} +1 -1
  85. package/dist/{index-BuubzuE8.d.ts → index-BDZCJ9ri.d.ts} +2 -2
  86. package/dist/{index-wY6dKz6c.d.ts → index-BEZ4ezJk.d.ts} +2 -2
  87. package/dist/{index-a1jCiQP7.d.ts → index-BcJzA5j_.d.ts} +8 -8
  88. package/dist/{index-CTjkJP4x.d.ts → index-Bgk1Rj2A.d.ts} +1 -1
  89. package/dist/{index-CuW4AQ7M.d.ts → index-BhxqUt3y.d.ts} +2 -2
  90. package/dist/{index-Bmqz1lVz.d.ts → index-BpprL2SN.d.ts} +1 -1
  91. package/dist/{index-CGDmjlec.d.ts → index-Buxb8Onp.d.ts} +60 -60
  92. package/dist/{index-DhcjuwQq.d.ts → index-C5e2rZML.d.ts} +3 -3
  93. package/dist/{index-D05JGsT3.d.ts → index-C8wfe0Mr.d.ts} +1 -1
  94. package/dist/{index-DFLPv9io.d.ts → index-CP-fJFcJ.d.ts} +1 -1
  95. package/dist/{index-_5purQow.d.ts → index-CfHBwR3F.d.ts} +10 -8
  96. package/dist/{index-CM2L3SUw.d.ts → index-D1J81rYJ.d.ts} +15 -0
  97. package/dist/{index-CKtrcglY.d.ts → index-D1RIIzDd.d.ts} +6 -6
  98. package/dist/{index-DydQ5Ngj.d.ts → index-D7YRtteD.d.ts} +1 -1
  99. package/dist/{index-CBOv5j3c.d.ts → index-DDrL_-hJ.d.ts} +2 -2
  100. package/dist/{index-BmYnVNI-.d.ts → index-DE1genab.d.ts} +14 -2
  101. package/dist/{index-D-YoRrfP.d.ts → index-DKuoSloc.d.ts} +2 -44
  102. package/dist/{index-Cy1rEWC-.d.ts → index-DMcf0QeR.d.ts} +2 -2
  103. package/dist/{index-B3FE7s7V.d.ts → index-DPH5yoAr.d.ts} +4 -4
  104. package/dist/{index-Q1oG9yIT.d.ts → index-DPklTi3o.d.ts} +1 -1
  105. package/dist/{index-B44fLswd.d.ts → index-DYabo8TI.d.ts} +2 -2
  106. package/dist/{index-O9y23OPJ.d.ts → index-DneQgJfI.d.ts} +1 -1
  107. package/dist/{index-C1zwvxPH.d.ts → index-KcCNhdAw.d.ts} +2 -2
  108. package/dist/{index-utZGF4GR.d.ts → index-NOXYEdOI.d.ts} +1 -1
  109. package/dist/{index-lmd9LZKB.d.ts → index-PffxihMx.d.ts} +1 -1
  110. package/dist/{index-COgrQZIL.d.ts → index-YKCx03zD.d.ts} +2 -2
  111. package/dist/{index-mkbGYz8f.d.ts → index-YfMHAQ_D.d.ts} +9 -2
  112. package/dist/{index-CLHJybQY.d.ts → index-ul1hNxih.d.ts} +1 -1
  113. package/dist/{index-9tZJgo0R.d.ts → index-x0rjeitC.d.ts} +2 -2
  114. package/dist/index.d.ts +34 -33
  115. package/dist/index.js +15 -15
  116. package/dist/{loadCatalog-XbgoqaRp.js → loadCatalog-BtQRPyzj.js} +6 -2
  117. package/dist/{loadCatalog-CQEYXGuI.d.ts → loadCatalog-Kp7aQZpL.d.ts} +3 -0
  118. package/dist/locale/index.d.ts +2 -2
  119. package/dist/locale/index.js +4 -4
  120. package/dist/{locale-BwnZeppK.js → locale-DET_YkFW.js} +1 -1
  121. package/dist/selectorEscape-BppRdqpc.js +52 -0
  122. package/dist/{useAnchoredListbox-CuRfVgKl.js → stillPointerGate-Bh02Mfnw.js} +19 -1
  123. package/dist/{tokenizer-DSka5PJD.js → tokenizer-ChiAuPN-.js} +5 -1
  124. package/dist/{searchResultMessage-BEqDlHdV.js → triggerVariant-BDVvyLtv.js} +18 -18
  125. package/dist/{useCombobox-CTo5C-gc.js → useCombobox-D374_pT8.js} +32 -8
  126. package/dist/useInputStatusIcon-B6m_t8cK.d.ts +45 -0
  127. package/dist/{useOptionActionGrid-CkJcuvaU.js → useOptionActionGrid-C7ibYM_A.js} +15 -1
  128. package/dist/{TypeaheadMenu-BOzaCvSb.js → useTypeaheadAnnouncement-MbuZumTd.js} +75 -33
  129. package/package.json +1 -1
  130. package/styles/complex-selector.css +24 -1
  131. package/styles/multi-selector.css +10 -0
  132. package/styles/selector.css +10 -0
  133. package/styles/tokenizer.css +64 -0
  134. package/styles/typeahead.css +28 -0
  135. package/dist/triggerVariant-BsL8jMHs.js +0 -16
  136. package/dist/{index-J6YRJ7Ul.d.ts → index-BqhgeAT4.d.ts} +1 -1
@@ -7,7 +7,7 @@ import { n as isKeyboardModality, r as trackInteractionModality } from "./intera
7
7
  import { t as _sfc_main$4 } from "./ButtonTooltip-CNKOQHYR.js";
8
8
  import { t as useButtonTooltip } from "./useButtonTooltip-DjCaZMp_.js";
9
9
  import { t as useAnnounce } from "./announce-B210eJVf.js";
10
- import { t as useCombobox } from "./useCombobox-CTo5C-gc.js";
10
+ import { t as useCombobox } from "./useCombobox-D374_pT8.js";
11
11
  import { n as useDevWarning } from "./useDevWarning-B2fsk2B-.js";
12
12
  import { t as useDisclosureHandle } from "./useDisclosureHandle-Df3HhAfC.js";
13
13
  import { t as useFieldControlState } from "./useFieldControlState-voICDrys.js";
@@ -20,14 +20,14 @@ import { t as useIndicator } from "./useIndicator--9mGGlT2.js";
20
20
  import { t as _sfc_main$6 } from "./Field-CqDOsI3P.js";
21
21
  import { t as useFieldPartStyling } from "./fieldParts-CDOlBdy6.js";
22
22
  import { t as consumeWhileDisabled } from "./disabledInteraction-CPzL8kVP.js";
23
- import { n as fieldStatusPlacement, t as normalizeTriggerVariant } from "./triggerVariant-BsL8jMHs.js";
23
+ import { n as fieldStatusPlacement, r as _sfc_main$7, t as normalizeTriggerVariant } from "./triggerVariant-BDVvyLtv.js";
24
24
  import { t as multiSelectorMessages } from "./multi-selector-CpVI6bt5.js";
25
- import { t as _sfc_main$7 } from "./InputClearButton-CSS2Tjat.js";
26
- import { n as _sfc_main$8, t as searchResultMessage } from "./searchResultMessage-BEqDlHdV.js";
25
+ import { t as _sfc_main$8 } from "./InputClearButton-CSS2Tjat.js";
26
+ import { a as useBusyAnnouncement, t as bindListboxEscape } from "./selectorEscape-BppRdqpc.js";
27
27
  import { t as _sfc_main$9 } from "./Token-CtG_XE6z.js";
28
- import { n as useAnchoredListbox, t as scrollOptionIntoView } from "./useAnchoredListbox-CuRfVgKl.js";
29
- import { n as OptionAction, r as isOptionAction, t as useOptionActionGrid } from "./useOptionActionGrid-CkJcuvaU.js";
30
- import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onMounted, onScopeDispose, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
28
+ import { n as scrollOptionIntoView, r as useAnchoredListbox, t as createStillPointerGate } from "./stillPointerGate-Bh02Mfnw.js";
29
+ import { i as isOptionAction, n as searchResultMessage, r as OptionAction, t as useOptionActionGrid } from "./useOptionActionGrid-C7ibYM_A.js";
30
+ import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
31
31
  import "../styles/layer.css";
32
32
  import "../styles/button.css";
33
33
  import "../styles/visually-hidden-utility.css";
@@ -113,6 +113,7 @@ const _hoisted_2$1 = [
113
113
  "aria-label",
114
114
  "aria-controls",
115
115
  "aria-activedescendant",
116
+ "aria-required",
116
117
  "placeholder",
117
118
  "value"
118
119
  ];
@@ -182,6 +183,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
182
183
  __name: "MultiSelectorPanel",
183
184
  props: {
184
185
  searchable: { type: Boolean },
186
+ required: { type: Boolean },
185
187
  query: {},
186
188
  searchId: {},
187
189
  searchPlaceholder: {},
@@ -225,6 +227,11 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
225
227
  const props = __props;
226
228
  const emit = __emit;
227
229
  const searchRef = useTemplateRef("searchRef");
230
+ const pointerGate = createStillPointerGate();
231
+ /** 只有鼠标真的移动了才让行拿走高亮;键盘滚动让行从静止的鼠标下冒出来不算。 */
232
+ function onRowEnter(event, index) {
233
+ if (pointerGate.moved(event)) emit("highlight", index);
234
+ }
228
235
  const markSize = computed(() => props.size === "lg" ? "md" : "sm");
229
236
  __expose({
230
237
  focusSearch: () => searchRef.value?.focus(),
@@ -234,7 +241,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
234
241
  return option?.action;
235
242
  }
236
243
  return (_ctx, _cache) => {
237
- return openBlock(), createElementBlock("div", null, [
244
+ return openBlock(), createElementBlock("div", { onMousemove: _cache[21] || (_cache[21] = (...args) => unref(pointerGate).track && unref(pointerGate).track(...args)) }, [
238
245
  __props.searchable ? (openBlock(), createElementBlock("div", {
239
246
  key: 0,
240
247
  class: "astryx-multi-selector-search",
@@ -258,6 +265,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
258
265
  "aria-controls": __props.listboxId,
259
266
  "aria-autocomplete": "list",
260
267
  "aria-activedescendant": __props.activeDescendant,
268
+ "aria-required": __props.required || void 0,
261
269
  placeholder: __props.searchPlaceholder,
262
270
  value: __props.query,
263
271
  onInput: _cache[0] || (_cache[0] = ($event) => emit("query", $event)),
@@ -286,7 +294,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
286
294
  "data-option-id": String(__props.createOption.value),
287
295
  tabindex: "-1",
288
296
  onMousedown: _cache[5] || (_cache[5] = withModifiers(() => {}, ["prevent"])),
289
- onMouseenter: _cache[6] || (_cache[6] = ($event) => emit("highlight", 0)),
297
+ onMouseenter: _cache[6] || (_cache[6] = ($event) => onRowEnter($event, 0)),
290
298
  onClick: _cache[7] || (_cache[7] = ($event) => emit("toggle", __props.createOption.value))
291
299
  }, [createElementVNode("span", _hoisted_5$1, toDisplayString(__props.createOption.label), 1)], 42, _hoisted_4$1)) : __props.createOption ? (openBlock(), createElementBlock("div", {
292
300
  key: 2,
@@ -302,7 +310,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
302
310
  tabindex: "-1",
303
311
  "data-option-id": String(__props.createOption.value),
304
312
  onMousedown: _cache[8] || (_cache[8] = withModifiers(() => {}, ["prevent"])),
305
- onMouseenter: _cache[9] || (_cache[9] = ($event) => emit("highlight", 0)),
313
+ onMouseenter: _cache[9] || (_cache[9] = ($event) => onRowEnter($event, 0)),
306
314
  onClick: _cache[10] || (_cache[10] = ($event) => emit("toggle", __props.createOption.value))
307
315
  }, [createElementVNode("span", _hoisted_7$1, toDisplayString(__props.createOption.label), 1)], 40, _hoisted_6$1),
308
316
  createElementVNode("div", {
@@ -321,7 +329,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
321
329
  "data-option-id": unref(SELECT_ALL_VALUE),
322
330
  tabindex: "-1",
323
331
  onMousedown: _cache[11] || (_cache[11] = withModifiers(() => {}, ["prevent"])),
324
- onMouseenter: _cache[12] || (_cache[12] = ($event) => emit("highlight", __props.selectAllIndex)),
332
+ onMouseenter: _cache[12] || (_cache[12] = ($event) => onRowEnter($event, __props.selectAllIndex)),
325
333
  onClick: _cache[13] || (_cache[13] = ($event) => emit("toggle", unref("__astryx_select_all__")))
326
334
  }, [
327
335
  __props.checkboxPosition === "start" ? (openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
@@ -349,7 +357,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
349
357
  tabindex: "-1",
350
358
  "data-option-id": unref(SELECT_ALL_VALUE),
351
359
  onMousedown: _cache[14] || (_cache[14] = withModifiers(() => {}, ["prevent"])),
352
- onMouseenter: _cache[15] || (_cache[15] = ($event) => emit("highlight", __props.selectAllIndex)),
360
+ onMouseenter: _cache[15] || (_cache[15] = ($event) => onRowEnter($event, __props.selectAllIndex)),
353
361
  onClick: _cache[16] || (_cache[16] = ($event) => emit("toggle", unref("__astryx_select_all__")))
354
362
  }, [
355
363
  __props.checkboxPosition === "start" ? (openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
@@ -388,7 +396,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
388
396
  "data-option-id": String(row.option.value),
389
397
  tabindex: "-1",
390
398
  onMousedown: _cache[17] || (_cache[17] = withModifiers(() => {}, ["prevent"])),
391
- onMouseenter: ($event) => emit("highlight", __props.optionIndex(row.option.value)),
399
+ onMouseenter: ($event) => onRowEnter($event, __props.optionIndex(row.option.value)),
392
400
  onClick: ($event) => emit("toggle", row.option.value)
393
401
  }, [
394
402
  __props.checkboxPosition === "start" ? (openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
@@ -434,7 +442,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
434
442
  tabindex: "-1",
435
443
  "data-option-id": String(row.option.value),
436
444
  onMousedown: _cache[18] || (_cache[18] = withModifiers(() => {}, ["prevent"])),
437
- onMouseenter: ($event) => emit("highlight", __props.optionIndex(row.option.value)),
445
+ onMouseenter: ($event) => onRowEnter($event, __props.optionIndex(row.option.value)),
438
446
  onClick: ($event) => emit("toggle", row.option.value)
439
447
  }, [
440
448
  __props.checkboxPosition === "start" ? (openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
@@ -477,11 +485,41 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
477
485
  ], 10, _hoisted_23)) : createCommentVNode("v-if", true)], 64);
478
486
  }), 128)) : createCommentVNode("v-if", true),
479
487
  __props.showEmpty ? (openBlock(), createElementBlock("div", _hoisted_29, [!__props.query.trim() ? renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(__props.emptyText), 1)], void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(__props.emptySearchText), 1)], 64))])) : createCommentVNode("v-if", true)
480
- ]);
488
+ ], 32);
481
489
  };
482
490
  }
483
491
  });
484
492
  //#endregion
493
+ //#region src/MultiSelector/useMultiSelectorDisplay.ts
494
+ /** 触发器上已选项的展示:徽标折叠成 +N、逗号拼起来的文字、调用方自己格式化的文字。 */
495
+ function useMultiSelectorDisplay(host) {
496
+ const { props, selectedOptions, messages } = host;
497
+ const badgeCount = computed(() => selectedOptions.value.length);
498
+ const overflow = useOverflow(badgeCount, { gap: 4 });
499
+ const visibleBadgeCount = computed(() => Math.min(overflow.visibleCount.value, props.maxBadges ?? 3, badgeCount.value));
500
+ const hiddenBadgeCount = computed(() => Math.max(0, badgeCount.value - visibleBadgeCount.value));
501
+ return {
502
+ overflow,
503
+ visibleBadgeCount,
504
+ hiddenBadgeCount,
505
+ measureMoreLabel: computed(() => messages.value.multiSelector.more(Math.max(hiddenBadgeCount.value, 1))),
506
+ labelText: computed(() => {
507
+ const labels = selectedOptions.value.map((option) => option.label);
508
+ const shown = labels.slice(0, props.maxBadges);
509
+ const extra = labels.length - shown.length;
510
+ if (shown.length === 0) return "";
511
+ return extra > 0 ? `${shown.join(", ")} ${messages.value.multiSelector.more(extra)}` : shown.join(", ");
512
+ }),
513
+ formattedValue: computed(() => {
514
+ if (selectedOptions.value.length === 0 || props.formatValue == null || props.triggerDisplay === "badges") return void 0;
515
+ return props.formatValue(selectedOptions.value.map((option) => ({
516
+ value: option.value,
517
+ label: option.label
518
+ })));
519
+ })
520
+ };
521
+ }
522
+ //#endregion
485
523
  //#region src/MultiSelector/createOption.ts
486
524
  /** 创建行的值永远不是真实选项。选中它会走创建,而不是切换勾选。 */
487
525
  const CREATE_VALUE_PREFIX = "__astryx_multi_selector_create__";
@@ -833,6 +871,8 @@ const _hoisted_3 = [
833
871
  "aria-controls",
834
872
  "aria-autocomplete",
835
873
  "aria-activedescendant",
874
+ "aria-labelledby",
875
+ "aria-required",
836
876
  "aria-describedby"
837
877
  ];
838
878
  const _hoisted_4 = {
@@ -1029,6 +1069,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1029
1069
  const resolvedDisabledMessage = computed(() => props.disabledMessage?.trim() || props.disabledReason?.trim());
1030
1070
  const showsDisabledMessage = computed(() => control.isDisabled.value && !!resolvedDisabledMessage.value);
1031
1071
  const disabledTooltip = useButtonTooltip(showsDisabledMessage);
1072
+ const fieldLabelId = `${triggerId}-label`;
1032
1073
  const hasClear = computed(() => props.hasClear || props.clearable);
1033
1074
  const hasCustomTrigger = computed(() => slots.trigger != null);
1034
1075
  const customAnchor = shallowRef(null);
@@ -1069,6 +1110,11 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1069
1110
  listboxId
1070
1111
  });
1071
1112
  const { combobox, selectedValues, selectedOptions } = menu;
1113
+ useBusyAnnouncement(() => control.isLoading.value, () => messages.value.multiSelector.loading);
1114
+ /** 禁用的字段不向表单交值:不渲染隐藏输入,而不是渲染一个原生禁用的。 */
1115
+ /** 带搜索时触发器是普通按钮,搜索框才是组合框;ARIA 不允许按钮带 aria-required,必填交给搜索框。 */
1116
+ const hasSearchRole = computed(() => Boolean(props.searchable) && !control.isReadOnly.value);
1117
+ const hiddenCarrierValues = computed(() => control.isDisabled.value ? [] : selectedValues.value);
1072
1118
  trackInteractionModality();
1073
1119
  const searchKeyboardFocus = ref(false);
1074
1120
  const sheetSlot = useTemplateRef("sheetSlot");
@@ -1094,24 +1140,20 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1094
1140
  combobox.close();
1095
1141
  }
1096
1142
  });
1097
- const badgeCount = computed(() => selectedOptions.value.length);
1098
- const overflow = useOverflow(badgeCount, { gap: 4 });
1099
- const visibleBadgeCount = computed(() => Math.min(overflow.visibleCount.value, props.maxBadges, badgeCount.value));
1100
- const hiddenBadgeCount = computed(() => Math.max(0, badgeCount.value - visibleBadgeCount.value));
1101
- const measureMoreLabel = computed(() => messages.value.multiSelector.more(Math.max(hiddenBadgeCount.value, 1)));
1102
- const labelText = computed(() => {
1103
- const labels = selectedOptions.value.map((option) => option.label);
1104
- const shown = labels.slice(0, props.maxBadges);
1105
- const extra = labels.length - shown.length;
1106
- if (shown.length === 0) return "";
1107
- return extra > 0 ? `${shown.join(", ")} ${messages.value.multiSelector.more(extra)}` : shown.join(", ");
1143
+ const { overflow, visibleBadgeCount, hiddenBadgeCount, measureMoreLabel, labelText, formattedValue } = useMultiSelectorDisplay({
1144
+ props,
1145
+ selectedOptions,
1146
+ messages
1108
1147
  });
1109
- const formattedValue = computed(() => {
1110
- if (selectedOptions.value.length === 0 || props.formatValue == null || props.triggerDisplay === "badges") return void 0;
1111
- return props.formatValue(selectedOptions.value.map((option) => ({
1112
- value: option.value,
1113
- label: option.label
1114
- })));
1148
+ /** 调用方的 aria-labelledby 接在字段自己的标签后面(组内先是组标签),不取代它。 */
1149
+ const labelledBy = computed(() => {
1150
+ const external = attrs["aria-labelledby"];
1151
+ if (typeof external !== "string" || external === "") return void 0;
1152
+ return [
1153
+ inGroup.value ? inputGroup?.labelId.value : void 0,
1154
+ fieldLabelId,
1155
+ external
1156
+ ].filter(Boolean).join(" ");
1115
1157
  });
1116
1158
  const describedBy = computed(() => {
1117
1159
  return [
@@ -1142,20 +1184,28 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1142
1184
  if (!event.defaultPrevented) emit("keydown", event);
1143
1185
  }
1144
1186
  /** 选项和操作按钮上的 Escape 不会经过搜索框,在列表根上接住并回到触发器。 */
1145
- function onListboxEscape(event) {
1187
+ bindListboxEscape(listboxRef, (event) => {
1146
1188
  if (event.key !== "Escape" || event.defaultPrevented || event.isComposing) return;
1147
1189
  menu.onKeyDown(event);
1190
+ });
1191
+ /**
1192
+ * 自制控件在禁用、只读(含 InputGroup 带来的禁用)时仍可聚焦,但调用方绑在同一个
1193
+ * 元素上的点击和按键处理也不该运行:先到的这一份把事件整个拦下。
1194
+ */
1195
+ function onCustomTriggerClick(event) {
1196
+ if (!control.canActivate.value) event.stopImmediatePropagation();
1197
+ onTriggerClick(event);
1198
+ }
1199
+ function onCustomTriggerKeyDown(event) {
1200
+ if (!control.canActivate.value && event.key !== "Tab") event.stopImmediatePropagation();
1201
+ onTriggerKeyDown(event);
1148
1202
  }
1149
- watch(listboxRef, (el, prev) => {
1150
- prev?.removeEventListener("keydown", onListboxEscape);
1151
- el?.addEventListener("keydown", onListboxEscape);
1152
- }, { flush: "sync" });
1153
- onScopeDispose(() => listboxRef.value?.removeEventListener("keydown", onListboxEscape));
1154
1203
  const triggerProps = computed(() => ({
1155
1204
  "id": triggerId,
1156
- "onClick": onTriggerClick,
1157
- "onKeyDown": onTriggerKeyDown,
1205
+ "onClick": onCustomTriggerClick,
1206
+ "onKeyDown": onCustomTriggerKeyDown,
1158
1207
  "onFocus": onTriggerFocus,
1208
+ "aria-disabled": control.isDisabled.value ? "true" : void 0,
1159
1209
  "aria-haspopup": menu.popupKind.value,
1160
1210
  "aria-expanded": combobox.isOpen.value,
1161
1211
  "aria-controls": listboxId,
@@ -1196,6 +1246,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1196
1246
  style: normalizeStyle(unref(parts).containerStyle.value),
1197
1247
  label: props.label,
1198
1248
  "input-id": props.searchable && unref(combobox).isOpen.value ? searchId : triggerId,
1249
+ "label-id": fieldLabelId,
1199
1250
  "is-label-hidden": inGroup.value || props.isLabelHidden || props.labelHidden,
1200
1251
  "is-disabled": unref(control).isDisabled.value,
1201
1252
  "is-required": inGroup.value ? false : props.required,
@@ -1234,41 +1285,43 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1234
1285
  "aria-disabled": unref(control).isDisabled.value || void 0,
1235
1286
  "aria-readonly": unref(control).isReadOnly.value || void 0,
1236
1287
  "aria-busy": unref(control).isLoading.value || void 0,
1237
- role: props.searchable && !unref(control).isReadOnly.value ? void 0 : "combobox",
1288
+ role: hasSearchRole.value ? void 0 : "combobox",
1238
1289
  "aria-haspopup": unref(control).isReadOnly.value ? void 0 : unref(menu).popupKind.value,
1239
1290
  "aria-expanded": unref(control).isReadOnly.value ? false : unref(combobox).isOpen.value,
1240
1291
  "aria-controls": unref(control).isReadOnly.value ? void 0 : listboxId,
1241
1292
  "aria-autocomplete": props.searchable ? void 0 : "none",
1242
1293
  "aria-activedescendant": !props.searchable ? unref(menu).actionGrid.activeDescendant.value : void 0,
1294
+ "aria-labelledby": labelledBy.value,
1295
+ "aria-required": props.required && !hasSearchRole.value ? true : void 0,
1243
1296
  "aria-describedby": [describedBy.value, unref(control).isReadOnly.value ? readOnlyId : void 0].filter(Boolean).join(" ") || void 0,
1244
1297
  onClick: onTriggerClick,
1245
1298
  onFocus: onTriggerFocus,
1246
1299
  onBlur: _cache[0] || (_cache[0] = (...args) => unref(disabledTooltip).onBlur && unref(disabledTooltip).onBlur(...args)),
1247
1300
  onKeydown: onTriggerKeyDown
1248
- }), [unref(selectedOptions).length === 0 ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(placeholder.value), 1)) : props.triggerDisplay === "count" ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(formattedValue.value ?? unref(messages).multiSelector.selected(unref(selectedOptions).length)), 1)) : props.triggerDisplay === "labels" ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(formattedValue.value ?? labelText.value), 1)) : (openBlock(), createElementBlock("span", {
1301
+ }), [unref(selectedOptions).length === 0 ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(placeholder.value), 1)) : props.triggerDisplay === "count" ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(unref(formattedValue) ?? unref(messages).multiSelector.selected(unref(selectedOptions).length)), 1)) : props.triggerDisplay === "labels" ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(unref(formattedValue) ?? unref(labelText)), 1)) : (openBlock(), createElementBlock("span", {
1249
1302
  key: 3,
1250
1303
  ref: unref(overflow).containerRef,
1251
1304
  class: "astryx-multi-selector-badges"
1252
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(selectedOptions).slice(0, visibleBadgeCount.value), (option) => {
1305
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(selectedOptions).slice(0, unref(visibleBadgeCount)), (option) => {
1253
1306
  return openBlock(), createBlock(_sfc_main$9, {
1254
1307
  key: option.value,
1255
1308
  label: option.label,
1256
1309
  size: unref(size) === "lg" ? "md" : "sm"
1257
1310
  }, null, 8, ["label", "size"]);
1258
- }), 128)), hiddenBadgeCount.value > 0 ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(unref(messages).multiSelector.more(hiddenBadgeCount.value)), 1)) : createCommentVNode("v-if", true)], 512))], 16, _hoisted_3),
1311
+ }), 128)), unref(hiddenBadgeCount) > 0 ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(unref(messages).multiSelector.more(unref(hiddenBadgeCount))), 1)) : createCommentVNode("v-if", true)], 512))], 16, _hoisted_3),
1259
1312
  unref(control).isLoading.value ? (openBlock(), createBlock(_sfc_main$5, {
1260
1313
  key: 1,
1261
1314
  class: "astryx-multi-selector-spinner",
1262
1315
  size: "sm",
1263
- "aria-label": unref(messages).multiSelector.loading
1264
- }, null, 8, ["aria-label"])) : createCommentVNode("v-if", true),
1265
- hasClear.value && unref(selectedValues).length > 0 && unref(control).canActivate.value ? (openBlock(), createBlock(_sfc_main$7, {
1316
+ "aria-hidden": "true"
1317
+ })) : createCommentVNode("v-if", true),
1318
+ hasClear.value && unref(selectedValues).length > 0 && unref(control).canActivate.value ? (openBlock(), createBlock(_sfc_main$8, {
1266
1319
  key: 2,
1267
1320
  class: "astryx-multi-selector-clear",
1268
1321
  label: unref(messages).multiSelector.clearAll(props.label),
1269
1322
  onClick: _cache[1] || (_cache[1] = withModifiers(($event) => unref(menu).commit([]), ["stop"]))
1270
1323
  }, null, 8, ["label"])) : createCommentVNode("v-if", true),
1271
- statusGlyph.value ? (openBlock(), createBlock(_sfc_main$8, {
1324
+ statusGlyph.value ? (openBlock(), createBlock(_sfc_main$7, {
1272
1325
  key: 3,
1273
1326
  type: statusGlyph.value,
1274
1327
  message: fieldStatus.value?.message,
@@ -1299,13 +1352,13 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1299
1352
  label: option.label,
1300
1353
  size: unref(size) === "lg" ? "md" : "sm"
1301
1354
  }, null, 8, ["label", "size"]);
1302
- }), 128)), createElementVNode("span", _hoisted_8, toDisplayString(measureMoreLabel.value), 1)], 512)) : createCommentVNode("v-if", true),
1355
+ }), 128)), createElementVNode("span", _hoisted_8, toDisplayString(unref(measureMoreLabel)), 1)], 512)) : createCommentVNode("v-if", true),
1303
1356
  showsDisabledMessage.value ? (openBlock(), createElementBlock("span", {
1304
1357
  key: 7,
1305
1358
  id: disabledId,
1306
1359
  class: "astryx-visually-hidden"
1307
1360
  }, toDisplayString(resolvedDisabledMessage.value), 1)) : createCommentVNode("v-if", true),
1308
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(selectedValues), (value) => {
1361
+ (openBlock(true), createElementBlock(Fragment, null, renderList(hiddenCarrierValues.value, (value) => {
1309
1362
  return openBlock(), createElementBlock("input", {
1310
1363
  key: value,
1311
1364
  type: "hidden",
@@ -1360,6 +1413,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1360
1413
  ref_key: "panelRef",
1361
1414
  ref: panelRef,
1362
1415
  searchable: Boolean(props.searchable),
1416
+ required: props.required,
1363
1417
  query: unref(menu).query.value,
1364
1418
  "search-id": searchId,
1365
1419
  "search-placeholder": unref(menu).searchPlaceholder.value,
@@ -1406,6 +1460,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1406
1460
  key: "1"
1407
1461
  } : void 0]), 1032, [
1408
1462
  "searchable",
1463
+ "required",
1409
1464
  "query",
1410
1465
  "search-placeholder",
1411
1466
  "clear-label",
@@ -1,3 +1,3 @@
1
1
  import { a as NavItemSize, i as NavItemProps, n as NavIconSlots, o as NavItemSlots, r as NavItemEmits, s as NavLinkComponent, t as NavIconProps } from "../types-BG23kC3S.js";
2
- import { n as _default, r as resolveNavRoot, t as _default$1 } from "../index-C1zwvxPH.js";
2
+ import { n as _default, r as resolveNavRoot, t as _default$1 } from "../index-KcCNhdAw.js";
3
3
  export { _default as NavIcon, type NavIconProps, type NavIconSlots, _default$1 as NavItem, type NavItemEmits, type NavItemProps, type NavItemSize, type NavItemSlots, type NavLinkComponent, resolveNavRoot };
@@ -1,2 +1,2 @@
1
- import { $r as NumberInputEmits, Qr as _default, ei as NumberInputProps, ti as NumberInputStatus } from "../index-CGDmjlec.js";
1
+ import { $r as NumberInputEmits, Qr as _default, ei as NumberInputProps, ti as NumberInputStatus } from "../index-Buxb8Onp.js";
2
2
  export { _default as NumberInput, type NumberInputEmits, type NumberInputProps, type NumberInputStatus };
@@ -1,2 +1,2 @@
1
- import { Jr as OverflowListCollapsedItem, Xr as OverflowListItem, Yr as OverflowListEmits, Zr as OverflowListProps, qr as _default } from "../index-CGDmjlec.js";
1
+ import { Jr as OverflowListCollapsedItem, Xr as OverflowListItem, Yr as OverflowListEmits, Zr as OverflowListProps, qr as _default } from "../index-Buxb8Onp.js";
2
2
  export { _default as OverflowList, type OverflowListCollapsedItem, type OverflowListEmits, type OverflowListItem, type OverflowListProps };
@@ -1,2 +1,2 @@
1
- import { a as OverlayContainerProps, c as OverlayScrimMode, d as OverlayShowOn, f as OverlaySlots, i as OverlayAlign, l as OverlayScrimProps, m as UseOverlayResult, n as _default$1, o as OverlayPosition, p as UseOverlayOptions, r as _default, s as OverlayProps, t as useOverlay, u as OverlayScrimSlots } from "../index-BuubzuE8.js";
1
+ import { a as OverlayContainerProps, c as OverlayScrimMode, d as OverlayShowOn, f as OverlaySlots, i as OverlayAlign, l as OverlayScrimProps, m as UseOverlayResult, n as _default$1, o as OverlayPosition, p as UseOverlayOptions, r as _default, s as OverlayProps, t as useOverlay, u as OverlayScrimSlots } from "../index-BDZCJ9ri.js";
2
2
  export { _default as Overlay, type OverlayAlign, type OverlayContainerProps, type OverlayPosition, type OverlayProps, _default$1 as OverlayScrim, type OverlayScrimMode, type OverlayScrimProps, type OverlayScrimSlots, type OverlayShowOn, type OverlaySlots, type UseOverlayOptions, type UseOverlayResult, useOverlay };
@@ -1,2 +1,2 @@
1
- import { a as PaginationSlots, i as PaginationSize, n as PaginationEmits, o as PaginationVariant, r as PaginationProps, t as _default } from "../index-Cy1rEWC-.js";
1
+ import { a as PaginationSlots, i as PaginationSize, n as PaginationEmits, o as PaginationVariant, r as PaginationProps, t as _default } from "../index-DMcf0QeR.js";
2
2
  export { _default as Pagination, type PaginationEmits, type PaginationProps, type PaginationSize, type PaginationSlots, type PaginationVariant };
@@ -1,2 +1,2 @@
1
- import { t as _sfc_main } from "../Pagination-uttop2ls.js";
1
+ import { t as _sfc_main } from "../Pagination-eeM9SNsG.js";
2
2
  export { _sfc_main as Pagination };
@@ -3,7 +3,7 @@ import { t as useListFocus } from "./useListFocus-CbHkLT-X.js";
3
3
  import { t as usePendingChange } from "./usePendingChange-ib-h8FZK.js";
4
4
  import { t as consumeWhileDisabled } from "./disabledInteraction-CPzL8kVP.js";
5
5
  import { t as paginationMessages } from "./pagination-CxZBYsPu.js";
6
- import { t as _sfc_main$1 } from "./Selector-OpczmkqS.js";
6
+ import { t as _sfc_main$1 } from "./Selector-DP012yul.js";
7
7
  import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, toValue, unref, vShow, watch, withDirectives, withKeys } from "vue";
8
8
  import "../styles/pagination.css";
9
9
  /**
@@ -1,3 +1,3 @@
1
1
  import { a as PopoverRole, i as PopoverProps, n as PopoverPadding, r as PopoverPlacement, t as PopoverAlignment } from "../types-OGMYGejX.js";
2
- import { i as _default, n as UsePopoverReturn, r as usePopover, t as UsePopoverOptions } from "../index-lmd9LZKB.js";
2
+ import { i as _default, n as UsePopoverReturn, r as usePopover, t as UsePopoverOptions } from "../index-PffxihMx.js";
3
3
  export { _default as Popover, type PopoverAlignment, type PopoverPadding, type PopoverPlacement, type PopoverProps, type PopoverRole, type UsePopoverOptions, type UsePopoverReturn, usePopover };
@@ -1,2 +1,2 @@
1
- import { A as PowerSearchItem, C as PowerSearchEmits, D as PowerSearchFieldType, E as PowerSearchFieldDefinition, F as PowerSearchSlots, I as PowerSearchStatus, M as PowerSearchOverflow, N as PowerSearchProps, O as PowerSearchFilter, P as PowerSearchSize, S as PowerSearchConfig, T as PowerSearchField, _ as FilterValue, a as usePowerSearchConfig, b as PowerSearchChangeType, c as resolveOperatorLabel, d as formatFilterValue, f as completePowerSearchFilter, g as DateTimeRangePart, h as DateTimeRange, i as createPowerSearchConfig, j as PowerSearchOperator, k as PowerSearchHandle, l as formatDateAbsolute, m as createPowerSearchLookup, n as InferPowerSearchData, o as _default, p as PowerSearchLookup, r as applyPowerSearchFilters, s as resolveEditorPlacement, t as searchPowerSearchFields, u as formatDateAbsoluteCompact, v as OperatorValue, w as PowerSearchEntity, x as PowerSearchComponents, y as PartialFilter } from "../index-B3FE7s7V.js";
1
+ import { A as PowerSearchItem, C as PowerSearchEmits, D as PowerSearchFieldType, E as PowerSearchFieldDefinition, F as PowerSearchSlots, I as PowerSearchStatus, M as PowerSearchOverflow, N as PowerSearchProps, O as PowerSearchFilter, P as PowerSearchSize, S as PowerSearchConfig, T as PowerSearchField, _ as FilterValue, a as usePowerSearchConfig, b as PowerSearchChangeType, c as resolveOperatorLabel, d as formatFilterValue, f as completePowerSearchFilter, g as DateTimeRangePart, h as DateTimeRange, i as createPowerSearchConfig, j as PowerSearchOperator, k as PowerSearchHandle, l as formatDateAbsolute, m as createPowerSearchLookup, n as InferPowerSearchData, o as _default, p as PowerSearchLookup, r as applyPowerSearchFilters, s as resolveEditorPlacement, t as searchPowerSearchFields, u as formatDateAbsoluteCompact, v as OperatorValue, w as PowerSearchEntity, x as PowerSearchComponents, y as PartialFilter } from "../index-DPH5yoAr.js";
2
2
  export { type DateTimeRange, type DateTimeRangePart, type FilterValue, type InferPowerSearchData, type OperatorValue, type PartialFilter, _default as PowerSearch, type PowerSearchChangeType, type PowerSearchComponents, type PowerSearchConfig, type PowerSearchEmits, type PowerSearchEntity, type PowerSearchField, type PowerSearchFieldDefinition, type PowerSearchFieldType, type PowerSearchFilter, type PowerSearchHandle, type PowerSearchItem, type PowerSearchLookup, type PowerSearchOperator, type PowerSearchOverflow, type PowerSearchProps, type PowerSearchSize, type PowerSearchSlots, type PowerSearchStatus, applyPowerSearchFilters, completePowerSearchFilter, createPowerSearchConfig, createPowerSearchLookup, formatDateAbsolute, formatDateAbsoluteCompact, formatFilterValue, resolveEditorPlacement, resolveOperatorLabel, searchPowerSearchFields, usePowerSearchConfig };
@@ -1,2 +1,2 @@
1
- import { a as searchPowerSearchFields, c as formatDateAbsolute, d as createPowerSearchLookup, f as completePowerSearchFilter, i as _sfc_main, l as formatDateAbsoluteCompact, n as createPowerSearchConfig, o as resolveEditorPlacement, r as usePowerSearchConfig, s as resolveOperatorLabel, t as applyPowerSearchFilters, u as formatFilterValue } from "../PowerSearch-DDuYfvNh.js";
1
+ import { a as searchPowerSearchFields, c as formatDateAbsolute, d as createPowerSearchLookup, f as completePowerSearchFilter, i as _sfc_main, l as formatDateAbsoluteCompact, n as createPowerSearchConfig, o as resolveEditorPlacement, r as usePowerSearchConfig, s as resolveOperatorLabel, t as applyPowerSearchFilters, u as formatFilterValue } from "../PowerSearch-CaqFxaFb.js";
2
2
  export { _sfc_main as PowerSearch, applyPowerSearchFilters, completePowerSearchFilter, createPowerSearchConfig, createPowerSearchLookup, formatDateAbsolute, formatDateAbsoluteCompact, formatFilterValue, resolveEditorPlacement, resolveOperatorLabel, searchPowerSearchFields, usePowerSearchConfig };
@@ -14,19 +14,19 @@ import { t as useScrollbars } from "./useScrollbars-Ch0xqJWO.js";
14
14
  import { t as _sfc_main$8 } from "./Field-CqDOsI3P.js";
15
15
  import { t as useFieldPartStyling } from "./fieldParts-CDOlBdy6.js";
16
16
  import { t as _sfc_main$9 } from "./DateInput-DgPIsWPu.js";
17
- import { l as powerSearchMessages } from "./loadCatalog-XbgoqaRp.js";
17
+ import { l as powerSearchMessages } from "./loadCatalog-BtQRPyzj.js";
18
18
  import { t as _sfc_main$10 } from "./DateRangeInput-oOfhUt1Q.js";
19
19
  import { t as _sfc_main$11 } from "./DateTimeInput-DZfghF2h.js";
20
20
  import { n as tokenNamingKey, t as _sfc_main$12 } from "./Token-CtG_XE6z.js";
21
- import { n as useAnchoredListbox, t as scrollOptionIntoView } from "./useAnchoredListbox-CuRfVgKl.js";
22
- import { t as _sfc_main$13 } from "./MultiSelector-BdedjB6u.js";
21
+ import { n as scrollOptionIntoView, r as useAnchoredListbox } from "./stillPointerGate-Bh02Mfnw.js";
22
+ import { t as _sfc_main$13 } from "./MultiSelector-BXIpOmSU.js";
23
23
  import { n as resolveNumberInputCommit, t as _sfc_main$14 } from "./NumberInput-0KbcEF3_.js";
24
- import { t as _sfc_main$15 } from "./Selector-OpczmkqS.js";
25
- import { i as useTypeaheadMenu } from "./TypeaheadMenu-BOzaCvSb.js";
26
- import { n as useTokenRemoveTap, t as _sfc_main$16 } from "./Tokenizer-BNazaZsP.js";
24
+ import { t as _sfc_main$15 } from "./Selector-DP012yul.js";
25
+ import { a as useTypeaheadMenu } from "./useTypeaheadAnnouncement-MbuZumTd.js";
26
+ import { n as useTokenRemoveTap, t as _sfc_main$16 } from "./Tokenizer-CY0ymjYr.js";
27
27
  import { t as _sfc_main$17 } from "./TextInput-kUzxl99M.js";
28
28
  import { t as _sfc_main$18 } from "./TimeInput-C_jTijHh.js";
29
- import { t as _sfc_main$19 } from "./Typeahead-BgQVQw-0.js";
29
+ import { t as _sfc_main$19 } from "./Typeahead-ByeXwX8E.js";
30
30
  import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
31
31
  import "../styles/layer.css";
32
32
  import "../styles/visually-hidden-utility.css";
@@ -1,2 +1,2 @@
1
- import { a as ProgressBarVariant, i as ProgressBarSize, n as ProgressBarMark, r as ProgressBarProps, t as _default } from "../index-COgrQZIL.js";
1
+ import { a as ProgressBarVariant, i as ProgressBarSize, n as ProgressBarMark, r as ProgressBarProps, t as _default } from "../index-YKCx03zD.js";
2
2
  export { _default as ProgressBar, type ProgressBarMark, type ProgressBarProps, type ProgressBarSize, type ProgressBarVariant };
@@ -1,2 +1,2 @@
1
- import { Br as RadioOrientation, Fr as RadioGroupEmits, Gr as RadioStatusType, Hr as RadioSize, Ir as RadioGroupProps, Kr as RadioValue, Lr as RadioGroupSlots, Mr as _default$1, Nr as _default, Pr as RadioChangeEvent, Ur as RadioSlots, Vr as RadioProps, Wr as RadioStatus, zr as RadioOption } from "../index-CGDmjlec.js";
1
+ import { Br as RadioOrientation, Fr as RadioGroupEmits, Gr as RadioStatusType, Hr as RadioSize, Ir as RadioGroupProps, Kr as RadioValue, Lr as RadioGroupSlots, Mr as _default$1, Nr as _default, Pr as RadioChangeEvent, Ur as RadioSlots, Vr as RadioProps, Wr as RadioStatus, zr as RadioOption } from "../index-Buxb8Onp.js";
2
2
  export { _default as Radio, type RadioChangeEvent, _default$1 as RadioGroup, type RadioGroupEmits, type RadioGroupProps, type RadioGroupSlots, type RadioOption, type RadioOrientation, type RadioProps, type RadioSize, type RadioSlots, type RadioStatus, type RadioStatusType, type RadioValue };
@@ -1,2 +1,2 @@
1
- import { Ar as RadioListItemProps, Rr as RadioListProps, jr as _default, kr as _default$1 } from "../index-CGDmjlec.js";
1
+ import { Ar as RadioListItemProps, Rr as RadioListProps, jr as _default, kr as _default$1 } from "../index-Buxb8Onp.js";
2
2
  export { _default as RadioList, _default$1 as RadioListItem, type RadioListItemProps, type RadioListProps };
@@ -1,2 +1,2 @@
1
- import { Dr as ScrollableAreaProps, Er as _default, Or as ScrollableAreaSlots } from "../index-CGDmjlec.js";
1
+ import { Dr as ScrollableAreaProps, Er as _default, Or as ScrollableAreaSlots } from "../index-Buxb8Onp.js";
2
2
  export { _default as ScrollableArea, type ScrollableAreaProps, type ScrollableAreaSlots };
@@ -1,2 +1,2 @@
1
- import { Cr as SelectableCardEmits, Sr as _default, Tr as SelectableCardSlots, wr as SelectableCardProps } from "../index-CGDmjlec.js";
1
+ import { Cr as SelectableCardEmits, Sr as _default, Tr as SelectableCardSlots, wr as SelectableCardProps } from "../index-Buxb8Onp.js";
2
2
  export { _default as SelectableCard, _default as default, type SelectableCardEmits, type SelectableCardProps, type SelectableCardSlots };
@@ -1,2 +1,2 @@
1
- import { a as SelectorOption, c as SelectorProps, d as SelectorSlots, f as SelectorStatus, h as SelectorVariant, i as SelectorIndicatorPosition, l as SelectorSection, m as SelectorStatusVariant, n as SelectorEmits, o as SelectorOptionInput, p as SelectorStatusInput, r as SelectorEntry, s as SelectorPresentation, t as _default, u as SelectorSize } from "../index-CKtrcglY.js";
1
+ import { a as SelectorOption, c as SelectorProps, d as SelectorSlots, f as SelectorStatus, h as SelectorVariant, i as SelectorIndicatorPosition, l as SelectorSection, m as SelectorStatusVariant, n as SelectorEmits, o as SelectorOptionInput, p as SelectorStatusInput, r as SelectorEntry, s as SelectorPresentation, t as _default, u as SelectorSize } from "../index-D1RIIzDd.js";
2
2
  export { _default as Selector, type SelectorEmits, type SelectorEntry, type SelectorIndicatorPosition, type SelectorOption, type SelectorOptionInput, type SelectorPresentation, type SelectorProps, type SelectorSection, type SelectorSize, type SelectorSlots, type SelectorStatus, type SelectorStatusInput, type SelectorStatusVariant, type SelectorVariant };
@@ -1,2 +1,2 @@
1
- import { t as _sfc_main } from "../Selector-OpczmkqS.js";
1
+ import { t as _sfc_main } from "../Selector-DP012yul.js";
2
2
  export { _sfc_main as Selector };
@@ -8,9 +8,8 @@ import { t as _sfc_main$4 } from "./VisuallyHidden-cpmsV-0M.js";
8
8
  import { t as _sfc_main$5 } from "./ButtonTooltip-CNKOQHYR.js";
9
9
  import { t as useButtonTooltip } from "./useButtonTooltip-DjCaZMp_.js";
10
10
  import { t as useAnnounce } from "./announce-B210eJVf.js";
11
- import { t as useCombobox } from "./useCombobox-CTo5C-gc.js";
11
+ import { t as useCombobox } from "./useCombobox-D374_pT8.js";
12
12
  import { t as useFieldControlState } from "./useFieldControlState-voICDrys.js";
13
- import { n as focusElement } from "./focus-l8jVTcqd.js";
14
13
  import { o as useComponentMessages } from "./context-B8IEFCDR.js";
15
14
  import { t as useScrollbars } from "./useScrollbars-Ch0xqJWO.js";
16
15
  import { n as clampInlineSize } from "./inlineSize-BNe8wggI.js";
@@ -19,50 +18,15 @@ import { t as useIndicator } from "./useIndicator--9mGGlT2.js";
19
18
  import { t as _sfc_main$7 } from "./Field-CqDOsI3P.js";
20
19
  import { t as useFieldPartStyling } from "./fieldParts-CDOlBdy6.js";
21
20
  import { t as consumeWhileDisabled } from "./disabledInteraction-CPzL8kVP.js";
22
- import { n as fieldStatusPlacement, t as normalizeTriggerVariant } from "./triggerVariant-BsL8jMHs.js";
21
+ import { n as fieldStatusPlacement, r as _sfc_main$8, t as normalizeTriggerVariant } from "./triggerVariant-BDVvyLtv.js";
23
22
  import { t as selectorMessages } from "./selector-BmGLjm94.js";
24
- import { n as _sfc_main$8, t as searchResultMessage } from "./searchResultMessage-BEqDlHdV.js";
25
- import { n as OptionAction, r as isOptionAction, t as useOptionActionGrid } from "./useOptionActionGrid-CkJcuvaU.js";
26
- import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, isVNode, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onMounted, onScopeDispose, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, vShow, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
23
+ import { a as useBusyAnnouncement, i as onSelectorListboxEscape, n as dismissSelectorEscape, r as focusSelectorTrigger, t as bindListboxEscape } from "./selectorEscape-BppRdqpc.js";
24
+ import { i as isOptionAction, n as searchResultMessage, r as OptionAction, t as useOptionActionGrid } from "./useOptionActionGrid-C7ibYM_A.js";
25
+ import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, isVNode, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, vShow, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
27
26
  import "../styles/layer.css";
28
27
  import "../styles/button.css";
29
28
  import "../styles/visually-hidden-utility.css";
30
29
  import "../styles/selector.css";
31
- //#region src/Selector/selectorEscape.ts
32
- /** 弹出层关掉后,焦点回到触发按钮,而不是掉到 body。 */
33
- function focusSelectorTrigger(field) {
34
- const trigger = field?.querySelector(".astryx-selector-trigger");
35
- if (trigger) nextTick(() => focusElement(trigger));
36
- }
37
- function focusInside(layer) {
38
- const active = document.activeElement;
39
- return layer != null && active instanceof Node && layer.contains(active);
40
- }
41
- /**
42
- * 搜索框已经处理过的 Escape 会带 preventDefault,这里接选项和操作按钮。
43
- * 焦点在弹出层里才送回触发器,免得抢走外面已经拿到焦点的控件。
44
- */
45
- function onSelectorListboxEscape(event, options) {
46
- if (event.key !== "Escape" || event.defaultPrevented || isImeKeyEvent(event) || !options.isOpen) return;
47
- if (!focusInside(options.layer)) return;
48
- event.preventDefault();
49
- options.close();
50
- options.focusTrigger();
51
- }
52
- /** 文档级 Escape。焦点还在层里才送回触发器,点外面关掉时不动焦点。 */
53
- function dismissSelectorEscape(layer, close, focusTrigger) {
54
- const inside = focusInside(layer);
55
- close();
56
- if (inside) focusTrigger();
57
- }
58
- function bindListboxEscape(layer, onKeyDown) {
59
- watch(layer, (el, prev) => {
60
- prev?.removeEventListener("keydown", onKeyDown);
61
- el?.addEventListener("keydown", onKeyDown);
62
- }, { flush: "sync" });
63
- onScopeDispose(() => layer.value?.removeEventListener("keydown", onKeyDown));
64
- }
65
- //#endregion
66
30
  //#region src/Selector/SelectorIcon.ts
67
31
  /**
68
32
  * 同上游 renderIconSlot:图标名、组件、渲染函数套进 sm 尺寸的 Icon 盒子;
@@ -709,6 +673,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
709
673
  loading: () => props.isLoading
710
674
  });
711
675
  const announce = useAnnounce();
676
+ useBusyAnnouncement(() => control.isLoading.value, () => messages.value.selector.loading);
712
677
  const readOnlyId = computed(() => `${selectorId.value}-readonly`);
713
678
  const disabledMessageId = computed(() => `${selectorId.value}-disabled-message`);
714
679
  const disabledTooltipId = computed(() => `${selectorId.value}-disabled-tooltip`);
@@ -966,8 +931,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
966
931
  key: 1,
967
932
  class: "astryx-selector-spinner",
968
933
  size: "sm",
969
- "aria-label": unref(messages).selector.loading
970
- }, null, 8, ["aria-label"])) : createCommentVNode("v-if", true),
934
+ "aria-hidden": "true"
935
+ })) : createCommentVNode("v-if", true),
971
936
  hasClear.value && selectedOption.value && unref(control).canActivate.value ? (openBlock(), createElementBlock("button", {
972
937
  key: 2,
973
938
  type: "button",
@@ -1,2 +1,2 @@
1
- import { _r as SideNavProps, ar as _default$1, br as SideNavCollapseContext, cr as SideNavCollapseButtonSize, dr as SideNavControlledCollapsible, fr as SideNavEmits, gr as SideNavItemProps, hr as SideNavItemEmits, ir as _default$2, lr as SideNavCollapseButtonSlots, mr as SideNavHeadingProps, nr as _default$4, or as _default, pr as SideNavHandle, rr as _default$3, sr as SideNavCollapseButtonProps, ur as SideNavCollapsible, vr as SideNavResizable, xr as useSideNavCollapse, yr as SideNavSectionProps } from "../index-CGDmjlec.js";
1
+ import { _r as SideNavProps, ar as _default$1, br as SideNavCollapseContext, cr as SideNavCollapseButtonSize, dr as SideNavControlledCollapsible, fr as SideNavEmits, gr as SideNavItemProps, hr as SideNavItemEmits, ir as _default$2, lr as SideNavCollapseButtonSlots, mr as SideNavHeadingProps, nr as _default$4, or as _default, pr as SideNavHandle, rr as _default$3, sr as SideNavCollapseButtonProps, ur as SideNavCollapsible, vr as SideNavResizable, xr as useSideNavCollapse, yr as SideNavSectionProps } from "../index-Buxb8Onp.js";
2
2
  export { _default as SideNav, _default$1 as SideNavCollapseButton, type SideNavCollapseButtonProps, type SideNavCollapseButtonSize, type SideNavCollapseButtonSlots, type SideNavCollapseContext, type SideNavCollapsible, type SideNavControlledCollapsible, type SideNavEmits, type SideNavHandle, _default$2 as SideNavHeading, type SideNavHeadingProps, _default$3 as SideNavItem, type SideNavItemEmits, type SideNavItemProps, type SideNavProps, type SideNavResizable, _default$4 as SideNavSection, type SideNavSectionProps, useSideNavCollapse };
@@ -1,2 +1,2 @@
1
- import { a as StepProps, c as StepperCollapsedVariant, d as StepperIndicatorPosition, f as StepperOrientation, i as StepProgress, l as StepperDensity, m as StepperSlots, n as _default, o as StepSlots, p as StepperProps, r as StepIndicator, s as StepStatus, t as _default$1, u as StepperHorizontalOptions } from "../index-Q1oG9yIT.js";
1
+ import { a as StepProps, c as StepperCollapsedVariant, d as StepperIndicatorPosition, f as StepperOrientation, i as StepProgress, l as StepperDensity, m as StepperSlots, n as _default, o as StepSlots, p as StepperProps, r as StepIndicator, s as StepStatus, t as _default$1, u as StepperHorizontalOptions } from "../index-DPklTi3o.js";
2
2
  export { _default as Step, type StepIndicator, type StepProgress, type StepProps, type StepSlots, type StepStatus, _default$1 as Stepper, type StepperCollapsedVariant, type StepperDensity, type StepperHorizontalOptions, type StepperIndicatorPosition, type StepperOrientation, type StepperProps, type StepperSlots };
@@ -1,2 +1,2 @@
1
- import { $n as SwitchSlots, Gn as _default, Jn as SwitchEmits, Kn as SwitchChangeAction, Qn as SwitchSize, Xn as SwitchLabelSpacing, Yn as SwitchLabelPosition, Zn as SwitchProps, er as SwitchStatus, qn as SwitchChangeEvent, tr as SwitchStatusType } from "../index-CGDmjlec.js";
1
+ import { $n as SwitchSlots, Gn as _default, Jn as SwitchEmits, Kn as SwitchChangeAction, Qn as SwitchSize, Xn as SwitchLabelSpacing, Yn as SwitchLabelPosition, Zn as SwitchProps, er as SwitchStatus, qn as SwitchChangeEvent, tr as SwitchStatusType } from "../index-Buxb8Onp.js";
2
2
  export { _default as Switch, type SwitchChangeAction, type SwitchChangeEvent, type SwitchEmits, type SwitchLabelPosition, type SwitchLabelSpacing, type SwitchProps, type SwitchSize, type SwitchSlots, type SwitchStatus, type SwitchStatusType };
@@ -1,2 +1,2 @@
1
- import { a as TabListLayout, c as TabListSize, d as TabMenuProps, f as TabProps, i as TabListEdgeCompensation, l as TabListTab, n as _default$1, o as TabListOverflow, p as TabSlots, r as _default, s as TabListProps, t as _default$2, u as TabMenuOption } from "../index-DhcjuwQq.js";
1
+ import { a as TabListLayout, c as TabListSize, d as TabMenuProps, f as TabProps, i as TabListEdgeCompensation, l as TabListTab, n as _default$1, o as TabListOverflow, p as TabSlots, r as _default, s as TabListProps, t as _default$2, u as TabMenuOption } from "../index-C5e2rZML.js";
2
2
  export { _default as Tab, _default$1 as TabList, type TabListEdgeCompensation, type TabListLayout, type TabListOverflow, type TabListProps, type TabListSize, type TabListTab, _default$2 as TabMenu, type TabMenuOption, type TabMenuProps, type TabProps, type TabSlots };