@ramesesinc/app-forms 0.1.0

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.
Files changed (46) hide show
  1. package/dist/components/AppContactForm.d.ts +2 -0
  2. package/dist/components/AppContactForm.js +13 -0
  3. package/dist/components/AppContactForm.tsx +80 -0
  4. package/dist/components/AppInitForm.d.ts +0 -0
  5. package/dist/components/AppInitForm.js +74 -0
  6. package/dist/components/AppInitForm.tsx +80 -0
  7. package/dist/components/AppOtpForm.d.ts +2 -0
  8. package/dist/components/AppOtpForm.js +25 -0
  9. package/dist/components/AppOtpForm.tsx +71 -0
  10. package/dist/components/AppSaveForm.d.ts +2 -0
  11. package/dist/components/AppSaveForm.js +8 -0
  12. package/dist/components/AppSaveForm.tsx +29 -0
  13. package/dist/components/ApplicantInfo.d.ts +2 -0
  14. package/dist/components/ApplicantInfo.js +29 -0
  15. package/dist/components/ApplicantInfo.tsx +125 -0
  16. package/dist/components/HtmlTemplate.d.ts +8 -0
  17. package/dist/components/HtmlTemplate.js +28 -0
  18. package/dist/components/HtmlTemplate.tsx +46 -0
  19. package/dist/components/NewPermitAppCodeForm.d.ts +2 -0
  20. package/dist/components/NewPermitAppCodeForm.js +6 -0
  21. package/dist/components/NewPermitAppCodeForm.tsx +22 -0
  22. package/dist/components/NewPermitAppForm.d.ts +2 -0
  23. package/dist/components/NewPermitAppForm.js +8 -0
  24. package/dist/components/NewPermitAppForm.tsx +26 -0
  25. package/dist/components/NewPermitAppTermForm.d.ts +2 -0
  26. package/dist/components/NewPermitAppTermForm.js +8 -0
  27. package/dist/components/NewPermitAppTermForm.tsx +33 -0
  28. package/dist/components/NewPermitAppTypeForm.d.ts +2 -0
  29. package/dist/components/NewPermitAppTypeForm.js +8 -0
  30. package/dist/components/NewPermitAppTypeForm.tsx +28 -0
  31. package/dist/components/PrivacyStatementForm.d.ts +0 -0
  32. package/dist/components/PrivacyStatementForm.js +49 -0
  33. package/dist/components/PrivacyStatementForm.tsx +55 -0
  34. package/dist/components/common/InputValidator.d.ts +13 -0
  35. package/dist/components/common/InputValidator.js +118 -0
  36. package/dist/components/common/InputValidator.tsx +252 -0
  37. package/dist/components/index.d.ts +10 -0
  38. package/dist/components/index.js +12 -0
  39. package/dist/components/index.ts +14 -0
  40. package/dist/components/test.d.ts +2 -0
  41. package/dist/components/test.js +5 -0
  42. package/dist/components/test.tsx +5 -0
  43. package/dist/index.d.ts +1 -0
  44. package/dist/index.js +1 -0
  45. package/dist/styles/index.css +47 -0
  46. package/package.json +51 -0
