@kdcloudjs/table 1.2.1-canary.6 → 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 +4588 -5991
- 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 +73 -152
- 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 +12 -19
- 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 +75 -173
- 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 +14 -23
- 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
|
@@ -1,56 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _flatMapInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flat-map");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.rowDetail = rowDetail;
|
|
11
|
-
|
|
12
9
|
var _toArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toArray"));
|
|
13
|
-
|
|
14
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
15
|
-
|
|
16
11
|
var _extends4 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
17
|
-
|
|
18
12
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toConsumableArray"));
|
|
19
|
-
|
|
20
13
|
var _symbol = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/symbol"));
|
|
21
|
-
|
|
22
14
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
23
|
-
|
|
24
15
|
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
25
|
-
|
|
26
16
|
var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
|
|
27
|
-
|
|
28
17
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
29
|
-
|
|
30
18
|
var _findIndex = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find-index"));
|
|
31
|
-
|
|
32
19
|
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
33
|
-
|
|
34
20
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
35
|
-
|
|
36
21
|
var _react = _interopRequireDefault(require("react"));
|
|
37
|
-
|
|
38
22
|
var _commonViews = require("../../common-views");
|
|
39
|
-
|
|
40
23
|
var _internals = require("../../internals");
|
|
41
|
-
|
|
42
24
|
var _utils = require("../../utils");
|
|
43
|
-
|
|
44
25
|
var _others = require("../../utils/others");
|
|
45
|
-
|
|
46
26
|
var _console = _interopRequireDefault(require("../../utils/console"));
|
|
47
|
-
|
|
48
27
|
var _renderTemplates = _interopRequireDefault(require("../../base/renderTemplates"));
|
|
49
|
-
|
|
50
28
|
var _base = require("../../base");
|
|
51
|
-
|
|
52
29
|
var rowDetailSymbol = (0, _symbol.default)('row-detail');
|
|
53
|
-
|
|
54
30
|
var fallbackRenderDetail = function fallbackRenderDetail() {
|
|
55
31
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
56
32
|
style: {
|
|
@@ -62,14 +38,11 @@ var fallbackRenderDetail = function fallbackRenderDetail() {
|
|
|
62
38
|
}
|
|
63
39
|
}, "\u8BBE\u7F6E ", /*#__PURE__*/_react.default.createElement("code", null, "rowDetail.renderDetail"), " \u6765\u81EA\u5B9A\u4E49\u8BE6\u60C5\u5185\u5BB9"));
|
|
64
40
|
};
|
|
65
|
-
|
|
66
41
|
function rowDetail() {
|
|
67
42
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
68
43
|
return function rowDetailStep(pipeline) {
|
|
69
44
|
var _context, _context2;
|
|
70
|
-
|
|
71
45
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
72
|
-
|
|
73
46
|
var stateKey = 'rowDetail';
|
|
74
47
|
var rowDetailMetaKey = (_a = opts.rowDetailMetaKey) !== null && _a !== void 0 ? _a : rowDetailSymbol;
|
|
75
48
|
var primaryKey = pipeline.ensurePrimaryKey('rowDetail');
|
|
@@ -84,33 +57,26 @@ function rowDetail() {
|
|
|
84
57
|
var openKeys = (_h = (_g = (_f = opts.openKeys) !== null && _f !== void 0 ? _f : pipeline.getStateAtKey(stateKey)) !== null && _g !== void 0 ? _g : opts.defaultOpenAll ? (0, _map.default)(_context = (0, _filter.default)(_context2 = pipeline.getDataSource()).call(_context2, hasDetail)).call(_context, function (row, rowIndex) {
|
|
85
58
|
return _internals.internals.safeGetRowKey(primaryKey, row, rowIndex);
|
|
86
59
|
}) : opts.defaultOpenKeys) !== null && _h !== void 0 ? _h : [];
|
|
87
|
-
|
|
88
60
|
var onChangeOpenKeys = function onChangeOpenKeys(nextKeys, key, action) {
|
|
89
61
|
var _a;
|
|
90
|
-
|
|
91
62
|
(_a = opts.onChangeOpenKeys) === null || _a === void 0 ? void 0 : _a.call(opts, nextKeys, key, action);
|
|
92
63
|
pipeline.setStateAtKey(stateKey, nextKeys, {
|
|
93
64
|
key: key,
|
|
94
65
|
action: action
|
|
95
66
|
});
|
|
96
67
|
};
|
|
97
|
-
|
|
98
68
|
var openKeySet = new _set.default(openKeys);
|
|
99
|
-
|
|
100
69
|
var toggle = function toggle(rowKey) {
|
|
101
70
|
var expanded = openKeySet.has(rowKey);
|
|
102
|
-
|
|
103
71
|
if (expanded) {
|
|
104
72
|
onChangeOpenKeys((0, _filter.default)(openKeys).call(openKeys, function (key) {
|
|
105
73
|
return key !== rowKey;
|
|
106
74
|
}), rowKey, 'collapse');
|
|
107
75
|
} else {
|
|
108
76
|
var _context3;
|
|
109
|
-
|
|
110
77
|
onChangeOpenKeys((0, _concat.default)(_context3 = []).call(_context3, (0, _toConsumableArray2.default)(openKeys), [rowKey]), rowKey, 'expand');
|
|
111
78
|
}
|
|
112
79
|
};
|
|
113
|
-
|
|
114
80
|
var detailPrimaryKey = typeof primaryKey === 'string' ? primaryKey : rowDetailMetaKey.toString() + 'PrimaryKey';
|
|
115
81
|
return pipeline.dataSource((0, _flatMapInstanceProperty(_others))(pipeline.getDataSource(), function (row, rowIndex) {
|
|
116
82
|
if (openKeySet.has(_internals.internals.safeGetRowKey(primaryKey, row, rowIndex))) {
|
|
@@ -126,35 +92,27 @@ function rowDetail() {
|
|
|
126
92
|
};
|
|
127
93
|
}
|
|
128
94
|
});
|
|
129
|
-
|
|
130
95
|
function processColumns(columns) {
|
|
131
96
|
if (columns.length === 0) {
|
|
132
97
|
return columns;
|
|
133
98
|
}
|
|
134
|
-
|
|
135
99
|
var expandColumnIndex = 0;
|
|
136
|
-
|
|
137
100
|
if (opts.expandColumnCode) {
|
|
138
101
|
expandColumnIndex = (0, _findIndex.default)(columns).call(columns, function (col) {
|
|
139
102
|
return col.code === opts.expandColumnCode;
|
|
140
103
|
});
|
|
141
|
-
|
|
142
104
|
if (expandColumnIndex < 0) {
|
|
143
105
|
_console.default.warn('没找到可展开的列,请检查设置的展开列code');
|
|
144
|
-
|
|
145
106
|
return columns;
|
|
146
107
|
}
|
|
147
108
|
}
|
|
148
|
-
|
|
149
109
|
var expandCol = columns[expandColumnIndex];
|
|
150
110
|
var tableColumns = (0, _toConsumableArray2.default)(columns);
|
|
151
|
-
|
|
152
111
|
var render = function render(value, row, rowIndex) {
|
|
153
112
|
if (row[rowDetailMetaKey]) {
|
|
154
113
|
// 第一列内容已经渲染
|
|
155
114
|
if (expandColumnIndex !== 0) return;
|
|
156
115
|
var renderRowDetail = (0, _renderTemplates.default)('rowDetail');
|
|
157
|
-
|
|
158
116
|
if (typeof renderRowDetail === 'function') {
|
|
159
117
|
return renderRowDetail({
|
|
160
118
|
row: row,
|
|
@@ -163,12 +121,9 @@ function rowDetail() {
|
|
|
163
121
|
renderDetail: renderDetail
|
|
164
122
|
});
|
|
165
123
|
}
|
|
166
|
-
|
|
167
124
|
return renderDetail(row, rowIndex);
|
|
168
125
|
}
|
|
169
|
-
|
|
170
126
|
var content = _internals.internals.safeRender(expandCol, row, rowIndex);
|
|
171
|
-
|
|
172
127
|
if (!hasDetail(row, rowIndex)) {
|
|
173
128
|
return /*#__PURE__*/_react.default.createElement(_commonViews.InlineFlexCell, {
|
|
174
129
|
style: {
|
|
@@ -176,19 +131,14 @@ function rowDetail() {
|
|
|
176
131
|
}
|
|
177
132
|
}, content);
|
|
178
133
|
}
|
|
179
|
-
|
|
180
134
|
var rowKey = _internals.internals.safeGetRowKey(primaryKey, row, rowIndex);
|
|
181
|
-
|
|
182
135
|
var expanded = openKeySet.has(rowKey);
|
|
183
|
-
|
|
184
136
|
var onClick = function onClick(e) {
|
|
185
137
|
if (opts.stopClickEventPropagation) {
|
|
186
138
|
e.stopPropagation();
|
|
187
139
|
}
|
|
188
|
-
|
|
189
140
|
toggle(rowKey);
|
|
190
141
|
};
|
|
191
|
-
|
|
192
142
|
var expandCls = expanded ? _base.Classes.expanded : _base.Classes.collapsed;
|
|
193
143
|
var ExpandIcon = opts.expandIcon;
|
|
194
144
|
return /*#__PURE__*/_react.default.createElement(_commonViews.ExpansionCell, {
|
|
@@ -210,10 +160,8 @@ function rowDetail() {
|
|
|
210
160
|
onClick: clickArea === 'icon' ? onClick : undefined
|
|
211
161
|
}), content);
|
|
212
162
|
};
|
|
213
|
-
|
|
214
163
|
var getCellProps = function getCellProps(value, row, rowIndex) {
|
|
215
164
|
var _a;
|
|
216
|
-
|
|
217
165
|
if (row[rowDetailMetaKey]) {
|
|
218
166
|
return {
|
|
219
167
|
style: (0, _extends4.default)({
|
|
@@ -222,19 +170,15 @@ function rowDetail() {
|
|
|
222
170
|
}, opts.detailCellStyle)
|
|
223
171
|
};
|
|
224
172
|
}
|
|
225
|
-
|
|
226
173
|
var prevProps = (_a = expandCol.getCellProps) === null || _a === void 0 ? void 0 : _a.call(expandCol, value, row, rowIndex);
|
|
227
|
-
|
|
228
174
|
if (!hasDetail(row, rowIndex)) {
|
|
229
175
|
return prevProps;
|
|
230
176
|
}
|
|
231
|
-
|
|
232
177
|
return (0, _utils.mergeCellProps)(prevProps, {
|
|
233
178
|
onClick: function onClick(e) {
|
|
234
179
|
if (opts.stopClickEventPropagation) {
|
|
235
180
|
e.stopPropagation();
|
|
236
181
|
}
|
|
237
|
-
|
|
238
182
|
toggle(_internals.internals.safeGetRowKey(primaryKey, row, rowIndex));
|
|
239
183
|
},
|
|
240
184
|
style: {
|
|
@@ -242,15 +186,12 @@ function rowDetail() {
|
|
|
242
186
|
}
|
|
243
187
|
});
|
|
244
188
|
};
|
|
245
|
-
|
|
246
189
|
var _tableColumns = (0, _toArray2.default)(tableColumns),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
190
|
+
firstCol = _tableColumns[0],
|
|
191
|
+
others = (0, _slice.default)(_tableColumns).call(_tableColumns, 1);
|
|
250
192
|
var firstColRender = function firstColRender(value, row, rowIndex) {
|
|
251
193
|
if (row[rowDetailMetaKey]) {
|
|
252
194
|
var renderRowDetail = (0, _renderTemplates.default)('rowDetail');
|
|
253
|
-
|
|
254
195
|
if (typeof renderRowDetail === 'function') {
|
|
255
196
|
return renderRowDetail({
|
|
256
197
|
row: row,
|
|
@@ -259,15 +200,11 @@ function rowDetail() {
|
|
|
259
200
|
renderDetail: renderDetail
|
|
260
201
|
});
|
|
261
202
|
}
|
|
262
|
-
|
|
263
203
|
return renderDetail(row, rowIndex);
|
|
264
204
|
}
|
|
265
|
-
|
|
266
205
|
var content = _internals.internals.safeRender(firstCol, row, rowIndex);
|
|
267
|
-
|
|
268
206
|
return content;
|
|
269
207
|
};
|
|
270
|
-
|
|
271
208
|
tableColumns[0] = (0, _extends4.default)((0, _extends4.default)({}, firstCol), {
|
|
272
209
|
render: firstColRender,
|
|
273
210
|
getSpanRect: function getSpanRect(value, row, rowIndex) {
|
|
@@ -283,12 +220,12 @@ function rowDetail() {
|
|
|
283
220
|
}
|
|
284
221
|
});
|
|
285
222
|
tableColumns[expandColumnIndex] = (0, _extends4.default)((0, _extends4.default)({}, expandCol), {
|
|
286
|
-
title: /*#__PURE__*/_react.default.createElement("div", {
|
|
223
|
+
title: ( /*#__PURE__*/_react.default.createElement("div", {
|
|
287
224
|
style: {
|
|
288
225
|
display: 'inline-block',
|
|
289
226
|
marginLeft: textOffset
|
|
290
227
|
}
|
|
291
|
-
}, _internals.internals.safeRenderHeader(expandCol)),
|
|
228
|
+
}, _internals.internals.safeRenderHeader(expandCol))),
|
|
292
229
|
render: render,
|
|
293
230
|
getCellProps: clickArea === 'cell' ? getCellProps : expandCol.getCellProps,
|
|
294
231
|
getSpanRect: function getSpanRect(value, row, rowIndex) {
|
|
File without changes
|
|
@@ -1,38 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
4
|
-
|
|
5
4
|
var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/map");
|
|
6
|
-
|
|
7
5
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
8
|
-
|
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
9
|
exports.ROW_DRAG_COLUMN_CODE = void 0;
|
|
13
10
|
exports.rowDrag = rowDrag;
|
|
14
11
|
exports.rowDragKey = void 0;
|
|
15
|
-
|
|
16
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
17
|
-
|
|
18
13
|
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
19
|
-
|
|
20
14
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
21
|
-
|
|
22
15
|
var _react = _interopRequireDefault(require("react"));
|
|
23
|
-
|
|
24
16
|
var _rxjs = require("rxjs");
|
|
25
|
-
|
|
26
17
|
var _operators = require("rxjs/operators");
|
|
27
|
-
|
|
28
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
29
|
-
|
|
30
19
|
var _styles = require("../../base/styles");
|
|
31
|
-
|
|
32
|
-
var
|
|
33
|
-
exports.ROW_DRAG_COLUMN_CODE = ROW_DRAG_COLUMN_CODE;
|
|
34
|
-
var rowDragKey = 'rowDragKey';
|
|
35
|
-
exports.rowDragKey = rowDragKey;
|
|
20
|
+
var ROW_DRAG_COLUMN_CODE = exports.ROW_DRAG_COLUMN_CODE = '$_row_drag_column_&';
|
|
21
|
+
var rowDragKey = exports.rowDragKey = 'rowDragKey';
|
|
36
22
|
var SCROLL_OFFSET = 30;
|
|
37
23
|
var defaultRowDragColumn = {
|
|
38
24
|
name: '拖拽列',
|
|
@@ -60,47 +46,38 @@ var defaultRowDragColumn = {
|
|
|
60
46
|
}));
|
|
61
47
|
}
|
|
62
48
|
};
|
|
63
|
-
|
|
64
49
|
function rowDrag(opt) {
|
|
65
50
|
return function rowDragStep(pipeline) {
|
|
66
51
|
var _context;
|
|
67
|
-
|
|
68
52
|
var tableBody = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.tableBody;
|
|
69
53
|
var artTable = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.artTable;
|
|
70
54
|
if (!tableBody) return pipeline;
|
|
71
55
|
var dataSource = pipeline.getDataSource();
|
|
72
56
|
var rowHeight = (opt === null || opt === void 0 ? void 0 : opt.rowHeight) || 48;
|
|
73
|
-
|
|
74
57
|
var handleDragStrat = function handleDragStrat(event) {
|
|
75
|
-
var _a;
|
|
76
|
-
|
|
77
|
-
|
|
58
|
+
var _a;
|
|
59
|
+
// 开始拖拽
|
|
78
60
|
artTable.classList.add((0, _classnames.default)(_styles.Classes.rowDragging));
|
|
79
61
|
(_a = opt === null || opt === void 0 ? void 0 : opt.onDragStart) === null || _a === void 0 ? void 0 : _a.call(opt, event);
|
|
80
62
|
};
|
|
81
|
-
|
|
82
63
|
var handleDragMove = function handleDragMove(event) {
|
|
83
64
|
var _a;
|
|
84
|
-
|
|
85
65
|
(_a = opt === null || opt === void 0 ? void 0 : opt.onDragMove) === null || _a === void 0 ? void 0 : _a.call(opt, event);
|
|
86
66
|
pipeline.setStateAtKey(rowDragKey, event);
|
|
87
67
|
};
|
|
88
|
-
|
|
89
68
|
var handleDragEnd = function handleDragEnd(event, isValid) {
|
|
90
69
|
var _a;
|
|
91
|
-
|
|
92
70
|
artTable.classList.remove((0, _classnames.default)(_styles.Classes.rowDragging));
|
|
93
|
-
pipeline.setStateAtKey(rowDragKey, event);
|
|
94
|
-
|
|
71
|
+
pipeline.setStateAtKey(rowDragKey, event);
|
|
72
|
+
// 超出拖拽范围不触发dragend事件
|
|
95
73
|
if (isValid) {
|
|
96
74
|
(_a = opt === null || opt === void 0 ? void 0 : opt.onDragEnd) === null || _a === void 0 ? void 0 : _a.call(opt, event);
|
|
97
75
|
}
|
|
98
76
|
};
|
|
99
|
-
|
|
100
77
|
var getDragEvent = function getDragEvent(startRowInfo, endRowInfo, _ref) {
|
|
101
78
|
var isFinished = _ref.isFinished,
|
|
102
|
-
|
|
103
|
-
|
|
79
|
+
_ref$dragPosition = _ref.dragPosition,
|
|
80
|
+
dragPosition = _ref$dragPosition === void 0 ? 'bottom' : _ref$dragPosition;
|
|
104
81
|
return {
|
|
105
82
|
startRowIndex: startRowInfo.rowIndex,
|
|
106
83
|
startRow: startRowInfo.row,
|
|
@@ -110,31 +87,26 @@ function rowDrag(opt) {
|
|
|
110
87
|
isFinished: isFinished
|
|
111
88
|
};
|
|
112
89
|
};
|
|
113
|
-
|
|
114
90
|
var updateScrollPosition = function updateScrollPosition(mouseMoveEvent) {
|
|
115
91
|
if (opt === null || opt === void 0 ? void 0 : opt.suppressScrollMove) return;
|
|
116
92
|
var clientY = mouseMoveEvent.clientY;
|
|
117
93
|
var tableBodyClientRect = tableBody.getBoundingClientRect();
|
|
118
94
|
var top = tableBodyClientRect.top,
|
|
119
|
-
|
|
120
|
-
|
|
95
|
+
height = tableBodyClientRect.height;
|
|
121
96
|
if (clientY + SCROLL_OFFSET >= top + height) {
|
|
122
97
|
pipeline.ref.current.domHelper.tableBody.scrollTop += SCROLL_OFFSET;
|
|
123
98
|
}
|
|
124
|
-
|
|
125
99
|
if (clientY + SCROLL_OFFSET <= top) {
|
|
126
100
|
pipeline.ref.current.domHelper.tableBody.scrollTop -= SCROLL_OFFSET;
|
|
127
101
|
}
|
|
128
102
|
};
|
|
129
|
-
|
|
130
103
|
var onMouseDown = function onMouseDown(mouseDownEvent) {
|
|
131
104
|
var _a;
|
|
132
|
-
|
|
133
105
|
var startRowInfo = getTargetRowInfo(mouseDownEvent.target, tableBody, dataSource);
|
|
134
106
|
var endRowInfo = startRowInfo;
|
|
135
107
|
if (!startRowInfo || startRowInfo.code !== rowDragColumn.code) return;
|
|
136
|
-
if ((_a = opt === null || opt === void 0 ? void 0 : opt.isDisabled) === null || _a === void 0 ? void 0 : _a.call(opt, startRowInfo.row, startRowInfo.rowIndex)) return;
|
|
137
|
-
|
|
108
|
+
if ((_a = opt === null || opt === void 0 ? void 0 : opt.isDisabled) === null || _a === void 0 ? void 0 : _a.call(opt, startRowInfo.row, startRowInfo.rowIndex)) return;
|
|
109
|
+
// 默认拖拽插入的位置是向下
|
|
138
110
|
var dragPosition = 'bottom';
|
|
139
111
|
var isOutOfRange = false;
|
|
140
112
|
var isValidDrag = false;
|
|
@@ -144,12 +116,12 @@ function rowDrag(opt) {
|
|
|
144
116
|
});
|
|
145
117
|
handleDragStrat(dragStartEvent);
|
|
146
118
|
var tableWidth = tableBody.clientWidth;
|
|
147
|
-
var startRowRects = startRowInfo.cell.getBoundingClientRect();
|
|
148
|
-
|
|
119
|
+
var startRowRects = startRowInfo.cell.getBoundingClientRect();
|
|
120
|
+
// 光标位置距离初始拖拽行的偏移量
|
|
149
121
|
var mouseDownClientY = mouseDownEvent.clientY;
|
|
150
122
|
var startOffset = mouseDownEvent.clientY - startRowRects.top;
|
|
151
|
-
var dragElement = createDragElement(startRowRects, tableWidth, rowHeight);
|
|
152
|
-
|
|
123
|
+
var dragElement = createDragElement(startRowRects, tableWidth, rowHeight);
|
|
124
|
+
// 可拖拽的范围
|
|
153
125
|
var dragRange = getDragRange(tableBody, {
|
|
154
126
|
startOffset: startOffset,
|
|
155
127
|
rowHeight: rowHeight
|
|
@@ -160,7 +132,6 @@ function rowDrag(opt) {
|
|
|
160
132
|
};
|
|
161
133
|
var mousemove$ = (0, _rxjs.fromEvent)(window, 'mousemove');
|
|
162
134
|
var mouseup$ = (0, _rxjs.fromEvent)(window, 'mouseup');
|
|
163
|
-
|
|
164
135
|
var scrollCallback = function scrollCallback(event) {
|
|
165
136
|
// 在当前表格内滚动不处理
|
|
166
137
|
if (event.target === tableBody) return;
|
|
@@ -171,27 +142,23 @@ function rowDrag(opt) {
|
|
|
171
142
|
var isOutOfRange = isOutOfDragRange(mousePosition, dragRange);
|
|
172
143
|
updateCurSorStyle(isOutOfRange);
|
|
173
144
|
};
|
|
174
|
-
|
|
175
145
|
document.addEventListener('scroll', scrollCallback, true);
|
|
176
146
|
var rowDrag$ = mousemove$.pipe((0, _filterInstanceProperty(_operators))(function (mouseMoveEvent) {
|
|
177
|
-
var mouseMoveClientY = mouseMoveEvent.clientY;
|
|
178
|
-
|
|
147
|
+
var mouseMoveClientY = mouseMoveEvent.clientY;
|
|
148
|
+
// 上下移动偏移量大于5才是有效的拖拽
|
|
179
149
|
if (Math.abs(mouseMoveClientY - mouseDownClientY) > 5) {
|
|
180
150
|
isValidDrag = true;
|
|
181
151
|
}
|
|
182
|
-
|
|
183
152
|
return isValidDrag;
|
|
184
153
|
}), (0, _mapInstanceProperty(_operators))(function (mouseMoveEvent) {
|
|
185
154
|
var clientX = mouseMoveEvent.clientX,
|
|
186
|
-
|
|
155
|
+
clientY = mouseMoveEvent.clientY;
|
|
187
156
|
var tagretRow = getTargetRowInfo(mouseMoveEvent.target, tableBody, dataSource);
|
|
188
|
-
|
|
189
157
|
if (tagretRow) {
|
|
190
158
|
endRowInfo = tagretRow;
|
|
191
159
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
160
|
+
var targetRowRects = endRowInfo.cell.getBoundingClientRect();
|
|
161
|
+
// 判断拖拽插入的位置,拖拽框上边框位于目标行之上则向上插入,否则向下插入
|
|
195
162
|
var isMoveToTop = clientY - startOffset < targetRowRects.top;
|
|
196
163
|
dragPosition = isMoveToTop ? 'top' : 'bottom';
|
|
197
164
|
isOutOfRange = isOutOfDragRange({
|
|
@@ -203,7 +170,6 @@ function rowDrag(opt) {
|
|
|
203
170
|
y: clientY
|
|
204
171
|
};
|
|
205
172
|
updateScrollPosition(mouseMoveEvent); // 拖拽到底时让滚动条可以滚动
|
|
206
|
-
|
|
207
173
|
updateDragElementPosition(dragElement, dragRange, {
|
|
208
174
|
x: clientX,
|
|
209
175
|
y: clientY,
|
|
@@ -219,8 +185,8 @@ function rowDrag(opt) {
|
|
|
219
185
|
rowDrag$.subscribe({
|
|
220
186
|
next: function next(_ref2) {
|
|
221
187
|
var startRowInfo = _ref2.startRowInfo,
|
|
222
|
-
|
|
223
|
-
|
|
188
|
+
endRowInfo = _ref2.endRowInfo,
|
|
189
|
+
dragPosition = _ref2.dragPosition;
|
|
224
190
|
var dragMoveEvent = getDragEvent(startRowInfo, endRowInfo, {
|
|
225
191
|
isFinished: false,
|
|
226
192
|
dragPosition: dragPosition
|
|
@@ -240,7 +206,6 @@ function rowDrag(opt) {
|
|
|
240
206
|
}
|
|
241
207
|
});
|
|
242
208
|
};
|
|
243
|
-
|
|
244
209
|
var rowDragColumn = (opt === null || opt === void 0 ? void 0 : opt.rowDragColumn) || defaultRowDragColumn;
|
|
245
210
|
pipeline.setFeatureOptions('rowDragColumnKey', rowDragColumn.code);
|
|
246
211
|
var nextColumns = (0, _slice.default)(_context = pipeline.getColumns()).call(_context);
|
|
@@ -250,16 +215,14 @@ function rowDrag(opt) {
|
|
|
250
215
|
onMouseDown: onMouseDown
|
|
251
216
|
});
|
|
252
217
|
pipeline.appendRowPropsGetter(function (row, rowIndex) {
|
|
253
|
-
var _cx;
|
|
254
|
-
|
|
255
218
|
var rowDragEvent = pipeline.getStateAtKey(rowDragKey) || {};
|
|
256
219
|
var startRowIndex = rowDragEvent.startRowIndex,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
220
|
+
endRowIndex = rowDragEvent.endRowIndex,
|
|
221
|
+
isFinished = rowDragEvent.isFinished,
|
|
222
|
+
dragPosition = rowDragEvent.dragPosition;
|
|
260
223
|
var isFooterCell = row[pipeline.getFeatureOptions('footerRowMetaKey')];
|
|
261
224
|
if (isFooterCell || isFinished || rowIndex !== startRowIndex && rowIndex !== endRowIndex) return;
|
|
262
|
-
var className = (0, _classnames.default)((
|
|
225
|
+
var className = (0, _classnames.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _styles.Classes.rowDragStart, rowIndex === startRowIndex), _styles.Classes.rowDragEnd, rowIndex === endRowIndex), _styles.Classes.rowDragEndToTop, rowIndex === endRowIndex && dragPosition === 'top'), _styles.Classes.rowDragEndToBottom, rowIndex === endRowIndex && dragPosition === 'bottom'));
|
|
263
226
|
return {
|
|
264
227
|
className: className
|
|
265
228
|
};
|
|
@@ -267,7 +230,6 @@ function rowDrag(opt) {
|
|
|
267
230
|
return pipeline;
|
|
268
231
|
};
|
|
269
232
|
}
|
|
270
|
-
|
|
271
233
|
function getTargetRowInfo(target, tableBody, record) {
|
|
272
234
|
while (target && tableBody.contains(target)) {
|
|
273
235
|
if (target.getAttribute('data-role') === 'table-cell') {
|
|
@@ -283,41 +245,33 @@ function getTargetRowInfo(target, tableBody, record) {
|
|
|
283
245
|
cell: target
|
|
284
246
|
};
|
|
285
247
|
}
|
|
286
|
-
|
|
287
248
|
target = target.parentElement;
|
|
288
249
|
}
|
|
289
|
-
|
|
290
250
|
return null;
|
|
291
251
|
}
|
|
292
|
-
|
|
293
252
|
function isEleInFooter(target) {
|
|
294
253
|
while (target && !target.classList.contains(_styles.Classes.artTable)) {
|
|
295
254
|
if (target.classList.contains(_styles.Classes.tableFooter)) {
|
|
296
255
|
return true;
|
|
297
256
|
}
|
|
298
|
-
|
|
299
257
|
target = target.parentElement;
|
|
300
258
|
}
|
|
301
|
-
|
|
302
259
|
return false;
|
|
303
260
|
}
|
|
304
|
-
|
|
305
261
|
function createDragElement(rects, tableWidth, rowHeight) {
|
|
306
262
|
var _context2, _context3, _context4;
|
|
307
|
-
|
|
308
263
|
var x = rects.x,
|
|
309
|
-
|
|
264
|
+
y = rects.y;
|
|
310
265
|
var dragMoveElement = document.createElement('div');
|
|
311
266
|
dragMoveElement.className = (0, _classnames.default)(_styles.Classes.rowDragElement);
|
|
312
267
|
dragMoveElement.style.cssText = (0, _concat.default)(_context2 = (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "position:fixed;z-index:9999;left:".concat(x, "px;top:")).call(_context4, y, "px;pointer-events:none;width:")).call(_context3, tableWidth, "px;height:")).call(_context2, rowHeight, "px;background:var(--primary-color);opacity: 0.1;");
|
|
313
268
|
document.body.appendChild(dragMoveElement);
|
|
314
269
|
return dragMoveElement;
|
|
315
270
|
}
|
|
316
|
-
|
|
317
271
|
function updateDragElementPosition(element, dragRange, _ref3) {
|
|
318
272
|
var x = _ref3.x,
|
|
319
|
-
|
|
320
|
-
|
|
273
|
+
y = _ref3.y,
|
|
274
|
+
startOffset = _ref3.startOffset;
|
|
321
275
|
var validPosition = getValidPosition({
|
|
322
276
|
x: x,
|
|
323
277
|
y: y
|
|
@@ -325,11 +279,9 @@ function updateDragElementPosition(element, dragRange, _ref3) {
|
|
|
325
279
|
element.style.top = validPosition.y - startOffset + 'px';
|
|
326
280
|
return element;
|
|
327
281
|
}
|
|
328
|
-
|
|
329
282
|
function removeDragElement(element) {
|
|
330
283
|
document.body.removeChild(element);
|
|
331
284
|
}
|
|
332
|
-
|
|
333
285
|
function updateCurSorStyle(isOutOfRange) {
|
|
334
286
|
if (isOutOfRange) {
|
|
335
287
|
document.body.style.cursor = 'no-drop';
|
|
@@ -337,19 +289,17 @@ function updateCurSorStyle(isOutOfRange) {
|
|
|
337
289
|
document.body.style.cursor = 'move';
|
|
338
290
|
}
|
|
339
291
|
}
|
|
340
|
-
|
|
341
292
|
function removeCurSorStyle() {
|
|
342
293
|
document.body.style.cursor = 'default';
|
|
343
294
|
}
|
|
344
|
-
|
|
345
295
|
function getDragRange(tableBody, _ref4) {
|
|
346
296
|
var startOffset = _ref4.startOffset,
|
|
347
|
-
|
|
297
|
+
rowHeight = _ref4.rowHeight;
|
|
348
298
|
var tableBodyClientRect = tableBody.getBoundingClientRect();
|
|
349
299
|
var height = tableBodyClientRect.height,
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
300
|
+
width = tableBodyClientRect.width,
|
|
301
|
+
top = tableBodyClientRect.top,
|
|
302
|
+
left = tableBodyClientRect.left;
|
|
353
303
|
return {
|
|
354
304
|
minX: left,
|
|
355
305
|
maxX: left + width,
|
|
@@ -357,14 +307,13 @@ function getDragRange(tableBody, _ref4) {
|
|
|
357
307
|
maxY: top + height + startOffset
|
|
358
308
|
};
|
|
359
309
|
}
|
|
360
|
-
|
|
361
310
|
function getValidPosition(position, dragRange) {
|
|
362
311
|
var x = position.x,
|
|
363
|
-
|
|
312
|
+
y = position.y;
|
|
364
313
|
var minX = dragRange.minX,
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
314
|
+
maxX = dragRange.maxX,
|
|
315
|
+
minY = dragRange.minY,
|
|
316
|
+
maxY = dragRange.maxY;
|
|
368
317
|
var newX = x < minX ? minX : x > maxX ? maxX : x;
|
|
369
318
|
var newY = y < minY ? minY : y > maxY ? maxY : y;
|
|
370
319
|
return {
|
|
@@ -372,13 +321,12 @@ function getValidPosition(position, dragRange) {
|
|
|
372
321
|
y: newY
|
|
373
322
|
};
|
|
374
323
|
}
|
|
375
|
-
|
|
376
324
|
function isOutOfDragRange(position, dragRange) {
|
|
377
325
|
var x = position.x,
|
|
378
|
-
|
|
326
|
+
y = position.y;
|
|
379
327
|
var minX = dragRange.minX,
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
328
|
+
maxX = dragRange.maxX,
|
|
329
|
+
minY = dragRange.minY,
|
|
330
|
+
maxY = dragRange.maxY;
|
|
383
331
|
return x > maxX || x < minX || y > maxY || y < minY;
|
|
384
332
|
}
|
|
File without changes
|