@hsu-react/ui 2.2.12 → 2.2.14

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.
@@ -134,14 +134,18 @@
134
134
  // `.ant-select-content > input.ant-select-input`.
135
135
  :global(.ant-select-content),
136
136
  :global(.ant-select-input) {
137
- height: 100%;
138
-
139
137
  font-family: inherit;
140
138
  font-size: inherit;
141
139
  font-weight: inherit;
142
140
  color: inherit;
143
141
  }
144
142
 
143
+ // 高度只给 input。`.ant-select-content` 由 antd 用 `align-self: center` 在行里居中,
144
+ // 拉成 height: 100% 会让它自己撑满、居中失效,文字贴顶偏上。
145
+ :global(.ant-select-input) {
146
+ height: 100%;
147
+ }
148
+
145
149
  :global(.ant-select-placeholder) {
146
150
  display: inline-flex;
147
151
  align-items: center;
@@ -196,13 +200,13 @@
196
200
  }
197
201
  }
198
202
 
199
- // Both icons are laid out by v6's flexbox root, so the absolute-position compensation
200
- // (`inset-inline-end` / `translateY(-50%)`) that v5 needed is gone.
203
+ // 箭头由 v6 flex 根布局,居中不用补偿;**清除按钮不是** —— antd 仍然把它绝对定位,
204
+ // `top: 50%` `margin-top: -半个图标高` 拉回中线。把 margin-top 一并归零就只剩
205
+ // top: 50%,图标整个掉到中线以下(实测偏下 7px,正好半个 14px 图标)。
201
206
  :global(.ant-select-suffix),
202
207
  :global(.ant-select-clear) {
203
208
  width: 14px;
204
209
  height: 14px;
205
- margin-top: 0px;
206
210
 
207
211
  font-size: 14px;
208
212
 
@@ -210,6 +214,17 @@
210
214
 
211
215
  pointer-events: all;
212
216
  }
217
+
218
+ :global(.ant-select-suffix) {
219
+ margin-top: 0px;
220
+ }
221
+
222
+ // 与箭头对齐。antd 的 `inset-inline-end: 11px` 是按「控件自带 11px 横向内边距」算的,
223
+ // 而这份内边距被挪到了外层,`.ant-select` 的 padding 是 0——箭头(flex 末位子项)没有
224
+ // 这 11px,绝对定位的清除按钮却还有,于是悬浮时图标会往左跳一格。
225
+ :global(.ant-select-clear) {
226
+ inset-inline-end: 0px;
227
+ }
213
228
  }
214
229
  }
215
230
 
@@ -148,14 +148,21 @@
148
148
  // `.ant-select-content > input.ant-select-input`.
149
149
  :global(.ant-select-content),
150
150
  :global(.ant-select-input) {
151
- height: 100%;
152
-
153
151
  font-family: inherit;
154
152
  font-size: inherit;
155
153
  font-weight: inherit;
156
154
  color: inherit;
157
155
  }
158
156
 
