@lemon-fe/components 0.1.154 → 1.1.0-alpha.0
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/es/{Actions → actions}/index.d.ts +8 -5
- package/es/{Actions → actions}/index.js +56 -39
- package/es/{Actions → actions}/index.less +5 -5
- package/es/alert/index.d.ts +3 -0
- package/es/alert/index.js +18 -0
- package/es/{BaseTable/Actions.js → base-table/actions.js} +13 -10
- package/es/{BaseTable → base-table}/index.d.ts +0 -1
- package/es/{BaseTable → base-table}/index.js +48 -22
- package/es/{BaseTable/ResizeHeaderCell.js → base-table/resize-header-cell.js} +3 -3
- package/es/{BaseTable → base-table}/utils.d.ts +1 -1
- package/es/{BaseTable/VirtualBody.js → base-table/virtual-body.js} +12 -13
- package/es/{ColorPicker → color-picker}/index.js +7 -7
- package/es/{ColorPicker → color-picker}/index.less +1 -1
- package/es/component-configure/index.d.ts +12 -0
- package/es/component-configure/index.js +4 -0
- package/es/data-grid/cell-editors/date.d.ts +19 -0
- package/es/data-grid/cell-editors/date.js +92 -0
- package/es/data-grid/cell-editors/number.d.ts +32 -0
- package/es/data-grid/cell-editors/number.js +120 -0
- package/es/data-grid/cell-editors/row.d.ts +23 -0
- package/es/data-grid/cell-editors/row.js +119 -0
- package/es/data-grid/cell-editors/select.d.ts +33 -0
- package/es/data-grid/cell-editors/select.js +102 -0
- package/es/data-grid/cell-editors/text.d.ts +10 -0
- package/es/data-grid/cell-editors/text.js +81 -0
- package/es/data-grid/cell-editors/utils.d.ts +10 -0
- package/es/data-grid/cell-editors/utils.js +45 -0
- package/es/data-grid/cell-editors/wrapper.d.ts +5 -0
- package/es/data-grid/cell-editors/wrapper.js +8 -0
- package/es/data-grid/components/custom-panel/drag-context.d.ts +4 -0
- package/es/data-grid/components/custom-panel/drag-context.js +3 -0
- package/es/data-grid/components/custom-panel/field-modal.d.ts +10 -0
- package/es/data-grid/components/custom-panel/field-modal.js +223 -0
- package/es/data-grid/components/custom-panel/index.d.ts +5 -0
- package/es/data-grid/components/custom-panel/index.js +321 -0
- package/es/data-grid/components/custom-panel/item.d.ts +14 -0
- package/es/data-grid/components/custom-panel/item.js +181 -0
- package/es/data-grid/components/custom-panel/typings.d.ts +25 -0
- package/es/data-grid/components/search.d.ts +4 -0
- package/es/data-grid/components/search.js +159 -0
- package/es/data-grid/components/selected.d.ts +7 -0
- package/es/data-grid/components/selected.js +24 -0
- package/es/data-grid/context/grid-store.d.ts +4 -0
- package/es/data-grid/context/grid-store.js +4 -0
- package/es/data-grid/hooks.d.ts +20 -0
- package/es/data-grid/hooks.js +71 -0
- package/es/data-grid/index.d.ts +102 -0
- package/es/data-grid/index.js +1684 -0
- package/es/data-grid/index.less +659 -0
- package/es/data-grid/modules/clipboard/clipboard/clipboardService.d.ts +62 -0
- package/es/data-grid/modules/clipboard/clipboard/clipboardService.js +1007 -0
- package/es/data-grid/modules/clipboard/clipboardModule.d.ts +2 -0
- package/es/data-grid/modules/clipboard/clipboardModule.js +10 -0
- package/es/data-grid/modules/clipboard/main.d.ts +1 -0
- package/es/data-grid/modules/clipboard/main.js +1 -0
- package/es/data-grid/modules/clipboard/version.d.ts +1 -0
- package/es/data-grid/modules/clipboard/version.js +2 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnModelItem.d.ts +26 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnModelItem.js +94 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnToolPanel.d.ts +32 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnToolPanel.js +272 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/modelItemUtils.d.ts +16 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/modelItemUtils.js +209 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/pivotModePanel.d.ts +9 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/pivotModePanel.js +68 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.d.ts +32 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.js +150 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.d.ts +44 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.js +455 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.d.ts +26 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.js +224 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.d.ts +24 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.js +123 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.d.ts +37 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.js +314 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.d.ts +51 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.js +406 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.d.ts +24 -0
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.js +264 -0
- package/es/data-grid/modules/column-tool-panel/columnsToolPanelModule.d.ts +2 -0
- package/es/data-grid/modules/column-tool-panel/columnsToolPanelModule.js +29 -0
- package/es/data-grid/modules/column-tool-panel/main.d.ts +2 -0
- package/es/data-grid/modules/column-tool-panel/main.js +3 -0
- package/es/data-grid/modules/column-tool-panel/version.d.ts +1 -0
- package/es/data-grid/modules/column-tool-panel/version.js +2 -0
- package/es/data-grid/modules/master-detail/main.d.ts +1 -0
- package/es/data-grid/modules/master-detail/main.js +1 -0
- package/es/data-grid/modules/master-detail/masterDetail/detailCellRenderer.d.ts +14 -0
- package/es/data-grid/modules/master-detail/masterDetail/detailCellRenderer.js +144 -0
- package/es/data-grid/modules/master-detail/masterDetail/detailCellRendererCtrl.d.ts +19 -0
- package/es/data-grid/modules/master-detail/masterDetail/detailCellRendererCtrl.js +203 -0
- package/es/data-grid/modules/master-detail/masterDetailModule.d.ts +2 -0
- package/es/data-grid/modules/master-detail/masterDetailModule.js +18 -0
- package/es/data-grid/modules/master-detail/version.d.ts +1 -0
- package/es/data-grid/modules/master-detail/version.js +2 -0
- package/es/data-grid/modules/menu/main.d.ts +1 -0
- package/es/data-grid/modules/menu/main.js +1 -0
- package/es/data-grid/modules/menu/menu/chartMenuItemMapper.d.ts +13 -0
- package/es/data-grid/modules/menu/menu/chartMenuItemMapper.js +351 -0
- package/es/data-grid/modules/menu/menu/contextMenu.d.ts +13 -0
- package/es/data-grid/modules/menu/menu/contextMenu.js +267 -0
- package/es/data-grid/modules/menu/menu/enterpriseMenu.d.ts +66 -0
- package/es/data-grid/modules/menu/menu/enterpriseMenu.js +592 -0
- package/es/data-grid/modules/menu/menu/menuItemMapper.d.ts +13 -0
- package/es/data-grid/modules/menu/menu/menuItemMapper.js +328 -0
- package/es/data-grid/modules/menu/menuModule.d.ts +2 -0
- package/es/data-grid/modules/menu/menuModule.js +12 -0
- package/es/data-grid/modules/menu/version.d.ts +1 -0
- package/es/data-grid/modules/menu/version.js +2 -0
- package/es/data-grid/modules/row-grouping/main.d.ts +4 -0
- package/es/data-grid/modules/row-grouping/main.js +4 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/aggFuncService.d.ts +23 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/aggFuncService.js +250 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/aggregationStage.d.ts +22 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/aggregationStage.js +285 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/batchRemover.d.ts +12 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/batchRemover.js +77 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.d.ts +75 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.js +516 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.d.ts +40 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.js +367 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.d.ts +11 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.js +85 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.d.ts +17 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.js +139 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.d.ts +15 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.js +105 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.d.ts +15 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.js +105 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/filterAggregatesStage.d.ts +9 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/filterAggregatesStage.js +136 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFilter.d.ts +39 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFilter.js +319 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFloatingFilter.d.ts +23 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFloatingFilter.js +163 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/groupStage.d.ts +48 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/groupStage.js +740 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/pivotColDefService.d.ts +24 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/pivotColDefService.js +396 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/pivotStage.d.ts +19 -0
- package/es/data-grid/modules/row-grouping/rowGrouping/pivotStage.js +182 -0
- package/es/data-grid/modules/row-grouping/rowGroupingModule.d.ts +2 -0
- package/es/data-grid/modules/row-grouping/rowGroupingModule.js +28 -0
- package/es/data-grid/modules/row-grouping/version.d.ts +1 -0
- package/es/data-grid/modules/row-grouping/version.js +2 -0
- package/es/data-grid/modules/side-bar/main.d.ts +2 -0
- package/es/data-grid/modules/side-bar/main.js +2 -0
- package/es/data-grid/modules/side-bar/sideBar/common/toolPanelColDefService.d.ts +11 -0
- package/es/data-grid/modules/side-bar/sideBar/common/toolPanelColDefService.js +216 -0
- package/es/data-grid/modules/side-bar/sideBar/horizontalResizeComp.d.ts +19 -0
- package/es/data-grid/modules/side-bar/sideBar/horizontalResizeComp.js +108 -0
- package/es/data-grid/modules/side-bar/sideBar/sideBarButtonComp.d.ts +16 -0
- package/es/data-grid/modules/side-bar/sideBar/sideBarButtonComp.js +84 -0
- package/es/data-grid/modules/side-bar/sideBar/sideBarButtonsComp.d.ts +18 -0
- package/es/data-grid/modules/side-bar/sideBar/sideBarButtonsComp.js +89 -0
- package/es/data-grid/modules/side-bar/sideBar/sideBarComp.d.ts +28 -0
- package/es/data-grid/modules/side-bar/sideBar/sideBarComp.js +325 -0
- package/es/data-grid/modules/side-bar/sideBar/sideBarDefParser.d.ts +10 -0
- package/es/data-grid/modules/side-bar/sideBar/sideBarDefParser.js +95 -0
- package/es/data-grid/modules/side-bar/sideBar/toolPanelWrapper.d.ts +17 -0
- package/es/data-grid/modules/side-bar/sideBar/toolPanelWrapper.js +103 -0
- package/es/data-grid/modules/side-bar/sideBarModule.d.ts +2 -0
- package/es/data-grid/modules/side-bar/sideBarModule.js +22 -0
- package/es/data-grid/modules/side-bar/version.d.ts +1 -0
- package/es/data-grid/modules/side-bar/version.js +2 -0
- package/es/data-grid/renderer/actions-renderer.d.ts +3 -0
- package/es/data-grid/renderer/actions-renderer.js +50 -0
- package/es/data-grid/renderer/actions.d.ts +11 -0
- package/es/data-grid/renderer/actions.js +72 -0
- package/es/data-grid/renderer/cell-delete-renderer.d.ts +5 -0
- package/es/data-grid/renderer/cell-delete-renderer.js +49 -0
- package/es/data-grid/renderer/cell-index-renderer.d.ts +4 -0
- package/es/data-grid/renderer/cell-index-renderer.js +43 -0
- package/es/data-grid/renderer/cell-renderer.d.ts +4 -0
- package/es/data-grid/renderer/cell-renderer.js +58 -0
- package/es/data-grid/renderer/detali-cell-renderer.d.ts +9 -0
- package/es/data-grid/renderer/detali-cell-renderer.js +59 -0
- package/es/data-grid/renderer/header-renderer.d.ts +6 -0
- package/es/data-grid/renderer/header-renderer.js +98 -0
- package/es/data-grid/typings.d.ts +226 -0
- package/es/data-grid/typings.js +1 -0
- package/es/data-grid/utils.d.ts +51 -0
- package/es/data-grid/utils.js +293 -0
- package/es/dropdown/index.d.ts +14 -0
- package/es/dropdown/index.js +42 -0
- package/es/dropdown/index.less +5 -0
- package/es/{DurationPicker → duration-picker}/index.d.ts +12 -9
- package/es/duration-picker/index.js +204 -0
- package/es/duration-picker/index.less +12 -0
- package/es/{EditableTable/EditableCell.d.ts → editable-table/editable-cell.d.ts} +1 -1
- package/es/editable-table/editable-cell.js +41 -0
- package/es/{EditableTable/EditableTableFormItem.d.ts → editable-table/editable-table-form-item.d.ts} +1 -1
- package/es/{EditableTable/EditableTableFormItem.js → editable-table/editable-table-form-item.js} +3 -5
- package/es/{EditableTable → editable-table}/index.d.ts +3 -3
- package/es/editable-table/index.js +8 -0
- package/es/{EditableTable/Table.d.ts → editable-table/table.d.ts} +1 -1
- package/es/{EditableTable/Table.js → editable-table/table.js} +27 -22
- package/es/{EditableTable → editable-table}/typings.d.ts +2 -2
- package/es/editable-table/util.js +311 -0
- package/es/empty-image/index.d.ts +2 -0
- package/es/empty-image/index.js +78 -0
- package/es/{Filter → filter}/index.d.ts +3 -3
- package/es/filter/index.js +615 -0
- package/es/{Filter → filter}/index.less +5 -5
- package/es/filter/typings.d.ts +70 -0
- package/es/{FormLayout → form-layout}/index.d.ts +5 -0
- package/es/form-layout/index.js +48 -0
- package/es/{FormLayout → form-layout}/index.less +21 -8
- package/es/grey-panel/index.d.ts +6 -0
- package/es/grey-panel/index.js +15 -0
- package/es/grey-panel/index.less +11 -0
- package/es/icons/add.d.ts +6 -0
- package/es/icons/add.js +39 -0
- package/es/{Icons/BigTip → icons/big-tip}/index.d.ts +1 -1
- package/es/{Icons/BigTip → icons/big-tip}/index.js +6 -8
- package/es/{Icons/Down.d.ts → icons/calendar.d.ts} +1 -1
- package/es/icons/calendar.js +35 -0
- package/es/icons/clear.d.ts +3 -0
- package/es/icons/clear.js +18 -0
- package/es/icons/clock.d.ts +5 -0
- package/es/icons/clock.js +27 -0
- package/es/icons/close-light.d.ts +5 -0
- package/es/icons/close-light.js +31 -0
- package/es/{Icons/Close.d.ts → icons/close.d.ts} +1 -1
- package/es/icons/close.js +22 -0
- package/es/{Icons/CollapseUp.d.ts → icons/collapse-up.d.ts} +1 -1
- package/es/icons/collapse-up.js +24 -0
- package/es/{Icons/Search.d.ts → icons/dark-search.d.ts} +1 -1
- package/es/{Icons/DarkSearch.js → icons/dark-search.js} +3 -5
- package/es/icons/delete.d.ts +3 -0
- package/es/icons/delete.js +37 -0
- package/es/icons/down.d.ts +3 -0
- package/es/icons/down.js +18 -0
- package/es/icons/drag/drag.svg +7 -0
- package/es/icons/drag/index.d.ts +3 -0
- package/es/icons/drag/index.js +31 -0
- package/es/{Icons/Empty.d.ts → icons/empty.d.ts} +1 -0
- package/es/icons/index.d.ts +45 -0
- package/es/icons/index.js +45 -0
- package/es/{Icons/LookUp.d.ts → icons/look-up.d.ts} +1 -1
- package/es/{Icons/LookUp.js → icons/look-up.js} +3 -5
- package/es/icons/more.d.ts +3 -0
- package/es/icons/more.js +37 -0
- package/es/icons/new-tag.d.ts +3 -0
- package/es/icons/new-tag.js +19 -0
- package/es/icons/plus/index.d.ts +3 -0
- package/es/icons/plus/index.js +27 -0
- package/es/icons/plus/plus.svg +6 -0
- package/es/icons/question.d.ts +3 -0
- package/es/icons/question.js +18 -0
- package/es/icons/reload.d.ts +3 -0
- package/es/icons/reload.js +18 -0
- package/es/icons/search.d.ts +3 -0
- package/es/icons/search.js +18 -0
- package/es/icons/tip.d.ts +5 -0
- package/es/{Icons/Tip.js → icons/tip.js} +64 -75
- package/es/index.d.ts +43 -32
- package/es/index.js +36 -28
- package/es/input-compact/index.d.ts +11 -0
- package/es/input-compact/index.js +63 -0
- package/es/input-compact/index.less +33 -0
- package/es/input-number/index.d.ts +8 -0
- package/es/input-number/index.js +35 -0
- package/es/input-number/index.less +58 -0
- package/es/{Layout → layout}/index.d.ts +26 -8
- package/es/layout/index.js +253 -0
- package/es/{Layout → layout}/index.less +43 -25
- package/es/{PageLoading → page-loading}/index.d.ts +2 -1
- package/es/{PageLoading → page-loading}/index.js +5 -3
- package/es/popup/index.d.ts +80 -0
- package/es/popup/index.js +260 -0
- package/es/popup/index.less +34 -0
- package/es/portal/index.d.ts +18 -0
- package/es/{Portal → portal}/index.js +48 -14
- package/es/{Section → section}/index.d.ts +10 -2
- package/es/section/index.js +99 -0
- package/es/{Section → section}/index.less +22 -6
- package/es/{Section/TabBar.d.ts → section/tab-bar.d.ts} +2 -1
- package/es/{Section/TabBar.js → section/tab-bar.js} +6 -3
- package/es/select-panel/index.d.ts +17 -0
- package/es/select-panel/index.js +63 -0
- package/es/select-panel/index.less +112 -0
- package/es/select-view/index.d.ts +63 -0
- package/es/select-view/index.js +269 -0
- package/es/select-view/index.less +57 -0
- package/es/{SiderTree → sider-tree}/index.d.ts +6 -12
- package/es/{SiderTree → sider-tree}/index.js +58 -82
- package/es/sider-tree/index.less +151 -0
- package/es/{SiderTree/TreeNodeTitle.js → sider-tree/tree-node-title.js} +13 -10
- package/es/{SiderTree → sider-tree}/typings.d.ts +2 -2
- package/es/state/index.d.ts +8 -0
- package/es/state/index.js +20 -0
- package/es/state/index.less +131 -0
- package/es/styles/empty.png +0 -0
- package/es/styles/index.less +28 -0
- package/es/styles/overrides.less +347 -0
- package/es/styles/theme.less +29 -0
- package/es/{utils.less → styles/utils.less} +18 -18
- package/es/symbol-icon/index.js +30 -0
- package/es/{TabBar → tab-bar}/index.d.ts +2 -3
- package/es/tab-bar/index.js +31 -0
- package/es/tab-bar/index.less +5 -0
- package/es/table/index.js +201 -0
- package/es/{Table → table}/typings.d.ts +2 -3
- package/es/{Table → table}/utils.d.ts +1 -1
- package/es/tip-mark/index.d.ts +8 -0
- package/es/tip-mark/index.js +44 -0
- package/es/utils.d.ts +2 -1
- package/es/utils.js +10 -2
- package/package.json +50 -21
- package/README.md +0 -11
- package/es/Dropdown/index.d.ts +0 -15
- package/es/Dropdown/index.js +0 -45
- package/es/Dropdown/index.less +0 -13
- package/es/DurationPicker/index.js +0 -174
- package/es/DurationPicker/index.less +0 -61
- package/es/EditableTable/EditableCell.js +0 -41
- package/es/EditableTable/index.js +0 -8
- package/es/EditableTable/util.js +0 -311
- package/es/Filter/index.js +0 -555
- package/es/Filter/typings.d.ts +0 -37
- package/es/FormHorizontal/index.d.ts +0 -6
- package/es/FormHorizontal/index.js +0 -30
- package/es/FormHorizontal/index.less +0 -14
- package/es/FormInline/index.d.ts +0 -15
- package/es/FormInline/index.js +0 -74
- package/es/FormInline/index.less +0 -26
- package/es/FormLayout/index.js +0 -36
- package/es/FormTable/index.d.ts +0 -6
- package/es/FormTable/index.js +0 -125
- package/es/FormTable/index.less +0 -11
- package/es/FormTable/typings.d.ts +0 -38
- package/es/Icons/Calendar.d.ts +0 -5
- package/es/Icons/Calendar.js +0 -42
- package/es/Icons/Close.js +0 -24
- package/es/Icons/CollapseUp.js +0 -26
- package/es/Icons/DarkSearch.d.ts +0 -5
- package/es/Icons/Down.js +0 -30
- package/es/Icons/More.d.ts +0 -5
- package/es/Icons/More.js +0 -39
- package/es/Icons/Search.js +0 -30
- package/es/Icons/Tip.d.ts +0 -6
- package/es/Icons/index.d.ts +0 -24
- package/es/Icons/index.js +0 -25
- package/es/InputMaxLength/index.d.ts +0 -14
- package/es/InputMaxLength/index.js +0 -72
- package/es/InputMaxLength/index.less +0 -8
- package/es/Layout/index.js +0 -184
- package/es/MainFramework/components/DropMenu/index.d.ts +0 -11
- package/es/MainFramework/components/DropMenu/index.js +0 -93
- package/es/MainFramework/components/DropMenu/index.less +0 -59
- package/es/MainFramework/components/Menu/index.d.ts +0 -10
- package/es/MainFramework/components/Menu/index.js +0 -603
- package/es/MainFramework/components/Menu/index.less +0 -445
- package/es/MainFramework/components/RefreshButton/index.d.ts +0 -6
- package/es/MainFramework/components/RefreshButton/index.js +0 -63
- package/es/MainFramework/components/RefreshButton/index.less +0 -30
- package/es/MainFramework/components/TabBar/index.d.ts +0 -10
- package/es/MainFramework/components/TabBar/index.js +0 -101
- package/es/MainFramework/components/TabBar/index.less +0 -155
- package/es/MainFramework/components/WaterMark/index.d.ts +0 -6
- package/es/MainFramework/components/WaterMark/index.js +0 -65
- package/es/MainFramework/index.d.ts +0 -28
- package/es/MainFramework/index.js +0 -78
- package/es/MainFramework/index.less +0 -97
- package/es/MainFramework/typings.d.ts +0 -10
- package/es/Popup/index.d.ts +0 -39
- package/es/Popup/index.js +0 -180
- package/es/Popup/index.less +0 -12
- package/es/Portal/index.d.ts +0 -17
- package/es/Section/index.js +0 -90
- package/es/SelectView/index.d.ts +0 -56
- package/es/SelectView/index.js +0 -227
- package/es/SelectView/index.less +0 -60
- package/es/SiderTree/index.less +0 -222
- package/es/SymbolIcon/index.js +0 -27
- package/es/TabBar/index.js +0 -42
- package/es/TabBar/index.less +0 -31
- package/es/Table/index.js +0 -205
- package/es/TipMark/index.d.ts +0 -10
- package/es/TipMark/index.js +0 -35
- package/es/TipMark/index.less +0 -6
- package/es/index.less +0 -26
- package/es/init.d.ts +0 -3
- package/es/init.js +0 -134
- package/es/overrides.less +0 -183
- package/es/theme.less +0 -9
- /package/es/{BaseTable/Actions.d.ts → base-table/actions.d.ts} +0 -0
- /package/es/{BaseTable/BaseTableContext.d.ts → base-table/base-table-context.d.ts} +0 -0
- /package/es/{BaseTable/BaseTableContext.js → base-table/base-table-context.js} +0 -0
- /package/es/{BaseTable → base-table}/empty.png +0 -0
- /package/es/{BaseTable → base-table}/index.less +0 -0
- /package/es/{BaseTable/ResizeHeaderCell.d.ts → base-table/resize-header-cell.d.ts} +0 -0
- /package/es/{BaseTable → base-table}/typings.d.ts +0 -0
- /package/es/{BaseTable → base-table}/utils.js +0 -0
- /package/es/{BaseTable/VirtualBody.d.ts → base-table/virtual-body.d.ts} +0 -0
- /package/es/{ColorPicker → color-picker}/index.d.ts +0 -0
- /package/es/{EditableTable → editable-table}/index.less +0 -0
- /package/es/{EditableTable → editable-table}/util.d.ts +0 -0
- /package/es/{Icons/BigTip → icons/big-tip}/error.png +0 -0
- /package/es/{Icons/BigTip → icons/big-tip}/info.png +0 -0
- /package/es/{Icons/BigTip → icons/big-tip}/success.png +0 -0
- /package/es/{Icons/BigTip → icons/big-tip}/warning.png +0 -0
- /package/es/{Icons/Empty.js → icons/empty.js} +0 -0
- /package/es/{PageLoading → page-loading}/index.less +0 -0
- /package/es/{SiderTree → sider-tree}/empty.png +0 -0
- /package/es/{SiderTree/TreeNodeTitle.d.ts → sider-tree/tree-node-title.d.ts} +0 -0
- /package/es/{SymbolIcon → symbol-icon}/index.d.ts +0 -0
- /package/es/{SymbolIcon → symbol-icon}/index.less +0 -0
- /package/es/{Table → table}/index.d.ts +0 -0
- /package/es/{Table → table}/utils.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
2
|
import type { CSSProperties } from 'react';
|
|
3
|
-
import { ButtonProps } from 'antd';
|
|
3
|
+
import { type ButtonProps } from 'antd';
|
|
4
4
|
interface ActionBtn extends ButtonProps {
|
|
5
5
|
text: string | ReactElement;
|
|
6
6
|
onClick?: () => void;
|
|
@@ -10,16 +10,19 @@ interface ActionBtn extends ButtonProps {
|
|
|
10
10
|
*/
|
|
11
11
|
action?: () => void;
|
|
12
12
|
dropDown?: ({
|
|
13
|
-
text: string;
|
|
14
|
-
onClick
|
|
13
|
+
text: string | ReactElement;
|
|
14
|
+
onClick?: () => void;
|
|
15
15
|
disabled?: boolean;
|
|
16
|
-
} | null)[];
|
|
16
|
+
} | ReactElement | null)[] | ReactElement;
|
|
17
17
|
}
|
|
18
18
|
interface Props {
|
|
19
19
|
actions: (ActionBtn | ReactElement | null)[];
|
|
20
20
|
style?: CSSProperties;
|
|
21
21
|
className?: string;
|
|
22
22
|
prefixCls?: string;
|
|
23
|
+
/**
|
|
24
|
+
* @description 默认无限大
|
|
25
|
+
*/
|
|
23
26
|
maxShowCount?: number;
|
|
24
27
|
}
|
|
25
28
|
declare function Actions(props: Props): JSX.Element;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
var _excluded = ["disabled", "dropDown", "text", "onClick", "icon", "action"];
|
|
2
|
-
function
|
|
3
|
-
function
|
|
4
|
-
function
|
|
3
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
7
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
8
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
10
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
11
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
11
|
-
function _iterableToArrayLimit(
|
|
12
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import React, { Fragment, useState } from 'react';
|
|
15
|
+
import React, { Fragment, useState, isValidElement } from 'react';
|
|
14
16
|
import { Space, Dropdown, Menu, Button, Popover } from 'antd';
|
|
15
17
|
import classNames from 'classnames';
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
+
import { PREFIX_CLS } from "../constants";
|
|
19
|
+
import Icons from "../icons";
|
|
18
20
|
function Actions(props) {
|
|
19
21
|
var actions = props.actions,
|
|
20
22
|
className = props.className,
|
|
@@ -22,7 +24,7 @@ function Actions(props) {
|
|
|
22
24
|
_props$prefixCls = props.prefixCls,
|
|
23
25
|
prefixCls = _props$prefixCls === void 0 ? PREFIX_CLS : _props$prefixCls,
|
|
24
26
|
_props$maxShowCount = props.maxShowCount,
|
|
25
|
-
maxShowCount = _props$maxShowCount === void 0 ?
|
|
27
|
+
maxShowCount = _props$maxShowCount === void 0 ? Infinity : _props$maxShowCount;
|
|
26
28
|
var _useState = useState(false),
|
|
27
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28
30
|
visible = _useState2[0],
|
|
@@ -34,12 +36,12 @@ function Actions(props) {
|
|
|
34
36
|
style: style
|
|
35
37
|
}, /*#__PURE__*/React.createElement(Space, {
|
|
36
38
|
direction: "horizontal",
|
|
37
|
-
size:
|
|
39
|
+
size: 8
|
|
38
40
|
}, visibleBtns.map(function (item, index) {
|
|
39
41
|
if (item === null) {
|
|
40
42
|
return item;
|
|
41
43
|
}
|
|
42
|
-
if ( /*#__PURE__*/
|
|
44
|
+
if ( /*#__PURE__*/isValidElement(item)) {
|
|
43
45
|
return /*#__PURE__*/React.createElement(Fragment, {
|
|
44
46
|
key: index
|
|
45
47
|
}, item);
|
|
@@ -51,56 +53,71 @@ function Actions(props) {
|
|
|
51
53
|
icon = item.icon,
|
|
52
54
|
action = item.action,
|
|
53
55
|
rest = _objectWithoutProperties(item, _excluded);
|
|
54
|
-
if ( /*#__PURE__*/
|
|
56
|
+
if ( /*#__PURE__*/isValidElement(text)) {
|
|
55
57
|
return /*#__PURE__*/React.createElement(Fragment, {
|
|
56
58
|
key: index
|
|
57
59
|
}, text);
|
|
58
60
|
}
|
|
59
61
|
var handleClick = onClick || action;
|
|
60
|
-
if (
|
|
61
|
-
var overlay
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
if (dropDown !== undefined) {
|
|
63
|
+
var overlay;
|
|
64
|
+
if (Array.isArray(dropDown)) {
|
|
65
|
+
overlay = /*#__PURE__*/React.createElement(Menu, {
|
|
66
|
+
items: dropDown.filter(Boolean).map(function (subItem, idx) {
|
|
67
|
+
if ( /*#__PURE__*/isValidElement(subItem)) {
|
|
68
|
+
return {
|
|
69
|
+
label: subItem,
|
|
70
|
+
key: idx
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
var target = subItem;
|
|
74
|
+
return {
|
|
75
|
+
label: target.text,
|
|
76
|
+
key: idx,
|
|
77
|
+
disabled: target.disabled,
|
|
78
|
+
onClick: target.onClick
|
|
79
|
+
};
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
} else {
|
|
83
|
+
overlay = dropDown;
|
|
84
|
+
}
|
|
72
85
|
if (handleClick !== undefined) {
|
|
73
|
-
return /*#__PURE__*/React.createElement(Dropdown.Button, {
|
|
86
|
+
return /*#__PURE__*/React.createElement(Dropdown.Button, _extends({
|
|
74
87
|
key: text,
|
|
75
88
|
disabled: disabled,
|
|
76
89
|
overlay: overlay,
|
|
77
90
|
onClick: handleClick,
|
|
91
|
+
trigger: ['click'],
|
|
92
|
+
overlayStyle: {
|
|
93
|
+
minWidth: 80
|
|
94
|
+
},
|
|
78
95
|
buttonsRender: function buttonsRender(_ref) {
|
|
79
|
-
var _ref2 = _slicedToArray(_ref,
|
|
80
|
-
leftBtn = _ref2[0]
|
|
81
|
-
_ = _ref2[1];
|
|
96
|
+
var _ref2 = _slicedToArray(_ref, 1),
|
|
97
|
+
leftBtn = _ref2[0];
|
|
82
98
|
return [leftBtn, /*#__PURE__*/React.createElement(Button, {
|
|
83
|
-
icon: /*#__PURE__*/React.createElement(Icons.More, null)
|
|
99
|
+
icon: /*#__PURE__*/React.createElement(Icons.More, null),
|
|
100
|
+
type: rest.type,
|
|
101
|
+
key: "more"
|
|
84
102
|
})];
|
|
85
103
|
}
|
|
86
|
-
}, text);
|
|
104
|
+
}, rest), text);
|
|
87
105
|
}
|
|
88
106
|
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
89
107
|
key: text,
|
|
90
108
|
disabled: disabled,
|
|
91
|
-
overlay: overlay
|
|
92
|
-
|
|
109
|
+
overlay: overlay,
|
|
110
|
+
trigger: ['click']
|
|
111
|
+
}, /*#__PURE__*/React.createElement(Button, _extends({
|
|
93
112
|
disabled: disabled,
|
|
94
113
|
icon: icon
|
|
95
114
|
}, rest), text, /*#__PURE__*/React.createElement(Icons.Down, {
|
|
96
115
|
style: {
|
|
97
|
-
opacity: 0.7
|
|
98
|
-
fontSize: 16,
|
|
99
|
-
verticalAlign: -3
|
|
116
|
+
opacity: 0.7
|
|
100
117
|
}
|
|
101
118
|
})));
|
|
102
119
|
}
|
|
103
|
-
return /*#__PURE__*/React.createElement(Button,
|
|
120
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
104
121
|
key: text,
|
|
105
122
|
disabled: disabled,
|
|
106
123
|
onClick: handleClick,
|
|
@@ -109,14 +126,14 @@ function Actions(props) {
|
|
|
109
126
|
}), collapsedBtns.length > 0 ? /*#__PURE__*/React.createElement(Popover, {
|
|
110
127
|
placement: "bottomRight",
|
|
111
128
|
overlayClassName: "".concat(prefixCls, "-actions-popover"),
|
|
112
|
-
|
|
113
|
-
|
|
129
|
+
onOpenChange: setVisible,
|
|
130
|
+
open: visible,
|
|
114
131
|
trigger: "click",
|
|
115
132
|
content: collapsedBtns.map(function (item, index) {
|
|
116
133
|
if (item === null) {
|
|
117
134
|
return item;
|
|
118
135
|
}
|
|
119
|
-
if ( /*#__PURE__*/
|
|
136
|
+
if ( /*#__PURE__*/isValidElement(item)) {
|
|
120
137
|
return /*#__PURE__*/React.createElement(Fragment, {
|
|
121
138
|
key: index
|
|
122
139
|
}, item);
|
|
@@ -24,11 +24,12 @@
|
|
|
24
24
|
|
|
25
25
|
&-item {
|
|
26
26
|
box-sizing: border-box;
|
|
27
|
-
width: 120px;
|
|
28
|
-
|
|
27
|
+
min-width: 120px;
|
|
28
|
+
max-width: 200px;
|
|
29
|
+
height: 30px;
|
|
29
30
|
padding: 0 16px;
|
|
30
31
|
color: #333;
|
|
31
|
-
line-height:
|
|
32
|
+
line-height: 30px;
|
|
32
33
|
list-style: none;
|
|
33
34
|
cursor: pointer;
|
|
34
35
|
transition: background-color 0.2s;
|
|
@@ -46,8 +47,7 @@
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
.@{ant-prefix}-btn:not(.@{ant-prefix}-btn-icon-only) {
|
|
49
|
-
min-width:
|
|
50
|
-
padding: 4px 12px;
|
|
50
|
+
min-width: 60px;
|
|
51
51
|
|
|
52
52
|
.@{prefixCls}-symbol-icon {
|
|
53
53
|
margin-right: 8px;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var _excluded = ["icon", "type"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import Icons from "../icons";
|
|
7
|
+
import { Alert as AntdAlert } from 'antd';
|
|
8
|
+
export default function Alert(props) {
|
|
9
|
+
var icon = props.icon,
|
|
10
|
+
type = props.type,
|
|
11
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
12
|
+
return /*#__PURE__*/React.createElement(AntdAlert, _extends({}, restProps, {
|
|
13
|
+
type: type,
|
|
14
|
+
icon: icon || /*#__PURE__*/React.createElement(Icons.Tip, {
|
|
15
|
+
type: type
|
|
16
|
+
})
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
2
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
6
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
6
|
-
function _iterableToArrayLimit(
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
11
|
import React, { useRef, useState } from 'react';
|
|
9
|
-
import classNames from 'classnames';
|
|
10
12
|
import { createPortal } from 'react-dom';
|
|
11
|
-
import { PREFIX_CLS } from
|
|
12
|
-
import Icons from
|
|
13
|
+
import { PREFIX_CLS } from "../constants";
|
|
14
|
+
import Icons from "../icons";
|
|
15
|
+
import classNames from 'classnames';
|
|
13
16
|
export default function Actions(props) {
|
|
14
17
|
var actionsProp = props.actions,
|
|
15
18
|
row = props.row,
|
|
@@ -58,8 +61,8 @@ export default function Actions(props) {
|
|
|
58
61
|
return null;
|
|
59
62
|
}
|
|
60
63
|
var key = getKey(item, idx);
|
|
61
|
-
var dropDown = item.dropDown ? item.dropDown.filter(function (
|
|
62
|
-
return
|
|
64
|
+
var dropDown = item.dropDown ? item.dropDown.filter(function (sub) {
|
|
65
|
+
return sub !== null;
|
|
63
66
|
}) : [];
|
|
64
67
|
return /*#__PURE__*/React.createElement("div", {
|
|
65
68
|
className: classNames("".concat(prefixCls, "-item"), _defineProperty({}, "".concat(prefixCls, "-item-disabled"), item.disabled)),
|
|
@@ -83,7 +86,7 @@ export default function Actions(props) {
|
|
|
83
86
|
});
|
|
84
87
|
} else {
|
|
85
88
|
var _item$onClick;
|
|
86
|
-
(_item$onClick = item.onClick) === null || _item$onClick === void 0
|
|
89
|
+
(_item$onClick = item.onClick) === null || _item$onClick === void 0 || _item$onClick.call(item, row, index);
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
92
|
}, item.text, dropDown.length > 0 && /*#__PURE__*/React.createElement(Icons.Down, null));
|
|
@@ -106,7 +109,7 @@ export default function Actions(props) {
|
|
|
106
109
|
if (!item.disabled) {
|
|
107
110
|
var _item$onClick2;
|
|
108
111
|
closePop();
|
|
109
|
-
(_item$onClick2 = item.onClick) === null || _item$onClick2 === void 0
|
|
112
|
+
(_item$onClick2 = item.onClick) === null || _item$onClick2 === void 0 || _item$onClick2.call(item, row, index);
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
}, item.text);
|
|
@@ -4,31 +4,49 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
|
|
|
4
4
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
6
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
-
function _typeof(
|
|
7
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
10
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
12
|
-
function _iterableToArrayLimit(
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
function
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
15
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
|
-
|
|
17
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
21
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
22
|
import React, { useMemo, useState, useEffect, useRef, forwardRef, useContext } from 'react';
|
|
21
23
|
import { Table as AntdTable, ConfigProvider } from 'antd';
|
|
22
24
|
import classNames from 'classnames';
|
|
23
25
|
import { get } from 'lodash';
|
|
24
26
|
import ResizeObserver from 'rc-resize-observer';
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
27
|
+
import { PREFIX_CLS } from "../constants";
|
|
28
|
+
import Actions from "./actions";
|
|
29
|
+
import BaseTableContext from "./base-table-context";
|
|
30
|
+
import empty from "./empty.png";
|
|
31
|
+
import ResizeHeaderCell from "./resize-header-cell";
|
|
32
|
+
import { isColumnType, getColumnKey } from "./utils";
|
|
33
|
+
import VirtualList from "./virtual-body";
|
|
34
|
+
function formatSummary(summary) {
|
|
35
|
+
if (!summary) {
|
|
36
|
+
return summary;
|
|
37
|
+
}
|
|
38
|
+
var obj = _objectSpread({}, summary);
|
|
39
|
+
var pretty = new Intl.NumberFormat('en-US', {
|
|
40
|
+
minimumFractionDigits: 2,
|
|
41
|
+
maximumFractionDigits: 2
|
|
42
|
+
});
|
|
43
|
+
Object.keys(obj).forEach(function (key) {
|
|
44
|
+
if (obj.hasOwnProperty(key) && typeof obj[key] === 'number') {
|
|
45
|
+
obj[key] = pretty.format(obj[key]);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return obj;
|
|
49
|
+
}
|
|
32
50
|
function Th(props) {
|
|
33
51
|
var onWidthChange = props.onWidthChange,
|
|
34
52
|
width = props.width,
|
|
@@ -48,7 +66,7 @@ function Th(props) {
|
|
|
48
66
|
}, content);
|
|
49
67
|
}
|
|
50
68
|
if (!width || !onWidthChange) {
|
|
51
|
-
return /*#__PURE__*/React.createElement("th",
|
|
69
|
+
return /*#__PURE__*/React.createElement("th", _extends({}, restProps, {
|
|
52
70
|
className: mClassName
|
|
53
71
|
}), content);
|
|
54
72
|
}
|
|
@@ -57,7 +75,7 @@ function Th(props) {
|
|
|
57
75
|
onChange: onWidthChange,
|
|
58
76
|
fullTableRef: fullTableRef,
|
|
59
77
|
prefixCls: "".concat(PREFIX_CLS, "-table")
|
|
60
|
-
}, /*#__PURE__*/React.createElement("th",
|
|
78
|
+
}, /*#__PURE__*/React.createElement("th", _extends({}, restProps, {
|
|
61
79
|
className: mClassName
|
|
62
80
|
}), content));
|
|
63
81
|
}
|
|
@@ -97,7 +115,9 @@ function BaseTable(props, _ref) {
|
|
|
97
115
|
scrollY = _useState4[0],
|
|
98
116
|
setScrollY = _useState4[1];
|
|
99
117
|
var memoHeight = useRef(0);
|
|
118
|
+
|
|
100
119
|
/** auto scroll y */
|
|
120
|
+
|
|
101
121
|
var calcScrollY = function calcScrollY() {
|
|
102
122
|
var wrapper = fullTableRef.current;
|
|
103
123
|
if (wrapper === null) {
|
|
@@ -112,8 +132,8 @@ function BaseTable(props, _ref) {
|
|
|
112
132
|
if (parent === null) {
|
|
113
133
|
return null;
|
|
114
134
|
}
|
|
115
|
-
var
|
|
116
|
-
var contentHeight = parent.offsetHeight - (parseFloat(
|
|
135
|
+
var mStyle = getComputedStyle(parent);
|
|
136
|
+
var contentHeight = parent.offsetHeight - (parseFloat(mStyle.getPropertyValue('padding-top')) || 0) - (parseFloat(mStyle.getPropertyValue('padding-bottom')) || 0);
|
|
117
137
|
var nodes = [];
|
|
118
138
|
if (tableBody.previousElementSibling !== null) {
|
|
119
139
|
nodes.push(tableBody.previousElementSibling);
|
|
@@ -173,7 +193,9 @@ function BaseTable(props, _ref) {
|
|
|
173
193
|
}
|
|
174
194
|
}
|
|
175
195
|
}, [scrollY]);
|
|
196
|
+
|
|
176
197
|
/** resizable column */
|
|
198
|
+
|
|
177
199
|
var _useMemo = useMemo(function () {
|
|
178
200
|
var flattenCols = [];
|
|
179
201
|
var isFixedLayout = tableLayout === 'fixed';
|
|
@@ -245,7 +267,9 @@ function BaseTable(props, _ref) {
|
|
|
245
267
|
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
246
268
|
formatedColumns = _useMemo2[0],
|
|
247
269
|
flattenColumns = _useMemo2[1];
|
|
270
|
+
|
|
248
271
|
/** row actions */
|
|
272
|
+
/** virtualize scroll */
|
|
249
273
|
var _useMemo3 = useMemo(function () {
|
|
250
274
|
if (rowActions !== undefined) {
|
|
251
275
|
var actionCol = {
|
|
@@ -268,7 +292,6 @@ function BaseTable(props, _ref) {
|
|
|
268
292
|
var _useMemo4 = _slicedToArray(_useMemo3, 2);
|
|
269
293
|
formatedColumns = _useMemo4[0];
|
|
270
294
|
flattenColumns = _useMemo4[1];
|
|
271
|
-
/** virtualize scroll */
|
|
272
295
|
var _useMemo5 = useMemo(function () {
|
|
273
296
|
return {
|
|
274
297
|
components: _objectSpread({
|
|
@@ -282,7 +305,9 @@ function BaseTable(props, _ref) {
|
|
|
282
305
|
};
|
|
283
306
|
}, [virtual]),
|
|
284
307
|
components = _useMemo5.components;
|
|
308
|
+
|
|
285
309
|
/** summary row */
|
|
310
|
+
|
|
286
311
|
var summary = useMemo(function () {
|
|
287
312
|
var Summary = AntdTable.Summary;
|
|
288
313
|
if (!summaryRecord) {
|
|
@@ -290,6 +315,7 @@ function BaseTable(props, _ref) {
|
|
|
290
315
|
}
|
|
291
316
|
return function () {
|
|
292
317
|
var _props$rowSelection;
|
|
318
|
+
var data = formatSummary(summaryRecord);
|
|
293
319
|
var offset = 0;
|
|
294
320
|
return /*#__PURE__*/React.createElement(Summary, {
|
|
295
321
|
fixed: true
|
|
@@ -300,7 +326,7 @@ function BaseTable(props, _ref) {
|
|
|
300
326
|
if (index === 0) {
|
|
301
327
|
value = summaryTitle;
|
|
302
328
|
} else if (item.dataIndex) {
|
|
303
|
-
value = get(
|
|
329
|
+
value = get(data, item.dataIndex);
|
|
304
330
|
}
|
|
305
331
|
return /*#__PURE__*/React.createElement(Summary.Cell, {
|
|
306
332
|
index: index + offset,
|
|
@@ -317,7 +343,7 @@ function BaseTable(props, _ref) {
|
|
|
317
343
|
antPrefixCls: antPrefixCls
|
|
318
344
|
};
|
|
319
345
|
}, [scrollY, rowHeight, antPrefixCls]);
|
|
320
|
-
var tableNode = /*#__PURE__*/React.createElement(AntdTable,
|
|
346
|
+
var tableNode = /*#__PURE__*/React.createElement(AntdTable, _extends({
|
|
321
347
|
size: "small",
|
|
322
348
|
ref: function ref(elm) {
|
|
323
349
|
fullTableRef.current = elm;
|
|
@@ -348,7 +374,7 @@ function BaseTable(props, _ref) {
|
|
|
348
374
|
src: empty
|
|
349
375
|
}), /*#__PURE__*/React.createElement("div", null, "\u6682\u65E0\u6570\u636E"))
|
|
350
376
|
}, localeProp)
|
|
351
|
-
}, restProps
|
|
377
|
+
}, restProps, {
|
|
352
378
|
pagination: paginationProp !== false ? _objectSpread({
|
|
353
379
|
size: 'small',
|
|
354
380
|
pageSizeOptions: ['10', '20', '50', '100'],
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
5
|
-
function _iterableToArrayLimit(
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import React, { useState, useRef, useEffect, useContext } from 'react';
|
|
8
8
|
import { Resizable } from 'react-resizable';
|
|
9
|
-
import BaseTableContext from
|
|
9
|
+
import BaseTableContext from "./base-table-context";
|
|
10
10
|
export default function ResizeHeaderCell(props) {
|
|
11
11
|
var children = props.children,
|
|
12
12
|
prefixCls = props.prefixCls,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColumnType, ColumnGroupType } from './typings';
|
|
1
|
+
import type { ColumnType, ColumnGroupType } from './typings';
|
|
2
2
|
export declare function isColumnType<T>(col: ColumnGroupType<T> | ColumnType<T>): col is ColumnType<T>;
|
|
3
3
|
export declare function getColumnKey(col: ColumnType<any>): string | number;
|
|
4
4
|
export declare function randomStr(): string;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
var _excluded = ["children"];
|
|
2
|
-
function
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
5
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
9
|
-
function _iterableToArrayLimit(
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
8
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
12
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
13
11
|
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
12
|
+
import { PREFIX_CLS } from "../constants";
|
|
13
|
+
import BaseTableContext from "./base-table-context";
|
|
14
14
|
import { useThrottle } from '@lemon-fe/hooks';
|
|
15
15
|
import { get } from 'lodash';
|
|
16
|
-
import BaseTableContext from './BaseTableContext';
|
|
17
|
-
import { PREFIX_CLS } from '../constants';
|
|
18
16
|
export default function VirtualList(props) {
|
|
19
17
|
var children = props.children,
|
|
20
18
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
@@ -74,9 +72,10 @@ export default function VirtualList(props) {
|
|
|
74
72
|
setRange(getRange());
|
|
75
73
|
}, [get(children, ['1', 'length']), rowHeight, scrollY]);
|
|
76
74
|
var render = useMemo(function () {
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
var _ref = children,
|
|
76
|
+
_ref2 = _slicedToArray(_ref, 2),
|
|
77
|
+
measureRow = _ref2[0],
|
|
78
|
+
rows = _ref2[1];
|
|
80
79
|
if (!Array.isArray(rows)) {
|
|
81
80
|
return [children, 0, 0];
|
|
82
81
|
}
|
|
@@ -85,8 +84,8 @@ export default function VirtualList(props) {
|
|
|
85
84
|
}
|
|
86
85
|
var list = [];
|
|
87
86
|
var max = rows.length - 1;
|
|
88
|
-
var start = range.start
|
|
89
|
-
|
|
87
|
+
var start = range.start;
|
|
88
|
+
var end = range.end;
|
|
90
89
|
if (end > max) {
|
|
91
90
|
end = max;
|
|
92
91
|
}
|
|
@@ -115,7 +114,7 @@ export default function VirtualList(props) {
|
|
|
115
114
|
display: 'block',
|
|
116
115
|
height: render[1]
|
|
117
116
|
}
|
|
118
|
-
}), /*#__PURE__*/React.createElement("tbody",
|
|
117
|
+
}), /*#__PURE__*/React.createElement("tbody", _extends({}, restProps, {
|
|
119
118
|
ref: ref
|
|
120
119
|
}), render[0]), /*#__PURE__*/React.createElement("tbody", {
|
|
121
120
|
className: "".concat(PREFIX_CLS, "-table-append-after"),
|