@hsu-react/ui 2.4.6 → 2.4.7

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.
@@ -1,8 +1,12 @@
1
1
  .antdInput {
2
2
  width: 100%;
3
- height: 100%;
4
- // When the parent has no set height (height:100% resolves to auto), ensure a minimum height so the input is not squashed;
5
- // the inner .ant-input-wrapper / .ant-input inherit this value via min-height: inherit.
3
+ // The control height is a floor, not `height: 100%` — see the long note in
4
+ // `Select/index.module.scss`. Same failure: under a flex item stretched by a taller
5
+ // sibling, `height: 100%` inflates the input to the item's whole content box.
6
+ //
7
+ // The inner `height: 100%` rules below stay: when this root *is* stretched (as a flex
8
+ // child, or because the app asked for it), they propagate that height inward. They
9
+ // resolve to `auto` otherwise and fall back to `min-height: inherit`.
6
10
  min-height: var(--vita-control-height);
7
11
 
8
12
  :global(.ant-input-clear-icon) {
@@ -4,7 +4,10 @@
4
4
  --tree-switcher-gap: 0px;
5
5
 
6
6
  width: 100%;
7
- height: 100%;
7
+ // Control height as a floor, not `height: 100%` — same reason as `Select` (see the
8
+ // note there). TreeSelect had no `min-height` at all because `height: 100%` was doing
9
+ // that job by accident; dropping one without adding the other would collapse it.
10
+ min-height: var(--vita-control-height);
8
11
 
9
12
  // CF style: outlined input control that follows appearance switching.
10
13
  //
@@ -5,9 +5,24 @@
5
5
  align-items: center;
6
6
 
7
7
  width: 100%;
8
- height: 100%;
9
- // When the parent has no explicit height (height:100% resolves to auto), guarantee a min height
10
- // consistent with Input and other form controls, so it is neither squashed nor mis-sized in search rows.
8
+ // The control height is a floor, not `height: 100%`.
9
+ //
10
+ // `height: 100%` looks harmless because it resolves to `auto` under an auto-height
11
+ // parent — but the moment the parent has a *definite* height the control inflates to
12
+ // fill it, and the most common way a parent acquires one is by accident: a flex item
13
+ // stretched by a taller sibling. A card holding `<label> <Select> <hint>` where the
14
+ // hint wraps to two lines is enough — the Select swells to the card's whole content
15
+ // box (measured: 102px for a 32px control) and covers the label and the hint.
16
+ //
17
+ // This bit hsu-ui itself: `ChainGraph/SearchSelect` has to park the Select in a
18
+ // fixed 32px box, "preventing the Select root's height:100% from resolving against
19
+ // the graph and being stretched to the full graph height". Consumers hit it too and
20
+ // reach for the same wrapper, which is a workaround for a default that is wrong.
21
+ //
22
+ // Filling a deliberately sized parent still works without the declaration: as a flex
23
+ // child the default `align-self: stretch` fills the cross axis, and the inner
24
+ // `height: 100%` rules below then resolve against a genuinely definite height.
25
+ // A block parent that really wants a taller control can still say `height: 100%`.
11
26
  min-height: var(--vita-control-height);
12
27
  padding: 0px 11px;
13
28
 
@@ -118,7 +133,16 @@
118
133
  align-items: center;
119
134
 
120
135
  width: 100%;
121
- height: 100%;
136
+ // 撑满外壳用 align-self,不用 height: 100%。
137
+ //
138
+ // 外壳 `.select` 的高度是 `min-height` 撑出来的、`height` 仍是 auto,
139
+ // 百分比高度对着 auto 解析不出东西 —— 这一层会缩回内容高(实测 22px,
140
+ // 而外壳是 32px),上下各多出 5px 点不动的死区:看着是个 32px 的下拉框,
141
+ // 边缘一圈却没有反应。
142
+ //
143
+ // 外壳是 flex 且 align-items: center,所以这里要显式 stretch;
144
+ // 前后缀图标不受影响,它们该保持居中
145
+ align-self: stretch;
122
146
  margin: 0px !important;
123
147
 
124
148
  border-radius: inherit;
@@ -1,8 +1,12 @@
1
1
  .antdInput {
2
2
  width: 100%;
3
- height: 100%;
4
- // When the parent has no set height (height:100% resolves to auto), ensure a minimum height so the input is not squashed;
5
- // the inner .ant-input-wrapper / .ant-input inherit this value via min-height: inherit.
3
+ // The control height is a floor, not `height: 100%` — see the long note in
4
+ // `Select/index.module.scss`. Same failure: under a flex item stretched by a taller
5
+ // sibling, `height: 100%` inflates the input to the item's whole content box.
6
+ //
7
+ // The inner `height: 100%` rules below stay: when this root *is* stretched (as a flex
8
+ // child, or because the app asked for it), they propagate that height inward. They
9
+ // resolve to `auto` otherwise and fall back to `min-height: inherit`.
6
10
  min-height: var(--vita-control-height);
7
11
 
8
12
  :global(.ant-input-clear-icon) {
@@ -4,7 +4,10 @@
4
4
  --tree-switcher-gap: 0px;
5
5
 
6
6
  width: 100%;
7
- height: 100%;
7
+ // Control height as a floor, not `height: 100%` — same reason as `Select` (see the
8
+ // note there). TreeSelect had no `min-height` at all because `height: 100%` was doing
9
+ // that job by accident; dropping one without adding the other would collapse it.
10
+ min-height: var(--vita-control-height);
8
11
 
9
12
  // CF style: outlined input control that follows appearance switching.
10
13
  //
@@ -5,9 +5,24 @@
5
5
  align-items: center;
6
6
 
7
7
  width: 100%;
8
- height: 100%;
9
- // When the parent has no explicit height (height:100% resolves to auto), guarantee a min height
10
- // consistent with Input and other form controls, so it is neither squashed nor mis-sized in search rows.
8
+ // The control height is a floor, not `height: 100%`.
9
+ //
10
+ // `height: 100%` looks harmless because it resolves to `auto` under an auto-height
11
+ // parent — but the moment the parent has a *definite* height the control inflates to
12
+ // fill it, and the most common way a parent acquires one is by accident: a flex item
13
+ // stretched by a taller sibling. A card holding `<label> <Select> <hint>` where the
14
+ // hint wraps to two lines is enough — the Select swells to the card's whole content
15
+ // box (measured: 102px for a 32px control) and covers the label and the hint.
16
+ //
17
+ // This bit hsu-ui itself: `ChainGraph/SearchSelect` has to park the Select in a
18
+ // fixed 32px box, "preventing the Select root's height:100% from resolving against
19
+ // the graph and being stretched to the full graph height". Consumers hit it too and
20
+ // reach for the same wrapper, which is a workaround for a default that is wrong.
21
+ //
22
+ // Filling a deliberately sized parent still works without the declaration: as a flex
23
+ // child the default `align-self: stretch` fills the cross axis, and the inner
24
+ // `height: 100%` rules below then resolve against a genuinely definite height.
25
+ // A block parent that really wants a taller control can still say `height: 100%`.
11
26
  min-height: var(--vita-control-height);
12
27
  padding: 0px 11px;
13
28
 
@@ -118,7 +133,16 @@
118
133
  align-items: center;
119
134
 
120
135
  width: 100%;
121
- height: 100%;
136
+ // 撑满外壳用 align-self,不用 height: 100%。
137
+ //
138
+ // 外壳 `.select` 的高度是 `min-height` 撑出来的、`height` 仍是 auto,
139
+ // 百分比高度对着 auto 解析不出东西 —— 这一层会缩回内容高(实测 22px,
140
+ // 而外壳是 32px),上下各多出 5px 点不动的死区:看着是个 32px 的下拉框,
141
+ // 边缘一圈却没有反应。
142
+ //
143
+ // 外壳是 flex 且 align-items: center,所以这里要显式 stretch;
144
+ // 前后缀图标不受影响,它们该保持居中
145
+ align-self: stretch;
122
146
  margin: 0px !important;
123
147
 
124
148
  border-radius: inherit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hsu-react/ui",
3
- "version": "2.4.6",
3
+ "version": "2.4.7",
4
4
  "description": "一套基于 React + Ant Design 的中后台业务组件库",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,8 +1,12 @@
1
1
  .antdInput {
2
2
  width: 100%;
3
- height: 100%;
4
- // When the parent has no set height (height:100% resolves to auto), ensure a minimum height so the input is not squashed;
5
- // the inner .ant-input-wrapper / .ant-input inherit this value via min-height: inherit.
3
+ // The control height is a floor, not `height: 100%` — see the long note in
4
+ // `Select/index.module.scss`. Same failure: under a flex item stretched by a taller
5
+ // sibling, `height: 100%` inflates the input to the item's whole content box.
6
+ //
7
+ // The inner `height: 100%` rules below stay: when this root *is* stretched (as a flex
8
+ // child, or because the app asked for it), they propagate that height inward. They
9
+ // resolve to `auto` otherwise and fall back to `min-height: inherit`.
6
10
  min-height: var(--vita-control-height);
7
11
 
8
12
  :global(.ant-input-clear-icon) {
@@ -4,7 +4,10 @@
4
4
  --tree-switcher-gap: 0px;
5
5
 
6
6
  width: 100%;
7
- height: 100%;
7
+ // Control height as a floor, not `height: 100%` — same reason as `Select` (see the
8
+ // note there). TreeSelect had no `min-height` at all because `height: 100%` was doing
9
+ // that job by accident; dropping one without adding the other would collapse it.
10
+ min-height: var(--vita-control-height);
8
11
 
9
12
  // CF style: outlined input control that follows appearance switching.
10
13
  //
@@ -5,9 +5,24 @@
5
5
  align-items: center;
6
6
 
7
7
  width: 100%;
8
- height: 100%;
9
- // When the parent has no explicit height (height:100% resolves to auto), guarantee a min height
10
- // consistent with Input and other form controls, so it is neither squashed nor mis-sized in search rows.
8
+ // The control height is a floor, not `height: 100%`.
9
+ //
10
+ // `height: 100%` looks harmless because it resolves to `auto` under an auto-height
11
+ // parent — but the moment the parent has a *definite* height the control inflates to
12
+ // fill it, and the most common way a parent acquires one is by accident: a flex item
13
+ // stretched by a taller sibling. A card holding `<label> <Select> <hint>` where the
14
+ // hint wraps to two lines is enough — the Select swells to the card's whole content
15
+ // box (measured: 102px for a 32px control) and covers the label and the hint.
16
+ //
17
+ // This bit hsu-ui itself: `ChainGraph/SearchSelect` has to park the Select in a
18
+ // fixed 32px box, "preventing the Select root's height:100% from resolving against
19
+ // the graph and being stretched to the full graph height". Consumers hit it too and
20
+ // reach for the same wrapper, which is a workaround for a default that is wrong.
21
+ //
22
+ // Filling a deliberately sized parent still works without the declaration: as a flex
23
+ // child the default `align-self: stretch` fills the cross axis, and the inner
24
+ // `height: 100%` rules below then resolve against a genuinely definite height.
25
+ // A block parent that really wants a taller control can still say `height: 100%`.
11
26
  min-height: var(--vita-control-height);
12
27
  padding: 0px 11px;
13
28
 
@@ -118,7 +133,16 @@
118
133
  align-items: center;
119
134
 
120
135
  width: 100%;
121
- height: 100%;
136
+ // 撑满外壳用 align-self,不用 height: 100%。
137
+ //
138
+ // 外壳 `.select` 的高度是 `min-height` 撑出来的、`height` 仍是 auto,
139
+ // 百分比高度对着 auto 解析不出东西 —— 这一层会缩回内容高(实测 22px,
140
+ // 而外壳是 32px),上下各多出 5px 点不动的死区:看着是个 32px 的下拉框,
141
+ // 边缘一圈却没有反应。
142
+ //
143
+ // 外壳是 flex 且 align-items: center,所以这里要显式 stretch;
144
+ // 前后缀图标不受影响,它们该保持居中
145
+ align-self: stretch;
122
146
  margin: 0px !important;
123
147
 
124
148
  border-radius: inherit;