@para-ui/core 4.0.46 → 4.0.48

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 (41) hide show
  1. package/Badge/index.d.ts +2 -0
  2. package/Badge/index.js +29 -5
  3. package/Cascader/index.js +4 -5
  4. package/ComboSelect/index.js +3 -3
  5. package/CycleSelector/index.js +1 -4
  6. package/DatePicker/index.js +1 -4
  7. package/DynamicMultiBox/index.js +3 -3
  8. package/Form/index.js +4 -4
  9. package/FormItem/index.js +4 -4
  10. package/Image/index.js +2 -3
  11. package/README.md +10 -0
  12. package/ScrollBar/index.d.ts +27 -0
  13. package/ScrollBar/index.js +153 -0
  14. package/SingleBox/index.js +2 -2
  15. package/Stepper/index.js +1 -1
  16. package/Table/index.js +111 -22
  17. package/Table/interface.d.ts +2 -0
  18. package/Table/tableBodyInterface.d.ts +4 -0
  19. package/Table/tableElement/index.d.ts +1 -0
  20. package/Tag/index.js +55 -87
  21. package/TimePicker/index.js +1 -4
  22. package/Timeline/index.js +1 -2
  23. package/ToggleButton/index.js +1 -2
  24. package/Tree/index.js +3 -4
  25. package/Upload/index.js +2 -3
  26. package/_verture/{Portal-f9bedb3a.js → Portal-42560ff0.js} +1 -2
  27. package/_verture/{defineProperty-6f62bb2a.js → defineProperty-f0e15205.js} +10 -2
  28. package/_verture/{index-972707a5.js → index-063009f8.js} +2 -3
  29. package/_verture/{index-6647cbf6.js → index-72981a9e.js} +1 -2
  30. package/index.d.ts +2 -0
  31. package/index.js +6 -6
  32. package/package.json +1 -1
  33. package/umd/Badge.js +1 -1
  34. package/umd/ComboSelect.js +9 -9
  35. package/umd/DynamicMultiBox.js +2 -2
  36. package/umd/Form.js +5 -5
  37. package/umd/FormItem.js +5 -5
  38. package/umd/ScrollBar.js +1 -0
  39. package/umd/Table.js +5 -5
  40. package/_verture/typeof-adeedc13.js +0 -11
  41. /package/_verture/{index-bc7b7394.js → index-caffc0da.js} +0 -0
package/Table/index.js CHANGED
@@ -23,6 +23,7 @@ import Refresh from '@para-ui/icons/Refresh';
23
23
  import { Pagination } from '../Pagination/index.js';
24
24
  import { Loading } from '../Loading/index.js';
25
25
  import { u as useGlobalProps } from '../_verture/useGlobalProps-4ae1a007.js';
26
+ import ScrollBar from '../ScrollBar/index.js';
26
27
  import '../Tooltip/index.js';
27
28
  import 'rc-tooltip';
28
29
  import 'rc-tooltip/lib/placements';
@@ -1130,7 +1131,9 @@ const TableBody = props => {
1130
1131
  tipMaxWidth,
1131
1132
  lineHeight,
1132
1133
  dragRow,
1133
- onDragRow
1134
+ onDragRow,
1135
+ virtualIndex,
1136
+ virtual
1134
1137
  } = props;
1135
1138
  const [expandableColSpan, setExpandableColSpan] = useState(0); // 嵌套表格合并列数
1136
1139
  const [expandableRow, setExpandableRow] = useState({}); // 当前哪行展开表格嵌套
@@ -1615,12 +1618,17 @@ const TableBody = props => {
1615
1618
  }));
1616
1619
  }, [expandableColSpan, loadMore, loadMoreRender, onClickMore, showMoreBtn, changePage, loadMoreUrl, lineHeight]);