157
+ // 高度只给 input:它是铺在控件上的那层输入框,要满高才好点。
158
+ //
159
+ // `.ant-select-content` **不能**给。antd 让它保持一行高(line-height 22px),再用
160
+ // `align-self: center` 在 32px 的行里居中;一旦拉成 height: 100%,它自己就撑满了,
161
+ // align-self 无事可做,22px 的行盒贴着顶边排,文字整体偏上(实测 5.5px)。
162
+ :global(.ant-select-input) {
163
+ height: 100%;
164
+ }
165
+
159
166
  :global(.ant-select-placeholder) {
160
167
  display: inline-flex;
161
168
  align-items: center;
@@ -205,7 +212,6 @@
205
212
  :global(.ant-select-clear) {
206
213
  width: 14px;
207
214
  height: 14px;
208
- margin-top: 0px;
209
215
 
210
216
  font-size: 14px;
211
217
 
@@ -214,6 +220,25 @@
214
220
  pointer-events: all;
215
221
  }
216
222
 
223
+ // 箭头是 `.ant-select` 的 flex 子项,靠 align-items: center 居中,margin 归零无副作用。
224
+ // 清除按钮不一样:它是绝对定位的,antd 靠 `top: 50%` 再配一个 `margin-top: -半个图标高`
225
+ // 把它拉回中线。上面那条规则从前把 margin-top 一并重置成 0,等于只做了 top: 50%
226
+ // 而没有回拉,图标就整个掉到中线以下(实测偏下 7px,正好是半个 14px 图标)。
227
+ // 所以这里只重置箭头的,清除按钮的 margin-top 交给 antd。
228
+ :global(.ant-select-suffix) {
229
+ margin-top: 0px;
230
+ }
231
+
232
+ // 清除按钮要和箭头落在同一个位置——悬浮时它顶替箭头出现,位置一变就是「跳一下」。
233
+ //
234
+ // antd 给它 `inset-inline-end: 11px`,那是按「控件自己带 11px 横向内边距」算的;
235
+ // 本组件把这份内边距挪到了外层 `.select`、把 `.ant-select` 的 padding 清成了 0,
236
+ // 于是这 11px 对箭头(flex 末位子项,右缘就是 `.ant-select` 的右缘)不再存在,
237
+ // 对绝对定位的清除按钮却还在,两者正好差一个 11px。归零即对齐。
238
+ :global(.ant-select-clear) {
239
+ inset-inline-end: 0px;
240
+ }
241
+
217
242
  &:global(.ant-select-multiple) {
218
243
  // Keep the search input from claiming a slot of its own between the tags.
219
244
  :global(.ant-select-input) {
@@ -134,14 +134,18 @@
134
134
  // `.ant-select-content > input.ant-select-input`.
135
135
  :global(.ant-select-content),
136
136
  :global(.ant-select-input) {
137
- height: 100%;
138
-
139
137
  font-family: inherit;
140
138
  font-size: inherit;
141
139
  font-weight: inherit;
142
140
  color: inherit;
143
141
  }
144
142
 
143
+ // 高度只给 input。`.ant-select-content` 由 antd 用 `align-self: center` 在行里居中,
144
+ // 拉成 height: 100% 会让它自己撑满、居中失效,文字贴顶偏上。
145
+ :global(.ant-select-input) {
146
+ height: 100%;
147
+ }
148
+
145
149
  :global(.ant-select-placeholder) {
146
150
  display: inline-flex;
147
151
  align-items: center;
@@ -196,13 +200,13 @@
196
200
  }
197
201
  }
198
202
 
199
- // Both icons are laid out by v6's flexbox root, so the absolute-position compensation
200
- // (`inset-inline-end` / `translateY(-50%)`) that v5 needed is gone.
203
+ // 箭头由 v6 flex 根布局,居中不用补偿;**清除按钮不是** —— antd 仍然把它绝对定位,
204
+ // `top: 50%` `margin-top: -半个图标高` 拉回中线。把 margin-top 一并归零就只剩
205
+ // top: 50%,图标整个掉到中线以下(实测偏下 7px,正好半个 14px 图标)。
201
206
  :global(.ant-select-suffix),
202
207
  :global(.ant-select-clear) {
203
208
  width: 14px;
204
209
  height: 14px;
205
- margin-top: 0px;
206
210
 
207
211
  font-size: 14px;
208
212
 
@@ -210,6 +214,17 @@
210
214
 
211
215
  pointer-events: all;
212
216
  }
217
+
218
+ :global(.ant-select-suffix) {
219
+ margin-top: 0px;
220
+ }
221
+
222
+ // 与箭头对齐。antd 的 `inset-inline-end: 11px` 是按「控件自带 11px 横向内边距」算的,
223
+ // 而这份内边距被挪到了外层,`.ant-select` 的 padding 是 0——箭头(flex 末位子项)没有
224
+ // 这 11px,绝对定位的清除按钮却还有,于是悬浮时图标会往左跳一格。
225
+ :global(.ant-select-clear) {
226
+ inset-inline-end: 0px;
227
+ }
213
228
  }
214
229
  }
215
230
 
@@ -148,14 +148,21 @@
148
148
  // `.ant-select-content > input.ant-select-input`.
149
149
  :global(.ant-select-content),
150
150
  :global(.ant-select-input) {
151
- height: 100%;
152
-
153
151
  font-family: inherit;
154
152
  font-size: inherit;
155
153
  font-weight: inherit;
156
154
  color: inherit;
157
155
  }
