@kdcloudjs/table 1.2.1-canary.5 → 1.2.1-canary.7
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 +0 -0
- package/README.md +0 -0
- package/dist/@kdcloudjs/table.css +1 -1
- package/dist/@kdcloudjs/table.css.map +0 -0
- package/dist/@kdcloudjs/table.js +4595 -5995
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +16 -24
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/dist/default-theme.js +0 -0
- package/dist/kd-ui-complete.less +0 -0
- package/dist/kd-ui.less +0 -0
- package/dist/theme.js +0 -0
- package/es/_utils/arrayUtil.d.ts +0 -0
- package/es/_utils/arrayUtil.js +0 -3
- package/es/_utils/devwarning.d.ts +0 -0
- package/es/_utils/devwarning.js +0 -1
- package/es/_utils/formatUtil.d.ts +0 -0
- package/es/_utils/formatUtil.js +36 -101
- package/es/_utils/hooks.d.ts +0 -0
- package/es/_utils/hooks.js +21 -45
- package/es/_utils/index.d.ts +0 -0
- package/es/_utils/index.js +0 -2
- package/es/_utils/numberUtil.d.ts +0 -0
- package/es/_utils/numberUtil.js +32 -55
- package/es/_utils/omit.d.ts +0 -0
- package/es/_utils/omit.js +0 -2
- package/es/_utils/react-children.d.ts +0 -0
- package/es/_utils/react-children.js +0 -0
- package/es/_utils/type.d.ts +0 -0
- package/es/_utils/type.js +0 -2
- package/es/_utils/usePopper.d.ts +0 -0
- package/es/_utils/usePopper.js +81 -144
- package/es/config-provider/ConfigContext.d.ts +0 -0
- package/es/config-provider/ConfigContext.js +0 -0
- package/es/config-provider/compDefaultProps.d.ts +0 -0
- package/es/config-provider/compDefaultProps.js +0 -1
- package/es/config-provider/configProvider.d.ts +0 -0
- package/es/config-provider/configProvider.js +2 -7
- package/es/config-provider/defaultConfig.d.ts +0 -0
- package/es/config-provider/defaultConfig.js +0 -1
- package/es/config-provider/index.d.ts +0 -0
- package/es/config-provider/index.js +0 -0
- package/es/index.d.ts +0 -0
- package/es/index.js +0 -2
- package/es/locale/index.d.ts +0 -0
- package/es/locale/index.js +0 -0
- package/es/locale/locale.d.ts +0 -0
- package/es/locale/locale.js +9 -48
- package/es/locale/zh-CN.d.ts +0 -0
- package/es/locale/zh-CN.js +0 -0
- package/es/style/color/colors.less +0 -0
- package/es/style/core/index.less +0 -0
- package/es/style/core/motion/other.less +0 -0
- package/es/style/core/motion/slide.less +0 -0
- package/es/style/core/motion.less +0 -0
- package/es/style/core/reset.less +0 -0
- package/es/style/css.js +0 -0
- package/es/style/index.css +0 -0
- package/es/style/index.d.ts +0 -0
- package/es/style/index.js +0 -0
- package/es/style/index.less +0 -0
- package/es/style/mixins/index.less +0 -0
- package/es/style/mixins/overlay.less +0 -0
- package/es/style/mixins/reset.less +0 -0
- package/es/style/themes/default.less +0 -0
- package/es/style/themes/index.less +0 -0
- package/es/table/base/calculations.d.ts +0 -0
- package/es/table/base/calculations.js +25 -75
- package/es/table/base/colgroup.d.ts +0 -0
- package/es/table/base/colgroup.js +0 -1
- package/es/table/base/empty.d.ts +0 -0
- package/es/table/base/empty.js +6 -6
- package/es/table/base/header.d.ts +0 -0
- package/es/table/base/header.js +21 -76
- package/es/table/base/helpers/SpanManager.d.ts +0 -0
- package/es/table/base/helpers/SpanManager.js +4 -11
- package/es/table/base/helpers/TableDOMUtils.d.ts +0 -0
- package/es/table/base/helpers/TableDOMUtils.js +9 -34
- package/es/table/base/helpers/__test__/SpanManager.test.d.ts +0 -0
- package/es/table/base/helpers/__test__/SpanManager.test.js +2 -2
- package/es/table/base/helpers/__test__/TableDOMUtils.test.d.ts +0 -0
- package/es/table/base/helpers/__test__/TableDOMUtils.test.js +0 -1
- package/es/table/base/helpers/__test__/rowHeightManager.test.d.ts +0 -0
- package/es/table/base/helpers/__test__/rowHeightManager.test.js +0 -0
- package/es/table/base/helpers/getRichVisibleRectsStream.d.ts +0 -0
- package/es/table/base/helpers/getRichVisibleRectsStream.js +13 -45
- package/es/table/base/helpers/rowHeightManager.d.ts +0 -0
- package/es/table/base/helpers/rowHeightManager.js +0 -28
- package/es/table/base/html-table.d.ts +0 -0
- package/es/table/base/html-table.js +17 -39
- package/es/table/base/index.d.ts +0 -0
- package/es/table/base/index.js +0 -0
- package/es/table/base/interfaces.d.ts +0 -0
- package/es/table/base/interfaces.js +0 -0
- package/es/table/base/loading.d.ts +0 -0
- package/es/table/base/loading.js +8 -10
- package/es/table/base/renderTemplates.d.ts +0 -0
- package/es/table/base/renderTemplates.js +41 -59
- package/es/table/base/styles.d.ts +0 -0
- package/es/table/base/styles.js +0 -9
- package/es/table/base/table.d.ts +0 -0
- package/es/table/base/table.js +110 -199
- package/es/table/base/utils.d.ts +0 -0
- package/es/table/base/utils.js +17 -57
- package/es/table/common-views.d.ts +0 -0
- package/es/table/common-views.js +0 -7
- package/es/table/index.d.ts +0 -0
- package/es/table/index.js +0 -0
- package/es/table/interfaces.d.ts +0 -0
- package/es/table/interfaces.js +0 -0
- package/es/table/internals.d.ts +0 -0
- package/es/table/internals.js +0 -13
- package/es/table/pipeline/features/autoFill.d.ts +0 -0
- package/es/table/pipeline/features/autoFill.js +11 -40
- package/es/table/pipeline/features/autoRowSpan.d.ts +0 -0
- package/es/table/pipeline/features/autoRowSpan.js +1 -14
- package/es/table/pipeline/features/buildTree.d.ts +0 -0
- package/es/table/pipeline/features/buildTree.js +0 -0
- package/es/table/pipeline/features/colGroupExtendable.d.ts +0 -0
- package/es/table/pipeline/features/colGroupExtendable.js +4 -19
- package/es/table/pipeline/features/columnDrag.d.ts +0 -0
- package/es/table/pipeline/features/columnDrag.js +41 -97
- package/es/table/pipeline/features/columnFilter.d.ts +0 -0
- package/es/table/pipeline/features/columnFilter.js +12 -51
- package/es/table/pipeline/features/columnHover.d.ts +0 -0
- package/es/table/pipeline/features/columnHover.js +1 -7
- package/es/table/pipeline/features/columnRangeHover.d.ts +0 -0
- package/es/table/pipeline/features/columnRangeHover.js +1 -8
- package/es/table/pipeline/features/columnResizeWidth.d.ts +0 -0
- package/es/table/pipeline/features/columnResizeWidth.js +13 -39
- package/es/table/pipeline/features/contextMenu.d.ts +0 -0
- package/es/table/pipeline/features/contextMenu.js +22 -95
- package/es/table/pipeline/features/filter/DefaultFilterContent.d.ts +0 -0
- package/es/table/pipeline/features/filter/DefaultFilterContent.js +14 -30
- package/es/table/pipeline/features/filter/DefaultFilterIcon.d.ts +0 -0
- package/es/table/pipeline/features/filter/DefaultFilterIcon.js +1 -1
- package/es/table/pipeline/features/filter/Filter.d.ts +0 -0
- package/es/table/pipeline/features/filter/Filter.js +26 -50
- package/es/table/pipeline/features/filter/FilterPanel.d.ts +0 -0
- package/es/table/pipeline/features/filter/FilterPanel.js +11 -25
- package/es/table/pipeline/features/filter/index.d.ts +0 -0
- package/es/table/pipeline/features/filter/index.js +0 -0
- package/es/table/pipeline/features/filter/util.d.ts +0 -0
- package/es/table/pipeline/features/filter/util.js +0 -4
- package/es/table/pipeline/features/footerDataSource.d.ts +0 -0
- package/es/table/pipeline/features/footerDataSource.js +0 -3
- package/es/table/pipeline/features/index.d.ts +0 -0
- package/es/table/pipeline/features/index.js +0 -0
- package/es/table/pipeline/features/mergeCellHover.d.ts +0 -0
- package/es/table/pipeline/features/mergeCellHover.js +0 -1
- package/es/table/pipeline/features/multiSelect.d.ts +0 -0
- package/es/table/pipeline/features/multiSelect.js +15 -57
- package/es/table/pipeline/features/rangeSelection.d.ts +0 -0
- package/es/table/pipeline/features/rangeSelection.js +74 -154
- package/es/table/pipeline/features/rowDetail.d.ts +0 -0
- package/es/table/pipeline/features/rowDetail.js +4 -43
- package/es/table/pipeline/features/rowDrag.d.ts +0 -0
- package/es/table/pipeline/features/rowDrag.js +39 -78
- package/es/table/pipeline/features/rowGrouping.d.ts +0 -0
- package/es/table/pipeline/features/rowGrouping.js +4 -37
- package/es/table/pipeline/features/singleSelect.d.ts +0 -0
- package/es/table/pipeline/features/singleSelect.js +0 -24
- package/es/table/pipeline/features/sort.d.ts +0 -0
- package/es/table/pipeline/features/sort.js +38 -96
- package/es/table/pipeline/features/tips.d.ts +0 -0
- package/es/table/pipeline/features/tips.js +4 -10
- package/es/table/pipeline/features/treeMode.d.ts +0 -0
- package/es/table/pipeline/features/treeMode.js +14 -49
- package/es/table/pipeline/features/treeSelect.d.ts +0 -0
- package/es/table/pipeline/features/treeSelect.js +2 -28
- package/es/table/pipeline/index.d.ts +0 -0
- package/es/table/pipeline/index.js +0 -0
- package/es/table/pipeline/pipeline.d.ts +0 -0
- package/es/table/pipeline/pipeline.js +12 -53
- package/es/table/pivot/cross-table/buildCrossTable.d.ts +0 -0
- package/es/table/pivot/cross-table/buildCrossTable.js +21 -72
- package/es/table/pivot/cross-table/constants.d.ts +0 -0
- package/es/table/pivot/cross-table/constants.js +0 -0
- package/es/table/pivot/cross-table/cross-table.d.ts +0 -0
- package/es/table/pivot/cross-table/cross-table.js +23 -31
- package/es/table/pivot/cross-table/index.d.ts +0 -0
- package/es/table/pivot/cross-table/index.js +0 -0
- package/es/table/pivot/cross-table/interfaces.d.ts +0 -0
- package/es/table/pivot/cross-table/interfaces.js +0 -0
- package/es/table/pivot/cross-table/internals.d.ts +0 -0
- package/es/table/pivot/cross-table/internals.js +0 -0
- package/es/table/pivot/cross-tree-table/buildCrossTreeTable.d.ts +0 -0
- package/es/table/pivot/cross-tree-table/buildCrossTreeTable.js +22 -57
- package/es/table/pivot/cross-tree-table/cross-tree-table.d.ts +0 -0
- package/es/table/pivot/cross-tree-table/cross-tree-table.js +36 -61
- package/es/table/pivot/cross-tree-table/index.d.ts +0 -0
- package/es/table/pivot/cross-tree-table/index.js +0 -0
- package/es/table/pivot/pivot-utils/buildDrillTree.d.ts +0 -0
- package/es/table/pivot/pivot-utils/buildDrillTree.js +10 -23
- package/es/table/pivot/pivot-utils/builders.d.ts +0 -0
- package/es/table/pivot/pivot-utils/builders.js +34 -74
- package/es/table/pivot/pivot-utils/convert-utils.d.ts +0 -0
- package/es/table/pivot/pivot-utils/convert-utils.js +16 -42
- package/es/table/pivot/pivot-utils/index.d.ts +0 -0
- package/es/table/pivot/pivot-utils/index.js +0 -0
- package/es/table/pivot/pivot-utils/interfaces.d.ts +0 -0
- package/es/table/pivot/pivot-utils/interfaces.js +0 -0
- package/es/table/pivot/pivot-utils/simpleEncode.d.ts +0 -0
- package/es/table/pivot/pivot-utils/simpleEncode.js +0 -1
- package/es/table/style/css.js +0 -0
- package/es/table/style/index.css +0 -0
- package/es/table/style/index.d.ts +0 -0
- package/es/table/style/index.js +0 -0
- package/es/table/style/index.less +0 -0
- package/es/table/transforms/autoRowSpan.d.ts +0 -0
- package/es/table/transforms/autoRowSpan.js +1 -15
- package/es/table/transforms/autoWidth.d.ts +0 -0
- package/es/table/transforms/autoWidth.js +13 -35
- package/es/table/transforms/buildTree.d.ts +0 -0
- package/es/table/transforms/buildTree.js +1 -2
- package/es/table/transforms/columnHover.d.ts +0 -0
- package/es/table/transforms/columnHover.js +9 -15
- package/es/table/transforms/columnRangeHover.d.ts +0 -0
- package/es/table/transforms/columnRangeHover.js +12 -19
- package/es/table/transforms/columnResize.d.ts +0 -0
- package/es/table/transforms/columnResize.js +18 -42
- package/es/table/transforms/flatten.d.ts +0 -0
- package/es/table/transforms/flatten.js +0 -3
- package/es/table/transforms/index.d.ts +0 -0
- package/es/table/transforms/index.js +0 -0
- package/es/table/transforms/orderField.d.ts +0 -0
- package/es/table/transforms/orderField.js +0 -3
- package/es/table/transforms/sort.d.ts +0 -0
- package/es/table/transforms/sort.js +42 -101
- package/es/table/transforms/tips.d.ts +0 -0
- package/es/table/transforms/tips.js +5 -10
- package/es/table/transforms/treeMode.d.ts +0 -0
- package/es/table/transforms/treeMode.js +36 -77
- package/es/table/transforms/visible.d.ts +0 -0
- package/es/table/transforms/visible.js +0 -2
- package/es/table/transforms/warnTransformsDeprecated.d.ts +0 -0
- package/es/table/transforms/warnTransformsDeprecated.js +0 -0
- package/es/table/use/useResizeObserver.d.ts +0 -0
- package/es/table/use/useResizeObserver.js +1 -4
- package/es/table/utils/applyTransforms.d.ts +0 -0
- package/es/table/utils/applyTransforms.js +0 -1
- package/es/table/utils/browserType.d.ts +0 -0
- package/es/table/utils/browserType.js +17 -20
- package/es/table/utils/buildTree.d.ts +0 -0
- package/es/table/utils/buildTree.js +7 -22
- package/es/table/utils/collectNodes.d.ts +0 -0
- package/es/table/utils/collectNodes.js +4 -13
- package/es/table/utils/console.d.ts +0 -0
- package/es/table/utils/console.js +0 -14
- package/es/table/utils/copyToClipboard.d.ts +0 -0
- package/es/table/utils/copyToClipboard.js +0 -4
- package/es/table/utils/element.d.ts +0 -0
- package/es/table/utils/element.js +14 -41
- package/es/table/utils/exportTableAsExcel.d.ts +0 -0
- package/es/table/utils/exportTableAsExcel.js +7 -43
- package/es/table/utils/getTreeDepth.d.ts +0 -0
- package/es/table/utils/getTreeDepth.js +4 -12
- package/es/table/utils/groupBy.d.ts +0 -0
- package/es/table/utils/groupBy.js +4 -13
- package/es/table/utils/index.d.ts +0 -0
- package/es/table/utils/index.js +0 -0
- package/es/table/utils/isGroupColumn.d.ts +0 -0
- package/es/table/utils/isGroupColumn.js +0 -0
- package/es/table/utils/isLeafNode.d.ts +0 -0
- package/es/table/utils/isLeafNode.js +0 -0
- package/es/table/utils/keyCode.d.ts +0 -0
- package/es/table/utils/keyCode.js +0 -0
- package/es/table/utils/layeredFilter.d.ts +0 -0
- package/es/table/utils/layeredFilter.js +0 -4
- package/es/table/utils/layeredSort.d.ts +0 -0
- package/es/table/utils/layeredSort.js +0 -5
- package/es/table/utils/makeRecursiveMapper.d.ts +0 -0
- package/es/table/utils/makeRecursiveMapper.js +4 -15
- package/es/table/utils/mergeCellProps.d.ts +0 -0
- package/es/table/utils/mergeCellProps.js +6 -14
- package/es/table/utils/others.d.ts +0 -0
- package/es/table/utils/others.js +6 -19
- package/es/table/utils/proto.d.ts +0 -0
- package/es/table/utils/proto.js +2 -30
- package/es/table/utils/selectColumn.d.ts +0 -0
- package/es/table/utils/selectColumn.js +0 -0
- package/es/table/utils/smartCompare.d.ts +0 -0
- package/es/table/utils/smartCompare.js +4 -12
- package/es/table/utils/traverseColumn.d.ts +0 -0
- package/es/table/utils/traverseColumn.js +5 -18
- package/es/table/utils/tree-data-helpers/StrictTreeDataHelper.d.ts +0 -0
- package/es/table/utils/tree-data-helpers/StrictTreeDataHelper.js +8 -30
- package/es/table/utils/tree-data-helpers/TreeDataHelper.d.ts +0 -0
- package/es/table/utils/tree-data-helpers/TreeDataHelper.js +19 -74
- package/es/table/utils/uiDegrade.d.ts +0 -0
- package/es/table/utils/uiDegrade.js +0 -5
- package/lib/_utils/arrayUtil.d.ts +0 -0
- package/lib/_utils/arrayUtil.js +2 -8
- package/lib/_utils/devwarning.d.ts +0 -0
- package/lib/_utils/devwarning.js +0 -5
- package/lib/_utils/formatUtil.d.ts +0 -0
- package/lib/_utils/formatUtil.js +36 -105
- package/lib/_utils/hooks.d.ts +0 -0
- package/lib/_utils/hooks.js +21 -56
- package/lib/_utils/index.d.ts +0 -0
- package/lib/_utils/index.js +2 -9
- package/lib/_utils/numberUtil.d.ts +0 -0
- package/lib/_utils/numberUtil.js +32 -63
- package/lib/_utils/omit.d.ts +0 -0
- package/lib/_utils/omit.js +0 -5
- package/lib/_utils/react-children.d.ts +0 -0
- package/lib/_utils/react-children.js +0 -5
- package/lib/_utils/type.d.ts +0 -0
- package/lib/_utils/type.js +3 -11
- package/lib/_utils/usePopper.d.ts +0 -0
- package/lib/_utils/usePopper.js +86 -173
- package/lib/config-provider/ConfigContext.d.ts +0 -0
- package/lib/config-provider/ConfigContext.js +2 -6
- package/lib/config-provider/compDefaultProps.d.ts +0 -0
- package/lib/config-provider/compDefaultProps.js +1 -3
- package/lib/config-provider/configProvider.d.ts +0 -0
- package/lib/config-provider/configProvider.js +6 -22
- package/lib/config-provider/defaultConfig.d.ts +0 -0
- package/lib/config-provider/defaultConfig.js +1 -7
- package/lib/config-provider/index.d.ts +0 -0
- package/lib/config-provider/index.js +1 -8
- package/lib/index.d.ts +0 -0
- package/lib/index.js +2 -8
- package/lib/locale/index.d.ts +0 -0
- package/lib/locale/index.js +3 -11
- package/lib/locale/locale.d.ts +0 -0
- package/lib/locale/locale.js +13 -69
- package/lib/locale/zh-CN.d.ts +0 -0
- package/lib/locale/zh-CN.js +1 -2
- package/lib/style/color/colors.less +0 -0
- package/lib/style/components.less +0 -0
- package/lib/style/core/index.less +0 -0
- package/lib/style/core/motion/other.less +0 -0
- package/lib/style/core/motion/slide.less +0 -0
- package/lib/style/core/motion.less +0 -0
- package/lib/style/core/reset.less +0 -0
- package/lib/style/css.js +0 -0
- package/lib/style/index.css +0 -0
- package/lib/style/index.d.ts +0 -0
- package/lib/style/index.js +0 -0
- package/lib/style/index.less +0 -0
- package/lib/style/mixins/index.less +0 -0
- package/lib/style/mixins/overlay.less +0 -0
- package/lib/style/mixins/reset.less +0 -0
- package/lib/style/themes/default.less +0 -0
- package/lib/style/themes/index.less +0 -0
- package/lib/table/base/calculations.d.ts +0 -0
- package/lib/table/base/calculations.js +25 -86
- package/lib/table/base/colgroup.d.ts +0 -0
- package/lib/table/base/colgroup.js +0 -5
- package/lib/table/base/empty.d.ts +0 -0
- package/lib/table/base/empty.js +8 -20
- package/lib/table/base/header.d.ts +0 -0
- package/lib/table/base/header.js +21 -86
- package/lib/table/base/helpers/SpanManager.d.ts +0 -0
- package/lib/table/base/helpers/SpanManager.js +6 -16
- package/lib/table/base/helpers/TableDOMUtils.d.ts +0 -0
- package/lib/table/base/helpers/TableDOMUtils.js +9 -37
- package/lib/table/base/helpers/__test__/SpanManager.test.d.ts +0 -0
- package/lib/table/base/helpers/__test__/SpanManager.test.js +2 -4
- package/lib/table/base/helpers/__test__/TableDOMUtils.test.d.ts +0 -0
- package/lib/table/base/helpers/__test__/TableDOMUtils.test.js +0 -5
- package/lib/table/base/helpers/__test__/rowHeightManager.test.d.ts +0 -0
- package/lib/table/base/helpers/__test__/rowHeightManager.test.js +0 -1
- package/lib/table/base/helpers/getRichVisibleRectsStream.d.ts +0 -0
- package/lib/table/base/helpers/getRichVisibleRectsStream.js +15 -65
- package/lib/table/base/helpers/rowHeightManager.d.ts +0 -0
- package/lib/table/base/helpers/rowHeightManager.js +0 -33
- package/lib/table/base/html-table.d.ts +0 -0
- package/lib/table/base/html-table.js +17 -49
- package/lib/table/base/index.d.ts +0 -0
- package/lib/table/base/index.js +0 -2
- package/lib/table/base/interfaces.d.ts +0 -0
- package/lib/table/base/interfaces.js +0 -0
- package/lib/table/base/loading.d.ts +0 -0
- package/lib/table/base/loading.js +8 -14
- package/lib/table/base/renderTemplates.d.ts +0 -0
- package/lib/table/base/renderTemplates.js +44 -75
- package/lib/table/base/styles.d.ts +0 -0
- package/lib/table/base/styles.js +9 -37
- package/lib/table/base/table.d.ts +0 -0
- package/lib/table/base/table.js +122 -243
- package/lib/table/base/utils.d.ts +0 -0
- package/lib/table/base/utils.js +27 -109
- package/lib/table/common-views.d.ts +0 -0
- package/lib/table/common-views.js +4 -24
- package/lib/table/index.d.ts +0 -0
- package/lib/table/index.js +0 -13
- package/lib/table/interfaces.d.ts +0 -0
- package/lib/table/interfaces.js +0 -0
- package/lib/table/internals.d.ts +0 -0
- package/lib/table/internals.js +2 -17
- package/lib/table/pipeline/features/autoFill.d.ts +0 -0
- package/lib/table/pipeline/features/autoFill.js +14 -53
- package/lib/table/pipeline/features/autoRowSpan.d.ts +0 -0
- package/lib/table/pipeline/features/autoRowSpan.js +1 -19
- package/lib/table/pipeline/features/buildTree.d.ts +0 -0
- package/lib/table/pipeline/features/buildTree.js +0 -2
- package/lib/table/pipeline/features/colGroupExtendable.d.ts +0 -0
- package/lib/table/pipeline/features/colGroupExtendable.js +6 -35
- package/lib/table/pipeline/features/columnDrag.d.ts +0 -0
- package/lib/table/pipeline/features/columnDrag.js +41 -103
- package/lib/table/pipeline/features/columnFilter.d.ts +0 -0
- package/lib/table/pipeline/features/columnFilter.js +12 -65
- package/lib/table/pipeline/features/columnHover.d.ts +0 -0
- package/lib/table/pipeline/features/columnHover.js +1 -11
- package/lib/table/pipeline/features/columnRangeHover.d.ts +0 -0
- package/lib/table/pipeline/features/columnRangeHover.js +1 -13
- package/lib/table/pipeline/features/columnResizeWidth.d.ts +0 -0
- package/lib/table/pipeline/features/columnResizeWidth.js +18 -63
- package/lib/table/pipeline/features/contextMenu.d.ts +0 -0
- package/lib/table/pipeline/features/contextMenu.js +24 -121
- package/lib/table/pipeline/features/filter/DefaultFilterContent.d.ts +0 -0
- package/lib/table/pipeline/features/filter/DefaultFilterContent.js +17 -52
- package/lib/table/pipeline/features/filter/DefaultFilterIcon.d.ts +0 -0
- package/lib/table/pipeline/features/filter/DefaultFilterIcon.js +1 -4
- package/lib/table/pipeline/features/filter/Filter.d.ts +0 -0
- package/lib/table/pipeline/features/filter/Filter.js +29 -76
- package/lib/table/pipeline/features/filter/FilterPanel.d.ts +0 -0
- package/lib/table/pipeline/features/filter/FilterPanel.js +14 -44
- package/lib/table/pipeline/features/filter/index.d.ts +0 -0
- package/lib/table/pipeline/features/filter/index.js +0 -5
- package/lib/table/pipeline/features/filter/util.d.ts +0 -0
- package/lib/table/pipeline/features/filter/util.js +2 -10
- package/lib/table/pipeline/features/footerDataSource.d.ts +0 -0
- package/lib/table/pipeline/features/footerDataSource.js +1 -12
- package/lib/table/pipeline/features/index.d.ts +0 -0
- package/lib/table/pipeline/features/index.js +0 -23
- package/lib/table/pipeline/features/mergeCellHover.d.ts +0 -0
- package/lib/table/pipeline/features/mergeCellHover.js +0 -5
- package/lib/table/pipeline/features/multiSelect.d.ts +0 -0
- package/lib/table/pipeline/features/multiSelect.js +15 -71
- package/lib/table/pipeline/features/rangeSelection.d.ts +0 -0
- package/lib/table/pipeline/features/rangeSelection.js +76 -175
- package/lib/table/pipeline/features/rowDetail.d.ts +0 -0
- package/lib/table/pipeline/features/rowDetail.js +4 -67
- package/lib/table/pipeline/features/rowDrag.d.ts +0 -0
- package/lib/table/pipeline/features/rowDrag.js +41 -93
- package/lib/table/pipeline/features/rowGrouping.d.ts +0 -0
- package/lib/table/pipeline/features/rowGrouping.js +4 -57
- package/lib/table/pipeline/features/singleSelect.d.ts +0 -0
- package/lib/table/pipeline/features/singleSelect.js +0 -34
- package/lib/table/pipeline/features/sort.d.ts +0 -0
- package/lib/table/pipeline/features/sort.js +37 -115
- package/lib/table/pipeline/features/tips.d.ts +0 -0
- package/lib/table/pipeline/features/tips.js +4 -19
- package/lib/table/pipeline/features/treeMode.d.ts +0 -0
- package/lib/table/pipeline/features/treeMode.js +15 -72
- package/lib/table/pipeline/features/treeSelect.d.ts +0 -0
- package/lib/table/pipeline/features/treeSelect.js +2 -36
- package/lib/table/pipeline/index.d.ts +0 -0
- package/lib/table/pipeline/index.js +2 -10
- package/lib/table/pipeline/pipeline.d.ts +0 -0
- package/lib/table/pipeline/pipeline.js +13 -64
- package/lib/table/pivot/cross-table/buildCrossTable.d.ts +0 -0
- package/lib/table/pivot/cross-table/buildCrossTable.js +21 -83
- package/lib/table/pivot/cross-table/constants.d.ts +0 -0
- package/lib/table/pivot/cross-table/constants.js +1 -2
- package/lib/table/pivot/cross-table/cross-table.d.ts +0 -0
- package/lib/table/pivot/cross-table/cross-table.js +25 -42
- package/lib/table/pivot/cross-table/index.d.ts +0 -0
- package/lib/table/pivot/cross-table/index.js +0 -4
- package/lib/table/pivot/cross-table/interfaces.d.ts +0 -0
- package/lib/table/pivot/cross-table/interfaces.js +0 -0
- package/lib/table/pivot/cross-table/internals.d.ts +0 -0
- package/lib/table/pivot/cross-table/internals.js +0 -0
- package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.d.ts +0 -0
- package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.js +22 -70
- package/lib/table/pivot/cross-tree-table/cross-tree-table.d.ts +0 -0
- package/lib/table/pivot/cross-tree-table/cross-tree-table.js +37 -73
- package/lib/table/pivot/cross-tree-table/index.d.ts +0 -0
- package/lib/table/pivot/cross-tree-table/index.js +0 -3
- package/lib/table/pivot/pivot-utils/buildDrillTree.d.ts +0 -0
- package/lib/table/pivot/pivot-utils/buildDrillTree.js +10 -29
- package/lib/table/pivot/pivot-utils/builders.d.ts +0 -0
- package/lib/table/pivot/pivot-utils/builders.js +34 -85
- package/lib/table/pivot/pivot-utils/convert-utils.d.ts +0 -0
- package/lib/table/pivot/pivot-utils/convert-utils.js +16 -60
- package/lib/table/pivot/pivot-utils/index.d.ts +0 -0
- package/lib/table/pivot/pivot-utils/index.js +0 -7
- package/lib/table/pivot/pivot-utils/interfaces.d.ts +0 -0
- package/lib/table/pivot/pivot-utils/interfaces.js +0 -0
- package/lib/table/pivot/pivot-utils/simpleEncode.d.ts +0 -0
- package/lib/table/pivot/pivot-utils/simpleEncode.js +0 -2
- package/lib/table/style/css.js +0 -1
- package/lib/table/style/index.css +0 -0
- package/lib/table/style/index.d.ts +0 -0
- package/lib/table/style/index.js +0 -1
- package/lib/table/style/index.less +0 -0
- package/lib/table/transforms/autoRowSpan.d.ts +0 -0
- package/lib/table/transforms/autoRowSpan.js +1 -21
- package/lib/table/transforms/autoWidth.d.ts +0 -0
- package/lib/table/transforms/autoWidth.js +15 -58
- package/lib/table/transforms/buildTree.d.ts +0 -0
- package/lib/table/transforms/buildTree.js +1 -4
- package/lib/table/transforms/columnHover.d.ts +0 -0
- package/lib/table/transforms/columnHover.js +9 -22
- package/lib/table/transforms/columnRangeHover.d.ts +0 -0
- package/lib/table/transforms/columnRangeHover.js +12 -27
- package/lib/table/transforms/columnResize.d.ts +0 -0
- package/lib/table/transforms/columnResize.js +20 -63
- package/lib/table/transforms/flatten.d.ts +0 -0
- package/lib/table/transforms/flatten.js +0 -5
- package/lib/table/transforms/index.d.ts +0 -0
- package/lib/table/transforms/index.js +0 -12
- package/lib/table/transforms/orderField.d.ts +0 -0
- package/lib/table/transforms/orderField.js +0 -7
- package/lib/table/transforms/sort.d.ts +0 -0
- package/lib/table/transforms/sort.js +44 -127
- package/lib/table/transforms/tips.d.ts +0 -0
- package/lib/table/transforms/tips.js +5 -20
- package/lib/table/transforms/treeMode.d.ts +0 -0
- package/lib/table/transforms/treeMode.js +38 -106
- package/lib/table/transforms/visible.d.ts +0 -0
- package/lib/table/transforms/visible.js +0 -7
- package/lib/table/transforms/warnTransformsDeprecated.d.ts +0 -0
- package/lib/table/transforms/warnTransformsDeprecated.js +0 -4
- package/lib/table/use/useResizeObserver.d.ts +0 -0
- package/lib/table/use/useResizeObserver.js +2 -10
- package/lib/table/utils/applyTransforms.d.ts +0 -0
- package/lib/table/utils/applyTransforms.js +0 -2
- package/lib/table/utils/browserType.d.ts +0 -0
- package/lib/table/utils/browserType.js +19 -24
- package/lib/table/utils/buildTree.d.ts +0 -0
- package/lib/table/utils/buildTree.js +7 -33
- package/lib/table/utils/collectNodes.d.ts +0 -0
- package/lib/table/utils/collectNodes.js +4 -18
- package/lib/table/utils/console.d.ts +0 -0
- package/lib/table/utils/console.js +2 -19
- package/lib/table/utils/copyToClipboard.d.ts +0 -0
- package/lib/table/utils/copyToClipboard.js +1 -8
- package/lib/table/utils/element.d.ts +0 -0
- package/lib/table/utils/element.js +14 -46
- package/lib/table/utils/exportTableAsExcel.d.ts +0 -0
- package/lib/table/utils/exportTableAsExcel.js +7 -52
- package/lib/table/utils/getTreeDepth.d.ts +0 -0
- package/lib/table/utils/getTreeDepth.js +4 -17
- package/lib/table/utils/groupBy.d.ts +0 -0
- package/lib/table/utils/groupBy.js +4 -17
- package/lib/table/utils/index.d.ts +0 -0
- package/lib/table/utils/index.js +0 -22
- package/lib/table/utils/isGroupColumn.d.ts +0 -0
- package/lib/table/utils/isGroupColumn.js +0 -3
- package/lib/table/utils/isLeafNode.d.ts +0 -0
- package/lib/table/utils/isLeafNode.js +0 -1
- package/lib/table/utils/keyCode.d.ts +0 -0
- package/lib/table/utils/keyCode.js +1 -2
- package/lib/table/utils/layeredFilter.d.ts +0 -0
- package/lib/table/utils/layeredFilter.js +0 -10
- package/lib/table/utils/layeredSort.d.ts +0 -0
- package/lib/table/utils/layeredSort.js +0 -10
- package/lib/table/utils/makeRecursiveMapper.d.ts +0 -0
- package/lib/table/utils/makeRecursiveMapper.js +4 -24
- package/lib/table/utils/mergeCellProps.d.ts +0 -0
- package/lib/table/utils/mergeCellProps.js +6 -18
- package/lib/table/utils/others.d.ts +0 -0
- package/lib/table/utils/others.js +7 -36
- package/lib/table/utils/proto.d.ts +0 -0
- package/lib/table/utils/proto.js +3 -35
- package/lib/table/utils/selectColumn.d.ts +0 -0
- package/lib/table/utils/selectColumn.js +2 -5
- package/lib/table/utils/smartCompare.d.ts +0 -0
- package/lib/table/utils/smartCompare.js +4 -13
- package/lib/table/utils/traverseColumn.d.ts +0 -0
- package/lib/table/utils/traverseColumn.js +5 -25
- package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.d.ts +0 -0
- package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.js +10 -41
- package/lib/table/utils/tree-data-helpers/TreeDataHelper.d.ts +0 -0
- package/lib/table/utils/tree-data-helpers/TreeDataHelper.js +21 -90
- package/lib/table/utils/uiDegrade.d.ts +0 -0
- package/lib/table/utils/uiDegrade.js +1 -8
- package/package.json +1 -1
|
@@ -57,34 +57,27 @@ export function getEventPath(event) {
|
|
|
57
57
|
// Firefox supports composePath
|
|
58
58
|
return event.composedPath();
|
|
59
59
|
}
|
|
60
|
-
|
|
61
60
|
return createEventPath(event);
|
|
62
61
|
}
|
|
63
|
-
|
|
64
62
|
function createEventPath(event) {
|
|
65
63
|
var res = [];
|
|
66
64
|
var pointer = event.target;
|
|
67
|
-
|
|
68
65
|
while (pointer) {
|
|
69
66
|
res.push(pointer);
|
|
70
67
|
pointer = pointer.parentElement;
|
|
71
68
|
}
|
|
72
|
-
|
|
73
69
|
return res;
|
|
74
70
|
}
|
|
75
|
-
|
|
76
71
|
;
|
|
77
72
|
/**
|
|
78
73
|
* 获取点击事件是否发生在元素内部
|
|
79
74
|
* @param ele
|
|
80
75
|
* @param event
|
|
81
76
|
*/
|
|
82
|
-
|
|
83
77
|
export function isElementInEventPath(ele, event) {
|
|
84
78
|
if (!ele || !event) {
|
|
85
79
|
return false;
|
|
86
80
|
}
|
|
87
|
-
|
|
88
81
|
var path = getEventPath(event);
|
|
89
82
|
return path.indexOf(ele) >= 0;
|
|
90
83
|
}
|
|
@@ -93,21 +86,16 @@ export function isElementInEventPath(ele, event) {
|
|
|
93
86
|
* @param path
|
|
94
87
|
* @param isTargetCb
|
|
95
88
|
*/
|
|
96
|
-
|
|
97
89
|
export function getTargetEleInEventPath(path, isTargetCb) {
|
|
98
90
|
var target;
|
|
99
91
|
var l = 0;
|
|
100
|
-
|
|
101
92
|
while (!target && l < path.length) {
|
|
102
93
|
var ele = path[l];
|
|
103
|
-
|
|
104
94
|
if (isTargetCb(ele)) {
|
|
105
95
|
target = ele;
|
|
106
96
|
}
|
|
107
|
-
|
|
108
97
|
l++;
|
|
109
98
|
}
|
|
110
|
-
|
|
111
99
|
return target;
|
|
112
100
|
}
|
|
113
101
|
/**
|
|
@@ -115,7 +103,6 @@ export function getTargetEleInEventPath(path, isTargetCb) {
|
|
|
115
103
|
* @param event
|
|
116
104
|
* @param popupParent
|
|
117
105
|
*/
|
|
118
|
-
|
|
119
106
|
export function calculatePointerRelative(event, popupParent) {
|
|
120
107
|
var parentRect = popupParent.getBoundingClientRect();
|
|
121
108
|
var documentRect = document.documentElement.getBoundingClientRect();
|
|
@@ -129,7 +116,6 @@ export function calculatePointerRelative(event, popupParent) {
|
|
|
129
116
|
* @param event
|
|
130
117
|
* @param popupParent
|
|
131
118
|
*/
|
|
132
|
-
|
|
133
119
|
export function calculatePopupRelative(trigger, popupParent, offset) {
|
|
134
120
|
var triggerRect = trigger.getBoundingClientRect();
|
|
135
121
|
var parent = popupParent === document.body ? document.documentElement : popupParent;
|
|
@@ -139,48 +125,39 @@ export function calculatePopupRelative(trigger, popupParent, offset) {
|
|
|
139
125
|
y: triggerRect.top - parentRect.top - (offset ? offset.y : 0)
|
|
140
126
|
};
|
|
141
127
|
}
|
|
142
|
-
|
|
143
128
|
function getPerfectX(_ref) {
|
|
144
129
|
var x = _ref.x,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
130
|
+
maxX = _ref.maxX,
|
|
131
|
+
width = _ref.width,
|
|
132
|
+
isPerfectX = _ref.isPerfectX;
|
|
149
133
|
if (isPerfectX && Math.max(x, 0) > Math.abs(maxX)) {
|
|
150
134
|
//看左侧空间是否足够
|
|
151
135
|
var parentAvailableWidth = x;
|
|
152
|
-
|
|
153
136
|
if (width <= parentAvailableWidth) {
|
|
154
137
|
return x - width; //空间足够,往左侧偏移
|
|
155
138
|
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
139
|
+
}
|
|
140
|
+
//目前位置,最大支持的位置
|
|
159
141
|
return Math.min(Math.max(x, 0), Math.abs(maxX));
|
|
160
142
|
}
|
|
161
|
-
|
|
162
143
|
function getPerfectY(_ref2) {
|
|
163
144
|
var y = _ref2.y,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
145
|
+
maxY = _ref2.maxY,
|
|
146
|
+
height = _ref2.height,
|
|
147
|
+
scrollTop = _ref2.scrollTop,
|
|
148
|
+
isBody = _ref2.isBody,
|
|
149
|
+
isPerfectY = _ref2.isPerfectY;
|
|
170
150
|
if (isPerfectY && Math.max(y, 0) > Math.abs(maxY)) {
|
|
171
151
|
//看下上方空间是否足够
|
|
172
152
|
var parentAvailableHeight = isBody ? y - scrollTop : y;
|
|
173
|
-
|
|
174
153
|
if (height <= parentAvailableHeight) {
|
|
175
154
|
//上方空间足够,向上展示
|
|
176
155
|
return y - height;
|
|
177
156
|
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
157
|
+
}
|
|
158
|
+
//目前位置,最大支持的位置
|
|
181
159
|
return Math.min(Math.max(y, 0), Math.abs(maxY));
|
|
182
160
|
}
|
|
183
|
-
|
|
184
161
|
export function keepWithinBounds(popupParent, popup, x, y, isPerfect) {
|
|
185
162
|
var parentRect = popupParent.getBoundingClientRect();
|
|
186
163
|
var docElement = document.documentElement;
|
|
@@ -189,14 +166,12 @@ export function keepWithinBounds(popupParent, popup, x, y, isPerfect) {
|
|
|
189
166
|
var parentAvailableWidth = parentRect.width;
|
|
190
167
|
var parentAvailableHeight = parentRect.height;
|
|
191
168
|
var isBody = popupParent === document.body;
|
|
192
|
-
|
|
193
169
|
if (isBody) {
|
|
194
170
|
//ducument的宽度减去 父元素到document边界的的宽度,就是剩余可显示的宽度
|
|
195
|
-
parentAvailableWidth = docRect.width - Math.abs(docRect.left - parentRect.left);
|
|
196
|
-
|
|
171
|
+
parentAvailableWidth = docRect.width - Math.abs(docRect.left - parentRect.left);
|
|
172
|
+
//ducument的高度加上滚动条的高度减去 父元素到document边界的的宽度,就是剩余可显示的高度
|
|
197
173
|
parentAvailableHeight = docRect.height + docElement.scrollTop - Math.abs(docRect.top - parentRect.top);
|
|
198
174
|
}
|
|
199
|
-
|
|
200
175
|
if (x) {
|
|
201
176
|
var width = popupRect.width;
|
|
202
177
|
var maxX = parentAvailableWidth - width;
|
|
@@ -207,7 +182,6 @@ export function keepWithinBounds(popupParent, popup, x, y, isPerfect) {
|
|
|
207
182
|
isPerfectX: isPerfect
|
|
208
183
|
});
|
|
209
184
|
}
|
|
210
|
-
|
|
211
185
|
if (y) {
|
|
212
186
|
var height = popupRect.height;
|
|
213
187
|
var maxY = parentAvailableHeight - height;
|
|
@@ -220,7 +194,6 @@ export function keepWithinBounds(popupParent, popup, x, y, isPerfect) {
|
|
|
220
194
|
isPerfectY: isPerfect
|
|
221
195
|
});
|
|
222
196
|
}
|
|
223
|
-
|
|
224
197
|
return {
|
|
225
198
|
x: x,
|
|
226
199
|
y: y
|
|
File without changes
|
|
@@ -4,23 +4,17 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
4
4
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
5
5
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
6
6
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
function _unsupportedIterableToArray(o, minLen) { var _context2; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context2 = Object.prototype.toString.call(o)).call(_context2, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
-
|
|
12
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
13
|
-
|
|
7
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
8
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context2; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context2 = {}.toString.call(r)).call(_context2, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
10
|
import SpanManager from '../base/helpers/SpanManager';
|
|
15
11
|
import { internals } from '../internals';
|
|
16
12
|
import collectNodes from './collectNodes';
|
|
17
13
|
import getTreeDepth from './getTreeDepth';
|
|
18
14
|
import isLeafNode from './isLeafNode';
|
|
19
|
-
|
|
20
15
|
function safeGetSpanRect(column, record, rowIndex, colIndex) {
|
|
21
16
|
var colSpan = 1;
|
|
22
17
|
var rowSpan = 1;
|
|
23
|
-
|
|
24
18
|
if (column.getSpanRect) {
|
|
25
19
|
var value = internals.safeGetValue(column, record, rowIndex);
|
|
26
20
|
var spanRect = column.getSpanRect(value, record, rowIndex);
|
|
@@ -28,17 +22,14 @@ function safeGetSpanRect(column, record, rowIndex, colIndex) {
|
|
|
28
22
|
rowSpan = spanRect == null ? 1 : spanRect.bottom - rowIndex;
|
|
29
23
|
} else {
|
|
30
24
|
var cellProps = internals.safeGetCellProps(column, record, rowIndex);
|
|
31
|
-
|
|
32
25
|
if (cellProps.colSpan != null) {
|
|
33
26
|
colSpan = cellProps.colSpan;
|
|
34
27
|
}
|
|
35
|
-
|
|
36
28
|
if (cellProps.rowSpan != null) {
|
|
37
29
|
rowSpan = cellProps.rowSpan;
|
|
38
30
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
}
|
|
32
|
+
// 注意这里没有考虑「rowSpan/colSpan 不能过大,避免 rowSpan/colSpan 影响因虚拟滚动而未渲染的单元格」
|
|
42
33
|
return {
|
|
43
34
|
top: rowIndex,
|
|
44
35
|
bottom: rowIndex + rowSpan,
|
|
@@ -46,16 +37,14 @@ function safeGetSpanRect(column, record, rowIndex, colIndex) {
|
|
|
46
37
|
right: colIndex + colSpan
|
|
47
38
|
};
|
|
48
39
|
}
|
|
49
|
-
|
|
50
40
|
function move(_ref, dx, dy) {
|
|
51
41
|
var c = _ref.c,
|
|
52
|
-
|
|
42
|
+
r = _ref.r;
|
|
53
43
|
return {
|
|
54
44
|
c: c + dx,
|
|
55
45
|
r: r + dy
|
|
56
46
|
};
|
|
57
47
|
}
|
|
58
|
-
|
|
59
48
|
function sanitizeCellDatum(value) {
|
|
60
49
|
if (value === Infinity || value === -Infinity || typeof value === 'number' && isNaN(value)) {
|
|
61
50
|
return null;
|
|
@@ -64,8 +53,6 @@ function sanitizeCellDatum(value) {
|
|
|
64
53
|
}
|
|
65
54
|
}
|
|
66
55
|
/** 根据 BaseTable 的 dataSource 和 column,将表格数据导出为 Excel 文件 */
|
|
67
|
-
|
|
68
|
-
|
|
69
56
|
export default function exportTableAsExcel(xlsxPackage, dataSource, columns, filename) {
|
|
70
57
|
var sheet = xlsxPackage.utils.aoa_to_sheet([]);
|
|
71
58
|
var topHeaderHeight = getTreeDepth(columns) + 1;
|
|
@@ -81,30 +68,22 @@ export default function exportTableAsExcel(xlsxPackage, dataSource, columns, fil
|
|
|
81
68
|
Sheet1: sheet
|
|
82
69
|
}
|
|
83
70
|
}, filename);
|
|
84
|
-
|
|
85
71
|
function addTopHeaders(origin) {
|
|
86
72
|
dfs(columns, 0, 0);
|
|
87
|
-
|
|
88
73
|
function dfs(cols, startDx, startDy) {
|
|
89
74
|
var _a;
|
|
90
|
-
|
|
91
75
|
var start = move(origin, startDx, startDy);
|
|
92
76
|
var offsetX = 0;
|
|
93
|
-
|
|
94
77
|
var _iterator = _createForOfIteratorHelper(cols),
|
|
95
|
-
|
|
96
|
-
|
|
78
|
+
_step;
|
|
97
79
|
try {
|
|
98
80
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
99
81
|
var col = _step.value;
|
|
100
|
-
|
|
101
82
|
if ((_a = col.features) === null || _a === void 0 ? void 0 : _a.noExport) {
|
|
102
83
|
continue;
|
|
103
84
|
}
|
|
104
|
-
|
|
105
85
|
var current = move(start, offsetX, 0);
|
|
106
86
|
addOne(col.name, current);
|
|
107
|
-
|
|
108
87
|
if (isLeafNode(col)) {
|
|
109
88
|
offsetX += 1;
|
|
110
89
|
mergeCells(current, 1, topHeaderHeight - startDy);
|
|
@@ -119,66 +98,51 @@ export default function exportTableAsExcel(xlsxPackage, dataSource, columns, fil
|
|
|
119
98
|
} finally {
|
|
120
99
|
_iterator.f();
|
|
121
100
|
}
|
|
122
|
-
|
|
123
101
|
return offsetX;
|
|
124
102
|
}
|
|
125
103
|
}
|
|
126
|
-
|
|
127
104
|
function addDataPart(origin) {
|
|
128
105
|
var _context;
|
|
129
|
-
|
|
130
106
|
var leafColumns = _filterInstanceProperty(_context = collectNodes(columns, 'leaf-only')).call(_context, function (col) {
|
|
131
107
|
var _a;
|
|
132
|
-
|
|
133
108
|
return !((_a = col.features) === null || _a === void 0 ? void 0 : _a.noExport);
|
|
134
109
|
});
|
|
135
|
-
|
|
136
110
|
var spanManager = new SpanManager();
|
|
137
|
-
|
|
138
111
|
var dataPart = _mapInstanceProperty(dataSource).call(dataSource, function (record, rowIndex) {
|
|
139
112
|
spanManager.stripUpwards(rowIndex);
|
|
140
113
|
return _mapInstanceProperty(leafColumns).call(leafColumns, function (col, colIndex) {
|
|
141
114
|
if (spanManager.testSkip(rowIndex, colIndex)) {
|
|
142
115
|
return null;
|
|
143
116
|
}
|
|
144
|
-
|
|
145
117
|
var spanRect = safeGetSpanRect(col, record, rowIndex, colIndex);
|
|
146
118
|
var rowSpan = spanRect.bottom - spanRect.top;
|
|
147
119
|
var colSpan = spanRect.right - spanRect.left;
|
|
148
|
-
|
|
149
120
|
if (rowSpan > 1 || colSpan > 1) {
|
|
150
121
|
spanManager.add(spanRect.top, spanRect.left, colSpan, rowSpan);
|
|
151
122
|
mergeCells(move(origin, spanRect.left, spanRect.top), colSpan, rowSpan);
|
|
152
123
|
}
|
|
153
|
-
|
|
154
124
|
return sanitizeCellDatum(internals.safeGetValue(col, record, rowIndex));
|
|
155
125
|
});
|
|
156
126
|
});
|
|
157
|
-
|
|
158
127
|
add(dataPart, origin);
|
|
159
128
|
}
|
|
160
|
-
|
|
161
129
|
function add(data, origin) {
|
|
162
130
|
xlsxPackage.utils.sheet_add_aoa(sheet, data, {
|
|
163
131
|
origin: origin
|
|
164
132
|
});
|
|
165
133
|
}
|
|
166
|
-
|
|
167
134
|
function addOne(datum, origin) {
|
|
168
135
|
xlsxPackage.utils.sheet_add_aoa(sheet, [[datum]], {
|
|
169
136
|
origin: origin
|
|
170
137
|
});
|
|
171
138
|
}
|
|
172
|
-
|
|
173
139
|
function mergeCells(addr, width, height) {
|
|
174
140
|
if (width === 1 && height === 1) {
|
|
175
141
|
return;
|
|
176
142
|
}
|
|
177
|
-
|
|
178
143
|
if (sheet['!merges'] == null) {
|
|
179
144
|
sheet['!merges'] = [];
|
|
180
145
|
}
|
|
181
|
-
|
|
182
146
|
sheet['!merges'].push({
|
|
183
147
|
s: addr,
|
|
184
148
|
e: move(addr, width - 1, height - 1)
|
|
File without changes
|
|
@@ -2,29 +2,21 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
2
2
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
3
3
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
4
4
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
function _unsupportedIterableToArray(o, minLen) { var _context; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
-
|
|
10
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11
|
-
|
|
5
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
6
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context = {}.toString.call(r)).call(_context, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
7
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
8
|
import isLeafNode from './isLeafNode';
|
|
13
9
|
/** 获取一棵树的高度/深度 (0-based) */
|
|
14
|
-
|
|
15
10
|
export default function getTreeDepth(nodes) {
|
|
16
11
|
var maxDepth = -1;
|
|
17
12
|
dfs(nodes, 0);
|
|
18
13
|
return maxDepth;
|
|
19
|
-
|
|
20
14
|
function dfs(columns, depth) {
|
|
21
15
|
var _iterator = _createForOfIteratorHelper(columns),
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
_step;
|
|
24
17
|
try {
|
|
25
18
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
26
19
|
var column = _step.value;
|
|
27
|
-
|
|
28
20
|
if (isLeafNode(column)) {
|
|
29
21
|
maxDepth = Math.max(maxDepth, depth);
|
|
30
22
|
} else {
|
|
File without changes
|
|
@@ -2,28 +2,20 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
2
2
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
3
3
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
4
4
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
function _unsupportedIterableToArray(o, minLen) { var _context; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
-
|
|
10
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11
|
-
|
|
5
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
6
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context = {}.toString.call(r)).call(_context, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
7
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
8
|
export default function groupBy(list, iteratee) {
|
|
13
9
|
var groups = {};
|
|
14
|
-
|
|
15
10
|
var _iterator = _createForOfIteratorHelper(list),
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
_step;
|
|
18
12
|
try {
|
|
19
13
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
20
14
|
var item = _step.value;
|
|
21
15
|
var key = iteratee(item);
|
|
22
|
-
|
|
23
16
|
if (groups[key] == null) {
|
|
24
17
|
groups[key] = [];
|
|
25
18
|
}
|
|
26
|
-
|
|
27
19
|
groups[key].push(item);
|
|
28
20
|
}
|
|
29
21
|
} catch (err) {
|
|
@@ -31,6 +23,5 @@ export default function groupBy(list, iteratee) {
|
|
|
31
23
|
} finally {
|
|
32
24
|
_iterator.f();
|
|
33
25
|
}
|
|
34
|
-
|
|
35
26
|
return groups;
|
|
36
27
|
}
|
|
File without changes
|
package/es/table/utils/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -4,19 +4,15 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
|
|
|
4
4
|
import isLeafNode from './isLeafNode';
|
|
5
5
|
export default function layeredFilter(array, filter) {
|
|
6
6
|
return dfs(array);
|
|
7
|
-
|
|
8
7
|
function dfs(rows) {
|
|
9
8
|
var _context;
|
|
10
|
-
|
|
11
9
|
if (!Array.isArray(array)) {
|
|
12
10
|
return array;
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
return _filterInstanceProperty(_context = _mapInstanceProperty(rows).call(rows, function (row) {
|
|
16
13
|
if (isLeafNode(row)) {
|
|
17
14
|
return row;
|
|
18
15
|
}
|
|
19
|
-
|
|
20
16
|
return _extends(_extends({}, row), {
|
|
21
17
|
children: dfs(row.children)
|
|
22
18
|
});
|
|
File without changes
|
|
@@ -5,22 +5,17 @@ import isLeafNode from './isLeafNode';
|
|
|
5
5
|
/** 对树状结构的数据进行排序.
|
|
6
6
|
* layeredSort 是一个递归的过程,针对树上的每一个父节点,该函数都会重新对其子节点数组(children) 进行排序.
|
|
7
7
|
* */
|
|
8
|
-
|
|
9
8
|
export default function layeredSort(array, compare) {
|
|
10
9
|
return dfs(array);
|
|
11
|
-
|
|
12
10
|
function dfs(rows) {
|
|
13
11
|
var _context;
|
|
14
|
-
|
|
15
12
|
if (!Array.isArray(array)) {
|
|
16
13
|
return array;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
return _sortInstanceProperty(_context = _mapInstanceProperty(rows).call(rows, function (row) {
|
|
20
16
|
if (isLeafNode(row)) {
|
|
21
17
|
return row;
|
|
22
18
|
}
|
|
23
|
-
|
|
24
19
|
return _extends(_extends({}, row), {
|
|
25
20
|
children: dfs(row.children)
|
|
26
21
|
});
|
|
File without changes
|
|
@@ -4,32 +4,24 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
4
4
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
5
5
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
6
6
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
function _unsupportedIterableToArray(o, minLen) { var _context; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
-
|
|
12
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
13
|
-
|
|
7
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
8
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context = {}.toString.call(r)).call(_context, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
10
|
import isLeafNode from './isLeafNode';
|
|
15
11
|
export default function makeRecursiveMapper(fn) {
|
|
16
12
|
return function (tree) {
|
|
17
13
|
return dfs(tree, 0, []).result;
|
|
18
|
-
|
|
19
14
|
function dfs(nodes, parentStartIndex, path) {
|
|
20
15
|
var flatCount = 0;
|
|
21
16
|
var result = [];
|
|
22
|
-
|
|
23
17
|
var _iterator = _createForOfIteratorHelper(nodes),
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
_step;
|
|
26
19
|
try {
|
|
27
20
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
28
21
|
var node = _step.value;
|
|
29
22
|
path.push(node);
|
|
30
23
|
var startIndex = parentStartIndex + flatCount;
|
|
31
24
|
var subResult = void 0;
|
|
32
|
-
|
|
33
25
|
if (isLeafNode(node)) {
|
|
34
26
|
subResult = fn(node, {
|
|
35
27
|
// parentStartIndex,
|
|
@@ -51,13 +43,11 @@ export default function makeRecursiveMapper(fn) {
|
|
|
51
43
|
});
|
|
52
44
|
flatCount += dfsResult.flatCount;
|
|
53
45
|
}
|
|
54
|
-
|
|
55
46
|
if (Array.isArray(subResult)) {
|
|
56
47
|
result.push.apply(result, _toConsumableArray(subResult));
|
|
57
48
|
} else if (subResult != null) {
|
|
58
49
|
result.push(subResult);
|
|
59
50
|
}
|
|
60
|
-
|
|
61
51
|
path.pop();
|
|
62
52
|
}
|
|
63
53
|
} catch (err) {
|
|
@@ -65,7 +55,6 @@ export default function makeRecursiveMapper(fn) {
|
|
|
65
55
|
} finally {
|
|
66
56
|
_iterator.f();
|
|
67
57
|
}
|
|
68
|
-
|
|
69
58
|
return {
|
|
70
59
|
result: result,
|
|
71
60
|
flatCount: flatCount
|
|
File without changes
|
|
@@ -2,12 +2,12 @@ import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
|
2
2
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
3
3
|
import _Object$keys2 from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
4
4
|
import cx from 'classnames';
|
|
5
|
-
|
|
6
5
|
function composeEventHandler(handler1, handler2) {
|
|
7
6
|
return function () {
|
|
8
7
|
// 先执行原有的事件回调函数
|
|
9
8
|
handler1.apply(void 0, arguments);
|
|
10
|
-
handler2.apply(void 0, arguments);
|
|
9
|
+
handler2.apply(void 0, arguments);
|
|
10
|
+
// 事件回调函数没有返回值,故这里不进行 return
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
/** 合并两个 cellProps(单元格属性)对象,返回一个合并后的全新对象。
|
|
@@ -16,29 +16,23 @@ function composeEventHandler(handler1, handler2) {
|
|
|
16
16
|
* * 对于 数字、字符串、布尔值类型的字段,extra 中的字段值将直接覆盖 base 中的字段值(className 是个特例,会进行字符串拼接)
|
|
17
17
|
* * 对于函数/方法类型的字段(对应单元格的事件回调函数),mergeCellProps 将生成一个新的函数,新函数将按序调用 base 和 extra 中的方法
|
|
18
18
|
* * 对于普通对象类型的字段(对应单元格的样式),mergeCellProps 将合并两个对象 */
|
|
19
|
-
|
|
20
|
-
|
|
21
19
|
export default function mergeCellProps(base, extra) {
|
|
22
20
|
if (base == null) {
|
|
23
21
|
return extra;
|
|
24
22
|
}
|
|
25
|
-
|
|
26
23
|
if (extra == null) {
|
|
27
24
|
return base;
|
|
28
25
|
}
|
|
29
|
-
|
|
30
26
|
var result = _extends({}, base);
|
|
31
|
-
|
|
32
27
|
for (var _i = 0, _Object$keys = _Object$keys2(extra); _i < _Object$keys.length; _i++) {
|
|
33
28
|
var key = _Object$keys[_i];
|
|
34
29
|
var value = extra[key];
|
|
35
|
-
|
|
36
30
|
var type = _typeof(value);
|
|
37
|
-
|
|
38
31
|
if (value === null) {
|
|
39
32
|
// value=null 时 覆盖原来的值
|
|
40
33
|
result[key] = null;
|
|
41
|
-
} else if (value === undefined) {
|
|
34
|
+
} else if (value === undefined) {
|
|
35
|
+
// value=undefined 时 保留原来的值
|
|
42
36
|
} else if (type === 'number' || type === 'string' || type === 'boolean') {
|
|
43
37
|
if (key === 'className') {
|
|
44
38
|
result[key] = cx(result[key], value);
|
|
@@ -47,7 +41,6 @@ export default function mergeCellProps(base, extra) {
|
|
|
47
41
|
}
|
|
48
42
|
} else if (type === 'function') {
|
|
49
43
|
var prev = result[key];
|
|
50
|
-
|
|
51
44
|
if (prev == null) {
|
|
52
45
|
result[key] = value;
|
|
53
46
|
} else {
|
|
@@ -55,9 +48,8 @@ export default function mergeCellProps(base, extra) {
|
|
|
55
48
|
}
|
|
56
49
|
} else if (type === 'object') {
|
|
57
50
|
result[key] = _extends({}, result[key], value);
|
|
58
|
-
}
|
|
59
|
-
|
|
51
|
+
}
|
|
52
|
+
// else `type` is 'bigint' or 'symbol', `value` is an invalid cellProp, ignore it
|
|
60
53
|
}
|
|
61
|
-
|
|
62
54
|
return result;
|
|
63
55
|
}
|
|
File without changes
|