@tendaui/components 1.2.4 → 1.3.1

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 (309) hide show
  1. package/_util/scroll.ts +9 -0
  2. package/alert/_example/base.tsx +13 -0
  3. package/alert/_example/collapse.tsx +15 -0
  4. package/badge/_example/base.tsx +10 -0
  5. package/badge/_example/count.tsx +29 -0
  6. package/badge/_example/custom-color.tsx +32 -0
  7. package/badge/_example/dot.tsx +26 -0
  8. package/badge/_example/max-count.tsx +26 -0
  9. package/badge/_example/offset.tsx +29 -0
  10. package/badge/_example/shape.tsx +32 -0
  11. package/badge/_example/show-zero.tsx +23 -0
  12. package/badge/_example/size.tsx +35 -0
  13. package/badge/_example/standalone.tsx +14 -0
  14. package/badge/_example/text-count.tsx +26 -0
  15. package/badge/_example/with-button.tsx +23 -0
  16. package/button/_example/block.tsx +18 -0
  17. package/button/_example/disabled.tsx +22 -0
  18. package/button/_example/ghost.tsx +21 -0
  19. package/button/_example/link.tsx +15 -0
  20. package/button/_example/loading.tsx +19 -0
  21. package/button/_example/shape.tsx +18 -0
  22. package/button/_example/size.tsx +18 -0
  23. package/button/_example/suffix.tsx +16 -0
  24. package/button/_example/theme.tsx +14 -0
  25. package/button/_example/variant-base.tsx +24 -0
  26. package/button/_example/variant-dashed.tsx +24 -0
  27. package/button/_example/variant-outline.tsx +24 -0
  28. package/button/_example/variant-text.tsx +24 -0
  29. package/checkbox/_example/base.tsx +8 -0
  30. package/checkbox/_example/controlled.tsx +11 -0
  31. package/checkbox/_example/group-disabled.tsx +13 -0
  32. package/checkbox/_example/group-with-check-all.tsx +22 -0
  33. package/checkbox/_example/group-with-max.tsx +17 -0
  34. package/checkbox/_example/group-with-options.tsx +18 -0
  35. package/checkbox/_example/group.tsx +17 -0
  36. package/checkbox/_example/states.tsx +19 -0
  37. package/color-picker/ColorPicker.tsx +16 -2
  38. package/color-picker/_example/base.tsx +12 -0
  39. package/color-picker/_example/borderless.tsx +17 -0
  40. package/color-picker/_example/clearable.tsx +12 -0
  41. package/color-picker/_example/disabled.tsx +17 -0
  42. package/color-picker/_example/formats.tsx +30 -0
  43. package/color-picker/_example/manual-input.tsx +39 -0
  44. package/color-picker/_example/recent-colors.tsx +19 -0
  45. package/color-picker/_example/swatch-colors.tsx +28 -0
  46. package/color-picker/_example/with-alpha.tsx +21 -0
  47. package/color-picker/components/panel/format/inputs.tsx +1 -1
  48. package/color-picker/components/panel/index.tsx +13 -0
  49. package/color-picker/components/trigger.tsx +64 -13
  50. package/color-picker/defaultProps.ts +4 -1
  51. package/color-picker/utils/color-picker/cmyk.ts +5 -5
  52. package/color-picker/utils/color-picker/draggable.ts +14 -15
  53. package/color-picker/utils/color-picker/format.ts +21 -26
  54. package/color-picker/utils/color-picker/gradient.ts +35 -41
  55. package/color-picker/utils/color-picker/types.ts +4 -4
  56. package/config-provider/ConfigContext.tsx +1 -0
  57. package/config-provider/ConfigProvider.tsx +18 -1
  58. package/config-provider/type.ts +5 -0
  59. package/dialog/_example/base.tsx +27 -0
  60. package/dialog/_example/confirm-loading.tsx +32 -0
  61. package/dialog/_example/custom-buttons.tsx +24 -0
  62. package/dialog/_example/full-screen.tsx +26 -0
  63. package/dialog/_example/hide-buttons.tsx +39 -0
  64. package/dialog/_example/modeless.tsx +25 -0
  65. package/dialog/_example/placement.tsx +40 -0
  66. package/dialog/_example/plugin-example.tsx +69 -0
  67. package/dialog/_example/themes.tsx +41 -0
  68. package/drawer/Drawer.tsx +17 -9
  69. package/drawer/_example/custom-header-footer.tsx +29 -0
  70. package/drawer/_example/default.tsx +20 -0
  71. package/drawer/_example/events.tsx +53 -0
  72. package/drawer/_example/no-footer.tsx +20 -0
  73. package/drawer/_example/no-overlay.tsx +20 -0
  74. package/drawer/_example/placement.tsx +43 -0
  75. package/drawer/_example/size-draggable.tsx +26 -0
  76. package/drawer/_example/size.tsx +40 -0
  77. package/drawer/defaultProps.ts +1 -1
  78. package/fireworks/Fireworks.tsx +1 -10
  79. package/fireworks/index.ts +0 -1
  80. package/fireworks/type.ts +0 -1
  81. package/form/_example/complex.tsx +76 -0
  82. package/form/_example/default.tsx +58 -0
  83. package/form/_example/disabled.tsx +26 -0
  84. package/form/_example/form-list.tsx +74 -0
  85. package/form/_example/inline-layout.tsx +20 -0
  86. package/form/_example/label-align.tsx +46 -0
  87. package/form/_example/methods.tsx +66 -0
  88. package/form/_example/validation.tsx +71 -0
  89. package/form/hooks/useFormItemStyle.tsx +19 -7
  90. package/form/index.ts +20 -2
  91. package/global-config/default-config.ts +28 -28
  92. package/global-config/locale/ar_KW.ts +176 -187
  93. package/global-config/locale/en_US.ts +180 -195
  94. package/global-config/locale/it_IT.ts +174 -197
  95. package/global-config/locale/ja_JP.ts +178 -193
  96. package/global-config/locale/ko_KR.ts +178 -193
  97. package/global-config/locale/ru_RU.ts +189 -200
  98. package/global-config/locale/zh_CN.ts +179 -193
  99. package/global-config/locale/zh_TW.ts +178 -192
  100. package/global-config/mobile/default-config.ts +3 -3
  101. package/global-config/mobile/locale/ar_KW.ts +76 -77
  102. package/global-config/mobile/locale/en_US.ts +76 -77
  103. package/global-config/mobile/locale/it_IT.ts +76 -77
  104. package/global-config/mobile/locale/ja_JP.ts +64 -65
  105. package/global-config/mobile/locale/ko_KR.ts +64 -65
  106. package/global-config/mobile/locale/ru_RU.ts +76 -77
  107. package/global-config/mobile/locale/zh_CN.ts +64 -65
  108. package/global-config/mobile/locale/zh_TW.ts +64 -65
  109. package/global-config/t.ts +12 -12
  110. package/hooks/useDebounce.ts +27 -0
  111. package/hooks/useLastest.ts +6 -2
  112. package/hooks/useResizeObserve.ts +0 -1
  113. package/index.ts +1 -1
  114. package/input/Input.tsx +53 -10
  115. package/input/_example/auto-width.tsx +14 -0
  116. package/input/_example/borderless.tsx +17 -0
  117. package/input/_example/clearable.tsx +14 -0
  118. package/input/_example/default.tsx +10 -0
  119. package/input/_example/disabled-readonly.tsx +12 -0
  120. package/input/_example/events.tsx +42 -0
  121. package/input/_example/group.tsx +14 -0
  122. package/input/_example/label-suffix.tsx +12 -0
  123. package/input/_example/max-length.tsx +11 -0
  124. package/input/_example/password.tsx +14 -0
  125. package/input/_example/sizes.tsx +12 -0
  126. package/input/_example/status.tsx +13 -0
  127. package/input/_example/text-align.tsx +12 -0
  128. package/input/_example/with-icon.tsx +13 -0
  129. package/input/type.ts +3 -0
  130. package/input/useLengthLimit.ts +122 -0
  131. package/input-number/_example/align.tsx +23 -0
  132. package/input-number/_example/auto-width.tsx +8 -0
  133. package/input-number/_example/default.tsx +8 -0
  134. package/input-number/_example/events.tsx +45 -0
  135. package/input-number/_example/format.tsx +27 -0
  136. package/input-number/_example/large-number.tsx +17 -0
  137. package/input-number/_example/min-max.tsx +14 -0
  138. package/input-number/_example/sizes.tsx +35 -0
  139. package/input-number/_example/status.tsx +65 -0
  140. package/input-number/_example/step-and-decimal.tsx +14 -0
  141. package/input-number/_example/themes.tsx +21 -0
  142. package/input-number/_example/with-suffix.tsx +12 -0
  143. package/ip-input/_example/controlled.tsx +26 -0
  144. package/ip-input/_example/default.tsx +12 -0
  145. package/ip-input/_example/full-featured.tsx +32 -0
  146. package/ip-input/_example/ipv6.tsx +23 -0
  147. package/ip-input/_example/keyboard-navigation.tsx +19 -0
  148. package/ip-input/_example/paste-demo.tsx +23 -0
  149. package/ip-input/_example/states.tsx +21 -0
  150. package/ip-input/_example/with-cidr.tsx +23 -0
  151. package/layout/_example/combine-left.tsx +54 -0
  152. package/layout/_example/combine-right.tsx +54 -0
  153. package/layout/_example/custom-aside-width.tsx +56 -0
  154. package/layout/_example/custom-height.tsx +45 -0
  155. package/layout/_example/double-sidebar.tsx +57 -0
  156. package/layout/_example/side-navigation-right.tsx +51 -0
  157. package/layout/_example/side-navigation.tsx +51 -0
  158. package/layout/_example/top-navigation.tsx +41 -0
  159. package/list/_example/async-loading.tsx +46 -0
  160. package/list/_example/default.tsx +23 -0
  161. package/list/_example/header-footer.tsx +40 -0
  162. package/list/_example/multiline.tsx +24 -0
  163. package/list/_example/scroll-loading.tsx +69 -0
  164. package/list/_example/sizes.tsx +45 -0
  165. package/list/_example/split.tsx +36 -0
  166. package/list/_example/stripe.tsx +24 -0
  167. package/list/_example/virtual-scroll.tsx +51 -0
  168. package/list/_example/with-image.tsx +26 -0
  169. package/loading/_example/default.tsx +6 -0
  170. package/loading/_example/delay.tsx +53 -0
  171. package/loading/_example/fullscreen.tsx +29 -0
  172. package/loading/_example/inherit-color.tsx +24 -0
  173. package/loading/_example/no-overlay.tsx +15 -0
  174. package/loading/_example/sizes.tsx +25 -0
  175. package/loading/_example/with-text.tsx +12 -0
  176. package/loading/_example/wrapper.tsx +30 -0
  177. package/notification/_example/default.tsx +31 -0
  178. package/notification/_example/long-content.tsx +37 -0
  179. package/notification/_example/stacking.tsx +40 -0
  180. package/notification/_example/types.tsx +78 -0
  181. package/notification/_example/usage-example.tsx +62 -0
  182. package/package.json +4 -3
  183. package/popup/Popup.tsx +17 -5
  184. package/popup/_example/controlled.tsx +32 -0
  185. package/popup/_example/custom-content.tsx +64 -0
  186. package/popup/_example/default.tsx +19 -0
  187. package/popup/_example/delay.tsx +35 -0
  188. package/popup/_example/disabled.tsx +17 -0
  189. package/popup/_example/no-arrow.tsx +17 -0
  190. package/popup/_example/placements.tsx +61 -0
  191. package/popup/_example/triggers.tsx +26 -0
  192. package/radio/_example/allow-uncheck.tsx +19 -0
  193. package/radio/_example/button-style.tsx +40 -0
  194. package/radio/_example/controlled.tsx +13 -0
  195. package/radio/_example/default.tsx +13 -0
  196. package/radio/_example/group-disabled.tsx +22 -0
  197. package/radio/_example/group-with-options.tsx +20 -0
  198. package/radio/_example/group.tsx +19 -0
  199. package/radio/_example/sizes.tsx +37 -0
  200. package/radio/_example/states.tsx +20 -0
  201. package/select/_example/collapsed.tsx +30 -0
  202. package/select/_example/creatable.tsx +36 -0
  203. package/select/_example/custom-content.tsx +26 -0
  204. package/select/_example/default.tsx +29 -0
  205. package/select/_example/disabled.tsx +20 -0
  206. package/select/_example/filterable.tsx +27 -0
  207. package/select/_example/group-options.tsx +44 -0
  208. package/select/_example/label-suffix.tsx +24 -0
  209. package/select/_example/loading.tsx +19 -0
  210. package/select/_example/multiple.tsx +31 -0
  211. package/select/_example/sizes.tsx +20 -0
  212. package/select/_example/status.tsx +27 -0
  213. package/slider/Slider.tsx +13 -5
  214. package/slider/_example/custom-label.tsx +19 -0
  215. package/slider/_example/default.tsx +14 -0
  216. package/slider/_example/disabled.tsx +17 -0
  217. package/slider/_example/marks.tsx +31 -0
  218. package/slider/_example/range.tsx +16 -0
  219. package/slider/_example/step.tsx +14 -0
  220. package/slider/_example/vertical.tsx +26 -0
  221. package/slider/_example/with-input-number.tsx +21 -0
  222. package/slider/type.ts +1 -1
  223. package/styles/_vars.scss +16 -0
  224. package/styles/components/button/_index.scss +3 -3
  225. package/styles/components/dialog/_index.scss +18 -20
  226. package/styles/components/drawer/_index.scss +4 -3
  227. package/styles/components/drawer/_var.scss +1 -1
  228. package/styles/components/form/_index.scss +7 -6
  229. package/styles/components/input/_mixins.scss +7 -5
  230. package/styles/components/input-number/_index.scss +13 -12
  231. package/styles/components/list/_index.scss +5 -5
  232. package/styles/components/notification/_index.scss +4 -4
  233. package/styles/components/slider/_index.scss +8 -8
  234. package/styles/components/switch/_index.scss +98 -15
  235. package/styles/components/table/_index.scss +37 -29
  236. package/styles/components/tabs/_index.scss +8 -9
  237. package/styles/components/tooltip/_index.scss +104 -0
  238. package/styles/components/tooltip/_vars.scss +23 -0
  239. package/switch/_example/async-change.tsx +25 -0
  240. package/switch/_example/before-change.tsx +22 -0
  241. package/switch/_example/controlled.tsx +14 -0
  242. package/switch/_example/custom-value.tsx +21 -0
  243. package/switch/_example/default.tsx +6 -0
  244. package/switch/_example/disabled.tsx +25 -0
  245. package/switch/_example/loading.tsx +17 -0
  246. package/switch/_example/sizes.tsx +21 -0
  247. package/switch/_example/with-label.tsx +21 -0
  248. package/tab/TabPanel.tsx +9 -6
  249. package/tab/_example/addable.tsx +45 -0
  250. package/tab/_example/card-theme.tsx +22 -0
  251. package/tab/_example/default.tsx +22 -0
  252. package/tab/_example/disabled.tsx +38 -0
  253. package/tab/_example/lazy.tsx +25 -0
  254. package/tab/_example/placement.tsx +36 -0
  255. package/tab/_example/removable.tsx +31 -0
  256. package/tab/_example/sizes.tsx +31 -0
  257. package/tab/_example/with-action.tsx +26 -0
  258. package/table/Cell.tsx +3 -6
  259. package/table/Ellipsis.tsx +73 -0
  260. package/table/_example/alignment.tsx +46 -0
  261. package/table/_example/auto-width.tsx +47 -0
  262. package/table/_example/bordered-stripe-hover.tsx +42 -0
  263. package/table/_example/bordered.tsx +42 -0
  264. package/table/_example/cell-click.tsx +52 -0
  265. package/table/_example/complex.tsx +82 -0
  266. package/table/_example/custom-cell.tsx +68 -0
  267. package/table/_example/custom-empty.tsx +37 -0
  268. package/table/_example/custom-row-class-name.tsx +57 -0
  269. package/table/_example/default.tsx +42 -0
  270. package/table/_example/ellipsis.tsx +56 -0
  271. package/table/_example/empty.tsx +28 -0
  272. package/table/_example/fixed-width.tsx +48 -0
  273. package/table/_example/hover.tsx +42 -0
  274. package/table/_example/row-click.tsx +52 -0
  275. package/table/_example/sizes.tsx +57 -0
  276. package/table/_example/stripe.tsx +42 -0
  277. package/table/_example/vertical-align.tsx +110 -0
  278. package/table/hooks/useTableClassName.ts +3 -3
  279. package/table/index.ts +2 -0
  280. package/table/type.ts +1 -0
  281. package/tag/Tag.tsx +1 -1
  282. package/tag/_example/closable.tsx +44 -0
  283. package/tag/_example/default.tsx +17 -0
  284. package/tag/_example/disabled.tsx +19 -0
  285. package/tag/_example/sizes.tsx +18 -0
  286. package/tag/_example/variants.tsx +37 -0
  287. package/tag-input/_example/collapsed.tsx +27 -0
  288. package/tag-input/_example/controlled-uncontrolled.tsx +26 -0
  289. package/tag-input/_example/default.tsx +15 -0
  290. package/tag-input/_example/disabled-readonly.tsx +21 -0
  291. package/tag-input/_example/events.tsx +64 -0
  292. package/tag-input/_example/excess-display.tsx +27 -0
  293. package/tag-input/_example/max-tags.tsx +22 -0
  294. package/tag-input/_example/sizes.tsx +21 -0
  295. package/tag-input/_example/status.tsx +37 -0
  296. package/tag-input/_example/with-label.tsx +23 -0
  297. package/tag-input/hooks/useTagList.tsx +1 -1
  298. package/tooltip/Tooltip.tsx +76 -0
  299. package/tooltip/_example/base.tsx +26 -0
  300. package/tooltip/_example/custom-content.tsx +47 -0
  301. package/tooltip/_example/placement.tsx +33 -0
  302. package/tooltip/_example/theme.tsx +34 -0
  303. package/tooltip/defaultProps.ts +14 -0
  304. package/tooltip/index.ts +7 -0
  305. package/tooltip/style/index.js +1 -0
  306. package/tooltip/type.ts +99 -0
  307. package/utils/log/index.ts +1 -1
  308. package/utils/log/log.ts +2 -3
  309. package/utils/log/types.ts +1 -4
