@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
@@ -89,7 +89,11 @@ var back_top_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
89
89
  key: 0,
90
90
  class: normalizeClass(unref(prefixCls)),
91
91
  onClick: scrollToTop
92
- }, [renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("button", { class: normalizeClass(`${unref(prefixCls)}-btn`) }, [createVNode(unref(IconToTop))], 2)])], 2)) : createCommentVNode("", true)]),
92
+ }, [renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("button", {
93
+ type: "button",
94
+ class: normalizeClass(`${unref(prefixCls)}-btn`),
95
+ "aria-label": "Back to top"
96
+ }, [createVNode(unref(IconToTop))], 2)])], 2)) : createCommentVNode("", true)]),
93
97
  _: 3
94
98
  });
95
99
  };
@@ -32,7 +32,7 @@
32
32
  border-radius: var(--sd-border-radius-circle);
33
33
  outline: none;
34
34
  cursor: pointer;
35
- transition: all 0.2s cubic-bezier(0, 0, 1, 1);
35
+ transition: background-color 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
36
36
  }
37
37
  .sd-back-top-btn:hover {
38
38
  background-color: rgb(var(--sd-primary-5));
@@ -21,7 +21,8 @@ $backtop-prefix-cls: string.unquote('#{theme.$prefix}-back-top');
21
21
  border-radius: $backtop-button-border-radius;
22
22
  outline: none;
23
23
  cursor: pointer;
24
- transition: all theme.$transition-duration-2 theme.$transition-timing-function-linear;
24
+ transition: background-color theme.$transition-duration-2
25
+ theme.$transition-timing-function-standard;
25
26
 
26
27
  &:hover {
27
28
  background-color: $backtop-button-color-bg_hover;
package/es/badge/badge.js CHANGED
@@ -126,9 +126,12 @@ var badge_default = /* @__PURE__ */ defineComponent({
126
126
  [`${prefixCls}-status-${statusValue}`]: statusValue,
127
127
  [`${prefixCls}-color-${colorValue}`]: colorValue
128
128
  }],
129
- "style": mergedStyle
129
+ "style": mergedStyle,
130
+ "aria-hidden": "true"
130
131
  }, null), textValue && createVNode("span", { "class": `${prefixCls}-status-text` }, [textValue])]);
131
132
  if ((dotValue || colorValue) && countValue > 0) return createVNode("span", {
133
+ "role": "status",
134
+ "aria-label": String(countValue),
132
135
  "class": [`${prefixCls}-dot`, { [`${prefixCls}-color-${colorValue}`]: colorValue }],
133
136
  "style": mergedStyle
134
137
  }, null);
@@ -144,7 +144,7 @@
144
144
 
145
145
  @keyframes sd-badge-scale {
146
146
  from {
147
- transform: scale(0, 0);
147
+ transform: scale(0.5, 0.5);
148
148
  }
149
149
  to {
150
150
  transform: scale(1, 1);
@@ -152,7 +152,7 @@
152
152
  }
153
153
  .badge-zoom-enter,
154
154
  .badge-zoom-appear {
155
- transform: translate(50%, -50%) scale(0.2, 0.2);
155
+ transform: translate(50%, -50%) scale(0.5, 0.5);
156
156
  transform-origin: center;
157
157
  }
158
158
 
@@ -171,7 +171,7 @@
171
171
  }
172
172
 
