@sdata/web-vue 3.12.0 → 3.14.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 (287) hide show
  1. package/dist/sd.css +288 -126
  2. package/dist/sd.min.css +43 -1
  3. package/es/_components/input-label/input-label.d.ts +2 -0
  4. package/es/_components/input-label/input-label.js +4 -2
  5. package/es/_components/input-label/style/index.css +2 -2
  6. package/es/_components/picker/input-range.vue.d.ts +6 -7
  7. package/es/_components/picker/input-range.vue_vue_type_script_setup_true_lang.js +63 -46
  8. package/es/_components/picker/input.vue.d.ts +5 -6
  9. package/es/_components/picker/input.vue_vue_type_script_setup_true_lang.js +52 -35
  10. package/es/_components/picker/style/index.scss +8 -2
  11. package/es/_components/resize-observer.js +1 -1
  12. package/es/_components/resize-trigger.vue_vue_type_script_setup_true_lang.js +9 -2
  13. package/es/_components/select-view/select-view.d.ts +2 -0
  14. package/es/_components/select-view/select-view.js +5 -1
  15. package/es/_components/select-view/style/index.css +5 -5
  16. package/es/_hooks/use-focus-trap.d.ts +10 -0
  17. package/es/_hooks/use-focus-trap.js +115 -0
  18. package/es/_hooks/use-readonly-tip.d.ts +11 -0
  19. package/es/_hooks/use-readonly-tip.js +66 -0
  20. package/es/_utils/dom.js +1 -10
  21. package/es/_utils/keyboard.d.ts +4 -0
  22. package/es/_utils/keyboard.js +21 -2
  23. package/es/alert/alert.vue.d.ts +2 -2
  24. package/es/alert/alert.vue_vue_type_script_setup_true_lang.js +12 -3
  25. package/es/alert/index.d.ts +5 -5
  26. package/es/alert/style/index.css +1 -1
  27. package/es/alert/style/index.scss +1 -1
  28. package/es/anchor/anchor-link.vue_vue_type_script_setup_true_lang.js +3 -1
  29. package/es/anchor/anchor.vue_vue_type_script_setup_true_lang.js +2 -0
  30. package/es/anchor/style/index.css +1 -1
  31. package/es/anchor/style/index.scss +3 -1
  32. package/es/auto-complete/auto-complete.d.ts +9 -0
  33. package/es/auto-complete/auto-complete.js +19 -1
  34. package/es/auto-complete/index.d.ts +15 -0
  35. package/es/avatar/avatar.vue_vue_type_script_setup_true_lang.js +8 -2
  36. package/es/avatar/style/index.css +2 -2
  37. package/es/avatar/style/index.scss +2 -2
  38. package/es/back-top/back-top.vue_vue_type_script_setup_true_lang.js +5 -1
  39. package/es/back-top/style/index.css +1 -1
  40. package/es/back-top/style/index.scss +2 -1
  41. package/es/badge/badge.js +4 -1
  42. package/es/badge/style/index.css +3 -3
  43. package/es/badge/style/index.scss +3 -3
  44. package/es/breadcrumb/breadcrumb.js +1 -0
  45. package/es/button/button.vue.d.ts +16 -7
  46. package/es/button/button.vue_vue_type_script_setup_true_lang.js +62 -31
  47. package/es/button/index.d.ts +11 -0
  48. package/es/button/interface.d.ts +2 -0
  49. package/es/button/style/index.css +15 -6
  50. package/es/button/style/index.scss +25 -7
  51. package/es/calendar/style/event.scss +2 -2
  52. package/es/calendar/style/index.css +2 -2
  53. package/es/card/card.d.ts +312 -0
  54. package/es/card/card.js +39 -7
  55. package/es/card/index.d.ts +616 -0
  56. package/es/card/style/index.css +26 -3
  57. package/es/card/style/index.scss +34 -3
  58. package/es/carousel/carousel-arrow.vue.d.ts +4 -4
  59. package/es/carousel/carousel-arrow.vue_vue_type_script_setup_true_lang.js +20 -4
  60. package/es/carousel/carousel-indicator.vue_vue_type_script_setup_true_lang.js +23 -4
  61. package/es/carousel/carousel-item.vue_vue_type_script_setup_true_lang.js +8 -1
  62. package/es/carousel/carousel.js +18 -1
  63. package/es/carousel/style/index.css +1 -1
  64. package/es/carousel/style/index.scss +1 -1
  65. package/es/cascader/cascader.vue.d.ts +9 -8
  66. package/es/cascader/cascader.vue_vue_type_script_setup_true_lang.js +158 -128
  67. package/es/cascader/style/index.css +2 -2
  68. package/es/cascader/style/index.scss +3 -1
  69. package/es/cascader/types.d.ts +1 -0
  70. package/es/checkbox/checkbox-group.js +4 -1
  71. package/es/checkbox/checkbox.d.ts +9 -0
  72. package/es/checkbox/checkbox.js +14 -0
  73. package/es/checkbox/index.d.ts +15 -0
  74. package/es/checkbox/style/index.css +1 -1
  75. package/es/checkbox/style/index.scss +1 -1
  76. package/es/collapse/collapse-item.js +21 -3
  77. package/es/collapse/context.d.ts +1 -1
  78. package/es/color-picker/color-picker.d.ts +9 -0
  79. package/es/color-picker/color-picker.js +39 -11
  80. package/es/color-picker/index.d.ts +15 -0
  81. package/es/config-provider/context.d.ts +9 -9
  82. package/es/copy/copy.vue_vue_type_script_setup_true_lang.js +11 -3
  83. package/es/date-picker/index.d.ts +3 -6
  84. package/es/date-picker/panels/body.vue_vue_type_script_setup_true_lang.js +14 -1
  85. package/es/date-picker/picker.vue.d.ts +2 -3
  86. package/es/date-picker/picker.vue_vue_type_script_setup_true_lang.js +6 -5
  87. package/es/date-picker/range-picker.vue.d.ts +2 -3
  88. package/es/date-picker/range-picker.vue_vue_type_script_setup_true_lang.js +4 -4
  89. package/es/date-picker/style/index.css +5 -5
  90. package/es/date-picker/style/index.scss +4 -3
  91. package/es/drawer/drawer.vue.d.ts +1 -1
  92. package/es/drawer/drawer.vue_vue_type_script_setup_true_lang.js +30 -9
  93. package/es/drawer/index.d.ts +3 -3
  94. package/es/dropdown/dropdown-option.vue_vue_type_script_setup_true_lang.js +5 -1
  95. package/es/dropdown/dropdown-panel.vue.d.ts +9 -0
  96. package/es/dropdown/dropdown-panel.vue_vue_type_script_setup_true_lang.js +75 -2
  97. package/es/dropdown/dropdown-submenu.vue_vue_type_script_setup_true_lang.js +5 -2
  98. package/es/dropdown/dropdown.vue_vue_type_script_setup_true_lang.js +4 -2
  99. package/es/dropdown/style/index.css +1 -1
  100. package/es/dropdown/style/index.scss +3 -1
  101. package/es/empty/empty.js +1 -1
  102. package/es/file-previewer/file-previewer.vue.d.ts +1 -1
  103. package/es/file-previewer/file-previewer.vue_vue_type_script_setup_true_lang.js +7 -3
  104. package/es/file-previewer/index.d.ts +3 -3
  105. package/es/form/context.d.ts +1 -0
  106. package/es/form/form-item.vue_vue_type_script_setup_true_lang.js +6 -2
  107. package/es/form/style/index.css +2 -2
  108. package/es/form/style/index.scss +2 -2
  109. package/es/image/image.vue_vue_type_script_setup_true_lang.js +1 -1
  110. package/es/image/preview-action.d.ts +7 -127
  111. package/es/image/preview.vue.d.ts +1 -1
  112. package/es/image/preview.vue_vue_type_script_setup_true_lang.js +3 -3
  113. package/es/index.css +288 -126
  114. package/es/index.js +3 -3
  115. package/es/input/index.d.ts +6 -6
  116. package/es/input/input.d.ts +3 -3
  117. package/es/input/input.js +34 -8
  118. package/es/input/style/index.css +2 -2
  119. package/es/input/style/input.scss +4 -4
  120. package/es/input-number/index.d.ts +9 -9
  121. package/es/input-number/input-number.d.ts +5 -5
  122. package/es/input-number/input-number.js +13 -9
  123. package/es/input-number/style/index.css +3 -3
  124. package/es/input-number/style/index.scss +5 -1
  125. package/es/input-tag/index.d.ts +9 -6
  126. package/es/input-tag/input-tag.d.ts +5 -3
  127. package/es/input-tag/input-tag.js +49 -36
  128. package/es/input-tag/style/index.css +8 -8
  129. package/es/input-tag/style/index.scss +11 -5
  130. package/es/layout/sider.vue_vue_type_script_setup_true_lang.js +31 -6
  131. package/es/layout/style/index.css +2 -2
  132. package/es/layout/style/index.scss +4 -2
  133. package/es/link/style/index.css +1 -1
  134. package/es/link/style/index.scss +3 -1
  135. package/es/locale/interface.d.ts +1 -0
  136. package/es/locale/lang/en-us.js +1 -0
  137. package/es/locale/lang/zh-cn.js +1 -0
  138. package/es/locale/lang/zh-tw.js +1 -0
  139. package/es/mention/index.d.ts +15 -0
  140. package/es/mention/mention.d.ts +9 -0
  141. package/es/mention/mention.js +20 -1
  142. package/es/menu/base-menu.vue_vue_type_script_setup_true_lang.js +30 -4
  143. package/es/menu/item.js +14 -1
  144. package/es/menu/style/index.css +6 -6
  145. package/es/menu/style/index.scss +5 -3
  146. package/es/message/style/index.css +3 -3
  147. package/es/message/style/index.scss +5 -3
  148. package/es/modal/index.d.ts +3 -3
  149. package/es/modal/modal.vue.d.ts +1 -1
  150. package/es/modal/modal.vue_vue_type_script_setup_true_lang.js +30 -15
  151. package/es/modal/style/index.css +2 -2
  152. package/es/modal/style/index.scss +3 -2
  153. package/es/notification/style/index.css +3 -3
  154. package/es/notification/style/index.scss +11 -3
  155. package/es/page-header/page-header.vue.d.ts +6 -6
  156. package/es/page-header/page-header.vue_vue_type_script_setup_true_lang.js +12 -1
  157. package/es/pagination/page-item-ellipsis.vue_vue_type_script_setup_true_lang.js +12 -2
  158. package/es/pagination/page-item-step.vue.d.ts +2 -2
  159. package/es/pagination/page-item-step.vue_vue_type_script_setup_true_lang.js +19 -2
  160. package/es/pagination/page-item.vue.d.ts +2 -2
  161. package/es/pagination/page-item.vue_vue_type_script_setup_true_lang.js +21 -3
  162. package/es/pagination/pagination.js +6 -2
  163. package/es/pagination/style/index.css +6 -1
  164. package/es/pagination/style/index.scss +9 -3
  165. package/es/popconfirm/popconfirm.vue_vue_type_script_setup_true_lang.js +4 -2
  166. package/es/popover/popover.vue_vue_type_script_setup_true_lang.js +3 -1
  167. package/es/progress/style/index.css +2 -2
  168. package/es/progress/style/index.scss +5 -3
  169. package/es/qr-code/qr-code-status.vue_vue_type_script_setup_true_lang.js +5 -1
  170. package/es/qr-code/qr-code.vue_vue_type_script_setup_true_lang.js +11 -6
  171. package/es/radio/context.d.ts +1 -0
  172. package/es/radio/radio-group.js +6 -2
  173. package/es/radio/radio.js +1 -0
  174. package/es/radio/style/index.css +2 -2
  175. package/es/radio/style/index.scss +4 -2
  176. package/es/rate/index.d.ts +6 -6
  177. package/es/rate/rate.d.ts +3 -3
  178. package/es/rate/rate.js +42 -8
  179. package/es/resize-box/resize-box.vue.d.ts +4 -4
  180. package/es/resize-box/resize-box.vue_vue_type_script_setup_true_lang.js +30 -1
  181. package/es/result/result.vue_vue_type_script_setup_true_lang.js +7 -4
  182. package/es/scrollbar/style/index.css +57 -15
  183. package/es/scrollbar/style/index.scss +63 -15
  184. package/es/sd-vue.js +3 -3
  185. package/es/secret/secret.vue_vue_type_script_setup_true_lang.js +1 -1
  186. package/es/select/index.d.ts +139 -0
  187. package/es/select/select-dropdown.vue_vue_type_script_setup_true_lang.js +4 -1
  188. package/es/select/select.d.ts +71 -0
  189. package/es/select/select.js +45 -6
  190. package/es/select/style/index.css +1 -1
  191. package/es/select/style/index.scss +3 -1
  192. package/es/selectable-card/style/index.css +2 -2
  193. package/es/selectable-card/style/index.scss +5 -5
  194. package/es/skeleton/skeleton.vue_vue_type_script_setup_true_lang.js +5 -1
  195. package/es/slider/slider-button.vue.d.ts +2 -0
  196. package/es/slider/slider-button.vue_vue_type_script_setup_true_lang.js +7 -2
  197. package/es/slider/slider.vue_vue_type_script_setup_true_lang.js +23 -2
  198. package/es/slider/style/index.css +1 -1
  199. package/es/slider/style/index.scss +3 -1
  200. package/es/spin/spin.js +7 -2
  201. package/es/spin/style/index.css +1 -1
  202. package/es/spin/style/index.scss +1 -1
  203. package/es/split/split.vue.d.ts +4 -4
  204. package/es/split/split.vue_vue_type_script_setup_true_lang.js +27 -3
  205. package/es/steps/context.d.ts +1 -0
  206. package/es/steps/step.vue_vue_type_script_setup_true_lang.js +15 -2
  207. package/es/steps/steps.vue_vue_type_script_setup_true_lang.js +6 -1
  208. package/es/steps/style/index.css +1 -1
  209. package/es/steps/style/index.scss +1 -1
  210. package/es/style/animation/index.scss +1 -0
  211. package/es/style/animation/reduced-motion.scss +22 -0
  212. package/es/style/animation/zoom.scss +7 -6
  213. package/es/style/icon.scss +9 -1
  214. package/es/style/normalize.scss +68 -0
  215. package/es/switch/style/index.css +1 -1
  216. package/es/switch/style/index.scss +4 -1
  217. package/es/switch/switch.vue_vue_type_script_setup_true_lang.js +6 -1
  218. package/es/table/style/index.css +8 -8
  219. package/es/table/style/index.scss +11 -8
  220. package/es/table/table-operation-td.d.ts +15 -0
  221. package/es/table/table-tbody.js +4 -1
  222. package/es/table/table-td.js +2 -1
  223. package/es/table/table-th.js +6 -4
  224. package/es/table/table-thead.js +4 -1
  225. package/es/table/table-tr.js +4 -1
  226. package/es/table/table.js +6 -2
  227. package/es/tabs/context.d.ts +3 -0
  228. package/es/tabs/index.d.ts +32 -0
  229. package/es/tabs/style/index.css +34 -5
  230. package/es/tabs/style/index.scss +45 -7
  231. package/es/tabs/tab-pane.vue.d.ts +4 -2
  232. package/es/tabs/tab-pane.vue_vue_type_script_setup_true_lang.js +39 -4
  233. package/es/tabs/tabs-nav.js +34 -1
  234. package/es/tabs/tabs-tab.vue_vue_type_script_setup_true_lang.js +27 -4
  235. package/es/tabs/tabs.d.ts +19 -0
  236. package/es/tabs/tabs.js +25 -2
  237. package/es/tag/index.d.ts +5 -5
  238. package/es/tag/style/index.css +1 -1
  239. package/es/tag/style/index.scss +3 -1
  240. package/es/tag/tag.vue.d.ts +2 -2
  241. package/es/tag/tag.vue_vue_type_script_setup_true_lang.js +19 -2
  242. package/es/textarea/index.d.ts +15 -0
  243. package/es/textarea/style/index.css +2 -2
  244. package/es/textarea/textarea.vue.d.ts +11 -2
  245. package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +84 -47
  246. package/es/time-picker/index.d.ts +3 -6
  247. package/es/time-picker/panel.vue_vue_type_script_setup_true_lang.js +1 -1
  248. package/es/time-picker/time-column.vue_vue_type_script_setup_true_lang.js +11 -3
  249. package/es/time-picker/time-picker.vue.d.ts +2 -3
  250. package/es/time-picker/time-picker.vue_vue_type_script_setup_true_lang.js +12 -6
  251. package/es/toolbar/toolbar.vue_vue_type_script_setup_true_lang.js +1 -1
  252. package/es/tooltip/index.d.ts +8 -127
  253. package/es/tooltip/interface.d.ts +17 -0
  254. package/es/tooltip/tooltip.vue.d.ts +5 -88
  255. package/es/tooltip/tooltip.vue_vue_type_script_setup_true_lang.js +9 -69
  256. package/es/tour/tour.vue_vue_type_script_setup_true_lang.js +1 -1
  257. package/es/transfer/style/index.css +1 -1
  258. package/es/transfer/style/index.scss +1 -1
  259. package/es/transfer/transfer-list-item.js +16 -2
  260. package/es/tree/base-node.vue_vue_type_script_setup_true_lang.js +27 -7
  261. package/es/tree/context.d.ts +2 -0
  262. package/es/tree/style/index.css +1 -1
  263. package/es/tree/style/index.scss +1 -1
  264. package/es/tree/tree.vue_vue_type_script_setup_true_lang.js +82 -3
  265. package/es/tree-select/tree-select.vue.d.ts +16 -10
  266. package/es/tree-select/tree-select.vue_vue_type_script_setup_true_lang.js +165 -133
  267. package/es/trigger/index.d.ts +45 -0
  268. package/es/trigger/trigger.d.ts +27 -0
  269. package/es/trigger/trigger.js +47 -5
  270. package/es/typography/base.js +1 -1
  271. package/es/typography/edit-content.vue_vue_type_script_setup_true_lang.js +11 -8
  272. package/es/typography/operations.vue_vue_type_script_setup_true_lang.js +38 -6
  273. package/es/typography/style/index.css +2 -2
  274. package/es/typography/style/index.scss +2 -2
  275. package/es/upload/style/index.css +9 -9
  276. package/es/upload/style/index.scss +15 -9
  277. package/es/upload/upload-button.js +1 -1
  278. package/es/upload/upload-list-item.js +18 -5
  279. package/es/upload/upload-picture-item.js +25 -3
  280. package/es/verification-code/index.d.ts +15 -6
  281. package/es/verification-code/verification-code.d.ts +9 -3
  282. package/es/verification-code/verification-code.js +10 -2
  283. package/json/vetur-attributes.json +63 -7
  284. package/json/vetur-tags.json +23 -7
  285. package/json/web-types.json +131 -10
  286. package/package.json +1 -1
  287. package/es/style/base.scss +0 -18
