cos-design 3.7.7 → 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/CHANGELOG.md +41 -0
- package/README.md +7 -7
- package/dist/index.cjs +3 -3
- package/dist/index.css +1 -1
- package/dist/index.js +1551 -1324
- package/dist/src/components/flipCard/index.d.ts +29 -0
- package/dist/src/components/index.d.ts +4 -0
- package/dist/src/components/nineGrid/index.d.ts +27 -0
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface FlipCardHandle {
|
|
3
|
+
/** 翻到背面(揭示奖励) */
|
|
4
|
+
flip: () => void;
|
|
5
|
+
/** 翻回正面 */
|
|
6
|
+
reset: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface FlipCardProps {
|
|
9
|
+
/** 正面标题 */
|
|
10
|
+
frontTitle?: string;
|
|
11
|
+
/** 正面副标题 */
|
|
12
|
+
frontSubtitle?: string;
|
|
13
|
+
/** 背面奖励标题 */
|
|
14
|
+
backTitle?: string;
|
|
15
|
+
/** 背面奖励说明 */
|
|
16
|
+
backSubtitle?: string;
|
|
17
|
+
/** 受控翻面状态;不传则非受控 */
|
|
18
|
+
flipped?: boolean;
|
|
19
|
+
/** 非受控时的初始翻面状态,默认 false */
|
|
20
|
+
defaultFlipped?: boolean;
|
|
21
|
+
/** 翻到背面时回调 */
|
|
22
|
+
onReveal?: () => void;
|
|
23
|
+
/** 翻面状态变化回调 */
|
|
24
|
+
onFlipChange?: (flipped: boolean) => void;
|
|
25
|
+
/** 禁用点击 */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
declare const FlipCard: React.ForwardRefExoticComponent<FlipCardProps & React.RefAttributes<FlipCardHandle>>;
|
|
29
|
+
export default FlipCard;
|
|
@@ -37,6 +37,8 @@ export { default as DoublePendulum } from './doublePendulum';
|
|
|
37
37
|
export type { DoublePendulumProps } from './doublePendulum';
|
|
38
38
|
export { default as Fireworks } from './fireworks';
|
|
39
39
|
export type { FireworksHandle, FireworksProps } from './fireworks';
|
|
40
|
+
export { default as FlipCard } from './flipCard';
|
|
41
|
+
export type { FlipCardHandle, FlipCardProps } from './flipCard';
|
|
40
42
|
export { default as FlipCounter } from './flipCounter';
|
|
41
43
|
export type { CountUpProps } from './countUp';
|
|
42
44
|
export { default as FuzzyText } from './fuzzyText';
|
|
@@ -72,6 +74,8 @@ export { default as NetworkGraph } from './networkGraph';
|
|
|
72
74
|
export type { NetworkGraphEdge, NetworkGraphNode, NetworkGraphProps } from './networkGraph';
|
|
73
75
|
export { default as NeonText } from './neonText';
|
|
74
76
|
export { default as NewtonCradle } from './newtonCradle';
|
|
77
|
+
export { default as NineGrid } from './nineGrid';
|
|
78
|
+
export type { NineGridHandle, NineGridItem, NineGridProps } from './nineGrid';
|
|
75
79
|
export type { NewtonCradleProps } from './newtonCradle';
|
|
76
80
|
export type { NeonTextProps } from './neonText';
|
|
77
81
|
export { default as OrbitalChart } from './orbitalChart';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface NineGridItem {
|
|
3
|
+
/** 奖品文案 */
|
|
4
|
+
label: string;
|
|
5
|
+
/** 可选图标(emoji 等),显示在文案上方 */
|
|
6
|
+
icon?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface NineGridHandle {
|
|
9
|
+
/** 开始抽奖;可传入目标索引覆盖 props.targetIndex */
|
|
10
|
+
draw: (targetIndex?: number) => void;
|
|
11
|
+
/** 重置高亮与中奖态 */
|
|
12
|
+
reset: () => void;
|
|
13
|
+
}
|
|
14
|
+
export interface NineGridProps {
|
|
15
|
+
/** 9 个奖品格子(不足补齐、超出截断) */
|
|
16
|
+
items?: NineGridItem[];
|
|
17
|
+
/** 指定下一次抽中的索引 0–8(服务端开奖);不传则随机 */
|
|
18
|
+
targetIndex?: number;
|
|
19
|
+
/** 抽奖按钮文案 */
|
|
20
|
+
buttonText?: string;
|
|
21
|
+
/** 抽奖结束回调 */
|
|
22
|
+
onDrawEnd?: (item: NineGridItem, index: number) => void;
|
|
23
|
+
/** 禁用交互 */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
}
|
|
26
|
+
declare const NineGrid: React.ForwardRefExoticComponent<NineGridProps & React.RefAttributes<NineGridHandle>>;
|
|
27
|
+
export default NineGrid;
|
package/package.json
CHANGED