@unicom-cloud/ui-common 0.1.23 → 0.1.25
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 +145 -22
- 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/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.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.d.ts +1 -0
- package/hooks/use-in-viewport/index.js +7 -6
- 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 +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.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 +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 +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-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.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 +604 -599
- 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/animation.less +4 -2
- 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 +5 -1
- package/utils/dom.js +22 -18
- 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 -1
- package/utils/index.js +316 -311
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.d.ts +2 -0
- package/utils/is.js +26 -20
- 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.d.ts +2 -1
- package/utils/pinyin.js +10 -3
- package/utils/react19Adapter.js +1 -1
- package/utils/reactNode.d.ts +7 -0
- package/utils/reactNode.js +14 -0
- 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 +7 -7
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unicom-cloud/ui-common","version":"0.1.
|
|
1
|
+
{"name":"@unicom-cloud/ui-common","version":"0.1.25","dependencies":{"@unicom-cloud/utils":"^0.1.0","@unicom-cloud/icons":"^0.1.0"},"peerDependencies":{"dayjs":"^1.11.19","lodash":"^4.18.1","react":"^18.3.1","react-dom":"^18.3.1","react-is":"^18.3.1"},"type":"module","types":"types/index.d.ts","main":"./index.js","bin":{"ui":"./test.js"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
|
package/progress/Progress.js
CHANGED
package/progress/index.d.ts
CHANGED
package/progress/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import e from "
|
|
1
|
+
/* 潘启宝 2026-05-21 17:02:03 星期四 山东省济南市 */
|
|
2
|
+
import { PROGRESS_COMPONENT_INFO as e } from "../utils/names.js";
|
|
3
|
+
import t from "./Progress.js";
|
|
3
4
|
//#region components/common/progress/index.js
|
|
4
|
-
var
|
|
5
|
+
var n = Object.assign(t, { id: e.id });
|
|
5
6
|
//#endregion
|
|
6
|
-
export {
|
|
7
|
+
export { n as default };
|
|
7
8
|
/* 独立思考,明辨是非 */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
1
|
+
/* 潘启宝 2026-05-21 17:02:03 星期四 山东省济南市 */
|
|
2
2
|
import { createContext as e, useCallback as t, useContext as n, useRef as r } from "react";
|
|
3
3
|
import { jsx as i } from "react/jsx-runtime";
|
|
4
4
|
//#region components/common/resize-observer/Collection.tsx
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
1
|
+
/* 潘启宝 2026-05-21 17:02:03 星期四 山东省济南市 */
|
|
2
2
|
import { isFunction as e } from "../utils/is.js";
|
|
3
3
|
import t from "../utils/toArray.js";
|
|
4
|
-
import {
|
|
5
|
-
import r from "./
|
|
6
|
-
import
|
|
4
|
+
import { RESIZE_OBSERVER_COMPONENT_INFO as n } from "../utils/names.js";
|
|
5
|
+
import { Collection as r } from "./Collection.js";
|
|
6
|
+
import i from "./SingleObserver.js";
|
|
7
|
+
import { createElement as a, forwardRef as o } from "react";
|
|
7
8
|
//#region components/common/resize-observer/ResizeObserver.tsx
|
|
8
|
-
function
|
|
9
|
+
function s(n, r) {
|
|
9
10
|
let { children: o } = n;
|
|
10
11
|
return (e(o) ? [o] : t(o)).map((e, t) => {
|
|
11
12
|
let o = e?.key || `observer-key-${t}`;
|
|
12
|
-
return /* @__PURE__ */ i
|
|
13
|
+
return /* @__PURE__ */ a(i, {
|
|
13
14
|
...n,
|
|
14
15
|
key: o,
|
|
15
|
-
ref: t === 0 ?
|
|
16
|
+
ref: t === 0 ? r : void 0
|
|
16
17
|
}, e);
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
|
-
var
|
|
20
|
-
|
|
20
|
+
var c = o(s);
|
|
21
|
+
c.displayName = n.displayName;
|
|
21
22
|
//#endregion
|
|
22
|
-
export {
|
|
23
|
+
export { r as Collection, c as default };
|
|
23
24
|
/* 独立思考,明辨是非 */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
1
|
+
/* 潘启宝 2026-05-21 17:02:03 星期四 山东省济南市 */
|
|
2
2
|
import { isFunction as e } from "../utils/is.js";
|
|
3
3
|
import { getReactElementRef as t, supportRef as n, useComposeRef as r } from "../utils/ref.js";
|
|
4
4
|
import i from "../utils/findRootElement.js";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Collection } from './ResizeObserver';
|
|
2
2
|
declare const ResizeObserver: import("react").ForwardRefExoticComponent<import("./interface").ResizeObserverProps & import("react").RefAttributes<HTMLElement>> & {
|
|
3
|
+
id: string;
|
|
3
4
|
Collection: typeof Collection;
|
|
5
|
+
SingleObserver: import("react").ForwardRefExoticComponent<import("./SingleObserver").SingleObserverProps & import("react").RefAttributes<HTMLElement>>;
|
|
4
6
|
};
|
|
5
7
|
export { Collection };
|
|
6
8
|
export default ResizeObserver;
|
package/resize-observer/index.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import {
|
|
3
|
-
import t from "./
|
|
1
|
+
/* 潘启宝 2026-05-21 17:02:03 星期四 山东省济南市 */
|
|
2
|
+
import { RESIZE_OBSERVER_COMPONENT_INFO as e } from "../utils/names.js";
|
|
3
|
+
import { Collection as t } from "./Collection.js";
|
|
4
|
+
import n from "./SingleObserver.js";
|
|
5
|
+
import r from "./ResizeObserver.js";
|
|
4
6
|
//#region components/common/resize-observer/index.ts
|
|
5
|
-
var
|
|
7
|
+
var i = Object.assign(r, {
|
|
8
|
+
id: e.id,
|
|
9
|
+
Collection: t,
|
|
10
|
+
SingleObserver: n
|
|
11
|
+
});
|
|
6
12
|
//#endregion
|
|
7
|
-
export {
|
|
13
|
+
export { t as Collection, i as default };
|
|
8
14
|
/* 独立思考,明辨是非 */
|
package/space/Space.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
1
|
+
/* 潘启宝 2026-05-21 17:02:03 星期四 山东省济南市 */
|
|
2
2
|
import { isPresent 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 r from "../utils/toArray.js";
|
|
6
|
-
import i from "../
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { SPACE_COMPONENT_INFO as i, SPACE_VERTICAL_COMPONENT_INFO as a } from "../utils/names.js";
|
|
7
|
+
import o from "../flex/index.js";
|
|
8
|
+
import { Fragment as s, forwardRef as c, useImperativeHandle as l, useRef as u } from "react";
|
|
9
|
+
import { UI_COMMON_PREFIX as d } from "@unicom-cloud/utils/constant/ui";
|
|
10
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
11
|
//#region components/common/space/Space.tsx
|
|
11
|
-
var
|
|
12
|
+
var m = {
|
|
12
13
|
gap: "small",
|
|
13
14
|
direction: "horizontal"
|
|
14
15
|
};
|
|
15
|
-
function
|
|
16
|
-
let { className:
|
|
16
|
+
function h(i, a) {
|
|
17
|
+
let { className: c, style: h, children: g, size: _, gap: v, direction: y, justifyContent: b, align: x, alignItems: S, wrap: C, separator: w, rtl: T, legacy: E, ...D } = t(i, m, {}), O = `${d}-space`, k = [
|
|
17
18
|
"horizontal",
|
|
18
19
|
"row-reverse",
|
|
19
20
|
"row"
|
|
@@ -36,10 +37,10 @@ function p(o, p) {
|
|
|
36
37
|
[`${O}-justify-content-${M}`]: M,
|
|
37
38
|
[`${O}-align-items-${N}`]: N,
|
|
38
39
|
[`${O}-rtl`]: T
|
|
39
|
-
}, C ? `${O}-wrap` : `${O}-no-wrap`,
|
|
40
|
-
return
|
|
40
|
+
}, C ? `${O}-wrap` : `${O}-no-wrap`, c), F = r(g), I = u(null);
|
|
41
|
+
return l(a, () => ({ getRootElement() {
|
|
41
42
|
return I.current.getRootElement();
|
|
42
|
-
} })), /* @__PURE__ */
|
|
43
|
+
} })), /* @__PURE__ */ f(o, {
|
|
43
44
|
ref: I,
|
|
44
45
|
style: h,
|
|
45
46
|
className: P,
|
|
@@ -53,24 +54,24 @@ function p(o, p) {
|
|
|
53
54
|
...D,
|
|
54
55
|
children: F.map((t, n) => {
|
|
55
56
|
let r = t?.key ?? n;
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ p(s, { children: [e(w) && n > 0 && /* @__PURE__ */ f("div", {
|
|
57
58
|
className: `${O}-item-separator`,
|
|
58
59
|
children: w
|
|
59
|
-
}), /* @__PURE__ */
|
|
60
|
+
}), /* @__PURE__ */ f("div", {
|
|
60
61
|
className: `${O}-item`,
|
|
61
62
|
children: t
|
|
62
63
|
})] }, r);
|
|
63
64
|
})
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
var
|
|
67
|
+
var g = c(h);
|
|
68
|
+
g.displayName = i.displayName;
|
|
69
|
+
var _ = c((e, t) => /* @__PURE__ */ f(g, {
|
|
69
70
|
...e,
|
|
70
71
|
ref: t,
|
|
71
72
|
direction: "vertical"
|
|
72
73
|
}));
|
|
73
|
-
|
|
74
|
+
_.displayName = a.displayName;
|
|
74
75
|
//#endregion
|
|
75
|
-
export {
|
|
76
|
+
export { _ as SpaceVertical, g as default };
|
|
76
77
|
/* 独立思考,明辨是非 */
|
package/space/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SpaceVertical } from './Space';
|
|
2
2
|
declare const Space: import("react").ForwardRefExoticComponent<import("./interface").SpaceProps & import("react").RefAttributes<unknown>> & {
|
|
3
|
+
id: string;
|
|
3
4
|
Vertical: import("react").ForwardRefExoticComponent<import("./interface").SpaceVerticalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
5
|
};
|
|
5
6
|
export { SpaceVertical };
|
package/space/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import
|
|
1
|
+
/* 潘启宝 2026-05-21 17:02:03 星期四 山东省济南市 */
|
|
2
|
+
import { SPACE_COMPONENT_INFO as e } from "../utils/names.js";
|
|
3
|
+
import t, { SpaceVertical as n } from "./Space.js";
|
|
3
4
|
//#region components/common/space/index.ts
|
|
4
|
-
var
|
|
5
|
+
var r = Object.assign(t, {
|
|
6
|
+
id: e.id,
|
|
7
|
+
Vertical: n
|
|
8
|
+
});
|
|
5
9
|
//#endregion
|
|
6
|
-
export {
|
|
10
|
+
export { n as SpaceVertical, r as default };
|
|
7
11
|
/* 独立思考,明辨是非 */
|
package/style/animation.less
CHANGED
|
@@ -16,11 +16,13 @@
|
|
|
16
16
|
transition: opacity 0.3s linear;
|
|
17
17
|
}
|
|
18
18
|
.@{ui-common-prefix}-animation-blink-appear,
|
|
19
|
-
.@{ui-common-prefix}-animation-blink-enter
|
|
19
|
+
.@{ui-common-prefix}-animation-blink-enter,
|
|
20
|
+
.@{ui-common-prefix}-animation-blink-exit-active {
|
|
20
21
|
opacity: 0;
|
|
21
22
|
}
|
|
22
23
|
.@{ui-common-prefix}-animation-blink-appear-active,
|
|
23
|
-
.@{ui-common-prefix}-animation-blink-enter-active
|
|
24
|
+
.@{ui-common-prefix}-animation-blink-enter-active,
|
|
25
|
+
.@{ui-common-prefix}-animation-blink-exit {
|
|
24
26
|
opacity: 1;
|
|
25
27
|
}
|
|
26
28
|
|
package/style.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:root{--pi:3.14159}@keyframes pqbc-keyframes-vibrate{0%{transform:translate(0)}20%{transform:translate(-2px,2px)}40%{transform:translate(-2px,-2px)}60%{transform:translate(2px,2px)}80%{transform:translate(2px,-2px)}to{transform:translate(0)}}@keyframes pqbc-keyframes-rotate-360deg{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes pqbc-keyframes-blink{0%{opacity:1}50%{opacity:0}to{opacity:1}}.pqbc-animation-rotate-360deg{animation:1s cubic-bezier(0,0,1,1) infinite pqbc-keyframes-rotate-360deg}.pqbc-animation-vibrate{animation:.3s linear infinite both pqbc-keyframes-vibrate}.pqbc-animation-blink-appear,.pqbc-animation-blink-appear-active,.pqbc-animation-blink-enter,.pqbc-animation-blink-enter-active,.pqbc-animation-blink-exit,.pqbc-animation-blink-exit-active{transition:opacity .3s linear}.pqbc-animation-blink-appear,.pqbc-animation-blink-enter{opacity:0}.pqbc-animation-blink-appear-active,.pqbc-animation-blink-enter-active{opacity:1}.pqbc-animation-blink-appear-done,.pqbc-animation-blink-enter-done{animation:.5s linear pqbc-keyframes-blink}.pqbc-display-none{display:none!important}.pqbc-visibility-hidden{visibility:hidden!important}.pqbc-overflow-hidden{overflow:hidden}.pqbc-cursor-pointer{cursor:pointer}.pqbc-filter-invert-100{filter:invert()}.pqbc-filter-grayscale-100{filter:grayscale()}.pqbc-isolation-isolate{isolation:isolate}.pqbc-direction-rtl{direction:rtl}.pqbc-line-height-1{line-height:1}.pqbc-text-overflow-ellipsis{text-overflow:ellipsis;white-space:nowrap;word-break:break-all;overflow:hidden}.pqbc-line-clamp-2,.pqbc-line-clamp-3,.pqbc-line-clamp-4,.pqbc-line-clamp-5{text-overflow:ellipsis;white-space:normal;-webkit-box-orient:vertical;display:-webkit-box;display:-moz-box;overflow:hidden}.pqbc-line-clamp-2{line-clamp:2;-webkit-line-clamp:2}.pqbc-line-clamp-3{line-clamp:3;-webkit-line-clamp:3}.pqbc-line-clamp-4{line-clamp:4;-webkit-line-clamp:4}.pqbc-line-clamp-5{line-clamp:5;-webkit-line-clamp:5}.pqb-theme-dark,.pqbm-theme-dark,.pqb-theme-dark *,.pqbm-theme-dark *{color-scheme:dark}[dir=rtl] *,.pqbc-with-speech-synthesis-rtl{direction:rtl}.pqbc-empty{width:100%}.pqbc-empty .pqbc-empty-description{line-height:1}.pqbc-development{flex-direction:column;justify-content:center;align-items:center;gap:10px;width:100%;height:100%;min-height:300px;display:flex}.pqbc-development-icon,.pqbc-development-img{width:50px;height:50px}.pqbc-development-label{--color-neutral:#868788;color:var(--pqbc-color-neutral-6,var(--pqb-color-neutral-6,var(--pqbm-color-neutral-6,--color-neutral)));font-size:20px}.pqbc-space-vertical{width:100%}.pqbc-space-rtl{direction:rtl}.pqbc-icons-file{position:relative}.pqbc-icons-file-svg{width:30px;height:30px}.pqbc-icons-file-svg-bg{--primary:26, 94, 255;fill:rgb(var(--pqbc-primary-6,var(--pqb-primary-6,var(--pqbm-primary-6,--primary))))}.pqbc-icons-file-svg-tr{fill:#fff;fill-opacity:.7}.pqbc-icons-file-svg-text{fill:#fff;text-align:center;font-size:66px;font-weight:bolder}.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}.pqbc-progress{pointer-events:none}.pqbc-progress-bar{--primary:26, 94, 255;background-color:rgb(var(--pqbc-primary-6,var(--pqb-primary-6,var(--pqbm-primary-6,--primary))));z-index:870227;width:100%;height:2px;position:fixed;inset-block-start:0;inset-inline-start:0}.pqbc-timer-rtl{direction:rtl}
|
|
1
|
+
:root{--pi:3.14159}@keyframes pqbc-keyframes-vibrate{0%{transform:translate(0)}20%{transform:translate(-2px,2px)}40%{transform:translate(-2px,-2px)}60%{transform:translate(2px,2px)}80%{transform:translate(2px,-2px)}to{transform:translate(0)}}@keyframes pqbc-keyframes-rotate-360deg{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes pqbc-keyframes-blink{0%{opacity:1}50%{opacity:0}to{opacity:1}}.pqbc-animation-rotate-360deg{animation:1s cubic-bezier(0,0,1,1) infinite pqbc-keyframes-rotate-360deg}.pqbc-animation-vibrate{animation:.3s linear infinite both pqbc-keyframes-vibrate}.pqbc-animation-blink-appear,.pqbc-animation-blink-appear-active,.pqbc-animation-blink-enter,.pqbc-animation-blink-enter-active,.pqbc-animation-blink-exit,.pqbc-animation-blink-exit-active{transition:opacity .3s linear}.pqbc-animation-blink-appear,.pqbc-animation-blink-enter,.pqbc-animation-blink-exit-active{opacity:0}.pqbc-animation-blink-appear-active,.pqbc-animation-blink-enter-active,.pqbc-animation-blink-exit{opacity:1}.pqbc-animation-blink-appear-done,.pqbc-animation-blink-enter-done{animation:.5s linear pqbc-keyframes-blink}.pqbc-display-none{display:none!important}.pqbc-visibility-hidden{visibility:hidden!important}.pqbc-overflow-hidden{overflow:hidden}.pqbc-cursor-pointer{cursor:pointer}.pqbc-filter-invert-100{filter:invert()}.pqbc-filter-grayscale-100{filter:grayscale()}.pqbc-isolation-isolate{isolation:isolate}.pqbc-direction-rtl{direction:rtl}.pqbc-line-height-1{line-height:1}.pqbc-text-overflow-ellipsis{text-overflow:ellipsis;white-space:nowrap;word-break:break-all;overflow:hidden}.pqbc-line-clamp-2,.pqbc-line-clamp-3,.pqbc-line-clamp-4,.pqbc-line-clamp-5{text-overflow:ellipsis;white-space:normal;-webkit-box-orient:vertical;display:-webkit-box;display:-moz-box;overflow:hidden}.pqbc-line-clamp-2{line-clamp:2;-webkit-line-clamp:2}.pqbc-line-clamp-3{line-clamp:3;-webkit-line-clamp:3}.pqbc-line-clamp-4{line-clamp:4;-webkit-line-clamp:4}.pqbc-line-clamp-5{line-clamp:5;-webkit-line-clamp:5}.pqb-theme-dark,.pqbm-theme-dark,.pqb-theme-dark *,.pqbm-theme-dark *{color-scheme:dark}[dir=rtl] *,.pqbc-with-speech-synthesis-rtl{direction:rtl}.pqbc-empty{width:100%}.pqbc-empty .pqbc-empty-description{line-height:1}.pqbc-development{flex-direction:column;justify-content:center;align-items:center;gap:10px;width:100%;height:100%;min-height:300px;display:flex}.pqbc-development-icon,.pqbc-development-img{width:50px;height:50px}.pqbc-development-label{--color-neutral:#868788;color:var(--pqbc-color-neutral-6,var(--pqb-color-neutral-6,var(--pqbm-color-neutral-6,--color-neutral)));font-size:20px}.pqbc-space-vertical{width:100%}.pqbc-space-rtl{direction:rtl}.pqbc-icons-file{position:relative}.pqbc-icons-file-svg{width:30px;height:30px}.pqbc-icons-file-svg-bg{--primary:26, 94, 255;fill:rgb(var(--pqbc-primary-6,var(--pqb-primary-6,var(--pqbm-primary-6,--primary))))}.pqbc-icons-file-svg-tr{fill:#fff;fill-opacity:.7}.pqbc-icons-file-svg-text{fill:#fff;text-align:center;font-size:66px;font-weight:bolder}.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}.pqbc-progress{pointer-events:none}.pqbc-progress-bar{--primary:26, 94, 255;background-color:rgb(var(--pqbc-primary-6,var(--pqb-primary-6,var(--pqbm-primary-6,--primary))));z-index:870227;width:100%;height:2px;position:fixed;inset-block-start:0;inset-inline-start:0}.pqbc-timer-rtl{direction:rtl}.pqbc-border-beam{--pqbc-border-beam-gradient:linear-gradient(to left, rgb(var(--pqbc-primary-5,var(--pqb-primary-5,--pqbm-primary-5))) 0%, rgb(var(--pqbc-cyan-5,var(--pqb-cyan-5,--pqbm-cyan-5))) 36.4%, rgb(var(--pqbc-lime-5,var(--pqb-lime-5,--pqbm-lime-5))) 70%, transparent);--pqbc-border-beam-inset-offset:-1px -1px -1px -1px;--pqbc-border-beam-border-radius:8px;box-sizing:border-box;inset:var(--pqbc-border-beam-inset-offset,0);border-radius:var(--pqbc-border-beam-border-radius,0);z-index:1;pointer-events:none;padding:1px;display:none;position:absolute;overflow:hidden}@supports (mask-composite:exclude) or (-webkit-mask-composite:exclude) or (-webkit-mask-composite:xor){.pqbc-border-beam{mask-image:linear-gradient(#fff 0 0),linear-gradient(#fff 0 0);mask-position:0 0,0 0;mask-size:auto,auto;mask-repeat:repeat,repeat;mask-clip:content-box,border-box;mask-origin:content-box,border-box;mask-composite:exclude;mask-mode:match-source,match-source}@supports (offset-path:rect(0 auto auto 0 round 1px)){.pqbc-border-beam{display:block}.pqbc-border-beam:before{content:"";aspect-ratio:1;opacity:.95;background-image:var(--pqbc-border-beam-gradient,linear-gradient(to left, rgb(var(--pqbc-primary-6,var(--pqb-primary-6,--pqbm-primary-6))) 0%, rgba(var(--pqbc-primary-6,var(--pqb-primary-6,--pqbm-primary-6)), .7) 70%, transparent));offset-anchor:90%50%;offset-distance:0%;offset-path:rect(0 auto auto 0 round 100px);offset-rotate:auto;will-change:offset-distance;width:100px;animation-name:pqbc-border-beam-move;animation-duration:6s;animation-timing-function:linear;animation-iteration-count:infinite;position:absolute;top:0;left:0}@media (prefers-reduced-motion:reduce){.pqbc-border-beam:before{transition:none;animation:none}}}}@media (prefers-reduced-motion:reduce){.pqbc-border-beam:before{display:none}}@keyframes pqbc-border-beam-move{0%{offset-distance:0%}to{offset-distance:100%}}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
/* 潘启宝 2026-05-21 17:02:03 星期四 山东省济南市 */
|
|
2
|
+
import { SUSPENSE_FALLBACK_TEST_COMPONENT_INFO as e } from "../utils/names.js";
|
|
3
|
+
import { forwardRef as t, lazy as n, useImperativeHandle as r, useMemo as i } from "react";
|
|
4
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
5
|
//#region components/common/suspense-fallback-test/SuspenseFallbackTest.tsx
|
|
5
|
-
function
|
|
6
|
-
let o =
|
|
7
|
-
return
|
|
6
|
+
function o(e, t) {
|
|
7
|
+
let o = i(() => n(() => new Promise(() => {})), []);
|
|
8
|
+
return r(t, () => ({})), /* @__PURE__ */ a(o, {});
|
|
8
9
|
}
|
|
9
|
-
var
|
|
10
|
-
|
|
10
|
+
var s = t(o);
|
|
11
|
+
s.displayName = e.displayName;
|
|
11
12
|
//#endregion
|
|
12
|
-
export {
|
|
13
|
+
export { s as default };
|
|
13
14
|
/* 独立思考,明辨是非 */
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
declare const SuspenseFallbackTest: import("react").ForwardRefExoticComponent<object & import("react").RefAttributes<unknown
|
|
1
|
+
declare const SuspenseFallbackTest: import("react").ForwardRefExoticComponent<object & import("react").RefAttributes<unknown>> & {
|
|
2
|
+
id: string;
|
|
3
|
+
};
|
|
2
4
|
export default SuspenseFallbackTest;
|
|
3
5
|
export type { SuspenseFallbackTestProps } from './interface';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import e from "
|
|
1
|
+
/* 潘启宝 2026-05-21 17:02:03 星期四 山东省济南市 */
|
|
2
|
+
import { SUSPENSE_FALLBACK_TEST_COMPONENT_INFO as e } from "../utils/names.js";
|
|
3
|
+
import t from "./SuspenseFallbackTest.js";
|
|
3
4
|
//#region components/common/suspense-fallback-test/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/test.js
CHANGED
package/timer/Timer.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
1
|
+
/* 潘启宝 2026-05-21 17:02:03 星期四 山东省济南市 */
|
|
2
2
|
import { isFunction as e } from "../utils/is.js";
|
|
3
3
|
import { DAYJS_DEFAULT_FORMAT_WITH_TIME as t } from "../utils/constant.js";
|
|
4
4
|
import n from "../utils/className.js";
|
|
5
|
+
import { TIMER_COMPONENT_INFO as r } from "../utils/names.js";
|
|
5
6
|
import "../utils/index.js";
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import
|
|
8
|
-
import { UI_COMMON_PREFIX as
|
|
9
|
-
import { jsx as
|
|
7
|
+
import { forwardRef as i, useEffect as a, useImperativeHandle as o, useRef as s, useState as c } from "react";
|
|
8
|
+
import l from "dayjs";
|
|
9
|
+
import { UI_COMMON_PREFIX as u } from "@unicom-cloud/utils/constant/ui";
|
|
10
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
10
11
|
//#region components/common/timer/Timer.tsx
|
|
11
|
-
function
|
|
12
|
-
let { style: f, className: p, format: m = `${t} dddd`, callback: h, ...g } = r, _ = `${
|
|
12
|
+
function f(r, i) {
|
|
13
|
+
let { style: f, className: p, format: m = `${t} dddd`, callback: h, ...g } = r, _ = `${u}-timer`, [v, y] = c({ time: b() });
|
|
13
14
|
function b() {
|
|
14
|
-
return
|
|
15
|
+
return l().format(m);
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
a(() => {
|
|
17
18
|
let t = n();
|
|
18
19
|
function n(r = b()) {
|
|
19
20
|
return e(h) && h(r), window.requestAnimationFrame(() => {
|
|
@@ -24,17 +25,17 @@ function d(r, d) {
|
|
|
24
25
|
window.cancelAnimationFrame(t);
|
|
25
26
|
};
|
|
26
27
|
}, []);
|
|
27
|
-
let x =
|
|
28
|
-
return
|
|
28
|
+
let x = s(null);
|
|
29
|
+
return o(i, () => ({ getRootElement() {
|
|
29
30
|
return x.current;
|
|
30
|
-
} })), /* @__PURE__ */
|
|
31
|
+
} })), /* @__PURE__ */ d("div", {
|
|
31
32
|
ref: x,
|
|
32
33
|
className: n(_, p),
|
|
33
34
|
children: v.time
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
|
-
var
|
|
37
|
-
|
|
37
|
+
var p = i(f);
|
|
38
|
+
p.displayName = r.displayName;
|
|
38
39
|
//#endregion
|
|
39
|
-
export {
|
|
40
|
+
export { p as default };
|
|
40
41
|
/* 独立思考,明辨是非 */
|
package/timer/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
declare const Timer: import("react").ForwardRefExoticComponent<import("./interface").TimerProps & import("react").RefAttributes<unknown
|
|
1
|
+
declare const Timer: import("react").ForwardRefExoticComponent<import("./interface").TimerProps & import("react").RefAttributes<unknown>> & {
|
|
2
|
+
id: string;
|
|
3
|
+
};
|
|
2
4
|
export default Timer;
|
|
3
5
|
export type { TimerProps } from './interface';
|
package/timer/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import e from "
|
|
1
|
+
/* 潘启宝 2026-05-21 17:02:03 星期四 山东省济南市 */
|
|
2
|
+
import { TIMER_COMPONENT_INFO as e } from "../utils/names.js";
|
|
3
|
+
import t from "./Timer.js";
|
|
3
4
|
//#region components/common/timer/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/transition/Transition.js
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
1
|
+
/* 潘启宝 2026-05-21 17:02:03 星期四 山东省济南市 */
|
|
2
2
|
import { isFunction as e, isNull as t, isUndefined as n } from "../utils/is.js";
|
|
3
3
|
import r from "../hooks/use-latest/index.js";
|
|
4
4
|
import i from "../hooks/use-create/index.js";
|
|
5
5
|
import a from "../hooks/use-update-effect/index.js";
|
|
6
|
+
import o from "../utils/findRootElement.js";
|
|
6
7
|
import { forceReflow as ee } from "../utils/dom.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
8
|
+
import s from "../hooks/use-set-state/index.js";
|
|
9
|
+
import c from "../hooks/use-update-layout-effect/index.js";
|
|
10
|
+
import { defaults as te } from "../utils/lodash.js";
|
|
11
|
+
import ne from "../hooks/use-is-first-render/index.js";
|
|
12
|
+
import { TRANSITION_COMPONENT_INFO as l } from "../utils/names.js";
|
|
12
13
|
import "../hooks/index.js";
|
|
13
|
-
import { TRANSITION_ADD_END_LISTENER_KEY as
|
|
14
|
-
import { TransitionContext as
|
|
15
|
-
import { isActivePhaseHandler as ue, isAppearPhaseHandler as de, isEnterPhaseHandler as fe, isExitDonePhaseHandler as pe, isExitPhaseHandler as
|
|
16
|
-
import { forwardRef as
|
|
17
|
-
import { jsx as
|
|
14
|
+
import { TRANSITION_ADD_END_LISTENER_KEY as u, TRANSITION_ALWAYS_MOUNTED_KEY as d, TRANSITION_DEFAULT_PROPS as f, TRANSITION_DURATION_KEY as re, TRANSITION_EVENT_MAP as p, TRANSITION_EVENT_NAME_KEY as ie, TRANSITION_MOUNT_ON_ENTER_KEY as ae, TRANSITION_NEXT_PHASE_KEY as oe, TRANSITION_PHASE_APPEAR as m, TRANSITION_PHASE_APPEAR_DONE as h, TRANSITION_PHASE_ENTER as g, TRANSITION_PHASE_ENTER_DONE as _, TRANSITION_PHASE_EXIT as v, TRANSITION_PHASE_EXIT_DONE as y, TRANSITION_UNMOUNT_ON_EXIT_KEY as se } from "./constants.js";
|
|
15
|
+
import { TransitionContext as ce, TransitionGroupContext as le } from "./context.js";
|
|
16
|
+
import { isActivePhaseHandler as ue, isAppearPhaseHandler as de, isEnterPhaseHandler as fe, isExitDonePhaseHandler as pe, isExitPhaseHandler as b, transitionNormalizeDurations as me } from "./utils.js";
|
|
17
|
+
import { forwardRef as x, memo as S, useContext as he, useDeferredValue as ge, useEffect as C, useImperativeHandle as w, useLayoutEffect as T, useRef as E, useTransition as D } from "react";
|
|
18
|
+
import { jsx as O } from "react/jsx-runtime";
|
|
18
19
|
//#region components/common/transition/Transition.tsx
|
|
19
|
-
var { setTimeout:
|
|
20
|
-
function
|
|
21
|
-
he(
|
|
22
|
-
let x =
|
|
23
|
-
i(() => {}),
|
|
24
|
-
let V =
|
|
20
|
+
var { setTimeout: k, clearTimeout: A, requestAnimationFrame: j, cancelAnimationFrame: M } = window, N = { ...f };
|
|
21
|
+
function P(l, f) {
|
|
22
|
+
he(le);
|
|
23
|
+
let x = te({}, l, N), S = "hasShown", P = "refElement", { children: F, in: I, [m]: L, [g]: _e, [v]: R, [re]: ve = 500, [d]: ye, [u]: be, [ae]: z, [se]: B, [P]: xe } = x;
|
|
24
|
+
i(() => {}), ne();
|
|
25
|
+
let V = E({ [S]: I }), H = V.current[S], U = ye;
|
|
25
26
|
"unmountOnExit" in x && !n(B) && (U = !B);
|
|
26
27
|
let W = "mountOnEnter" in x && !n(z);
|
|
27
28
|
W && (H || (U = !z));
|
|
28
|
-
let [G, Se, Ce] =
|
|
29
|
+
let [G, Se, Ce] = s(() => X(Y())), { phase: K, destroy: q } = G, J = ge(q, q);
|
|
29
30
|
r(K);
|
|
30
|
-
let [we, Te] =
|
|
31
|
+
let [we, Te] = D();
|
|
31
32
|
function Y() {
|
|
32
|
-
let e =
|
|
33
|
-
return
|
|
33
|
+
let e = y;
|
|
34
|
+
return I && (e = L ? m : h), e;
|
|
34
35
|
}
|
|
35
36
|
function X(e) {
|
|
36
37
|
return {
|
|
@@ -39,8 +40,8 @@ function M(u, b) {
|
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
42
|
function Z() {
|
|
42
|
-
let { [
|
|
43
|
-
return
|
|
43
|
+
let { [P]: e } = x;
|
|
44
|
+
return o(e);
|
|
44
45
|
}
|
|
45
46
|
function Ee(e) {
|
|
46
47
|
return U ? void 0 : pe(e);
|
|
@@ -54,47 +55,48 @@ function M(u, b) {
|
|
|
54
55
|
Se(X(t));
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
+
T(() => {
|
|
58
59
|
if (!(W && !z && !H)) {
|
|
59
|
-
let t =
|
|
60
|
+
let t = p[K]?.[ie], { [t]: n } = x;
|
|
60
61
|
e(n) && n(Z());
|
|
61
62
|
}
|
|
62
63
|
return () => {};
|
|
63
64
|
}, [K]), a(() => {
|
|
64
65
|
let { onAfterPhaseChange: t } = x;
|
|
65
66
|
return e(t) && t(K, Z()), () => {};
|
|
66
|
-
}, [K]),
|
|
67
|
-
let e, t =
|
|
68
|
-
return
|
|
69
|
-
}, [
|
|
70
|
-
let { [
|
|
67
|
+
}, [K]), c(() => {
|
|
68
|
+
let e, t = b(K);
|
|
69
|
+
return I ? (V.current[S] = !0, t && (e = _e ? g : _)) : t || (e = R ? v : y), Q(e || K), () => {};
|
|
70
|
+
}, [I]), C(() => {
|
|
71
|
+
let { [u]: n } = x, r = null, i = null, a = p[K]?.[oe];
|
|
71
72
|
if (a && K !== a) if (ue(K)) if (e(n)) n(K, (e = a) => {
|
|
72
73
|
Q(e || a);
|
|
73
74
|
}, Z());
|
|
74
75
|
else {
|
|
75
|
-
let e = me(ve), t = e[
|
|
76
|
-
t = de(K) ? e[
|
|
76
|
+
let e = me(ve), t = e[g];
|
|
77
|
+
t = de(K) ? e[m] : fe(K) ? e[g] : b(K) ? e[v] : e[g], r = k((e = a) => {
|
|
77
78
|
Q(e || a);
|
|
78
79
|
}, t, a);
|
|
79
80
|
}
|
|
80
|
-
else i =
|
|
81
|
+
else i = j(() => {
|
|
81
82
|
Q(a);
|
|
82
83
|
});
|
|
83
84
|
return () => {
|
|
84
|
-
t(r) ||
|
|
85
|
+
t(r) || A(r), t(i) || M(i);
|
|
85
86
|
};
|
|
86
|
-
}, [K]),
|
|
87
|
+
}, [K]), c(() => () => {}, []), T(() => () => {}, []), a(() => () => {}, []), C(() => () => {}, []), w(f, () => ({
|
|
87
88
|
getState: Ce,
|
|
88
89
|
getInitPhase: Y,
|
|
89
90
|
getRootElement: Z
|
|
90
91
|
}));
|
|
91
|
-
let $ =
|
|
92
|
-
return n(q) || (R ?
|
|
92
|
+
let $ = F;
|
|
93
|
+
return n(q) || (R ? I ? q && ($ = null) : J && ($ = null) : I || J && ($ = null)), e($) && ($ = $(x, G, K)), $ = /* @__PURE__ */ O(ce.Provider, {
|
|
93
94
|
value: { phase: K },
|
|
94
95
|
children: $
|
|
95
96
|
}), $;
|
|
96
97
|
}
|
|
97
|
-
var
|
|
98
|
+
var F = S(x(P));
|
|
99
|
+
F.displayName = l.displayName;
|
|
98
100
|
//#endregion
|
|
99
|
-
export {
|
|
101
|
+
export { F as Transition, F as default };
|
|
100
102
|
/* 独立思考,明辨是非 */
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
1
|
+
/* 潘启宝 2026-05-21 17:02:03 星期四 山东省济南市 */
|
|
2
2
|
import { isPlainObject as e, isString as t, isStringAndExist as n } from "../utils/is.js";
|
|
3
3
|
import r from "../utils/className.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { TRANSITION_CSS_COMPONENT_INFO as i } from "../utils/names.js";
|
|
5
|
+
import { TRANSITION_CSS_CLASS_NAMES_SUFFIX as a, TRANSITION_PHASE_APPEAR as o } from "./constants.js";
|
|
6
|
+
import { TransitionCSS_Context as s } from "./context.js";
|
|
7
|
+
import { isAppearPhaseHandler as c, transitionFallbackAppearToEnter as l } from "./utils.js";
|
|
8
|
+
import { Transition as u } from "./Transition.js";
|
|
9
|
+
import { cloneElement as d, isValidElement as f, memo as p } from "react";
|
|
10
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
10
11
|
//#region components/common/transition/TransitionCSS.tsx
|
|
11
|
-
function
|
|
12
|
-
let { children:
|
|
13
|
-
if (!
|
|
14
|
-
if (!
|
|
12
|
+
function h(i) {
|
|
13
|
+
let { children: u, classNames: p = "", phase: h, [o]: g } = i;
|
|
14
|
+
if (!f(u)) return null;
|
|
15
|
+
if (!p) return u;
|
|
15
16
|
let _ = "";
|
|
16
|
-
if (t(
|
|
17
|
-
let e =
|
|
18
|
-
n(e) && (_ = `${
|
|
19
|
-
} else if (e(
|
|
20
|
-
let e = { ...
|
|
21
|
-
g &&
|
|
17
|
+
if (t(p)) {
|
|
18
|
+
let e = a[h];
|
|
19
|
+
n(e) && (_ = `${p}-${e}`);
|
|
20
|
+
} else if (e(p)) {
|
|
21
|
+
let e = { ...p };
|
|
22
|
+
g && c(h) && Object.assign(e, l(e)), _ = e[h] ?? "";
|
|
22
23
|
}
|
|
23
|
-
if (!n(_)) return
|
|
24
|
-
let { className: v } =
|
|
25
|
-
return b = /* @__PURE__ */
|
|
24
|
+
if (!n(_)) return u;
|
|
25
|
+
let { className: v } = u.props, y = r(v, _), b = u;
|
|
26
|
+
return b = /* @__PURE__ */ m(s.Provider, {
|
|
26
27
|
value: { className: _ },
|
|
27
|
-
children:
|
|
28
|
+
children: d(b, { className: y })
|
|
28
29
|
}), b;
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function g(e) {
|
|
31
32
|
let { children: t, classNames: n = "", ...r } = e;
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ m(u, {
|
|
33
34
|
...r,
|
|
34
|
-
children: (e, r, i) => /* @__PURE__ */
|
|
35
|
+
children: (e, r, i) => /* @__PURE__ */ m(h, {
|
|
35
36
|
...e,
|
|
36
37
|
classNames: n,
|
|
37
38
|
phase: i,
|
|
@@ -39,8 +40,8 @@ function h(e) {
|
|
|
39
40
|
})
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
|
-
var
|
|
43
|
-
|
|
43
|
+
var _ = p(g);
|
|
44
|
+
_.displayName = i.displayName;
|
|
44
45
|
//#endregion
|
|
45
|
-
export {
|
|
46
|
+
export { _ as TransitionCSS, _ as default };
|
|
46
47
|
/* 独立思考,明辨是非 */
|