@aclymatepackages/modules 2.4.1 → 2.4.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.
@@ -14,7 +14,7 @@ var _atoms = require("@aclymatepackages/atoms");
14
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
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
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; }
17
- const PdlCompanySelect = _ref => {
17
+ const PdlCompanySelectModule = _ref => {
18
18
  let {
19
19
  onCompanyNotFound,
20
20
  onCompanySelected,
@@ -28,8 +28,8 @@ const PdlCompanySelect = _ref => {
28
28
  const [matchingCompanies, setMatchingCompanies] = (0, _react.useState)([]);
29
29
  const [inputComplete, setInputComplete] = (0, _react.useState)(false);
30
30
  const [pdlFetchLoading, setPdlFetchLoading] = (0, _react.useState)(false);
31
- const [selectedCompanyId, setSelectedCompanyId] = (0, _react.useState)(null);
32
31
  const [nextStepLoading, setNextStepLoading] = (0, _react.useState)(false);
32
+ const [selectedCompany, setSelectedCompany] = (0, _react.useState)(null);
33
33
  const fetchMatchingCompanies = async () => {
34
34
  setPdlFetchLoading(true);
35
35
  const matchingCompanies = await matchingFunction(inputValue);
@@ -46,12 +46,6 @@ const PdlCompanySelect = _ref => {
46
46
  await onCompanySelected(companyId, name);
47
47
  return onSelectClick();
48
48
  };
49
- const selectedCompany = matchingCompanies.find(_ref2 => {
50
- let {
51
- id
52
- } = _ref2;
53
- return selectedCompanyId === id;
54
- });
55
49
  return /*#__PURE__*/_react.default.createElement(_material.Grid, {
56
50
  container: true,
57
51
  spacing: 2,
@@ -63,10 +57,10 @@ const PdlCompanySelect = _ref => {
63
57
  label: label,
64
58
  value: inputValue,
65
59
  setValue: setInputValue,
66
- onKeyPress: _ref3 => {
60
+ onKeyPress: _ref2 => {
67
61
  let {
68
62
  key
69
- } = _ref3;
63
+ } = _ref2;
70
64
  if (key === "Enter") {
71
65
  return fetchMatchingCompanies();
72
66
  }
@@ -93,8 +87,8 @@ const PdlCompanySelect = _ref => {
93
87
  item: true
94
88
  }, /*#__PURE__*/_react.default.createElement(_atoms.MatchingCompanyChips, {
95
89
  matchingCompanies: matchingCompanies,
96
- selectedCompanyId: selectedCompanyId,
97
- setSelectedCompanyId: setSelectedCompanyId
90
+ selectedCompany: selectedCompany,
91
+ setSelectedCompany: setSelectedCompany
98
92
  })), /*#__PURE__*/_react.default.createElement(_material.Grid, {
99
93
  item: true,
100
94
  container: true,
@@ -102,7 +96,7 @@ const PdlCompanySelect = _ref => {
102
96
  justifyContent: "center"
103
97
  }, /*#__PURE__*/_react.default.createElement(_material.Grid, {
104
98
  item: true
105
- }, selectedCompanyId ? /*#__PURE__*/_react.default.createElement(_atoms.LoadingButton, {
99
+ }, selectedCompany ? /*#__PURE__*/_react.default.createElement(_atoms.LoadingButton, {
106
100
  isLoading: nextStepLoading,
107
101
  label: "Choose This Company",
108
102
  variant: "contained",
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@aclymatepackages/modules",
3
- "version": "2.4.1",
3
+ "version": "2.4.3",
4
4
  "description": "Aclymate modules",
5
5
  "author": "William Loopesko",
6
6
  "main": "dist/index.js",
7
7
  "dependencies": {
8
8
  "@aclymatepackages/array-immutability-helpers": "^1.0.0",
9
- "@aclymatepackages/atoms": "^3.3.2",
9
+ "@aclymatepackages/atoms": "^3.3.4",
10
10
  "@aclymatepackages/chart-helpers": "^2.0.8",
11
11
  "@aclymatepackages/converters": "^1.0.0",
12
12
  "@aclymatepackages/fetch-aclymate-api": "^1.0.0",
@@ -15,7 +15,7 @@ import {
15
15
  MatchingCompanyChips,
16
16
  } from "@aclymatepackages/atoms";
17
17
 
18
- const PdlCompanySelect = ({
18
+ const PdlCompanySelectModule = ({
19
19
  onCompanyNotFound,
20
20
  onCompanySelected,
21
21
  onSelectClick = () => {},
@@ -28,8 +28,8 @@ const PdlCompanySelect = ({
28
28
  const [matchingCompanies, setMatchingCompanies] = useState([]);
29
29
  const [inputComplete, setInputComplete] = useState(false);
30
30
  const [pdlFetchLoading, setPdlFetchLoading] = useState(false);
31
- const [selectedCompanyId, setSelectedCompanyId] = useState(null);
32
31
  const [nextStepLoading, setNextStepLoading] = useState(false);
32
+ const [selectedCompany, setSelectedCompany] = useState(null);
33
33
 
34
34
  const fetchMatchingCompanies = async () => {
35
35
  setPdlFetchLoading(true);
@@ -52,10 +52,6 @@ const PdlCompanySelect = ({
52
52
  return onSelectClick();
53
53
  };
54
54
 
55
- const selectedCompany = matchingCompanies.find(
56
- ({ id }) => selectedCompanyId === id
57
- );
58
-
59
55
  return (
60
56
  <Grid container spacing={2} direction="column">
61
57
  <Grid item>
@@ -102,13 +98,13 @@ const PdlCompanySelect = ({
102
98
  <Grid item>
103
99
  <MatchingCompanyChips
104
100
  matchingCompanies={matchingCompanies}
105
- selectedCompanyId={selectedCompanyId}
106
- setSelectedCompanyId={setSelectedCompanyId}
101
+ selectedCompany={selectedCompany}
102
+ setSelectedCompany={setSelectedCompany}
107
103
  />
108
104
  </Grid>
109
105
  <Grid item container spacing={2} justifyContent="center">
110
106
  <Grid item>
111
- {selectedCompanyId ? (
107
+ {selectedCompany ? (
112
108
  <LoadingButton
113
109
  isLoading={nextStepLoading}
114
110
  label="Choose This Company"