158
156
 
157
+ // 高度只给 input:它是铺在控件上的那层输入框,要满高才好点。
158
+ //
159
+ // `.ant-select-content` **不能**给。antd 让它保持一行高(line-height 22px),再用
160
+ // `align-self: center` 在 32px 的行里居中;一旦拉成 height: 100%,它自己就撑满了,
161
+ // align-self 无事可做,22px 的行盒贴着顶边排,文字整体偏上(实测 5.5px)。
162
+ :global(.ant-select-input) {
163
+ height: 100%;
164
+ }
165
+
159
166
  :global(.ant-select-placeholder) {
160
167
  display: inline-flex;
161
168
  align-items: center;
@@ -205,7 +212,6 @@
205
212
  :global(.ant-select-clear) {
206
213
  width: 14px;
207
214
  height: 14px;
208
- margin-top: 0px;
209
215
 
210
216
  font-size: 14px;
211
217
 
@@ -214,6 +220,25 @@
214
220
  pointer-events: all;
215
221
  }
216
222
 
223
+ // 箭头是 `.ant-select` 的 flex 子项,靠 align-items: center 居中,margin 归零无副作用。
224
+ // 清除按钮不一样:它是绝对定位的,antd 靠 `top: 50%` 再配一个 `margin-top: -半个图标高`
225
+ // 把它拉回中线。上面那条规则从前把 margin-top 一并重置成 0,等于只做了 top: 50%
226
+ // 而没有回拉,图标就整个掉到中线以下(实测偏下 7px,正好是半个 14px 图标)。
227
+ // 所以这里只重置箭头的,清除按钮的 margin-top 交给 antd。
228
+ :global(.ant-select-suffix) {
229
+ margin-top: 0px;
230
+ }
231
+
232
+ // 清除按钮要和箭头落在同一个位置——悬浮时它顶替箭头出现,位置一变就是「跳一下」。
233
+ //
234
+ // antd 给它 `inset-inline-end: 11px`,那是按「控件自己带 11px 横向内边距」算的;
235
+ // 本组件把这份内边距挪到了外层 `.select`、把 `.ant-select` 的 padding 清成了 0,
236
+ // 于是这 11px 对箭头(flex 末位子项,右缘就是 `.ant-select` 的右缘)不再存在,
237
+ // 对绝对定位的清除按钮却还在,两者正好差一个 11px。归零即对齐。
238
+ :global(.ant-select-clear) {
239
+ inset-inline-end: 0px;
240
+ }
241
+
217
242
  &:global(.ant-select-multiple) {
218
243
  // Keep the search input from claiming a slot of its own between the tags.
219
244
  :global(.ant-select-input) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hsu-react/ui",
3
- "version": "2.2.12",
3
+ "version": "2.2.14",
4
4
  "description": "一套基于 React + Ant Design 的中后台业务组件库",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -134,14 +134,18 @@
134
134
  // `.ant-select-content > input.ant-select-input`.
135
135
  :global(.ant-select-content),
136
136
  :global(.ant-select-input) {
137
- height: 100%;
138
-
139
137
  font-family: inherit;
140
138
  font-size: inherit;
141
139
  font-weight: inherit;
142
140
  color: inherit;
143
141
  }
144
142
 
143
+ // 高度只给 input。`.ant-select-content` 由 antd 用 `align-self: center` 在行里居中,
144
+ // 拉成 height: 100% 会让它自己撑满、居中失效,文字贴顶偏上。
145
+ :global(.ant-select-input) {
146
+ height: 100%;
147
+ }
148
+
145
149
  :global(.ant-select-placeholder) {
146
150
  display: inline-flex;
147
151
  align-items: center;
@@ -196,13 +200,13 @@
196
200
  }
197
201
  }
198
202
 
199
- // Both icons are laid out by v6's flexbox root, so the absolute-position compensation
200
- // (`inset-inline-end` / `translateY(-50%)`) that v5 needed is gone.
203
+ // 箭头由 v6 flex 根布局,居中不用补偿;**清除按钮不是** —— antd 仍然把它绝对定位,
204
+ // `top: 50%` `margin-top: -半个图标高` 拉回中线。把 margin-top 一并归零就只剩
205
+ // top: 50%,图标整个掉到中线以下(实测偏下 7px,正好半个 14px 图标)。
201
206
  :global(.ant-select-suffix),
202
207
  :global(.ant-select-clear) {
203
208
  width: 14px;
204
209
  height: 14px;
205
- margin-top: 0px;
206
210
 
207
211
  font-size: 14px;
208
212
 
@@ -210,6 +214,17 @@
210
214
 
211
215
  pointer-events: all;
212
216
  }
217
+
218
+ :global(.ant-select-suffix) {
219
+ margin-top: 0px;
220
+ }
221
+
222
+ // 与箭头对齐。antd 的 `inset-inline-end: 11px` 是按「控件自带 11px 横向内边距」算的,
223
+ // 而这份内边距被挪到了外层,`.ant-select` 的 padding 是 0——箭头(flex 末位子项)没有
224
+ // 这 11px,绝对定位的清除按钮却还有,于是悬浮时图标会往左跳一格。
225
+ :global(.ant-select-clear) {
226
+ inset-inline-end: 0px;
227
+ }
213
228
  }