@@ -1,17 +1,17 @@
1
1
  @use "../../_vars.scss" as *;
2
2
  // 组件允许单个组件打包,因此默认引入公共基础样式
3
3
 
4
- @use '../../_vars.scss' as *;
4
+ @use "../../_vars.scss" as *;
5
5
 
6
- @use './_vars.scss' as *;
6
+ @use "./_vars.scss" as *;
7
7
 
8
- @use './_animate.scss' as *;
8
+ @use "./_animate.scss" as *;
9
9
 
10
- @use './_mixins.scss' as *;
10
+ @use "./_mixins.scss" as *;
11
11
 
12
- @use '../../mixins/_reset.scss' as *;
12
+ @use "../../mixins/_reset.scss" as *;
13
13
 
14
- @use '../../mixins/_scrollbar.scss' as *;
14
+ @use "../../mixins/_scrollbar.scss" as *;
15
15
 
16
16
  // <name> 替换为组件名
17
17
  .#{$prefix}-dialog {
@@ -64,7 +64,7 @@
64
64
  font-size: $dialog-icon-size;
65
65
  display: inline-flex;
66
66
  align-items: center;
67
- margin-right: $dialog-header-icon-margin-right;
67
+ margin-inline-end: $dialog-header-icon-margin-right;
68
68
  flex-shrink: 0;
