@qq1948037137/adminsmart-ui 0.1.33 → 0.1.34

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.
package/README.md CHANGED
@@ -61,6 +61,8 @@ function Example() {
61
61
 
62
62
  `SessionReplay` 默认关闭鼠标轨迹。宿主传入 `mouseTrail` 与已录制的 rrweb `MouseMove` 事件后,播放器以主题主色显示原生轨迹。轨迹跟随录像坐标和播放倍率;拖动时间轴保留该时刻的鼠标位置。文档示例可实时开关轨迹。
63
63
 
64
+ `Input.TextArea` 默认至少显示五行,并随内容自动调整高度。需要固定行数可传 `rows`,需要自定义增高范围可传 `autoSize`。
65
+
64
66
  ## 表格序号和分页
65
67
 
66
68
  `Table`、`DataTable` 默认把「序号」作为第一列业务数据,表头和内容均居中。选择框和独立展开控件保留其原生位置。内置分页默认每页 10 条,自动连续编号。业务页面单独调用后端分页时,把实际页码和每页条数传给序号列:
package/dist/index.cjs CHANGED
@@ -349,10 +349,21 @@ var Form = Object.assign(wrapAntComponent(import_antd5.Form, "Form"), {
349
349
 
350
350
  // src/components/Input.ts
351
351
  var import_antd6 = require("antd");
352
+ var DEFAULT_TEXT_AREA_ROWS = 5;
353
+ function normalizeTextArea(props) {
354
+ if (props.rows !== void 0 || Object.hasOwn(props, "autoSize")) return props;
355
+ return {
356
+ ...props,
357
+ rows: DEFAULT_TEXT_AREA_ROWS,
358
+ // 自动测量前也保持五行,避免初次显示时跳动。
359
+ autoSize: { minRows: DEFAULT_TEXT_AREA_ROWS }
360
+ // 由 Ant 随输入内容增减,不设行数上限。
361
+ };
362
+ }
352
363
  var Input = Object.assign(wrapAntComponent(import_antd6.Input, "Input"), {
353
364
  Group: wrapAntComponent(import_antd6.Input.Group, "Input.Group"),
354
365
  Search: wrapAntComponent(import_antd6.Input.Search, "Input.Search"),
355
- TextArea: wrapAntComponent(import_antd6.Input.TextArea, "Input.TextArea"),
366
+ TextArea: wrapAntComponent(import_antd6.Input.TextArea, "Input.TextArea", {}, normalizeTextArea),
356
367
  Password: wrapAntComponent(import_antd6.Input.Password, "Input.Password"),
357
368
  OTP: wrapAntComponent(import_antd6.Input.OTP, "Input.OTP")
358
369
  });