@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,254 @@
|
|
|
1
|
+
import _toArray from "@babel/runtime-corejs3/helpers/toArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
3
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
4
|
+
import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
|
|
5
|
+
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
6
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
7
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
8
|
+
import _Set from "@babel/runtime-corejs3/core-js-stable/set";
|
|
9
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
10
|
+
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
|
|
11
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
12
|
+
import cx from 'classnames';
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import { ExpansionCell, icons, InlineFlexCell } from '../../common-views';
|
|
15
|
+
import { internals } from '../../internals';
|
|
16
|
+
import { collectNodes, mergeCellProps } from '../../utils';
|
|
17
|
+
import { always, flatMap } from '../../utils/others';
|
|
18
|
+
import console from '../../utils/console';
|
|
19
|
+
|
|
20
|
+
var rowDetailSymbol = _Symbol('row-detail');
|
|
21
|
+
|
|
22
|
+
var fallbackRenderDetail = function fallbackRenderDetail() {
|
|
23
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
style: {
|
|
25
|
+
margin: '8px 24px'
|
|
26
|
+
}
|
|
27
|
+
}, /*#__PURE__*/React.createElement("b", {
|
|
28
|
+
style: {
|
|
29
|
+
color: 'indianred'
|
|
30
|
+
}
|
|
31
|
+
}, "\u8BBE\u7F6E ", /*#__PURE__*/React.createElement("code", null, "rowDetail.renderDetail"), " \u6765\u81EA\u5B9A\u4E49\u8BE6\u60C5\u5185\u5BB9"));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function rowDetail() {
|
|
35
|
+
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
36
|
+
return function rowDetailStep(pipeline) {
|
|
37
|
+
var _context, _context2;
|
|
38
|
+
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
40
|
+
|
|
41
|
+
var stateKey = 'rowDetail';
|
|
42
|
+
var primaryKey = pipeline.ensurePrimaryKey('rowDetail');
|
|
43
|
+
|
|
44
|
+
if (typeof primaryKey !== 'string') {
|
|
45
|
+
throw new Error('rowDetail 仅支持字符串作为 primaryKey');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var rowDetailMetaKey = (_a = opts.rowDetailMetaKey) !== null && _a !== void 0 ? _a : rowDetailSymbol;
|
|
49
|
+
var indents = pipeline.ctx.indents;
|
|
50
|
+
var textOffset = indents.iconIndent + indents.iconWidth + indents.iconGap;
|
|
51
|
+
var clickArea = (_b = opts.clickArea) !== null && _b !== void 0 ? _b : 'cell';
|
|
52
|
+
var getDetailKey = (_c = opts.getDetailKey) !== null && _c !== void 0 ? _c : function (row) {
|
|
53
|
+
return row[primaryKey] + '_detail';
|
|
54
|
+
};
|
|
55
|
+
var renderDetail = (_d = opts.renderDetail) !== null && _d !== void 0 ? _d : fallbackRenderDetail;
|
|
56
|
+
var hasDetail = (_e = opts.hasDetail) !== null && _e !== void 0 ? _e : always(true);
|
|
57
|
+
var openKeys = (_h = (_g = (_f = opts.openKeys) !== null && _f !== void 0 ? _f : pipeline.getStateAtKey(stateKey)) !== null && _g !== void 0 ? _g : opts.defaultOpenAll ? _mapInstanceProperty(_context = _filterInstanceProperty(_context2 = pipeline.getDataSource()).call(_context2, hasDetail)).call(_context, function (row) {
|
|
58
|
+
return row[primaryKey];
|
|
59
|
+
}) : opts.defaultOpenKeys) !== null && _h !== void 0 ? _h : [];
|
|
60
|
+
|
|
61
|
+
var onChangeOpenKeys = function onChangeOpenKeys(nextKeys, key, action) {
|
|
62
|
+
var _a;
|
|
63
|
+
|
|
64
|
+
(_a = opts.onChangeOpenKeys) === null || _a === void 0 ? void 0 : _a.call(opts, nextKeys, key, action);
|
|
65
|
+
pipeline.setStateAtKey(stateKey, nextKeys, {
|
|
66
|
+
key: key,
|
|
67
|
+
action: action
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
var openKeySet = new _Set(openKeys);
|
|
72
|
+
|
|
73
|
+
var toggle = function toggle(rowKey) {
|
|
74
|
+
var expanded = openKeySet.has(rowKey);
|
|
75
|
+
|
|
76
|
+
if (expanded) {
|
|
77
|
+
onChangeOpenKeys(_filterInstanceProperty(openKeys).call(openKeys, function (key) {
|
|
78
|
+
return key !== rowKey;
|
|
79
|
+
}), rowKey, 'collapse');
|
|
80
|
+
} else {
|
|
81
|
+
var _context3;
|
|
82
|
+
|
|
83
|
+
onChangeOpenKeys(_concatInstanceProperty(_context3 = []).call(_context3, _toConsumableArray(openKeys), [rowKey]), rowKey, 'expand');
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return pipeline.dataSource(flatMap(pipeline.getDataSource(), function (row, rowIndex) {
|
|
88
|
+
if (openKeySet.has(row[primaryKey])) {
|
|
89
|
+
return [row, _extends(_extends(_defineProperty({}, rowDetailMetaKey, true), row), _defineProperty({}, primaryKey, getDetailKey(row, rowIndex)))];
|
|
90
|
+
} else {
|
|
91
|
+
return [row];
|
|
92
|
+
}
|
|
93
|
+
})).columns(processColumns(pipeline.getColumns())).appendRowPropsGetter(function (row) {
|
|
94
|
+
if (row[rowDetailMetaKey]) {
|
|
95
|
+
return {
|
|
96
|
+
className: 'no-hover'
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
function processColumns(columns) {
|
|
102
|
+
if (columns.length === 0) {
|
|
103
|
+
return columns;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
var expandColumnIndex = 0;
|
|
107
|
+
|
|
108
|
+
if (opts.expandColumnCode) {
|
|
109
|
+
expandColumnIndex = _findIndexInstanceProperty(columns).call(columns, function (col) {
|
|
110
|
+
return col.code === opts.expandColumnCode;
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
if (expandColumnIndex < 0) {
|
|
114
|
+
console.warn('没找到可展开的列,请检查设置的展开列code');
|
|
115
|
+
return columns;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var expandCol = columns[expandColumnIndex];
|
|
120
|
+
|
|
121
|
+
var tableColumns = _toConsumableArray(columns);
|
|
122
|
+
|
|
123
|
+
var render = function render(value, row, rowIndex) {
|
|
124
|
+
if (row[rowDetailMetaKey]) {
|
|
125
|
+
return renderDetail(row, rowIndex);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
var content = internals.safeRender(expandCol, row, rowIndex);
|
|
129
|
+
|
|
130
|
+
if (!hasDetail(row, rowIndex)) {
|
|
131
|
+
return /*#__PURE__*/React.createElement(InlineFlexCell, {
|
|
132
|
+
style: {
|
|
133
|
+
marginLeft: textOffset
|
|
134
|
+
}
|
|
135
|
+
}, content);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
var rowKey = row[primaryKey];
|
|
139
|
+
var expanded = openKeySet.has(rowKey);
|
|
140
|
+
|
|
141
|
+
var onClick = function onClick(e) {
|
|
142
|
+
if (opts.stopClickEventPropagation) {
|
|
143
|
+
e.stopPropagation();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
toggle(rowKey);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
var expandCls = expanded ? 'expanded' : 'collapsed';
|
|
150
|
+
var ExpandIcon = opts.expandIcon;
|
|
151
|
+
return /*#__PURE__*/React.createElement(ExpansionCell, {
|
|
152
|
+
className: cx('expansion-cell', expandCls),
|
|
153
|
+
style: {
|
|
154
|
+
cursor: clickArea === 'content' ? 'pointer' : undefined
|
|
155
|
+
},
|
|
156
|
+
onClick: clickArea === 'content' ? onClick : undefined
|
|
157
|
+
}, opts.expandIcon ? /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
158
|
+
expanded: expanded,
|
|
159
|
+
onClick: clickArea === 'icon' ? onClick : undefined
|
|
160
|
+
}) : /*#__PURE__*/React.createElement(icons.CaretRight, {
|
|
161
|
+
style: {
|
|
162
|
+
cursor: clickArea === 'icon' ? 'pointer' : undefined,
|
|
163
|
+
marginLeft: indents.iconIndent,
|
|
164
|
+
marginRight: indents.iconGap
|
|
165
|
+
},
|
|
166
|
+
className: cx('expansion-icon', expandCls),
|
|
167
|
+
onClick: clickArea === 'icon' ? onClick : undefined
|
|
168
|
+
}), content);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
var getCellProps = function getCellProps(value, row, rowIndex) {
|
|
172
|
+
var _a;
|
|
173
|
+
|
|
174
|
+
if (row[rowDetailMetaKey]) {
|
|
175
|
+
return {
|
|
176
|
+
style: _extends({
|
|
177
|
+
'--cell-padding': '0',
|
|
178
|
+
overflow: 'hidden'
|
|
179
|
+
}, opts.detailCellStyle)
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
var prevProps = (_a = expandCol.getCellProps) === null || _a === void 0 ? void 0 : _a.call(expandCol, value, row, rowIndex);
|
|
184
|
+
|
|
185
|
+
if (!hasDetail(row, rowIndex)) {
|
|
186
|
+
return prevProps;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return mergeCellProps(prevProps, {
|
|
190
|
+
onClick: function onClick(e) {
|
|
191
|
+
if (opts.stopClickEventPropagation) {
|
|
192
|
+
e.stopPropagation();
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
toggle(row[primaryKey]);
|
|
196
|
+
},
|
|
197
|
+
style: {
|
|
198
|
+
cursor: 'pointer'
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
var _tableColumns = _toArray(tableColumns),
|
|
204
|
+
firstCol = _tableColumns[0],
|
|
205
|
+
others = _sliceInstanceProperty(_tableColumns).call(_tableColumns, 1);
|
|
206
|
+
|
|
207
|
+
var firstColRender = function firstColRender(value, row, rowIndex) {
|
|
208
|
+
if (row[rowDetailMetaKey]) {
|
|
209
|
+
return renderDetail(row, rowIndex);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
var content = internals.safeRender(firstCol, row, rowIndex);
|
|
213
|
+
return content;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
tableColumns[0] = _extends(_extends({}, firstCol), {
|
|
217
|
+
render: firstColRender,
|
|
218
|
+
getSpanRect: function getSpanRect(value, row, rowIndex) {
|
|
219
|
+
if (row[rowDetailMetaKey]) {
|
|
220
|
+
// detail 总是成一行
|
|
221
|
+
return {
|
|
222
|
+
top: rowIndex,
|
|
223
|
+
bottom: rowIndex + 1,
|
|
224
|
+
left: 0,
|
|
225
|
+
right: collectNodes(pipeline.getColumns(), 'leaf-only').length
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
tableColumns[expandColumnIndex] = _extends(_extends({}, expandCol), {
|
|
231
|
+
title: /*#__PURE__*/React.createElement("div", {
|
|
232
|
+
style: {
|
|
233
|
+
display: 'inline-block',
|
|
234
|
+
marginLeft: textOffset
|
|
235
|
+
}
|
|
236
|
+
}, internals.safeRenderHeader(expandCol)),
|
|
237
|
+
render: render,
|
|
238
|
+
getCellProps: clickArea === 'cell' ? getCellProps : expandCol.getCellProps,
|
|
239
|
+
getSpanRect: function getSpanRect(value, row, rowIndex) {
|
|
240
|
+
if (row[rowDetailMetaKey]) {
|
|
241
|
+
// detail 总是成一行
|
|
242
|
+
return {
|
|
243
|
+
top: rowIndex,
|
|
244
|
+
bottom: rowIndex + 1,
|
|
245
|
+
left: 0,
|
|
246
|
+
right: collectNodes(pipeline.getColumns(), 'leaf-only').length
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
return tableColumns;
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TablePipeline } from '../pipeline';
|
|
2
|
+
export interface RowGroupingFeatureOptions {
|
|
3
|
+
/** 非受控用法:是否默认展开所有分组 */
|
|
4
|
+
defaultOpenAll?: boolean;
|
|
5
|
+
/** 非受控用法:默认展开的 keys */
|
|
6
|
+
defaultOpenKeys?: string[];
|
|
7
|
+
/** 受控用法:当前展开的 keys */
|
|
8
|
+
openKeys?: string[];
|
|
9
|
+
/** 受控用法:当前展开 keys 改变回调 */
|
|
10
|
+
onChangeOpenKeys?(nextKeys: string[], key: string, action: 'expand' | 'collapse'): void;
|
|
11
|
+
/** 是否对触发 onChangeOpenKeys 的 click 事件调用 event.stopPropagation() */
|
|
12
|
+
stopClickEventPropagation?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function rowGrouping(opts?: RowGroupingFeatureOptions): (pipeline: TablePipeline) => TablePipeline;
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
|
|
2
|
+
import _toArray from "@babel/runtime-corejs3/helpers/toArray";
|
|
3
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
4
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
5
|
+
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
6
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
7
|
+
import _Set from "@babel/runtime-corejs3/core-js-stable/set";
|
|
8
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
9
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
10
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { ExpansionCell, icons, InlineFlexCell } from '../../common-views';
|
|
14
|
+
import { internals } from '../../internals';
|
|
15
|
+
import { collectNodes, isLeafNode, mergeCellProps } from '../../utils';
|
|
16
|
+
import { flatMap } from '../../utils/others';
|
|
17
|
+
|
|
18
|
+
var groupingMetaSymbol = _Symbol('row-grouping-meta');
|
|
19
|
+
|
|
20
|
+
function attachGroupingMeta(row) {
|
|
21
|
+
return _extends(_defineProperty({}, groupingMetaSymbol, {
|
|
22
|
+
expandable: !isLeafNode(row)
|
|
23
|
+
}), row);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function getGroupingMeta(row) {
|
|
27
|
+
if (row[groupingMetaSymbol] == null) {
|
|
28
|
+
return {
|
|
29
|
+
isGroupHeader: false,
|
|
30
|
+
expandable: false
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
isGroupHeader: true,
|
|
36
|
+
expandable: row[groupingMetaSymbol].expandable
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function rowGroupingRowPropsGetter(row) {
|
|
41
|
+
if (getGroupingMeta(row).isGroupHeader) {
|
|
42
|
+
return {
|
|
43
|
+
className: 'alternative'
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function rowGrouping() {
|
|
49
|
+
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
50
|
+
return function (pipeline) {
|
|
51
|
+
var _context;
|
|
52
|
+
|
|
53
|
+
var _a, _b, _c;
|
|
54
|
+
|
|
55
|
+
var stateKey = 'rowGrouping';
|
|
56
|
+
var indents = pipeline.ctx.indents;
|
|
57
|
+
var textOffset = indents.iconIndent + indents.iconWidth + indents.iconGap;
|
|
58
|
+
var primaryKey = pipeline.ensurePrimaryKey('rowGrouping');
|
|
59
|
+
|
|
60
|
+
if (typeof primaryKey !== 'string') {
|
|
61
|
+
throw new Error('rowGrouping 仅支持字符串作为 primaryKey');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var openKeys = (_c = (_b = (_a = opts.openKeys) !== null && _a !== void 0 ? _a : pipeline.getStateAtKey(stateKey)) !== null && _b !== void 0 ? _b : opts.defaultOpenAll ? _mapInstanceProperty(_context = pipeline.getDataSource()).call(_context, function (row) {
|
|
65
|
+
return row[primaryKey];
|
|
66
|
+
}) : opts.defaultOpenKeys) !== null && _c !== void 0 ? _c : [];
|
|
67
|
+
var openKeySet = new _Set(openKeys);
|
|
68
|
+
|
|
69
|
+
var onChangeOpenKeys = function onChangeOpenKeys(nextKeys, key, action) {
|
|
70
|
+
var _a;
|
|
71
|
+
|
|
72
|
+
(_a = opts.onChangeOpenKeys) === null || _a === void 0 ? void 0 : _a.call(opts, nextKeys, key, action);
|
|
73
|
+
pipeline.setStateAtKey(stateKey, nextKeys, {
|
|
74
|
+
key: key,
|
|
75
|
+
action: action
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return pipeline.mapDataSource(processDataSource).mapColumns(processColumns).appendRowPropsGetter(rowGroupingRowPropsGetter);
|
|
80
|
+
|
|
81
|
+
function processDataSource(input) {
|
|
82
|
+
return flatMap(input, function (row) {
|
|
83
|
+
var result = [attachGroupingMeta(row)];
|
|
84
|
+
var expanded = openKeySet.has(row[primaryKey]);
|
|
85
|
+
|
|
86
|
+
if (expanded) {
|
|
87
|
+
if (Array.isArray(row.children)) {
|
|
88
|
+
result = _concatInstanceProperty(result).call(result, row.children);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return result;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function processColumns(columns) {
|
|
97
|
+
var _context3;
|
|
98
|
+
|
|
99
|
+
if (columns.length === 0) {
|
|
100
|
+
return columns;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
var columnFlatCount = collectNodes(columns, 'leaf-only').length;
|
|
104
|
+
|
|
105
|
+
var _columns = _toArray(columns),
|
|
106
|
+
firstCol = _columns[0],
|
|
107
|
+
others = _sliceInstanceProperty(_columns).call(_columns, 1);
|
|
108
|
+
|
|
109
|
+
var render = function render(value, row, rowIndex) {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
|
|
112
|
+
var content = internals.safeRender(firstCol, row, rowIndex);
|
|
113
|
+
var meta = getGroupingMeta(row);
|
|
114
|
+
|
|
115
|
+
if (!meta.isGroupHeader || !meta.expandable) {
|
|
116
|
+
var marginLeft = textOffset + (meta.isGroupHeader ? 0 : indents.indentSize);
|
|
117
|
+
return /*#__PURE__*/React.createElement(InlineFlexCell, {
|
|
118
|
+
style: {
|
|
119
|
+
marginLeft: marginLeft
|
|
120
|
+
}
|
|
121
|
+
}, meta.isGroupHeader ? (_a = row.groupTitle) !== null && _a !== void 0 ? _a : content : content);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
var expanded = openKeySet.has(row[primaryKey]);
|
|
125
|
+
var expandCls = expanded ? 'expanded' : 'collapsed';
|
|
126
|
+
return /*#__PURE__*/React.createElement(ExpansionCell, {
|
|
127
|
+
className: cx('expansion-cell', expandCls)
|
|
128
|
+
}, /*#__PURE__*/React.createElement(icons.CaretRight, {
|
|
129
|
+
className: cx('expansion-icon', expandCls),
|
|
130
|
+
style: {
|
|
131
|
+
marginLeft: indents.iconIndent,
|
|
132
|
+
marginRight: indents.iconGap
|
|
133
|
+
}
|
|
134
|
+
}), (_b = row.groupTitle) !== null && _b !== void 0 ? _b : content);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
var getCellProps = function getCellProps(value, row, rowIndex) {
|
|
138
|
+
var _a;
|
|
139
|
+
|
|
140
|
+
var meta = getGroupingMeta(row);
|
|
141
|
+
|
|
142
|
+
if (!meta.isGroupHeader) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
var expandable = meta.expandable;
|
|
147
|
+
var rowKey = row[primaryKey];
|
|
148
|
+
var expanded = openKeySet.has(rowKey);
|
|
149
|
+
var onClick;
|
|
150
|
+
|
|
151
|
+
if (expandable) {
|
|
152
|
+
onClick = function onClick(e) {
|
|
153
|
+
if (opts.stopClickEventPropagation) {
|
|
154
|
+
e.stopPropagation();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (expanded) {
|
|
158
|
+
onChangeOpenKeys(_filterInstanceProperty(openKeys).call(openKeys, function (key) {
|
|
159
|
+
return key !== rowKey;
|
|
160
|
+
}), rowKey, 'collapse');
|
|
161
|
+
} else {
|
|
162
|
+
var _context2;
|
|
163
|
+
|
|
164
|
+
onChangeOpenKeys(_concatInstanceProperty(_context2 = []).call(_context2, _toConsumableArray(openKeys), [rowKey]), rowKey, 'expand');
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
var prevProps = (_a = firstCol.getCellProps) === null || _a === void 0 ? void 0 : _a.call(firstCol, value, row, rowIndex);
|
|
170
|
+
return mergeCellProps(prevProps, {
|
|
171
|
+
onClick: onClick,
|
|
172
|
+
style: {
|
|
173
|
+
cursor: expandable ? 'pointer' : undefined
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
return _concatInstanceProperty(_context3 = [_extends(_extends({}, firstCol), {
|
|
179
|
+
title: /*#__PURE__*/React.createElement("div", {
|
|
180
|
+
style: {
|
|
181
|
+
display: 'inline-block',
|
|
182
|
+
marginLeft: textOffset
|
|
183
|
+
}
|
|
184
|
+
}, internals.safeRenderHeader(firstCol)),
|
|
185
|
+
render: render,
|
|
186
|
+
getCellProps: getCellProps,
|
|
187
|
+
getSpanRect: function getSpanRect(value, row, rowIndex) {
|
|
188
|
+
if (getGroupingMeta(row).isGroupHeader) {
|
|
189
|
+
return {
|
|
190
|
+
top: rowIndex,
|
|
191
|
+
bottom: rowIndex + 1,
|
|
192
|
+
left: 0,
|
|
193
|
+
right: columnFlatCount
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
})]).call(_context3, _toConsumableArray(others));
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ArtColumn } from '../../interfaces';
|
|
2
|
+
import { TablePipeline } from '../pipeline';
|
|
3
|
+
export interface SingleSelectFeatureOptions {
|
|
4
|
+
/** 是否高亮被选中的行 */
|
|
5
|
+
highlightRowWhenSelected?: boolean;
|
|
6
|
+
/** 非受控用法:默认选中的值 */
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
/** 受控用法:当前选中的值 */
|
|
9
|
+
value?: string;
|
|
10
|
+
/** 受控用法:选中值改变回调 */
|
|
11
|
+
onChange?: (next: string) => void;
|
|
12
|
+
/** 判断一行是否禁用 */
|
|
13
|
+
isDisabled?(row: any, rowIndex: number): boolean;
|
|
14
|
+
/** 点击事件的响应区域 */
|
|
15
|
+
clickArea?: 'radio' | 'cell' | 'row';
|
|
16
|
+
/** 单选框所在列的 column 配置,可指定 width,lock 等属性 */
|
|
17
|
+
radioColumn?: Partial<ArtColumn>;
|
|
18
|
+
/** 单选框所在列的位置 */
|
|
19
|
+
radioPlacement?: 'start' | 'end';
|
|
20
|
+
/** 是否对触发 onChange 的 click 事件调用 event.stopPropagation() */
|
|
21
|
+
stopClickEventPropagation?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function singleSelect(opts?: SingleSelectFeatureOptions): (pipeline: TablePipeline) => TablePipeline;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { internals } from '../../internals';
|
|
5
|
+
import { always } from '../../utils/others';
|
|
6
|
+
import { mergeCellProps } from '../../utils';
|
|
7
|
+
export function singleSelect() {
|
|
8
|
+
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9
|
+
return function singleSelectStep(pipeline) {
|
|
10
|
+
var _context;
|
|
11
|
+
|
|
12
|
+
var _a, _b, _c, _d, _e;
|
|
13
|
+
|
|
14
|
+
var Radio = pipeline.ctx.components.Radio;
|
|
15
|
+
|
|
16
|
+
if (Radio == null) {
|
|
17
|
+
throw new Error('使用 singleSelect 之前需要通过 pipeline context 设置 components.Radio');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
var stateKey = 'singleSelect';
|
|
21
|
+
var clickArea = (_a = opts.clickArea) !== null && _a !== void 0 ? _a : 'radio';
|
|
22
|
+
var isDisabled = (_b = opts.isDisabled) !== null && _b !== void 0 ? _b : always(false);
|
|
23
|
+
var primaryKey = pipeline.ensurePrimaryKey('singleSelect');
|
|
24
|
+
var value = (_d = (_c = opts.value) !== null && _c !== void 0 ? _c : pipeline.getStateAtKey(stateKey)) !== null && _d !== void 0 ? _d : opts.defaultValue;
|
|
25
|
+
|
|
26
|
+
var onChange = function onChange(rowKey) {
|
|
27
|
+
var _a;
|
|
28
|
+
|
|
29
|
+
(_a = opts.onChange) === null || _a === void 0 ? void 0 : _a.call(opts, rowKey);
|
|
30
|
+
pipeline.setStateAtKey(stateKey, rowKey);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var radioColumn = _extends(_extends({
|
|
34
|
+
name: '',
|
|
35
|
+
width: 50,
|
|
36
|
+
align: 'center'
|
|
37
|
+
}, opts.radioColumn), {
|
|
38
|
+
getCellProps: function getCellProps(value, row, rowIndex) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
|
|
41
|
+
if (clickArea === 'cell') {
|
|
42
|
+
var rowKey = internals.safeGetRowKey(primaryKey, row, rowIndex);
|
|
43
|
+
var disabled = isDisabled(row, rowIndex);
|
|
44
|
+
var preCellProps = (_b = (_a = opts.radioColumn) === null || _a === void 0 ? void 0 : _a.getCellProps) === null || _b === void 0 ? void 0 : _b.call(_a, value, row, rowIndex);
|
|
45
|
+
return mergeCellProps(preCellProps, {
|
|
46
|
+
style: {
|
|
47
|
+
cursor: disabled ? 'not-allowed' : 'pointer'
|
|
48
|
+
},
|
|
49
|
+
onClick: disabled ? undefined : function (e) {
|
|
50
|
+
if (opts.stopClickEventPropagation) {
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
onChange(rowKey);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
render: function render(_, row, rowIndex) {
|
|
60
|
+
var rowKey = internals.safeGetRowKey(primaryKey, row, rowIndex);
|
|
61
|
+
return /*#__PURE__*/React.createElement(Radio, {
|
|
62
|
+
checked: value === rowKey,
|
|
63
|
+
disabled: isDisabled(row, rowIndex),
|
|
64
|
+
onChange: clickArea === 'radio' ? function (arg1, arg2) {
|
|
65
|
+
var _a;
|
|
66
|
+
|
|
67
|
+
var nativeEvent = (_a = arg2 === null || arg2 === void 0 ? void 0 : arg2.nativeEvent) !== null && _a !== void 0 ? _a : arg1 === null || arg1 === void 0 ? void 0 : arg1.nativeEvent;
|
|
68
|
+
|
|
69
|
+
if (nativeEvent && opts.stopClickEventPropagation) {
|
|
70
|
+
nativeEvent.stopPropagation();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
onChange(rowKey);
|
|
74
|
+
} : undefined
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
var nextColumns = _sliceInstanceProperty(_context = pipeline.getColumns()).call(_context);
|
|
80
|
+
|
|
81
|
+
var radioPlacement = (_e = opts.radioPlacement) !== null && _e !== void 0 ? _e : 'start';
|
|
82
|
+
|
|
83
|
+
if (radioPlacement === 'start') {
|
|
84
|
+
nextColumns.unshift(radioColumn);
|
|
85
|
+
} else {
|
|
86
|
+
nextColumns.push(radioColumn);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
pipeline.columns(nextColumns);
|
|
90
|
+
pipeline.appendRowPropsGetter(function (row, rowIndex) {
|
|
91
|
+
var rowKey = internals.safeGetRowKey(primaryKey, row, rowIndex);
|
|
92
|
+
var style = {};
|
|
93
|
+
var className;
|
|
94
|
+
var onClick;
|
|
95
|
+
|
|
96
|
+
if (opts.highlightRowWhenSelected) {
|
|
97
|
+
if (value === rowKey) {
|
|
98
|
+
className = 'highlight';
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (clickArea === 'row' && !isDisabled(row, rowIndex)) {
|
|
103
|
+
style.cursor = 'pointer';
|
|
104
|
+
|
|
105
|
+
onClick = function onClick(e) {
|
|
106
|
+
if (opts.stopClickEventPropagation) {
|
|
107
|
+
e.stopPropagation();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
onChange(rowKey);
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
className: className,
|
|
116
|
+
style: style,
|
|
117
|
+
onClick: onClick
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
return pipeline;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ArtColumn, SortItem, SortOrder } from '../../interfaces';
|
|
3
|
+
import { TablePipeline } from '../pipeline';
|
|
4
|
+
export interface SortHeaderCellProps {
|
|
5
|
+
/** 调用 makeSortTransform(...) 时的参数 */
|
|
6
|
+
sortOptions: Required<Omit<SortFeatureOptions, 'SortHeaderCell' | 'defaultSorts'>>;
|
|
7
|
+
/** 在添加排序相关的内容之前 表头原有的渲染内容 */
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/** 当前排序 */
|
|
10
|
+
sortOrder: SortOrder;
|
|
11
|
+
/** 多列排序下,sortIndex 指明了当前排序字段起作用的顺序. 当 sortOrder 为 none 时,sortIndex 固定为 -1 */
|
|
12
|
+
sortIndex: number;
|
|
13
|
+
/** 当前列的配置 */
|
|
14
|
+
column: ArtColumn;
|
|
15
|
+
/** 切换排序的回调 */
|
|
16
|
+
onToggle(e: React.MouseEvent): void;
|
|
17
|
+
}
|
|
18
|
+
export interface SortFeatureOptions {
|
|
19
|
+
/** (非受控用法) 默认的排序字段列表 */
|
|
20
|
+
defaultSorts?: SortItem[];
|
|
21
|
+
/** (受控用法) 排序字段列表 */
|
|
22
|
+
sorts?: SortItem[];
|
|
23
|
+
/** 更新排序字段列表的回调函数 */
|
|
24
|
+
onChangeSorts?(nextSorts: SortItem[], currentSort: SortItem): void;
|
|
25
|
+
/** 排序切换顺序 */
|
|
26
|
+
orders?: SortOrder[];
|
|
27
|
+
/** 排序模式。单选 single,多选 multiple,默认为多选 */
|
|
28
|
+
mode?: 'single' | 'multiple';
|
|
29
|
+
/** 自定义排序表头 */
|
|
30
|
+
SortHeaderCell?: React.ComponentType<SortHeaderCellProps>;
|
|
31
|
+
/** 是否保持 dataSource 不变 */
|
|
32
|
+
keepDataSource?: boolean;
|
|
33
|
+
/** 排序激活时 是否高亮这一列的单元格 */
|
|
34
|
+
highlightColumnWhenActive?: boolean;
|
|
35
|
+
/** 是否对触发 onChangeOpenKeys 的 click 事件调用 event.stopPropagation() */
|
|
36
|
+
stopClickEventPropagation?: boolean;
|
|
37
|
+
/** sort icon 是否 hover 之后显示 */
|
|
38
|
+
sortIconHoverShow?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export declare function sort(opts?: SortFeatureOptions): (pipeline: TablePipeline) => TablePipeline;
|