@@ -7,15 +7,17 @@ import icon_hover_default from "../_components/icon-hover.js";
7
7
  import IconClose from "../icon/icon-close/index.js";
8
8
  import { useAllowClear } from "../_hooks/use-allow-clear.js";
9
9
  import feedback_icon_default from "../_components/feedback-icon.js";
10
+ import { isReadonlyModificationKey, useReadonlyTip, useReadonlyTipText } from "../_hooks/use-readonly-tip.js";
10
11
  import { useSize } from "../_hooks/use-size.js";
11
12
  import { INPUT_EVENTS } from "../_utils/constant.js";
12
13
  import { Backspace, Enter } from "../_utils/keycode.js";
13
14
  import { omit } from "../_utils/omit.js";
14
15
  import pick from "../_utils/pick.js";
16
+ import Tooltip from "../tooltip/index.js";
15
17
  import Ellipsis from "../ellipsis/index.js";
16
18
  import Tag from "../tag/index.js";
17
19
  import { getValueData } from "./utils.js";
18
- import { TransitionGroup, computed, createVNode, defineComponent, isVNode, mergeProps, nextTick, onMounted, reactive, ref, toRefs, watch } from "vue";
20
+ import { TransitionGroup, computed, createVNode, defineComponent, isVNode, mergeProps, nextTick, onMounted, reactive, ref, toRef, toRefs, watch } from "vue";
19
21
  //#region components/input-tag/input-tag.tsx
