@unicom-cloud/ui-common 0.1.25 → 0.1.27
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 +33 -18
- package/border-beam/BorderBeam.js +2 -2
- package/border-beam/Effect.d.ts +1 -1
- package/border-beam/Effect.js +19 -17
- package/border-beam/constants.js +1 -1
- package/border-beam/hooks/useBorderSize.js +1 -1
- package/border-beam/hooks/useChildDom.js +3 -3
- package/border-beam/index.d.ts +3 -0
- package/border-beam/index.js +2 -2
- package/border-beam/utils.js +1 -1
- package/development/Development.js +1 -1
- package/development/index.d.ts +3 -0
- package/development/index.js +2 -2
- package/empty/Empty.js +1 -1
- package/empty/index.d.ts +3 -0
- package/empty/index.js +2 -2
- package/flex/Flex.js +1 -1
- package/flex/index.d.ts +4 -1
- package/flex/index.js +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 -0
- package/higher-order/with-speech-synthesis/index.js +2 -2
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.js +1 -1
- package/hooks/create-deep-compare-effect/index.js +1 -1
- package/hooks/create-update-effect/index.js +1 -1
- package/hooks/create-use-storage-state/index.d.ts +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.d.ts +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.d.ts +4 -4
- 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.d.ts +3 -3
- package/hooks/use-fullscreen/index.js +1 -1
- package/hooks/use-get-state/index.js +1 -1
- package/hooks/use-history-travel/index.d.ts +5 -5
- 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.d.ts +4 -4
- 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.d.ts +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.d.ts +5 -5
- 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 +6 -3
- package/hooks/use-memoized-fn/index.js +2 -2
- 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 +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.d.ts +7 -7
- package/hooks/use-selections/index.js +1 -1
- package/hooks/use-session-storage-state/index.d.ts +1 -1
- package/hooks/use-session-storage-state/index.js +1 -1
- package/hooks/use-set/index.d.ts +3 -3
- package/hooks/use-set/index.js +1 -1
- package/hooks/use-set-state/index.d.ts +2 -2
- 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.d.ts +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.d.ts +3 -2
- package/hooks/use-url-state/index.js +25 -31
- package/hooks/use-virtual-list/index.d.ts +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 +1 -1
- package/icons/file/index.d.ts +3 -0
- package/icons/file/index.js +2 -2
- package/index.js +604 -593
- package/package.json +1 -1
- package/progress/Progress.js +1 -1
- package/progress/index.d.ts +3 -0
- package/progress/index.js +2 -2
- package/resize-observer/Collection.d.ts +1 -1
- package/resize-observer/Collection.js +1 -1
- package/resize-observer/ResizeObserver.js +1 -1
- package/resize-observer/SingleObserver.js +1 -1
- package/resize-observer/index.d.ts +4 -1
- package/resize-observer/index.js +2 -2
- package/resize-observer/observerUtil.js +1 -1
- package/space/Space.js +1 -1
- package/space/index.d.ts +4 -1
- package/space/index.js +2 -2
- package/style/animation.less +0 -24
- package/style/global.less +39 -9
- package/style/index.less +6 -1
- package/style/normalize.less +13 -0
- package/style/transition.less +63 -0
- package/style/variables.less +1 -0
- package/style.css +1 -1
- package/suspense-fallback-test/SuspenseFallbackTest.js +1 -1
- package/suspense-fallback-test/index.d.ts +3 -0
- package/suspense-fallback-test/index.js +2 -2
- package/test.js +1 -1
- package/timer/Timer.js +1 -1
- package/timer/index.d.ts +3 -0
- package/timer/index.js +2 -2
- package/transition/Transition.d.ts +6 -1
- package/transition/Transition.js +63 -63
- package/transition/TransitionCSS.d.ts +14 -2
- package/transition/TransitionCSS.js +33 -33
- package/transition/TransitionGroup.d.ts +8 -1
- package/transition/TransitionGroup.js +3 -4
- package/transition/TransitionStyle.d.ts +14 -2
- package/transition/TransitionStyle.js +3 -4
- package/transition/constants.d.ts +18 -15
- package/transition/constants.js +49 -40
- package/transition/context.js +1 -1
- package/transition/index.d.ts +46 -4
- package/transition/index.js +11 -6
- package/transition/interface.d.ts +20 -21
- package/transition/utils.d.ts +2 -1
- package/transition/utils.js +64 -61
- package/utils/callOrReturn.js +1 -1
- package/utils/callbackOriginRef.js +1 -1
- package/utils/caseName.js +1 -1
- package/utils/className.js +1 -1
- package/utils/constant.d.ts +2 -0
- package/utils/constant.js +5 -5
- package/utils/copy.js +1 -1
- package/utils/css.d.ts +1 -0
- package/utils/css.js +4 -0
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/dom.d.ts +2 -1
- package/utils/dom.js +21 -21
- 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.d.ts +1 -1
- package/utils/findRootElement.js +13 -13
- 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 +4 -2
- package/utils/index.js +312 -304
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.d.ts +2 -2
- package/utils/is.js +16 -16
- 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.js +3 -3
- package/utils/object.js +1 -1
- package/utils/omit.js +1 -1
- package/utils/pad.js +1 -1
- package/utils/pick.js +1 -1
- package/utils/pinyin.js +1 -1
- package/utils/react19Adapter.js +1 -1
- package/utils/reactNode.js +1 -1
- package/utils/ref.d.ts +3 -3
- 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 +2 -2
- package/utils/setPrimaryColor.js +1 -1
- package/utils/setTheme.js +2 -2
- package/utils/string.js +1 -1
- package/utils/style.js +1 -1
- package/utils/throttleByRequestAnimationFrame.d.ts +6 -0
- package/utils/throttleByRequestAnimationFrame.js +18 -0
- package/utils/tinycolor.js +1 -1
- package/utils/toArray.js +1 -1
- package/utils/tree.js +1 -1
- package/utils/tunnel.d.ts +17 -0
- package/utils/tunnel.js +55 -0
- 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/hooks/use-event-emitter/demo/demo1.d.ts +0 -10
- package/utils/throttleByRaf.d.ts +0 -6
- package/utils/throttleByRaf.js +0 -16
- package/utils/throttleByRaf2.d.ts +0 -6
- package/utils/throttleByRaf2.js +0 -9
package/transition/utils.js
CHANGED
|
@@ -1,99 +1,102 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-06-02 15:43:18 星期二 山东省济南市 */
|
|
2
2
|
import { isNullOrUndefined as e, isNumber as t, isPlainObject as n } from "../utils/is.js";
|
|
3
|
-
import {
|
|
3
|
+
import { TRANSITION_PHASE_APPEAR_ACTIVE as r, TRANSITION_PHASE_APPEAR_DONE as i, TRANSITION_PHASE_APPEAR_KEY as a, TRANSITION_PHASE_APPEAR_START as o, TRANSITION_PHASE_ENTER_ACTIVE as s, TRANSITION_PHASE_ENTER_DONE as c, TRANSITION_PHASE_ENTER_KEY as l, TRANSITION_PHASE_ENTER_START as u, TRANSITION_PHASE_EXIT_ACTIVE as d, TRANSITION_PHASE_EXIT_DONE as f, TRANSITION_PHASE_EXIT_KEY as p, TRANSITION_PHASE_EXIT_START as m } from "./constants.js";
|
|
4
4
|
//#region components/common/transition/utils.ts
|
|
5
|
-
function
|
|
6
|
-
let
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
5
|
+
function h(r, i) {
|
|
6
|
+
let o = {
|
|
7
|
+
[a]: void 0,
|
|
8
|
+
[l]: void 0,
|
|
9
|
+
[p]: void 0
|
|
10
10
|
};
|
|
11
|
-
return n(
|
|
12
|
-
if (e(
|
|
11
|
+
return n(r) && (o = Object.assign(o, r)), Object.entries(o).forEach(([n, a], s, c) => {
|
|
12
|
+
if (e(a)) {
|
|
13
13
|
let e;
|
|
14
|
-
e = t(
|
|
14
|
+
e = t(r) ? r : i ?? o.appear ?? o.enter ?? o.exit ?? 500, o[n] = Math.max(e, 0);
|
|
15
15
|
}
|
|
16
|
-
}),
|
|
16
|
+
}), o;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return e[
|
|
18
|
+
function g(e) {
|
|
19
|
+
return e[o] ||= e[u], e[r] ||= e[s], e[i] ||= e[c], e;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function _(e, t) {
|
|
22
22
|
return e.includes(t);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
24
|
+
function v(e) {
|
|
25
|
+
return _([
|
|
26
|
+
o,
|
|
26
27
|
r,
|
|
27
|
-
i
|
|
28
|
-
a
|
|
28
|
+
i
|
|
29
29
|
], e);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function y(e) {
|
|
32
|
+
return _([o], e);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
34
|
+
function b(e) {
|
|
35
|
+
return _([r], e);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function x(e) {
|
|
38
|
+
return _([i], e);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
let n =
|
|
42
|
-
|
|
40
|
+
function S(e, t) {
|
|
41
|
+
let n = _([
|
|
42
|
+
u,
|
|
43
43
|
s,
|
|
44
44
|
c
|
|
45
45
|
], e);
|
|
46
|
-
return t && (n ||=
|
|
46
|
+
return t && (n ||= v(e)), n;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
let n =
|
|
50
|
-
return t && (n ||=
|
|
48
|
+
function C(e, t) {
|
|
49
|
+
let n = _([u], e);
|
|
50
|
+
return t && (n ||= y(e)), n;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
let n =
|
|
54
|
-
return t && (n ||=
|
|
52
|
+
function w(e, t) {
|
|
53
|
+
let n = _([s], e);
|
|
54
|
+
return t && (n ||= b(e)), n;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
let n =
|
|
58
|
-
return t && (n ||=
|
|
56
|
+
function T(e, t) {
|
|
57
|
+
let n = _([c], e);
|
|
58
|
+
return t && (n ||= x(e)), n;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
function E(e) {
|
|
61
|
+
return _([
|
|
62
|
+
m,
|
|
63
|
+
d,
|
|
64
|
+
f
|
|
65
65
|
], e);
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
67
|
+
function D(e) {
|
|
68
|
+
return _([m], e);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
70
|
+
function O(e) {
|
|
71
|
+
return _([d], e);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
return
|
|
73
|
+
function k(e) {
|
|
74
|
+
return _([f], e);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
return
|
|
78
|
-
r,
|
|
76
|
+
function A(e) {
|
|
77
|
+
return _([
|
|
79
78
|
o,
|
|
80
|
-
|
|
79
|
+
u,
|
|
80
|
+
m
|
|
81
81
|
], e);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
return
|
|
85
|
-
|
|
83
|
+
function j(e) {
|
|
84
|
+
return _([
|
|
85
|
+
r,
|
|
86
86
|
s,
|
|
87
|
-
|
|
87
|
+
d
|
|
88
88
|
], e);
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
return
|
|
92
|
-
|
|
90
|
+
function M(e) {
|
|
91
|
+
return _([
|
|
92
|
+
i,
|
|
93
93
|
c,
|
|
94
|
-
|
|
94
|
+
f
|
|
95
95
|
], e);
|
|
96
96
|
}
|
|
97
|
+
function N(e, t) {
|
|
98
|
+
return e.map((e, n, r) => `${e}-${t}`);
|
|
99
|
+
}
|
|
97
100
|
//#endregion
|
|
98
|
-
export {
|
|
101
|
+
export { N as addSuffix, _ as inArrayHandler, j as isActivePhaseHandler, b as isAppearActivePhaseHandler, x as isAppearDonePhaseHandler, v as isAppearPhaseHandler, y as isAppearStartPhaseHandler, M as isDonePhaseHandler, w as isEnterActivePhaseHandler, T as isEnterDonePhaseHandler, S as isEnterPhaseHandler, C as isEnterStartPhaseHandler, O as isExitActivePhaseHandler, k as isExitDonePhaseHandler, E as isExitPhaseHandler, D as isExitStartPhaseHandler, A as isStartPhaseHandler, g as transitionFallbackAppearToEnter, h as transitionNormalizeDurations };
|
|
99
102
|
/* 独立思考,明辨是非 */
|
package/utils/callOrReturn.js
CHANGED
package/utils/caseName.js
CHANGED
package/utils/className.js
CHANGED
package/utils/constant.d.ts
CHANGED
|
@@ -3,3 +3,5 @@ export declare const NOOP: (...args: any[]) => void;
|
|
|
3
3
|
export { UI_PC_KEY, UI_PC_THEME_DARK_CLASS_NAME, } from '@unicom-cloud/utils/constant/ui';
|
|
4
4
|
export declare const DAYJS_DEFAULT_FORMAT = "YYYY-MM-DD";
|
|
5
5
|
export declare const DAYJS_DEFAULT_FORMAT_WITH_TIME = "YYYY-MM-DD HH:mm:ss";
|
|
6
|
+
declare const PREFIX_CLASS: "pqbc";
|
|
7
|
+
export { PREFIX_CLASS };
|
package/utils/constant.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
2
|
-
import e from "
|
|
3
|
-
import
|
|
1
|
+
/* 潘启宝 2026-06-02 15:43:18 星期二 山东省济南市 */
|
|
2
|
+
import { UI_COMMON_PREFIX as e, UI_PC_KEY as t, UI_PC_THEME_DARK_CLASS_NAME as n } from "@unicom-cloud/utils/constant/ui";
|
|
3
|
+
import r from "lodash/noop";
|
|
4
4
|
//#region components/common/utils/constant.ts
|
|
5
|
-
var
|
|
5
|
+
var i = window.document.documentElement, a = r, o = "YYYY-MM-DD", s = `${o} HH:mm:ss`, c = e;
|
|
6
6
|
//#endregion
|
|
7
|
-
export {
|
|
7
|
+
export { i as CSS_VARIABLE_ELEMENT, o as DAYJS_DEFAULT_FORMAT, s as DAYJS_DEFAULT_FORMAT_WITH_TIME, a as NOOP, c as PREFIX_CLASS, t as UI_PC_KEY, n as UI_PC_THEME_DARK_CLASS_NAME };
|
|
8
8
|
/* 独立思考,明辨是非 */
|
package/utils/copy.js
CHANGED
package/utils/css.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@unicom-cloud/utils/css';
|
package/utils/css.js
ADDED
package/utils/date.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-06-02 15:43:18 星期二 山东省济南市 */
|
|
2
2
|
import { convertTime as e, convertToDurationBasedOnTimeUnits as t, dateFormat as n, dayjsFormat as r } from "@unicom-cloud/utils/date";
|
|
3
3
|
export { e as convertTime, t as convertToDurationBasedOnTimeUnits, n as dateFormat, r as dayjsFormat };
|
|
4
4
|
/* 独立思考,明辨是非 */
|
package/utils/dayjs.js
CHANGED
package/utils/dom.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import canUseDOM from '@unicom-cloud/utils/dom-helpers/canUseDOM';
|
|
2
2
|
import getElementCoordinates from '@unicom-cloud/utils/dom-helpers/getElementCoordinates';
|
|
3
3
|
import forceReflow from '@unicom-cloud/utils/dom-helpers/reflow';
|
|
4
|
+
import type { ElementLike } from './findRootElement';
|
|
4
5
|
declare function on(eventTarget: EventTarget, type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void;
|
|
5
6
|
declare function off(eventTarget: EventTarget, type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
|
|
6
7
|
declare function contains(parentNode: Node | HTMLElement, child: Node | HTMLElement): boolean;
|
|
@@ -28,5 +29,5 @@ declare function focusAtEnd(element: HTMLElement): void;
|
|
|
28
29
|
/**
|
|
29
30
|
* Retrieves a DOM node via a ref, and does not invoke `findDOMNode`.
|
|
30
31
|
*/
|
|
31
|
-
declare function getDOM(node:
|
|
32
|
+
declare function getDOM(node: ElementLike): HTMLElement | SVGElement | null;
|
|
32
33
|
export { canUseDOM, contains, focusAtEnd, forceReflow, getBodyContainer, getDOM, getElementCoordinates, getScrollElements, off, on, parentContainsChildren, forceReflow as reflow, };
|
package/utils/dom.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
/* 潘启宝 2026-06-02 15:43:18 星期二 山东省济南市 */
|
|
2
|
+
import { isEventTarget as e, isFunction as t, isScrollElement as n, isServerRendering as r, isString as i } from "./is.js";
|
|
3
|
+
import a from "./findRootElement.js";
|
|
4
|
+
import o from "@unicom-cloud/utils/dom-helpers/canUseDOM";
|
|
5
|
+
import s from "@unicom-cloud/utils/dom-helpers/getElementCoordinates";
|
|
6
|
+
import c from "@unicom-cloud/utils/dom-helpers/reflow";
|
|
7
7
|
//#region components/common/utils/dom.ts
|
|
8
|
-
function
|
|
9
|
-
|
|
8
|
+
function l(n, a, o, s) {
|
|
9
|
+
r || e(n) && i(a) && t(o) && n.addEventListener(a, o, s || !1);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
|
|
11
|
+
function u(n, a, o, s) {
|
|
12
|
+
r || e(n) && i(a) && t(o) && n.removeEventListener(a, o, s || !1);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function d(e, t) {
|
|
15
15
|
if (!e) return !1;
|
|
16
16
|
if (e.contains) return e.contains(t);
|
|
17
17
|
let n = t;
|
|
@@ -21,12 +21,12 @@ function p(e, t) {
|
|
|
21
21
|
}
|
|
22
22
|
return !1;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
let
|
|
26
|
-
for (;
|
|
27
|
-
return
|
|
24
|
+
function f(e, t = document.documentElement) {
|
|
25
|
+
let r = [], i = e;
|
|
26
|
+
for (; i && i !== t;) n(i) && r.push(i), i = i.parentElement;
|
|
27
|
+
return r;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function p(e, t) {
|
|
30
30
|
if (!e || !t) return !1;
|
|
31
31
|
if (e.contains) return e.contains(t);
|
|
32
32
|
let n = t;
|
|
@@ -36,10 +36,10 @@ function h(e, t) {
|
|
|
36
36
|
}
|
|
37
37
|
return !1;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function m() {
|
|
40
40
|
return window.document.body;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function h(e) {
|
|
43
43
|
if (e.focus(), e.tagName === "INPUT" || e.tagName === "TEXTAREA") {
|
|
44
44
|
let t = e;
|
|
45
45
|
t.selectionStart = t.selectionEnd = t.value.length;
|
|
@@ -48,9 +48,9 @@ function _(e) {
|
|
|
48
48
|
let t = document.createRange(), n = window.getSelection();
|
|
49
49
|
t.selectNodeContents(e), t.collapse(!1), n && (n.removeAllRanges(), n.addRange(t));
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
51
|
+
function g(e) {
|
|
52
|
+
return a(e);
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
|
-
export {
|
|
55
|
+
export { o as canUseDOM, d as contains, h as focusAtEnd, c as forceReflow, c as reflow, m as getBodyContainer, g as getDOM, s as getElementCoordinates, f as getScrollElements, u as off, l as on, p as parentContainsChildren };
|
|
56
56
|
/* 独立思考,明辨是非 */
|
package/utils/emitter.js
CHANGED
package/utils/file.js
CHANGED
package/utils/fileRead.js
CHANGED
package/utils/fileToDataURL.js
CHANGED
package/utils/fillNBSP.js
CHANGED
|
@@ -19,7 +19,7 @@ type ElementLike = Element | undefined | null | (() => Element | undefined | nul
|
|
|
19
19
|
* @param element
|
|
20
20
|
* @returns
|
|
21
21
|
*/
|
|
22
|
-
declare function findRootElement(element?: ElementLike): Element | null;
|
|
22
|
+
declare function findRootElement(element?: ElementLike | null): Element | null;
|
|
23
23
|
export { findRootElement };
|
|
24
24
|
export default findRootElement;
|
|
25
25
|
export type { ElementLike };
|
package/utils/findRootElement.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
2
|
-
import {
|
|
3
|
-
import { getReactElementRef as
|
|
4
|
-
import { Component as
|
|
5
|
-
import
|
|
1
|
+
/* 潘启宝 2026-06-02 15:43:18 星期二 山东省济南市 */
|
|
2
|
+
import { isDOM as e, isElementByInstanceof as t, isFunction as n } from "./is.js";
|
|
3
|
+
import { getReactElementRef as r } from "./ref.js";
|
|
4
|
+
import { Component as i } from "react";
|
|
5
|
+
import a from "react-dom";
|
|
6
6
|
//#region components/common/utils/findRootElement.ts
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
return
|
|
7
|
+
var o = a.findDOMNode;
|
|
8
|
+
function s(a) {
|
|
9
|
+
let s = a;
|
|
10
|
+
return s ? (s = a, e(s) || (s = a, t(s)) ? s : t(s?.dom) ? s.dom : (s = a, s = s?.current, t(s) || (s = c(s), t(s)) || (s = a, s = r(s), s && (s = s.current, s && (t(s) || (s = c(s), t(s))))) || (s = a, n(s) && (s = s()), s = c(s), t(s)) ? s : (s = a, s instanceof i && n(o) ? o(s) : null))) : null;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function c(e) {
|
|
13
13
|
if (!e) return null;
|
|
14
|
-
let
|
|
15
|
-
return t
|
|
14
|
+
let t = e.getRootElement;
|
|
15
|
+
return n(t) ? t() : e;
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
|
-
export {
|
|
18
|
+
export { s as default, s as findRootElement };
|
|
19
19
|
/* 独立思考,明辨是非 */
|
package/utils/getStringLength.js
CHANGED
package/utils/include.js
CHANGED
package/utils/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './caseName';
|
|
|
4
4
|
export * from './className';
|
|
5
5
|
export * from './constant';
|
|
6
6
|
export * from './copy';
|
|
7
|
+
export * from './css';
|
|
7
8
|
export * from './date';
|
|
8
9
|
export * from './dayjs';
|
|
9
10
|
export * from './dom';
|
|
@@ -44,14 +45,15 @@ export * from './setPrimaryColor';
|
|
|
44
45
|
export * from './setTheme';
|
|
45
46
|
export * from './string';
|
|
46
47
|
export * from './style';
|
|
47
|
-
export * from './
|
|
48
|
+
export * from './throttleByRequestAnimationFrame';
|
|
48
49
|
export * from './tinycolor';
|
|
49
50
|
export * from './toArray';
|
|
50
51
|
export * from './tree';
|
|
52
|
+
export * from './tunnel';
|
|
51
53
|
export * from './tween';
|
|
52
54
|
export * from './uuid';
|
|
53
55
|
export * from './validate';
|
|
54
56
|
export * from './warning';
|
|
57
|
+
export * as pinyin from './pinyin';
|
|
55
58
|
export { keyboardCode } from './keyboardCode';
|
|
56
59
|
export { COMPONENT_NAMES } from './names';
|
|
57
|
-
export * as pinyin from './pinyin';
|