173
173
  .badge-zoom-exit-active {
174
- transform: translate(50%, -50%) scale(0.2, 0.2);
174
+ transform: translate(50%, -50%) scale(0.5, 0.5);
175
175
  transform-origin: center;
176
176
  opacity: 0;
177
177
  transition: opacity 0.3s cubic-bezier(0.3, 1.3, 0.3, 1), transform 0.3s cubic-bezier(0.3, 1.3, 0.3, 1);
@@ -159,7 +159,7 @@ $badge-prefix-cls: string.unquote('#{theme.$prefix}-badge');
159
159
 
160
160
  @keyframes #{theme.$prefix}-badge-scale {
161
161
  from {
162
- transform: scale(0, 0);
162
+ transform: scale(0.5, 0.5);
163
163
  }
164
164
 
165
165
  to {
@@ -169,7 +169,7 @@ $badge-prefix-cls: string.unquote('#{theme.$prefix}-badge');
169
169
 
170
170
  .badge-zoom-enter,
171
171
  .badge-zoom-appear {
172
- transform: translate(50%, -50%) scale(0.2, 0.2);
172
+ transform: translate(50%, -50%) scale(0.5, 0.5);
173
173
  // opacity: 0;
174
174
  transform-origin: center;
175
175
  }
@@ -191,7 +191,7 @@ $badge-prefix-cls: string.unquote('#{theme.$prefix}-badge');
191
191
  }
192
192
 
193
193
  .badge-zoom-exit-active {
194
- transform: translate(50%, -50%) scale(0.2, 0.2);
194
+ transform: translate(50%, -50%) scale(0.5, 0.5);
195
195
  transform-origin: center;
196
196
  opacity: 0;
197
197
  transition:
@@ -105,6 +105,7 @@ var breadcrumb_default = /* @__PURE__ */ defineComponent({
105
105
  return () => {
106
106
  return createVNode("div", {
107
107
  "role": "list",
108
+ "aria-label": "Breadcrumb",
108
109
  "class": prefixCls
109
110
  }, [slots.default ? renderByChildren() : renderByRoutes()]);
110
111
  };
@@ -1,19 +1,22 @@
1
1
  import type { PropType } from 'vue';
2
+ import type { TooltipProps } from '../tooltip';
2
3
  import { Status, Size, BorderShape } from '../_utils/constant';
3
4
  import { ButtonTypes } from './constants';
4
- declare var __VLS_6: {}, __VLS_8: {}, __VLS_10: {}, __VLS_17: {}, __VLS_19: {}, __VLS_21: {};
5
+ declare var __VLS_13: {}, __VLS_15: {}, __VLS_17: {}, __VLS_24: {}, __VLS_26: {}, __VLS_28: {}, __VLS_31: {};
5
6
  type __VLS_Slots = {} & {
6
- icon?: (props: typeof __VLS_6) => any;
7
+ icon?: (props: typeof __VLS_13) => any;
7
8
  } & {
8
- default?: (props: typeof __VLS_8) => any;
9
+ default?: (props: typeof __VLS_15) => any;
9
10
  } & {
10
- default?: (props: typeof __VLS_10) => any;
11
+ default?: (props: typeof __VLS_17) => any;
11
12
  } & {
12
- icon?: (props: typeof __VLS_17) => any;
13
+ icon?: (props: typeof __VLS_24) => any;
13
14
  } & {
14
- default?: (props: typeof __VLS_19) => any;
15
+ default?: (props: typeof __VLS_26) => any;
15
16
  } & {
16
- default?: (props: typeof __VLS_21) => any;
17
+ default?: (props: typeof __VLS_28) => any;
18
+ } & {
19
+ tooltip?: (props: typeof __VLS_31) => any;
17
20
  };
18
21
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
19
22
  type: {
@@ -52,6 +55,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
52
55
  default: boolean;
53
56
  };
54
57
  href: StringConstructor;
58
+ tooltip: {
59
+ type: PropType<string | TooltipProps>;
60
+ };
55
61
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
56
62
  click: (_ev: MouseEvent) => any;
57
63
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -91,6 +97,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
91
97
  default: boolean;
92
98
  };
93
99
  href: StringConstructor;
100
+ tooltip: {
101
+ type: PropType<string | TooltipProps>;
102
+ };
94
103
  }>> & Readonly<{
95
104
  onClick?: ((_ev: MouseEvent) => any) | undefined;
96
105
  }>, {
@@ -5,8 +5,9 @@ import { getPrefixCls } from "../_utils/global-config.js";
5
5
  import { isString } from "../_utils/is.js";
6
6
  import IconLoading from "../icon/icon-loading/index.js";
7
7
  import { useSize } from "../_hooks/use-size.js";
8
+ import Tooltip from "../tooltip/index.js";
8
9
  import { buttonGroupInjectionKey } from "./context.js";
9
- import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, inject, normalizeClass, onMounted, onUpdated, openBlock, ref, renderSlot, toRefs, unref } from "vue";
10
+ import { cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createSlots, defineComponent, guardReactiveProps, inject, normalizeClass, normalizeProps, onMounted, onUpdated, openBlock, ref, renderSlot, resolveDynamicComponent, toRefs, unref, useSlots, withCtx } from "vue";
10
11
  //#region components/button/button.vue?vue&type=script&setup=true&lang.ts
11
12
  var _hoisted_1 = ["href"];
12
13
  var _hoisted_2 = { key: 2 };
@@ -94,7 +95,12 @@ var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
94
95
  * @zh 设置跳转链接。设置此属性时,按钮渲染为a标签。
95
96
  * @en Set up a jump link. When this property is set, the button is rendered as `<a>`
96
97
  */
97
- href: String
98
+ href: String,
99
+ /**
100
+ * @zh 按钮的文字气泡配置。传入字符串时作为气泡内容;传入对象时可完整继承 Tooltip 的所有属性。
101
+ * @en Tooltip configuration for the button. A string is used as the tooltip content; an object inherits all Tooltip props.
102
+ */
103
+ tooltip: { type: [String, Object] }
98
104
  },
99
105
  emits: ["click"],
100
106
  setup(__props, { emit: __emit }) {
@@ -108,6 +114,24 @@ var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
108
114
  */
109
115
  const { size, disabled } = toRefs(props);
110
116
  const prefixCls = getPrefixCls("btn");
117
+ const PassThrough = defineComponent({
118
+ name: "ButtonPassThrough",
119
+ inheritAttrs: false,
120
+ setup: (_, { slots, attrs }) => () => {
121
+ var _slots$default;
122
+ const vnodes = (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots);
123
+ return (vnodes === null || vnodes === void 0 ? void 0 : vnodes.length) ? cloneVNode(vnodes[0], attrs) : void 0;
124
+ }
125
+ });
126
+ const slots = useSlots();
127
+ const hasTooltip = computed(() => props.tooltip != null || Boolean(slots.tooltip));
128
+ const tooltipWrapper = computed(() => hasTooltip.value ? Tooltip : PassThrough);
129
+ const tooltipBindings = computed(() => {
130
+ if (!hasTooltip.value) return;
131
+ const tooltip = props.tooltip;
132
+ if (isString(tooltip)) return { content: tooltip };
133
+ return tooltip !== null && tooltip !== void 0 ? tooltip : {};
134
+ });
111
135
  const configContext = inject(configProviderInjectionKey, void 0);
112
136
  const groupContext = inject(buttonGroupInjectionKey, void 0);
113
137
  const autoInsertSpaceInButton = computed(() => Boolean(configContext === null || configContext === void 0 ? void 0 : configContext.autoInsertSpaceInButton));
@@ -159,35 +183,42 @@ var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
159
183
  emit("click", ev);
160
184
  };
161
185
  return (_ctx, _cache) => {
162
- return __props.href ? (openBlock(), createElementBlock("a", {
163
- key: 0,
164
- ref_key: "buttonRef",
165
- ref: buttonRef,
166
- class: normalizeClass([cls.value, { [`${unref(prefixCls)}-only-icon`]: _ctx.$slots.icon && !_ctx.$slots.default }]),
167
- href: unref(mergedDisabled) || __props.loading ? void 0 : __props.href,
168
- onClick: handleClick
169
- }, [__props.loading || _ctx.$slots.icon ? (openBlock(), createElementBlock("span", {
170
- key: 0,
171
- class: normalizeClass(`${unref(prefixCls)}-icon`)
172
- }, [__props.loading ? (openBlock(), createBlock(unref(IconLoading), {
173
- key: 0,
174
- spin: ""
175
- })) : renderSlot(_ctx.$slots, "icon", { key: 1 })], 2)) : createCommentVNode("", true), !isTwoCNChar.value ? renderSlot(_ctx.$slots, "default", { key: 1 }) : (openBlock(), createElementBlock("span", _hoisted_2, [renderSlot(_ctx.$slots, "default")]))], 10, _hoisted_1)) : (openBlock(), createElementBlock("button", {
176
- key: 1,
177
- ref_key: "buttonRef",
178
- ref: buttonRef,
179
- class: normalizeClass([cls.value, { [`${unref(prefixCls)}-only-icon`]: _ctx.$slots.icon && !_ctx.$slots.default }]),
180
- type: __props.htmlType,
181
- disabled: unref(mergedDisabled),
182
- autofocus: __props.autofocus,
183
- onClick: handleClick
184
- }, [__props.loading || _ctx.$slots.icon ? (openBlock(), createElementBlock("span", {
185
- key: 0,
186
- class: normalizeClass(`${unref(prefixCls)}-icon`)
187
- }, [__props.loading ? (openBlock(), createBlock(unref(IconLoading), {
188
- key: 0,
189
- spin: true
190
- })) : renderSlot(_ctx.$slots, "icon", { key: 1 })], 2)) : createCommentVNode("", true), !isTwoCNChar.value ? renderSlot(_ctx.$slots, "default", { key: 1 }) : (openBlock(), createElementBlock("span", _hoisted_4, [renderSlot(_ctx.$slots, "default")]))], 10, _hoisted_3));
186
+ return openBlock(), createBlock(resolveDynamicComponent(tooltipWrapper.value), normalizeProps(guardReactiveProps(tooltipBindings.value)), createSlots({
187
+ default: withCtx(() => [__props.href ? (openBlock(), createElementBlock("a", {
188
+ key: 0,
189
+ ref_key: "buttonRef",
190
+ ref: buttonRef,
191
+ class: normalizeClass([cls.value, { [`${unref(prefixCls)}-only-icon`]: _ctx.$slots.icon && !_ctx.$slots.default }]),
192
+ href: unref(mergedDisabled) || __props.loading ? void 0 : __props.href,
193
+ onClick: handleClick
194
+ }, [__props.loading || _ctx.$slots.icon ? (openBlock(), createElementBlock("span", {
195
+ key: 0,
196
+ class: normalizeClass(`${unref(prefixCls)}-icon`)
197
+ }, [__props.loading ? (openBlock(), createBlock(unref(IconLoading), {
198
+ key: 0,
199
+ spin: ""
200
+ })) : renderSlot(_ctx.$slots, "icon", { key: 1 })], 2)) : createCommentVNode("", true), !isTwoCNChar.value ? renderSlot(_ctx.$slots, "default", { key: 1 }) : (openBlock(), createElementBlock("span", _hoisted_2, [renderSlot(_ctx.$slots, "default")]))], 10, _hoisted_1)) : (openBlock(), createElementBlock("button", {
201
+ key: 1,
202
+ ref_key: "buttonRef",
203
+ ref: buttonRef,
204
+ class: normalizeClass([cls.value, { [`${unref(prefixCls)}-only-icon`]: _ctx.$slots.icon && !_ctx.$slots.default }]),
205
+ type: __props.htmlType,
206
+ disabled: unref(mergedDisabled),
207
+ autofocus: __props.autofocus,
208
+ onClick: handleClick
209
+ }, [__props.loading || _ctx.$slots.icon ? (openBlock(), createElementBlock("span", {
210
+ key: 0,
211
+ class: normalizeClass(`${unref(prefixCls)}-icon`)
212
+ }, [__props.loading ? (openBlock(), createBlock(unref(IconLoading), {
213
+ key: 0,
214
+ spin: true
215
+ })) : renderSlot(_ctx.$slots, "icon", { key: 1 })], 2)) : createCommentVNode("", true), !isTwoCNChar.value ? renderSlot(_ctx.$slots, "default", { key: 1 }) : (openBlock(), createElementBlock("span", _hoisted_4, [renderSlot(_ctx.$slots, "default")]))], 10, _hoisted_3))]),
216
+ _: 2
217
+ }, [_ctx.$slots.tooltip ? {
218
+ name: "content",
219
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "tooltip")]),
220
+ key: "0"
221
+ } : void 0]), 1040);
191
222
  };