20
22
  function _isSlot(s) {
21
23
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
@@ -84,7 +86,7 @@ var input_tag_default = /* @__PURE__ */ defineComponent({
84
86
  * @en Whether it is read-only mode
85
87
  */
86
88
  readonly: {
87
- type: Boolean,
89
+ type: [Boolean, String],
88
90
  default: false
89
91
  },
90
92
  /**
@@ -150,7 +152,8 @@ var input_tag_default = /* @__PURE__ */ defineComponent({
150
152
  baseCls: String,
151
153
  focused: Boolean,
152
154
  disabledInput: Boolean,
153
- uninjectFormItemContext: Boolean
155
+ uninjectFormItemContext: Boolean,
156
+ inputAttrs: Object
154
157
  },
155
158
  emits: {
156
159
  "update:modelValue": (_value) => true,
@@ -233,6 +236,8 @@ var input_tag_default = /* @__PURE__ */ defineComponent({
233
236
  });
234
237
  const { mergedSize } = useSize(_mergedSize);
235
238
  const { mergedAllowClear } = useAllowClear(allowClear);
239
+ const { tipVisible, show: showReadonlyTip } = useReadonlyTip(toRef(props, "readonly"), mergedDisabled);
240
+ const readonlyTipText = useReadonlyTipText(toRef(props, "readonly"));
236
241
  const mergedFieldNames = computed(() => _objectSpread2(_objectSpread2({}, DEFAULT_FIELD_NAMES), props.fieldNames));
237
242
  const _focused = ref(false);
238
243
  const _value = ref(props.defaultValue);
@@ -443,6 +448,7 @@ var input_tag_default = /* @__PURE__ */ defineComponent({
443
448
  return -1;
444
449
  };
445
450
  const handleKeyDown = (e) => {
451
+ if (props.readonly && !mergedDisabled.value && isReadonlyModificationKey(e)) showReadonlyTip();
446
452
  if (mergedDisabled.value || props.readonly) return;
447
453
  const keyCode = e.key || e.code;
448
454
  if (!isComposition.value && computedInputValue.value && keyCode === Enter.key) handlePressEnter(e);
@@ -515,9 +521,13 @@ var input_tag_default = /* @__PURE__ */ defineComponent({
515
521
  });
516
522
  });
517
523
  const isCompressedResponsiveTag = (index, value) => isResponsiveMaxTagCount.value && !isOverflowCounterTag(value) && hiddenTagCount.value > 0 && index === 0 && responsiveTagMaxWidth.value > 0;
518
- const render = () => {
524
+ const render = () => createVNode(Tooltip, {
525
+ "popupVisible": tipVisible.value,
526
+ "content": readonlyTipText.value,
527
+ "position": "top"
528
+ }, { default: () => {
519
529
  var _slots$suffix;
520
- return createVNode("span", mergeProps({
530
+ return [createVNode("span", mergeProps({
521
531
  "ref": wrapperRef,
522
532
  "class": cls.value,
523
533
  "onMousedown": handleMousedown
@@ -558,42 +568,45 @@ var input_tag_default = /* @__PURE__ */ defineComponent({
558
568
  }, { class: [`${prefixCls}-inner`, {
559
569
  [`${prefixCls}-inner-responsive`]: isResponsiveMaxTagCount.value,
560
570
  [`${prefixCls}-nowrap`]: props.tagNowrap
561
- }] }), { default: () => [tags.value.map((item, index) => {
562
- let _slot;
563
- return createVNode(Tag, mergeProps({
564
- "key": `tag-${item.value}`,
565
- "class": [`${prefixCls}-tag`, {
566
- [`${prefixCls}-tag-counter`]: isOverflowCounterTag(item.value),
567
- [`${prefixCls}-tag-overflow`]: isCompressedResponsiveTag(index, item.value)
568
- }],
569
- "closable": isClosableTag(item),
570
- "visible": true,
571
- "nowrap": props.tagNowrap || isResponsiveMaxTagCount.value,
572
- "style": getTagStyle(index)
573
- }, item.tagProps, { "onClose": (ev) => handleRemove(item.value, index, ev) }), _isSlot(_slot = renderTagContent(item, index)) ? _slot : { default: () => [_slot] });
574
- }), createVNode("input", mergeProps(inputAttrs.value, {
575
- "ref": inputRef,
576
- "key": "input-tag-input",
577
- "class": `${prefixCls}-input`,
578
- "style": getInputStyle.value,
579
- "placeholder": valueData.value.length === 0 ? props.placeholder : void 0,
580
- "disabled": mergedDisabled.value,
581
- "readonly": props.readonly || props.disabledInput,
582
- "onInput": handleInput,
583
- "onKeydown": handleKeyDown,
584
- "onFocus": handleFocus,
585
- "onBlur": handleBlur,
586
- "onCompositionstart": handleComposition,
587
- "onCompositionupdate": handleComposition,
588
- "onCompositionend": handleComposition
589
- }), null)] }),
571
+ }] }), { default: () => {
572
+ var _props$inputAttrs;
573
+ return [tags.value.map((item, index) => {
574
+ let _slot;
575
+ return createVNode(Tag, mergeProps({
576
+ "key": `tag-${item.value}`,
577
+ "class": [`${prefixCls}-tag`, {
578
+ [`${prefixCls}-tag-counter`]: isOverflowCounterTag(item.value),
579
+ [`${prefixCls}-tag-overflow`]: isCompressedResponsiveTag(index, item.value)
580
+ }],
581
+ "closable": isClosableTag(item),
582
+ "visible": true,
583
+ "nowrap": props.tagNowrap || isResponsiveMaxTagCount.value,
584
+ "style": getTagStyle(index)
585
+ }, item.tagProps, { "onClose": (ev) => handleRemove(item.value, index, ev) }), _isSlot(_slot = renderTagContent(item, index)) ? _slot : { default: () => [_slot] });
586
+ }), createVNode("input", mergeProps(inputAttrs.value, (_props$inputAttrs = props.inputAttrs) !== null && _props$inputAttrs !== void 0 ? _props$inputAttrs : {}, {
587
+ "ref": inputRef,
588
+ "key": "input-tag-input",
589
+ "class": `${prefixCls}-input`,
590
+ "style": getInputStyle.value,
591
+ "placeholder": valueData.value.length === 0 ? props.placeholder : void 0,
592
+ "disabled": mergedDisabled.value,
593
+ "readonly": !!(props.readonly || props.disabledInput),
594
+ "onInput": handleInput,
595
+ "onKeydown": handleKeyDown,
596
+ "onFocus": handleFocus,
597
+ "onBlur": handleBlur,
598
+ "onCompositionstart": handleComposition,
599
+ "onCompositionupdate": handleComposition,
600
+ "onCompositionend": handleComposition
601
+ }), null)];
602
+ } }),
590
603
  showClearBtn.value && createVNode(icon_hover_default, mergeProps({ "class": `${prefixCls}-clear-btn` }, {
591
604
  onClick: handleClear,
592
605
  onMousedown: (e) => e.stopPropagation()
593
606
  }), { default: () => [createVNode(IconClose, null, null)] }),
594
607
  (slots.suffix || Boolean(feedback.value)) && createVNode("span", { "class": `${prefixCls}-suffix` }, [(_slots$suffix = slots.suffix) === null || _slots$suffix === void 0 ? void 0 : _slots$suffix.call(slots), Boolean(feedback.value) && createVNode(feedback_icon_default, { "type": feedback.value }, null)])
595
- ]);
596
- };
608
+ ])];
609
+ } });
597
610
  return {
598
611
  inputRef,
599
612
  render
@@ -44,7 +44,7 @@
44
44
  }
45
45
  .sd-tag-checkable {
46
46
  cursor: pointer;
47
- transition: all 0.1s cubic-bezier(0, 0, 1, 1);
47
+ transition: background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), border-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
48
48
  }