69
69
  }
70
70
  }
@@ -106,9 +106,7 @@
106
106
 
107
107
  box-sizing: border-box;
108
108
  padding: $dialog-body-padding-fullscreen;
109
- height: calc(
110
- 100% - $dialog-header-height-fullscreen - $dialog-footer-height-fullscreen
111
- );
109
+ height: calc(100% - $dialog-header-height-fullscreen - $dialog-footer-height-fullscreen);
112
110
  overflow: auto;
113
111
  }
114
112
 
@@ -121,10 +119,10 @@
121
119
 
122
120
  &__footer {
123
121
  width: 100%;
124
- text-align: right;
122
+ text-align: end;
125
123
  padding: $dialog-footer-padding;
126
124
  .#{$prefix}-button + .#{$prefix}-button {
127
- margin-left: $dialog-footer-button-margin-left;
125
+ margin-inline-start: $dialog-footer-button-margin-left;
128
126
  }
129
127
  }
130
128
 
@@ -202,7 +200,7 @@
202
200
  width: 100%;
203
201
  height: 100%;
204
202
 
205
- // modeless 点击穿�?即可以操作背景后的元�?
203
+ // modeless 点击穿�?即可以操作背景后的元�?
206
204
  &.#{$prefix}-dialog__ctx--modeless {
