@aclymatepackages/modules 5.0.0 → 5.0.1
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,31 @@ 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
64
|
alignSelf: "center"
|
|
62
|
-
}, /*#__PURE__*/
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Chip, {
|
|
63
66
|
label: (0, _otherHelpers.truncateText)(industryTitle, 50),
|
|
64
67
|
onDelete: onDeleteCurrentIndustry
|
|
65
|
-
})), showOptions && /*#__PURE__*/
|
|
68
|
+
})), showOptions && /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
66
69
|
item: true,
|
|
67
70
|
container: true,
|
|
68
71
|
spacing: 2
|
|
69
|
-
}, /*#__PURE__*/
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
70
73
|
item: true,
|
|
71
74
|
xs: 12
|
|
72
|
-
}, /*#__PURE__*/
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
73
76
|
variant: "h6",
|
|
74
77
|
align: "center"
|
|
75
|
-
}, "Select your company's industry")), /*#__PURE__*/
|
|
78
|
+
}, "Select your company's industry")), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
76
79
|
item: true,
|
|
77
80
|
container: true,
|
|
78
81
|
justifyContent: "center",
|
|
@@ -83,10 +86,10 @@ const IndustryAutocomplete = _ref => {
|
|
|
83
86
|
description,
|
|
84
87
|
tonsCo2ePerDollar
|
|
85
88
|
} = _ref3;
|
|
86
|
-
return /*#__PURE__*/
|
|
89
|
+
return /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
87
90
|
item: true,
|
|
88
91
|
key: "naics-chip-".concat(idx)
|
|
89
|
-
}, /*#__PURE__*/
|
|
92
|
+
}, /*#__PURE__*/_react.default.createElement(_atoms.DefaultSelectableChip, {
|
|
90
93
|
label: (0, _otherHelpers.truncateText)(description, 50),
|
|
91
94
|
onClick: () => onSelectOption({
|
|
92
95
|
code,
|
|
@@ -95,13 +98,13 @@ const IndustryAutocomplete = _ref => {
|
|
|
95
98
|
}),
|
|
96
99
|
isSelected: (industry === null || industry === void 0 ? void 0 : industry.naicsCode) === code
|
|
97
100
|
}));
|
|
98
|
-
})), /*#__PURE__*/
|
|
101
|
+
})), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
99
102
|
item: true,
|
|
100
103
|
container: true,
|
|
101
104
|
justifyContent: "center"
|
|
102
|
-
}, /*#__PURE__*/
|
|
105
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
103
106
|
item: true
|
|
104
|
-
}, /*#__PURE__*/
|
|
107
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Button, {
|
|
105
108
|
color: "primary",
|
|
106
109
|
onClick: () => setNaicsCodesOptions([])
|
|
107
110
|
}, "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
|
|
|
@@ -81,7 +85,7 @@ const IndustryAutocomplete = ({
|
|
|
81
85
|
isSelected={industry?.naicsCode === code}
|
|
82
86
|
/>
|
|
83
87
|
</Grid>
|
|
84
|
-
)
|
|
88
|
+
),
|
|
85
89
|
)}
|
|
86
90
|
</Grid>
|
|
87
91
|
<Grid item container justifyContent="center">
|