@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,173 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime-corejs3/helpers/taggedTemplateLiteral";
|
|
3
|
+
|
|
4
|
+
var _templateObject, _templateObject2;
|
|
5
|
+
|
|
6
|
+
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
7
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
8
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import styled from 'styled-components';
|
|
11
|
+
import { fromEvent } from 'rxjs';
|
|
12
|
+
import * as op from 'rxjs/operators';
|
|
13
|
+
import { mergeCellProps, collectNodes, makeRecursiveMapper, isGroupColumn } from '../../utils';
|
|
14
|
+
import { internals } from '../../internals';
|
|
15
|
+
import { Classes } from '../../base/styles';
|
|
16
|
+
var TableHeaderCellResize = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n right: -5px;\n height: 100%;\n width: 10px;\n cursor: ew-resize;\n display: flex;\n flex-direction: column;\n align-items: center;\n z-index:1;\n\n &:after {\n content: \"\";\n position: absolute;\n display: block;\n left: calc(50% - 1px);\n width: 1px;\n height: calc(100% - 14px);\n top: 7px;\n background-color: var(--border-color);\n }\n"])));
|
|
17
|
+
var TableHeaderGroupCellResize = styled(TableHeaderCellResize)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &:after {\n height: 100%;\n top: 0;\n }\n"])));
|
|
18
|
+
|
|
19
|
+
function clamp(min, x, max) {
|
|
20
|
+
return Math.max(min, Math.min(max, x));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function disableSelect(event) {
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function columnResize() {
|
|
28
|
+
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
29
|
+
|
|
30
|
+
var _a, _b, _c;
|
|
31
|
+
|
|
32
|
+
var stateKey = 'columnResize';
|
|
33
|
+
var minSize = (_a = opts.minSize) !== null && _a !== void 0 ? _a : 60;
|
|
34
|
+
var fallbackSize = (_b = opts.fallbackSize) !== null && _b !== void 0 ? _b : 150;
|
|
35
|
+
var maxSize = (_c = opts.maxSize) !== null && _c !== void 0 ? _c : 1000;
|
|
36
|
+
return function columnResizeFeature(pipeline) {
|
|
37
|
+
var _a, _b, _c;
|
|
38
|
+
|
|
39
|
+
var columnSize = (_b = (_a = opts.columnSize) !== null && _a !== void 0 ? _a : pipeline.getStateAtKey(stateKey)) !== null && _b !== void 0 ? _b : {};
|
|
40
|
+
var leafColumns = collectNodes(pipeline.getColumns(), 'leaf-only');
|
|
41
|
+
leafColumns.forEach(function (_ref) {
|
|
42
|
+
var code = _ref.code,
|
|
43
|
+
width = _ref.width;
|
|
44
|
+
|
|
45
|
+
if (columnSize[code] === undefined) {
|
|
46
|
+
if (typeof width === 'number') {
|
|
47
|
+
columnSize[code] = width;
|
|
48
|
+
} else {
|
|
49
|
+
columnSize[code] = fallbackSize;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}); // 初始化 || opts.columnSize发生变化(为了autofill时能取到最新值)
|
|
53
|
+
|
|
54
|
+
if (!pipeline.getStateAtKey(stateKey) || ((_c = pipeline.ref) === null || _c === void 0 ? void 0 : _c.current.lastOptColumnSize) !== opts.columnSize) {
|
|
55
|
+
pipeline.setStateAtKey(stateKey, columnSize);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (pipeline.ref) {
|
|
59
|
+
pipeline.ref.current.lastOptColumnSize = opts.columnSize;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
var onChangeSize = function onChangeSize(nextColumnSize) {
|
|
63
|
+
window.requestAnimationFrame(function () {
|
|
64
|
+
var _a;
|
|
65
|
+
|
|
66
|
+
pipeline.setStateAtKey(stateKey, nextColumnSize);
|
|
67
|
+
(_a = opts === null || opts === void 0 ? void 0 : opts.onChangeSize) === null || _a === void 0 ? void 0 : _a.call(opts, nextColumnSize);
|
|
68
|
+
|
|
69
|
+
if (opts.columnSize) {
|
|
70
|
+
if (pipeline.ref) {
|
|
71
|
+
pipeline.ref.current.lastOptColumnSize = nextColumnSize; // 这里记录由列宽拖拽导致的opts.columnSize变化,避免重复渲染
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
var handleMouseDown = function handleMouseDown(e, col) {
|
|
78
|
+
window.addEventListener('selectstart', disableSelect);
|
|
79
|
+
var changedColumnSize = {};
|
|
80
|
+
var startX = e.clientX;
|
|
81
|
+
var children = col.children,
|
|
82
|
+
code = col.code;
|
|
83
|
+
var recordColumnSize = columnSize;
|
|
84
|
+
e.stopPropagation();
|
|
85
|
+
var nextSize$ = fromEvent(window, 'mousemove').pipe(op.takeUntil(fromEvent(window, 'mouseup')), op.map(function (e) {
|
|
86
|
+
var movingX = e.clientX;
|
|
87
|
+
|
|
88
|
+
var nextColumnSize = _extends({}, columnSize);
|
|
89
|
+
|
|
90
|
+
var deltaSum = movingX - startX;
|
|
91
|
+
var deltaRemaining = deltaSum;
|
|
92
|
+
|
|
93
|
+
if ((children === null || children === void 0 ? void 0 : children.length) > 0) {
|
|
94
|
+
var leafChildColumns = collectNodes(children, 'leaf-only');
|
|
95
|
+
|
|
96
|
+
var childrenWidthSum = _reduceInstanceProperty(leafChildColumns).call(leafChildColumns, function (sum, _ref2) {
|
|
97
|
+
var code = _ref2.code;
|
|
98
|
+
return sum + columnSize[code];
|
|
99
|
+
}, 0);
|
|
100
|
+
|
|
101
|
+
leafChildColumns.forEach(function (_ref3, index) {
|
|
102
|
+
var code = _ref3.code;
|
|
103
|
+
var startSize = columnSize[code];
|
|
104
|
+
var currentDeltaWidth = Math.round(deltaSum * startSize / childrenWidthSum);
|
|
105
|
+
|
|
106
|
+
if (index < leafChildColumns.length - 1) {
|
|
107
|
+
nextColumnSize[code] = clamp(minSize, startSize + currentDeltaWidth, maxSize);
|
|
108
|
+
changedColumnSize[code] = nextColumnSize[code];
|
|
109
|
+
deltaRemaining -= currentDeltaWidth;
|
|
110
|
+
} else {
|
|
111
|
+
nextColumnSize[code] = clamp(minSize, startSize + deltaRemaining, maxSize);
|
|
112
|
+
changedColumnSize[code] = nextColumnSize[code];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
} else {
|
|
116
|
+
var startSize = columnSize[code];
|
|
117
|
+
nextColumnSize[code] = clamp(minSize, startSize + deltaSum, maxSize);
|
|
118
|
+
changedColumnSize[code] = nextColumnSize[code];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
recordColumnSize = nextColumnSize;
|
|
122
|
+
return nextColumnSize;
|
|
123
|
+
}));
|
|
124
|
+
nextSize$.subscribe({
|
|
125
|
+
next: onChangeSize,
|
|
126
|
+
complete: function complete() {
|
|
127
|
+
var _context;
|
|
128
|
+
|
|
129
|
+
var changedColumnSizes = _mapInstanceProperty(_context = _Object$keys(changedColumnSize)).call(_context, function (code) {
|
|
130
|
+
return {
|
|
131
|
+
code: code,
|
|
132
|
+
width: changedColumnSize[code]
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
window.requestAnimationFrame(function () {
|
|
137
|
+
var _a;
|
|
138
|
+
|
|
139
|
+
(_a = opts === null || opts === void 0 ? void 0 : opts.afterChangeSize) === null || _a === void 0 ? void 0 : _a.call(opts, recordColumnSize, changedColumnSizes);
|
|
140
|
+
});
|
|
141
|
+
window.removeEventListener('selectstart', disableSelect);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
var isGroup = isGroupColumn(pipeline.getColumns());
|
|
147
|
+
return pipeline.mapColumns(makeRecursiveMapper(function (col) {
|
|
148
|
+
var _a;
|
|
149
|
+
|
|
150
|
+
var prevTitle = internals.safeRenderHeader(col);
|
|
151
|
+
var code = col.code,
|
|
152
|
+
features = col.features,
|
|
153
|
+
width = col.width;
|
|
154
|
+
return _extends(_extends({}, col), {
|
|
155
|
+
width: (_a = columnSize[code]) !== null && _a !== void 0 ? _a : width,
|
|
156
|
+
title: /*#__PURE__*/React.createElement(React.Fragment, null, prevTitle, (features === null || features === void 0 ? void 0 : features.resizeable) !== false && (isGroup ? /*#__PURE__*/React.createElement(TableHeaderGroupCellResize, {
|
|
157
|
+
className: Classes.tableHeaderCellResize,
|
|
158
|
+
onMouseDown: function onMouseDown(e) {
|
|
159
|
+
return handleMouseDown(e, col);
|
|
160
|
+
}
|
|
161
|
+
}) : /*#__PURE__*/React.createElement(TableHeaderCellResize, {
|
|
162
|
+
className: Classes.tableHeaderCellResize,
|
|
163
|
+
onMouseDown: function onMouseDown(e) {
|
|
164
|
+
return handleMouseDown(e, col);
|
|
165
|
+
}
|
|
166
|
+
}))),
|
|
167
|
+
headerCellProps: mergeCellProps(col.headerCellProps, {
|
|
168
|
+
className: 'resizeable'
|
|
169
|
+
})
|
|
170
|
+
});
|
|
171
|
+
}));
|
|
172
|
+
};
|
|
173
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TablePipeline } from '../pipeline';
|
|
2
|
+
interface ContextMenuItem {
|
|
3
|
+
name: string;
|
|
4
|
+
action: () => {};
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface ContextMenuFeatureOptions {
|
|
8
|
+
/** 获得自定义菜单 */
|
|
9
|
+
getContextMenuItems?: (params: any) => ContextMenuItem[];
|
|
10
|
+
/** 弹出框的父容器 */
|
|
11
|
+
popupParent?: HTMLElement;
|
|
12
|
+
}
|
|
13
|
+
export declare function contextMenu(opts?: ContextMenuFeatureOptions): (pipeline: TablePipeline) => TablePipeline;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
3
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
4
|
+
import React, { useRef, useEffect } from 'react';
|
|
5
|
+
import ReactDOM from 'react-dom';
|
|
6
|
+
import { ContextMenuStyleWrap } from '../../common-views';
|
|
7
|
+
import { copyDataToClipboard, executeOnTempElement, console, getEventPath, isElementInEventPath, getTargetEleInEventPath } from '../../utils';
|
|
8
|
+
import { findByTree } from '../../utils/others';
|
|
9
|
+
import { internals } from '../../internals';
|
|
10
|
+
import { MenuClasses } from '../../base/styles';
|
|
11
|
+
var stateKey = 'contextMenu';
|
|
12
|
+
export function contextMenu() {
|
|
13
|
+
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
14
|
+
return function step(pipeline) {
|
|
15
|
+
var popupParent = opts.popupParent || document.body;
|
|
16
|
+
var menuHelper = new MenuHelper();
|
|
17
|
+
|
|
18
|
+
var addPopup = function addPopup(menu) {
|
|
19
|
+
var ePopupDiv = document.createElement('div');
|
|
20
|
+
ePopupDiv.setAttribute('class', 'kd-table-popup');
|
|
21
|
+
popupParent.appendChild(ePopupDiv);
|
|
22
|
+
var popupHidden = false;
|
|
23
|
+
var eventList = ['mousedown', 'contextmenu'];
|
|
24
|
+
|
|
25
|
+
var hidePopup = function hidePopup(event) {
|
|
26
|
+
if (isEventFromCurrentPopup(event, ePopupDiv) || popupHidden) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
popupHidden = true;
|
|
31
|
+
popupParent.removeChild(ePopupDiv);
|
|
32
|
+
eventList.forEach(function (eventType) {
|
|
33
|
+
window.removeEventListener(eventType, hidePopup, true);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
ReactDOM.render(menu, ePopupDiv, function () {
|
|
38
|
+
setTimeout(function () {
|
|
39
|
+
eventList.forEach(function (eventType) {
|
|
40
|
+
window.addEventListener(eventType, hidePopup, true);
|
|
41
|
+
});
|
|
42
|
+
}, 0);
|
|
43
|
+
});
|
|
44
|
+
return hidePopup;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var onContextMenu = function onContextMenu(e) {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
showContextMenu(e);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
pipeline.addTableProps({
|
|
53
|
+
onContextMenu: onContextMenu
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
var getContextMenuOptions = function getContextMenuOptions(record, column, value) {
|
|
57
|
+
var defaultMenuOptions = [];
|
|
58
|
+
|
|
59
|
+
if (column) {
|
|
60
|
+
defaultMenuOptions.push(getCopyItem(value));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (opts.getContextMenuItems) {
|
|
64
|
+
var params = {
|
|
65
|
+
record: record,
|
|
66
|
+
column: column,
|
|
67
|
+
value: value
|
|
68
|
+
};
|
|
69
|
+
return opts.getContextMenuItems(params);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return defaultMenuOptions;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
var hideContextMenu = function hideContextMenu() {
|
|
76
|
+
menuHelper.destroy();
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
var getPopupParent = function getPopupParent() {
|
|
80
|
+
return popupParent;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
var showContextMenu = function showContextMenu(e) {
|
|
84
|
+
var dataSource = pipeline.getDataSource();
|
|
85
|
+
var cellEle = getCellEleForEvent(e);
|
|
86
|
+
var code;
|
|
87
|
+
var rowIndex;
|
|
88
|
+
|
|
89
|
+
if (cellEle) {
|
|
90
|
+
code = cellEle.getAttribute('data-code'), rowIndex = cellEle.getAttribute('data-rowindex');
|
|
91
|
+
} else {
|
|
92
|
+
var rowEle = getRowEleForEvent(e, dataSource);
|
|
93
|
+
rowIndex = rowEle === null || rowEle === void 0 ? void 0 : rowEle.getAttribute('data-rowindex');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var record = dataSource[rowIndex];
|
|
97
|
+
var column = code !== undefined && findByTree(pipeline.getColumns(), function (item, index) {
|
|
98
|
+
return item.code === code ? index : -1;
|
|
99
|
+
});
|
|
100
|
+
var value = column && record && internals.safeGetValue(column, record, rowIndex);
|
|
101
|
+
var options = getContextMenuOptions(record, column, value);
|
|
102
|
+
|
|
103
|
+
if (options.length === 0) {
|
|
104
|
+
console.warn('context menu options is empty');
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var position = positionForMenu(e, popupParent);
|
|
109
|
+
var menu = /*#__PURE__*/React.createElement(Menu, {
|
|
110
|
+
options: options,
|
|
111
|
+
hideContextMenu: hideContextMenu,
|
|
112
|
+
position: position,
|
|
113
|
+
getPopupParent: getPopupParent
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
var _hidePopup = addPopup(menu);
|
|
117
|
+
|
|
118
|
+
menuHelper.init(_hidePopup);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
return pipeline;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function getMenuItemKey(_ref) {
|
|
126
|
+
var name = _ref.name,
|
|
127
|
+
index = _ref.index;
|
|
128
|
+
|
|
129
|
+
if (name) {
|
|
130
|
+
var _context;
|
|
131
|
+
|
|
132
|
+
var _key = 0;
|
|
133
|
+
name = name + '';
|
|
134
|
+
|
|
135
|
+
for (var i = 0; i < name.length; i++) {
|
|
136
|
+
_key += name.charCodeAt(name[i]);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return _concatInstanceProperty(_context = "".concat(_key, "_")).call(_context, index);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return index;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function Menu(props) {
|
|
146
|
+
var _props$options = props.options,
|
|
147
|
+
options = _props$options === void 0 ? [] : _props$options,
|
|
148
|
+
hideContextMenu = props.hideContextMenu,
|
|
149
|
+
position = props.position,
|
|
150
|
+
getPopupParent = props.getPopupParent;
|
|
151
|
+
var menuRef = useRef();
|
|
152
|
+
useEffect(function () {
|
|
153
|
+
if (menuRef.current) {
|
|
154
|
+
var popupParent = getPopupParent();
|
|
155
|
+
var x = position.x,
|
|
156
|
+
y = position.y;
|
|
157
|
+
|
|
158
|
+
var _keepWithinBounds = keepWithinBounds(popupParent, menuRef.current, x, y),
|
|
159
|
+
_x = _keepWithinBounds.x,
|
|
160
|
+
_y = _keepWithinBounds.y;
|
|
161
|
+
|
|
162
|
+
menuRef.current.style.left = _x + 'px';
|
|
163
|
+
menuRef.current.style.top = _y + 'px';
|
|
164
|
+
}
|
|
165
|
+
}, [position]);
|
|
166
|
+
return /*#__PURE__*/React.createElement(ContextMenuStyleWrap, {
|
|
167
|
+
className: MenuClasses.menu,
|
|
168
|
+
ref: menuRef,
|
|
169
|
+
style: {
|
|
170
|
+
left: position.x,
|
|
171
|
+
top: position.y
|
|
172
|
+
}
|
|
173
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
174
|
+
className: MenuClasses.menuList
|
|
175
|
+
}, _mapInstanceProperty(options).call(options, function (item, index) {
|
|
176
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
177
|
+
key: item.key ? item.key : getMenuItemKey({
|
|
178
|
+
name: item.name,
|
|
179
|
+
index: index
|
|
180
|
+
}),
|
|
181
|
+
name: item.name,
|
|
182
|
+
action: item.action,
|
|
183
|
+
hideContextMenu: hideContextMenu
|
|
184
|
+
});
|
|
185
|
+
})));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function MenuItem(props) {
|
|
189
|
+
var name = props.name,
|
|
190
|
+
action = props.action,
|
|
191
|
+
disabled = props.disabled,
|
|
192
|
+
hideContextMenu = props.hideContextMenu;
|
|
193
|
+
var itemRef = useRef();
|
|
194
|
+
|
|
195
|
+
var handleClick = function handleClick() {
|
|
196
|
+
hideContextMenu();
|
|
197
|
+
typeof action === 'function' && action();
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
var handleMouseEnter = function handleMouseEnter(e) {
|
|
201
|
+
if (disabled) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
var itemDom = itemRef.current;
|
|
206
|
+
|
|
207
|
+
if (itemDom) {
|
|
208
|
+
itemDom.classList.add(MenuClasses.menuOptionActive);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
var handleMouseLeave = function handleMouseLeave(e) {
|
|
213
|
+
if (disabled) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
var itemDom = itemRef.current;
|
|
218
|
+
|
|
219
|
+
if (itemDom) {
|
|
220
|
+
setTimeout(function () {
|
|
221
|
+
itemDom.classList.remove(MenuClasses.menuOptionActive);
|
|
222
|
+
}, 10);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
227
|
+
className: MenuClasses.menuOption,
|
|
228
|
+
ref: itemRef,
|
|
229
|
+
onClick: handleClick,
|
|
230
|
+
onMouseEnter: handleMouseEnter,
|
|
231
|
+
onMouseLeave: handleMouseLeave
|
|
232
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
233
|
+
className: MenuClasses.menuOptionText
|
|
234
|
+
}, name));
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
var MenuHelper = function MenuHelper() {
|
|
238
|
+
var _this = this;
|
|
239
|
+
|
|
240
|
+
_classCallCheck(this, MenuHelper);
|
|
241
|
+
|
|
242
|
+
this.init = function (hidePopup) {
|
|
243
|
+
_this.hidePopup = hidePopup;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
this.destroy = function () {
|
|
247
|
+
_this.hidePopup && _this.hidePopup();
|
|
248
|
+
_this.hidePopup = null;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
/** 是否点击是外部 start */
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
function isEventFromCurrentPopup(event, ele) {
|
|
255
|
+
if (!event || !ele) {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (isElementInEventPath(ele, event)) {
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function getCellEleInEventPath(path) {
|
|
267
|
+
return getTargetEleInEventPath(path, function (ele) {
|
|
268
|
+
return ele && ele.getAttribute('data-role') === 'table-cell';
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function getRowEleInEventPath(path) {
|
|
273
|
+
return getTargetEleInEventPath(path, function (ele) {
|
|
274
|
+
return ele && ele.getAttribute('data-role') === 'table-row';
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
/** 是否点击是外部 end */
|
|
278
|
+
|
|
279
|
+
/** 计算位置 start */
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
function calculatePointerRelative(event, popupParent) {
|
|
283
|
+
var parentRect = popupParent.getBoundingClientRect();
|
|
284
|
+
var documentRect = document.documentElement.getBoundingClientRect();
|
|
285
|
+
return {
|
|
286
|
+
x: event.clientX - (popupParent === document.body ? documentRect.left : parentRect.left),
|
|
287
|
+
y: event.clientY - (popupParent === document.body ? documentRect.top : parentRect.top)
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function positionForMenu(event, popupParent, params) {
|
|
292
|
+
var _calculatePointerRela = calculatePointerRelative(event, popupParent),
|
|
293
|
+
x = _calculatePointerRela.x,
|
|
294
|
+
y = _calculatePointerRela.y;
|
|
295
|
+
|
|
296
|
+
if (params) {
|
|
297
|
+
var offsetX = params.offsetX,
|
|
298
|
+
offsetY = params.offsetY;
|
|
299
|
+
|
|
300
|
+
if (offsetX) {
|
|
301
|
+
x -= offsetX;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if (offsetY) {
|
|
305
|
+
y -= offsetY;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return {
|
|
310
|
+
x: x,
|
|
311
|
+
y: y
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function keepWithinBounds(popupParent, ePopup, x, y) {
|
|
316
|
+
var parentRect = popupParent.getBoundingClientRect();
|
|
317
|
+
var docElement = document.documentElement;
|
|
318
|
+
var documentRect = docElement.getBoundingClientRect();
|
|
319
|
+
var ePopupRect = ePopup.getBoundingClientRect();
|
|
320
|
+
var parentWidth = parentRect.width;
|
|
321
|
+
var parentHeight = parentRect.height;
|
|
322
|
+
|
|
323
|
+
if (popupParent === document.body) {
|
|
324
|
+
parentWidth = documentRect.width;
|
|
325
|
+
parentWidth -= Math.abs(documentRect.left - parentRect.left);
|
|
326
|
+
parentHeight = documentRect.height + docElement.scrollTop;
|
|
327
|
+
parentHeight -= Math.abs(documentRect.top - parentRect.top);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
if (x) {
|
|
331
|
+
var minWidth = Math.min(ePopupRect.width, 120);
|
|
332
|
+
ePopup.style.minWidth = minWidth + 'px';
|
|
333
|
+
var maxX = parentWidth - minWidth;
|
|
334
|
+
x = Math.min(Math.max(x, 0), Math.abs(maxX)); //目前位置,最大支持的位置
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (y) {
|
|
338
|
+
var minHeight = Math.min(ePopupRect.height, 180);
|
|
339
|
+
var maxY = parentHeight - minHeight;
|
|
340
|
+
y = Math.min(Math.max(y, 0), Math.abs(maxY)); //目前位置,最大支持的位置
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return {
|
|
344
|
+
x: x,
|
|
345
|
+
y: y
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
/** 计算位置 end */
|
|
349
|
+
|
|
350
|
+
/** 获得点击的元素 start */
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
function getCellEleForEvent(event) {
|
|
354
|
+
return getCellEleInEventPath(getEventPath(event));
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function getRowEleForEvent(event, dataSource) {
|
|
358
|
+
return getRowEleInEventPath(getEventPath(event));
|
|
359
|
+
}
|
|
360
|
+
/** 获得点击的元素 end */
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
function getCopyItem(v) {
|
|
364
|
+
return {
|
|
365
|
+
name: '复制',
|
|
366
|
+
action: function action() {
|
|
367
|
+
executeOnTempElement(copyDataToClipboard(v));
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
3
|
+
import _taggedTemplateLiteral from "@babel/runtime-corejs3/helpers/taggedTemplateLiteral";
|
|
4
|
+
|
|
5
|
+
var _templateObject;
|
|
6
|
+
|
|
7
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
8
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
9
|
+
import React, { useEffect } from 'react';
|
|
10
|
+
import styled from 'styled-components';
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
import { DEFAULT_FILTER_OPTIONS } from './util';
|
|
13
|
+
import { Classes, ButtonCSS } from '../../../base/styles';
|
|
14
|
+
var DefaultFilterContentStyle = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n background-color: #ffffff;\n border-radius: 2px;\n width: 100%;\n\n ", "\n .filter-option-list {\n display: flex;\n flex-direction: column;\n margin-top: 8px;\n ul {\n margin: 0;\n padding: 0;\n li {\n display: flex;\n position: relative;\n flex-shrink: 0;\n height: 32px;\n align-items: center;\n border-radius: 2px;\n font-size: 12px;\n color: var(--color);\n padding: 0 12px;\n overflow: hidden;\n cursor: pointer;\n &:hover{\n background-color: var(--primary-color-level1);\n }\n }\n li.active{\n background-color: var(--primary-color-level1);\n }\n }\n }\n\n .filter-search {\n display: flex;\n padding: 6px 12px;\n\n .filter-search-inner {\n width: 100%;\n font-size: 12px;\n color: #333333;\n height: 28px;\n line-height: 28px;\n padding: 0 8px;\n outline: none;\n background-color: #FAFAFA;\n border-radius: 2px;\n border: 1px solid var(--strong-border-color);\n &:hover{\n border-color: var(--primary-color)\n } \n &:focus{\n border-color: var(--primary-color)\n } \n }\n }\n\n .filter-footer {\n display: flex;\n flex-direction: row;\n padding: 8px 12px;\n justify-content: space-between;\n\n .filter-btn {\n text-align: center;\n font-size: 12px;\n width: 60px;\n height: 24px;\n line-height: 24px;\n }\n \n }\n"])), ButtonCSS);
|
|
15
|
+
|
|
16
|
+
function DefaultFilterContent(_ref) {
|
|
17
|
+
var _cx2;
|
|
18
|
+
|
|
19
|
+
var setFilterModel = _ref.setFilterModel,
|
|
20
|
+
filterModel = _ref.filterModel,
|
|
21
|
+
hidePanel = _ref.hidePanel;
|
|
22
|
+
|
|
23
|
+
var _React$useState = React.useState((filterModel === null || filterModel === void 0 ? void 0 : filterModel.filterCondition) || 'contain'),
|
|
24
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
25
|
+
selectedValue = _React$useState2[0],
|
|
26
|
+
setSelectedValue = _React$useState2[1];
|
|
27
|
+
|
|
28
|
+
var _React$useState3 = React.useState((filterModel === null || filterModel === void 0 ? void 0 : _filterInstanceProperty(filterModel)) || ''),
|
|
29
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
30
|
+
innerValue = _React$useState4[0],
|
|
31
|
+
setInnerValue = _React$useState4[1];
|
|
32
|
+
|
|
33
|
+
var handleClick = React.useCallback(function (option) {
|
|
34
|
+
setSelectedValue(option.key);
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
37
|
+
var reset = function reset() {
|
|
38
|
+
hidePanel();
|
|
39
|
+
setFilterModel();
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var confirm = function confirm() {
|
|
43
|
+
hidePanel();
|
|
44
|
+
setFilterModel({
|
|
45
|
+
filter: [innerValue],
|
|
46
|
+
filterCondition: selectedValue
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
useEffect(function () {
|
|
51
|
+
setSelectedValue((filterModel === null || filterModel === void 0 ? void 0 : filterModel.filterCondition) || 'contain');
|
|
52
|
+
setInnerValue((filterModel === null || filterModel === void 0 ? void 0 : _filterInstanceProperty(filterModel)) || '');
|
|
53
|
+
}, [filterModel]);
|
|
54
|
+
return /*#__PURE__*/React.createElement(DefaultFilterContentStyle, null, /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: 'filter-option-list'
|
|
56
|
+
}, /*#__PURE__*/React.createElement("ul", null, _mapInstanceProperty(DEFAULT_FILTER_OPTIONS).call(DEFAULT_FILTER_OPTIONS, function (option, index) {
|
|
57
|
+
return (
|
|
58
|
+
/*#__PURE__*/
|
|
59
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
60
|
+
React.createElement("li", {
|
|
61
|
+
key: index,
|
|
62
|
+
className: option.key === selectedValue ? 'active' : '',
|
|
63
|
+
onClick: function onClick() {
|
|
64
|
+
return handleClick(option);
|
|
65
|
+
}
|
|
66
|
+
}, option.title)
|
|
67
|
+
);
|
|
68
|
+
}))), selectedValue !== 'notIsNull' && selectedValue !== 'isNull' && /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: 'filter-search'
|
|
70
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
71
|
+
className: 'filter-search-inner',
|
|
72
|
+
value: innerValue,
|
|
73
|
+
onChange: function onChange(e) {
|
|
74
|
+
setInnerValue(e.target.value);
|
|
75
|
+
}
|
|
76
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: 'filter-footer'
|
|
78
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
79
|
+
className: cx(_defineProperty({
|
|
80
|
+
'filter-btn': true
|
|
81
|
+
}, Classes.button, true)),
|
|
82
|
+
onClick: reset
|
|
83
|
+
}, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement("button", {
|
|
84
|
+
className: cx((_cx2 = {
|
|
85
|
+
'filter-btn': true
|
|
86
|
+
}, _defineProperty(_cx2, Classes.button, true), _defineProperty(_cx2, Classes.buttonPrimary, true), _cx2)),
|
|
87
|
+
onClick: confirm
|
|
88
|
+
}, "\u786E\u5B9A")));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export default DefaultFilterContent;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { FilterPanel as FilterPanelType, DefaultFilterPanelProps, CustomeFilterPanelProps } from '../../../interfaces';
|
|
3
|
+
interface FilterProps {
|
|
4
|
+
style?: CSSProperties;
|
|
5
|
+
className?: string;
|
|
6
|
+
size?: number;
|
|
7
|
+
isFilterActive: boolean;
|
|
8
|
+
FilterPanelContent?: FilterPanelType;
|
|
9
|
+
filterIcon?: ReactNode;
|
|
10
|
+
setFilterModel: DefaultFilterPanelProps['setFilterModel'];
|
|
11
|
+
filterModel: DefaultFilterPanelProps['filterModel'];
|
|
12
|
+
setFilter: CustomeFilterPanelProps['setFilter'];
|
|
13
|
+
onClick?: (e: React.MouseEvent) => any;
|
|
14
|
+
stopClickEventPropagation?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare function Filter({ size, style, className, FilterPanelContent, filterIcon, setFilter, setFilterModel, filterModel, isFilterActive, stopClickEventPropagation }: FilterProps): JSX.Element;
|
|
17
|
+
export default Filter;
|