@dtjoy/dt-design 1.1.2 → 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 +161 -141
- 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/es/_util/easings.d.ts +1 -0
- package/es/_util/gapSize.d.ts +3 -0
- package/es/_util/getScroll.d.ts +3 -0
- 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/useForceUpdate.d.ts +2 -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/useOrientation.d.ts +2 -0
- package/es/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
- package/{esm → es}/_util/hooks/useProxyImperativeHandle.js +10 -3
- package/es/_util/hooks/useSyncState.d.ts +3 -0
- 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/es/_util/scrollTo.d.ts +10 -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/es/_util/type.d.ts +53 -0
- package/es/_util/validate.d.ts +2 -0
- package/es/_util/validate.js +10 -0
- package/es/_util/warning.d.ts +31 -0
- package/{esm → es}/_util/warning.js +5 -6
- package/es/block-header/index.d.ts +58 -0
- package/{esm/blockHeader → es/block-header}/index.js +1 -1
- package/es/block-header/style/index.d.ts +2 -0
- package/{lib/blockHeader → es/block-header}/style/index.less +167 -143
- package/es/button/index.d.ts +10 -0
- package/{esm → es}/button/index.js +16 -4
- package/es/button/style/index.d.ts +2 -0
- package/{esm → es}/button/style/index.less +62 -59
- package/{esm → es}/button/style/mixin.less +40 -39
- package/es/collapsible/index.d.ts +102 -0
- package/{esm → es}/collapsible/index.js +3 -2
- package/es/collapsible/style/index.d.ts +1 -0
- package/{esm → es}/collapsible/style/index.less +24 -24
- package/es/collapsible-action-items/index.d.ts +24 -0
- package/{esm/collapsibleActionItems → es/collapsible-action-items}/index.js +21 -19
- package/es/collapsible-action-items/style/index.d.ts +2 -0
- package/{lib/collapsibleActionItems → es/collapsible-action-items}/style/index.less +7 -7
- package/es/flex/index.d.ts +7 -0
- package/{esm → es}/flex/index.js +3 -3
- package/es/flex/interface.d.ts +16 -0
- package/es/flex/style/index.d.ts +2 -0
- package/{esm → es}/flex/style/index.less +80 -76
- package/es/flex/utils.d.ts +7 -0
- package/es/form-list/index.d.ts +87 -0
- package/{esm/formList → es/form-list}/index.js +18 -8
- package/es/form-list/style/index.d.ts +2 -0
- package/{esm/formList → es/form-list}/style/index.less +45 -45
- package/es/index.d.ts +26 -0
- package/es/index.js +21 -0
- package/es/overflow-list/index.d.ts +43 -0
- package/{esm/overflowList → es/overflow-list}/index.js +37 -9
- package/es/overflow-list/style/index.d.ts +2 -0
- package/{esm/overflowList → es/overflow-list}/style/index.less +9 -9
- package/es/resize/index.d.ts +9 -0
- package/es/resize-observer/index.d.ts +45 -0
- package/{esm/resizeObserver → es/resize-observer}/index.js +8 -8
- package/es/splitter/Panel.d.ts +7 -0
- package/{esm → es}/splitter/Panel.js +12 -4
- package/es/splitter/SplitBar.d.ts +28 -0
- package/{esm → es}/splitter/SplitBar.js +82 -80
- package/es/splitter/Splitter.d.ts +5 -0
- package/{esm → es}/splitter/Splitter.js +52 -23
- package/es/splitter/hooks/sizeUtil.d.ts +3 -0
- 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/es/splitter/hooks/useItems.d.ts +20 -0
- package/es/splitter/hooks/useOrientation.d.ts +2 -0
- package/es/splitter/hooks/useOrientation.js +6 -0
- package/es/splitter/hooks/useResizable.d.ts +13 -0
- package/{esm → es}/splitter/hooks/useResizable.js +5 -2
- package/es/splitter/hooks/useResize.d.ts +6 -0
- package/{esm → es}/splitter/hooks/useResize.js +10 -3
- package/es/splitter/hooks/useSizes.d.ts +4 -0
- package/{esm → es}/splitter/hooks/useSizes.js +5 -6
- package/es/splitter/index.d.ts +9 -0
- package/es/splitter/interface.d.ts +45 -0
- package/es/splitter/style/index.d.ts +2 -0
- package/es/splitter/style/index.less +349 -0
- package/es/status-tag/index.d.ts +29 -0
- package/{esm/statusTag → es/status-tag}/index.js +1 -1
- package/es/status-tag/style/index.d.ts +2 -0
- package/{lib/statusTag → es/status-tag}/style/index.less +70 -70
- package/{esm/statusTag → es/status-tag}/style/mixin.less +48 -39
- package/es/style/index.d.ts +1 -0
- 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/es/table/Table.d.ts +19 -0
- package/es/table/Table.js +30 -0
- package/es/table/TableMeasureRowContext.d.ts +3 -0
- package/es/table/TableMeasureRowContext.js +3 -0
- 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/es/table/components/VirtualTable.js +12 -0
- 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/useContainerWidth.d.ts +1 -0
- package/es/table/shared/hooks/useContainerWidth.js +14 -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/es/table/shared/utils/util.d.ts +6 -0
- package/es/table/shared/utils/util.js +26 -0
- 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/lib/{formList → form-list}/style/index.less +45 -45
- package/lib/index.js +41 -63
- 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/{esm/statusTag → lib/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 +824 -0
- package/lib/table/Table.js +40 -0
- package/lib/table/TableMeasureRowContext.js +10 -0
- 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 +124 -0
- package/lib/table/interface.js +60 -0
- 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 -0
- 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 -0
- package/lib/table/style/index.js +5 -0
- package/lib/table/style/index.less +19 -0
- 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 -0
- package/lib/table/style/size.less +54 -0
- package/lib/table/style/sorter.less +99 -0
- package/lib/table/style/sticky.less +45 -0
- package/lib/table/style/summary.less +23 -0
- package/lib/table/style/variables.less +80 -0
- package/lib/table/style/virtual.less +95 -0
- package/package.json +147 -152
- package/esm/_util/extendsObject.js +0 -17
- package/esm/_util/hooks/index.js +0 -4
- package/esm/_util/isNonNullable.js +0 -4
- package/esm/index.js +0 -22
- 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/lib/_util/extendsObject.js +0 -20
- package/lib/_util/isNonNullable.js +0 -10
- package/lib/blockHeader/index.js +0 -121
- package/lib/collapsibleActionItems/index.js +0 -68
- package/lib/formList/index.js +0 -130
- package/lib/overflowList/index.js +0 -144
- package/lib/resizeObserver/index.js +0 -137
- package/lib/statusTag/index.js +0 -125
- package/lib/style/mixins/index.less +0 -0
- /package/{esm → es}/_util/easings.js +0 -0
- /package/{esm → es}/_util/gapSize.js +0 -0
- /package/{esm → es}/_util/hooks/useForceUpdate.js +0 -0
- /package/{esm → es}/_util/hooks/useOrientation.js +0 -0
- /package/{esm → es}/_util/hooks/useSyncState.js +0 -0
- /package/{esm → es}/_util/type.js +0 -0
- /package/{esm/blockHeader → es/block-header}/style/index.js +0 -0
- /package/{esm → es}/button/style/index.js +0 -0
- /package/{esm → es}/collapsible/style/index.js +0 -0
- /package/{esm/collapsibleActionItems → es/collapsible-action-items}/style/index.js +0 -0
- /package/{esm → es}/flex/interface.js +0 -0
- /package/{esm → es}/flex/style/index.js +0 -0
- /package/{esm → es}/flex/utils.js +0 -0
- /package/{esm/formList → es/form-list}/style/index.js +0 -0
- /package/{esm/overflowList → es/overflow-list}/style/index.js +0 -0
- /package/{esm → es}/resize/index.js +0 -0
- /package/{esm → es}/splitter/hooks/useItems.js +0 -0
- /package/{esm → es}/splitter/index.js +0 -0
- /package/{esm → es}/splitter/interface.js +0 -0
- /package/{esm → es}/splitter/style/index.js +0 -0
- /package/{esm/statusTag → es/status-tag}/style/index.js +0 -0
- /package/{esm → es}/style/index.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
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.responsiveArray = exports.default = void 0;
|
|
8
|
+
exports.useBreakpoint = useBreakpoint;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
|
+
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; }
|
|
12
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
15
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
16
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
var responsiveArray = exports.responsiveArray = ['xxxl', 'xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
|
|
19
|
+
// Simplified responsive observer that always returns all breakpoints as true
|
|
20
|
+
// (We don't depend on antd v5 theme tokens for screen sizes)
|
|
21
|
+
var defaultScreenMap = {
|
|
22
|
+
xxxl: true,
|
|
23
|
+
xxl: true,
|
|
24
|
+
xl: true,
|
|
25
|
+
lg: true,
|
|
26
|
+
md: true,
|
|
27
|
+
sm: true,
|
|
28
|
+
xs: true
|
|
29
|
+
};
|
|
30
|
+
function useBreakpoint(needResponsive) {
|
|
31
|
+
var _React$useState = React.useState(defaultScreenMap),
|
|
32
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
33
|
+
screens = _React$useState2[0],
|
|
34
|
+
setScreens = _React$useState2[1];
|
|
35
|
+
React.useEffect(function () {
|
|
36
|
+
if (!needResponsive) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
var mediaQueries = {
|
|
40
|
+
xs: window.matchMedia('(max-width: 575px)'),
|
|
41
|
+
sm: window.matchMedia('(min-width: 576px)'),
|
|
42
|
+
md: window.matchMedia('(min-width: 768px)'),
|
|
43
|
+
lg: window.matchMedia('(min-width: 992px)'),
|
|
44
|
+
xl: window.matchMedia('(min-width: 1200px)'),
|
|
45
|
+
xxl: window.matchMedia('(min-width: 1600px)'),
|
|
46
|
+
xxxl: window.matchMedia('(min-width: 2000px)')
|
|
47
|
+
};
|
|
48
|
+
var update = function update() {
|
|
49
|
+
var newScreens = {};
|
|
50
|
+
Object.keys(mediaQueries).forEach(function (key) {
|
|
51
|
+
newScreens[key] = mediaQueries[key].matches;
|
|
52
|
+
});
|
|
53
|
+
setScreens(newScreens);
|
|
54
|
+
};
|
|
55
|
+
update();
|
|
56
|
+
var mqlList = [];
|
|
57
|
+
var handlerList = [];
|
|
58
|
+
Object.keys(mediaQueries).forEach(function (key) {
|
|
59
|
+
var mql = mediaQueries[key];
|
|
60
|
+
var handler = function handler() {
|
|
61
|
+
return update();
|
|
62
|
+
};
|
|
63
|
+
if (mql.addEventListener) {
|
|
64
|
+
mql.addEventListener('change', handler);
|
|
65
|
+
} else {
|
|
66
|
+
// Legacy browsers use deprecated addListener API
|
|
67
|
+
mql.addListener(handler);
|
|
68
|
+
}
|
|
69
|
+
mqlList.push(mql);
|
|
70
|
+
handlerList.push(handler);
|
|
71
|
+
});
|
|
72
|
+
return function () {
|
|
73
|
+
mqlList.forEach(function (mql, index) {
|
|
74
|
+
var handler = handlerList[index];
|
|
75
|
+
if (mql.removeEventListener) {
|
|
76
|
+
mql.removeEventListener('change', handler);
|
|
77
|
+
} else {
|
|
78
|
+
mql.removeListener(handler);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
}, [needResponsive]);
|
|
83
|
+
return screens;
|
|
84
|
+
}
|
|
85
|
+
var _default = exports.default = useBreakpoint;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
10
|
+
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; }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
function useCssVar(ref, varName, fallback) {
|
|
18
|
+
var _React$useState = React.useState(fallback),
|
|
19
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
20
|
+
value = _React$useState2[0],
|
|
21
|
+
setValue = _React$useState2[1];
|
|
22
|
+
React.useLayoutEffect(function () {
|
|
23
|
+
var el = ref.current;
|
|
24
|
+
if (!el) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
var computed = getComputedStyle(el).getPropertyValue(varName).trim();
|
|
28
|
+
if (computed) {
|
|
29
|
+
var num = Number.parseInt(computed, 10);
|
|
30
|
+
if (!Number.isNaN(num)) {
|
|
31
|
+
setValue(num);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, [ref, varName, fallback]);
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
var _default = exports.default = useCssVar;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _useEvent.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _useEvent = _interopRequireDefault(require("rc-util/lib/hooks/useEvent"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useForceUpdate = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
|
|
10
|
-
return _react.default.useReducer(
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
var useForceUpdate = exports.useForceUpdate = function useForceUpdate() {
|
|
10
|
+
return _react.default.useReducer(function (ori) {
|
|
11
|
+
return ori + 1;
|
|
12
|
+
}, 0);
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _useLayoutEffect.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _useLayoutEffect = _interopRequireDefault(require("rc-util/lib/hooks/useLayoutEffect"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useMultipleSelect = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
var useMultipleSelect = exports.useMultipleSelect = function useMultipleSelect(getKey) {
|
|
15
|
+
var _useState = (0, _react.useState)(null),
|
|
16
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
+
prevSelectedIndex = _useState2[0],
|
|
18
|
+
setPrevSelectedIndex = _useState2[1];
|
|
19
|
+
var multipleSelect = (0, _react.useCallback)(function (currentSelectedIndex, data, selectedKeys) {
|
|
20
|
+
var configPrevSelectedIndex = prevSelectedIndex !== null && prevSelectedIndex !== void 0 ? prevSelectedIndex : currentSelectedIndex;
|
|
21
|
+
var startIndex = Math.min(configPrevSelectedIndex || 0, currentSelectedIndex);
|
|
22
|
+
var endIndex = Math.max(configPrevSelectedIndex || 0, currentSelectedIndex);
|
|
23
|
+
var rangeKeys = data.slice(startIndex, endIndex + 1).map(getKey);
|
|
24
|
+
var shouldSelected = rangeKeys.some(function (rangeKey) {
|
|
25
|
+
return !selectedKeys.has(rangeKey);
|
|
26
|
+
});
|
|
27
|
+
var changedKeys = [];
|
|
28
|
+
rangeKeys.forEach(function (item) {
|
|
29
|
+
if (shouldSelected) {
|
|
30
|
+
if (!selectedKeys.has(item)) {
|
|
31
|
+
changedKeys.push(item);
|
|
32
|
+
}
|
|
33
|
+
selectedKeys.add(item);
|
|
34
|
+
} else {
|
|
35
|
+
selectedKeys.delete(item);
|
|
36
|
+
changedKeys.push(item);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
setPrevSelectedIndex(shouldSelected ? endIndex : null);
|
|
40
|
+
return changedKeys;
|
|
41
|
+
}, [prevSelectedIndex]);
|
|
42
|
+
return [multipleSelect, setPrevSelectedIndex];
|
|
43
|
+
};
|
|
@@ -5,22 +5,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useOrientation = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
|
|
8
|
+
var isValidOrientation = function isValidOrientation(orientation) {
|
|
9
9
|
return orientation === 'horizontal' || orientation === 'vertical';
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
return (0, _react.useMemo)(()
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var useOrientation = exports.useOrientation = function useOrientation(orientation, vertical, legacyDirection) {
|
|
12
|
+
return (0, _react.useMemo)(function () {
|
|
13
|
+
var validOrientation = isValidOrientation(orientation);
|
|
14
|
+
var mergedOrientation;
|
|
15
15
|
if (validOrientation) {
|
|
16
16
|
mergedOrientation = orientation || 'horizontal';
|
|
17
17
|
} else if (typeof vertical === 'boolean') {
|
|
18
18
|
mergedOrientation = vertical ? 'vertical' : 'horizontal';
|
|
19
19
|
} else {
|
|
20
|
-
|
|
20
|
+
var validLegacyDirection = isValidOrientation(legacyDirection);
|
|
21
21
|
mergedOrientation = validLegacyDirection ? legacyDirection || 'horizontal' : 'horizontal';
|
|
22
22
|
}
|
|
23
23
|
return [mergedOrientation, mergedOrientation === 'vertical'];
|
|
24
24
|
}, [legacyDirection, orientation, vertical]);
|
|
25
|
-
};
|
|
26
|
-
exports.useOrientation = useOrientation;
|
|
25
|
+
};
|
|
@@ -5,27 +5,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useProxyImperativeHandle = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
|
|
8
|
+
var fillProxy = function fillProxy(element, handler) {
|
|
9
9
|
element._dtProxy = element._dtProxy || {};
|
|
10
|
-
Object.keys(handler).forEach(key
|
|
10
|
+
Object.keys(handler).forEach(function (key) {
|
|
11
11
|
if (!(key in element._dtProxy)) {
|
|
12
|
-
|
|
12
|
+
var ori = element[key];
|
|
13
13
|
element._dtProxy[key] = ori;
|
|
14
14
|
element[key] = handler[key];
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
return element;
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
return (0, _react.useImperativeHandle)(ref, ()
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
var useProxyImperativeHandle = exports.useProxyImperativeHandle = function useProxyImperativeHandle(ref, init, deps) {
|
|
20
|
+
return (0, _react.useImperativeHandle)(ref, function () {
|
|
21
|
+
var refObj = init();
|
|
22
|
+
var nativeElement = refObj.nativeElement;
|
|
23
|
+
|
|
24
|
+
// null guard: ref 尚未挂载时(SSR / 首次 render / Strict Mode 二次挂载)
|
|
25
|
+
// 返回 refObj 本身,避免 Proxy(null) 导致 Reflect.get 崩溃
|
|
26
|
+
if (!nativeElement) {
|
|
27
|
+
return refObj;
|
|
28
|
+
}
|
|
25
29
|
if (typeof Proxy !== 'undefined') {
|
|
30
|
+
var refObjKeys = new Set(Object.keys(refObj));
|
|
26
31
|
return new Proxy(nativeElement, {
|
|
27
|
-
get(obj, prop) {
|
|
28
|
-
if (
|
|
32
|
+
get: function get(obj, prop) {
|
|
33
|
+
if (refObjKeys.has(prop)) {
|
|
29
34
|
return refObj[prop];
|
|
30
35
|
}
|
|
31
36
|
return Reflect.get(obj, prop);
|
|
@@ -35,6 +40,5 @@ const useProxyImperativeHandle = (ref, init) => {
|
|
|
35
40
|
|
|
36
41
|
// Fallback of IE
|
|
37
42
|
return fillProxy(nativeElement, refObj);
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
exports.useProxyImperativeHandle = useProxyImperativeHandle;
|
|
43
|
+
}, deps);
|
|
44
|
+
};
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.useSyncState = void 0;
|
|
7
8
|
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var
|
|
9
|
-
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); }
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
var _useForceUpdate3 = require("./useForceUpdate");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
|
+
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; }
|
|
12
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
15
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
16
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
var useSyncState = exports.useSyncState = function useSyncState(initialValue) {
|
|
19
|
+
var ref = React.useRef(initialValue);
|
|
20
|
+
var _useForceUpdate = (0, _useForceUpdate3.useForceUpdate)(),
|
|
21
|
+
_useForceUpdate2 = _slicedToArray(_useForceUpdate, 2),
|
|
22
|
+
forceUpdate = _useForceUpdate2[1];
|
|
23
|
+
return [function () {
|
|
24
|
+
return ref.current;
|
|
25
|
+
}, function (newValue) {
|
|
15
26
|
ref.current = newValue;
|
|
16
27
|
forceUpdate();
|
|
17
28
|
}];
|
|
18
|
-
};
|
|
19
|
-
exports.useSyncState = useSyncState;
|
|
29
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useTimeoutLock = useTimeoutLock;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
10
|
+
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; }
|
|
11
|
+
function useTimeoutLock(defaultState) {
|
|
12
|
+
var frameRef = React.useRef(defaultState !== null && defaultState !== void 0 ? defaultState : null);
|
|
13
|
+
var timeoutRef = React.useRef(null);
|
|
14
|
+
function cleanUp() {
|
|
15
|
+
if (timeoutRef.current) {
|
|
16
|
+
clearTimeout(timeoutRef.current);
|
|
17
|
+
timeoutRef.current = null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function setState(newState) {
|
|
21
|
+
frameRef.current = newState;
|
|
22
|
+
cleanUp();
|
|
23
|
+
timeoutRef.current = setTimeout(function () {
|
|
24
|
+
frameRef.current = null;
|
|
25
|
+
timeoutRef.current = null;
|
|
26
|
+
}, 100);
|
|
27
|
+
}
|
|
28
|
+
function getState() {
|
|
29
|
+
return frameRef.current;
|
|
30
|
+
}
|
|
31
|
+
React.useEffect(function () {
|
|
32
|
+
return cleanUp;
|
|
33
|
+
}, []);
|
|
34
|
+
return [setState, getState];
|
|
35
|
+
}
|
package/lib/_util/index.js
CHANGED
|
@@ -3,11 +3,111 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
toTooltipProps: true
|
|
8
|
+
};
|
|
6
9
|
exports.toTooltipProps = toTooltipProps;
|
|
7
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _getScroll = require("./getScroll");
|
|
12
|
+
Object.keys(_getScroll).forEach(function (key) {
|
|
13
|
+
if (key === "default" || key === "__esModule") return;
|
|
14
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
15
|
+
if (key in exports && exports[key] === _getScroll[key]) return;
|
|
16
|
+
Object.defineProperty(exports, key, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function get() {
|
|
19
|
+
return _getScroll[key];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
var _is = require("./is");
|
|
24
|
+
Object.keys(_is).forEach(function (key) {
|
|
25
|
+
if (key === "default" || key === "__esModule") return;
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
27
|
+
if (key in exports && exports[key] === _is[key]) return;
|
|
28
|
+
Object.defineProperty(exports, key, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function get() {
|
|
31
|
+
return _is[key];
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
var _rcUtil = require("./rcUtil");
|
|
36
|
+
Object.keys(_rcUtil).forEach(function (key) {
|
|
37
|
+
if (key === "default" || key === "__esModule") return;
|
|
38
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
39
|
+
if (key in exports && exports[key] === _rcUtil[key]) return;
|
|
40
|
+
Object.defineProperty(exports, key, {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function get() {
|
|
43
|
+
return _rcUtil[key];
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
var _scrollbar = require("./scrollbar");
|
|
48
|
+
Object.keys(_scrollbar).forEach(function (key) {
|
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
|
50
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
51
|
+
if (key in exports && exports[key] === _scrollbar[key]) return;
|
|
52
|
+
Object.defineProperty(exports, key, {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function get() {
|
|
55
|
+
return _scrollbar[key];
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
var _scrollTo = require("./scrollTo");
|
|
60
|
+
Object.keys(_scrollTo).forEach(function (key) {
|
|
61
|
+
if (key === "default" || key === "__esModule") return;
|
|
62
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
63
|
+
if (key in exports && exports[key] === _scrollTo[key]) return;
|
|
64
|
+
Object.defineProperty(exports, key, {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function get() {
|
|
67
|
+
return _scrollTo[key];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
var _type = require("./type");
|
|
72
|
+
Object.keys(_type).forEach(function (key) {
|
|
73
|
+
if (key === "default" || key === "__esModule") return;
|
|
74
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
75
|
+
if (key in exports && exports[key] === _type[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function get() {
|
|
79
|
+
return _type[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
var _validate = require("./validate");
|
|
84
|
+
Object.keys(_validate).forEach(function (key) {
|
|
85
|
+
if (key === "default" || key === "__esModule") return;
|
|
86
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
87
|
+
if (key in exports && exports[key] === _validate[key]) return;
|
|
88
|
+
Object.defineProperty(exports, key, {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function get() {
|
|
91
|
+
return _validate[key];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
var _warning = require("./warning");
|
|
96
|
+
Object.keys(_warning).forEach(function (key) {
|
|
97
|
+
if (key === "default" || key === "__esModule") return;
|
|
98
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
99
|
+
if (key in exports && exports[key] === _warning[key]) return;
|
|
100
|
+
Object.defineProperty(exports, key, {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: function get() {
|
|
103
|
+
return _warning[key];
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
8
107
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
108
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
9
109
|
function toTooltipProps(tooltip) {
|
|
10
|
-
if (tooltip !== null &&
|
|
110
|
+
if (tooltip !== null && _typeof(tooltip) === 'object' && ! /*#__PURE__*/_react.default.isValidElement(tooltip)) {
|
|
11
111
|
return tooltip;
|
|
12
112
|
}
|
|
13
113
|
return {
|
package/lib/_util/is.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isString = exports.isPlainObject = exports.isNumber = exports.isNonNullable = exports.isFunction = void 0;
|
|
7
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
|
+
var isNonNullable = exports.isNonNullable = function isNonNullable(val) {
|
|
9
|
+
return val !== undefined && val !== null;
|
|
10
|
+
};
|
|
11
|
+
var isNumber = exports.isNumber = function isNumber(val) {
|
|
12
|
+
return typeof val === 'number' && !Number.isNaN(val);
|
|
13
|
+
};
|
|
14
|
+
var isString = exports.isString = function isString(val) {
|
|
15
|
+
return typeof val === 'string';
|
|
16
|
+
};
|
|
17
|
+
var isPlainObject = exports.isPlainObject = function isPlainObject(val) {
|
|
18
|
+
return val !== null && _typeof(val) === 'object';
|
|
19
|
+
};
|
|
20
|
+
var isFunction = exports.isFunction = function isFunction(val) {
|
|
21
|
+
return typeof val === 'function';
|
|
22
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "KeyCode", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _KeyCode.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "get", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _get.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "isEqual", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _isEqual.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
exports.mergeProps = mergeProps;
|
|
25
|
+
Object.defineProperty(exports, "omit", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _omit.default;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "pickAttrs", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function get() {
|
|
34
|
+
return _pickAttrs.default;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "raf", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function get() {
|
|
40
|
+
return _raf.default;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
exports.toArray = toArray;
|
|
44
|
+
Object.defineProperty(exports, "useControlledState", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function get() {
|
|
47
|
+
return _useMergedState.default;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(exports, "useEvent", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function get() {
|
|
53
|
+
return _useEvent.default;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, "useLayoutEffect", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function get() {
|
|
59
|
+
return _useLayoutEffect.default;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(exports, "useMemo", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function get() {
|
|
65
|
+
return _useMemo.default;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, "useMergedState", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function get() {
|
|
71
|
+
return _useMergedState.default;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
var _useEvent = _interopRequireDefault(require("rc-util/lib/hooks/useEvent"));
|
|
75
|
+
var _useLayoutEffect = _interopRequireDefault(require("rc-util/lib/hooks/useLayoutEffect"));
|
|
76
|
+
var _useMemo = _interopRequireDefault(require("rc-util/lib/hooks/useMemo"));
|
|
77
|
+
var _useMergedState = _interopRequireDefault(require("rc-util/lib/hooks/useMergedState"));
|
|
78
|
+
var _isEqual = _interopRequireDefault(require("rc-util/lib/isEqual"));
|
|
79
|
+
var _KeyCode = _interopRequireDefault(require("rc-util/lib/KeyCode"));
|
|
80
|
+
var _omit = _interopRequireDefault(require("rc-util/lib/omit"));
|
|
81
|
+
var _pickAttrs = _interopRequireDefault(require("rc-util/lib/pickAttrs"));
|
|
82
|
+
var _raf = _interopRequireDefault(require("rc-util/lib/raf"));
|
|
83
|
+
var _get = _interopRequireDefault(require("rc-util/lib/utils/get"));
|
|
84
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
85
|
+
/**
|
|
86
|
+
* Local shim for `@rc-component/util`.
|
|
87
|
+
* Maps all needed functions to `rc-util` subpaths (React 17 compatible).
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
// hooks
|
|
91
|
+
|
|
92
|
+
// useControlledState is the @rc-component/util name for useMergedState
|
|
93
|
+
|
|
94
|
+
// isEqual
|
|
95
|
+
|
|
96
|
+
// KeyCode
|
|
97
|
+
|
|
98
|
+
// omit
|
|
99
|
+
|
|
100
|
+
// pickAttrs
|
|
101
|
+
|
|
102
|
+
// raf
|
|
103
|
+
|
|
104
|
+
// get
|
|
105
|
+
|
|
106
|
+
// toArray - implement locally (rc-util doesn't export this at top level)
|
|
107
|
+
function toArray(value) {
|
|
108
|
+
if (value === undefined || value === null) {
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
return Array.isArray(value) ? value : [value];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// mergeProps - implement locally
|
|
115
|
+
// Merges multiple props objects, later ones win for primitive values,
|
|
116
|
+
// functions are chained
|
|
117
|
+
function mergeProps() {
|
|
118
|
+
var result = {};
|
|
119
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
120
|
+
args[_key] = arguments[_key];
|
|
121
|
+
}
|
|
122
|
+
for (var _i = 0, _args = args; _i < _args.length; _i++) {
|
|
123
|
+
var props = _args[_i];
|
|
124
|
+
if (!props) continue;
|
|
125
|
+
for (var _i2 = 0, _arr = Object.keys(props); _i2 < _arr.length; _i2++) {
|
|
126
|
+
var key = _arr[_i2];
|
|
127
|
+
var value = props[key];
|
|
128
|
+
if (value !== undefined) {
|
|
129
|
+
result[key] = value;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return result;
|
|
134
|
+
}
|