@unicom-cloud/ui-common 0.1.57 → 0.1.59
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/.virtual/_rolldown/runtime.js +1 -1
- package/animation/Animation.js +41 -42
- package/animation/constants.d.ts +2 -0
- package/animation/constants.js +4 -4
- package/animation/context.d.ts +0 -1
- package/animation/context.js +3 -3
- package/animation/index.d.ts +0 -6
- package/animation/index.js +6 -10
- package/animation/interface.d.ts +1 -1
- package/animation/style/index.js +1 -1
- package/animation/utils.js +1 -1
- package/base/Base.js +1 -1
- package/base/constants.d.ts +2 -0
- package/base/constants.js +4 -1
- package/base/context.d.ts +0 -1
- package/base/context.js +3 -3
- package/base/index.js +1 -1
- package/base/style/index.js +1 -1
- package/base/utils.js +1 -1
- package/border-beam/BorderBeam.js +14 -14
- package/border-beam/Effect.d.ts +1 -6
- package/border-beam/Effect.js +13 -12
- package/border-beam/constants.d.ts +2 -1
- package/border-beam/constants.js +8 -3
- package/border-beam/context.d.ts +0 -1
- package/border-beam/context.js +4 -10
- package/border-beam/hooks/useBorderSize.d.ts +1 -5
- package/border-beam/hooks/useBorderSize.js +1 -1
- package/border-beam/hooks/useChildDom.d.ts +1 -1
- package/border-beam/hooks/useChildDom.js +1 -1
- package/border-beam/index.d.ts +0 -6
- package/border-beam/index.js +5 -9
- package/border-beam/interface.d.ts +27 -4
- package/border-beam/style/index.js +1 -1
- package/border-beam/utils.d.ts +1 -9
- package/border-beam/utils.js +9 -9
- package/development/Development.js +6 -5
- package/development/constants.d.ts +2 -0
- package/development/constants.js +4 -1
- package/development/context.d.ts +0 -1
- package/development/context.js +3 -3
- package/development/index.d.ts +0 -6
- package/development/index.js +5 -9
- package/development/style/index.js +1 -1
- package/development/utils.js +1 -1
- package/empty/Empty.d.ts +1 -1
- package/empty/Empty.js +28 -27
- package/empty/constants.d.ts +2 -0
- package/empty/constants.js +4 -1
- package/empty/context.d.ts +0 -1
- package/empty/context.js +3 -3
- package/empty/index.d.ts +1 -7
- package/empty/index.js +5 -9
- package/empty/style/index.js +1 -1
- package/empty/utils.js +1 -1
- package/flex/Flex.js +5 -4
- package/flex/FlexVertical.js +1 -1
- package/flex/constants.d.ts +2 -0
- package/flex/constants.js +7 -1
- package/flex/context.d.ts +0 -1
- package/flex/context.js +3 -6
- package/flex/index.d.ts +1 -7
- package/flex/index.js +9 -11
- package/flex/interface.d.ts +1 -1
- package/flex/style/index.js +1 -1
- package/flex/utils.d.ts +1 -1
- package/flex/utils.js +10 -12
- package/grid/Grid.js +16 -15
- package/grid/Item.js +10 -9
- package/grid/constants.d.ts +3 -0
- package/grid/constants.js +8 -1
- package/grid/context.d.ts +0 -2
- package/grid/context.js +4 -8
- package/grid/index.d.ts +0 -6
- package/grid/index.js +9 -11
- package/grid/style/index.js +1 -1
- package/grid/utils.js +1 -1
- package/higher-order/with-speech-synthesis/constants.d.ts +2 -0
- package/higher-order/with-speech-synthesis/constants.js +7 -0
- package/higher-order/with-speech-synthesis/context.d.ts +0 -1
- package/higher-order/with-speech-synthesis/context.js +3 -3
- package/higher-order/with-speech-synthesis/index.d.ts +0 -6
- package/higher-order/with-speech-synthesis/index.js +5 -9
- package/higher-order/with-speech-synthesis/style/index.js +1 -1
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.d.ts +8 -1
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.js +28 -27
- package/hoc/withContext.js +1 -1
- package/hooks/create-deep-compare-effect/index.js +1 -1
- package/hooks/create-update-effect/index.js +1 -1
- package/hooks/create-use-storage-state/index.js +9 -9
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +93 -92
- package/hooks/use-async-effect/index.js +1 -1
- package/hooks/use-boolean/index.js +1 -1
- package/hooks/use-click-away/index.d.ts +7 -1
- package/hooks/use-click-away/index.js +20 -12
- package/hooks/use-computed-state/index.js +1 -1
- package/hooks/use-controllable-value/index.js +1 -1
- package/hooks/use-cookie-state/index.js +2 -2
- package/hooks/use-count-down/index.js +1 -1
- package/hooks/use-counter/index.js +1 -1
- package/hooks/use-create/index.js +6 -5
- package/hooks/use-creation/index.js +7 -6
- package/hooks/use-debounce/debounceOptions.d.ts +1 -6
- package/hooks/use-debounce/index.js +1 -1
- package/hooks/use-debounce/interface.d.ts +14 -0
- package/hooks/use-debounce-effect/index.js +1 -1
- package/hooks/use-debounce-fn/index.js +5 -5
- package/hooks/use-deep-compare-effect/index.js +1 -1
- package/hooks/use-deep-compare-layout-effect/index.js +1 -1
- package/hooks/use-document-visibility/index.js +7 -7
- package/hooks/use-drag/index.d.ts +1 -1
- package/hooks/use-drag/index.js +10 -10
- package/hooks/use-drag-move/index.js +1 -1
- package/hooks/use-drop/index.d.ts +1 -1
- package/hooks/use-drop/index.js +1 -1
- package/hooks/use-dynamic-list/index.d.ts +18 -0
- package/hooks/use-dynamic-list/index.js +105 -0
- package/hooks/use-effect-event/index.js +1 -1
- package/hooks/use-event/index.js +1 -1
- package/hooks/use-event-emitter/index.d.ts +13 -1
- package/hooks/use-event-emitter/index.js +15 -12
- package/hooks/use-event-listener/index.d.ts +2 -7
- package/hooks/use-event-listener/index.js +1 -1
- package/hooks/use-event-target/index.js +1 -1
- package/hooks/use-external/index.js +2 -2
- package/hooks/use-favicon/index.js +2 -2
- package/hooks/use-focus-within/index.d.ts +1 -5
- package/hooks/use-focus-within/index.js +1 -1
- package/hooks/use-focus-within/interface.d.ts +13 -0
- package/hooks/use-force-update/index.js +1 -1
- package/hooks/use-fullscreen/index.js +14 -14
- package/hooks/use-get-state/index.d.ts +1 -7
- package/hooks/use-get-state/index.js +1 -1
- package/hooks/use-history-travel/index.d.ts +1 -1
- package/hooks/use-history-travel/index.js +32 -26
- package/hooks/use-hover/index.js +1 -1
- package/hooks/use-id/index.js +1 -1
- package/hooks/use-in-viewport/index.js +10 -10
- package/hooks/use-infinite-scroll/index.js +33 -31
- package/hooks/use-intersection-observer/index.js +3 -3
- package/hooks/use-intersection-observers/index.js +10 -10
- package/hooks/use-interval/index.js +1 -1
- package/hooks/use-is-first-render/index.js +1 -1
- package/hooks/use-isomorphic-layout-effect/index.js +1 -1
- package/hooks/use-key-press/index.js +1 -1
- package/hooks/use-keyboard-event/index.d.ts +1 -0
- package/hooks/use-keyboard-event/index.js +1 -1
- package/hooks/use-latest/index.js +1 -1
- package/hooks/use-listen-window-resize/index.js +1 -1
- package/hooks/use-local-storage-state/index.js +4 -4
- package/hooks/use-lock-fn/index.js +1 -1
- package/hooks/use-long-press/index.js +1 -1
- package/hooks/use-map/index.js +1 -1
- package/hooks/use-media/index.js +1 -1
- package/hooks/use-memo/index.js +1 -1
- package/hooks/use-memoized-fn/index.js +1 -1
- package/hooks/use-merge-component-props/index.d.ts +2 -2
- package/hooks/use-merge-component-props/index.js +2 -1
- package/hooks/use-merge-value/index.d.ts +1 -1
- package/hooks/use-merge-value/index.js +1 -1
- package/hooks/use-mobile/index.js +1 -1
- package/hooks/use-mount/index.js +1 -1
- package/hooks/use-mouse/index.d.ts +1 -1
- package/hooks/use-mouse/index.js +9 -9
- package/hooks/use-mutation-observer/index.js +2 -2
- package/hooks/use-mutation-observers/index.js +10 -10
- package/hooks/use-network/index.js +1 -1
- package/hooks/use-online-status/index.js +1 -1
- package/hooks/use-overflow-hidden/index.js +1 -1
- package/hooks/use-override-ref/index.d.ts +3 -5
- package/hooks/use-override-ref/index.js +5 -5
- package/hooks/use-pagination/index.js +1 -1
- package/hooks/use-pagination/types.d.ts +5 -8
- package/hooks/use-paste-file/index.js +9 -9
- package/hooks/use-paste-image/index.js +1 -1
- package/hooks/use-persist-callback/index.js +1 -1
- package/hooks/use-prefers-color-scheme-dark/index.js +1 -1
- package/hooks/use-previous/index.js +1 -1
- package/hooks/use-raf-interval/index.js +17 -17
- package/hooks/use-raf-state/index.d.ts +1 -6
- package/hooks/use-raf-state/index.js +1 -1
- package/hooks/use-raf-timeout/index.js +17 -17
- package/hooks/use-reactive/index.js +5 -5
- package/hooks/use-ref-latest/index.js +1 -1
- package/hooks/use-ref-map/index.d.ts +2 -1
- package/hooks/use-ref-map/index.js +1 -1
- package/hooks/use-refs/index.js +1 -1
- package/hooks/use-request/index.js +5 -5
- package/hooks/use-request/src/Fetch.js +1 -1
- package/hooks/use-request/src/plugins/useAutoRunPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useCachePlugin.js +5 -5
- package/hooks/use-request/src/plugins/useDebouncePlugin.js +2 -2
- package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +13 -12
- package/hooks/use-request/src/plugins/usePollingPlugin.js +3 -3
- package/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useRetryPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useThrottlePlugin.js +1 -1
- package/hooks/use-request/src/useRequest.d.ts +11 -4
- package/hooks/use-request/src/useRequest.js +1 -1
- package/hooks/use-request/src/useRequestImplement.js +18 -18
- package/hooks/use-request/src/utils/cache.js +1 -1
- package/hooks/use-request/src/utils/cachePromise.js +1 -1
- package/hooks/use-request/src/utils/cacheSubscribe.js +1 -1
- package/hooks/use-request/src/utils/isDocumentVisible.js +1 -1
- package/hooks/use-request/src/utils/isOnline.js +3 -3
- package/hooks/use-request/src/utils/limit.js +1 -1
- package/hooks/use-request/src/utils/subscribeFocus.js +1 -1
- package/hooks/use-request/src/utils/subscribeReVisible.js +1 -1
- package/hooks/use-reset-state/index.js +6 -6
- package/hooks/use-resize-observer/index.d.ts +6 -1
- package/hooks/use-resize-observer/index.js +30 -4
- package/hooks/use-resize-observers/index.d.ts +1 -0
- package/hooks/use-resize-observers/index.js +23 -24
- package/hooks/use-responsive/index.js +2 -2
- package/hooks/use-safe-state/index.js +1 -1
- package/hooks/use-scroll/index.js +20 -20
- package/hooks/use-selections/index.d.ts +1 -1
- package/hooks/use-selections/index.js +45 -39
- package/hooks/use-session-storage-state/index.js +4 -4
- package/hooks/use-set/index.js +1 -1
- package/hooks/use-set-state/index.js +1 -1
- package/hooks/use-size/index.d.ts +1 -6
- package/hooks/use-size/index.js +4 -33
- package/hooks/use-state-callback/index.d.ts +1 -5
- package/hooks/use-state-callback/index.js +7 -7
- package/hooks/use-state-with-promise/index.d.ts +1 -4
- package/hooks/use-state-with-promise/index.js +1 -1
- package/hooks/use-sync-state/index.js +5 -5
- package/hooks/use-text-selection/index.js +1 -1
- package/hooks/use-theme/index.js +14 -14
- package/hooks/use-throttle/index.js +1 -1
- package/hooks/use-throttle/interface.d.ts +13 -0
- package/hooks/use-throttle/throttleOptions.d.ts +1 -5
- package/hooks/use-throttle-effect/index.js +5 -5
- package/hooks/use-throttle-fn/index.js +5 -5
- package/hooks/use-throttle-fn-with-raf/index.js +6 -6
- package/hooks/use-timeout/index.js +1 -1
- package/hooks/use-title/index.js +5 -5
- package/hooks/use-toggle/index.d.ts +6 -3
- package/hooks/use-toggle/index.js +1 -1
- package/hooks/use-tracked-effect/index.js +1 -1
- package/hooks/use-unmount/index.js +1 -1
- package/hooks/use-unmounted-ref/index.js +1 -1
- package/hooks/use-update/index.js +1 -1
- package/hooks/use-update-effect/index.js +1 -1
- package/hooks/use-update-layout-effect/index.js +1 -1
- package/hooks/use-url-state/index.d.ts +1 -1
- package/hooks/use-url-state/index.js +1 -1
- package/hooks/use-virtual-list/index.js +13 -13
- package/hooks/use-watch/index.js +1 -1
- package/hooks/use-web-socket/index.js +7 -7
- package/hooks/use-why-did-you-update/index.js +1 -1
- package/hooks/use-window-size/index.js +7 -7
- package/hooks/utils/createEffectWithTarget.js +7 -7
- package/hooks/utils/depsAreSame.js +1 -1
- package/hooks/utils/depsEqual.js +1 -1
- package/hooks/utils/domTarget.js +1 -1
- package/hooks/utils/getDocumentOrShadow.js +1 -1
- package/hooks/utils/index.js +1 -1
- package/hooks/utils/isAppleDevice.js +1 -1
- package/hooks/utils/isBrowser.js +1 -1
- package/hooks/utils/isDev.js +1 -1
- package/hooks/utils/rect.js +1 -1
- package/hooks/utils/useDeepCompareWithTarget.js +4 -4
- package/hooks/utils/useEffectWithTarget.js +1 -1
- package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +1 -1
- package/hooks/utils/useLayoutEffectWithTarget.js +1 -1
- package/icons/file/File.js +5 -4
- package/icons/file/constants.d.ts +2 -0
- package/icons/file/constants.js +7 -0
- package/icons/file/context.d.ts +0 -1
- package/icons/file/context.js +3 -3
- package/icons/file/index.js +2 -2
- package/icons/file/style/index.js +1 -1
- package/index.d.ts +2 -2
- package/index.js +542 -537
- package/morphicons/core/interpolate.js +1 -1
- package/morphicons/core/normalize.js +72 -71
- package/morphicons/core/parse.d.ts +1 -9
- package/morphicons/core/resample.js +1 -1
- package/morphicons/core/serialize.js +1 -1
- package/morphicons/core/spring.js +1 -1
- package/morphicons/dom/controller.d.ts +3 -3
- package/morphicons/dom/index.js +68 -67
- package/morphicons/element/index.d.ts +1 -1
- package/morphicons/index.d.ts +1 -1
- package/morphicons/index.js +6 -6
- package/morphicons/react/index.d.ts +1 -1
- package/morphicons/react/index.js +65 -64
- package/package.json +1 -1
- package/progress/Progress.js +20 -20
- package/progress/constants.js +1 -1
- package/progress/context.js +1 -1
- package/progress/index.js +1 -1
- package/progress/style/index.js +1 -1
- package/progress/utils.js +1 -1
- package/resize-observer/Collection.js +1 -1
- package/resize-observer/ResizeObserver.js +13 -12
- package/resize-observer/SingleObserver.d.ts +1 -5
- package/resize-observer/SingleObserver.js +4 -4
- package/resize-observer/constants.d.ts +2 -0
- package/resize-observer/constants.js +4 -1
- package/resize-observer/context.d.ts +0 -1
- package/resize-observer/context.js +3 -3
- package/resize-observer/index.d.ts +1 -7
- package/resize-observer/index.js +7 -9
- package/resize-observer/interface.d.ts +18 -0
- package/resize-observer/observerUtil.d.ts +1 -1
- package/resize-observer/observerUtil.js +1 -1
- package/resize-observer/style/index.js +1 -1
- package/resize-observer/utils.js +1 -1
- package/space/Space.d.ts +2 -1
- package/space/Space.js +12 -11
- package/space/SpaceVertical.js +1 -1
- package/space/constants.d.ts +2 -0
- package/space/constants.js +9 -1
- package/space/context.d.ts +0 -1
- package/space/context.js +3 -8
- package/space/index.d.ts +0 -6
- package/space/index.js +8 -10
- package/space/interface.d.ts +1 -0
- package/space/style/index.js +1 -1
- package/space/utils.js +1 -1
- package/style/animation.less +2 -8
- package/style/normalize.less +0 -13
- package/style.css +1 -1
- package/suspense-fallback-test/NeverLoadLazy.d.ts +3 -0
- package/suspense-fallback-test/NeverLoadLazy.js +8 -0
- package/suspense-fallback-test/SuspenseFallbackTest.js +14 -14
- package/suspense-fallback-test/constants.d.ts +2 -0
- package/suspense-fallback-test/constants.js +4 -1
- package/suspense-fallback-test/context.d.ts +0 -2
- package/suspense-fallback-test/context.js +3 -3
- package/suspense-fallback-test/index.d.ts +0 -6
- package/suspense-fallback-test/index.js +5 -9
- package/suspense-fallback-test/style/index.js +1 -1
- package/suspense-fallback-test/utils.js +1 -1
- package/test.js +1 -1
- package/timer/Timer.js +6 -5
- package/timer/constants.d.ts +2 -0
- package/timer/constants.js +4 -1
- package/timer/context.d.ts +0 -1
- package/timer/context.js +3 -3
- package/timer/index.d.ts +0 -6
- package/timer/index.js +5 -9
- package/timer/style/index.js +1 -1
- package/timer/utils.js +1 -1
- package/transition/Transition.d.ts +0 -1
- package/transition/Transition.js +55 -58
- package/transition/TransitionCSS.js +15 -15
- package/transition/TransitionGroup.js +13 -13
- package/transition/TransitionStyle.js +12 -12
- package/transition/constants.d.ts +4 -27
- package/transition/constants.js +37 -41
- package/transition/context.d.ts +2 -3
- package/transition/context.js +4 -5
- package/transition/index.d.ts +0 -7
- package/transition/index.js +15 -16
- package/transition/interface.d.ts +26 -1
- package/transition/interface.js +11 -0
- package/transition/style/index.js +1 -1
- package/transition/utils.d.ts +1 -1
- package/transition/utils.js +1 -1
- package/utils/callbackOriginRef.js +1 -1
- package/utils/confetti.js +1 -1
- package/utils/constants.d.ts +3 -2
- package/utils/constants.js +6 -5
- package/utils/copy.js +1 -1
- package/utils/createRoot.d.ts +1 -6
- package/utils/createRoot.js +11 -11
- package/utils/css.js +1 -1
- package/utils/date.d.ts +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/document.js +1 -1
- package/utils/dom.d.ts +1 -1
- package/utils/dom.js +9 -9
- package/utils/file.js +1 -1
- package/utils/fillNBSP.js +1 -1
- package/utils/getCompatProp.js +1 -1
- package/utils/getElement.js +1 -1
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.d.ts +1 -12
- package/utils/getHotkeyHandler.js +17 -17
- package/utils/getPrefixCls.js +1 -1
- package/utils/getScrollBarHeight.js +1 -1
- package/utils/getScrollBarSize.js +1 -1
- package/utils/getScrollBarWidth.js +1 -1
- package/utils/getScrollParent.js +1 -1
- package/utils/getStringLength.js +1 -1
- package/utils/getUrlSearchParam.js +1 -1
- package/utils/index.js +274 -273
- package/utils/initAllLineClamp.js +1 -1
- package/utils/injectLineClamp.js +1 -1
- package/utils/interface.d.ts +103 -0
- package/utils/interface.js +4 -0
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.js +1 -1
- package/utils/keyboardCode.js +1 -1
- package/utils/lodash.d.ts +2 -1
- package/utils/lodash.js +19 -18
- package/utils/math.d.ts +1 -1
- package/utils/mergeProps.d.ts +1 -2
- package/utils/mergeProps.js +1 -1
- package/utils/mergedToString.js +1 -1
- package/utils/migrateLegacyProps.d.ts +1 -8
- package/utils/migrateLegacyProps.js +1 -1
- package/utils/mutationObserver.js +1 -1
- package/utils/names.d.ts +1 -8
- package/utils/names.js +1 -1
- package/utils/object.js +1 -1
- package/utils/omit.js +1 -1
- package/utils/pad.js +1 -1
- package/utils/pick.js +1 -1
- package/utils/react19Adapter.js +1 -1
- package/utils/reactNode.js +1 -1
- package/utils/ref.d.ts +2 -1
- package/utils/ref.js +13 -13
- package/utils/resizeObserver.js +1 -1
- package/utils/scrollIntoViewIfNeeded.js +1 -1
- package/utils/scrollTo.js +1 -1
- package/utils/setDarkTheme.js +1 -1
- package/utils/setDir.js +1 -1
- package/utils/setPrimaryColor.js +1 -1
- package/utils/setTheme.js +1 -1
- package/utils/string.js +1 -1
- package/utils/style.js +1 -1
- package/utils/tinycolor.js +1 -1
- package/utils/toArray.js +1 -1
- package/utils/tunnel.d.ts +2 -12
- package/utils/tunnel.js +1 -1
- package/utils/warning.js +1 -1
- package/version/index.js +10 -9
- /package/{base → resize-observer}/style/index.css +0 -0
package/grid/context.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
-
import {
|
|
4
|
-
import { createContext as t } from "react";
|
|
3
|
+
import { createContext as e } from "react";
|
|
5
4
|
// components/common/grid/context.ts
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
span: 1
|
|
9
|
-
}, o = t({});
|
|
10
|
-
export { n as GridContext, i as PropsContext, o as PropsContextGridItem, r as defaultProps, a as defaultPropsGridItem };
|
|
5
|
+
var t = e({}), n = e({}), r = e({});
|
|
6
|
+
export { t as GridContext, n as PropsContext, r as PropsContextGridItem };
|
|
11
7
|
/* 欲穷千里目,更上一层楼 */
|
|
12
8
|
/* 独立思考,明辨是非 */
|
package/grid/index.d.ts
CHANGED
|
@@ -23,12 +23,6 @@ declare const Grid: import("react").ForwardRefExoticComponent<import("./interfac
|
|
|
23
23
|
rowGap?: import("./interface").GridProps["rowGap"];
|
|
24
24
|
columnGap?: import("./interface").GridProps["columnGap"];
|
|
25
25
|
}>;
|
|
26
|
-
zh: string;
|
|
27
|
-
en: string;
|
|
28
|
-
displayName: string;
|
|
29
|
-
id: string;
|
|
30
|
-
legacy?: string;
|
|
31
|
-
descriptions?: string;
|
|
32
26
|
};
|
|
33
27
|
export { GridContext, Item as GridItem };
|
|
34
28
|
export default Grid;
|
package/grid/index.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
-
import { COMPONENT_INFO_GRID as e } from "../utils/names.js";
|
|
4
3
|
import "./style/index.js";
|
|
5
|
-
import { GridContext as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import { GridContext as e, PropsContext as t } from "./context.js";
|
|
5
|
+
import n from "./Grid.js";
|
|
6
|
+
import r from "./Item.js";
|
|
8
7
|
// components/common/grid/index.ts
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Context: t
|
|
8
|
+
var i = Object.assign(n, {
|
|
9
|
+
PropsContext: t,
|
|
10
|
+
Item: r,
|
|
11
|
+
Context: e
|
|
14
12
|
});
|
|
15
|
-
export {
|
|
13
|
+
export { e as GridContext, r as GridItem, i as default };
|
|
16
14
|
/* 欲穷千里目,更上一层楼 */
|
|
17
15
|
/* 独立思考,明辨是非 */
|
package/grid/style/index.js
CHANGED
package/grid/utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { createContext as e } from "react";
|
|
4
4
|
// components/common/higher-order/with-speech-synthesis/context.ts
|
|
5
|
-
var t =
|
|
6
|
-
export {
|
|
5
|
+
var t = e({});
|
|
6
|
+
export { t as PropsContext };
|
|
7
7
|
/* 欲穷千里目,更上一层楼 */
|
|
8
8
|
/* 独立思考,明辨是非 */
|
|
@@ -2,12 +2,6 @@ import './style';
|
|
|
2
2
|
import Component from './withSpeechSynthesis';
|
|
3
3
|
declare const withSpeechSynthesis: typeof Component & {
|
|
4
4
|
PropsContext: import("react").Context<Partial<import("./interface").SpeechSynthesisProps>>;
|
|
5
|
-
zh: string;
|
|
6
|
-
en: string;
|
|
7
|
-
displayName: string;
|
|
8
|
-
id: string;
|
|
9
|
-
legacy?: string;
|
|
10
|
-
descriptions?: string;
|
|
11
5
|
};
|
|
12
6
|
export default withSpeechSynthesis;
|
|
13
7
|
export type * from './interface';
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
-
import { COMPONENT_INFO_SPEECH_SYNTHESIS as e } from "../../utils/names.js";
|
|
4
3
|
import "./style/index.js";
|
|
5
|
-
import { PropsContext as
|
|
6
|
-
import
|
|
4
|
+
import { PropsContext as e } from "./context.js";
|
|
5
|
+
import t from "./withSpeechSynthesis.js";
|
|
7
6
|
// components/common/higher-order/with-speech-synthesis/index.ts
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
PropsContext: t
|
|
11
|
-
});
|
|
12
|
-
export { r as default };
|
|
7
|
+
var n = Object.assign(t, { PropsContext: e });
|
|
8
|
+
export { n as default };
|
|
13
9
|
/* 欲穷千里目,更上一层楼 */
|
|
14
10
|
/* 独立思考,明辨是非 */
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SpeechSynthesisHandles, SpeechSynthesisProps } from './interface';
|
|
3
|
-
declare function withSpeechSynthesis<P extends object>(WrappedComponent: React.ComponentType<P>): React.
|
|
3
|
+
declare function withSpeechSynthesis<P extends object>(WrappedComponent: React.ComponentType<P>): React.ForwardRefExoticComponent<React.PropsWithoutRef<SpeechSynthesisProps & P> & React.RefAttributes<SpeechSynthesisHandles>> & {
|
|
4
|
+
displayName: string;
|
|
5
|
+
zh: string;
|
|
6
|
+
en: string;
|
|
7
|
+
id: string;
|
|
8
|
+
legacy?: string;
|
|
9
|
+
descriptions?: string;
|
|
10
|
+
};
|
|
4
11
|
export default withSpeechSynthesis;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../../hooks/use-merge-component-props/index.js";
|
|
4
4
|
import { COMPONENT_INFO_SPEECH_SYNTHESIS as t } from "../../utils/names.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
5
|
+
import { defaultProps as n } from "./constants.js";
|
|
6
|
+
import { PropsContext as r } from "./context.js";
|
|
7
|
+
import { forwardRef as i, useCallback as a, useContext as o, useEffect as s, useImperativeHandle as c, useMemo as l, useState as u } from "react";
|
|
8
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
9
|
+
import f from "@unicom-cloud/icons/IconUiMute";
|
|
10
|
+
import p from "@unicom-cloud/icons/IconUiPauseCircleFill";
|
|
11
|
+
import m from "@unicom-cloud/icons/IconUiPlayCircleFill";
|
|
12
|
+
import h from "@unicom-cloud/icons/IconUiSound";
|
|
12
13
|
// components/common/higher-order/with-speech-synthesis/withSpeechSynthesis.tsx
|
|
13
|
-
function
|
|
14
|
-
let
|
|
15
|
-
let
|
|
14
|
+
function g(g) {
|
|
15
|
+
let _ = i((t, i) => {
|
|
16
|
+
let _ = o(r), { useButton: v = !0, buttonProps: y = {}, ...b } = e({
|
|
16
17
|
internalProps: t,
|
|
17
|
-
contextProps:
|
|
18
|
+
contextProps: _,
|
|
18
19
|
globalProps: {},
|
|
19
|
-
defaultProps:
|
|
20
|
-
}), [x, S] =
|
|
20
|
+
defaultProps: n
|
|
21
|
+
}), [x, S] = u(!1), [C, w] = u(null), T = l(() => "speechSynthesis" in window && "SpeechSynthesisUtterance" in window, []), E = a(() => {
|
|
21
22
|
T && (window.speechSynthesis.cancel(), S(!1), w(null));
|
|
22
|
-
}, [T]), D =
|
|
23
|
+
}, [T]), D = a(() => {
|
|
23
24
|
if (!T) return;
|
|
24
25
|
E();
|
|
25
26
|
let e = b.getText?.() ?? b.text;
|
|
@@ -40,11 +41,11 @@ function _(_) {
|
|
|
40
41
|
T,
|
|
41
42
|
b.getText,
|
|
42
43
|
b.text
|
|
43
|
-
]), O =
|
|
44
|
+
]), O = a(() => {
|
|
44
45
|
T && C && window.speechSynthesis.pause();
|
|
45
|
-
}, [T, C]), k =
|
|
46
|
+
}, [T, C]), k = a(() => {
|
|
46
47
|
T && C && window.speechSynthesis.resume();
|
|
47
|
-
}, [T, C]), A =
|
|
48
|
+
}, [T, C]), A = a((e) => {
|
|
48
49
|
e.preventDefault(), e.stopPropagation(), x ? O() : D(), y.onClick?.(e);
|
|
49
50
|
}, [
|
|
50
51
|
x,
|
|
@@ -52,7 +53,7 @@ function _(_) {
|
|
|
52
53
|
D,
|
|
53
54
|
y.onClick
|
|
54
55
|
]);
|
|
55
|
-
if (
|
|
56
|
+
if (s(() => E, [E]), c(i, () => ({
|
|
56
57
|
cancel: E,
|
|
57
58
|
speak: D,
|
|
58
59
|
pause: O,
|
|
@@ -60,27 +61,27 @@ function _(_) {
|
|
|
60
61
|
})), !T) return null;
|
|
61
62
|
if (v) {
|
|
62
63
|
let { label: e, text: t, children: n, ...r } = y;
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ d(g, {
|
|
64
65
|
...b,
|
|
65
66
|
type: "text",
|
|
66
67
|
size: "mini",
|
|
67
|
-
icon:
|
|
68
|
+
icon: d(x ? f : h, {}),
|
|
68
69
|
...r,
|
|
69
70
|
onClick: A,
|
|
70
71
|
children: e || t || n
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ d(x ? p : m, {
|
|
74
75
|
...b.iconProps,
|
|
75
76
|
onClick: A,
|
|
76
77
|
style: { cursor: "pointer" }
|
|
77
78
|
});
|
|
78
|
-
});
|
|
79
|
-
return Object.assign(
|
|
79
|
+
}), v = g.displayName || g.name || t.displayName;
|
|
80
|
+
return Object.assign(_, {
|
|
80
81
|
...t,
|
|
81
|
-
displayName: `WithSpeechSynthesis.${
|
|
82
|
-
})
|
|
82
|
+
displayName: `WithSpeechSynthesis.${v}`
|
|
83
|
+
});
|
|
83
84
|
}
|
|
84
|
-
export {
|
|
85
|
+
export { g as default };
|
|
85
86
|
/* 欲穷千里目,更上一层楼 */
|
|
86
87
|
/* 独立思考,明辨是非 */
|
package/hoc/withContext.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
-
import e from "../use-
|
|
4
|
-
import t from "../use-
|
|
5
|
-
import n from "../use-
|
|
6
|
-
import r from "../use-
|
|
3
|
+
import e from "../use-event-listener/index.js";
|
|
4
|
+
import t from "../use-memoized-fn/index.js";
|
|
5
|
+
import n from "../use-mount/index.js";
|
|
6
|
+
import r from "../use-update-effect/index.js";
|
|
7
7
|
import { useRef as i, useState as a } from "react";
|
|
8
8
|
import { isFunction as o, isUndefined as s } from "@unicom-cloud/utils/is";
|
|
9
9
|
// components/common/hooks/create-use-storage-state/index.ts
|
|
@@ -29,11 +29,11 @@ function l(l) {
|
|
|
29
29
|
return o(d.defaultValue) ? d.defaultValue() : d.defaultValue;
|
|
30
30
|
}
|
|
31
31
|
let [b, x] = a(() => m ? y() : v());
|
|
32
|
-
|
|
32
|
+
n(() => {
|
|
33
33
|
m && x(v());
|
|
34
34
|
});
|
|
35
35
|
let S = i(b);
|
|
36
|
-
S.current = b,
|
|
36
|
+
S.current = b, r(() => {
|
|
37
37
|
let e = v();
|
|
38
38
|
Object.is(e, S.current) || (S.current = e, x(e));
|
|
39
39
|
}, [u]);
|
|
@@ -58,9 +58,9 @@ function l(l) {
|
|
|
58
58
|
let t = v();
|
|
59
59
|
Object.is(t, S.current) || (S.current = t, x(t));
|
|
60
60
|
};
|
|
61
|
-
return
|
|
61
|
+
return e("storage", w, { enable: p }), e(c, (e) => {
|
|
62
62
|
w(e.detail);
|
|
63
|
-
}, { enable: p }), [b,
|
|
63
|
+
}, { enable: p }), [b, t(C)];
|
|
64
64
|
}
|
|
65
65
|
return u;
|
|
66
66
|
}
|
package/hooks/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { default as useComputedState } from './use-computed-state';
|
|
|
6
6
|
export { default as useControllableValue } from './use-controllable-value';
|
|
7
7
|
export { default as useCookieState } from './use-cookie-state';
|
|
8
8
|
export { default as useCountDown } from './use-count-down';
|
|
9
|
+
export { default as useDynamicList } from './use-dynamic-list';
|
|
9
10
|
export { default as useCounter } from './use-counter';
|
|
10
11
|
export { default as useCreate } from './use-create';
|
|
11
12
|
export { default as useCreation } from './use-creation';
|
package/hooks/index.js
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import ee from "./create-update-effect/index.js";
|
|
4
4
|
import te from "./use-async-effect/index.js";
|
|
5
|
-
import e from "./use-
|
|
6
|
-
import t from "./use-
|
|
7
|
-
import n from "./use-
|
|
8
|
-
import r from "./use-
|
|
9
|
-
import i from "./use-
|
|
10
|
-
import a from "./use-
|
|
11
|
-
import o from "./use-
|
|
12
|
-
import s from "./use-
|
|
13
|
-
import c from "./use-
|
|
14
|
-
import l from "./use-
|
|
15
|
-
import u from "./use-
|
|
16
|
-
import d from "./use-
|
|
17
|
-
import f from "./use-
|
|
18
|
-
import p from "./use-
|
|
19
|
-
import m from "./use-
|
|
20
|
-
import h from "./use-
|
|
21
|
-
import g from "./use-
|
|
22
|
-
import _ from "./use-
|
|
23
|
-
import v from "./use-
|
|
24
|
-
import y from "./use-
|
|
25
|
-
import b from "./use-
|
|
26
|
-
import x from "./use-
|
|
27
|
-
import S from "./use-
|
|
28
|
-
import C from "./use-
|
|
29
|
-
import w from "./use-
|
|
30
|
-
import T from "./use-
|
|
31
|
-
import E from "./use-
|
|
32
|
-
import D from "./use-
|
|
33
|
-
import O from "./use-
|
|
34
|
-
import k from "./use-
|
|
35
|
-
import A from "./use-
|
|
36
|
-
import j from "./use-
|
|
37
|
-
import M from "./use-
|
|
38
|
-
import N from "./use-
|
|
39
|
-
import P from "./use-
|
|
40
|
-
import F from "./use-
|
|
41
|
-
import I from "./use-
|
|
42
|
-
import L from "./use-
|
|
43
|
-
import R from "./use-
|
|
44
|
-
import z from "./use-
|
|
45
|
-
import B from "./use-
|
|
46
|
-
import V from "./use-
|
|
47
|
-
import
|
|
48
|
-
import U from "./use-request/
|
|
49
|
-
import W from "./use-
|
|
50
|
-
import G from "./use-interval/index.js";
|
|
51
|
-
import K from "./use-isomorphic-layout-effect/index.js";
|
|
52
|
-
import q from "./use-key-press/index.js";
|
|
53
|
-
import J from "./use-local-storage-state/index.js";
|
|
54
|
-
import Y from "./use-lock-fn/index.js";
|
|
55
|
-
import X from "./use-long-press/index.js";
|
|
56
|
-
import Z from "./use-mobile/index.js";
|
|
57
|
-
import Q from "./use-raf-state/index.js";
|
|
58
|
-
import ne from "./use-mouse/index.js";
|
|
5
|
+
import e from "./use-boolean/index.js";
|
|
6
|
+
import t from "./use-click-away/index.js";
|
|
7
|
+
import n from "./use-computed-state/index.js";
|
|
8
|
+
import r from "./use-controllable-value/index.js";
|
|
9
|
+
import i from "./use-cookie-state/index.js";
|
|
10
|
+
import a from "./use-count-down/index.js";
|
|
11
|
+
import o from "./use-dynamic-list/index.js";
|
|
12
|
+
import s from "./use-counter/index.js";
|
|
13
|
+
import c from "./use-create/index.js";
|
|
14
|
+
import l from "./use-creation/index.js";
|
|
15
|
+
import u from "./use-debounce/index.js";
|
|
16
|
+
import d from "./use-debounce-effect/index.js";
|
|
17
|
+
import f from "./use-debounce-fn/index.js";
|
|
18
|
+
import p from "./use-deep-compare-effect/index.js";
|
|
19
|
+
import m from "./use-deep-compare-layout-effect/index.js";
|
|
20
|
+
import h from "./use-document-visibility/index.js";
|
|
21
|
+
import g from "./use-drag/index.js";
|
|
22
|
+
import _ from "./use-drag-move/index.js";
|
|
23
|
+
import v from "./use-drop/index.js";
|
|
24
|
+
import y from "./use-event/index.js";
|
|
25
|
+
import b from "./use-event-emitter/index.js";
|
|
26
|
+
import x from "./use-event-listener/index.js";
|
|
27
|
+
import S from "./use-event-target/index.js";
|
|
28
|
+
import C from "./use-external/index.js";
|
|
29
|
+
import w from "./use-favicon/index.js";
|
|
30
|
+
import T from "./use-focus-within/index.js";
|
|
31
|
+
import E from "./use-fullscreen/index.js";
|
|
32
|
+
import D from "./use-get-state/index.js";
|
|
33
|
+
import O from "./use-history-travel/index.js";
|
|
34
|
+
import k from "./use-hover/index.js";
|
|
35
|
+
import A from "./use-in-viewport/index.js";
|
|
36
|
+
import j from "./use-infinite-scroll/index.js";
|
|
37
|
+
import M from "./use-interval/index.js";
|
|
38
|
+
import N from "./use-isomorphic-layout-effect/index.js";
|
|
39
|
+
import P from "./use-key-press/index.js";
|
|
40
|
+
import F from "./use-latest/index.js";
|
|
41
|
+
import I from "./use-local-storage-state/index.js";
|
|
42
|
+
import L from "./use-lock-fn/index.js";
|
|
43
|
+
import R from "./use-long-press/index.js";
|
|
44
|
+
import z from "./use-memo/index.js";
|
|
45
|
+
import B from "./use-memoized-fn/index.js";
|
|
46
|
+
import V from "./use-mobile/index.js";
|
|
47
|
+
import H from "./use-mount/index.js";
|
|
48
|
+
import { clearCache as U } from "./use-request/src/utils/cache.js";
|
|
49
|
+
import W from "./use-mouse/index.js";
|
|
59
50
|
import "./use-move/index.js";
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import
|
|
63
|
-
import
|
|
64
|
-
import
|
|
65
|
-
import
|
|
66
|
-
import
|
|
67
|
-
import
|
|
68
|
-
import
|
|
69
|
-
import
|
|
70
|
-
import
|
|
71
|
-
import
|
|
72
|
-
import
|
|
73
|
-
import
|
|
74
|
-
import
|
|
75
|
-
import
|
|
76
|
-
import
|
|
77
|
-
import
|
|
78
|
-
import
|
|
79
|
-
import
|
|
80
|
-
import
|
|
81
|
-
import
|
|
82
|
-
import
|
|
83
|
-
import
|
|
84
|
-
import
|
|
85
|
-
import
|
|
86
|
-
import
|
|
87
|
-
import
|
|
88
|
-
import
|
|
89
|
-
import
|
|
90
|
-
import
|
|
91
|
-
import
|
|
51
|
+
import G from "./use-mutation-observer/index.js";
|
|
52
|
+
import K from "./use-network/index.js";
|
|
53
|
+
import q from "./use-pagination/index.js";
|
|
54
|
+
import J from "./use-previous/index.js";
|
|
55
|
+
import Y from "./use-raf-interval/index.js";
|
|
56
|
+
import X from "./use-raf-state/index.js";
|
|
57
|
+
import Z from "./use-raf-timeout/index.js";
|
|
58
|
+
import Q from "./use-reactive/index.js";
|
|
59
|
+
import ne from "./use-ref-latest/index.js";
|
|
60
|
+
import re from "./use-request/index.js";
|
|
61
|
+
import ie from "./use-reset-state/index.js";
|
|
62
|
+
import ae, { configResponsive as oe } from "./use-responsive/index.js";
|
|
63
|
+
import $ from "./use-safe-state/index.js";
|
|
64
|
+
import se from "./use-scroll/index.js";
|
|
65
|
+
import ce from "./use-selections/index.js";
|
|
66
|
+
import le from "./use-session-storage-state/index.js";
|
|
67
|
+
import ue from "./use-set-state/index.js";
|
|
68
|
+
import de from "./use-size/index.js";
|
|
69
|
+
import fe from "./use-sync-state/index.js";
|
|
70
|
+
import pe from "./use-text-selection/index.js";
|
|
71
|
+
import me from "./use-theme/index.js";
|
|
72
|
+
import he from "./use-throttle/index.js";
|
|
73
|
+
import ge from "./use-throttle-effect/index.js";
|
|
74
|
+
import _e from "./use-throttle-fn/index.js";
|
|
75
|
+
import ve from "./use-timeout/index.js";
|
|
76
|
+
import ye from "./use-title/index.js";
|
|
77
|
+
import be from "./use-toggle/index.js";
|
|
78
|
+
import xe from "./use-tracked-effect/index.js";
|
|
79
|
+
import Se from "./use-unmount/index.js";
|
|
80
|
+
import Ce from "./use-unmounted-ref/index.js";
|
|
81
|
+
import we from "./use-update/index.js";
|
|
82
|
+
import Te from "./use-update-effect/index.js";
|
|
83
|
+
import Ee from "./use-update-layout-effect/index.js";
|
|
84
|
+
import De from "./use-url-state/index.js";
|
|
85
|
+
import Oe from "./use-virtual-list/index.js";
|
|
86
|
+
import ke from "./use-web-socket/index.js";
|
|
87
|
+
import Ae from "./use-why-did-you-update/index.js";
|
|
88
|
+
import je from "./use-effect-event/index.js";
|
|
89
|
+
import Me from "./use-force-update/index.js";
|
|
90
|
+
import Ne from "./use-id/index.js";
|
|
91
|
+
import Pe from "./use-intersection-observer/index.js";
|
|
92
92
|
import Fe from "./use-intersection-observers/index.js";
|
|
93
93
|
import Ie from "./use-is-first-render/index.js";
|
|
94
94
|
import Le from "./use-keyboard-event/index.js";
|
|
@@ -107,10 +107,11 @@ import Ye from "./use-ref-map/index.js";
|
|
|
107
107
|
import Xe from "./use-refs/index.js";
|
|
108
108
|
import Ze from "./use-resize-observer/index.js";
|
|
109
109
|
import Qe from "./use-resize-observers/index.js";
|
|
110
|
-
import $e from "./use-state-
|
|
111
|
-
import et from "./use-
|
|
112
|
-
import tt from "./use-
|
|
113
|
-
import nt from "./use-
|
|
114
|
-
|
|
110
|
+
import $e from "./use-state-callback/index.js";
|
|
111
|
+
import et from "./use-state-with-promise/index.js";
|
|
112
|
+
import tt from "./use-throttle-fn-with-raf/index.js";
|
|
113
|
+
import nt from "./use-watch/index.js";
|
|
114
|
+
import rt from "./use-window-size/index.js";
|
|
115
|
+
export { U as clearCache, oe as configResponsive, ee as createUpdateEffect, te as useAsyncEffect, e as useBoolean, t as useClickAway, n as useComputedState, r as useControllableValue, i as useCookieState, a as useCountDown, s as useCounter, c as useCreate, l as useCreation, u as useDebounce, d as useDebounceEffect, f as useDebounceFn, p as useDeepCompareEffect, m as useDeepCompareLayoutEffect, h as useDocumentVisibility, g as useDrag, _ as useDragMove, v as useDrop, o as useDynamicList, je as useEffectEvent, y as useEvent, b as useEventEmitter, x as useEventListener, S as useEventTarget, C as useExternal, w as useFavicon, T as useFocusWithin, Me as useForceUpdate, E as useFullscreen, D as useGetState, O as useHistoryTravel, k as useHover, Ne as useId, A as useInViewport, j as useInfiniteScroll, Pe as useIntersectionObserver, Fe as useIntersectionObservers, M as useInterval, Ie as useIsFirstRender, N as useIsomorphicLayoutEffect, P as useKeyPress, Le as useKeyboardEvent, F as useLatest, Re as useListenWindowResize, I as useLocalStorageState, L as useLockFn, R as useLongPress, ze as useMedia, z as useMemo, B as useMemoizedFn, Be as useMergeComponentProps, V as useMobile, H as useMount, W as useMouse, _ as useMove, G as useMutationObserver, Ve as useMutationObservers, K as useNetwork, He as useOnlineStatus, Ue as useOverflowHidden, We as useOverrideRef, q as usePagination, Ge as usePasteFile, Ke as usePasteImage, qe as usePersistCallback, Je as usePrefersColorSchemeDark, J as usePrevious, Y as useRafInterval, X as useRafState, Z as useRafTimeout, Q as useReactive, ne as useRefLatest, Ye as useRefMap, Xe as useRefs, re as useRequest, ie as useResetState, Ze as useResizeObserver, Qe as useResizeObservers, ae as useResponsive, $ as useSafeState, se as useScroll, ce as useSelections, le as useSessionStorageState, ue as useSetState, de as useSize, $e as useStateCallback, et as useStateWithPromise, fe as useSyncState, pe as useTextSelection, me as useTheme, he as useThrottle, ge as useThrottleEffect, _e as useThrottleFn, tt as useThrottleFnWithRAF, ve as useTimeout, ye as useTitle, be as useToggle, xe as useTrackedEffect, Se as useUnmount, Ce as useUnmountedRef, we as useUpdate, Te as useUpdateEffect, Ee as useUpdateLayoutEffect, De as useUrlState, Oe as useVirtualList, nt as useWatch, ke as useWebSocket, Ae as useWhyDidYouUpdate, rt as useWindowSize };
|
|
115
116
|
/* 欲穷千里目,更上一层楼 */
|
|
116
117
|
/* 独立思考,明辨是非 */
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { BasicTarget } from '../utils/domTarget';
|
|
2
2
|
type DocumentEventKey = keyof DocumentEventMap;
|
|
3
|
-
|
|
3
|
+
export type UseClickAwayEventName = DocumentEventKey | DocumentEventKey[];
|
|
4
|
+
export interface UseClickAwayOptions {
|
|
5
|
+
eventName?: UseClickAwayEventName;
|
|
6
|
+
/** Whether the away listener is active. Defaults to `true`. */
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const useClickAway: <T extends Event = Event>(onClickAway: (event: T) => void, target: BasicTarget | BasicTarget[], eventNameOrOptions?: UseClickAwayEventName | UseClickAwayOptions) => void;
|
|
4
10
|
export default useClickAway;
|
|
@@ -1,29 +1,37 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-latest/index.js";
|
|
4
4
|
import t from "../utils/domTarget.js";
|
|
5
5
|
import n from "../utils/getDocumentOrShadow.js";
|
|
6
6
|
import r from "../utils/useEffectWithTarget.js";
|
|
7
|
-
import i from "
|
|
7
|
+
import { isArray as i } from "@unicom-cloud/utils/is";
|
|
8
|
+
import a from "lodash/castArray";
|
|
8
9
|
// components/common/hooks/use-click-away/index.ts
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
var o = (e) => typeof e == "string" || i(e) ? {
|
|
11
|
+
eventName: e,
|
|
12
|
+
enabled: !0
|
|
13
|
+
} : {
|
|
14
|
+
eventName: e.eventName ?? "click",
|
|
15
|
+
enabled: e.enabled ?? !0
|
|
16
|
+
}, s = (i, s, c = "click") => {
|
|
17
|
+
let l = e(i), { eventName: u, enabled: d } = o(c);
|
|
11
18
|
r(() => {
|
|
19
|
+
if (!d) return;
|
|
12
20
|
let e = (e) => {
|
|
13
|
-
|
|
21
|
+
a(s).some((n) => {
|
|
14
22
|
let r = t(n);
|
|
15
23
|
return !r || r.contains(e.target);
|
|
16
|
-
}) ||
|
|
17
|
-
}, r = n(
|
|
18
|
-
return
|
|
24
|
+
}) || l.current(e);
|
|
25
|
+
}, r = n(s), i = a(u);
|
|
26
|
+
return i.forEach((t) => {
|
|
19
27
|
r.addEventListener(t, e);
|
|
20
28
|
}), () => {
|
|
21
|
-
|
|
29
|
+
i.forEach((t) => {
|
|
22
30
|
r.removeEventListener(t, e);
|
|
23
31
|
});
|
|
24
32
|
};
|
|
25
|
-
},
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
33
|
+
}, [...a(u), d], s);
|
|
34
|
+
};
|
|
35
|
+
export { s as default };
|
|
28
36
|
/* 欲穷千里目,更上一层楼 */
|
|
29
37
|
/* 独立思考,明辨是非 */
|