@@ -0,0 +1,2 @@
1
+ declare const AppContactForm: (props: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default AppContactForm;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from "@ramesesinc/client";
3
+ import InputValidator from "./common/InputValidator";
4
+ const AppContactForm = (props) => {
5
+ var _a;
6
+ const { wizard } = (_a = props.params) !== null && _a !== void 0 ? _a : {};
7
+ return (
8
+ // <div className="bg-gray-50 p-4">
9
+ _jsxs("div", { className: "mx-auto bg-white px-4", children: [_jsx("h1", { className: "text-lg font-bold text-green-600 mb-6", children: "Email Verification" }), _jsx("p", { className: "text-gray-700 mb-8 leading-relaxed", children: "A validation key will be sent to your email. Please make sure your email is valid and you have access to it." }), _jsxs("div", { className: "space-y-6 flex flex-col gap-2 my-4", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-gray-600 text-sm mb-2", children: "Full Name *" }), _jsx(InputValidator, { datatype: "string", value: wizard.getValue("fullname"), onChange: (val) => wizard.setValue("fullname", val), className: "w-full px-2 border-b-2 border-gray-300 transition-colors text-gray-600" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-gray-600 text-sm mb-2", children: "Address *" }), _jsx(InputValidator, { datatype: "string", value: wizard.getValue("address"), onChange: (val) => wizard.setValue("address", val), className: "w-full px-2 border-b-2 border-gray-300 transition-colors text-gray-600" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-gray-600 text-sm mb-2", children: "Email Address" }), _jsx(InputValidator, { datatype: "email", value: wizard.getValue("emailaddress"), onChange: (val) => wizard.setValue("emailaddress", val), className: "w-full px-2 border-b-2 border-gray-300 transition-colors text-gray-600" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-gray-600 text-sm mb-2", children: "Mobile No." }), _jsx(InputValidator, { datatype: "mobilenumber", value: wizard.getValue("mobileno"), onChange: (val) => wizard.setValue("mobileno", val), className: "w-full px-2 border-b-2 border-gray-300 transition-colors text-gray-600" })] })] }), _jsxs("div", { className: "flex flex-row justify-between gap-4 py-4 border-t border-slate-200", children: [_jsx("div", { className: "w-[120px]", children: wizard.hasPrev() && (_jsx(Button, { variant: "secondary", size: "lg", type: "button", onClick: wizard.prev, children: "Prev" })) }), _jsx("div", { className: "w-[120px] flex justify-end", children: wizard.hasNext() && (_jsx(Button, { variant: "primary", size: "lg", type: "button", onClick: wizard.next, children: "Next" })) })] })] })
10
+ // </div>
11
+ );
12
+ };
13
+ export default AppContactForm;
@@ -0,0 +1,80 @@
1
+ import { Button } from "@ramesesinc/client";
2
+ import InputValidator from "./common/InputValidator";
3
+
4
+ const AppContactForm = (props: any) => {
5
+ const { wizard } = props.params ?? {};
6
+
7
+ return (
8
+ // <div className="bg-gray-50 p-4">
9
+ <div className="mx-auto bg-white px-4">
10
+ <h1 className="text-lg font-bold text-green-600 mb-6">Email Verification</h1>
11
+
12
+ <p className="text-gray-700 mb-8 leading-relaxed">
13
+ A validation key will be sent to your email. Please make sure your email is valid and you have access to it.
14
+ </p>
15
+
16
+ <div className="space-y-6 flex flex-col gap-2 my-4">
17
+ <div>
18
+ <label className="block text-gray-600 text-sm mb-2">Full Name *</label>
19
+ <InputValidator
20
+ datatype="string"
21
+ value={wizard.getValue("fullname")}
22
+ onChange={(val) => wizard.setValue("fullname", val)}
23
+ className="w-full px-2 border-b-2 border-gray-300 transition-colors text-gray-600"
24
+ />
25
+ </div>
26
+
27
+ <div>
28
+ <label className="block text-gray-600 text-sm mb-2">Address *</label>
29
+ <InputValidator
30
+ datatype="string"
31
+ value={wizard.getValue("address")}
32
+ onChange={(val) => wizard.setValue("address", val)}
33
+ className="w-full px-2 border-b-2 border-gray-300 transition-colors text-gray-600"
34
+ />
35
+ </div>
36
+
37
+ <div>
38
+ <label className="block text-gray-600 text-sm mb-2">Email Address</label>
39
+ <InputValidator
40
+ datatype="email"
41
+ value={wizard.getValue("emailaddress")}
42
+ onChange={(val) => wizard.setValue("emailaddress", val)}
43
+ className="w-full px-2 border-b-2 border-gray-300 transition-colors text-gray-600"
44
+ />
45
+ </div>
46
+
47
+ <div>
48
+ <label className="block text-gray-600 text-sm mb-2">Mobile No.</label>
49
+ <InputValidator
50
+ datatype="mobilenumber"
51
+ value={wizard.getValue("mobileno")}
52
+ onChange={(val) => wizard.setValue("mobileno", val)}
53
+ className="w-full px-2 border-b-2 border-gray-300 transition-colors text-gray-600"
54
+ />
55
+ </div>
56
+ </div>
57
+
58
+ <div className="flex flex-row justify-between gap-4 py-4 border-t border-slate-200">
59
+ <div className="w-[120px]">
60
+ {wizard.hasPrev() && (
61
+ <Button variant="secondary" size="lg" type="button" onClick={wizard.prev}>
62
+ Prev
63
+ </Button>
64
+ )}
65
+ </div>
66
+
67
+ <div className="w-[120px] flex justify-end">
68
+ {wizard.hasNext() && (
69
+ <Button variant="primary" size="lg" type="button" onClick={wizard.next}>
70
+ Next
71
+ </Button>
72
+ )}
73
+ </div>
74
+ </div>
75
+ </div>
76
+ // </div>
77
+ );
78
+ };
79
+
80
+ export default AppContactForm;
File without changes
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ // import { Button } from "@ramesesinc/client";
3
+ // import { usePageContext } from "@ramesesinc/platform-core";
4
+ // import { useState } from "react";
5
+ // import InputValidator from "./common/InputValidator";
6
+ // const AppInitForm = (props: any) => {
7
+ // const { tenant, module, data, wizard } = props.params ?? {};
8
+ // const [mode, setMode] = useState<"select" | "resume">("select");
9
+ // const showOverlay = mode === "resume";
10
+ // // const selectedAction = wizard.getValue("name");
11
+ // // const showOverlay = selectedAction === "Resume Pending Application";
12
+ // const pageContext = usePageContext();
13
+ // const partner = pageContext.data;
14
+ // // console.log(partner);
15
+ // return (
16
+ // <div className="px-4">
17
+ // <h1 className={`text-lg text-green-600 ${showOverlay ? "hidden" : ""}`}>Select an action</h1>
18
+ // <div>
19
+ // <div className={showOverlay ? "hidden" : ""}>
20
+ // <InputValidator
21
+ // datatype="radio"
22
+ // options={["Create New Application", "Resume Pending Application"]}
23
+ // value={wizard.getValue("name")}
24
+ // onChange={(val) => wizard.setValue("name", val)}
25
+ // className="gap-2 my-4"
26
+ // />
27
+ // </div>
28
+ // <div className={showOverlay ? "" : "hidden"}>
29
+ // <label className="block text-gray-600 text-sm mb-2">Tracking No.</label>
30
+ // <InputValidator
31
+ // datatype="string"
32
+ // value={wizard.getValue("trackingno")}
33
+ // onChange={(val) => wizard.setValue("trackno", val)}
34
+ // className="w-full px-2 border-b-2 border-gray-300 transition-colors text-gray-600"
35
+ // />
36
+ // </div>
37
+ // </div>
38
+ // <div className="flex flex-row justify-between gap-4 py-4 border-t border-slate-200">
39
+ // {!showOverlay ? (
40
+ // <>
41
+ // <div className="w-[120px]">
42
+ // {wizard.hasPrev() && (
43
+ // <Button variant="secondary" size="lg" type="button" onClick={wizard.prev}>
44
+ // Prev
45
+ // </Button>
46
+ // )}
47
+ // </div>
48
+ // <div className="w-[120px] flex justify-end">
49
+ // {wizard.hasNext() && (
50
+ // <Button variant="primary" size="lg" type="button" onClick={() => { if (wizard.getValue("name") === "Resume Pending Application") { setMode("resume"); } else { wizard.next(); } }}>
51
+ // Next
52
+ // </Button>
53
+ // )}
54
+ // </div>
55
+ // </>
56
+ // ) : (
57
+ // <>
58
+ // <div className="w-[120px]">
59
+ // <Button variant="secondary" size="lg" type="button" onClick={wizard.cancelWizard}>
60
+ // Go Back
61
+ // </Button>
62
+ // </div>
63
+ // <div className="w-[120px] flex justify-end">
64
+ // <Button variant="primary" size="lg" type="button" onClick={() => wizard.redirect("url", `/partners/negor_tanjay/oscp/building_permit`)}>
65
+ // Next
66
+ // </Button>
67
+ // </div>
68
+ // </>
69
+ // )}
70
+ // </div>
71
+ // </div>
72
+ // );
73
+ // };
74
+ // export default AppInitForm;
@@ -0,0 +1,80 @@
1
+ // import { Button } from "@ramesesinc/client";
2
+ // import { usePageContext } from "@ramesesinc/platform-core";
3
+ // import { useState } from "react";
4
+ // import InputValidator from "./common/InputValidator";
5
+
6
+ // const AppInitForm = (props: any) => {
7
+ // const { tenant, module, data, wizard } = props.params ?? {};
8
+ // const [mode, setMode] = useState<"select" | "resume">("select");
9
+ // const showOverlay = mode === "resume";
10
+ // // const selectedAction = wizard.getValue("name");
11
+ // // const showOverlay = selectedAction === "Resume Pending Application";
12
+
13
+ // const pageContext = usePageContext();
14
+ // const partner = pageContext.data;
15
+ // // console.log(partner);
16
+
17
+ // return (
18
+ // <div className="px-4">
19
+ // <h1 className={`text-lg text-green-600 ${showOverlay ? "hidden" : ""}`}>Select an action</h1>
20
+
21
+ // <div>
22
+ // <div className={showOverlay ? "hidden" : ""}>
23
+ // <InputValidator
24
+ // datatype="radio"
25
+ // options={["Create New Application", "Resume Pending Application"]}
26
+ // value={wizard.getValue("name")}
27
+ // onChange={(val) => wizard.setValue("name", val)}
28
+ // className="gap-2 my-4"
29
+ // />
30
+ // </div>
31
+
32
+ // <div className={showOverlay ? "" : "hidden"}>
33
+ // <label className="block text-gray-600 text-sm mb-2">Tracking No.</label>
34
+ // <InputValidator
35
+ // datatype="string"
36
+ // value={wizard.getValue("trackingno")}
37
+ // onChange={(val) => wizard.setValue("trackno", val)}
38
+ // className="w-full px-2 border-b-2 border-gray-300 transition-colors text-gray-600"
39
+ // />
40
+ // </div>
41
+ // </div>
42
+
43
+ // <div className="flex flex-row justify-between gap-4 py-4 border-t border-slate-200">
44
+ // {!showOverlay ? (
45
+ // <>
46
+ // <div className="w-[120px]">
47
+ // {wizard.hasPrev() && (
48
+ // <Button variant="secondary" size="lg" type="button" onClick={wizard.prev}>
49
+ // Prev
50
+ // </Button>
51
+ // )}
52
+ // </div>
53
+
54
+ // <div className="w-[120px] flex justify-end">
55
+ // {wizard.hasNext() && (
56
+ // <Button variant="primary" size="lg" type="button" onClick={() => { if (wizard.getValue("name") === "Resume Pending Application") { setMode("resume"); } else { wizard.next(); } }}>
57
+ // Next
58
+ // </Button>
59
+ // )}
60
+ // </div>
61
+ // </>
62
+ // ) : (
63
+ // <>
64
+ // <div className="w-[120px]">
65
+ // <Button variant="secondary" size="lg" type="button" onClick={wizard.cancelWizard}>
66
+ // Go Back
67
+ // </Button>
68
+ // </div>
69
+ // <div className="w-[120px] flex justify-end">
70
+ // <Button variant="primary" size="lg" type="button" onClick={() => wizard.redirect("url", `/partners/negor_tanjay/oscp/building_permit`)}>
71
+ // Next
72
+ // </Button>
73
+ // </div>
74
+ // </>
75
+ // )}
76
+ // </div>
77
+ // </div>
78
+ // );
79
+ // };
80
+ // export default AppInitForm;
@@ -0,0 +1,2 @@
1
+ declare const AppOtpForm: (props: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default AppOtpForm;
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from "@ramesesinc/client";
3
+ import { useState } from "react";
4
+ import InputValidator from "./common/InputValidator";
5
+ const AppOtpForm = (props) => {
6
+ var _a;
7
+ const { wizard } = (_a = props.params) !== null && _a !== void 0 ? _a : {};
8
+ const [emailCode, setEmailCode] = useState("");
9
+ const handleResendCode = () => {
10
+ console.log("Resend code clicked");
11
+ alert("Verification code has been resent to your email!");
12
+ };
13
+ const handleVerify = () => {
14
+ console.log("Email code:", emailCode);
15
+ if (emailCode.trim() === "") {
16
+ alert("Please enter the verification code");
17
+ return;
18
+ }
19
+ alert(`Verifying code: ${emailCode}`);
20
+ };
21
+ return (_jsxs("div", { className: "mx-auto bg-white px-4", children: [_jsx("h1", { className: "text-lg font-bold text-green-600 mb-6", children: "Email Verification" }), _jsx("p", { className: "text-gray-700 mb-8 leading-relaxed", children: "Please check your email inbox or spam for the sent 6-digit validation key. If you have not received any email, please click resend code." }), _jsxs("div", { className: "space-y-6 flex flex-col gap-2 my-4", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-gray-600 text-sm mb-2", children: "OTP Code" }), _jsx(InputValidator, { datatype: "string", value: wizard.getValue("otpcode"), onChange: (val) => wizard.setValue("otpcode", val),
22
+ // placeholder="Email Code"
23
+ className: "w-full px-2 border-b-2 border-gray-300 focus:border-green-500 transition-colors text-gray-600" })] }), _jsx("div", { className: "flex justify-end", children: _jsx(Button, { onClick: handleResendCode, className: "text-blue-600 hover:text-blue-800 underline font-medium transition-colors", children: "Resend Code" }) })] }), _jsxs("div", { className: "flex flex-row justify-between gap-4 py-4 border-t border-slate-200", children: [_jsx("div", { className: "w-[120px]", children: wizard.hasPrev() && (_jsx(Button, { variant: "secondary", size: "lg", type: "button", onClick: wizard.prev, children: "Prev" })) }), _jsx("div", { className: "w-[120px] flex justify-end", children: wizard.hasNext() && (_jsx(Button, { variant: "primary", size: "lg", type: "button", onClick: wizard.next, children: "Next" })) })] })] }));
24
+ };
25
+ export default AppOtpForm;
@@ -0,0 +1,71 @@
1
+ import { Button } from "@ramesesinc/client";
2
+ import { useState } from "react";
3
+ import InputValidator from "./common/InputValidator";
4
+
5
+ const AppOtpForm = (props: any) => {
6
+ const { wizard } = props.params ?? {};
7
+ const [emailCode, setEmailCode] = useState("");
8
+
9
+ const handleResendCode = () => {
10
+ console.log("Resend code clicked");
11
+ alert("Verification code has been resent to your email!");
12
+ };
13
+
14
+ const handleVerify = () => {
15
+ console.log("Email code:", emailCode);
16
+ if (emailCode.trim() === "") {
17
+ alert("Please enter the verification code");
18
+ return;
19
+ }
20
+ alert(`Verifying code: ${emailCode}`);
21
+ };
22
+
23
+ return (
24
+ <div className="mx-auto bg-white px-4">
25
+ <h1 className="text-lg font-bold text-green-600 mb-6">Email Verification</h1>
26
+
27
+ <p className="text-gray-700 mb-8 leading-relaxed">
28
+ Please check your email inbox or spam for the sent 6-digit validation key. If you have not received any email, please click resend code.
29
+ </p>
30
+
31
+ <div className="space-y-6 flex flex-col gap-2 my-4">
32
+ <div>
33
+ <label className="block text-gray-600 text-sm mb-2">OTP Code</label>
34
+ <InputValidator
35
+ datatype="string"
36
+ value={wizard.getValue("otpcode")}
37
+ onChange={(val) => wizard.setValue("otpcode", val)}
38
+ // placeholder="Email Code"
39
+ className="w-full px-2 border-b-2 border-gray-300 focus:border-green-500 transition-colors text-gray-600"
40
+ />
41
+ </div>
42
+
43
+ <div className="flex justify-end">
44
+ <Button onClick={handleResendCode} className="text-blue-600 hover:text-blue-800 underline font-medium transition-colors">
45
+ Resend Code
46
+ </Button>
47
+ </div>
48
+ </div>
49
+
50
+ <div className="flex flex-row justify-between gap-4 py-4 border-t border-slate-200">
51
+ <div className="w-[120px]">
52
+ {wizard.hasPrev() && (
53
+ <Button variant="secondary" size="lg" type="button" onClick={wizard.prev}>
54
+ Prev
55
+ </Button>
56
+ )}
57
+ </div>
58
+
59
+ <div className="w-[120px] flex justify-end">
60
+ {wizard.hasNext() && (
61
+ <Button variant="primary" size="lg" type="button" onClick={wizard.next}>
62
+ Next
63
+ </Button>
64
+ )}
65
+ </div>
66
+ </div>
67
+ </div>
68
+ );
69
+ };
70
+
71
+ export default AppOtpForm;
@@ -0,0 +1,2 @@
1
+ declare const AppSaveForm: (props: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default AppSaveForm;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from "@ramesesinc/client";
3
+ const AppSaveForm = (props) => {
4
+ var _a;
5
+ const { wizard } = (_a = props.params) !== null && _a !== void 0 ? _a : {};
6
+ return (_jsxs("div", { children: ["AppSaveForm", _jsxs("div", { className: "flex flex-row justify-between gap-4 py-4 border-t border-slate-200", children: [_jsx("div", { className: "w-[120px]", children: wizard.hasPrev() && (_jsx(Button, { variant: "secondary", size: "lg", type: "button", onClick: wizard.prev, children: "Prev" })) }), _jsx("div", { className: "w-[120px] flex justify-end", children: wizard.hasNext() && (_jsx(Button, { variant: "primary", size: "lg", type: "button", onClick: wizard.next, children: "Next" })) })] })] }));
7
+ };
8
+ export default AppSaveForm;
@@ -0,0 +1,29 @@
1
+ import { Button } from "@ramesesinc/client";
2
+ const AppSaveForm = (props: any) => {
3
+ const { wizard } = props.params ?? {};
4
+
5
+ return (
6
+ <div>
7
+ AppSaveForm
8
+ <div className="flex flex-row justify-between gap-4 py-4 border-t border-slate-200">
9
+ <div className="w-[120px]">
10
+ {wizard.hasPrev() && (
11
+ <Button variant="secondary" size="lg" type="button" onClick={wizard.prev}>
12
+ Prev
13
+ </Button>
14
+ )}
15
+ </div>
16
+
17
+ <div className="w-[120px] flex justify-end">
18
+ {wizard.hasNext() && (
19
+ <Button variant="primary" size="lg" type="button" onClick={wizard.next}>
20
+ Next
21
+ </Button>
22
+ )}
23
+ </div>
24
+ </div>
25
+ </div>
26
+ );
27
+ };
28
+
29
+ export default AppSaveForm;
@@ -0,0 +1,2 @@
1
+ declare const ApplicantForm: (props: any) => import("react/jsx-runtime").JSX.Element | null;
2
+ export default ApplicantForm;
@@ -0,0 +1,29 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import InputValidator from "./common/InputValidator";
3
+ const ApplicantForm = (props) => {
4
+ var _a, _b, _c, _d, _e, _f;
5
+ const { data, setData } = (_a = props.params) !== null && _a !== void 0 ? _a : {};
6
+ if (!data || !data.applicant)
7
+ return null;
8
+ const { applicant, trackingno } = data;
9
+ // update root-level fields
10
+ const setRoot = (field, value) => setData((prev) => (Object.assign(Object.assign({}, prev), { [field]: value })));
11
+ // update applicant fields
12
+ const setApplicant = (field, value) => setData((prev) => (Object.assign(Object.assign({}, prev), { applicant: Object.assign(Object.assign({}, prev.applicant), { [field]: value }) })));
13
+ return (_jsxs("div", { children: [_jsxs("p", { className: "text-sm text-gray-600 px-6 py-2", children: ["Tracking No: ", trackingno !== null && trackingno !== void 0 ? trackingno : "-"] }), _jsxs("div", { className: "px-6", children: [_jsx("h2", { className: "text-lg font-semibold text-green-600 mb-6", children: "Building Applicant Details" }), _jsx("label", { className: "block text-sm text-gray-600 mb-2", children: "Type of Applicant" }), _jsx(InputValidator, { datatype: "list", value: (_b = data.typeOfApplicant) !== null && _b !== void 0 ? _b : "Individual", options: ["Individual", "Corporation", "Partnership", "Cooperative"], onChange: (v) => setRoot("typeOfApplicant", v), className: "w-full border-b border-gray-300 focus:border-blue-500" }), _jsx("label", { className: "block text-sm text-gray-600 mb-2", children: "Name" }), _jsx(InputValidator, { datatype: "string", value: (_c = applicant.fullname) !== null && _c !== void 0 ? _c : "", onChange: (v) => setApplicant("fullname", v), className: "w-full border-b border-gray-300 focus:border-blue-500 mb-6" }), _jsx("h3", { className: "text-base font-semibold text-gray-900 mb-4", children: "Administrator / Contact Name" }), _jsx("div", { className: "grid grid-cols-1 gap-4 mb-6", children: [
14
+ ["Last Name *", "lastname"],
15
+ ["First Name *", "firstname"],
16
+ ["Middle Name", "middlename"],
17
+ ["TIN", "tin"],
18
+ ["Email *", "email"],
19
+ ["Mobile *", "mobileno"],
20
+ ["Phone", "phoneno"],
21
+ ].map(([label, field]) => {
22
+ var _a;
23
+ return (_jsxs("div", { children: [_jsx("label", { className: "block text-xs text-gray-500 mb-1", children: label }), _jsx(InputValidator, { datatype: "string", value: (_a = applicant[field]) !== null && _a !== void 0 ? _a : "", onChange: (v) => setApplicant(field, v), className: "w-full border-b border-gray-300 focus:border-blue-500" })] }, field));
24
+ }) }), _jsx("h3", { className: "text-base font-semibold text-gray-900 mb-4", children: "Applicant Address" }), _jsx(InputValidator, { datatype: "boolean", label: "Resident", value: (_d = data.isResident) !== null && _d !== void 0 ? _d : false, onChange: (v) => setRoot("isResident", v), className: "mb-4" }), _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: "Address" }), _jsx(InputValidator, { datatype: "string", value: (_e = applicant.address) !== null && _e !== void 0 ? _e : "", onChange: (v) => setApplicant("address", v), className: "w-full border-b border-gray-300 focus:border-blue-500 mb-6" }), _jsx("h3", { className: "text-base font-semibold text-gray-900 mb-4", children: "Proof of Identity" }), _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: "ID Type *" }), _jsx(InputValidator, { datatype: "list", value: (_f = data.idType) !== null && _f !== void 0 ? _f : "", options: ["Driver's License", "Passport", "SSS ID", "UMID", "PhilHealth ID", "Voter's ID"], onChange: (v) => setRoot("idType", v), className: "w-full border-b border-gray-300 focus:border-blue-500 mb-4" }), ["idNo", "placeIssued"].map((field) => {
25
+ var _a;
26
+ return (_jsxs("div", { className: "mb-4", children: [_jsx("label", { className: "block text-xs text-gray-500 mb-1", children: field === "idNo" ? "ID No *" : "Place Issued *" }), _jsx(InputValidator, { datatype: "string", value: (_a = data[field]) !== null && _a !== void 0 ? _a : "", onChange: (v) => setRoot(field, v), className: "w-full border-b border-gray-300 focus:border-blue-500" })] }, field));
27
+ })] })] }));
28
+ };
29
+ export default ApplicantForm;
@@ -0,0 +1,125 @@
1
+ import InputValidator from "./common/InputValidator";
2
+
3
+ const ApplicantForm = (props: any) => {
4
+ const { data, setData } = props.params ?? {};
5
+
6
+ if (!data || !data.applicant) return null;
7
+
8
+ const { applicant, trackingno } = data;
9
+
10
+ // update root-level fields
11
+ const setRoot = (field: string, value: any) =>
12
+ setData((prev: any) => ({
13
+ ...prev,
14
+ [field]: value,
15
+ }));
16
+
17
+ // update applicant fields
18
+ const setApplicant = (field: string, value: any) =>
19
+ setData((prev: any) => ({
20
+ ...prev,
21
+ applicant: {
22
+ ...prev.applicant,
23
+ [field]: value,
24
+ },
25
+ }));
26
+
27
+ return (
28
+ <div>
29
+ <p className="text-sm text-gray-600 px-6 py-2">Tracking No: {trackingno ?? "-"}</p>
30
+
31
+ <div className="px-6">
32
+ <h2 className="text-lg font-semibold text-green-600 mb-6">Building Applicant Details</h2>
33
+
34
+ {/* Type */}
35
+ <label className="block text-sm text-gray-600 mb-2">Type of Applicant</label>
36
+ <InputValidator
37
+ datatype="list"
38
+ value={data.typeOfApplicant ?? "Individual"}
39
+ options={["Individual", "Corporation", "Partnership", "Cooperative"]}
40
+ onChange={(v) => setRoot("typeOfApplicant", v)}
41
+ className="w-full border-b border-gray-300 focus:border-blue-500"
42
+ />
43
+
44
+ {/* Name */}
45
+ <label className="block text-sm text-gray-600 mb-2">Name</label>
46
+ <InputValidator
47
+ datatype="string"
48
+ value={applicant.fullname ?? ""}
49
+ onChange={(v) => setApplicant("fullname", v)}
50
+ className="w-full border-b border-gray-300 focus:border-blue-500 mb-6"
51
+ />
52
+
53
+ {/* Administrator */}
54
+ <h3 className="text-base font-semibold text-gray-900 mb-4">Administrator / Contact Name</h3>
55
+
56
+ <div className="grid grid-cols-1 gap-4 mb-6">
57
+ {[
58
+ ["Last Name *", "lastname"],
59
+ ["First Name *", "firstname"],
60
+ ["Middle Name", "middlename"],
61
+ ["TIN", "tin"],
62
+ ["Email *", "email"],
63
+ ["Mobile *", "mobileno"],
64
+ ["Phone", "phoneno"],
65
+ ].map(([label, field]) => (
66
+ <div key={field}>
67
+ <label className="block text-xs text-gray-500 mb-1">{label}</label>
68
+ <InputValidator
69
+ datatype="string"
70
+ value={applicant[field] ?? ""}
71
+ onChange={(v) => setApplicant(field, v)}
72
+ className="w-full border-b border-gray-300 focus:border-blue-500"
73
+ />
74
+ </div>
75
+ ))}
76
+ </div>
77
+
78
+ {/* Address */}
79
+ <h3 className="text-base font-semibold text-gray-900 mb-4">Applicant Address</h3>
80
+
81
+ <InputValidator
82
+ datatype="boolean"
83
+ label="Resident"
84
+ value={data.isResident ?? false}
85
+ onChange={(v) => setRoot("isResident", v)}
86
+ className="mb-4"
87
+ />
88
+
89
+ <label className="block text-xs text-gray-500 mb-1">Address</label>
90
+ <InputValidator
91
+ datatype="string"
92
+ value={applicant.address ?? ""}
93
+ onChange={(v) => setApplicant("address", v)}
94
+ className="w-full border-b border-gray-300 focus:border-blue-500 mb-6"
95
+ />
96
+
97
+ {/* ID */}
98
+ <h3 className="text-base font-semibold text-gray-900 mb-4">Proof of Identity</h3>
99
+
100
+ <label className="block text-xs text-gray-500 mb-1">ID Type *</label>
101
+ <InputValidator
102
+ datatype="list"
103
+ value={data.idType ?? ""}
104
+ options={["Driver's License", "Passport", "SSS ID", "UMID", "PhilHealth ID", "Voter's ID"]}
105
+ onChange={(v) => setRoot("idType", v)}
106
+ className="w-full border-b border-gray-300 focus:border-blue-500 mb-4"
107
+ />
108
+
109
+ {["idNo", "placeIssued"].map((field) => (
110
+ <div key={field} className="mb-4">
111
+ <label className="block text-xs text-gray-500 mb-1">{field === "idNo" ? "ID No *" : "Place Issued *"}</label>
112
+ <InputValidator
113
+ datatype="string"
114
+ value={data[field] ?? ""}
115
+ onChange={(v) => setRoot(field, v)}
116
+ className="w-full border-b border-gray-300 focus:border-blue-500"
117
+ />
118
+ </div>
119
+ ))}
120
+ </div>
121
+ </div>
122
+ );
123
+ };
124
+
125
+ export default ApplicantForm;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ type HtmlTemplateProps = {
3
+ id: string;
4
+ module: string;
5
+ tenant: string;
6
+ };
7
+ declare const HtmlTemplate: React.FC<HtmlTemplateProps>;
8
+ export default HtmlTemplate;
@@ -0,0 +1,28 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { localAPI } from "@ramesesinc/lib/local-api";
3
+ import { useEffect, useState } from "react";
4
+ const HtmlTemplate = ({ id, module, tenant }) => {
5
+ const [html, setHtml] = useState("");
6
+ const [error, setError] = useState(null);
7
+ console.log("HtmlTemplate props:", { id, module, tenant });
8
+ useEffect(() => {
9
+ const fetchHtml = async () => {
10
+ var _a;
11
+ try {
12
+ const mgmt = localAPI.useMgmt(tenant, module);
13
+ const data = await mgmt.get("html_templates", id);
14
+ console.log("Fetched HTML Template:", data);
15
+ setHtml((_a = data === null || data === void 0 ? void 0 : data.htmlCode) !== null && _a !== void 0 ? _a : "");
16
+ }
17
+ catch (e) {
18
+ setHtml("");
19
+ setError(e.message || "Unknown error");
20
+ }
21
+ };
22
+ fetchHtml();
23
+ }, [id]);
24
+ if (error)
25
+ return (_jsxs("div", { id: id, style: { color: "red" }, children: ["Error: ", error] }));
26
+ return (_jsx("div", { id: id, children: _jsx("div", { dangerouslySetInnerHTML: { __html: html } }) }));
27
+ };
28
+ export default HtmlTemplate;