49
49
  .sd-tag-checkable:hover {
50
50
  background-color: var(--sd-color-fill-2);
@@ -489,7 +489,7 @@
489
489
  border: 1px solid transparent;
490
490
  border-radius: var(--sd-border-radius-small);
491
491
  cursor: text;
492
- transition: color 0.1s cubic-bezier(0, 0, 1, 1), border-color 0.1s cubic-bezier(0, 0, 1, 1), background-color 0.1s cubic-bezier(0, 0, 1, 1);
492
+ transition: color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), border-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
493
493
  }
494
494
  .sd-input-tag:hover {
495
495
  background-color: var(--sd-color-fill-3);
@@ -574,7 +574,7 @@
574
574
  }
575
575
  .sd-input-tag .sd-input-tag-clear-btn > svg {
576
576
  position: relative;
577
- transition: color 0.1s cubic-bezier(0, 0, 1, 1);
577
+ transition: color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
578
578
  }
579
579
  .sd-input-tag:hover .sd-input-tag-clear-btn {
580
580
  visibility: visible;
@@ -808,7 +808,7 @@
808
808
  }
809
809
 
810
810
  .input-tag-zoom-enter-from {
811
- transform: scale(0.5, 0.5);
811
+ transform: scale(0.94, 0.94);
812
812
  opacity: 0;
813
813
  }
