@kdcloudjs/table 1.0.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/LICENSE +568 -0
- package/README.md +111 -0
- package/dist/@kdcloudjs/table.css +422 -0
- package/dist/@kdcloudjs/table.css.map +1 -0
- package/dist/@kdcloudjs/table.js +38578 -0
- package/dist/@kdcloudjs/table.js.map +1 -0
- package/dist/@kdcloudjs/table.min.css +9 -0
- package/dist/@kdcloudjs/table.min.js +208 -0
- package/dist/@kdcloudjs/table.min.js.map +1 -0
- package/dist/default-theme.js +344 -0
- package/dist/kd-table.css +422 -0
- package/dist/kd-table.css.map +1 -0
- package/dist/kd-table.js +38578 -0
- package/dist/kd-table.js.map +1 -0
- package/dist/kd-table.min.css +9 -0
- package/dist/kd-table.min.js +208 -0
- package/dist/kd-table.min.js.map +1 -0
- package/dist/kd-ui-complete.less +779 -0
- package/dist/kd-ui.less +2 -0
- package/dist/theme.js +13 -0
- package/es/_utils/arrayUtil.d.ts +5 -0
- package/es/_utils/arrayUtil.js +17 -0
- package/es/_utils/devwarning.d.ts +1 -0
- package/es/_utils/devwarning.js +10 -0
- package/es/_utils/formatUtil.d.ts +46 -0
- package/es/_utils/formatUtil.js +346 -0
- package/es/_utils/hooks.d.ts +51 -0
- package/es/_utils/hooks.js +165 -0
- package/es/_utils/index.d.ts +8 -0
- package/es/_utils/index.js +15 -0
- package/es/_utils/numberUtil.d.ts +34 -0
- package/es/_utils/numberUtil.js +181 -0
- package/es/_utils/omit.d.ts +1 -0
- package/es/_utils/omit.js +11 -0
- package/es/_utils/react-children.d.ts +2 -0
- package/es/_utils/react-children.js +8 -0
- package/es/_utils/type.d.ts +12 -0
- package/es/_utils/type.js +15 -0
- package/es/_utils/usePopper.d.ts +29 -0
- package/es/_utils/usePopper.js +546 -0
- package/es/config-provider/ConfigContext.d.ts +22 -0
- package/es/config-provider/ConfigContext.js +7 -0
- package/es/config-provider/compDefaultProps.d.ts +8 -0
- package/es/config-provider/compDefaultProps.js +10 -0
- package/es/config-provider/configProvider.d.ts +11 -0
- package/es/config-provider/configProvider.js +40 -0
- package/es/config-provider/defaultConfig.d.ts +10 -0
- package/es/config-provider/defaultConfig.js +18 -0
- package/es/config-provider/index.d.ts +6 -0
- package/es/config-provider/index.js +6 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +4 -0
- package/es/locale/index.d.ts +3 -0
- package/es/locale/index.js +3 -0
- package/es/locale/locale.d.ts +50 -0
- package/es/locale/locale.js +251 -0
- package/es/locale/zh-CN.d.ts +8 -0
- package/es/locale/zh-CN.js +8 -0
- package/es/style/color/colors.less +2 -0
- package/es/style/core/index.less +2 -0
- package/es/style/core/motion/other.less +28 -0
- package/es/style/core/motion/slide.less +53 -0
- package/es/style/core/motion.less +2 -0
- package/es/style/core/reset.less +186 -0
- package/es/style/css.js +1 -0
- package/es/style/index.css +410 -0
- package/es/style/index.d.ts +1 -0
- package/es/style/index.js +1 -0
- package/es/style/index.less +2 -0
- package/es/style/mixins/index.less +19 -0
- package/es/style/mixins/overlay.less +22 -0
- package/es/style/mixins/reset.less +13 -0
- package/es/style/themes/default.less +445 -0
- package/es/style/themes/index.less +1 -0
- package/es/table/base/calculations.d.ts +5 -0
- package/es/table/base/calculations.js +364 -0
- package/es/table/base/colgroup.d.ts +5 -0
- package/es/table/base/colgroup.js +22 -0
- package/es/table/base/empty.d.ts +9 -0
- package/es/table/base/empty.js +38 -0
- package/es/table/base/header.d.ts +5 -0
- package/es/table/base/header.js +324 -0
- package/es/table/base/helpers/SpanManager.d.ts +9 -0
- package/es/table/base/helpers/SpanManager.js +50 -0
- package/es/table/base/helpers/TableDOMUtils.d.ts +18 -0
- package/es/table/base/helpers/TableDOMUtils.js +104 -0
- package/es/table/base/helpers/__test__/SpanManager.test.d.ts +1 -0
- package/es/table/base/helpers/__test__/SpanManager.test.js +18 -0
- package/es/table/base/helpers/__test__/TableDOMUtils.test.d.ts +1 -0
- package/es/table/base/helpers/__test__/TableDOMUtils.test.js +34 -0
- package/es/table/base/helpers/__test__/rowHeightManager.test.d.ts +1 -0
- package/es/table/base/helpers/__test__/rowHeightManager.test.js +30 -0
- package/es/table/base/helpers/__test__/visible-part.test.d.ts +1 -0
- package/es/table/base/helpers/__test__/visible-part.test.js +28 -0
- package/es/table/base/helpers/rowHeightManager.d.ts +7 -0
- package/es/table/base/helpers/rowHeightManager.js +157 -0
- package/es/table/base/helpers/visible-part.d.ts +23 -0
- package/es/table/base/helpers/visible-part.js +58 -0
- package/es/table/base/html-table.d.ts +15 -0
- package/es/table/base/html-table.js +132 -0
- package/es/table/base/index.d.ts +3 -0
- package/es/table/base/index.js +2 -0
- package/es/table/base/interfaces.d.ts +54 -0
- package/es/table/base/interfaces.js +0 -0
- package/es/table/base/loading.d.ts +13 -0
- package/es/table/base/loading.js +60 -0
- package/es/table/base/styles.d.ts +132 -0
- package/es/table/base/styles.js +112 -0
- package/es/table/base/table.d.ts +150 -0
- package/es/table/base/table.js +733 -0
- package/es/table/base/utils.d.ts +36 -0
- package/es/table/base/utils.js +193 -0
- package/es/table/common-views.d.ts +24 -0
- package/es/table/common-views.js +70 -0
- package/es/table/index.d.ts +6 -0
- package/es/table/index.js +6 -0
- package/es/table/interfaces.d.ts +98 -0
- package/es/table/interfaces.js +0 -0
- package/es/table/internals.d.ts +14 -0
- package/es/table/internals.js +56 -0
- package/es/table/pipeline/features/__test__/multiSelect.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/multiSelect.test.js +152 -0
- package/es/table/pipeline/features/__test__/rowDetail.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/rowDetail.test.js +223 -0
- package/es/table/pipeline/features/__test__/rowGrouping.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/rowGrouping.test.js +120 -0
- package/es/table/pipeline/features/__test__/singleSelect.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/singleSelect.test.js +191 -0
- package/es/table/pipeline/features/__test__/sort.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/sort.test.js +213 -0
- package/es/table/pipeline/features/__test__/tips.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/tips.test.js +123 -0
- package/es/table/pipeline/features/__test__/treeMode.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/treeMode.test.js +202 -0
- package/es/table/pipeline/features/autoFill.d.ts +4 -0
- package/es/table/pipeline/features/autoFill.js +63 -0
- package/es/table/pipeline/features/autoRowSpan.d.ts +2 -0
- package/es/table/pipeline/features/autoRowSpan.js +72 -0
- package/es/table/pipeline/features/buildTree.d.ts +2 -0
- package/es/table/pipeline/features/buildTree.js +8 -0
- package/es/table/pipeline/features/columnDrag.d.ts +6 -0
- package/es/table/pipeline/features/columnDrag.js +265 -0
- package/es/table/pipeline/features/columnFilter.d.ts +20 -0
- package/es/table/pipeline/features/columnFilter.js +173 -0
- package/es/table/pipeline/features/columnHover.d.ts +12 -0
- package/es/table/pipeline/features/columnHover.js +51 -0
- package/es/table/pipeline/features/columnRangeHover.d.ts +15 -0
- package/es/table/pipeline/features/columnRangeHover.js +83 -0
- package/es/table/pipeline/features/columnResizeWidth.d.ts +21 -0
- package/es/table/pipeline/features/columnResizeWidth.js +173 -0
- package/es/table/pipeline/features/contextMenu.d.ts +14 -0
- package/es/table/pipeline/features/contextMenu.js +370 -0
- package/es/table/pipeline/features/filter/DefaultFilterContent.d.ts +4 -0
- package/es/table/pipeline/features/filter/DefaultFilterContent.js +91 -0
- package/es/table/pipeline/features/filter/Filter.d.ts +17 -0
- package/es/table/pipeline/features/filter/Filter.js +111 -0
- package/es/table/pipeline/features/filter/FilterPanel.d.ts +20 -0
- package/es/table/pipeline/features/filter/FilterPanel.js +81 -0
- package/es/table/pipeline/features/filter/__test__/Filter.test.d.ts +1 -0
- package/es/table/pipeline/features/filter/__test__/Filter.test.js +29 -0
- package/es/table/pipeline/features/filter/index.d.ts +4 -0
- package/es/table/pipeline/features/filter/index.js +4 -0
- package/es/table/pipeline/features/filter/util.d.ts +10 -0
- package/es/table/pipeline/features/filter/util.js +67 -0
- package/es/table/pipeline/features/index.d.ts +16 -0
- package/es/table/pipeline/features/index.js +16 -0
- package/es/table/pipeline/features/multiSelect.d.ts +27 -0
- package/es/table/pipeline/features/multiSelect.js +208 -0
- package/es/table/pipeline/features/rowDetail.d.ts +35 -0
- package/es/table/pipeline/features/rowDetail.js +254 -0
- package/es/table/pipeline/features/rowGrouping.d.ts +14 -0
- package/es/table/pipeline/features/rowGrouping.js +200 -0
- package/es/table/pipeline/features/singleSelect.d.ts +23 -0
- package/es/table/pipeline/features/singleSelect.js +122 -0
- package/es/table/pipeline/features/sort.d.ts +40 -0
- package/es/table/pipeline/features/sort.js +332 -0
- package/es/table/pipeline/features/tips.d.ts +2 -0
- package/es/table/pipeline/features/tips.js +57 -0
- package/es/table/pipeline/features/treeMode.d.ts +37 -0
- package/es/table/pipeline/features/treeMode.js +234 -0
- package/es/table/pipeline/features/treeSelect.d.ts +38 -0
- package/es/table/pipeline/features/treeSelect.js +154 -0
- package/es/table/pipeline/index.d.ts +3 -0
- package/es/table/pipeline/index.js +3 -0
- package/es/table/pipeline/pipeline.d.ts +85 -0
- package/es/table/pipeline/pipeline.js +272 -0
- package/es/table/pivot/cross-table/buildCrossTable.d.ts +14 -0
- package/es/table/pivot/cross-table/buildCrossTable.js +294 -0
- package/es/table/pivot/cross-table/constants.d.ts +1 -0
- package/es/table/pivot/cross-table/constants.js +1 -0
- package/es/table/pivot/cross-table/cross-table.d.ts +18 -0
- package/es/table/pivot/cross-table/cross-table.js +55 -0
- package/es/table/pivot/cross-table/index.d.ts +4 -0
- package/es/table/pivot/cross-table/index.js +3 -0
- package/es/table/pivot/cross-table/interfaces.d.ts +29 -0
- package/es/table/pivot/cross-table/interfaces.js +0 -0
- package/es/table/pivot/cross-table/internals.d.ts +13 -0
- package/es/table/pivot/cross-table/internals.js +0 -0
- package/es/table/pivot/cross-tree-table/buildCrossTreeTable.d.ts +14 -0
- package/es/table/pivot/cross-tree-table/buildCrossTreeTable.js +219 -0
- package/es/table/pivot/cross-tree-table/cross-tree-table.d.ts +38 -0
- package/es/table/pivot/cross-tree-table/cross-tree-table.js +127 -0
- package/es/table/pivot/cross-tree-table/index.d.ts +2 -0
- package/es/table/pivot/cross-tree-table/index.js +2 -0
- package/es/table/pivot/pivot-utils/buildDrillTree.d.ts +16 -0
- package/es/table/pivot/pivot-utils/buildDrillTree.js +93 -0
- package/es/table/pivot/pivot-utils/builders.d.ts +26 -0
- package/es/table/pivot/pivot-utils/builders.js +252 -0
- package/es/table/pivot/pivot-utils/convert-utils.d.ts +31 -0
- package/es/table/pivot/pivot-utils/convert-utils.js +180 -0
- package/es/table/pivot/pivot-utils/index.d.ts +5 -0
- package/es/table/pivot/pivot-utils/index.js +4 -0
- package/es/table/pivot/pivot-utils/interfaces.d.ts +12 -0
- package/es/table/pivot/pivot-utils/interfaces.js +0 -0
- package/es/table/pivot/pivot-utils/simpleEncode.d.ts +1 -0
- package/es/table/pivot/pivot-utils/simpleEncode.js +7 -0
- package/es/table/style/css.js +2 -0
- package/es/table/style/index.css +0 -0
- package/es/table/style/index.d.ts +2 -0
- package/es/table/style/index.js +2 -0
- package/es/table/style/index.less +1 -0
- package/es/table/transforms/autoRowSpan.d.ts +3 -0
- package/es/table/transforms/autoRowSpan.js +73 -0
- package/es/table/transforms/autoWidth.d.ts +25 -0
- package/es/table/transforms/autoWidth.js +160 -0
- package/es/table/transforms/buildTree.d.ts +3 -0
- package/es/table/transforms/buildTree.js +15 -0
- package/es/table/transforms/columnHover.d.ts +17 -0
- package/es/table/transforms/columnHover.js +59 -0
- package/es/table/transforms/columnRangeHover.d.ts +17 -0
- package/es/table/transforms/columnRangeHover.js +94 -0
- package/es/table/transforms/columnResize.d.ts +27 -0
- package/es/table/transforms/columnResize.js +152 -0
- package/es/table/transforms/flatten.d.ts +3 -0
- package/es/table/transforms/flatten.js +16 -0
- package/es/table/transforms/index.d.ts +12 -0
- package/es/table/transforms/index.js +12 -0
- package/es/table/transforms/orderField.d.ts +3 -0
- package/es/table/transforms/orderField.js +22 -0
- package/es/table/transforms/sort.d.ts +43 -0
- package/es/table/transforms/sort.js +338 -0
- package/es/table/transforms/tips.d.ts +8 -0
- package/es/table/transforms/tips.js +54 -0
- package/es/table/transforms/treeMode.d.ts +30 -0
- package/es/table/transforms/treeMode.js +252 -0
- package/es/table/transforms/visible.d.ts +5 -0
- package/es/table/transforms/visible.js +19 -0
- package/es/table/transforms/warnTransformsDeprecated.d.ts +1 -0
- package/es/table/transforms/warnTransformsDeprecated.js +8 -0
- package/es/table/use/useResizeObserver.d.ts +2 -0
- package/es/table/use/useResizeObserver.js +20 -0
- package/es/table/utils/applyTransforms.d.ts +6 -0
- package/es/table/utils/applyTransforms.js +15 -0
- package/es/table/utils/buildTree.d.ts +36 -0
- package/es/table/utils/buildTree.js +119 -0
- package/es/table/utils/collectNodes.d.ts +8 -0
- package/es/table/utils/collectNodes.js +59 -0
- package/es/table/utils/console.d.ts +11 -0
- package/es/table/utils/console.js +58 -0
- package/es/table/utils/copyToClipboard.d.ts +3 -0
- package/es/table/utils/copyToClipboard.js +30 -0
- package/es/table/utils/element.d.ts +42 -0
- package/es/table/utils/element.js +228 -0
- package/es/table/utils/exportTableAsExcel.d.ts +4 -0
- package/es/table/utils/exportTableAsExcel.js +188 -0
- package/es/table/utils/getTreeDepth.d.ts +3 -0
- package/es/table/utils/getTreeDepth.js +41 -0
- package/es/table/utils/groupBy.d.ts +1 -0
- package/es/table/utils/groupBy.js +37 -0
- package/es/table/utils/index.d.ts +18 -0
- package/es/table/utils/index.js +18 -0
- package/es/table/utils/isGroupColumn.d.ts +2 -0
- package/es/table/utils/isGroupColumn.js +7 -0
- package/es/table/utils/isLeafNode.d.ts +2 -0
- package/es/table/utils/isLeafNode.js +4 -0
- package/es/table/utils/layeredFilter.d.ts +2 -0
- package/es/table/utils/layeredFilter.js +25 -0
- package/es/table/utils/layeredSort.d.ts +5 -0
- package/es/table/utils/layeredSort.js +26 -0
- package/es/table/utils/makeRecursiveMapper.d.ts +9 -0
- package/es/table/utils/makeRecursiveMapper.js +76 -0
- package/es/table/utils/mergeCellProps.d.ts +8 -0
- package/es/table/utils/mergeCellProps.js +67 -0
- package/es/table/utils/others.d.ts +16 -0
- package/es/table/utils/others.js +80 -0
- package/es/table/utils/proto.d.ts +21 -0
- package/es/table/utils/proto.js +106 -0
- package/es/table/utils/smartCompare.d.ts +9 -0
- package/es/table/utils/smartCompare.js +51 -0
- package/es/table/utils/traverseColumn.d.ts +11 -0
- package/es/table/utils/traverseColumn.js +88 -0
- package/es/table/utils/tree-data-helpers/StrictTreeDataHelper.d.ts +22 -0
- package/es/table/utils/tree-data-helpers/StrictTreeDataHelper.js +138 -0
- package/es/table/utils/tree-data-helpers/TreeDataHelper.d.ts +26 -0
- package/es/table/utils/tree-data-helpers/TreeDataHelper.js +337 -0
- package/lib/_utils/arrayUtil.d.ts +5 -0
- package/lib/_utils/arrayUtil.js +26 -0
- package/lib/_utils/devwarning.d.ts +1 -0
- package/lib/_utils/devwarning.js +21 -0
- package/lib/_utils/formatUtil.d.ts +46 -0
- package/lib/_utils/formatUtil.js +358 -0
- package/lib/_utils/hooks.d.ts +51 -0
- package/lib/_utils/hooks.js +187 -0
- package/lib/_utils/index.d.ts +8 -0
- package/lib/_utils/index.js +28 -0
- package/lib/_utils/numberUtil.d.ts +34 -0
- package/lib/_utils/numberUtil.js +202 -0
- package/lib/_utils/omit.d.ts +1 -0
- package/lib/_utils/omit.js +21 -0
- package/lib/_utils/react-children.d.ts +2 -0
- package/lib/_utils/react-children.js +20 -0
- package/lib/_utils/type.d.ts +12 -0
- package/lib/_utils/type.js +27 -0
- package/lib/_utils/usePopper.d.ts +29 -0
- package/lib/_utils/usePopper.js +574 -0
- package/lib/config-provider/ConfigContext.d.ts +22 -0
- package/lib/config-provider/ConfigContext.js +19 -0
- package/lib/config-provider/compDefaultProps.d.ts +8 -0
- package/lib/config-provider/compDefaultProps.js +17 -0
- package/lib/config-provider/configProvider.d.ts +11 -0
- package/lib/config-provider/configProvider.js +56 -0
- package/lib/config-provider/defaultConfig.d.ts +10 -0
- package/lib/config-provider/defaultConfig.js +30 -0
- package/lib/config-provider/index.d.ts +6 -0
- package/lib/config-provider/index.js +37 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +45 -0
- package/lib/locale/index.d.ts +3 -0
- package/lib/locale/index.js +25 -0
- package/lib/locale/locale.d.ts +50 -0
- package/lib/locale/locale.js +277 -0
- package/lib/locale/zh-CN.d.ts +8 -0
- package/lib/locale/zh-CN.js +15 -0
- package/lib/style/color/colors.less +2 -0
- package/lib/style/components.less +1 -0
- package/lib/style/core/index.less +2 -0
- package/lib/style/core/motion/other.less +28 -0
- package/lib/style/core/motion/slide.less +53 -0
- package/lib/style/core/motion.less +2 -0
- package/lib/style/core/reset.less +186 -0
- package/lib/style/css.js +3 -0
- package/lib/style/index.css +410 -0
- package/lib/style/index.d.ts +1 -0
- package/lib/style/index.js +3 -0
- package/lib/style/index.less +2 -0
- package/lib/style/mixins/index.less +19 -0
- package/lib/style/mixins/overlay.less +22 -0
- package/lib/style/mixins/reset.less +13 -0
- package/lib/style/themes/default.less +445 -0
- package/lib/style/themes/index.less +1 -0
- package/lib/table/base/calculations.d.ts +5 -0
- package/lib/table/base/calculations.js +385 -0
- package/lib/table/base/colgroup.d.ts +5 -0
- package/lib/table/base/colgroup.js +33 -0
- package/lib/table/base/empty.d.ts +9 -0
- package/lib/table/base/empty.js +54 -0
- package/lib/table/base/header.d.ts +5 -0
- package/lib/table/base/header.js +340 -0
- package/lib/table/base/helpers/SpanManager.d.ts +9 -0
- package/lib/table/base/helpers/SpanManager.js +59 -0
- package/lib/table/base/helpers/TableDOMUtils.d.ts +18 -0
- package/lib/table/base/helpers/TableDOMUtils.js +113 -0
- package/lib/table/base/helpers/__test__/SpanManager.test.d.ts +1 -0
- package/lib/table/base/helpers/__test__/SpanManager.test.js +23 -0
- package/lib/table/base/helpers/__test__/TableDOMUtils.test.d.ts +1 -0
- package/lib/table/base/helpers/__test__/TableDOMUtils.test.js +41 -0
- package/lib/table/base/helpers/__test__/rowHeightManager.test.d.ts +1 -0
- package/lib/table/base/helpers/__test__/rowHeightManager.test.js +33 -0
- package/lib/table/base/helpers/__test__/visible-part.test.d.ts +1 -0
- package/lib/table/base/helpers/__test__/visible-part.test.js +31 -0
- package/lib/table/base/helpers/rowHeightManager.d.ts +7 -0
- package/lib/table/base/helpers/rowHeightManager.js +170 -0
- package/lib/table/base/helpers/visible-part.d.ts +23 -0
- package/lib/table/base/helpers/visible-part.js +72 -0
- package/lib/table/base/html-table.d.ts +15 -0
- package/lib/table/base/html-table.js +149 -0
- package/lib/table/base/index.d.ts +3 -0
- package/lib/table/base/index.js +21 -0
- package/lib/table/base/interfaces.d.ts +54 -0
- package/lib/table/base/interfaces.js +0 -0
- package/lib/table/base/loading.d.ts +13 -0
- package/lib/table/base/loading.js +71 -0
- package/lib/table/base/styles.d.ts +132 -0
- package/lib/table/base/styles.js +136 -0
- package/lib/table/base/table.d.ts +150 -0
- package/lib/table/base/table.js +773 -0
- package/lib/table/base/utils.d.ts +36 -0
- package/lib/table/base/utils.js +234 -0
- package/lib/table/common-views.d.ts +24 -0
- package/lib/table/common-views.js +90 -0
- package/lib/table/index.d.ts +6 -0
- package/lib/table/index.js +85 -0
- package/lib/table/interfaces.d.ts +98 -0
- package/lib/table/interfaces.js +0 -0
- package/lib/table/internals.d.ts +14 -0
- package/lib/table/internals.js +64 -0
- package/lib/table/pipeline/features/__test__/multiSelect.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/multiSelect.test.js +163 -0
- package/lib/table/pipeline/features/__test__/rowDetail.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/rowDetail.test.js +230 -0
- package/lib/table/pipeline/features/__test__/rowGrouping.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/rowGrouping.test.js +129 -0
- package/lib/table/pipeline/features/__test__/singleSelect.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/singleSelect.test.js +201 -0
- package/lib/table/pipeline/features/__test__/sort.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/sort.test.js +218 -0
- package/lib/table/pipeline/features/__test__/tips.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/tips.test.js +133 -0
- package/lib/table/pipeline/features/__test__/treeMode.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/treeMode.test.js +206 -0
- package/lib/table/pipeline/features/autoFill.d.ts +4 -0
- package/lib/table/pipeline/features/autoFill.js +80 -0
- package/lib/table/pipeline/features/autoRowSpan.d.ts +2 -0
- package/lib/table/pipeline/features/autoRowSpan.js +84 -0
- package/lib/table/pipeline/features/buildTree.d.ts +2 -0
- package/lib/table/pipeline/features/buildTree.js +16 -0
- package/lib/table/pipeline/features/columnDrag.d.ts +6 -0
- package/lib/table/pipeline/features/columnDrag.js +278 -0
- package/lib/table/pipeline/features/columnFilter.d.ts +20 -0
- package/lib/table/pipeline/features/columnFilter.js +197 -0
- package/lib/table/pipeline/features/columnHover.d.ts +12 -0
- package/lib/table/pipeline/features/columnHover.js +62 -0
- package/lib/table/pipeline/features/columnRangeHover.d.ts +15 -0
- package/lib/table/pipeline/features/columnRangeHover.js +95 -0
- package/lib/table/pipeline/features/columnResizeWidth.d.ts +21 -0
- package/lib/table/pipeline/features/columnResizeWidth.js +192 -0
- package/lib/table/pipeline/features/contextMenu.d.ts +14 -0
- package/lib/table/pipeline/features/contextMenu.js +397 -0
- package/lib/table/pipeline/features/filter/DefaultFilterContent.d.ts +4 -0
- package/lib/table/pipeline/features/filter/DefaultFilterContent.js +112 -0
- package/lib/table/pipeline/features/filter/Filter.d.ts +17 -0
- package/lib/table/pipeline/features/filter/Filter.js +129 -0
- package/lib/table/pipeline/features/filter/FilterPanel.d.ts +20 -0
- package/lib/table/pipeline/features/filter/FilterPanel.js +98 -0
- package/lib/table/pipeline/features/filter/__test__/Filter.test.d.ts +1 -0
- package/lib/table/pipeline/features/filter/__test__/Filter.test.js +36 -0
- package/lib/table/pipeline/features/filter/index.d.ts +4 -0
- package/lib/table/pipeline/features/filter/index.js +39 -0
- package/lib/table/pipeline/features/filter/util.d.ts +10 -0
- package/lib/table/pipeline/features/filter/util.js +77 -0
- package/lib/table/pipeline/features/index.d.ts +16 -0
- package/lib/table/pipeline/features/index.js +141 -0
- package/lib/table/pipeline/features/multiSelect.d.ts +27 -0
- package/lib/table/pipeline/features/multiSelect.js +227 -0
- package/lib/table/pipeline/features/rowDetail.d.ts +35 -0
- package/lib/table/pipeline/features/rowDetail.js +283 -0
- package/lib/table/pipeline/features/rowGrouping.d.ts +14 -0
- package/lib/table/pipeline/features/rowGrouping.js +227 -0
- package/lib/table/pipeline/features/singleSelect.d.ts +23 -0
- package/lib/table/pipeline/features/singleSelect.js +138 -0
- package/lib/table/pipeline/features/sort.d.ts +40 -0
- package/lib/table/pipeline/features/sort.js +361 -0
- package/lib/table/pipeline/features/tips.d.ts +2 -0
- package/lib/table/pipeline/features/tips.js +73 -0
- package/lib/table/pipeline/features/treeMode.d.ts +37 -0
- package/lib/table/pipeline/features/treeMode.js +266 -0
- package/lib/table/pipeline/features/treeSelect.d.ts +38 -0
- package/lib/table/pipeline/features/treeSelect.js +169 -0
- package/lib/table/pipeline/index.d.ts +3 -0
- package/lib/table/pipeline/index.js +26 -0
- package/lib/table/pipeline/pipeline.d.ts +85 -0
- package/lib/table/pipeline/pipeline.js +291 -0
- package/lib/table/pivot/cross-table/buildCrossTable.d.ts +14 -0
- package/lib/table/pivot/cross-table/buildCrossTable.js +313 -0
- package/lib/table/pivot/cross-table/constants.d.ts +1 -0
- package/lib/table/pivot/cross-table/constants.js +8 -0
- package/lib/table/pivot/cross-table/cross-table.d.ts +18 -0
- package/lib/table/pivot/cross-table/cross-table.js +71 -0
- package/lib/table/pivot/cross-table/index.d.ts +4 -0
- package/lib/table/pivot/cross-table/index.js +31 -0
- package/lib/table/pivot/cross-table/interfaces.d.ts +29 -0
- package/lib/table/pivot/cross-table/interfaces.js +0 -0
- package/lib/table/pivot/cross-table/internals.d.ts +13 -0
- package/lib/table/pivot/cross-table/internals.js +0 -0
- package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.d.ts +14 -0
- package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.js +240 -0
- package/lib/table/pivot/cross-tree-table/cross-tree-table.d.ts +38 -0
- package/lib/table/pivot/cross-tree-table/cross-tree-table.js +144 -0
- package/lib/table/pivot/cross-tree-table/index.d.ts +2 -0
- package/lib/table/pivot/cross-tree-table/index.js +23 -0
- package/lib/table/pivot/pivot-utils/buildDrillTree.d.ts +16 -0
- package/lib/table/pivot/pivot-utils/buildDrillTree.js +106 -0
- package/lib/table/pivot/pivot-utils/builders.d.ts +26 -0
- package/lib/table/pivot/pivot-utils/builders.js +272 -0
- package/lib/table/pivot/pivot-utils/convert-utils.d.ts +31 -0
- package/lib/table/pivot/pivot-utils/convert-utils.js +204 -0
- package/lib/table/pivot/pivot-utils/index.d.ts +5 -0
- package/lib/table/pivot/pivot-utils/index.js +59 -0
- package/lib/table/pivot/pivot-utils/interfaces.d.ts +12 -0
- package/lib/table/pivot/pivot-utils/interfaces.js +0 -0
- package/lib/table/pivot/pivot-utils/simpleEncode.d.ts +1 -0
- package/lib/table/pivot/pivot-utils/simpleEncode.js +14 -0
- package/lib/table/style/css.js +5 -0
- package/lib/table/style/index.css +0 -0
- package/lib/table/style/index.d.ts +2 -0
- package/lib/table/style/index.js +5 -0
- package/lib/table/style/index.less +1 -0
- package/lib/table/transforms/autoRowSpan.d.ts +3 -0
- package/lib/table/transforms/autoRowSpan.js +86 -0
- package/lib/table/transforms/autoWidth.d.ts +25 -0
- package/lib/table/transforms/autoWidth.js +187 -0
- package/lib/table/transforms/buildTree.d.ts +3 -0
- package/lib/table/transforms/buildTree.js +23 -0
- package/lib/table/transforms/columnHover.d.ts +17 -0
- package/lib/table/transforms/columnHover.js +74 -0
- package/lib/table/transforms/columnRangeHover.d.ts +17 -0
- package/lib/table/transforms/columnRangeHover.js +110 -0
- package/lib/table/transforms/columnResize.d.ts +27 -0
- package/lib/table/transforms/columnResize.js +176 -0
- package/lib/table/transforms/flatten.d.ts +3 -0
- package/lib/table/transforms/flatten.js +24 -0
- package/lib/table/transforms/index.d.ts +12 -0
- package/lib/table/transforms/index.js +131 -0
- package/lib/table/transforms/orderField.d.ts +3 -0
- package/lib/table/transforms/orderField.js +33 -0
- package/lib/table/transforms/sort.d.ts +43 -0
- package/lib/table/transforms/sort.js +369 -0
- package/lib/table/transforms/tips.d.ts +8 -0
- package/lib/table/transforms/tips.js +71 -0
- package/lib/table/transforms/treeMode.d.ts +30 -0
- package/lib/table/transforms/treeMode.js +286 -0
- package/lib/table/transforms/visible.d.ts +5 -0
- package/lib/table/transforms/visible.js +31 -0
- package/lib/table/transforms/warnTransformsDeprecated.d.ts +1 -0
- package/lib/table/transforms/warnTransformsDeprecated.js +19 -0
- package/lib/table/use/useResizeObserver.d.ts +2 -0
- package/lib/table/use/useResizeObserver.js +32 -0
- package/lib/table/utils/applyTransforms.d.ts +6 -0
- package/lib/table/utils/applyTransforms.js +24 -0
- package/lib/table/utils/buildTree.d.ts +36 -0
- package/lib/table/utils/buildTree.js +140 -0
- package/lib/table/utils/collectNodes.d.ts +8 -0
- package/lib/table/utils/collectNodes.js +72 -0
- package/lib/table/utils/console.d.ts +11 -0
- package/lib/table/utils/console.js +68 -0
- package/lib/table/utils/copyToClipboard.d.ts +3 -0
- package/lib/table/utils/copyToClipboard.js +40 -0
- package/lib/table/utils/element.d.ts +42 -0
- package/lib/table/utils/element.js +243 -0
- package/lib/table/utils/exportTableAsExcel.d.ts +4 -0
- package/lib/table/utils/exportTableAsExcel.js +205 -0
- package/lib/table/utils/getTreeDepth.d.ts +3 -0
- package/lib/table/utils/getTreeDepth.js +54 -0
- package/lib/table/utils/groupBy.d.ts +1 -0
- package/lib/table/utils/groupBy.js +48 -0
- package/lib/table/utils/index.d.ts +18 -0
- package/lib/table/utils/index.js +187 -0
- package/lib/table/utils/isGroupColumn.d.ts +2 -0
- package/lib/table/utils/isGroupColumn.js +17 -0
- package/lib/table/utils/isLeafNode.d.ts +2 -0
- package/lib/table/utils/isLeafNode.js +11 -0
- package/lib/table/utils/layeredFilter.d.ts +2 -0
- package/lib/table/utils/layeredFilter.js +38 -0
- package/lib/table/utils/layeredSort.d.ts +5 -0
- package/lib/table/utils/layeredSort.js +37 -0
- package/lib/table/utils/makeRecursiveMapper.d.ts +9 -0
- package/lib/table/utils/makeRecursiveMapper.js +94 -0
- package/lib/table/utils/mergeCellProps.d.ts +8 -0
- package/lib/table/utils/mergeCellProps.js +78 -0
- package/lib/table/utils/others.d.ts +16 -0
- package/lib/table/utils/others.js +108 -0
- package/lib/table/utils/proto.d.ts +21 -0
- package/lib/table/utils/proto.js +117 -0
- package/lib/table/utils/smartCompare.d.ts +9 -0
- package/lib/table/utils/smartCompare.js +58 -0
- package/lib/table/utils/traverseColumn.d.ts +11 -0
- package/lib/table/utils/traverseColumn.js +103 -0
- package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.d.ts +22 -0
- package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.js +154 -0
- package/lib/table/utils/tree-data-helpers/TreeDataHelper.d.ts +26 -0
- package/lib/table/utils/tree-data-helpers/TreeDataHelper.js +358 -0
- package/package.json +213 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _fillInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/fill";
|
|
3
|
+
import { OVERSCAN_SIZE, sum } from '../utils';
|
|
4
|
+
export function getFullRenderRange(rowCount) {
|
|
5
|
+
return {
|
|
6
|
+
topIndex: 0,
|
|
7
|
+
topBlank: 0,
|
|
8
|
+
bottomIndex: rowCount,
|
|
9
|
+
bottomBlank: 0
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function makeRowHeightManager(initRowCount, estimatedRowHeight) {
|
|
13
|
+
var _context;
|
|
14
|
+
|
|
15
|
+
var cache = _fillInstanceProperty(_context = new Array(initRowCount)).call(_context, estimatedRowHeight);
|
|
16
|
+
|
|
17
|
+
function getRenderRange(offset, maxRenderHeight, rowCount) {
|
|
18
|
+
if (cache.length !== rowCount) {
|
|
19
|
+
setRowCount(rowCount);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (maxRenderHeight <= 0) {
|
|
23
|
+
// maxRenderHeight <= 0 说明表格目前在 viewport 之外
|
|
24
|
+
if (offset <= 0) {
|
|
25
|
+
// 表格在 viewport 下方
|
|
26
|
+
return getRenderRangeWhenBelowView();
|
|
27
|
+
} else {
|
|
28
|
+
// 表格在 viewport 上方
|
|
29
|
+
return getRenderRangeWhenAboveView();
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
// 表格与 viewport 相交
|
|
33
|
+
return getRenderRangeWhenInView();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getRenderRangeWhenBelowView() {
|
|
37
|
+
var start = {
|
|
38
|
+
topIndex: 0,
|
|
39
|
+
topBlank: 0
|
|
40
|
+
};
|
|
41
|
+
var end = getEnd(0, start);
|
|
42
|
+
return _extends(_extends({}, start), end);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function getRenderRangeWhenAboveView() {
|
|
46
|
+
var totalSize = getEstimatedTotalSize(rowCount);
|
|
47
|
+
var start = getStart(totalSize);
|
|
48
|
+
var end = getEnd(totalSize, start);
|
|
49
|
+
return _extends(_extends({}, start), end);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function getRenderRangeWhenInView() {
|
|
53
|
+
var start = getStart(offset);
|
|
54
|
+
var end = getEnd(offset + maxRenderHeight, start);
|
|
55
|
+
return _extends(_extends({}, start), end);
|
|
56
|
+
}
|
|
57
|
+
/** 获取虚拟滚动在 开始位置上的信息 */
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
function getStart(offset) {
|
|
61
|
+
if (cache.length === 0) {
|
|
62
|
+
return {
|
|
63
|
+
topIndex: 0,
|
|
64
|
+
topBlank: 0
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
var topIndex = 0;
|
|
69
|
+
var topBlank = 0;
|
|
70
|
+
|
|
71
|
+
while (topIndex < cache.length) {
|
|
72
|
+
var h = cache[topIndex];
|
|
73
|
+
|
|
74
|
+
if (topBlank + h >= offset) {
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
topBlank += h;
|
|
79
|
+
topIndex += 1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return overscanUpwards(topIndex, topBlank);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function overscanUpwards(topIndex, topBlank) {
|
|
86
|
+
var overscanSize = 0;
|
|
87
|
+
var overscanCount = 0;
|
|
88
|
+
|
|
89
|
+
while (overscanCount < topIndex && overscanSize < OVERSCAN_SIZE) {
|
|
90
|
+
overscanCount += 1;
|
|
91
|
+
overscanSize += cache[topIndex - overscanCount];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
topIndex: topIndex - overscanCount,
|
|
96
|
+
topBlank: topBlank - overscanSize
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/** 获取虚拟滚动 在结束位置上的信息 */
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
function getEnd(endOffset, startInfo) {
|
|
103
|
+
var bottomIndex = startInfo.topIndex;
|
|
104
|
+
var offset = startInfo.topBlank;
|
|
105
|
+
|
|
106
|
+
while (bottomIndex < rowCount && offset < endOffset) {
|
|
107
|
+
offset += cache[bottomIndex];
|
|
108
|
+
bottomIndex += 1;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
var bottomBlank = getEstimatedTotalSize(rowCount) - offset;
|
|
112
|
+
return overscanDownwards(bottomIndex, bottomBlank);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function overscanDownwards(bottomIndex, bottomBlank) {
|
|
116
|
+
var overscanSize = 0;
|
|
117
|
+
var overscanCount = 0;
|
|
118
|
+
|
|
119
|
+
while (overscanCount < rowCount - bottomIndex && overscanSize < OVERSCAN_SIZE) {
|
|
120
|
+
overscanSize += cache[bottomIndex + overscanCount];
|
|
121
|
+
overscanCount += 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
bottomIndex: bottomIndex + overscanCount,
|
|
126
|
+
bottomBlank: bottomBlank - overscanSize
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function getEstimatedTotalSize(rowCount) {
|
|
131
|
+
return sum(cache) + (rowCount - cache.length) * estimatedRowHeight;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function setRowCount(count) {
|
|
135
|
+
// 将 cache 的长度设置为 count
|
|
136
|
+
if (count < cache.length) {
|
|
137
|
+
cache.length = count;
|
|
138
|
+
} else {
|
|
139
|
+
var prevSize = cache.length;
|
|
140
|
+
cache.length = count;
|
|
141
|
+
|
|
142
|
+
_fillInstanceProperty(cache).call(cache, estimatedRowHeight, prevSize);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function updateRow(index, offset, size) {
|
|
148
|
+
cache[index] = size;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return {
|
|
152
|
+
getRenderRange: getRenderRange,
|
|
153
|
+
updateRow: updateRow,
|
|
154
|
+
// 导出 cache,方便调试;上层在实际使用时 并不需要使用 cache 字段
|
|
155
|
+
cache: cache
|
|
156
|
+
};
|
|
157
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export declare function getVisiblePart(target: HTMLElement | typeof window, flowRoot: HTMLElement | typeof window): {
|
|
3
|
+
offsetY: number;
|
|
4
|
+
offsetX: number;
|
|
5
|
+
clipRect: {
|
|
6
|
+
left: number;
|
|
7
|
+
top: number;
|
|
8
|
+
right: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
/** 基于 ResizeObserver 和 scroll event 封装的 RxJS observable;
|
|
13
|
+
* 用于监听一个元素的在页面中的「可见范围」的不断变化 */
|
|
14
|
+
export declare function getVisiblePartObservable(target: HTMLElement, flowRoot: HTMLElement | typeof window): Observable<{
|
|
15
|
+
offsetY: number;
|
|
16
|
+
offsetX: number;
|
|
17
|
+
clipRect: {
|
|
18
|
+
left: number;
|
|
19
|
+
top: number;
|
|
20
|
+
right: number;
|
|
21
|
+
bottom: number;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import ResizeObserver from 'resize-observer-polyfill';
|
|
2
|
+
import { fromEvent, merge, Observable } from 'rxjs';
|
|
3
|
+
import * as op from 'rxjs/operators';
|
|
4
|
+
|
|
5
|
+
function getRect(ele) {
|
|
6
|
+
if (ele === window) {
|
|
7
|
+
return {
|
|
8
|
+
left: 0,
|
|
9
|
+
top: 0,
|
|
10
|
+
bottom: window.innerHeight,
|
|
11
|
+
right: window.innerWidth
|
|
12
|
+
};
|
|
13
|
+
} else {
|
|
14
|
+
return ele.getBoundingClientRect();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function getVisiblePart(target, flowRoot) {
|
|
19
|
+
var targetRect = getRect(target);
|
|
20
|
+
var rootRect = getRect(flowRoot);
|
|
21
|
+
return {
|
|
22
|
+
offsetY: Math.max(0, rootRect.top - targetRect.top),
|
|
23
|
+
offsetX: Math.max(0, rootRect.left - targetRect.left),
|
|
24
|
+
clipRect: {
|
|
25
|
+
left: Math.max(targetRect.left, rootRect.left),
|
|
26
|
+
top: Math.max(targetRect.top, rootRect.top),
|
|
27
|
+
right: Math.min(targetRect.right, rootRect.right),
|
|
28
|
+
bottom: Math.min(targetRect.bottom, rootRect.bottom)
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function fromResizeEvent(element) {
|
|
34
|
+
if (element === window) {
|
|
35
|
+
return fromEvent(element, 'resize');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return new Observable(function (subscriber) {
|
|
39
|
+
var resizeObserver = new ResizeObserver(function () {
|
|
40
|
+
subscriber.next();
|
|
41
|
+
});
|
|
42
|
+
resizeObserver.observe(element);
|
|
43
|
+
return function () {
|
|
44
|
+
resizeObserver.disconnect();
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/** 基于 ResizeObserver 和 scroll event 封装的 RxJS observable;
|
|
49
|
+
* 用于监听一个元素的在页面中的「可见范围」的不断变化 */
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
export function getVisiblePartObservable(target, flowRoot) {
|
|
53
|
+
return merge(fromEvent(flowRoot, 'scroll', {
|
|
54
|
+
passive: true
|
|
55
|
+
}), fromResizeEvent(flowRoot), fromResizeEvent(target)).pipe(op.map(function () {
|
|
56
|
+
return getVisiblePart(target, flowRoot);
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RenderInfo } from './interfaces';
|
|
3
|
+
import { BaseTableProps } from './table';
|
|
4
|
+
export interface HtmlTableProps extends Required<Pick<BaseTableProps, 'getRowProps' | 'primaryKey'>> {
|
|
5
|
+
tbodyHtmlTag: 'tbody' | 'tfoot';
|
|
6
|
+
data: any[];
|
|
7
|
+
horizontalRenderInfo: Pick<RenderInfo, 'flat' | 'visible' | 'horizontalRenderRange' | 'stickyLeftMap' | 'stickyRightMap'>;
|
|
8
|
+
verticalRenderInfo: {
|
|
9
|
+
offset: number;
|
|
10
|
+
first: number;
|
|
11
|
+
last: number;
|
|
12
|
+
limit: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare function HtmlTable({ tbodyHtmlTag, getRowProps, primaryKey, data, verticalRenderInfo: verInfo, horizontalRenderInfo: hozInfo }: HtmlTableProps): JSX.Element;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _flatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/flat";
|
|
3
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
4
|
+
import cx from 'classnames';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { internals } from '../internals';
|
|
7
|
+
import { Colgroup } from './colgroup';
|
|
8
|
+
import SpanManager from './helpers/SpanManager';
|
|
9
|
+
import { Classes } from './styles';
|
|
10
|
+
export function HtmlTable(_ref) {
|
|
11
|
+
var tbodyHtmlTag = _ref.tbodyHtmlTag,
|
|
12
|
+
getRowProps = _ref.getRowProps,
|
|
13
|
+
primaryKey = _ref.primaryKey,
|
|
14
|
+
data = _ref.data,
|
|
15
|
+
verInfo = _ref.verticalRenderInfo,
|
|
16
|
+
hozInfo = _ref.horizontalRenderInfo;
|
|
17
|
+
|
|
18
|
+
var flat = _flatInstanceProperty(hozInfo),
|
|
19
|
+
hoz = hozInfo.horizontalRenderRange;
|
|
20
|
+
|
|
21
|
+
var spanManager = new SpanManager();
|
|
22
|
+
var fullFlatCount = flat.full.length;
|
|
23
|
+
var leftFlatCount = flat.left.length;
|
|
24
|
+
var rightFlatCount = flat.right.length;
|
|
25
|
+
return /*#__PURE__*/React.createElement("table", null, /*#__PURE__*/React.createElement(Colgroup, {
|
|
26
|
+
descriptors: hozInfo.visible
|
|
27
|
+
}), /*#__PURE__*/React.createElement(tbodyHtmlTag, null, _mapInstanceProperty(data).call(data, renderRow)));
|
|
28
|
+
|
|
29
|
+
function renderRow(record, i) {
|
|
30
|
+
var _context;
|
|
31
|
+
|
|
32
|
+
var rowIndex = verInfo.offset + i;
|
|
33
|
+
spanManager.stripUpwards(rowIndex);
|
|
34
|
+
var rowProps = getRowProps(record, rowIndex);
|
|
35
|
+
var rowClass = cx(Classes.tableRow, {
|
|
36
|
+
first: rowIndex === verInfo.first,
|
|
37
|
+
last: rowIndex === verInfo.last,
|
|
38
|
+
even: rowIndex % 2 === 0,
|
|
39
|
+
odd: rowIndex % 2 === 1
|
|
40
|
+
}, rowProps === null || rowProps === void 0 ? void 0 : rowProps.className);
|
|
41
|
+
return /*#__PURE__*/React.createElement("tr", _extends({}, rowProps, {
|
|
42
|
+
className: rowClass,
|
|
43
|
+
key: internals.safeGetRowKey(primaryKey, record, rowIndex),
|
|
44
|
+
"data-rowindex": rowIndex,
|
|
45
|
+
"data-role": 'table-row'
|
|
46
|
+
}), _mapInstanceProperty(_context = hozInfo.visible).call(_context, function (descriptor) {
|
|
47
|
+
if (descriptor.type === 'blank') {
|
|
48
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
49
|
+
key: descriptor.blankSide
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return renderBodyCell(record, rowIndex, descriptor.col, descriptor.colIndex);
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function renderBodyCell(record, rowIndex, column, colIndex) {
|
|
58
|
+
var _a, _b, _c;
|
|
59
|
+
|
|
60
|
+
if (spanManager.testSkip(rowIndex, colIndex)) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var value = internals.safeGetValue(column, record, rowIndex);
|
|
65
|
+
var cellProps = (_b = (_a = column.getCellProps) === null || _a === void 0 ? void 0 : _a.call(column, value, record, rowIndex)) !== null && _b !== void 0 ? _b : {};
|
|
66
|
+
var cellContent = value;
|
|
67
|
+
|
|
68
|
+
if (column.render) {
|
|
69
|
+
cellContent = column.render(value, record, rowIndex);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var colSpan = 1;
|
|
73
|
+
var rowSpan = 1;
|
|
74
|
+
|
|
75
|
+
if (column.getSpanRect) {
|
|
76
|
+
var spanRect = column.getSpanRect(value, record, rowIndex);
|
|
77
|
+
colSpan = spanRect == null ? 1 : spanRect.right - colIndex;
|
|
78
|
+
rowSpan = spanRect == null ? 1 : spanRect.bottom - rowIndex;
|
|
79
|
+
} else {
|
|
80
|
+
if (cellProps.colSpan != null) {
|
|
81
|
+
colSpan = cellProps.colSpan;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (cellProps.rowSpan != null) {
|
|
85
|
+
rowSpan = cellProps.rowSpan;
|
|
86
|
+
}
|
|
87
|
+
} // rowSpan/colSpan 不能过大,避免 rowSpan/colSpan 影响因虚拟滚动而未渲染的单元格
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
rowSpan = Math.min(rowSpan, verInfo.limit - rowIndex);
|
|
91
|
+
colSpan = Math.min(colSpan, leftFlatCount + hoz.rightIndex - colIndex);
|
|
92
|
+
var hasSpan = colSpan > 1 || rowSpan > 1;
|
|
93
|
+
|
|
94
|
+
if (hasSpan) {
|
|
95
|
+
spanManager.add(rowIndex, colIndex, colSpan, rowSpan);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
var positionStyle = {};
|
|
99
|
+
|
|
100
|
+
if (colIndex < leftFlatCount) {
|
|
101
|
+
positionStyle.position = 'sticky';
|
|
102
|
+
positionStyle.left = hozInfo.stickyLeftMap.get(colIndex);
|
|
103
|
+
} else if (colIndex >= fullFlatCount - rightFlatCount) {
|
|
104
|
+
positionStyle.position = 'sticky';
|
|
105
|
+
positionStyle.right = hozInfo.stickyRightMap.get(colIndex);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return /*#__PURE__*/React.createElement('td', _extends(_extends(_extends(_extends({
|
|
109
|
+
key: colIndex
|
|
110
|
+
}, cellProps), {
|
|
111
|
+
className: cx(Classes.tableCell, cellProps.className, {
|
|
112
|
+
// class
|
|
113
|
+
first: colIndex === 0,
|
|
114
|
+
last: colIndex + colSpan === fullFlatCount,
|
|
115
|
+
'lock-left': colIndex < leftFlatCount,
|
|
116
|
+
'lock-right': colIndex >= fullFlatCount - rightFlatCount,
|
|
117
|
+
'row-span': rowSpan > 1
|
|
118
|
+
})
|
|
119
|
+
}), hasSpan ? {
|
|
120
|
+
colSpan: colSpan,
|
|
121
|
+
rowSpan: rowSpan
|
|
122
|
+
} : null), {
|
|
123
|
+
style: _extends(_extends({
|
|
124
|
+
textAlign: column.align,
|
|
125
|
+
verticalAlign: (_c = column.verticalAlign) !== null && _c !== void 0 ? _c : 'middle'
|
|
126
|
+
}, cellProps.style), positionStyle),
|
|
127
|
+
'data-role': 'table-cell',
|
|
128
|
+
'data-rowindex': rowIndex,
|
|
129
|
+
'data-code': column.code
|
|
130
|
+
}), cellContent);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ArtColumn } from '../interfaces';
|
|
2
|
+
export declare type VirtualEnum = false | true | 'auto';
|
|
3
|
+
export interface VerticalRenderRange {
|
|
4
|
+
topIndex: number;
|
|
5
|
+
topBlank: number;
|
|
6
|
+
bottomIndex: number;
|
|
7
|
+
bottomBlank: number;
|
|
8
|
+
}
|
|
9
|
+
export interface HorizontalRenderRange {
|
|
10
|
+
leftIndex: number;
|
|
11
|
+
leftBlank: number;
|
|
12
|
+
rightIndex: number;
|
|
13
|
+
rightBlank: number;
|
|
14
|
+
}
|
|
15
|
+
export declare type VisibleColumnDescriptor = {
|
|
16
|
+
type: 'blank';
|
|
17
|
+
blankSide: 'left' | 'right';
|
|
18
|
+
width: number;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'normal';
|
|
21
|
+
colIndex: number;
|
|
22
|
+
col: ArtColumn;
|
|
23
|
+
};
|
|
24
|
+
export interface ResolvedUseVirtual {
|
|
25
|
+
horizontal: boolean;
|
|
26
|
+
vertical: boolean;
|
|
27
|
+
header: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface RenderInfo {
|
|
30
|
+
verticalRenderRange: VerticalRenderRange;
|
|
31
|
+
horizontalRenderRange: HorizontalRenderRange;
|
|
32
|
+
visible: VisibleColumnDescriptor[];
|
|
33
|
+
flat: {
|
|
34
|
+
full: ArtColumn[];
|
|
35
|
+
left: ArtColumn[];
|
|
36
|
+
center: ArtColumn[];
|
|
37
|
+
right: ArtColumn[];
|
|
38
|
+
};
|
|
39
|
+
nested: {
|
|
40
|
+
full: ArtColumn[];
|
|
41
|
+
left: ArtColumn[];
|
|
42
|
+
center: ArtColumn[];
|
|
43
|
+
right: ArtColumn[];
|
|
44
|
+
};
|
|
45
|
+
stickyLeftMap: Map<number, number>;
|
|
46
|
+
stickyRightMap: Map<number, number>;
|
|
47
|
+
useVirtual: ResolvedUseVirtual;
|
|
48
|
+
/** props.columns 是否包含有效的锁列 */
|
|
49
|
+
hasLockColumn: boolean;
|
|
50
|
+
/** 左侧锁定列的总宽度 */
|
|
51
|
+
leftLockTotalWidth: number;
|
|
52
|
+
/** 右侧锁定列的总宽度 */
|
|
53
|
+
rightLockTotalWidth: number;
|
|
54
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export interface LoadingContentWrapperProps {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
interface LoadingProps {
|
|
7
|
+
visible: boolean;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
LoadingContentWrapper?: React.ComponentType<LoadingContentWrapperProps>;
|
|
10
|
+
LoadingIcon?: React.ComponentType;
|
|
11
|
+
}
|
|
12
|
+
export default function Loading({ visible, children, LoadingContentWrapper, LoadingIcon }: LoadingProps): JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Classes } from './styles';
|
|
3
|
+
var DefaultLoadingIcon = /*#__PURE__*/React.memo(function () {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
5
|
+
style: {
|
|
6
|
+
margin: 'auto',
|
|
7
|
+
display: 'block',
|
|
8
|
+
width: 40,
|
|
9
|
+
height: 40
|
|
10
|
+
},
|
|
11
|
+
viewBox: "0 0 100 100",
|
|
12
|
+
preserveAspectRatio: "xMidYMid"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
14
|
+
cx: "50",
|
|
15
|
+
cy: "50",
|
|
16
|
+
r: "40",
|
|
17
|
+
fill: "none",
|
|
18
|
+
stroke: "#23a7fa",
|
|
19
|
+
strokeDasharray: "188 64",
|
|
20
|
+
strokeLinecap: "round",
|
|
21
|
+
strokeWidth: "10"
|
|
22
|
+
}, /*#__PURE__*/React.createElement("animateTransform", {
|
|
23
|
+
attributeName: "transform",
|
|
24
|
+
dur: "1.5s",
|
|
25
|
+
keyTimes: "0;1",
|
|
26
|
+
repeatCount: "indefinite",
|
|
27
|
+
type: "rotate",
|
|
28
|
+
values: "0 50 50;360 50 50"
|
|
29
|
+
})));
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
function DefaultLoadingContentWrapper(_ref) {
|
|
33
|
+
var children = _ref.children,
|
|
34
|
+
visible = _ref.visible;
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: Classes.loadingContentWrapper,
|
|
37
|
+
style: {
|
|
38
|
+
filter: visible ? 'blur(1px)' : 'none'
|
|
39
|
+
}
|
|
40
|
+
}, children);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default function Loading(_ref2) {
|
|
44
|
+
var visible = _ref2.visible,
|
|
45
|
+
children = _ref2.children,
|
|
46
|
+
_ref2$LoadingContentW = _ref2.LoadingContentWrapper,
|
|
47
|
+
LoadingContentWrapper = _ref2$LoadingContentW === void 0 ? DefaultLoadingContentWrapper : _ref2$LoadingContentW,
|
|
48
|
+
_ref2$LoadingIcon = _ref2.LoadingIcon,
|
|
49
|
+
LoadingIcon = _ref2$LoadingIcon === void 0 ? DefaultLoadingIcon : _ref2$LoadingIcon;
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
className: Classes.loadingWrapper
|
|
52
|
+
}, visible && /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
className: Classes.loadingIndicatorWrapper
|
|
54
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: Classes.loadingIndicator
|
|
56
|
+
}, /*#__PURE__*/React.createElement(LoadingIcon, null))), /*#__PURE__*/React.createElement(LoadingContentWrapper, {
|
|
57
|
+
visible: visible,
|
|
58
|
+
children: children
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
export declare const LOCK_SHADOW_PADDING = 20;
|
|
2
|
+
export declare const Classes: {
|
|
3
|
+
/** BaseTable 表格组件的外层包裹 div */
|
|
4
|
+
readonly artTableWrapper: string;
|
|
5
|
+
readonly artTable: string;
|
|
6
|
+
readonly tableHeader: string;
|
|
7
|
+
readonly tableBody: string;
|
|
8
|
+
readonly virtual: string;
|
|
9
|
+
readonly tableFooter: string;
|
|
10
|
+
/** 表格行 */
|
|
11
|
+
readonly tableRow: string;
|
|
12
|
+
/** 表头行 */
|
|
13
|
+
readonly tableHeaderRow: string;
|
|
14
|
+
/** 单元格 */
|
|
15
|
+
readonly tableCell: string;
|
|
16
|
+
/** 表头的单元格 */
|
|
17
|
+
readonly tableHeaderCell: string;
|
|
18
|
+
readonly tableHeaderCellContent: string;
|
|
19
|
+
readonly tableHeaderCellResize: string;
|
|
20
|
+
readonly virtualBlank: string;
|
|
21
|
+
readonly stickyScroll: string;
|
|
22
|
+
readonly stickyScrollItem: string;
|
|
23
|
+
readonly horizontalScrollContainer: string;
|
|
24
|
+
readonly lockShadowMask: string;
|
|
25
|
+
readonly lockShadow: string;
|
|
26
|
+
readonly leftLockShadow: string;
|
|
27
|
+
readonly rightLockShadow: string;
|
|
28
|
+
/** 数据为空时表格内容的外层 div */
|
|
29
|
+
readonly emptyWrapper: string;
|
|
30
|
+
readonly loadingWrapper: string;
|
|
31
|
+
readonly loadingContentWrapper: string;
|
|
32
|
+
readonly loadingIndicatorWrapper: string;
|
|
33
|
+
readonly loadingIndicator: string;
|
|
34
|
+
readonly tableHeaderCellLine: string;
|
|
35
|
+
readonly tableFilterTrigger: string;
|
|
36
|
+
readonly tableSortIcon: string;
|
|
37
|
+
readonly button: string;
|
|
38
|
+
readonly buttonPrimary: string;
|
|
39
|
+
readonly filterIcon: string;
|
|
40
|
+
};
|
|
41
|
+
export declare const MenuClasses: {
|
|
42
|
+
menu: string;
|
|
43
|
+
menuList: string;
|
|
44
|
+
menuOption: string;
|
|
45
|
+
menuOptionActive: string;
|
|
46
|
+
menuOptionText: string;
|
|
47
|
+
};
|
|
48
|
+
export declare type BaseTableCSSVariables = Partial<{
|
|
49
|
+
/** 表格一行的高度,注意该属性将被作为 CSS variable,不能使用数字作为简写 */
|
|
50
|
+
'--row-height': string;
|
|
51
|
+
/** 表格的字体颜色 */
|
|
52
|
+
'--color': string;
|
|
53
|
+
/** 表格背景颜色 */
|
|
54
|
+
'--bgcolor': string;
|
|
55
|
+
/** 鼠标悬停时的背景色 */
|
|
56
|
+
'--hover-bgcolor': string;
|
|
57
|
+
/** 单元格高亮时的背景色 */
|
|
58
|
+
'--highlight-bgcolor': string;
|
|
59
|
+
/** 主题色 */
|
|
60
|
+
'--primary-color': string;
|
|
61
|
+
/** 主题色浅色1,浅色选中、悬浮 */
|
|
62
|
+
'--primary-color-level1': string;
|
|
63
|
+
/** 主题色浅色2,深色选中、悬浮 */
|
|
64
|
+
'--primary-color-level2': string;
|
|
65
|
+
/**图标默认颜色 */
|
|
66
|
+
'--icon-color': string;
|
|
67
|
+
/**边框颜色 */
|
|
68
|
+
'--strong-border-color': string;
|
|
69
|
+
/** 表头中一行的高度,注意该属性将被作为 CSS variable,不能使用数字作为简写 */
|
|
70
|
+
'--header-row-height': string;
|
|
71
|
+
/** 表头中的字体颜色 */
|
|
72
|
+
'--header-color': string;
|
|
73
|
+
/** 表头的背景色 */
|
|
74
|
+
'--header-bgcolor': string;
|
|
75
|
+
/** 表头上鼠标悬停时的背景色 */
|
|
76
|
+
'--header-hover-bgcolor': string;
|
|
77
|
+
/** 表头上单元格高亮时的背景色 */
|
|
78
|
+
'--header-highlight-bgcolor': string;
|
|
79
|
+
/** 单元格 padding */
|
|
80
|
+
'--cell-padding': string;
|
|
81
|
+
/** 字体大小 */
|
|
82
|
+
'--font-size': string;
|
|
83
|
+
/** 表格内字体的行高 */
|
|
84
|
+
'--line-height': string;
|
|
85
|
+
/** 锁列阴影,默认为 rgba(152, 152, 152, 0.5) 0 0 6px 2px */
|
|
86
|
+
'--lock-shadow': string;
|
|
87
|
+
/** 单元格的边框颜色 */
|
|
88
|
+
'--border-color': string;
|
|
89
|
+
/** 单元格边框,默认为 1px solid #dfe3e8 */
|
|
90
|
+
'--cell-border': string;
|
|
91
|
+
/** 单元格上下边框,默认为 #dfe3e8 */
|
|
92
|
+
'--cell-border-horizontal': string;
|
|
93
|
+
/** 单元格左右边框,默认为 #dfe3e8 */
|
|
94
|
+
'--cell-border-vertical': string;
|
|
95
|
+
/** 表头单元格边框,默认为 1px solid #dfe3e8 */
|
|
96
|
+
'--header-cell-border': string;
|
|
97
|
+
/** 表头单元格上下边框,默认为 1px solid #dfe3e8 */
|
|
98
|
+
'--header-cell-border-horizontal': string;
|
|
99
|
+
/** 表头单元格左右边框,默认为 1px solid #dfe3e8 */
|
|
100
|
+
'--header-cell-border-vertical': string;
|
|
101
|
+
}>;
|
|
102
|
+
export declare const defaultCSSVariables: {
|
|
103
|
+
'--row-height': string;
|
|
104
|
+
'--color': string;
|
|
105
|
+
'--bgcolor': string;
|
|
106
|
+
'--hover-bgcolor': string;
|
|
107
|
+
'--highlight-bgcolor': string;
|
|
108
|
+
'--primary-color': string;
|
|
109
|
+
'--primary-color-level1': string;
|
|
110
|
+
'--primary-color-level2': string;
|
|
111
|
+
'--icon-color': string;
|
|
112
|
+
'--strong-border-color': string;
|
|
113
|
+
'--header-row-height': string;
|
|
114
|
+
'--header-color': string;
|
|
115
|
+
'--header-bgcolor': string;
|
|
116
|
+
'--header-hover-bgcolor': string;
|
|
117
|
+
'--header-highlight-bgcolor': string;
|
|
118
|
+
'--cell-padding': string;
|
|
119
|
+
'--font-size': string;
|
|
120
|
+
'--line-height': string;
|
|
121
|
+
'--lock-shadow': string;
|
|
122
|
+
'--border-color': string;
|
|
123
|
+
'--cell-border': string;
|
|
124
|
+
'--cell-border-horizontal': string;
|
|
125
|
+
'---cell-border-vertical': string;
|
|
126
|
+
'--header-cell-border': string;
|
|
127
|
+
'--header-cell-border-horizontal': string;
|
|
128
|
+
'--header-cell-border-vertical': string;
|
|
129
|
+
};
|
|
130
|
+
export declare const variableConst: string;
|
|
131
|
+
export declare const StyledArtTableWrapper: any;
|
|
132
|
+
export declare const ButtonCSS: any;
|