@unicom-cloud/ui-common 0.1.30 → 0.1.32
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 +32 -32
- package/animation/constants.js +1 -1
- package/animation/context.d.ts +3 -0
- package/animation/context.js +3 -3
- package/animation/index.d.ts +2 -0
- package/animation/index.js +10 -5
- package/animation/style/index.css +1 -0
- package/animation/style/index.d.ts +1 -0
- package/animation/style/index.js +3 -0
- package/border-beam/BorderBeam.js +30 -30
- package/border-beam/Effect.js +1 -1
- package/border-beam/constants.js +2 -2
- package/border-beam/context.d.ts +3 -0
- package/border-beam/context.js +8 -0
- package/border-beam/hooks/useBorderSize.js +1 -1
- package/border-beam/hooks/useChildDom.js +1 -1
- package/border-beam/index.d.ts +2 -0
- package/border-beam/index.js +9 -4
- package/border-beam/style/index.css +1 -0
- package/border-beam/style/index.d.ts +1 -0
- package/border-beam/style/index.js +3 -0
- package/border-beam/utils.js +1 -1
- package/development/Development.js +32 -30
- package/development/constants.d.ts +0 -0
- package/development/constants.js +2 -0
- package/development/context.d.ts +3 -0
- package/development/context.js +7 -0
- package/development/index.d.ts +2 -0
- package/development/index.js +9 -4
- package/development/style/index.css +1 -0
- package/development/style/index.d.ts +1 -0
- package/development/style/index.js +3 -0
- package/empty/Empty.js +32 -30
- package/empty/constants.d.ts +0 -0
- package/empty/constants.js +2 -0
- package/empty/context.d.ts +3 -0
- package/empty/context.js +7 -0
- package/empty/index.d.ts +2 -0
- package/empty/index.js +9 -4
- package/empty/style/index.css +1 -0
- package/empty/style/index.d.ts +1 -0
- package/empty/style/index.js +3 -0
- package/flex/Flex.js +32 -35
- package/flex/constants.d.ts +0 -0
- package/flex/constants.js +2 -0
- package/flex/context.d.ts +3 -0
- package/flex/context.js +10 -0
- package/flex/index.d.ts +2 -0
- package/flex/index.js +9 -6
- package/flex/style/index.css +1 -0
- package/flex/style/index.d.ts +1 -0
- package/flex/style/index.js +3 -0
- package/flex/utils.d.ts +1 -1
- package/flex/utils.js +1 -1
- package/higher-order/index.js +1 -1
- package/higher-order/with-speech-synthesis/constants.d.ts +0 -0
- package/higher-order/with-speech-synthesis/context.d.ts +3 -0
- package/higher-order/with-speech-synthesis/context.js +7 -0
- package/higher-order/with-speech-synthesis/index.d.ts +2 -0
- package/higher-order/with-speech-synthesis/index.js +9 -4
- package/higher-order/with-speech-synthesis/interface.d.ts +2 -1
- package/higher-order/with-speech-synthesis/style/index.css +1 -0
- package/higher-order/with-speech-synthesis/style/index.d.ts +0 -1
- package/higher-order/with-speech-synthesis/style/index.js +3 -0
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.js +52 -48
- 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 +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +5 -4
- package/hooks/use-async-effect/index.js +1 -1
- package/hooks/use-boolean/index.js +1 -1
- package/hooks/use-click-away/index.js +1 -1
- 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 +1 -1
- package/hooks/use-count-down/index.js +1 -1
- package/hooks/use-counter/index.js +1 -1
- package/hooks/use-create/index.js +1 -1
- package/hooks/use-creation/index.js +1 -1
- package/hooks/use-debounce/index.js +1 -1
- package/hooks/use-debounce-effect/index.js +1 -1
- package/hooks/use-debounce-fn/index.js +1 -1
- 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 +1 -1
- package/hooks/use-drag/index.js +1 -1
- package/hooks/use-drop/index.js +1 -1
- package/hooks/use-effect-event/index.js +1 -1
- package/hooks/use-event/index.js +1 -1
- package/hooks/use-event-emitter/index.js +1 -1
- package/hooks/use-event-listener/index.js +1 -1
- package/hooks/use-event-target/index.js +1 -1
- package/hooks/use-external/index.js +1 -1
- package/hooks/use-favicon/index.js +1 -1
- package/hooks/use-focus-within/index.js +1 -1
- package/hooks/use-force-update/index.js +1 -1
- package/hooks/use-fullscreen/index.js +1 -1
- package/hooks/use-get-state/index.js +1 -1
- package/hooks/use-history-travel/index.js +1 -1
- package/hooks/use-hover/index.js +1 -1
- package/hooks/use-id/index.js +1 -1
- package/hooks/use-in-viewport/index.js +1 -1
- package/hooks/use-infinite-scroll/index.js +1 -1
- package/hooks/use-intersection-observer/index.js +1 -1
- package/hooks/use-intersection-observers/index.js +2 -2
- 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.js +2 -2
- 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 +1 -1
- 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-props/index.d.ts +2 -2
- package/hooks/use-merge-props/index.js +4 -4
- package/hooks/use-merge-value/index.js +1 -1
- package/hooks/use-mobile/index.js +2 -2
- package/hooks/use-mount/index.js +1 -1
- package/hooks/use-mouse/index.js +1 -1
- package/hooks/use-move/index.js +1 -1
- package/hooks/use-mutation-observer/index.js +1 -1
- package/hooks/use-mutation-observers/index.js +2 -2
- package/hooks/use-network/index.js +1 -1
- package/hooks/use-online-status/index.js +1 -1
- package/hooks/use-overflow-hidden/index.d.ts +1 -1
- package/hooks/use-overflow-hidden/index.js +7 -4
- package/hooks/use-override-ref/index.js +1 -1
- package/hooks/use-pagination/index.js +1 -1
- 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 +2 -2
- package/hooks/use-previous/index.js +1 -1
- package/hooks/use-raf-interval/index.js +1 -1
- package/hooks/use-raf-state/index.js +1 -1
- package/hooks/use-raf-timeout/index.js +1 -1
- package/hooks/use-reactive/index.js +1 -1
- package/hooks/use-ref-latest/index.js +1 -1
- package/hooks/use-refs/index.js +1 -1
- package/hooks/use-request/index.js +1 -1
- 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 +1 -1
- package/hooks/use-request/src/plugins/useDebouncePlugin.js +1 -1
- package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +1 -1
- package/hooks/use-request/src/plugins/usePollingPlugin.js +1 -1
- 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.js +1 -1
- package/hooks/use-request/src/useRequestImplement.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/hooks/use-resize-observer/index.js +1 -1
- package/hooks/use-resize-observers/index.js +2 -2
- package/hooks/use-responsive/index.js +1 -1
- package/hooks/use-safe-state/index.js +1 -1
- package/hooks/use-scroll/index.js +1 -1
- package/hooks/use-selections/index.js +1 -1
- package/hooks/use-session-storage-state/index.js +1 -1
- package/hooks/use-set/index.js +1 -1
- package/hooks/use-set-state/index.js +1 -1
- package/hooks/use-size/index.js +1 -1
- package/hooks/use-state-callback/index.js +1 -1
- package/hooks/use-state-with-promise/index.js +1 -1
- package/hooks/use-sync-state/index.js +1 -1
- package/hooks/use-text-selection/index.js +1 -1
- package/hooks/use-theme/index.js +1 -1
- package/hooks/use-throttle/index.js +1 -1
- package/hooks/use-throttle-effect/index.js +1 -1
- package/hooks/use-throttle-fn/index.js +1 -1
- package/hooks/use-throttle-fn-with-raf/index.d.ts +6 -0
- package/hooks/use-throttle-fn-with-raf/index.js +25 -0
- package/hooks/use-timeout/index.js +1 -1
- package/hooks/use-title/index.js +1 -1
- 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.js +1 -1
- package/hooks/use-virtual-list/index.js +1 -1
- package/hooks/use-watch/index.js +1 -1
- package/hooks/use-web-socket/index.js +1 -1
- package/hooks/use-why-did-you-update/index.js +1 -1
- package/hooks/use-window-size/index.js +1 -1
- package/hooks/utils/createEffectWithTarget.js +1 -1
- 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.d.ts +1 -1
- package/hooks/utils/isAppleDevice.js +2 -2
- package/hooks/utils/isBrowser.d.ts +1 -1
- package/hooks/utils/isBrowser.js +2 -2
- package/hooks/utils/isDev.js +1 -1
- package/hooks/utils/noop.d.ts +1 -1
- package/hooks/utils/rect.js +1 -1
- package/hooks/utils/useDeepCompareWithTarget.js +1 -1
- 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 +60 -0
- package/icons/file/constants.d.ts +0 -0
- package/icons/file/context.d.ts +3 -0
- package/icons/file/context.js +7 -0
- package/icons/file/index.d.ts +2 -0
- package/icons/file/index.js +9 -4
- package/icons/file/style/index.css +1 -0
- package/icons/file/style/index.d.ts +0 -1
- package/icons/file/style/index.js +3 -0
- package/index.js +72 -71
- package/package.json +1 -1
- package/progress/Progress.js +2 -2
- package/progress/constants.d.ts +0 -0
- package/progress/constants.js +2 -0
- package/progress/index.d.ts +1 -28
- package/progress/index.js +5 -5
- package/progress/style/index.css +1 -0
- package/progress/style/index.d.ts +1 -0
- package/progress/style/index.js +3 -0
- package/resize-observer/Collection.js +1 -1
- package/resize-observer/ResizeObserver.js +19 -17
- package/resize-observer/SingleObserver.js +1 -1
- package/resize-observer/constants.d.ts +0 -0
- package/resize-observer/constants.js +2 -0
- package/resize-observer/context.d.ts +3 -0
- package/resize-observer/context.js +7 -0
- package/resize-observer/index.d.ts +2 -0
- package/resize-observer/index.js +9 -6
- package/resize-observer/observerUtil.js +1 -1
- package/resize-observer/style/index.d.ts +1 -0
- package/resize-observer/style/index.js +3 -0
- package/space/Space.js +44 -47
- package/space/constants.d.ts +0 -0
- package/space/constants.js +2 -0
- package/space/context.d.ts +3 -0
- package/space/context.js +10 -0
- package/space/index.d.ts +2 -0
- package/space/index.js +8 -5
- package/space/style/index.css +1 -0
- package/space/style/index.d.ts +1 -0
- package/space/style/index.js +3 -0
- package/style/index.less +5 -1
- package/style/variables-css.less +5 -0
- package/style/variables.less +0 -4
- package/style.css +1 -2
- package/suspense-fallback-test/SuspenseFallbackTest.js +13 -10
- package/suspense-fallback-test/constants.d.ts +0 -0
- package/suspense-fallback-test/constants.js +2 -0
- package/suspense-fallback-test/context.d.ts +3 -0
- package/suspense-fallback-test/context.js +7 -0
- package/suspense-fallback-test/index.d.ts +2 -0
- package/suspense-fallback-test/index.js +9 -4
- package/suspense-fallback-test/style/index.css +1 -0
- package/suspense-fallback-test/style/index.d.ts +1 -0
- package/suspense-fallback-test/style/index.js +3 -0
- package/test.js +1 -1
- package/timer/Timer.js +28 -26
- package/timer/constants.d.ts +0 -0
- package/timer/constants.js +2 -0
- package/timer/context.d.ts +3 -0
- package/timer/context.js +7 -0
- package/timer/index.d.ts +2 -0
- package/timer/index.js +9 -4
- package/timer/style/index.css +1 -0
- package/timer/style/index.d.ts +1 -0
- package/timer/style/index.js +3 -0
- package/transition/Transition.d.ts +1 -0
- package/transition/Transition.js +46 -43
- package/transition/TransitionCSS.js +1 -1
- package/transition/TransitionGroup.js +1 -1
- package/transition/TransitionStyle.js +1 -1
- package/transition/constants.js +1 -1
- package/transition/context.d.ts +2 -0
- package/transition/context.js +5 -5
- package/transition/index.d.ts +3 -1
- package/transition/index.js +8 -6
- package/transition/style/index.css +1 -0
- package/transition/style/index.d.ts +1 -0
- package/transition/style/index.js +3 -0
- package/transition/utils.js +1 -1
- package/typewriter/Typewriter.js +35 -37
- package/typewriter/constants.d.ts +0 -0
- package/typewriter/constants.js +2 -0
- package/typewriter/context.d.ts +3 -0
- package/typewriter/context.js +10 -0
- package/typewriter/index.d.ts +2 -0
- package/typewriter/index.js +9 -4
- package/typewriter/style/index.css +1 -0
- package/typewriter/style/index.d.ts +1 -0
- package/typewriter/style/index.js +3 -0
- package/utils/callOrReturn.js +1 -1
- package/utils/callbackOriginRef.js +1 -1
- package/utils/caseName.js +1 -1
- package/utils/className.js +1 -1
- package/utils/{constant.d.ts → constants.d.ts} +1 -1
- package/utils/{constant.js → constants.js} +3 -3
- package/utils/copy.js +1 -1
- package/utils/css.js +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/document.d.ts +1 -0
- package/utils/document.js +4 -0
- package/utils/dom.js +1 -1
- package/utils/emitter.js +1 -1
- package/utils/file.js +1 -1
- package/utils/fileRead.js +1 -1
- package/utils/fileToDataURL.js +1 -1
- package/utils/fillNBSP.js +1 -1
- package/utils/findRootElement.js +1 -1
- package/utils/findScrollParent.js +1 -1
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.js +1 -1
- package/utils/getScrollBarHeight.js +1 -1
- package/utils/getScrollBarSize.js +1 -1
- package/utils/getScrollBarWidth.js +1 -1
- package/utils/getStringLength.js +1 -1
- package/utils/include.js +1 -1
- package/utils/index.d.ts +2 -2
- package/utils/index.js +48 -48
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.js +2 -2
- package/utils/keyboardCode.d.ts +2 -2
- package/utils/keyboardCode.js +3 -3
- package/utils/lodash.js +1 -1
- package/utils/math.js +1 -1
- package/utils/mergeProps.d.ts +1 -1
- package/utils/mergeProps.js +6 -4
- package/utils/mergedToString.js +1 -1
- package/utils/mutationObserver.js +1 -1
- package/utils/names.d.ts +1 -0
- package/utils/names.js +2 -2
- 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/pinyin.js +1 -1
- package/utils/react19Adapter.js +1 -1
- package/utils/reactNode.js +1 -1
- package/utils/ref.js +1 -1
- package/utils/resizeObserver.js +2 -2
- package/utils/saveAs.js +1 -1
- package/utils/screenfull.js +1 -1
- package/utils/scrollIntoViewIfNeeded.js +1 -1
- package/utils/setCreateRoot.js +1 -1
- package/utils/setDarkTheme.js +3 -3
- package/utils/setDir.js +3 -3
- package/utils/setPrimaryColor.js +3 -3
- package/utils/setTheme.js +3 -3
- package/utils/string.d.ts +1 -1
- package/utils/string.js +2 -2
- package/utils/style.js +1 -1
- package/utils/tinycolor.js +1 -1
- package/utils/toArray.js +1 -1
- package/utils/tree.js +1 -1
- package/utils/tunnel.js +1 -1
- package/utils/tween.js +1 -1
- package/utils/uuid.js +1 -1
- package/utils/validate.js +1 -1
- package/utils/warning.js +2 -2
- package/version/index.js +8 -8
- package/.vite/license.md +0 -3
- package/.vite/manifest.json +0 -2750
- package/icons/file/IconFile.js +0 -56
- package/utils/throttleByRequestAnimationFrame.d.ts +0 -6
- package/utils/throttleByRequestAnimationFrame.js +0 -18
- /package/icons/file/{IconFile.d.ts → File.d.ts} +0 -0
package/empty/Empty.js
CHANGED
|
@@ -1,41 +1,43 @@
|
|
|
1
|
-
/* 潘启宝 2026-06-17
|
|
1
|
+
/* 潘启宝 2026-06-25 17:54:51 星期四 山东省济南市 */
|
|
2
2
|
import { isString as e } from "../utils/is.js";
|
|
3
|
-
import t from "../
|
|
4
|
-
import
|
|
5
|
-
import r from "../
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
3
|
+
import t from "../hooks/use-merge-props/index.js";
|
|
4
|
+
import n from "../utils/className.js";
|
|
5
|
+
import { EMPTY_COMPONENT_INFO as r } from "../utils/names.js";
|
|
6
|
+
import { PropsContext as i, defaultProps as a } from "./context.js";
|
|
7
|
+
import o from "../space/index.js";
|
|
8
|
+
import { forwardRef as s, memo as c, useContext as l, useImperativeHandle as u, useRef as d } from "react";
|
|
9
|
+
import { UI_COMMON_PREFIX as f } from "@unicom-cloud/utils/constants/ui";
|
|
10
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
11
|
+
import h from "@unicom-cloud/icons/IconUiEmpty";
|
|
10
12
|
//#region components/common/empty/Empty.tsx
|
|
11
|
-
function
|
|
12
|
-
let { style:
|
|
13
|
-
className:
|
|
14
|
-
alt:
|
|
15
|
-
src:
|
|
13
|
+
function g(r, s) {
|
|
14
|
+
let { style: c, className: g, description: _ = "无数据", icon: v, imgSrc: y, prefixCls: b, ...x } = t(r, { ...l(i) }, a), S = `${f}-empty`, C = b || S, w = e(_) ? _ : "empty", T = () => y ? /* @__PURE__ */ p("img", {
|
|
15
|
+
className: n(`${S}-img`, `${C}-img`),
|
|
16
|
+
alt: w,
|
|
17
|
+
src: y,
|
|
16
18
|
loading: "lazy"
|
|
17
|
-
}) :
|
|
18
|
-
className:
|
|
19
|
-
children:
|
|
20
|
-
}) : /* @__PURE__ */
|
|
21
|
-
return
|
|
22
|
-
return
|
|
23
|
-
} })), /* @__PURE__ */
|
|
24
|
-
ref:
|
|
25
|
-
className:
|
|
26
|
-
style:
|
|
19
|
+
}) : v ? /* @__PURE__ */ p("div", {
|
|
20
|
+
className: n(`${S}-icon`, `${C}-icon`),
|
|
21
|
+
children: v
|
|
22
|
+
}) : /* @__PURE__ */ p(h, { className: n(`${S}-icon`, `${C}-icon`) }), E = d(null);
|
|
23
|
+
return u(s, () => ({ getRootElement() {
|
|
24
|
+
return E.current;
|
|
25
|
+
} })), /* @__PURE__ */ m(o.Vertical, {
|
|
26
|
+
ref: E,
|
|
27
|
+
className: n(S, C, g),
|
|
28
|
+
style: c,
|
|
27
29
|
justifyContent: "center",
|
|
28
30
|
alignItems: "center",
|
|
29
31
|
gap: 5,
|
|
30
|
-
...
|
|
31
|
-
children: [
|
|
32
|
-
className:
|
|
33
|
-
children:
|
|
32
|
+
...x,
|
|
33
|
+
children: [T(), /* @__PURE__ */ p("div", {
|
|
34
|
+
className: n(`${S}-description`, `${C}-description`),
|
|
35
|
+
children: _
|
|
34
36
|
})]
|
|
35
37
|
});
|
|
36
38
|
}
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
+
var _ = c(s(g));
|
|
40
|
+
_.displayName = r.displayName;
|
|
39
41
|
//#endregion
|
|
40
|
-
export {
|
|
42
|
+
export { _ as Empty, _ as default };
|
|
41
43
|
/* 独立思考,明辨是非 */
|
|
File without changes
|
package/empty/context.js
ADDED
package/empty/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import './style';
|
|
1
2
|
declare const Empty: import("react").NamedExoticComponent<import("./interface").EmptyProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
3
|
+
PropsContext: import("react").Context<Partial<import("./interface").EmptyProps>>;
|
|
2
4
|
zh: string;
|
|
3
5
|
en: string;
|
|
4
6
|
displayName: string;
|
package/empty/index.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
/* 潘启宝 2026-06-17
|
|
1
|
+
/* 潘启宝 2026-06-25 17:54:51 星期四 山东省济南市 */
|
|
2
2
|
import { EMPTY_COMPONENT_INFO as e } from "../utils/names.js";
|
|
3
|
-
import
|
|
3
|
+
import "./style/index.js";
|
|
4
|
+
import { PropsContext as t } from "./context.js";
|
|
5
|
+
import { Empty as n } from "./Empty.js";
|
|
4
6
|
//#region components/common/empty/index.ts
|
|
5
|
-
var
|
|
7
|
+
var r = Object.assign(n, {
|
|
8
|
+
...e,
|
|
9
|
+
PropsContext: t
|
|
10
|
+
});
|
|
6
11
|
//#endregion
|
|
7
|
-
export {
|
|
12
|
+
export { r as default };
|
|
8
13
|
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.pqbc-empty{width:100%}.pqbc-empty .pqbc-empty-description{line-height:1}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
package/flex/Flex.js
CHANGED
|
@@ -1,53 +1,50 @@
|
|
|
1
|
-
/* 潘启宝 2026-06-17
|
|
1
|
+
/* 潘启宝 2026-06-25 17:54:51 星期四 山东省济南市 */
|
|
2
2
|
import { isBoolean as e } from "../utils/is.js";
|
|
3
3
|
import t from "../hooks/use-merge-props/index.js";
|
|
4
4
|
import n from "../utils/className.js";
|
|
5
5
|
import { FLEX_COMPONENT_INFO as r, FLEX_VERTICAL_COMPONENT_INFO as i } from "../utils/names.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { PropsContext as a, defaultProps as o } from "./context.js";
|
|
7
|
+
import { processGap as s } from "./utils.js";
|
|
8
|
+
import { forwardRef as c, useContext as l, useImperativeHandle as u, useRef as d } from "react";
|
|
9
|
+
import { UI_COMMON_PREFIX as f } from "@unicom-cloud/utils/constants/ui";
|
|
10
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
10
11
|
//#region components/common/flex/Flex.tsx
|
|
11
|
-
|
|
12
|
-
component: "div",
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let o = t(r, d, {}), { className: f, style: p, gap: m, children: h, direction: g, justify: _, justifyContent: v, align: y, alignItems: b, component: x = "div", wrap: S, rtl: C, inline: w, ...T } = o, E = v ?? _, D = b ?? y, O = `${l}-flex`, k = { display: w ? "inline-flex" : "flex" };
|
|
17
|
-
if ("wrap" in o) {
|
|
18
|
-
let t = S;
|
|
19
|
-
t = e(t) ? t ? "wrap" : "nowrap" : S, k.flexWrap = t;
|
|
12
|
+
function m(r, i) {
|
|
13
|
+
let c = t(r, { ...l(a) }, o), { className: m, style: h, gap: g, children: _, direction: v, justify: y, justifyContent: b, align: x, alignItems: S, component: C = "div", wrap: w, rtl: T, inline: E, ...D } = c, O = b ?? y, k = S ?? x, A = `${f}-flex`, j = { display: E ? "inline-flex" : "flex" };
|
|
14
|
+
if ("wrap" in c) {
|
|
15
|
+
let t = w;
|
|
16
|
+
t = e(t) ? t ? "wrap" : "nowrap" : w, j.flexWrap = t;
|
|
20
17
|
}
|
|
21
|
-
|
|
22
|
-
let
|
|
23
|
-
return
|
|
24
|
-
return
|
|
25
|
-
} })), /* @__PURE__ */
|
|
26
|
-
ref:
|
|
18
|
+
k && (j.alignItems = k), O && (j.justifyContent = O), v && (j.flexDirection = v);
|
|
19
|
+
let M = d(null);
|
|
20
|
+
return u(i, () => ({ getRootElement() {
|
|
21
|
+
return M.current;
|
|
22
|
+
} })), /* @__PURE__ */ p(C, {
|
|
23
|
+
ref: M,
|
|
27
24
|
style: {
|
|
28
|
-
...
|
|
29
|
-
...
|
|
30
|
-
...
|
|
25
|
+
...j,
|
|
26
|
+
...s(g),
|
|
27
|
+
...h
|
|
31
28
|
},
|
|
32
|
-
className: n(
|
|
33
|
-
[`${
|
|
34
|
-
[`${
|
|
35
|
-
}, !!
|
|
36
|
-
...
|
|
37
|
-
children:
|
|
29
|
+
className: n(A, {
|
|
30
|
+
[`${A}-rtl`]: T,
|
|
31
|
+
[`${A}-inline`]: E
|
|
32
|
+
}, !!v && `${A}-flex-direction-${v}`, !!O && `${A}-justify-content-${O}`, !!k && `${A}-align-items-${k}`, m),
|
|
33
|
+
...D,
|
|
34
|
+
children: _
|
|
38
35
|
});
|
|
39
36
|
}
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
var
|
|
37
|
+
var h = c(m);
|
|
38
|
+
h.displayName = r.displayName;
|
|
39
|
+
var g = c((e, t) => {
|
|
43
40
|
let { direction: n = "column", ...r } = e;
|
|
44
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ p(h, {
|
|
45
42
|
...r,
|
|
46
43
|
ref: t,
|
|
47
44
|
direction: n
|
|
48
45
|
});
|
|
49
46
|
});
|
|
50
|
-
|
|
47
|
+
g.displayName = i.displayName;
|
|
51
48
|
//#endregion
|
|
52
|
-
export {
|
|
49
|
+
export { g as FlexVertical, h as default };
|
|
53
50
|
/* 独立思考,明辨是非 */
|
|
File without changes
|
package/flex/context.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* 潘启宝 2026-06-25 17:54:51 星期四 山东省济南市 */
|
|
2
|
+
import { createContext as e } from "react";
|
|
3
|
+
//#region components/common/flex/context.ts
|
|
4
|
+
var t = {
|
|
5
|
+
component: "div",
|
|
6
|
+
gap: "small"
|
|
7
|
+
}, n = e({});
|
|
8
|
+
//#endregion
|
|
9
|
+
export { n as PropsContext, t as defaultProps };
|
|
10
|
+
/* 独立思考,明辨是非 */
|
package/flex/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import './style';
|
|
1
2
|
import { FlexVertical } from './Flex';
|
|
2
3
|
import { GAP_SIZE_MAP, processGap } from './utils';
|
|
3
4
|
declare const Flex: import("react").ForwardRefExoticComponent<import("./interface").FlexProps & import("react").RefAttributes<unknown>> & {
|
|
5
|
+
PropsContext: import("react").Context<Partial<import("./interface").FlexProps>>;
|
|
4
6
|
Vertical: import("react").ForwardRefExoticComponent<import("./interface").FlexVerticalProps & import("react").RefAttributes<HTMLElement>>;
|
|
5
7
|
zh: string;
|
|
6
8
|
en: string;
|
package/flex/index.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
/* 潘启宝 2026-06-17
|
|
1
|
+
/* 潘启宝 2026-06-25 17:54:51 星期四 山东省济南市 */
|
|
2
2
|
import { FLEX_COMPONENT_INFO as e } from "../utils/names.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import "./style/index.js";
|
|
4
|
+
import { PropsContext as t } from "./context.js";
|
|
5
|
+
import { GAP_SIZE_MAP as n, processGap as r } from "./utils.js";
|
|
6
|
+
import i, { FlexVertical as a } from "./Flex.js";
|
|
5
7
|
//#region components/common/flex/index.ts
|
|
6
|
-
var
|
|
8
|
+
var o = Object.assign(i, {
|
|
7
9
|
...e,
|
|
8
|
-
|
|
10
|
+
PropsContext: t,
|
|
11
|
+
Vertical: a
|
|
9
12
|
});
|
|
10
13
|
//#endregion
|
|
11
|
-
export {
|
|
14
|
+
export { n as FLEX_GAP_SIZE_MAP, a as FlexVertical, o as default, r as flexProcessGap };
|
|
12
15
|
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.pqbc-flex{box-sizing:border-box;margin:0;padding:0;display:flex}.pqbc-flex-inline{display:inline-flex}.pqbc-flex:empty{display:none}.pqbc-flex-rtl{direction:rtl}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
package/flex/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FlexProps } from './interface';
|
|
3
|
-
declare const GAP_SIZE_MAP: Record<string,
|
|
3
|
+
declare const GAP_SIZE_MAP: Record<string, string | number>;
|
|
4
4
|
declare function getGapFromSizeString(value: string | number | undefined): string;
|
|
5
5
|
/**
|
|
6
6
|
* 处理间距属性
|
package/flex/utils.js
CHANGED
package/higher-order/index.js
CHANGED
|
File without changes
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import './style';
|
|
1
2
|
import Component from './withSpeechSynthesis';
|
|
2
3
|
declare const withSpeechSynthesis: typeof Component & {
|
|
4
|
+
PropsContext: import("react").Context<Partial<import("./interface").SpeechSynthesisProps>>;
|
|
3
5
|
zh: string;
|
|
4
6
|
en: string;
|
|
5
7
|
displayName: string;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
/* 潘启宝 2026-06-17
|
|
1
|
+
/* 潘启宝 2026-06-25 17:54:51 星期四 山东省济南市 */
|
|
2
2
|
import { SPEECH_SYNTHESIS_COMPONENT_INFO as e } from "../../utils/names.js";
|
|
3
|
-
import
|
|
3
|
+
import "./style/index.js";
|
|
4
|
+
import { PropsContext as t } from "./context.js";
|
|
5
|
+
import n from "./withSpeechSynthesis.js";
|
|
4
6
|
//#region components/common/higher-order/with-speech-synthesis/index.ts
|
|
5
|
-
var
|
|
7
|
+
var r = Object.assign(n, {
|
|
8
|
+
...e,
|
|
9
|
+
PropsContext: t
|
|
10
|
+
});
|
|
6
11
|
//#endregion
|
|
7
|
-
export {
|
|
12
|
+
export { r as default };
|
|
8
13
|
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.pqbc-with-speech-synthesis-rtl{direction:rtl}
|
|
@@ -1,75 +1,79 @@
|
|
|
1
|
-
/* 潘启宝 2026-06-17
|
|
1
|
+
/* 潘启宝 2026-06-25 17:54:51 星期四 山东省济南市 */
|
|
2
2
|
import { SPEECH_SYNTHESIS_COMPONENT_INFO as e } from "../../utils/names.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
3
|
+
import { PropsContext as t } from "./context.js";
|
|
4
|
+
import { forwardRef as n, memo as r, useCallback as i, useContext as a, useEffect as o, useImperativeHandle as s, useMemo as c, useState as l } from "react";
|
|
5
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
6
|
+
import d from "@unicom-cloud/icons/IconUiMute";
|
|
7
|
+
import f from "@unicom-cloud/icons/IconUiPauseCircleFill";
|
|
8
|
+
import p from "@unicom-cloud/icons/IconUiPlayCircleFill";
|
|
9
|
+
import m from "@unicom-cloud/icons/IconUiSound";
|
|
9
10
|
//#region components/common/higher-order/with-speech-synthesis/withSpeechSynthesis.tsx
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
let { useButton:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
x();
|
|
17
|
-
|
|
11
|
+
function h(h) {
|
|
12
|
+
let g = n((e, n) => {
|
|
13
|
+
let { useButton: r = !0, buttonProps: g = {}, ..._ } = {
|
|
14
|
+
...a(t),
|
|
15
|
+
...e
|
|
16
|
+
}, [v, y] = l(!1), [b, x] = l(null), S = c(() => "speechSynthesis" in window && "SpeechSynthesisUtterance" in window, []), C = i(() => {
|
|
17
|
+
S && (window.speechSynthesis.cancel(), y(!1), x(null));
|
|
18
|
+
}, [S]), w = i(() => {
|
|
19
|
+
if (!S) return;
|
|
20
|
+
C();
|
|
21
|
+
let e = _.getText?.() ?? _.text;
|
|
18
22
|
if (!e) return;
|
|
19
23
|
let t = new SpeechSynthesisUtterance(e);
|
|
20
|
-
|
|
24
|
+
x(t);
|
|
21
25
|
let n = () => {
|
|
22
|
-
|
|
26
|
+
y(!1), x(null);
|
|
23
27
|
};
|
|
24
|
-
t.onstart = () =>
|
|
28
|
+
t.onstart = () => y(!0), t.onend = n, t.onerror = n, t.onpause = () => y(!1), t.onresume = () => y(!0);
|
|
25
29
|
try {
|
|
26
30
|
window.speechSynthesis.speak(t);
|
|
27
31
|
} catch (e) {
|
|
28
32
|
console.error("Speech synthesis failed:", e), n();
|
|
29
33
|
}
|
|
30
34
|
}, [
|
|
31
|
-
x,
|
|
32
|
-
b,
|
|
33
|
-
h.getText,
|
|
34
|
-
h.text
|
|
35
|
-
]), C = r(() => {
|
|
36
|
-
b && v && window.speechSynthesis.pause();
|
|
37
|
-
}, [b, v]), w = r(() => {
|
|
38
|
-
b && v && window.speechSynthesis.resume();
|
|
39
|
-
}, [b, v]), T = r((e) => {
|
|
40
|
-
e.preventDefault(), e.stopPropagation(), g ? C() : S(), m.onClick?.(e);
|
|
41
|
-
}, [
|
|
42
|
-
g,
|
|
43
35
|
C,
|
|
44
36
|
S,
|
|
45
|
-
|
|
37
|
+
_.getText,
|
|
38
|
+
_.text
|
|
39
|
+
]), T = i(() => {
|
|
40
|
+
S && b && window.speechSynthesis.pause();
|
|
41
|
+
}, [S, b]), E = i(() => {
|
|
42
|
+
S && b && window.speechSynthesis.resume();
|
|
43
|
+
}, [S, b]), D = i((e) => {
|
|
44
|
+
e.preventDefault(), e.stopPropagation(), v ? T() : w(), g.onClick?.(e);
|
|
45
|
+
}, [
|
|
46
|
+
v,
|
|
47
|
+
T,
|
|
48
|
+
w,
|
|
49
|
+
g.onClick
|
|
46
50
|
]);
|
|
47
|
-
if (
|
|
48
|
-
cancel:
|
|
49
|
-
speak:
|
|
50
|
-
pause:
|
|
51
|
-
resume:
|
|
52
|
-
})), !
|
|
53
|
-
if (
|
|
54
|
-
let { label: e, text: t, children: n, ...r } =
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
...
|
|
51
|
+
if (o(() => C, [C]), s(n, () => ({
|
|
52
|
+
cancel: C,
|
|
53
|
+
speak: w,
|
|
54
|
+
pause: T,
|
|
55
|
+
resume: E
|
|
56
|
+
})), !S) return null;
|
|
57
|
+
if (r) {
|
|
58
|
+
let { label: e, text: t, children: n, ...r } = g;
|
|
59
|
+
return /* @__PURE__ */ u(h, {
|
|
60
|
+
..._,
|
|
57
61
|
type: "text",
|
|
58
62
|
size: "mini",
|
|
59
|
-
icon:
|
|
63
|
+
icon: u(v ? d : m, {}),
|
|
60
64
|
...r,
|
|
61
|
-
onClick:
|
|
65
|
+
onClick: D,
|
|
62
66
|
children: e || t || n
|
|
63
67
|
});
|
|
64
68
|
}
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
...
|
|
67
|
-
onClick:
|
|
69
|
+
return /* @__PURE__ */ u(v ? f : p, {
|
|
70
|
+
..._.iconProps,
|
|
71
|
+
onClick: D,
|
|
68
72
|
style: { cursor: "pointer" }
|
|
69
73
|
});
|
|
70
74
|
});
|
|
71
|
-
return
|
|
75
|
+
return g.displayName = `WithSpeechSynthesis.${h.displayName || h.name || e.displayName}`, r(g);
|
|
72
76
|
}
|
|
73
77
|
//#endregion
|
|
74
|
-
export {
|
|
78
|
+
export { h as default };
|
|
75
79
|
/* 独立思考,明辨是非 */
|
package/hooks/index.d.ts
CHANGED
|
@@ -102,5 +102,6 @@ export { default as useResizeObserver } from './use-resize-observer';
|
|
|
102
102
|
export { default as useResizeObservers } from './use-resize-observers';
|
|
103
103
|
export { default as useStateCallback } from './use-state-callback';
|
|
104
104
|
export { default as useStateWithPromise } from './use-state-with-promise';
|
|
105
|
+
export { default as useThrottleFnWithRAF } from './use-throttle-fn-with-raf';
|
|
105
106
|
export { default as useWatch } from './use-watch';
|
|
106
107
|
export { default as useWindowSize } from './use-window-size';
|
package/hooks/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-06-17
|
|
1
|
+
/* 潘启宝 2026-06-25 17:54:51 星期四 山东省济南市 */
|
|
2
2
|
import e from "./create-update-effect/index.js";
|
|
3
3
|
import t from "./use-async-effect/index.js";
|
|
4
4
|
import n from "./use-toggle/index.js";
|
|
@@ -104,7 +104,8 @@ import Je, { useRefs2 as Ye } from "./use-refs/index.js";
|
|
|
104
104
|
import Xe from "./use-resize-observer/index.js";
|
|
105
105
|
import Ze from "./use-resize-observers/index.js";
|
|
106
106
|
import Qe from "./use-state-with-promise/index.js";
|
|
107
|
-
import $e from "./use-
|
|
108
|
-
import et from "./use-
|
|
109
|
-
|
|
107
|
+
import $e from "./use-throttle-fn-with-raf/index.js";
|
|
108
|
+
import et from "./use-watch/index.js";
|
|
109
|
+
import tt from "./use-window-size/index.js";
|
|
110
|
+
export { B as clearCache, ue as configResponsive, e as createUpdateEffect, t as useAsyncEffect, r as useBoolean, o as useClickAway, s as useComputedState, d as useControllableValue, f as useCookieState, p as useCountDown, m as useCounter, h as useCreate, g as useCreation, v as useDebounce, b as useDebounceEffect, _ as useDebounceFn, x as useDeepCompareEffect, S as useDeepCompareLayoutEffect, w as useDocumentVisibility, E as useDrag, D as useDrop, Ne as useEffectEvent, O as useEvent, k as useEventEmitter, C as useEventListener, A as useEventTarget, j as useExternal, M as useFavicon, N as useFocusWithin, $ as useForceUpdate, P as useFullscreen, F as useGetState, I as useHistoryTravel, L as useHover, Pe as useId, z as useInViewport, H as useInfiniteScroll, R as useIntersectionObserver, Fe as useIntersectionObservers, U as useInterval, Ie as useIsFirstRender, W as useIsomorphicLayoutEffect, G as useKeyPress, Le as useKeyboardEvent, i as useLatest, Re as useListenWindowResize, K as useLocalStorageState, q as useLockFn, J as useLongPress, ze as useMedia, Y as useMemo, c as useMemoizedFn, Be as useMergeProps, X as useMobile, T as useMount, Q as useMouse, ee as useMove, te as useMutationObserver, Ve as useMutationObservers, ne as useNetwork, He as useOnlineStatus, Ue as useOverflowHidden, We as useOverrideRef, re as usePagination, Ge as usePasteImage, Ke as usePersistCallback, qe as usePrefersColorSchemeDark, l as usePrevious, ie as useRafInterval, Z as useRafState, ae as useRafTimeout, oe as useReactive, se as useRefLatest, Je as useRefs, Ye as useRefs2, V as useRequest, ce as useResetState, Xe as useResizeObserver, Ze as useResizeObservers, le as useResponsive, fe as useSafeState, pe as useScroll, me as useSelections, he as useSessionStorageState, _e as useSetState, ve as useSize, ge as useStateCallback, Qe as useStateWithPromise, ye as useSyncState, be as useTextSelection, xe as useTheme, Ce as useThrottle, we as useThrottleEffect, Se as useThrottleFn, $e as useThrottleFnWithRAF, Te as useTimeout, Ee as useTitle, n as useToggle, De as useTrackedEffect, a as useUnmount, de as useUnmountedRef, u as useUpdate, y as useUpdateEffect, Oe as useUpdateLayoutEffect, ke as useUrlState, Ae as useVirtualList, et as useWatch, je as useWebSocket, Me as useWhyDidYouUpdate, tt as useWindowSize };
|
|
110
111
|
/* 独立思考,明辨是非 */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-06-17
|
|
1
|
+
/* 潘启宝 2026-06-25 17:54:51 星期四 山东省济南市 */
|
|
2
2
|
import { isFunction as e, isString as t, isUndefined as n } from "../../utils/is.js";
|
|
3
3
|
import { object_exports as r } from "../../utils/object.js";
|
|
4
4
|
import i from "../use-memoized-fn/index.js";
|