@aclymatepackages/modules 5.0.0 → 5.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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.weak-map.js");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -7,10 +8,12 @@ exports.default = void 0;
|
|
|
7
8
|
require("core-js/modules/es.symbol.description.js");
|
|
8
9
|
require("core-js/modules/es.promise.js");
|
|
9
10
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
|
-
var _react = require("react");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _material = require("@mui/material");
|
|
12
13
|
var _atoms = require("@aclymatepackages/atoms");
|
|
13
14
|
var _otherHelpers = require("@aclymatepackages/other-helpers");
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
17
|
const IndustryAutocomplete = _ref => {
|
|
15
18
|
let {
|
|
16
19
|
industry,
|
|
@@ -48,31 +51,40 @@ const IndustryAutocomplete = _ref => {
|
|
|
48
51
|
const showCurrentChip = !!industryTitle && !naicsCodesOptions.length;
|
|
49
52
|
const showOptions = !!naicsCodesOptions.length;
|
|
50
53
|
const showSearchInput = !showCurrentChip && !showOptions;
|
|
51
|
-
return /*#__PURE__*/
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showSearchInput && /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
52
55
|
item: true
|
|
53
|
-
}, /*#__PURE__*/
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_atoms.SearchActionInput, {
|
|
54
57
|
label: questionText,
|
|
55
58
|
value: companyDescription,
|
|
56
59
|
setValue: setCompanyDescription,
|
|
57
60
|
searchLoading: loading,
|
|
58
61
|
searchFunction: onSearch
|
|
59
|
-
})), showCurrentChip && /*#__PURE__*/
|
|
62
|
+
})), showCurrentChip && /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
60
63
|
item: true,
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
container: true,
|
|
65
|
+
direction: "column",
|
|
66
|
+
spacing: 1
|
|
67
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
68
|
+
item: true
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
70
|
+
variant: "caption",
|
|
71
|
+
color: "textSecondary"
|
|
72
|
+
}, "Company Industry")), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
73
|
+
item: true
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Chip, {
|
|
63
75
|
label: (0, _otherHelpers.truncateText)(industryTitle, 50),
|
|
64
76
|
onDelete: onDeleteCurrentIndustry
|
|
65
|
-
})), showOptions && /*#__PURE__*/
|
|
77
|
+
}))), showOptions && /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
66
78
|
item: true,
|
|
67
79
|
container: true,
|
|
68
80
|
spacing: 2
|
|
69
|
-
}, /*#__PURE__*/
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
70
82
|
item: true,
|
|
71
83
|
xs: 12
|
|
72
|
-
}, /*#__PURE__*/
|
|
84
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
73
85
|
variant: "h6",
|
|
74
86
|
align: "center"
|
|
75
|
-
}, "Select your company's industry")), /*#__PURE__*/
|
|
87
|
+
}, "Select your company's industry")), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
76
88
|
item: true,
|
|
77
89
|
container: true,
|
|
78
90
|
justifyContent: "center",
|
|
@@ -83,10 +95,10 @@ const IndustryAutocomplete = _ref => {
|
|
|
83
95
|
description,
|
|
84
96
|
tonsCo2ePerDollar
|
|
85
97
|
} = _ref3;
|
|
86
|
-
return /*#__PURE__*/
|
|
98
|
+
return /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
87
99
|
item: true,
|
|
88
100
|
key: "naics-chip-".concat(idx)
|
|
89
|
-
}, /*#__PURE__*/
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement(_atoms.DefaultSelectableChip, {
|
|
90
102
|
label: (0, _otherHelpers.truncateText)(description, 50),
|
|
91
103
|
onClick: () => onSelectOption({
|
|
92
104
|
code,
|
|
@@ -95,13 +107,13 @@ const IndustryAutocomplete = _ref => {
|
|
|
95
107
|
}),
|
|
96
108
|
isSelected: (industry === null || industry === void 0 ? void 0 : industry.naicsCode) === code
|
|
97
109
|
}));
|
|
98
|
-
})), /*#__PURE__*/
|
|
110
|
+
})), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
99
111
|
item: true,
|
|
100
112
|
container: true,
|
|
101
113
|
justifyContent: "center"
|
|
102
|
-
}, /*#__PURE__*/
|
|
114
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
103
115
|
item: true
|
|
104
|
-
}, /*#__PURE__*/
|
|
116
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Button, {
|
|
105
117
|
color: "primary",
|
|
106
118
|
onClick: () => setNaicsCodesOptions([])
|
|
107
119
|
}, "Choose Different Categories")))));
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
|
|
3
3
|
import { Grid, Typography, Chip, Button } from "@mui/material";
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
DefaultSelectableChip,
|
|
7
|
-
SearchActionInput
|
|
7
|
+
SearchActionInput,
|
|
8
8
|
} from "@aclymatepackages/atoms";
|
|
9
9
|
import { truncateText } from "@aclymatepackages/other-helpers";
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ const IndustryAutocomplete = ({
|
|
|
12
12
|
industry,
|
|
13
13
|
setIndustry,
|
|
14
14
|
fetchNaicsCodes,
|
|
15
|
-
questionText = "What does your company do?"
|
|
15
|
+
questionText = "What does your company do?",
|
|
16
16
|
}) => {
|
|
17
17
|
const [loading, setLoading] = useState(false);
|
|
18
18
|
const [naicsCodesOptions, setNaicsCodesOptions] = useState([]);
|
|
@@ -28,7 +28,11 @@ const IndustryAutocomplete = ({
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const onSelectOption = ({ code, description, tonsCo2ePerDollar }) => {
|
|
31
|
-
setIndustry({
|
|
31
|
+
setIndustry({
|
|
32
|
+
naicsCode: code,
|
|
33
|
+
naicsTitle: description,
|
|
34
|
+
tonsCo2ePerDollar,
|
|
35
|
+
});
|
|
32
36
|
setNaicsCodesOptions([]);
|
|
33
37
|
};
|
|
34
38
|
|
|
@@ -55,11 +59,18 @@ const IndustryAutocomplete = ({
|
|
|
55
59
|
</Grid>
|
|
56
60
|
)}
|
|
57
61
|
{showCurrentChip && (
|
|
58
|
-
<Grid item
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
<Grid item container direction="column" spacing={1}>
|
|
63
|
+
<Grid item>
|
|
64
|
+
<Typography variant="caption" color="textSecondary">
|
|
65
|
+
Company Industry
|
|
66
|
+
</Typography>
|
|
67
|
+
</Grid>
|
|
68
|
+
<Grid item>
|
|
69
|
+
<Chip
|
|
70
|
+
label={truncateText(industryTitle, 50)}
|
|
71
|
+
onDelete={onDeleteCurrentIndustry}
|
|
72
|
+
/>
|
|
73
|
+
</Grid>
|
|
63
74
|
</Grid>
|
|
64
75
|
)}
|
|
65
76
|
{showOptions && (
|
|
@@ -81,7 +92,7 @@ const IndustryAutocomplete = ({
|
|
|
81
92
|
isSelected={industry?.naicsCode === code}
|
|
82
93
|
/>
|
|
83
94
|
</Grid>
|
|
84
|
-
)
|
|
95
|
+
),
|
|
85
96
|
)}
|
|
86
97
|
</Grid>
|
|
87
98
|
<Grid item container justifyContent="center">
|