207
205
  pointer-events: none;
208
206
  }
@@ -238,7 +236,7 @@
238
236
  &.#{$prefix}-not-display {
239
237
  display: none;
240
238
  }
241
- // 遮罩�?
239
+ // 遮罩�?
242
240
  .#{$prefix}-dialog__mask {
243
241
  position: fixed;
244
242
  top: 0;
@@ -249,7 +247,7 @@
249
247
  background: $dialog-mask-bg-color;
250
248
  pointer-events: auto;
251
249
  }
252
- // wrap 滚动的显示层 固定为页面窗口大�?
250
+ // wrap 滚动的显示层 固定为页面窗口大�?
253
251
  .#{$prefix}-dialog__wrap {
254
252
  position: fixed;
255
253
  top: 0;
@@ -260,22 +258,22 @@
260
258
  overflow: auto;
261
259
  @include scrollbar(8px, 2px);
262
260
  }
263
- // 定位�?用于实现居中 或者距离顶�?定位
261
+ // 定位�?用于实现居中 或者距离顶�?定位
264
262
  .#{$prefix}-dialog__position {
265
- // 因为内容会超�?使用flex布局
263
+ // 因为内容会超�?使用flex布局
266
264
  display: flex;
267
265
  justify-content: center;
268
266
  min-height: 100%;