814
814
 
@@ -818,7 +818,7 @@
818
818
  }
819
819
 
820
820
  .input-tag-zoom-enter-active {
821
- transition: all 0.3s cubic-bezier(0.34, 0.69, 0.1, 1);
821
+ transition: transform 0.3s cubic-bezier(0.34, 0.69, 0.1, 1), opacity 0.3s cubic-bezier(0.34, 0.69, 0.1, 1);
822
822
  }
823
823
 
824
824
  .input-tag-zoom-leave-from {
@@ -827,15 +827,15 @@
827
827
  }
828
828
 
829
829
  .input-tag-zoom-leave-to {
830
- transform: scale(0.5, 0.5);
830
+ transform: scale(0.94, 0.94);
831
831
  opacity: 0;
832
832
  }
833
833
 
834
834
  .input-tag-zoom-leave-active {
835
835
  position: absolute;
836
- transition: all 0.3s cubic-bezier(0.3, 1.3, 0.3, 1);
836
+ transition: transform 0.3s cubic-bezier(0.34, 0.69, 0.1, 1), opacity 0.3s cubic-bezier(0.34, 0.69, 0.1, 1);
837
837
  }
838
838
 
839
839
  .input-tag-zoom-move {
840
- transition: all 0.3s cubic-bezier(0.3, 1.3, 0.3, 1);
840
+ transition: transform 0.3s cubic-bezier(0.3, 1.3, 0.3, 1);
841
841
  }
@@ -8,8 +8,9 @@ $input-tag-prefix-cls: string.unquote('#{theme.$prefix}-input-tag');
8
8
  @include input-tag-style($input-tag-prefix-cls);
9
9
  }
10
10
 
11
+ // 标签入场/退场:从 scale(0.94) 起步而非 scale(0.5),轻微弹出即可
11
12
  .input-tag-zoom-enter-from {
12
- transform: scale(0.5, 0.5);
13
+ transform: scale(0.94, 0.94);
13
14
  opacity: 0;
14
15
  }
15
16
 
@@ -19,7 +20,9 @@ $input-tag-prefix-cls: string.unquote('#{theme.$prefix}-input-tag');
19
20
  }
20
21
 
21
22
  .input-tag-zoom-enter-active {
22
- transition: all theme.$transition-duration-3 theme.$transition-timing-function-standard;
23
+ transition:
24
+ transform theme.$transition-duration-3 theme.$transition-timing-function-standard,
25
+ opacity theme.$transition-duration-3 theme.$transition-timing-function-standard;
23
26
  }
24
27
 
25
28
  .input-tag-zoom-leave-from {
@@ -28,15 +31,18 @@ $input-tag-prefix-cls: string.unquote('#{theme.$prefix}-input-tag');
28
31
  }
29
32
 
30
33
  .input-tag-zoom-leave-to {
31
- transform: scale(0.5, 0.5);
34
+ transform: scale(0.94, 0.94);
32
35
  opacity: 0;
33
36
  }
34
37
 
35
38
  .input-tag-zoom-leave-active {
36
39
  position: absolute;
37
- transition: all theme.$transition-duration-3 theme.$transition-timing-function-overshoot;
40
+ transition:
41
+ transform theme.$transition-duration-3 theme.$transition-timing-function-standard,
42
+ opacity theme.$transition-duration-3 theme.$transition-timing-function-standard;
38
43
  }
39
44
 
45
+ // 列表重排(FLIP)只过渡 transform
40
46
  .input-tag-zoom-move {
41
- transition: all theme.$transition-duration-3 theme.$transition-timing-function-overshoot;
47
+ transition: transform theme.$transition-duration-3 theme.$transition-timing-function-overshoot;
42
48
  }
@@ -1,6 +1,7 @@
1
1
  import { configProviderInjectionKey } from "../config-provider/context.js";
2
2
  import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
3
3
  import { getPrefixCls } from "../_utils/global-config.js";
4
+ import { isActivationKey } from "../_utils/keyboard.js";
4
5
  import { useScrollbar } from "../_hooks/use-scrollbar.js";
