deepsea-components 5.7.4 → 5.7.6
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/dist/cjs/components/AutoFit.js +1 -1
- package/dist/cjs/components/AutoFit.js.map +2 -2
- package/dist/cjs/components/AutoScroll.js +1 -1
- package/dist/cjs/components/AutoScroll.js.map +2 -2
- package/dist/cjs/components/AutoSizeTextarea.js +1 -1
- package/dist/cjs/components/AutoSizeTextarea.js.map +2 -2
- package/dist/cjs/components/CircleText.js +0 -1
- package/dist/cjs/components/CircleText.js.map +2 -2
- package/dist/cjs/components/CopyButton.d.ts +7 -3
- package/dist/cjs/components/CopyButton.js +1 -0
- package/dist/cjs/components/CopyButton.js.map +2 -2
- package/dist/cjs/components/Echart.d.ts +2 -2
- package/dist/cjs/components/Echart.js +1 -0
- package/dist/cjs/components/Echart.js.map +2 -2
- package/dist/cjs/components/Flow.d.ts +1 -1
- package/dist/cjs/components/Flow.js +1 -1
- package/dist/cjs/components/Flow.js.map +2 -2
- package/dist/cjs/components/FormLabel.d.ts +2 -2
- package/dist/cjs/components/FormLabel.js +15 -18
- package/dist/cjs/components/FormLabel.js.map +2 -2
- package/dist/cjs/components/InfiniteScroll.d.ts +26 -3
- package/dist/cjs/components/InfiniteScroll.js +2 -1
- package/dist/cjs/components/InfiniteScroll.js.map +2 -2
- package/dist/cjs/components/LoopSwiper.js +1 -1
- package/dist/cjs/components/LoopSwiper.js.map +2 -2
- package/dist/cjs/components/Ring.js +0 -1
- package/dist/cjs/components/Ring.js.map +2 -2
- package/dist/cjs/components/Scroll.d.ts +1 -1
- package/dist/cjs/components/Scroll.js +1 -1
- package/dist/cjs/components/Scroll.js.map +2 -2
- package/dist/cjs/components/SectionRing.d.ts +2 -2
- package/dist/cjs/components/SectionRing.js +6 -4
- package/dist/cjs/components/SectionRing.js.map +2 -2
- package/dist/cjs/components/Skeleton.js +2 -4
- package/dist/cjs/components/Skeleton.js.map +2 -2
- package/dist/cjs/components/Title.d.ts +2 -2
- package/dist/cjs/components/Title.js +1 -0
- package/dist/cjs/components/Title.js.map +2 -2
- package/dist/cjs/components/TransitionBox.js.map +1 -1
- package/dist/cjs/components/Trapezium.js +1 -2
- package/dist/cjs/components/Trapezium.js.map +2 -2
- package/dist/esm/components/AutoFit.js +1 -1
- package/dist/esm/components/AutoFit.js.map +1 -1
- package/dist/esm/components/AutoScroll.js +1 -1
- package/dist/esm/components/AutoScroll.js.map +1 -1
- package/dist/esm/components/AutoSizeTextarea.js +1 -1
- package/dist/esm/components/AutoSizeTextarea.js.map +1 -1
- package/dist/esm/components/CircleText.js +0 -2
- package/dist/esm/components/CircleText.js.map +1 -1
- package/dist/esm/components/CopyButton.d.ts +7 -3
- package/dist/esm/components/CopyButton.js +2 -0
- package/dist/esm/components/CopyButton.js.map +1 -1
- package/dist/esm/components/Echart.d.ts +2 -2
- package/dist/esm/components/Echart.js +2 -0
- package/dist/esm/components/Echart.js.map +1 -1
- package/dist/esm/components/Flow.d.ts +1 -1
- package/dist/esm/components/Flow.js +1 -1
- package/dist/esm/components/Flow.js.map +1 -1
- package/dist/esm/components/FormLabel.d.ts +2 -2
- package/dist/esm/components/FormLabel.js +24 -27
- package/dist/esm/components/FormLabel.js.map +1 -1
- package/dist/esm/components/InfiniteScroll.d.ts +26 -3
- package/dist/esm/components/InfiniteScroll.js +3 -1
- package/dist/esm/components/InfiniteScroll.js.map +1 -1
- package/dist/esm/components/LoopSwiper.js +1 -1
- package/dist/esm/components/LoopSwiper.js.map +1 -1
- package/dist/esm/components/Ring.js +0 -2
- package/dist/esm/components/Ring.js.map +1 -1
- package/dist/esm/components/Scroll.d.ts +1 -1
- package/dist/esm/components/Scroll.js +1 -1
- package/dist/esm/components/Scroll.js.map +1 -1
- package/dist/esm/components/SectionRing.d.ts +2 -2
- package/dist/esm/components/SectionRing.js +6 -4
- package/dist/esm/components/SectionRing.js.map +1 -1
- package/dist/esm/components/Skeleton.js +3 -6
- package/dist/esm/components/Skeleton.js.map +1 -1
- package/dist/esm/components/Title.d.ts +2 -2
- package/dist/esm/components/Title.js +2 -0
- package/dist/esm/components/Title.js.map +1 -1
- package/dist/esm/components/TransitionBox.js.map +1 -1
- package/dist/esm/components/Trapezium.js +1 -3
- package/dist/esm/components/Trapezium.js.map +1 -1
- package/package.json +2 -2
- package/src/components/AutoFit.tsx +3 -2
- package/src/components/AutoScroll.tsx +3 -2
- package/src/components/AutoSizeTextarea.tsx +3 -2
- package/src/components/CircleText.tsx +0 -2
- package/src/components/CopyButton.tsx +4 -2
- package/src/components/Echart.tsx +7 -5
- package/src/components/Flow.tsx +3 -2
- package/src/components/FormLabel.tsx +20 -23
- package/src/components/InfiniteScroll.tsx +6 -3
- package/src/components/LoopSwiper.tsx +3 -2
- package/src/components/Ring.tsx +1 -3
- package/src/components/Scroll.tsx +5 -3
- package/src/components/SectionRing.tsx +5 -4
- package/src/components/Skeleton.tsx +3 -6
- package/src/components/Title.tsx +5 -2
- package/src/components/TransitionBox.tsx +1 -1
- package/src/components/Trapezium.tsx +2 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["css","useSize","clsx","useEffect","useImperativeHandle","useRef","useState","px","transformCSSVariable","jsx","_jsx","getGapRange","gap","Array","isArray","getGapCountAndSize","width","itemWidth","minGap","maxGap","count","Math","floor","averageGap","ManualFlow","props","itemHeight","columnGap","rowGap","maxRows","data","render","keyExactor","className","style","wrapperClassName","wrapperStyle","throttle","transitionDuration","onSizeChange","containerClassName","containerStyle","element","rest","minColumnGap","maxColumnGap","columnCount","columnGapSize","setGapAndCount","ele","contentRows","ceil","length","contentShownRows","min","height","getPosition","index","y","x","left","top","getHidden","current","task","timeout","setTimeout","clearTimeout","rowCount","overflow","itemCount","ref","children","map","item","arr","transition","display","Flow","size"],"sources":["../../../src/components/Flow.tsx"],"sourcesContent":["\"use client\"\n\nimport { css } from \"@emotion/css\"\nimport { useSize } from \"ahooks\"\nimport { clsx } from \"deepsea-tools\"\nimport { CSSProperties, HTMLAttributes, Key, ReactNode, RefObject, useEffect, useImperativeHandle, useRef, useState } from \"react\"\nimport { px, transformCSSVariable } from \"../utils\"\n\nexport interface FlowSizeData {\n /** 容器宽度 */\n width: number\n /** 容器高度 */\n height: number\n /** 元素宽度 */\n itemWidth: number\n /** 元素高度 */\n itemHeight: number\n /** 列间距 */\n columnGap: number\n /** 列数 */\n columnCount: number\n /** 行间距 */\n rowGap: number\n /** 行数 */\n rowCount: number\n /** 元素格数 */\n itemCount: number\n /** 最大行数 */\n maxRows: number | null\n /** 是否有元素被隐藏 */\n overflow: boolean\n}\n\nexport interface FlowProps<T> extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** 元素宽度 */\n itemWidth: number\n /** 元素高度 */\n itemHeight: number\n /**\n * 列间距\n * 1. 如果是数字,表示列间距是固定的\n * 2. 如果是 auto,表示会在尽可能放进更多列的情况下,列间距是平均的\n * 2. 如果是数组,表示列间距是区间的,第一个元素是最小值,第二个元素是最大值\n */\n columnGap?: number | \"auto\" | [number | \"auto\", number | \"auto\"]\n /** 行间距 */\n rowGap?: number\n gap?: number\n /** 最大行数 */\n maxRows?: number | null\n /** 源数据 */\n data?: T[]\n /** 渲染 */\n render: (item: T, index: number, arr: T[]) => ReactNode\n /** key释放器,默认为 index */\n keyExactor?: (item: T, index: number, arr: T[]) => Key\n /**\n * 渲染的元素由两层容器包裹,外层容器类名\n */\n wrapperClassName?: string\n /**\n * 渲染的元素由两层容器包裹,外层容器样式\n */\n wrapperStyle?: CSSProperties\n /**\n * 渲染的元素由两层容器包裹,内层容器类名\n */\n containerClassName?: string\n /**\n * 渲染的元素由两层容器包裹,内层容器样式\n */\n containerStyle?: CSSProperties\n /** 节流时间,单位毫秒,默认200ms,传入 0 不节流 */\n throttle?: number\n /** 动画时间,单位毫秒,默认400ms,传入 0 不展示动画 */\n transitionDuration?: number\n /** 变化的回调函数 */\n onSizeChange?: (sizeData: FlowSizeData) => void\n element?: RefObject<HTMLDivElement>\n}\n\nexport function getGapRange(gap?: undefined | number | \"auto\" | (number | \"auto\")[]): [number, number | \"auto\"] {\n if (typeof gap === \"number\") return [gap, gap]\n if (Array.isArray(gap)) return [typeof gap[0] === \"number\" ? gap[0] : 0, gap[1]]\n return [0, \"auto\"]\n}\n\nexport interface GapAndCount {\n count: number\n gap: number\n}\n\nexport function getGapCountAndSize(width: number, itemWidth: number, minGap: number, maxGap: number | \"auto\"): GapAndCount {\n const count = Math.floor((width + minGap) / (itemWidth + minGap)) || 1\n if (count === 1) return { count, gap: 0 }\n const averageGap = (width - itemWidth * count) / (count - 1)\n if (averageGap < minGap) return { count, gap: minGap }\n if (maxGap !== \"auto\" && averageGap > maxGap) return { count, gap: maxGap }\n return { count, gap: averageGap }\n}\n\nexport interface ManualFlowProps<T> extends FlowProps<T> {\n /** 组件宽度,必须指定 */\n width: number\n}\n\n/** 手动组件,由外界指定宽度,性能更好 */\nexport function ManualFlow<T>(props: ManualFlowProps<T>) {\n let {\n itemWidth,\n itemHeight,\n columnGap,\n rowGap,\n maxRows,\n data = [],\n render,\n keyExactor,\n className,\n style,\n wrapperClassName,\n wrapperStyle,\n throttle,\n transitionDuration,\n onSizeChange,\n containerClassName,\n containerStyle,\n gap = 0,\n width,\n element,\n ...rest\n } = props\n rowGap ??= gap\n columnGap ??= gap\n const [minColumnGap, maxColumnGap] = getGapRange(columnGap)\n const [{ count: columnCount, gap: columnGapSize }, setGapAndCount] = useState(() => getGapCountAndSize(width, itemWidth, minColumnGap, maxColumnGap))\n const ele = useRef<HTMLDivElement>(null)\n const contentRows = Math.ceil(data.length / columnCount)\n const contentShownRows = typeof maxRows === \"number\" ? Math.min(contentRows, maxRows) : contentRows\n const height = contentShownRows > 0 ? contentShownRows * (itemHeight + rowGap) - rowGap : 0\n\n function getPosition(index: number) {\n const y = Math.floor(index / columnCount)\n const x = index - y * columnCount\n return {\n left: x * (itemWidth + columnGapSize),\n top: y * (itemHeight + rowGap!),\n }\n }\n\n function getHidden(index: number) {\n if (typeof maxRows !== \"number\") return false\n return index >= maxRows * columnCount\n }\n\n useImperativeHandle(element, () => ele.current!, [ele.current])\n\n useEffect(() => {\n function task() {\n setGapAndCount(getGapCountAndSize(width, itemWidth, minColumnGap, maxColumnGap))\n }\n if (throttle === 0) return task()\n const timeout = setTimeout(task, throttle || 200)\n return () => clearTimeout(timeout)\n }, [width, itemWidth, throttle, minColumnGap, maxColumnGap])\n\n useEffect(() => {\n onSizeChange?.({\n width,\n height,\n itemWidth,\n itemHeight,\n columnGap: columnGapSize,\n columnCount,\n rowGap: rowGap!,\n rowCount: contentShownRows,\n overflow: data.length > contentShownRows * columnCount,\n itemCount: data.length,\n maxRows: maxRows ?? null,\n })\n }, [width, height, columnGapSize, columnCount, rowGap, contentShownRows, data.length, itemWidth, itemHeight, maxRows])\n\n return (\n <div\n ref={ele}\n className={clsx(\n css`\n position: relative;\n height: var(--height);\n overflow: hidden;\n `,\n className,\n )}\n style={transformCSSVariable({ height: px(height) }, style)}\n {...rest}\n >\n {data.map((item, index, arr) => (\n <div\n key={keyExactor ? keyExactor(item, index, arr) : index}\n className={clsx(\n css`\n position: absolute;\n width: var(--width);\n height: var(--height);\n transition: var(--transition);\n left: 0;\n top: 0;\n transform: translate(var(--left), var(--top));\n `,\n wrapperClassName,\n )}\n style={transformCSSVariable(\n {\n width: px(itemWidth),\n height: px(itemHeight),\n transition: transitionDuration === 0 ? \"none\" : `all ${transitionDuration || 400}ms`,\n left: px(getPosition(index).left),\n top: px(getPosition(index).top),\n },\n wrapperStyle,\n )}\n >\n <div\n className={clsx(\n css`\n width: 100%;\n height: 100%;\n display: var(--display);\n `,\n containerClassName,\n )}\n style={transformCSSVariable({ display: getHidden(index) ? \"none\" : \"block\" }, containerStyle)}\n >\n {render(item, index, arr)}\n </div>\n </div>\n ))}\n </div>\n )\n}\n\n/** 自适应浮动组件 */\nexport function Flow<T>(props: FlowProps<T>) {\n const {\n itemWidth,\n itemHeight,\n columnGap,\n rowGap,\n gap,\n maxRows,\n data,\n render,\n keyExactor,\n wrapperClassName,\n wrapperStyle,\n containerClassName,\n containerStyle,\n throttle,\n transitionDuration,\n onSizeChange,\n element,\n ...rest\n } = props\n const ele = useRef<HTMLDivElement>(null)\n const size = useSize(ele)\n const width = useRef(size?.width || 0)\n if (size && size.width !== 0) width.current = size.width\n useImperativeHandle(element, () => ele.current!, [ele.current])\n if (width.current === 0) return <div ref={ele} {...rest} />\n return <ManualFlow element={ele} {...props} width={width.current} />\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,GAAG,QAAQ,cAAc;AAClC,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,IAAI,QAAQ,eAAe;AACpC,SAAmEC,SAAS,EAAEC,mBAAmB,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAClI,SAASC,EAAE,EAAEC,oBAAoB;AAAkB,SAAAC,GAAA,IAAAC,IAAA;AA2EnD,OAAO,SAASC,WAAWA,CAACC,GAAuD,EAA6B;EAC5G,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE,OAAO,CAACA,GAAG,EAAEA,GAAG,CAAC;EAC9C,IAAIC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE,OAAO,CAAC,OAAOA,GAAG,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAGA,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAEA,GAAG,CAAC,CAAC,CAAC,CAAC;EAChF,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC;AACtB;AAOA,OAAO,SAASG,kBAAkBA,CAACC,KAAa,EAAEC,SAAiB,EAAEC,MAAc,EAAEC,MAAuB,EAAe;EACvH,MAAMC,KAAK,GAAGC,IAAI,CAACC,KAAK,CAAC,CAACN,KAAK,GAAGE,MAAM,KAAKD,SAAS,GAAGC,MAAM,CAAC,CAAC,IAAI,CAAC;EACtE,IAAIE,KAAK,KAAK,CAAC,EAAE,OAAO;IAAEA,KAAK;IAAER,GAAG,EAAE;EAAE,C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AAC/D,KAAK,KAAK,CAAC,EAAEA,KAAK,CAAC+C,OAAO,GAAGgB,IAAI,CAAC/D,KAAK;EACxDZ,mBAAmB,CAACsC,OAAO,EAAE,MAAMO,GAAG,CAACc,OAAQ,EAAE,CAACd,GAAG,CAACc,OAAO,CAAC,CAAC;EAC/D,IAAI/C,KAAK,CAAC+C,OAAO,KAAK,CAAC,EAAE,oBAAOrD,IAAA;IAAK6D,GAAG,EAAEtB,GAAI;IAAA,GAAKN;EAAI,CAAG,CAAC;EAC3D,oBAAOjC,IAAA,CAACc,UAAU;IAACkB,OAAO,EAAEO,GAAI;IAAA,GAAKxB,KAAK;IAAET,KAAK,EAAEA,KAAK,CAAC+C;EAAQ,CAAE,CAAC;AACxE"}
|
|
1
|
+
{"version":3,"names":["useSize","clsx","useEffect","useImperativeHandle","useRef","useState","css","px","transformCSSVariable","jsx","_jsx","getGapRange","gap","Array","isArray","getGapCountAndSize","width","itemWidth","minGap","maxGap","count","Math","floor","averageGap","ManualFlow","props","itemHeight","columnGap","rowGap","maxRows","data","render","keyExactor","className","style","wrapperClassName","wrapperStyle","throttle","transitionDuration","onSizeChange","containerClassName","containerStyle","element","rest","minColumnGap","maxColumnGap","columnCount","columnGapSize","setGapAndCount","ele","contentRows","ceil","length","contentShownRows","min","height","getPosition","index","y","x","left","top","getHidden","current","task","timeout","setTimeout","clearTimeout","rowCount","overflow","itemCount","ref","children","map","item","arr","transition","display","Flow","size"],"sources":["../../../src/components/Flow.tsx"],"sourcesContent":["\"use client\"\n\nimport { useSize } from \"ahooks\"\nimport { clsx } from \"deepsea-tools\"\nimport { CSSProperties, HTMLAttributes, Key, ReactNode, RefObject, useEffect, useImperativeHandle, useRef, useState } from \"react\"\n\nimport { css } from \"@emotion/css\"\nimport { px, transformCSSVariable } from \"../utils\"\n\nexport interface FlowSizeData {\n /** 容器宽度 */\n width: number\n /** 容器高度 */\n height: number\n /** 元素宽度 */\n itemWidth: number\n /** 元素高度 */\n itemHeight: number\n /** 列间距 */\n columnGap: number\n /** 列数 */\n columnCount: number\n /** 行间距 */\n rowGap: number\n /** 行数 */\n rowCount: number\n /** 元素格数 */\n itemCount: number\n /** 最大行数 */\n maxRows: number | null\n /** 是否有元素被隐藏 */\n overflow: boolean\n}\n\nexport interface FlowProps<T> extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** 元素宽度 */\n itemWidth: number\n /** 元素高度 */\n itemHeight: number\n /**\n * 列间距\n * 1. 如果是数字,表示列间距是固定的\n * 2. 如果是 auto,表示会在尽可能放进更多列的情况下,列间距是平均的\n * 2. 如果是数组,表示列间距是区间的,第一个元素是最小值,第二个元素是最大值\n */\n columnGap?: number | \"auto\" | [number | \"auto\", number | \"auto\"]\n /** 行间距 */\n rowGap?: number\n gap?: number\n /** 最大行数 */\n maxRows?: number | null\n /** 源数据 */\n data?: T[]\n /** 渲染 */\n render: (item: T, index: number, arr: T[]) => ReactNode\n /** key释放器,默认为 index */\n keyExactor?: (item: T, index: number, arr: T[]) => Key\n /**\n * 渲染的元素由两层容器包裹,外层容器类名\n */\n wrapperClassName?: string\n /**\n * 渲染的元素由两层容器包裹,外层容器样式\n */\n wrapperStyle?: CSSProperties\n /**\n * 渲染的元素由两层容器包裹,内层容器类名\n */\n containerClassName?: string\n /**\n * 渲染的元素由两层容器包裹,内层容器样式\n */\n containerStyle?: CSSProperties\n /** 节流时间,单位毫秒,默认200ms,传入 0 不节流 */\n throttle?: number\n /** 动画时间,单位毫秒,默认400ms,传入 0 不展示动画 */\n transitionDuration?: number\n /** 变化的回调函数 */\n onSizeChange?: (sizeData: FlowSizeData) => void\n element?: RefObject<HTMLDivElement>\n}\n\nexport function getGapRange(gap?: undefined | number | \"auto\" | (number | \"auto\")[]): [number, number | \"auto\"] {\n if (typeof gap === \"number\") return [gap, gap]\n if (Array.isArray(gap)) return [typeof gap[0] === \"number\" ? gap[0] : 0, gap[1]]\n return [0, \"auto\"]\n}\n\nexport interface GapAndCount {\n count: number\n gap: number\n}\n\nexport function getGapCountAndSize(width: number, itemWidth: number, minGap: number, maxGap: number | \"auto\"): GapAndCount {\n const count = Math.floor((width + minGap) / (itemWidth + minGap)) || 1\n if (count === 1) return { count, gap: 0 }\n const averageGap = (width - itemWidth * count) / (count - 1)\n if (averageGap < minGap) return { count, gap: minGap }\n if (maxGap !== \"auto\" && averageGap > maxGap) return { count, gap: maxGap }\n return { count, gap: averageGap }\n}\n\nexport interface ManualFlowProps<T> extends FlowProps<T> {\n /** 组件宽度,必须指定 */\n width: number\n}\n\n/** 手动组件,由外界指定宽度,性能更好 */\nexport function ManualFlow<T>(props: ManualFlowProps<T>) {\n let {\n itemWidth,\n itemHeight,\n columnGap,\n rowGap,\n maxRows,\n data = [],\n render,\n keyExactor,\n className,\n style,\n wrapperClassName,\n wrapperStyle,\n throttle,\n transitionDuration,\n onSizeChange,\n containerClassName,\n containerStyle,\n gap = 0,\n width,\n element,\n ...rest\n } = props\n rowGap ??= gap\n columnGap ??= gap\n const [minColumnGap, maxColumnGap] = getGapRange(columnGap)\n const [{ count: columnCount, gap: columnGapSize }, setGapAndCount] = useState(() => getGapCountAndSize(width, itemWidth, minColumnGap, maxColumnGap))\n const ele = useRef<HTMLDivElement>(null)\n const contentRows = Math.ceil(data.length / columnCount)\n const contentShownRows = typeof maxRows === \"number\" ? Math.min(contentRows, maxRows) : contentRows\n const height = contentShownRows > 0 ? contentShownRows * (itemHeight + rowGap) - rowGap : 0\n\n function getPosition(index: number) {\n const y = Math.floor(index / columnCount)\n const x = index - y * columnCount\n return {\n left: x * (itemWidth + columnGapSize),\n top: y * (itemHeight + rowGap!),\n }\n }\n\n function getHidden(index: number) {\n if (typeof maxRows !== \"number\") return false\n return index >= maxRows * columnCount\n }\n\n useImperativeHandle(element, () => ele.current!, [ele.current])\n\n useEffect(() => {\n function task() {\n setGapAndCount(getGapCountAndSize(width, itemWidth, minColumnGap, maxColumnGap))\n }\n if (throttle === 0) return task()\n const timeout = setTimeout(task, throttle || 200)\n return () => clearTimeout(timeout)\n }, [width, itemWidth, throttle, minColumnGap, maxColumnGap])\n\n useEffect(() => {\n onSizeChange?.({\n width,\n height,\n itemWidth,\n itemHeight,\n columnGap: columnGapSize,\n columnCount,\n rowGap: rowGap!,\n rowCount: contentShownRows,\n overflow: data.length > contentShownRows * columnCount,\n itemCount: data.length,\n maxRows: maxRows ?? null,\n })\n }, [width, height, columnGapSize, columnCount, rowGap, contentShownRows, data.length, itemWidth, itemHeight, maxRows])\n\n return (\n <div\n ref={ele}\n className={clsx(\n css`\n position: relative;\n height: var(--height);\n overflow: hidden;\n `,\n className,\n )}\n style={transformCSSVariable({ height: px(height) }, style)}\n {...rest}\n >\n {data.map((item, index, arr) => (\n <div\n key={keyExactor ? keyExactor(item, index, arr) : index}\n className={clsx(\n css`\n position: absolute;\n width: var(--width);\n height: var(--height);\n transition: var(--transition);\n left: 0;\n top: 0;\n transform: translate(var(--left), var(--top));\n `,\n wrapperClassName,\n )}\n style={transformCSSVariable(\n {\n width: px(itemWidth),\n height: px(itemHeight),\n transition: transitionDuration === 0 ? \"none\" : `all ${transitionDuration || 400}ms`,\n left: px(getPosition(index).left),\n top: px(getPosition(index).top),\n },\n wrapperStyle,\n )}\n >\n <div\n className={clsx(\n css`\n width: 100%;\n height: 100%;\n display: var(--display);\n `,\n containerClassName,\n )}\n style={transformCSSVariable({ display: getHidden(index) ? \"none\" : \"block\" }, containerStyle)}\n >\n {render(item, index, arr)}\n </div>\n </div>\n ))}\n </div>\n )\n}\n\n/** 自适应浮动组件 */\nexport function Flow<T>(props: FlowProps<T>): ReactNode {\n const {\n itemWidth,\n itemHeight,\n columnGap,\n rowGap,\n gap,\n maxRows,\n data,\n render,\n keyExactor,\n wrapperClassName,\n wrapperStyle,\n containerClassName,\n containerStyle,\n throttle,\n transitionDuration,\n onSizeChange,\n element,\n ...rest\n } = props\n const ele = useRef<HTMLDivElement>(null)\n const size = useSize(ele)\n const width = useRef(size?.width || 0)\n if (size && size.width !== 0) width.current = size.width\n useImperativeHandle(element, () => ele.current!, [ele.current])\n if (width.current === 0) return <div ref={ele} {...rest} />\n return <ManualFlow element={ele} {...props} width={width.current} />\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,OAAO,QAAQ,QAAQ;AAChC,SAASC,IAAI,QAAQ,eAAe;AACpC,SAAmEC,SAAS,EAAEC,mBAAmB,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAElI,SAASC,GAAG,QAAQ,cAAc;AAClC,SAASC,EAAE,EAAEC,oBAAoB;AAAkB,SAAAC,GAAA,IAAAC,IAAA;AA2EnD,OAAO,SAASC,WAAWA,CAACC,GAAuD,EAA6B;EAC5G,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE,OAAO,CAACA,GAAG,EAAEA,GAAG,CAAC;EAC9C,IAAIC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE,OAAO,CAAC,OAAOA,GAAG,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAGA,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAEA,GAAG,CAAC,CAAC,CAAC,CAAC;EAChF,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC;AACtB;AAOA,OAAO,SAASG,kBAAkBA,CAACC,KAAa,EAAEC,SAAiB,EAAEC,MAAc,EAAEC,MAAuB,EAAe;EACvH,MAAMC,KAAK,GAAGC,IAAI,CAACC,KAAK,CAAC,CAACN,KAAK,GAAGE,MAAM,KAAKD,SAAS,GAAGC,MAAM,CAAC,CAAC,IAAI,CAAC;EACtE,IAAIE,KAAK,KAAK,CAAC,EAAE,OAAO;IAAEA,KAAK;IAAER,GAAG,EAAE;EAAE,CAAC;EACzC,MAAMW,UAAU,GAAG,CAACP,KAAK,GAAGC,SAAS,GAAGG,KAAK,KAAKA,KAAK,GAAG,CAAC,CAAC;EAC5D,IAAIG,UAAU,GAAGL,MAAM,EAAE,OAAO;IAAEE,KAAK;IAAER,GAAG,EAAEM;EAAO,CAAC;EACtD,IAAIC,MAAM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CAAC+C,OAAO,KAAK,CAAC,EAAE,oBAAOrD,IAAA;IAAK6D,GAAG,EAAEtB,GAAI;IAAA,GAAKN;EAAI,CAAG,CAAC;EAC3D,oBAAOjC,IAAA,CAACc,UAAU;IAACkB,OAAO,EAAEO,GAAI;IAAA,GAAKxB,KAAK;IAAET,KAAK,EAAEA,KAAK,CAAC+C;EAAQ,CAAE,CAAC;AACxE"}
|
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
import { css } from "@emotion/css";
|
|
2
1
|
import { clsx } from "deepsea-tools";
|
|
3
2
|
import { Fragment } from "react";
|
|
3
|
+
import { css } from "@emotion/css";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
/**
|
|
7
7
|
* 为 Ant Design 的 FormItem 设计的 Label 组件
|
|
8
8
|
*/
|
|
9
|
-
export const FormLabel =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
export const FormLabel = ({
|
|
10
|
+
className,
|
|
11
|
+
style,
|
|
12
|
+
before,
|
|
13
|
+
width,
|
|
14
|
+
...rest
|
|
15
|
+
}) => /*#__PURE__*/_jsxs(Fragment, {
|
|
16
|
+
children: [!!before && /*#__PURE__*/_jsx("div", {
|
|
17
|
+
style: {
|
|
18
|
+
width: 11
|
|
19
|
+
},
|
|
20
|
+
children: "\u2002"
|
|
21
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
22
|
+
className: clsx(css`
|
|
23
|
+
text-align: justify;
|
|
24
|
+
text-align-last: justify;
|
|
25
|
+
`, className),
|
|
26
|
+
style: {
|
|
27
|
+
width,
|
|
28
|
+
...style
|
|
29
|
+
},
|
|
15
30
|
...rest
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
children: [!!before && /*#__PURE__*/_jsx("div", {
|
|
19
|
-
style: {
|
|
20
|
-
width: 11
|
|
21
|
-
},
|
|
22
|
-
children: "\u2002"
|
|
23
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
24
|
-
className: clsx(css`
|
|
25
|
-
text-align: justify;
|
|
26
|
-
text-align-last: justify;
|
|
27
|
-
`, className),
|
|
28
|
-
style: {
|
|
29
|
-
width,
|
|
30
|
-
...style
|
|
31
|
-
},
|
|
32
|
-
...rest
|
|
33
|
-
})]
|
|
34
|
-
});
|
|
35
|
-
};
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
36
33
|
//# sourceMappingURL=FormLabel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["clsx","Fragment","css","jsx","_jsx","jsxs","_jsxs","FormLabel","className","style","before","width","rest","children"],"sources":["../../../src/components/FormLabel.tsx"],"sourcesContent":["import { clsx } from \"deepsea-tools\"\nimport { ComponentPropsWithoutRef, FC, Fragment } from \"react\"\n\nimport { css } from \"@emotion/css\"\n\nexport type FormLabelProps = ComponentPropsWithoutRef<\"div\"> & {\n /**\n * Label 的宽度.\n */\n width: number\n /**\n * 是否在 Label 前面添加一个空白区域,只有当前 Label 为非必选,而存在其他 Label 为必选的时候开启\n */\n before?: boolean\n}\n\n/**\n * 为 Ant Design 的 FormItem 设计的 Label 组件\n */\nexport const FormLabel: FC<FormLabelProps> = ({ className, style, before, width, ...rest }) => (\n <Fragment>\n {!!before && <div style={{ width: 11 }}> </div>}\n <div\n className={clsx(\n css`\n text-align: justify;\n text-align-last: justify;\n `,\n className,\n )}\n style={{ width, ...style }}\n {...rest}\n />\n </Fragment>\n)\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,eAAe;AACpC,SAAuCC,QAAQ,QAAQ,OAAO;AAE9D,SAASC,GAAG,QAAQ,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAalC;AACA;AACA;AACA,OAAO,MAAMC,SAA6B,GAAGA,CAAC;EAAEC,SAAS;EAAEC,KAAK;EAAEC,MAAM;EAAEC,KAAK;EAAE,GAAGC;AAAK,CAAC,kBACtFN,KAAA,CAACL,QAAQ;EAAAY,QAAA,GACJ,CAAC,CAACH,MAAM,iBAAIN,IAAA;IAAKK,KAAK,EAAE;MAAEE,KAAK,EAAE;IAAG,CAAE;IAAAE,QAAA,EAAC;EAAM,CAAK,CAAC,eACpDT,IAAA;IACII,SAAS,EAAER,IAAI,CACXE,GAAI;AACpB;AACA;AACA,iBAAiB,EACDM,SACJ,CAAE;IACFC,KAAK,EAAE;MAAEE,KAAK;MAAE,GAAGF;IAAM,CAAE;IAAA,GACvBG;EAAI,CACX,CAAC;AAAA,CACI,CACb"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type InfiniteScrollProps =
|
|
1
|
+
import { CSSProperties, ComponentPropsWithoutRef } from "react";
|
|
2
|
+
export type InfiniteScrollProps = ComponentPropsWithoutRef<"div"> & {
|
|
3
3
|
/**
|
|
4
4
|
* 滚动的方向
|
|
5
5
|
* @default "vertical"
|
|
@@ -28,4 +28,27 @@ export type InfiniteScrollProps = ComponentProps<"div"> & {
|
|
|
28
28
|
* 子元素会内置的容器中被渲染两次,首尾相连,形成无限滚动的效果
|
|
29
29
|
* 但是,如果内部检测到并没有溢出,那么不会渲染两次,并且没有动画
|
|
30
30
|
*/
|
|
31
|
-
export declare const InfiniteScroll: import("react").ForwardRefExoticComponent<Omit<
|
|
31
|
+
export declare const InfiniteScroll: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
32
|
+
/**
|
|
33
|
+
* 滚动的方向
|
|
34
|
+
* @default "vertical"
|
|
35
|
+
*/
|
|
36
|
+
direction?: "horizontal" | "vertical" | undefined;
|
|
37
|
+
/** 渲染 children 的容器的类名 */
|
|
38
|
+
containerClassName?: string | undefined;
|
|
39
|
+
/** 渲染 children 的容器的样式 */
|
|
40
|
+
containerStyle?: CSSProperties | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* 两个 children 容器之间的间距
|
|
43
|
+
* @default 0
|
|
44
|
+
*/
|
|
45
|
+
gap?: number | undefined;
|
|
46
|
+
/** 一个周期的时间,单位:毫秒 */
|
|
47
|
+
duration: number;
|
|
48
|
+
/** 是否将 gap 的距离也加入 overflow 的计算 */
|
|
49
|
+
withGap?: boolean | undefined;
|
|
50
|
+
/** 尺寸刚好相同时,是否视为溢出 */
|
|
51
|
+
withEqual?: boolean | undefined;
|
|
52
|
+
/** 鼠标移入时,是否停止动画 */
|
|
53
|
+
pauseOnHover?: boolean | undefined;
|
|
54
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
2
3
|
import { useSize } from "ahooks";
|
|
3
4
|
import { clsx } from "deepsea-tools";
|
|
4
5
|
import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
|
|
6
|
+
import { css } from "@emotion/css";
|
|
5
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useSize","clsx","forwardRef","useEffect","useImperativeHandle","useRef","css","jsx","_jsx","jsxs","_jsxs","InfiniteScroll","props","ref","className","direction","children","containerClassName","containerStyle","gap","duration","withGap","withEqual","pauseOnHover","onMouseEnter","onMouseLeave","rest","wrapper","wrapperSize","ele","current","container","containerSize","bigger","overflow","height","width","animation","undefined","animate","transform","iterations","Infinity","cancel","enter","e","pause","leave","play","playState","style","position"],"sources":["../../../src/components/InfiniteScroll.tsx"],"sourcesContent":["\"use client\"\n\nimport { useSize } from \"ahooks\"\nimport { clsx } from \"deepsea-tools\"\nimport { CSSProperties, ComponentPropsWithoutRef, MouseEvent as ReactMouseEvent, forwardRef, useEffect, useImperativeHandle, useRef } from \"react\"\n\nimport { css } from \"@emotion/css\"\n\nexport type InfiniteScrollProps = ComponentPropsWithoutRef<\"div\"> & {\n /**\n * 滚动的方向\n * @default \"vertical\"\n */\n direction?: \"vertical\" | \"horizontal\"\n /** 渲染 children 的容器的类名 */\n containerClassName?: string\n /** 渲染 children 的容器的样式 */\n containerStyle?: CSSProperties\n /**\n * 两个 children 容器之间的间距\n * @default 0\n */\n gap?: number\n /** 一个周期的时间,单位:毫秒 */\n duration: number\n /** 是否将 gap 的距离也加入 overflow 的计算 */\n withGap?: boolean\n /** 尺寸刚好相同时,是否视为溢出 */\n withEqual?: boolean\n /** 鼠标移入时,是否停止动画 */\n pauseOnHover?: boolean\n}\n\n/**\n * 无限滚动的组件\n * 子元素会内置的容器中被渲染两次,首尾相连,形成无限滚动的效果\n * 但是,如果内部检测到并没有溢出,那么不会渲染两次,并且没有动画\n */\nexport const InfiniteScroll = forwardRef<HTMLDivElement, InfiniteScrollProps>((props, ref) => {\n const {\n className,\n direction = \"vertical\",\n children,\n containerClassName,\n containerStyle,\n gap = 0,\n duration,\n withGap,\n withEqual,\n pauseOnHover,\n onMouseEnter,\n onMouseLeave,\n ...rest\n } = props\n\n const wrapper = useRef<HTMLDivElement>(null)\n const wrapperSize = useSize(wrapper)\n\n const ele = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => wrapper.current as HTMLDivElement, [wrapper.current])\n\n const container = useRef<HTMLDivElement>(null)\n const containerSize = useSize(container)\n\n function bigger(containerSize: number, wrapperSize: number) {\n return withEqual ? containerSize + (withGap ? gap : 0) >= wrapperSize : containerSize + (withGap ? gap : 0) > wrapperSize\n }\n\n const overflow =\n wrapperSize && containerSize\n ? direction === \"vertical\"\n ? bigger(containerSize.height, wrapperSize.height)\n : bigger(containerSize.width, wrapperSize.width)\n : false\n\n const animation = useRef<Animation | undefined>(undefined)\n\n useEffect(() => {\n if (!wrapperSize || !containerSize || !overflow) return\n animation.current = ele.current?.animate(\n {\n transform:\n direction === \"vertical\"\n ? [`translateY(0)`, `translateY(-${containerSize.height + gap}px)`]\n : [`translateX(0)`, `translateX(-${containerSize.width + gap}px)`],\n },\n { duration, iterations: Infinity },\n )\n return () => animation.current?.cancel()\n }, [wrapperSize, containerSize, overflow, direction, duration])\n\n function enter(e: ReactMouseEvent<HTMLDivElement, MouseEvent>) {\n if (pauseOnHover) animation.current?.pause()\n onMouseEnter?.(e)\n }\n\n function leave(e: ReactMouseEvent<HTMLDivElement, MouseEvent>) {\n if (pauseOnHover) animation.current?.play()\n onMouseLeave?.(e)\n }\n\n useEffect(() => {\n if (!pauseOnHover && animation.current?.playState === \"paused\") animation.current?.play()\n }, [animation.current, pauseOnHover])\n\n return (\n <div\n ref={wrapper}\n className={clsx(\n css`\n position: relative;\n ${direction === \"vertical\" ? \"overflow-y: hidden;\" : \"overflow-x: hidden;\"}\n `,\n className,\n )}\n onMouseEnter={enter}\n onMouseLeave={leave}\n {...rest}\n >\n <div\n ref={ele}\n style={{\n position: \"absolute\",\n width: direction === \"vertical\" ? \"100%\" : containerSize && (overflow ? containerSize.width * 2 + gap : containerSize.width),\n height: direction === \"horizontal\" ? \"100%\" : containerSize && (overflow ? containerSize.height * 2 + gap : containerSize.width),\n }}\n >\n <div\n ref={container}\n className={clsx(\n css`\n position: absolute;\n left: 0;\n top: 0;\n ${direction === \"vertical\" ? \"width: 100%;\" : \"height: 100%;\"}\n `,\n containerClassName,\n )}\n style={containerStyle}\n >\n {children}\n </div>\n {overflow && (\n <div\n ref={container}\n className={clsx(\n css`\n position: absolute;\n right: 0;\n bottom: 0;\n ${direction === \"vertical\" ? \"width: 100%;\" : \"height: 100%;\"}\n `,\n containerClassName,\n )}\n style={containerStyle}\n >\n {children}\n </div>\n )}\n </div>\n </div>\n )\n})\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,OAAO,QAAQ,QAAQ;AAChC,SAASC,IAAI,QAAQ,eAAe;AACpC,SAAiFC,UAAU,EAAEC,SAAS,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,CACL,CAAC;AAEd,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { css } from "@emotion/css";
|
|
4
3
|
import { clsx } from "deepsea-tools";
|
|
5
4
|
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
5
|
+
import { css } from "@emotion/css";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
8
|
/** 循环播放组件 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["clsx","forwardRef","useEffect","useImperativeHandle","useRef","useState","css","jsx","_jsx","jsxs","_jsxs","LoopSwiper","props","ref","className","style","children","direction","period","reverse","gap","rest","wrapper","container","swiper","setSwiper","directionRef","current","flexDirection","animationName","animationDuration","animationTimingFunction","animationIterationCount","wrapperEle","containerEle","wrapperWidth","wrapperHeight","containerWidth","containerHeight","observer","ResizeObserver","entries","forEach","entry","target","contentRect","width","height","observe","display"],"sources":["../../../src/components/LoopSwiper.tsx"],"sourcesContent":["\"use client\"\n\nimport { clsx } from \"deepsea-tools\"\nimport { CSSProperties, HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useRef, useState } from \"react\"\n\nimport { css } from \"@emotion/css\"\n\nexport interface LoopSwiperProps extends HTMLAttributes<HTMLDivElement> {\n direction?: \"horizontal\" | \"vertical\"\n reverse?: boolean\n period: number\n gap?: CSSProperties[\"gap\"]\n}\n\n/** 循环播放组件 */\nexport const LoopSwiper = forwardRef<HTMLDivElement, LoopSwiperProps>((props, ref) => {\n const { className, style, children, direction, period, reverse, gap, ...rest } = props\n const wrapper = useRef<HTMLDivElement>(null)\n const container = useRef<HTMLDivElement>(null)\n const [swiper, setSwiper] = useState(false)\n const directionRef = useRef(direction)\n directionRef.current = direction\n const flexDirection: CSSProperties[\"flexDirection\"] = direction === \"vertical\" ? (reverse ? \"column-reverse\" : \"column\") : reverse ? \"row-reverse\" : \"row\"\n const animationName = swiper\n ? direction === \"vertical\"\n ? reverse\n ? \"deepsea-reverse-vertical-loop-swipe\"\n : \"deepsea-vertical-loop-swipe\"\n : reverse\n ? \"deepsea-reverse-horizontal-loop-swipe\"\n : \"deepsea-horizontal-loop-swipe\"\n : \"none\"\n const animationDuration = `${period}ms`\n const animationTimingFunction = \"linear\"\n const animationIterationCount = \"infinite\"\n\n useImperativeHandle(ref, () => wrapper.current!, [])\n\n useEffect(() => {\n const wrapperEle = wrapper.current!\n const containerEle = container.current!\n let wrapperWidth = 0\n let wrapperHeight = 0\n let containerWidth = 0\n let containerHeight = 0\n const observer = new ResizeObserver(entries => {\n entries.forEach(entry => {\n if (entry.target === wrapperEle) {\n wrapperWidth = entry.contentRect.width\n wrapperHeight = entry.contentRect.height\n } else if (entry.target === containerEle) {\n containerWidth = entry.contentRect.width\n containerHeight = entry.contentRect.height\n }\n })\n setSwiper(directionRef.current === \"vertical\" ? containerHeight > wrapperHeight : containerWidth > wrapperWidth)\n })\n observer.observe(wrapperEle)\n observer.observe(containerEle)\n }, [])\n\n return (\n <div\n ref={wrapper}\n className={clsx(\n css`\n @keyframes deepsea-horizontal-loop-swipe {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(-100%);\n }\n }\n @keyframes deepsea-reverse-horizontal-loop-swipe {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(100%);\n }\n }\n @keyframes deepsea-vertical-loop-swipe {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(-100%);\n }\n }\n @keyframes deepsea-reverse-vertical-loop-swipe {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(100%);\n }\n }\n `,\n className,\n )}\n style={{ display: \"flex\", flexDirection, gap, ...style }}\n {...rest}\n >\n <div\n ref={container}\n style={{ display: \"flex\", flexDirection, gap, animationName, animationTimingFunction, animationDuration, animationIterationCount }}\n >\n {children}\n </div>\n <div\n style={{\n display: swiper ? \"flex\" : \"none\",\n flexDirection,\n gap,\n animationName,\n animationTimingFunction,\n animationDuration,\n animationIterationCount,\n }}\n >\n {children}\n </div>\n </div>\n )\n})\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,IAAI,QAAQ,eAAe;AACpC,SAAwCC,UAAU,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAEnH,SAASC,GAAG,QAAQ,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AASlC;AACA,OAAO,MAAMC,UAAU,gBAAGV,UAAU,CAAkC,CAACW,KAAK,EAAEC,GAAG,KAAK;EAClF,MAAM;IAAEC,SAAS;IAAEC,KAAK;IAAEC,QAAQ;IAAEC,SAAS;IAAEC,MAAM;IAAEC,OAAO;IAAEC,GAAG;IAAE,GAAGC;EAAK,CAAC,GAAGT,KAAK;EACtF,MAAMU,OAAO,GAAGlB,MAAM,CAAiB,IAAI,CAAC;EAC5C,MAAMmB,SAAS,GAAGnB,MAAM,CAAiB,IAAI,CAAC;EAC9C,MAAM,CAACoB,MAAM,EAAEC,SAAS,CAAC,GAAGpB,QAAQ,CAAC,KAAK,CAAC;EAC3C,MAAMqB,YAAY,GAAGtB,MAAM,CAACa,SAAS,CAAC;EACtCS,YAAY,CAACC,OAAO,GAAGV,SAAS;EAChC,MAAMW,aAA6C,GAAGX,SAAS,KAAK,UAAU,GAAIE,OAAO,GAAG,gBAAgB,GAAG,QAAQ,GAAIA,OAAO,GAAG,aAAa,GAAG,KAAK;EAC1J,MAAMU,aAAa,GAAGL,MAAM,GACtBP,SAAS,KAAK,UAAU,GACpBE,OAAO,GACH,qCAAqC,GACrC,6BAA6B,GACjCA,OAAO,GACL,uCAAuC,GACvC,+BAA+B,GACrC,MAAM;EACZ,MAAMW,iBAAiB,GAAI,GAAEZ,MAAO,IAAG;EACvC,MAAMa,uBAAuB,GAAG,QAAQ;EACxC,MAAMC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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,EACDQ,SACJ,CAAE;IACFC,KAAK,EAAE;MAAEkC,OAAO,EAAE,MAAM;MAAErB,aAAa;MAAER,GAAG;MAAE,GAAGL;IAAM,CAAE;IAAA,GACrDM,IAAI;IAAAL,QAAA,gBAERR,IAAA;MACIK,GAAG,EAAEU,SAAU;MACfR,KAAK,EAAE;QAAEkC,OAAO,EAAE,MAAM;QAAErB,aAAa;QAAER,GAAG;QAAES,aAAa;QAAEE,uBAAuB;QAAED,iBAAiB;QAAEE;MAAwB,CAAE;MAAAhB,QAAA,EAElIA;IAAQ,CACR,CAAC,eACNR,IAAA;MACIO,KAAK,EAAE;QACHkC,OAAO,EAAEzB,MAAM,GAAG,MAAM,GAAG,MAAM;QACjCI,aAAa;QACbR,GAAG;QACHS,aAAa;QACbE,uBAAuB;QACvBD,iBAAiB;QACjBE;MACJ,CAAE;MAAAhB,QAAA,EAEDA;IAAQ,CACR,CAAC;EAAA,CACL,CAAC;AAEd,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","jsx","_jsx","Ring","props","ref","outerWidth","innerWidth","style","rest","outerRadius","innerRadius","width","height","clipPath"],"sources":["../../../src/components/Ring.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["forwardRef","jsx","_jsx","Ring","props","ref","outerWidth","innerWidth","style","rest","outerRadius","innerRadius","width","height","clipPath"],"sources":["../../../src/components/Ring.tsx"],"sourcesContent":["import { HTMLAttributes, forwardRef } from \"react\"\n\nexport interface RingProps extends HTMLAttributes<HTMLDivElement> {\n outerWidth: number\n innerWidth: number\n}\n\n/** 环形组件 */\nexport const Ring = forwardRef<HTMLDivElement, RingProps>((props, ref) => {\n const { outerWidth, innerWidth, style, ...rest } = props\n\n const outerRadius = outerWidth / 2\n\n const innerRadius = innerWidth / 2\n\n return (\n <div\n ref={ref}\n style={{\n ...style,\n width: `${outerWidth}px`,\n height: `${outerWidth}px`,\n clipPath: `path(\"M0,${outerRadius} a${outerRadius},${outerRadius},0,1,0,${outerWidth},0 a${outerRadius},${outerRadius},0,1,0,-${outerWidth},0 l${outerRadius - innerRadius},0 a${innerRadius},${innerRadius},0,0,1,${innerRadius * 2},0 a${innerRadius},${innerRadius},0,0,1,-${innerRadius * 2},0 Z\")`,\n }}\n {...rest}\n />\n )\n})\n"],"mappings":"AAAA,SAAyBA,UAAU,QAAQ,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAOlD;AACA,OAAO,MAAMC,IAAI,gBAAGH,UAAU,CAA4B,CAACI,KAAK,EAAEC,GAAG,KAAK;EACtE,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC,KAAK;IAAE,GAAGC;EAAK,CAAC,GAAGL,KAAK;EAExD,MAAMM,WAAW,GAAGJ,UAAU,GAAG,CAAC;EAElC,MAAMK,WAAW,GAAGJ,UAAU,GAAG,CAAC;EAElC,oBACIL,IAAA;IACIG,GAAG,EAAEA,GAAI;IACTG,KAAK,EAAE;MACH,GAAGA,KAAK;MACRI,KAAK,EAAG,GAAEN,UAAW,IAAG;MACxBO,MAAM,EAAG,GAAEP,UAAW,IAAG;MACzBQ,QAAQ,EAAG,YAAWJ,WAAY,KAAIA,WAAY,IAAGA,WAAY,UAASJ,UAAW,OAAMI,WAAY,IAAGA,WAAY,WAAUJ,UAAW,OAAMI,WAAW,GAAGC,WAAY,OAAMA,WAAY,IAAGA,WAAY,UAASA,WAAW,GAAG,CAAE,OAAMA,WAAY,IAAGA,WAAY,WAAUA,WAAW,GAAG,CAAE;IACpS,CAAE;IAAA,GACEF;EAAI,CACX,CAAC;AAEV,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, ForwardedRef, HTMLAttributes } from "react";
|
|
2
2
|
import Scrollbar from "smooth-scrollbar";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ScrollListener, ScrollbarOptions } from "smooth-scrollbar/interfaces";
|
|
4
4
|
export { default as Scrollbar } from "smooth-scrollbar";
|
|
5
5
|
export * from "smooth-scrollbar/interfaces";
|
|
6
6
|
export interface ScrollOptions extends Partial<ScrollbarOptions> {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { css } from "@emotion/css";
|
|
4
3
|
import { clsx } from "deepsea-tools";
|
|
5
4
|
import { forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef } from "react";
|
|
6
5
|
import Scrollbar from "smooth-scrollbar";
|
|
6
|
+
import { css } from "@emotion/css";
|
|
7
7
|
import { px, transformCSSVariable } from "../utils";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
export { default as Scrollbar } from "smooth-scrollbar";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["clsx","forwardRef","useEffect","useImperativeHandle","useLayoutEffect","useRef","Scrollbar","css","px","transformCSSVariable","jsx","_jsx","default","Scroll","props","ref","children","options","className","style","scrollbar","onScrollbar","rest","thumbWidth","thumbRadius","thumbColor","trackColor","scrollbarOptions","ele","bar","current","init","destroy","addListener","removeListener","undefined"],"sources":["../../../src/components/Scroll.tsx"],"sourcesContent":["\"use client\"\n\nimport { clsx } from \"deepsea-tools\"\nimport { CSSProperties, ForwardedRef, HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef } from \"react\"\nimport Scrollbar from \"smooth-scrollbar\"\nimport type { ScrollListener, ScrollbarOptions } from \"smooth-scrollbar/interfaces\"\n\nimport { css } from \"@emotion/css\"\nimport { px, transformCSSVariable } from \"../utils\"\n\nexport { default as Scrollbar } from \"smooth-scrollbar\"\nexport * from \"smooth-scrollbar/interfaces\"\n\nexport interface ScrollOptions extends Partial<ScrollbarOptions> {\n /** 滑块宽度 */\n thumbWidth?: number | string\n /** 滑块圆角大小 */\n thumbRadius?: number | string\n /** 滑块背景颜色 */\n thumbColor?: CSSProperties[\"backgroundColor\"]\n /** 滚动条背景颜色 */\n trackColor?: CSSProperties[\"backgroundColor\"]\n}\n\nexport interface ScrollProps extends HTMLAttributes<HTMLDivElement> {\n /** 滚动的配置 */\n options?: ScrollOptions\n /** 滚动条实例 */\n scrollbar?: ForwardedRef<Scrollbar>\n /** 滚动条滚动事件 */\n onScrollbar?: ScrollListener\n}\n\nexport const Scroll = forwardRef<HTMLDivElement, ScrollProps>((props, ref) => {\n const { children, options, className, style, scrollbar, onScrollbar, ...rest } = props\n const { thumbWidth, thumbRadius, thumbColor, trackColor, ...scrollbarOptions } = options || {}\n const ele = useRef<HTMLDivElement>(null)\n const bar = useRef<Scrollbar | null>(null)\n\n useLayoutEffect(() => {\n bar.current = Scrollbar.init(ele.current!, scrollbarOptions)\n return () => bar.current?.destroy()\n }, [])\n\n useImperativeHandle(ref, () => ele.current!, [])\n\n useImperativeHandle(scrollbar, () => bar.current!, [])\n\n useEffect(() => {\n if (!onScrollbar) return\n bar.current?.addListener(onScrollbar)\n return () => bar.current?.removeListener(onScrollbar)\n }, [onScrollbar])\n\n return (\n <div\n ref={ele}\n className={clsx(\n css`\n .scrollbar-track.scrollbar-track-x {\n ${thumbWidth !== undefined ? \"height: var(--thumb-width);\" : \"\"}\n ${trackColor !== undefined ? \"background-color: var(--track-color);\" : \"\"}\n }\n\n .scrollbar-thumb.scrollbar-thumb-x {\n ${thumbWidth !== undefined ? \"height: var(--thumb-width);\" : \"\"}\n ${thumbRadius !== undefined ? \"border-radius: var(--thumb-radius);\" : \"\"}\n ${thumbColor !== undefined ? \"background-color: var(--thumb-color);\" : \"\"}\n }\n\n .scrollbar-track.scrollbar-track-y {\n ${thumbWidth !== undefined ? \"width: var(--thumb-width);\" : \"\"}\n ${trackColor !== undefined ? \"background-color: var(--track-color);\" : \"\"}\n }\n\n .scrollbar-thumb.scrollbar-thumb-y {\n ${thumbWidth !== undefined ? \"width: var(--thumb-width);\" : \"\"}\n ${thumbRadius !== undefined ? \"border-radius: var(--thumb-radius);\" : \"\"}\n ${thumbColor !== undefined ? \"background-color: var(--thumb-color);\" : \"\"}\n }\n `,\n className,\n )}\n style={transformCSSVariable(\n {\n thumbWidth: px(thumbWidth),\n thumbRadius: px(thumbRadius),\n thumbColor,\n trackColor,\n },\n style,\n )}\n {...rest}\n >\n {children}\n </div>\n )\n})\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,IAAI,QAAQ,eAAe;AACpC,SAAsDC,UAAU,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,eAAe,EAAEC,MAAM,QAAQ,OAAO;AACxI,OAAOC,SAAS,MAAM,kBAAkB;AAGxC,SAASC,GAAG,QAAQ,cAAc;AAClC,SAASC,EAAE,EAAEC,oBAAoB;AAAkB,SAAAC,GAAA,IAAAC,IAAA;AAEnD,SAASC,OAAO,IAAIN,SAAS,QAAQ,kBAAkB;AACvD,cAAc,6BAA6B;AAsB3C,OAAO,MAAMO,MAAM,gBAAGZ,UAAU,CAA8B,CAACa,KAAK,EAAEC,GAAG,KAAK;EAC1E,MAAM;IAAEC,QAAQ;IAAEC,OAAO;IAAEC,SAAS;IAAEC,KAAK;IAAEC,SAAS;IAAEC,WAAW;IAAE,GAAGC;EAAK,CAAC,GAAGR,KAAK;EACtF,MAAM;IAAES,UAAU;IAAEC,WAAW;IAAEC,UAAU;IAAEC,UAAU;IAAE,GAAGC;EAAiB,CAAC,GAAGV,OAAO,IAAI,CAAC,CAAC;EAC9F,MAAMW,GAAG,GAAGvB,MAAM,CAAiB,IAAI,CAAC;EACxC,MAAMwB,GAAG,GAAGxB,MAAM,CAAmB,IAAI,CAAC;EAE1CD,eAAe,CAAC,MAAM;IAClByB,GAAG,CAACC,OAAO,GAAGxB,SAAS,CAACyB,IAAI,CAACH,GAAG,CAACE,OAAO,EAAGH,gBAAgB,CAAC;IAC5D,OAAO,MAAME,GAAG,CAACC,OAAO,EAAEE,OAAO,CAAC,CAAC;EACvC,CAAC,EA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,UAAU,EAAEf,EAAE,CAACe,UAAU,CAAC;MAC1BC,WAAW,EAAEhB,EAAE,CAACgB,WAAW,CAAC;MAC5BC,UAAU;MACVC;IACJ,CAAC,EACDP,KACJ,CAAE;IAAA,GACEG,IAAI;IAAAN,QAAA,EAEPA;EAAQ,CACR,CAAC;AAEd,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
2
|
export interface SectionRingProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
outerRadius: number;
|
|
4
4
|
innerRadius: number;
|
|
5
5
|
count: number;
|
|
6
6
|
angel: number;
|
|
7
7
|
}
|
|
8
|
-
export declare const SectionRing:
|
|
8
|
+
export declare const SectionRing: import("react").ForwardRefExoticComponent<SectionRingProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { drawArc } from "deepsea-tools";
|
|
4
|
+
import { forwardRef } from "react";
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
export const SectionRing = props => {
|
|
6
|
+
export const SectionRing = /*#__PURE__*/forwardRef((props, ref) => {
|
|
6
7
|
const {
|
|
7
8
|
outerRadius: o,
|
|
8
9
|
innerRadius: i,
|
|
@@ -16,16 +17,17 @@ export const SectionRing = props => {
|
|
|
16
17
|
return drawArc(o, o, radius, startAngle, endAngle, options);
|
|
17
18
|
}
|
|
18
19
|
return /*#__PURE__*/_jsx("div", {
|
|
20
|
+
ref: ref,
|
|
19
21
|
style: {
|
|
20
|
-
...style,
|
|
21
22
|
width: o * 2,
|
|
22
23
|
height: o * 2,
|
|
23
24
|
clipPath: `path("${Array(c).fill(0).map((it, idx) => `${arc(o, idx * (a + s), idx * (a + s) + a)} ${arc(i, idx * (a + s) + a, idx * (a + s), {
|
|
24
25
|
line: true,
|
|
25
26
|
anticlockwise: true
|
|
26
|
-
})}`).join(" ")} Z")
|
|
27
|
+
})}`).join(" ")} Z")`,
|
|
28
|
+
...style
|
|
27
29
|
},
|
|
28
30
|
...rest
|
|
29
31
|
});
|
|
30
|
-
};
|
|
32
|
+
});
|
|
31
33
|
//# sourceMappingURL=SectionRing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["drawArc","jsx","_jsx","SectionRing","props","outerRadius","o","innerRadius","i","count","c","angel","a","style","rest","s","Math","PI","arc","radius","startAngle","endAngle","options","width","height","clipPath","Array","fill","map","it","idx","line","anticlockwise","join"],"sources":["../../../src/components/SectionRing.tsx"],"sourcesContent":["\"use client\"\n\nimport { DrawArcOptions, drawArc } from \"deepsea-tools\"\nimport {
|
|
1
|
+
{"version":3,"names":["drawArc","forwardRef","jsx","_jsx","SectionRing","props","ref","outerRadius","o","innerRadius","i","count","c","angel","a","style","rest","s","Math","PI","arc","radius","startAngle","endAngle","options","width","height","clipPath","Array","fill","map","it","idx","line","anticlockwise","join"],"sources":["../../../src/components/SectionRing.tsx"],"sourcesContent":["\"use client\"\n\nimport { DrawArcOptions, drawArc } from \"deepsea-tools\"\nimport { HTMLAttributes, forwardRef } from \"react\"\n\nexport interface SectionRingProps extends HTMLAttributes<HTMLDivElement> {\n outerRadius: number\n innerRadius: number\n count: number\n angel: number\n}\n\nexport const SectionRing = forwardRef<HTMLDivElement, SectionRingProps>((props, ref) => {\n const { outerRadius: o, innerRadius: i, count: c, angel: a, style, ...rest } = props\n\n const s = (Math.PI * 2) / c - a\n\n function arc(radius: number, startAngle: number, endAngle: number, options: DrawArcOptions = {}) {\n return drawArc(o, o, radius, startAngle, endAngle, options)\n }\n\n return (\n <div\n ref={ref}\n style={{\n width: o * 2,\n height: o * 2,\n clipPath: `path(\"${Array(c)\n .fill(0)\n .map(\n (it, idx) =>\n `${arc(o, idx * (a + s), idx * (a + s) + a)} ${arc(i, idx * (a + s) + a, idx * (a + s), { line: true, anticlockwise: true })}`,\n )\n .join(\" \")}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IlB,CAAC,GAAGG,CAAC,CAAC,EAAE;QAAEgB,IAAI,EAAE,IAAI;QAAEC,aAAa,EAAE;MAAK,CAAC,CAAE,EACrI,CAAC,CACAC,IAAI,CAAC,GAAG,CAAE,MAAK;MACpB,GAAGpB;IACP,CAAE;IAAA,GACEC;EAAI,CACX,CAAC;AAEV,CAAC,CAAC"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { css } from "@emotion/css";
|
|
4
1
|
import { clsx } from "deepsea-tools";
|
|
5
2
|
import { forwardRef } from "react";
|
|
3
|
+
import { css } from "@emotion/css";
|
|
6
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
5
|
export const Skeleton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
|
-
|
|
6
|
+
const {
|
|
9
7
|
className,
|
|
10
|
-
loading,
|
|
11
8
|
children,
|
|
9
|
+
loading = children === undefined || children === null,
|
|
12
10
|
...rest
|
|
13
11
|
} = props;
|
|
14
|
-
loading ??= children === undefined || children === null;
|
|
15
12
|
return /*#__PURE__*/_jsx("div", {
|
|
16
13
|
ref: ref,
|
|
17
14
|
className: clsx(css`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["clsx","forwardRef","css","jsx","_jsx","Skeleton","props","ref","className","children","loading","undefined","rest"],"sources":["../../../src/components/Skeleton.tsx"],"sourcesContent":["import { clsx } from \"deepsea-tools\"\nimport { HTMLAttributes, forwardRef } from \"react\"\n\nimport { css } from \"@emotion/css\"\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n loading?: boolean\n}\n\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>((props, ref) => {\n const { className, children, loading = children === undefined || children === null, ...rest } = props\n\n return (\n <div\n ref={ref}\n className={clsx(\n css`\n @keyframes shimmer {\n 0% {\n background-position: -400px 0px;\n }\n 100% {\n background-position: 400px 0px;\n }\n }\n `,\n loading &&\n css`\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0.067) 8%, rgba(0, 0, 0, 0.133) 18%, rgba(0, 0, 0, 0.067) 33%);\n animation-duration: 1s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: shimmer;\n animation-timing-function: linear;\n background-size: 800px 104px;\n `,\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n )\n})\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,eAAe;AACpC,SAAyBC,UAAU,QAAQ,OAAO;AAElD,SAASC,GAAG,QAAQ,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMlC,OAAO,MAAMC,QAAQ,gBAAGJ,UAAU,CAAgC,CAACK,KAAK,EAAEC,GAAG,KAAK;EAC9E,MAAM;IAAEC,SAAS;IAAEC,QAAQ;IAAEC,OAAO,GAAGD,QAAQ,KAAKE,SAAS,IAAIF,QAAQ,KAAK,IAAI;IAAE,GAAGG;EAAK,CAAC,GAAGN,KAAK;EAErG,oBACIF,IAAA;IACIG,GAAG,EAAEA,GAAI;IACTC,SAAS,EAAER,IAAI,CACXE,GAAI;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,EACDQ,OAAO,IACHR,GAAI;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,EACLM,SACJ,CAAE;IAAA,GACEI,IAAI;IAAAH,QAAA,EAEPA;EAAQ,CACR,CAAC;AAEd,CAAC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type TitleProps =
|
|
1
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
export type TitleProps = ComponentPropsWithoutRef<"title">;
|
|
3
3
|
export declare const Title: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTitleElement>, HTMLTitleElement>, "ref"> & import("react").RefAttributes<HTMLTitleElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","useImperativeHandle","useLayoutEffect","useRef","createPortal","getReactVersion","jsx","_jsx","major","Title","props","ref","ele","current","title","document","head","querySelector","insertBefore"],"sources":["../../../src/components/Title.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["forwardRef","useImperativeHandle","useLayoutEffect","useRef","createPortal","getReactVersion","jsx","_jsx","major","Title","props","ref","ele","current","title","document","head","querySelector","insertBefore"],"sources":["../../../src/components/Title.tsx"],"sourcesContent":["\"use client\"\n\nimport { ComponentPropsWithoutRef, forwardRef, useImperativeHandle, useLayoutEffect, useRef } from \"react\"\nimport { createPortal } from \"react-dom\"\n\nimport { getReactVersion } from \"../utils/getReactVersion\"\n\nexport type TitleProps = ComponentPropsWithoutRef<\"title\">\n\nconst [major] = getReactVersion()\n\nexport const Title = forwardRef<HTMLTitleElement, TitleProps>((props, ref) => {\n if (major >= 19) return <title ref={ref} {...props} />\n\n const ele = useRef<HTMLTitleElement>(null)\n\n useImperativeHandle(ref, () => ele.current as HTMLTitleElement, [ele.current])\n\n useLayoutEffect(() => {\n const title = document.head.querySelector(\"title\")\n if (title === ele.current) return\n document.head.insertBefore(ele.current as HTMLTitleElement, title)\n }, [])\n\n return createPortal(<title ref={ele} {...props} />, document.head)\n})\n"],"mappings":"AAAA,YAAY;;AAEZ,SAAmCA,UAAU,EAAEC,mBAAmB,EAAEC,eAAe,EAAEC,MAAM,QAAQ,OAAO;AAC1G,SAASC,YAAY,QAAQ,WAAW;AAExC,SAASC,eAAe;AAAkC,SAAAC,GAAA,IAAAC,IAAA;AAI1D,MAAM,CAACC,KAAK,CAAC,GAAGH,eAAe,CAAC,CAAC;AAEjC,OAAO,MAAMI,KAAK,gBAAGT,UAAU,CAA+B,CAACU,KAAK,EAAEC,GAAG,KAAK;EAC1E,IAAIH,KAAK,IAAI,EAAE,EAAE,oBAAOD,IAAA;IAAOI,GAAG,EAAEA,GAAI;IAAA,GAAKD;EAAK,CAAG,CAAC;EAEtD,MAAME,GAAG,GAAGT,MAAM,CAAmB,IAAI,CAAC;EAE1CF,mBAAmB,CAACU,GAAG,EAAE,MAAMC,GAAG,CAACC,OAA2B,EAAE,CAACD,GAAG,CAACC,OAAO,CAAC,CAAC;EAE9EX,eAAe,CAAC,MAAM;IAClB,MAAMY,KAAK,GAAGC,QAAQ,CAACC,IAAI,CAACC,aAAa,CAAC,OAAO,CAAC;IAClD,IAAIH,KAAK,KAAKF,GAAG,CAACC,OAAO,EAAE;IAC3BE,QAAQ,CAACC,IAAI,CAACE,YAAY,CAACN,GAAG,CAACC,OAAO,EAAsBC,KAAK,CAAC;EACtE,CAAC,EAAE,EAAE,CAAC;EAEN,oBAAOV,YAAY,eAACG,IAAA;IAAOI,GAAG,EAAEC,GAAI;IAAA,GAAKF;EAAK,CAAG,CAAC,EAAEK,QAAQ,CAACC,IAAI,CAAC;AACtE,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSize","forwardRef","useEffect","useRef","useState","jsx","_jsx","TransitionBox","props","ref","style","containerClassName","containerStyle","children","vertical","horizontal","time","rest","container","size","width","height","count","setCount","Math","min","outerStyle","transitionProperty","filter","Boolean","join","undefined","transitionDuration","overflow","position","className"],"sources":["../../../src/components/TransitionBox.tsx"],"sourcesContent":["\"use client\"\n\nimport { useSize } from \"ahooks\"\nimport { CSSProperties, FC,
|
|
1
|
+
{"version":3,"names":["useSize","forwardRef","useEffect","useRef","useState","jsx","_jsx","TransitionBox","props","ref","style","containerClassName","containerStyle","children","vertical","horizontal","time","rest","container","size","width","height","count","setCount","Math","min","outerStyle","transitionProperty","filter","Boolean","join","undefined","transitionDuration","overflow","position","className"],"sources":["../../../src/components/TransitionBox.tsx"],"sourcesContent":["\"use client\"\n\nimport { useSize } from \"ahooks\"\nimport { CSSProperties, FC, HTMLAttributes, forwardRef, useEffect, useRef, useState } from \"react\"\n\nexport interface TransitionBoxProps extends HTMLAttributes<HTMLDivElement> {\n containerClassName?: string\n containerStyle?: CSSProperties\n vertical?: boolean\n horizontal?: boolean\n time?: number\n}\n\n/** 尺寸渐变的组件 */\nexport const TransitionBox: FC<TransitionBoxProps> = forwardRef<HTMLDivElement, TransitionBoxProps>((props, ref) => {\n const { style, containerClassName, containerStyle, children, vertical = true, horizontal = true, time = 3000, ...rest } = props\n const container = useRef<HTMLDivElement>(null)\n const size = useSize(container)\n const width = size?.width ?? 0\n const height = size?.height ?? 0\n const [count, setCount] = useState(0)\n\n useEffect(() => {\n setCount(count => Math.min(count + 1, 3))\n }, [width, height])\n\n const outerStyle: CSSProperties = {\n transitionProperty: count === 3 ? [horizontal && \"width\", vertical && \"height\"].filter(Boolean).join(\", \") : undefined,\n transitionDuration: count === 3 ? `${time}ms` : undefined,\n width,\n height,\n overflow: \"hidden\",\n position: \"relative\",\n ...style,\n }\n\n return (\n <div ref={ref} style={outerStyle} {...rest}>\n <div className={containerClassName} style={{ position: \"absolute\", ...containerStyle }} ref={container}>\n {children}\n </div>\n </div>\n )\n})\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,OAAO,QAAQ,QAAQ;AAChC,SAA4CC,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAUlG;AACA,OAAO,MAAMC,aAAqC,gBAAGN,UAAU,CAAqC,CAACO,KAAK,EAAEC,GAAG,KAAK;EAChH,MAAM;IAAEC,KAAK;IAAEC,kBAAkB;IAAEC,cAAc;IAAEC,QAAQ;IAAEC,QAAQ,GAAG,IAAI;IAAEC,UAAU,GAAG,IAAI;IAAEC,IAAI,GAAG,IAAI;IAAE,GAAGC;EAAK,CAAC,GAAGT,KAAK;EAC/H,MAAMU,SAAS,GAAGf,MAAM,CAAiB,IAAI,CAAC;EAC9C,MAAMgB,IAAI,GAAGnB,OAAO,CAACkB,SAAS,CAAC;EAC/B,MAAME,KAAK,GAAGD,IAAI,EAAEC,KAAK,IAAI,CAAC;EAC9B,MAAMC,MAAM,GAAGF,IAAI,EAAEE,MAAM,IAAI,CAAC;EAChC,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGnB,QAAQ,CAAC,CAAC,CAAC;EAErCF,SAAS,CAAC,MAAM;IACZqB,QAAQ,CAACD,KAAK,IAAIE,IAAI,CAACC,GAAG,CAACH,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;EAC7C,CAAC,EAAE,CAACF,KAAK,EAAEC,MAAM,CAAC,CAAC;EAEnB,MAAMK,UAAyB,GAAG;IAC9BC,kBAAkB,EAAEL,KAAK,KAAK,CAAC,GAAG,CAACP,UAAU,IAAI,OAAO,EAAED,QAAQ,IAAI,QAAQ,CAAC,CAACc,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,GAAGC,SAAS;IACtHC,kBAAkB,EAAEV,KAAK,KAAK,CAAC,GAAI,GAAEN,IAAK,IAAG,GAAGe,SAAS;IACzDX,KAAK;IACLC,MAAM;IACNY,QAAQ,EAAE,QAAQ;IAClBC,QAAQ,EAAE,UAAU;IACpB,GAAGxB;EACP,CAAC;EAED,oBACIJ,IAAA;IAAKG,GAAG,EAAEA,GAAI;IAACC,KAAK,EAAEgB,UAAW;IAAA,GAAKT,IAAI;IAAAJ,QAAA,eACtCP,IAAA;MAAK6B,SAAS,EAAExB,kBAAmB;MAACD,KAAK,EAAE;QAAEwB,QAAQ,EAAE,UAAU;QAAE,GAAGtB;MAAe,CAAE;MAACH,GAAG,EAAES,SAAU;MAAAL,QAAA,EAClGA;IAAQ,CACR;EAAC,CACL,CAAC;AAEd,CAAC,CAAC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { css } from "@emotion/css";
|
|
4
1
|
import { clsx } from "deepsea-tools";
|
|
5
2
|
import { forwardRef } from "react";
|
|
3
|
+
import { css } from "@emotion/css";
|
|
6
4
|
import { px, transformCSSVariable } from "../utils";
|
|
7
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
6
|
/** 梯形组件 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["clsx","forwardRef","css","px","transformCSSVariable","jsx","_jsx","Trapezium","props","ref","top","bottom","height","borderRadius","className","style","rest","diff","a","Math","atan","b","tan","c","cos","d","sin","e","PI","f","g","h","width","clipath"],"sources":["../../../src/components/Trapezium.tsx"],"sourcesContent":["import { clsx } from \"deepsea-tools\"\nimport { HTMLAttributes, forwardRef } from \"react\"\n\nimport { css } from \"@emotion/css\"\nimport { px, transformCSSVariable } from \"../utils\"\n\nexport interface TrapeziumProps extends HTMLAttributes<HTMLDivElement> {\n top: number\n bottom: number\n height: number\n borderRadius: number\n}\n\n/** 梯形组件 */\nexport const Trapezium = forwardRef<HTMLDivElement, TrapeziumProps>((props, ref) => {\n const { top, bottom, height, borderRadius, className, style, ...rest } = props\n\n const diff = (bottom - top) / 2\n\n const a = Math.atan(height / diff) / 2\n\n const b = borderRadius / Math.tan(a)\n\n const c = b * Math.cos(a * 2)\n\n const d = b * Math.sin(a * 2)\n\n const e = Math.PI / 2 - a\n\n const f = borderRadius / Math.tan(e)\n\n const g = f * Math.cos(a * 2)\n\n const h = f * Math.sin(a * 2)\n\n return (\n <div\n ref={ref}\n className={clsx(\n css`\n width: var(--width);\n height: var(--height);\n clip-path: var(--clip-path);\n `,\n className,\n )}\n style={transformCSSVariable(\n {\n width: px(bottom),\n height: px(height),\n clipath: `path(\"M ${diff + f} ${0} A ${borderRadius} ${borderRadius} 0 0 0 ${diff - g} ${h} L ${c} ${height - d} A ${borderRadius} ${borderRadius} 0 0 0 ${b} ${height} L ${bottom - b} ${height} A ${borderRadius} ${borderRadius} 0 0 0 ${bottom - c} ${height - d} L ${top + diff + g} ${h} A ${borderRadius} ${borderRadius} 0 0 0 ${top + diff - f} ${0} Z\")`,\n },\n style,\n )}\n {...rest}\n />\n )\n})\n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