@unicom-cloud/ui-common 0.1.42 → 0.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.virtual/_rolldown/runtime.js +1 -1
- package/animation/Animation.js +38 -38
- package/animation/constants.js +1 -1
- package/animation/context.js +1 -1
- package/animation/hooks/index.d.ts +0 -0
- package/animation/index.js +1 -1
- package/animation/style/index.js +1 -1
- package/animation/utils.js +1 -1
- package/base/Base.d.ts +3 -0
- package/base/Base.js +6 -0
- package/base/constants.d.ts +0 -0
- package/base/constants.js +2 -0
- package/base/context.d.ts +3 -0
- package/base/context.js +7 -0
- package/base/hooks/index.d.ts +0 -0
- package/base/index.d.ts +9 -0
- package/base/index.js +9 -0
- package/base/interface.d.ts +5 -0
- package/base/style/index.d.ts +1 -0
- package/base/style/index.js +3 -0
- package/base/utils.d.ts +0 -0
- package/base/utils.js +2 -0
- package/border-beam/BorderBeam.js +21 -21
- package/border-beam/Effect.js +1 -1
- package/border-beam/constants.js +1 -1
- package/border-beam/context.js +1 -1
- package/border-beam/hooks/useBorderSize.js +1 -1
- package/border-beam/hooks/useChildDom.js +1 -1
- package/border-beam/index.js +1 -1
- package/border-beam/style/index.js +1 -1
- package/border-beam/utils.js +1 -1
- package/development/Development.js +18 -18
- package/development/constants.js +1 -1
- package/development/context.js +1 -1
- package/development/hooks/index.d.ts +0 -0
- package/development/index.js +1 -1
- package/development/style/index.js +1 -1
- package/development/utils.js +1 -1
- package/empty/Empty.js +17 -17
- package/empty/constants.js +1 -1
- package/empty/context.js +1 -1
- package/empty/hooks/index.d.ts +0 -0
- package/empty/index.js +1 -1
- package/empty/style/index.js +1 -1
- package/empty/utils.js +1 -1
- package/flex/Flex.js +19 -19
- package/flex/constants.js +1 -1
- package/flex/context.js +1 -1
- package/flex/hooks/index.d.ts +0 -0
- package/flex/index.js +1 -1
- package/flex/style/index.js +1 -1
- package/flex/utils.d.ts +1 -1
- package/flex/utils.js +26 -26
- package/higher-order/index.js +1 -1
- package/higher-order/with-speech-synthesis/context.js +1 -1
- package/higher-order/with-speech-synthesis/hooks/index.d.ts +0 -0
- package/higher-order/with-speech-synthesis/index.js +1 -1
- package/higher-order/with-speech-synthesis/style/index.js +1 -1
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.js +1 -1
- package/hoc/withContext.d.ts +10 -0
- package/hoc/withContext.js +18 -0
- package/hooks/create-deep-compare-effect/index.js +1 -1
- package/hooks/create-update-effect/index.js +1 -1
- package/hooks/create-use-storage-state/index.js +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +41 -40
- 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 +16 -16
- 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-drag-move/index.d.ts +2 -0
- package/hooks/use-drag-move/index.js +67 -0
- package/hooks/use-drag-move/interface.d.ts +8 -0
- 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 +27 -27
- package/hooks/use-favicon/index.js +1 -1
- package/hooks/use-focus-within/index.js +1 -1
- package/hooks/use-force-update/index.js +1 -1
- package/hooks/use-fullscreen/index.js +1 -1
- package/hooks/use-get-state/index.js +1 -1
- package/hooks/use-history-travel/index.js +1 -1
- package/hooks/use-hover/index.js +1 -1
- package/hooks/use-id/index.js +1 -1
- package/hooks/use-in-viewport/index.js +1 -1
- package/hooks/use-infinite-scroll/index.js +1 -1
- package/hooks/use-intersection-observer/index.js +1 -1
- package/hooks/use-intersection-observers/index.d.ts +1 -0
- package/hooks/use-intersection-observers/index.js +23 -22
- 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.d.ts +2 -2
- 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.d.ts +2 -2
- package/hooks/use-merge-props/index.js +2 -2
- 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.d.ts +2 -4
- package/hooks/use-move/index.js +3 -67
- package/hooks/use-move/interface.d.ts +1 -0
- package/hooks/use-mutation-observer/index.js +1 -1
- package/hooks/use-mutation-observers/index.d.ts +1 -0
- package/hooks/use-mutation-observers/index.js +23 -22
- 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.d.ts +4 -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 +2 -2
- 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.d.ts +1 -0
- package/hooks/use-resize-observers/index.js +23 -22
- 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 +5 -5
- package/hooks/use-text-selection/index.js +1 -1
- package/hooks/use-theme/index.js +1 -1
- package/hooks/use-throttle/index.js +1 -1
- package/hooks/use-throttle-effect/index.js +1 -1
- package/hooks/use-throttle-fn/index.js +1 -1
- package/hooks/use-throttle-fn-with-raf/index.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 +2 -2
- 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/noop.d.ts +2 -2
- package/hooks/utils/rect.js +1 -1
- package/hooks/utils/useDeepCompareWithTarget.js +1 -1
- package/hooks/utils/useEffectWithTarget.js +1 -1
- package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +1 -1
- package/hooks/utils/useLayoutEffectWithTarget.js +1 -1
- package/icons/file/File.js +1 -1
- package/icons/file/context.js +1 -1
- package/icons/file/hooks/index.d.ts +0 -0
- package/icons/file/index.js +1 -1
- package/icons/file/style/index.js +1 -1
- package/index.d.ts +2 -0
- package/index.js +632 -620
- package/package.json +1 -1
- package/progress/Progress.js +31 -33
- package/progress/constants.js +1 -1
- package/progress/index.js +1 -1
- package/progress/style/index.js +1 -1
- package/progress/utils.js +1 -1
- package/resize-observer/Collection.js +1 -1
- package/resize-observer/ResizeObserver.js +4 -4
- package/resize-observer/SingleObserver.js +11 -11
- package/resize-observer/constants.js +1 -1
- package/resize-observer/context.js +1 -1
- package/resize-observer/hooks/index.d.ts +0 -0
- package/resize-observer/index.js +1 -1
- package/resize-observer/observerUtil.js +1 -1
- package/resize-observer/style/index.js +1 -1
- package/resize-observer/utils.js +1 -1
- package/space/Space.js +51 -50
- package/space/constants.js +1 -1
- package/space/context.js +3 -2
- package/space/hooks/index.d.ts +0 -0
- package/space/index.js +1 -1
- package/space/interface.d.ts +2 -1
- package/space/style/index.js +1 -1
- package/space/utils.js +1 -1
- package/suspense-fallback-test/SuspenseFallbackTest.js +5 -4
- package/suspense-fallback-test/constants.js +1 -1
- package/suspense-fallback-test/context.js +1 -1
- package/suspense-fallback-test/hooks/index.d.ts +0 -0
- package/suspense-fallback-test/index.js +1 -1
- package/suspense-fallback-test/style/index.js +1 -1
- package/suspense-fallback-test/utils.js +1 -1
- package/test.js +1 -1
- package/timer/Timer.js +16 -16
- package/timer/constants.js +1 -1
- package/timer/context.js +1 -1
- package/timer/hooks/index.d.ts +0 -0
- package/timer/index.js +1 -1
- package/timer/style/index.js +1 -1
- package/timer/utils.js +1 -1
- package/transition/Transition.js +35 -36
- package/transition/TransitionCSS.js +1 -1
- package/transition/TransitionGroup.js +10 -10
- package/transition/TransitionStyle.js +1 -1
- package/transition/constants.js +1 -1
- package/transition/context.js +1 -1
- package/transition/hooks/index.d.ts +0 -0
- package/transition/index.js +1 -1
- package/transition/interface.d.ts +1 -2
- package/transition/style/index.js +1 -1
- package/transition/utils.js +1 -1
- package/typewriter/Typewriter.js +28 -28
- package/typewriter/constants.js +1 -1
- package/typewriter/context.js +1 -1
- package/typewriter/hooks/index.d.ts +0 -0
- package/typewriter/index.js +1 -1
- package/typewriter/style/index.js +1 -1
- package/typewriter/utils.js +1 -1
- package/utils/callOrReturn.js +1 -1
- package/utils/callbackOriginRef.d.ts +2 -2
- package/utils/callbackOriginRef.js +1 -1
- package/utils/caseName.js +1 -1
- package/utils/className.js +1 -1
- package/utils/constants.d.ts +1 -3
- package/utils/constants.js +3 -4
- package/utils/copy.js +1 -1
- package/utils/css.js +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/document.js +1 -1
- package/utils/dom.d.ts +4 -3
- package/utils/dom.js +13 -12
- 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/getElement.d.ts +8 -0
- package/utils/getElement.js +27 -0
- 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/getScrollParent.js +1 -1
- package/utils/getStringLength.js +1 -1
- package/utils/include.js +1 -1
- package/utils/index.d.ts +1 -1
- package/utils/index.js +333 -324
- package/utils/initAllLineClamp.js +13 -12
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.d.ts +3 -0
- package/utils/is.js +82 -70
- package/utils/keyboardCode.js +1 -1
- package/utils/lodash.d.ts +7 -1
- package/utils/lodash.js +67 -61
- package/utils/math.js +1 -1
- package/utils/mergeProps.d.ts +1 -1
- package/utils/mergeProps.js +9 -9
- package/utils/mergedToString.js +1 -1
- package/utils/mutationObserver.js +1 -1
- package/utils/names.js +1 -1
- package/utils/object.js +1 -1
- package/utils/omit.js +1 -1
- package/utils/pad.js +1 -1
- package/utils/pick.js +1 -1
- package/utils/pinyin.js +1 -1
- package/utils/react19Adapter.js +1 -1
- package/utils/reactNode.js +1 -1
- package/utils/ref.js +1 -1
- package/utils/resizeObserver.js +5 -5
- package/utils/saveAs.js +1 -1
- package/utils/screenfull.js +1 -1
- package/utils/scrollIntoViewIfNeeded.js +1 -1
- package/utils/scrollTo.js +1 -1
- package/utils/setCreateRoot.js +1 -1
- package/utils/setDarkTheme.js +4 -4
- 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/tinycolor.js +1 -1
- package/utils/toArray.js +1 -1
- package/utils/tree.js +1 -1
- package/utils/tunnel.d.ts +2 -0
- package/utils/tunnel.js +43 -40
- 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/interface.d.ts +0 -3
- package/utils/getRootElement.d.ts +0 -25
- package/utils/getRootElement.js +0 -19
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unicom-cloud/ui-common","version":"0.1.
|
|
1
|
+
{"name":"@unicom-cloud/ui-common","version":"0.1.44","dependencies":{"@unicom-cloud/utils":"^0.1.0","@unicom-cloud/icons":"^0.1.0","react-compiler-runtime":"^1.0.0"},"peerDependencies":{"dayjs":"^1.11.21","lodash":"^4.18.1","react":"^18.3.1","react-dom":"^18.3.1","react-is":"^18.3.1"},"type":"module","types":"./index.d.ts","main":"./index.js","bin":{"ui":"./test.js"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
|
package/progress/Progress.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
import { isNumber as e, isUndefined as t } from "../utils/is.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { clamp as n } from "../utils/lodash.js";
|
|
4
|
+
import { getBody as r } from "../utils/dom.js";
|
|
5
|
+
import { UI_COMMON_PREFIX as i } from "@unicom-cloud/utils/constants/ui";
|
|
5
6
|
//#region components/common/progress/Progress.ts
|
|
6
|
-
var
|
|
7
|
+
var a = {
|
|
7
8
|
status: null,
|
|
8
9
|
settings: {
|
|
9
|
-
parent:
|
|
10
|
+
parent: r(),
|
|
10
11
|
progress: document.createElement("div"),
|
|
11
12
|
bar: document.createElement("div"),
|
|
12
13
|
minimum: .07,
|
|
@@ -17,52 +18,49 @@ var i = {
|
|
|
17
18
|
trickleSpeed: 227
|
|
18
19
|
},
|
|
19
20
|
configure(e) {
|
|
20
|
-
return Object.assign(
|
|
21
|
+
return Object.assign(a.settings, e), a;
|
|
21
22
|
},
|
|
22
23
|
set(e) {
|
|
23
|
-
let t =
|
|
24
|
-
e =
|
|
25
|
-
let
|
|
26
|
-
return
|
|
27
|
-
f(
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
}),
|
|
24
|
+
let t = a.isStarted();
|
|
25
|
+
e = n(e, a.settings.minimum, 1), a.status = e === 1 ? null : e;
|
|
26
|
+
let r = a.render(!t), i = a.settings.speed;
|
|
27
|
+
return r.offsetWidth, d(function(t) {
|
|
28
|
+
f(a.settings.bar, s(e, i)), e === 1 ? (r.offsetWidth, setTimeout(function() {
|
|
29
|
+
a.remove(), t();
|
|
30
|
+
}, i)) : setTimeout(t, i);
|
|
31
|
+
}), a;
|
|
31
32
|
},
|
|
32
33
|
isStarted() {
|
|
33
|
-
return e(
|
|
34
|
+
return e(a.status);
|
|
34
35
|
},
|
|
35
36
|
start() {
|
|
36
|
-
return
|
|
37
|
+
return a.status || a.set(0), a.settings.trickle && c(), a;
|
|
37
38
|
},
|
|
38
39
|
done(e) {
|
|
39
|
-
return e ||
|
|
40
|
+
return e || a.status ? a.inc(.3 + .5 * Math.random()).set(1) : a;
|
|
40
41
|
},
|
|
41
42
|
inc(t) {
|
|
42
|
-
let
|
|
43
|
-
if (!
|
|
44
|
-
if (!(
|
|
43
|
+
let r = a.status;
|
|
44
|
+
if (!r) return a.start();
|
|
45
|
+
if (!(r > 1)) return e(t) || (r >= 0 && r < .2 && (t = .1), r >= .2 && r < .5 && (t = .04), r >= .5 && r < .8 && (t = .02), r >= .8 && r < .99 && (t = .005)), t ??= 7e-4, r = n(r + t, 0, .994), a.set(r);
|
|
45
46
|
},
|
|
46
47
|
trickle() {
|
|
47
|
-
return
|
|
48
|
+
return a.inc();
|
|
48
49
|
},
|
|
49
50
|
render(e) {
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
let t = e ? "-100" : o(
|
|
53
|
-
return f(
|
|
51
|
+
if (a.settings.parent.contains(a.settings.progress)) return a.settings.progress;
|
|
52
|
+
a.settings.progress.hasAttribute("class"), a.settings.bar.hasAttribute("class"), a.settings.progress.setAttribute("class", `${i}-progress`), a.settings.bar.setAttribute("class", `${i}-progress-bar`), a.settings.progress.contains(a.settings.bar) || a.settings.progress.append(a.settings.bar);
|
|
53
|
+
let t = e ? "-100" : o(a.status || 0);
|
|
54
|
+
return f(a.settings.bar, s(0, t)), a.settings.parent.append(a.settings.progress), a.settings.progress;
|
|
54
55
|
},
|
|
55
56
|
remove() {
|
|
56
|
-
|
|
57
|
+
a.settings.progress.remove();
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
|
-
function a(e, t, n) {
|
|
60
|
-
return Math.max(Math.min(e, n), t);
|
|
61
|
-
}
|
|
62
60
|
function o(e) {
|
|
63
61
|
return (-1 + e) * 100;
|
|
64
62
|
}
|
|
65
|
-
function s(e, t, n =
|
|
63
|
+
function s(e, t, n = a.settings.easing) {
|
|
66
64
|
return {
|
|
67
65
|
transform: `translate(${o(e)}%,0)`,
|
|
68
66
|
transition: `transform ${t}ms ${n}`
|
|
@@ -70,8 +68,8 @@ function s(e, t, n = i.settings.easing) {
|
|
|
70
68
|
}
|
|
71
69
|
function c() {
|
|
72
70
|
setTimeout(() => {
|
|
73
|
-
|
|
74
|
-
},
|
|
71
|
+
a.status && (a.trickle(), c());
|
|
72
|
+
}, a.settings.trickleSpeed);
|
|
75
73
|
}
|
|
76
74
|
var l = [];
|
|
77
75
|
function u() {
|
|
@@ -87,5 +85,5 @@ function f(e, n) {
|
|
|
87
85
|
});
|
|
88
86
|
}
|
|
89
87
|
//#endregion
|
|
90
|
-
export {
|
|
88
|
+
export { a as default };
|
|
91
89
|
/* 独立思考,明辨是非 */
|
package/progress/constants.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
/* 独立思考,明辨是非 */
|
package/progress/index.js
CHANGED
package/progress/style/index.js
CHANGED
package/progress/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
/* 独立思考,明辨是非 */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
import { isFunction as e } from "../utils/is.js";
|
|
3
3
|
import t from "../hooks/use-merge-props/index.js";
|
|
4
4
|
import n from "../utils/toArray.js";
|
|
@@ -10,11 +10,11 @@ import s from "./SingleObserver.js";
|
|
|
10
10
|
import { createElement as c, forwardRef as l, useContext as u } from "react";
|
|
11
11
|
//#region components/common/resize-observer/ResizeObserver.tsx
|
|
12
12
|
function d(r, o) {
|
|
13
|
-
let l = t(r, { ...
|
|
14
|
-
return (e(
|
|
13
|
+
let l = u(i), d = t(r, { ...l }, a), { children: f } = d;
|
|
14
|
+
return (e(f) ? [f] : n(f)).map((e, t) => {
|
|
15
15
|
let n = e?.key || `observer-key-${t}`;
|
|
16
16
|
return /* @__PURE__ */ c(s, {
|
|
17
|
-
...
|
|
17
|
+
...d,
|
|
18
18
|
key: n,
|
|
19
19
|
ref: t === 0 ? o : void 0
|
|
20
20
|
}, e);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
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
|
-
import i from "../utils/
|
|
4
|
+
import { getDOM as i } from "../utils/dom.js";
|
|
5
5
|
import { CollectionContext as a } from "./context.js";
|
|
6
6
|
import { observe as o, unobserve as s } from "./observerUtil.js";
|
|
7
7
|
import { cloneElement as c, forwardRef as l, isValidElement as u, useCallback as d, useContext as f, useEffect as p, useImperativeHandle as m, useRef as h } from "react";
|
|
@@ -12,12 +12,12 @@ function g(l, g) {
|
|
|
12
12
|
height: -1,
|
|
13
13
|
offsetWidth: -1,
|
|
14
14
|
offsetHeight: -1
|
|
15
|
-
}), w = !x && u(S) && n(S), T =
|
|
16
|
-
m(g, () =>
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
let
|
|
20
|
-
let { onResize: t, data: n } =
|
|
15
|
+
}), w = !x && u(S) && n(S), T = w ? t(S) : null, E = r(T, y), D = () => i(y);
|
|
16
|
+
m(g, () => D());
|
|
17
|
+
let O = h(l);
|
|
18
|
+
O.current = l;
|
|
19
|
+
let k = d((e) => {
|
|
20
|
+
let { onResize: t, data: n } = O.current, { width: r, height: i } = e.getBoundingClientRect(), { offsetWidth: a, offsetHeight: o } = e, s = Math.floor(r), c = Math.floor(i);
|
|
21
21
|
if (C.current.width !== s || C.current.height !== c || C.current.offsetWidth !== a || C.current.offsetHeight !== o) {
|
|
22
22
|
let l = {
|
|
23
23
|
width: s,
|
|
@@ -37,9 +37,9 @@ function g(l, g) {
|
|
|
37
37
|
}
|
|
38
38
|
}, []);
|
|
39
39
|
return p(() => {
|
|
40
|
-
let e =
|
|
41
|
-
return e && !v && o(e,
|
|
42
|
-
}, [y.current, v]), w ? c(S, { ref:
|
|
40
|
+
let e = D();
|
|
41
|
+
return e && !v && o(e, k), () => s(e, k);
|
|
42
|
+
}, [y.current, v]), w ? c(S, { ref: E }) : S;
|
|
43
43
|
}
|
|
44
44
|
var _ = l(g);
|
|
45
45
|
_.displayName = "SingleObserver";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
/* 独立思考,明辨是非 */
|
|
File without changes
|
package/resize-observer/index.js
CHANGED
package/resize-observer/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
/* 独立思考,明辨是非 */
|
package/space/Space.js
CHANGED
|
@@ -1,74 +1,75 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
import { isPresent as e } from "../utils/is.js";
|
|
3
|
-
import t from "../
|
|
4
|
-
import n from "../
|
|
5
|
-
import r from "../utils/
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import c from "
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { getDOM as t } from "../utils/dom.js";
|
|
4
|
+
import n from "../hooks/use-merge-props/index.js";
|
|
5
|
+
import r from "../utils/className.js";
|
|
6
|
+
import i from "../utils/toArray.js";
|
|
7
|
+
import { SPACE_COMPONENT_INFO as a, SPACE_VERTICAL_COMPONENT_INFO as o } from "../utils/names.js";
|
|
8
|
+
import { PropsContext as s, defaultProps as c } from "./context.js";
|
|
9
|
+
import l from "../flex/index.js";
|
|
10
|
+
import { Fragment as u, forwardRef as d, useContext as f, useImperativeHandle as p, useRef as m } from "react";
|
|
11
|
+
import { UI_COMMON_PREFIX as h } from "@unicom-cloud/utils/constants/ui";
|
|
12
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
12
13
|
//#region components/common/space/Space.tsx
|
|
13
|
-
function
|
|
14
|
-
let { className:
|
|
14
|
+
function v(a, o) {
|
|
15
|
+
let d = f(s), { className: v, style: y, children: b, size: x, gap: S, direction: C, justifyContent: w, align: T, alignItems: E, wrap: D, separator: O, rtl: k, legacy: A, inline: j, ...M } = n(a, { ...d }, c), N = `${h}-space`, P = [
|
|
15
16
|
"horizontal",
|
|
16
17
|
"row-reverse",
|
|
17
18
|
"row"
|
|
18
|
-
].includes(
|
|
19
|
+
].includes(C);
|
|
19
20
|
[
|
|
20
21
|
"vertical",
|
|
21
22
|
"column-reverse",
|
|
22
23
|
"column"
|
|
23
|
-
].includes(
|
|
24
|
-
let
|
|
24
|
+
].includes(C);
|
|
25
|
+
let F = {
|
|
25
26
|
horizontal: "row",
|
|
26
27
|
vertical: "column"
|
|
27
|
-
}[
|
|
28
|
+
}[C] ?? C, I = A ? {
|
|
28
29
|
start: "flex-start",
|
|
29
30
|
end: "flex-end"
|
|
30
|
-
} : {},
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
[`${
|
|
34
|
-
[`${
|
|
35
|
-
[`${
|
|
36
|
-
[`${
|
|
37
|
-
},
|
|
38
|
-
return
|
|
39
|
-
return
|
|
40
|
-
} })), /* @__PURE__ */
|
|
41
|
-
ref:
|
|
42
|
-
style:
|
|
43
|
-
className:
|
|
44
|
-
gap:
|
|
45
|
-
wrap:
|
|
46
|
-
justifyContent:
|
|
47
|
-
alignItems:
|
|
48
|
-
direction:
|
|
49
|
-
rtl:
|
|
50
|
-
inline:
|
|
51
|
-
...
|
|
52
|
-
children:
|
|
53
|
-
let r = t?.key ?? n;
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
className: `${
|
|
56
|
-
children:
|
|
57
|
-
}), /* @__PURE__ */
|
|
58
|
-
className: `${
|
|
31
|
+
} : {}, L = I[w] ?? w, R = E ?? T ?? (P ? "center" : void 0);
|
|
32
|
+
R = I[R] ?? R;
|
|
33
|
+
let z = r(N, {
|
|
34
|
+
[`${N}-${C}`]: C,
|
|
35
|
+
[`${N}-justify-content-${L}`]: L,
|
|
36
|
+
[`${N}-align-items-${R}`]: R,
|
|
37
|
+
[`${N}-rtl`]: k
|
|
38
|
+
}, D ? `${N}-wrap` : `${N}-no-wrap`, v), B = i(b), V = m(null);
|
|
39
|
+
return p(o, () => ({ getRootElement() {
|
|
40
|
+
return t(V);
|
|
41
|
+
} })), /* @__PURE__ */ g(l, {
|
|
42
|
+
ref: V,
|
|
43
|
+
style: y,
|
|
44
|
+
className: z,
|
|
45
|
+
gap: S ?? x,
|
|
46
|
+
wrap: D,
|
|
47
|
+
justifyContent: L,
|
|
48
|
+
alignItems: R,
|
|
49
|
+
direction: F,
|
|
50
|
+
rtl: k,
|
|
51
|
+
inline: j,
|
|
52
|
+
...M,
|
|
53
|
+
children: B.map((t, n) => {
|
|
54
|
+
let r = t?.key ?? n, i = e(O) && n > 0;
|
|
55
|
+
return /* @__PURE__ */ _(u, { children: [i && /* @__PURE__ */ g("div", {
|
|
56
|
+
className: `${N}-item-separator`,
|
|
57
|
+
children: O
|
|
58
|
+
}), /* @__PURE__ */ g("div", {
|
|
59
|
+
className: `${N}-item`,
|
|
59
60
|
children: t
|
|
60
61
|
})] }, r);
|
|
61
62
|
})
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
|
-
var
|
|
65
|
-
Object.assign(
|
|
66
|
-
var
|
|
65
|
+
var y = d(v);
|
|
66
|
+
Object.assign(y, { ...a });
|
|
67
|
+
var b = d((e, t) => /* @__PURE__ */ g(y, {
|
|
67
68
|
...e,
|
|
68
69
|
ref: t,
|
|
69
70
|
direction: "vertical"
|
|
70
71
|
}));
|
|
71
|
-
Object.assign(
|
|
72
|
+
Object.assign(b, { ...o });
|
|
72
73
|
//#endregion
|
|
73
|
-
export {
|
|
74
|
+
export { b as SpaceVertical, y as default };
|
|
74
75
|
/* 独立思考,明辨是非 */
|
package/space/constants.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
/* 独立思考,明辨是非 */
|
package/space/context.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
import { createContext as e } from "react";
|
|
3
3
|
//#region components/common/space/context.ts
|
|
4
4
|
var t = {
|
|
5
5
|
gap: "small",
|
|
6
|
-
direction: "horizontal"
|
|
6
|
+
direction: "horizontal",
|
|
7
|
+
inline: !0
|
|
7
8
|
}, n = e({});
|
|
8
9
|
//#endregion
|
|
9
10
|
export { n as PropsContext, t as defaultProps };
|
|
File without changes
|
package/space/index.js
CHANGED
package/space/interface.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import type { GapType } from '../flex/interface';
|
|
2
|
+
import type { FlexProps, GapType } from '../flex/interface';
|
|
3
3
|
export type AlignItems = 'start' | 'end' | 'center' | 'baseline';
|
|
4
4
|
export type JustifyContent = 'start' | 'end' | 'center' | 'space-between';
|
|
5
5
|
export type Direction = 'vertical' | 'horizontal';
|
|
6
6
|
export interface SpaceProps {
|
|
7
7
|
style?: CSSProperties;
|
|
8
8
|
className?: string;
|
|
9
|
+
inline?: FlexProps['inline'];
|
|
9
10
|
/**
|
|
10
11
|
* @zh 交叉轴方向对齐方式
|
|
11
12
|
* @deprecated 请用 alignItems 属性替代
|
package/space/style/index.js
CHANGED
package/space/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
/* 独立思考,明辨是非 */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
import e from "../hooks/use-merge-props/index.js";
|
|
3
3
|
import { SUSPENSE_FALLBACK_TEST_COMPONENT_INFO as t } from "../utils/names.js";
|
|
4
4
|
import { PropsContext as n, defaultProps as r } from "./context.js";
|
|
@@ -6,9 +6,10 @@ import { forwardRef as i, lazy as a, useContext as o, useImperativeHandle as s,
|
|
|
6
6
|
import { jsx as l } from "react/jsx-runtime";
|
|
7
7
|
//#region components/common/suspense-fallback-test/SuspenseFallbackTest.tsx
|
|
8
8
|
function u(t, i) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
let u = o(n);
|
|
10
|
+
e(t, { ...u }, r);
|
|
11
|
+
let d = c(() => a(() => new Promise(() => {})), []);
|
|
12
|
+
return s(i, () => ({})), /* @__PURE__ */ l(d, {});
|
|
12
13
|
}
|
|
13
14
|
var d = i(u);
|
|
14
15
|
Object.assign(d, { ...t });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
/* 独立思考,明辨是非 */
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
/* 独立思考,明辨是非 */
|
package/test.js
CHANGED
package/timer/Timer.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
import { isFunction as e } from "../utils/is.js";
|
|
3
|
-
import
|
|
4
|
-
import n from "../
|
|
5
|
-
import r from "../utils/
|
|
3
|
+
import t from "../hooks/use-merge-props/index.js";
|
|
4
|
+
import n from "../utils/className.js";
|
|
5
|
+
import { DAYJS_DEFAULT_FORMAT_WITH_TIME as r } from "../utils/constants.js";
|
|
6
6
|
import { TIMER_COMPONENT_INFO as i } from "../utils/names.js";
|
|
7
7
|
import "../utils/index.js";
|
|
8
8
|
import { PropsContext as a, defaultProps as o } from "./context.js";
|
|
@@ -12,28 +12,28 @@ import { UI_COMMON_PREFIX as m } from "@unicom-cloud/utils/constants/ui";
|
|
|
12
12
|
import { jsx as h } from "react/jsx-runtime";
|
|
13
13
|
//#region components/common/timer/Timer.tsx
|
|
14
14
|
function g(i, s) {
|
|
15
|
-
let { style:
|
|
16
|
-
function
|
|
17
|
-
return p().format(
|
|
15
|
+
let g = c(a), { style: _, className: v, format: y = `${r} dddd`, callback: b, ...x } = t(i, { ...g }, o), S = `${m}-timer`, [C, w] = f({ time: T() });
|
|
16
|
+
function T() {
|
|
17
|
+
return p().format(y);
|
|
18
18
|
}
|
|
19
19
|
l(() => {
|
|
20
20
|
let t = n();
|
|
21
|
-
function n(r =
|
|
22
|
-
return e(
|
|
23
|
-
|
|
21
|
+
function n(r = T()) {
|
|
22
|
+
return e(b) && b(r), window.requestAnimationFrame(() => {
|
|
23
|
+
w({ time: r }), t = n();
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
return () => {
|
|
27
27
|
window.cancelAnimationFrame(t);
|
|
28
28
|
};
|
|
29
29
|
}, []);
|
|
30
|
-
let
|
|
30
|
+
let E = d(null);
|
|
31
31
|
return u(s, () => ({ getRootElement() {
|
|
32
|
-
return
|
|
33
|
-
} })), /* @__PURE__ */ h("
|
|
34
|
-
ref:
|
|
35
|
-
className:
|
|
36
|
-
children:
|
|
32
|
+
return E.current;
|
|
33
|
+
} })), /* @__PURE__ */ h("time", {
|
|
34
|
+
ref: E,
|
|
35
|
+
className: n(S, v),
|
|
36
|
+
children: C.time
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
var _ = s(g);
|
package/timer/constants.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
/* 独立思考,明辨是非 */
|
package/timer/context.js
CHANGED
|
File without changes
|
package/timer/index.js
CHANGED
package/timer/style/index.js
CHANGED
package/timer/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-08-06 15:14:52 星期四 山东省济南市 */
|
|
2
2
|
/* 独立思考,明辨是非 */
|