This commit is contained in:
Malai Raja
2024-01-06 19:23:37 +05:30
parent da4b95297d
commit 92cc1445ea
8 changed files with 1755 additions and 1 deletions

Submodule nearlexpressbuild updated: 808807828a...7bbcc4548e

27
package-lock.json generated
View File

@@ -21,6 +21,7 @@
"@reduxjs/toolkit": "^1.9.5", "@reduxjs/toolkit": "^1.9.5",
"@svgr/webpack": "^7.0.0", "@svgr/webpack": "^7.0.0",
"antd": "^5.11.5", "antd": "^5.11.5",
"autosuggest-highlight": "^3.3.4",
"axios": "^1.3.5", "axios": "^1.3.5",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"chance": "^1.1.11", "chance": "^1.1.11",
@@ -5915,6 +5916,14 @@
"postcss": "^8.1.0" "postcss": "^8.1.0"
} }
}, },
"node_modules/autosuggest-highlight": {
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/autosuggest-highlight/-/autosuggest-highlight-3.3.4.tgz",
"integrity": "sha512-j6RETBD2xYnrVcoV1S5R4t3WxOlWZKyDQjkwnggDPSjF5L4jV98ZltBpvPvbkM1HtoSe5o+bNrTHyjPbieGeYA==",
"dependencies": {
"remove-accents": "^0.4.2"
}
},
"node_modules/available-typed-arrays": { "node_modules/available-typed-arrays": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz",
@@ -17617,6 +17626,11 @@
"node": ">= 0.10" "node": ">= 0.10"
} }
}, },
"node_modules/remove-accents": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/remove-accents/-/remove-accents-0.4.4.tgz",
"integrity": "sha512-EpFcOa/ISetVHEXqu+VwI96KZBmq+a8LJnGkaeFw45epGlxIZz5dhEEnNZMsQXgORu3qaMoLX4qJCzOik6ytAg=="
},
"node_modules/renderkid": { "node_modules/renderkid": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/renderkid/-/renderkid-3.0.0.tgz", "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-3.0.0.tgz",
@@ -24370,6 +24384,14 @@
"postcss-value-parser": "^4.2.0" "postcss-value-parser": "^4.2.0"
} }
}, },
"autosuggest-highlight": {
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/autosuggest-highlight/-/autosuggest-highlight-3.3.4.tgz",
"integrity": "sha512-j6RETBD2xYnrVcoV1S5R4t3WxOlWZKyDQjkwnggDPSjF5L4jV98ZltBpvPvbkM1HtoSe5o+bNrTHyjPbieGeYA==",
"requires": {
"remove-accents": "^0.4.2"
}
},
"available-typed-arrays": { "available-typed-arrays": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz",
@@ -32632,6 +32654,11 @@
"resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz",
"integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==" "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog=="
}, },
"remove-accents": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/remove-accents/-/remove-accents-0.4.4.tgz",
"integrity": "sha512-EpFcOa/ISetVHEXqu+VwI96KZBmq+a8LJnGkaeFw45epGlxIZz5dhEEnNZMsQXgORu3qaMoLX4qJCzOik6ytAg=="
},
"renderkid": { "renderkid": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/renderkid/-/renderkid-3.0.0.tgz", "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-3.0.0.tgz",

View File

@@ -16,6 +16,7 @@
"@reduxjs/toolkit": "^1.9.5", "@reduxjs/toolkit": "^1.9.5",
"@svgr/webpack": "^7.0.0", "@svgr/webpack": "^7.0.0",
"antd": "^5.11.5", "antd": "^5.11.5",
"autosuggest-highlight": "^3.3.4",
"axios": "^1.3.5", "axios": "^1.3.5",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"chance": "^1.1.11", "chance": "^1.1.11",

View File

@@ -64,6 +64,7 @@ const Profile = () => {
localStorage.removeItem('authname'); localStorage.removeItem('authname');
localStorage.removeItem('roleid'); localStorage.removeItem('roleid');
localStorage.removeItem('tenantid'); localStorage.removeItem('tenantid');
localStorage.clear();
navigate('/login') navigate('/login')

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,156 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import TextField from '@mui/material/TextField';
import Autocomplete from '@mui/material/Autocomplete';
import LocationOnIcon from '@mui/icons-material/LocationOn';
import Grid from '@mui/material/Grid';
import Typography from '@mui/material/Typography';
import parse from 'autosuggest-highlight/parse';
import { debounce } from '@mui/material/utils';
// This key was created specifically for the demo in mui.com.
// You need to create a new one for your application.
const GOOGLE_MAPS_API_KEY ='AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8';
function loadScript(src, position, id) {
if (!position) {
return;
}
const script = document.createElement('script');
script.setAttribute('async', '');
script.setAttribute('id', id);
script.src = src;
position.appendChild(script);
}
const autocompleteService = { current: null };
export default function GoogleMaps() {
const [value, setValue] = React.useState(null);
const [inputValue, setInputValue] = React.useState('');
const [options, setOptions] = React.useState([]);
const loaded = React.useRef(false);
if (typeof window !== 'undefined' && !loaded.current) {
if (!document.querySelector('#google-maps')) {
loadScript(
`https://maps.googleapis.com/maps/api/js?key=${GOOGLE_MAPS_API_KEY}&libraries=places`,
document.querySelector('head'),
'google-maps',
);
}
loaded.current = true;
}
const fetch = React.useMemo(
() =>
debounce((request, callback) => {
autocompleteService.current.getPlacePredictions(request, callback);
}, 400),
[],
);
React.useEffect(() => {
let active = true;
if (!autocompleteService.current && window.google) {
autocompleteService.current =
new window.google.maps.places.AutocompleteService();
}
if (!autocompleteService.current) {
return undefined;
}
if (inputValue === '') {
setOptions(value ? [value] : []);
return undefined;
}
fetch({ input: inputValue }, (results) => {
if (active) {
let newOptions = [];
if (value) {
newOptions = [value];
}
if (results) {
newOptions = [...newOptions, ...results];
}
setOptions(newOptions);
}
});
return () => {
active = false;
};
}, [value, inputValue, fetch]);
return (
<Autocomplete
id="google-map-demo"
// sx={{ width: 300 }}
fullWidth
getOptionLabel={(option) =>
typeof option === 'string' ? option : option.description
}
filterOptions={(x) => x}
options={options}
autoComplete
includeInputInList
filterSelectedOptions
value={value}
noOptionsText="No locations"
onChange={(event, newValue) => {
setOptions(newValue ? [newValue, ...options] : options);
setValue(newValue);
}}
onInputChange={(event, newInputValue) => {
setInputValue(newInputValue);
}}
renderInput={(params) => (
<TextField {...params}
// label="Add a location"
placeholder='Address'
fullWidth />
)}
renderOption={(props, option) => {
const matches =
option.structured_formatting.main_text_matched_substrings || [];
const parts = parse(
option.structured_formatting.main_text,
matches.map((match) => [match.offset, match.offset + match.length]),
);
return (
<li {...props}>
<Grid container alignItems="center">
<Grid item sx={{ display: 'flex', width: 44 }}>
<LocationOnIcon sx={{ color: 'text.secondary' }} />
</Grid>
<Grid item sx={{ width: 'calc(100% - 44px)', wordWrap: 'break-word' }}>
{parts.map((part, index) => (
<Box
key={index}
component="span"
sx={{ fontWeight: part.highlight ? 'bold' : 'regular' }}
>
{part.text}
</Box>
))}
<Typography variant="body2" color="text.secondary">
{option.structured_formatting.secondary_text}
</Typography>
</Grid>
</Grid>
</li>
);
}}
/>
);
}

View File

@@ -28,6 +28,7 @@ const Accountsettings = Loadable(lazy(() => import('pages/nearle/accountsettings
const Createorder = Loadable(lazy(() => import('pages/nearle/orders/createorder'))); const Createorder = Loadable(lazy(() => import('pages/nearle/orders/createorder')));
const Createclient = Loadable(lazy(() => import('pages/nearle/clients/createclient'))); const Createclient = Loadable(lazy(() => import('pages/nearle/clients/createclient')));
const Createorder1 = Loadable(lazy(() => import('pages/nearle/orders/createorder1')));
@@ -72,6 +73,10 @@ const MainRoutes = {
path: 'orders/create', path: 'orders/create',
element: <Createorder /> element: <Createorder />
}, },
{
path: 'orders/create1',
element: <Createorder1 />
},
{ {
path: 'orders/details', path: 'orders/details',
element: <Details /> element: <Details />

View File

@@ -3302,6 +3302,13 @@ autoprefixer@^10.4.11:
picocolors "^1.0.0" picocolors "^1.0.0"
postcss-value-parser "^4.2.0" postcss-value-parser "^4.2.0"
autosuggest-highlight@^3.3.4:
version "3.3.4"
resolved "https://registry.npmjs.org/autosuggest-highlight/-/autosuggest-highlight-3.3.4.tgz"
integrity sha512-j6RETBD2xYnrVcoV1S5R4t3WxOlWZKyDQjkwnggDPSjF5L4jV98ZltBpvPvbkM1HtoSe5o+bNrTHyjPbieGeYA==
dependencies:
remove-accents "^0.4.2"
available-typed-arrays@^1.0.5: available-typed-arrays@^1.0.5:
version "1.0.5" version "1.0.5"
resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz" resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz"
@@ -9421,6 +9428,11 @@ relateurl@^0.2.7:
resolved "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz" resolved "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz"
integrity sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog== integrity sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==
remove-accents@^0.4.2:
version "0.4.4"
resolved "https://registry.npmjs.org/remove-accents/-/remove-accents-0.4.4.tgz"
integrity sha512-EpFcOa/ISetVHEXqu+VwI96KZBmq+a8LJnGkaeFw45epGlxIZz5dhEEnNZMsQXgORu3qaMoLX4qJCzOik6ytAg==
renderkid@^3.0.0: renderkid@^3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.npmjs.org/renderkid/-/renderkid-3.0.0.tgz" resolved "https://registry.npmjs.org/renderkid/-/renderkid-3.0.0.tgz"