192
223
  }
193
224
  }));
@@ -40,6 +40,9 @@ declare const Button: {
40
40
  default: boolean;
41
41
  };
42
42
  href: StringConstructor;
43
+ tooltip: {
44
+ type: import("vue").PropType<string | import("../tooltip/interface.ts").TooltipProps>;
45
+ };
43
46
  }>> & Readonly<{
44
47
  onClick?: ((_ev: MouseEvent) => any) | undefined;
45
48
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -95,6 +98,9 @@ declare const Button: {
95
98
  default: boolean;
96
99
  };
97
100
  href: StringConstructor;
101
+ tooltip: {
102
+ type: import("vue").PropType<string | import("../tooltip/interface.ts").TooltipProps>;
103
+ };
98
104
  }>> & Readonly<{
99
105
  onClick?: ((_ev: MouseEvent) => any) | undefined;
100
106
  }>, {}, {}, {}, {}, {
@@ -145,6 +151,9 @@ declare const Button: {
145
151
  default: boolean;
146
152
  };
147
153
  href: StringConstructor;
154
+ tooltip: {
155
+ type: import("vue").PropType<string | import("../tooltip/interface.ts").TooltipProps>;
156
+ };
148
157
  }>> & Readonly<{
149
158
  onClick?: ((_ev: MouseEvent) => any) | undefined;
150
159
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -169,6 +178,8 @@ declare const Button: {
169
178
  default?: (props: {}) => any;
170
179
  } & {
171
180
  default?: (props: {}) => any;
181
+ } & {
182
+ tooltip?: (props: {}) => any;
172
183
  };
173
184
  }) & {
174
185
  Group: {
@@ -1,3 +1,4 @@
1
+ import type { TooltipProps } from '../tooltip';
1
2
  import { Size, Status, BorderShape } from '../_utils/constant';
2
3
  import { ButtonTypes } from './constants';
3
4
  export interface ButtonProps {
@@ -12,4 +13,5 @@ export interface ButtonProps {
12
13
  htmlType?: 'button' | 'submit' | 'reset';
13
14
  autofocus?: boolean;
14
15
  href?: string;
16
+ tooltip?: string | TooltipProps;
15
17
  }
@@ -32,7 +32,7 @@
32
32
  white-space: nowrap;
33
33
  outline: none;
34
34
  cursor: pointer;
35
- transition: all 0.1s cubic-bezier(0, 0, 1, 1);
35
+ 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), border-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), transform 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
36
36
  appearance: none;
37
37
  user-select: none;
38
38
  }
