@cuemath/leap 3.2.21-tp-beta-0.4 → 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/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-item.js +43 -43
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-item.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-utils.js +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-utils.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 -3
- package/dist/index.js +150 -150
- 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,53 +1,53 @@
|
|
1
|
-
import { jsxs as t, jsx as
|
2
|
-
import { useMemo as C, useCallback as
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
2
|
+
import { useMemo as C, useCallback as d } from "react";
|
3
3
|
import { useUIContext as D } from "../../../../ui/context/context.js";
|
4
|
-
import
|
4
|
+
import i from "../../../../ui/layout/flex-view.js";
|
5
5
|
import S from "../../../../ui/text/text.js";
|
6
6
|
import { RewardAccuracy as _ } from "../sheet-item/rewards-n-actions/reward-n-actions-styled.js";
|
7
7
|
import v from "../sheet-item/sheet-item-icon.js";
|
8
|
-
import { SheetItemContainer as O, VerticalLineWrapper as U, TopVerticalLine as
|
8
|
+
import { SheetItemContainer as O, VerticalLineWrapper as U, TopVerticalLine as B, SheetDetailsWrapper as j } from "../sheet-item/sheet-item-styled.js";
|
9
9
|
import { getUserNodeIdsToUnlockSAT as M, getSATSheetStatementStats as G } from "./sat-sheet-item-utils.js";
|
10
|
-
import {
|
10
|
+
import { getActiveSheet as V } from "./sat-sheet-utils.js";
|
11
11
|
import L from "./student-actions/student-actions.js";
|
12
12
|
import N from "./teacher-actions/teacher-actions.js";
|
13
13
|
const ee = ({
|
14
14
|
blockStatus: n,
|
15
|
-
satMaxScore:
|
15
|
+
satMaxScore: f,
|
16
16
|
satScore: A,
|
17
17
|
...T
|
18
18
|
}) => {
|
19
|
-
const { blockId:
|
20
|
-
user_block_id:
|
19
|
+
const { blockId: u, sheets: c, userType: I, onSATReview: a, onSATUnlock: m, onSATStartOrResume: l } = T, {
|
20
|
+
user_block_id: e,
|
21
21
|
can_review: h,
|
22
22
|
can_start: g,
|
23
23
|
can_resume: x,
|
24
24
|
order: y
|
25
|
-
} = V(
|
25
|
+
} = V(c) || {}, { onEvent: p } = D(), s = C(
|
26
26
|
() => ({
|
27
|
-
user_block_id:
|
28
|
-
block_id:
|
27
|
+
user_block_id: e,
|
28
|
+
block_id: u
|
29
29
|
}),
|
30
|
-
[
|
31
|
-
), w = !!((n === "COMPLETED" || n === "MASTERED") && h &&
|
32
|
-
if (typeof
|
30
|
+
[u, e]
|
31
|
+
), w = !!((n === "COMPLETED" || n === "MASTERED") && h && e), $ = d(() => {
|
32
|
+
if (typeof a != "function")
|
33
33
|
throw new Error("onSATReview must be a function");
|
34
|
-
if (!
|
34
|
+
if (!e)
|
35
35
|
throw new Error("userBlockId must be a string");
|
36
|
-
p("clicked",
|
37
|
-
}, [
|
38
|
-
if (typeof
|
36
|
+
p("clicked", s), a(e);
|
37
|
+
}, [s, a, p, e]), E = d(() => {
|
38
|
+
if (typeof m != "function")
|
39
39
|
throw new Error("onSATUnlock must be a function");
|
40
|
-
const
|
41
|
-
if (
|
40
|
+
const o = M(c);
|
41
|
+
if (o.length === 0)
|
42
42
|
throw new Error("User node IDs are missing");
|
43
|
-
|
44
|
-
}, [
|
45
|
-
if (typeof
|
43
|
+
m(o);
|
44
|
+
}, [m, c]), b = d(() => {
|
45
|
+
if (typeof l != "function")
|
46
46
|
throw new Error("onSATStartOrResume must be a function");
|
47
|
-
if (!
|
48
|
-
throw new Error("
|
49
|
-
|
50
|
-
}, [
|
47
|
+
if (!e)
|
48
|
+
throw new Error("userBlockId must be a string");
|
49
|
+
l(e);
|
50
|
+
}, [l, e]);
|
51
51
|
return /* @__PURE__ */ t(
|
52
52
|
O,
|
53
53
|
{
|
@@ -56,10 +56,10 @@ const ee = ({
|
|
56
56
|
$alignItems: "center",
|
57
57
|
$flexGapX: 1,
|
58
58
|
children: [
|
59
|
-
/* @__PURE__ */ t(
|
60
|
-
/* @__PURE__ */
|
59
|
+
/* @__PURE__ */ t(i, { $width: "70%", $flexGap: 8, $flexDirection: "row", children: [
|
60
|
+
/* @__PURE__ */ r(U, { children: /* @__PURE__ */ r(B, {}) }),
|
61
61
|
/* @__PURE__ */ t(
|
62
|
-
|
62
|
+
j,
|
63
63
|
{
|
64
64
|
$width: "100%",
|
65
65
|
$flexDirection: "row",
|
@@ -67,25 +67,25 @@ const ee = ({
|
|
67
67
|
$flexGap: 8,
|
68
68
|
$marginBottom: 12,
|
69
69
|
children: [
|
70
|
-
/* @__PURE__ */
|
71
|
-
/* @__PURE__ */ t(
|
72
|
-
/* @__PURE__ */
|
73
|
-
/* @__PURE__ */
|
74
|
-
const { statement: k, color: R } = G(
|
75
|
-
return /* @__PURE__ */
|
70
|
+
/* @__PURE__ */ r(v, { chapterPermissionCode: n }),
|
71
|
+
/* @__PURE__ */ t(i, { $justifyContent: "center", $width: "100%", children: [
|
72
|
+
/* @__PURE__ */ r(S, { $renderAs: "body1Medium", children: "Assessment • Mock test" }),
|
73
|
+
/* @__PURE__ */ r(i, { children: c.map((o) => {
|
74
|
+
const { statement: k, color: R } = G(o);
|
75
|
+
return /* @__PURE__ */ r(S, { $renderAs: "body2", $color: R, children: k }, o.node_id);
|
76
76
|
}) })
|
77
77
|
] })
|
78
78
|
]
|
79
79
|
}
|
80
80
|
)
|
81
81
|
] }),
|
82
|
-
/* @__PURE__ */ t(
|
83
|
-
h &&
|
82
|
+
/* @__PURE__ */ t(i, { $flexDirection: "row", $alignItems: "center", $justifyContent: "center", $flexGap: 8, children: [
|
83
|
+
h && f && /* @__PURE__ */ r(i, { $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ t(_, { $renderAs: "eyebrow2", $align: "center", children: [
|
84
84
|
A,
|
85
85
|
"/",
|
86
|
-
|
86
|
+
f
|
87
87
|
] }) }),
|
88
|
-
I === "STUDENT" ? /* @__PURE__ */
|
88
|
+
I === "STUDENT" ? /* @__PURE__ */ r(
|
89
89
|
L,
|
90
90
|
{
|
91
91
|
handleOnReview: $,
|
@@ -94,17 +94,17 @@ const ee = ({
|
|
94
94
|
canResume: !!x,
|
95
95
|
canStart: !!g,
|
96
96
|
handleOnStartOrResume: b,
|
97
|
-
analyticsProps:
|
97
|
+
analyticsProps: s,
|
98
98
|
questionOrder: y
|
99
99
|
}
|
100
|
-
) : /* @__PURE__ */
|
100
|
+
) : /* @__PURE__ */ r(
|
101
101
|
N,
|
102
102
|
{
|
103
103
|
handleOnReview: $,
|
104
104
|
handleOnUnlock: E,
|
105
105
|
isMenuVisible: w,
|
106
106
|
blockStatus: n,
|
107
|
-
analyticsProps:
|
107
|
+
analyticsProps: s
|
108
108
|
}
|
109
109
|
)
|
110
110
|
] })
|
package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-item.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sat-sheet-item.js","sources":["../../../../../../src/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-item.tsx"],"sourcesContent":["import type { ISATSheetItemProps } from './sat-sheet-item-types';\n\nimport { useCallback, type FC, useMemo } from 'react';\n\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { RewardAccuracy } from '../sheet-item/rewards-n-actions/reward-n-actions-styled';\nimport SheetItemIcon from '../sheet-item/sheet-item-icon';\nimport {\n SheetDetailsWrapper,\n SheetItemContainer,\n TopVerticalLine,\n VerticalLineWrapper,\n} from '../sheet-item/sheet-item-styled';\nimport { getSATSheetStatementStats, getUserNodeIdsToUnlockSAT } from './sat-sheet-item-utils';\nimport {
|
1
|
+
{"version":3,"file":"sat-sheet-item.js","sources":["../../../../../../src/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-item.tsx"],"sourcesContent":["import type { ISATSheetItemProps } from './sat-sheet-item-types';\n\nimport { useCallback, type FC, useMemo } from 'react';\n\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { RewardAccuracy } from '../sheet-item/rewards-n-actions/reward-n-actions-styled';\nimport SheetItemIcon from '../sheet-item/sheet-item-icon';\nimport {\n SheetDetailsWrapper,\n SheetItemContainer,\n TopVerticalLine,\n VerticalLineWrapper,\n} from '../sheet-item/sheet-item-styled';\nimport { getSATSheetStatementStats, getUserNodeIdsToUnlockSAT } from './sat-sheet-item-utils';\nimport { getActiveSheet } from './sat-sheet-utils';\nimport StudentActions from './student-actions/student-actions';\nimport TeacherActions from './teacher-actions/teacher-actions';\n\nconst SATSheetItem: FC<ISATSheetItemProps> = ({\n blockStatus,\n satMaxScore,\n satScore,\n ...restSATSheetItemProps\n}) => {\n const { blockId, sheets, userType, onSATReview, onSATUnlock, onSATStartOrResume } =\n restSATSheetItemProps;\n const {\n user_block_id: userBlockId,\n can_review: canReview,\n can_start: canStart,\n can_resume: canResume,\n order: questionOrder,\n } = getActiveSheet(sheets) || {};\n\n const { onEvent: trackEvent } = useUIContext();\n const analyticsProps = useMemo(\n () => ({\n user_block_id: userBlockId,\n block_id: blockId,\n }),\n [blockId, userBlockId],\n );\n\n const isMenuVisible = Boolean(\n (blockStatus === 'COMPLETED' || blockStatus === 'MASTERED') && canReview && userBlockId,\n );\n\n const handleOnReview = useCallback(() => {\n if (typeof onSATReview !== 'function') {\n throw new Error('onSATReview must be a function');\n }\n\n if (!userBlockId) {\n throw new Error('userBlockId must be a string');\n }\n\n trackEvent('clicked', analyticsProps);\n\n onSATReview(userBlockId);\n }, [analyticsProps, onSATReview, trackEvent, userBlockId]);\n\n const handleOnUnlock = useCallback(() => {\n if (typeof onSATUnlock !== 'function') {\n throw new Error('onSATUnlock must be a function');\n }\n\n const userNodeIds = getUserNodeIdsToUnlockSAT(sheets);\n\n if (userNodeIds.length === 0) {\n throw new Error('User node IDs are missing');\n }\n\n onSATUnlock(userNodeIds);\n }, [onSATUnlock, sheets]);\n\n const handleOnStartOrResume = useCallback(() => {\n if (typeof onSATStartOrResume !== 'function') {\n throw new Error('onSATStartOrResume must be a function');\n }\n\n if (!userBlockId) {\n throw new Error('userBlockId must be a string');\n }\n\n onSATStartOrResume(userBlockId);\n }, [onSATStartOrResume, userBlockId]);\n\n return (\n <SheetItemContainer\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $flexGapX={1}\n >\n <FlexView $width=\"70%\" $flexGap={8} $flexDirection=\"row\">\n <VerticalLineWrapper>\n <TopVerticalLine />\n </VerticalLineWrapper>\n\n <SheetDetailsWrapper\n $width=\"100%\"\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGap={8}\n $marginBottom={12}\n >\n <SheetItemIcon chapterPermissionCode={blockStatus} />\n\n <FlexView $justifyContent=\"center\" $width=\"100%\">\n <Text $renderAs=\"body1Medium\">Assessment • Mock test</Text>\n\n <FlexView>\n {sheets.map(sheet => {\n const { statement, color } = getSATSheetStatementStats(sheet);\n\n return (\n <Text $renderAs=\"body2\" key={sheet.node_id} $color={color}>\n {statement}\n </Text>\n );\n })}\n </FlexView>\n </FlexView>\n </SheetDetailsWrapper>\n </FlexView>\n\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"center\" $flexGap={8}>\n {canReview && satMaxScore && (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\">\n <RewardAccuracy $renderAs=\"eyebrow2\" $align=\"center\">\n {satScore}/{satMaxScore}\n </RewardAccuracy>\n </FlexView>\n )}\n\n {userType === 'STUDENT' ? (\n <StudentActions\n handleOnReview={handleOnReview}\n isMenuVisible={isMenuVisible}\n blockStatus={blockStatus}\n canResume={Boolean(canResume)}\n canStart={Boolean(canStart)}\n handleOnStartOrResume={handleOnStartOrResume}\n analyticsProps={analyticsProps}\n questionOrder={questionOrder}\n />\n ) : (\n <TeacherActions\n handleOnReview={handleOnReview}\n handleOnUnlock={handleOnUnlock}\n isMenuVisible={isMenuVisible}\n blockStatus={blockStatus}\n analyticsProps={analyticsProps}\n />\n )}\n </FlexView>\n </SheetItemContainer>\n );\n};\n\nexport default SATSheetItem;\n"],"names":["SATSheetItem","blockStatus","satMaxScore","satScore","restSATSheetItemProps","blockId","sheets","userType","onSATReview","onSATUnlock","onSATStartOrResume","userBlockId","canReview","canStart","canResume","questionOrder","getActiveSheet","trackEvent","useUIContext","analyticsProps","useMemo","isMenuVisible","handleOnReview","useCallback","handleOnUnlock","userNodeIds","getUserNodeIdsToUnlockSAT","handleOnStartOrResume","jsxs","SheetItemContainer","FlexView","jsx","VerticalLineWrapper","TopVerticalLine","SheetDetailsWrapper","SheetItemIcon","Text","sheet","statement","color","getSATSheetStatementStats","RewardAccuracy","StudentActions","TeacherActions"],"mappings":";;;;;;;;;;;;AAoBA,MAAMA,KAAuC,CAAC;AAAA,EAC5C,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,EAAE,SAAAC,GAAS,QAAAC,GAAQ,UAAAC,GAAU,aAAAC,GAAa,aAAAC,GAAa,oBAAAC,EAC3D,IAAAN,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cACA,eAAAD;AAAA,cACA,aAAApB;AAAA,cACA,WAAW,EAAQa;AAAA,cACnB,UAAU,EAAQD;AAAA,cAClB,uBAAAc;AAAA,cACA,gBAAAR;AAAA,cACA,eAAAJ;AAAA,YAAA;AAAA,UAAA,IAGF,gBAAAgB;AAAA,YAACY;AAAA,YAAA;AAAA,cACC,gBAAArB;AAAA,cACA,gBAAAE;AAAA,cACA,eAAAH;AAAA,cACA,aAAApB;AAAA,cACA,gBAAAkB;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-utils.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sat-sheet-utils.js","sources":["../../../../../../src/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-utils.ts"],"sourcesContent":["import type { TLPARSheetData } from '../sheet-item/sheet-item-type';\n\nconst
|
1
|
+
{"version":3,"file":"sat-sheet-utils.js","sources":["../../../../../../src/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-utils.ts"],"sourcesContent":["import type { TLPARSheetData } from '../sheet-item/sheet-item-type';\n\nconst getActiveSheet = (sheets: TLPARSheetData[]) => {\n const activeSheet = sheets.find(sheet => sheet.can_start || sheet.can_resume) ?? sheets[0];\n\n return activeSheet;\n};\n\nexport { getActiveSheet };\n"],"names":["getActiveSheet","sheets","sheet"],"mappings":"AAEM,MAAAA,IAAiB,CAACC,MACFA,EAAO,KAAK,CAASC,MAAAA,EAAM,aAAaA,EAAM,UAAU,KAAKD,EAAO,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,IACT,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,EACE,IAAAR,GAEES,IAAYC,EAA0B,IAAI,GAC1CC,IAAoBD,EAA+B,IAAI;AAE7D,SAAAE;AAAA,IACEX;AAAA,IACA,OAAO;AAAA,MACL,cAAc,CAACY,MAA+B;;AAC5C,SAAAC,IAAAH,EAAkB,YAAlB,QAAAG,EAA2B,WAAWD,EAAS,CAAC,GAAGA,EAAS,CAAC,KAC7DE,IAAAJ,EAAkB,YAAlB,QAAAI,EAA2B;AAAA,MAC7B;AAAA,MACA,MAAM,MAAM;;AACV,SAAAD,IAAAH,EAAkB,YAAlB,QAAAG,EAA2B;AAAA,MAC7B;AAAA,MACA,OAAO,MAAM;;AACX,SAAAA,IAAAH,EAAkB,YAAlB,QAAAG,EAA2B;AAAA,MAC7B;AAAA,IAAA;AAAA,IAEF,CAAC;AAAA,EAAA,GAGHE,EAAU,MAAM;AACV,QAACP,EAAU;AAEX,UAAA;AACgB,QAAAE,EAAA,UAAU,IAAIM,EAAg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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,UAAW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