5
6
  import Scrollbar from "../scrollbar/index.js";
6
7
  import IconRight from "../icon/icon-right/index.js";
@@ -11,6 +12,9 @@ import { LayoutContextInjectionKey, SiderContextInjectionKey } from "./context.j
11
12
  import IconMenu from "../icon/icon-menu/index.js";
12
13
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, inject, mergeProps, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, provide, reactive, ref, renderSlot, resolveDynamicComponent, toRef, unref, watch, withCtx } from "vue";
13
14
  //#region components/layout/sider.vue?vue&type=script&setup=true&lang.ts
15
+ var _hoisted_1 = ["aria-expanded"];
16
+ var _hoisted_2 = ["aria-expanded"];
17
+ var _hoisted_3 = ["aria-expanded"];
14
18
  var sider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "LayoutSider" }), {}, {
15
19
  __name: "sider",
16
20
  props: {
@@ -182,6 +186,12 @@ var sider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
182
186
  const toggle = () => {
183
187
  handleSetCollapsed(!mergedCollapsed.value, "clickTrigger");
184
188
  };
189
+ const handleTriggerKeydown = (ev) => {
190
+ if (isActivationKey(ev)) {
191
+ ev.preventDefault();
192
+ toggle();
193
+ }
194
+ };
185
195
  const below = ref(false);
186
196
  const setupResponsive = () => {
187
197
  const { breakpoint } = props;
@@ -369,8 +379,13 @@ var sider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
369
379
  }, 16, ["visible"]), renderTrigger.value ? (openBlock(), createElementBlock("span", {
370
380
  key: 0,
371
381
  class: normalizeClass(`${unref(prefixCls)}-temporary-trigger`),
372
- onClick: toggle
373
- }, [renderSlot(_ctx.$slots, "trigger", {}, () => [createVNode(unref(IconMenu))])], 2)) : createCommentVNode("", true)], 64)) : __props.rail ? (openBlock(), createElementBlock("div", {
382
+ role: "button",
383
+ tabindex: "0",
384
+ "aria-expanded": !mergedCollapsed.value,
385
+ "aria-label": "Toggle sidebar",
386
+ onClick: toggle,
387
+ onKeydown: handleTriggerKeydown
388
+ }, [renderSlot(_ctx.$slots, "trigger", {}, () => [createVNode(unref(IconMenu))])], 42, _hoisted_1)) : createCommentVNode("", true)], 64)) : __props.rail ? (openBlock(), createElementBlock("div", {
374
389
  key: 1,
375
390
  class: normalizeClass(railOverlayCls.value),
376
391
  style: normalizeStyle(railOverlayStyle.value)
@@ -405,13 +420,23 @@ var sider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
405
420
  key: 0,
406
421
  class: normalizeClass([`${unref(prefixCls)}-zero-width-trigger`, `${unref(prefixCls)}-zero-width-trigger-${__props.reverseArrow ? "right" : "left"}`]),
407
422
  style: normalizeStyle(__props.zeroWidthTriggerStyle),
408
- onClick: toggle
409
- }, [renderSlot(_ctx.$slots, "trigger", {}, () => [createVNode(unref(IconMenu))])], 6)) : (openBlock(), createElementBlock("div", {
423
+ role: "button",
424
+ tabindex: "0",
425
+ "aria-expanded": !mergedCollapsed.value,
426
+ "aria-label": "Toggle sidebar",
427
+ onClick: toggle,
428
+ onKeydown: handleTriggerKeydown
429
+ }, [renderSlot(_ctx.$slots, "trigger", {}, () => [createVNode(unref(IconMenu))])], 46, _hoisted_2)) : (openBlock(), createElementBlock("div", {
410
430
  key: 1,
411
431
  class: normalizeClass(`${unref(prefixCls)}-trigger`),
412
432
  style: normalizeStyle({ width: siderWidth.value }),
413
- onClick: toggle
414
- }, [renderSlot(_ctx.$slots, "trigger", {}, () => [(openBlock(), createBlock(resolveDynamicComponent(defaultTriggerComponent.value)))])], 6))], 64)) : createCommentVNode("", true)
433
+ role: "button",
434
+ tabindex: "0",
435
+ "aria-expanded": !mergedCollapsed.value,
436
+ "aria-label": "Toggle sidebar",
437
+ onClick: toggle,
438
+ onKeydown: handleTriggerKeydown
439
+ }, [renderSlot(_ctx.$slots, "trigger", {}, () => [(openBlock(), createBlock(resolveDynamicComponent(defaultTriggerComponent.value)))])], 46, _hoisted_3))], 64)) : createCommentVNode("", true)
415
440
  ], 64))], 38);
416
441
  };
417
442
  }
@@ -124,7 +124,7 @@
124
124
  line-height: 44px;
125
125
  text-align: center;
126
126
  cursor: pointer;
127
- transition: all 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
127
+ transition: color 0.2s cubic-bezier(0.34, 0.69, 0.1, 1), background-color 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
128
128
  }
129
129
  .sd-layout-sider-zero-width-trigger {
130
130
  position: absolute;
@@ -147,7 +147,7 @@
147
147
  position: absolute;
148
148
  inset: 0;
149
149
  background: transparent;
150
- transition: all 0.3s;
150
+ transition: background-color 0.3s ease;
151
151
  content: "";
152
152
  }
153
153
  .sd-layout-sider-zero-width-trigger:hover::after {
@@ -123,7 +123,9 @@ $text-color: var(string.unquote('#{theme.$sd-cssvars-prefix}-color-text-1'));
123
123
  line-height: $layout-sider-trigger-height;
124
124
  text-align: center;
125
125
  cursor: pointer;
126
- transition: all $layout-motion-duration-mid theme.$transition-timing-function-standard;
126
+ transition:
127
+ color $layout-motion-duration-mid theme.$transition-timing-function-standard,
128
+ background-color $layout-motion-duration-mid theme.$transition-timing-function-standard;
127
129
  }
128
130
 
129
131
  &-zero-width-trigger {
@@ -147,7 +149,7 @@ $text-color: var(string.unquote('#{theme.$sd-cssvars-prefix}-color-text-1'));
147
149
  position: absolute;
148
150
  inset: 0;
149
151
  background: transparent;
150
- transition: all $layout-motion-duration-slow;
152
+ transition: background-color $layout-motion-duration-slow ease;
151
153
  content: '';
152
154
  }
153
155
 
@@ -27,7 +27,7 @@
27
27
  background-color: transparent;
28
28
  border-radius: var(--sd-border-radius-small);
29
29
  cursor: pointer;
30
- transition: all 0.1s cubic-bezier(0, 0, 1, 1);
30
+ transition: color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
31
31
  }