@@ -40,7 +40,7 @@
40
40
  color: currentcolor;
41
41
  }
42
42
  .sd-btn:active {
43
- transition: none;
43
+ transform: scale(0.97);
44
44
  }
45
45
  .sd-btn-long {
46
46
  display: flex;
@@ -80,13 +80,10 @@
80
80
  background: #fff;
81
81
  border-radius: inherit;
82
82
  opacity: 0.4;
83
- transition: opacity 0.1s cubic-bezier(0, 0, 1, 1);
83
+ transition: opacity 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
84
84
  content: "";
85
85
  pointer-events: none;
86
86
  }
87
- .sd-btn-loading-fixed-width {
88
- transition: none;
89
- }
90
87
  .sd-btn-two-chinese-chars > *:not(svg) {
91
88
  margin-right: -0.3em;
92
89
  letter-spacing: 0.3em;
@@ -909,6 +906,9 @@
909
906
  .sd-btn-group .sd-btn-dashed:active {
910
907
  z-index: 2;
911
908
  }
909
+ .sd-btn-group .sd-btn:active {
910
+ transform: none;
911
+ }
912
912
  .sd-btn-group .sd-btn:first-child {
913
913
  border-top-right-radius: 0;
914
914
  border-bottom-right-radius: 0;
@@ -923,4 +923,13 @@
923
923
 
924
924
  :where(body, [sd-theme])[sd-theme=dark] .sd-btn-primary.sd-btn-disabled {
925
925
  color: rgba(255, 255, 255, 0.3);
926
+ }
927
+
928
+ @media (prefers-reduced-motion: reduce) {
929
+ .sd-btn:active {
930
+ transform: none;
931
+ }
932
+ .sd-btn .sd-icon-loading {
933
+ animation-duration: 3s;
934
+ }
926
935
  }
@@ -63,7 +63,12 @@ $token-var-aliases: (
63
63
  white-space: nowrap;
64
64
  outline: none;
65
65
  cursor: pointer;
66
- transition: all theme.$transition-duration-1 theme.$transition-timing-function-linear;
66
+ // 状态切换只过渡颜色与按压形变;box-shadow(聚焦环)保持即时切换以保证可见性
67
+ transition:
68
+ color theme.$transition-duration-1 theme.$transition-timing-function-standard,
69
+ background-color theme.$transition-duration-1 theme.$transition-timing-function-standard,
70
+ border-color theme.$transition-duration-1 theme.$transition-timing-function-standard,
71
+ transform theme.$transition-duration-1 theme.$transition-timing-function-standard;
67
72
  appearance: none;
68
73
  user-select: none;
69
74
 
@@ -72,7 +77,7 @@ $token-var-aliases: (
72
77
  }
73
78
 
74
79
  &:active {
75
- transition: none;
80
+ transform: scale(0.97);
76
81
  }
77
82
 
78
83
  &-long {
@@ -119,16 +124,12 @@ $token-var-aliases: (
119
124
  background: #fff;
120
125
  border-radius: inherit;
121
126
  opacity: 0.4;
122
- transition: opacity theme.$transition-duration-1 theme.$transition-timing-function-linear;
127
+ transition: opacity theme.$transition-duration-1 theme.$transition-timing-function-standard;
123
128
  content: '';
124
129
  pointer-events: none;
125
130
  }
126
131
  }
127
132
 
128
- &-loading-fixed-width {
129
- transition: none;
130
- }
131
-
132
133
  &-two-chinese-chars > *:not(svg) {
133
134
  margin-right: -0.3em;
134
135
  letter-spacing: 0.3em;
@@ -324,6 +325,11 @@ $token-var-aliases: (
324
325
  }
325
326
  }
326
327
 
328
+ // 按钮组是连体控件,单个按钮按压形变会与相邻按钮产生缝隙,故禁用形变
329
+ .#{$btn-prefix-cls}:active {
330
+ transform: none;
331
+ }
332
+
327
333
  .#{$btn-prefix-cls}:first-child {
328
334
  border-top-right-radius: 0;
329
335
  border-bottom-right-radius: 0;
@@ -344,3 +350,15 @@ $token-var-aliases: (
344
350
  color: rgb(255 255 255 / 30%);
345
351
  }
346
352
  }
353
+
354
+ // 减少动态偏好:去掉按压形变(位移),保留颜色过渡(有助于理解状态);
355
+ // 放慢加载图标旋转,避免快速循环带来的不适,但仍可表达加载态
356
+ @media (prefers-reduced-motion: reduce) {
357
+ .#{$btn-prefix-cls}:active {
358
+ transform: none;
359
+ }
360
+
361
+ .#{$btn-prefix-cls} .#{theme.$prefix}-icon-loading {
362
+ animation-duration: 3s;
363
+ }
364
+ }
@@ -56,7 +56,7 @@ $calendar-css-prefix: string.unquote('--#{theme.$prefix}-calendar');
56
56
  }