1617
1620
  const TableBodySubjectContentMemo = useMemo(() => {
1621
+ let rowDataCom = rowData;
1622
+ if (virtual) {
1623
+ rowDataCom = rowDataCom.slice(virtualIndex[0], virtualIndex[1]);
1624
+ }
1618
1625
  return jsx(Fragment, {
1619
- children: rowData.map((row, index) => {
1626
+ children: rowDataCom.map((row, idx) => {
1620
1627
  let str = 'table-body-row';
1621
1628
  if (rowClassMapping && rowClassMapping[row[rowKey]]) {
1622
1629
  str += " ".concat(rowClassMapping[row[rowKey]]);
1623
1630
  }
1631
+ const index = idx + virtualIndex[0];
1624
1632
  return jsxs(Fragment$1, {
1625
1633
  children: [jsxs(TrElement, Object.assign({
1626
1634
  className: str,
@@ -1636,13 +1644,15 @@ const TableBody = props => {
1636
1644
  }, index);
1637
1645
  })
1638
1646
  });
1639
- }, [rowData, rowKey, disabledJson, checkJson, radio, radioValue, expandable, expandableRow, tableCell, headData, align, operate, expandableColSpan, selectCheck, selectRadio, disabledExpandJson, onExpand, disabledArrStatus, showColumns, onClickRow, rowClassMapping, tipMaxWidth, lineHeight, dragRow, onDragRow, dragBol]);
1647
+ }, [rowData, rowKey, disabledJson, checkJson, radio, radioValue, expandable, expandableRow, tableCell, headData, align, operate, expandableColSpan, selectCheck, selectRadio, disabledExpandJson, onExpand, disabledArrStatus, showColumns, onClickRow, rowClassMapping, tipMaxWidth, lineHeight, dragRow, onDragRow, dragBol, virtualIndex, virtual]);
1640
1648
  // 内容memo
1641
1649
  const TableBodyContentMemo = useMemo(() => {
1642
1650
  return jsxs(Fragment$1, {
1643
- children: [TableBodySubjectContentMemo, MoreMemo]
1651
+ children: [TableBodySubjectContentMemo, MoreMemo, virtual && jsx(TrElement, {
1652
+ className: 'virtual-scroll-height'
1653
+ })]
1644
1654
  });
1645
- }, [rowData, rowKey, disabledJson, checkJson, radio, radioValue, expandable, expandableRow, tableCell, headData, align, operate, expandableColSpan, selectCheck, selectRadio, loadMore, loadMoreRender, onClickMore, changePage, loadMoreUrl, disabledExpandJson, onExpand, showMoreBtn, disabledArrStatus, showColumns, onClickRow, rowClassMapping, tipMaxWidth, lineHeight, dragRow, onDragRow, dragBol]);
1655
+ }, [rowData, rowKey, disabledJson, checkJson, radio, radioValue, expandable, expandableRow, tableCell, headData, align, operate, expandableColSpan, selectCheck, selectRadio, loadMore, loadMoreRender, onClickMore, changePage, loadMoreUrl, disabledExpandJson, onExpand, showMoreBtn, disabledArrStatus, showColumns, onClickRow, rowClassMapping, tipMaxWidth, lineHeight, dragRow, onDragRow, dragBol, virtualIndex, virtual]);
1646
1656
  // 处理内容
1647
1657
  const handContent = () => {
1648
1658
  // 无数据,且不再请求,显示暂无数据
@@ -1667,13 +1677,23 @@ const TableBody = props => {
1667
1677
  setDragBol(false);
1668
1678
  onDragRow && onDragRow(evt);
1669
1679
  };
1680
+ const handleStyle = () => {
1681
+ const obj = {};
1682
+ if (virtual) {
1683
+ obj.height = rowData.length * lineHeight + 'px';
1684
+ obj.position = 'relative';
1685
+ obj.top = virtualIndex[0] * lineHeight + 'px';
1686
+ }
1687
+ return obj;
1688
+ };
1670
1689
  return jsx(TableBodyElement, Object.assign({
1671
1690
  className: handClass(),
1672
1691
  drag: dragRow,
1673
1692
  handle: '.drag-row-btn',
1674
1693
  list: handleRowData(),
1675
1694
  onDrag: onDragRowCom,
1676
- onChoose: onChoose
1695
+ onChoose: onChoose,
1696
+ style: handleStyle()
1677
1697
  }, {
1678
1698
  children: handContent()
1679
1699
  }));
@@ -1827,9 +1847,10 @@ const TableElement = props => {
1827
1847
  className,
1828
1848
  style,
1829
1849
  fixedColumn,
1830
- children
1850
+ children,
1851
+ cRef
1831
1852
  } = props,
1832
- otherProps = __rest(props, ["className", "style", "fixedColumn", "children"]);
1853
+ otherProps = __rest(props, ["className", "style", "fixedColumn", "children", "cRef"]);
1833
1854
  const handClass = () => {
1834
1855
  let str = 'table-element';
1835
1856
  if (fixedColumn) str += ' table-element-fixed-column';
@@ -1838,13 +1859,14 @@ const TableElement = props => {
1838
1859
  };
1839
1860
  return jsx("table", Object.assign({
1840
1861
  className: handClass(),
1841
- style: style
1862
+ style: style,
1863
+ ref: cRef
1842
1864
  }, otherProps, {
1843
1865
  children: children
1844
1866
  }));
1845
1867
  };
1846
1868
 
1847
- var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-table {\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: white;\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n position: relative;\n}\n.paraui-v4-table.paraui-v4-table-draggable * {\n user-select: none !important;\n}\n.paraui-v4-table.paraui-v4-table-fixed-table > .table-contain > table {\n table-layout: fixed;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn > .table-contain > table .table-checkbox {\n left: 0;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn > .table-contain > table .table-radio {\n left: 0;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn > .table-contain > table .table-expandable {\n left: 0;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn.paraui-v4-table-radio.paraui-v4-table-check .table-radio {\n left: 48px;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn.paraui-v4-table-expandable.paraui-v4-table-check .table-expandable {\n left: 48px;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn.paraui-v4-table-expandable.paraui-v4-table-check.paraui-v4-table-radio .table-expandable {\n left: 80px;\n}\n.paraui-v4-table.paraui-v4-table-no-data > .table-container > table {\n height: 100%;\n}\n.paraui-v4-table.paraui-v4-table-no-data > .table-container > table .paraui-v4-empty {\n overflow: hidden;\n}\n.paraui-v4-table.paraui-v4-table-load.paraui-v4-table-no-data > .table-container > table {\n height: auto;\n}\n.paraui-v4-table.paraui-v4-table-pagination > .table-contain {\n height: calc(100% - 36px);\n}\n.paraui-v4-table.paraui-v4-table-pagination.table-load-more > .table-contain {\n height: 100%;\n}\n.paraui-v4-table.paraui-v4-table-load-more.paraui-v4-table-pagination > .table-contain {\n height: 100%;\n}\n.paraui-v4-table > .table-contain {\n height: 100%;\n position: relative;\n}\n.paraui-v4-table > .table-contain > table {\n height: auto;\n}\n.paraui-v4-table > .table-contain > table .table-checkbox > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-checkbox .table-header-box {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-radio > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-radio .table-header-box {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-expandable > svg {\n vertical-align: middle;\n}\n.paraui-v4-table > .table-contain > table > .table-head {\n width: 100%;\n white-space: nowrap;\n}\n.paraui-v4-table > .table-contain > table > .table-head > tr th {\n height: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-head.table-head-scroll tr th {\n max-width: 240px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-serial-number .table-header-box .table-header-title {\n padding-right: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box {\n height: 47px;\n line-height: 47px;\n position: relative;\n padding: 0 8px;\n display: flex;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-title {\n max-width: 100%;\n display: flex;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-title > .table-header-title-label {\n width: 100%;\n color: rgb(92, 101, 115);\n font-weight: 700;\n font-size: 14px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span {\n width: 20px;\n height: 20px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n border-radius: 2px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span:hover {\n background-color: rgba(46, 101, 230, 0.1);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > svg {\n font-size: 12px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > .up-svg {\n position: relative;\n top: 3px;\n transform: scale(0.8);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > .down-svg {\n position: relative;\n top: -3px;\n transform: scale(0.8);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span {\n width: 20px;\n height: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n cursor: pointer;\n border-radius: 2px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span:hover {\n background-color: rgba(46, 101, 230, 0.1);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span > svg {\n font-size: 14px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-show > span > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-select > span > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-select > span:after {\n position: absolute;\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background-color: rgb(244, 66, 66);\n content: \"\";\n right: 3px;\n top: 2px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort > .table-header-title {\n padding-right: 8px;\n max-width: calc(100% - 20px);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-filter > .table-header-title {\n padding-right: 8px;\n max-width: calc(100% - 20px);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort.table-header-box-filter > .table-header-title {\n max-width: calc(100% - 40px);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort-asc > .table-sort-svg > span > .up-svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort-desc > .table-sort-svg > span > .down-svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums {\n width: 53px;\n cursor: pointer;\n border-left: 1px solid rgb(234, 236, 241);\n right: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums .table-header-box {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums .table-header-box > svg {\n font-size: 20px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums .table-header-box:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .drag-row {\n width: 53px;\n cursor: pointer;\n border-left: 1px solid rgb(234, 236, 241);\n right: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head.table-head-no-btn tr th:first-child .table-header-box {\n padding-left: 20px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn {\n width: 32px;\n padding: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn > .table-header-box {\n width: 32px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn:first-child {\n width: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn:first-child > .table-header-box {\n width: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-body {\n width: 100%;\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-scroll tr td {\n max-width: 240px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td {\n background-color: white;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate {\n padding-right: 16px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box {\n display: flex;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box .drag-btn-line {\n display: inline-block;\n width: 1px;\n height: 12px;\n background-color: rgb(213, 224, 250);\n margin: 0 10px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box .drag-row-btn {\n cursor: all-scroll;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box .drag-row-btn svg {\n font-size: 18px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate.table-operate-center {\n padding-right: 8px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate.table-operate-center > .table-operate-box {\n justify-content: center;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr:nth-of-type(2n) td {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr:hover td {\n background-color: rgb(233, 239, 255);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr .table-expandable > svg {\n transition: all 0.3s;\n cursor: pointer;\n font-size: 18px;\n color: rgb(92, 101, 115);\n transform: rotate(270deg);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr .table-expandable > svg:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr .table-expandable > .expand {\n transform: rotate(360deg);\n}\n.paraui-v4-table > .table-contain > table > .table-body .more-table-row {\n cursor: pointer;\n position: sticky;\n bottom: 0;\n z-index: 10;\n}\n.paraui-v4-table > .table-contain > table > .table-body .more-table-row .more-btn {\n color: rgb(46, 101, 230);\n font-size: 14px;\n}\n.paraui-v4-table > .table-contain > table > .table-body .more-table-row > .td-element {\n position: relative;\n background: white;\n box-shadow: 4px -4px 8px 0px rgb(234, 236, 241);\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-no-btn tr td:first-child {\n padding-left: 20px;\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-no-btn tr.more-table-row td:first-child {\n padding-left: 8px;\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-no-btn > .table-no-data > td:first-child {\n padding: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-body .table-body-btn {\n width: 32px;\n padding: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-body .table-body-btn:first-child {\n width: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-body > .table-no-data {\n height: calc(100% - 50px);\n}\n.paraui-v4-table > .table-contain > table > .table-body > .table-no-data:hover td {\n background-color: white;\n}\n.paraui-v4-table > .table-contain > table > .table-body > .table-no-data > td {\n padding: 56px 0 0 0;\n}\n.paraui-v4-table > .table-contain > .table-pos-line {\n position: absolute;\n top: 0;\n width: 1px;\n background-color: rgb(46, 101, 230);\n z-index: 1000;\n}\n.paraui-v4-table > .table-pagination {\n width: 100%;\n height: 36px;\n display: flex;\n align-items: flex-end;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right {\n display: flex;\n height: 32px;\n align-items: center;\n color: rgb(29, 33, 38);\n line-height: 32px;\n padding-left: 16px;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right .all-select {\n margin-left: 12px;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right .line {\n width: 1px;\n height: 12px;\n background-color: rgb(212, 218, 227);\n margin: 0 10px;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right .check-number {\n width: 65px;\n display: inline-block;\n}\n.paraui-v4-table > .table-pagination .table-pagination-com {\n flex: 1;\n justify-content: flex-end;\n}\n.paraui-v4-table > .table-pagination .refresh-btn {\n margin-left: 20px;\n}\n\n.paraui-v4-table-show-colums-popover > .component-popover-content {\n min-width: 200px;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box {\n padding-top: 4px;\n max-height: 320px;\n overflow-y: auto;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item {\n height: 30px;\n line-height: 30px;\n cursor: pointer;\n display: flex;\n padding: 0 10px;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item > span {\n padding-left: 8px;\n color: rgb(29, 33, 38);\n font-size: 14px;\n display: inline-block;\n width: calc(100% - 14px);\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item:hover {\n background: rgb(247, 248, 250);\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-disabled {\n cursor: inherit;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-disabled > span {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-disabled:hover {\n background: transparent;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer {\n height: 36px;\n border-top: 1px solid rgb(247, 248, 250);\n text-align: center;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer > button {\n width: 100%;\n height: 100%;\n margin: 0;\n}\n\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box {\n padding-top: 4px;\n max-height: 320px;\n overflow-y: auto;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item {\n height: 30px;\n line-height: 30px;\n cursor: pointer;\n display: flex;\n padding: 0 10px;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item > span {\n padding-left: 8px;\n color: rgb(29, 33, 38);\n font-size: 14px;\n display: inline-block;\n width: calc(100% - 14px);\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item:hover {\n background: rgb(247, 248, 250);\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-footer {\n height: 36px;\n border-top: 1px solid rgb(247, 248, 250);\n text-align: center;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-footer > button {\n width: 50%;\n height: 100%;\n margin: 0;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select.filter-select-none {\n text-align: center;\n padding: 20px 0;\n}\n.paraui-v4-filter-popover.paraui-v4-filter-popover-default > .component-popover-content {\n min-width: 200px;\n}";
1869
+ var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-table {\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: white;\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n position: relative;\n}\n.paraui-v4-table.paraui-v4-virtual > .table-contain {\n margin-right: 8px;\n}\n.paraui-v4-table.paraui-v4-virtual > .table-contain::-webkit-scrollbar {\n width: 0;\n}\n.paraui-v4-table.paraui-v4-virtual.paraui-v4-table-pagination .paraui-v4-scroll-bar {\n height: calc(100% - 36px);\n}\n.paraui-v4-table.paraui-v4-virtual.table-scroll-left .paraui-v4-scroll-bar, .paraui-v4-table.paraui-v4-virtual.table-scroll-right .paraui-v4-scroll-bar, .paraui-v4-table.paraui-v4-virtual.table-scroll-middle .paraui-v4-scroll-bar {\n padding-bottom: 8px;\n}\n.paraui-v4-table.paraui-v4-table-draggable * {\n user-select: none !important;\n}\n.paraui-v4-table.paraui-v4-table-fixed-table > .table-contain > table {\n table-layout: fixed;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn > .table-contain > table .table-checkbox {\n left: 0;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn > .table-contain > table .table-radio {\n left: 0;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn > .table-contain > table .table-expandable {\n left: 0;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn.paraui-v4-table-radio.paraui-v4-table-check .table-radio {\n left: 48px;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn.paraui-v4-table-expandable.paraui-v4-table-check .table-expandable {\n left: 48px;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn.paraui-v4-table-expandable.paraui-v4-table-check.paraui-v4-table-radio .table-expandable {\n left: 80px;\n}\n.paraui-v4-table.paraui-v4-table-no-data > .table-container > table {\n height: 100%;\n}\n.paraui-v4-table.paraui-v4-table-no-data > .table-container > table .paraui-v4-empty {\n overflow: hidden;\n}\n.paraui-v4-table.paraui-v4-table-load.paraui-v4-table-no-data > .table-container > table {\n height: auto;\n}\n.paraui-v4-table.paraui-v4-table-pagination > .table-contain {\n height: calc(100% - 36px);\n}\n.paraui-v4-table.paraui-v4-table-pagination.table-load-more > .table-contain {\n height: 100%;\n}\n.paraui-v4-table.paraui-v4-table-load-more.paraui-v4-table-pagination > .table-contain {\n height: 100%;\n}\n.paraui-v4-table > .table-contain {\n height: 100%;\n position: relative;\n}\n.paraui-v4-table > .table-contain > table {\n height: auto;\n}\n.paraui-v4-table > .table-contain > table .table-checkbox > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-checkbox .table-header-box {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-radio > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-radio .table-header-box {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-expandable > svg {\n vertical-align: middle;\n}\n.paraui-v4-table > .table-contain > table > .table-head {\n width: 100%;\n white-space: nowrap;\n}\n.paraui-v4-table > .table-contain > table > .table-head > tr th {\n height: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-head.table-head-scroll tr th {\n max-width: 240px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-serial-number .table-header-box .table-header-title {\n padding-right: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box {\n height: 47px;\n line-height: 47px;\n position: relative;\n padding: 0 8px;\n display: flex;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-title {\n max-width: 100%;\n display: flex;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-title > .table-header-title-label {\n width: 100%;\n color: rgb(92, 101, 115);\n font-weight: 700;\n font-size: 14px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span {\n width: 20px;\n height: 20px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n border-radius: 2px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span:hover {\n background-color: rgba(46, 101, 230, 0.1);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > svg {\n font-size: 12px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > .up-svg {\n position: relative;\n top: 3px;\n transform: scale(0.8);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > .down-svg {\n position: relative;\n top: -3px;\n transform: scale(0.8);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span {\n width: 20px;\n height: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n cursor: pointer;\n border-radius: 2px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span:hover {\n background-color: rgba(46, 101, 230, 0.1);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span > svg {\n font-size: 14px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-show > span > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-select > span > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-select > span:after {\n position: absolute;\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background-color: rgb(244, 66, 66);\n content: \"\";\n right: 3px;\n top: 2px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort > .table-header-title {\n padding-right: 8px;\n max-width: calc(100% - 20px);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-filter > .table-header-title {\n padding-right: 8px;\n max-width: calc(100% - 20px);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort.table-header-box-filter > .table-header-title {\n max-width: calc(100% - 40px);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort-asc > .table-sort-svg > span > .up-svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort-desc > .table-sort-svg > span > .down-svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums {\n width: 53px;\n cursor: pointer;\n border-left: 1px solid rgb(234, 236, 241);\n right: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums .table-header-box {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums .table-header-box > svg {\n font-size: 20px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums .table-header-box:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .drag-row {\n width: 53px;\n cursor: pointer;\n border-left: 1px solid rgb(234, 236, 241);\n right: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head.table-head-no-btn tr th:first-child .table-header-box {\n padding-left: 20px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn {\n width: 32px;\n padding: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn > .table-header-box {\n width: 32px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn:first-child {\n width: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn:first-child > .table-header-box {\n width: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-body {\n width: 100%;\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-scroll tr td {\n max-width: 240px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td {\n background-color: white;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate {\n padding-right: 16px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box {\n display: flex;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box .drag-btn-line {\n display: inline-block;\n width: 1px;\n height: 12px;\n background-color: rgb(213, 224, 250);\n margin: 0 10px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box .drag-row-btn {\n cursor: all-scroll;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box .drag-row-btn svg {\n font-size: 18px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate.table-operate-center {\n padding-right: 8px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate.table-operate-center > .table-operate-box {\n justify-content: center;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr:nth-of-type(2n) td {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr:hover td {\n background-color: rgb(233, 239, 255);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr .table-expandable > svg {\n transition: all 0.3s;\n cursor: pointer;\n font-size: 18px;\n color: rgb(92, 101, 115);\n transform: rotate(270deg);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr .table-expandable > svg:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr .table-expandable > .expand {\n transform: rotate(360deg);\n}\n.paraui-v4-table > .table-contain > table > .table-body .more-table-row {\n cursor: pointer;\n position: sticky;\n bottom: 0;\n z-index: 10;\n}\n.paraui-v4-table > .table-contain > table > .table-body .more-table-row .more-btn {\n color: rgb(46, 101, 230);\n font-size: 14px;\n}\n.paraui-v4-table > .table-contain > table > .table-body .more-table-row > .td-element {\n position: relative;\n background: white;\n box-shadow: 4px -4px 8px 0px rgb(234, 236, 241);\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-no-btn tr td:first-child {\n padding-left: 20px;\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-no-btn tr.more-table-row td:first-child {\n padding-left: 8px;\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-no-btn > .table-no-data > td:first-child {\n padding: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-body .table-body-btn {\n width: 32px;\n padding: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-body .table-body-btn:first-child {\n width: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-body > .table-no-data {\n height: calc(100% - 50px);\n}\n.paraui-v4-table > .table-contain > table > .table-body > .table-no-data:hover td {\n background-color: white;\n}\n.paraui-v4-table > .table-contain > table > .table-body > .table-no-data > td {\n padding: 56px 0 0 0;\n}\n.paraui-v4-table > .table-contain > .table-pos-line {\n position: absolute;\n top: 0;\n width: 1px;\n background-color: rgb(46, 101, 230);\n z-index: 1000;\n}\n.paraui-v4-table > .table-pagination {\n width: 100%;\n height: 36px;\n display: flex;\n align-items: flex-end;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right {\n display: flex;\n height: 32px;\n align-items: center;\n color: rgb(29, 33, 38);\n line-height: 32px;\n padding-left: 16px;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right .all-select {\n margin-left: 12px;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right .line {\n width: 1px;\n height: 12px;\n background-color: rgb(212, 218, 227);\n margin: 0 10px;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right .check-number {\n width: 65px;\n display: inline-block;\n}\n.paraui-v4-table > .table-pagination .table-pagination-com {\n flex: 1;\n justify-content: flex-end;\n}\n.paraui-v4-table > .table-pagination .refresh-btn {\n margin-left: 20px;\n}\n\n.paraui-v4-table-show-colums-popover > .component-popover-content {\n min-width: 200px;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box {\n padding-top: 4px;\n max-height: 320px;\n overflow-y: auto;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item {\n height: 30px;\n line-height: 30px;\n cursor: pointer;\n display: flex;\n padding: 0 10px;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item > span {\n padding-left: 8px;\n color: rgb(29, 33, 38);\n font-size: 14px;\n display: inline-block;\n width: calc(100% - 14px);\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item:hover {\n background: rgb(247, 248, 250);\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-disabled {\n cursor: inherit;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-disabled > span {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-disabled:hover {\n background: transparent;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer {\n height: 36px;\n border-top: 1px solid rgb(247, 248, 250);\n text-align: center;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer > button {\n width: 100%;\n height: 100%;\n margin: 0;\n}\n\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box {\n padding-top: 4px;\n max-height: 320px;\n overflow-y: auto;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item {\n height: 30px;\n line-height: 30px;\n cursor: pointer;\n display: flex;\n padding: 0 10px;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item > span {\n padding-left: 8px;\n color: rgb(29, 33, 38);\n font-size: 14px;\n display: inline-block;\n width: calc(100% - 14px);\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item:hover {\n background: rgb(247, 248, 250);\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-footer {\n height: 36px;\n border-top: 1px solid rgb(247, 248, 250);\n text-align: center;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-footer > button {\n width: 50%;\n height: 100%;\n margin: 0;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select.filter-select-none {\n text-align: center;\n padding: 20px 0;\n}\n.paraui-v4-filter-popover.paraui-v4-filter-popover-default > .component-popover-content {\n min-width: 200px;\n}";
1848
1870
  styleInject(css_248z);
1849
1871
 
1850
1872
  const Table = propsInit => {
@@ -1925,7 +1947,8 @@ const Table = propsInit => {
1925
1947
  refreshInside = props.url ? true : false,
1926
1948
  checkCount = props.check ? true : false,
1927
1949
  onDragRow,
1928
- resizePaginationLine
1950
+ resizePaginationLine,
1951
+ virtual = false
1929
1952
  } = props;
1930
1953
  const intl = useFormatMessage('Table', localeJson);
1931
1954
  const dayNum = props.expirationTime ? props.expirationTime === 0 ? 100000000 : props.expirationTime : 7; // 过期天数
@@ -1953,8 +1976,13 @@ const Table = propsInit => {
1953
1976
  const [tableMinWidth, setTableMinWidth] = useState(0); // 表格最小width
1954
1977
  const [posFixed, setPosFixed] = useState({}); // 固定位置
1955
1978
  const [headDataConfig, setHeadDataConfig] = useState({}); // 表头配置
1979
+ const [virtualCom, setVirtualCom] = useState(false);
1980
+ const [virtualIndex, setVirtualIndex] = useState([0, 0]);
1981
+ const [scrollTop, setScrollTop] = useState(0);
1982
+ useState(0);
1956
1983
  const containerRef = useRef(); // 表格内容高度
1957
1984
  const tableRef = useRef(); // 表格
1985
+ const tableEleRef = useRef(); // 表格元素
1958
1986
  const constData = useRef({
1959
1987
  page: props.page !== undefined ? props.page : 1,
1960
1988
  headDataConfig: {}
@@ -2003,13 +2031,7 @@ const Table = propsInit => {
2003
2031
  handSize(size);
2004
2032
  } else {
2005
2033
  if (containerRef && containerRef.current) {
2006
- let height = containerRef.current.clientHeight - 48;
2007
- if (props.loadMore) height -= lineHeight;
2008
- let num = Math.floor(height / lineHeight);
2009
- /*// 取余大于0.5,加一条
2010
- const numRemainder = height % lineHeight / lineHeight;
2011
- if (numRemainder > 0.5) num += 1;*/
2012
- const columnsNUmber = num < 1 ? size : num;
2034
+ const columnsNUmber = getVisibleWinNum();
2013
2035
  if (sizeArr.indexOf(columnsNUmber) === -1) {
2014
2036
  sizeArr.unshift(columnsNUmber);
2015
2037
  // 数组排序
@@ -2198,12 +2220,27 @@ const Table = propsInit => {
2198
2220
  }
2199
2221
  }
2200
2222
  }, [checkJson, rowData, disabledJson]);
2223
+ // 计算表格虚拟滚动
2224
+ useEffect(() => {
2225
+ handleVirtualizedIndex();
2226
+ }, [virtual, rowData, expandable]);
2201
2227
  // 表格更新计算是否有滚动条
2202
2228
  useEffect(() => {
2203
2229
  tableBoxScroll({
2204
2230
  target: containerRef.current
2205
2231
  });
2206
2232
  });
2233
+ // 可视化窗口显示条数 / 第一次显示条数
2234
+ const getVisibleWinNum = () => {
2235
+ let height = containerRef.current.clientHeight - 48;
2236
+ if (props.loadMore) height -= lineHeight;
2237
+ let num = Math.floor(height / lineHeight);
2238
+ /*// 取余大于0.5,加一条
2239
+ const numRemainder = height % lineHeight / lineHeight;
2240
+ if (numRemainder > 0.5) num += 1;*/
2241
+ const columnsNUmber = num < 1 ? size : num;
2242
+ return columnsNUmber;
2243
+ };
2207
2244
  /** 设置size */
2208
2245
  const handSize = num => {
2209
2246
  constData.current.size = num;
@@ -3010,9 +3047,11 @@ const Table = propsInit => {
3010
3047
  tipMaxWidth: tipMaxWidth,
3011
3048
  lineHeight: lineHeight,
3012
3049
  dragRow: dragRow,
3013
- onDragRow: onDragRowCom
3050
+ onDragRow: onDragRowCom,
3051
+ virtualIndex: virtualIndex,
3052
+ virtual: virtualCom
3014
3053
  });
3015
- }, [showColumns, formatter, rowKey, rowData, headDataCom, expandable, check, radio, checkJson, sortTable, orderTypeArr, orderFieldArr, radioValue, disabledJson, align, tableCell, operate, setRadio, setCheck, totalDataJson, loadMore, loadMoreRender, onClickMore, total, pageCom, sizeCom, loadMoreUrl, expandValue, expandMultiple, disabledExpand, onExpand, defaultExpandAllRows, loadState, emptyProps, url, disabledArrStatus, posFixed, beyondText, fixedTable, fixedColumn, onClickRow, rowClassMapping, tipMaxWidth, lineHeight, dragRow, onDragRow]);
3054
+ }, [showColumns, formatter, rowKey, rowData, headDataCom, expandable, check, radio, checkJson, sortTable, orderTypeArr, orderFieldArr, radioValue, disabledJson, align, tableCell, operate, setRadio, setCheck, totalDataJson, loadMore, loadMoreRender, onClickMore, total, pageCom, sizeCom, loadMoreUrl, expandValue, expandMultiple, disabledExpand, onExpand, defaultExpandAllRows, loadState, emptyProps, url, disabledArrStatus, posFixed, beyondText, fixedTable, fixedColumn, onClickRow, rowClassMapping, tipMaxWidth, lineHeight, dragRow, onDragRow, virtualIndex, virtual, virtualCom]);
3016
3055
  // 表格分页memo
3017
3056
  const TablePaginationMemo = useMemo(() => {
3018
3057
  if (constData.current.page === null || constData.current.size === null || loadMore) return;
@@ -3073,15 +3112,61 @@ const Table = propsInit => {
3073
3112
  if (expandable) str += " ".concat($prefixCls, "-table-expandable");
3074
3113
  if (rowData.length === 0) str += " ".concat($prefixCls, "-table-no-data");
3075
3114
  if (loadState) str += " ".concat($prefixCls, "-table-load");
3115
+ if (virtualCom) str += " ".concat($prefixCls, "-virtual");
3076
3116
  if (className) str += " ".concat(className);
3077
3117
  return str;
3078
3118
  };
3079
3119
  // 改变屏幕大小
3080
3120
  const changeResize = () => {
3121
+ handleVirtualizedIndex();
3081
3122
  tableBoxScroll({
3082
3123
  target: containerRef.current
3083
3124
  });
3084
3125
  };
3126
+ // 计算虚拟列表滚动索引
3127
+ const handleVirtualizedIndex = () => {
3128
+ // 可视窗口显示条数
3129
+ const visibleWinNum = getVisibleWinNum();
3130
+ // 索引差量 上下10条
3131
+ const indexDiff = 10;
3132
+ // 每页显示条数 > 可视窗口显示条数 + 2倍索引差量 + 开启条数 开启虚拟滚动
3133
+ if (virtual && !expandable && Number(sizeCom) > visibleWinNum + 2 * indexDiff) {
3134
+ setVirtualCom(true);
3135
+ // 最大滚动距离 超出说明到底部,定制向下滚动
3136
+ const maxScroll = tableEleRef.current.clientHeight - containerRef.current.clientHeight;
3137
+ if (containerRef.current.scrollTop >= maxScroll) {
3138
+ // 滚动到底部
3139
+ containerRef.current.scrollTop = maxScroll;
3140
+ setScrollTop(maxScroll);
3141
+ }
3142
+ setScrollTop(containerRef.current.scrollTop);
3143
+ const scrollDom = containerRef.current;
3144
+ // 上索引
3145
+ const topIndex = Math.floor(scrollDom.scrollTop / lineHeight);
3146
+ // 下索引
3147
+ const bottomIndex = topIndex + visibleWinNum + indexDiff;
3148
+ setVirtualIndex([topIndex, bottomIndex]);
3149
+ } else {
3150
+ setVirtualIndex([0, 0]);
3151
+ setVirtualCom(false); // 不显示虚拟滚动条
3152
+ }
3153
+ };
3154
+ const handleVirtualScroll = () => {
3155
+ if (!virtualCom) return null;
3156
+ return jsx(ScrollBar, {
3157
+ style: {
3158
+ position: 'absolute',
3159
+ top: 0,
3160
+ right: 0,
3161
+ zIndex: 100
3162
+ },
3163
+ scrollTotalLength: tableEleRef.current.clientHeight - containerRef.current.clientHeight,
3164
+ scrollLength: scrollTop,
3165
+ onScroll: scrollH => {
3166
+ containerRef.current.scrollTop = scrollH;
3167
+ }
3168
+ });
3169
+ };
3085
3170
  return jsxs("div", Object.assign({
3086
3171
  className: handClass(),
3087
3172
  style: style,
@@ -3090,9 +3175,13 @@ const Table = propsInit => {
3090
3175
  children: [jsx(TableContainer, Object.assign({
3091
3176
  className: "table-contain",
3092
3177
  cRef: containerRef,
3093
- onScroll: tableBoxScroll
3178
+ onScroll: e => {
3179
+ handleVirtualizedIndex();
3180
+ tableBoxScroll(e);
3181
+ }
3094
3182
  }, {
3095
3183
  children: jsxs(TableElement, Object.assign({
3184
+ cRef: tableEleRef,
3096
3185
  fixedColumn: fixedColumn,
3097
3186
  style: {
3098
3187
  minWidth: "".concat(tableMinWidth, "px")
@@ -3100,7 +3189,7 @@ const Table = propsInit => {
3100
3189
  }, {
3101
3190
  children: [TableHeadMemo, TableBodyMemo]
3102
3191
  }))
3103
- })), loadState && jsx(Loading, {}), TablePaginationMemo]
3192
+ })), handleVirtualScroll(), loadState && jsx(Loading, {}), TablePaginationMemo]
3104
3193
  }));
3105
3194
  };
3106
3195
 
@@ -223,6 +223,8 @@ export interface TableProps extends TableHeadBodyPublicProps {
223
223
  dragColumn?: boolean;
224
224
  /** 拖动行 */
225
225
  dragRow?: boolean;
226
+ /** 虚拟滚动 嵌套表格不适用 */
227
+ virtual?: boolean;
226
228
  /** 是否过滤 */
227
229
  filter?: boolean;
228
230
  /** 排序 多个/单个 */
@@ -76,4 +76,8 @@ export interface TableBodyProps extends TableHeadBodyPublicProps {
76
76
  dragRow?: boolean;
77
77
  /** 拖动行事件 */
78
78
  onDragRow?: (evt: any) => void;
79
+ /** 虚拟滚动 */
80
+ virtual?: boolean;
81
+ /** 虚拟滚动下标 */
82
+ virtualIndex: [number, number];
79
83
  }
@@ -11,6 +11,7 @@ export interface TableElementProps {
11
11
  /** 是否具有固定列 */
12
12
  fixedColumn?: boolean;
13
13
  children?: any;
14
+ cRef?: any;
14
15
  [name: string]: any;
15
16
  }
16
17
  export declare const TableElement: FunctionComponent<TableElementProps>;
package/Tag/index.js CHANGED
@@ -4,9 +4,6 @@ import { useState, useRef, useEffect } from 'react';
4
4
  import Close from '@para-ui/icons/Close';
5
5
  import EditOutline from '@para-ui/icons/EditOutline';
6
6
  import clsx from 'clsx';
7
- import { _ as _toConsumableArray } from '../_verture/toConsumableArray-c7a8028f.js';
8
- import { _ as _typeof } from '../_verture/typeof-adeedc13.js';
9
- import { _ as _slicedToArray } from '../_verture/slicedToArray-75fa4188.js';
10
7
  import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
11
8
  import AutoTips from '../AutoTips/index.js';
12
9
  import { t as tinycolor } from '../_verture/tinycolor-ece3542d.js';
@@ -24,129 +21,102 @@ var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/1/12 上
24
21
  styleInject(css_248z);
25
22
 
26
23
  //tag group
27
- var TagGroup = function TagGroup(props) {
28
- var _useGlobalProps = useGlobalProps(props, 'TagGroup'),
29
- className = _useGlobalProps.className,
30
- _useGlobalProps$size = _useGlobalProps.size,
31
- size = _useGlobalProps$size === void 0 ? 'large' : _useGlobalProps$size,
32
- style = _useGlobalProps.style,
33
- defaultInputValue = _useGlobalProps.defaultInputValue,
34
- _useGlobalProps$incre = _useGlobalProps.increased,
35
- increased = _useGlobalProps$incre === void 0 ? false : _useGlobalProps$incre,
36
- increasedTag = _useGlobalProps.increasedTag,
37
- inputClassName = _useGlobalProps.inputClassName,
38
- inputWidth = _useGlobalProps.inputWidth,
39
- _useGlobalProps$margi = _useGlobalProps.marginBottom,
40
- marginBottom = _useGlobalProps$margi === void 0 ? '8px' : _useGlobalProps$margi,
41
- _useGlobalProps$margi2 = _useGlobalProps.marginRight,
42
- marginRight = _useGlobalProps$margi2 === void 0 ? '8px' : _useGlobalProps$margi2,
43
- onChange = _useGlobalProps.onChange;
44
- var _useState = useState([]),
45
- _useState2 = _slicedToArray(_useState, 2),
46
- inData = _useState2[0],
47
- setInData = _useState2[1]; //数据源
48
- var _useState3 = useState(defaultInputValue !== null && defaultInputValue !== void 0 ? defaultInputValue : ''),
49
- _useState4 = _slicedToArray(_useState3, 2),
50
- inputValue = _useState4[0],
51
- setInputValue = _useState4[1]; //input value
52
- var _useState5 = useState(false),
53
- _useState6 = _slicedToArray(_useState5, 2),
54
- inputVisible = _useState6[0],
55
- setInputVisible = _useState6[1]; //input visible
56
- var inputRef = useRef(); //input ref
57
- var _useState7 = useState(),
58
- _useState8 = _slicedToArray(_useState7, 2),
59
- increasedInputWidth = _useState8[0],
60
- setIncreasedInputWidth = _useState8[1]; //添加标签的最小宽
61
- useEffect(function () {
24
+ const TagGroup = props => {
25
+ const {
26
+ className,
27
+ size = 'large',
28
+ style,
29
+ defaultInputValue,
30
+ increased = false,
31
+ increasedTag,
32
+ inputClassName,
33
+ inputWidth,
34
+ marginBottom = '8px',
35
+ marginRight = '8px',
36
+ onChange
37
+ } = useGlobalProps(props, 'TagGroup');
38
+ const [inData, setInData] = useState([]); //数据源
39
+ const [inputValue, setInputValue] = useState(defaultInputValue !== null && defaultInputValue !== void 0 ? defaultInputValue : ''); //input value
40
+ const [inputVisible, setInputVisible] = useState(false); //input visible
41
+ const inputRef = useRef(); //input ref
42
+ const [increasedInputWidth, setIncreasedInputWidth] = useState(); //添加标签的最小宽
43
+ useEffect(() => {
62
44
  if (props.data) {
63
- var tArr = props.data;
45
+ let tArr = props.data;
64
46
  //Item[]
65
- var unObjType = tArr.some(function (v) {
66
- return ['string', 'number'].includes(_typeof(v));
67
- });
47
+ const unObjType = tArr.some(v => ['string', 'number'].includes(typeof v));
68
48
  if (unObjType) {
69
- tArr = tArr.map(function (_) {
70
- return {
71
- value: _,
72
- label: _
73
- };
74
- });
49
+ tArr = tArr.map(_ => ({
50
+ value: _,
51
+ label: _
52
+ }));
75
53
  }
76
- setInData(_toConsumableArray(tArr));
54
+ setInData([...tArr]);
77
55
  }
78
56
  }, [props.data]);
79
57
  //tag value
80
- var getTagGroupVal = function getTagGroupVal(data) {
81
- return data.map(function (_) {
82
- return _.value;
83
- });
58
+ const getTagGroupVal = data => {
59
+ return data.map(_ => _.value);
84
60
  };
85
61
  //show input
86
- var showInput = function showInput() {
62
+ const showInput = () => {
87
63
  setInputVisible(true);
88
- setTimeout(function () {
64
+ setTimeout(() => {
89
65
  var _a;
90
66
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
91
67
  });
92
68
  };
93
- var handleTagEdit = function handleTagEdit(value, idx) {
69
+ const handleTagEdit = (value, idx) => {
94
70
  inData[idx].value = value;
95
- setInData(_toConsumableArray(inData));
71
+ setInData([...inData]);
96
72
  onChange === null || onChange === void 0 ? void 0 : onChange(inData, getTagGroupVal(inData));
97
73
  };
98
74
  //input change
99
- var handleInputChange = function handleInputChange(e) {
75
+ const handleInputChange = e => {
100
76
  setInputValue(e.target.value);
101
77
  };
102
78
  //input confirm
103
- var handleInputConfirm = function handleInputConfirm() {
104
- var val = inputValue.trim();
79
+ const handleInputConfirm = () => {
80
+ const val = inputValue.trim();
105
81
  if (val !== '') {
106
82
  inData.push({
107
83
  value: val,
108
84
  label: val,
109
85
  closable: true
110
86
  });
111
- setInData(_toConsumableArray(inData));
87
+ setInData([...inData]);
112
88
  onChange === null || onChange === void 0 ? void 0 : onChange(inData, getTagGroupVal(inData));
113
89
  }
114
90
  setInputValue(defaultInputValue !== null && defaultInputValue !== void 0 ? defaultInputValue : '');
115
91
  setInputVisible(false);
116
92
  };
117
93
  //input enter
118
- var handleInputEnter = function handleInputEnter(e) {
94
+ const handleInputEnter = e => {
119
95
  if (e.keyCode === 13 || e.which === 13) {
120
96
  handleInputConfirm();
121
97
  }
122
98
  };
123
99
  //handle close
124
- var handleClose = function handleClose(item) {
125
- return function (e) {
126
- var idx = inData.findIndex(function (_) {
127
- return _.value === item.value;
128
- });
129
- if (idx > -1) {
130
- inData.splice(idx, 1);
131
- setInData(_toConsumableArray(inData));
132
- }
133
- if (item.onClose) item.onClose(e);
134
- onChange === null || onChange === void 0 ? void 0 : onChange(inData, getTagGroupVal(inData));
135
- };
100
+ const handleClose = item => e => {
101
+ const idx = inData.findIndex(_ => _.value === item.value);
102
+ if (idx > -1) {
103
+ inData.splice(idx, 1);
104
+ setInData([...inData]);
105
+ }
106
+ if (item.onClose) item.onClose(e);
107
+ onChange === null || onChange === void 0 ? void 0 : onChange(inData, getTagGroupVal(inData));
136
108
  };
137
109
  //渲染Tag组
138
- var renderTagGroup = function renderTagGroup() {
110
+ const renderTagGroup = () => {
139
111
  if (!(inData === null || inData === void 0 ? void 0 : inData.length)) return null;
140
- return inData.map(function (item, idx) {
112
+ return inData.map((item, idx) => {
141
113
  return jsx(Tag, Object.assign({
142
114
  marginBottom: marginBottom,
143
115
  marginRight: marginRight
144
116
  }, item, {
145
117
  size: size,
146
118
  visible: true,
147
- tagChange: function tagChange(value) {
148
- return handleTagEdit(value, idx);
149
- },
119
+ tagChange: value => handleTagEdit(value, idx),
150
120
  onClose: handleClose(item)
151
121
  }, {
152
122
  children: item.label
@@ -154,10 +124,10 @@ var TagGroup = function TagGroup(props) {
154
124
  });
155
125
  };
156
126
  //动态增加tag
157
- var renderNewInput = function renderNewInput() {
127
+ const renderNewInput = () => {
158
128
  var _a;
159
129
  if (inputVisible) {
160
- var inputCls = clsx('tag-group-input', {
130
+ const inputCls = clsx('tag-group-input', {
161
131
  'tag-group-input-large': size === 'large'
162
132
  }, inputClassName);
163
133
  return jsx("input", {
@@ -174,19 +144,17 @@ var TagGroup = function TagGroup(props) {
174
144
  onKeyDown: handleInputEnter
175
145
  });
176
146
  }
177
- var icon = jsx(Plus, {});
178
- var text = 'New Tag';
147
+ let icon = jsx(Plus, {});
148
+ let text = 'New Tag';
179
149
  if (increasedTag) {
180
150
  icon = increasedTag.icon || jsx(Plus, {});
181
151
  text = (_a = increasedTag.text) !== null && _a !== void 0 ? _a : 'New Tag';
182
152
  }
183
- var newCls = clsx('tag-group-new', {
153
+ const newCls = clsx('tag-group-new', {
184
154
  'tag-group-new-icon': !text
185
155
  }, 'tag-group-add-btn');
186
156
  return jsx(Tag, Object.assign({
187
- getWidth: function getWidth(width) {
188
- return setIncreasedInputWidth(width);
189
- },
157
+ getWidth: width => setIncreasedInputWidth(width),
190
158
  className: newCls,
191
159
  size: size,
192
160
  icon: icon,
@@ -24,13 +24,10 @@ import '@para-ui/icons/Forbid';
24
24
  import '../Tag/index.js';
25
25
  import '@para-ui/icons/Close';
26
26
  import '@para-ui/icons/EditOutline';
27
- import '../_verture/toConsumableArray-c7a8028f.js';
28
- import '../_verture/slicedToArray-75fa4188.js';
29
- import '../_verture/typeof-adeedc13.js';
30
27
  import '../_verture/tinycolor-ece3542d.js';
31
28
  import '../_verture/useGlobalProps-4ae1a007.js';
32
29
  import '@para-ui/icons/Plus';
33
- import '../_verture/defineProperty-6f62bb2a.js';
30
+ import '../_verture/defineProperty-f0e15205.js';
34
31
  import 'rc-picker';
35
32
  import '@para-ui/icons/CloseCircleF';
36
33
  import '@para-ui/icons/Calendar';
package/Timeline/index.js CHANGED
@@ -2,10 +2,9 @@ import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import React__default from 'react';
4
4
  import clsx from 'clsx';
5
- import { _ as _defineProperty } from '../_verture/defineProperty-6f62bb2a.js';
5
+ import { a as _defineProperty } from '../_verture/defineProperty-f0e15205.js';
6
6
  import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-5317fc89.js';
7
7
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
8
- import '../_verture/typeof-adeedc13.js';
9
8
 
10
9
  //TimelineItem
11
10
  var TimelineItem = function TimelineItem(props) {