32
32
  .sd-link:hover {
33
33
  color: rgb(var(--sd-link-6));
@@ -17,7 +17,9 @@ $link-prefix-cls: string.unquote('#{theme.$prefix}-link');
17
17
  background-color: global.$color-transparent;
18
18
  border-radius: $link-border-radius;
19
19
  cursor: pointer;
20
- transition: all theme.$transition-duration-1 theme.$transition-timing-function-linear;
20
+ transition:
21
+ color theme.$transition-duration-1 theme.$transition-timing-function-standard,
22
+ background-color theme.$transition-duration-1 theme.$transition-timing-function-standard;
21
23
 
22
24
  &:hover {
23
25
  color: $link-color-text_hover;
@@ -116,6 +116,7 @@ export interface ValidateMessage {
116
116
  }
117
117
  export interface SdLang {
118
118
  locale: string;
119
+ readonlyTip?: string;
119
120
  empty: {
120
121
  description: string;
121
122
  };
@@ -71,6 +71,7 @@ var calendarLang = {
71
71
  };
72
72
  var lang = {
73
73
  locale: "en-US",
74
+ readonlyTip: "Read-only mode",
74
75
  empty: { description: "No Data" },
75
76
  drawer: {
76
77
  okText: "Ok",
@@ -70,6 +70,7 @@ var calendarLang = {
70
70
  };
71
71
  var lang = {
72
72
  locale: "zh-CN",
73
+ readonlyTip: "当前为只读模式",
73
74
  empty: { description: "暂无数据" },
74
75
  drawer: {
75
76
  okText: "确定",
@@ -70,6 +70,7 @@ var calendarLang = {
70
70
  };
71
71
  var lang = {
72
72
  locale: "zh-TW",
73
+ readonlyTip: "目前為唯讀模式",
73
74
  empty: { description: "無資料" },
74
75
  drawer: {
75
76
  okText: "確認",
@@ -28,6 +28,10 @@ declare const Mention: {
28
28
  type: BooleanConstructor;
29
29
  default: boolean;
30
30
  };
31
+ readonly: {
32
+ type: (StringConstructor | BooleanConstructor)[];
33
+ default: boolean;
34
+ };
31
35
  allowClear: {
32
36
  type: BooleanConstructor;
33
37
  default: boolean;
@@ -57,6 +61,7 @@ declare const Mention: {
57
61
  }, import("vue").PublicProps, {
58
62
  type: "input" | "textarea";
59
63
  split: string;
64
+ readonly: string | boolean;
60
65
  data: (string | number | import("..").SelectOptionData | import("..").SelectOptionGroup)[];
61
66
  disabled: boolean;
62
67
  prefix: string | string[];
@@ -95,6 +100,10 @@ declare const Mention: {
95
100
  type: BooleanConstructor;
96
101
  default: boolean;
97
102
  };
103
+ readonly: {
104
+ type: (StringConstructor | BooleanConstructor)[];
105
+ default: boolean;
106
+ };
98
107
  allowClear: {
99
108
  type: BooleanConstructor;
100
109
  default: boolean;
@@ -116,6 +125,7 @@ declare const Mention: {
116
125
  }, {
117
126
  type: "input" | "textarea";
118
127
  split: string;
128
+ readonly: string | boolean;
119
129
  data: (string | number | import("..").SelectOptionData | import("..").SelectOptionGroup)[];
120
130
  disabled: boolean;
121
131
  prefix: string | string[];
@@ -151,6 +161,10 @@ declare const Mention: {
151
161
  type: BooleanConstructor;
152
162
  default: boolean;
153
163
  };
164
+ readonly: {
165
+ type: (StringConstructor | BooleanConstructor)[];
166
+ default: boolean;
167
+ };
154
168
  allowClear: {
155
169
  type: BooleanConstructor;
156
170
  default: boolean;
@@ -180,6 +194,7 @@ declare const Mention: {
180
194
  }, string, {
181
195
  type: "input" | "textarea";
182
196
  split: string;
197
+ readonly: string | boolean;
183
198
  data: (string | number | import("..").SelectOptionData | import("..").SelectOptionGroup)[];
184
199
  disabled: boolean;
185
200
  prefix: string | string[];
@@ -26,6 +26,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
26
26
  type: BooleanConstructor;
27
27
  default: boolean;
28
28
  };
29
+ readonly: {
30
+ type: (StringConstructor | BooleanConstructor)[];
31
+ default: boolean;
32
+ };
29
33
  allowClear: {
30
34
  type: BooleanConstructor;
31
35
  default: boolean;
@@ -70,6 +74,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
70
74
  type: BooleanConstructor;
71
75
  default: boolean;
72
76
  };
77
+ readonly: {
78
+ type: (StringConstructor | BooleanConstructor)[];
79
+ default: boolean;
80
+ };
73
81
  allowClear: {
74
82
  type: BooleanConstructor;
75
83
  default: boolean;
@@ -85,6 +93,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
85
93
  }>, {
86
94
  type: "input" | "textarea";
87
95
  split: string;
96
+ readonly: string | boolean;
88
97
  data: (string | number | SelectOptionData | SelectOptionGroup)[];
89
98
  disabled: boolean;
90
99
  prefix: string | string[];
@@ -4,11 +4,11 @@ import { getPrefixCls } from "../_utils/global-config.js";
4
4
  import { isFunction, isNull, isUndefined } from "../_utils/is.js";
5
5
  import resize_observer_default from "../_components/resize-observer.js";
6
6
  import { useAllowClear } from "../_hooks/use-allow-clear.js";
7
+ import Trigger from "../trigger/index.js";
7
8
  import Input from "../input/index.js";
8
9
  import { getKeyFromValue } from "../select/utils.js";
9
10
  import { useSelect } from "../select/hooks/use-select.js";
10
11
  import select_dropdown_default from "../select/select-dropdown.js";
11
- import Trigger from "../trigger/index.js";
12
12
  import { getSizeStyles } from "../textarea/utils.js";
13
13
  import Textarea from "../textarea/index.js";
14
14
  import { getLastMeasureIndex, getTextBeforeSelection, isValidSearch } from "./utils.js";
@@ -76,6 +76,14 @@ var mention_default = /* @__PURE__ */ defineComponent({
76
76
  default: false
77
77
  },
78
78
  /**
79
+ * @zh 是否为只读状态
80
+ * @en Whether it is read-only
81
+ */
82
+ readonly: {
83
+ type: [Boolean, String],
84
+ default: false
85
+ },
86
+ /**
79
87
  * @zh 是否允许清空输入框
80
88
  * @en Whether to allow the input to be cleared
81
89
  * @version 2.23.0
@@ -170,6 +178,7 @@ var mention_default = /* @__PURE__ */ defineComponent({
170
178
  const filterOption = ref(true);
171
179
  const handleInput = (value, e) => {
172
180
  var _eventHandlers$value, _eventHandlers$value$;
181
+ if (props.readonly) return;
173
182
  const text = getTextBeforeSelection(e.target);
174
183
  const lastMeasure = getLastMeasureIndex(text, props.prefix);
175
184
  if (lastMeasure.location > -1) {
@@ -268,6 +277,8 @@ var mention_default = /* @__PURE__ */ defineComponent({
268
277
  },
269
278
  "key": item.key,
270
279
  "class": cls,
280
+ "role": "option",
281
+ "aria-disabled": item.disabled || void 0,
271
282
  "onClick": (ev) => {
272
283
  if (!item.disabled) handleSelect(item.key, ev);
273
284
  },
@@ -308,6 +319,7 @@ var mention_default = /* @__PURE__ */ defineComponent({
308
319
  "allowClear": mergedAllowClear.value,
309
320
  "modelValue": computedValue.value,
310
321
  "disabled": mergedDisabled.value,
322
+ "readonly": props.readonly,
311
323
  "onInput": handleInput,
312
324
  "onClear": handleClear,
313
325
  "onFocus": onFocus,
@@ -347,6 +359,13 @@ var mention_default = /* @__PURE__ */ defineComponent({
347
359
  "allowClear": mergedAllowClear.value,
348
360
  "modelValue": computedValue.value,
349
361
  "disabled": mergedDisabled.value,
362
+ "readonly": props.readonly,
363
+ "inputAttrs": {
364
+ "role": "combobox",
365
+ "aria-haspopup": "listbox",
366
+ "aria-expanded": computedPopupVisible.value,
367
+ "aria-autocomplete": "list"
368
+ },
350
369
  "onInput": handleInput,
351
370
  "onClear": handleClear,
352
371
  "onFocus": onFocus,
@@ -1,9 +1,10 @@
1
1
  import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
2
2
  import { getPrefixCls } from "../_utils/global-config.js";
3
3
  import { isNumber, isObject } from "../_utils/is.js";
4
+ import { KEYBOARD_KEY } from "../_utils/keyboard.js";
4
5
  import { omit } from "../_utils/omit.js";
5
- import useMergeState from "../_hooks/use-merge-state.js";
6
6
  import usePickSlots from "../_hooks/use-pick-slots.js";
7
+ import useMergeState from "../_hooks/use-merge-state.js";
7
8
  import { MenuInjectionKey } from "./context.js";
8
9
  import { provideLevel } from "./hooks/use-level.js";
9
10
  import useMenuDataCollector from "./hooks/use-menu-data-collector.js";
@@ -13,6 +14,7 @@ import IconMenuUnfold from "../icon/icon-menu-unfold/index.js";
13
14
  import useMenuOpenState from "./hooks/use-menu-open-state.js";
14
15
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeProps, normalizeClass, openBlock, provide, reactive, renderSlot, toRefs, unref, useSlots } from "vue";
15
16
  //#region components/menu/base-menu.vue?vue&type=script&setup=true&lang.ts
17
+ var _hoisted_1 = ["role"];
16
18
  /**
17
19
  * @displayName Menu
18
20
  */
@@ -242,6 +244,26 @@ var base_menu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
242
244
  const width = computedCollapsed.value ? pxCollapsedWidth : objectStyle === null || objectStyle === void 0 ? void 0 : objectStyle.width;
243
245
  return [objectStyle ? omit(objectStyle, ["width"]) : style.value, { width }];
244
246
  });
247
+ const expandIconDown = usePickSlots(slots, "expand-icon-down");
248
+ const expandIconRight = usePickSlots(slots, "expand-icon-right");
249
+ const onMenuKeydown = (e) => {
250
+ const horizontal = mode.value === "horizontal";
251
+ const forward = horizontal ? e.key === KEYBOARD_KEY.ARROW_RIGHT : e.key === KEYBOARD_KEY.ARROW_DOWN;
252
+ const backward = horizontal ? e.key === KEYBOARD_KEY.ARROW_LEFT : e.key === KEYBOARD_KEY.ARROW_UP;
253
+ if (!forward && !backward && e.key !== KEYBOARD_KEY.HOME && e.key !== KEYBOARD_KEY.END) return;
254
+ const container = e.currentTarget;
255
+ const items = Array.from(container.querySelectorAll("[role=\"menuitem\"]")).filter((el) => el.tabIndex === 0);
256
+ if (!items.length) return;
257
+ const current = e.target;
258
+ const idx = items.indexOf(current);
259
+ e.preventDefault();
260
+ let target;
261
+ if (e.key === KEYBOARD_KEY.HOME) target = items[0];
262
+ else if (e.key === KEYBOARD_KEY.END) target = items[items.length - 1];
263
+ else if (forward) target = items[idx < 0 ? 0 : Math.min(idx + 1, items.length - 1)];
264
+ else if (backward) target = items[idx < 0 ? 0 : Math.max(idx - 1, 0)];
265
+ target === null || target === void 0 || target.focus();
266
+ };
245
267
  provide(MenuInjectionKey, reactive({
246
268
  theme,
247
269
  mode,
@@ -258,8 +280,8 @@ var base_menu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
258
280
  ellipsis,
259
281
  ellipsisProps,
260
282
  popupMaxHeight,
261
- expandIconDown: usePickSlots(slots, "expand-icon-down"),
262
- expandIconRight: usePickSlots(slots, "expand-icon-right"),
283
+ expandIconDown,
284
+ expandIconRight,
263
285
  onMenuItemClick: (key) => {
264
286
  setSelectedKeys([key]);
265
287
  emit("update:selectedKeys", [key]);
@@ -274,7 +296,11 @@ var base_menu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
274
296
  }));
275
297
  provideLevel(1);
276
298
  return (_ctx, _cache) => {
277
- return openBlock(), createElementBlock("div", mergeProps({ class: classNames.value }, _ctx.$attrs, { style: computedStyle.value }), [createElementVNode("div", { class: normalizeClass(`${computedPrefixCls.value}-inner`) }, [renderSlot(_ctx.$slots, "default")], 2), computedHasCollapseButton.value ? (openBlock(), createElementBlock("div", {
299
+ return openBlock(), createElementBlock("div", mergeProps({ class: classNames.value }, _ctx.$attrs, { style: computedStyle.value }), [createElementVNode("div", {
300
+ class: normalizeClass(`${computedPrefixCls.value}-inner`),
301
+ role: !unref(inTrigger) && unref(mode) === "horizontal" ? "menubar" : "menu",
302
+ onKeydown: onMenuKeydown
303
+ }, [renderSlot(_ctx.$slots, "default")], 42, _hoisted_1), computedHasCollapseButton.value ? (openBlock(), createElementBlock("div", {
278
304
  key: 0,
279
305
  class: normalizeClass(`${computedPrefixCls.value}-collapse-button`),
280
306
  onClick: onCollapseBtnClick