269
267
  width: 100%;
270
268
  // 通过修改position为absolute进行拖拽定位
271
269
  position: relative;
272
- // 设置最小距离顶部底部距�?
270
+ // 设置最小距离顶部底部距�?
273
271
  padding: 48px 0;
274
272
  box-sizing: border-box;
275
273
  // 居中和距顶部布局
276
274
  &.#{$prefix}-dialog--top {
277
275
  align-items: flex-start;
278
- // 这里top api实现 更改padding 因为子元素拖拽定�?如果使用子元素margin 拖拽时需要计算margin 比较麻烦
276
+ // 这里top api实现 更改padding 因为子元素拖拽定�?如果使用子元素margin 拖拽时需要计算margin 比较麻烦
279
277
  padding-top: $dialog-top-position-top;
280
278
  }
281
279
  // 垂直居中布局
@@ -285,7 +283,7 @@
285
283
  }
286
284
 
287
285
  .#{$prefix}-dialog__position_fullscreen {
288
- // 因为内容会超�?使用flex布局
286
+ // 因为内容会超�?使用flex布局
289
287
  display: flex;
290
288
  justify-content: center;
291
289
  min-height: 100%;
@@ -141,11 +141,11 @@
141
141
  box-sizing: border-box;
142
142
 
143
143
  .#{$prefix}-button {
144
- margin-left: $drawer-footer-btn-margin-left;
144
+ margin-inline-start: $drawer-footer-btn-margin-left;
145
145
  }
146
146
 
147
147
  .#{$prefix}-button:first-child {
148
- margin-left: 0;
148
+ margin-inline-start: 0;
149
149
  }
150
150
  }
151
151
 
@@ -157,7 +157,7 @@
157
157
  width: $drawer-close-btn-size;
158
158
  height: $drawer-close-btn-size;
