@unicom-cloud/ui-common 0.1.1
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/Development.js +10 -0
- package/Empty.js +14 -0
- package/Flex.js +14 -0
- package/Progress.js +8 -0
- package/Space.js +15 -0
- package/SuspenseFallbackTest.js +7 -0
- package/TransitionGroup.js +32 -0
- package/development/index.js +48 -0
- package/empty/index.js +52 -0
- package/flex/index.js +78 -0
- package/flex/interface.js +10 -0
- package/higher-order/index.js +5 -0
- package/higher-order/with-speech-synthesis/index.js +83 -0
- package/higher-order/withSpeechSynthesis.js +11 -0
- package/hooks/create-deep-compare-effect/index.js +10 -0
- package/hooks/create-update-effect/index.js +15 -0
- package/hooks/create-use-storage-state/index.js +79 -0
- package/hooks/createDeepCompareEffect.js +7 -0
- package/hooks/createUpdateEffect.js +6 -0
- package/hooks/createUseStorageState.js +12 -0
- package/hooks/index.js +197 -0
- package/hooks/use-async-effect/index.js +26 -0
- package/hooks/use-boolean/index.js +15 -0
- package/hooks/use-click-away/index.js +32 -0
- package/hooks/use-computed-state/index.js +12 -0
- package/hooks/use-controllable-value/index.js +27 -0
- package/hooks/use-cookie-state/index.js +21 -0
- package/hooks/use-count-down/index.js +37 -0
- package/hooks/use-counter/index.js +44 -0
- package/hooks/use-create/index.js +9 -0
- package/hooks/use-creation/index.js +14 -0
- package/hooks/use-debounce/index.js +14 -0
- package/hooks/use-debounce-effect/index.js +13 -0
- package/hooks/use-debounce-fn/index.js +31 -0
- package/hooks/use-deep-compare-effect/index.js +7 -0
- package/hooks/use-deep-compare-layout-effect/index.js +7 -0
- package/hooks/use-document-visibility/index.js +20 -0
- package/hooks/use-drag/index.js +47 -0
- package/hooks/use-drop/index.js +60 -0
- package/hooks/use-event-listener/index.js +37 -0
- package/hooks/use-event-target/index.js +21 -0
- package/hooks/use-external/index.js +65 -0
- package/hooks/use-favicon/index.js +18 -0
- package/hooks/use-focus-within/index.js +26 -0
- package/hooks/use-force-update/index.js +5 -0
- package/hooks/use-fullscreen/index.js +75 -0
- package/hooks/use-get-state/index.js +10 -0
- package/hooks/use-history-travel/index.js +79 -0
- package/hooks/use-hover/index.js +26 -0
- package/hooks/use-id/index.js +11 -0
- package/hooks/use-in-view/index.js +32 -0
- package/hooks/use-in-viewport/index.js +34 -0
- package/hooks/use-infinite-scroll/index.js +83 -0
- package/hooks/use-intersection-observer/index.js +25 -0
- package/hooks/use-interval/index.js +17 -0
- package/hooks/use-is-first-render/index.js +10 -0
- package/hooks/use-isomorphic-layout-effect/index.js +7 -0
- package/hooks/use-key-press/index.js +169 -0
- package/hooks/use-keyboard-event/index.js +17 -0
- package/hooks/use-latest/index.js +9 -0
- package/hooks/use-listen-window-resize/index.js +10 -0
- package/hooks/use-local-storage-state/index.js +9 -0
- package/hooks/use-lock-fn/index.js +23 -0
- package/hooks/use-long-press/index.js +59 -0
- package/hooks/use-map/index.js +31 -0
- package/hooks/use-media/index.js +16 -0
- package/hooks/use-memoized-fn/index.js +19 -0
- package/hooks/use-merge-props/index.js +18 -0
- package/hooks/use-merge-value/index.js +21 -0
- package/hooks/use-mount/index.js +13 -0
- package/hooks/use-mouse/index.js +50 -0
- package/hooks/use-mutation-observer/index.js +23 -0
- package/hooks/use-network/index.js +57 -0
- package/hooks/use-online-status/index.js +21 -0
- package/hooks/use-overflow-hidden/index.js +27 -0
- package/hooks/use-override-ref/index.js +15 -0
- package/hooks/use-pagination/index.js +49 -0
- package/hooks/use-persist-callback/index.js +9 -0
- package/hooks/use-prefers-color-scheme-dark/index.js +25 -0
- package/hooks/use-previous/index.js +10 -0
- package/hooks/use-raf-interval/index.js +36 -0
- package/hooks/use-raf-state/index.js +16 -0
- package/hooks/use-raf-timeout/index.js +35 -0
- package/hooks/use-reactive/index.js +38 -0
- package/hooks/use-ref-latest/index.js +5 -0
- package/hooks/use-refs/index.js +11 -0
- package/hooks/use-request/index.js +7 -0
- package/hooks/use-request/src/Fetch.js +93 -0
- package/hooks/use-request/src/plugins/useAutoRunPlugin.js +30 -0
- package/hooks/use-request/src/plugins/useCachePlugin.js +66 -0
- package/hooks/use-request/src/plugins/useDebouncePlugin.js +34 -0
- package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +28 -0
- package/hooks/use-request/src/plugins/usePollingPlugin.js +37 -0
- package/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.js +29 -0
- package/hooks/use-request/src/plugins/useRetryPlugin.js +28 -0
- package/hooks/use-request/src/plugins/useThrottlePlugin.js +31 -0
- package/hooks/use-request/src/useRequest.js +26 -0
- package/hooks/use-request/src/useRequestImplement.js +54 -0
- package/hooks/use-request/src/utils/cache.js +20 -0
- package/hooks/use-request/src/utils/cachePromise.js +10 -0
- package/hooks/use-request/src/utils/cacheSubscribe.js +11 -0
- package/hooks/use-request/src/utils/isDocumentVisible.js +8 -0
- package/hooks/use-request/src/utils/isOnline.js +8 -0
- package/hooks/use-request/src/utils/limit.js +12 -0
- package/hooks/use-request/src/utils/subscribeFocus.js +19 -0
- package/hooks/use-request/src/utils/subscribeReVisible.js +18 -0
- package/hooks/use-reset-state/index.js +18 -0
- package/hooks/use-resize-observer/index.js +5 -0
- package/hooks/use-responsive/index.js +47 -0
- package/hooks/use-safe-state/index.js +12 -0
- package/hooks/use-scroll/index.js +44 -0
- package/hooks/use-selections/index.js +58 -0
- package/hooks/use-session-storage-state/index.js +9 -0
- package/hooks/use-set/index.js +23 -0
- package/hooks/use-set-state/index.js +17 -0
- package/hooks/use-size/index.js +41 -0
- package/hooks/use-state-callback/index.js +16 -0
- package/hooks/use-state-with-promise/index.js +36 -0
- package/hooks/use-text-selection/index.js +56 -0
- package/hooks/use-theme/index.js +36 -0
- package/hooks/use-throttle/index.js +14 -0
- package/hooks/use-throttle-effect/index.js +13 -0
- package/hooks/use-throttle-fn/index.js +31 -0
- package/hooks/use-timeout/index.js +17 -0
- package/hooks/use-title/index.js +18 -0
- package/hooks/use-toggle/index.js +17 -0
- package/hooks/use-tracked-effect/index.js +12 -0
- package/hooks/use-unmount/index.js +21 -0
- package/hooks/use-unmounted-ref/index.js +11 -0
- package/hooks/use-update/index.js +9 -0
- package/hooks/use-update-effect/index.js +7 -0
- package/hooks/use-update-layout-effect/index.js +7 -0
- package/hooks/use-url-state/index.js +60 -0
- package/hooks/use-virtual-list/index.js +83 -0
- package/hooks/use-watch/index.js +14 -0
- package/hooks/use-web-socket/index.js +74 -0
- package/hooks/use-why-did-you-update/index.js +20 -0
- package/hooks/use-window-size/index.js +40 -0
- package/hooks/useAsyncEffect.js +8 -0
- package/hooks/useBoolean.js +7 -0
- package/hooks/useClickAway.js +11 -0
- package/hooks/useComputedState.js +6 -0
- package/hooks/useControllableValue.js +10 -0
- package/hooks/useCookieState.js +10 -0
- package/hooks/useCountDown.js +10 -0
- package/hooks/useCounter.js +9 -0
- package/hooks/useCreate.js +6 -0
- package/hooks/useCreation.js +7 -0
- package/hooks/useDebounce.js +7 -0
- package/hooks/useDebounceEffect.js +8 -0
- package/hooks/useDebounceFn.js +12 -0
- package/hooks/useDeepCompareEffect.js +7 -0
- package/hooks/useDeepCompareLayoutEffect.js +7 -0
- package/hooks/useDocumentVisibility.js +8 -0
- package/hooks/useDrag.js +12 -0
- package/hooks/useDrop.js +9 -0
- package/hooks/useEventListener.js +10 -0
- package/hooks/useEventTarget.js +9 -0
- package/hooks/useExternal.js +6 -0
- package/hooks/useFavicon.js +6 -0
- package/hooks/useFocusWithin.js +7 -0
- package/hooks/useForceUpdate.js +5 -0
- package/hooks/useFullscreen.js +12 -0
- package/hooks/useGetState.js +7 -0
- package/hooks/useHistoryTravel.js +9 -0
- package/hooks/useHover.js +7 -0
- package/hooks/useId.js +8 -0
- package/hooks/useInView.js +7 -0
- package/hooks/useInViewport.js +10 -0
- package/hooks/useInfiniteScroll.js +13 -0
- package/hooks/useIntersectionObserver.js +10 -0
- package/hooks/useInterval.js +9 -0
- package/hooks/useIsFirstRender.js +6 -0
- package/hooks/useIsomorphicLayoutEffect.js +7 -0
- package/hooks/useKeyPress.js +11 -0
- package/hooks/useKeyboardEvent.js +7 -0
- package/hooks/useLatest.js +6 -0
- package/hooks/useListenWindowResize.js +6 -0
- package/hooks/useLocalStorageState.js +7 -0
- package/hooks/useLockFn.js +6 -0
- package/hooks/useLongPress.js +9 -0
- package/hooks/useMap.js +7 -0
- package/hooks/useMedia.js +6 -0
- package/hooks/useMemoizedFn.js +9 -0
- package/hooks/useMergeProps.js +7 -0
- package/hooks/useMergeValue.js +9 -0
- package/hooks/useMount.js +9 -0
- package/hooks/useMouse.js +8 -0
- package/hooks/useMutationObserver.js +8 -0
- package/hooks/useNetwork.js +8 -0
- package/hooks/useOnlineStatus.js +6 -0
- package/hooks/useOverflowHidden.js +6 -0
- package/hooks/useOverrideRef.js +8 -0
- package/hooks/usePagination.js +9 -0
- package/hooks/usePersistCallback.js +6 -0
- package/hooks/usePrefersColorSchemeDark.js +7 -0
- package/hooks/usePrevious.js +6 -0
- package/hooks/useRafInterval.js +9 -0
- package/hooks/useRafState.js +7 -0
- package/hooks/useRafTimeout.js +9 -0
- package/hooks/useReactive.js +10 -0
- package/hooks/useRefLatest.js +5 -0
- package/hooks/useRefs.js +6 -0
- package/hooks/useRequest.js +7 -0
- package/hooks/useResetState.js +10 -0
- package/hooks/useResizeObserver.js +5 -0
- package/hooks/useResponsive.js +8 -0
- package/hooks/useSafeState.js +7 -0
- package/hooks/useScroll.js +9 -0
- package/hooks/useSelections.js +9 -0
- package/hooks/useSessionStorageState.js +7 -0
- package/hooks/useSet.js +7 -0
- package/hooks/useSetState.js +9 -0
- package/hooks/useSize.js +11 -0
- package/hooks/useStateCallback.js +6 -0
- package/hooks/useStateWithPromise.js +8 -0
- package/hooks/useTextSelection.js +8 -0
- package/hooks/useTheme.js +9 -0
- package/hooks/useThrottle.js +7 -0
- package/hooks/useThrottleEffect.js +8 -0
- package/hooks/useThrottleFn.js +12 -0
- package/hooks/useTimeout.js +9 -0
- package/hooks/useTitle.js +8 -0
- package/hooks/useToggle.js +6 -0
- package/hooks/useTrackedEffect.js +6 -0
- package/hooks/useUnmount.js +10 -0
- package/hooks/useUnmountedRef.js +6 -0
- package/hooks/useUpdate.js +6 -0
- package/hooks/useUpdateEffect.js +7 -0
- package/hooks/useUpdateLayoutEffect.js +7 -0
- package/hooks/useUrlState.js +12 -0
- package/hooks/useVirtualList.js +14 -0
- package/hooks/useWatch.js +9 -0
- package/hooks/useWebSocket.js +10 -0
- package/hooks/useWhyDidYouUpdate.js +6 -0
- package/hooks/useWindowSize.js +10 -0
- package/hooks/utils/createEffectWithTarget.js +23 -0
- package/hooks/utils/depsAreSame.js +12 -0
- package/hooks/utils/depsEqual.js +7 -0
- package/hooks/utils/domTarget.js +16 -0
- package/hooks/utils/getDocumentOrShadow.js +16 -0
- package/hooks/utils/index.js +5 -0
- package/hooks/utils/isAppleDevice.js +6 -0
- package/hooks/utils/isBrowser.js +6 -0
- package/hooks/utils/isDev.js +5 -0
- package/hooks/utils/rect.js +19 -0
- package/hooks/utils/useDeepCompareWithTarget.js +11 -0
- package/hooks/utils/useEffectWithTarget.js +7 -0
- package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +8 -0
- package/hooks/utils/useLayoutEffectWithTarget.js +7 -0
- package/hooks/utils.js +5 -0
- package/icons/file/index.js +59 -0
- package/icons/file.js +9 -0
- package/index.js +49 -0
- package/package.json +1 -0
- package/progress/index.js +153 -0
- package/space/index.js +77 -0
- package/style/animation.less +21 -0
- package/style/global.less +69 -0
- package/style/index.less +41 -0
- package/style/keyframes.less +48 -0
- package/style/normalize.less +0 -0
- package/style/override.less +0 -0
- package/style/style.less +2 -0
- package/style/variables.css +3 -0
- package/style/variables.less +0 -0
- package/style.css +1 -0
- package/suspense-fallback-test/index.js +17 -0
- package/transition-group/CSSTransition.js +91 -0
- package/transition-group/PqbCSSTransition.js +36 -0
- package/transition-group/ReplaceTransition.js +34 -0
- package/transition-group/SwitchTransition.js +102 -0
- package/transition-group/Transition.js +188 -0
- package/transition-group/TransitionGroup.js +50 -0
- package/transition-group/TransitionGroupContext.js +6 -0
- package/transition-group/index.js +32 -0
- package/transition-group/utils/ChildMapping.js +66 -0
- package/types/development/index.d.ts +8 -0
- package/types/development/interface.d.ts +22 -0
- package/types/empty/index.d.ts +5 -0
- package/types/empty/interface.d.ts +24 -0
- package/types/flex/index.d.ts +8 -0
- package/types/flex/interface.d.ts +73 -0
- package/types/higher-order/index.d.ts +1 -0
- package/types/higher-order/with-speech-synthesis/index.d.ts +7 -0
- package/types/higher-order/with-speech-synthesis/interface.d.ts +13 -0
- package/types/hooks/create-deep-compare-effect/index.d.ts +5 -0
- package/types/hooks/create-update-effect/index.d.ts +4 -0
- package/types/hooks/create-use-storage-state/index.d.ts +11 -0
- package/types/hooks/index.d.ts +97 -0
- package/types/hooks/use-async-effect/index.d.ts +3 -0
- package/types/hooks/use-boolean/index.d.ts +7 -0
- package/types/hooks/use-click-away/index.d.ts +4 -0
- package/types/hooks/use-computed-state/index.d.ts +4 -0
- package/types/hooks/use-controllable-value/index.d.ts +16 -0
- package/types/hooks/use-cookie-state/index.d.ts +7 -0
- package/types/hooks/use-count-down/index.d.ts +17 -0
- package/types/hooks/use-counter/index.d.ts +18 -0
- package/types/hooks/use-create/index.d.ts +2 -0
- package/types/hooks/use-creation/index.d.ts +3 -0
- package/types/hooks/use-debounce/debounceOptions.d.ts +6 -0
- package/types/hooks/use-debounce/index.d.ts +3 -0
- package/types/hooks/use-debounce-effect/index.d.ts +4 -0
- package/types/hooks/use-debounce-fn/index.d.ts +8 -0
- package/types/hooks/use-deep-compare-effect/index.d.ts +3 -0
- package/types/hooks/use-deep-compare-layout-effect/index.d.ts +3 -0
- package/types/hooks/use-document-visibility/index.d.ts +3 -0
- package/types/hooks/use-drag/index.d.ts +13 -0
- package/types/hooks/use-drop/index.d.ts +15 -0
- package/types/hooks/use-event-listener/index.d.ts +17 -0
- package/types/hooks/use-event-target/index.d.ts +14 -0
- package/types/hooks/use-external/index.d.ts +20 -0
- package/types/hooks/use-favicon/index.d.ts +2 -0
- package/types/hooks/use-focus-within/index.d.ts +7 -0
- package/types/hooks/use-force-update/index.d.ts +16 -0
- package/types/hooks/use-fullscreen/index.d.ts +17 -0
- package/types/hooks/use-get-state/index.d.ts +9 -0
- package/types/hooks/use-history-travel/index.d.ts +10 -0
- package/types/hooks/use-hover/index.d.ts +8 -0
- package/types/hooks/use-id/index.d.ts +6 -0
- package/types/hooks/use-in-view/index.d.ts +11 -0
- package/types/hooks/use-in-viewport/index.d.ts +10 -0
- package/types/hooks/use-infinite-scroll/index.d.ts +15 -0
- package/types/hooks/use-infinite-scroll/types.d.ts +32 -0
- package/types/hooks/use-intersection-observer/index.d.ts +7 -0
- package/types/hooks/use-interval/index.d.ts +4 -0
- package/types/hooks/use-is-first-render/index.d.ts +2 -0
- package/types/hooks/use-isomorphic-layout-effect/index.d.ts +3 -0
- package/types/hooks/use-key-press/index.d.ts +14 -0
- package/types/hooks/use-keyboard-event/index.d.ts +8 -0
- package/types/hooks/use-latest/index.d.ts +2 -0
- package/types/hooks/use-listen-window-resize/index.d.ts +16 -0
- package/types/hooks/use-local-storage-state/index.d.ts +2 -0
- package/types/hooks/use-lock-fn/index.d.ts +2 -0
- package/types/hooks/use-long-press/index.d.ts +13 -0
- package/types/hooks/use-map/index.d.ts +8 -0
- package/types/hooks/use-media/index.d.ts +2 -0
- package/types/hooks/use-memoized-fn/index.d.ts +4 -0
- package/types/hooks/use-merge-props/index.d.ts +5 -0
- package/types/hooks/use-merge-value/index.d.ts +6 -0
- package/types/hooks/use-mount/index.d.ts +3 -0
- package/types/hooks/use-mouse/index.d.ts +17 -0
- package/types/hooks/use-mutation-observer/index.d.ts +3 -0
- package/types/hooks/use-network/index.d.ts +12 -0
- package/types/hooks/use-online-status/index.d.ts +2 -0
- package/types/hooks/use-overflow-hidden/index.d.ts +5 -0
- package/types/hooks/use-override-ref/index.d.ts +3 -0
- package/types/hooks/use-pagination/index.d.ts +3 -0
- package/types/hooks/use-pagination/types.d.ts +29 -0
- package/types/hooks/use-persist-callback/index.d.ts +2 -0
- package/types/hooks/use-prefers-color-scheme-dark/index.d.ts +2 -0
- package/types/hooks/use-previous/index.d.ts +3 -0
- package/types/hooks/use-raf-interval/index.d.ts +4 -0
- package/types/hooks/use-raf-state/index.d.ts +7 -0
- package/types/hooks/use-raf-timeout/index.d.ts +2 -0
- package/types/hooks/use-reactive/index.d.ts +2 -0
- package/types/hooks/use-ref-latest/index.d.ts +2 -0
- package/types/hooks/use-refs/index.d.ts +2 -0
- package/types/hooks/use-request/index.d.ts +4 -0
- package/types/hooks/use-request/src/Fetch.d.ts +20 -0
- package/types/hooks/use-request/src/plugins/useAutoRunPlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/useCachePlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/useDebouncePlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/useLoadingDelayPlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/usePollingPlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/useRetryPlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/useThrottlePlugin.d.ts +3 -0
- package/types/hooks/use-request/src/types.d.ts +73 -0
- package/types/hooks/use-request/src/useRequest.d.ts +3 -0
- package/types/hooks/use-request/src/useRequestImplement.d.ts +3 -0
- package/types/hooks/use-request/src/utils/cache.d.ts +14 -0
- package/types/hooks/use-request/src/utils/cachePromise.d.ts +4 -0
- package/types/hooks/use-request/src/utils/cacheSubscribe.d.ts +4 -0
- package/types/hooks/use-request/src/utils/isDocumentVisible.d.ts +1 -0
- package/types/hooks/use-request/src/utils/isOnline.d.ts +2 -0
- package/types/hooks/use-request/src/utils/limit.d.ts +1 -0
- package/types/hooks/use-request/src/utils/subscribeFocus.d.ts +3 -0
- package/types/hooks/use-request/src/utils/subscribeReVisible.d.ts +3 -0
- package/types/hooks/use-reset-state/index.d.ts +4 -0
- package/types/hooks/use-resize-observer/index.d.ts +2 -0
- package/types/hooks/use-responsive/index.d.ts +5 -0
- package/types/hooks/use-safe-state/index.d.ts +7 -0
- package/types/hooks/use-scroll/index.d.ts +9 -0
- package/types/hooks/use-selections/index.d.ts +21 -0
- package/types/hooks/use-session-storage-state/index.d.ts +2 -0
- package/types/hooks/use-set/index.d.ts +6 -0
- package/types/hooks/use-set-state/index.d.ts +3 -0
- package/types/hooks/use-size/index.d.ts +7 -0
- package/types/hooks/use-state-callback/index.d.ts +5 -0
- package/types/hooks/use-state-with-promise/index.d.ts +2 -0
- package/types/hooks/use-text-selection/index.d.ts +14 -0
- package/types/hooks/use-theme/index.d.ts +16 -0
- package/types/hooks/use-throttle/index.d.ts +3 -0
- package/types/hooks/use-throttle/throttleOptions.d.ts +5 -0
- package/types/hooks/use-throttle-effect/index.d.ts +4 -0
- package/types/hooks/use-throttle-fn/index.d.ts +8 -0
- package/types/hooks/use-timeout/index.d.ts +2 -0
- package/types/hooks/use-title/index.d.ts +5 -0
- package/types/hooks/use-toggle/index.d.ts +10 -0
- package/types/hooks/use-tracked-effect/index.d.ts +4 -0
- package/types/hooks/use-unmount/index.d.ts +2 -0
- package/types/hooks/use-unmounted-ref/index.d.ts +2 -0
- package/types/hooks/use-update/index.d.ts +2 -0
- package/types/hooks/use-update-effect/index.d.ts +3 -0
- package/types/hooks/use-update-layout-effect/index.d.ts +3 -0
- package/types/hooks/use-url-state/index.d.ts +10 -0
- package/types/hooks/use-virtual-list/index.d.ts +13 -0
- package/types/hooks/use-watch/index.d.ts +3 -0
- package/types/hooks/use-web-socket/index.d.ts +26 -0
- package/types/hooks/use-why-did-you-update/index.d.ts +3 -0
- package/types/hooks/use-window-size/index.d.ts +18 -0
- package/types/hooks/utils/createEffectWithTarget.d.ts +4 -0
- package/types/hooks/utils/depsAreSame.d.ts +3 -0
- package/types/hooks/utils/depsEqual.d.ts +2 -0
- package/types/hooks/utils/domTarget.d.ts +6 -0
- package/types/hooks/utils/getDocumentOrShadow.d.ts +3 -0
- package/types/hooks/utils/index.d.ts +2 -0
- package/types/hooks/utils/isAppleDevice.d.ts +2 -0
- package/types/hooks/utils/isBrowser.d.ts +2 -0
- package/types/hooks/utils/isDev.d.ts +2 -0
- package/types/hooks/utils/rect.d.ts +4 -0
- package/types/hooks/utils/useDeepCompareWithTarget.d.ts +4 -0
- package/types/hooks/utils/useEffectWithTarget.d.ts +2 -0
- package/types/hooks/utils/useIsomorphicLayoutEffectWithTarget.d.ts +2 -0
- package/types/hooks/utils/useLayoutEffectWithTarget.d.ts +2 -0
- package/types/icons/file/index.d.ts +4 -0
- package/types/icons/file/interface.d.ts +20 -0
- package/types/index.d.ts +16 -0
- package/types/progress/index.d.ts +437 -0
- package/types/space/index.d.ts +7 -0
- package/types/space/interface.d.ts +53 -0
- package/types/suspense-fallback-test/index.d.ts +7 -0
- package/types/suspense-fallback-test/interface.d.ts +1 -0
- package/types/transition-group/CSSTransition.d.ts +98 -0
- package/types/transition-group/PqbCSSTransition.d.ts +4 -0
- package/types/transition-group/ReplaceTransition.d.ts +23 -0
- package/types/transition-group/SwitchTransition.d.ts +88 -0
- package/types/transition-group/Transition.d.ts +130 -0
- package/types/transition-group/TransitionGroup.d.ts +31 -0
- package/types/transition-group/TransitionGroupContext.d.ts +3 -0
- package/types/transition-group/index.d.ts +10 -0
- package/types/transition-group/utils/ChildMapping.d.ts +27 -0
- package/types/utils/caseName.d.ts +1 -0
- package/types/utils/className.d.ts +1 -0
- package/types/utils/compute.d.ts +100 -0
- package/types/utils/constant.d.ts +3 -0
- package/types/utils/copy.d.ts +3 -0
- package/types/utils/date.d.ts +1 -0
- package/types/utils/dayjs.d.ts +3 -0
- package/types/utils/dom.d.ts +27 -0
- package/types/utils/emitter.d.ts +1 -0
- package/types/utils/fileToURL.d.ts +1 -0
- package/types/utils/fillNBSP.d.ts +3 -0
- package/types/utils/findScrollParent.d.ts +2 -0
- package/types/utils/getHighlightText.d.ts +7 -0
- package/types/utils/getHotkeyHandler.d.ts +18 -0
- package/types/utils/getStringLength.d.ts +3 -0
- package/types/utils/include.d.ts +3 -0
- package/types/utils/index.d.ts +46 -0
- package/types/utils/intersectionObserver.d.ts +3 -0
- package/types/utils/is.d.ts +10 -0
- package/types/utils/keyboardCode.d.ts +4 -0
- package/types/utils/lodash.d.ts +60 -0
- package/types/utils/math.d.ts +1 -0
- package/types/utils/mergeProps.d.ts +3 -0
- package/types/utils/mergedToString.d.ts +4 -0
- package/types/utils/mutationObserver.d.ts +3 -0
- package/types/utils/omit.d.ts +3 -0
- package/types/utils/pad.d.ts +2 -0
- package/types/utils/pick.d.ts +6 -0
- package/types/utils/pinyin.d.ts +1 -0
- package/types/utils/react19Adapter.d.ts +1 -0
- package/types/utils/reactDOM.d.ts +34 -0
- package/types/utils/resizeObserver.d.ts +3 -0
- package/types/utils/saveAs.d.ts +1 -0
- package/types/utils/screenfull.d.ts +1 -0
- package/types/utils/scrollIntoViewIfNeeded.d.ts +12 -0
- package/types/utils/setDarkTheme.d.ts +4 -0
- package/types/utils/setDir.d.ts +3 -0
- package/types/utils/setPrimaryColor.d.ts +3 -0
- package/types/utils/setTheme.d.ts +3 -0
- package/types/utils/style.d.ts +3 -0
- package/types/utils/supportRef.d.ts +3 -0
- package/types/utils/throttleByRaf.d.ts +6 -0
- package/types/utils/throttleByRaf2.d.ts +6 -0
- package/types/utils/tinycolor.d.ts +2 -0
- package/types/utils/toArray.d.ts +13 -0
- package/types/utils/tree.d.ts +1 -0
- package/types/utils/tween.d.ts +1 -0
- package/types/utils/uuid.d.ts +1 -0
- package/types/utils/validate.d.ts +1 -0
- package/types/utils/warning.d.ts +3 -0
- package/utils/caseName.js +6 -0
- package/utils/className.js +6 -0
- package/utils/compute.js +142 -0
- package/utils/constant.js +10 -0
- package/utils/copy.js +8 -0
- package/utils/date.js +2 -0
- package/utils/dayjs.js +23 -0
- package/utils/dom.js +63 -0
- package/utils/emitter.js +6 -0
- package/utils/fileToURL.js +6 -0
- package/utils/fillNBSP.js +10 -0
- package/utils/findScrollParent.js +18 -0
- package/utils/getHighlightText.js +45 -0
- package/utils/getHotkeyHandler.js +29 -0
- package/utils/getStringLength.js +11 -0
- package/utils/include.js +11 -0
- package/utils/index.js +334 -0
- package/utils/intersectionObserver.js +23 -0
- package/utils/is.js +98 -0
- package/utils/keyboardCode.js +7 -0
- package/utils/lodash.js +121 -0
- package/utils/math.js +10 -0
- package/utils/mergeProps.js +13 -0
- package/utils/mergedToString.js +16 -0
- package/utils/mutationObserver.js +21 -0
- package/utils/omit.js +13 -0
- package/utils/pad.js +19 -0
- package/utils/pick.js +19 -0
- package/utils/pinyin.js +6 -0
- package/utils/react19Adapter.js +4 -0
- package/utils/reactDOM.js +87 -0
- package/utils/resizeObserver.js +33 -0
- package/utils/saveAs.js +6 -0
- package/utils/screenfull.js +6 -0
- package/utils/scrollIntoViewIfNeeded.js +75 -0
- package/utils/setDarkTheme.js +28 -0
- package/utils/setDir.js +14 -0
- package/utils/setPrimaryColor.js +31 -0
- package/utils/setTheme.js +56 -0
- package/utils/style.js +40 -0
- package/utils/supportRef.js +10 -0
- package/utils/throttleByRaf.js +17 -0
- package/utils/throttleByRaf2.js +9 -0
- package/utils/tinycolor.js +7 -0
- package/utils/toArray.js +15 -0
- package/utils/tree.js +14 -0
- package/utils/tween.js +7 -0
- package/utils/uuid.js +6 -0
- package/utils/validate.js +18 -0
- package/utils/warning.js +12 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Enum of modes for SwitchTransition component
|
|
4
|
+
* @enum { string }
|
|
5
|
+
*/
|
|
6
|
+
export declare const modes: {
|
|
7
|
+
out: string;
|
|
8
|
+
in: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).
|
|
12
|
+
* You can use it when you want to control the render between state transitions.
|
|
13
|
+
* Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.
|
|
14
|
+
*
|
|
15
|
+
* If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.
|
|
16
|
+
* If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.
|
|
17
|
+
*
|
|
18
|
+
* **Note**: If you want the animation to happen simultaneously
|
|
19
|
+
* (that is, to have the old child removed and a new child inserted **at the same time**),
|
|
20
|
+
* you should use
|
|
21
|
+
* [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)
|
|
22
|
+
* instead.
|
|
23
|
+
*
|
|
24
|
+
* ```jsx
|
|
25
|
+
* function App() {
|
|
26
|
+
* const [state, setState] = useState(false);
|
|
27
|
+
* const helloRef = useRef(null);
|
|
28
|
+
* const goodbyeRef = useRef(null);
|
|
29
|
+
* const refElement = state ? goodbyeRef : helloRef;
|
|
30
|
+
* return (
|
|
31
|
+
* <SwitchTransition>
|
|
32
|
+
* <CSSTransition
|
|
33
|
+
* key={state ? "Goodbye, world!" : "Hello, world!"}
|
|
34
|
+
* refElement={refElement}
|
|
35
|
+
* addEndListener={(element, done) => element.addEventListener("transitionend", done, false)}
|
|
36
|
+
* classNames='fade'
|
|
37
|
+
* >
|
|
38
|
+
* <button ref={refElement} onClick={() => setState(state => !state)}>
|
|
39
|
+
* {state ? "Goodbye, world!" : "Hello, world!"}
|
|
40
|
+
* </button>
|
|
41
|
+
* </CSSTransition>
|
|
42
|
+
* </SwitchTransition>
|
|
43
|
+
* );
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* ```css
|
|
48
|
+
* .fade-enter{
|
|
49
|
+
* opacity: 0;
|
|
50
|
+
* }
|
|
51
|
+
* .fade-exit{
|
|
52
|
+
* opacity: 1;
|
|
53
|
+
* }
|
|
54
|
+
* .fade-enter-active{
|
|
55
|
+
* opacity: 1;
|
|
56
|
+
* }
|
|
57
|
+
* .fade-exit-active{
|
|
58
|
+
* opacity: 0;
|
|
59
|
+
* }
|
|
60
|
+
* .fade-enter-active,
|
|
61
|
+
* .fade-exit-active{
|
|
62
|
+
* transition: opacity 500ms;
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
declare class SwitchTransition extends React.Component {
|
|
67
|
+
state: {
|
|
68
|
+
status: string;
|
|
69
|
+
current: null;
|
|
70
|
+
};
|
|
71
|
+
appeared: boolean;
|
|
72
|
+
componentDidMount(): void;
|
|
73
|
+
static getDerivedStateFromProps(props: any, state: any): {
|
|
74
|
+
current: null;
|
|
75
|
+
status?: undefined;
|
|
76
|
+
} | {
|
|
77
|
+
status: string;
|
|
78
|
+
current?: undefined;
|
|
79
|
+
} | {
|
|
80
|
+
current: React.FunctionComponentElement<{
|
|
81
|
+
in: boolean;
|
|
82
|
+
}>;
|
|
83
|
+
status?: undefined;
|
|
84
|
+
};
|
|
85
|
+
changeState: (status: any, current?: null) => void;
|
|
86
|
+
render(): React.JSX.Element;
|
|
87
|
+
}
|
|
88
|
+
export default SwitchTransition;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const UNMOUNTED = "unmounted";
|
|
3
|
+
export declare const EXITED = "exited";
|
|
4
|
+
export declare const ENTERING = "entering";
|
|
5
|
+
export declare const ENTERED = "entered";
|
|
6
|
+
export declare const EXITING = "exiting";
|
|
7
|
+
/**
|
|
8
|
+
* The Transition component lets you describe a transition from one component
|
|
9
|
+
* state to another _over time_ with a simple declarative API. Most commonly
|
|
10
|
+
* it's used to animate the mounting and unmounting of a component, but can also
|
|
11
|
+
* be used to describe in-place transition states as well.
|
|
12
|
+
*
|
|
13
|
+
* ---
|
|
14
|
+
*
|
|
15
|
+
* **Note**: `Transition` is a platform-agnostic base component. If you're using
|
|
16
|
+
* transitions in CSS, you'll probably want to use
|
|
17
|
+
* [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
|
|
18
|
+
* instead. It inherits all the features of `Transition`, but contains
|
|
19
|
+
* additional features necessary to play nice with CSS transitions (hence the
|
|
20
|
+
* name of the component).
|
|
21
|
+
*
|
|
22
|
+
* ---
|
|
23
|
+
*
|
|
24
|
+
* By default the `Transition` component does not alter the behavior of the
|
|
25
|
+
* component it renders, it only tracks "enter" and "exit" states for the
|
|
26
|
+
* components. It's up to you to give meaning and effect to those states. For
|
|
27
|
+
* example we can add styles to a component when it enters or exits:
|
|
28
|
+
*
|
|
29
|
+
* ```jsx
|
|
30
|
+
* import { Transition } from 'react-transition-group';
|
|
31
|
+
* import { useRef } from 'react';
|
|
32
|
+
*
|
|
33
|
+
* const duration = 300;
|
|
34
|
+
*
|
|
35
|
+
* const defaultStyle = {
|
|
36
|
+
* transition: `opacity ${duration}ms ease-in-out`,
|
|
37
|
+
* opacity: 0,
|
|
38
|
+
* }
|
|
39
|
+
*
|
|
40
|
+
* const transitionStyles = {
|
|
41
|
+
* entering: { opacity: 1 },
|
|
42
|
+
* entered: { opacity: 1 },
|
|
43
|
+
* exiting: { opacity: 0 },
|
|
44
|
+
* exited: { opacity: 0 },
|
|
45
|
+
* };
|
|
46
|
+
*
|
|
47
|
+
* function Fade({ in: inProp }) {
|
|
48
|
+
* const refElement = useRef(null);
|
|
49
|
+
* return (
|
|
50
|
+
* <Transition refElement={refElement} in={inProp} timeout={duration}>
|
|
51
|
+
* {state => (
|
|
52
|
+
* <div ref={refElement} style={{
|
|
53
|
+
* ...defaultStyle,
|
|
54
|
+
* ...transitionStyles[state]
|
|
55
|
+
* }}>
|
|
56
|
+
* I'm a fade Transition!
|
|
57
|
+
* </div>
|
|
58
|
+
* )}
|
|
59
|
+
* </Transition>
|
|
60
|
+
* );
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* There are 4 main states a Transition can be in:
|
|
65
|
+
* - `'entering'`
|
|
66
|
+
* - `'entered'`
|
|
67
|
+
* - `'exiting'`
|
|
68
|
+
* - `'exited'`
|
|
69
|
+
*
|
|
70
|
+
* Transition state is toggled via the `in` prop. When `true` the component
|
|
71
|
+
* begins the "Enter" stage. During this stage, the component will shift from
|
|
72
|
+
* its current transition state, to `'entering'` for the duration of the
|
|
73
|
+
* transition and then to the `'entered'` stage once it's complete. Let's take
|
|
74
|
+
* the following example (we'll use the
|
|
75
|
+
* [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
|
|
76
|
+
*
|
|
77
|
+
* ```jsx
|
|
78
|
+
* import { Transition } from 'react-transition-group';
|
|
79
|
+
* import { useState, useRef } from 'react';
|
|
80
|
+
*
|
|
81
|
+
* function App() {
|
|
82
|
+
* const [inProp, setInProp] = useState(false);
|
|
83
|
+
* const refElement = useRef(null);
|
|
84
|
+
* return (
|
|
85
|
+
* <div>
|
|
86
|
+
* <Transition refElement={refElement} in={inProp} timeout={500}>
|
|
87
|
+
* {state => ()}
|
|
88
|
+
* </Transition>
|
|
89
|
+
* <button onClick={() => setInProp(true)}>
|
|
90
|
+
* Click to Enter
|
|
91
|
+
* </button>
|
|
92
|
+
* </div>
|
|
93
|
+
* );
|
|
94
|
+
* }
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* When the button is clicked the component will shift to the `'entering'` state
|
|
98
|
+
* and stay there for 500ms (the value of `timeout`) before it finally switches
|
|
99
|
+
* to `'entered'`.
|
|
100
|
+
*
|
|
101
|
+
* When `in` is `false` the same thing happens except the state moves from
|
|
102
|
+
* `'exiting'` to `'exited'`.
|
|
103
|
+
*/
|
|
104
|
+
declare class Transition extends React.Component {
|
|
105
|
+
static contextType: React.Context<null>;
|
|
106
|
+
constructor(props: any, context: any);
|
|
107
|
+
refElement: undefined;
|
|
108
|
+
static getDerivedStateFromProps({ in: nextIn }: {
|
|
109
|
+
in: any;
|
|
110
|
+
}, prevState: any): {
|
|
111
|
+
status: string;
|
|
112
|
+
} | null;
|
|
113
|
+
componentDidMount(): void;
|
|
114
|
+
componentDidUpdate(prevProps: any): void;
|
|
115
|
+
componentWillUnmount(): void;
|
|
116
|
+
getTimeouts(): {
|
|
117
|
+
exit: any;
|
|
118
|
+
enter: any;
|
|
119
|
+
appear: any;
|
|
120
|
+
};
|
|
121
|
+
updateStatus(mounting: boolean | undefined, nextStatus: any): void;
|
|
122
|
+
performEnter(mounting: any): void;
|
|
123
|
+
performExit(): void;
|
|
124
|
+
cancelNextCallback(): void;
|
|
125
|
+
safeSetState(nextState: any, callback: any): void;
|
|
126
|
+
setNextCallback(callback: any): any;
|
|
127
|
+
onTransitionEnd(timeout: any, handler: any): void;
|
|
128
|
+
render(): React.JSX.Element | null;
|
|
129
|
+
}
|
|
130
|
+
export default Transition;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The `<TransitionGroup>` component manages a set of transition components
|
|
4
|
+
* (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
|
|
5
|
+
* components, `<TransitionGroup>` is a state machine for managing the mounting
|
|
6
|
+
* and unmounting of components over time.
|
|
7
|
+
*
|
|
8
|
+
* Consider the example below. As items are removed or added to the TodoList the
|
|
9
|
+
* `in` prop is toggled automatically by the `<TransitionGroup>`.
|
|
10
|
+
*
|
|
11
|
+
* Note that `<TransitionGroup>` does not define any animation behavior!
|
|
12
|
+
* Exactly _how_ a list item animates is up to the individual transition
|
|
13
|
+
* component. This means you can mix and match animations across different list
|
|
14
|
+
* items.
|
|
15
|
+
*/
|
|
16
|
+
declare class TransitionGroup extends React.Component {
|
|
17
|
+
constructor(props: any, context: any);
|
|
18
|
+
componentDidMount(): void;
|
|
19
|
+
componentWillUnmount(): void;
|
|
20
|
+
static getDerivedStateFromProps(nextProps: any, { children: prevChildMapping, handleExited, firstRender }: {
|
|
21
|
+
children: any;
|
|
22
|
+
handleExited: any;
|
|
23
|
+
firstRender: any;
|
|
24
|
+
}): {
|
|
25
|
+
children: object;
|
|
26
|
+
firstRender: boolean;
|
|
27
|
+
};
|
|
28
|
+
handleExited(child: any, element: any): void;
|
|
29
|
+
render(): React.JSX.Element;
|
|
30
|
+
}
|
|
31
|
+
export default TransitionGroup;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { forceReflow as TransitionGroupForceReflow } from '../utils/dom';
|
|
2
|
+
export { default as CSSTransition } from './CSSTransition';
|
|
3
|
+
export { default as PqbCSSTransition } from './PqbCSSTransition';
|
|
4
|
+
export { default as ReplaceTransition } from './ReplaceTransition';
|
|
5
|
+
export { default as SwitchTransition, modes as SwitchTransitionModes, } from './SwitchTransition';
|
|
6
|
+
export { default as Transition, ENTERED as TRANSITION_ENTERED, ENTERING as TRANSITION_ENTERING, EXITED as TRANSITION_EXITED, EXITING as TRANSITION_EXITING, UNMOUNTED as TRANSITION_UNMOUNTED, } from './Transition';
|
|
7
|
+
export { default as TransitionGroup } from './TransitionGroup';
|
|
8
|
+
export { default as TransitionGroupContext } from './TransitionGroupContext';
|
|
9
|
+
export { getChildMapping as TransitionGroupGetChildMapping, getInitialChildMapping as TransitionGroupGetInitialChildMapping, getNextChildMapping as TransitionGroupGetNextChildMapping, mergeChildMappings as TransitionGroupMergeChildMappings, } from './utils/ChildMapping';
|
|
10
|
+
export { default } from './TransitionGroup';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given `this.props.children`, return an object mapping key to child.
|
|
3
|
+
*
|
|
4
|
+
* @param {*} children `this.props.children`
|
|
5
|
+
* @return {object} Mapping of key to child
|
|
6
|
+
*/
|
|
7
|
+
export function getChildMapping(children: any, mapFn: any): object;
|
|
8
|
+
/**
|
|
9
|
+
* When you're adding or removing children some may be added or removed in the
|
|
10
|
+
* same render pass. We want to show *both* since we want to simultaneously
|
|
11
|
+
* animate elements in and out. This function takes a previous set of keys
|
|
12
|
+
* and a new set of keys and merges them with its best guess of the correct
|
|
13
|
+
* ordering. In the future we may expose some of the utilities in
|
|
14
|
+
* ReactMultiChild to make this easy, but for now React itself does not
|
|
15
|
+
* directly have this concept of the union of prevChildren and nextChildren
|
|
16
|
+
* so we implement it here.
|
|
17
|
+
*
|
|
18
|
+
* @param {object} prev prev children as returned from
|
|
19
|
+
* `ReactTransitionChildMapping.getChildMapping()`.
|
|
20
|
+
* @param {object} next next children as returned from
|
|
21
|
+
* `ReactTransitionChildMapping.getChildMapping()`.
|
|
22
|
+
* @return {object} a key set that contains all keys in `prev` and all keys
|
|
23
|
+
* in `next` in a reasonable order.
|
|
24
|
+
*/
|
|
25
|
+
export function mergeChildMappings(prev: object, next: object): object;
|
|
26
|
+
export function getInitialChildMapping(props: any, onExited: any): object;
|
|
27
|
+
export function getNextChildMapping(nextProps: any, prevChildMapping: any, onExited: any): object;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as caseName, default } from '@unicom-cloud/utils/case-name';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as className, default } from '@unicom-cloud/utils/class-name';
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
type ScrollBehavior = 'auto' | 'smooth';
|
|
2
|
+
type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest';
|
|
3
|
+
/**
|
|
4
|
+
* 滚动模式类型
|
|
5
|
+
* - 'always':总是执行滚动
|
|
6
|
+
* - 'if-needed':仅当元素不可见时滚动
|
|
7
|
+
*/
|
|
8
|
+
type ScrollMode = 'always' | 'if-needed';
|
|
9
|
+
type SkipOverflowHiddenElements = boolean;
|
|
10
|
+
type CustomScrollBoundaryCallback = (parent: Element) => boolean;
|
|
11
|
+
type CustomScrollBoundary = Element | CustomScrollBoundaryCallback | null;
|
|
12
|
+
type CustomScrollBehaviorCallback<T = unknown> = (actions: CustomScrollAction[]) => T;
|
|
13
|
+
type Options<T = unknown> = StandardBehaviorOptions | CustomBehaviorOptions<T>;
|
|
14
|
+
interface BaseOptions {
|
|
15
|
+
block?: ScrollLogicalPosition;
|
|
16
|
+
inline?: ScrollLogicalPosition;
|
|
17
|
+
scrollMode?: ScrollMode;
|
|
18
|
+
boundary?: CustomScrollBoundary;
|
|
19
|
+
skipOverflowHiddenElements?: SkipOverflowHiddenElements;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 滚动动作描述
|
|
23
|
+
*/
|
|
24
|
+
interface ScrollAction {
|
|
25
|
+
el: Element;
|
|
26
|
+
top: number;
|
|
27
|
+
left: number;
|
|
28
|
+
}
|
|
29
|
+
interface CustomScrollAction {
|
|
30
|
+
el: Element;
|
|
31
|
+
top: number;
|
|
32
|
+
left: number;
|
|
33
|
+
}
|
|
34
|
+
interface StandardBehaviorOptions extends BaseOptions {
|
|
35
|
+
behavior?: ScrollBehavior;
|
|
36
|
+
}
|
|
37
|
+
interface CustomBehaviorOptions<T = unknown> extends BaseOptions {
|
|
38
|
+
behavior: CustomScrollBehaviorCallback<T>;
|
|
39
|
+
}
|
|
40
|
+
interface SmoothScrollExtensions {
|
|
41
|
+
duration?: number;
|
|
42
|
+
ease?: (t: number) => number;
|
|
43
|
+
onScrollChange?: (state: {
|
|
44
|
+
target: Element;
|
|
45
|
+
elapsed: number;
|
|
46
|
+
value: number;
|
|
47
|
+
left: number;
|
|
48
|
+
top: number;
|
|
49
|
+
}) => void;
|
|
50
|
+
}
|
|
51
|
+
interface SmoothBehaviorOptions extends StandardBehaviorOptions, SmoothScrollExtensions {
|
|
52
|
+
behavior?: 'smooth';
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 检查overflow属性是否允许滚动
|
|
56
|
+
*/
|
|
57
|
+
declare const canOverflow: (overflow: string | null, skipOverflowHiddenElements?: boolean) => boolean;
|
|
58
|
+
/**
|
|
59
|
+
* 获取iframe元素(如果存在)
|
|
60
|
+
*/
|
|
61
|
+
declare const getFrameElement: (el: Element) => Element | null;
|
|
62
|
+
/**
|
|
63
|
+
* 检查元素是否被iframe裁剪
|
|
64
|
+
*/
|
|
65
|
+
declare const isHiddenByFrame: (el: Element) => boolean;
|
|
66
|
+
/**
|
|
67
|
+
* 检查元素是否可滚动
|
|
68
|
+
*/
|
|
69
|
+
declare const isScrollable: (el: Element, skipOverflowHiddenElements?: boolean) => boolean;
|
|
70
|
+
/**
|
|
71
|
+
* 计算"nearest"对齐方式的最佳滚动位置
|
|
72
|
+
*
|
|
73
|
+
* 图例说明:
|
|
74
|
+
* ┌────────┐ ┏ ━ ━ ━ ┓
|
|
75
|
+
* │ target │ frame
|
|
76
|
+
* └────────┘ ┗ ━ ━ ━ ┛
|
|
77
|
+
*/
|
|
78
|
+
declare const alignNearest: (scrollingEdgeStart: number, scrollingEdgeEnd: number, scrollingSize: number, scrollingBorderStart: number, scrollingBorderEnd: number, elementEdgeStart: number, elementEdgeEnd: number, elementSize: number) => number;
|
|
79
|
+
/**
|
|
80
|
+
* 获取元素的父元素(支持Shadow DOM)
|
|
81
|
+
*/
|
|
82
|
+
declare const getParentElement: (element: Node) => Element | null;
|
|
83
|
+
/**
|
|
84
|
+
* 获取元素的滚动边距
|
|
85
|
+
*/
|
|
86
|
+
declare const getScrollMargins: (target: Element) => {
|
|
87
|
+
top: number;
|
|
88
|
+
right: number;
|
|
89
|
+
bottom: number;
|
|
90
|
+
left: number;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* 计算需要执行的滚动动作
|
|
94
|
+
* @param target 目标元素
|
|
95
|
+
* @param options 滚动选项
|
|
96
|
+
*/
|
|
97
|
+
declare const compute: (target: Element, options: Options) => ScrollAction[];
|
|
98
|
+
export { alignNearest, canOverflow, compute, getFrameElement, getParentElement, getScrollMargins, isHiddenByFrame, isScrollable, };
|
|
99
|
+
export default compute;
|
|
100
|
+
export type { BaseOptions, CustomBehaviorOptions, CustomScrollAction, CustomScrollBehaviorCallback, CustomScrollBoundary, CustomScrollBoundaryCallback, Options, ScrollAction, ScrollBehavior, ScrollLogicalPosition, ScrollMode, SkipOverflowHiddenElements, SmoothBehaviorOptions, SmoothScrollExtensions, StandardBehaviorOptions, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@unicom-cloud/utils/date';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import forceReflow from '@unicom-cloud/utils/dom-helpers/reflow';
|
|
2
|
+
import { isServerRendering } from './is';
|
|
3
|
+
export declare function on(eventTarget: EventTarget, type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void;
|
|
4
|
+
export declare function off(eventTarget: EventTarget, type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
|
|
5
|
+
export declare function contains(node: Node, other: Node): boolean;
|
|
6
|
+
export declare function isScrollElement(element: HTMLElement): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* 从当前节点向上查找所有的滚动元素
|
|
9
|
+
* @param container 当前节点
|
|
10
|
+
* @param top 查找到 top 节点就终止,不再继续查找
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function getScrollElements(container: HTMLElement, top?: HTMLElement): HTMLElement[];
|
|
14
|
+
/**
|
|
15
|
+
* 判断父节点是否包含子节点
|
|
16
|
+
* @desc {en} confirm parentNode contains children nodes
|
|
17
|
+
* @param {HTMLElement | null} parentElement 父节点
|
|
18
|
+
* @param {HTMLElement | null} parentElement {en} The parent element
|
|
19
|
+
* @param {HTMLElement | null} childrenElement 子节点
|
|
20
|
+
* @param {HTMLElement | null} childrenElement {en} The child element
|
|
21
|
+
* @returns {boolean} 是否包含子节点
|
|
22
|
+
* @returns {boolean} {en} Whether the parent contains the child
|
|
23
|
+
* @example
|
|
24
|
+
*/
|
|
25
|
+
export declare function parentContainsChildren(parentElement: HTMLElement | null, childrenElement: HTMLElement | null): boolean;
|
|
26
|
+
export declare function getBodyContainer(): HTMLElement;
|
|
27
|
+
export { forceReflow, isServerRendering, forceReflow as reflow };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, default as emitter } from '@unicom-cloud/utils/emitter';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, default as fileToURL } from '@unicom-cloud/utils/file/fileToURL';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface Key {
|
|
2
|
+
/** Keyboard key code */
|
|
3
|
+
code: number | string;
|
|
4
|
+
/** Ctrl / ⌃ */
|
|
5
|
+
ctrl?: boolean;
|
|
6
|
+
/** Shift key */
|
|
7
|
+
shift?: boolean;
|
|
8
|
+
/** Alt / ⌥ */
|
|
9
|
+
alt?: boolean;
|
|
10
|
+
/** meta ⌘ / ⊞ */
|
|
11
|
+
meta?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @param hotkeyMap - 快捷键描述对象
|
|
15
|
+
*/
|
|
16
|
+
declare function getHotkeyHandler(hotkeyMap: Map<Key | number | string, Function>): (e: KeyboardEvent) => void;
|
|
17
|
+
export { getHotkeyHandler };
|
|
18
|
+
export default getHotkeyHandler;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export * from './caseName';
|
|
2
|
+
export * from './className';
|
|
3
|
+
export * from './constant';
|
|
4
|
+
export * from './copy';
|
|
5
|
+
export * from './date';
|
|
6
|
+
export * from './dayjs';
|
|
7
|
+
export * from './dom';
|
|
8
|
+
export * from './emitter';
|
|
9
|
+
export * from './fileToURL';
|
|
10
|
+
export * from './fillNBSP';
|
|
11
|
+
export * from './findScrollParent';
|
|
12
|
+
export * from './getHighlightText';
|
|
13
|
+
export * from './getHotkeyHandler';
|
|
14
|
+
export * from './getStringLength';
|
|
15
|
+
export * from './include';
|
|
16
|
+
export * from './intersectionObserver';
|
|
17
|
+
export * from './is';
|
|
18
|
+
export * from './lodash';
|
|
19
|
+
export * from './math';
|
|
20
|
+
export * from './mergedToString';
|
|
21
|
+
export * from './mergeProps';
|
|
22
|
+
export * from './mutationObserver';
|
|
23
|
+
export * from './omit';
|
|
24
|
+
export * from './pad';
|
|
25
|
+
export * from './pick';
|
|
26
|
+
export * from './pinyin';
|
|
27
|
+
export * from './reactDOM';
|
|
28
|
+
export * from './resizeObserver';
|
|
29
|
+
export * from './saveAs';
|
|
30
|
+
export * from './screenfull';
|
|
31
|
+
export * from './scrollIntoViewIfNeeded';
|
|
32
|
+
export * from './setDarkTheme';
|
|
33
|
+
export * from './setDir';
|
|
34
|
+
export * from './setPrimaryColor';
|
|
35
|
+
export * from './setTheme';
|
|
36
|
+
export * from './style';
|
|
37
|
+
export * from './supportRef';
|
|
38
|
+
export * from './throttleByRaf';
|
|
39
|
+
export * from './tinycolor';
|
|
40
|
+
export * from './toArray';
|
|
41
|
+
export * from './tree';
|
|
42
|
+
export * from './tween';
|
|
43
|
+
export * from './uuid';
|
|
44
|
+
export * from './validate';
|
|
45
|
+
export * from './warning';
|
|
46
|
+
export { keyboardCode } from './keyboardCode';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { is32Bit, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBlob, isBoolean, isBuffer, isColorValue, isDate, isElement, isEmpty, isEmptyArray, isEmptyObject, isEmptyValue, isEqual, isEqualWith, isError, isEventTarget, isExist, isFile, isFinite, isFunction, isInteger, isJSON, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPromise, isReadableStream, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, isWindow } from '@unicom-cloud/utils/is';
|
|
2
|
+
import { isDayjs } from 'dayjs';
|
|
3
|
+
declare const isServerRendering: boolean;
|
|
4
|
+
declare const isReact18: boolean, isReact19: boolean;
|
|
5
|
+
export declare function isEmptyReactNode(content: any, trim?: boolean): boolean;
|
|
6
|
+
export declare function isReactComponent(element: any): boolean;
|
|
7
|
+
export declare function isClassComponent(element: any): boolean;
|
|
8
|
+
export declare function isDOMElement(element: any): boolean;
|
|
9
|
+
export declare function isForwardRefReact(object: any): boolean;
|
|
10
|
+
export { is32Bit, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBlob, isBoolean, isBuffer, isColorValue, isDate, isDayjs, isElement, isEmpty, isEmptyArray, isEmptyObject, isEmptyValue, isEqual, isEqualWith, isError, isEventTarget, isExist, isFile, isFinite, isFunction, isInteger, isJSON, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPromise, isReact18, isReact19, isReadableStream, isRegExp, isSafeInteger, isServerRendering, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, isWindow, };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import assign from 'lodash/assign';
|
|
2
|
+
import assignIn from 'lodash/assignIn';
|
|
3
|
+
import at from 'lodash/at';
|
|
4
|
+
import camelCase from 'lodash/camelCase';
|
|
5
|
+
import capitalize from 'lodash/capitalize';
|
|
6
|
+
import castArray from 'lodash/castArray';
|
|
7
|
+
import chain from 'lodash/chain';
|
|
8
|
+
import chunk from 'lodash/chunk';
|
|
9
|
+
import clone from 'lodash/clone';
|
|
10
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
11
|
+
import cloneDeepWith from 'lodash/cloneDeepWith';
|
|
12
|
+
import cloneWith from 'lodash/cloneWith';
|
|
13
|
+
import compact from 'lodash/compact';
|
|
14
|
+
import curry from 'lodash/curry';
|
|
15
|
+
import debounce from 'lodash/debounce';
|
|
16
|
+
import defaults from 'lodash/defaults';
|
|
17
|
+
import defaultsDeep from 'lodash/defaultsDeep';
|
|
18
|
+
import defaultTo from 'lodash/defaultTo';
|
|
19
|
+
import difference from 'lodash/difference';
|
|
20
|
+
import escape from 'lodash/escape';
|
|
21
|
+
import findKey from 'lodash/findKey';
|
|
22
|
+
import flattenDeep from 'lodash/flattenDeep';
|
|
23
|
+
import flow from 'lodash/flow';
|
|
24
|
+
import get from 'lodash/get';
|
|
25
|
+
import groupBy from 'lodash/groupBy';
|
|
26
|
+
import has from 'lodash/has';
|
|
27
|
+
import intersection from 'lodash/intersection';
|
|
28
|
+
import invert from 'lodash/invert';
|
|
29
|
+
import invertBy from 'lodash/invertBy';
|
|
30
|
+
import kebabCase from 'lodash/kebabCase';
|
|
31
|
+
import mean from 'lodash/mean';
|
|
32
|
+
import memoize from 'lodash/memoize';
|
|
33
|
+
import merge from 'lodash/merge';
|
|
34
|
+
import mergeWith from 'lodash/mergeWith';
|
|
35
|
+
import orderBy from 'lodash/orderBy';
|
|
36
|
+
import partition from 'lodash/partition';
|
|
37
|
+
import pullAll from 'lodash/pullAll';
|
|
38
|
+
import result from 'lodash/result';
|
|
39
|
+
import sample from 'lodash/sample';
|
|
40
|
+
import sampleSize from 'lodash/sampleSize';
|
|
41
|
+
import set from 'lodash/set';
|
|
42
|
+
import setWith from 'lodash/setWith';
|
|
43
|
+
import shuffle from 'lodash/shuffle';
|
|
44
|
+
import snakeCase from 'lodash/snakeCase';
|
|
45
|
+
import startCase from 'lodash/startCase';
|
|
46
|
+
import throttle from 'lodash/throttle';
|
|
47
|
+
import toPath from 'lodash/toPath';
|
|
48
|
+
import truncate from 'lodash/truncate';
|
|
49
|
+
import union from 'lodash/union';
|
|
50
|
+
import uniq from 'lodash/uniq';
|
|
51
|
+
import uniqueId from 'lodash/uniqueId';
|
|
52
|
+
import unset from 'lodash/unset';
|
|
53
|
+
import update from 'lodash/update';
|
|
54
|
+
import updateWith from 'lodash/updateWith';
|
|
55
|
+
import upperCase from 'lodash/upperCase';
|
|
56
|
+
import upperFirst from 'lodash/upperFirst';
|
|
57
|
+
import without from 'lodash/without';
|
|
58
|
+
import xor from 'lodash/xor';
|
|
59
|
+
import zip from 'lodash/zip';
|
|
60
|
+
export { assign, assignIn, at, camelCase, capitalize, castArray, chain, chunk, clone, cloneDeep, cloneDeepWith, cloneWith, compact, curry, debounce, defaults, defaultsDeep, defaultTo, difference, escape, findKey, flattenDeep, flow, get, groupBy, has, intersection, invert, invertBy, kebabCase, mean, memoize, merge, mergeWith, orderBy, partition, pullAll, result, sample, sampleSize, set, setWith, shuffle, snakeCase, startCase, throttle, toPath, truncate, union, uniq, uniqueId, unset, update, updateWith, upperCase, upperFirst, without, xor, zip, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, div, default as math, minus, plus, times, } from '@unicom-cloud/utils/math';
|