@cuemath/leap 3.2.21-tp-beta-0.3 → 3.2.22-as333
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/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapters-list.js +53 -68
- package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapters-list.js.map +1 -1
- package/dist/features/ui/dot-lottie-animations/dot-lottie-animation-styled.js +9 -0
- package/dist/features/ui/dot-lottie-animations/dot-lottie-animation-styled.js.map +1 -0
- package/dist/features/ui/dot-lottie-animations/dot-lottie-animation.js +80 -0
- package/dist/features/ui/dot-lottie-animations/dot-lottie-animation.js.map +1 -0
- package/dist/features/ui/inputs/base-select-input/base-select-input.js +77 -67
- package/dist/features/ui/inputs/base-select-input/base-select-input.js.map +1 -1
- package/dist/index.d.ts +27 -0
- package/dist/index.js +344 -342
- package/dist/index.js.map +1 -1
- package/dist/node_modules/@lottiefiles/dotlottie-web/dist/index.js +1881 -0
- package/dist/node_modules/@lottiefiles/dotlottie-web/dist/index.js.map +1 -0
- package/package.json +2 -1
@@ -1,88 +1,73 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import {
|
10
|
-
|
11
|
-
const
|
12
|
-
const { formData: u, isProcessing: d, onFormDataChange: i, isGoalCreation: n } = p, { testType: A, primaryChaptersList: o, chapterGoalCategory: D } = u, { primaryGoalCategory: G } = D || {}, a = A === "no-test", { flow: c } = b(N), { recommendedChaptersList: h, customChaptersList: s } = R(
|
1
|
+
import { jsx as e, jsxs as p, Fragment as G } from "react/jsx-runtime";
|
2
|
+
import { memo as X, useCallback as b } from "react";
|
3
|
+
import d from "../../../../../ui/layout/flex-view.js";
|
4
|
+
import k from "../../../../../ui/loader/app-loader/app-loader.js";
|
5
|
+
import D from "../../../../../ui/separator/separator.js";
|
6
|
+
import l from "../../../../../ui/text/text.js";
|
7
|
+
import C from "../../chapter-item/chapter-item.js";
|
8
|
+
import { computeRecommendedNCustomChapters as L } from "../utils.js";
|
9
|
+
import { ChaptersListWrapper as f } from "./chapter-selection-step-styled.js";
|
10
|
+
const F = X((u) => {
|
11
|
+
const { formData: $, isProcessing: g, onFormDataChange: m, isGoalCreation: t } = u, { testType: x, primaryChaptersList: o, chapterGoalCategory: A } = $, { primaryGoalCategory: T } = A || {}, a = x === "no-test", { recommendedChaptersList: s, customChaptersList: c } = L(
|
13
12
|
o,
|
14
|
-
|
15
|
-
|
16
|
-
),
|
17
|
-
(
|
18
|
-
if (
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
} : e);
|
26
|
-
i({
|
27
|
-
primaryChaptersList: l
|
13
|
+
T,
|
14
|
+
t
|
15
|
+
), h = b(
|
16
|
+
(r) => {
|
17
|
+
if (t && !a) return null;
|
18
|
+
const n = o == null ? void 0 : o.map((i) => i.id === r ? {
|
19
|
+
...i,
|
20
|
+
added: !i.added
|
21
|
+
} : i);
|
22
|
+
m({
|
23
|
+
primaryChaptersList: n
|
28
24
|
});
|
29
25
|
},
|
30
|
-
[o, a,
|
26
|
+
[o, a, t, m]
|
31
27
|
);
|
32
|
-
return
|
33
|
-
|
28
|
+
return g ? /* @__PURE__ */ e(
|
29
|
+
f,
|
34
30
|
{
|
35
31
|
$gapX: 1.5,
|
36
32
|
$gutterX: 1.5,
|
37
33
|
$flexGapX: 1.25,
|
38
34
|
$justifyContent: "center",
|
39
35
|
$alignItems: "center",
|
40
|
-
children: /* @__PURE__ */
|
36
|
+
children: /* @__PURE__ */ e(k, {})
|
41
37
|
}
|
42
|
-
) : /* @__PURE__ */ f
|
43
|
-
/* @__PURE__ */
|
44
|
-
/* @__PURE__ */
|
45
|
-
a && /* @__PURE__ */
|
38
|
+
) : /* @__PURE__ */ p(f, { $gapX: 1.5, $gutterX: 1.5, $flexGapX: 1.25, children: [
|
39
|
+
/* @__PURE__ */ p(d, { $flexDirection: "row", $flexGap: 4, $alignItems: "center", children: [
|
40
|
+
/* @__PURE__ */ e(l, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: "Recommended Chapters" }),
|
41
|
+
a && /* @__PURE__ */ e(l, { $renderAs: "ub2", $color: "BLACK_T_60", children: "(Click on any chapter to exclude it)" })
|
46
42
|
] }),
|
47
|
-
/* @__PURE__ */
|
48
|
-
|
49
|
-
|
50
|
-
|
43
|
+
/* @__PURE__ */ e(d, { $flexDirection: "row", $flexWrap: !0, $flexGapX: 1.25, children: s.length > 0 ? s.map((r, n) => /* @__PURE__ */ e(
|
44
|
+
C,
|
45
|
+
{
|
46
|
+
chapterData: r,
|
47
|
+
chapterNo: n + 1,
|
48
|
+
canAddChapter: !t || a,
|
49
|
+
onChapterItemClick: h
|
50
|
+
},
|
51
|
+
r.id
|
52
|
+
)) : /* @__PURE__ */ e(l, { $renderAs: "ub1", children: "No recommended chapters available" }) }),
|
53
|
+
!!(c != null && c.length) && /* @__PURE__ */ p(G, { children: [
|
54
|
+
/* @__PURE__ */ e(D, { height: 8, background: "TRANSPARENT" }),
|
55
|
+
/* @__PURE__ */ e(l, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: "Custom chapters" }),
|
56
|
+
/* @__PURE__ */ e(d, { $flexDirection: "row", $flexWrap: !0, $flexGapX: 1.25, children: c.map((r, n) => /* @__PURE__ */ e(
|
57
|
+
C,
|
51
58
|
{
|
52
|
-
chapterData:
|
53
|
-
|
54
|
-
|
55
|
-
onChapterItemClick:
|
59
|
+
chapterData: r,
|
60
|
+
canAddChapter: !t || a,
|
61
|
+
chapterNo: n + 1,
|
62
|
+
onChapterItemClick: h,
|
63
|
+
showChapterTags: !0
|
56
64
|
},
|
57
|
-
|
58
|
-
)
|
59
|
-
}) : /* @__PURE__ */ r(m, { $renderAs: "ub1", children: "No recommended chapters available" }) }),
|
60
|
-
!!(s != null && s.length) && /* @__PURE__ */ f(X, { children: [
|
61
|
-
/* @__PURE__ */ r(F, { height: 8, background: "TRANSPARENT" }),
|
62
|
-
/* @__PURE__ */ r(m, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: "Custom chapters" }),
|
63
|
-
/* @__PURE__ */ r(C, { $flexDirection: "row", $flexWrap: !0, $flexGapX: 1.25, children: s.map((t, l) => {
|
64
|
-
const e = x(
|
65
|
-
n,
|
66
|
-
a,
|
67
|
-
c,
|
68
|
-
t
|
69
|
-
);
|
70
|
-
return /* @__PURE__ */ r(
|
71
|
-
$,
|
72
|
-
{
|
73
|
-
chapterData: t,
|
74
|
-
canAddChapter: e,
|
75
|
-
chapterNo: l + 1,
|
76
|
-
onChapterItemClick: g,
|
77
|
-
showChapterTags: !0
|
78
|
-
},
|
79
|
-
t.id
|
80
|
-
);
|
81
|
-
}) })
|
65
|
+
r.id
|
66
|
+
)) })
|
82
67
|
] })
|
83
68
|
] });
|
84
69
|
});
|
85
70
|
export {
|
86
|
-
|
71
|
+
F as default
|
87
72
|
};
|
88
73
|
//# sourceMappingURL=chapters-list.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapters-list.js","sources":["../../../../../../../src/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapters-list.tsx"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"file":"chapters-list.js","sources":["../../../../../../../src/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapters-list.tsx"],"sourcesContent":["import type { IChaptersListProps } from './chapter-selection-step-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback } from 'react';\n\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport AppLoader from '../../../../../ui/loader/app-loader/app-loader';\nimport Seperator from '../../../../../ui/separator/separator';\nimport Text from '../../../../../ui/text/text';\nimport ChapterItemV2 from '../../chapter-item/chapter-item';\nimport { computeRecommendedNCustomChapters } from '../utils';\nimport * as Styled from './chapter-selection-step-styled';\n\nconst ChaptersList: FC<IChaptersListProps> = memo(props => {\n const { formData, isProcessing, onFormDataChange, isGoalCreation } = props;\n const { testType, primaryChaptersList, chapterGoalCategory } = formData;\n const { primaryGoalCategory } = chapterGoalCategory || {};\n const isSchoolSuccess = testType === 'no-test';\n\n const { recommendedChaptersList, customChaptersList } = computeRecommendedNCustomChapters(\n primaryChaptersList,\n primaryGoalCategory,\n isGoalCreation,\n );\n\n const handleChapterToggled = useCallback(\n (chapterId: string) => {\n //* If category is Test prep or Enrichment, Then one can not deselect the chapters.\n if (isGoalCreation && !isSchoolSuccess) return null;\n\n const updatedChaptersList = primaryChaptersList?.map(chapter => {\n if (chapter.id === chapterId) {\n return {\n ...chapter,\n added: !chapter.added,\n };\n }\n\n return chapter;\n });\n\n onFormDataChange({\n primaryChaptersList: updatedChaptersList,\n });\n },\n [primaryChaptersList, isSchoolSuccess, isGoalCreation, onFormDataChange],\n );\n\n if (isProcessing) {\n return (\n <Styled.ChaptersListWrapper\n $gapX={1.5}\n $gutterX={1.5}\n $flexGapX={1.25}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n <AppLoader />\n </Styled.ChaptersListWrapper>\n );\n }\n\n return (\n <Styled.ChaptersListWrapper $gapX={1.5} $gutterX={1.5} $flexGapX={1.25}>\n <FlexView $flexDirection=\"row\" $flexGap={4} $alignItems=\"center\">\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recommended Chapters\n </Text>\n\n {isSchoolSuccess && (\n <Text $renderAs=\"ub2\" $color=\"BLACK_T_60\">\n (Click on any chapter to exclude it)\n </Text>\n )}\n </FlexView>\n\n <FlexView $flexDirection=\"row\" $flexWrap $flexGapX={1.25}>\n {recommendedChaptersList.length > 0 ? (\n recommendedChaptersList.map((chapter, idx) => {\n return (\n <ChapterItemV2\n key={chapter.id}\n chapterData={chapter}\n chapterNo={idx + 1}\n canAddChapter={!isGoalCreation || isSchoolSuccess}\n onChapterItemClick={handleChapterToggled}\n />\n );\n })\n ) : (\n <Text $renderAs=\"ub1\">No recommended chapters available</Text>\n )}\n </FlexView>\n\n {!!customChaptersList?.length && (\n <>\n <Seperator height={8} background=\"TRANSPARENT\" />\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Custom chapters\n </Text>\n\n <FlexView $flexDirection=\"row\" $flexWrap $flexGapX={1.25}>\n {customChaptersList.map((chapter, idx) => {\n return (\n <ChapterItemV2\n key={chapter.id}\n chapterData={chapter}\n canAddChapter={!isGoalCreation || isSchoolSuccess}\n chapterNo={idx + 1}\n onChapterItemClick={handleChapterToggled}\n showChapterTags\n />\n );\n })}\n </FlexView>\n </>\n )}\n </Styled.ChaptersListWrapper>\n );\n});\n\nexport default ChaptersList;\n"],"names":["ChaptersList","memo","props","formData","isProcessing","onFormDataChange","isGoalCreation","testType","primaryChaptersList","chapterGoalCategory","primaryGoalCategory","isSchoolSuccess","recommendedChaptersList","customChaptersList","computeRecommendedNCustomChapters","handleChapterToggled","useCallback","chapterId","updatedChaptersList","chapter","jsx","Styled.ChaptersListWrapper","AppLoader","jsxs","FlexView","Text","idx","ChapterItemV2","Fragment","Seperator"],"mappings":";;;;;;;;;AAaM,MAAAA,IAAuCC,EAAK,CAASC,MAAA;AACzD,QAAM,EAAE,UAAAC,GAAU,cAAAC,GAAc,kBAAAC,GAAkB,gBAAAC,MAAmBJ,GAC/D,EAAE,UAAAK,GAAU,qBAAAC,GAAqB,qBAAAC,EAAA,IAAwBN,GACzD,EAAE,qBAAAO,EAAA,IAAwBD,KAAuB,IACjDE,IAAkBJ,MAAa,WAE/B,EAAE,yBAAAK,GAAyB,oBAAAC,EAAA,IAAuBC;AAAA,IACtDN;AAAA,IACAE;AAAA,IACAJ;AAAA,EAAA,GAGIS,IAAuBC;AAAA,IAC3B,CAACC,MAAsB;AAEjB,UAAAX,KAAkB,CAACK,EAAwB,QAAA;AAEzC,YAAAO,IAAsBV,KAAA,gBAAAA,EAAqB,IAAI,CAAWW,MAC1DA,EAAQ,OAAOF,IACV;AAAA,QAC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GAAG,YAAW,eAAc;AAAA,wBAE9CJ,GAAK,EAAA,WAAU,aAAY,QAAO,cAAa,UAEhD,mBAAA;AAAA,MAEC,gBAAAL,EAAAI,GAAA,EAAS,gBAAe,OAAM,WAAS,IAAC,WAAW,MACjD,UAAmBX,EAAA,IAAI,CAACM,GAASO,MAE9B,gBAAAN;AAAA,QAACO;AAAA,QAAA;AAAA,UAEC,aAAaR;AAAA,UACb,eAAe,CAACb,KAAkBK;AAAA,UAClC,WAAWe,IAAM;AAAA,UACjB,oBAAoBX;AAAA,UACpB,iBAAe;AAAA,QAAA;AAAA,QALVI,EAAQ;AAAA,MAAA,CAQlB,GACH;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import p from "styled-components";
|
2
|
+
const a = p.canvas`
|
3
|
+
${({ $renderWidth: o }) => typeof o == "number" ? `width: ${o}px;` : `width: ${o};`}
|
4
|
+
${({ $renderHeight: o }) => typeof o == "number" ? `height: ${o}px;` : `height: ${o};`}
|
5
|
+
`;
|
6
|
+
export {
|
7
|
+
a as Canvas
|
8
|
+
};
|
9
|
+
//# sourceMappingURL=dot-lottie-animation-styled.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dot-lottie-animation-styled.js","sources":["../../../../src/features/ui/dot-lottie-animations/dot-lottie-animation-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const Canvas = styled.canvas<{\n $renderWidth: string | number;\n $renderHeight: string | number;\n}>`\n ${({ $renderWidth }) =>\n typeof $renderWidth === 'number' ? `width: ${$renderWidth}px;` : `width: ${$renderWidth};`}\n ${({ $renderHeight }) =>\n typeof $renderHeight === 'number' ? `height: ${$renderHeight}px;` : `height: ${$renderHeight};`}\n`;\n"],"names":["Canvas","styled","$renderWidth","$renderHeight"],"mappings":";AAEO,MAAMA,IAASC,EAAO;AAAA,IAIzB,CAAC,EAAE,cAAAC,EAAa,MAChB,OAAOA,KAAiB,WAAW,UAAUA,CAAY,QAAQ,UAAUA,CAAY,GAAG;AAAA,IAC1F,CAAC,EAAE,eAAAC,EAAc,MACjB,OAAOA,KAAkB,WAAW,WAAWA,CAAa,QAAQ,WAAWA,CAAa,GAAG;AAAA;"}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
2
|
+
import { DotLottieWorker as v } from "../../../node_modules/@lottiefiles/dotlottie-web/dist/index.js";
|
3
|
+
import { memo as w, forwardRef as x, useRef as p, useImperativeHandle as R, useEffect as h } from "react";
|
4
|
+
import E from "../layout/flex-view.js";
|
5
|
+
import { Canvas as H } from "./dot-lottie-animation-styled.js";
|
6
|
+
const N = x((y, g) => {
|
7
|
+
const {
|
8
|
+
src: m,
|
9
|
+
width: i = "100%",
|
10
|
+
height: a = "100%",
|
11
|
+
settings: f,
|
12
|
+
eventListeners: r,
|
13
|
+
onRender: u,
|
14
|
+
onError: c
|
15
|
+
} = y, s = p(null), t = p(null);
|
16
|
+
return R(
|
17
|
+
g,
|
18
|
+
() => ({
|
19
|
+
playSegments: (e) => {
|
20
|
+
var n, o;
|
21
|
+
(n = t.current) == null || n.setSegment(e[0], e[1]), (o = t.current) == null || o.play();
|
22
|
+
},
|
23
|
+
play: () => {
|
24
|
+
var e;
|
25
|
+
(e = t.current) == null || e.play();
|
26
|
+
},
|
27
|
+
pause: () => {
|
28
|
+
var e;
|
29
|
+
(e = t.current) == null || e.pause();
|
30
|
+
}
|
31
|
+
}),
|
32
|
+
[]
|
33
|
+
), h(() => {
|
34
|
+
if (s.current)
|
35
|
+
try {
|
36
|
+
t.current = new v({
|
37
|
+
src: m,
|
38
|
+
canvas: s.current,
|
39
|
+
autoplay: !0,
|
40
|
+
loop: !1,
|
41
|
+
renderConfig: {
|
42
|
+
autoResize: !0,
|
43
|
+
devicePixelRatio: window.devicePixelRatio,
|
44
|
+
freezeOnOffscreen: !0
|
45
|
+
},
|
46
|
+
...f
|
47
|
+
}), requestAnimationFrame(() => {
|
48
|
+
u == null || u();
|
49
|
+
});
|
50
|
+
} catch (e) {
|
51
|
+
console.log(e), c == null || c();
|
52
|
+
}
|
53
|
+
}, [m, f, u, c]), h(() => (r == null || r.forEach(
|
54
|
+
({ name: e, callback: n }) => {
|
55
|
+
var o;
|
56
|
+
return (o = t.current) == null ? void 0 : o.addEventListener(e, n);
|
57
|
+
}
|
58
|
+
), () => {
|
59
|
+
var e;
|
60
|
+
r == null || r.forEach(
|
61
|
+
({ name: n, callback: o }) => {
|
62
|
+
var d;
|
63
|
+
return (d = t.current) == null ? void 0 : d.removeEventListener(n, o);
|
64
|
+
}
|
65
|
+
), (e = t.current) == null || e.destroy();
|
66
|
+
}), [r]), /* @__PURE__ */ l(E, { $width: i, $height: a, children: /* @__PURE__ */ l(
|
67
|
+
H,
|
68
|
+
{
|
69
|
+
ref: s,
|
70
|
+
$renderWidth: i,
|
71
|
+
$renderHeight: a,
|
72
|
+
width: typeof i == "number" ? i : void 0,
|
73
|
+
height: typeof a == "number" ? a : void 0
|
74
|
+
}
|
75
|
+
) });
|
76
|
+
}), F = w(N);
|
77
|
+
export {
|
78
|
+
F as default
|
79
|
+
};
|
80
|
+
//# sourceMappingURL=dot-lottie-animation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dot-lottie-animation.js","sources":["../../../../src/features/ui/dot-lottie-animations/dot-lottie-animation.tsx"],"sourcesContent":["import type {\n AnimationSegment,\n ILottieAnimationProps,\n ILottieAnimationRef,\n} from './dot-lottie-types';\n\nimport { DotLottieWorker } from '@lottiefiles/dotlottie-web';\nimport { forwardRef, memo, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport * as Styled from './dot-lottie-animation-styled';\n\nconst DotLottieAnimation = forwardRef<ILottieAnimationRef, ILottieAnimationProps>((props, ref) => {\n const {\n src,\n width = '100%',\n height = '100%',\n settings,\n eventListeners,\n onRender,\n onError,\n } = props;\n\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const animationInstance = useRef<DotLottieWorker | null>(null);\n\n useImperativeHandle(\n ref,\n () => ({\n playSegments: (segments: AnimationSegment) => {\n animationInstance.current?.setSegment(segments[0], segments[1]);\n animationInstance.current?.play();\n },\n play: () => {\n animationInstance.current?.play();\n },\n pause: () => {\n animationInstance.current?.pause();\n },\n }),\n [],\n );\n\n useEffect(() => {\n if (!canvasRef.current) return;\n\n try {\n animationInstance.current = new DotLottieWorker({\n src,\n canvas: canvasRef.current,\n autoplay: true,\n loop: false,\n renderConfig: {\n autoResize: true,\n devicePixelRatio: window.devicePixelRatio,\n freezeOnOffscreen: true,\n },\n ...settings,\n });\n\n requestAnimationFrame(() => {\n onRender?.();\n });\n } catch (err) {\n // eslint-disable-next-line no-console\n console.log(err);\n onError?.();\n }\n }, [src, settings, onRender, onError]);\n\n useEffect(() => {\n eventListeners?.forEach(\n ({ name, callback }) => animationInstance.current?.addEventListener(name, callback),\n );\n\n return () => {\n eventListeners?.forEach(\n ({ name, callback }) => animationInstance.current?.removeEventListener(name, callback),\n );\n animationInstance.current?.destroy();\n };\n }, [eventListeners]);\n\n const isNumW = typeof width === 'number';\n const isNumH = typeof height === 'number';\n\n return (\n <FlexView $width={width} $height={height}>\n <Styled.Canvas\n ref={canvasRef}\n $renderWidth={width}\n $renderHeight={height}\n width={isNumW ? width : undefined}\n height={isNumH ? height : undefined}\n />\n </FlexView>\n );\n});\n\nexport default memo(DotLottieAnimation);\n"],"names":["DotLottieAnimation","forwardRef","props","ref","src","width","height","settings","eventListeners","onRender","onError","canvasRef","useRef","animationInstance","useImperativeHandle","segments","_a","_b","useEffect","DotLottieWorker","err","name","callback","jsx","FlexView","Styled.Canvas","dotLottieAnimation","memo"],"mappings":";;;;;AAYA,MAAMA,IAAqBC,EAAuD,CAACC,GAAOC,MAAQ;AAC1F,QAAA;AAAA,IACJ,KAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IAC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A,KAGrE,MAAM;;AACK,IAAAd,KAAA,QAAAA,EAAA;AAAA,MACd,CAAC,EAAE,MAAAa,GAAM,UAAAC,QAAe;;AAAA,gBAAAN,IAAAH,EAAkB,YAAlB,gBAAAG,EAA2B,oBAAoBK,GAAMC;AAAA;AAAA,QAE/EN,IAAAH,EAAkB,YAAlB,QAAAG,EAA2B;AAAA,EAAQ,IAEpC,CAACR,CAAc,CAAC,GAMhB,gBAAAe,EAAAC,GAAA,EAAS,QAAQnB,GAAO,SAASC,GAChC,UAAA,gBAAAiB;AAAA,IAACE;AAAAA,IAAA;AAAA,MACC,KAAKd;AAAA,MACL,cAAcN;AAAA,MACd,eAAeC;AAAA,MACf,OATS,OAAOD,KAAU,WASVA,IAAQ;AAAA,MACxB,QATS,OAAOC,KAAW,WASVA,IAAS;AAAA,IAAA;AAAA,EAE9B,EAAA,CAAA;AAEJ,CAAC,GAEcoB,IAAAC,EAAK3B,CAAkB;"}
|
@@ -1,114 +1,124 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { useMemo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import { Input as
|
7
|
-
import { Container as
|
8
|
-
import
|
9
|
-
import
|
10
|
-
const
|
1
|
+
import { jsxs as V, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { useMemo as G, useRef as A, useCallback as d } from "react";
|
3
|
+
import J from "../../../../assets/line-icons/icons/cross.js";
|
4
|
+
import K from "../../hooks/use-context-menu-click-handler.js";
|
5
|
+
import N from "../base-input/base-input.js";
|
6
|
+
import { Input as P } from "../text-input/text-input-styled.js";
|
7
|
+
import { Container as Q, OptionsContainer as U, OptionsWrapper as Y, StyledChevronDownIcon as Z, StyledDownIcon as _ } from "./base-select-input-styled.js";
|
8
|
+
import ee from "./select-option/select-option.js";
|
9
|
+
import ne from "./select-section/select-section.js";
|
10
|
+
const he = (E) => {
|
11
11
|
const {
|
12
|
-
label:
|
13
|
-
value:
|
12
|
+
label: b,
|
13
|
+
value: i,
|
14
14
|
options: u,
|
15
15
|
searchable: n = !1,
|
16
16
|
searchText: g,
|
17
|
-
onCloseWithoutSelection:
|
18
|
-
onSearchTextChange:
|
19
|
-
onChange:
|
17
|
+
onCloseWithoutSelection: L,
|
18
|
+
onSearchTextChange: r,
|
19
|
+
onChange: v,
|
20
20
|
renderAs: h,
|
21
|
-
width:
|
22
|
-
widthX:
|
21
|
+
width: R,
|
22
|
+
widthX: j,
|
23
23
|
disabled: p,
|
24
|
-
willShowMessage:
|
25
|
-
mandatory:
|
26
|
-
size:
|
24
|
+
willShowMessage: z,
|
25
|
+
mandatory: B,
|
26
|
+
size: w = "regular",
|
27
27
|
shape: m,
|
28
28
|
theme: f = "light",
|
29
|
-
isTransparent:
|
29
|
+
isTransparent: S = !1,
|
30
30
|
renderOptionsAs: $ = "list",
|
31
|
-
errorMessage:
|
32
|
-
|
33
|
-
|
31
|
+
errorMessage: D,
|
32
|
+
inputLabelOverrides: C
|
33
|
+
} = E, s = $ === "section-list" && u, l = $ === "list" && u, I = G(() => {
|
34
|
+
var e;
|
34
35
|
if (n) return g;
|
35
|
-
if (
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
if (s) {
|
37
|
+
let o, a;
|
38
|
+
for (const T of s) {
|
39
|
+
const y = T.data.find(({ id: q }) => q === i);
|
40
|
+
if (y) {
|
41
|
+
o = T, a = y;
|
42
|
+
break;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
return o && C ? C(o, a) : (a == null ? void 0 : a.label) || "";
|
46
|
+
}
|
47
|
+
if (l) return (e = l.find((o) => o.id === i)) == null ? void 0 : e.label;
|
48
|
+
}, [n, g, s, l, C, i]), k = A(null), x = A(null), { menuVisible: c, onMenuClick: F, hideMenu: O } = K(
|
49
|
+
k,
|
40
50
|
void 0,
|
41
51
|
!n,
|
42
|
-
|
52
|
+
L,
|
43
53
|
p
|
44
|
-
),
|
54
|
+
), W = d(
|
45
55
|
(e) => {
|
46
|
-
n &&
|
56
|
+
n && r && r(e.target.value);
|
47
57
|
},
|
48
|
-
[
|
49
|
-
),
|
50
|
-
(e,
|
51
|
-
|
58
|
+
[r, n]
|
59
|
+
), M = d(
|
60
|
+
(e, o) => {
|
61
|
+
O(), v(e, o);
|
52
62
|
},
|
53
|
-
[
|
54
|
-
),
|
63
|
+
[O, v]
|
64
|
+
), X = d((e) => {
|
55
65
|
e.target.select(), setTimeout(() => {
|
56
66
|
e.target.scrollIntoView({
|
57
67
|
behavior: "smooth"
|
58
68
|
});
|
59
69
|
}, 300);
|
60
|
-
}, []),
|
70
|
+
}, []), H = d(() => {
|
61
71
|
var e;
|
62
|
-
|
63
|
-
}, [
|
64
|
-
return /* @__PURE__ */
|
72
|
+
r && (r(""), (e = x.current) == null || e.focus());
|
73
|
+
}, [r]);
|
74
|
+
return /* @__PURE__ */ V(Q, { ref: k, $width: R, $widthX: j, onClick: F, children: [
|
65
75
|
/* @__PURE__ */ t(
|
66
|
-
|
76
|
+
N,
|
67
77
|
{
|
68
78
|
renderAs: h,
|
69
|
-
label:
|
79
|
+
label: b,
|
70
80
|
stickyLabel: !0,
|
71
81
|
disabled: p,
|
72
|
-
willShowMessage:
|
73
|
-
size:
|
74
|
-
mandatory:
|
82
|
+
willShowMessage: z,
|
83
|
+
size: w,
|
84
|
+
mandatory: B,
|
75
85
|
shape: m,
|
76
|
-
isTransparent:
|
86
|
+
isTransparent: S,
|
77
87
|
inputElement: /* @__PURE__ */ t(
|
78
|
-
|
88
|
+
P,
|
79
89
|
{
|
80
90
|
ref: x,
|
81
91
|
$renderAs: h,
|
82
|
-
$size:
|
83
|
-
placeholder: I ? "" :
|
92
|
+
$size: w,
|
93
|
+
placeholder: I ? "" : b,
|
84
94
|
disabled: p,
|
85
95
|
readOnly: !n,
|
86
96
|
value: I ?? "",
|
87
|
-
onFocus: n ?
|
88
|
-
onChange: n ?
|
89
|
-
$isTransparent:
|
97
|
+
onFocus: n ? X : void 0,
|
98
|
+
onChange: n ? W : void 0,
|
99
|
+
$isTransparent: S
|
90
100
|
}
|
91
101
|
),
|
92
|
-
siblingElement: n &&
|
93
|
-
errorMessage:
|
102
|
+
siblingElement: n && c ? /* @__PURE__ */ t(J, { onClick: H }) : m === "curved" || m === "borderLess" ? /* @__PURE__ */ t(Z, { $menuVisible: c, pointerEvents: "none" }) : /* @__PURE__ */ t(_, { $menuVisible: c, pointerEvents: "none" }),
|
103
|
+
errorMessage: D
|
94
104
|
}
|
95
105
|
),
|
96
|
-
u.length > 0 && /* @__PURE__ */ t(
|
97
|
-
|
98
|
-
|
106
|
+
u.length > 0 && /* @__PURE__ */ t(U, { $visible: c, children: /* @__PURE__ */ V(Y, { $renderAs: h, $theme: f, children: [
|
107
|
+
s && /* @__PURE__ */ t(
|
108
|
+
ne,
|
99
109
|
{
|
100
|
-
sectionOptions:
|
110
|
+
sectionOptions: s,
|
101
111
|
theme: f,
|
102
|
-
value:
|
103
|
-
onChange:
|
112
|
+
value: i,
|
113
|
+
onChange: M
|
104
114
|
}
|
105
115
|
),
|
106
|
-
|
107
|
-
|
116
|
+
l && l.map((e) => /* @__PURE__ */ t(
|
117
|
+
ee,
|
108
118
|
{
|
109
119
|
option: e,
|
110
|
-
selected: e.id ===
|
111
|
-
onChange:
|
120
|
+
selected: e.id === i,
|
121
|
+
onChange: M,
|
112
122
|
theme: f
|
113
123
|
},
|
114
124
|
e.id
|
@@ -117,6 +127,6 @@ const ae = (y) => {
|
|
117
127
|
] });
|
118
128
|
};
|
119
129
|
export {
|
120
|
-
|
130
|
+
he as default
|
121
131
|
};
|
122
132
|
//# sourceMappingURL=base-select-input.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base-select-input.js","sources":["../../../../../src/features/ui/inputs/base-select-input/base-select-input.tsx"],"sourcesContent":["import type { ISectionOption } from '../../section-list/section-list-types';\nimport type { IBaseSelectInputProps, ISelectOption } from './base-select-input-types';\nimport type { ChangeEvent, FocusEvent, ReactElement } from 'react';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport useContextMenuClickHandler from '../../hooks/use-context-menu-click-handler';\nimport BaseInput from '../base-input/base-input';\nimport { Input } from '../text-input/text-input-styled';\nimport * as Styled from './base-select-input-styled';\nimport SelectOption from './select-option/select-option';\nimport SelectSection from './select-section/select-section';\n\nconst BaseSelectInput = <IDType extends string | number>(\n props: IBaseSelectInputProps<IDType>,\n): ReactElement => {\n const {\n label,\n value,\n options,\n searchable = false,\n searchText,\n onCloseWithoutSelection,\n onSearchTextChange,\n onChange,\n renderAs,\n width,\n widthX,\n disabled,\n willShowMessage,\n mandatory,\n size = 'regular',\n shape,\n theme = 'light',\n isTransparent = false,\n renderOptionsAs = 'list',\n errorMessage,\n } = props;\n\n const sectionOptions =\n renderOptionsAs === 'section-list' && (options as ISectionOption<ISelectOption<IDType>>[]);\n const selectOptions = renderOptionsAs === 'list' && (options as ISelectOption<IDType>[]);\n\n const inputValue = useMemo(() => {\n if (searchable) return searchText;\n\n if (sectionOptions) {\n
|
1
|
+
{"version":3,"file":"base-select-input.js","sources":["../../../../../src/features/ui/inputs/base-select-input/base-select-input.tsx"],"sourcesContent":["import type { ISectionOption } from '../../section-list/section-list-types';\nimport type { IBaseSelectInputProps, ISelectOption } from './base-select-input-types';\nimport type { ChangeEvent, FocusEvent, ReactElement } from 'react';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport useContextMenuClickHandler from '../../hooks/use-context-menu-click-handler';\nimport BaseInput from '../base-input/base-input';\nimport { Input } from '../text-input/text-input-styled';\nimport * as Styled from './base-select-input-styled';\nimport SelectOption from './select-option/select-option';\nimport SelectSection from './select-section/select-section';\n\nconst BaseSelectInput = <IDType extends string | number>(\n props: IBaseSelectInputProps<IDType>,\n): ReactElement => {\n const {\n label,\n value,\n options,\n searchable = false,\n searchText,\n onCloseWithoutSelection,\n onSearchTextChange,\n onChange,\n renderAs,\n width,\n widthX,\n disabled,\n willShowMessage,\n mandatory,\n size = 'regular',\n shape,\n theme = 'light',\n isTransparent = false,\n renderOptionsAs = 'list',\n errorMessage,\n inputLabelOverrides,\n } = props;\n\n const sectionOptions =\n renderOptionsAs === 'section-list' && (options as ISectionOption<ISelectOption<IDType>>[]);\n const selectOptions = renderOptionsAs === 'list' && (options as ISelectOption<IDType>[]);\n\n const inputValue = useMemo(() => {\n if (searchable) return searchText;\n\n if (sectionOptions) {\n let foundSection, foundOption;\n\n for (const section of sectionOptions) {\n const option = section.data.find(({ id }) => id === value);\n\n if (option) {\n foundSection = section;\n foundOption = option;\n\n break;\n }\n }\n\n if (foundSection && inputLabelOverrides)\n return inputLabelOverrides(foundSection, foundOption);\n\n return foundOption?.label || '';\n }\n\n if (selectOptions) return selectOptions.find(option => option.id === value)?.label;\n }, [searchable, searchText, sectionOptions, selectOptions, inputLabelOverrides, value]);\n\n const containerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const inputRef = useRef<HTMLInputElement>(null) as React.RefObject<HTMLInputElement>;\n const { menuVisible, onMenuClick, hideMenu } = useContextMenuClickHandler(\n containerRef,\n undefined,\n !searchable,\n onCloseWithoutSelection,\n disabled,\n );\n\n const handleTextChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n if (searchable && onSearchTextChange) {\n onSearchTextChange(e.target.value);\n }\n },\n [onSearchTextChange, searchable],\n );\n\n const handleChange = useCallback<IBaseSelectInputProps<IDType>['onChange']>(\n (id, option) => {\n hideMenu();\n onChange(id, option);\n },\n [hideMenu, onChange],\n );\n\n const handleFocus = useCallback((e: FocusEvent<HTMLInputElement>) => {\n e.target.select();\n setTimeout(() => {\n e.target.scrollIntoView({\n behavior: 'smooth',\n });\n }, 300);\n }, []);\n\n const handleClear = useCallback(() => {\n if (onSearchTextChange) {\n onSearchTextChange('');\n inputRef.current?.focus();\n }\n }, [onSearchTextChange]);\n\n const downIcon =\n shape === 'curved' || shape === 'borderLess' ? (\n <Styled.StyledChevronDownIcon $menuVisible={menuVisible} pointerEvents=\"none\" />\n ) : (\n <Styled.StyledDownIcon $menuVisible={menuVisible} pointerEvents=\"none\" />\n );\n\n return (\n <Styled.Container ref={containerRef} $width={width} $widthX={widthX} onClick={onMenuClick}>\n <BaseInput\n renderAs={renderAs}\n label={label}\n stickyLabel={true}\n disabled={disabled}\n willShowMessage={willShowMessage}\n size={size}\n mandatory={mandatory}\n shape={shape}\n isTransparent={isTransparent}\n inputElement={\n <Input\n ref={inputRef}\n $renderAs={renderAs}\n $size={size}\n placeholder={inputValue ? '' : label}\n disabled={disabled}\n readOnly={!searchable}\n value={inputValue ?? ''}\n onFocus={searchable ? handleFocus : undefined}\n onChange={searchable ? handleTextChange : undefined}\n $isTransparent={isTransparent}\n />\n }\n siblingElement={searchable && menuVisible ? <CrossIcon onClick={handleClear} /> : downIcon}\n errorMessage={errorMessage}\n />\n\n {options.length > 0 && (\n <Styled.OptionsContainer $visible={menuVisible}>\n <Styled.OptionsWrapper $renderAs={renderAs} $theme={theme}>\n {sectionOptions && (\n <SelectSection<IDType>\n sectionOptions={sectionOptions}\n theme={theme}\n value={value}\n onChange={handleChange}\n />\n )}\n\n {selectOptions &&\n selectOptions.map(option => (\n <SelectOption<IDType>\n key={option.id}\n option={option}\n selected={option.id === value}\n onChange={handleChange}\n theme={theme}\n />\n ))}\n </Styled.OptionsWrapper>\n </Styled.OptionsContainer>\n )}\n </Styled.Container>\n );\n};\n\nexport default BaseSelectInput;\n"],"names":["BaseSelectInput","props","label","value","options","searchable","searchText","onCloseWithoutSelection","onSearchTextChange","onChange","renderAs","width","widthX","disabled","willShowMessage","mandatory","size","shape","theme","isTransparent","renderOptionsAs","errorMessage","inputLabelOverrides","sectionOptions","selectOptions","inputValue","useMemo","foundSection","foundOption","section","option","id","_a","containerRef","useRef","inputRef","menuVisible","onMenuClick","hideMenu","useContextMenuClickHandler","handleTextChange","useCallback","handleChange","handleFocus","handleClear","jsxs","Styled.Container","jsx","BaseInput","Input","CrossIcon","Styled.StyledChevronDownIcon","Styled.StyledDownIcon","Styled.OptionsContainer","Styled.OptionsWrapper","SelectSection","SelectOption"],"mappings":";;;;;;;;;AAcM,MAAAA,KAAkB,CACtBC,MACiB;AACX,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,YAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,eAAAC,IAAgB;AAAA,IAChB,iBAAAC,IAAkB;AAAA,IAClB,cAAAC;AAAA,IACA,qBAAAC;AAAA,EACE,IAAArB,GAEEsB,IACJH,MAAoB,kBAAmBhB,GACnCoB,IAAgBJ,MAAoB,UAAWhB,GAE/CqB,IAAaC,EAAQ,MAAM;;AAC/B,QAAIrB,EAAmB,QAAAC;AAEvB,QAAIiB,GAAgB;AAClB,UAAII,GAAcC;AAElB,iBAAWC,KAAWN,GAAgB;AAC9B,cAAAO,IAASD,EAAQ,KAAK,KAAK,CAAC,EAAE,IAAAE,EAAS,MAAAA,MAAO5B,CAAK;AAEzD,YAAI2B,GAAQ;AACK,UAAAH,IAAAE,GACDD,IAAAE;AAEd;AAAA,QACF;AAAA,MACF;AAEA,aAAIH,KAAgBL,IACXA,EAAoBK,GAAcC,CAAW,KAE/CA,KAAA,gBAAAA,EAAa,UAAS;AAAA,IAC/B;AAEI,QAAAJ,WAAsBQ,IAAAR,EAAc,KAAK,OAAUM,EAAO,OAAO3B,CAAK,MAAhD,gBAAA6B,EAAmD;AAAA,EAAA,GAC5E,CAAC3B,GAAYC,GAAYiB,GAAgBC,GAAeF,GAAqBnB,CAAK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A,YACP,aAAaS,IAAa,KAAKvB;AAAA,YAC/B,UAAAW;AAAA,YACA,UAAU,CAACR;AAAA,YACX,OAAOoB,KAAc;AAAA,YACrB,SAASpB,IAAasC,IAAc;AAAA,YACpC,UAAUtC,IAAamC,IAAmB;AAAA,YAC1C,gBAAgBrB;AAAA,UAAA;AAAA,QAClB;AAAA,QAEF,gBAAgBd,KAAc+B,sBAAec,GAAU,EAAA,SAASN,EAAa,CAAA,IAhCjF3B,MAAU,YAAYA,MAAU,eAC7B,gBAAA8B,EAAAI,GAAA,EAA6B,cAAcf,GAAa,eAAc,OAAO,CAAA,IAE7E,gBAAAW,EAAAK,GAAA,EAAsB,cAAchB,GAAa,eAAc,OAAO,CAAA;AAAA,QA8BrE,cAAAf;AAAA,MAAA;AAAA,IACF;AAAA,IAECjB,EAAQ,SAAS,KACf,gBAAA2C,EAAAM,GAAA,EAAwB,UAAUjB,GACjC,UAAA,gBAAAS,EAACS,GAAA,EAAsB,WAAW5C,GAAU,QAAQQ,GACjD,UAAA;AAAA,MACCK,KAAA,gBAAAwB;AAAA,QAACQ;AAAA,QAAA;AAAA,UACC,gBAAAhC;AAAA,UACA,OAAAL;AAAA,UACA,OAAAf;AAAA,UACA,UAAUuC;AAAA,QAAA;AAAA,MACZ;AAAA,MAGDlB,KACCA,EAAc,IAAI,CAChBM,MAAA,gBAAAiB;AAAA,QAACS;AAAA,QAAA;AAAA,UAEC,QAAA1B;AAAA,UACA,UAAUA,EAAO,OAAO3B;AAAA,UACxB,UAAUuC;AAAA,UACV,OAAAxB;AAAA,QAAA;AAAA,QAJKY,EAAO;AAAA,MAAA,CAMf;AAAA,IAAA,EAAA,CACL,EACF,CAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
|
package/dist/index.d.ts
CHANGED
@@ -2,10 +2,13 @@ import type { ButtonHTMLAttributes } from 'react';
|
|
2
2
|
import type { Channel } from '@cuemath/cue-message-broker';
|
3
3
|
import { ChannelStatus } from '@cuemath/cue-message-broker';
|
4
4
|
import { ComponentType } from 'react';
|
5
|
+
import type { Config } from '@lottiefiles/dotlottie-web';
|
5
6
|
import { Context } from 'react';
|
6
7
|
import type { DefaultTheme } from 'styled-components';
|
7
8
|
import { DetailedHTMLProps } from 'react';
|
8
9
|
import type { Dispatch } from 'react';
|
10
|
+
import type { EventListener as EventListener_2 } from '@lottiefiles/dotlottie-web';
|
11
|
+
import type { EventType } from '@lottiefiles/dotlottie-web';
|
9
12
|
import { FC } from 'react';
|
10
13
|
import type { FormEvent } from 'react';
|
11
14
|
import { ForwardRefExoticComponent } from 'react';
|
@@ -74,6 +77,8 @@ export declare const AnimatedArc: React_2.FC<IAnimatedArcProps>;
|
|
74
77
|
|
75
78
|
export declare const AnimatedAvatarMessage: NamedExoticComponent<IAnimatedAvatarMessageProps>;
|
76
79
|
|
80
|
+
declare type AnimationSegment = [number, number];
|
81
|
+
|
77
82
|
export declare const AppLoader: FC<IAppLoaderProps>;
|
78
83
|
|
79
84
|
export declare const ArcButton: NamedExoticComponent<IArcButtonProps & {
|
@@ -363,6 +368,8 @@ export declare const DesmosCalculator: FC<IDesmosCalculatorProps>;
|
|
363
368
|
|
364
369
|
export declare const DigitalMeter: FC<IDigitalMeterProps>;
|
365
370
|
|
371
|
+
export declare const DotLottieAnimation: NamedExoticComponent<ILottieAnimationProps & RefAttributes<ILottieAnimationRef>>;
|
372
|
+
|
366
373
|
export declare const DownIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
367
374
|
|
368
375
|
export declare const DraftIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
@@ -838,6 +845,7 @@ declare interface IBaseSelectInputProps<IDType extends string | number> extends
|
|
838
845
|
controlled?: boolean;
|
839
846
|
size?: TInputSizes;
|
840
847
|
theme?: 'light' | 'dark';
|
848
|
+
inputLabelOverrides?: (section: ISectionOption<ISelectOption<IDType>>, option: ISelectOption<IDType> | undefined) => string;
|
841
849
|
}
|
842
850
|
|
843
851
|
declare interface IBaseWebGameProps {
|
@@ -2216,6 +2224,23 @@ declare interface ILogger {
|
|
2216
2224
|
(eventName: string, data?: Record<string, unknown>): void;
|
2217
2225
|
}
|
2218
2226
|
|
2227
|
+
declare interface ILottieAnimationProps {
|
2228
|
+
src: string;
|
2229
|
+
width?: string | number;
|
2230
|
+
height?: string | number;
|
2231
|
+
settings?: Partial<LottieSettings>;
|
2232
|
+
eventListeners?: {
|
2233
|
+
name: EventType;
|
2234
|
+
callback: EventListener_2<EventType>;
|
2235
|
+
}[];
|
2236
|
+
onRender?: () => void;
|
2237
|
+
onError?: () => void;
|
2238
|
+
}
|
2239
|
+
|
2240
|
+
declare interface ILottieAnimationRef {
|
2241
|
+
playSegments: (segments: AnimationSegment, forceFlag?: boolean) => void;
|
2242
|
+
}
|
2243
|
+
|
2219
2244
|
declare interface ILPARChapterProps extends ILPARSheetCallbacks {
|
2220
2245
|
userType: TUserTypes;
|
2221
2246
|
chapterData: TLPARChapterData;
|
@@ -4508,6 +4533,8 @@ export declare const LOTTIE: {
|
|
4508
4533
|
VIDEO: string;
|
4509
4534
|
};
|
4510
4535
|
|
4536
|
+
declare type LottieSettings = Omit<Config, 'src' | 'canvas'>;
|
4537
|
+
|
4511
4538
|
export declare const LPARChapter: FC<ILPARChapterProps>;
|
4512
4539
|
|
4513
4540
|
export declare const LPARMilestoneChapter: FC<ILPARMilestoneChapter>;
|