@djb25/digit-ui-module-ekyc 1.0.0 → 1.0.2
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.js +1 -1
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +3290 -0
- package/dist/index.modern.js.map +1 -0
- package/package.json +1 -1
- package/src/Module.js +7 -23
- package/src/components/ConnectionDetailsView.js +114 -0
- package/src/components/DesktopInbox.js +84 -84
- package/src/components/Filter.js +59 -0
- package/src/components/MobileInbox.js +73 -0
- package/src/components/SearchConsumer.js +122 -0
- package/src/components/StatusCards.js +13 -22
- package/src/pages/employee/AadhaarVerification.js +357 -0
- package/src/pages/employee/AddressDetails.js +452 -0
- package/src/pages/employee/Create.js +94 -0
- package/src/pages/employee/Inbox.js +37 -20
- package/src/pages/employee/PropertyInfo.js +405 -0
- package/src/pages/employee/Review.js +118 -0
- package/src/pages/employee/index.js +104 -0
- package/src/components/Search.js +0 -77
package/src/components/Search.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from "react";
|
|
2
|
-
import { useForm, Controller } from "react-hook-form";
|
|
3
|
-
import { TextInput, Label, LinkLabel, Dropdown } from "@djb25/digit-ui-react-components";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
|
|
6
|
-
const SearchApplication = ({ onSearch, searchFields, searchParams }) => {
|
|
7
|
-
const { t } = useTranslation();
|
|
8
|
-
const { register, handleSubmit, reset, watch, control } = useForm({
|
|
9
|
-
defaultValues: searchParams,
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const onSubmitInput = (data) => {
|
|
13
|
-
onSearch(data);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
function clearSearch() {
|
|
17
|
-
const resetValues = searchFields.reduce((acc, field) => ({ ...acc, [field?.name]: "" }), {});
|
|
18
|
-
reset(resetValues);
|
|
19
|
-
onSearch({ ...resetValues });
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Watch all fields
|
|
23
|
-
const watchedFields = watch();
|
|
24
|
-
const prevFields = useRef(watchedFields);
|
|
25
|
-
|
|
26
|
-
// Trigger search only when fields actually change and compare values to avoid loops
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
const isChanged = JSON.stringify(prevFields.current) !== JSON.stringify(watchedFields);
|
|
29
|
-
if (isChanged) {
|
|
30
|
-
prevFields.current = watchedFields;
|
|
31
|
-
// Debounce or delay if needed, but for dropdowns immediate is fine
|
|
32
|
-
const timeoutId = setTimeout(() => {
|
|
33
|
-
onSearch(watchedFields);
|
|
34
|
-
}, 300); // Small debounce to be safe
|
|
35
|
-
return () => clearTimeout(timeoutId);
|
|
36
|
-
}
|
|
37
|
-
}, [watchedFields, onSearch]);
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<form onSubmit={handleSubmit(onSubmitInput)} style={{ flex: 1 }}>
|
|
41
|
-
<div className="search-container" style={{ backgroundColor: "#ffffffff", padding: "24px" }}>
|
|
42
|
-
<div className="complaint-input-container" style={{ display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(700px, 1fr))", gap: "20px", alignItems: "end" }}>
|
|
43
|
-
{searchFields?.map((input) => (
|
|
44
|
-
<div key={input.name} className="input-fields">
|
|
45
|
-
<Label>{input.label}</Label>
|
|
46
|
-
{input.type === "dropdown" ? (
|
|
47
|
-
<Controller
|
|
48
|
-
control={control}
|
|
49
|
-
name={input.name}
|
|
50
|
-
render={(props) => (
|
|
51
|
-
<Dropdown
|
|
52
|
-
selected={props.value}
|
|
53
|
-
select={(val) => {
|
|
54
|
-
props.onChange(val);
|
|
55
|
-
}}
|
|
56
|
-
onBlur={props.onBlur}
|
|
57
|
-
option={input.options}
|
|
58
|
-
optionKey={input.optionsKey}
|
|
59
|
-
t={t}
|
|
60
|
-
/>
|
|
61
|
-
)}
|
|
62
|
-
/>
|
|
63
|
-
) : (
|
|
64
|
-
<TextInput {...input} inputRef={register} watch={watch} />
|
|
65
|
-
)}
|
|
66
|
-
</div>
|
|
67
|
-
))}
|
|
68
|
-
{/* <div className="search-submit-wrapper" style={{ display: "flex", alignItems: "center", gap: "20px", height: "40px" }}>
|
|
69
|
-
<LinkLabel onClick={clearSearch}>{t("ES_COMMON_CLEAR_ALL")}</LinkLabel>
|
|
70
|
-
</div> */}
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
</form>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export default SearchApplication;
|