159
159
  top: calc((#{$drawer-header-height} - #{$drawer-close-btn-size}) / 2);
160
- right: $drawer-close-btn-position-right;
160
+ inset-inline-end: $drawer-close-btn-position-right;
161
161
  color: $drawer-close-btn-color;
162
162
  background-color: $drawer-close-btn-bg-color;
163
163
  border-radius: $border-radius-default;
@@ -203,3 +203,4 @@
203
203
  [tabindex="-1"]:focus {
204
204
  outline: none !important;
205
205
  }
206
+
@@ -47,7 +47,7 @@ $drawer-footer-btn-margin-left: $comp-margin-s;
47
47
  * 位置
48
48
  */
49
49
  $drawer-close-btn-position-right: $comp-margin-s;
50
- $drawer-footer-text-align: left;
50
+ $drawer-footer-text-align: start;
51
51
 
52
52
  /**
53
53
  * 边框弧度
@@ -38,7 +38,7 @@
38
38
 
39
39
  &__label {
40
40
  float: left;
41
- padding-right: $form-label-padding-right;
41
+ padding-inline-end: $form-label-padding-right;
42
42
  vertical-align: middle;
43
43
  line-height: $form-item-control-height;
44
44
  color: $form-color-label;
@@ -61,7 +61,7 @@
61
61
  &--required:not(.#{$prefix}-form__label--required-right) {
62
62
  label::before {
63
63
  display: inline-block;
64
- margin-right: $form-label-margin-right-required;
64
+ margin-inline-end: $form-label-margin-right-required;
65
65
  color: $form-color-error;
66
66
  line-height: $form-label-line-height;
67
67
  content: '*';
@@ -71,7 +71,7 @@
71
71
  &--required-right {
72
72
  label::after {
73
73
  display: inline-block;
74
- margin-left: $form-label-margin-left-required;
74
+ margin-inline-start: $form-label-margin-left-required;
75
75
  color: $form-color-error;
76
76
  line-height: $form-label-line-height;
77
77
  content: '*';
@@ -101,7 +101,7 @@
101
101
  // formItem 嵌套情况无间�?
102
102
  .#{$prefix}-form__item {
103
103
  margin-bottom: 0;
104
- margin-right: $form-item-margin-right-inline;
104
+ margin-inline-end: $form-item-margin-right-inline;
105
105
  }
106
106
  }
107
107
 
@@ -133,7 +133,7 @@
133
133
  }
134
134
 
135
135
  button + button {
136
- margin-left: $form-status-button-margin;
136
+ margin-inline-start: $form-status-button-margin;
137
137
  }
138
138
  }
139
139
  }
@@ -147,7 +147,7 @@
147
147
  margin: 0;
148
148
  min-width: 200px;
149
149
  display: inline-block;
150
- margin-right: $form-item-margin-right-inline;
150
+ margin-inline-end: $form-item-margin-right-inline;
151
151
  }
152
152
  }
153
153
 
@@ -173,3 +173,4 @@
173
173
  // 输入框状�?
174
174
  @include input-status(warning);
175
175
  @include input-status(error);
176
+
@@ -73,18 +73,20 @@
73
73
  }
74
74
  }
75
75
 
76
- // 状态样式:需使用map-get 和 #{} 来拼接变量名
76
+ // 状态样式:使用 map-get 从映射中获取颜色值
77
77
  @mixin input-status($status) {
78
78
  &.#{$prefix}-is-#{$status} {
79
- border-color: #000;
80
-
79
+ border-color: map-get(map-get($input-color, border), $status);
80
+ &:hover {
81
+ border-color: map-get(map-get($input-color, border), $status);
82
+ }
81
83
  &:focus,
82
84
  &.#{$prefix}-input--focused {
83
- box-shadow: 0 0 0 2px #000;
85
+ box-shadow: 0 0 0 2px map-get(map-get($input-color, box-shadow), $status);
84
86
  }
85
87
 
86
88
  & > .#{$prefix}-input__extra {
87
- color: #000;
89
+ color: map-get(map-get($input-color, extra), $status);
88
90
  }
89
91
  }
90
92
  }
@@ -21,7 +21,7 @@ $inputNumberCls: "#{$prefix}-input-number";
21
21
 
22
22
  &:not(&--column) {
23
23
  > .#{$prefix}-input-number__decrease + .#{$prefix}-input__wrap {
24
- margin-left: $comp-margin-xs;
24
+ margin-inline-start: $comp-margin-xs;
25
25
  }
26
26
  }
27
27
 
@@ -36,15 +36,15 @@ $inputNumberCls: "#{$prefix}-input-number";
36
36
 
37
37
  > .#{$prefix}-input__tips {
38
38
  position: absolute;
39
- left: 0;
39
+ inset-inline-start: 0;
40
40
  }
41
41
 
42
42
  // 输入框和右置内容之间需要间距 input + .#{$prefix}-input__suffix {
43
- margin-left: $input-number-padding-horizontal-default;
43
+ margin-inline-start: $input-number-padding-horizontal-default;
44
44
  }
45
45
 
46
46
  .#{$prefix}-input__prefix {
47
- margin-right: $input-number-padding-horizontal-default;
47
+ margin-inline-end: $input-number-padding-horizontal-default;
48
48
  }
49
49
 
50
50
  .#{$inputCls} {
@@ -127,11 +127,11 @@ $inputNumberCls: "#{$prefix}-input-number";
127
127
  }
128
128
 
129
129
  .#{$inputNumberCls}__decrease {
130
- left: 0;
130
+ inset-inline-start: 0;
131
131
  }
132
132
 
133
133
  .#{$inputNumberCls}__increase {
134
- right: -8px;
134
+ inset-inline-end: -8px;
135
135
  }
136
136
 
137
137
  .#{$inputNumberCls}.#{$prefix}-is-disabled {
@@ -197,7 +197,7 @@ $inputNumberCls: "#{$prefix}-input-number";
197
197
  .#{$inputCls} {
198
198
  height: $input-number-inner-height-l;
199
199
  line-height: $input-number-inner-height-l;
200
- padding-right: calc($input-number-right-button-width-l + $input-number-padding-horizontal-default);
200
+ padding-inline-end: calc($input-number-right-button-width-l + $input-number-padding-horizontal-default);
201
201
  }
202
202
 
203
203
  .#{$inputNumberCls}__decrease,
@@ -252,7 +252,7 @@ $inputNumberCls: "#{$prefix}-input-number";
252
252
  width: 100%;
253
253
  box-sizing: border-box;
254
254
  margin: 0;
255
- padding-right: calc($input-number-right-button-width + $input-number-padding-horizontal-default);
255
+ padding-inline-end: calc($input-number-right-button-width + $input-number-padding-horizontal-default);
256
256
  border-radius: $border-radius-default;
257
257
  }
258
258
 
@@ -261,9 +261,9 @@ $inputNumberCls: "#{$prefix}-input-number";
261
261
  width: $input-number-right-button-width;
262
262
  height: $input-number-button-column-height;
263
263
  border: 0;
264
- left: initial;
264
+ inset-inline-start: auto;
265
265
  top: initial;
266
- right: 1px;
266
+ inset-inline-end: 1px;
267
267
  border-radius: 0;
268
268
  background: $input-number-right-button-bg-color;
269
269
  opacity: 0;
@@ -343,9 +343,10 @@ $inputNumberCls: "#{$prefix}-input-number";
343
343
  .#{$inputNumberCls}--row {
344
344
  .#{$prefix}-input__wrap {
345
345
  width: initial;
346
- margin-right: $comp-margin-xs;
346
+ margin-inline-end: $comp-margin-xs;
347
347
  }
348
348
  .#{$prefix}-input-number__increase {
349
- right: 0;
349
+ inset-inline-end: 0;
350
350
  }
351
351
  }
352
+
@@ -30,7 +30,7 @@
30
30
  &::after {
31
31
  content: "";
32
32
  position: absolute;
33
- left: 0;
33
+ inset-inline-start: 0;
34
34
  bottom: 0;
35
35
  width: 100%;
36
36
  height: 1px;
@@ -54,7 +54,7 @@
54
54
  border-radius: calc($list-avatar-size / 2);
55
55
  overflow: hidden;
56
56
  background: $list-avatar-bg-color;
57
- margin-right: $list-avatar-margin-right;
57
+ margin-inline-end: $list-avatar-margin-right;
58
58
  flex-shrink: 0;
59
59
 
60
60
  img {
@@ -72,7 +72,7 @@
72
72
  }
73
73
 
74
74
  &-description {
75
- margin-right: $list-meta-description-margin-right;
75
+ margin-inline-end: $list-meta-description-margin-right;
76
76
  color: $list-meta-description-color;
77
77
  }
78
78
  }
@@ -86,7 +86,7 @@
86
86
  display: inline-block;
87
87
 
88
88
  &:not(:last-child) {
89
- margin-right: $list-action-margin-right;
89
+ margin-inline-end: $list-action-margin-right;
90
90
  }
91
91
 
92
92
  .t-icon {
@@ -163,7 +163,7 @@
163
163
 
164
164
  .#{$prefix}-loading {
165
165
  font-size: $list-load-font-size;
166
- margin-right: $list-load-icon-margin;
166
+ margin-inline-end: $list-load-icon-margin;
167
167
  }
168
168
 
169
169
  .#{$prefix}-loading.#{$prefix}-is-load-more {
@@ -10,15 +10,15 @@
10
10
 
11
11
  .#{$prefix}-notify {
12
12
  &[data-x-position='right'] {
13
- right: 8px;
13
+ inset-inline-end: 8px;
14
14
  }
15
15
 
16
16
  &[data-x-position='left'] {
17
- left: 8px;
17
+ inset-inline-start: 8px;
18
18
  }
19
19
 
20
20
  &[data-x-position='center'] {
21
- left: 50%;
21
+ inset-inline-start: 50%;
22
22
  transform: translateX(-50%);
23
23
  }
24
24
 
@@ -90,7 +90,7 @@
90
90
  &__icon {
91
91
  width: $notification-icon-width;
92
92
  text-align: center;
93
- margin-right: $notification-icon-margin-right;
93
+ margin-inline-end: $notification-icon-margin-right;
94
94
 
95
95
  .t-icon {
96
96
  font-size: $notification-icon-font-size;
@@ -11,11 +11,11 @@
11
11
  .#{$prefix}-slider__input-container {
12
12
  display: flex;
13
13
  align-items: center;
14
- margin-left: $slider-input-margin-left;
14
+ margin-inline-start: $slider-input-margin-left;
15
15
 
16
16
  &.is-vertical {
17
17
  padding-top: $slider-input-vertical-padding-top;
18
- margin-left: $slider-input-vertical-margin-left;
18
+ margin-inline-start: $slider-input-vertical-margin-left;
19
19
  }
20
20
 
21
21
  .#{$prefix}-slider__center-line {
@@ -120,7 +120,7 @@
120
120
  &__mark {
121
121
  position: absolute;
122
122
  top: 2px;
123
- left: 0;
123
+ inset-inline-start: 0;
124
124
  width: 100%;
125
125
  }
126
126
 
@@ -168,14 +168,14 @@
168
168
 
169
169
  .#{$prefix}-slider__handle {
170
170
  margin-top: $slider-vertical-handle-margin-top;
171
- margin-left: $slider-vertical-handle-margin-left;
171
+ margin-inline-start: $slider-vertical-handle-margin-left;
172
172
  top: auto;
173
173
  transform: translateY(50%);
174
174
  }
175
175
 
176
176
  .#{$prefix}-slider__mark {
177
177
  top: 0;
178
- left: 12px;
178
+ inset-inline-start: 12px;
179
179
  width: $slider-vertical-mark-width;
180
180
  height: 100%;
181
181
  }
@@ -183,14 +183,14 @@
183
183
  .#{$prefix}-slider__stop {
184
184
  width: $slider-stop-height;
185
185
  height: $slider-stop-width;
186
- left: 4px;
186
+ inset-inline-start: 4px;
187
187
  background-color: $slider-background;
188
188
  }
189
189
 
190
190
  .#{$prefix}-slider__mark-text {
191
191
  transform: translateY(-50%);
192
192
  margin-top: $slider-vertical-text-margin-top;
193
- margin-left: $slider-vertical-text-margin-left;
193
+ margin-inline-start: $slider-vertical-text-margin-left;
194
194
  }
195
195
  }
196
196
 
@@ -198,7 +198,7 @@
198
198
  top: auto;
199
199
  position: absolute;
200
200
  z-index: 2;
201
- left: 50%;
201
+ inset-inline-start: 50%;
202
202
  transform: translate(-50%, 50%);
203
203
  background-color: transparent;
204
204
  text-align: center;
@@ -1,11 +1,11 @@
1
1
  @use "../../_vars.scss" as *;
2
- @use '../../_vars.scss' as *;
2
+ @use "../../_vars.scss" as *;
3
3
 
4
- @use './_vars.scss' as *;
4
+ @use "./_vars.scss" as *;
5
5
 
6
- @use './_mixins.scss' as *;
6
+ @use "./_mixins.scss" as *;
7
7
 
8
- @use '../../mixins/_reset.scss' as *;
8
+ @use "../../mixins/_reset.scss" as *;
9
9
 
10
10
  .#{$prefix}-switch {
11
11
  @include reset;
@@ -50,7 +50,7 @@
50
50
  }
51
51
 
52
52
  &::before {
53
- content: '';
53
+ content: "";
54
54
  position: absolute;
55
55
  top: 0;
56
56
  left: 0;
@@ -85,8 +85,7 @@
85
85
  display: inline-flex;
86
86
  align-items: center;
87
87
  color: $switch-content-color-unchecked;
88
- padding: 0 $switch-content-margin-right-default 0
89
- $switch-content-margin-left-default;
88
+ padding: 0 $switch-content-margin-right-default 0 $switch-content-margin-left-default;
90
89
  font-size: $switch-content-font-size-default;
91
90
  min-width: $switch-min-width-default;
92
91
  transition: $switch-content-transition;
@@ -106,18 +105,13 @@
106
105
  .#{$prefix}-switch__handle {
107
106
  left: calc(100% - $switch-width-border-check-default);
108
107
  transform: translate(-100%, 0);
109
- width: calc(
110
- $switch-height-default - 2 * $switch-width-border-check-default
111
- );
112
- height: calc(
113
- $switch-height-default - 2 * $switch-width-border-check-default
114
- );
108
+ width: calc($switch-height-default - 2 * $switch-width-border-check-default);
109
+ height: calc($switch-height-default - 2 * $switch-width-border-check-default);
115
110
  top: $switch-width-border-check-default;
116
111
  }
117
112
 
118
113
  .#{$prefix}-switch__content {
119
- padding: 0 $switch-content-margin-left-default 0
120
- $switch-content-margin-right-default;
114
+ padding: 0 $switch-content-margin-left-default 0 $switch-content-margin-right-default;
121
115
  color: $switch-content-color-checked;
122
116
  }
123
117
  }
@@ -169,6 +163,35 @@
169
163
  }
170
164
  }
171
165
 
166
+ [dir="rtl"] .#{$prefix}-switch {
167
+ &__handle {
168
+ left: auto;
169
+ right: $switch-width-border-default;
170
+ }
171
+
172
+ &:active:not(.#{$prefix}-is-disabled):not(.#{$prefix}-is-loading) {
173
+ .#{$prefix}-switch__handle::before {
174
+ left: -6px;
175
+ right: 0;
176
+ }
177
+
178
+ &.#{$prefix}-is-checked {
179
+ .#{$prefix}-switch__handle::before {
180
+ right: -6px;
181
+ left: 0;
182
+ }
183
+ }
184
+ }
185
+
186
+ &.#{$prefix}-is-checked {
187
+ .#{$prefix}-switch__handle {
188
+ right: auto;
189
+ left: $switch-width-border-check-default;
190
+ transform: none;
191
+ }
192
+ }
193
+ }
194
+
172
195
  .#{$prefix}-switch.#{$prefix}-size-l {
173
196
  min-width: $switch-min-width-l;
174
197
  height: $switch-height-l;
@@ -213,6 +236,7 @@
213
236
  &.#{$prefix}-is-checked {
214
237
  .#{$prefix}-switch__handle {
215
238
  left: calc(100% - $switch-width-border-check-l);
239
+ transform: translate(-100%, 0);
216
240
  top: $switch-width-border-check-l;
217
241
  width: calc($switch-height-l - 2 * $switch-width-border-check-l);
218
242
  height: calc($switch-height-l - 2 * $switch-width-border-check-l);
@@ -224,6 +248,35 @@
224
248
  }
225
249
  }
226
250
 
251
+ [dir="rtl"] .#{$prefix}-switch.#{$prefix}-size-l {
252
+ &:active:not(.#{$prefix}-is-disabled):not(.#{$prefix}-is-loading) {
253
+ .#{$prefix}-switch__handle::before {
254
+ left: -8px;
255
+ right: 0;
256
+ }
257
+
258
+ &.#{$prefix}-is-checked {
259
+ .#{$prefix}-switch__handle::before {
260
+ right: -8px;
261
+ left: 0;
262
+ }
263
+ }
264
+ }
265
+
266
+ .#{$prefix}-switch__handle {
267
+ left: auto;
268
+ right: $switch-width-border-l;
269
+ }
270
+
271
+ &.#{$prefix}-is-checked {
272
+ .#{$prefix}-switch__handle {
273
+ right: auto;
274
+ left: $switch-width-border-check-l;
275
+ transform: none;
276
+ }
277
+ }
278
+ }
279
+
227
280
  .#{$prefix}-switch.#{$prefix}-size-s {
228
281
  min-width: $switch-min-width-s;
229
282
  height: $switch-height-s;
@@ -268,6 +321,7 @@
268
321
  &.#{$prefix}-is-checked {
269
322
  .#{$prefix}-switch__handle {
270
323
  left: calc(100% - $switch-width-border-check-s);
324
+ transform: translate(-100%, 0);
271
325
  top: $switch-width-border-check-s;
272
326
  width: calc($switch-height-s - 2 * $switch-width-border-check-s);
273
327
  height: calc($switch-height-s - 2 * $switch-width-border-check-s);
@@ -278,3 +332,32 @@
278
332
  }
279
333
  }
280
334
  }
335
+
336
+ [dir="rtl"] .#{$prefix}-switch.#{$prefix}-size-s {
337
+ &:active:not(.#{$prefix}-is-disabled):not(.#{$prefix}-is-loading) {
338
+ .#{$prefix}-switch__handle::before {
339
+ left: -4px;
340
+ right: 0;
341
+ }
342
+
343
+ &.#{$prefix}-is-checked {
344
+ .#{$prefix}-switch__handle::before {
345
+ right: -4px;
346
+ left: 0;
347
+ }
348
+ }
349
+ }
350
+
351
+ .#{$prefix}-switch__handle {
352
+ left: auto;
353
+ right: $switch-width-border-s;
354
+ }
355
+
356
+ &.#{$prefix}-is-checked {
357
+ .#{$prefix}-switch__handle {
358
+ right: auto;
359
+ left: $switch-width-border-check-s;
360
+ transform: none;
361
+ }
362
+ }
363
+ }