diff --git a/package-lock.json b/package-lock.json
index 59b9e5d..f10b8e2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,6 +10,7 @@
"dependencies": {
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.19",
+ "@mui/x-charts": "^6.19.4",
"@react-google-maps/api": "^2.19.2",
"@szhsin/react-menu": "github:szhsin/react-menu",
"@testing-library/jest-dom": "^5.17.0",
@@ -33,6 +34,7 @@
"i18next": "^23.6.0",
"i18next-browser-languagedetector": "^7.1.0",
"json-server": "^0.17.4",
+ "moment": "^2.30.1",
"react": "^18.2.0",
"react-apexcharts": "^1.4.1",
"react-bootstrap": "^2.9.1",
@@ -2895,7 +2897,6 @@
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.4.tgz",
"integrity": "sha512-CF8k2rgKeh/49UrnIBs4BdxPUV6vize/Db1d/YbCLyp9GiVZ0BEwf5AiDSxJRCr6yOkGqTFHtmrULxkEfYZ7dQ==",
- "peer": true,
"dependencies": {
"@floating-ui/dom": "^1.5.1"
},
@@ -3394,7 +3395,6 @@
"version": "5.0.0-beta.26",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.26.tgz",
"integrity": "sha512-gPMRKC84VRw+tjqYoyBzyrBUqHQucMXdlBpYazHa5rCXrb91fYEQk5SqQ2U5kjxx9QxZxTBvWAmZ6DblIgaGhQ==",
- "peer": true,
"dependencies": {
"@babel/runtime": "^7.23.4",
"@floating-ui/react-dom": "^2.0.4",
@@ -3605,7 +3605,6 @@
"version": "7.2.10",
"resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.10.tgz",
"integrity": "sha512-wX1vbDC+lzF7FlhT6A3ffRZgEoKWPF8VqRoTu4lZwouFX2t90KyCMsgepMw5DxLak1BSp/KP86CmtZttikb/gQ==",
- "peer": true,
"peerDependencies": {
"@types/react": "^17.0.0 || ^18.0.0"
},
@@ -3619,7 +3618,6 @@
"version": "5.14.20",
"resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.20.tgz",
"integrity": "sha512-Y6yL5MoFmtQml20DZnaaK1znrCEwG6/vRSzW8PKOTrzhyqKIql0FazZRUR7sA5EPASgiyKZfq0FPwISRXm5NdA==",
- "peer": true,
"dependencies": {
"@babel/runtime": "^7.23.4",
"@types/prop-types": "^15.7.11",
@@ -3643,6 +3641,41 @@
}
}
},
+ "node_modules/@mui/x-charts": {
+ "version": "6.19.4",
+ "resolved": "https://registry.npmjs.org/@mui/x-charts/-/x-charts-6.19.4.tgz",
+ "integrity": "sha512-0kNg/6jVuG4GoZbV6qb9pYmL8Bhor1m55VIuVlu3p9WdsZFLUyksS4r08viII3YMxosl6MJdFnEfMjWJDAswXw==",
+ "dependencies": {
+ "@babel/runtime": "^7.23.2",
+ "@mui/base": "^5.0.0-beta.22",
+ "@react-spring/rafz": "^9.7.3",
+ "@react-spring/web": "^9.7.3",
+ "clsx": "^2.0.0",
+ "d3-color": "^3.1.0",
+ "d3-scale": "^4.0.2",
+ "d3-shape": "^3.2.0",
+ "prop-types": "^15.8.1"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ },
+ "peerDependencies": {
+ "@emotion/react": "^11.9.0",
+ "@emotion/styled": "^11.8.1",
+ "@mui/material": "^5.4.1",
+ "@mui/system": "^5.4.1",
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@emotion/react": {
+ "optional": true
+ },
+ "@emotion/styled": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@nicolo-ribaudo/eslint-scope-5-internals": {
"version": "5.1.1-v1",
"resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz",
@@ -3922,6 +3955,71 @@
"resolved": "https://registry.npmjs.org/@react-google-maps/marker-clusterer/-/marker-clusterer-2.19.2.tgz",
"integrity": "sha512-x9ibmsP0ZVqzyCo1Pitbw+4b6iEXRw/r1TCy3vOUR3eKrzWLnHYZMR325BkZW2r8fnuWE/V3Fp4QZOP9qYORCw=="
},
+ "node_modules/@react-spring/animated": {
+ "version": "9.7.3",
+ "resolved": "https://registry.npmjs.org/@react-spring/animated/-/animated-9.7.3.tgz",
+ "integrity": "sha512-5CWeNJt9pNgyvuSzQH+uy2pvTg8Y4/OisoscZIR8/ZNLIOI+CatFBhGZpDGTF/OzdNFsAoGk3wiUYTwoJ0YIvw==",
+ "dependencies": {
+ "@react-spring/shared": "~9.7.3",
+ "@react-spring/types": "~9.7.3"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
+ "node_modules/@react-spring/core": {
+ "version": "9.7.3",
+ "resolved": "https://registry.npmjs.org/@react-spring/core/-/core-9.7.3.tgz",
+ "integrity": "sha512-IqFdPVf3ZOC1Cx7+M0cXf4odNLxDC+n7IN3MDcVCTIOSBfqEcBebSv+vlY5AhM0zw05PDbjKrNmBpzv/AqpjnQ==",
+ "dependencies": {
+ "@react-spring/animated": "~9.7.3",
+ "@react-spring/shared": "~9.7.3",
+ "@react-spring/types": "~9.7.3"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/react-spring/donate"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
+ "node_modules/@react-spring/rafz": {
+ "version": "9.7.3",
+ "resolved": "https://registry.npmjs.org/@react-spring/rafz/-/rafz-9.7.3.tgz",
+ "integrity": "sha512-9vzW1zJPcC4nS3aCV+GgcsK/WLaB520Iyvm55ARHfM5AuyBqycjvh1wbmWmgCyJuX4VPoWigzemq1CaaeRSHhQ=="
+ },
+ "node_modules/@react-spring/shared": {
+ "version": "9.7.3",
+ "resolved": "https://registry.npmjs.org/@react-spring/shared/-/shared-9.7.3.tgz",
+ "integrity": "sha512-NEopD+9S5xYyQ0pGtioacLhL2luflh6HACSSDUZOwLHoxA5eku1UPuqcJqjwSD6luKjjLfiLOspxo43FUHKKSA==",
+ "dependencies": {
+ "@react-spring/types": "~9.7.3"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
+ "node_modules/@react-spring/types": {
+ "version": "9.7.3",
+ "resolved": "https://registry.npmjs.org/@react-spring/types/-/types-9.7.3.tgz",
+ "integrity": "sha512-Kpx/fQ/ZFX31OtlqVEFfgaD1ACzul4NksrvIgYfIFq9JpDHFwQkMVZ10tbo0FU/grje4rcL4EIrjekl3kYwgWw=="
+ },
+ "node_modules/@react-spring/web": {
+ "version": "9.7.3",
+ "resolved": "https://registry.npmjs.org/@react-spring/web/-/web-9.7.3.tgz",
+ "integrity": "sha512-BXt6BpS9aJL/QdVqEIX9YoUy8CE6TJrU0mNCqSoxdXlIeNcEBWOfIyE6B14ENNsyQKS3wOWkiJfco0tCr/9tUg==",
+ "dependencies": {
+ "@react-spring/animated": "~9.7.3",
+ "@react-spring/core": "~9.7.3",
+ "@react-spring/shared": "~9.7.3",
+ "@react-spring/types": "~9.7.3"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
"node_modules/@remix-run/router": {
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.13.1.tgz",
@@ -7501,6 +7599,100 @@
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
},
+ "node_modules/d3-array": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz",
+ "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==",
+ "dependencies": {
+ "internmap": "1 - 2"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-color": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz",
+ "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-format": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz",
+ "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-interpolate": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
+ "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
+ "dependencies": {
+ "d3-color": "1 - 3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-path": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz",
+ "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-scale": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz",
+ "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",
+ "dependencies": {
+ "d3-array": "2.10.0 - 3",
+ "d3-format": "1 - 3",
+ "d3-interpolate": "1.2.0 - 3",
+ "d3-time": "2.1.1 - 3",
+ "d3-time-format": "2 - 4"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-shape": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz",
+ "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==",
+ "dependencies": {
+ "d3-path": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-time": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz",
+ "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",
+ "dependencies": {
+ "d3-array": "2 - 3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-time-format": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz",
+ "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",
+ "dependencies": {
+ "d3-time": "1 - 3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
"node_modules/damerau-levenshtein": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz",
@@ -10317,6 +10509,14 @@
"node": ">= 0.4"
}
},
+ "node_modules/internmap": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz",
+ "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
"node_modules/invariant": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
@@ -12557,6 +12757,14 @@
"mkdirp": "bin/cmd.js"
}
},
+ "node_modules/moment": {
+ "version": "2.30.1",
+ "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz",
+ "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==",
+ "engines": {
+ "node": "*"
+ }
+ },
"node_modules/morgan": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz",
diff --git a/package.json b/package.json
index 52a22a7..3f55348 100644
--- a/package.json
+++ b/package.json
@@ -5,6 +5,7 @@
"dependencies": {
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.19",
+ "@mui/x-charts": "^6.19.4",
"@react-google-maps/api": "^2.19.2",
"@szhsin/react-menu": "github:szhsin/react-menu",
"@testing-library/jest-dom": "^5.17.0",
@@ -28,6 +29,7 @@
"i18next": "^23.6.0",
"i18next-browser-languagedetector": "^7.1.0",
"json-server": "^0.17.4",
+ "moment": "^2.30.1",
"react": "^18.2.0",
"react-apexcharts": "^1.4.1",
"react-bootstrap": "^2.9.1",
diff --git a/public/Layout/De.svg b/public/Layout/De.svg
new file mode 100644
index 0000000..543a1bc
--- /dev/null
+++ b/public/Layout/De.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/Components/Columns/ColumnsImage.tsx b/src/Components/Columns/ColumnsImage.tsx
index 081aa1b..f5c45a4 100644
--- a/src/Components/Columns/ColumnsImage.tsx
+++ b/src/Components/Columns/ColumnsImage.tsx
@@ -14,8 +14,11 @@ import useImageError from '../../Hooks/useImageError';
const ColumnsImage= ({src}:any) => {
const ErrorImage = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/832px-No-Image-Placeholder.svg.png"
-
+ console.log(ImageBaseURL + src,"ColumnsImage");
+
const imageUrl = ImageBaseURL + src || ErrorImage;
+ console.log(imageUrl);
+
const handleError = useImageError;
// or you can download flipped and rotated image
// https://codesandbox.io/s/zi-ding-yi-gong-ju-lan-antd-5-7-0-forked-c9jvmp
diff --git a/src/Components/Karimalden/View/SearchField.tsx b/src/Components/Karimalden/View/SearchField.tsx
deleted file mode 100644
index bffbe3d..0000000
--- a/src/Components/Karimalden/View/SearchField.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { Input } from 'antd';
-import { SearchProps } from 'antd/es/input'
-import { useState } from 'react';
-import { useTranslation } from 'react-i18next';
-import { useLocation, useNavigate, useSearchParams } from 'react-router-dom';
-const { Search } = Input;
-
-const SearchField = () => {
- const navigate = useNavigate()
- const [searchParams,] = useSearchParams();
- const location =useLocation()
- const {t} = useTranslation();
-
- const [searchValue, setSearchValue] = useState(searchParams.get('search')|| "");
-
-
- const onSearch: SearchProps['onSearch'] = (value, _e, info) => {
- // console.log(value);
-
- navigate(`${location?.pathname}?search=${value}`, { replace: true });
- }
- const onChange = (e :any) => {
- setSearchValue(e.target.value);
-
- }
-
-
- return (
-
-
-
-
- )
-}
-
-export default SearchField
\ No newline at end of file
diff --git a/src/Components/Ui/StaticsCard/StaticCard.tsx b/src/Components/Ui/StaticsCard/StaticCard.tsx
index f82c1c4..362e20f 100644
--- a/src/Components/Ui/StaticsCard/StaticCard.tsx
+++ b/src/Components/Ui/StaticsCard/StaticCard.tsx
@@ -1,6 +1,5 @@
import React from "react";
import { Card, CardBody } from "reactstrap";
-import Chart from "react-apexcharts";
import { ChartTypeEnum } from "../../../enums/ChartTypeEnum";
import { history } from "../../../ProviderContainer";
import { useNavigate } from "react-router-dom";
@@ -33,7 +32,7 @@ const StatisticsCard = (props :StatisticsCardProps) => {
} = props;
return (
- navigate(pathWhenClick , {replace:true})}>
+ navigate(pathWhenClick , {replace:true})}>
{
-
{CardTitle}
+ {/*
{CardTitle}
*/}
{icon}
-
{count}
+ {/*
{count}
*/}
{CardContent}
diff --git a/src/Components/Utils/Translate.tsx b/src/Components/Utils/Translate.tsx
index f345457..6864551 100644
--- a/src/Components/Utils/Translate.tsx
+++ b/src/Components/Utils/Translate.tsx
@@ -1,8 +1,9 @@
import { Menu, MenuItem, MenuButton } from '@szhsin/react-menu';
import { useTranslation, initReactI18next } from 'react-i18next';
-import i18n from 'i18next'; // Make sure this import is correct
+import i18n from 'i18next';
import translationEN from '../../translate/en.json';
import translationAR from '../../translate/ar.json';
+import translationDE from '../../translate/de.json';
i18n.use(initReactI18next).init({
resources: {
@@ -11,6 +12,9 @@ i18n.use(initReactI18next).init({
},
ar: {
translation: translationAR
+ },
+ de: {
+ translation: translationDE
}
},
lng: 'en',
@@ -18,60 +22,73 @@ i18n.use(initReactI18next).init({
escapeValue: false
}
});
-let What_the_language = localStorage.getItem('language') ?? "en";
+
+let What_the_language = localStorage.getItem('language') ?? "en";
if (What_the_language === "en") {
-
i18n.changeLanguage('en');
- document.body.setAttribute('dir', 'ltr'); document.body.classList.add('en')}
- else{
- i18n.changeLanguage('ar');
- document.body.setAttribute('dir', 'rtl'); document.body.classList.add('ar');
+ document.body.setAttribute('dir', 'ltr');
+ document.body.classList.add('en');
+} else if (What_the_language === "ar") {
+ i18n.changeLanguage('ar');
+ document.body.setAttribute('dir', 'rtl');
+ document.body.classList.add('ar');
+} else if (What_the_language === "de") {
+ i18n.changeLanguage('de');
+ document.body.setAttribute('dir', 'ltr');
+ document.body.classList.add('de');
}
-
export default function Translate() {
const { t, i18n } = useTranslation();
-
- const changeLanguage = (newLanguage : any) => {
+ const changeLanguage = (newLanguage : string) => {
i18n.changeLanguage(newLanguage);
- if(newLanguage === "Ar"){
- i18n.changeLanguage('ar');
- document.body.setAttribute('dir', 'rtl'); document.body.classList.add('ar');localStorage.setItem("language", "ar");
- What_the_language = "ar"
- }
- else if(newLanguage === "En"){
- i18n.changeLanguage('en');
- document.body.setAttribute('dir', 'ltr'); document.body.classList.remove('ar');localStorage.setItem("language", "en");
- What_the_language = "en"
-
+ localStorage.setItem("language", newLanguage);
+ What_the_language = newLanguage;
+ if (newLanguage === "ar") {
+ document.body.setAttribute('dir', 'rtl');
+ document.body.classList.remove('de');
+ document.body.classList.add('ar');
+ } else if (newLanguage === "en") {
+ document.body.setAttribute('dir', 'ltr');
+ document.body.classList.remove('ar', 'de');
+ document.body.classList.add('en');
+ } else if (newLanguage === "de") {
+ document.body.setAttribute('dir', 'ltr');
+ document.body.classList.remove('ar');
+ document.body.classList.add('de');
}
};
return (
-
+
);
}
diff --git a/src/Components/Karimalden/Ui/KarimSpinner.tsx b/src/Components/ValidationField/Ui/KarimSpinner.tsx
similarity index 100%
rename from src/Components/Karimalden/Ui/KarimSpinner.tsx
rename to src/Components/ValidationField/Ui/KarimSpinner.tsx
diff --git a/src/Components/ValidationField/Ui/SearchBar.scss b/src/Components/ValidationField/Ui/SearchBar.scss
new file mode 100644
index 0000000..2ddadd9
--- /dev/null
+++ b/src/Components/ValidationField/Ui/SearchBar.scss
@@ -0,0 +1,48 @@
+.SearchBar{
+ // margin-top: 20px;
+ .group {
+ display: flex;
+ align-items: center;
+ position: relative;
+ max-width: 350px;
+ width: 350px;
+
+ }
+
+ .input {
+ width: 100%;
+ height: 40px;
+ padding: 0 1rem;
+ padding-left: 2.5rem;
+ border-radius: 8px;
+ outline: none;
+ font-weight: 500;
+ background: var(--bg);
+ color: var(--text);
+ border: none;
+ box-shadow: 2px 2px 7px 0 var(--bg);
+
+ }
+
+ .input::placeholder {
+ color: var(--subtext);
+ opacity: .4;
+
+ }
+
+
+
+ .icon {
+ position: absolute;
+ left: 1rem;
+ fill: var(--subtext);
+ width: 1rem;
+ height: 1rem;
+ }
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/src/Components/ValidationField/Ui/SearchBar.tsx b/src/Components/ValidationField/Ui/SearchBar.tsx
new file mode 100644
index 0000000..76c855c
--- /dev/null
+++ b/src/Components/ValidationField/Ui/SearchBar.tsx
@@ -0,0 +1,35 @@
+import React, { useState } from 'react'
+import './SearchBar.scss'
+import { useNavigate, useSearchParams } from 'react-router-dom';
+const SearchBar = () => {
+ const [searchQuery, setSearchQuery] = useState('');
+ const [searchParams] = useSearchParams()
+ const navigate = useNavigate();
+
+ const handleChange = (event:any) => {
+ const { value } = event.target;
+ setSearchQuery(value);
+ updateUrlParams(value);
+ };
+
+ const updateUrlParams = (value:any) => {
+ navigate(`?search=${value}`, { replace: true });
+
+
+ };
+
+ return (
+
+ )
+}
+
+export default SearchBar
\ No newline at end of file
diff --git a/src/Components/Karimalden/KarimField.scss b/src/Components/ValidationField/ValidationField.scss
similarity index 98%
rename from src/Components/Karimalden/KarimField.scss
rename to src/Components/ValidationField/ValidationField.scss
index 864c255..97e9f5e 100644
--- a/src/Components/Karimalden/KarimField.scss
+++ b/src/Components/ValidationField/ValidationField.scss
@@ -1,4 +1,4 @@
-.KarimField{
+.ValidationField{
>*{
width: 100%;
}
diff --git a/src/Components/Karimalden/KarimField.tsx b/src/Components/ValidationField/ValidationField.tsx
similarity index 62%
rename from src/Components/Karimalden/KarimField.tsx
rename to src/Components/ValidationField/ValidationField.tsx
index 2ecdc51..722bc5a 100644
--- a/src/Components/Karimalden/KarimField.tsx
+++ b/src/Components/ValidationField/ValidationField.tsx
@@ -1,13 +1,17 @@
import React from "react";
-import "./KarimField.scss";
+import "./ValidationField.scss";
import { Date, Time, File, DataRange, SelectField, Default, CheckboxField } from './View';
-import { KarimFieldProps } from "./types";
+import { ValidationFieldProps } from "./types";
import MaltyFile from "./View/MaltyFile";
+import SearchField from "./View/SearchField";
-const KarimField: React.FC = ({type = "text", ...otherProps}) => {
+const ValidationField: React.FC = ({type , ...otherProps}) => {
+
switch (type) {
case 'Select':
return ;
+ case 'Search':
+ return ;
case "DataRange":
return ;
case "Date":
@@ -21,8 +25,8 @@ const KarimField: React.FC = ({type = "text", ...otherProps}) =
case "Checkbox":
return ;
default:
- return ;
+ return ;
}
};
-export default React.memo(KarimField);
+export default React.memo(ValidationField);
diff --git a/src/Components/Karimalden/View/CheckboxField.tsx b/src/Components/ValidationField/View/CheckboxField.tsx
similarity index 95%
rename from src/Components/Karimalden/View/CheckboxField.tsx
rename to src/Components/ValidationField/View/CheckboxField.tsx
index 329bffd..21c419e 100644
--- a/src/Components/Karimalden/View/CheckboxField.tsx
+++ b/src/Components/ValidationField/View/CheckboxField.tsx
@@ -25,7 +25,7 @@ const CheckboxField = ({ name, label, isDisabled, onChange,Group,className, prop
>
- {t(label)}
+ {t(`${label ? label : name}`)}
diff --git a/src/Components/Karimalden/View/DataRange.tsx b/src/Components/ValidationField/View/DataRange.tsx
similarity index 54%
rename from src/Components/Karimalden/View/DataRange.tsx
rename to src/Components/ValidationField/View/DataRange.tsx
index 6639e76..742e6b5 100644
--- a/src/Components/Karimalden/View/DataRange.tsx
+++ b/src/Components/ValidationField/View/DataRange.tsx
@@ -5,34 +5,35 @@ import useFormField from '../../../Hooks/useFormField';
const { RangePicker } = DatePicker;
-const DataRange = ({ name, label,Format ,props ,onChange,isDisabled,placeholder,className}: any) => {
+const DataRange = ({ name, label, Format, props, onChange, isDisabled, placeholder, className }: any) => {
const { errorMsg, isError, t, formik } = useFormField(name, props)
const onCalendarChange = (value: any) => {
-
+
formik.setFieldValue(name, value)
};
return (
-
+
-
+
diff --git a/src/Components/Karimalden/View/Date.tsx b/src/Components/ValidationField/View/Date.tsx
similarity index 96%
rename from src/Components/Karimalden/View/Date.tsx
rename to src/Components/ValidationField/View/Date.tsx
index 4f96987..dfb5757 100644
--- a/src/Components/Karimalden/View/Date.tsx
+++ b/src/Components/ValidationField/View/Date.tsx
@@ -13,7 +13,7 @@ const Date = ({ name, label,picker="date" ,isDisabled,props,onChange,placeholder
};
return (
-
+
diff --git a/src/Components/Karimalden/View/Default.tsx b/src/Components/ValidationField/View/Default.tsx
similarity index 89%
rename from src/Components/Karimalden/View/Default.tsx
rename to src/Components/ValidationField/View/Default.tsx
index 6f960ab..62b7544 100644
--- a/src/Components/Karimalden/View/Default.tsx
+++ b/src/Components/ValidationField/View/Default.tsx
@@ -2,12 +2,11 @@ import { Form, Input } from 'antd'
import React from 'react'
import useFormField from '../../../Hooks/useFormField';
-const Default = ({ name, label, placeholder, isDisabled, onChange, props,type="text" }: any) => {
+const Default = ({ name, label, placeholder, isDisabled, onChange, props,type }: any) => {
const { Field, formik, isError, errorMsg, t } = useFormField(name, props);
-
return (
-
+
@@ -18,7 +17,7 @@ const Default = ({ name, label, placeholder, isDisabled, onChange, props,type="t
>
{
const { formik, t ,isError} = useFormField(name, props)
- const imageUrl = formik.values[name] ? ImageBaseURL + formik.values[name] : '';
+ let FormikName = formik.values[name];
+ const imageUrl = formik.values[name] ? ImageBaseURL + FormikName : '';
+
const fileList: UploadFile[] = [
{
uid: '-1',
name: '',
status: 'done',
- url: imageUrl,
- thumbUrl: imageUrl,
+ url: FormikName == ""? imageUrl : imageUrl?.replace("public", "/storage"),
+ thumbUrl: FormikName == ""? imageUrl : imageUrl?.replace("public", "/storage")
}
];
const FilehandleChange = (value:any) => {
@@ -27,7 +29,7 @@ const File = ({ name, label, onChange, isDisabled,placholder,className, props }:
onSuccess();
};
return (
-
+
diff --git a/src/Components/Karimalden/View/MaltyFile.tsx b/src/Components/ValidationField/View/MaltyFile.tsx
similarity index 87%
rename from src/Components/Karimalden/View/MaltyFile.tsx
rename to src/Components/ValidationField/View/MaltyFile.tsx
index 7e953dd..c383aea 100644
--- a/src/Components/Karimalden/View/MaltyFile.tsx
+++ b/src/Components/ValidationField/View/MaltyFile.tsx
@@ -6,8 +6,8 @@ import useFormField from '../../../Hooks/useFormField';
const MaltyFile = ({ name, label, onChange, isDisabled, placholder, className, props }: any) => {
const { formik, t, isError } = useFormField(name, props);
- const imageUrl = formik.values[name] ? ImageBaseURL + formik.values[name] : '';
- const fileList = formik.values[name] ? formik.values[name].map((file: any, index: number) => ({
+ const imageUrl = formik?.values[name] ? ImageBaseURL + formik.values[name] : '';
+ const fileList = formik?.values[name] ? formik?.values[name]?.map((file: any, index: number) => ({
uid: index,
name: file.name,
status: 'done',
@@ -25,7 +25,7 @@ const MaltyFile = ({ name, label, onChange, isDisabled, placholder, className, p
};
return (
-
+
diff --git a/src/Components/ValidationField/View/SearchField.tsx b/src/Components/ValidationField/View/SearchField.tsx
new file mode 100644
index 0000000..35bc235
--- /dev/null
+++ b/src/Components/ValidationField/View/SearchField.tsx
@@ -0,0 +1,56 @@
+import { Form, Select } from 'antd';
+import React, { useEffect, useState } from 'react';
+import useFormField from '../../../Hooks/useFormField';
+import { useNavigate } from 'react-router-dom';
+
+const SearchField = ({ name, label, placeholder, isDisabled, searchBy, option, isMulti, onChange, className, props }: any) => {
+ const { errorMsg, isError, t, formik } = useFormField(name, props);
+ const [searchQuery, setSearchQuery] = useState
('');
+ const navigate = useNavigate()
+ useEffect(() => {
+ const searchParams = new URLSearchParams(window.location.search);
+ setSearchQuery(searchParams?.get('search') || '');
+ }, []);
+
+
+
+ const SelecthandleChange = (value: { value: string; label: React.ReactNode }) => {
+ formik.setFieldValue(name, value);
+
+ };
+ const SearchHandleChange = (value:any) => {
+ navigate(`${window?.location?.pathname}?${searchBy}=${value}`, { replace: true });
+
+ };
+
+ return (
+
+
+
+
+
+
+ );
+};
+
+export default React.memo(SearchField);
diff --git a/src/Components/Karimalden/View/SelectField.tsx b/src/Components/ValidationField/View/SelectField.tsx
similarity index 96%
rename from src/Components/Karimalden/View/SelectField.tsx
rename to src/Components/ValidationField/View/SelectField.tsx
index 4a1f20c..b208b48 100644
--- a/src/Components/Karimalden/View/SelectField.tsx
+++ b/src/Components/ValidationField/View/SelectField.tsx
@@ -10,7 +10,7 @@ const SelectField = ({ name, label, placeholder, isDisabled,option,isMulti,onCha
};
return (
-
+
diff --git a/src/Components/Karimalden/View/Time.tsx b/src/Components/ValidationField/View/Time.tsx
similarity index 96%
rename from src/Components/Karimalden/View/Time.tsx
rename to src/Components/ValidationField/View/Time.tsx
index debecbd..3d3bb0c 100644
--- a/src/Components/Karimalden/View/Time.tsx
+++ b/src/Components/ValidationField/View/Time.tsx
@@ -12,7 +12,7 @@ const Time = ({ name, label,className,isDisabled,onChange,props }: any) => {
};
return (
-
+
diff --git a/src/Components/Karimalden/View/index.tsx b/src/Components/ValidationField/View/index.tsx
similarity index 100%
rename from src/Components/Karimalden/View/index.tsx
rename to src/Components/ValidationField/View/index.tsx
diff --git a/src/Components/Karimalden/index.tsx b/src/Components/ValidationField/index.tsx
similarity index 100%
rename from src/Components/Karimalden/index.tsx
rename to src/Components/ValidationField/index.tsx
diff --git a/src/Components/Karimalden/types.ts b/src/Components/ValidationField/types.ts
similarity index 67%
rename from src/Components/Karimalden/types.ts
rename to src/Components/ValidationField/types.ts
index bb3a03f..17fe1b0 100644
--- a/src/Components/Karimalden/types.ts
+++ b/src/Components/ValidationField/types.ts
@@ -1,5 +1,5 @@
-// export interface KarimFieldProps {
+// export interface ValidationFieldProps {
// name: string;
// type?: "text" | "Select" | "DataRange" | "Date" | "Time" | "File" | "number" | "Checkbox" | "password";
// placeholder?: string;
@@ -15,7 +15,7 @@
// dir?:'ltr' | "rtl"
// }
- export interface KarimFieldPropsText {
+ export interface ValidationFieldPropsText {
name: string;
type: "text";
placeholder?: string;
@@ -26,7 +26,7 @@
dir?:'ltr' | "rtl"
}
- export interface KarimFieldPropsSelect {
+ export interface ValidationFieldPropsSelect {
name: string;
type: "Select";
placeholder?: string;
@@ -39,7 +39,22 @@
isMulti?: boolean;
}
- export interface KarimFieldPropsDataRange {
+
+ export interface ValidationFieldPropsSearch{
+ name: string;
+ type: "Search";
+ placeholder?: string;
+ label?: string;
+ className?: string;
+ isDisabled?: boolean;
+ onChange?: (value: any) => void;
+ dir?:'ltr' | "rtl";
+ option: any[];
+ isMulti?: boolean;
+ searchBy:string;
+
+ }
+ export interface ValidationFieldPropsDataRange {
name: string;
type: "DataRange";
placeholder?: string;
@@ -48,9 +63,9 @@
isDisabled?: boolean;
onChange?: (value: any) => void;
dir?:'ltr' | "rtl"
- Format?: "YYYY/MM/DD" | "MM/DD" | "YYYY/MM";
+ Format?: "YYYY/MM/DD" | "MM/DD" | "YYYY/MM" | "YYYY-MM-DD HH:mm:ss.SSS";
}
- export interface KarimFieldPropsDate {
+ export interface ValidationFieldPropsDate {
name: string;
type: "Date";
placeholder?: string;
@@ -63,7 +78,7 @@
}
- export interface KarimFieldPropsTime {
+ export interface ValidationFieldPropsTime {
name: string;
type: "Time";
label?: string;
@@ -75,7 +90,7 @@
}
- export interface KarimFieldPropsFile {
+ export interface ValidationFieldPropsFile {
name: string;
type: "File" | "MaltyFile";
placeholder?: string;
@@ -86,7 +101,7 @@
dir?:'ltr' | "rtl"
}
- export interface KarimFieldPropsCheckbox {
+ export interface ValidationFieldPropsCheckbox {
name: string;
type: "Checkbox";
label?: string;
@@ -97,7 +112,7 @@
Group?: boolean
}
- export interface KarimFieldPropstext {
+ export interface ValidationFieldPropstext {
name: string;
type?: "text" | "number" | "password";
label?: string;
@@ -111,4 +126,4 @@
}
- export type KarimFieldProps = KarimFieldPropsText| KarimFieldPropsSelect| KarimFieldPropsDataRange| KarimFieldPropsDate| KarimFieldPropsTime| KarimFieldPropsFile| KarimFieldPropsCheckbox| KarimFieldPropstext;
+ export type ValidationFieldProps = ValidationFieldPropsText| ValidationFieldPropsSelect| ValidationFieldPropsDataRange| ValidationFieldPropsDate| ValidationFieldPropsTime| ValidationFieldPropsFile| ValidationFieldPropsCheckbox| ValidationFieldPropstext | ValidationFieldPropsSearch;
diff --git a/src/Extensions/FileGenerator/generateForm.js b/src/Extensions/FileGenerator/generateForm.js
index 2a1ea27..3558bd6 100644
--- a/src/Extensions/FileGenerator/generateForm.js
+++ b/src/Extensions/FileGenerator/generateForm.js
@@ -12,7 +12,7 @@ if (!fileName) {
let FileContiner = `
import React from 'react'
import { Col, Row } from 'reactstrap';
-import KarimField from '../../Components/Karimalden/KarimField';
+import ValidationField from '../../Components/ValidationField/ValidationField';
import { FakeSelectData } from '../../Layout/app/Const';
import { useFormikContext } from 'formik';
@@ -27,18 +27,18 @@ function Form${capitalizeFirstLetter(fileName)}() {
// name from form utils
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
diff --git a/src/Hooks/isEmpty.tsx b/src/Hooks/isEmpty.tsx
new file mode 100644
index 0000000..e20a5fe
--- /dev/null
+++ b/src/Hooks/isEmpty.tsx
@@ -0,0 +1,3 @@
+export const isEmpty = (Type:any) => {
+ return !Type || (Array.isArray(Type) && Type.length === 0);
+ };
\ No newline at end of file
diff --git a/src/Hooks/useFormatToSelect.tsx b/src/Hooks/useFormatToSelect.tsx
new file mode 100644
index 0000000..74fe0f2
--- /dev/null
+++ b/src/Hooks/useFormatToSelect.tsx
@@ -0,0 +1,14 @@
+const useFormatToSelect = (Data : any) => {
+ const format = (data :any) => {
+ if (!data) return [];
+ return data.map((item :any) => ({
+ value: item?.id,
+ label: item?.name,
+ }));
+ };
+
+ return format(Data);
+ };
+
+ export default useFormatToSelect;
+
\ No newline at end of file
diff --git a/src/Hooks/usePagination.tsx b/src/Hooks/usePagination.tsx
index 4eabc74..3654bb3 100644
--- a/src/Hooks/usePagination.tsx
+++ b/src/Hooks/usePagination.tsx
@@ -1,4 +1,5 @@
import { Pagination } from "antd";
+import { useTranslation } from "react-i18next";
import { useLocation, useNavigate, useSearchParams } from "react-router-dom";
export const PaginationBody = ({ data }: any) => {
@@ -6,29 +7,32 @@ export const PaginationBody = ({ data }: any) => {
const location = useLocation();
const pagination = location?.search || '';
const currentPage = parseInt(new URLSearchParams(location.search).get("page") || "1", 10);
- const pageSize = parseInt(new URLSearchParams(location.search).get("per_page") || "8", 10);
+ const pageSize = parseInt(new URLSearchParams(location.search).get("per_page") || "15", 10);
const [searchParams] = useSearchParams()
const onChange = (page: number, pageSize?: number) => {
- navigate(`?page=${page}&per_page=${pageSize || data?.per_page}&search=${searchParams.get('search')}`, { replace: true });
+ navigate(`?page=${page}&per_page=${pageSize || data?.per_page}`, { replace: true });
};
const onShowSizeChange = (current: number, pageSize: number) => {
- navigate(`?page=${current}&per_page=${pageSize}&search=${searchParams.get('search')}`, { replace: true });
+ navigate(`?page=${current}&per_page=${pageSize}`, { replace: true });
};
-
+ const [t] = useTranslation()
return (
`Total ${total} items`}
+ showTotal={(total: any) => `${t(`Total`)} ${total} ${t(`items`)}`}
pageSize={pageSize}
- pageSizeOptions={[8, 16, 24, 32, 40]}
+ pageSizeOptions={[6, 15, 22, 30]}
defaultCurrent={currentPage}
- current={currentPage} // Adding this line will set the current page correctly
+ current={currentPage}
onChange={onChange}
onShowSizeChange={onShowSizeChange}
+ // showQuickJumper
+ showSizeChanger
+
/>
);
};
diff --git a/src/Layout/app/Header.tsx b/src/Layout/app/Header.tsx
index 894088c..d3af37e 100644
--- a/src/Layout/app/Header.tsx
+++ b/src/Layout/app/Header.tsx
@@ -49,7 +49,7 @@ const Header = () => {
-
+ {/*
*/}