@dtjoy/dt-design 1.1.1 → 1.1.5
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/README.md +44 -24
- package/dist/dt-design.min.css +1 -0
- package/dist/dt-design.min.js +1 -0
- package/es/_util/context/createContextSelector.d.ts +28 -0
- package/es/_util/context/createContextSelector.js +110 -0
- package/es/_util/context/immutable.d.ts +10 -0
- package/es/_util/context/immutable.js +84 -0
- package/es/_util/context/index.d.ts +3 -0
- package/es/_util/context/index.js +3 -0
- package/{esm → es}/_util/gapSize.d.ts +1 -1
- package/{esm → es}/_util/getScroll.js +1 -1
- package/es/_util/hooks/index.d.ts +11 -0
- package/es/_util/hooks/index.js +11 -0
- package/es/_util/hooks/useBreakpoint.d.ts +5 -0
- package/es/_util/hooks/useBreakpoint.js +75 -0
- package/es/_util/hooks/useCssVar.d.ts +3 -0
- package/es/_util/hooks/useCssVar.js +28 -0
- package/es/_util/hooks/useEvent.d.ts +1 -0
- package/es/_util/hooks/useEvent.js +1 -0
- package/es/_util/hooks/useLayoutEffect.d.ts +1 -0
- package/es/_util/hooks/useLayoutEffect.js +1 -0
- package/es/_util/hooks/useMultipleSelect.d.ts +2 -0
- package/es/_util/hooks/useMultipleSelect.js +37 -0
- package/es/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
- package/{esm → es}/_util/hooks/useProxyImperativeHandle.js +10 -3
- package/es/_util/hooks/useTimeoutLock.d.ts +1 -0
- package/es/_util/hooks/useTimeoutLock.js +26 -0
- package/es/_util/index.d.ts +11 -0
- package/{esm → es}/_util/index.js +9 -1
- package/es/_util/is.d.ts +5 -0
- package/es/_util/is.js +16 -0
- package/es/_util/rcUtil.d.ts +17 -0
- package/es/_util/rcUtil.js +58 -0
- package/{esm → es}/_util/scrollTo.js +1 -1
- package/es/_util/scrollbar.d.ts +1 -0
- package/es/_util/scrollbar.js +32 -0
- package/{esm → es}/_util/type.d.ts +1 -0
- package/es/_util/validate.d.ts +2 -0
- package/es/_util/validate.js +10 -0
- package/{esm → es}/_util/warning.js +5 -6
- package/{lib/blockHeader → es/block-header}/index.d.ts +1 -1
- package/{esm/blockHeader → es/block-header}/index.js +1 -1
- package/{lib/blockHeader → es/block-header}/style/index.less +167 -143
- package/{esm → es}/button/index.d.ts +3 -3
- package/{esm → es}/button/index.js +16 -4
- package/{esm → es}/button/style/index.less +62 -59
- package/{esm → es}/button/style/mixin.less +40 -39
- package/{esm → es}/collapsible/index.js +3 -2
- package/{esm → es}/collapsible/style/index.less +24 -24
- package/{esm/collapsibleActionItems → es/collapsible-action-items}/index.d.ts +1 -1
- package/{esm/collapsibleActionItems → es/collapsible-action-items}/index.js +21 -19
- package/{lib/collapsibleActionItems → es/collapsible-action-items}/style/index.less +7 -7
- package/{lib → es}/flex/index.d.ts +2 -2
- package/{esm → es}/flex/index.js +3 -3
- package/{esm → es}/flex/style/index.less +80 -76
- package/{esm/formList → es/form-list}/index.d.ts +9 -0
- package/{esm/formList → es/form-list}/index.js +18 -8
- package/{lib/formList → es/form-list}/style/index.less +45 -45
- package/es/index.d.ts +26 -0
- package/es/index.js +21 -0
- package/{lib/overflowList → es/overflow-list}/index.d.ts +4 -1
- package/{esm/overflowList → es/overflow-list}/index.js +37 -9
- package/{esm/overflowList → es/overflow-list}/style/index.less +9 -9
- package/{lib/resizeObserver → es/resize-observer}/index.d.ts +1 -1
- package/{esm/resizeObserver → es/resize-observer}/index.js +8 -8
- package/{esm → es}/splitter/Panel.d.ts +1 -1
- package/{esm → es}/splitter/Panel.js +12 -4
- package/{esm → es}/splitter/SplitBar.d.ts +6 -2
- package/{esm → es}/splitter/SplitBar.js +82 -80
- package/{esm → es}/splitter/Splitter.js +52 -23
- package/{esm → es}/splitter/hooks/sizeUtil.js +1 -1
- package/es/splitter/hooks/useDragListeners.d.ts +14 -0
- package/es/splitter/hooks/useDragListeners.js +107 -0
- package/{esm → es}/splitter/hooks/useItems.d.ts +6 -0
- package/es/splitter/hooks/useOrientation.d.ts +2 -0
- package/es/splitter/hooks/useOrientation.js +6 -0
- package/{esm → es}/splitter/hooks/useResizable.d.ts +3 -0
- package/{esm → es}/splitter/hooks/useResizable.js +5 -2
- package/{esm → es}/splitter/hooks/useResize.d.ts +1 -1
- package/{esm → es}/splitter/hooks/useResize.js +10 -3
- package/{esm → es}/splitter/hooks/useSizes.js +5 -6
- package/{lib → es}/splitter/index.d.ts +2 -1
- package/es/splitter/interface.d.ts +45 -0
- package/es/splitter/style/index.less +349 -0
- package/{esm/statusTag → es/status-tag}/index.js +1 -1
- package/{esm/statusTag → es/status-tag}/style/index.less +70 -70
- package/{esm/statusTag → es/status-tag}/style/mixin.less +48 -39
- package/{esm → es}/style/index.less +1 -1
- package/es/style/themes/index.less +2 -0
- package/{esm → es}/style/themes/variable.less +5 -5
- package/es/table/Column.d.ts +2 -0
- package/es/table/Column.js +1 -0
- package/es/table/ColumnGroup.d.ts +2 -0
- package/es/table/ColumnGroup.js +1 -0
- package/es/table/InternalTable.d.ts +43 -0
- package/es/table/InternalTable.js +816 -0
- package/{lib → es}/table/Table.d.ts +7 -5
- package/{esm → es}/table/Table.js +6 -4
- package/es/table/components/Body/BodyRow.d.ts +37 -0
- package/es/table/components/Body/BodyRow.js +182 -0
- package/es/table/components/Body/ExpandedRow.d.ts +15 -0
- package/es/table/components/Body/ExpandedRow.js +51 -0
- package/es/table/components/Body/MeasureCell.d.ts +8 -0
- package/es/table/components/Body/MeasureCell.js +33 -0
- package/es/table/components/Body/MeasureRow.d.ts +10 -0
- package/es/table/components/Body/MeasureRow.js +54 -0
- package/es/table/components/Body/index.d.ts +11 -0
- package/es/table/components/Body/index.js +123 -0
- package/es/table/components/Cell/index.d.ts +39 -0
- package/es/table/components/Cell/index.js +196 -0
- package/es/table/components/Cell/useCellRender.d.ts +3 -0
- package/es/table/components/Cell/useCellRender.js +69 -0
- package/es/table/components/Cell/useHoverState.d.ts +2 -0
- package/es/table/components/Cell/useHoverState.js +13 -0
- package/es/table/components/ColGroup.d.ts +9 -0
- package/es/table/components/ColGroup.js +53 -0
- package/es/table/components/ExpandIcon.d.ts +12 -0
- package/es/table/components/ExpandIcon.js +27 -0
- package/es/table/components/FixedHolder/index.d.ts +27 -0
- package/es/table/components/FixedHolder/index.js +186 -0
- package/es/table/components/Footer/Cell.d.ts +11 -0
- package/es/table/components/Footer/Cell.js +47 -0
- package/es/table/components/Footer/Row.d.ts +8 -0
- package/es/table/components/Footer/Row.js +10 -0
- package/es/table/components/Footer/Summary.d.ts +14 -0
- package/es/table/components/Footer/Summary.js +12 -0
- package/es/table/components/Footer/SummaryContext.d.ts +11 -0
- package/es/table/components/Footer/SummaryContext.js +3 -0
- package/es/table/components/Footer/index.d.ts +16 -0
- package/es/table/components/Footer/index.js +31 -0
- package/es/table/components/Header/Header.d.ts +10 -0
- package/es/table/components/Header/Header.js +110 -0
- package/es/table/components/Header/HeaderRow.d.ts +19 -0
- package/es/table/components/Header/HeaderRow.js +63 -0
- package/es/table/components/Panel.d.ts +7 -0
- package/es/table/components/Panel.js +11 -0
- package/es/table/components/RcTable.d.ts +114 -0
- package/es/table/components/RcTable.js +757 -0
- package/es/table/components/VirtualTable.d.ts +5 -0
- package/{esm/table/RcTable → es/table/components}/VirtualTable.js +4 -1
- package/es/table/components/VirtualTableBody/BodyGrid.d.ts +13 -0
- package/es/table/components/VirtualTableBody/BodyGrid.js +307 -0
- package/es/table/components/VirtualTableBody/BodyLine.d.ts +14 -0
- package/es/table/components/VirtualTableBody/BodyLine.js +116 -0
- package/es/table/components/VirtualTableBody/VirtualCell.d.ts +26 -0
- package/es/table/components/VirtualTableBody/VirtualCell.js +118 -0
- package/es/table/components/VirtualTableBody/context.d.ts +13 -0
- package/es/table/components/VirtualTableBody/context.js +3 -0
- package/es/table/components/VirtualTableBody/index.d.ts +16 -0
- package/es/table/components/VirtualTableBody/index.js +102 -0
- package/es/table/constant.d.ts +2 -0
- package/es/table/constant.js +2 -0
- package/es/table/features/columns/Column.d.ts +7 -0
- package/es/table/features/columns/Column.js +4 -0
- package/es/table/features/columns/ColumnGroup.d.ts +9 -0
- package/es/table/features/columns/ColumnGroup.js +4 -0
- package/es/table/features/columns/index.d.ts +8 -0
- package/es/table/features/columns/index.js +6 -0
- package/es/table/features/columns/useColumns.d.ts +31 -0
- package/es/table/features/columns/useColumns.js +227 -0
- package/es/table/features/columns/useFilledColumns.d.ts +4 -0
- package/es/table/features/columns/useFilledColumns.js +34 -0
- package/es/table/features/columns/useTitleColumns.d.ts +4 -0
- package/es/table/features/columns/useTitleColumns.js +26 -0
- package/es/table/features/columns/useWidthColumns.d.ts +5 -0
- package/es/table/features/columns/useWidthColumns.js +75 -0
- package/es/table/features/editable/BatchEditModal.d.ts +4 -0
- package/es/table/features/editable/BatchEditModal.js +786 -0
- package/es/table/features/editable/EditableCell.d.ts +42 -0
- package/es/table/features/editable/EditableCell.js +294 -0
- package/es/table/features/editable/EditableContext.d.ts +33 -0
- package/es/table/features/editable/EditableContext.js +20 -0
- package/es/table/features/editable/batchEditTypes.d.ts +55 -0
- package/es/table/features/editable/batchEditTypes.js +1 -0
- package/es/table/features/editable/batchEditUtils.d.ts +44 -0
- package/es/table/features/editable/batchEditUtils.js +258 -0
- package/es/table/features/editable/builtinEditors.d.ts +32 -0
- package/es/table/features/editable/builtinEditors.js +165 -0
- package/es/table/features/editable/index.d.ts +11 -0
- package/es/table/features/editable/index.js +10 -0
- package/es/table/features/editable/useBatchRules.d.ts +17 -0
- package/es/table/features/editable/useBatchRules.js +96 -0
- package/es/table/features/editable/useEditable.d.ts +51 -0
- package/es/table/features/editable/useEditable.js +693 -0
- package/es/table/features/expand/expandUtil.d.ts +5 -0
- package/es/table/features/expand/expandUtil.js +47 -0
- package/es/table/features/expand/index.d.ts +2 -0
- package/es/table/features/expand/index.js +2 -0
- package/es/table/features/expand/useExpand.d.ts +10 -0
- package/es/table/features/expand/useExpand.js +90 -0
- package/es/table/features/filter/FilterDropdown.d.ts +31 -0
- package/es/table/features/filter/FilterDropdown.js +494 -0
- package/es/table/features/filter/FilterSearch.d.ts +12 -0
- package/es/table/features/filter/FilterSearch.js +24 -0
- package/es/table/features/filter/FilterWrapper.d.ts +8 -0
- package/es/table/features/filter/FilterWrapper.js +23 -0
- package/es/table/features/filter/index.d.ts +4 -0
- package/es/table/features/filter/index.js +4 -0
- package/es/table/features/filter/useFilter.d.ts +22 -0
- package/es/table/features/filter/useFilter.js +240 -0
- package/es/table/features/fixed/fixUtil.d.ts +21 -0
- package/es/table/features/fixed/fixUtil.js +69 -0
- package/es/table/features/fixed/index.d.ts +4 -0
- package/es/table/features/fixed/index.js +4 -0
- package/es/table/features/fixed/offsetUtil.d.ts +4 -0
- package/es/table/features/fixed/offsetUtil.js +13 -0
- package/es/table/features/fixed/useFixedInfo.d.ts +2 -0
- package/es/table/features/fixed/useFixedInfo.js +16 -0
- package/es/table/features/fixed/useStickyOffsets.d.ts +6 -0
- package/es/table/features/fixed/useStickyOffsets.js +29 -0
- package/es/table/features/hover/index.d.ts +1 -0
- package/es/table/features/hover/index.js +1 -0
- package/es/table/features/hover/useHover.d.ts +2 -0
- package/es/table/features/hover/useHover.js +22 -0
- package/es/table/features/pagination/index.d.ts +1 -0
- package/es/table/features/pagination/index.js +1 -0
- package/es/table/features/pagination/usePagination.d.ts +5 -0
- package/es/table/features/pagination/usePagination.js +89 -0
- package/es/table/features/resize/ResizeHandle.d.ts +22 -0
- package/es/table/features/resize/ResizeHandle.js +99 -0
- package/es/table/features/resize/index.d.ts +5 -0
- package/es/table/features/resize/index.js +3 -0
- package/es/table/features/resize/transformResizableColumns.d.ts +11 -0
- package/es/table/features/resize/transformResizableColumns.js +52 -0
- package/es/table/features/resize/useResize.d.ts +52 -0
- package/es/table/features/resize/useResize.js +586 -0
- package/es/table/features/selection/index.d.ts +1 -0
- package/es/table/features/selection/index.js +1 -0
- package/es/table/features/selection/useSelection.d.ts +20 -0
- package/es/table/features/selection/useSelection.js +579 -0
- package/es/table/features/sort/index.d.ts +1 -0
- package/es/table/features/sort/index.js +1 -0
- package/es/table/features/sort/useSorter.d.ts +21 -0
- package/es/table/features/sort/useSorter.js +372 -0
- package/es/table/features/sticky/index.d.ts +2 -0
- package/es/table/features/sticky/index.js +2 -0
- package/es/table/features/sticky/stickyScrollBar.d.ts +12 -0
- package/es/table/features/sticky/stickyScrollBar.js +203 -0
- package/es/table/features/sticky/useSticky.d.ts +10 -0
- package/es/table/features/sticky/useSticky.js +34 -0
- package/es/table/features/summary/index.d.ts +1 -0
- package/es/table/features/summary/index.js +1 -0
- package/es/table/features/virtual/index.d.ts +2 -0
- package/es/table/features/virtual/index.js +2 -0
- package/es/table/features/virtual/useFlattenRecords.d.ts +19 -0
- package/es/table/features/virtual/useFlattenRecords.js +55 -0
- package/es/table/features/virtual/useFrame.d.ts +7 -0
- package/es/table/features/virtual/useFrame.js +67 -0
- package/es/table/immutableHelper.d.ts +9 -0
- package/es/table/immutableHelper.js +36 -0
- package/es/table/index.d.ts +24 -0
- package/es/table/index.js +23 -0
- package/es/table/interface.d.ts +438 -0
- package/es/table/interface.js +56 -0
- package/es/table/shared/context/PerfContext.d.ts +6 -0
- package/es/table/shared/context/PerfContext.js +6 -0
- package/es/table/shared/context/TableContext.d.ts +51 -0
- package/es/table/shared/context/TableContext.js +8 -0
- package/es/table/shared/hooks/useLazyKVMap.d.ts +4 -0
- package/es/table/shared/hooks/useLazyKVMap.js +30 -0
- package/es/table/shared/hooks/useRenderTimes.d.ts +5 -0
- package/es/table/shared/hooks/useRenderTimes.js +39 -0
- package/es/table/shared/hooks/useRowInfo.d.ts +11 -0
- package/es/table/shared/hooks/useRowInfo.js +73 -0
- package/es/table/shared/utils/legacyUtil.d.ts +5 -0
- package/es/table/shared/utils/legacyUtil.js +30 -0
- package/{esm/table → es/table/shared/utils}/util.d.ts +3 -11
- package/{esm/table → es/table/shared/utils}/util.js +6 -13
- package/es/table/shared/utils/valueUtil.d.ts +8 -0
- package/es/table/shared/utils/valueUtil.js +29 -0
- package/es/table/style/base.less +164 -0
- package/es/table/style/bordered.less +83 -0
- package/es/table/style/editable.less +50 -0
- package/es/table/style/ellipsis.less +33 -0
- package/es/table/style/empty.less +16 -0
- package/es/table/style/expand.less +123 -0
- package/es/table/style/filter.less +34 -0
- package/es/table/style/fixed.less +85 -0
- package/es/table/style/index.d.ts +3 -0
- package/es/table/style/index.js +3 -0
- package/es/table/style/index.less +19 -0
- package/es/table/style/pagination.less +29 -0
- package/es/table/style/radius.less +64 -0
- package/es/table/style/resize.less +78 -0
- package/es/table/style/rtl.less +52 -0
- package/es/table/style/selection.less +63 -0
- package/es/table/style/size.less +54 -0
- package/es/table/style/sorter.less +99 -0
- package/es/table/style/sticky.less +45 -0
- package/es/table/style/summary.less +23 -0
- package/es/table/style/variables.less +80 -0
- package/es/table/style/virtual.less +95 -0
- package/lib/_util/context/createContextSelector.js +120 -0
- package/lib/_util/context/immutable.js +92 -0
- package/lib/_util/context/index.js +41 -0
- package/lib/_util/easings.js +1 -1
- package/lib/_util/getScroll.js +6 -6
- package/lib/_util/hooks/index.js +82 -5
- package/lib/_util/hooks/useBreakpoint.js +85 -0
- package/lib/_util/hooks/useCssVar.js +37 -0
- package/lib/_util/hooks/useEvent.js +13 -0
- package/lib/_util/hooks/useForceUpdate.js +5 -4
- package/lib/_util/hooks/useLayoutEffect.js +13 -0
- package/lib/_util/hooks/useMultipleSelect.js +43 -0
- package/lib/_util/hooks/useOrientation.js +7 -8
- package/lib/_util/hooks/useProxyImperativeHandle.js +18 -14
- package/lib/_util/hooks/useSyncState.js +19 -9
- package/lib/_util/hooks/useTimeoutLock.js +35 -0
- package/lib/_util/index.js +101 -1
- package/lib/_util/is.js +22 -0
- package/lib/_util/rcUtil.js +134 -0
- package/lib/_util/scrollTo.js +22 -18
- package/lib/_util/scrollbar.js +38 -0
- package/lib/_util/validate.js +17 -0
- package/lib/_util/warning.js +25 -27
- package/lib/block-header/index.js +141 -0
- package/{esm/blockHeader → lib/block-header}/style/index.less +167 -143
- package/lib/button/index.js +24 -9
- package/lib/button/style/index.less +62 -59
- package/lib/button/style/mixin.less +40 -39
- package/lib/collapsible/index.js +210 -169
- package/lib/collapsible/style/index.less +24 -24
- package/lib/collapsible-action-items/index.js +83 -0
- package/{esm/collapsibleActionItems → lib/collapsible-action-items}/style/index.less +7 -7
- package/lib/flex/index.js +43 -34
- package/lib/flex/style/index.less +80 -76
- package/lib/flex/utils.js +23 -23
- package/lib/form-list/index.js +163 -0
- package/{esm/formList → lib/form-list}/style/index.less +45 -45
- package/lib/index.js +37 -67
- package/lib/overflow-list/index.js +203 -0
- package/lib/{overflowList → overflow-list}/style/index.less +9 -9
- package/lib/resize/index.js +13 -13
- package/lib/resize-observer/index.js +182 -0
- package/lib/splitter/Panel.js +36 -25
- package/lib/splitter/SplitBar.js +151 -134
- package/lib/splitter/Splitter.js +141 -89
- package/lib/splitter/hooks/sizeUtil.js +50 -33
- package/lib/splitter/hooks/useDragListeners.js +114 -0
- package/lib/splitter/hooks/useItems.js +27 -20
- package/lib/splitter/hooks/useOrientation.js +12 -0
- package/lib/splitter/hooks/useResizable.js +32 -30
- package/lib/splitter/hooks/useResize.js +76 -45
- package/lib/splitter/hooks/useSizes.js +55 -30
- package/lib/splitter/index.js +1 -1
- package/lib/splitter/style/index.less +349 -312
- package/lib/status-tag/index.js +131 -0
- package/lib/{statusTag → status-tag}/style/index.less +70 -70
- package/lib/{statusTag → status-tag}/style/mixin.less +48 -39
- package/lib/style/index.less +1 -1
- package/lib/style/themes/index.less +2 -2
- package/lib/style/themes/variable.less +5 -5
- package/lib/table/Column.js +13 -0
- package/lib/table/ColumnGroup.js +13 -0
- package/lib/table/InternalTable.js +699 -270
- package/lib/table/Table.js +14 -11
- package/lib/table/TableMeasureRowContext.js +1 -1
- package/lib/table/components/Body/BodyRow.js +192 -0
- package/lib/table/components/Body/ExpandedRow.js +61 -0
- package/lib/table/components/Body/MeasureCell.js +43 -0
- package/lib/table/components/Body/MeasureRow.js +64 -0
- package/lib/table/components/Body/index.js +133 -0
- package/lib/table/components/Cell/index.js +205 -0
- package/lib/table/components/Cell/useCellRender.js +78 -0
- package/lib/table/components/Cell/useHoverState.js +20 -0
- package/lib/table/components/ColGroup.js +62 -0
- package/lib/table/components/ExpandIcon.js +35 -0
- package/lib/table/components/FixedHolder/index.js +195 -0
- package/lib/table/components/Footer/Cell.js +57 -0
- package/lib/table/components/Footer/Row.js +19 -0
- package/lib/table/components/Footer/Summary.js +19 -0
- package/lib/table/components/Footer/SummaryContext.js +12 -0
- package/lib/table/components/Footer/index.js +41 -0
- package/lib/table/components/Header/Header.js +120 -0
- package/lib/table/components/Header/HeaderRow.js +72 -0
- package/lib/table/components/Panel.js +20 -0
- package/lib/table/components/RcTable.js +764 -0
- package/lib/table/components/VirtualTable.js +18 -0
- package/lib/table/components/VirtualTableBody/BodyGrid.js +316 -0
- package/lib/table/components/VirtualTableBody/BodyLine.js +125 -0
- package/lib/table/components/VirtualTableBody/VirtualCell.js +128 -0
- package/lib/table/components/VirtualTableBody/context.js +9 -0
- package/lib/table/components/VirtualTableBody/index.js +111 -0
- package/lib/table/constant.js +8 -0
- package/lib/table/features/columns/Column.js +10 -0
- package/lib/table/features/columns/ColumnGroup.js +10 -0
- package/lib/table/features/columns/index.js +57 -0
- package/lib/table/features/columns/useColumns.js +237 -0
- package/lib/table/features/columns/useFilledColumns.js +42 -0
- package/lib/table/features/columns/useTitleColumns.js +34 -0
- package/lib/table/features/columns/useWidthColumns.js +83 -0
- package/lib/table/features/editable/BatchEditModal.js +794 -0
- package/lib/table/features/editable/EditableCell.js +303 -0
- package/lib/table/features/editable/EditableContext.js +28 -0
- package/lib/table/features/editable/batchEditTypes.js +5 -0
- package/lib/table/features/editable/batchEditUtils.js +264 -0
- package/lib/table/features/editable/builtinEditors.js +174 -0
- package/lib/table/features/editable/index.js +75 -0
- package/lib/table/features/editable/useBatchRules.js +103 -0
- package/lib/table/features/editable/useEditable.js +701 -0
- package/lib/table/features/expand/expandUtil.js +57 -0
- package/lib/table/features/expand/index.js +32 -0
- package/lib/table/features/expand/useExpand.js +99 -0
- package/lib/table/features/filter/FilterDropdown.js +504 -0
- package/lib/table/features/filter/FilterSearch.js +34 -0
- package/lib/table/features/filter/FilterWrapper.js +32 -0
- package/lib/table/features/filter/index.js +49 -0
- package/lib/table/features/filter/useFilter.js +254 -0
- package/lib/table/features/fixed/fixUtil.js +75 -0
- package/lib/table/features/fixed/index.js +34 -0
- package/lib/table/features/fixed/offsetUtil.js +19 -0
- package/lib/table/features/fixed/useFixedInfo.js +26 -0
- package/lib/table/features/fixed/useStickyOffsets.js +35 -0
- package/lib/table/features/hover/index.js +13 -0
- package/lib/table/features/hover/useHover.js +31 -0
- package/lib/table/features/pagination/index.js +27 -0
- package/lib/table/features/pagination/usePagination.js +96 -0
- package/lib/table/features/resize/ResizeHandle.js +109 -0
- package/lib/table/features/resize/index.js +27 -0
- package/lib/table/features/resize/transformResizableColumns.js +61 -0
- package/lib/table/features/resize/useResize.js +595 -0
- package/lib/table/features/selection/index.js +39 -0
- package/lib/table/features/selection/useSelection.js +588 -0
- package/lib/table/features/sort/index.js +21 -0
- package/lib/table/features/sort/useSorter.js +381 -0
- package/lib/table/features/sticky/index.js +20 -0
- package/lib/table/features/sticky/stickyScrollBar.js +212 -0
- package/lib/table/features/sticky/useSticky.js +43 -0
- package/lib/table/features/summary/index.js +13 -0
- package/lib/table/features/virtual/index.js +26 -0
- package/lib/table/features/virtual/useFlattenRecords.js +64 -0
- package/lib/table/features/virtual/useFrame.js +74 -0
- package/lib/table/immutableHelper.js +46 -0
- package/lib/table/index.js +118 -3
- package/lib/table/interface.js +54 -2
- package/lib/table/shared/context/PerfContext.js +15 -0
- package/lib/table/shared/context/TableContext.js +13 -0
- package/lib/table/shared/hooks/useContainerWidth.js +20 -0
- package/lib/table/shared/hooks/useLazyKVMap.js +39 -0
- package/lib/table/shared/hooks/useRenderTimes.js +49 -0
- package/lib/table/shared/hooks/useRowInfo.js +80 -0
- package/lib/table/shared/utils/legacyUtil.js +38 -0
- package/lib/table/shared/utils/util.js +34 -0
- package/lib/table/shared/utils/valueUtil.js +37 -0
- package/lib/table/style/base.less +164 -0
- package/lib/table/style/bordered.less +83 -141
- package/lib/table/style/editable.less +50 -0
- package/lib/table/style/ellipsis.less +33 -0
- package/lib/table/style/empty.less +16 -0
- package/lib/table/style/expand.less +123 -0
- package/lib/table/style/filter.less +34 -0
- package/lib/table/style/fixed.less +85 -88
- package/lib/table/style/index.js +2 -1
- package/lib/table/style/index.less +19 -150
- package/lib/table/style/pagination.less +29 -0
- package/lib/table/style/radius.less +64 -0
- package/lib/table/style/resize.less +78 -0
- package/lib/table/style/rtl.less +52 -0
- package/lib/table/style/selection.less +63 -90
- package/lib/table/style/size.less +54 -0
- package/lib/table/style/sorter.less +99 -0
- package/lib/table/style/sticky.less +45 -55
- package/lib/table/style/summary.less +23 -0
- package/lib/table/style/variables.less +80 -0
- package/lib/table/style/virtual.less +95 -65
- package/package.json +148 -155
- package/esm/_util/extendsObject.d.ts +0 -4
- package/esm/_util/extendsObject.js +0 -17
- package/esm/_util/hooks/index.d.ts +0 -4
- package/esm/_util/hooks/index.js +0 -4
- package/esm/_util/hooks/useProxyImperativeHandle.d.ts +0 -4
- package/esm/_util/index.d.ts +0 -3
- package/esm/_util/isNonNullable.d.ts +0 -2
- package/esm/_util/isNonNullable.js +0 -4
- package/esm/blockHeader/index.d.ts +0 -58
- package/esm/flex/index.d.ts +0 -7
- package/esm/index.d.ts +0 -17
- package/esm/index.js +0 -14
- package/esm/overflowList/index.d.ts +0 -40
- package/esm/resizeObserver/index.d.ts +0 -45
- package/esm/splitter/index.d.ts +0 -8
- package/esm/splitter/interface.d.ts +0 -69
- package/esm/splitter/style/index.less +0 -312
- package/esm/style/mixins/index.less +0 -0
- package/esm/style/themes/index.less +0 -2
- package/esm/table/InternalTable.d.ts +0 -32
- package/esm/table/InternalTable.js +0 -429
- package/esm/table/RcTable/VirtualTable.d.ts +0 -2
- package/esm/table/RcTable/index.d.ts +0 -2
- package/esm/table/RcTable/index.js +0 -9
- package/esm/table/Table.d.ts +0 -17
- package/esm/table/index.d.ts +0 -7
- package/esm/table/index.js +0 -2
- package/esm/table/interface.d.ts +0 -196
- package/esm/table/interface.js +0 -4
- package/esm/table/style/bordered.less +0 -141
- package/esm/table/style/fixed.less +0 -88
- package/esm/table/style/index.d.ts +0 -2
- package/esm/table/style/index.js +0 -2
- package/esm/table/style/index.less +0 -150
- package/esm/table/style/selection.less +0 -90
- package/esm/table/style/sticky.less +0 -55
- package/esm/table/style/virtual.less +0 -65
- package/lib/_util/easings.d.ts +0 -1
- package/lib/_util/extendsObject.d.ts +0 -4
- package/lib/_util/extendsObject.js +0 -20
- package/lib/_util/gapSize.d.ts +0 -3
- package/lib/_util/getScroll.d.ts +0 -3
- package/lib/_util/hooks/index.d.ts +0 -4
- package/lib/_util/hooks/useForceUpdate.d.ts +0 -2
- package/lib/_util/hooks/useOrientation.d.ts +0 -2
- package/lib/_util/hooks/useProxyImperativeHandle.d.ts +0 -4
- package/lib/_util/hooks/useSyncState.d.ts +0 -3
- package/lib/_util/index.d.ts +0 -3
- package/lib/_util/isNonNullable.d.ts +0 -2
- package/lib/_util/isNonNullable.js +0 -10
- package/lib/_util/scrollTo.d.ts +0 -10
- package/lib/_util/type.d.ts +0 -52
- package/lib/_util/warning.d.ts +0 -31
- package/lib/blockHeader/index.js +0 -121
- package/lib/blockHeader/style/index.d.ts +0 -2
- package/lib/button/index.d.ts +0 -10
- package/lib/button/style/index.d.ts +0 -2
- package/lib/collapsible/index.d.ts +0 -102
- package/lib/collapsible/style/index.d.ts +0 -1
- package/lib/collapsibleActionItems/index.d.ts +0 -24
- package/lib/collapsibleActionItems/index.js +0 -68
- package/lib/collapsibleActionItems/style/index.d.ts +0 -2
- package/lib/flex/interface.d.ts +0 -16
- package/lib/flex/style/index.d.ts +0 -2
- package/lib/flex/utils.d.ts +0 -7
- package/lib/formList/index.d.ts +0 -78
- package/lib/formList/index.js +0 -130
- package/lib/formList/style/index.d.ts +0 -2
- package/lib/index.d.ts +0 -17
- package/lib/overflowList/index.js +0 -144
- package/lib/overflowList/style/index.d.ts +0 -2
- package/lib/resize/index.d.ts +0 -9
- package/lib/resizeObserver/index.js +0 -137
- package/lib/splitter/Panel.d.ts +0 -7
- package/lib/splitter/SplitBar.d.ts +0 -24
- package/lib/splitter/Splitter.d.ts +0 -5
- package/lib/splitter/hooks/sizeUtil.d.ts +0 -3
- package/lib/splitter/hooks/useItems.d.ts +0 -14
- package/lib/splitter/hooks/useResizable.d.ts +0 -10
- package/lib/splitter/hooks/useResize.d.ts +0 -6
- package/lib/splitter/hooks/useSizes.d.ts +0 -4
- package/lib/splitter/interface.d.ts +0 -69
- package/lib/splitter/style/index.d.ts +0 -2
- package/lib/statusTag/index.d.ts +0 -29
- package/lib/statusTag/index.js +0 -125
- package/lib/statusTag/style/index.d.ts +0 -2
- package/lib/style/index.d.ts +0 -1
- package/lib/style/mixins/index.less +0 -0
- package/lib/table/InternalTable.d.ts +0 -32
- package/lib/table/RcTable/VirtualTable.d.ts +0 -2
- package/lib/table/RcTable/VirtualTable.js +0 -17
- package/lib/table/RcTable/index.d.ts +0 -2
- package/lib/table/RcTable/index.js +0 -17
- package/lib/table/TableMeasureRowContext.d.ts +0 -3
- package/lib/table/hooks/useContainerWidth.d.ts +0 -1
- package/lib/table/hooks/useContainerWidth.js +0 -20
- package/lib/table/index.d.ts +0 -7
- package/lib/table/interface.d.ts +0 -196
- package/lib/table/style/index.d.ts +0 -2
- package/lib/table/util.d.ts +0 -14
- package/lib/table/util.js +0 -44
- /package/{esm → es}/_util/easings.d.ts +0 -0
- /package/{esm → es}/_util/easings.js +0 -0
- /package/{esm → es}/_util/gapSize.js +0 -0
- /package/{esm → es}/_util/getScroll.d.ts +0 -0
- /package/{esm → es}/_util/hooks/useForceUpdate.d.ts +0 -0
- /package/{esm → es}/_util/hooks/useForceUpdate.js +0 -0
- /package/{esm → es}/_util/hooks/useOrientation.d.ts +0 -0
- /package/{esm → es}/_util/hooks/useOrientation.js +0 -0
- /package/{esm → es}/_util/hooks/useSyncState.d.ts +0 -0
- /package/{esm → es}/_util/hooks/useSyncState.js +0 -0
- /package/{esm → es}/_util/scrollTo.d.ts +0 -0
- /package/{esm → es}/_util/type.js +0 -0
- /package/{esm → es}/_util/warning.d.ts +0 -0
- /package/{esm/blockHeader → es/block-header}/style/index.d.ts +0 -0
- /package/{esm/blockHeader → es/block-header}/style/index.js +0 -0
- /package/{esm → es}/button/style/index.d.ts +0 -0
- /package/{esm → es}/button/style/index.js +0 -0
- /package/{esm → es}/collapsible/index.d.ts +0 -0
- /package/{esm → es}/collapsible/style/index.d.ts +0 -0
- /package/{esm → es}/collapsible/style/index.js +0 -0
- /package/{esm/collapsibleActionItems → es/collapsible-action-items}/style/index.d.ts +0 -0
- /package/{esm/collapsibleActionItems → es/collapsible-action-items}/style/index.js +0 -0
- /package/{esm → es}/flex/interface.d.ts +0 -0
- /package/{esm → es}/flex/interface.js +0 -0
- /package/{esm → es}/flex/style/index.d.ts +0 -0
- /package/{esm → es}/flex/style/index.js +0 -0
- /package/{esm → es}/flex/utils.d.ts +0 -0
- /package/{esm → es}/flex/utils.js +0 -0
- /package/{esm/formList → es/form-list}/style/index.d.ts +0 -0
- /package/{esm/formList → es/form-list}/style/index.js +0 -0
- /package/{esm/overflowList → es/overflow-list}/style/index.d.ts +0 -0
- /package/{esm/overflowList → es/overflow-list}/style/index.js +0 -0
- /package/{esm → es}/resize/index.d.ts +0 -0
- /package/{esm → es}/resize/index.js +0 -0
- /package/{esm → es}/splitter/Splitter.d.ts +0 -0
- /package/{esm → es}/splitter/hooks/sizeUtil.d.ts +0 -0
- /package/{esm → es}/splitter/hooks/useItems.js +0 -0
- /package/{esm → es}/splitter/hooks/useSizes.d.ts +0 -0
- /package/{esm → es}/splitter/index.js +0 -0
- /package/{esm → es}/splitter/interface.js +0 -0
- /package/{esm → es}/splitter/style/index.d.ts +0 -0
- /package/{esm → es}/splitter/style/index.js +0 -0
- /package/{esm/statusTag → es/status-tag}/index.d.ts +0 -0
- /package/{esm/statusTag → es/status-tag}/style/index.d.ts +0 -0
- /package/{esm/statusTag → es/status-tag}/style/index.js +0 -0
- /package/{esm → es}/style/index.d.ts +0 -0
- /package/{esm → es}/style/index.js +0 -0
- /package/{esm → es}/table/TableMeasureRowContext.d.ts +0 -0
- /package/{esm → es}/table/TableMeasureRowContext.js +0 -0
- /package/{esm/table → es/table/shared}/hooks/useContainerWidth.d.ts +0 -0
- /package/{esm/table → es/table/shared}/hooks/useContainerWidth.js +0 -0
- /package/lib/{blockHeader → block-header}/style/index.js +0 -0
- /package/lib/{collapsibleActionItems → collapsible-action-items}/style/index.js +0 -0
- /package/lib/{formList → form-list}/style/index.js +0 -0
- /package/lib/{overflowList → overflow-list}/style/index.js +0 -0
- /package/lib/{statusTag → status-tag}/style/index.js +0 -0
package/lib/_util/scrollTo.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface ScrollToOptions {
|
|
2
|
-
/** Scroll container, default as window */
|
|
3
|
-
getContainer?: () => HTMLElement | Window | Document;
|
|
4
|
-
/** Scroll end callback */
|
|
5
|
-
callback?: () => void;
|
|
6
|
-
/** Animation duration, default as 450 */
|
|
7
|
-
duration?: number;
|
|
8
|
-
}
|
|
9
|
-
export default function scrollTo(y: number, options?: ScrollToOptions): () => void;
|
|
10
|
-
export {};
|
package/lib/_util/type.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
export type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
3
|
-
/** https://github.com/Microsoft/TypeScript/issues/29729 */
|
|
4
|
-
export type LiteralUnion<T, U extends Primitive = string> = T | (U & Record<never, never>);
|
|
5
|
-
export type AnyObject = Record<PropertyKey, any>;
|
|
6
|
-
export type CustomComponent<P = AnyObject> = React.ComponentType<P> | string;
|
|
7
|
-
/**
|
|
8
|
-
* Get component props
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* import { Checkbox } from '@dtjoy/dt-design'
|
|
12
|
-
* import type { GetProps } from '@dtjoy/dt-design';
|
|
13
|
-
*
|
|
14
|
-
* type CheckboxGroupProps = GetProps<typeof Checkbox.Group>
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export type GetProps<T extends React.ComponentType<any> | object> = T extends React.ComponentType<infer P> ? P : T extends object ? T : never;
|
|
18
|
-
/**
|
|
19
|
-
* Get component props by component name
|
|
20
|
-
* @example
|
|
21
|
-
* ```ts
|
|
22
|
-
* import { Select } from '@dtjoy/dt-design';
|
|
23
|
-
* import type { GetProp, SelectProps } from '@dtjoy/dt-design';
|
|
24
|
-
*
|
|
25
|
-
* type SelectOption1 = GetProp<SelectProps, 'options'>[number];
|
|
26
|
-
* // or
|
|
27
|
-
* type SelectOption2 = GetProp<typeof Select, 'options'>[number];
|
|
28
|
-
*
|
|
29
|
-
* const onChange: GetProp<typeof Select, 'onChange'> = (value, option) => {
|
|
30
|
-
* // Do something
|
|
31
|
-
* };
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export type GetProp<T extends React.ComponentType<any> | object, PropName extends keyof GetProps<T>> = NonNullable<GetProps<T>[PropName]>;
|
|
35
|
-
type ReactRefComponent<Props extends {
|
|
36
|
-
ref?: React.Ref<any> | string;
|
|
37
|
-
}> = (props: Props) => React.ReactNode;
|
|
38
|
-
type ExtractRefAttributesRef<T> = T extends React.RefAttributes<infer P> ? P : never;
|
|
39
|
-
/**
|
|
40
|
-
* Get component ref
|
|
41
|
-
* @example
|
|
42
|
-
* ```ts
|
|
43
|
-
* import { Input } from '@dtjoy/dt-design';
|
|
44
|
-
* import type { GetRef } from '@dtjoy/dt-design';
|
|
45
|
-
*
|
|
46
|
-
* type InputRef = GetRef<typeof Input>;
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export type GetRef<T extends ReactRefComponent<any> | React.Component<any>> = T extends React.Component<any> ? T : T extends React.ComponentType<infer P> ? ExtractRefAttributesRef<P> : never;
|
|
50
|
-
export type GetContextProps<T> = T extends React.Context<infer P> ? P : never;
|
|
51
|
-
export type GetContextProp<T extends React.Context<any>, PropName extends keyof GetContextProps<T>> = NonNullable<GetContextProps<T>[PropName]>;
|
|
52
|
-
export {};
|
package/lib/_util/warning.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare function noop(): void;
|
|
3
|
-
export declare function resetWarned(): void;
|
|
4
|
-
type Warning = (valid: boolean, component: string, message?: string) => void;
|
|
5
|
-
declare const warning: Warning;
|
|
6
|
-
type BaseTypeWarning = (valid: boolean,
|
|
7
|
-
/**
|
|
8
|
-
* - deprecated: Some API will be removed in future but still support now.
|
|
9
|
-
* - usage: Some API usage is not correct.
|
|
10
|
-
* - breaking: Breaking change like API is removed.
|
|
11
|
-
*/
|
|
12
|
-
type: 'deprecated' | 'usage' | 'breaking', message?: string) => void;
|
|
13
|
-
type TypeWarning = BaseTypeWarning & {
|
|
14
|
-
deprecated: (valid: boolean, oldProp: string, newProp: string, message?: string) => void;
|
|
15
|
-
};
|
|
16
|
-
export interface WarningContextProps {
|
|
17
|
-
/**
|
|
18
|
-
* @descCN 设置警告等级,设置 `false` 时会将废弃相关信息聚合为单条信息。
|
|
19
|
-
* @descEN Set the warning level. When set to `false`, discard related information will be aggregated into a single message.
|
|
20
|
-
* @since 5.10.0
|
|
21
|
-
*/
|
|
22
|
-
strict?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export declare const WarningContext: React.Context<WarningContextProps>;
|
|
25
|
-
/**
|
|
26
|
-
* This is a hook but we not named as `useWarning`
|
|
27
|
-
* since this is only used in development.
|
|
28
|
-
* We should always wrap this in `if (process.env.NODE_ENV !== 'production')` condition
|
|
29
|
-
*/
|
|
30
|
-
export declare const devUseWarning: (component: string) => TypeWarning;
|
|
31
|
-
export default warning;
|
package/lib/blockHeader/index.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _icons = require("@ant-design/icons");
|
|
9
|
-
var _antd = require("antd");
|
|
10
|
-
var _configProvider = require("antd/es/config-provider");
|
|
11
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
|
-
require("./style");
|
|
13
|
-
var _util = require("../_util");
|
|
14
|
-
var _collapsible = _interopRequireDefault(require("../collapsible"));
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } // 优化后的代码示例
|
|
19
|
-
function isControlled(props) {
|
|
20
|
-
return props.expand !== undefined;
|
|
21
|
-
}
|
|
22
|
-
const prefixCls = (0, _configProvider.globalConfig)().getPrefixCls('block-header');
|
|
23
|
-
const preTitleRowCls = `${prefixCls}__title`;
|
|
24
|
-
const BlockHeader = props => {
|
|
25
|
-
const {
|
|
26
|
-
id,
|
|
27
|
-
title,
|
|
28
|
-
description = '',
|
|
29
|
-
tooltip,
|
|
30
|
-
size = 'middle',
|
|
31
|
-
spaceBottom = {
|
|
32
|
-
expand: 16,
|
|
33
|
-
collapse: 16
|
|
34
|
-
},
|
|
35
|
-
className = '',
|
|
36
|
-
contentClassName = '',
|
|
37
|
-
style = {},
|
|
38
|
-
contentStyle = {},
|
|
39
|
-
background = true,
|
|
40
|
-
defaultExpand = true,
|
|
41
|
-
addonAfter,
|
|
42
|
-
expand,
|
|
43
|
-
children = '',
|
|
44
|
-
addonBefore = /*#__PURE__*/_react.default.createElement("div", {
|
|
45
|
-
className: "addon-before--default"
|
|
46
|
-
}),
|
|
47
|
-
onExpand,
|
|
48
|
-
titleStyle,
|
|
49
|
-
keepDOM = false,
|
|
50
|
-
lazy = false,
|
|
51
|
-
expandable = true
|
|
52
|
-
} = props;
|
|
53
|
-
const [internalExpand, setInternalExpand] = (0, _react.useState)(defaultExpand);
|
|
54
|
-
const currentExpand = isControlled(props) ? expand ?? false : internalExpand;
|
|
55
|
-
const showCollapse = expandable && !!children;
|
|
56
|
-
const tooltipProps = (0, _util.toTooltipProps)(tooltip);
|
|
57
|
-
const bottomStyle = (0, _react.useMemo)(() => {
|
|
58
|
-
if (typeof spaceBottom === 'number') {
|
|
59
|
-
return {
|
|
60
|
-
marginBottom: spaceBottom
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
const key = currentExpand ? 'expand' : 'collapse';
|
|
64
|
-
return {
|
|
65
|
-
marginBottom: spaceBottom[key] ?? 0
|
|
66
|
-
};
|
|
67
|
-
}, [spaceBottom, currentExpand]);
|
|
68
|
-
const handleExpand = () => {
|
|
69
|
-
const newExpandState = !currentExpand;
|
|
70
|
-
!isControlled(props) && setInternalExpand(newExpandState);
|
|
71
|
-
onExpand?.(newExpandState);
|
|
72
|
-
};
|
|
73
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
74
|
-
id: id,
|
|
75
|
-
className: (0, _clsx.default)(`${prefixCls}`, className),
|
|
76
|
-
style: {
|
|
77
|
-
...bottomStyle,
|
|
78
|
-
...style
|
|
79
|
-
}
|
|
80
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
81
|
-
className: (0, _clsx.default)(preTitleRowCls, `${preTitleRowCls}--${size}`, {
|
|
82
|
-
[`${preTitleRowCls}--background`]: background,
|
|
83
|
-
[`${preTitleRowCls}--pointer`]: showCollapse
|
|
84
|
-
}),
|
|
85
|
-
style: titleStyle,
|
|
86
|
-
onClick: showCollapse ? handleExpand : undefined
|
|
87
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
88
|
-
className: "title__box"
|
|
89
|
-
}, addonBefore ? /*#__PURE__*/_react.default.createElement("div", {
|
|
90
|
-
className: `title__addon-before title__addon-before--${size}`
|
|
91
|
-
}, addonBefore) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
92
|
-
className: "title__text"
|
|
93
|
-
}, title), tooltipProps?.title ? /*#__PURE__*/_react.default.createElement("div", {
|
|
94
|
-
className: `title__tooltip`
|
|
95
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.Tooltip, _extends({}, tooltipProps, {
|
|
96
|
-
className: (0, _clsx.default)(tooltipProps?.className)
|
|
97
|
-
}), /*#__PURE__*/_react.default.createElement(_icons.QuestionCircleOutlined, null))) : null, description ? /*#__PURE__*/_react.default.createElement("div", {
|
|
98
|
-
className: `title__description`
|
|
99
|
-
}, description) : null), addonAfter && /*#__PURE__*/_react.default.createElement("div", {
|
|
100
|
-
className: `title__addon-after`
|
|
101
|
-
}, addonAfter), showCollapse && /*#__PURE__*/_react.default.createElement("div", {
|
|
102
|
-
className: `title__collapse`
|
|
103
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
104
|
-
className: "collapse__text"
|
|
105
|
-
}, currentExpand ? '收起' : '展开'), /*#__PURE__*/_react.default.createElement(_icons.UpOutlined, {
|
|
106
|
-
className: (0, _clsx.default)('collapse__icon', {
|
|
107
|
-
'collapse__icon--up': currentExpand,
|
|
108
|
-
'collapse__icon--down': !currentExpand
|
|
109
|
-
})
|
|
110
|
-
}))), /*#__PURE__*/_react.default.createElement(_collapsible.default, {
|
|
111
|
-
isOpen: currentExpand,
|
|
112
|
-
keepDOM: keepDOM,
|
|
113
|
-
lazyRender: lazy
|
|
114
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
115
|
-
className: (0, _clsx.default)(`${prefixCls}__content`, contentClassName, {
|
|
116
|
-
[`${prefixCls}__content--active`]: currentExpand || !showCollapse
|
|
117
|
-
}),
|
|
118
|
-
style: contentStyle
|
|
119
|
-
}, children)));
|
|
120
|
-
};
|
|
121
|
-
var _default = exports.default = BlockHeader;
|
package/lib/button/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ButtonProps as AntdButtonProps } from 'antd';
|
|
3
|
-
import type { ButtonType as AntdButtonType } from 'antd/es/button';
|
|
4
|
-
import './style';
|
|
5
|
-
type ButtonType = AntdButtonType | 'secondary' | 'tertiary';
|
|
6
|
-
export interface ButtonProps extends Omit<AntdButtonProps, 'type'> {
|
|
7
|
-
type?: ButtonType;
|
|
8
|
-
}
|
|
9
|
-
declare const _default: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
|
|
10
|
-
export default _default;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './style';
|
|
3
|
-
import type { ConfigConsumerProps } from 'antd/lib/config-provider';
|
|
4
|
-
interface BaseComponentProps {
|
|
5
|
-
/**
|
|
6
|
-
* 类名
|
|
7
|
-
*/
|
|
8
|
-
className?: string;
|
|
9
|
-
/**
|
|
10
|
-
* 样式
|
|
11
|
-
*/
|
|
12
|
-
style?: React.CSSProperties;
|
|
13
|
-
/**
|
|
14
|
-
* id
|
|
15
|
-
*/
|
|
16
|
-
id?: string;
|
|
17
|
-
'data-*'?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface CollapsibleProps extends BaseComponentProps {
|
|
20
|
-
/**
|
|
21
|
-
* 是否开启动画
|
|
22
|
-
*/
|
|
23
|
-
motion?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* 子元素
|
|
26
|
-
*/
|
|
27
|
-
children?: React.ReactNode;
|
|
28
|
-
/**
|
|
29
|
-
* 是否展开内容区域
|
|
30
|
-
*/
|
|
31
|
-
isOpen?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* 动画执行的时间
|
|
34
|
-
*/
|
|
35
|
-
duration?: number;
|
|
36
|
-
/**
|
|
37
|
-
* 是否保留隐藏的面板 DOM 树,默认销毁
|
|
38
|
-
*/
|
|
39
|
-
keepDOM?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* 配合 keepDOM 使用,为 true 时挂载时不会渲染组件
|
|
42
|
-
*/
|
|
43
|
-
lazyRender?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* 折叠高度
|
|
46
|
-
*/
|
|
47
|
-
collapseHeight?: number;
|
|
48
|
-
/**
|
|
49
|
-
* 当 reCalcKey 改变时,将重新计算子节点的高度,用于优化动态渲染时的计算
|
|
50
|
-
*/
|
|
51
|
-
reCalcKey?: number | string;
|
|
52
|
-
/**
|
|
53
|
-
* 动画结束的回调
|
|
54
|
-
*/
|
|
55
|
-
onMotionEnd?: () => void;
|
|
56
|
-
/**
|
|
57
|
-
* 是否开启淡入淡出
|
|
58
|
-
*/
|
|
59
|
-
fade?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* 样式前缀
|
|
62
|
-
*/
|
|
63
|
-
prefixCls?: string;
|
|
64
|
-
}
|
|
65
|
-
interface CollapsibleState {
|
|
66
|
-
domInRenderTree: boolean;
|
|
67
|
-
domHeight: number;
|
|
68
|
-
visible: boolean;
|
|
69
|
-
isTransitioning: boolean;
|
|
70
|
-
cacheIsOpen: boolean;
|
|
71
|
-
}
|
|
72
|
-
declare class Collapsible extends React.Component<CollapsibleProps, CollapsibleState> {
|
|
73
|
-
static defaultProps: {
|
|
74
|
-
isOpen: boolean;
|
|
75
|
-
duration: number;
|
|
76
|
-
motion: boolean;
|
|
77
|
-
keepDOM: boolean;
|
|
78
|
-
lazyRender: boolean;
|
|
79
|
-
collapseHeight: number;
|
|
80
|
-
fade: boolean;
|
|
81
|
-
};
|
|
82
|
-
static displayName: string;
|
|
83
|
-
foundation: any;
|
|
84
|
-
private domRef;
|
|
85
|
-
private resizeObserver;
|
|
86
|
-
private hasBeenRendered;
|
|
87
|
-
constructor(props: CollapsibleProps);
|
|
88
|
-
static getEntryInfo: (entry: ResizeObserverEntry) => {
|
|
89
|
-
isShown: boolean;
|
|
90
|
-
height: number;
|
|
91
|
-
};
|
|
92
|
-
static getDerivedStateFromProps(props: CollapsibleProps, prevState: CollapsibleState): Partial<CollapsibleState>;
|
|
93
|
-
componentDidMount(): void;
|
|
94
|
-
componentDidUpdate(prevProps: Readonly<CollapsibleProps>, prevState: Readonly<CollapsibleState>): void;
|
|
95
|
-
componentWillUnmount(): void;
|
|
96
|
-
renderCollapsible: ({ getPrefixCls }: ConfigConsumerProps) => React.JSX.Element;
|
|
97
|
-
render(): React.JSX.Element;
|
|
98
|
-
private handleResize;
|
|
99
|
-
private isChildrenInRenderTree;
|
|
100
|
-
private getDataAttr;
|
|
101
|
-
}
|
|
102
|
-
export default Collapsible;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { ButtonProps } from "..";
|
|
4
|
-
import type { DropDownProps } from 'antd';
|
|
5
|
-
import './style';
|
|
6
|
-
export type ActionItem = {
|
|
7
|
-
key: React.Key;
|
|
8
|
-
name: ReactNode;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
render?: () => ReactNode;
|
|
11
|
-
};
|
|
12
|
-
interface ICollapsibleActionItems {
|
|
13
|
-
maxCount?: number;
|
|
14
|
-
actionItems: ActionItem[];
|
|
15
|
-
className?: string;
|
|
16
|
-
divider?: ReactNode;
|
|
17
|
-
collapseIcon?: ReactNode;
|
|
18
|
-
dropdownProps?: Partial<DropDownProps>;
|
|
19
|
-
buttonProps?: Partial<ButtonProps>;
|
|
20
|
-
style?: React.CSSProperties;
|
|
21
|
-
onItemClick?: (key: React.Key) => void;
|
|
22
|
-
}
|
|
23
|
-
declare const CollapsibleActionItems: React.FC<ICollapsibleActionItems>;
|
|
24
|
-
export default CollapsibleActionItems;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _icons = require("@ant-design/icons");
|
|
9
|
-
var _ = require("./..");
|
|
10
|
-
var _antd = require("antd");
|
|
11
|
-
var _configProvider = require("antd/es/config-provider");
|
|
12
|
-
require("./style");
|
|
13
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
|
-
const CollapsibleActionItems = props => {
|
|
17
|
-
const {
|
|
18
|
-
actionItems,
|
|
19
|
-
maxCount = 3,
|
|
20
|
-
className,
|
|
21
|
-
divider = /*#__PURE__*/_react.default.createElement(_antd.Divider, {
|
|
22
|
-
type: "vertical"
|
|
23
|
-
}),
|
|
24
|
-
collapseIcon = /*#__PURE__*/_react.default.createElement(_icons.EllipsisOutlined, null),
|
|
25
|
-
dropdownProps,
|
|
26
|
-
buttonProps,
|
|
27
|
-
style,
|
|
28
|
-
onItemClick
|
|
29
|
-
} = props;
|
|
30
|
-
const isOverMaxCount = actionItems.length > maxCount;
|
|
31
|
-
const prefixCls = (0, _configProvider.globalConfig)().getPrefixCls('collapsible-action-items');
|
|
32
|
-
const getActionItemNode = (item, isCollapse = false) => {
|
|
33
|
-
const customRender = item.render ? item.render() : null;
|
|
34
|
-
if (!isCollapse) return /*#__PURE__*/_react.default.createElement("span", {
|
|
35
|
-
className: `${prefixCls}__btn`,
|
|
36
|
-
key: item.key,
|
|
37
|
-
onClick: () => !item.disabled && onItemClick?.(item.key)
|
|
38
|
-
}, customRender || /*#__PURE__*/_react.default.createElement(_.Button, _extends({
|
|
39
|
-
type: "link",
|
|
40
|
-
disabled: item.disabled
|
|
41
|
-
}, buttonProps), item.name));
|
|
42
|
-
return /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, {
|
|
43
|
-
key: item.key,
|
|
44
|
-
disabled: item.disabled
|
|
45
|
-
}, customRender || item.name);
|
|
46
|
-
};
|
|
47
|
-
const displayAction = actionItems.slice(0, isOverMaxCount ? maxCount - 1 : maxCount).map(item => getActionItemNode(item, false));
|
|
48
|
-
const dropdownMenu = isOverMaxCount ? /*#__PURE__*/_react.default.createElement(_antd.Menu, {
|
|
49
|
-
"data-testid": "action-dropdown-menu",
|
|
50
|
-
onClick: info => onItemClick?.(info.key)
|
|
51
|
-
}, actionItems.slice(maxCount - 1).map(item => getActionItemNode(item, true))) : null;
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
53
|
-
className: (0, _clsx.default)(prefixCls, className),
|
|
54
|
-
style: style
|
|
55
|
-
}, displayAction.map((actionItem, index) => {
|
|
56
|
-
const showDivider = index < actionItems.length - 1;
|
|
57
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
58
|
-
key: actionItem.key
|
|
59
|
-
}, actionItem, showDivider && divider);
|
|
60
|
-
}), dropdownMenu && /*#__PURE__*/_react.default.createElement(_antd.Dropdown, _extends({
|
|
61
|
-
placement: 'bottomRight',
|
|
62
|
-
overlay: dropdownMenu,
|
|
63
|
-
getPopupContainer: triggerNode => triggerNode.parentElement ?? document.body
|
|
64
|
-
}, dropdownProps), /*#__PURE__*/_react.default.createElement("a", {
|
|
65
|
-
className: `${prefixCls}__icon`
|
|
66
|
-
}, collapseIcon)));
|
|
67
|
-
};
|
|
68
|
-
var _default = exports.default = CollapsibleActionItems;
|
package/lib/flex/interface.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
3
|
-
import type { Orientation } from '../_util/hooks';
|
|
4
|
-
import type { AnyObject, CustomComponent, LiteralUnion } from '../_util/type';
|
|
5
|
-
export interface FlexProps<P = AnyObject> extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
-
prefixCls?: string;
|
|
7
|
-
rootClassName?: string;
|
|
8
|
-
vertical?: boolean;
|
|
9
|
-
orientation?: Orientation;
|
|
10
|
-
wrap?: boolean | React.CSSProperties['flexWrap'];
|
|
11
|
-
justify?: React.CSSProperties['justifyContent'];
|
|
12
|
-
align?: React.CSSProperties['alignItems'];
|
|
13
|
-
flex?: React.CSSProperties['flex'];
|
|
14
|
-
gap?: LiteralUnion<SizeType, React.CSSProperties['gap']>;
|
|
15
|
-
component?: CustomComponent<P>;
|
|
16
|
-
}
|
package/lib/flex/utils.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { FlexProps } from './interface';
|
|
3
|
-
export declare const flexWrapValues: React.CSSProperties['flexWrap'][];
|
|
4
|
-
export declare const justifyContentValues: React.CSSProperties['justifyContent'][];
|
|
5
|
-
export declare const alignItemsValues: React.CSSProperties['alignItems'][];
|
|
6
|
-
declare const createFlexClassNames: (prefixCls: string, props: FlexProps) => string;
|
|
7
|
-
export default createFlexClassNames;
|
package/lib/formList/index.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { FormListFieldData, TableProps } from 'antd';
|
|
4
|
-
import type { FormItemProps, FormListProps, RuleObject, RuleRender } from 'antd/lib/form';
|
|
5
|
-
import type { ColumnType as TableColumnType } from 'antd/lib/table';
|
|
6
|
-
import './style';
|
|
7
|
-
type NotNullRowSelection = NonNullable<TableProps<any>['rowSelection']>;
|
|
8
|
-
/**
|
|
9
|
-
* Override NamePath parameters type
|
|
10
|
-
*/
|
|
11
|
-
type OverrideParameters = (string | number)[];
|
|
12
|
-
type RcFormInstance = Parameters<RuleRender>[0];
|
|
13
|
-
type RawPanelRender = NonNullable<TableProps<any>['footer']>;
|
|
14
|
-
/**
|
|
15
|
-
* Override PanelRender type
|
|
16
|
-
*/
|
|
17
|
-
type PanelRenderFunc = (...args: Parameters<FormListProps['children']>) => ReturnType<RawPanelRender>;
|
|
18
|
-
/**
|
|
19
|
-
* Form.Table 组件类型
|
|
20
|
-
*/
|
|
21
|
-
export interface IFormTableProps
|
|
22
|
-
/**
|
|
23
|
-
* Support all FormListProps except children for which is re-defined in this component
|
|
24
|
-
* and prefixCls for which is not expected to be supported
|
|
25
|
-
*/
|
|
26
|
-
extends Pick<FormListProps, 'name' | 'rules' | 'initialValue'>,
|
|
27
|
-
/**
|
|
28
|
-
* Support all TableProps except
|
|
29
|
-
* - re-define columns and re-defined rowSelection
|
|
30
|
-
* - and pagination which is expect to be not supported in Form.Table
|
|
31
|
-
* - and className which is renamed to tableClassName
|
|
32
|
-
* - and rowKey, dataSource for which are defined and not allowed to be modified
|
|
33
|
-
* - and footer, title, summary for which are re-defined to pass form's operation
|
|
34
|
-
*/
|
|
35
|
-
Omit<TableProps<any>, 'columns' | 'rowSelection' | 'pagination' | 'className' | 'rowKey' | 'dataSource' | 'footer' | 'title' | 'summary'> {
|
|
36
|
-
/**
|
|
37
|
-
* 表格列的配置描述
|
|
38
|
-
*/
|
|
39
|
-
columns?: ColumnType[] | ((...args: Parameters<FormListProps['children']>) => ColumnType[]);
|
|
40
|
-
/**
|
|
41
|
-
* Table 的 className
|
|
42
|
-
*/
|
|
43
|
-
tableClassName?: TableProps<any>['className'];
|
|
44
|
-
/**
|
|
45
|
-
* 表格行是否可选择
|
|
46
|
-
*/
|
|
47
|
-
rowSelection?: Omit<NotNullRowSelection, 'getCheckboxProps'> & {
|
|
48
|
-
getCheckboxProps?: (field: FormListFieldData) => ReturnType<NonNullable<NotNullRowSelection['getCheckboxProps']>>;
|
|
49
|
-
};
|
|
50
|
-
title?: PanelRenderFunc;
|
|
51
|
-
footer?: PanelRenderFunc;
|
|
52
|
-
summary?: PanelRenderFunc;
|
|
53
|
-
}
|
|
54
|
-
export interface ColumnType
|
|
55
|
-
/**
|
|
56
|
-
* Support all FormItemProps, and re-defined `rules` and `dependencies`
|
|
57
|
-
*/
|
|
58
|
-
extends Omit<FormItemProps, 'rules' | 'dependencies' | 'prefixCls' | 'children'>,
|
|
59
|
-
/**
|
|
60
|
-
* Support all TableColumnType, and re-defined `render`
|
|
61
|
-
*/
|
|
62
|
-
Omit<TableColumnType<FormListFieldData>, 'render'> {
|
|
63
|
-
/**
|
|
64
|
-
* 设置依赖字段, 支持通过回调函数获取当前字段名
|
|
65
|
-
*/
|
|
66
|
-
dependencies?: ((namePath: OverrideParameters) => FormItemProps['dependencies']) | FormItemProps['dependencies'];
|
|
67
|
-
/**
|
|
68
|
-
* 校验规则,设置字段的校验逻辑,支持通过回调函数获取当前字段名
|
|
69
|
-
*/
|
|
70
|
-
rules?: (RuleObject | ((form: RcFormInstance, namePath: OverrideParameters) => RuleObject))[];
|
|
71
|
-
/**
|
|
72
|
-
* 渲染函数
|
|
73
|
-
* @param formInstance 只有在设置了 `dependencies` 的情况下才有该参数
|
|
74
|
-
*/
|
|
75
|
-
render?: (fieldData: FormListFieldData, namePath: OverrideParameters, formInstance?: RcFormInstance) => ReactNode;
|
|
76
|
-
}
|
|
77
|
-
export default function InternalTable({ name, rules, initialValue, ...tableProps }: IFormTableProps): React.JSX.Element;
|
|
78
|
-
export {};
|