@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,169 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import "../../utils/is.js";
|
|
3
|
+
import l from "../use-latest/index.js";
|
|
4
|
+
import { getTargetElement as K } from "../utils/domTarget.js";
|
|
5
|
+
import { isAppleDevice as b } from "@unicom-cloud/utils/constant/platform";
|
|
6
|
+
import C from "../utils/useDeepCompareWithTarget.js";
|
|
7
|
+
import { isFunction as E, isArray as L, isString as q, isNumber as g } from "@unicom-cloud/utils/is";
|
|
8
|
+
const y = {
|
|
9
|
+
0: 48,
|
|
10
|
+
1: 49,
|
|
11
|
+
2: 50,
|
|
12
|
+
3: 51,
|
|
13
|
+
4: 52,
|
|
14
|
+
5: 53,
|
|
15
|
+
6: 54,
|
|
16
|
+
7: 55,
|
|
17
|
+
8: 56,
|
|
18
|
+
9: 57,
|
|
19
|
+
backspace: 8,
|
|
20
|
+
tab: 9,
|
|
21
|
+
enter: 13,
|
|
22
|
+
shift: 16,
|
|
23
|
+
ctrl: 17,
|
|
24
|
+
alt: 18,
|
|
25
|
+
pausebreak: 19,
|
|
26
|
+
capslock: 20,
|
|
27
|
+
esc: 27,
|
|
28
|
+
space: 32,
|
|
29
|
+
pageup: 33,
|
|
30
|
+
pagedown: 34,
|
|
31
|
+
end: 35,
|
|
32
|
+
home: 36,
|
|
33
|
+
leftarrow: 37,
|
|
34
|
+
uparrow: 38,
|
|
35
|
+
rightarrow: 39,
|
|
36
|
+
downarrow: 40,
|
|
37
|
+
insert: 45,
|
|
38
|
+
delete: 46,
|
|
39
|
+
a: 65,
|
|
40
|
+
b: 66,
|
|
41
|
+
c: 67,
|
|
42
|
+
d: 68,
|
|
43
|
+
e: 69,
|
|
44
|
+
f: 70,
|
|
45
|
+
g: 71,
|
|
46
|
+
h: 72,
|
|
47
|
+
i: 73,
|
|
48
|
+
j: 74,
|
|
49
|
+
k: 75,
|
|
50
|
+
l: 76,
|
|
51
|
+
m: 77,
|
|
52
|
+
n: 78,
|
|
53
|
+
o: 79,
|
|
54
|
+
p: 80,
|
|
55
|
+
q: 81,
|
|
56
|
+
r: 82,
|
|
57
|
+
s: 83,
|
|
58
|
+
t: 84,
|
|
59
|
+
u: 85,
|
|
60
|
+
v: 86,
|
|
61
|
+
w: 87,
|
|
62
|
+
x: 88,
|
|
63
|
+
y: 89,
|
|
64
|
+
z: 90,
|
|
65
|
+
leftwindowkey: 91,
|
|
66
|
+
rightwindowkey: 92,
|
|
67
|
+
meta: b ? [91, 93] : [91, 92],
|
|
68
|
+
selectkey: 93,
|
|
69
|
+
numpad0: 96,
|
|
70
|
+
numpad1: 97,
|
|
71
|
+
numpad2: 98,
|
|
72
|
+
numpad3: 99,
|
|
73
|
+
numpad4: 100,
|
|
74
|
+
numpad5: 101,
|
|
75
|
+
numpad6: 102,
|
|
76
|
+
numpad7: 103,
|
|
77
|
+
numpad8: 104,
|
|
78
|
+
numpad9: 105,
|
|
79
|
+
multiply: 106,
|
|
80
|
+
add: 107,
|
|
81
|
+
subtract: 109,
|
|
82
|
+
decimalpoint: 110,
|
|
83
|
+
divide: 111,
|
|
84
|
+
f1: 112,
|
|
85
|
+
f2: 113,
|
|
86
|
+
f3: 114,
|
|
87
|
+
f4: 115,
|
|
88
|
+
f5: 116,
|
|
89
|
+
f6: 117,
|
|
90
|
+
f7: 118,
|
|
91
|
+
f8: 119,
|
|
92
|
+
f9: 120,
|
|
93
|
+
f10: 121,
|
|
94
|
+
f11: 122,
|
|
95
|
+
f12: 123,
|
|
96
|
+
numlock: 144,
|
|
97
|
+
scrolllock: 145,
|
|
98
|
+
semicolon: 186,
|
|
99
|
+
equalsign: 187,
|
|
100
|
+
comma: 188,
|
|
101
|
+
dash: 189,
|
|
102
|
+
period: 190,
|
|
103
|
+
forwardslash: 191,
|
|
104
|
+
graveaccent: 192,
|
|
105
|
+
openbracket: 219,
|
|
106
|
+
backslash: 220,
|
|
107
|
+
closebracket: 221,
|
|
108
|
+
singlequote: 222
|
|
109
|
+
}, d = {
|
|
110
|
+
ctrl: (e) => e.ctrlKey,
|
|
111
|
+
shift: (e) => e.shiftKey,
|
|
112
|
+
alt: (e) => e.altKey,
|
|
113
|
+
meta: (e) => e.type === "keyup" ? y.meta.includes(e.keyCode) : e.metaKey
|
|
114
|
+
};
|
|
115
|
+
function w(e) {
|
|
116
|
+
return q(e) || g(e);
|
|
117
|
+
}
|
|
118
|
+
function v(e) {
|
|
119
|
+
const n = Object.keys(d).reduce((t, r) => d[r](e) ? t + 1 : t, 0);
|
|
120
|
+
return [16, 17, 18, 91, 92].includes(e.keyCode) ? n : n + 1;
|
|
121
|
+
}
|
|
122
|
+
function p(e, n, t) {
|
|
123
|
+
if (!e.key)
|
|
124
|
+
return !1;
|
|
125
|
+
if (g(n))
|
|
126
|
+
return e.keyCode === n ? n : !1;
|
|
127
|
+
const r = n.split(".");
|
|
128
|
+
let a = 0;
|
|
129
|
+
for (const f of r) {
|
|
130
|
+
const s = d[f], c = y[f.toLowerCase()];
|
|
131
|
+
(s && s(e) || c && c === e.keyCode) && a++;
|
|
132
|
+
}
|
|
133
|
+
return t ? a === r.length && v(e) === r.length ? n : !1 : a === r.length ? n : !1;
|
|
134
|
+
}
|
|
135
|
+
function A(e, n) {
|
|
136
|
+
return E(e) ? e : w(e) ? (t) => p(t, e, n) : L(e) ? (t) => e.find((r) => p(t, r, n)) : () => !!e;
|
|
137
|
+
}
|
|
138
|
+
const G = ["keydown"];
|
|
139
|
+
function H(e, n, t) {
|
|
140
|
+
const {
|
|
141
|
+
events: r = G,
|
|
142
|
+
target: a,
|
|
143
|
+
exactMatch: f = !1,
|
|
144
|
+
useCapture: s = !1
|
|
145
|
+
} = t || {}, c = l(n), h = l(e);
|
|
146
|
+
C(
|
|
147
|
+
() => {
|
|
148
|
+
const u = K(a, window);
|
|
149
|
+
if (!u)
|
|
150
|
+
return;
|
|
151
|
+
const m = (o) => {
|
|
152
|
+
const i = A(h.current, f)(o), k = w(i) ? i : o.key;
|
|
153
|
+
if (i)
|
|
154
|
+
return c.current?.(o, k);
|
|
155
|
+
};
|
|
156
|
+
for (const o of r)
|
|
157
|
+
u?.addEventListener?.(o, m, s);
|
|
158
|
+
return () => {
|
|
159
|
+
for (const o of r)
|
|
160
|
+
u?.removeEventListener?.(o, m, s);
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
[r],
|
|
164
|
+
a
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
export {
|
|
168
|
+
H as default
|
|
169
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { Enter as t, ArrowDown as i, ArrowLeft as w, ArrowRight as f, ArrowUp as y } from "@unicom-cloud/utils/constant/keyboardCode";
|
|
3
|
+
import { useCallback as A } from "react";
|
|
4
|
+
function E(n) {
|
|
5
|
+
return A(
|
|
6
|
+
(e) => ({
|
|
7
|
+
onKeyDown(o) {
|
|
8
|
+
const r = o.key;
|
|
9
|
+
r === t.key && e.onPressEnter?.(o, r), r === i.key && e.onArrowDown?.(o, r), r === w.key && e.onArrowLeft?.(o, r), r === f.key && e.onArrowRight?.(o, r), r === y.key && e.onArrowUp?.(o, r), n?.onKeyDown?.(o);
|
|
10
|
+
}
|
|
11
|
+
}),
|
|
12
|
+
[]
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
E as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useEffect as t } from "react";
|
|
3
|
+
function o(e, n = []) {
|
|
4
|
+
t(() => (window.addEventListener("resize", e), window.addEventListener("orientationchange", e), () => {
|
|
5
|
+
window.removeEventListener("resize", e), window.removeEventListener("orientationchange", e);
|
|
6
|
+
}), [...n]);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
o as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useRef as n, useCallback as u } from "react";
|
|
3
|
+
function o(e) {
|
|
4
|
+
const r = n(!1);
|
|
5
|
+
return u(
|
|
6
|
+
async (...c) => {
|
|
7
|
+
if (!r.current) {
|
|
8
|
+
r.current = !0;
|
|
9
|
+
try {
|
|
10
|
+
return await e(...c);
|
|
11
|
+
} catch (t) {
|
|
12
|
+
throw t;
|
|
13
|
+
} finally {
|
|
14
|
+
r.current = !1;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
[e]
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
o as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useRef as s } from "react";
|
|
3
|
+
import v from "../use-latest/index.js";
|
|
4
|
+
import { getTargetElement as D } from "../utils/domTarget.js";
|
|
5
|
+
import S from "../utils/useEffectWithTarget.js";
|
|
6
|
+
function z(y, L, { delay: M = 300, moveThreshold: n, onClick: P, onLongPressEnd: R } = {}) {
|
|
7
|
+
const w = v(y), i = v(P), m = v(R), t = s(void 0), c = s(!1), u = s({ x: 0, y: 0 }), o = s(!1), f = s(!1), a = !!(n?.x && n.x > 0 || n?.y && n.y > 0);
|
|
8
|
+
S(
|
|
9
|
+
() => {
|
|
10
|
+
const r = D(L);
|
|
11
|
+
if (!r?.addEventListener)
|
|
12
|
+
return;
|
|
13
|
+
const b = (e) => {
|
|
14
|
+
const { clientX: d, clientY: E } = p(e), C = Math.abs(d - u.current.x), k = Math.abs(E - u.current.y);
|
|
15
|
+
return !!(n?.x && C > n.x || n?.y && k > n.y);
|
|
16
|
+
};
|
|
17
|
+
function p(e) {
|
|
18
|
+
return "TouchEvent" in window && e instanceof TouchEvent ? {
|
|
19
|
+
clientX: e.touches[0].clientX,
|
|
20
|
+
clientY: e.touches[0].clientY
|
|
21
|
+
} : e instanceof MouseEvent ? {
|
|
22
|
+
clientX: e.clientX,
|
|
23
|
+
clientY: e.clientY
|
|
24
|
+
} : { clientX: 0, clientY: 0 };
|
|
25
|
+
}
|
|
26
|
+
const T = (e) => {
|
|
27
|
+
t.current = setTimeout(() => {
|
|
28
|
+
w.current(e), c.current = !0;
|
|
29
|
+
}, M);
|
|
30
|
+
}, g = (e) => {
|
|
31
|
+
if (!f.current) {
|
|
32
|
+
if (f.current = !0, a) {
|
|
33
|
+
const { clientX: d, clientY: E } = p(e);
|
|
34
|
+
u.current.x = d, u.current.y = E;
|
|
35
|
+
}
|
|
36
|
+
T(e);
|
|
37
|
+
}
|
|
38
|
+
}, h = (e) => {
|
|
39
|
+
e?.sourceCapabilities?.firesTouchEvents || (o.current = !0, a && (u.current.x = e.clientX, u.current.y = e.clientY), T(e));
|
|
40
|
+
}, l = (e) => {
|
|
41
|
+
t.current && b(e) && (clearTimeout(t.current), t.current = void 0);
|
|
42
|
+
}, x = (e) => {
|
|
43
|
+
f.current && (f.current = !1, t.current && (clearTimeout(t.current), t.current = void 0), c.current ? m.current?.(e) : i.current && i.current(e), c.current = !1);
|
|
44
|
+
}, X = (e) => {
|
|
45
|
+
e?.sourceCapabilities?.firesTouchEvents || o.current && (o.current = !1, t.current && (clearTimeout(t.current), t.current = void 0), c.current ? m.current?.(e) : i.current && i.current(e), c.current = !1);
|
|
46
|
+
}, Y = (e) => {
|
|
47
|
+
o.current && (o.current = !1, t.current && (clearTimeout(t.current), t.current = void 0), c.current && (m.current?.(e), c.current = !1));
|
|
48
|
+
};
|
|
49
|
+
return r.addEventListener("mousedown", h), r.addEventListener("mouseup", X), r.addEventListener("mouseleave", Y), r.addEventListener("touchstart", g), r.addEventListener("touchend", x), a && (r.addEventListener("mousemove", l), r.addEventListener("touchmove", l)), () => {
|
|
50
|
+
t.current && (clearTimeout(t.current), c.current = !1), r.removeEventListener("mousedown", h), r.removeEventListener("mouseup", X), r.removeEventListener("mouseleave", Y), r.removeEventListener("touchstart", g), r.removeEventListener("touchend", x), a && (r.removeEventListener("mousemove", l), r.removeEventListener("touchmove", l));
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
[],
|
|
54
|
+
L
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
z as default
|
|
59
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as f } from "react";
|
|
3
|
+
import t from "../use-memoized-fn/index.js";
|
|
4
|
+
function d(c) {
|
|
5
|
+
const r = () => new Map(c), [p, s] = f(r), m = (e, o) => {
|
|
6
|
+
s((n) => {
|
|
7
|
+
const a = new Map(n);
|
|
8
|
+
return a.set(e, o), a;
|
|
9
|
+
});
|
|
10
|
+
}, u = (e) => {
|
|
11
|
+
s(new Map(e));
|
|
12
|
+
}, l = (e) => {
|
|
13
|
+
s((o) => {
|
|
14
|
+
const n = new Map(o);
|
|
15
|
+
return n.delete(e), n;
|
|
16
|
+
});
|
|
17
|
+
}, M = () => s(r()), i = (e) => p.get(e);
|
|
18
|
+
return [
|
|
19
|
+
p,
|
|
20
|
+
{
|
|
21
|
+
set: t(m),
|
|
22
|
+
setAll: t(u),
|
|
23
|
+
remove: t(l),
|
|
24
|
+
reset: t(M),
|
|
25
|
+
get: t(i)
|
|
26
|
+
}
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
d as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as o, useEffect as i } from "react";
|
|
3
|
+
const r = (t, e) => e !== void 0 ? e : window.matchMedia(t).matches, d = (t, e) => {
|
|
4
|
+
const [c, a] = o(r(t, e));
|
|
5
|
+
return i(() => {
|
|
6
|
+
const n = window.matchMedia(t), s = () => {
|
|
7
|
+
a(!!n.matches);
|
|
8
|
+
};
|
|
9
|
+
return n.addEventListener("change", s), a(n.matches), () => {
|
|
10
|
+
n.removeEventListener("change", s);
|
|
11
|
+
};
|
|
12
|
+
}, [t]), c;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
d as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useRef as t, useMemo as n } from "react";
|
|
3
|
+
import "../../utils/is.js";
|
|
4
|
+
import u from "../utils/isDev.js";
|
|
5
|
+
import { isFunction as c } from "@unicom-cloud/utils/is";
|
|
6
|
+
const a = (e) => {
|
|
7
|
+
u && (c(e) || console.error(
|
|
8
|
+
`useMemoizedFn expected parameter is a function, got ${typeof e}`
|
|
9
|
+
));
|
|
10
|
+
const o = t(e);
|
|
11
|
+
o.current = n(() => e, [e]);
|
|
12
|
+
const r = t(void 0);
|
|
13
|
+
return r.current || (r.current = function(...i) {
|
|
14
|
+
return o.current.apply(this, i);
|
|
15
|
+
}), r.current;
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
a as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useMemo as m } from "react";
|
|
3
|
+
import { omit as u } from "../../utils/omit.js";
|
|
4
|
+
function c(r, e, i = {}) {
|
|
5
|
+
const { _ignorePropsFromGlobal: p } = r, o = m(() => ({
|
|
6
|
+
...e,
|
|
7
|
+
...p ? {} : i
|
|
8
|
+
}), [e, i, p]);
|
|
9
|
+
return m(() => {
|
|
10
|
+
const s = u(r, ["_ignorePropsFromGlobal"]);
|
|
11
|
+
for (const t in o)
|
|
12
|
+
s[t] === void 0 && (s[t] = o[t]);
|
|
13
|
+
return s;
|
|
14
|
+
}, [r, o]);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
c as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useRef as n, useState as c, useEffect as m } from "react";
|
|
3
|
+
import "../../utils/is.js";
|
|
4
|
+
import d from "../use-previous/index.js";
|
|
5
|
+
import { isUndefined as r } from "@unicom-cloud/utils/is";
|
|
6
|
+
function R(i, l) {
|
|
7
|
+
const { defaultValue: u, value: e } = l || {}, s = n(!0), f = d(e), [o, a] = c(() => {
|
|
8
|
+
let t = e;
|
|
9
|
+
return r(e) ? r(u) ? t = i : t = u : t = e, t;
|
|
10
|
+
});
|
|
11
|
+
return m(() => {
|
|
12
|
+
if (s.current) {
|
|
13
|
+
s.current = !1;
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
e === void 0 && (f === e || a(e));
|
|
17
|
+
}, [f, e]), [r(e) ? o : e, a, o];
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
R as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useEffect as t } from "react";
|
|
3
|
+
import "../../utils/is.js";
|
|
4
|
+
import e from "../utils/isDev.js";
|
|
5
|
+
import { isFunction as r } from "@unicom-cloud/utils/is";
|
|
6
|
+
const n = (o) => {
|
|
7
|
+
e && (r(o) || console.error(
|
|
8
|
+
`useMount: parameter \`fn\` expected to be a function, but got "${typeof o}".`
|
|
9
|
+
)), t(() => o?.(), []);
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
n as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import p from "../use-event-listener/index.js";
|
|
3
|
+
import P from "../use-raf-state/index.js";
|
|
4
|
+
import { getTargetElement as d } from "../utils/domTarget.js";
|
|
5
|
+
const u = {
|
|
6
|
+
screenX: NaN,
|
|
7
|
+
screenY: NaN,
|
|
8
|
+
clientX: NaN,
|
|
9
|
+
clientY: NaN,
|
|
10
|
+
pageX: NaN,
|
|
11
|
+
pageY: NaN,
|
|
12
|
+
elementX: NaN,
|
|
13
|
+
elementY: NaN,
|
|
14
|
+
elementH: NaN,
|
|
15
|
+
elementW: NaN,
|
|
16
|
+
elementPosX: NaN,
|
|
17
|
+
elementPosY: NaN
|
|
18
|
+
}, E = (a) => {
|
|
19
|
+
const [m, l] = P(u);
|
|
20
|
+
return p(
|
|
21
|
+
"mousemove",
|
|
22
|
+
(o) => {
|
|
23
|
+
const { screenX: s, screenY: i, clientX: c, clientY: r, pageX: t, pageY: n } = o, e = {
|
|
24
|
+
screenX: s,
|
|
25
|
+
screenY: i,
|
|
26
|
+
clientX: c,
|
|
27
|
+
clientY: r,
|
|
28
|
+
pageX: t,
|
|
29
|
+
pageY: n,
|
|
30
|
+
elementX: NaN,
|
|
31
|
+
elementY: NaN,
|
|
32
|
+
elementH: NaN,
|
|
33
|
+
elementW: NaN,
|
|
34
|
+
elementPosX: NaN,
|
|
35
|
+
elementPosY: NaN
|
|
36
|
+
}, N = d(a);
|
|
37
|
+
if (N) {
|
|
38
|
+
const { left: X, top: Y, width: g, height: f } = N.getBoundingClientRect();
|
|
39
|
+
e.elementPosX = X + window.pageXOffset, e.elementPosY = Y + window.pageYOffset, e.elementX = t - e.elementPosX, e.elementY = n - e.elementPosY, e.elementW = g, e.elementH = f;
|
|
40
|
+
}
|
|
41
|
+
l(e);
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
target: () => document
|
|
45
|
+
}
|
|
46
|
+
), m;
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
E as default
|
|
50
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import c from "../use-latest/index.js";
|
|
3
|
+
import { getTargetElement as a } from "../utils/domTarget.js";
|
|
4
|
+
import m from "../utils/useDeepCompareWithTarget.js";
|
|
5
|
+
const b = (n, e, t = {}) => {
|
|
6
|
+
const s = c(n);
|
|
7
|
+
m(
|
|
8
|
+
() => {
|
|
9
|
+
const r = a(e);
|
|
10
|
+
if (!r)
|
|
11
|
+
return;
|
|
12
|
+
const o = new MutationObserver(s.current);
|
|
13
|
+
return o.observe(r, t), () => {
|
|
14
|
+
o?.disconnect();
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
[t],
|
|
18
|
+
e
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
b as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as f, useEffect as l } from "react";
|
|
3
|
+
import "../../utils/is.js";
|
|
4
|
+
import { isObject as v } from "@unicom-cloud/utils/is";
|
|
5
|
+
function s() {
|
|
6
|
+
const n = navigator;
|
|
7
|
+
return v(n) ? n.connection || n.mozConnection || n.webkitConnection : null;
|
|
8
|
+
}
|
|
9
|
+
function a() {
|
|
10
|
+
const n = s();
|
|
11
|
+
return n ? {
|
|
12
|
+
rtt: n.rtt,
|
|
13
|
+
type: n.type,
|
|
14
|
+
saveData: n.saveData,
|
|
15
|
+
downlink: n.downlink,
|
|
16
|
+
downlinkMax: n.downlinkMax,
|
|
17
|
+
effectiveType: n.effectiveType
|
|
18
|
+
} : {};
|
|
19
|
+
}
|
|
20
|
+
function m() {
|
|
21
|
+
const [n, t] = f(() => ({
|
|
22
|
+
since: void 0,
|
|
23
|
+
online: navigator?.onLine,
|
|
24
|
+
...a()
|
|
25
|
+
}));
|
|
26
|
+
return l(() => {
|
|
27
|
+
const o = () => {
|
|
28
|
+
t((e) => ({
|
|
29
|
+
...e,
|
|
30
|
+
online: !0,
|
|
31
|
+
since: /* @__PURE__ */ new Date()
|
|
32
|
+
}));
|
|
33
|
+
}, i = () => {
|
|
34
|
+
t((e) => ({
|
|
35
|
+
...e,
|
|
36
|
+
online: !1,
|
|
37
|
+
since: /* @__PURE__ */ new Date()
|
|
38
|
+
}));
|
|
39
|
+
}, r = () => {
|
|
40
|
+
t((e) => ({
|
|
41
|
+
...e,
|
|
42
|
+
...a()
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
window.addEventListener("online", o), window.addEventListener("offline", i);
|
|
46
|
+
const c = s();
|
|
47
|
+
return c?.addEventListener("change", r), () => {
|
|
48
|
+
window.removeEventListener("online", o), window.removeEventListener("offline", i), c?.removeEventListener(
|
|
49
|
+
"change",
|
|
50
|
+
r
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
}, []), n;
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
m as default
|
|
57
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useSyncExternalStore as n, useDebugValue as i } from "react";
|
|
3
|
+
function t(e) {
|
|
4
|
+
return window.addEventListener("online", e), window.addEventListener("offline", e), () => {
|
|
5
|
+
window.removeEventListener("online", e), window.removeEventListener("offline", e);
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
function r() {
|
|
9
|
+
const e = n(
|
|
10
|
+
t,
|
|
11
|
+
// 只要传递的是同一个函数,React 不会重新订阅
|
|
12
|
+
() => navigator.onLine,
|
|
13
|
+
// 如何在客户端获取值
|
|
14
|
+
() => !0
|
|
15
|
+
// 如何在服务端获取值
|
|
16
|
+
);
|
|
17
|
+
return i(e ? "Online" : "Offline"), e;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
r as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useRef as d, useEffect as f } from "react";
|
|
3
|
+
function a(o, { hidden: s }) {
|
|
4
|
+
const c = d(!1), r = d({}), u = (t) => t === document.body || t.tagName?.toLowerCase?.() === "body" ? window.innerWidth - (document.body.clientWidth || document.documentElement.clientWidth) : t.offsetWidth - t.clientWidth, l = () => {
|
|
5
|
+
const t = o();
|
|
6
|
+
if (t && t.style.overflow !== "hidden") {
|
|
7
|
+
const e = t.style;
|
|
8
|
+
c.current = !0;
|
|
9
|
+
const n = u(t);
|
|
10
|
+
n && (r.current.width = e.width, t.style.width = `calc(${t.style.width || "100%"} - ${n}px)`), r.current.overflow = e.overflow, t.style.overflow = "hidden";
|
|
11
|
+
}
|
|
12
|
+
}, i = () => {
|
|
13
|
+
if (c.current && o()) {
|
|
14
|
+
const t = o(), e = r.current;
|
|
15
|
+
Object.keys(e).forEach(
|
|
16
|
+
(n) => t.style[n] = e[n]
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
c.current = !1, r.current = {};
|
|
20
|
+
};
|
|
21
|
+
return f(() => (s ? l() : i(), () => {
|
|
22
|
+
i();
|
|
23
|
+
}), [o, s]), [i, l];
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
a as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import f, { useCallback as l, isValidElement as u, cloneElement as c } from "react";
|
|
3
|
+
import { callbackOriginRef as a } from "../../utils/reactDOM.js";
|
|
4
|
+
import { supportRef as m } from "../../utils/supportRef.js";
|
|
5
|
+
function R() {
|
|
6
|
+
const r = f.useRef(null);
|
|
7
|
+
return [l((e) => u(e) && m(e) ? c(e, {
|
|
8
|
+
ref(t) {
|
|
9
|
+
r.current = t, a(e, t);
|
|
10
|
+
}
|
|
11
|
+
}) : e, []), r];
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
R as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useMemo as M } from "react";
|
|
3
|
+
import s from "../use-memoized-fn/index.js";
|
|
4
|
+
import x from "../use-request/src/useRequest.js";
|
|
5
|
+
import "lodash/castArray";
|
|
6
|
+
const R = (p, P = {}) => {
|
|
7
|
+
const { defaultPageSize: i = 10, defaultCurrent: h = 1, ...f } = P, t = x(p, {
|
|
8
|
+
defaultParams: [{ current: h, pageSize: i }],
|
|
9
|
+
refreshDepsAction: () => {
|
|
10
|
+
u(1);
|
|
11
|
+
},
|
|
12
|
+
...f
|
|
13
|
+
}), { current: c = 1, pageSize: a = i } = t.params[0] || {}, n = t.data?.total || 0, z = M(
|
|
14
|
+
() => Math.ceil(n / a),
|
|
15
|
+
[a, n]
|
|
16
|
+
), o = (e, g) => {
|
|
17
|
+
let r = e <= 0 ? 1 : e;
|
|
18
|
+
const m = g <= 0 ? 1 : g, l = Math.ceil(n / m);
|
|
19
|
+
r > l && (r = Math.max(1, l));
|
|
20
|
+
const [S = {}, ...C] = t.params || [];
|
|
21
|
+
t.run(
|
|
22
|
+
{
|
|
23
|
+
...S,
|
|
24
|
+
current: r,
|
|
25
|
+
pageSize: m
|
|
26
|
+
},
|
|
27
|
+
...C
|
|
28
|
+
);
|
|
29
|
+
}, u = (e) => {
|
|
30
|
+
o(e, a);
|
|
31
|
+
}, d = (e) => {
|
|
32
|
+
o(c, e);
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
...t,
|
|
36
|
+
pagination: {
|
|
37
|
+
current: c,
|
|
38
|
+
pageSize: a,
|
|
39
|
+
total: n,
|
|
40
|
+
totalPage: z,
|
|
41
|
+
onChange: s(o),
|
|
42
|
+
changeCurrent: s(u),
|
|
43
|
+
changePageSize: s(d)
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
R as default
|
|
49
|
+
};
|