@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,26 +1,18 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
2
2
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime-corejs3/helpers/taggedTemplateLiteral";
|
|
4
|
-
|
|
5
4
|
var _templateObject;
|
|
6
|
-
|
|
7
5
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
8
6
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
9
7
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
10
|
-
|
|
11
8
|
var __rest = this && this.__rest || function (s, e) {
|
|
12
9
|
var t = {};
|
|
13
|
-
|
|
14
|
-
for (var p in s) {
|
|
15
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
16
|
-
}
|
|
17
|
-
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
18
11
|
if (s != null && typeof _Object$getOwnPropertySymbols === "function") for (var i = 0, p = _Object$getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
12
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
20
13
|
}
|
|
21
14
|
return t;
|
|
22
15
|
};
|
|
23
|
-
|
|
24
16
|
import React, { useState } from 'react';
|
|
25
17
|
import { fromEvent } from 'rxjs';
|
|
26
18
|
import * as op from 'rxjs/operators';
|
|
@@ -28,48 +20,40 @@ import styled from 'styled-components';
|
|
|
28
20
|
import { internals } from '../internals';
|
|
29
21
|
import { isLeafNode, traverseColumn } from '../utils';
|
|
30
22
|
import { warnTransformsDeprecated } from './warnTransformsDeprecated';
|
|
31
|
-
|
|
32
23
|
function clamp(min, x, max) {
|
|
33
24
|
return Math.max(min, Math.min(max, x));
|
|
34
25
|
}
|
|
35
|
-
|
|
36
26
|
var RESIZE_EXPANDER_CLS = 'resize-expander';
|
|
37
27
|
var ResizeHandle = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: -5px;\n width: 10px;\n cursor: col-resize;\n z-index: 1;\n"])));
|
|
38
28
|
/** @deprecated transform 用法已经过时,请使用 pipeline 来对表格进行拓展 */
|
|
39
|
-
|
|
40
29
|
export function makeColumnResizeTransform(_ref) {
|
|
41
30
|
var sizes = _ref.sizes,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
31
|
+
onChangeSizes = _ref.onChangeSizes,
|
|
32
|
+
_ref$minSize = _ref.minSize,
|
|
33
|
+
minSize = _ref$minSize === void 0 ? 40 : _ref$minSize,
|
|
34
|
+
_ref$maxSize = _ref.maxSize,
|
|
35
|
+
maxSize = _ref$maxSize === void 0 ? Infinity : _ref$maxSize,
|
|
36
|
+
appendExpander = _ref.appendExpander,
|
|
37
|
+
_ref$expanderVisibili = _ref.expanderVisibility,
|
|
38
|
+
expanderVisibility = _ref$expanderVisibili === void 0 ? 'visible' : _ref$expanderVisibili,
|
|
39
|
+
disableUserSelectWhenResizing = _ref.disableUserSelectWhenResizing;
|
|
51
40
|
warnTransformsDeprecated('makeColumnResizeTransform');
|
|
52
|
-
|
|
53
41
|
var startResize = function startResize(colIndex, e) {
|
|
54
42
|
var startX = e.clientX;
|
|
55
43
|
var startSize = sizes[colIndex];
|
|
56
44
|
var nextSizes$ = fromEvent(window, 'mousemove').pipe(op.takeUntil(fromEvent(window, 'mouseup')), op.map(function (e) {
|
|
57
45
|
var movingX = e.clientX;
|
|
58
|
-
|
|
59
46
|
var nextSizes = _sliceInstanceProperty(sizes).call(sizes);
|
|
60
|
-
|
|
61
47
|
nextSizes[colIndex] = clamp(minSize, startSize + (movingX - startX), maxSize);
|
|
62
48
|
return nextSizes;
|
|
63
49
|
}));
|
|
64
50
|
var prevUserSelect = '';
|
|
65
51
|
var docElemStyle;
|
|
66
|
-
|
|
67
52
|
if (disableUserSelectWhenResizing) {
|
|
68
53
|
docElemStyle = document.documentElement.style;
|
|
69
54
|
prevUserSelect = docElemStyle.userSelect;
|
|
70
55
|
docElemStyle.userSelect = 'none';
|
|
71
56
|
}
|
|
72
|
-
|
|
73
57
|
nextSizes$.subscribe({
|
|
74
58
|
next: onChangeSizes,
|
|
75
59
|
complete: function complete() {
|
|
@@ -79,25 +63,21 @@ export function makeColumnResizeTransform(_ref) {
|
|
|
79
63
|
}
|
|
80
64
|
});
|
|
81
65
|
};
|
|
82
|
-
|
|
83
66
|
var innerTransform = traverseColumn(function (col, _ref2) {
|
|
84
67
|
var range = _ref2.range;
|
|
85
|
-
|
|
86
68
|
var _a;
|
|
87
|
-
|
|
88
69
|
if (!isLeafNode(col)) {
|
|
89
70
|
return col;
|
|
90
71
|
}
|
|
91
|
-
|
|
92
72
|
var prevTitle = internals.safeRenderHeader(col);
|
|
93
73
|
return _extends(_extends({}, col), {
|
|
94
74
|
width: sizes[range.start],
|
|
95
|
-
title: /*#__PURE__*/React.createElement(React.Fragment, null, prevTitle, /*#__PURE__*/React.createElement(ResizeHandle, {
|
|
75
|
+
title: ( /*#__PURE__*/React.createElement(React.Fragment, null, prevTitle, /*#__PURE__*/React.createElement(ResizeHandle, {
|
|
96
76
|
className: "resize-handle",
|
|
97
77
|
onMouseDown: function onMouseDown(e) {
|
|
98
78
|
return startResize(range.start, e);
|
|
99
79
|
}
|
|
100
|
-
})),
|
|
80
|
+
}))),
|
|
101
81
|
headerCellProps: _extends(_extends({}, col.headerCellProps), {
|
|
102
82
|
style: _extends(_extends({}, (_a = col.headerCellProps) === null || _a === void 0 ? void 0 : _a.style), {
|
|
103
83
|
overflow: 'visible',
|
|
@@ -108,9 +88,8 @@ export function makeColumnResizeTransform(_ref) {
|
|
|
108
88
|
});
|
|
109
89
|
return function (input) {
|
|
110
90
|
var _innerTransform = innerTransform(input),
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
91
|
+
columns = _innerTransform.columns,
|
|
92
|
+
dataSource = _innerTransform.dataSource;
|
|
114
93
|
return {
|
|
115
94
|
columns: appendExpander ? _concatInstanceProperty(columns).call(columns, [{
|
|
116
95
|
name: '',
|
|
@@ -135,16 +114,13 @@ export function makeColumnResizeTransform(_ref) {
|
|
|
135
114
|
};
|
|
136
115
|
}
|
|
137
116
|
/** @deprecated transform 用法已经过时,请使用 pipeline 来对表格进行拓展 */
|
|
138
|
-
|
|
139
117
|
export function useColumnResizeTransform(_a) {
|
|
140
118
|
var defaultSizes = _a.defaultSizes,
|
|
141
|
-
|
|
142
|
-
|
|
119
|
+
others = __rest(_a, ["defaultSizes"]);
|
|
143
120
|
var _useState = useState(defaultSizes),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
121
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
122
|
+
sizes = _useState2[0],
|
|
123
|
+
onChangeSizes = _useState2[1];
|
|
148
124
|
return makeColumnResizeTransform(_extends({
|
|
149
125
|
sizes: sizes,
|
|
150
126
|
onChangeSizes: onChangeSizes
|
|
File without changes
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { isLeafNode, traverseColumn } from '../utils';
|
|
2
2
|
import { warnTransformsDeprecated } from './warnTransformsDeprecated';
|
|
3
3
|
/** @deprecated transform 用法已经过时,请使用 pipeline 来对表格进行拓展 */
|
|
4
|
-
|
|
5
4
|
export function makeFlattenTransform() {
|
|
6
5
|
warnTransformsDeprecated('makeFlattenTransform');
|
|
7
6
|
return traverseColumn(function (column) {
|
|
8
7
|
var _a;
|
|
9
|
-
|
|
10
8
|
if (isLeafNode(column)) {
|
|
11
9
|
return column;
|
|
12
10
|
}
|
|
13
|
-
|
|
14
11
|
return ((_a = column.features) === null || _a === void 0 ? void 0 : _a.flatten) ? column.children : column;
|
|
15
12
|
});
|
|
16
13
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,13 +2,11 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
2
2
|
import { traverseColumn } from '../utils';
|
|
3
3
|
import { warnTransformsDeprecated } from './warnTransformsDeprecated';
|
|
4
4
|
/** @deprecated transform 用法已经过时,请使用 pipeline 来对表格进行拓展 */
|
|
5
|
-
|
|
6
5
|
export function makeOrderFieldTransform() {
|
|
7
6
|
var startOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
8
7
|
warnTransformsDeprecated('makeOrderFieldTransform');
|
|
9
8
|
return traverseColumn(function (column) {
|
|
10
9
|
var _a, _b;
|
|
11
|
-
|
|
12
10
|
if (((_a = column.features) === null || _a === void 0 ? void 0 : _a.order) || ((_b = column.features) === null || _b === void 0 ? void 0 : _b.orderField)) {
|
|
13
11
|
return _extends(_extends({}, column), {
|
|
14
12
|
getValue: function getValue(record, index) {
|
|
@@ -16,7 +14,6 @@ export function makeOrderFieldTransform() {
|
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
return column;
|
|
21
18
|
});
|
|
22
19
|
}
|
|
File without changes
|
|
@@ -4,15 +4,10 @@ import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-meth
|
|
|
4
4
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
5
5
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
6
6
|
import _taggedTemplateLiteral from "@babel/runtime-corejs3/helpers/taggedTemplateLiteral";
|
|
7
|
-
|
|
8
7
|
var _templateObject;
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function _unsupportedIterableToArray(o, minLen) { var _context4; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context4 = Object.prototype.toString.call(o)).call(_context4, 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); }
|
|
13
|
-
|
|
14
|
-
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; }
|
|
15
|
-
|
|
8
|
+
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; } } }; }
|
|
9
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context4; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context4 = {}.toString.call(r)).call(_context4, 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; } }
|
|
10
|
+
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; }
|
|
16
11
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
17
12
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
18
13
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
@@ -20,32 +15,25 @@ import _Map from "@babel/runtime-corejs3/core-js-stable/map";
|
|
|
20
15
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
21
16
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
22
17
|
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
|
|
23
|
-
|
|
24
18
|
var __rest = this && this.__rest || function (s, e) {
|
|
25
19
|
var t = {};
|
|
26
|
-
|
|
27
|
-
for (var p in s) {
|
|
28
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
29
|
-
}
|
|
30
|
-
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
31
21
|
if (s != null && typeof _Object$getOwnPropertySymbols === "function") for (var i = 0, p = _Object$getOwnPropertySymbols(s); i < p.length; i++) {
|
|
32
22
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
33
23
|
}
|
|
34
24
|
return t;
|
|
35
25
|
};
|
|
36
|
-
|
|
37
26
|
import React, { useState } from 'react';
|
|
38
27
|
import styled from 'styled-components';
|
|
39
28
|
import { internals } from '../internals';
|
|
40
29
|
import { collectNodes, isLeafNode, layeredSort, mergeCellProps, smartCompare } from '../utils';
|
|
41
30
|
import { warnTransformsDeprecated } from './warnTransformsDeprecated';
|
|
42
|
-
|
|
43
31
|
function SortIcon(_ref) {
|
|
44
32
|
var _ref$size = _ref.size,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
33
|
+
size = _ref$size === void 0 ? 32 : _ref$size,
|
|
34
|
+
style = _ref.style,
|
|
35
|
+
className = _ref.className,
|
|
36
|
+
order = _ref.order;
|
|
49
37
|
return /*#__PURE__*/React.createElement("svg", {
|
|
50
38
|
style: style,
|
|
51
39
|
className: className,
|
|
@@ -65,14 +53,13 @@ function SortIcon(_ref) {
|
|
|
65
53
|
d: "M24 24L16 32 8 24z "
|
|
66
54
|
}));
|
|
67
55
|
}
|
|
68
|
-
|
|
69
56
|
function DefaultSortHeaderCell(_ref2) {
|
|
70
57
|
var children = _ref2.children,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
58
|
+
column = _ref2.column,
|
|
59
|
+
onToggle = _ref2.onToggle,
|
|
60
|
+
sortOrder = _ref2.sortOrder,
|
|
61
|
+
sortIndex = _ref2.sortIndex,
|
|
62
|
+
sortOptions = _ref2.sortOptions;
|
|
76
63
|
// 通过 justify-content 来与 col.align 保持对齐方向一致
|
|
77
64
|
var justifyContent = column.align === 'right' ? 'flex-end' : column.align === 'center' ? 'center' : 'flex-start';
|
|
78
65
|
return /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
@@ -88,7 +75,7 @@ function DefaultSortHeaderCell(_ref2) {
|
|
|
88
75
|
},
|
|
89
76
|
size: 16,
|
|
90
77
|
order: sortOrder
|
|
91
|
-
}), sortOptions.mode === 'multiple' && sortIndex != -1 && /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
}), sortOptions.mode === 'multiple' && sortIndex != -1 && ( /*#__PURE__*/React.createElement("div", {
|
|
92
79
|
style: {
|
|
93
80
|
userSelect: 'none',
|
|
94
81
|
marginLeft: 2,
|
|
@@ -97,39 +84,33 @@ function DefaultSortHeaderCell(_ref2) {
|
|
|
97
84
|
fontSize: 10,
|
|
98
85
|
fontFamily: 'monospace'
|
|
99
86
|
}
|
|
100
|
-
}, sortIndex + 1));
|
|
87
|
+
}, sortIndex + 1)));
|
|
101
88
|
}
|
|
102
|
-
|
|
103
89
|
function hasAnySortableColumns(cols) {
|
|
104
90
|
return cols.some(function (col) {
|
|
105
91
|
var _a;
|
|
106
|
-
|
|
107
92
|
return Boolean((_a = col.features) === null || _a === void 0 ? void 0 : _a.sortable) || !isLeafNode(col) && hasAnySortableColumns(col.children);
|
|
108
93
|
});
|
|
109
94
|
}
|
|
110
|
-
|
|
111
95
|
var TableHeaderCell = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n display: flex;\n align-items: center;\n"])));
|
|
112
96
|
/** @deprecated transform 用法已经过时,请使用 pipeline 来对表格进行拓展 */
|
|
113
|
-
|
|
114
97
|
export function makeSortTransform(_ref3) {
|
|
115
98
|
var inputSorts = _ref3.sorts,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
99
|
+
inputOnChangeSorts = _ref3.onChangeSorts,
|
|
100
|
+
_ref3$orders = _ref3.orders,
|
|
101
|
+
orders = _ref3$orders === void 0 ? ['desc', 'asc', 'none'] : _ref3$orders,
|
|
102
|
+
_ref3$mode = _ref3.mode,
|
|
103
|
+
mode = _ref3$mode === void 0 ? 'multiple' : _ref3$mode,
|
|
104
|
+
_ref3$SortHeaderCell = _ref3.SortHeaderCell,
|
|
105
|
+
SortHeaderCell = _ref3$SortHeaderCell === void 0 ? DefaultSortHeaderCell : _ref3$SortHeaderCell,
|
|
106
|
+
keepDataSource = _ref3.keepDataSource,
|
|
107
|
+
highlightColumnWhenActive = _ref3.highlightColumnWhenActive,
|
|
108
|
+
stopClickEventPropagation = _ref3.stopClickEventPropagation;
|
|
126
109
|
warnTransformsDeprecated('makeSortTransform');
|
|
127
|
-
|
|
128
110
|
var filteredInputSorts = _filterInstanceProperty(inputSorts).call(inputSorts, function (s) {
|
|
129
111
|
return s.order !== 'none';
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
|
|
112
|
+
});
|
|
113
|
+
// 单字段排序的情况下 sorts 中只有第一个排序字段才会生效
|
|
133
114
|
var sorts = mode === 'multiple' ? filteredInputSorts : _sliceInstanceProperty(filteredInputSorts).call(filteredInputSorts, 0, 1);
|
|
134
115
|
var onChangeSorts = mode === 'multiple' ? inputOnChangeSorts : function (nextSorts) {
|
|
135
116
|
// 单字段排序的情况下,nextSorts 中只有最后一个排序字段才会生效
|
|
@@ -152,54 +133,40 @@ export function makeSortTransform(_ref3) {
|
|
|
152
133
|
}));
|
|
153
134
|
return function (_ref4) {
|
|
154
135
|
var dataSource = _ref4.dataSource,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
158
|
-
if (!hasAnySortableColumns(columns)) {
|
|
159
|
-
console.warn('[ali-react-table] commonTransform.sort 缺少可排序的列,请通过 column.features.sortable 来指定哪些列可排序', columns);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
136
|
+
columns = _ref4.columns;
|
|
163
137
|
return {
|
|
164
138
|
columns: processColumns(columns),
|
|
165
139
|
dataSource: processDataSource(dataSource)
|
|
166
140
|
};
|
|
167
|
-
|
|
168
141
|
function processDataSource(dataSource) {
|
|
169
142
|
var _context, _context2;
|
|
170
|
-
|
|
171
143
|
if (keepDataSource) {
|
|
172
144
|
return dataSource;
|
|
173
145
|
}
|
|
174
|
-
|
|
175
146
|
var sortColumnsMap = new _Map(_mapInstanceProperty(_context = _filterInstanceProperty(_context2 = collectNodes(columns, 'leaf-only')).call(_context2, function (col) {
|
|
176
147
|
var _a;
|
|
177
|
-
|
|
178
148
|
return ((_a = col.features) === null || _a === void 0 ? void 0 : _a.sortable) != null;
|
|
179
149
|
})).call(_context, function (col) {
|
|
180
150
|
return [col.code, col];
|
|
181
151
|
}));
|
|
182
152
|
return layeredSort(dataSource, function (x, y) {
|
|
183
153
|
var _iterator = _createForOfIteratorHelper(sorts),
|
|
184
|
-
|
|
185
|
-
|
|
154
|
+
_step;
|
|
186
155
|
try {
|
|
187
156
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
188
157
|
var _step$value = _step.value,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
var column = sortColumnsMap.get(code);
|
|
192
|
-
|
|
158
|
+
code = _step$value.code,
|
|
159
|
+
order = _step$value.order;
|
|
160
|
+
var column = sortColumnsMap.get(code);
|
|
161
|
+
// 如果 code 对应的 column 不可排序,我们跳过该 code
|
|
193
162
|
if (column == null) {
|
|
194
163
|
continue;
|
|
195
164
|
}
|
|
196
|
-
|
|
197
165
|
var sortable = column.features.sortable;
|
|
198
166
|
var compareFn = typeof sortable === 'function' ? sortable : smartCompare;
|
|
199
167
|
var xValue = internals.safeGetValue(column, x, -1);
|
|
200
168
|
var yValue = internals.safeGetValue(column, y, -1);
|
|
201
169
|
var cmp = compareFn(xValue, yValue);
|
|
202
|
-
|
|
203
170
|
if (cmp !== 0) {
|
|
204
171
|
return cmp * (order === 'asc' ? 1 : -1);
|
|
205
172
|
}
|
|
@@ -209,15 +176,12 @@ export function makeSortTransform(_ref3) {
|
|
|
209
176
|
} finally {
|
|
210
177
|
_iterator.f();
|
|
211
178
|
}
|
|
212
|
-
|
|
213
179
|
return 0;
|
|
214
180
|
});
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
|
|
181
|
+
}
|
|
182
|
+
// 在「升序 - 降序 - 不排序」之间不断切换
|
|
218
183
|
function toggle(code) {
|
|
219
184
|
var sort = sortMap.get(code);
|
|
220
|
-
|
|
221
185
|
if (sort == null) {
|
|
222
186
|
onChangeSorts(_concatInstanceProperty(sorts).call(sorts, [{
|
|
223
187
|
code: code,
|
|
@@ -227,11 +191,8 @@ export function makeSortTransform(_ref3) {
|
|
|
227
191
|
var index = _findIndexInstanceProperty(sorts).call(sorts, function (s) {
|
|
228
192
|
return s.code === code;
|
|
229
193
|
});
|
|
230
|
-
|
|
231
194
|
var nextSorts = _sliceInstanceProperty(sorts).call(sorts, 0, index + 1);
|
|
232
|
-
|
|
233
195
|
var nextOrder = getNextOrder(sort.order);
|
|
234
|
-
|
|
235
196
|
if (nextOrder === 'none') {
|
|
236
197
|
nextSorts.pop();
|
|
237
198
|
} else {
|
|
@@ -239,41 +200,31 @@ export function makeSortTransform(_ref3) {
|
|
|
239
200
|
order: nextOrder
|
|
240
201
|
});
|
|
241
202
|
}
|
|
242
|
-
|
|
243
203
|
onChangeSorts(nextSorts);
|
|
244
204
|
}
|
|
245
205
|
}
|
|
246
|
-
|
|
247
206
|
function processColumns(columns) {
|
|
248
207
|
return _mapInstanceProperty(columns).call(columns, dfs);
|
|
249
|
-
|
|
250
208
|
function dfs(col) {
|
|
251
209
|
var _a;
|
|
252
|
-
|
|
253
210
|
var result = _extends({}, col);
|
|
254
|
-
|
|
255
211
|
var sortable = col.code && (((_a = col.features) === null || _a === void 0 ? void 0 : _a.sortable) || sortMap.has(col.code));
|
|
256
212
|
var active = sortable && sortMap.has(col.code);
|
|
257
|
-
|
|
258
213
|
if (sortable) {
|
|
259
214
|
var sortIndex = -1;
|
|
260
215
|
var sortOrder = 'none';
|
|
261
|
-
|
|
262
216
|
if (active) {
|
|
263
217
|
var _sortMap$get = sortMap.get(col.code),
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
218
|
+
order = _sortMap$get.order,
|
|
219
|
+
index = _sortMap$get.index;
|
|
267
220
|
sortOrder = order;
|
|
268
221
|
sortIndex = index;
|
|
269
|
-
|
|
270
222
|
if (highlightColumnWhenActive) {
|
|
271
223
|
result.headerCellProps = mergeCellProps(col.headerCellProps, {
|
|
272
224
|
style: {
|
|
273
225
|
background: 'var(--header-highlight-bgcolor)'
|
|
274
226
|
}
|
|
275
227
|
});
|
|
276
|
-
|
|
277
228
|
result.getCellProps = function (value, row, rowIndex) {
|
|
278
229
|
var prevCellProps = internals.safeGetCellProps(col, row, rowIndex);
|
|
279
230
|
return mergeCellProps(prevCellProps, {
|
|
@@ -284,13 +235,11 @@ export function makeSortTransform(_ref3) {
|
|
|
284
235
|
};
|
|
285
236
|
}
|
|
286
237
|
}
|
|
287
|
-
|
|
288
238
|
result.title = /*#__PURE__*/React.createElement(SortHeaderCell, {
|
|
289
239
|
onToggle: function onToggle(e) {
|
|
290
240
|
if (stopClickEventPropagation) {
|
|
291
241
|
e.stopPropagation();
|
|
292
242
|
}
|
|
293
|
-
|
|
294
243
|
toggle(col.code);
|
|
295
244
|
},
|
|
296
245
|
sortOrder: sortOrder,
|
|
@@ -299,37 +248,29 @@ export function makeSortTransform(_ref3) {
|
|
|
299
248
|
sortOptions: sortOptions
|
|
300
249
|
}, internals.safeRenderHeader(col));
|
|
301
250
|
}
|
|
302
|
-
|
|
303
251
|
if (!isLeafNode(col)) {
|
|
304
252
|
var _context3;
|
|
305
|
-
|
|
306
253
|
result.children = _mapInstanceProperty(_context3 = col.children).call(_context3, dfs);
|
|
307
254
|
}
|
|
308
|
-
|
|
309
255
|
return result;
|
|
310
256
|
}
|
|
311
257
|
}
|
|
312
258
|
};
|
|
313
|
-
|
|
314
259
|
function getNextOrder(order) {
|
|
315
260
|
var idx = orders.indexOf(order);
|
|
316
261
|
return orders[idx === orders.length - 1 ? 0 : idx + 1];
|
|
317
262
|
}
|
|
318
263
|
}
|
|
319
264
|
/** @deprecated transform 用法已经过时,请使用 pipeline 来对表格进行拓展 */
|
|
320
|
-
|
|
321
265
|
export function useSortTransform() {
|
|
322
266
|
var _a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
323
|
-
|
|
324
267
|
var _a$defaultSorts = _a.defaultSorts,
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
268
|
+
defaultSorts = _a$defaultSorts === void 0 ? [] : _a$defaultSorts,
|
|
269
|
+
others = __rest(_a, ["defaultSorts"]);
|
|
328
270
|
var _useState = useState(defaultSorts),
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
271
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
272
|
+
sorts = _useState2[0],
|
|
273
|
+
onChangeSorts = _useState2[1];
|
|
333
274
|
return makeSortTransform(_extends({
|
|
334
275
|
sorts: sorts,
|
|
335
276
|
onChangeSorts: onChangeSorts
|
|
File without changes
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime-corejs3/helpers/taggedTemplateLiteral";
|
|
3
|
-
|
|
4
3
|
var _templateObject;
|
|
5
|
-
|
|
6
4
|
import React from 'react';
|
|
7
5
|
import styled from 'styled-components';
|
|
8
6
|
import { icons } from '../common-views';
|
|
@@ -11,25 +9,22 @@ import { traverseColumn } from '../utils';
|
|
|
11
9
|
import { warnTransformsDeprecated } from './warnTransformsDeprecated';
|
|
12
10
|
var HeaderCellWithTips = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n .tip-icon-wrapper {\n margin-left: 2px;\n }\n\n .tip-icon {\n display: flex;\n fill: currentColor;\n }\n"])));
|
|
13
11
|
/** @deprecated transform 用法已经过时,请使用 pipeline 来对表格进行拓展 */
|
|
14
|
-
|
|
15
12
|
export function makeTipsTransform(_ref) {
|
|
16
13
|
var Balloon = _ref.Balloon,
|
|
17
|
-
|
|
14
|
+
Tooltip = _ref.Tooltip;
|
|
18
15
|
warnTransformsDeprecated('makeTipsTransform');
|
|
19
16
|
return traverseColumn(function (col) {
|
|
20
17
|
var _a;
|
|
21
|
-
|
|
22
18
|
if (!((_a = col.features) === null || _a === void 0 ? void 0 : _a.tips)) {
|
|
23
19
|
return col;
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
var justifyContent = col.align === 'right' ? 'flex-end' : col.align === 'center' ? 'center' : 'flex-start';
|
|
27
22
|
return _extends(_extends({}, col), {
|
|
28
|
-
title: /*#__PURE__*/React.createElement(HeaderCellWithTips, {
|
|
23
|
+
title: ( /*#__PURE__*/React.createElement(HeaderCellWithTips, {
|
|
29
24
|
style: {
|
|
30
25
|
justifyContent: justifyContent
|
|
31
26
|
}
|
|
32
|
-
}, internals.safeRenderHeader(col), Balloon ?
|
|
27
|
+
}, internals.safeRenderHeader(col), Balloon ? (
|
|
33
28
|
/*#__PURE__*/
|
|
34
29
|
// fusion/hippo
|
|
35
30
|
React.createElement(Balloon, {
|
|
@@ -39,7 +34,7 @@ export function makeTipsTransform(_ref) {
|
|
|
39
34
|
}, /*#__PURE__*/React.createElement(icons.Info, {
|
|
40
35
|
className: "tip-icon"
|
|
41
36
|
}))
|
|
42
|
-
}, col.features.tips) :
|
|
37
|
+
}, col.features.tips)) : (
|
|
43
38
|
/*#__PURE__*/
|
|
44
39
|
// antd
|
|
45
40
|
React.createElement(Tooltip, {
|
|
@@ -48,7 +43,7 @@ export function makeTipsTransform(_ref) {
|
|
|
48
43
|
className: "tip-icon-wrapper"
|
|
49
44
|
}, /*#__PURE__*/React.createElement(icons.Info, {
|
|
50
45
|
className: "tip-icon"
|
|
51
|
-
}))))
|
|
46
|
+
}))))))
|
|
52
47
|
});
|
|
53
48
|
});
|
|
54
49
|
}
|
|
File without changes
|