@unicom-cloud/ui-common 0.1.60 → 0.1.62
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 +1 -1
- package/animation/constants.js +1 -1
- package/animation/context.js +1 -1
- package/animation/index.js +1 -1
- package/animation/style/index.js +1 -1
- package/animation/utils.js +1 -1
- package/base/Base.js +1 -1
- package/base/constants.js +1 -1
- package/base/context.js +1 -1
- package/base/index.js +1 -1
- package/base/style/index.js +1 -1
- package/base/utils.js +1 -1
- package/border-beam/BorderBeam.js +3 -3
- 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 +10 -10
- 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 +1 -1
- package/development/constants.js +1 -1
- package/development/context.js +1 -1
- package/development/index.js +1 -1
- package/development/style/index.js +1 -1
- package/development/utils.js +1 -1
- package/empty/Empty.js +1 -1
- package/empty/constants.js +1 -1
- package/empty/context.js +1 -1
- package/empty/index.js +1 -1
- package/empty/style/index.js +1 -1
- package/empty/utils.js +1 -1
- package/flex/Flex.js +1 -1
- package/flex/FlexVertical.js +1 -1
- package/flex/constants.js +1 -1
- package/flex/context.js +1 -1
- package/flex/index.js +1 -1
- package/flex/interface.d.ts +41 -24
- package/flex/style/index.js +1 -1
- package/flex/utils.js +1 -1
- package/grid/Grid.js +1 -1
- package/grid/Item.js +8 -7
- package/grid/constants.js +1 -1
- package/grid/context.js +1 -1
- package/grid/index.js +1 -1
- package/grid/style/index.js +1 -1
- package/grid/utils.js +14 -13
- package/higher-order/with-speech-synthesis/constants.js +1 -1
- package/higher-order/with-speech-synthesis/context.js +1 -1
- 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.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.js +1 -1
- package/hooks/index.d.ts +2 -1
- package/hooks/index.js +18 -17
- package/hooks/use-async-effect/index.js +1 -1
- package/hooks/use-boolean/index.js +1 -1
- package/hooks/use-click-away/index.js +1 -1
- package/hooks/use-computed-state/index.js +1 -1
- package/hooks/use-controllable-value/index.js +1 -1
- package/hooks/use-cookie-state/index.js +1 -1
- package/hooks/use-count-down/index.js +1 -1
- package/hooks/use-counter/index.js +1 -1
- package/hooks/use-create/index.js +1 -1
- package/hooks/use-creation/index.js +1 -1
- package/hooks/use-debounce/index.js +1 -1
- package/hooks/use-debounce-effect/index.js +1 -1
- package/hooks/use-debounce-fn/index.js +1 -1
- package/hooks/use-deep-compare-effect/index.js +1 -1
- package/hooks/use-deep-compare-layout-effect/index.js +1 -1
- package/hooks/use-document-visibility/index.js +1 -1
- package/hooks/use-drag/index.js +1 -1
- package/hooks/use-drag-move/index.js +3 -2
- package/hooks/use-drop/index.js +1 -1
- package/hooks/use-dynamic-list/index.js +1 -1
- package/hooks/use-effect-event/index.js +1 -1
- package/hooks/use-event/index.js +1 -1
- package/hooks/use-event-emitter/index.js +1 -1
- package/hooks/use-event-listener/index.js +1 -1
- package/hooks/use-event-target/index.js +1 -1
- package/hooks/use-external/index.js +1 -1
- package/hooks/use-favicon/index.js +1 -1
- package/hooks/use-focus-within/index.js +1 -1
- package/hooks/use-force-update/index.js +1 -1
- package/hooks/use-fullscreen/index.js +1 -1
- package/hooks/use-get-state/index.js +1 -1
- package/hooks/use-history-travel/index.js +1 -1
- package/hooks/use-hover/index.js +1 -1
- package/hooks/use-id/index.js +1 -1
- package/hooks/use-in-viewport/index.js +1 -1
- package/hooks/use-infinite-scroll/index.js +1 -1
- package/hooks/use-intersection-observer/index.js +1 -1
- package/hooks/use-intersection-observers/index.js +1 -1
- package/hooks/use-interval/index.js +1 -1
- package/hooks/use-is-first-render/index.js +1 -1
- package/hooks/use-isomorphic-layout-effect/index.js +1 -1
- package/hooks/use-key-press/index.js +1 -1
- package/hooks/use-keyboard-event/index.js +1 -1
- package/hooks/use-latest/index.js +1 -1
- package/hooks/use-listen-window-resize/index.js +1 -1
- package/hooks/use-local-storage-state/index.js +1 -1
- package/hooks/use-lock-fn/index.js +1 -1
- package/hooks/use-long-press/index.js +1 -1
- package/hooks/use-map/index.js +1 -1
- package/hooks/use-media/index.js +1 -1
- package/hooks/use-memo/index.js +1 -1
- package/hooks/use-memoized-fn/index.js +1 -1
- package/hooks/use-merge-component-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-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-file/index.js +9 -8
- 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-ref-map/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 +15 -15
- 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 +11 -11
- package/hooks/use-request/src/useRequest.js +1 -1
- package/hooks/use-request/src/useRequestImplement.js +1 -1
- package/hooks/use-request/src/utils/cache.js +1 -1
- package/hooks/use-request/src/utils/cachePromise.js +1 -1
- package/hooks/use-request/src/utils/cacheSubscribe.js +1 -1
- package/hooks/use-request/src/utils/isDocumentVisible.js +1 -1
- package/hooks/use-request/src/utils/isOnline.js +1 -1
- package/hooks/use-request/src/utils/limit.js +1 -1
- package/hooks/use-request/src/utils/subscribeFocus.js +1 -1
- package/hooks/use-request/src/utils/subscribeReVisible.js +1 -1
- package/hooks/use-reset-state/index.js +1 -1
- package/hooks/use-resize-observer/index.js +1 -1
- package/hooks/use-resize-observers/index.js +1 -1
- package/hooks/use-responsive/index.js +1 -1
- package/hooks/use-safe-state/index.js +1 -1
- package/hooks/use-scroll/index.js +1 -1
- package/hooks/use-selections/index.js +1 -1
- package/hooks/use-session-storage-state/index.js +1 -1
- package/hooks/use-set/index.js +1 -1
- package/hooks/use-set-state/index.js +1 -1
- package/hooks/use-size/index.js +1 -1
- package/hooks/use-state-callback/index.js +1 -1
- package/hooks/use-state-with-promise/index.js +1 -1
- package/hooks/use-sync-state/index.js +1 -1
- package/hooks/use-text-selection/index.js +1 -1
- package/hooks/use-theme/index.js +1 -1
- package/hooks/use-throttle/index.js +1 -1
- package/hooks/use-throttle-effect/index.js +1 -1
- package/hooks/use-throttle-fn/index.js +1 -1
- package/hooks/use-throttle-fn-with-raf/index.d.ts +2 -5
- package/hooks/use-throttle-fn-with-raf/index.js +4 -22
- package/hooks/use-throttle-fn-with-request-animation-frame/index.d.ts +5 -0
- package/hooks/use-throttle-fn-with-request-animation-frame/index.js +26 -0
- 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 +2 -2
- 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/File.js +1 -1
- package/icons/file/constants.js +1 -1
- package/icons/file/context.js +1 -1
- package/icons/file/index.js +1 -1
- package/icons/file/style/index.js +1 -1
- package/index.js +534 -529
- package/morphicons/core/interpolate.js +1 -1
- package/morphicons/core/normalize.js +1 -1
- package/morphicons/core/resample.js +1 -1
- package/morphicons/core/serialize.js +1 -1
- package/morphicons/core/spring.js +1 -1
- package/morphicons/dom/index.js +1 -1
- package/morphicons/index.js +1 -1
- package/morphicons/react/index.js +1 -1
- package/package.json +1 -1
- package/progress/Progress.js +1 -1
- package/progress/constants.js +1 -1
- package/progress/context.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 +1 -1
- package/resize-observer/SingleObserver.js +3 -2
- package/resize-observer/constants.js +1 -1
- package/resize-observer/context.js +1 -1
- 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 +10 -9
- package/space/SpaceVertical.js +1 -1
- package/space/constants.js +1 -1
- package/space/context.js +1 -1
- package/space/index.js +1 -1
- package/space/style/index.js +1 -1
- package/space/utils.js +1 -1
- package/suspense-fallback-test/NeverLoadLazy.js +1 -1
- package/suspense-fallback-test/SuspenseFallbackTest.js +1 -1
- package/suspense-fallback-test/constants.js +1 -1
- package/suspense-fallback-test/context.js +1 -1
- 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 +1 -1
- package/timer/constants.js +1 -1
- package/timer/context.js +1 -1
- package/timer/index.js +1 -1
- package/timer/style/index.js +1 -1
- package/timer/utils.js +1 -1
- package/transition/Transition.js +9 -8
- package/transition/TransitionCSS.js +1 -1
- package/transition/TransitionGroup.js +1 -1
- package/transition/TransitionStyle.js +1 -1
- package/transition/constants.js +1 -1
- package/transition/context.js +1 -1
- package/transition/index.js +1 -1
- package/transition/interface.js +1 -1
- package/transition/style/index.js +1 -1
- package/transition/utils.js +1 -1
- package/utils/callbackOriginRef.js +1 -1
- package/utils/confetti.js +1 -1
- package/utils/constants.js +1 -1
- package/utils/copy.js +1 -1
- package/utils/createRoot.js +1 -1
- package/utils/css.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/document.js +1 -1
- package/utils/dom.d.ts +4 -2
- package/utils/dom.js +47 -58
- package/utils/file.js +1 -1
- package/utils/fillNBSP.js +1 -1
- package/utils/getCompatProp.js +1 -1
- package/utils/getElement.js +14 -14
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.js +1 -1
- package/utils/getPrefixCls.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 +5 -6
- package/utils/getStringLength.js +1 -1
- package/utils/getUrlSearchParam.js +1 -1
- package/utils/index.js +227 -225
- package/utils/initAllLineClamp.js +1 -1
- package/utils/injectLineClamp.js +1 -1
- package/utils/interface.js +1 -1
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.js +1 -1
- package/utils/keyboardCode.js +1 -1
- package/utils/lodash.js +1 -1
- package/utils/mergeProps.js +1 -1
- package/utils/mergedToString.js +1 -1
- package/utils/migrateLegacyProps.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/react19Adapter.js +1 -1
- package/utils/reactNode.js +1 -1
- package/utils/ref.js +1 -1
- package/utils/resizeObserver.js +5 -5
- package/utils/scrollIntoViewIfNeeded.js +1 -1
- package/utils/scrollTo.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/tinycolor.js +1 -1
- package/utils/toArray.js +1 -1
- package/utils/tunnel.js +1 -1
- package/utils/warning.js +1 -1
- package/version/index.js +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-24 11:22:31 星期二 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
// \0rolldown/runtime.js
|
|
4
4
|
var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, n = Object.getOwnPropertyNames, r = Object.prototype.hasOwnProperty, i = (t, n) => {
|
package/animation/Animation.js
CHANGED
package/animation/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-24 11:22:31 星期二 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
// components/common/animation/constants.ts
|
|
4
4
|
var e = {}, t = /* @__PURE__ */ "back-in-down.back-in-left.back-in-right.back-in-up.back-out-down.back-out-left.back-out-right.back-out-up.bounce.bounce-in.bounce-in-down.bounce-in-left.bounce-in-right.bounce-in-up.bounce-out.bounce-out-down.bounce-out-left.bounce-out-right.bounce-out-up.flash.pulse.rubber-band.shake.shake-x.shake-y.head-shake.swing.tada.wobble.jello.heart-beat.fade-in.fade-in-down.fade-in-down-big.fade-in-left.fade-in-left-big.fade-in-right.fade-in-right-big.fade-in-up.fade-in-up-big.fade-in-top-left.fade-in-top-right.fade-in-bottom-left.fade-in-bottom-right.fade-out.fade-out-down.fade-out-down-big.fade-out-left.fade-out-left-big.fade-out-right.fade-out-right-big.fade-out-up.fade-out-up-big.fade-out-top-left.fade-out-top-right.fade-out-bottom-right.fade-out-bottom-left.flip.flip-in-x.flip-in-y.flip-out-x.flip-out-y.light-speed-in-right.light-speed-in-left.light-speed-out-right.light-speed-out-left.rotate-in.rotate-in-down-left.rotate-in-down-right.rotate-in-up-left.rotate-in-up-right.rotate-out.rotate-out-down-left.rotate-out-down-right.rotate-out-up-left.rotate-out-up-right.hinge.jack-in-the-box.roll-in.roll-out.zoom-in.zoom-in-down.zoom-in-left.zoom-in-right.zoom-in-up.zoom-out.zoom-out-down.zoom-out-left.zoom-out-right.zoom-out-up.slide-in-down.slide-in-left.slide-in-right.slide-in-up.slide-out-down.slide-out-left.slide-out-right.slide-out-up".split(".");
|
package/animation/context.js
CHANGED
package/animation/index.js
CHANGED
package/animation/style/index.js
CHANGED
package/animation/utils.js
CHANGED
package/base/Base.js
CHANGED
package/base/constants.js
CHANGED
package/base/context.js
CHANGED
package/base/index.js
CHANGED
package/base/style/index.js
CHANGED
package/base/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-24 11:22:31 星期二 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../hooks/use-merge-component-props/index.js";
|
|
4
4
|
import { utils_exports as t } from "../utils/index.js";
|
|
@@ -12,7 +12,7 @@ import l from "./hooks/useBorderSize.js";
|
|
|
12
12
|
import u from "./hooks/useChildDom.js";
|
|
13
13
|
import { getBorderBeamGradient as d } from "./utils.js";
|
|
14
14
|
import { forwardRef as f, useContext as p, useImperativeHandle as m, useMemo as h, useRef as g } from "react";
|
|
15
|
-
import {
|
|
15
|
+
import { numberToCssPx as _ } from "@unicom-cloud/utils/css";
|
|
16
16
|
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
17
17
|
// components/common/border-beam/BorderBeam.tsx
|
|
18
18
|
function x(i, f) {
|
|
@@ -26,7 +26,7 @@ function x(i, f) {
|
|
|
26
26
|
let e = o.find((e, t, n) => e.key === E);
|
|
27
27
|
e && (M = e.color);
|
|
28
28
|
}
|
|
29
|
-
let N = r("border-beam"), [P, F] = u(w), { borderWidth: I, borderRadius: L } = l(F), R = h(() => d(M), [M]), z = (e) => (0, t.isString)(e) ? `calc(-1 * ${e})` :
|
|
29
|
+
let N = r("border-beam"), [P, F] = u(w), { borderWidth: I, borderRadius: L } = l(F), R = h(() => d(M), [M]), z = (e) => (0, t.isString)(e) ? `calc(-1 * ${e})` : _(-1 * e), B = h(() => (0, t.isNonNullable)(D) ? z(D) : I.map(z).join(" "), [I, D]), V = {}, H = g(null);
|
|
30
30
|
return m(f, () => ({ getRootElement() {
|
|
31
31
|
return H.current;
|
|
32
32
|
} })), /* @__PURE__ */ b(v, { children: [P, /* @__PURE__ */ y(a, {
|
package/border-beam/Effect.js
CHANGED
package/border-beam/constants.js
CHANGED
package/border-beam/context.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-24 11:22:31 星期二 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import "../../utils/
|
|
6
|
-
import {
|
|
3
|
+
import "../../utils/dom.js";
|
|
4
|
+
import e from "../../utils/getElement.js";
|
|
5
|
+
import { cloneElement as t } from "../../utils/reactNode.js";
|
|
6
|
+
import { getNodeRef as n, supportRef as r, useComposeRef as i } from "../../utils/ref.js";
|
|
7
7
|
import { isValidElement as a, useCallback as o, useState as s } from "react";
|
|
8
8
|
// components/common/border-beam/hooks/useChildDom.ts
|
|
9
9
|
var c = (c) => {
|
|
10
|
-
let [l, u] = s(null), d = a(c) ? c : null, f = o((
|
|
11
|
-
let
|
|
12
|
-
u((e) => e ===
|
|
13
|
-
}, []), p = n(
|
|
14
|
-
return
|
|
10
|
+
let [l, u] = s(null), d = a(c) ? c : null, f = o((t) => {
|
|
11
|
+
let n = e(t);
|
|
12
|
+
u((e) => e === n ? e : n);
|
|
13
|
+
}, []), p = i(n(d), f);
|
|
14
|
+
return r(d) ? [t(d, { ref: p }), l] : [c, l];
|
|
15
15
|
};
|
|
16
16
|
export { c as default };
|
|
17
17
|
/* 欲穷千里目,更上一层楼 */
|
package/border-beam/index.js
CHANGED
package/border-beam/utils.js
CHANGED
package/development/constants.js
CHANGED
package/development/context.js
CHANGED
package/development/index.js
CHANGED
package/development/utils.js
CHANGED
package/empty/Empty.js
CHANGED
package/empty/constants.js
CHANGED
package/empty/context.js
CHANGED
package/empty/index.js
CHANGED
package/empty/style/index.js
CHANGED
package/empty/utils.js
CHANGED
package/flex/Flex.js
CHANGED
package/flex/FlexVertical.js
CHANGED
package/flex/constants.js
CHANGED
package/flex/context.js
CHANGED
package/flex/index.js
CHANGED
package/flex/interface.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
1
|
import type React from 'react';
|
|
2
|
+
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
3
3
|
export type GapProperty = 'gap' | 'rowGap' | 'columnGap';
|
|
4
4
|
export type SizeType = 'default' | 'mini' | 'small' | 'medium' | 'large' | '1x' | '2x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | 'x1' | 'x2' | 'x3' | 'x4' | 'x5' | 'x6' | 'x7' | 'x8' | 'x9';
|
|
5
5
|
export type GapType = SizeType | React.CSSProperties['gap'];
|
|
@@ -9,69 +9,86 @@ export type GapType = SizeType | React.CSSProperties['gap'];
|
|
|
9
9
|
*/
|
|
10
10
|
export interface FlexProps extends PropsWithChildren, HTMLAttributes<HTMLElement> {
|
|
11
11
|
/**
|
|
12
|
-
* @zh
|
|
12
|
+
* @zh 是否 inline-flex,true 时元素会像行内元素一样参与文档流
|
|
13
|
+
* @en Whether to use inline-flex. When true, the element participates in the document flow like an inline element
|
|
14
|
+
* @defaultValue false
|
|
13
15
|
*/
|
|
14
16
|
inline?: boolean;
|
|
15
17
|
/**
|
|
16
|
-
* @zh
|
|
18
|
+
* @zh 主轴方向
|
|
19
|
+
* @en Flex main axis direction
|
|
17
20
|
*/
|
|
18
21
|
direction?: React.CSSProperties['flexDirection'];
|
|
19
22
|
/**
|
|
20
|
-
* @zh
|
|
21
|
-
* @en
|
|
23
|
+
* @zh 换行方式。boolean 时 true='wrap'、false='nowrap',也可以直接传 flexWrap 值
|
|
24
|
+
* @en Wrap behavior. `true` → `'wrap'`, `false` → `'nowrap'`, or pass a flexWrap value directly
|
|
22
25
|
*/
|
|
23
26
|
wrap?: boolean | React.CSSProperties['flexWrap'];
|
|
24
27
|
/**
|
|
25
28
|
* @zh 主轴对齐方式
|
|
26
|
-
* @en
|
|
29
|
+
* @en Main axis alignment (justify-content)
|
|
27
30
|
*/
|
|
28
31
|
justifyContent?: React.CSSProperties['justifyContent'];
|
|
32
|
+
/**
|
|
33
|
+
* @zh 主轴上子项的默认对齐(多格子/多行时生效)
|
|
34
|
+
* @en Default main axis alignment for child items (effective in multi-row/multi-column layouts)
|
|
35
|
+
*/
|
|
29
36
|
justifyItems?: React.CSSProperties['justifyItems'];
|
|
30
37
|
/**
|
|
31
38
|
* @zh 交叉轴对齐方式
|
|
32
|
-
* @en
|
|
39
|
+
* @en Cross axis alignment (align-items)
|
|
33
40
|
*/
|
|
34
41
|
alignItems?: React.CSSProperties['alignItems'];
|
|
42
|
+
/**
|
|
43
|
+
* @zh 多行/多列时交叉轴上的整体对齐方式
|
|
44
|
+
* @en Cross axis alignment for multiple lines/columns (align-content)
|
|
45
|
+
*/
|
|
35
46
|
alignContent?: React.CSSProperties['alignContent'];
|
|
36
47
|
/**
|
|
37
|
-
* @zh
|
|
38
|
-
* @en
|
|
39
|
-
* @
|
|
40
|
-
* @values 'mini'
|
|
48
|
+
* @zh 子项之间的间距。支持语义 token(`small` / `medium` / `1x` …)或任意合法 CSS gap 值;也可传 `[rowGap, columnGap]` 数组同时设置行列
|
|
49
|
+
* @en Space between children. Accepts semantic tokens (`small` / `medium` / `1x` …) or any valid CSS gap value. Pass `[rowGap, columnGap]` to set both axes at once
|
|
50
|
+
* @defaultValue small
|
|
51
|
+
* @values 'default' | 'mini' | 'small' | 'medium' | 'large' | '1x'-'9x' | 'x1'-'x9' | CSS gap value
|
|
41
52
|
*/
|
|
42
53
|
gap?: GapType | GapType[];
|
|
43
54
|
/**
|
|
44
|
-
* @zh 行与行之间的间距(优先级高于 gap
|
|
45
|
-
* @en
|
|
46
|
-
* @defaultValue 0
|
|
55
|
+
* @zh 行与行之间的间距(优先级高于 gap 中的 row 分量)
|
|
56
|
+
* @en Space between rows (takes precedence over the row component of `gap`)
|
|
47
57
|
*/
|
|
48
58
|
rowGap?: GapType;
|
|
49
59
|
/**
|
|
50
|
-
* @zh 列与列之间的间距(优先级高于 gap
|
|
51
|
-
* @en
|
|
52
|
-
* @defaultValue 0
|
|
60
|
+
* @zh 列与列之间的间距(优先级高于 gap 中的 column 分量)
|
|
61
|
+
* @en Space between columns (takes precedence over the column component of `gap`)
|
|
53
62
|
*/
|
|
54
63
|
columnGap?: GapType;
|
|
55
64
|
/**
|
|
56
|
-
* @zh
|
|
57
|
-
* @en Custom component
|
|
65
|
+
* @zh 自定义渲染的 HTML 标签或组件
|
|
66
|
+
* @en Custom HTML tag or React component to render as the root
|
|
67
|
+
* @defaultValue 'div'
|
|
58
68
|
*/
|
|
59
69
|
component?: React.ElementType;
|
|
60
70
|
/**
|
|
61
|
-
* @zh 是否启用RTL
|
|
62
|
-
* @en Whether to enable
|
|
71
|
+
* @zh 是否启用 RTL(从右到左)布局
|
|
72
|
+
* @en Whether to enable right-to-left layout
|
|
73
|
+
* @defaultValue false
|
|
63
74
|
*/
|
|
64
75
|
rtl?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* @zh flex-direction + flex-wrap 的简写,优先级高于分别设置 direction / wrap
|
|
78
|
+
* @en Shorthand for `flex-direction` + `flex-wrap`. Takes precedence over separate `direction` / `wrap` props
|
|
79
|
+
*/
|
|
65
80
|
flow?: React.CSSProperties['flexFlow'];
|
|
66
81
|
/**
|
|
67
|
-
* @zh
|
|
82
|
+
* @zh 是否主轴 + 交叉轴都居中。为 true 时等价于同时设置 justifyContent='center' 和 alignItems='center'
|
|
83
|
+
* @en Whether to center on both axes. `true` is equivalent to `justifyContent='center'` + `alignItems='center'`
|
|
84
|
+
* @defaultValue false
|
|
68
85
|
*/
|
|
69
86
|
center?: boolean;
|
|
70
87
|
}
|
|
71
88
|
export interface FlexVerticalProps extends Omit<FlexProps, 'direction'> {
|
|
72
89
|
/**
|
|
73
|
-
* @zh
|
|
74
|
-
* @en
|
|
90
|
+
* @zh 垂直布局方向(正序或倒序)
|
|
91
|
+
* @en Vertical layout direction (normal or reversed)
|
|
75
92
|
*/
|
|
76
93
|
direction?: 'column' | 'column-reverse';
|
|
77
94
|
}
|
package/flex/style/index.js
CHANGED
package/flex/utils.js
CHANGED
package/grid/Grid.js
CHANGED
package/grid/Item.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-24 11:22:31 星期二 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
-
import e from "../
|
|
4
|
-
import t from "../
|
|
5
|
-
import
|
|
3
|
+
import e from "../utils/getElement.js";
|
|
4
|
+
import t from "../hooks/use-merge-component-props/index.js";
|
|
5
|
+
import n from "../utils/className.js";
|
|
6
|
+
import "../utils/dom.js";
|
|
6
7
|
import r from "../utils/getPrefixCls.js";
|
|
7
8
|
import { COMPONENT_INFO_GRID_ITEM as i } from "../utils/names.js";
|
|
8
9
|
import { defaultPropsGridItem as a } from "./constants.js";
|
|
@@ -13,7 +14,7 @@ import { isExist as m, isNumber as h } from "@unicom-cloud/utils/is";
|
|
|
13
14
|
import { jsx as g } from "react/jsx-runtime";
|
|
14
15
|
// components/common/grid/Item.tsx
|
|
15
16
|
function _(i, l) {
|
|
16
|
-
let _ = u(s), { columnGap: v, columns: y } = u(o), b = r("grid-item"), x = p(null), { style: S, className: C, children: w, offset: T, span: E, area: D, order: O, column: k, row: A, columnStart: j, columnEnd: M, rowStart: N, rowEnd: P, justifySelf: F, alignSelf: I, placeSelf: L } =
|
|
17
|
+
let _ = u(s), { columnGap: v, columns: y } = u(o), b = r("grid-item"), x = p(null), { style: S, className: C, children: w, offset: T, span: E, area: D, order: O, column: k, row: A, columnStart: j, columnEnd: M, rowStart: N, rowEnd: P, justifySelf: F, alignSelf: I, placeSelf: L } = t({
|
|
17
18
|
internalProps: i,
|
|
18
19
|
contextProps: _,
|
|
19
20
|
globalProps: {},
|
|
@@ -23,14 +24,14 @@ function _(i, l) {
|
|
|
23
24
|
offset: T
|
|
24
25
|
}) : {}, B = {};
|
|
25
26
|
return h(R) && (B.gridColumnStart = `span ${R}`, h(v) && h(z) && z > 0 && (B.marginInlineStart = `calc(${`(100% - ${v * (R - 1)}px) / ${R}`} * ${z} + ${v * z}px)`), B.gridColumnEnd = `span ${E}`), m(O) && (B.order = O), m(k) && (B.gridColumn = k), m(j) && (B.gridColumnStart = j), m(M) && (B.gridColumnEnd = M), m(A) && (B.gridRow = A), m(N) && (B.gridRowStart = N), m(P) && (B.gridRowEnd = P), m(D) && (B.gridArea = D), m(F) && (B.justifySelf = F), m(I) && (B.alignSelf = I), m(L) && (B.placeSelf = L), d(() => () => {}, []), f(l, () => ({ getRootElement() {
|
|
26
|
-
return
|
|
27
|
+
return e(x);
|
|
27
28
|
} })), /* @__PURE__ */ g("div", {
|
|
28
29
|
ref: x,
|
|
29
30
|
style: {
|
|
30
31
|
...B,
|
|
31
32
|
...S
|
|
32
33
|
},
|
|
33
|
-
className:
|
|
34
|
+
className: n(b, C),
|
|
34
35
|
children: w
|
|
35
36
|
});
|
|
36
37
|
}
|
package/grid/constants.js
CHANGED
package/grid/context.js
CHANGED
package/grid/index.js
CHANGED
package/grid/style/index.js
CHANGED
package/grid/utils.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-24 11:22:31 星期二 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { isExist as e, isNumber as t, isPlainObject as n, isString as r } from "@unicom-cloud/utils/is";
|
|
4
|
+
import { numberToCssPx as i } from "@unicom-cloud/utils/css";
|
|
4
5
|
// components/common/grid/utils.ts
|
|
5
|
-
function
|
|
6
|
+
function a(e, { span: t, offset: n }) {
|
|
6
7
|
let r = t ?? 1, i = n ?? 0, a = Math.min(i, e);
|
|
7
8
|
return {
|
|
8
9
|
span: Math.min(a > 0 ? r + i : r, e),
|
|
9
10
|
offset: a
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
|
-
function a
|
|
13
|
-
if (!e(
|
|
14
|
-
let
|
|
15
|
-
if (r(
|
|
16
|
-
else if (t(
|
|
17
|
-
else if (n(
|
|
18
|
-
let e =
|
|
19
|
-
|
|
20
|
-
} else
|
|
21
|
-
return
|
|
13
|
+
function o(a) {
|
|
14
|
+
if (!e(a)) return;
|
|
15
|
+
let o = "auto-fit", s;
|
|
16
|
+
if (r(a)) s = a;
|
|
17
|
+
else if (t(a)) s = `repeat(${a}, minmax(0, 1fr))`;
|
|
18
|
+
else if (n(a)) {
|
|
19
|
+
let e = a, t = e.count ?? e.type ?? o, [n, r] = [e.min ?? "0px", e.max ?? "1fr"].map((e, t, n) => i(e));
|
|
20
|
+
s = `repeat(${t}, minmax(${n}, ${r}))`;
|
|
21
|
+
} else s = `repeat(${o}, minmax(0px, 1fr))`;
|
|
22
|
+
return s;
|
|
22
23
|
}
|
|
23
|
-
export {
|
|
24
|
+
export { o as resolveGridTemplateColumns, a as resolveItemData };
|
|
24
25
|
/* 欲穷千里目,更上一层楼 */
|
|
25
26
|
/* 独立思考,明辨是非 */
|