@visns-studio/visns-components 1.5.1 → 1.5.3

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.
@@ -65,7 +65,15 @@ const VisnsAutocomplete = (props) => {
65
65
  });
66
66
 
67
67
  const handleItemClicked = (place) => {
68
- setSearch(place.address + " " + place.text);
68
+ const address =
69
+ place.address !== undefined && place.address !== null
70
+ ? place.address
71
+ : "";
72
+ const text =
73
+ place.text !== undefined && place.text !== null ? place.text : "";
74
+
75
+ const search = address && text ? `${address} ${text}` : text;
76
+ setSearch(search);
69
77
  setResults([]);
70
78
  onSelect(place, field);
71
79
  };
@@ -269,21 +269,18 @@ function Form(props) {
269
269
 
270
270
  const autocompleteSelect = (place, id) => {
271
271
  const { address, text, context } = place;
272
- const address1 = address !== undefined ? address + " " + text : text;
273
- let address2 = "";
274
- let suburb = "";
275
- let postcode = "";
276
- let state = "";
277
- let country = "";
278
-
279
- if (context[1]) {
280
- suburb = context[1].text;
281
- }
282
272
 
283
- if (context[0]) {
284
- postcode = context[0].text;
285
- }
273
+ const address1 = address
274
+ ? text
275
+ ? `${address} ${text}`
276
+ : address
277
+ : text;
278
+ const address2 = "";
279
+ const suburb = context[1]?.text || "";
280
+ const postcode = context[0]?.text || "";
286
281
 
282
+ let state = "";
283
+ let country = "";
287
284
  if (context.length === 5) {
288
285
  [state, country] = [context[3]?.text, context[4]?.text];
289
286
  } else {
@@ -299,34 +296,19 @@ function Form(props) {
299
296
  country,
300
297
  };
301
298
 
302
- if (formData.same_address === true) {
303
- setFormData((prevState) => ({
304
- ...prevState,
305
- ...formDataUpdate,
306
- postal_address1: address1,
307
- postal_address2: address2,
308
- postal_suburb: suburb,
309
- postal_postcode: postcode,
310
- postal_state: state,
311
- postal_country: country,
312
- }));
313
- } else if (id === "address1") {
314
- setFormData((prevState) => ({
315
- ...prevState,
316
- ...formDataUpdate,
317
- }));
318
- } else {
319
- setFormData((prevState) => ({
320
- ...prevState,
321
- ...formDataUpdate,
322
- postal_address1: address1,
323
- postal_address2: address2,
324
- postal_suburb: suburb,
325
- postal_postcode: postcode,
326
- postal_state: state,
327
- postal_country: country,
328
- }));
299
+ if (formData.same_address === true || id !== "address1") {
300
+ formDataUpdate.postal_address1 = address1;
301
+ formDataUpdate.postal_address2 = address2;
302
+ formDataUpdate.postal_suburb = suburb;
303
+ formDataUpdate.postal_postcode = postcode;
304
+ formDataUpdate.postal_state = state;
305
+ formDataUpdate.postal_country = country;
329
306
  }
307
+
308
+ setFormData((prevState) => ({
309
+ ...prevState,
310
+ ...formDataUpdate,
311
+ }));
330
312
  };
331
313
 
332
314
  const handleSubmit = (e) => {
@@ -1,10 +1,15 @@
1
1
  import React, { useEffect, useState } from "react";
2
2
  import { Link, useLocation } from "react-router-dom";
3
3
  import {
4
+ ArrowCycle,
5
+ BookClose,
4
6
  Bug,
7
+ Calendar,
8
+ Clipboard,
5
9
  DoubleSword,
6
10
  Draft,
7
11
  Grid,
12
+ LightBulb,
8
13
  PeopleGroup,
9
14
  Person,
10
15
  SettingsVertical,
@@ -33,6 +38,7 @@ function Navigation({ logo, logout, navConfig, setSystemAuth, userProfile }) {
33
38
  const renderSetting = (n) => {
34
39
  const iconComponents = {
35
40
  bug: Bug,
41
+ calendar: Calendar,
36
42
  person: Person,
37
43
  shield: Shield,
38
44
  signOut: SignOut,
@@ -68,6 +74,7 @@ function Navigation({ logo, logout, navConfig, setSystemAuth, userProfile }) {
68
74
  data-tooltip-id="system-tooltip"
69
75
  data-tooltip-content={n.label}
70
76
  className="tooltip"
77
+ target={n.target ? n.target : "_self"}
71
78
  >
72
79
  <IconComponent size={19} strokeWidth={2} />
73
80
  </Link>
@@ -78,9 +85,14 @@ function Navigation({ logo, logout, navConfig, setSystemAuth, userProfile }) {
78
85
 
79
86
  const renderNav = (n) => {
80
87
  const iconComponents = {
88
+ arrowCycle: ArrowCycle,
89
+ bookClose: BookClose,
90
+ calendar: Calendar,
91
+ clipboard: Clipboard,
81
92
  doubleSword: DoubleSword,
82
93
  draft: Draft,
83
94
  grid: Grid,
95
+ lightBulb: LightBulb,
84
96
  peopleGroup: PeopleGroup,
85
97
  settingsVertical: SettingsVertical,
86
98
  ticket: Ticket,
package/package.json CHANGED
@@ -1,55 +1,55 @@
1
1
  {
2
- "dependencies": {
3
- "@inovua/reactdatagrid-community": "^5.9.4",
4
- "@inovua/reactdatagrid-enterprise": "^5.9.4",
5
- "akar-icons": "^1.9.28",
6
- "awesome-debounce-promise": "^2.1.0",
7
- "axios": "^1.4.0",
8
- "framer-motion": "^10.12.16",
9
- "html-react-parser": "^4.0.0",
10
- "lodash": "^4.17.21",
11
- "moment": "^2.29.4",
12
- "numeral": "^2.0.6",
13
- "quill-image-uploader": "^1.3.0",
14
- "react-confirm-alert": "^3.0.6",
15
- "react-datepicker": "^4.14.0",
16
- "react-dropzone": "^14.2.3",
17
- "react-number-format": "^5.2.2",
18
- "react-promise-tracker": "^2.1.1",
19
- "react-quill": "^2.0.0",
20
- "react-select": "^5.7.3",
21
- "react-slugify": "^3.0.2",
22
- "react-sortable-hoc": "^2.0.0",
23
- "react-toastify": "^9.1.3",
24
- "react-toggle": "^4.1.3",
25
- "react-tooltip": "^5.14.0",
26
- "react-window": "^1.8.9",
27
- "reactjs-popup": "^2.0.5"
28
- },
29
- "devDependecies": {
30
- "react": "^18.2.0",
31
- "react-dom": "^18.2.0"
32
- },
33
- "peerDependencies": {
34
- "react": "^17.0.1",
35
- "react-dom": "^17.0.1"
36
- },
37
- "name": "@visns-studio/visns-components",
38
- "version": "1.5.1",
39
- "description": "Various packages to assist in the development of our Custom Applications.",
40
- "main": "index.js",
41
- "devDependencies": {},
42
- "scripts": {
43
- "test": "echo \"Error: no test specified\" && exit 1"
44
- },
45
- "repository": {
46
- "type": "git",
47
- "url": "git+https://github.com/visnsstudio/visns-components.git"
48
- },
49
- "author": "Visns Studio",
50
- "license": "ISC",
51
- "bugs": {
52
- "url": "https://github.com/visnsstudio/visns-components/issues"
53
- },
54
- "homepage": "https://github.com/visnsstudio/visns-components#readme"
2
+ "dependencies": {
3
+ "@inovua/reactdatagrid-community": "^5.9.4",
4
+ "@inovua/reactdatagrid-enterprise": "^5.9.4",
5
+ "akar-icons": "^1.9.28",
6
+ "awesome-debounce-promise": "^2.1.0",
7
+ "axios": "^1.4.0",
8
+ "framer-motion": "^10.12.16",
9
+ "html-react-parser": "^4.0.0",
10
+ "lodash": "^4.17.21",
11
+ "moment": "^2.29.4",
12
+ "numeral": "^2.0.6",
13
+ "quill-image-uploader": "^1.3.0",
14
+ "react-confirm-alert": "^3.0.6",
15
+ "react-datepicker": "^4.14.0",
16
+ "react-dropzone": "^14.2.3",
17
+ "react-number-format": "^5.2.2",
18
+ "react-promise-tracker": "^2.1.1",
19
+ "react-quill": "^2.0.0",
20
+ "react-select": "^5.7.3",
21
+ "react-slugify": "^3.0.2",
22
+ "react-sortable-hoc": "^2.0.0",
23
+ "react-toastify": "^9.1.3",
24
+ "react-toggle": "^4.1.3",
25
+ "react-tooltip": "^5.14.0",
26
+ "react-window": "^1.8.9",
27
+ "reactjs-popup": "^2.0.5"
28
+ },
29
+ "devDependecies": {
30
+ "react": "^18.2.0",
31
+ "react-dom": "^18.2.0"
32
+ },
33
+ "peerDependencies": {
34
+ "react": "^17.0.1",
35
+ "react-dom": "^17.0.1"
36
+ },
37
+ "name": "@visns-studio/visns-components",
38
+ "version": "1.5.3",
39
+ "description": "Various packages to assist in the development of our Custom Applications.",
40
+ "main": "index.js",
41
+ "devDependencies": {},
42
+ "scripts": {
43
+ "test": "echo \"Error: no test specified\" && exit 1"
44
+ },
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/visnsstudio/visns-components.git"
48
+ },
49
+ "author": "Visns Studio",
50
+ "license": "ISC",
51
+ "bugs": {
52
+ "url": "https://github.com/visnsstudio/visns-components/issues"
53
+ },
54
+ "homepage": "https://github.com/visnsstudio/visns-components#readme"
55
55
  }