57
57
 
58
58
  [class*='-calendar-delete-btn-enter-from'] {
59
- transform: scale(0) rotate(-90deg);
59
+ transform: scale(0.5) rotate(-90deg);
60
60
  }
61
61
 
62
62
  [class*='-calendar-delete-btn-enter-to'] {
@@ -64,6 +64,6 @@ $calendar-css-prefix: string.unquote('--#{theme.$prefix}-calendar');
64
64
  }
65
65
 
66
66
  [class*='-calendar-delete-btn-leave-active'] {
67
- transform: scale(0);
67
+ transform: scale(0.5);
68
68
  transition: 0.3s ease-in-out;
69
69
  }
@@ -1626,7 +1626,7 @@
1626
1626
  }
1627
1627
 
1628
1628
  [class*=-calendar-delete-btn-enter-from] {
1629
- transform: scale(0) rotate(-90deg);
1629
+ transform: scale(0.5) rotate(-90deg);
1630
1630
  }
1631
1631
 
1632
1632
  [class*=-calendar-delete-btn-enter-to] {
@@ -1634,6 +1634,6 @@
1634
1634
  }
1635
1635
 
1636
1636
  [class*=-calendar-delete-btn-leave-active] {
1637
- transform: scale(0);
1637
+ transform: scale(0.5);
1638
1638
  transition: 0.3s ease-in-out;
1639
1639
  }