@unicom-cloud/ui-common 0.1.22 → 0.1.24
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/.vite/manifest.json +159 -23
- package/border-beam/BorderBeam.d.ts +4 -0
- package/border-beam/BorderBeam.js +45 -0
- package/border-beam/Effect.d.ts +9 -0
- package/border-beam/Effect.js +23 -0
- package/border-beam/constants.d.ts +2 -0
- package/border-beam/constants.js +131 -0
- package/border-beam/hooks/useBorderSize.d.ts +7 -0
- package/border-beam/hooks/useBorderSize.js +36 -0
- package/border-beam/hooks/useChildDom.d.ts +8 -0
- package/border-beam/hooks/useChildDom.js +17 -0
- package/border-beam/index.d.ts +6 -0
- package/border-beam/index.js +9 -0
- package/border-beam/interface.d.ts +31 -0
- package/border-beam/utils.d.ts +9 -0
- package/border-beam/utils.js +22 -0
- package/development/Development.js +20 -19
- package/development/index.d.ts +3 -1
- package/development/index.js +5 -4
- package/empty/Empty.js +18 -17
- package/empty/index.d.ts +3 -1
- package/empty/index.js +5 -4
- package/flex/Flex.js +20 -19
- package/flex/index.d.ts +1 -0
- package/flex/index.js +9 -5
- package/flex/interface.d.ts +2 -2
- package/flex/utils.js +1 -1
- package/higher-order/index.js +1 -1
- package/higher-order/with-speech-synthesis/index.d.ts +3 -1
- package/higher-order/with-speech-synthesis/index.js +5 -4
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.d.ts +0 -3
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.js +22 -22
- 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.js +1 -1
- 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.d.ts +2 -0
- package/hooks/use-controllable-value/index.js +30 -15
- 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 +1 -1
- 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 +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 +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.js +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.js +1 -1
- package/hooks/use-move/index.js +8 -8
- package/hooks/use-mutation-observer/index.js +1 -1
- package/hooks/use-mutation-observers/index.js +1 -1
- package/hooks/use-network/index.js +16 -19
- package/hooks/use-online-status/index.js +1 -1
- package/hooks/use-overflow-hidden/index.js +1 -1
- package/hooks/use-override-ref/index.js +1 -1
- package/hooks/use-pagination/index.js +1 -1
- package/hooks/use-paste-image/index.d.ts +3 -1
- package/hooks/use-paste-image/index.js +16 -13
- 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 +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 +1 -1
- 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 +10 -10
- 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-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 +29 -29
- 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.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 +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/IconFile.js +16 -15
- package/icons/file/index.d.ts +3 -1
- package/icons/file/index.js +5 -4
- package/index.js +607 -598
- package/package.json +1 -1
- package/progress/Progress.js +1 -1
- package/progress/index.d.ts +2 -0
- package/progress/index.js +5 -4
- package/resize-observer/Collection.js +1 -1
- package/resize-observer/ResizeObserver.js +11 -10
- package/resize-observer/SingleObserver.js +1 -1
- package/resize-observer/index.d.ts +2 -0
- package/resize-observer/index.js +11 -5
- package/resize-observer/observerUtil.js +1 -1
- package/space/Space.js +19 -18
- package/space/index.d.ts +1 -0
- package/space/index.js +8 -4
- package/style.css +1 -1
- package/suspense-fallback-test/SuspenseFallbackTest.js +10 -9
- package/suspense-fallback-test/index.d.ts +3 -1
- package/suspense-fallback-test/index.js +5 -4
- package/test.js +1 -1
- package/timer/Timer.js +16 -15
- package/timer/index.d.ts +3 -1
- package/timer/index.js +5 -4
- package/transition/Transition.js +41 -39
- package/transition/TransitionCSS.js +28 -27
- package/transition/TransitionGroup.js +31 -30
- package/transition/TransitionStyle.js +23 -22
- package/transition/constants.js +1 -1
- package/transition/context.js +1 -1
- package/transition/index.d.ts +5 -2
- package/transition/index.js +11 -10
- package/transition/utils.js +1 -1
- 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.js +1 -1
- package/utils/copy.js +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/dom.d.ts +7 -2
- package/utils/dom.js +30 -17
- package/utils/emitter.js +1 -1
- package/utils/file.d.ts +1 -0
- package/utils/file.js +4 -0
- 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 -0
- package/utils/index.js +320 -310
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.d.ts +5 -2
- package/utils/is.js +27 -19
- package/utils/keyboardCode.js +1 -1
- package/utils/lodash.js +1 -1
- package/utils/math.js +1 -1
- package/utils/mergeProps.js +1 -1
- package/utils/mergedToString.js +1 -1
- package/utils/mutationObserver.js +1 -1
- package/utils/names.d.ts +207 -0
- package/utils/names.js +110 -0
- 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.d.ts +7 -0
- package/utils/reactNode.js +14 -0
- package/utils/ref.d.ts +2 -2
- package/utils/ref.js +1 -1
- package/utils/resizeObserver.js +1 -1
- 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 +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/throttleByRaf.js +1 -1
- package/utils/throttleByRaf2.js +1 -1
- package/utils/tinycolor.js +1 -1
- package/utils/toArray.js +1 -1
- package/utils/tree.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 +1 -1
- package/version/index.js +8 -8
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Merge the child ref with an internal ref and expose the resolved DOM node.
|
|
4
|
+
*
|
|
5
|
+
* @returns A tuple containing the renderable child node and the DOM node resolved from its ref.
|
|
6
|
+
*/
|
|
7
|
+
declare const useChildDom: (children: React.ReactNode) => [childNode: React.ReactNode, domNode: HTMLElement | SVGElement | null];
|
|
8
|
+
export default useChildDom;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-18 15:16:57 星期一 */
|
|
2
|
+
import { getNodeRef as e, supportRef as t, useComposeRef as n } from "../../utils/ref.js";
|
|
3
|
+
import { getDOM as r } from "../../utils/dom.js";
|
|
4
|
+
import "../../utils/index.js";
|
|
5
|
+
import { cloneElement as i } from "../../utils/reactNode.js";
|
|
6
|
+
import a from "react";
|
|
7
|
+
//#region components/common/border-beam/hooks/useChildDom.ts
|
|
8
|
+
var o = (o) => {
|
|
9
|
+
let [s, c] = a.useState(null), l = a.isValidElement(o) ? o : null, u = a.useCallback((e) => {
|
|
10
|
+
let t = r(e);
|
|
11
|
+
c((e) => e === t ? e : t);
|
|
12
|
+
}, []), d = n(l ? e(l) : null, u);
|
|
13
|
+
return !l || !t(l) ? [o, s] : [i(l, { ref: d }), s];
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { o as default };
|
|
17
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GRADIENT_PRESETS } from './constants';
|
|
2
|
+
declare const BorderBeam: import("react").ForwardRefExoticComponent<import("./interface").BorderBeamProps & import("react").RefAttributes<unknown>> & {
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
export { GRADIENT_PRESETS as BORDER_BEAM_GRADIENT_PRESETS };
|
|
6
|
+
export default BorderBeam;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-18 15:16:57 星期一 */
|
|
2
|
+
import { BORDER_BEAM_COMPONENT_INFO as e } from "../utils/names.js";
|
|
3
|
+
import { GRADIENT_PRESETS as t } from "./constants.js";
|
|
4
|
+
import n from "./BorderBeam.js";
|
|
5
|
+
//#region components/common/border-beam/index.ts
|
|
6
|
+
var r = Object.assign(n, { id: e.id });
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as BORDER_BEAM_GRADIENT_PRESETS, r as default };
|
|
9
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type BorderBeamGradientItem = {
|
|
3
|
+
color: string;
|
|
4
|
+
percent: number;
|
|
5
|
+
};
|
|
6
|
+
export type BorderBeamGradient = BorderBeamGradientItem[];
|
|
7
|
+
export type BorderBeamColor = string | BorderBeamGradient;
|
|
8
|
+
/**
|
|
9
|
+
* @title BorderBeam 边框流光
|
|
10
|
+
* @description 为容器边框提供持续流动的装饰性高亮效果。
|
|
11
|
+
*/
|
|
12
|
+
export interface BorderBeamProps {
|
|
13
|
+
prefixCls?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
color?: BorderBeamColor;
|
|
18
|
+
gradientType?: 'ocean' | 'sunset' | 'aurora' | 'forest' | 'ember' | 'nebula';
|
|
19
|
+
outset?: number | string;
|
|
20
|
+
}
|
|
21
|
+
export interface Preset {
|
|
22
|
+
key: BorderBeamProps['gradientType'];
|
|
23
|
+
name: string;
|
|
24
|
+
usage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
color: Array<{
|
|
27
|
+
color: string;
|
|
28
|
+
percent: number;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type BorderBeamGradientItem = {
|
|
2
|
+
color: string;
|
|
3
|
+
percent: number;
|
|
4
|
+
};
|
|
5
|
+
export type BorderBeamGradient = BorderBeamGradientItem[];
|
|
6
|
+
export type BorderBeamColor = string | BorderBeamGradient;
|
|
7
|
+
export declare const MAX_BEAM_COLOR_STOP_PERCENT = 70;
|
|
8
|
+
export declare const getBorderBeamGradient: (value?: BorderBeamColor) => string | undefined;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-18 15:16:57 星期一 */
|
|
2
|
+
import { isString as e } from "../utils/is.js";
|
|
3
|
+
//#region components/common/border-beam/utils.ts
|
|
4
|
+
var t = 70, n = (...e) => `linear-gradient(to left, ${e.join(", ")}, transparent)`, r = (t) => e(t) ? [{
|
|
5
|
+
color: t,
|
|
6
|
+
percent: 0
|
|
7
|
+
}] : t ?? [], i = (e) => {
|
|
8
|
+
let t = e[e.length - 1];
|
|
9
|
+
return !t || t.percent === 100 ? e : [...e, {
|
|
10
|
+
...t,
|
|
11
|
+
percent: 100
|
|
12
|
+
}];
|
|
13
|
+
}, a = (e) => Number((Math.min(Math.max(e, 0), 100) / 100 * 70).toFixed(2)), o = (e) => i(e).map((e) => ({
|
|
14
|
+
...e,
|
|
15
|
+
percent: a(e.percent)
|
|
16
|
+
})), s = (e) => {
|
|
17
|
+
let t = o(r(e));
|
|
18
|
+
return t.length ? n(...t.map((e) => `${e.color} ${e.percent}%`)) : void 0;
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { t as MAX_BEAM_COLOR_STOP_PERCENT, s as getBorderBeamGradient };
|
|
22
|
+
/* 独立思考,明辨是非 */
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import a from "@unicom-cloud/utils/
|
|
5
|
-
import
|
|
6
|
-
import c from "
|
|
1
|
+
/* 潘启宝 2026-05-18 15:16:57 星期一 */
|
|
2
|
+
import { DEVELOPMENT_COMPONENT_INFO as e } from "../utils/names.js";
|
|
3
|
+
import { forwardRef as t, useImperativeHandle as n, useMemo as r, useRef as i } from "react";
|
|
4
|
+
import { UI_COMMON_PREFIX as a } from "@unicom-cloud/utils/constant/ui";
|
|
5
|
+
import o from "@unicom-cloud/utils/class-name";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import l from "@unicom-cloud/icons/IconFluentHourglassNotDone";
|
|
7
8
|
//#region components/common/development/Development.tsx
|
|
8
|
-
function
|
|
9
|
-
let { url: u, imgClassName: d, icon: f, iconClassName: p, tip: m, label: h = "等待开发", labelClassName: g, style: _, className: v } = e, y = `${
|
|
10
|
-
className:
|
|
9
|
+
function u(e, t) {
|
|
10
|
+
let { url: u, imgClassName: d, icon: f, iconClassName: p, tip: m, label: h = "等待开发", labelClassName: g, style: _, className: v } = e, y = `${a}-development`, b = r(() => u ? /* @__PURE__ */ s("img", {
|
|
11
|
+
className: o(`${y}-img`, d),
|
|
11
12
|
src: u,
|
|
12
13
|
alt: "开发预览图"
|
|
13
|
-
}) : f ?? /* @__PURE__ */
|
|
14
|
+
}) : f ?? /* @__PURE__ */ s(l, { className: o(`${y}-icon`, p) }), [
|
|
14
15
|
u,
|
|
15
16
|
y,
|
|
16
17
|
d,
|
|
17
18
|
f,
|
|
18
19
|
p
|
|
19
|
-
]), x = m ?? h, S =
|
|
20
|
-
return t
|
|
20
|
+
]), x = m ?? h, S = i(null);
|
|
21
|
+
return n(t, () => ({ getRootElement() {
|
|
21
22
|
return S.current;
|
|
22
|
-
} })), /* @__PURE__ */
|
|
23
|
+
} })), /* @__PURE__ */ c("div", {
|
|
23
24
|
ref: S,
|
|
24
25
|
style: { ..._ },
|
|
25
|
-
className:
|
|
26
|
-
children: [b, /* @__PURE__ */
|
|
27
|
-
className:
|
|
26
|
+
className: o(y, v),
|
|
27
|
+
children: [b, /* @__PURE__ */ s("div", {
|
|
28
|
+
className: o(`${y}-label`, g),
|
|
28
29
|
children: x
|
|
29
30
|
})]
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
|
-
var
|
|
33
|
-
|
|
33
|
+
var d = t(u);
|
|
34
|
+
d.displayName = e.displayName;
|
|
34
35
|
//#endregion
|
|
35
|
-
export {
|
|
36
|
+
export { d as default };
|
|
36
37
|
/* 独立思考,明辨是非 */
|
package/development/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
declare const Development: import("react").ForwardRefExoticComponent<import("./interface").DevelopmentProps & import("react").RefAttributes<HTMLDivElement
|
|
1
|
+
declare const Development: import("react").ForwardRefExoticComponent<import("./interface").DevelopmentProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
2
|
+
id: string;
|
|
3
|
+
};
|
|
2
4
|
export default Development;
|
|
3
5
|
export type { DevelopmentProps } from './interface';
|
package/development/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import e from "
|
|
1
|
+
/* 潘启宝 2026-05-18 15:16:57 星期一 */
|
|
2
|
+
import { DEVELOPMENT_COMPONENT_INFO as e } from "../utils/names.js";
|
|
3
|
+
import t from "./Development.js";
|
|
3
4
|
//#region components/common/development/index.ts
|
|
4
|
-
var
|
|
5
|
+
var n = Object.assign(t, { id: e.id });
|
|
5
6
|
//#endregion
|
|
6
|
-
export {
|
|
7
|
+
export { n as default };
|
|
7
8
|
/* 独立思考,明辨是非 */
|
package/empty/Empty.js
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
1
|
+
/* 潘启宝 2026-05-18 15:16:57 星期一 */
|
|
2
2
|
import { isString as e } from "../utils/is.js";
|
|
3
3
|
import t from "../utils/className.js";
|
|
4
|
-
import n from "../
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import u from "
|
|
4
|
+
import { EMPTY_COMPONENT_INFO as n } from "../utils/names.js";
|
|
5
|
+
import r from "../space/index.js";
|
|
6
|
+
import { forwardRef as i, memo as a, useImperativeHandle as o, useRef as s } from "react";
|
|
7
|
+
import { UI_COMMON_PREFIX as c } from "@unicom-cloud/utils/constant/ui";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
import d from "@unicom-cloud/icons/IconUiEmpty";
|
|
9
10
|
//#region components/common/empty/Empty.tsx
|
|
10
|
-
function
|
|
11
|
-
let { style:
|
|
11
|
+
function f(n, i) {
|
|
12
|
+
let { style: a, className: f, description: p = "无数据", icon: m, imgSrc: h, prefixCls: g, ..._ } = n, v = `${c}-empty`, y = g || v, b = e(p) ? p : "empty", x = () => h ? /* @__PURE__ */ l("img", {
|
|
12
13
|
className: t(`${v}-img`, `${y}-img`),
|
|
13
14
|
alt: b,
|
|
14
15
|
src: h,
|
|
15
16
|
loading: "lazy"
|
|
16
|
-
}) : m ? /* @__PURE__ */
|
|
17
|
+
}) : m ? /* @__PURE__ */ l("div", {
|
|
17
18
|
className: t(`${v}-icon`, `${y}-icon`),
|
|
18
19
|
children: m
|
|
19
|
-
}) : /* @__PURE__ */
|
|
20
|
-
return
|
|
20
|
+
}) : /* @__PURE__ */ l(d, { className: t(`${v}-icon`, `${y}-icon`) }), S = s(null);
|
|
21
|
+
return o(i, () => ({ getRootElement() {
|
|
21
22
|
return S.current;
|
|
22
|
-
} })), /* @__PURE__ */
|
|
23
|
+
} })), /* @__PURE__ */ u(r.Vertical, {
|
|
23
24
|
ref: S,
|
|
24
25
|
className: t(v, y, f),
|
|
25
|
-
style:
|
|
26
|
+
style: a,
|
|
26
27
|
justifyContent: "center",
|
|
27
28
|
alignItems: "center",
|
|
28
29
|
gap: 5,
|
|
29
30
|
..._,
|
|
30
|
-
children: [x(), /* @__PURE__ */
|
|
31
|
+
children: [x(), /* @__PURE__ */ l("div", {
|
|
31
32
|
className: t(`${v}-description`, `${y}-description`),
|
|
32
33
|
children: p
|
|
33
34
|
})]
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
|
-
var
|
|
37
|
-
|
|
37
|
+
var p = a(i(f));
|
|
38
|
+
p.displayName = n.displayName;
|
|
38
39
|
//#endregion
|
|
39
|
-
export {
|
|
40
|
+
export { p as Empty, p as default };
|
|
40
41
|
/* 独立思考,明辨是非 */
|
package/empty/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
declare const Empty: import("react").NamedExoticComponent<import("./interface").EmptyProps & import("react").RefAttributes<HTMLDivElement
|
|
1
|
+
declare const Empty: import("react").NamedExoticComponent<import("./interface").EmptyProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
2
|
+
id: string;
|
|
3
|
+
};
|
|
2
4
|
export default Empty;
|
|
3
5
|
export type { EmptyProps } from './interface';
|
package/empty/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import {
|
|
1
|
+
/* 潘启宝 2026-05-18 15:16:57 星期一 */
|
|
2
|
+
import { EMPTY_COMPONENT_INFO as e } from "../utils/names.js";
|
|
3
|
+
import { Empty as t } from "./Empty.js";
|
|
3
4
|
//#region components/common/empty/index.ts
|
|
4
|
-
var
|
|
5
|
+
var n = Object.assign(t, { id: e.id });
|
|
5
6
|
//#endregion
|
|
6
|
-
export {
|
|
7
|
+
export { n as default };
|
|
7
8
|
/* 独立思考,明辨是非 */
|
package/flex/Flex.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
1
|
+
/* 潘启宝 2026-05-18 15:16:57 星期一 */
|
|
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
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { FLEX_COMPONENT_INFO as r, FLEX_VERTICAL_COMPONENT_INFO as i } from "../utils/names.js";
|
|
6
|
+
import { processGap as a } from "./utils.js";
|
|
7
|
+
import { forwardRef as o, useImperativeHandle as s, useRef as c } from "react";
|
|
8
|
+
import { UI_COMMON_PREFIX as l } from "@unicom-cloud/utils/constant/ui";
|
|
9
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
9
10
|
//#region components/common/flex/Flex.tsx
|
|
10
|
-
var
|
|
11
|
+
var d = {
|
|
11
12
|
component: "div",
|
|
12
13
|
gap: "small"
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
-
let
|
|
16
|
-
if ("wrap" in
|
|
15
|
+
function f(r, i) {
|
|
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) {
|
|
17
18
|
let t = S;
|
|
18
19
|
t = e(t) ? t ? "wrap" : "nowrap" : S, k.flexWrap = t;
|
|
19
20
|
}
|
|
20
21
|
D && (k.alignItems = D), E && (k.justifyContent = E), g && (k.flexDirection = g);
|
|
21
|
-
let A =
|
|
22
|
-
return
|
|
22
|
+
let A = c(null);
|
|
23
|
+
return s(i, () => ({ getRootElement() {
|
|
23
24
|
return A.current;
|
|
24
|
-
} })), /* @__PURE__ */
|
|
25
|
+
} })), /* @__PURE__ */ u(x, {
|
|
25
26
|
ref: A,
|
|
26
27
|
style: {
|
|
27
28
|
...k,
|
|
28
|
-
...
|
|
29
|
+
...a(m),
|
|
29
30
|
...p
|
|
30
31
|
},
|
|
31
32
|
className: n(O, {
|
|
@@ -36,17 +37,17 @@ function u(i, u) {
|
|
|
36
37
|
children: h
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
var
|
|
40
|
+
var p = o(f);
|
|
41
|
+
p.displayName = r.displayName;
|
|
42
|
+
var m = o((e, t) => {
|
|
42
43
|
let { direction: n = "column", ...r } = e;
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ u(p, {
|
|
44
45
|
...r,
|
|
45
46
|
ref: t,
|
|
46
47
|
direction: n
|
|
47
48
|
});
|
|
48
49
|
});
|
|
49
|
-
|
|
50
|
+
m.displayName = i.displayName;
|
|
50
51
|
//#endregion
|
|
51
|
-
export {
|
|
52
|
+
export { m as FlexVertical, p as default };
|
|
52
53
|
/* 独立思考,明辨是非 */
|
package/flex/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FlexVertical } from './Flex';
|
|
2
2
|
import { GAP_SIZE_MAP, processGap } from './utils';
|
|
3
3
|
declare const Flex: import("react").ForwardRefExoticComponent<import("./interface").FlexProps & import("react").RefAttributes<unknown>> & {
|
|
4
|
+
id: string;
|
|
4
5
|
Vertical: import("react").ForwardRefExoticComponent<import("./interface").FlexVerticalProps & import("react").RefAttributes<HTMLElement>>;
|
|
5
6
|
};
|
|
6
7
|
export { GAP_SIZE_MAP as FLEX_GAP_SIZE_MAP, processGap as flexProcessGap, FlexVertical, };
|
package/flex/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
/* 潘启宝 2026-05-18 15:16:57 星期一 */
|
|
2
|
+
import { FLEX_COMPONENT_INFO as e } from "../utils/names.js";
|
|
3
|
+
import { GAP_SIZE_MAP as t, processGap as n } from "./utils.js";
|
|
4
|
+
import r, { FlexVertical as i } from "./Flex.js";
|
|
4
5
|
//#region components/common/flex/index.ts
|
|
5
|
-
var
|
|
6
|
+
var a = Object.assign(r, {
|
|
7
|
+
id: e.id,
|
|
8
|
+
Vertical: i
|
|
9
|
+
});
|
|
6
10
|
//#endregion
|
|
7
|
-
export {
|
|
11
|
+
export { t as FLEX_GAP_SIZE_MAP, i as FlexVertical, a as default, n as flexProcessGap };
|
|
8
12
|
/* 独立思考,明辨是非 */
|
package/flex/interface.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
2
|
export type GapProperty = 'gap' | 'rowGap' | 'columnGap';
|
|
3
3
|
export type SizeType = 'default' | 'mini' | 'small' | 'medium' | 'large' | '1x' | '2x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | 'x1' | 'x2' | 'x3' | 'x4' | 'x5' | 'x6' | 'x7' | 'x8' | 'x9';
|
|
4
4
|
export type GapType = SizeType | React.CSSProperties['gap'];
|
|
@@ -6,7 +6,7 @@ export type GapType = SizeType | React.CSSProperties['gap'];
|
|
|
6
6
|
* @title Flex
|
|
7
7
|
* @description Flex布局组件属性
|
|
8
8
|
*/
|
|
9
|
-
export interface FlexProps extends
|
|
9
|
+
export interface FlexProps extends HTMLAttributes<HTMLElement> {
|
|
10
10
|
/**
|
|
11
11
|
* @zh 元素的行为类似于行级元素并且它的内容根据弹性盒模型布局。
|
|
12
12
|
*/
|
package/flex/utils.js
CHANGED
package/higher-order/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import Component from './withSpeechSynthesis';
|
|
2
|
-
declare const withSpeechSynthesis: typeof Component
|
|
2
|
+
declare const withSpeechSynthesis: typeof Component & {
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
3
5
|
export default withSpeechSynthesis;
|
|
4
6
|
export type { SpeechSynthesisHandles, SpeechSynthesisProps } from './interface';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import e from "
|
|
1
|
+
/* 潘启宝 2026-05-18 15:16:57 星期一 */
|
|
2
|
+
import { SPEECH_SYNTHESIS_COMPONENT_INFO as e } from "../../utils/names.js";
|
|
3
|
+
import t from "./withSpeechSynthesis.js";
|
|
3
4
|
//#region components/common/higher-order/with-speech-synthesis/index.ts
|
|
4
|
-
var
|
|
5
|
+
var n = Object.assign(t, { id: e.id });
|
|
5
6
|
//#endregion
|
|
6
|
-
export {
|
|
7
|
+
export { n as default };
|
|
7
8
|
/* 独立思考,明辨是非 */
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SpeechSynthesisHandles, SpeechSynthesisProps } from './interface';
|
|
3
3
|
declare function withSpeechSynthesis<P extends object>(WrappedComponent: React.ComponentType<P>): React.NamedExoticComponent<React.PropsWithoutRef<SpeechSynthesisProps & P> & React.RefAttributes<SpeechSynthesisHandles>>;
|
|
4
|
-
declare namespace withSpeechSynthesis {
|
|
5
|
-
var displayName: string;
|
|
6
|
-
}
|
|
7
4
|
export default withSpeechSynthesis;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import c from "
|
|
5
|
-
import l from "@unicom-cloud/icons/
|
|
6
|
-
import u from "@unicom-cloud/icons/
|
|
7
|
-
import d from "@unicom-cloud/icons/
|
|
1
|
+
/* 潘启宝 2026-05-18 15:16:57 星期一 */
|
|
2
|
+
import { SPEECH_SYNTHESIS_COMPONENT_INFO as e } from "../../utils/names.js";
|
|
3
|
+
import { forwardRef as t, memo as n, useCallback as r, useEffect as i, useImperativeHandle as a, useMemo as o, useState as s } from "react";
|
|
4
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
5
|
+
import l from "@unicom-cloud/icons/IconUiMute";
|
|
6
|
+
import u from "@unicom-cloud/icons/IconUiPauseCircleFill";
|
|
7
|
+
import d from "@unicom-cloud/icons/IconUiPlayCircleFill";
|
|
8
|
+
import f from "@unicom-cloud/icons/IconUiSound";
|
|
8
9
|
//#region components/common/higher-order/with-speech-synthesis/withSpeechSynthesis.tsx
|
|
9
|
-
function
|
|
10
|
-
let
|
|
11
|
-
let { useButton:
|
|
10
|
+
function p(p) {
|
|
11
|
+
let m = t((e, t) => {
|
|
12
|
+
let { useButton: n = !0, buttonProps: m = {}, ...h } = e, [g, _] = s(!1), [v, y] = s(null), b = o(() => "speechSynthesis" in window && "SpeechSynthesisUtterance" in window, []), x = r(() => {
|
|
12
13
|
b && (window.speechSynthesis.cancel(), _(!1), y(null));
|
|
13
|
-
}, [b]), S =
|
|
14
|
+
}, [b]), S = r(() => {
|
|
14
15
|
if (!b) return;
|
|
15
16
|
x();
|
|
16
17
|
let e = h.getText?.() ?? h.text;
|
|
@@ -31,11 +32,11 @@ function f(f) {
|
|
|
31
32
|
b,
|
|
32
33
|
h.getText,
|
|
33
34
|
h.text
|
|
34
|
-
]), C =
|
|
35
|
+
]), C = r(() => {
|
|
35
36
|
b && v && window.speechSynthesis.pause();
|
|
36
|
-
}, [b, v]), w =
|
|
37
|
+
}, [b, v]), w = r(() => {
|
|
37
38
|
b && v && window.speechSynthesis.resume();
|
|
38
|
-
}, [b, v]), T =
|
|
39
|
+
}, [b, v]), T = r((e) => {
|
|
39
40
|
e.preventDefault(), e.stopPropagation(), g ? C() : S(), m.onClick?.(e);
|
|
40
41
|
}, [
|
|
41
42
|
g,
|
|
@@ -43,33 +44,32 @@ function f(f) {
|
|
|
43
44
|
S,
|
|
44
45
|
m.onClick
|
|
45
46
|
]);
|
|
46
|
-
if (
|
|
47
|
+
if (i(() => x, [x]), a(t, () => ({
|
|
47
48
|
cancel: x,
|
|
48
49
|
speak: S,
|
|
49
50
|
pause: C,
|
|
50
51
|
resume: w
|
|
51
52
|
})), !b) return null;
|
|
52
|
-
if (
|
|
53
|
+
if (n) {
|
|
53
54
|
let { label: e, text: t, children: n, ...r } = m;
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ c(p, {
|
|
55
56
|
...h,
|
|
56
57
|
type: "text",
|
|
57
58
|
size: "mini",
|
|
58
|
-
icon:
|
|
59
|
+
icon: c(g ? l : f, {}),
|
|
59
60
|
...r,
|
|
60
61
|
onClick: T,
|
|
61
62
|
children: e || t || n
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ c(g ? u : d, {
|
|
65
66
|
...h.iconProps,
|
|
66
67
|
onClick: T,
|
|
67
68
|
style: { cursor: "pointer" }
|
|
68
69
|
});
|
|
69
70
|
});
|
|
70
|
-
return
|
|
71
|
+
return m.displayName = `WithSpeechSynthesis.${p.displayName || p.name || e.displayName}`, n(m);
|
|
71
72
|
}
|
|
72
|
-
f.displayName = "withSpeechSynthesis";
|
|
73
73
|
//#endregion
|
|
74
|
-
export {
|
|
74
|
+
export { p as default };
|
|
75
75
|
/* 独立思考,明辨是非 */
|
package/hooks/index.js
CHANGED
|
@@ -2,7 +2,9 @@ import type { SetStateAction } from 'react';
|
|
|
2
2
|
export interface Options<T> {
|
|
3
3
|
defaultValue?: T;
|
|
4
4
|
defaultValuePropName?: string;
|
|
5
|
+
defaultValueParser?: (v: T) => T;
|
|
5
6
|
valuePropName?: string;
|
|
7
|
+
valueParser?: (v: T) => T;
|
|
6
8
|
triggerPropName?: string | false;
|
|
7
9
|
useStrict?: boolean;
|
|
8
10
|
}
|