@kdcloudjs/table 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +568 -0
- package/README.md +111 -0
- package/dist/@kdcloudjs/table.css +422 -0
- package/dist/@kdcloudjs/table.css.map +1 -0
- package/dist/@kdcloudjs/table.js +38578 -0
- package/dist/@kdcloudjs/table.js.map +1 -0
- package/dist/@kdcloudjs/table.min.css +9 -0
- package/dist/@kdcloudjs/table.min.js +208 -0
- package/dist/@kdcloudjs/table.min.js.map +1 -0
- package/dist/default-theme.js +344 -0
- package/dist/kd-table.css +422 -0
- package/dist/kd-table.css.map +1 -0
- package/dist/kd-table.js +38578 -0
- package/dist/kd-table.js.map +1 -0
- package/dist/kd-table.min.css +9 -0
- package/dist/kd-table.min.js +208 -0
- package/dist/kd-table.min.js.map +1 -0
- package/dist/kd-ui-complete.less +779 -0
- package/dist/kd-ui.less +2 -0
- package/dist/theme.js +13 -0
- package/es/_utils/arrayUtil.d.ts +5 -0
- package/es/_utils/arrayUtil.js +17 -0
- package/es/_utils/devwarning.d.ts +1 -0
- package/es/_utils/devwarning.js +10 -0
- package/es/_utils/formatUtil.d.ts +46 -0
- package/es/_utils/formatUtil.js +346 -0
- package/es/_utils/hooks.d.ts +51 -0
- package/es/_utils/hooks.js +165 -0
- package/es/_utils/index.d.ts +8 -0
- package/es/_utils/index.js +15 -0
- package/es/_utils/numberUtil.d.ts +34 -0
- package/es/_utils/numberUtil.js +181 -0
- package/es/_utils/omit.d.ts +1 -0
- package/es/_utils/omit.js +11 -0
- package/es/_utils/react-children.d.ts +2 -0
- package/es/_utils/react-children.js +8 -0
- package/es/_utils/type.d.ts +12 -0
- package/es/_utils/type.js +15 -0
- package/es/_utils/usePopper.d.ts +29 -0
- package/es/_utils/usePopper.js +546 -0
- package/es/config-provider/ConfigContext.d.ts +22 -0
- package/es/config-provider/ConfigContext.js +7 -0
- package/es/config-provider/compDefaultProps.d.ts +8 -0
- package/es/config-provider/compDefaultProps.js +10 -0
- package/es/config-provider/configProvider.d.ts +11 -0
- package/es/config-provider/configProvider.js +40 -0
- package/es/config-provider/defaultConfig.d.ts +10 -0
- package/es/config-provider/defaultConfig.js +18 -0
- package/es/config-provider/index.d.ts +6 -0
- package/es/config-provider/index.js +6 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +4 -0
- package/es/locale/index.d.ts +3 -0
- package/es/locale/index.js +3 -0
- package/es/locale/locale.d.ts +50 -0
- package/es/locale/locale.js +251 -0
- package/es/locale/zh-CN.d.ts +8 -0
- package/es/locale/zh-CN.js +8 -0
- package/es/style/color/colors.less +2 -0
- package/es/style/core/index.less +2 -0
- package/es/style/core/motion/other.less +28 -0
- package/es/style/core/motion/slide.less +53 -0
- package/es/style/core/motion.less +2 -0
- package/es/style/core/reset.less +186 -0
- package/es/style/css.js +1 -0
- package/es/style/index.css +410 -0
- package/es/style/index.d.ts +1 -0
- package/es/style/index.js +1 -0
- package/es/style/index.less +2 -0
- package/es/style/mixins/index.less +19 -0
- package/es/style/mixins/overlay.less +22 -0
- package/es/style/mixins/reset.less +13 -0
- package/es/style/themes/default.less +445 -0
- package/es/style/themes/index.less +1 -0
- package/es/table/base/calculations.d.ts +5 -0
- package/es/table/base/calculations.js +364 -0
- package/es/table/base/colgroup.d.ts +5 -0
- package/es/table/base/colgroup.js +22 -0
- package/es/table/base/empty.d.ts +9 -0
- package/es/table/base/empty.js +38 -0
- package/es/table/base/header.d.ts +5 -0
- package/es/table/base/header.js +324 -0
- package/es/table/base/helpers/SpanManager.d.ts +9 -0
- package/es/table/base/helpers/SpanManager.js +50 -0
- package/es/table/base/helpers/TableDOMUtils.d.ts +18 -0
- package/es/table/base/helpers/TableDOMUtils.js +104 -0
- package/es/table/base/helpers/__test__/SpanManager.test.d.ts +1 -0
- package/es/table/base/helpers/__test__/SpanManager.test.js +18 -0
- package/es/table/base/helpers/__test__/TableDOMUtils.test.d.ts +1 -0
- package/es/table/base/helpers/__test__/TableDOMUtils.test.js +34 -0
- package/es/table/base/helpers/__test__/rowHeightManager.test.d.ts +1 -0
- package/es/table/base/helpers/__test__/rowHeightManager.test.js +30 -0
- package/es/table/base/helpers/__test__/visible-part.test.d.ts +1 -0
- package/es/table/base/helpers/__test__/visible-part.test.js +28 -0
- package/es/table/base/helpers/rowHeightManager.d.ts +7 -0
- package/es/table/base/helpers/rowHeightManager.js +157 -0
- package/es/table/base/helpers/visible-part.d.ts +23 -0
- package/es/table/base/helpers/visible-part.js +58 -0
- package/es/table/base/html-table.d.ts +15 -0
- package/es/table/base/html-table.js +132 -0
- package/es/table/base/index.d.ts +3 -0
- package/es/table/base/index.js +2 -0
- package/es/table/base/interfaces.d.ts +54 -0
- package/es/table/base/interfaces.js +0 -0
- package/es/table/base/loading.d.ts +13 -0
- package/es/table/base/loading.js +60 -0
- package/es/table/base/styles.d.ts +132 -0
- package/es/table/base/styles.js +112 -0
- package/es/table/base/table.d.ts +150 -0
- package/es/table/base/table.js +733 -0
- package/es/table/base/utils.d.ts +36 -0
- package/es/table/base/utils.js +193 -0
- package/es/table/common-views.d.ts +24 -0
- package/es/table/common-views.js +70 -0
- package/es/table/index.d.ts +6 -0
- package/es/table/index.js +6 -0
- package/es/table/interfaces.d.ts +98 -0
- package/es/table/interfaces.js +0 -0
- package/es/table/internals.d.ts +14 -0
- package/es/table/internals.js +56 -0
- package/es/table/pipeline/features/__test__/multiSelect.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/multiSelect.test.js +152 -0
- package/es/table/pipeline/features/__test__/rowDetail.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/rowDetail.test.js +223 -0
- package/es/table/pipeline/features/__test__/rowGrouping.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/rowGrouping.test.js +120 -0
- package/es/table/pipeline/features/__test__/singleSelect.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/singleSelect.test.js +191 -0
- package/es/table/pipeline/features/__test__/sort.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/sort.test.js +213 -0
- package/es/table/pipeline/features/__test__/tips.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/tips.test.js +123 -0
- package/es/table/pipeline/features/__test__/treeMode.test.d.ts +1 -0
- package/es/table/pipeline/features/__test__/treeMode.test.js +202 -0
- package/es/table/pipeline/features/autoFill.d.ts +4 -0
- package/es/table/pipeline/features/autoFill.js +63 -0
- package/es/table/pipeline/features/autoRowSpan.d.ts +2 -0
- package/es/table/pipeline/features/autoRowSpan.js +72 -0
- package/es/table/pipeline/features/buildTree.d.ts +2 -0
- package/es/table/pipeline/features/buildTree.js +8 -0
- package/es/table/pipeline/features/columnDrag.d.ts +6 -0
- package/es/table/pipeline/features/columnDrag.js +265 -0
- package/es/table/pipeline/features/columnFilter.d.ts +20 -0
- package/es/table/pipeline/features/columnFilter.js +173 -0
- package/es/table/pipeline/features/columnHover.d.ts +12 -0
- package/es/table/pipeline/features/columnHover.js +51 -0
- package/es/table/pipeline/features/columnRangeHover.d.ts +15 -0
- package/es/table/pipeline/features/columnRangeHover.js +83 -0
- package/es/table/pipeline/features/columnResizeWidth.d.ts +21 -0
- package/es/table/pipeline/features/columnResizeWidth.js +173 -0
- package/es/table/pipeline/features/contextMenu.d.ts +14 -0
- package/es/table/pipeline/features/contextMenu.js +370 -0
- package/es/table/pipeline/features/filter/DefaultFilterContent.d.ts +4 -0
- package/es/table/pipeline/features/filter/DefaultFilterContent.js +91 -0
- package/es/table/pipeline/features/filter/Filter.d.ts +17 -0
- package/es/table/pipeline/features/filter/Filter.js +111 -0
- package/es/table/pipeline/features/filter/FilterPanel.d.ts +20 -0
- package/es/table/pipeline/features/filter/FilterPanel.js +81 -0
- package/es/table/pipeline/features/filter/__test__/Filter.test.d.ts +1 -0
- package/es/table/pipeline/features/filter/__test__/Filter.test.js +29 -0
- package/es/table/pipeline/features/filter/index.d.ts +4 -0
- package/es/table/pipeline/features/filter/index.js +4 -0
- package/es/table/pipeline/features/filter/util.d.ts +10 -0
- package/es/table/pipeline/features/filter/util.js +67 -0
- package/es/table/pipeline/features/index.d.ts +16 -0
- package/es/table/pipeline/features/index.js +16 -0
- package/es/table/pipeline/features/multiSelect.d.ts +27 -0
- package/es/table/pipeline/features/multiSelect.js +208 -0
- package/es/table/pipeline/features/rowDetail.d.ts +35 -0
- package/es/table/pipeline/features/rowDetail.js +254 -0
- package/es/table/pipeline/features/rowGrouping.d.ts +14 -0
- package/es/table/pipeline/features/rowGrouping.js +200 -0
- package/es/table/pipeline/features/singleSelect.d.ts +23 -0
- package/es/table/pipeline/features/singleSelect.js +122 -0
- package/es/table/pipeline/features/sort.d.ts +40 -0
- package/es/table/pipeline/features/sort.js +332 -0
- package/es/table/pipeline/features/tips.d.ts +2 -0
- package/es/table/pipeline/features/tips.js +57 -0
- package/es/table/pipeline/features/treeMode.d.ts +37 -0
- package/es/table/pipeline/features/treeMode.js +234 -0
- package/es/table/pipeline/features/treeSelect.d.ts +38 -0
- package/es/table/pipeline/features/treeSelect.js +154 -0
- package/es/table/pipeline/index.d.ts +3 -0
- package/es/table/pipeline/index.js +3 -0
- package/es/table/pipeline/pipeline.d.ts +85 -0
- package/es/table/pipeline/pipeline.js +272 -0
- package/es/table/pivot/cross-table/buildCrossTable.d.ts +14 -0
- package/es/table/pivot/cross-table/buildCrossTable.js +294 -0
- package/es/table/pivot/cross-table/constants.d.ts +1 -0
- package/es/table/pivot/cross-table/constants.js +1 -0
- package/es/table/pivot/cross-table/cross-table.d.ts +18 -0
- package/es/table/pivot/cross-table/cross-table.js +55 -0
- package/es/table/pivot/cross-table/index.d.ts +4 -0
- package/es/table/pivot/cross-table/index.js +3 -0
- package/es/table/pivot/cross-table/interfaces.d.ts +29 -0
- package/es/table/pivot/cross-table/interfaces.js +0 -0
- package/es/table/pivot/cross-table/internals.d.ts +13 -0
- package/es/table/pivot/cross-table/internals.js +0 -0
- package/es/table/pivot/cross-tree-table/buildCrossTreeTable.d.ts +14 -0
- package/es/table/pivot/cross-tree-table/buildCrossTreeTable.js +219 -0
- package/es/table/pivot/cross-tree-table/cross-tree-table.d.ts +38 -0
- package/es/table/pivot/cross-tree-table/cross-tree-table.js +127 -0
- package/es/table/pivot/cross-tree-table/index.d.ts +2 -0
- package/es/table/pivot/cross-tree-table/index.js +2 -0
- package/es/table/pivot/pivot-utils/buildDrillTree.d.ts +16 -0
- package/es/table/pivot/pivot-utils/buildDrillTree.js +93 -0
- package/es/table/pivot/pivot-utils/builders.d.ts +26 -0
- package/es/table/pivot/pivot-utils/builders.js +252 -0
- package/es/table/pivot/pivot-utils/convert-utils.d.ts +31 -0
- package/es/table/pivot/pivot-utils/convert-utils.js +180 -0
- package/es/table/pivot/pivot-utils/index.d.ts +5 -0
- package/es/table/pivot/pivot-utils/index.js +4 -0
- package/es/table/pivot/pivot-utils/interfaces.d.ts +12 -0
- package/es/table/pivot/pivot-utils/interfaces.js +0 -0
- package/es/table/pivot/pivot-utils/simpleEncode.d.ts +1 -0
- package/es/table/pivot/pivot-utils/simpleEncode.js +7 -0
- package/es/table/style/css.js +2 -0
- package/es/table/style/index.css +0 -0
- package/es/table/style/index.d.ts +2 -0
- package/es/table/style/index.js +2 -0
- package/es/table/style/index.less +1 -0
- package/es/table/transforms/autoRowSpan.d.ts +3 -0
- package/es/table/transforms/autoRowSpan.js +73 -0
- package/es/table/transforms/autoWidth.d.ts +25 -0
- package/es/table/transforms/autoWidth.js +160 -0
- package/es/table/transforms/buildTree.d.ts +3 -0
- package/es/table/transforms/buildTree.js +15 -0
- package/es/table/transforms/columnHover.d.ts +17 -0
- package/es/table/transforms/columnHover.js +59 -0
- package/es/table/transforms/columnRangeHover.d.ts +17 -0
- package/es/table/transforms/columnRangeHover.js +94 -0
- package/es/table/transforms/columnResize.d.ts +27 -0
- package/es/table/transforms/columnResize.js +152 -0
- package/es/table/transforms/flatten.d.ts +3 -0
- package/es/table/transforms/flatten.js +16 -0
- package/es/table/transforms/index.d.ts +12 -0
- package/es/table/transforms/index.js +12 -0
- package/es/table/transforms/orderField.d.ts +3 -0
- package/es/table/transforms/orderField.js +22 -0
- package/es/table/transforms/sort.d.ts +43 -0
- package/es/table/transforms/sort.js +338 -0
- package/es/table/transforms/tips.d.ts +8 -0
- package/es/table/transforms/tips.js +54 -0
- package/es/table/transforms/treeMode.d.ts +30 -0
- package/es/table/transforms/treeMode.js +252 -0
- package/es/table/transforms/visible.d.ts +5 -0
- package/es/table/transforms/visible.js +19 -0
- package/es/table/transforms/warnTransformsDeprecated.d.ts +1 -0
- package/es/table/transforms/warnTransformsDeprecated.js +8 -0
- package/es/table/use/useResizeObserver.d.ts +2 -0
- package/es/table/use/useResizeObserver.js +20 -0
- package/es/table/utils/applyTransforms.d.ts +6 -0
- package/es/table/utils/applyTransforms.js +15 -0
- package/es/table/utils/buildTree.d.ts +36 -0
- package/es/table/utils/buildTree.js +119 -0
- package/es/table/utils/collectNodes.d.ts +8 -0
- package/es/table/utils/collectNodes.js +59 -0
- package/es/table/utils/console.d.ts +11 -0
- package/es/table/utils/console.js +58 -0
- package/es/table/utils/copyToClipboard.d.ts +3 -0
- package/es/table/utils/copyToClipboard.js +30 -0
- package/es/table/utils/element.d.ts +42 -0
- package/es/table/utils/element.js +228 -0
- package/es/table/utils/exportTableAsExcel.d.ts +4 -0
- package/es/table/utils/exportTableAsExcel.js +188 -0
- package/es/table/utils/getTreeDepth.d.ts +3 -0
- package/es/table/utils/getTreeDepth.js +41 -0
- package/es/table/utils/groupBy.d.ts +1 -0
- package/es/table/utils/groupBy.js +37 -0
- package/es/table/utils/index.d.ts +18 -0
- package/es/table/utils/index.js +18 -0
- package/es/table/utils/isGroupColumn.d.ts +2 -0
- package/es/table/utils/isGroupColumn.js +7 -0
- package/es/table/utils/isLeafNode.d.ts +2 -0
- package/es/table/utils/isLeafNode.js +4 -0
- package/es/table/utils/layeredFilter.d.ts +2 -0
- package/es/table/utils/layeredFilter.js +25 -0
- package/es/table/utils/layeredSort.d.ts +5 -0
- package/es/table/utils/layeredSort.js +26 -0
- package/es/table/utils/makeRecursiveMapper.d.ts +9 -0
- package/es/table/utils/makeRecursiveMapper.js +76 -0
- package/es/table/utils/mergeCellProps.d.ts +8 -0
- package/es/table/utils/mergeCellProps.js +67 -0
- package/es/table/utils/others.d.ts +16 -0
- package/es/table/utils/others.js +80 -0
- package/es/table/utils/proto.d.ts +21 -0
- package/es/table/utils/proto.js +106 -0
- package/es/table/utils/smartCompare.d.ts +9 -0
- package/es/table/utils/smartCompare.js +51 -0
- package/es/table/utils/traverseColumn.d.ts +11 -0
- package/es/table/utils/traverseColumn.js +88 -0
- package/es/table/utils/tree-data-helpers/StrictTreeDataHelper.d.ts +22 -0
- package/es/table/utils/tree-data-helpers/StrictTreeDataHelper.js +138 -0
- package/es/table/utils/tree-data-helpers/TreeDataHelper.d.ts +26 -0
- package/es/table/utils/tree-data-helpers/TreeDataHelper.js +337 -0
- package/lib/_utils/arrayUtil.d.ts +5 -0
- package/lib/_utils/arrayUtil.js +26 -0
- package/lib/_utils/devwarning.d.ts +1 -0
- package/lib/_utils/devwarning.js +21 -0
- package/lib/_utils/formatUtil.d.ts +46 -0
- package/lib/_utils/formatUtil.js +358 -0
- package/lib/_utils/hooks.d.ts +51 -0
- package/lib/_utils/hooks.js +187 -0
- package/lib/_utils/index.d.ts +8 -0
- package/lib/_utils/index.js +28 -0
- package/lib/_utils/numberUtil.d.ts +34 -0
- package/lib/_utils/numberUtil.js +202 -0
- package/lib/_utils/omit.d.ts +1 -0
- package/lib/_utils/omit.js +21 -0
- package/lib/_utils/react-children.d.ts +2 -0
- package/lib/_utils/react-children.js +20 -0
- package/lib/_utils/type.d.ts +12 -0
- package/lib/_utils/type.js +27 -0
- package/lib/_utils/usePopper.d.ts +29 -0
- package/lib/_utils/usePopper.js +574 -0
- package/lib/config-provider/ConfigContext.d.ts +22 -0
- package/lib/config-provider/ConfigContext.js +19 -0
- package/lib/config-provider/compDefaultProps.d.ts +8 -0
- package/lib/config-provider/compDefaultProps.js +17 -0
- package/lib/config-provider/configProvider.d.ts +11 -0
- package/lib/config-provider/configProvider.js +56 -0
- package/lib/config-provider/defaultConfig.d.ts +10 -0
- package/lib/config-provider/defaultConfig.js +30 -0
- package/lib/config-provider/index.d.ts +6 -0
- package/lib/config-provider/index.js +37 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +45 -0
- package/lib/locale/index.d.ts +3 -0
- package/lib/locale/index.js +25 -0
- package/lib/locale/locale.d.ts +50 -0
- package/lib/locale/locale.js +277 -0
- package/lib/locale/zh-CN.d.ts +8 -0
- package/lib/locale/zh-CN.js +15 -0
- package/lib/style/color/colors.less +2 -0
- package/lib/style/components.less +1 -0
- package/lib/style/core/index.less +2 -0
- package/lib/style/core/motion/other.less +28 -0
- package/lib/style/core/motion/slide.less +53 -0
- package/lib/style/core/motion.less +2 -0
- package/lib/style/core/reset.less +186 -0
- package/lib/style/css.js +3 -0
- package/lib/style/index.css +410 -0
- package/lib/style/index.d.ts +1 -0
- package/lib/style/index.js +3 -0
- package/lib/style/index.less +2 -0
- package/lib/style/mixins/index.less +19 -0
- package/lib/style/mixins/overlay.less +22 -0
- package/lib/style/mixins/reset.less +13 -0
- package/lib/style/themes/default.less +445 -0
- package/lib/style/themes/index.less +1 -0
- package/lib/table/base/calculations.d.ts +5 -0
- package/lib/table/base/calculations.js +385 -0
- package/lib/table/base/colgroup.d.ts +5 -0
- package/lib/table/base/colgroup.js +33 -0
- package/lib/table/base/empty.d.ts +9 -0
- package/lib/table/base/empty.js +54 -0
- package/lib/table/base/header.d.ts +5 -0
- package/lib/table/base/header.js +340 -0
- package/lib/table/base/helpers/SpanManager.d.ts +9 -0
- package/lib/table/base/helpers/SpanManager.js +59 -0
- package/lib/table/base/helpers/TableDOMUtils.d.ts +18 -0
- package/lib/table/base/helpers/TableDOMUtils.js +113 -0
- package/lib/table/base/helpers/__test__/SpanManager.test.d.ts +1 -0
- package/lib/table/base/helpers/__test__/SpanManager.test.js +23 -0
- package/lib/table/base/helpers/__test__/TableDOMUtils.test.d.ts +1 -0
- package/lib/table/base/helpers/__test__/TableDOMUtils.test.js +41 -0
- package/lib/table/base/helpers/__test__/rowHeightManager.test.d.ts +1 -0
- package/lib/table/base/helpers/__test__/rowHeightManager.test.js +33 -0
- package/lib/table/base/helpers/__test__/visible-part.test.d.ts +1 -0
- package/lib/table/base/helpers/__test__/visible-part.test.js +31 -0
- package/lib/table/base/helpers/rowHeightManager.d.ts +7 -0
- package/lib/table/base/helpers/rowHeightManager.js +170 -0
- package/lib/table/base/helpers/visible-part.d.ts +23 -0
- package/lib/table/base/helpers/visible-part.js +72 -0
- package/lib/table/base/html-table.d.ts +15 -0
- package/lib/table/base/html-table.js +149 -0
- package/lib/table/base/index.d.ts +3 -0
- package/lib/table/base/index.js +21 -0
- package/lib/table/base/interfaces.d.ts +54 -0
- package/lib/table/base/interfaces.js +0 -0
- package/lib/table/base/loading.d.ts +13 -0
- package/lib/table/base/loading.js +71 -0
- package/lib/table/base/styles.d.ts +132 -0
- package/lib/table/base/styles.js +136 -0
- package/lib/table/base/table.d.ts +150 -0
- package/lib/table/base/table.js +773 -0
- package/lib/table/base/utils.d.ts +36 -0
- package/lib/table/base/utils.js +234 -0
- package/lib/table/common-views.d.ts +24 -0
- package/lib/table/common-views.js +90 -0
- package/lib/table/index.d.ts +6 -0
- package/lib/table/index.js +85 -0
- package/lib/table/interfaces.d.ts +98 -0
- package/lib/table/interfaces.js +0 -0
- package/lib/table/internals.d.ts +14 -0
- package/lib/table/internals.js +64 -0
- package/lib/table/pipeline/features/__test__/multiSelect.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/multiSelect.test.js +163 -0
- package/lib/table/pipeline/features/__test__/rowDetail.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/rowDetail.test.js +230 -0
- package/lib/table/pipeline/features/__test__/rowGrouping.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/rowGrouping.test.js +129 -0
- package/lib/table/pipeline/features/__test__/singleSelect.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/singleSelect.test.js +201 -0
- package/lib/table/pipeline/features/__test__/sort.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/sort.test.js +218 -0
- package/lib/table/pipeline/features/__test__/tips.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/tips.test.js +133 -0
- package/lib/table/pipeline/features/__test__/treeMode.test.d.ts +1 -0
- package/lib/table/pipeline/features/__test__/treeMode.test.js +206 -0
- package/lib/table/pipeline/features/autoFill.d.ts +4 -0
- package/lib/table/pipeline/features/autoFill.js +80 -0
- package/lib/table/pipeline/features/autoRowSpan.d.ts +2 -0
- package/lib/table/pipeline/features/autoRowSpan.js +84 -0
- package/lib/table/pipeline/features/buildTree.d.ts +2 -0
- package/lib/table/pipeline/features/buildTree.js +16 -0
- package/lib/table/pipeline/features/columnDrag.d.ts +6 -0
- package/lib/table/pipeline/features/columnDrag.js +278 -0
- package/lib/table/pipeline/features/columnFilter.d.ts +20 -0
- package/lib/table/pipeline/features/columnFilter.js +197 -0
- package/lib/table/pipeline/features/columnHover.d.ts +12 -0
- package/lib/table/pipeline/features/columnHover.js +62 -0
- package/lib/table/pipeline/features/columnRangeHover.d.ts +15 -0
- package/lib/table/pipeline/features/columnRangeHover.js +95 -0
- package/lib/table/pipeline/features/columnResizeWidth.d.ts +21 -0
- package/lib/table/pipeline/features/columnResizeWidth.js +192 -0
- package/lib/table/pipeline/features/contextMenu.d.ts +14 -0
- package/lib/table/pipeline/features/contextMenu.js +397 -0
- package/lib/table/pipeline/features/filter/DefaultFilterContent.d.ts +4 -0
- package/lib/table/pipeline/features/filter/DefaultFilterContent.js +112 -0
- package/lib/table/pipeline/features/filter/Filter.d.ts +17 -0
- package/lib/table/pipeline/features/filter/Filter.js +129 -0
- package/lib/table/pipeline/features/filter/FilterPanel.d.ts +20 -0
- package/lib/table/pipeline/features/filter/FilterPanel.js +98 -0
- package/lib/table/pipeline/features/filter/__test__/Filter.test.d.ts +1 -0
- package/lib/table/pipeline/features/filter/__test__/Filter.test.js +36 -0
- package/lib/table/pipeline/features/filter/index.d.ts +4 -0
- package/lib/table/pipeline/features/filter/index.js +39 -0
- package/lib/table/pipeline/features/filter/util.d.ts +10 -0
- package/lib/table/pipeline/features/filter/util.js +77 -0
- package/lib/table/pipeline/features/index.d.ts +16 -0
- package/lib/table/pipeline/features/index.js +141 -0
- package/lib/table/pipeline/features/multiSelect.d.ts +27 -0
- package/lib/table/pipeline/features/multiSelect.js +227 -0
- package/lib/table/pipeline/features/rowDetail.d.ts +35 -0
- package/lib/table/pipeline/features/rowDetail.js +283 -0
- package/lib/table/pipeline/features/rowGrouping.d.ts +14 -0
- package/lib/table/pipeline/features/rowGrouping.js +227 -0
- package/lib/table/pipeline/features/singleSelect.d.ts +23 -0
- package/lib/table/pipeline/features/singleSelect.js +138 -0
- package/lib/table/pipeline/features/sort.d.ts +40 -0
- package/lib/table/pipeline/features/sort.js +361 -0
- package/lib/table/pipeline/features/tips.d.ts +2 -0
- package/lib/table/pipeline/features/tips.js +73 -0
- package/lib/table/pipeline/features/treeMode.d.ts +37 -0
- package/lib/table/pipeline/features/treeMode.js +266 -0
- package/lib/table/pipeline/features/treeSelect.d.ts +38 -0
- package/lib/table/pipeline/features/treeSelect.js +169 -0
- package/lib/table/pipeline/index.d.ts +3 -0
- package/lib/table/pipeline/index.js +26 -0
- package/lib/table/pipeline/pipeline.d.ts +85 -0
- package/lib/table/pipeline/pipeline.js +291 -0
- package/lib/table/pivot/cross-table/buildCrossTable.d.ts +14 -0
- package/lib/table/pivot/cross-table/buildCrossTable.js +313 -0
- package/lib/table/pivot/cross-table/constants.d.ts +1 -0
- package/lib/table/pivot/cross-table/constants.js +8 -0
- package/lib/table/pivot/cross-table/cross-table.d.ts +18 -0
- package/lib/table/pivot/cross-table/cross-table.js +71 -0
- package/lib/table/pivot/cross-table/index.d.ts +4 -0
- package/lib/table/pivot/cross-table/index.js +31 -0
- package/lib/table/pivot/cross-table/interfaces.d.ts +29 -0
- package/lib/table/pivot/cross-table/interfaces.js +0 -0
- package/lib/table/pivot/cross-table/internals.d.ts +13 -0
- package/lib/table/pivot/cross-table/internals.js +0 -0
- package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.d.ts +14 -0
- package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.js +240 -0
- package/lib/table/pivot/cross-tree-table/cross-tree-table.d.ts +38 -0
- package/lib/table/pivot/cross-tree-table/cross-tree-table.js +144 -0
- package/lib/table/pivot/cross-tree-table/index.d.ts +2 -0
- package/lib/table/pivot/cross-tree-table/index.js +23 -0
- package/lib/table/pivot/pivot-utils/buildDrillTree.d.ts +16 -0
- package/lib/table/pivot/pivot-utils/buildDrillTree.js +106 -0
- package/lib/table/pivot/pivot-utils/builders.d.ts +26 -0
- package/lib/table/pivot/pivot-utils/builders.js +272 -0
- package/lib/table/pivot/pivot-utils/convert-utils.d.ts +31 -0
- package/lib/table/pivot/pivot-utils/convert-utils.js +204 -0
- package/lib/table/pivot/pivot-utils/index.d.ts +5 -0
- package/lib/table/pivot/pivot-utils/index.js +59 -0
- package/lib/table/pivot/pivot-utils/interfaces.d.ts +12 -0
- package/lib/table/pivot/pivot-utils/interfaces.js +0 -0
- package/lib/table/pivot/pivot-utils/simpleEncode.d.ts +1 -0
- package/lib/table/pivot/pivot-utils/simpleEncode.js +14 -0
- package/lib/table/style/css.js +5 -0
- package/lib/table/style/index.css +0 -0
- package/lib/table/style/index.d.ts +2 -0
- package/lib/table/style/index.js +5 -0
- package/lib/table/style/index.less +1 -0
- package/lib/table/transforms/autoRowSpan.d.ts +3 -0
- package/lib/table/transforms/autoRowSpan.js +86 -0
- package/lib/table/transforms/autoWidth.d.ts +25 -0
- package/lib/table/transforms/autoWidth.js +187 -0
- package/lib/table/transforms/buildTree.d.ts +3 -0
- package/lib/table/transforms/buildTree.js +23 -0
- package/lib/table/transforms/columnHover.d.ts +17 -0
- package/lib/table/transforms/columnHover.js +74 -0
- package/lib/table/transforms/columnRangeHover.d.ts +17 -0
- package/lib/table/transforms/columnRangeHover.js +110 -0
- package/lib/table/transforms/columnResize.d.ts +27 -0
- package/lib/table/transforms/columnResize.js +176 -0
- package/lib/table/transforms/flatten.d.ts +3 -0
- package/lib/table/transforms/flatten.js +24 -0
- package/lib/table/transforms/index.d.ts +12 -0
- package/lib/table/transforms/index.js +131 -0
- package/lib/table/transforms/orderField.d.ts +3 -0
- package/lib/table/transforms/orderField.js +33 -0
- package/lib/table/transforms/sort.d.ts +43 -0
- package/lib/table/transforms/sort.js +369 -0
- package/lib/table/transforms/tips.d.ts +8 -0
- package/lib/table/transforms/tips.js +71 -0
- package/lib/table/transforms/treeMode.d.ts +30 -0
- package/lib/table/transforms/treeMode.js +286 -0
- package/lib/table/transforms/visible.d.ts +5 -0
- package/lib/table/transforms/visible.js +31 -0
- package/lib/table/transforms/warnTransformsDeprecated.d.ts +1 -0
- package/lib/table/transforms/warnTransformsDeprecated.js +19 -0
- package/lib/table/use/useResizeObserver.d.ts +2 -0
- package/lib/table/use/useResizeObserver.js +32 -0
- package/lib/table/utils/applyTransforms.d.ts +6 -0
- package/lib/table/utils/applyTransforms.js +24 -0
- package/lib/table/utils/buildTree.d.ts +36 -0
- package/lib/table/utils/buildTree.js +140 -0
- package/lib/table/utils/collectNodes.d.ts +8 -0
- package/lib/table/utils/collectNodes.js +72 -0
- package/lib/table/utils/console.d.ts +11 -0
- package/lib/table/utils/console.js +68 -0
- package/lib/table/utils/copyToClipboard.d.ts +3 -0
- package/lib/table/utils/copyToClipboard.js +40 -0
- package/lib/table/utils/element.d.ts +42 -0
- package/lib/table/utils/element.js +243 -0
- package/lib/table/utils/exportTableAsExcel.d.ts +4 -0
- package/lib/table/utils/exportTableAsExcel.js +205 -0
- package/lib/table/utils/getTreeDepth.d.ts +3 -0
- package/lib/table/utils/getTreeDepth.js +54 -0
- package/lib/table/utils/groupBy.d.ts +1 -0
- package/lib/table/utils/groupBy.js +48 -0
- package/lib/table/utils/index.d.ts +18 -0
- package/lib/table/utils/index.js +187 -0
- package/lib/table/utils/isGroupColumn.d.ts +2 -0
- package/lib/table/utils/isGroupColumn.js +17 -0
- package/lib/table/utils/isLeafNode.d.ts +2 -0
- package/lib/table/utils/isLeafNode.js +11 -0
- package/lib/table/utils/layeredFilter.d.ts +2 -0
- package/lib/table/utils/layeredFilter.js +38 -0
- package/lib/table/utils/layeredSort.d.ts +5 -0
- package/lib/table/utils/layeredSort.js +37 -0
- package/lib/table/utils/makeRecursiveMapper.d.ts +9 -0
- package/lib/table/utils/makeRecursiveMapper.js +94 -0
- package/lib/table/utils/mergeCellProps.d.ts +8 -0
- package/lib/table/utils/mergeCellProps.js +78 -0
- package/lib/table/utils/others.d.ts +16 -0
- package/lib/table/utils/others.js +108 -0
- package/lib/table/utils/proto.d.ts +21 -0
- package/lib/table/utils/proto.js +117 -0
- package/lib/table/utils/smartCompare.d.ts +9 -0
- package/lib/table/utils/smartCompare.js +58 -0
- package/lib/table/utils/traverseColumn.d.ts +11 -0
- package/lib/table/utils/traverseColumn.js +103 -0
- package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.d.ts +22 -0
- package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.js +154 -0
- package/lib/table/utils/tree-data-helpers/TreeDataHelper.d.ts +26 -0
- package/lib/table/utils/tree-data-helpers/TreeDataHelper.js +358 -0
- package/package.json +213 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
2
|
+
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
3
|
+
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
4
|
+
import _getIterator from "@babel/runtime-corejs3/core-js/get-iterator";
|
|
5
|
+
import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
|
|
6
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
7
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
8
|
+
|
|
9
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof _Symbol === "undefined" || _getIteratorMethod(o) == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = _getIterator(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
10
|
+
|
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { var _context; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
import isLeafNode from './isLeafNode';
|
|
16
|
+
export default function makeRecursiveMapper(fn) {
|
|
17
|
+
return function (tree) {
|
|
18
|
+
return dfs(tree, 0, []).result;
|
|
19
|
+
|
|
20
|
+
function dfs(nodes, parentStartIndex, path) {
|
|
21
|
+
var flatCount = 0;
|
|
22
|
+
var result = [];
|
|
23
|
+
|
|
24
|
+
var _iterator = _createForOfIteratorHelper(nodes),
|
|
25
|
+
_step;
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
29
|
+
var node = _step.value;
|
|
30
|
+
path.push(node);
|
|
31
|
+
var startIndex = parentStartIndex + flatCount;
|
|
32
|
+
var subResult = void 0;
|
|
33
|
+
|
|
34
|
+
if (isLeafNode(node)) {
|
|
35
|
+
subResult = fn(node, {
|
|
36
|
+
// parentStartIndex,
|
|
37
|
+
startIndex: startIndex,
|
|
38
|
+
endIndex: startIndex + 1,
|
|
39
|
+
path: _sliceInstanceProperty(path).call(path),
|
|
40
|
+
isLeaf: true
|
|
41
|
+
});
|
|
42
|
+
flatCount += 1;
|
|
43
|
+
} else {
|
|
44
|
+
var dfsResult = dfs(node.children, startIndex, path);
|
|
45
|
+
subResult = fn(_extends(_extends({}, node), {
|
|
46
|
+
children: dfsResult.result
|
|
47
|
+
}), {
|
|
48
|
+
startIndex: startIndex,
|
|
49
|
+
endIndex: startIndex + dfsResult.flatCount,
|
|
50
|
+
path: _sliceInstanceProperty(path).call(path),
|
|
51
|
+
isLeaf: false
|
|
52
|
+
});
|
|
53
|
+
flatCount += dfsResult.flatCount;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (Array.isArray(subResult)) {
|
|
57
|
+
result.push.apply(result, _toConsumableArray(subResult));
|
|
58
|
+
} else if (subResult != null) {
|
|
59
|
+
result.push(subResult);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
path.pop();
|
|
63
|
+
}
|
|
64
|
+
} catch (err) {
|
|
65
|
+
_iterator.e(err);
|
|
66
|
+
} finally {
|
|
67
|
+
_iterator.f();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
result: result,
|
|
72
|
+
flatCount: flatCount
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CellProps } from '../interfaces';
|
|
2
|
+
/** 合并两个 cellProps(单元格属性)对象,返回一个合并后的全新对象。
|
|
3
|
+
*
|
|
4
|
+
* mergeCellProps 会按照以下规则来合并两个对象:
|
|
5
|
+
* * 对于 数字、字符串、布尔值类型的字段,extra 中的字段值将直接覆盖 base 中的字段值(className 是个特例,会进行字符串拼接)
|
|
6
|
+
* * 对于函数/方法类型的字段(对应单元格的事件回调函数),mergeCellProps 将生成一个新的函数,新函数将按序调用 base 和 extra 中的方法
|
|
7
|
+
* * 对于普通对象类型的字段(对应单元格的样式),mergeCellProps 将合并两个对象 */
|
|
8
|
+
export default function mergeCellProps(base: CellProps, extra: CellProps): CellProps;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
2
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
3
|
+
import _Object$keys2 from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
4
|
+
import cx from 'classnames';
|
|
5
|
+
|
|
6
|
+
function composeEventHandler(handler1, handler2) {
|
|
7
|
+
return function () {
|
|
8
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9
|
+
args[_key] = arguments[_key];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// 先执行原有的事件回调函数
|
|
13
|
+
handler1(args);
|
|
14
|
+
handler2(args); // 事件回调函数没有返回值,故这里不进行 return
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** 合并两个 cellProps(单元格属性)对象,返回一个合并后的全新对象。
|
|
18
|
+
*
|
|
19
|
+
* mergeCellProps 会按照以下规则来合并两个对象:
|
|
20
|
+
* * 对于 数字、字符串、布尔值类型的字段,extra 中的字段值将直接覆盖 base 中的字段值(className 是个特例,会进行字符串拼接)
|
|
21
|
+
* * 对于函数/方法类型的字段(对应单元格的事件回调函数),mergeCellProps 将生成一个新的函数,新函数将按序调用 base 和 extra 中的方法
|
|
22
|
+
* * 对于普通对象类型的字段(对应单元格的样式),mergeCellProps 将合并两个对象 */
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export default function mergeCellProps(base, extra) {
|
|
26
|
+
if (base == null) {
|
|
27
|
+
return extra;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (extra == null) {
|
|
31
|
+
return base;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
var result = _extends({}, base);
|
|
35
|
+
|
|
36
|
+
for (var _i = 0, _Object$keys = _Object$keys2(extra); _i < _Object$keys.length; _i++) {
|
|
37
|
+
var key = _Object$keys[_i];
|
|
38
|
+
var value = extra[key];
|
|
39
|
+
|
|
40
|
+
var type = _typeof(value);
|
|
41
|
+
|
|
42
|
+
if (value === null) {
|
|
43
|
+
// value=null 时 覆盖原来的值
|
|
44
|
+
result[key] = null;
|
|
45
|
+
} else if (value === undefined) {// value=undefined 时 保留原来的值
|
|
46
|
+
} else if (type === 'number' || type === 'string' || type === 'boolean') {
|
|
47
|
+
if (key === 'className') {
|
|
48
|
+
result[key] = cx(result[key], value);
|
|
49
|
+
} else {
|
|
50
|
+
result[key] = value;
|
|
51
|
+
}
|
|
52
|
+
} else if (type === 'function') {
|
|
53
|
+
var prev = result[key];
|
|
54
|
+
|
|
55
|
+
if (prev == null) {
|
|
56
|
+
result[key] = value;
|
|
57
|
+
} else {
|
|
58
|
+
result[key] = composeEventHandler(prev, value);
|
|
59
|
+
}
|
|
60
|
+
} else if (type === 'object') {
|
|
61
|
+
result[key] = _extends({}, result[key], value);
|
|
62
|
+
} // else `type` is 'bigint' or 'symbol', `value` is an invalid cellProp, ignore it
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare function flatMap<T, U>(array: T[], callback: (value: T, index: number, array: T[]) => U[]): U[];
|
|
2
|
+
export declare function fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
|
|
3
|
+
[x: string]: T;
|
|
4
|
+
[x: number]: T;
|
|
5
|
+
};
|
|
6
|
+
export declare const arrayUtils: {
|
|
7
|
+
readonly diff: (arr1: string[], arr2: Iterable<string>) => string[];
|
|
8
|
+
readonly merge: (arr1: string[], arr2: string[]) => string[];
|
|
9
|
+
};
|
|
10
|
+
export declare function always<T>(value: T): (...args: any[]) => T;
|
|
11
|
+
interface treeItem {
|
|
12
|
+
children?: any[];
|
|
13
|
+
code?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function findByTree<T extends treeItem, U>(array: T[], callback: (value: T, index: number, array: T[]) => number): T;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
2
|
+
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
3
|
+
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
4
|
+
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
5
|
+
import _getIterator from "@babel/runtime-corejs3/core-js/get-iterator";
|
|
6
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
7
|
+
import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
|
|
8
|
+
import _Set from "@babel/runtime-corejs3/core-js-stable/set";
|
|
9
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
10
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
11
|
+
import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
|
|
12
|
+
|
|
13
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof _Symbol === "undefined" || _getIteratorMethod(o) == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = _getIterator(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
14
|
+
|
|
15
|
+
function _unsupportedIterableToArray(o, minLen) { var _context; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
export function flatMap(array, callback) {
|
|
20
|
+
var result = [];
|
|
21
|
+
array.forEach(function (value, index) {
|
|
22
|
+
result.push.apply(result, _toConsumableArray(callback(value, index, array)));
|
|
23
|
+
});
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
export function fromEntries(entries) {
|
|
27
|
+
var result = {};
|
|
28
|
+
|
|
29
|
+
var _iterator = _createForOfIteratorHelper(entries),
|
|
30
|
+
_step;
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
34
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
|
35
|
+
key = _step$value[0],
|
|
36
|
+
value = _step$value[1];
|
|
37
|
+
|
|
38
|
+
result[key] = value;
|
|
39
|
+
}
|
|
40
|
+
} catch (err) {
|
|
41
|
+
_iterator.e(err);
|
|
42
|
+
} finally {
|
|
43
|
+
_iterator.f();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
export var arrayUtils = {
|
|
49
|
+
diff: function diff(arr1, arr2) {
|
|
50
|
+
var set = new _Set(arr2);
|
|
51
|
+
return _filterInstanceProperty(arr1).call(arr1, function (x) {
|
|
52
|
+
return !set.has(x);
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
merge: function merge(arr1, arr2) {
|
|
56
|
+
var set = new _Set(arr1);
|
|
57
|
+
return _concatInstanceProperty(arr1).call(arr1, _filterInstanceProperty(arr2).call(arr2, function (x) {
|
|
58
|
+
return !set.has(x);
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
export function always(value) {
|
|
63
|
+
return function () {
|
|
64
|
+
return value;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export function findByTree(array, callback) {
|
|
68
|
+
return _findInstanceProperty(array).call(array, function (item, index) {
|
|
69
|
+
var result = false;
|
|
70
|
+
var findedIndex = callback(item, index, array);
|
|
71
|
+
|
|
72
|
+
if (findedIndex >= 0) {
|
|
73
|
+
result = true;
|
|
74
|
+
} else if (item.children) {
|
|
75
|
+
result = findByTree(item.children, callback);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return result;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare type SameKeysWith<T> = T extends object ? {
|
|
2
|
+
[key in keyof T]?: any;
|
|
3
|
+
} : T;
|
|
4
|
+
interface ObjectProto<T> {
|
|
5
|
+
(v: SameKeysWith<T>): T;
|
|
6
|
+
extends(ext: SameKeysWith<T>): ObjectProto<T>;
|
|
7
|
+
}
|
|
8
|
+
interface ArrayProto<T> {
|
|
9
|
+
(items: SameKeysWith<T>[]): T[];
|
|
10
|
+
extends(extRecord: SameKeysWith<T>): ArrayProto<T>;
|
|
11
|
+
}
|
|
12
|
+
export interface ProtoStatic {
|
|
13
|
+
string(v: string): string;
|
|
14
|
+
number(v: number): number;
|
|
15
|
+
notNull<T = any>(v: any): T;
|
|
16
|
+
object<O extends object = any>(base: SameKeysWith<O>): ObjectProto<O>;
|
|
17
|
+
array<T extends object = any>(base: SameKeysWith<T>): ArrayProto<T>;
|
|
18
|
+
readonly empty: unique symbol;
|
|
19
|
+
}
|
|
20
|
+
declare const _default: ProtoStatic;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
3
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
4
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
5
|
+
|
|
6
|
+
var factorySymbol = _Symbol('factory-symbol');
|
|
7
|
+
|
|
8
|
+
function isProtoFactory(v) {
|
|
9
|
+
return v && v[factorySymbol];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function proto(baseRecord) {
|
|
13
|
+
var ensureArray = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'auto';
|
|
14
|
+
|
|
15
|
+
var baseKeys = _Object$keys(baseRecord);
|
|
16
|
+
|
|
17
|
+
function process(record) {
|
|
18
|
+
var result = _extends({}, record);
|
|
19
|
+
|
|
20
|
+
baseKeys.forEach(function (key) {
|
|
21
|
+
var _a;
|
|
22
|
+
|
|
23
|
+
if (result[key] === proto.empty) {
|
|
24
|
+
delete result[key];
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var base = baseRecord[key];
|
|
29
|
+
|
|
30
|
+
if (isProtoFactory(base)) {
|
|
31
|
+
result[key] = base(result[key]);
|
|
32
|
+
} else {
|
|
33
|
+
result[key] = (_a = result[key]) !== null && _a !== void 0 ? _a : base;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function factory(arg) {
|
|
40
|
+
var isEnsureArray = ensureArray === 'auto' ? Array.isArray(arg) : ensureArray;
|
|
41
|
+
|
|
42
|
+
if (isEnsureArray) {
|
|
43
|
+
if (arg == null) {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return _mapInstanceProperty(arg).call(arg, process);
|
|
48
|
+
} else {
|
|
49
|
+
return process(arg);
|
|
50
|
+
}
|
|
51
|
+
} // @ts-ignore
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
factory[factorySymbol] = true;
|
|
55
|
+
|
|
56
|
+
factory.extends = function (extRecord) {
|
|
57
|
+
var extFactory = proto(extRecord, ensureArray);
|
|
58
|
+
return function (arg) {
|
|
59
|
+
return factory(extFactory(arg));
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return factory;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
proto.empty = _Symbol('proto.empty');
|
|
67
|
+
|
|
68
|
+
proto.string = function (v) {
|
|
69
|
+
if (v != null && typeof v !== 'string') {
|
|
70
|
+
throw new Error('must be string');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return v;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
proto.string[factorySymbol] = true;
|
|
77
|
+
|
|
78
|
+
proto.number = function (v) {
|
|
79
|
+
if (v != null && typeof v !== 'number') {
|
|
80
|
+
throw new Error('must be number');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return v;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
proto.number[factorySymbol] = true;
|
|
87
|
+
|
|
88
|
+
proto.notNull = function (v) {
|
|
89
|
+
if (v == null) {
|
|
90
|
+
throw new Error('must be not null');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return v;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
proto.notNull[factorySymbol] = true;
|
|
97
|
+
|
|
98
|
+
proto.object = function (baseRecord) {
|
|
99
|
+
return proto(baseRecord, false);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
proto.array = function (baseRecord) {
|
|
103
|
+
return proto(baseRecord, true);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export default proto;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** 比较函数,支持字符串、数字、数组和 null。
|
|
2
|
+
* * 对于字符串将比较两者的字典序;
|
|
3
|
+
* * 对数字将比较两者大小;
|
|
4
|
+
* * null 值在比较时总是小于另一个值;
|
|
5
|
+
* * 对于数组来说,将逐个比较数组中的元素,第一个不相等的比较结果将作为整个数组的比较结果
|
|
6
|
+
*
|
|
7
|
+
* 数组的比较可参考 python 中的元祖比较:
|
|
8
|
+
* https://stackoverflow.com/questions/5292303/how-does-tuple-comparison-work-in-python */
|
|
9
|
+
export default function smartCompare(x: any, y: any): number;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** 比较函数,支持字符串、数字、数组和 null。
|
|
2
|
+
* * 对于字符串将比较两者的字典序;
|
|
3
|
+
* * 对数字将比较两者大小;
|
|
4
|
+
* * null 值在比较时总是小于另一个值;
|
|
5
|
+
* * 对于数组来说,将逐个比较数组中的元素,第一个不相等的比较结果将作为整个数组的比较结果
|
|
6
|
+
*
|
|
7
|
+
* 数组的比较可参考 python 中的元祖比较:
|
|
8
|
+
* https://stackoverflow.com/questions/5292303/how-does-tuple-comparison-work-in-python */
|
|
9
|
+
export default function smartCompare(x, y) {
|
|
10
|
+
// 将 null 排在最后面
|
|
11
|
+
if (x == null) {
|
|
12
|
+
return 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (y == null) {
|
|
16
|
+
return -1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (typeof x === 'number' && typeof y === 'number') {
|
|
20
|
+
return x - y;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (typeof x === 'string' && typeof y === 'string') {
|
|
24
|
+
// 字符串使用 默认的字典序
|
|
25
|
+
if (x < y) {
|
|
26
|
+
return -1;
|
|
27
|
+
} else if (x > y) {
|
|
28
|
+
return 1;
|
|
29
|
+
} else {
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (Array.isArray(x) && Array.isArray(y)) {
|
|
35
|
+
var len = Math.min(x.length, y.length);
|
|
36
|
+
|
|
37
|
+
for (var i = 0; i < len; i++) {
|
|
38
|
+
var cmp = smartCompare(x[i], y[i]);
|
|
39
|
+
|
|
40
|
+
if (cmp !== 0) {
|
|
41
|
+
return cmp;
|
|
42
|
+
}
|
|
43
|
+
} // 数组长度不等时,元素少的字段放在前面
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
return x.length - y.length;
|
|
47
|
+
} // 对于不认识的数据类型,返回 0
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
return 0;
|
|
51
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ArtColumn, TableTransform } from '../interfaces';
|
|
2
|
+
declare type NormalizeAsArrayInput<T> = null | T | T[];
|
|
3
|
+
/** @deprecated 该 API 已经过时,请使用 makeRecursiveMapper */
|
|
4
|
+
export default function traverseColumn(fn: (column: ArtColumn, ctx: {
|
|
5
|
+
range: {
|
|
6
|
+
start: number;
|
|
7
|
+
end: number;
|
|
8
|
+
};
|
|
9
|
+
dataSource: any[];
|
|
10
|
+
}) => NormalizeAsArrayInput<ArtColumn>): TableTransform;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
2
|
+
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
3
|
+
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
4
|
+
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
5
|
+
import _getIterator from "@babel/runtime-corejs3/core-js/get-iterator";
|
|
6
|
+
import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
|
|
7
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
8
|
+
|
|
9
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof _Symbol === "undefined" || _getIteratorMethod(o) == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = _getIterator(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
10
|
+
|
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { var _context; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
import isLeafNode from './isLeafNode';
|
|
16
|
+
|
|
17
|
+
function normalizeAsArray(input) {
|
|
18
|
+
if (input == null) {
|
|
19
|
+
return [];
|
|
20
|
+
} else if (Array.isArray(input)) {
|
|
21
|
+
return input;
|
|
22
|
+
} else {
|
|
23
|
+
return [input];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** @deprecated 该 API 已经过时,请使用 makeRecursiveMapper */
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
export default function traverseColumn(fn) {
|
|
30
|
+
return function (_ref) {
|
|
31
|
+
var columns = _ref.columns,
|
|
32
|
+
dataSource = _ref.dataSource;
|
|
33
|
+
return {
|
|
34
|
+
dataSource: dataSource,
|
|
35
|
+
columns: dfs(columns, 0).result
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
function dfs(columns, parentStartColIndex) {
|
|
39
|
+
var flatColCount = 0;
|
|
40
|
+
var result = [];
|
|
41
|
+
|
|
42
|
+
var _iterator = _createForOfIteratorHelper(columns),
|
|
43
|
+
_step;
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
47
|
+
var col = _step.value;
|
|
48
|
+
var startColIndex = parentStartColIndex + flatColCount;
|
|
49
|
+
var unNormalized = void 0;
|
|
50
|
+
|
|
51
|
+
if (isLeafNode(col)) {
|
|
52
|
+
unNormalized = fn(col, {
|
|
53
|
+
range: {
|
|
54
|
+
start: startColIndex,
|
|
55
|
+
end: startColIndex + 1
|
|
56
|
+
},
|
|
57
|
+
dataSource: dataSource
|
|
58
|
+
});
|
|
59
|
+
flatColCount += 1;
|
|
60
|
+
} else {
|
|
61
|
+
var dfsResult = dfs(col.children, startColIndex);
|
|
62
|
+
unNormalized = fn(_extends(_extends({}, col), {
|
|
63
|
+
children: dfsResult.result
|
|
64
|
+
}), {
|
|
65
|
+
range: {
|
|
66
|
+
start: startColIndex,
|
|
67
|
+
end: startColIndex + dfsResult.flatColCount
|
|
68
|
+
},
|
|
69
|
+
dataSource: dataSource
|
|
70
|
+
});
|
|
71
|
+
flatColCount += dfsResult.flatColCount;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
result.push.apply(result, _toConsumableArray(normalizeAsArray(unNormalized)));
|
|
75
|
+
}
|
|
76
|
+
} catch (err) {
|
|
77
|
+
_iterator.e(err);
|
|
78
|
+
} finally {
|
|
79
|
+
_iterator.f();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
result: result,
|
|
84
|
+
flatColCount: flatColCount
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AbstractTreeNode } from '../../interfaces';
|
|
2
|
+
export interface StrictTreeDataHelperOptions<N extends AbstractTreeNode> {
|
|
3
|
+
tree: N[];
|
|
4
|
+
getNodeValue(node: N): string;
|
|
5
|
+
value: string[];
|
|
6
|
+
}
|
|
7
|
+
export default class StrictTreeDataHelper<N extends AbstractTreeNode> {
|
|
8
|
+
private readonly opts;
|
|
9
|
+
private readonly valueSet;
|
|
10
|
+
private wrapperMap;
|
|
11
|
+
private rootWrapper;
|
|
12
|
+
constructor(opts: StrictTreeDataHelperOptions<N>);
|
|
13
|
+
private initWrapperTree;
|
|
14
|
+
private get value();
|
|
15
|
+
isIndeterminate(nodeValue: string): boolean;
|
|
16
|
+
isChecked(nodeValue: string): boolean;
|
|
17
|
+
getValueAfterCheck(nodeValue: string): string[];
|
|
18
|
+
getValueAfterUncheck(nodeValue: string): string[];
|
|
19
|
+
getValueAfterToggle(nodeValue: string): string[];
|
|
20
|
+
getNode(nodeValue: string): N;
|
|
21
|
+
getCleanValue(): string[];
|
|
22
|
+
}
|