@unicom-cloud/ui-common 0.1.19 → 0.1.20
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 +88 -67
- package/development/index.js +1 -1
- package/empty/index.js +1 -1
- package/flex/index.js +1 -1
- package/flex/utils.js +1 -1
- package/higher-order/index.js +1 -1
- package/higher-order/with-speech-synthesis/index.js +1 -1
- package/hooks/create-deep-compare-effect/index.js +8 -7
- package/hooks/create-update-effect/index.d.ts +1 -1
- package/hooks/create-update-effect/index.js +9 -10
- package/hooks/create-use-storage-state/index.js +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +82 -81
- package/hooks/use-async-effect/index.js +1 -1
- package/hooks/use-boolean/index.js +1 -1
- package/hooks/use-click-away/index.d.ts +2 -2
- package/hooks/use-click-away/index.js +7 -3
- package/hooks/use-computed-state/index.js +1 -1
- package/hooks/use-controllable-value/index.js +1 -1
- package/hooks/use-cookie-state/index.d.ts +34 -1
- package/hooks/use-cookie-state/index.js +16 -16
- package/hooks/use-count-down/index.js +1 -1
- package/hooks/use-counter/index.js +1 -1
- package/hooks/use-create/index.d.ts +4 -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/demo/demo1.d.ts +10 -0
- package/hooks/use-event-emitter/index.d.ts +8 -0
- package/hooks/use-event-emitter/index.js +26 -0
- package/hooks/use-event-listener/index.js +1 -1
- package/hooks/use-event-target/index.js +1 -1
- package/hooks/use-external/index.js +25 -24
- 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-view/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 +3 -3
- package/hooks/use-latest/index.js +1 -1
- package/hooks/use-listen-window-resize/index.d.ts +1 -1
- package/hooks/use-listen-window-resize/index.js +3 -3
- 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.d.ts +1 -1
- package/hooks/use-memoized-fn/index.js +3 -3
- 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 +1 -1
- 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 +13 -12
- 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.d.ts +11 -1
- package/hooks/use-state-with-promise/index.js +21 -20
- 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 +12 -11
- 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.d.ts +3 -1
- package/hooks/use-update/index.js +5 -5
- 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.d.ts +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/index.js +1 -1
- package/index.d.ts +1 -1
- package/index.js +574 -544
- package/package.json +1 -1
- package/progress/index.js +43 -43
- package/resize-observer/Collection.d.ts +2 -2
- package/resize-observer/Collection.js +1 -1
- package/resize-observer/SingleObserver.js +1 -1
- package/resize-observer/index.js +1 -1
- package/resize-observer/observerUtil.js +1 -1
- package/space/index.js +1 -1
- package/style/animation.less +13 -1
- package/style.css +1 -1
- package/suspense-fallback-test/index.js +1 -1
- package/test.js +1 -1
- package/timer/index.js +1 -1
- package/transition/Transition.d.ts +11 -0
- package/transition/Transition.js +92 -0
- package/transition/TransitionCSS.d.ts +11 -0
- package/transition/TransitionCSS.js +33 -0
- package/transition/TransitionGroup.d.ts +11 -0
- package/transition/TransitionGroup.js +62 -0
- package/transition/TransitionStyle.d.ts +11 -0
- package/transition/TransitionStyle.js +46 -0
- package/transition/constants.d.ts +43 -0
- package/transition/constants.js +46 -0
- package/transition/index.d.ts +12 -0
- package/transition/index.js +12 -0
- package/transition/interface.d.ts +192 -0
- package/transition/utils.d.ts +19 -0
- package/transition/utils.js +97 -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.js +1 -1
- package/utils/copy.js +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/dom.js +1 -1
- package/utils/emitter.js +1 -1
- package/utils/fileRead.js +1 -1
- package/utils/fileToDataURL.js +1 -1
- package/utils/fillNBSP.js +1 -1
- package/utils/findRootElement.d.ts +3 -3
- package/utils/findRootElement.js +2 -2
- 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.js +277 -276
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.d.ts +6 -5
- package/utils/is.js +23 -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/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/ref.js +2 -2
- 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 +9 -9
- package/transition-group/ChildMapping.d.ts +0 -27
- package/transition-group/ChildMapping.js +0 -61
- package/transition-group/Transition.d.ts +0 -126
- package/transition-group/Transition.js +0 -133
- package/transition-group/TransitionCSS.d.ts +0 -97
- package/transition-group/TransitionCSS.js +0 -73
- package/transition-group/TransitionGroup.d.ts +0 -31
- package/transition-group/TransitionGroup.js +0 -54
- package/transition-group/TransitionReplace.d.ts +0 -23
- package/transition-group/TransitionReplace.js +0 -38
- package/transition-group/TransitionSwitch.d.ts +0 -88
- package/transition-group/TransitionSwitch.js +0 -84
- package/transition-group/context.d.ts +0 -2
- package/transition-group/context.js +0 -7
- package/transition-group/index.d.ts +0 -9
- package/transition-group/index.js +0 -11
package/utils/is.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import { isDayjs } from 'dayjs';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
declare const isServerRendering: boolean;
|
|
5
5
|
declare const isReact18: boolean, isReact19: boolean;
|
|
6
|
-
export declare function isEmptyReactNode(element:
|
|
6
|
+
export declare function isEmptyReactNode(element: unknown, trim?: boolean): element is null | undefined | false | '' | [];
|
|
7
7
|
export declare function isReactComponentAndNotFragment(element: React.ReactElement): element is never;
|
|
8
|
-
export declare function isReactComponent(element?: React.ReactElement):
|
|
9
|
-
export declare function isReactClassComponent(element?: React.ReactElement):
|
|
10
|
-
export declare function isElementByInstanceof(element?:
|
|
11
|
-
export declare function
|
|
8
|
+
export declare function isReactComponent(element?: React.ReactElement): element is React.ReactElement;
|
|
9
|
+
export declare function isReactClassComponent(element?: React.ReactElement): element is React.ReactElement;
|
|
10
|
+
export declare function isElementByInstanceof(element?: unknown): element is Element;
|
|
11
|
+
export declare function isHTMLElement(element?: unknown): element is HTMLElement;
|
|
12
|
+
export declare function isScrollElement(element?: unknown): element is HTMLElement;
|
|
12
13
|
export { is32Bit, isAllChinese, isArguments, isArray, isArrayAndNotEmpty, isArrayBuffer, isArrayEmpty, isArrayLike, isArrayLikeObject, isAscii, isAsyncFunction, isBase64, isBigInt, isBlob, isBoolean, isBuffer, isChinese, isColorValue, isDataURI, isDate, isDayjs, isElement, isEmail, isEmpty, isEmptyArray, isEmptyObject, isEmptyValue, isEqual, isEqualWith, isError, isEventTarget, isExist, isFile, isFinite, isFullWidth, isFunction, isHalfWidth, isHash, isHexColor, isHSL, isIdentityCard, isIMEI, isInteger, isIP, isIPRange, isJSON, isJSON_String, isJWT, isLength, isMACAddress, isMap, isMatch, isMatchWith, isMD5, isMimeType, isMobilePhone, isMobilePhoneLocales, isNaN, isNative, isNil, isNull, isNullOrUndefined, isNumber, isNumberOrString, isObject, isObjectLike, isPlainObject, isPort, isPromise, isReact18, isReact19, isReadableStream, isRegExp, isRgbColor, isSafeInteger, isSemVer, isServerRendering, isSet, isSlug, isSparseArray, isString, isStringOrNumber, isStrongPassword, isSymbol, isTypedArray, isUndefined, isUndefinedOrNull, isURL, isUUID, isVariableWidth, isWeakMap, isWeakSet, isWindow, };
|
package/utils/is.js
CHANGED
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
/* 潘启宝 2026-04-
|
|
1
|
+
/* 潘启宝 2026-04-14 16:51:31 星期二 */
|
|
2
2
|
import e, { isValidElement as t } from "react";
|
|
3
3
|
import { isBrowser as n } from "@unicom-cloud/utils/constant/platform";
|
|
4
|
-
import { is32Bit as r, isAllChinese as i, isArguments as a, isArray as
|
|
5
|
-
import { isDayjs as
|
|
6
|
-
import
|
|
7
|
-
import { isFragment as
|
|
4
|
+
import { is32Bit as r, isAllChinese as i, isArguments as a, isArray as o, isArrayAndNotEmpty as ee, isArrayBuffer as te, isArrayEmpty as ne, isArrayLike as re, isArrayLikeObject as ie, isAscii as ae, isAsyncFunction as s, isBase64 as c, isBigInt as l, isBlob as u, isBoolean as d, isBuffer as f, isChinese as p, isColorValue as m, isDataURI as h, isDate as g, isElement as _, isEmail as v, isEmpty as y, isEmptyArray as b, isEmptyObject as x, isEmptyValue as S, isEqual as C, isEqualWith as w, isError as T, isEventTarget as E, isExist as D, isFile as O, isFinite as k, isFullWidth as A, isFunction as j, isHSL as M, isHalfWidth as N, isHash as P, isHexColor as F, isIMEI as I, isIP as L, isIPRange as R, isIdentityCard as z, isInteger as B, isJSON as V, isJSON_String as H, isJWT as U, isLength as W, isMACAddress as G, isMD5 as K, isMap as q, isMatch as J, isMatchWith as oe, isMimeType as se, isMobilePhone as ce, isMobilePhoneLocales as le, isNaN as ue, isNative as de, isNil as fe, isNull as pe, isNullOrUndefined as Y, isNumber as me, isNumberOrString as he, isObject as ge, isObjectLike as _e, isPlainObject as ve, isPort as ye, isPromise as be, isReadableStream as xe, isRegExp as Se, isRgbColor as Ce, isSafeInteger as we, isSemVer as Te, isSet as Ee, isSlug as De, isSparseArray as Oe, isString as X, isStringOrNumber as ke, isStrongPassword as Ae, isSymbol as je, isTypedArray as Me, isURL as Ne, isUUID as Pe, isUndefined as Fe, isUndefinedOrNull as Ie, isVariableWidth as Le, isWeakMap as Re, isWeakSet as ze, isWindow as Be } from "@unicom-cloud/utils/is";
|
|
5
|
+
import { isDayjs as Ve } from "dayjs";
|
|
6
|
+
import He from "react-dom";
|
|
7
|
+
import { isFragment as Ue } from "react-is";
|
|
8
8
|
//#region components/common/utils/is.ts
|
|
9
|
-
var
|
|
10
|
-
let i =
|
|
11
|
-
return t <= parseFloat(
|
|
9
|
+
var Z = !n, [We, Ge] = [18, 19].map((t, n, r) => {
|
|
10
|
+
let i = e.version || He.version || "", a = /\d+/.exec(i)?.[0] ?? "";
|
|
11
|
+
return t <= parseFloat(a);
|
|
12
12
|
});
|
|
13
|
-
function
|
|
14
|
-
return !!(
|
|
15
|
-
}
|
|
16
|
-
function Ke(e) {
|
|
17
|
-
return t(e) && !He(e);
|
|
18
|
-
}
|
|
19
|
-
function $(e) {
|
|
20
|
-
return t(e) && M(e.type);
|
|
13
|
+
function Ke(e, t) {
|
|
14
|
+
return !!(Y(e) || e === !1 || X(e) && (t ? e.trim() === "" : e === "") || b(e));
|
|
21
15
|
}
|
|
22
16
|
function qe(e) {
|
|
23
|
-
return
|
|
17
|
+
return t(e) && !Ue(e);
|
|
18
|
+
}
|
|
19
|
+
function Q(e) {
|
|
20
|
+
return t(e) && j(e.type);
|
|
24
21
|
}
|
|
25
22
|
function Je(e) {
|
|
26
|
-
return e
|
|
23
|
+
return Q(e) && !!e.type?.prototype?.isReactComponent;
|
|
27
24
|
}
|
|
28
25
|
function Ye(e) {
|
|
29
|
-
|
|
26
|
+
return e instanceof Element;
|
|
27
|
+
}
|
|
28
|
+
function $(e) {
|
|
29
|
+
return e instanceof HTMLElement;
|
|
30
|
+
}
|
|
31
|
+
function Xe(e) {
|
|
32
|
+
if (!$(e) || [document.documentElement].includes(e)) return !1;
|
|
30
33
|
let t = window.getComputedStyle(e), n = [
|
|
31
34
|
"auto",
|
|
32
35
|
"scroll",
|
|
@@ -35,5 +38,5 @@ function Ye(e) {
|
|
|
35
38
|
return e.scrollHeight > e.offsetHeight && n.includes(t.overflowY) || e.scrollWidth > e.offsetWidth && n.includes(t.overflowX);
|
|
36
39
|
}
|
|
37
40
|
//#endregion
|
|
38
|
-
export { r as is32Bit, i as isAllChinese, a as isArguments,
|
|
41
|
+
export { r as is32Bit, i as isAllChinese, a as isArguments, o as isArray, ee as isArrayAndNotEmpty, te as isArrayBuffer, ne as isArrayEmpty, re as isArrayLike, ie as isArrayLikeObject, ae as isAscii, s as isAsyncFunction, c as isBase64, l as isBigInt, u as isBlob, d as isBoolean, f as isBuffer, p as isChinese, m as isColorValue, h as isDataURI, g as isDate, Ve as isDayjs, _ as isElement, Ye as isElementByInstanceof, v as isEmail, y as isEmpty, b as isEmptyArray, x as isEmptyObject, Ke as isEmptyReactNode, S as isEmptyValue, C as isEqual, w as isEqualWith, T as isError, E as isEventTarget, D as isExist, O as isFile, k as isFinite, A as isFullWidth, j as isFunction, M as isHSL, $ as isHTMLElement, N as isHalfWidth, P as isHash, F as isHexColor, I as isIMEI, L as isIP, R as isIPRange, z as isIdentityCard, B as isInteger, V as isJSON, H as isJSON_String, U as isJWT, W as isLength, G as isMACAddress, K as isMD5, q as isMap, J as isMatch, oe as isMatchWith, se as isMimeType, ce as isMobilePhone, le as isMobilePhoneLocales, ue as isNaN, de as isNative, fe as isNil, pe as isNull, Y as isNullOrUndefined, me as isNumber, he as isNumberOrString, ge as isObject, _e as isObjectLike, ve as isPlainObject, ye as isPort, be as isPromise, We as isReact18, Ge as isReact19, Je as isReactClassComponent, Q as isReactComponent, qe as isReactComponentAndNotFragment, xe as isReadableStream, Se as isRegExp, Ce as isRgbColor, we as isSafeInteger, Xe as isScrollElement, Te as isSemVer, Z as isServerRendering, Ee as isSet, De as isSlug, Oe as isSparseArray, X as isString, ke as isStringOrNumber, Ae as isStrongPassword, je as isSymbol, Me as isTypedArray, Ne as isURL, Pe as isUUID, Fe as isUndefined, Ie as isUndefinedOrNull, Le as isVariableWidth, Re as isWeakMap, ze as isWeakSet, Be as isWindow };
|
|
39
42
|
/* 独立思考,明辨是非 */
|
package/utils/keyboardCode.js
CHANGED
package/utils/lodash.js
CHANGED
package/utils/math.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-04-
|
|
1
|
+
/* 潘启宝 2026-04-14 16:51:31 星期二 */
|
|
2
2
|
import e, { div as t, minus as n, plus as r, times as i, default as a } from "@unicom-cloud/utils/math";
|
|
3
3
|
export { a as default, t as div, e as math, n as minus, r as plus, i as times };
|
|
4
4
|
/* 独立思考,明辨是非 */
|
package/utils/mergeProps.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-04-
|
|
1
|
+
/* 潘启宝 2026-04-14 16:51:31 星期二 */
|
|
2
2
|
//#region components/common/utils/mergeProps.ts
|
|
3
3
|
function e(e, t, n, r) {
|
|
4
4
|
let i = t || {}, a = n || {}, o = e || {}, s = r ? new Set(r) : new Set(Object.keys(o).concat(Object.keys(i)).concat(Object.keys(a))), c = {};
|
package/utils/mergedToString.js
CHANGED
package/utils/omit.js
CHANGED
package/utils/pad.js
CHANGED
package/utils/pick.js
CHANGED
package/utils/pinyin.js
CHANGED
package/utils/react19Adapter.js
CHANGED
package/utils/ref.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-04-
|
|
1
|
+
/* 潘启宝 2026-04-14 16:51:31 星期二 */
|
|
2
2
|
import { isFunction as e, isObjectLike as t, isReact19 as n, isReactComponentAndNotFragment as r } from "./is.js";
|
|
3
3
|
import i from "../hooks/use-memo/index.js";
|
|
4
4
|
import { isValidElement as a } from "react";
|
|
@@ -17,7 +17,7 @@ var c = (n, r) => {
|
|
|
17
17
|
function d(t) {
|
|
18
18
|
if (!t) return !1;
|
|
19
19
|
if (r(t) && n) return !0;
|
|
20
|
-
let i = s(t) ? t.type
|
|
20
|
+
let i = s(t) ? t.type?.type : t.type;
|
|
21
21
|
return !(e(i) && !i.prototype?.render && i.$$typeof !== o || e(t) && !t.prototype?.render && t.$$typeof !== o);
|
|
22
22
|
}
|
|
23
23
|
var f = (e) => r(e) && d(e);
|
package/utils/resizeObserver.js
CHANGED
package/utils/saveAs.js
CHANGED
package/utils/screenfull.js
CHANGED
package/utils/setCreateRoot.js
CHANGED
package/utils/setDarkTheme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-04-
|
|
1
|
+
/* 潘启宝 2026-04-14 16:51:31 星期二 */
|
|
2
2
|
import { isElementByInstanceof as e } from "./is.js";
|
|
3
3
|
import { CSS_VARIABLE_ELEMENT as t } from "./constant.js";
|
|
4
4
|
import { UI_PC_THEME_DARK_CLASS_NAME as n } from "@unicom-cloud/utils/constant/ui";
|
package/utils/setDir.js
CHANGED
package/utils/setPrimaryColor.js
CHANGED
package/utils/setTheme.js
CHANGED
package/utils/string.js
CHANGED
package/utils/style.js
CHANGED
package/utils/throttleByRaf.js
CHANGED
package/utils/throttleByRaf2.js
CHANGED
package/utils/tinycolor.js
CHANGED
package/utils/toArray.js
CHANGED
package/utils/tree.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-04-
|
|
1
|
+
/* 潘启宝 2026-04-14 16:51:31 星期二 */
|
|
2
2
|
import e, { findNodeBy as t, getChildWithParentBy as n, getItemBy as r, getItemByID as i, getLabelFromDictionaryByValue as a, searchTree as o, default as s } from "@unicom-cloud/utils/tree";
|
|
3
3
|
export { s as default, t as findNodeBy, n as getChildWithParentBy, r as getItemBy, i as getItemByID, a as getLabelFromDictionaryByValue, o as searchTree, e as tree };
|
|
4
4
|
/* 独立思考,明辨是非 */
|
package/utils/tween.js
CHANGED
package/utils/uuid.js
CHANGED
package/utils/validate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-04-
|
|
1
|
+
/* 潘启宝 2026-04-14 16:51:31 星期二 */
|
|
2
2
|
import { PqbValidator as e, Validator as t, ValidatorArray as n, ValidatorBase as r, ValidatorBoolean as i, ValidatorCustom as a, ValidatorNumber as o, ValidatorObject as s, ValidatorSchema as c, ValidatorString as l, ValidatorType as u, validatorLocale as d } from "@unicom-cloud/utils/validate";
|
|
3
3
|
export { e as PqbValidator, t as Validator, n as ValidatorArray, r as ValidatorBase, i as ValidatorBoolean, a as ValidatorCustom, o as ValidatorNumber, s as ValidatorObject, c as ValidatorSchema, l as ValidatorString, u as ValidatorType, d as validatorLocale };
|
|
4
4
|
/* 独立思考,明辨是非 */
|
package/utils/warning.js
CHANGED
package/version/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-04-
|
|
1
|
+
/* 潘启宝 2026-04-14 16:51:31 星期二 */
|
|
2
2
|
//#region components/common/version/index.ts
|
|
3
3
|
var e = {
|
|
4
4
|
name: "潘启宝",
|
|
5
|
-
date: "2026-04-
|
|
5
|
+
date: "2026-04-14 16:51:31",
|
|
6
6
|
platform: "darwin",
|
|
7
7
|
arch: "arm64",
|
|
8
8
|
hostname: "Mac-mini-2.local",
|
|
@@ -10,18 +10,18 @@ var e = {
|
|
|
10
10
|
cpu: "Apple M4",
|
|
11
11
|
endianness: "LE",
|
|
12
12
|
release: "Darwin25.4.0",
|
|
13
|
-
uptime:
|
|
14
|
-
UUID: "
|
|
15
|
-
mac: "
|
|
13
|
+
uptime: 114486,
|
|
14
|
+
UUID: "271f3641-f09a-4a68-9467-6ba636d3fd6e",
|
|
15
|
+
mac: "c2:98:65:c4:08:09",
|
|
16
16
|
version: {
|
|
17
17
|
node: "24.14.0",
|
|
18
18
|
npm: "11.9.0",
|
|
19
|
-
vite: "8.0.
|
|
20
|
-
rolldown: "1.0.0-rc.
|
|
19
|
+
vite: "8.0.8",
|
|
20
|
+
rolldown: "1.0.0-rc.15",
|
|
21
21
|
self: "0.0.0",
|
|
22
|
-
react: "19.2.
|
|
22
|
+
react: "19.2.5"
|
|
23
23
|
}
|
|
24
|
-
}, t = "2026-04-
|
|
24
|
+
}, t = "2026-04-14 16:51:31", n = "1776156691487", r = "0.1.0";
|
|
25
25
|
//#endregion
|
|
26
26
|
export { r as VERSION, r as default, t as VERSION_BUILD_DATE, e as VERSION_BUILD_INFO, n as VERSION_BUILD_TIME };
|
|
27
27
|
/* 独立思考,明辨是非 */
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Given `this.props.children`, return an object mapping key to child.
|
|
3
|
-
*
|
|
4
|
-
* @param {*} children `this.props.children`
|
|
5
|
-
* @return {object} Mapping of key to child
|
|
6
|
-
*/
|
|
7
|
-
export declare function getChildMapping(children: any, mapFn: any): any;
|
|
8
|
-
/**
|
|
9
|
-
* When you're adding or removing children some may be added or removed in the
|
|
10
|
-
* same render pass. We want to show *both* since we want to simultaneously
|
|
11
|
-
* animate elements in and out. This function takes a previous set of keys
|
|
12
|
-
* and a new set of keys and merges them with its best guess of the correct
|
|
13
|
-
* ordering. In the future we may expose some of the utilities in
|
|
14
|
-
* ReactMultiChild to make this easy, but for now React itself does not
|
|
15
|
-
* directly have this concept of the union of prevChildren and nextChildren
|
|
16
|
-
* so we implement it here.
|
|
17
|
-
*
|
|
18
|
-
* @param {object} prev prev children as returned from
|
|
19
|
-
* `ReactTransitionChildMapping.getChildMapping()`.
|
|
20
|
-
* @param {object} next next children as returned from
|
|
21
|
-
* `ReactTransitionChildMapping.getChildMapping()`.
|
|
22
|
-
* @return {object} a key set that contains all keys in `prev` and all keys
|
|
23
|
-
* in `next` in a reasonable order.
|
|
24
|
-
*/
|
|
25
|
-
export declare function mergeChildMappings(prev: any, next: any): {};
|
|
26
|
-
export declare function getInitialChildMapping(props: any, onExited: any): any;
|
|
27
|
-
export declare function getNextChildMapping(nextProps: any, prevChildMapping: any, onExited: any): {};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/* 潘启宝 2026-04-03 14:07:44 星期五 */
|
|
2
|
-
import { Children as e, cloneElement as t, isValidElement as n } from "react";
|
|
3
|
-
//#region components/common/transition-group/ChildMapping.ts
|
|
4
|
-
function r(t, r) {
|
|
5
|
-
let i = (e) => r && n(e) ? r(e) : e, a = Object.create(null);
|
|
6
|
-
return t && e.map(t, (e) => e).forEach((e) => {
|
|
7
|
-
a[e.key] = i(e);
|
|
8
|
-
}), a;
|
|
9
|
-
}
|
|
10
|
-
function i(e, t) {
|
|
11
|
-
e ||= {}, t ||= {};
|
|
12
|
-
function n(n) {
|
|
13
|
-
return n in t ? t[n] : e[n];
|
|
14
|
-
}
|
|
15
|
-
let r = Object.create(null), i = [];
|
|
16
|
-
for (let n in e) n in t ? i.length && (r[n] = i, i = []) : i.push(n);
|
|
17
|
-
let a, o = {};
|
|
18
|
-
for (let e in t) {
|
|
19
|
-
if (r[e]) for (a = 0; a < r[e].length; a++) {
|
|
20
|
-
let t = r[e][a];
|
|
21
|
-
o[r[e][a]] = n(t);
|
|
22
|
-
}
|
|
23
|
-
o[e] = n(e);
|
|
24
|
-
}
|
|
25
|
-
for (a = 0; a < i.length; a++) o[i[a]] = n(i[a]);
|
|
26
|
-
return o;
|
|
27
|
-
}
|
|
28
|
-
function a(e, t, n) {
|
|
29
|
-
return n[t] == null ? e.props[t] : n[t];
|
|
30
|
-
}
|
|
31
|
-
function o(e, n) {
|
|
32
|
-
return r(e.children, (r) => t(r, {
|
|
33
|
-
onExited: n.bind(null, r),
|
|
34
|
-
in: !0,
|
|
35
|
-
appear: a(r, "appear", e),
|
|
36
|
-
enter: a(r, "enter", e),
|
|
37
|
-
exit: a(r, "exit", e)
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
function s(e, o, s) {
|
|
41
|
-
let c = r(e.children), l = i(o, c);
|
|
42
|
-
return Object.keys(l).forEach((r) => {
|
|
43
|
-
let i = l[r];
|
|
44
|
-
if (!n(i)) return;
|
|
45
|
-
let u = r in o, d = r in c, f = o[r], p = n(f) && !f.props.in;
|
|
46
|
-
d && (!u || p) ? l[r] = t(i, {
|
|
47
|
-
onExited: s.bind(null, i),
|
|
48
|
-
in: !0,
|
|
49
|
-
exit: a(i, "exit", e),
|
|
50
|
-
enter: a(i, "enter", e)
|
|
51
|
-
}) : !d && u && !p ? l[r] = t(i, { in: !1 }) : d && u && n(f) && (l[r] = t(i, {
|
|
52
|
-
onExited: s.bind(null, i),
|
|
53
|
-
in: f.props.in,
|
|
54
|
-
exit: a(i, "exit", e),
|
|
55
|
-
enter: a(i, "enter", e)
|
|
56
|
-
}));
|
|
57
|
-
}), l;
|
|
58
|
-
}
|
|
59
|
-
//#endregion
|
|
60
|
-
export { r as getChildMapping, o as getInitialChildMapping, s as getNextChildMapping, i as mergeChildMappings };
|
|
61
|
-
/* 独立思考,明辨是非 */
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare const ENTERING = "entering";
|
|
3
|
-
export declare const ENTERED = "entered";
|
|
4
|
-
export declare const EXITING = "exiting";
|
|
5
|
-
export declare const EXITED = "exited";
|
|
6
|
-
export declare const UNMOUNTED = "unmounted";
|
|
7
|
-
/**
|
|
8
|
-
* Transition 组件允许你通过简单的声明式 API,
|
|
9
|
-
* 描述组件状态随时间的过渡。
|
|
10
|
-
* 最常用于组件的挂载和卸载动画,
|
|
11
|
-
* 也可用于组件在位状态切换。
|
|
12
|
-
*
|
|
13
|
-
* ---
|
|
14
|
-
*
|
|
15
|
-
* 注意:`Transition` 是一个与平台无关的基础组件。
|
|
16
|
-
* 如果你在使用 CSS 过渡,可能更适合使用
|
|
17
|
-
* [`TransitionCSS`](https://reactcommunity.org/react-transition-group/css-transition)。
|
|
18
|
-
* 它继承了 Transition 的所有功能,
|
|
19
|
-
* 还包含了适配 CSS 过渡所需的额外特性。
|
|
20
|
-
*
|
|
21
|
-
* ---
|
|
22
|
-
*
|
|
23
|
-
* 默认情况下,Transition 组件不会改变所渲染组件的行为,
|
|
24
|
-
* 它只追踪组件的「进入」和「退出」状态。
|
|
25
|
-
* 你需要自行为这些状态定义样式和行为。
|
|
26
|
-
* 例如,你可以在组件进入/退出时添加样式:
|
|
27
|
-
*
|
|
28
|
-
* ```jsx
|
|
29
|
-
* import { Transition } from 'react-transition-group';
|
|
30
|
-
* import { useRef } from 'react';
|
|
31
|
-
*
|
|
32
|
-
* const duration = 300;
|
|
33
|
-
*
|
|
34
|
-
* const defaultStyle = {
|
|
35
|
-
* transition: `opacity ${duration}ms ease-in-out`,
|
|
36
|
-
* opacity: 0,
|
|
37
|
-
* }
|
|
38
|
-
*
|
|
39
|
-
* const transitionStyles = {
|
|
40
|
-
* entering: { opacity: 1 },
|
|
41
|
-
* entered: { opacity: 1 },
|
|
42
|
-
* exiting: { opacity: 0 },
|
|
43
|
-
* exited: { opacity: 0 },
|
|
44
|
-
* };
|
|
45
|
-
*
|
|
46
|
-
* function Fade({ in: inProp }) {
|
|
47
|
-
* const refElement = useRef(null);
|
|
48
|
-
* return (
|
|
49
|
-
* <Transition refElement={refElement} in={inProp} duration={duration}>
|
|
50
|
-
* {state => (
|
|
51
|
-
* <div ref={refElement} style={{
|
|
52
|
-
* ...defaultStyle,
|
|
53
|
-
* ...transitionStyles[state]
|
|
54
|
-
* }}>
|
|
55
|
-
* I'm a fade Transition!
|
|
56
|
-
* </div>
|
|
57
|
-
* )}
|
|
58
|
-
* </Transition>
|
|
59
|
-
* );
|
|
60
|
-
* }
|
|
61
|
-
* ```
|
|
62
|
-
*
|
|
63
|
-
* Transition 共有 4 种主要状态:
|
|
64
|
-
* - `'entering'` 进入中
|
|
65
|
-
* - `'entered'` 已进入
|
|
66
|
-
* - `'exiting'` 退出中
|
|
67
|
-
* - `'exited'` 已退出
|
|
68
|
-
*
|
|
69
|
-
* 过渡状态由 `in` 属性控制。
|
|
70
|
-
* 当 `in={true}` 时,组件开始「进入」阶段。
|
|
71
|
-
* 在此阶段,组件状态会切换为 `entering`,
|
|
72
|
-
* 持续过渡时长后切换为 `entered`。
|
|
73
|
-
*
|
|
74
|
-
* ```jsx
|
|
75
|
-
* import { Transition } from 'react-transition-group';
|
|
76
|
-
* import { useState, useRef } from 'react';
|
|
77
|
-
*
|
|
78
|
-
* function App() {
|
|
79
|
-
* const [inProp, setInProp] = useState(false);
|
|
80
|
-
* const refElement = useRef(null);
|
|
81
|
-
* return (
|
|
82
|
-
* <div>
|
|
83
|
-
* <Transition refElement={refElement} in={inProp} duration={500}>
|
|
84
|
-
* {state => ()}
|
|
85
|
-
* </Transition>
|
|
86
|
-
* <button onClick={() => setInProp(true)}>
|
|
87
|
-
* Click to Enter
|
|
88
|
-
* </button>
|
|
89
|
-
* </div>
|
|
90
|
-
* );
|
|
91
|
-
* }
|
|
92
|
-
* ```
|
|
93
|
-
*
|
|
94
|
-
* 点击按钮后,组件状态变为 `entering`,
|
|
95
|
-
* 持续 500ms 后切换为 `entered`。
|
|
96
|
-
*
|
|
97
|
-
* 当 `in={false}` 时,过程类似,
|
|
98
|
-
* 状态从 `exiting` 变为 `exited`。
|
|
99
|
-
*/
|
|
100
|
-
declare class Transition extends React.Component {
|
|
101
|
-
#private;
|
|
102
|
-
static contextType: React.Context<null>;
|
|
103
|
-
constructor(props: any, context: any);
|
|
104
|
-
static getDerivedStateFromProps({ in: nextIn }: {
|
|
105
|
-
in: any;
|
|
106
|
-
}, prevState: any): {
|
|
107
|
-
status: string;
|
|
108
|
-
} | null;
|
|
109
|
-
componentDidMount(): void;
|
|
110
|
-
componentDidUpdate(prevProps: any): void;
|
|
111
|
-
componentWillUnmount(): void;
|
|
112
|
-
getDurations: () => {
|
|
113
|
-
exit: any;
|
|
114
|
-
enter: any;
|
|
115
|
-
appear: any;
|
|
116
|
-
};
|
|
117
|
-
updateStatus: (mounting: boolean | undefined, nextStatus: any) => void;
|
|
118
|
-
performEnter: (mounting: any) => void;
|
|
119
|
-
performExit: () => void;
|
|
120
|
-
cancelNextCallback: () => void;
|
|
121
|
-
safeSetState(nextState: any, callback: any): void;
|
|
122
|
-
setNextCallback: (callback: any) => null;
|
|
123
|
-
onTransitionEnd: (duration: any, handler: any) => void;
|
|
124
|
-
render(): import("react/jsx-runtime").JSX.Element | null;
|
|
125
|
-
}
|
|
126
|
-
export default Transition;
|