cos-design 3.7.8 → 3.7.9
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/index.js
CHANGED
|
@@ -1448,7 +1448,7 @@ var Oe = {
|
|
|
1448
1448
|
kicker: "cos-kicker-H-OGk",
|
|
1449
1449
|
title: "cos-title-XTDn7",
|
|
1450
1450
|
subtitle: "cos-subtitle-2YmXW"
|
|
1451
|
-
}, ke = t(
|
|
1451
|
+
}, ke = t(({ frontTitle: e = "签到翻牌", frontSubtitle: t = "点击翻开今日奖励", backTitle: n = "恭喜获得", backSubtitle: r = "积分 +20", flipped: i, defaultFlipped: o = !1, onReveal: s, onFlipChange: l, disabled: f = !1 }, p) => {
|
|
1452
1452
|
let [m, h] = c(o), g = typeof i == "boolean", _ = g ? !!i : m, v = (e, t) => {
|
|
1453
1453
|
g || h(e), l?.(e), e && t && s?.();
|
|
1454
1454
|
};
|
|
@@ -1508,7 +1508,9 @@ var Oe = {
|
|
|
1508
1508
|
})]
|
|
1509
1509
|
})
|
|
1510
1510
|
});
|
|
1511
|
-
})
|
|
1511
|
+
});
|
|
1512
|
+
ke.displayName = "FlipCard";
|
|
1513
|
+
var Ae = {
|
|
1512
1514
|
flipCounter: "cos-flipCounter-3LuI0",
|
|
1513
1515
|
digit: "cos-digit-yJRPy",
|
|
1514
1516
|
digitCard: "cos-digitCard-zZUzt",
|
|
@@ -2881,7 +2883,7 @@ var Oe = {
|
|
|
2881
2883
|
let t = [...e?.length ? e : Dt];
|
|
2882
2884
|
for (; t.length < 9;) t.push({ label: `奖品 ${t.length + 1}` });
|
|
2883
2885
|
return t.slice(0, 9);
|
|
2884
|
-
}, kt = t(
|
|
2886
|
+
}, kt = t(({ items: e = Dt, targetIndex: t, buttonText: i = "开始抽奖", onDrawEnd: o, disabled: l = !1 }, f) => {
|
|
2885
2887
|
let p = Ot(e), [m, h] = c(null), [g, _] = c(null), [v, y] = c(!1), b = s([]), x = s(o), S = s(t);
|
|
2886
2888
|
r(() => {
|
|
2887
2889
|
x.current = o;
|
|
@@ -2943,7 +2945,9 @@ var Oe = {
|
|
|
2943
2945
|
children: v ? "抽奖中…" : i
|
|
2944
2946
|
})]
|
|
2945
2947
|
});
|
|
2946
|
-
})
|
|
2948
|
+
});
|
|
2949
|
+
kt.displayName = "NineGrid";
|
|
2950
|
+
var At = {
|
|
2947
2951
|
orbitalChart: "cos-orbitalChart-XLORB",
|
|
2948
2952
|
canvas: "cos-canvas-hGVud",
|
|
2949
2953
|
legend: "cos-legend-Np9Mm",
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
export interface FlipCardHandle {
|
|
3
|
+
/** 翻到背面(揭示奖励) */
|
|
3
4
|
flip: () => void;
|
|
5
|
+
/** 翻回正面 */
|
|
4
6
|
reset: () => void;
|
|
5
7
|
}
|
|
6
8
|
export interface FlipCardProps {
|
|
7
|
-
/**
|
|
9
|
+
/** 正面标题 */
|
|
8
10
|
frontTitle?: string;
|
|
9
|
-
/**
|
|
11
|
+
/** 正面副标题 */
|
|
10
12
|
frontSubtitle?: string;
|
|
11
|
-
/**
|
|
13
|
+
/** 背面奖励标题 */
|
|
12
14
|
backTitle?: string;
|
|
13
|
-
/**
|
|
15
|
+
/** 背面奖励说明 */
|
|
14
16
|
backSubtitle?: string;
|
|
15
|
-
/**
|
|
17
|
+
/** 受控翻面状态;不传则非受控 */
|
|
16
18
|
flipped?: boolean;
|
|
17
|
-
/**
|
|
19
|
+
/** 非受控时的初始翻面状态,默认 false */
|
|
18
20
|
defaultFlipped?: boolean;
|
|
19
|
-
/**
|
|
21
|
+
/** 翻到背面时回调 */
|
|
20
22
|
onReveal?: () => void;
|
|
21
|
-
/**
|
|
23
|
+
/** 翻面状态变化回调 */
|
|
22
24
|
onFlipChange?: (flipped: boolean) => void;
|
|
23
|
-
/**
|
|
25
|
+
/** 禁用点击 */
|
|
24
26
|
disabled?: boolean;
|
|
25
27
|
}
|
|
26
28
|
declare const FlipCard: React.ForwardRefExoticComponent<FlipCardProps & React.RefAttributes<FlipCardHandle>>;
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
export interface NineGridItem {
|
|
3
|
+
/** 奖品文案 */
|
|
3
4
|
label: string;
|
|
4
|
-
/**
|
|
5
|
+
/** 可选图标(emoji 等),显示在文案上方 */
|
|
5
6
|
icon?: string;
|
|
6
7
|
}
|
|
7
8
|
export interface NineGridHandle {
|
|
8
|
-
/**
|
|
9
|
+
/** 开始抽奖;可传入目标索引覆盖 props.targetIndex */
|
|
9
10
|
draw: (targetIndex?: number) => void;
|
|
11
|
+
/** 重置高亮与中奖态 */
|
|
10
12
|
reset: () => void;
|
|
11
13
|
}
|
|
12
14
|
export interface NineGridProps {
|
|
13
|
-
/**
|
|
15
|
+
/** 9 个奖品格子(不足补齐、超出截断) */
|
|
14
16
|
items?: NineGridItem[];
|
|
15
|
-
/**
|
|
17
|
+
/** 指定下一次抽中的索引 0–8(服务端开奖);不传则随机 */
|
|
16
18
|
targetIndex?: number;
|
|
17
|
-
/**
|
|
19
|
+
/** 抽奖按钮文案 */
|
|
18
20
|
buttonText?: string;
|
|
19
|
-
/**
|
|
21
|
+
/** 抽奖结束回调 */
|
|
20
22
|
onDrawEnd?: (item: NineGridItem, index: number) => void;
|
|
21
|
-
/**
|
|
23
|
+
/** 禁用交互 */
|
|
22
24
|
disabled?: boolean;
|
|
23
25
|
}
|
|
24
26
|
declare const NineGrid: React.ForwardRefExoticComponent<NineGridProps & React.RefAttributes<NineGridHandle>>;
|
package/package.json
CHANGED