@rxdrag/website-lib-core 0.0.6 → 0.0.8
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/index.ts +1 -1
- package/package.json +11 -7
- package/src/component-logic/gsap.d.ts +4 -0
- package/src/component-logic/index.ts +8 -0
- package/src/component-logic/link-client.ts +33 -0
- package/src/component-logic/link.ts +50 -0
- package/src/component-logic/modal.ts +36 -0
- package/src/component-logic/motion.ts +272 -0
- package/src/component-logic/number.ts +45 -0
- package/src/component-logic/popover.ts +51 -0
- package/src/component-logic/tabs.ts +10 -0
- package/src/controller/AnimateController.ts +138 -0
- package/src/controller/AosController.ts +240 -0
- package/src/controller/FlipController.ts +339 -0
- package/src/controller/ModalController.ts +127 -0
- package/src/controller/NumberController.ts +161 -0
- package/src/controller/PageLoader.ts +163 -0
- package/src/controller/PopoverController.ts +116 -0
- package/src/controller/TabsController.ts +271 -0
- package/src/controller/applyAnimation.ts +86 -0
- package/src/controller/applyInitialState.ts +79 -0
- package/src/{scripts → controller}/consts.ts +0 -2
- package/src/controller/index.ts +9 -0
- package/src/controller/popup.ts +346 -0
- package/src/controller/utils.ts +48 -0
- package/src/entify/Entify.ts +354 -365
- package/src/entify/IEntify.ts +91 -0
- package/src/entify/index.ts +3 -2
- package/src/entify/lib/newQueryProductOptions.ts +2 -3
- package/src/entify/lib/newQueryProductsMediaOptions.ts +19 -18
- package/src/entify/lib/queryAllProducts.ts +11 -3
- package/src/entify/lib/queryFeaturedProducts.ts +3 -3
- package/src/entify/lib/queryLatestPosts.ts +2 -2
- package/src/entify/lib/queryOneTheme.ts +1 -1
- package/src/entify/lib/queryPostCategories.ts +3 -3
- package/src/entify/lib/queryPostSlugs.ts +2 -2
- package/src/entify/lib/queryPosts.ts +92 -92
- package/src/entify/lib/queryProductCategories.ts +3 -3
- package/src/entify/lib/queryProducts.ts +69 -69
- package/src/entify/lib/queryUserPosts.ts +2 -2
- package/src/entify/lib/searchProducts.ts +2 -2
- package/src/index.ts +3 -1
- package/src/lib/formatDate.ts +15 -0
- package/src/lib/index.ts +3 -0
- package/src/lib/pagination.ts +114 -0
- package/src/lib/utils.ts +119 -0
- package/src/motion/consts.ts +428 -598
- package/src/motion/convertToGsapVars.ts +102 -0
- package/src/motion/index.ts +5 -1
- package/src/motion/normalizeAnimation.ts +28 -0
- package/src/motion/normalizeAosAnimation.ts +22 -0
- package/src/motion/normalizePopupAnimation.ts +24 -0
- package/src/motion/types.ts +133 -46
- package/src/react/components/AttachmentIcon/index.tsx +53 -0
- package/src/react/components/ContactForm/index.tsx +341 -0
- package/src/react/components/Icon/index.tsx +10 -0
- package/src/react/components/Medias/index.tsx +347 -347
- package/src/react/components/ProductCard/ProductCta/index.tsx +7 -5
- package/src/react/components/RichTextOutline/index.tsx +76 -76
- package/src/react/components/Scroller.tsx +5 -1
- package/src/react/components/SearchInput.tsx +36 -34
- package/src/react/components/ToTop.tsx +63 -28
- package/src/react/components/index.ts +3 -1
- package/src/react/hooks/useScroll.ts +16 -10
- package/src/react/components/EnquiryForm/index.tsx +0 -334
- package/src/scripts/actions.ts +0 -304
- package/src/scripts/events.ts +0 -33
- package/src/scripts/index.ts +0 -3
- /package/src/react/components/{EnquiryForm → ContactForm}/Input.tsx +0 -0
- /package/src/react/components/{EnquiryForm → ContactForm}/Submit.tsx +0 -0
- /package/src/react/components/{EnquiryForm → ContactForm}/Textarea.tsx +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { AnimationConfig, EaseConfig, EaseString } from "./types";
|
|
2
|
+
import { gsap } from "gsap/dist/gsap";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 将AnimationConfig转换为GSAP兼容的TweenVars
|
|
6
|
+
* @param animation 动画配置
|
|
7
|
+
* @returns GSAP兼容的动画配置
|
|
8
|
+
*/
|
|
9
|
+
export function convertToGsapVars(animation: AnimationConfig): gsap.TweenVars {
|
|
10
|
+
// 创建基础TweenVars对象
|
|
11
|
+
const gsapVars: gsap.TweenVars = {};
|
|
12
|
+
|
|
13
|
+
// 如果传入的是直接包含属性的对象(如initial),直接使用其中的属性
|
|
14
|
+
if (
|
|
15
|
+
typeof animation === "object" &&
|
|
16
|
+
!animation.to &&
|
|
17
|
+
!animation.from &&
|
|
18
|
+
!animation.fromTo
|
|
19
|
+
) {
|
|
20
|
+
// 检查是否有initial属性
|
|
21
|
+
if (animation.initial) {
|
|
22
|
+
// initial属性是TweenVars类型,可以直接使用
|
|
23
|
+
Object.assign(gsapVars, animation.initial);
|
|
24
|
+
} else {
|
|
25
|
+
// 复制除了控制参数外的所有属性
|
|
26
|
+
// 这里使用安全的类型方式处理
|
|
27
|
+
const copyProps = (obj: Record<string, unknown>) => {
|
|
28
|
+
Object.keys(obj).forEach((key) => {
|
|
29
|
+
// 跳过动画控制参数
|
|
30
|
+
if (
|
|
31
|
+
key !== "duration" &&
|
|
32
|
+
key !== "delay" &&
|
|
33
|
+
key !== "ease" &&
|
|
34
|
+
key !== "preset"
|
|
35
|
+
) {
|
|
36
|
+
gsapVars[key] = obj[key];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
copyProps(animation as Record<string, unknown>);
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
// 标准动画配置处理
|
|
45
|
+
// 复制所有属性
|
|
46
|
+
if (animation.to) {
|
|
47
|
+
Object.assign(gsapVars, animation.to);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (animation.from) {
|
|
51
|
+
Object.assign(gsapVars, animation.from);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (animation.fromTo) {
|
|
55
|
+
Object.assign(gsapVars, animation.fromTo.to);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 复制动画控制参数
|
|
60
|
+
if (animation.duration) gsapVars.duration = animation.duration;
|
|
61
|
+
if (animation.delay) gsapVars.delay = animation.delay;
|
|
62
|
+
|
|
63
|
+
// 处理ease属性
|
|
64
|
+
if (animation.ease) {
|
|
65
|
+
if (typeof animation.ease === "string") {
|
|
66
|
+
// 字符串直接使用
|
|
67
|
+
gsapVars.ease = animation.ease as EaseString;
|
|
68
|
+
} else if (typeof animation.ease === "function") {
|
|
69
|
+
// 如果是函数,直接使用
|
|
70
|
+
gsapVars.ease = animation.ease;
|
|
71
|
+
} else if (typeof animation.ease === "object" && "type" in animation.ease) {
|
|
72
|
+
// 处理EaseConfig对象
|
|
73
|
+
const easeConfig = animation.ease as EaseConfig;
|
|
74
|
+
if (easeConfig.type) {
|
|
75
|
+
// 将EaseConfig转换为字符串
|
|
76
|
+
let easeStr = easeConfig.type;
|
|
77
|
+
|
|
78
|
+
// 添加方向后缀,如.out
|
|
79
|
+
easeStr += ".out";
|
|
80
|
+
|
|
81
|
+
// 添加参数
|
|
82
|
+
if (easeConfig.config) {
|
|
83
|
+
const params = [];
|
|
84
|
+
if (easeConfig.config.overshoot !== undefined)
|
|
85
|
+
params.push(easeConfig.config.overshoot);
|
|
86
|
+
if (easeConfig.config.amplitude !== undefined)
|
|
87
|
+
params.push(easeConfig.config.amplitude);
|
|
88
|
+
if (easeConfig.config.period !== undefined)
|
|
89
|
+
params.push(easeConfig.config.period);
|
|
90
|
+
|
|
91
|
+
if (params.length > 0) {
|
|
92
|
+
easeStr += `(${params.join(",")})`;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
gsapVars.ease = easeStr;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return gsapVars;
|
|
102
|
+
}
|
package/src/motion/index.ts
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ANIMATIONS } from "./consts";
|
|
2
|
+
import { AnimationConfig } from "./types";
|
|
3
|
+
import { merge } from "lodash-es";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 标准化动画配置,把预置动画补全
|
|
7
|
+
* @param motion 动画配置
|
|
8
|
+
* @param isDual 是否为双态动画
|
|
9
|
+
* @returns 标准化后的动画配置
|
|
10
|
+
*/
|
|
11
|
+
export function normalizeAnimation(motion?: AnimationConfig | string) {
|
|
12
|
+
let presetKey: string | undefined;
|
|
13
|
+
let normalMotion: AnimationConfig | undefined;
|
|
14
|
+
if (typeof motion === "string") {
|
|
15
|
+
presetKey = motion;
|
|
16
|
+
} else {
|
|
17
|
+
presetKey = motion?.preset;
|
|
18
|
+
normalMotion = motion;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (presetKey) {
|
|
22
|
+
const presetMotion = ANIMATIONS[presetKey];
|
|
23
|
+
if (presetMotion) {
|
|
24
|
+
return merge(presetMotion, normalMotion);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return normalMotion;
|
|
28
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { merge } from "lodash-es";
|
|
2
|
+
import { AOS_ANIMATIONS } from "./consts";
|
|
3
|
+
import { AnimationConfig, AosAnimationConfig } from "./types";
|
|
4
|
+
|
|
5
|
+
export function normalizeAosAnimation(motion?: AosAnimationConfig | string) {
|
|
6
|
+
let presetKey: string | undefined;
|
|
7
|
+
let normalMotion: AnimationConfig | undefined;
|
|
8
|
+
if (typeof motion === "string") {
|
|
9
|
+
presetKey = motion;
|
|
10
|
+
} else {
|
|
11
|
+
presetKey = motion?.preset;
|
|
12
|
+
normalMotion = motion;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (presetKey) {
|
|
16
|
+
const presetMotion = AOS_ANIMATIONS[presetKey];
|
|
17
|
+
if (presetMotion) {
|
|
18
|
+
return merge(presetMotion, normalMotion);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return normalMotion;
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { merge } from "lodash-es";
|
|
2
|
+
import { PopupAnimationConfig } from "./types";
|
|
3
|
+
import { POPUP_ANIMATIONS } from "./consts";
|
|
4
|
+
|
|
5
|
+
export function normalizePopupAnimation(
|
|
6
|
+
motion?: PopupAnimationConfig | string
|
|
7
|
+
) {
|
|
8
|
+
let presetKey: string | undefined;
|
|
9
|
+
let normalMotion: PopupAnimationConfig | undefined;
|
|
10
|
+
if (typeof motion === "string") {
|
|
11
|
+
presetKey = motion;
|
|
12
|
+
} else {
|
|
13
|
+
presetKey = motion?.preset;
|
|
14
|
+
normalMotion = motion;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (presetKey) {
|
|
18
|
+
const presetMotion = POPUP_ANIMATIONS[presetKey];
|
|
19
|
+
if (presetMotion) {
|
|
20
|
+
return merge(presetMotion, normalMotion);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return normalMotion;
|
|
24
|
+
}
|
package/src/motion/types.ts
CHANGED
|
@@ -1,46 +1,133 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
import { PresetAnimations } from "./consts";
|
|
2
|
+
|
|
3
|
+
// ease配置对象类型,修改为与GSAP兼容的类型
|
|
4
|
+
export type EaseFunction = (progress: number) => number;
|
|
5
|
+
export type EaseString = string;
|
|
6
|
+
|
|
7
|
+
export interface EaseConfig {
|
|
8
|
+
type?: string; // 如 "back", "elastic", "bounce" 等
|
|
9
|
+
config?: {
|
|
10
|
+
// 配置参数
|
|
11
|
+
amplitude?: number;
|
|
12
|
+
period?: number;
|
|
13
|
+
overshoot?: number;
|
|
14
|
+
friction?: number;
|
|
15
|
+
velocity?: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type AnimationStyles = {
|
|
20
|
+
// CSS变换属性
|
|
21
|
+
x?: number | string;
|
|
22
|
+
y?: number | string;
|
|
23
|
+
z?: number | string;
|
|
24
|
+
rotation?: number | string;
|
|
25
|
+
rotationX?: number | string;
|
|
26
|
+
rotationY?: number | string;
|
|
27
|
+
rotationZ?: number | string;
|
|
28
|
+
scale?: number | string;
|
|
29
|
+
scaleX?: number | string;
|
|
30
|
+
scaleY?: number | string;
|
|
31
|
+
opacity?: number;
|
|
32
|
+
|
|
33
|
+
// 其他常用属性
|
|
34
|
+
transformOrigin?: string;
|
|
35
|
+
transform?: string;
|
|
36
|
+
backgroundColor?: string;
|
|
37
|
+
color?: string;
|
|
38
|
+
width?: number | string;
|
|
39
|
+
height?: number | string;
|
|
40
|
+
// 允许任意CSS属性
|
|
41
|
+
[prop: string]: unknown;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// GSAP TweenVars类型定义
|
|
45
|
+
export type TweenVars = AnimationStyles & {
|
|
46
|
+
// 动画控制参数 (也存在于IAnimation中,可保留做细粒度控制)
|
|
47
|
+
delay?: number;
|
|
48
|
+
duration?: number;
|
|
49
|
+
ease?: EaseString | EaseFunction;
|
|
50
|
+
repeat?: number;
|
|
51
|
+
repeatDelay?: number;
|
|
52
|
+
yoyo?: boolean;
|
|
53
|
+
stagger?: number | object;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type AnchorPlacement =
|
|
57
|
+
| "top-bottom"
|
|
58
|
+
| "top-center"
|
|
59
|
+
| "top-top"
|
|
60
|
+
| "center-bottom"
|
|
61
|
+
| "center-center"
|
|
62
|
+
| "center-top"
|
|
63
|
+
| "bottom-bottom"
|
|
64
|
+
| "bottom-center"
|
|
65
|
+
| "bottom-top";
|
|
66
|
+
|
|
67
|
+
export type AnchorOffset = {
|
|
68
|
+
element: number;
|
|
69
|
+
viewport: number;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export type AnchorOffsets = Record<AnchorPlacement, AnchorOffset>;
|
|
73
|
+
|
|
74
|
+
export type BaseAnimationConfig = {
|
|
75
|
+
// 初始状态设置 (gsap.set) - 立即应用,不产生动画
|
|
76
|
+
initial?: AnimationStyles;
|
|
77
|
+
// 主动画配置 - 三选一
|
|
78
|
+
to?: TweenVars; // 到目标状态 (gsap.to)
|
|
79
|
+
from?: TweenVars; // 从起始状态 (gsap.from)
|
|
80
|
+
fromTo?: {
|
|
81
|
+
// 从起始到目标状态 (gsap.fromTo)
|
|
82
|
+
from: TweenVars;
|
|
83
|
+
to: TweenVars;
|
|
84
|
+
};
|
|
85
|
+
// 通用动画配置
|
|
86
|
+
duration?: number;
|
|
87
|
+
delay?: number;
|
|
88
|
+
ease?: EaseString | EaseFunction;
|
|
89
|
+
opacity?: number;
|
|
90
|
+
autoAlpha?: number;
|
|
91
|
+
visibility?: string;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export type AnimationConfig = BaseAnimationConfig & {
|
|
95
|
+
preset?: PresetAnimations;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// 视口动画配置扩展接口
|
|
99
|
+
export type AosAnimationConfig = AnimationConfig & {
|
|
100
|
+
// 进入视口时的动画
|
|
101
|
+
enter?: AnimationConfig;
|
|
102
|
+
|
|
103
|
+
// 离开视口时的动画
|
|
104
|
+
exit?: AnimationConfig;
|
|
105
|
+
|
|
106
|
+
// 是否只触发一次 (默认false)
|
|
107
|
+
once?: boolean;
|
|
108
|
+
|
|
109
|
+
// 可选:触发阈值 (0-1之间,表示元素多少比例可见时触发)
|
|
110
|
+
threshold?: number;
|
|
111
|
+
|
|
112
|
+
// 可选:触发边距 (类似于IntersectionObserver的rootMargin)
|
|
113
|
+
margin?: string;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// Hover动画配置扩展接口
|
|
117
|
+
export type HoverAnimationConfig = AnimationConfig & {
|
|
118
|
+
// 鼠标进入时的动画
|
|
119
|
+
enter?: AnimationConfig;
|
|
120
|
+
|
|
121
|
+
// 鼠标离开时的动画
|
|
122
|
+
exit?: AnimationConfig;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export type PopupAnimationConfig = AnimationConfig & {
|
|
126
|
+
// 初始状态设置 (gsap.set) - 立即应用,不产生动画
|
|
127
|
+
initial?: AnimationStyles;
|
|
128
|
+
// 打开时的动画
|
|
129
|
+
open?: AnimationConfig;
|
|
130
|
+
|
|
131
|
+
// 关闭时的动画
|
|
132
|
+
close?: AnimationConfig;
|
|
133
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
|
|
3
|
+
export type AttachmentIconProps = {
|
|
4
|
+
extName?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const AttachmentIcon = forwardRef<HTMLDivElement, AttachmentIconProps>(
|
|
9
|
+
(props, ref) => {
|
|
10
|
+
const { extName, ...rest } = props;
|
|
11
|
+
return (
|
|
12
|
+
<div ref={ref} {...rest}>
|
|
13
|
+
{extName && extName === ".pdf" ? (
|
|
14
|
+
<svg
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
viewBox="0 0 1024 1024"
|
|
17
|
+
version="1.1"
|
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
19
|
+
>
|
|
20
|
+
<path d="M905.185809 178.844158C898.576738 172.685485 891.19337 165.824412 883.21687 158.436127 860.422682 137.322863 837.434925 116.207791 815.697647 96.487895 813.243072 94.261877 813.243072 94.261877 810.786411 92.037081 781.783552 65.781062 757.590948 44.376502 739.713617 29.293612 729.254178 20.469111 721.020606 13.860686 714.970549 9.501727 710.955023 6.608611 707.690543 4.524745 704.47155 2.998714 700.417679 1.07689 696.638044-0.094029 691.307277 0.005928 677.045677 0.273349 665.6 11.769337 665.6 26.182727L665.6 77.352844 665.6 128.522961 665.6 230.863194 665.6 256.448252 691.2 256.448252 896 256.448252 870.4 230.863194 870.4 998.414942 896 972.829884 230.381436 972.829884C187.90385 972.829884 153.6 938.623723 153.6 896.20663L153.6 26.182727 128 51.767786 588.8 51.767786C602.93849 51.767786 614.4 40.312965 614.4 26.182727 614.4 12.05249 602.93849 0.597669 588.8 0.597669L128 0.597669 102.4 0.597669 102.4 26.182727 102.4 896.20663C102.4 966.91021 159.652833 1024 230.381436 1024L896 1024 921.6 1024 921.6 998.414942 921.6 230.863194 921.6 205.278135 896 205.278135 691.2 205.278135 716.8 230.863194 716.8 128.522961 716.8 77.352844 716.8 26.182727C716.8 39.813762 705.748075 50.91427 692.267725 51.167041 687.705707 51.252584 685.069822 50.435995 682.52845 49.231204 682.259458 49.103682 683.344977 49.796618 685.029451 51.010252 689.779394 54.432502 697.145822 60.34494 706.686383 68.394196 724.009052 83.009121 747.816448 104.072869 776.413589 129.961594 778.850014 132.168064 778.850014 132.168064 781.285216 134.376514 802.876774 153.964212 825.739479 174.96442 848.413564 195.966437 856.350957 203.3185 863.697005 210.144893 870.269888 216.269843 874.209847 219.941299 877.019309 222.565641 878.499674 223.951409 888.81866 233.610931 905.019017 233.081212 914.684179 222.768247 924.349344 212.455283 923.819315 196.264383 913.500326 186.604861 911.981323 185.182945 909.155025 182.542876 905.185809 178.844158ZM102.4 461.128719 0 461.128719 0 896.074709 512 896.074709 1024 896.074709 1024 461.128719 153.6 461.128719 153.6 460.531049 102.4 460.531049 102.4 461.128719ZM208.2 711 208.2 819.2 157.6 819.2 157.6 528 269 528C301.533495 528 327.366571 536.466581 346.5 553.4 365.633429 570.333419 375.2 592.733195 375.2 620.6 375.2 649.133476 365.833427 671.333254 347.1 687.2 328.366573 703.066746 302.133502 711 268.4 711L208.2 711ZM208.2 670.4 269 670.4C287.00009 670.4 300.733286 666.166709 310.2 657.7 319.666714 649.233291 324.4 637.000079 324.4 621 324.4 605.266588 319.600047 592.700047 310 583.3 300.399951 573.899953 287.200083 569.066669 270.4 568.8L208.2 568.8 208.2 670.4ZM419.4 819.2 419.4 528 505.4 528C531.133461 528 553.966566 533.733276 573.9 545.2 593.833434 556.666724 609.266611 572.933229 620.2 594 631.133389 615.066771 636.6 639.199863 636.6 666.4L636.6 681C636.6 708.600139 631.100055 732.866562 620.1 753.8 609.099945 774.733438 593.433436 790.866609 573.1 802.2 552.766564 813.533391 529.466799 819.2 503.2 819.2L419.4 819.2ZM470 568.8 470 778.8 503 778.8C529.533466 778.8 549.89993 770.500083 564.1 753.9 578.30007 737.299917 585.533331 713.466822 585.8 682.4L585.8 666.2C585.8 634.599842 578.933402 610.46675 565.2 593.8 551.466598 577.13325 531.533463 568.8 505.4 568.8L470 568.8ZM854.8 695.8 737.6 695.8 737.6 819.2 687 819.2 687 528 872 528 872 568.8 737.6 568.8 737.6 655.4 854.8 655.4 854.8 695.8Z" />
|
|
21
|
+
</svg>
|
|
22
|
+
) : extName && (extName === ".xls" || extName === ".xlsx") ? (
|
|
23
|
+
<svg
|
|
24
|
+
fill="currentColor"
|
|
25
|
+
viewBox="0 0 1024 1024"
|
|
26
|
+
version="1.1"
|
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
+
>
|
|
29
|
+
<path d="M810.18 949.8H213.821c-20.551 0-37.271-16.649-37.271-37.1V111.3c0-20.45 16.72-37.1 37.271-37.1h395.27v143.74c0 52.25 46.97 94.77 104.71 94.77h133.65V912.7c0 20.451-16.72 37.1-37.27 37.1zM678.9 118.68l130.85 130.85H713.8c-19.25 0-34.9-14.169-34.9-31.59v-99.26z m168.551 55.41l-99.89-99.89L673.36 0H213.82C152.16 0 102 49.93 102 111.3v801.4c0 61.371 50.16 111.3 111.821 111.3h596.36C871.84 1024 922 974.071 922 912.7V248.64l-74.55-74.55z" />
|
|
30
|
+
<path d="M810.18 949.8H213.821c-20.551 0-37.271-16.649-37.271-37.1V111.3c0-20.45 16.72-37.1 37.271-37.1h395.27v143.74c0 52.25 46.97 94.77 104.71 94.77h133.65V912.7c0 20.451-16.72 37.1-37.27 37.1zM678.9 118.68l130.85 130.85H713.8c-19.25 0-34.9-14.169-34.9-31.59v-99.26z m168.551 55.41l-99.89-99.89L673.36 0H213.82C152.16 0 102 49.93 102 111.3v801.4c0 61.371 50.16 111.3 111.821 111.3h596.36C871.84 1024 922 974.071 922 912.7V248.64l-74.55-74.55z" />
|
|
31
|
+
<path d="M559.714 579.272L668.11 404.855a0.2 0.2 0 0 0-0.17-0.305h-89.12a0.2 0.2 0 0 0-0.174 0.102l-67.604 120.3-70.265-120.303a0.2 0.2 0 0 0-0.173-0.1h-85.779a0.2 0.2 0 0 0-0.168 0.308L461.02 571.401 347.653 746.24a0.2 0.2 0 0 0 0.168 0.309h88.007a0.2 0.2 0 0 0 0.17-0.095l74.362-120.51 75.153 120.51a0.2 0.2 0 0 0 0.17 0.095h89.835a0.2 0.2 0 0 0 0.164-0.314L559.714 579.272z" />
|
|
32
|
+
</svg>
|
|
33
|
+
) : extName && (extName === ".doc" || extName === ".docx") ? (
|
|
34
|
+
<svg
|
|
35
|
+
fill="currentColor"
|
|
36
|
+
viewBox="0 0 1024 1024"
|
|
37
|
+
version="1.1"
|
|
38
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
39
|
+
>
|
|
40
|
+
<path d="M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326z m1.8 562H232V136h302v216c0 23.2 18.8 42 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4c-1.1 0-2.1 0.1-3.1 0.4-6.4 1.7-10.2 8.3-8.5 14.7l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276c0.3-1 0.4-2.1 0.4-3.1 0-6.6-5.4-12-12-12H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z" />
|
|
41
|
+
</svg>
|
|
42
|
+
) : (
|
|
43
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
44
|
+
<path
|
|
45
|
+
fill="currentColor"
|
|
46
|
+
d="M14 11a3 3 0 0 1-3-3V4H7a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-8zm-2-3a2 2 0 0 0 2 2h3.59L12 4.41zM7 3h5l7 7v9a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3"
|
|
47
|
+
/>
|
|
48
|
+
</svg>
|
|
49
|
+
)}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
);
|