214
229
  }
215
230
 
@@ -148,14 +148,21 @@
148
148
  // `.ant-select-content > input.ant-select-input`.
149
149
  :global(.ant-select-content),
150
150
  :global(.ant-select-input) {
151
- height: 100%;
152
-
153
151
  font-family: inherit;
154
152
  font-size: inherit;
155
153
  font-weight: inherit;
156
154
  color: inherit;
157
155
  }
158
156
 
157
+ // 高度只给 input:它是铺在控件上的那层输入框,要满高才好点。
158
+ //
159
+ // `.ant-select-content` **不能**给。antd 让它保持一行高(line-height 22px),再用
160
+ // `align-self: center` 在 32px 的行里居中;一旦拉成 height: 100%,它自己就撑满了,
161
+ // align-self 无事可做,22px 的行盒贴着顶边排,文字整体偏上(实测 5.5px)。
162
+ :global(.ant-select-input) {
163
+ height: 100%;
164
+ }
165
+
159
166
  :global(.ant-select-placeholder) {
160
167
  display: inline-flex;
161
168
  align-items: center;
@@ -205,7 +212,6 @@
205
212
  :global(.ant-select-clear) {
206
213
  width: 14px;
207
214
  height: 14px;
208
- margin-top: 0px;
209
215
 
210
216
  font-size: 14px;
211
217
 
@@ -214,6 +220,25 @@
214
220
  pointer-events: all;
215
221
  }
216
222
 
223
+ // 箭头是 `.ant-select` 的 flex 子项,靠 align-items: center 居中,margin 归零无副作用。
224
+ // 清除按钮不一样:它是绝对定位的,antd 靠 `top: 50%` 再配一个 `margin-top: -半个图标高`
225
+ // 把它拉回中线。上面那条规则从前把 margin-top 一并重置成 0,等于只做了 top: 50%
226
+ // 而没有回拉,图标就整个掉到中线以下(实测偏下 7px,正好是半个 14px 图标)。
227
+ // 所以这里只重置箭头的,清除按钮的 margin-top 交给 antd。
228
+ :global(.ant-select-suffix) {
229
+ margin-top: 0px;
230
+ }
231
+
232
+ // 清除按钮要和箭头落在同一个位置——悬浮时它顶替箭头出现,位置一变就是「跳一下」。
233
+ //
234
+ // antd 给它 `inset-inline-end: 11px`,那是按「控件自己带 11px 横向内边距」算的;
235
+ // 本组件把这份内边距挪到了外层 `.select`、把 `.ant-select` 的 padding 清成了 0,
236
+ // 于是这 11px 对箭头(flex 末位子项,右缘就是 `.ant-select` 的右缘)不再存在,
237
+ // 对绝对定位的清除按钮却还在,两者正好差一个 11px。归零即对齐。
238
+ :global(.ant-select-clear) {
239
+ inset-inline-end: 0px;
240
+ }
241
+
217
242
  &:global(.ant-select-multiple) {
218
243
  // Keep the search input from claiming a slot of its own between the tags.
219
244
  :global(.ant-select-input) {