catchup-library-web 2.6.3 → 2.6.5
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.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +39 -1
- package/dist/index.mjs +39 -1
- package/package.json +4 -2
- package/src/components/groups/InputGroup.tsx +42 -0
- package/src/properties/GroupProperties.ts +3 -1
package/dist/index.d.mts
CHANGED
|
@@ -282,7 +282,7 @@ interface IInputGroupProps {
|
|
|
282
282
|
title?: string;
|
|
283
283
|
defaultValue?: string;
|
|
284
284
|
placeholder?: string;
|
|
285
|
-
value:
|
|
285
|
+
value: any;
|
|
286
286
|
minValue?: string;
|
|
287
287
|
maxValue?: string;
|
|
288
288
|
onFocus?: (e: any) => void;
|
|
@@ -298,6 +298,8 @@ interface IInputGroupProps {
|
|
|
298
298
|
disabled?: boolean;
|
|
299
299
|
limit?: number;
|
|
300
300
|
useMath?: boolean;
|
|
301
|
+
checked?: boolean;
|
|
302
|
+
description?: string;
|
|
301
303
|
}
|
|
302
304
|
interface ILeftTextRightInputGroupProps {
|
|
303
305
|
type: string;
|
|
@@ -349,7 +351,7 @@ declare global {
|
|
|
349
351
|
}
|
|
350
352
|
}
|
|
351
353
|
}
|
|
352
|
-
declare const InputGroup: ({ type, title, defaultValue, placeholder, value, minValue, maxValue, onFocus, onChange, onClick, onKeyDown, optionList, errorText, multiple, accept, theme, useMinHeight, disabled, limit, useMath, }: IInputGroupProps) => react_jsx_runtime.JSX.Element;
|
|
354
|
+
declare const InputGroup: ({ type, title, defaultValue, placeholder, value, minValue, maxValue, onFocus, onChange, onClick, onKeyDown, optionList, errorText, multiple, accept, theme, useMinHeight, disabled, limit, useMath, checked, description, }: IInputGroupProps) => react_jsx_runtime.JSX.Element;
|
|
353
355
|
|
|
354
356
|
declare const LeftTextRightInputGroup: ({ type, title, value, optionList, onChange, disabled, errorText, }: ILeftTextRightInputGroupProps) => react_jsx_runtime.JSX.Element;
|
|
355
357
|
|
package/dist/index.d.ts
CHANGED
|
@@ -282,7 +282,7 @@ interface IInputGroupProps {
|
|
|
282
282
|
title?: string;
|
|
283
283
|
defaultValue?: string;
|
|
284
284
|
placeholder?: string;
|
|
285
|
-
value:
|
|
285
|
+
value: any;
|
|
286
286
|
minValue?: string;
|
|
287
287
|
maxValue?: string;
|
|
288
288
|
onFocus?: (e: any) => void;
|
|
@@ -298,6 +298,8 @@ interface IInputGroupProps {
|
|
|
298
298
|
disabled?: boolean;
|
|
299
299
|
limit?: number;
|
|
300
300
|
useMath?: boolean;
|
|
301
|
+
checked?: boolean;
|
|
302
|
+
description?: string;
|
|
301
303
|
}
|
|
302
304
|
interface ILeftTextRightInputGroupProps {
|
|
303
305
|
type: string;
|
|
@@ -349,7 +351,7 @@ declare global {
|
|
|
349
351
|
}
|
|
350
352
|
}
|
|
351
353
|
}
|
|
352
|
-
declare const InputGroup: ({ type, title, defaultValue, placeholder, value, minValue, maxValue, onFocus, onChange, onClick, onKeyDown, optionList, errorText, multiple, accept, theme, useMinHeight, disabled, limit, useMath, }: IInputGroupProps) => react_jsx_runtime.JSX.Element;
|
|
354
|
+
declare const InputGroup: ({ type, title, defaultValue, placeholder, value, minValue, maxValue, onFocus, onChange, onClick, onKeyDown, optionList, errorText, multiple, accept, theme, useMinHeight, disabled, limit, useMath, checked, description, }: IInputGroupProps) => react_jsx_runtime.JSX.Element;
|
|
353
355
|
|
|
354
356
|
declare const LeftTextRightInputGroup: ({ type, title, value, optionList, onChange, disabled, errorText, }: ILeftTextRightInputGroupProps) => react_jsx_runtime.JSX.Element;
|
|
355
357
|
|
package/dist/index.js
CHANGED
|
@@ -3844,6 +3844,7 @@ var import_react_katex2 = require("react-katex");
|
|
|
3844
3844
|
|
|
3845
3845
|
// src/components/groups/InputGroup.tsx
|
|
3846
3846
|
var import_react_select = __toESM(require("react-select"));
|
|
3847
|
+
var import_react_switch = __toESM(require("react-switch"));
|
|
3847
3848
|
var import_react12 = require("react");
|
|
3848
3849
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3849
3850
|
var InputGroup = ({
|
|
@@ -3866,7 +3867,9 @@ var InputGroup = ({
|
|
|
3866
3867
|
useMinHeight,
|
|
3867
3868
|
disabled,
|
|
3868
3869
|
limit,
|
|
3869
|
-
useMath
|
|
3870
|
+
useMath,
|
|
3871
|
+
checked,
|
|
3872
|
+
description
|
|
3870
3873
|
}) => {
|
|
3871
3874
|
const textAreaRef = (0, import_react12.useRef)(null);
|
|
3872
3875
|
const latexTextAreaRef = (0, import_react12.useRef)(null);
|
|
@@ -4266,6 +4269,39 @@ var InputGroup = ({
|
|
|
4266
4269
|
)
|
|
4267
4270
|
] });
|
|
4268
4271
|
};
|
|
4272
|
+
const SwitchInputGroup = () => {
|
|
4273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col my-1", children: [
|
|
4274
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-row items-center", children: [
|
|
4275
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4276
|
+
import_react_switch.default,
|
|
4277
|
+
{
|
|
4278
|
+
onChange: () => {
|
|
4279
|
+
onClick && onClick(!checked);
|
|
4280
|
+
},
|
|
4281
|
+
checkedIcon: false,
|
|
4282
|
+
offColor: "#e2e8f0",
|
|
4283
|
+
onColor: "#57C2D3",
|
|
4284
|
+
offHandleColor: "#57C2D3",
|
|
4285
|
+
onHandleColor: "#e2e8f0",
|
|
4286
|
+
uncheckedIcon: false,
|
|
4287
|
+
checked: !!checked,
|
|
4288
|
+
height: 20,
|
|
4289
|
+
width: 40,
|
|
4290
|
+
handleDiameter: 14,
|
|
4291
|
+
disabled
|
|
4292
|
+
}
|
|
4293
|
+
),
|
|
4294
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4295
|
+
"p",
|
|
4296
|
+
{
|
|
4297
|
+
className: `${checked ? "font-bold" : "text-catchup-gray"} px-2 transition-all duration-300`,
|
|
4298
|
+
children: title
|
|
4299
|
+
}
|
|
4300
|
+
)
|
|
4301
|
+
] }),
|
|
4302
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-md text-catchup-gray-300 mt-1 ml-12", children: description }) : null
|
|
4303
|
+
] });
|
|
4304
|
+
};
|
|
4269
4305
|
const RenderMainContent = () => {
|
|
4270
4306
|
if (type === "text" || type === "number") {
|
|
4271
4307
|
return TextInputGroup();
|
|
@@ -4281,6 +4317,8 @@ var InputGroup = ({
|
|
|
4281
4317
|
return FileInputGroup();
|
|
4282
4318
|
} else if (type === "checkbox") {
|
|
4283
4319
|
return CheckboxInputGroup();
|
|
4320
|
+
} else if (type === "switch") {
|
|
4321
|
+
return SwitchInputGroup();
|
|
4284
4322
|
}
|
|
4285
4323
|
};
|
|
4286
4324
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
package/dist/index.mjs
CHANGED
|
@@ -3610,6 +3610,7 @@ import { InlineMath as InlineMath2 } from "react-katex";
|
|
|
3610
3610
|
|
|
3611
3611
|
// src/components/groups/InputGroup.tsx
|
|
3612
3612
|
import Select from "react-select";
|
|
3613
|
+
import Switch from "react-switch";
|
|
3613
3614
|
import { useEffect as useEffect3, useRef, useState as useState12, useCallback } from "react";
|
|
3614
3615
|
import { Fragment, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3615
3616
|
var InputGroup = ({
|
|
@@ -3632,7 +3633,9 @@ var InputGroup = ({
|
|
|
3632
3633
|
useMinHeight,
|
|
3633
3634
|
disabled,
|
|
3634
3635
|
limit,
|
|
3635
|
-
useMath
|
|
3636
|
+
useMath,
|
|
3637
|
+
checked,
|
|
3638
|
+
description
|
|
3636
3639
|
}) => {
|
|
3637
3640
|
const textAreaRef = useRef(null);
|
|
3638
3641
|
const latexTextAreaRef = useRef(null);
|
|
@@ -4032,6 +4035,39 @@ var InputGroup = ({
|
|
|
4032
4035
|
)
|
|
4033
4036
|
] });
|
|
4034
4037
|
};
|
|
4038
|
+
const SwitchInputGroup = () => {
|
|
4039
|
+
return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col my-1", children: [
|
|
4040
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex flex-row items-center", children: [
|
|
4041
|
+
/* @__PURE__ */ jsx23(
|
|
4042
|
+
Switch,
|
|
4043
|
+
{
|
|
4044
|
+
onChange: () => {
|
|
4045
|
+
onClick && onClick(!checked);
|
|
4046
|
+
},
|
|
4047
|
+
checkedIcon: false,
|
|
4048
|
+
offColor: "#e2e8f0",
|
|
4049
|
+
onColor: "#57C2D3",
|
|
4050
|
+
offHandleColor: "#57C2D3",
|
|
4051
|
+
onHandleColor: "#e2e8f0",
|
|
4052
|
+
uncheckedIcon: false,
|
|
4053
|
+
checked: !!checked,
|
|
4054
|
+
height: 20,
|
|
4055
|
+
width: 40,
|
|
4056
|
+
handleDiameter: 14,
|
|
4057
|
+
disabled
|
|
4058
|
+
}
|
|
4059
|
+
),
|
|
4060
|
+
/* @__PURE__ */ jsx23(
|
|
4061
|
+
"p",
|
|
4062
|
+
{
|
|
4063
|
+
className: `${checked ? "font-bold" : "text-catchup-gray"} px-2 transition-all duration-300`,
|
|
4064
|
+
children: title
|
|
4065
|
+
}
|
|
4066
|
+
)
|
|
4067
|
+
] }),
|
|
4068
|
+
description ? /* @__PURE__ */ jsx23("p", { className: "text-md text-catchup-gray-300 mt-1 ml-12", children: description }) : null
|
|
4069
|
+
] });
|
|
4070
|
+
};
|
|
4035
4071
|
const RenderMainContent = () => {
|
|
4036
4072
|
if (type === "text" || type === "number") {
|
|
4037
4073
|
return TextInputGroup();
|
|
@@ -4047,6 +4083,8 @@ var InputGroup = ({
|
|
|
4047
4083
|
return FileInputGroup();
|
|
4048
4084
|
} else if (type === "checkbox") {
|
|
4049
4085
|
return CheckboxInputGroup();
|
|
4086
|
+
} else if (type === "switch") {
|
|
4087
|
+
return SwitchInputGroup();
|
|
4050
4088
|
}
|
|
4051
4089
|
};
|
|
4052
4090
|
return /* @__PURE__ */ jsxs14(Fragment, { children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "catchup-library-web",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"react-loader-spinner": ">=5.0.0",
|
|
25
25
|
"react-modal": "^3.16.0",
|
|
26
26
|
"react-pdf": ">=7.0.0",
|
|
27
|
-
"react-select": "^5.8.0"
|
|
27
|
+
"react-select": "^5.8.0",
|
|
28
|
+
"react-switch": "^7.0.0"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@types/react": "^18.3.0",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"react-modal": "^3.16.3",
|
|
41
42
|
"react-pdf": "^10.0.1",
|
|
42
43
|
"react-select": "^5.10.0",
|
|
44
|
+
"react-switch": "^7.0.0",
|
|
43
45
|
"tsup": "^8.3.6",
|
|
44
46
|
"typescript": "^5.9.2"
|
|
45
47
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Select from "react-select";
|
|
2
|
+
import Switch from "react-switch";
|
|
2
3
|
import i18n from "../../language/i18n";
|
|
3
4
|
import { useEffect, useRef, useState, useCallback } from "react";
|
|
4
5
|
import { IInputGroupProps } from "../../properties/GroupProperties";
|
|
@@ -65,6 +66,8 @@ const InputGroup = ({
|
|
|
65
66
|
disabled,
|
|
66
67
|
limit,
|
|
67
68
|
useMath,
|
|
69
|
+
checked,
|
|
70
|
+
description,
|
|
68
71
|
}: IInputGroupProps) => {
|
|
69
72
|
const textAreaRef = useRef<HTMLTextAreaElement>(null);
|
|
70
73
|
const latexTextAreaRef = useRef<HTMLTextAreaElement>(null);
|
|
@@ -534,6 +537,43 @@ const InputGroup = ({
|
|
|
534
537
|
);
|
|
535
538
|
};
|
|
536
539
|
|
|
540
|
+
const SwitchInputGroup = () => {
|
|
541
|
+
return (
|
|
542
|
+
<div className="flex flex-col my-1">
|
|
543
|
+
<div className="flex flex-row items-center">
|
|
544
|
+
<Switch
|
|
545
|
+
onChange={() => {
|
|
546
|
+
onClick && onClick(!checked);
|
|
547
|
+
}}
|
|
548
|
+
checkedIcon={false}
|
|
549
|
+
offColor={"#e2e8f0"}
|
|
550
|
+
onColor={"#57C2D3"}
|
|
551
|
+
offHandleColor={"#57C2D3"}
|
|
552
|
+
onHandleColor={"#e2e8f0"}
|
|
553
|
+
uncheckedIcon={false}
|
|
554
|
+
checked={!!checked}
|
|
555
|
+
height={20}
|
|
556
|
+
width={40}
|
|
557
|
+
handleDiameter={14}
|
|
558
|
+
disabled={disabled}
|
|
559
|
+
/>
|
|
560
|
+
<p
|
|
561
|
+
className={`${
|
|
562
|
+
checked ? "font-bold" : "text-catchup-gray"
|
|
563
|
+
} px-2 transition-all duration-300`}
|
|
564
|
+
>
|
|
565
|
+
{title}
|
|
566
|
+
</p>
|
|
567
|
+
</div>
|
|
568
|
+
{description ? (
|
|
569
|
+
<p className="text-md text-catchup-gray-300 mt-1 ml-12">
|
|
570
|
+
{description}
|
|
571
|
+
</p>
|
|
572
|
+
) : null}
|
|
573
|
+
</div>
|
|
574
|
+
);
|
|
575
|
+
};
|
|
576
|
+
|
|
537
577
|
const RenderMainContent = () => {
|
|
538
578
|
if (type === "text" || type === "number") {
|
|
539
579
|
return TextInputGroup();
|
|
@@ -549,6 +589,8 @@ const InputGroup = ({
|
|
|
549
589
|
return FileInputGroup();
|
|
550
590
|
} else if (type === "checkbox") {
|
|
551
591
|
return CheckboxInputGroup();
|
|
592
|
+
} else if (type === "switch") {
|
|
593
|
+
return SwitchInputGroup();
|
|
552
594
|
}
|
|
553
595
|
};
|
|
554
596
|
|
|
@@ -3,7 +3,7 @@ export interface IInputGroupProps {
|
|
|
3
3
|
title?: string;
|
|
4
4
|
defaultValue?: string;
|
|
5
5
|
placeholder?: string;
|
|
6
|
-
value:
|
|
6
|
+
value: any;
|
|
7
7
|
minValue?: string;
|
|
8
8
|
maxValue?: string;
|
|
9
9
|
onFocus?: (e: any) => void;
|
|
@@ -19,6 +19,8 @@ export interface IInputGroupProps {
|
|
|
19
19
|
disabled?: boolean;
|
|
20
20
|
limit?: number;
|
|
21
21
|
useMath?: boolean;
|
|
22
|
+
checked?: boolean;
|
|
23
|
+
description?: string;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export interface ILeftTextRightInputGroupProps {
|