@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,10 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import "react";
|
|
3
|
+
import "./use-latest/index.js";
|
|
4
|
+
import "./use-memoized-fn/index.js";
|
|
5
|
+
import "./use-unmount/index.js";
|
|
6
|
+
import { ReadyState as i, default as a } from "./use-web-socket/index.js";
|
|
7
|
+
export {
|
|
8
|
+
i as ReadyState,
|
|
9
|
+
a as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import "lodash/debounce";
|
|
3
|
+
import "react";
|
|
4
|
+
import "../utils/is.js";
|
|
5
|
+
import "./use-listen-window-resize/index.js";
|
|
6
|
+
import "@unicom-cloud/utils/is";
|
|
7
|
+
import { default as f } from "./use-window-size/index.js";
|
|
8
|
+
export {
|
|
9
|
+
f as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useRef as n } from "react";
|
|
3
|
+
import "../../utils/is.js";
|
|
4
|
+
import l from "../use-unmount/index.js";
|
|
5
|
+
import a from "./depsAreSame.js";
|
|
6
|
+
import { getTargetElement as p } from "./domTarget.js";
|
|
7
|
+
import { isArray as g } from "@unicom-cloud/utils/is";
|
|
8
|
+
const x = (m) => (f, c, u) => {
|
|
9
|
+
const o = n(!1), r = n([]), s = n([]), t = n(void 0);
|
|
10
|
+
m(() => {
|
|
11
|
+
const e = (g(u) ? u : [u]).map((i) => p(i));
|
|
12
|
+
if (!o.current) {
|
|
13
|
+
o.current = !0, r.current = e, s.current = c, t.current = f();
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
(e.length !== r.current.length || !a(r.current, e) || !a(s.current, c)) && (t.current?.(), r.current = e, s.current = c, t.current = f());
|
|
17
|
+
}), l(() => {
|
|
18
|
+
t.current?.(), o.current = !1;
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
x as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import "../../utils/is.js";
|
|
3
|
+
import { isBrowser as n } from "@unicom-cloud/utils/constant/platform";
|
|
4
|
+
import { isFunction as o } from "@unicom-cloud/utils/is";
|
|
5
|
+
function m(e, i) {
|
|
6
|
+
if (!n)
|
|
7
|
+
return;
|
|
8
|
+
if (!e)
|
|
9
|
+
return i;
|
|
10
|
+
let r;
|
|
11
|
+
return o(e) ? r = e() : "current" in e ? r = e.current : r = e, r;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
m as default,
|
|
15
|
+
m as getTargetElement
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import "../../utils/is.js";
|
|
3
|
+
import { getTargetElement as r } from "./domTarget.js";
|
|
4
|
+
import { isArray as n } from "@unicom-cloud/utils/is";
|
|
5
|
+
const u = (t) => t.every((e) => {
|
|
6
|
+
const o = r(e);
|
|
7
|
+
return o ? o.getRootNode() instanceof ShadowRoot : !1;
|
|
8
|
+
}), c = (t) => t ? t.getRootNode() : document, s = (t) => {
|
|
9
|
+
if (!t || !document.getRootNode)
|
|
10
|
+
return document;
|
|
11
|
+
const e = n(t) ? t : [t];
|
|
12
|
+
return u(e) ? c(r(e[0])) : document;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
s as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
function e(t) {
|
|
3
|
+
return t === document || t === document.documentElement || t === document.body ? Math.max(
|
|
4
|
+
window.pageYOffset,
|
|
5
|
+
document.documentElement.scrollTop,
|
|
6
|
+
document.body.scrollTop
|
|
7
|
+
) : t.scrollTop;
|
|
8
|
+
}
|
|
9
|
+
function o(t) {
|
|
10
|
+
return t.scrollHeight || Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
|
|
11
|
+
}
|
|
12
|
+
function n(t) {
|
|
13
|
+
return t.clientHeight || Math.max(document.documentElement.clientHeight, document.body.clientHeight);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
n as getClientHeight,
|
|
17
|
+
o as getScrollHeight,
|
|
18
|
+
e as getScrollTop
|
|
19
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useRef as f } from "react";
|
|
3
|
+
import u from "./useEffectWithTarget.js";
|
|
4
|
+
import { depsEqual as i } from "./depsEqual.js";
|
|
5
|
+
const m = (o, e, c) => {
|
|
6
|
+
const r = f(void 0), t = f(0);
|
|
7
|
+
i(e, r.current) || (t.current += 1), r.current = e, u(o, [t.current], c);
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
m as default
|
|
11
|
+
};
|
package/hooks/utils.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
3
|
+
import { UI_COMMON_PREFIX as d } from "@unicom-cloud/utils/constant/ui";
|
|
4
|
+
import { forwardRef as f } from "react";
|
|
5
|
+
import p from "@unicom-cloud/utils/class-name";
|
|
6
|
+
function x(s, t) {
|
|
7
|
+
const { style: o, className: c, backgroundColor: i, color: r, text: a, ...n } = s, l = `${d}-icons-file`;
|
|
8
|
+
return /* @__PURE__ */ e("div", { className: p(l, c), children: /* @__PURE__ */ m(
|
|
9
|
+
"svg",
|
|
10
|
+
{
|
|
11
|
+
ref: t,
|
|
12
|
+
className: `${l}-svg`,
|
|
13
|
+
style: o,
|
|
14
|
+
...n,
|
|
15
|
+
width: "100%",
|
|
16
|
+
height: "100%",
|
|
17
|
+
viewBox: "0 0 166 200",
|
|
18
|
+
version: "1.1",
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ e(
|
|
21
|
+
"path",
|
|
22
|
+
{
|
|
23
|
+
className: `${l}-svg-bg`,
|
|
24
|
+
d: "M9.911,0c-5.4,0.149 -9.792,4.556 -9.911,9.944l0,179.114c-0.012,2.627 1.066,5.147 2.976,6.956c1.811,1.889 4.312,2.968 6.931,2.991l145.363,-0c2.623,0.008 5.134,-1.075 6.928,-2.985c1.88,-1.833 2.952,-4.34 2.976,-6.962l0,-132.696l-56.159,-56.362l-99.111,0l0.007,0Z",
|
|
25
|
+
style: {
|
|
26
|
+
fill: i
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ e(
|
|
31
|
+
"path",
|
|
32
|
+
{
|
|
33
|
+
className: `${l}-svg-tr`,
|
|
34
|
+
d: "M165.174,55.97l-46.193,0c-5.379,-0.13 -9.768,-4.505 -9.904,-9.872l0,-46.098l56.088,55.97l0.009,0Z"
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
/* @__PURE__ */ e(
|
|
38
|
+
"text",
|
|
39
|
+
{
|
|
40
|
+
className: `${l}-svg-text`,
|
|
41
|
+
x: "50%",
|
|
42
|
+
y: "142.967px",
|
|
43
|
+
textAnchor: "middle",
|
|
44
|
+
dominantBaseline: "middle",
|
|
45
|
+
style: {
|
|
46
|
+
fill: r
|
|
47
|
+
},
|
|
48
|
+
children: a ?? "doc"
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
) });
|
|
54
|
+
}
|
|
55
|
+
const h = f(x);
|
|
56
|
+
h.displayName = "IconFile";
|
|
57
|
+
export {
|
|
58
|
+
h as default
|
|
59
|
+
};
|
package/icons/file.js
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { default as o } from "@unicom-cloud/utils/dom-helpers/reflow";
|
|
3
|
+
import "./utils/is.js";
|
|
4
|
+
import { default as i } from "./transition-group/CSSTransition.js";
|
|
5
|
+
import { PqbCSSTransition as s } from "./transition-group/PqbCSSTransition.js";
|
|
6
|
+
import { default as l } from "./transition-group/ReplaceTransition.js";
|
|
7
|
+
import { default as f, modes as d } from "./transition-group/SwitchTransition.js";
|
|
8
|
+
import { ENTERED as m, ENTERING as u, EXITED as x, EXITING as I, UNMOUNTED as E, default as S } from "./transition-group/Transition.js";
|
|
9
|
+
import { default as G } from "./transition-group/TransitionGroup.js";
|
|
10
|
+
import { default as M } from "./transition-group/TransitionGroupContext.js";
|
|
11
|
+
import { getChildMapping as C, getInitialChildMapping as R, getNextChildMapping as D, mergeChildMappings as O } from "./transition-group/utils/ChildMapping.js";
|
|
12
|
+
import { default as F } from "./development/index.js";
|
|
13
|
+
import { Empty as w } from "./empty/index.js";
|
|
14
|
+
import { default as X, FlexVertical as b } from "./flex/index.js";
|
|
15
|
+
import { default as P } from "./higher-order/with-speech-synthesis/index.js";
|
|
16
|
+
import { default as k } from "./icons/file/index.js";
|
|
17
|
+
import { default as v } from "./progress/index.js";
|
|
18
|
+
import { default as z, SpaceVertical as B } from "./space/index.js";
|
|
19
|
+
import { default as J } from "./suspense-fallback-test/index.js";
|
|
20
|
+
export {
|
|
21
|
+
i as CSSTransition,
|
|
22
|
+
F as Development,
|
|
23
|
+
w as Empty,
|
|
24
|
+
X as Flex,
|
|
25
|
+
b as FlexVertical,
|
|
26
|
+
k as IconFile,
|
|
27
|
+
s as PqbCSSTransition,
|
|
28
|
+
v as Progress,
|
|
29
|
+
l as ReplaceTransition,
|
|
30
|
+
z as Space,
|
|
31
|
+
B as SpaceVertical,
|
|
32
|
+
J as SuspenseFallbackTest,
|
|
33
|
+
f as SwitchTransition,
|
|
34
|
+
d as SwitchTransitionModes,
|
|
35
|
+
m as TRANSITION_ENTERED,
|
|
36
|
+
u as TRANSITION_ENTERING,
|
|
37
|
+
x as TRANSITION_EXITED,
|
|
38
|
+
I as TRANSITION_EXITING,
|
|
39
|
+
E as TRANSITION_UNMOUNTED,
|
|
40
|
+
S as Transition,
|
|
41
|
+
G as TransitionGroup,
|
|
42
|
+
M as TransitionGroupContext,
|
|
43
|
+
o as TransitionGroupForceReflow,
|
|
44
|
+
C as TransitionGroupGetChildMapping,
|
|
45
|
+
R as TransitionGroupGetInitialChildMapping,
|
|
46
|
+
D as TransitionGroupGetNextChildMapping,
|
|
47
|
+
O as TransitionGroupMergeChildMappings,
|
|
48
|
+
P as withSpeechSynthesis
|
|
49
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@unicom-cloud/ui-common","version":"0.1.1","dependencies":{"dayjs":"^1.11.19","lodash":"^4.17.21","react-is":"latest","@unicom-cloud/utils":"latest","@unicom-cloud/icons":"latest"},"peerDependencies":{"react":"latest","react-dom":"latest"},"type":"module","types":"types/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { UI_COMMON_PREFIX as u } from "@unicom-cloud/utils/constant/ui";
|
|
3
|
+
import "../utils/is.js";
|
|
4
|
+
import { isNumber as f } from "@unicom-cloud/utils/is";
|
|
5
|
+
const t = {
|
|
6
|
+
status: null,
|
|
7
|
+
settings: {
|
|
8
|
+
parent: document.body,
|
|
9
|
+
progress: document.createElement("div"),
|
|
10
|
+
bar: document.createElement("div"),
|
|
11
|
+
minimum: 0.08,
|
|
12
|
+
easing: "linear",
|
|
13
|
+
positionUsing: "",
|
|
14
|
+
speed: 200,
|
|
15
|
+
trickle: !0,
|
|
16
|
+
trickleSpeed: 200
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* Updates configuration.
|
|
20
|
+
*
|
|
21
|
+
* Progress.configure({
|
|
22
|
+
* minimum: 0.1
|
|
23
|
+
* });
|
|
24
|
+
*/
|
|
25
|
+
configure(e) {
|
|
26
|
+
return Object.assign(t.settings, e), t;
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* Sets the progress bar status, where `n` is a number from `0.0` to `1.0`.
|
|
30
|
+
*
|
|
31
|
+
* Progress.set(0.4);
|
|
32
|
+
* Progress.set(1.0);
|
|
33
|
+
*/
|
|
34
|
+
set(e) {
|
|
35
|
+
const s = t.isStarted();
|
|
36
|
+
e = c(e, t.settings.minimum, 1), t.status = e === 1 ? null : e;
|
|
37
|
+
const r = t.render(!s), i = t.settings.speed, l = t.settings.easing;
|
|
38
|
+
return r.offsetWidth, b(function(o) {
|
|
39
|
+
t.settings.positionUsing === "" && (t.settings.positionUsing = t.getPositioningCSS()), n(t.settings.bar, m(e, i, l)), e === 1 ? (n(r, {
|
|
40
|
+
transition: "none",
|
|
41
|
+
opacity: 1
|
|
42
|
+
}), r.offsetWidth, setTimeout(function() {
|
|
43
|
+
n(r, {
|
|
44
|
+
transition: `all ${i}ms linear`,
|
|
45
|
+
opacity: 0
|
|
46
|
+
}), setTimeout(function() {
|
|
47
|
+
t.remove(), o();
|
|
48
|
+
}, i);
|
|
49
|
+
}, i)) : setTimeout(o, i);
|
|
50
|
+
}), t;
|
|
51
|
+
},
|
|
52
|
+
isStarted() {
|
|
53
|
+
return f(t.status);
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* Shows the progress bar.
|
|
57
|
+
* This is the same as setting the status to 0%, except that it doesn't go backwards.
|
|
58
|
+
*
|
|
59
|
+
* Progress.start();
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
start() {
|
|
63
|
+
return t.status || t.set(0), t.settings.trickle && p(), t;
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* Hides the progress bar.
|
|
67
|
+
* This is the *sort of* the same as setting the status to 100%, with the
|
|
68
|
+
* difference being `done()` makes some placebo effect of some realistic motion.
|
|
69
|
+
*
|
|
70
|
+
* Progress.done();
|
|
71
|
+
*
|
|
72
|
+
* If `true` is passed, it will show the progress bar even if its hidden.
|
|
73
|
+
*
|
|
74
|
+
* Progress.done(true);
|
|
75
|
+
*/
|
|
76
|
+
done(e) {
|
|
77
|
+
return e || t.status ? t.inc(0.3 + 0.5 * Math.random()).set(1) : t;
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* Increments by a random amount.
|
|
81
|
+
*/
|
|
82
|
+
inc(e) {
|
|
83
|
+
let s = t.status;
|
|
84
|
+
return s ? s > 1 ? void 0 : (f(e) || (s >= 0 && s < 0.2 ? e = 0.1 : s >= 0.2 && s < 0.5 ? e = 0.04 : s >= 0.5 && s < 0.8 ? e = 0.02 : s >= 0.8 && s < 0.99 ? e = 5e-3 : e = 0), s = c(s + e, 0, 0.994), t.set(s)) : t.start();
|
|
85
|
+
},
|
|
86
|
+
trickle() {
|
|
87
|
+
return t.inc();
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* (Internal) renders the progress bar markup based on the `template`
|
|
91
|
+
* setting.
|
|
92
|
+
*/
|
|
93
|
+
render(e) {
|
|
94
|
+
if (t.settings.parent.contains(t.settings.progress))
|
|
95
|
+
return t.settings.progress;
|
|
96
|
+
t.settings.progress.hasAttribute("class"), t.settings.bar.hasAttribute("class"), t.settings.progress.setAttribute(
|
|
97
|
+
"class",
|
|
98
|
+
`${u}-progress`
|
|
99
|
+
), t.settings.bar.setAttribute(
|
|
100
|
+
"class",
|
|
101
|
+
`${u}-progress-bar`
|
|
102
|
+
), t.settings.progress.contains(t.settings.bar) || t.settings.progress.appendChild(t.settings.bar);
|
|
103
|
+
let s = e ? "-100" : a(t.status || 0);
|
|
104
|
+
return n(t.settings.bar, {
|
|
105
|
+
transition: "all 0 linear",
|
|
106
|
+
transform: `translate3d(${s}%,0,0)`
|
|
107
|
+
}), t.settings.parent.appendChild(t.settings.progress), t.settings.progress;
|
|
108
|
+
},
|
|
109
|
+
/**
|
|
110
|
+
* Removes the element. Opposite of render().
|
|
111
|
+
*/
|
|
112
|
+
remove() {
|
|
113
|
+
t.settings.progress.remove();
|
|
114
|
+
},
|
|
115
|
+
/**
|
|
116
|
+
* Determine which positioning CSS rule to use.
|
|
117
|
+
*/
|
|
118
|
+
getPositioningCSS() {
|
|
119
|
+
const e = t.settings.parent.style;
|
|
120
|
+
return "perspective" in e ? "translate3d" : "transform" in e ? "translate" : "margin";
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
function c(e, s, r) {
|
|
124
|
+
return Math.max(Math.min(e, r), s);
|
|
125
|
+
}
|
|
126
|
+
function a(e) {
|
|
127
|
+
return (-1 + e) * 100;
|
|
128
|
+
}
|
|
129
|
+
function m(e, s, r) {
|
|
130
|
+
let i;
|
|
131
|
+
return t.settings.positionUsing === "translate3d" ? i = { transform: `translate3d(${a(e)}%,0,0)` } : t.settings.positionUsing === "translate" ? i = { transform: `translate(${a(e)}%,0)` } : i = { "margin-left": `${a(e)}%` }, i.transition = `all ${s}ms ${r}`, i;
|
|
132
|
+
}
|
|
133
|
+
function p() {
|
|
134
|
+
setTimeout(() => {
|
|
135
|
+
t.status && (t.trickle(), p());
|
|
136
|
+
}, t.settings.trickleSpeed);
|
|
137
|
+
}
|
|
138
|
+
const g = [];
|
|
139
|
+
function d() {
|
|
140
|
+
const e = g.shift();
|
|
141
|
+
e && e(d);
|
|
142
|
+
}
|
|
143
|
+
function b(e) {
|
|
144
|
+
g.push(e), g.length === 1 && d();
|
|
145
|
+
}
|
|
146
|
+
function n(e, s) {
|
|
147
|
+
Object.entries(s).forEach(([r, i], l, o) => {
|
|
148
|
+
i === void 0 || (e.style[r] = i);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
export {
|
|
152
|
+
t as default
|
|
153
|
+
};
|
package/space/index.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { jsx as s, jsxs as _ } from "react/jsx-runtime";
|
|
3
|
+
import { UI_COMMON_PREFIX as O } from "@unicom-cloud/utils/constant/ui";
|
|
4
|
+
import { forwardRef as g, Fragment as R } from "react";
|
|
5
|
+
import { GAP_SIZE_MAP as d } from "../flex/interface.js";
|
|
6
|
+
import b from "../hooks/use-merge-props/index.js";
|
|
7
|
+
import k from "@unicom-cloud/utils/class-name";
|
|
8
|
+
import "../utils/is.js";
|
|
9
|
+
import { toArray as E } from "../utils/toArray.js";
|
|
10
|
+
import { isString as F, isNumber as f, isArray as L } from "@unicom-cloud/utils/is";
|
|
11
|
+
const U = {
|
|
12
|
+
size: "small",
|
|
13
|
+
direction: "horizontal"
|
|
14
|
+
}, l = g(
|
|
15
|
+
(n, a) => {
|
|
16
|
+
const y = b(n, U, {}), {
|
|
17
|
+
className: S,
|
|
18
|
+
style: h,
|
|
19
|
+
children: N,
|
|
20
|
+
gap: G,
|
|
21
|
+
size: w,
|
|
22
|
+
direction: i = "horizontal",
|
|
23
|
+
align: x,
|
|
24
|
+
alignItems: P,
|
|
25
|
+
justifyContent: p,
|
|
26
|
+
wrap: V,
|
|
27
|
+
split: m,
|
|
28
|
+
rtl: j,
|
|
29
|
+
...z
|
|
30
|
+
} = y, t = `${O}-space`, e = G ?? w, u = P ?? x ?? (i === "horizontal" ? "center" : ""), A = k(
|
|
31
|
+
t,
|
|
32
|
+
{
|
|
33
|
+
[`${t}-${i}`]: i,
|
|
34
|
+
[`${t}-justify-content-${p}`]: p,
|
|
35
|
+
[`${t}-align-items-${u}`]: u,
|
|
36
|
+
[`${t}-rtl`]: j
|
|
37
|
+
},
|
|
38
|
+
V ? `${t}-wrap` : `${t}-no-wrap`,
|
|
39
|
+
S
|
|
40
|
+
), c = (r) => f(r) ? r : d[r] ?? d.small, v = {
|
|
41
|
+
...(() => {
|
|
42
|
+
if (F(e) || f(e))
|
|
43
|
+
return {
|
|
44
|
+
gap: `${c(e)}px`
|
|
45
|
+
};
|
|
46
|
+
if (L(e)) {
|
|
47
|
+
const r = c(e[1]), o = c(e[0]);
|
|
48
|
+
return {
|
|
49
|
+
rowGap: `${r}px`,
|
|
50
|
+
columnGap: `${o}px`
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return {};
|
|
54
|
+
})(),
|
|
55
|
+
...h
|
|
56
|
+
}, C = E(N);
|
|
57
|
+
return /* @__PURE__ */ s("div", { ref: a, className: A, style: v, ...z, children: C.map((r, o) => {
|
|
58
|
+
const I = r?.key ?? o, M = m != null && o > 0;
|
|
59
|
+
return /* @__PURE__ */ _(R, { children: [
|
|
60
|
+
M && /* @__PURE__ */ s("div", { className: `${t}-item-split`, children: m }),
|
|
61
|
+
/* @__PURE__ */ s("div", { className: `${t}-item`, children: r })
|
|
62
|
+
] }, I);
|
|
63
|
+
}) });
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
l.displayName = "Space";
|
|
67
|
+
const $ = g(
|
|
68
|
+
(n, a) => /* @__PURE__ */ s(l, { ...n, ref: a, direction: "vertical" })
|
|
69
|
+
);
|
|
70
|
+
$.displayName = "SpaceVertical";
|
|
71
|
+
const W = Object.assign(l, {
|
|
72
|
+
Vertical: $
|
|
73
|
+
});
|
|
74
|
+
export {
|
|
75
|
+
$ as SpaceVertical,
|
|
76
|
+
W as default
|
|
77
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.@{ui-common-prefix}-animation-rotate-360deg {
|
|
2
|
+
animation: ~'@{ui-common-prefix}-keyframes-rotate-360deg' 1s infinite
|
|
3
|
+
cubic-bezier(0, 0, 1, 1);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.@{ui-common-prefix}-animation-vibrate {
|
|
7
|
+
animation: ~'@{ui-common-prefix}-keyframes-vibrate' 0.3s linear infinite both;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.@{ui-common-prefix}-animation-blink-enter,
|
|
11
|
+
.@{ui-common-prefix}-animation-blink-appear {
|
|
12
|
+
opacity: 0;
|
|
13
|
+
}
|
|
14
|
+
.@{ui-common-prefix}-animation-blink-enter-active,
|
|
15
|
+
.@{ui-common-prefix}-animation-blink-appear-active {
|
|
16
|
+
opacity: 1;
|
|
17
|
+
transition: opacity 0.3s linear;
|
|
18
|
+
}
|
|
19
|
+
.@{ui-common-prefix}-animation-blink-enter-done {
|
|
20
|
+
animation: ~'@{ui-common-prefix}-keyframes-blink' 0.5s linear;
|
|
21
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
.@{ui-common-prefix}-display-none {
|
|
2
|
+
display: none !important;
|
|
3
|
+
}
|
|
4
|
+
.@{ui-common-prefix}-visibility-hidden {
|
|
5
|
+
visibility: hidden !important;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.@{ui-common-prefix}-overflow-hidden {
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.@{ui-common-prefix}-cursor-pointer {
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.@{ui-common-prefix}-filter-invert-100 {
|
|
17
|
+
filter: invert(100%);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.@{ui-common-prefix}-filter-grayscale-100 {
|
|
21
|
+
filter: grayscale(100%);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.@{ui-common-prefix}-isolation-isolate {
|
|
25
|
+
isolation: isolate;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.@{ui-common-prefix}-direction-rtl {
|
|
29
|
+
direction: rtl;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.@{ui-common-prefix}-line-height-1 {
|
|
33
|
+
line-height: 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.@{ui-common-prefix}-text-overflow-ellipsis {
|
|
37
|
+
text-overflow: ellipsis;
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
word-break: break-all;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.@{ui-common-prefix}-line-clamp-2,
|
|
44
|
+
.@{ui-common-prefix}-line-clamp-3,
|
|
45
|
+
.@{ui-common-prefix}-line-clamp-4,
|
|
46
|
+
.@{ui-common-prefix}-line-clamp-5 {
|
|
47
|
+
display: -webkit-box;
|
|
48
|
+
display: -moz-box;
|
|
49
|
+
-webkit-box-orient: vertical;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
text-overflow: ellipsis;
|
|
52
|
+
white-space: normal;
|
|
53
|
+
}
|
|
54
|
+
.@{ui-common-prefix}-line-clamp-2 {
|
|
55
|
+
line-clamp: 2;
|
|
56
|
+
-webkit-line-clamp: 2;
|
|
57
|
+
}
|
|
58
|
+
.@{ui-common-prefix}-line-clamp-3 {
|
|
59
|
+
line-clamp: 3;
|
|
60
|
+
-webkit-line-clamp: 3;
|
|
61
|
+
}
|
|
62
|
+
.@{ui-common-prefix}-line-clamp-4 {
|
|
63
|
+
line-clamp: 4;
|
|
64
|
+
-webkit-line-clamp: 4;
|
|
65
|
+
}
|
|
66
|
+
.@{ui-common-prefix}-line-clamp-5 {
|
|
67
|
+
line-clamp: 5;
|
|
68
|
+
-webkit-line-clamp: 5;
|
|
69
|
+
}
|