@corpsmap/corpsmap 3.2.17 → 3.2.19
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.
package/lib/dev.js
CHANGED
|
@@ -1016,7 +1016,7 @@ var SouthRegion = /*#__PURE__*/function (_React$Component) {
|
|
|
1016
1016
|
id: "south-panel-content"
|
|
1017
1017
|
}, /*#__PURE__*/React$1__default.createElement("ul", {
|
|
1018
1018
|
className: "cm-nav cm-nav-tabs"
|
|
1019
|
-
}, southRegionChildren.
|
|
1019
|
+
}, southRegionChildren.map(function (child, i) {
|
|
1020
1020
|
var activeClass = classnames({
|
|
1021
1021
|
"active": i === activeTab
|
|
1022
1022
|
});
|
|
@@ -105849,6 +105849,7 @@ var southRegionBundle = {
|
|
|
105849
105849
|
|
|
105850
105850
|
for (var key in children) {
|
|
105851
105851
|
out.push(children[key]);
|
|
105852
|
+
out.unshift(out.pop());
|
|
105852
105853
|
}
|
|
105853
105854
|
|
|
105854
105855
|
return out;
|
|
@@ -106558,7 +106559,7 @@ var config = {
|
|
|
106558
106559
|
};
|
|
106559
106560
|
|
|
106560
106561
|
var name = "@corpsmap/corpsmap";
|
|
106561
|
-
var version$1 = "3.2.
|
|
106562
|
+
var version$1 = "3.2.19";
|
|
106562
106563
|
var description = "CorpsMap as React Components";
|
|
106563
106564
|
var main = "index.js";
|
|
106564
106565
|
var scripts = {
|
|
@@ -135565,7 +135566,8 @@ var SearchBar = /*#__PURE__*/function (_React$Component) {
|
|
|
135565
135566
|
|
|
135566
135567
|
_this = _super.call(this, props);
|
|
135567
135568
|
_this.state = {
|
|
135568
|
-
selectedIdx: null
|
|
135569
|
+
selectedIdx: null,
|
|
135570
|
+
currentVal: ""
|
|
135569
135571
|
};
|
|
135570
135572
|
_this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
|
|
135571
135573
|
_this.fireSearch = _this.fireSearch.bind(_assertThisInitialized(_this));
|
|
@@ -135587,16 +135589,22 @@ var SearchBar = /*#__PURE__*/function (_React$Component) {
|
|
|
135587
135589
|
value: function handleChange(val) {
|
|
135588
135590
|
var doSearchSetQuery = this.props.doSearchSetQuery;
|
|
135589
135591
|
this.setState({
|
|
135590
|
-
selectedIdx: null
|
|
135592
|
+
selectedIdx: null,
|
|
135593
|
+
currentVal: val
|
|
135591
135594
|
});
|
|
135592
135595
|
doSearchSetQuery(val);
|
|
135593
|
-
|
|
135596
|
+
|
|
135597
|
+
if (val.length < 3) {
|
|
135598
|
+
return null;
|
|
135599
|
+
} else {
|
|
135600
|
+
this.debouncedSearch();
|
|
135601
|
+
}
|
|
135594
135602
|
}
|
|
135595
135603
|
}, {
|
|
135596
135604
|
key: "fireSearch",
|
|
135597
135605
|
value: function fireSearch() {
|
|
135598
135606
|
var doSearchShouldFire = this.props.doSearchShouldFire;
|
|
135599
|
-
doSearchShouldFire();
|
|
135607
|
+
doSearchShouldFire(this.state.currentVal);
|
|
135600
135608
|
}
|
|
135601
135609
|
}, {
|
|
135602
135610
|
key: "handleKeyUp",
|
|
@@ -135635,11 +135643,15 @@ var SearchBar = /*#__PURE__*/function (_React$Component) {
|
|
|
135635
135643
|
var _classnames,
|
|
135636
135644
|
_this2 = this;
|
|
135637
135645
|
|
|
135638
|
-
var
|
|
135646
|
+
var _this$state = this.state,
|
|
135647
|
+
selectedIdx = _this$state.selectedIdx,
|
|
135648
|
+
currentVal = _this$state.currentVal;
|
|
135639
135649
|
var _this$props = this.props,
|
|
135640
135650
|
theme = _this$props.theme,
|
|
135641
135651
|
searchResults = _this$props.searchResults,
|
|
135642
135652
|
searchQueryString = _this$props.searchQueryString;
|
|
135653
|
+
var emptyArry = [];
|
|
135654
|
+
var optSearchResults = currentVal < 2 ? emptyArry : searchResults;
|
|
135643
135655
|
var containerClass = classnames((_classnames = {}, _defineProperty(_classnames, theme, true), _defineProperty(_classnames, "cm-btn-group", true), _classnames));
|
|
135644
135656
|
return /*#__PURE__*/React$1__default.createElement("div", null, /*#__PURE__*/React$1__default.createElement("div", {
|
|
135645
135657
|
className: containerClass,
|
|
@@ -135660,7 +135672,7 @@ var SearchBar = /*#__PURE__*/function (_React$Component) {
|
|
|
135660
135672
|
_this2.searchResultsList = el;
|
|
135661
135673
|
},
|
|
135662
135674
|
onItemClick: this.handleItemClick,
|
|
135663
|
-
items:
|
|
135675
|
+
items: optSearchResults,
|
|
135664
135676
|
selectedIdx: selectedIdx
|
|
135665
135677
|
}));
|
|
135666
135678
|
}
|
package/lib/prod.js
CHANGED
|
@@ -1016,7 +1016,7 @@ var SouthRegion = /*#__PURE__*/function (_React$Component) {
|
|
|
1016
1016
|
id: "south-panel-content"
|
|
1017
1017
|
}, /*#__PURE__*/React$1__default.createElement("ul", {
|
|
1018
1018
|
className: "cm-nav cm-nav-tabs"
|
|
1019
|
-
}, southRegionChildren.
|
|
1019
|
+
}, southRegionChildren.map(function (child, i) {
|
|
1020
1020
|
var activeClass = classnames({
|
|
1021
1021
|
"active": i === activeTab
|
|
1022
1022
|
});
|
|
@@ -105763,6 +105763,7 @@ var southRegionBundle = {
|
|
|
105763
105763
|
|
|
105764
105764
|
for (var key in children) {
|
|
105765
105765
|
out.push(children[key]);
|
|
105766
|
+
out.unshift(out.pop());
|
|
105766
105767
|
}
|
|
105767
105768
|
|
|
105768
105769
|
return out;
|
|
@@ -106472,7 +106473,7 @@ var config = {
|
|
|
106472
106473
|
};
|
|
106473
106474
|
|
|
106474
106475
|
var name = "@corpsmap/corpsmap";
|
|
106475
|
-
var version$1 = "3.2.
|
|
106476
|
+
var version$1 = "3.2.19";
|
|
106476
106477
|
var description = "CorpsMap as React Components";
|
|
106477
106478
|
var main = "index.js";
|
|
106478
106479
|
var scripts = {
|
|
@@ -135479,7 +135480,8 @@ var SearchBar = /*#__PURE__*/function (_React$Component) {
|
|
|
135479
135480
|
|
|
135480
135481
|
_this = _super.call(this, props);
|
|
135481
135482
|
_this.state = {
|
|
135482
|
-
selectedIdx: null
|
|
135483
|
+
selectedIdx: null,
|
|
135484
|
+
currentVal: ""
|
|
135483
135485
|
};
|
|
135484
135486
|
_this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
|
|
135485
135487
|
_this.fireSearch = _this.fireSearch.bind(_assertThisInitialized(_this));
|
|
@@ -135501,16 +135503,22 @@ var SearchBar = /*#__PURE__*/function (_React$Component) {
|
|
|
135501
135503
|
value: function handleChange(val) {
|
|
135502
135504
|
var doSearchSetQuery = this.props.doSearchSetQuery;
|
|
135503
135505
|
this.setState({
|
|
135504
|
-
selectedIdx: null
|
|
135506
|
+
selectedIdx: null,
|
|
135507
|
+
currentVal: val
|
|
135505
135508
|
});
|
|
135506
135509
|
doSearchSetQuery(val);
|
|
135507
|
-
|
|
135510
|
+
|
|
135511
|
+
if (val.length < 3) {
|
|
135512
|
+
return null;
|
|
135513
|
+
} else {
|
|
135514
|
+
this.debouncedSearch();
|
|
135515
|
+
}
|
|
135508
135516
|
}
|
|
135509
135517
|
}, {
|
|
135510
135518
|
key: "fireSearch",
|
|
135511
135519
|
value: function fireSearch() {
|
|
135512
135520
|
var doSearchShouldFire = this.props.doSearchShouldFire;
|
|
135513
|
-
doSearchShouldFire();
|
|
135521
|
+
doSearchShouldFire(this.state.currentVal);
|
|
135514
135522
|
}
|
|
135515
135523
|
}, {
|
|
135516
135524
|
key: "handleKeyUp",
|
|
@@ -135549,11 +135557,15 @@ var SearchBar = /*#__PURE__*/function (_React$Component) {
|
|
|
135549
135557
|
var _classnames,
|
|
135550
135558
|
_this2 = this;
|
|
135551
135559
|
|
|
135552
|
-
var
|
|
135560
|
+
var _this$state = this.state,
|
|
135561
|
+
selectedIdx = _this$state.selectedIdx,
|
|
135562
|
+
currentVal = _this$state.currentVal;
|
|
135553
135563
|
var _this$props = this.props,
|
|
135554
135564
|
theme = _this$props.theme,
|
|
135555
135565
|
searchResults = _this$props.searchResults,
|
|
135556
135566
|
searchQueryString = _this$props.searchQueryString;
|
|
135567
|
+
var emptyArry = [];
|
|
135568
|
+
var optSearchResults = currentVal < 2 ? emptyArry : searchResults;
|
|
135557
135569
|
var containerClass = classnames((_classnames = {}, _defineProperty(_classnames, theme, true), _defineProperty(_classnames, "cm-btn-group", true), _classnames));
|
|
135558
135570
|
return /*#__PURE__*/React$1__default.createElement("div", null, /*#__PURE__*/React$1__default.createElement("div", {
|
|
135559
135571
|
className: containerClass,
|
|
@@ -135574,7 +135586,7 @@ var SearchBar = /*#__PURE__*/function (_React$Component) {
|
|
|
135574
135586
|
_this2.searchResultsList = el;
|
|
135575
135587
|
},
|
|
135576
135588
|
onItemClick: this.handleItemClick,
|
|
135577
|
-
items:
|
|
135589
|
+
items: optSearchResults,
|
|
135578
135590
|
selectedIdx: selectedIdx
|
|
135579
135591
|
}));
|
|
135580
135592
|
}
|
package/package.json
CHANGED
|
@@ -34,7 +34,6 @@ export default {
|
|
|
34
34
|
},
|
|
35
35
|
});
|
|
36
36
|
},
|
|
37
|
-
|
|
38
37
|
doSouthRegionClose: () => ({ dispatch, store }) => {
|
|
39
38
|
dispatch({
|
|
40
39
|
type: "SOUTH_REGION_CLOSED",
|
|
@@ -68,13 +67,14 @@ export default {
|
|
|
68
67
|
selectSouthRegionChildrenObj: (state) => {
|
|
69
68
|
return state.southRegion.children;
|
|
70
69
|
},
|
|
71
|
-
|
|
70
|
+
|
|
72
71
|
selectSouthRegionChildren: createSelector(
|
|
73
72
|
"selectSouthRegionChildrenObj",
|
|
74
73
|
(children) => {
|
|
75
74
|
const out = [];
|
|
76
75
|
for (var key in children) {
|
|
77
76
|
out.push(children[key]);
|
|
77
|
+
out.unshift(out.pop());
|
|
78
78
|
}
|
|
79
79
|
return out;
|
|
80
80
|
}
|
|
@@ -84,4 +84,5 @@ export default {
|
|
|
84
84
|
if (state.southRegion._shouldTryToCloseRegion)
|
|
85
85
|
return { actionCreator: "doSouthRegionTryClose" };
|
|
86
86
|
},
|
|
87
|
+
|
|
87
88
|
};
|
|
@@ -31,8 +31,8 @@ class SouthRegion extends React.Component {
|
|
|
31
31
|
<div id="south-panel-content">
|
|
32
32
|
<ul className="cm-nav cm-nav-tabs">
|
|
33
33
|
{
|
|
34
|
-
southRegionChildren.
|
|
35
|
-
|
|
34
|
+
southRegionChildren.map((child, i) => {
|
|
35
|
+
|
|
36
36
|
const activeClass = classnames({
|
|
37
37
|
"active": i === activeTab
|
|
38
38
|
})
|
|
@@ -8,7 +8,8 @@ class SearchBar extends React.Component {
|
|
|
8
8
|
constructor(props) {
|
|
9
9
|
super(props);
|
|
10
10
|
this.state = {
|
|
11
|
-
selectedIdx: null
|
|
11
|
+
selectedIdx: null,
|
|
12
|
+
currentVal: ""
|
|
12
13
|
};
|
|
13
14
|
this.handleChange = this.handleChange.bind(this);
|
|
14
15
|
this.fireSearch = this.fireSearch.bind(this);
|
|
@@ -25,14 +26,19 @@ class SearchBar extends React.Component {
|
|
|
25
26
|
|
|
26
27
|
handleChange(val) {
|
|
27
28
|
const { doSearchSetQuery } = this.props;
|
|
28
|
-
this.setState({ selectedIdx: null });
|
|
29
|
+
this.setState({ selectedIdx: null , currentVal: val });
|
|
29
30
|
doSearchSetQuery(val);
|
|
30
|
-
if (val.length
|
|
31
|
+
if (val.length < 3){
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
else{
|
|
35
|
+
this.debouncedSearch();
|
|
36
|
+
}
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
fireSearch() {
|
|
34
40
|
const { doSearchShouldFire } = this.props;
|
|
35
|
-
doSearchShouldFire();
|
|
41
|
+
doSearchShouldFire(this.state.currentVal);
|
|
36
42
|
}
|
|
37
43
|
|
|
38
44
|
handleKeyUp(e) {
|
|
@@ -65,8 +71,10 @@ class SearchBar extends React.Component {
|
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
render() {
|
|
68
|
-
const { selectedIdx } = this.state;
|
|
69
|
-
const { theme, searchResults, searchQueryString
|
|
74
|
+
const { selectedIdx, currentVal} = this.state;
|
|
75
|
+
const { theme, searchResults, searchQueryString } = this.props;
|
|
76
|
+
const emptyArry = [];
|
|
77
|
+
let optSearchResults = currentVal < 2 ? emptyArry : searchResults
|
|
70
78
|
const containerClass = classnames({
|
|
71
79
|
[theme]: true,
|
|
72
80
|
"cm-btn-group": true
|
|
@@ -95,7 +103,7 @@ class SearchBar extends React.Component {
|
|
|
95
103
|
this.searchResultsList = el;
|
|
96
104
|
}}
|
|
97
105
|
onItemClick={this.handleItemClick}
|
|
98
|
-
items={
|
|
106
|
+
items={optSearchResults}
|
|
99
107
|
selectedIdx={selectedIdx}
|
|
100
108
|
/>
|
|
101
109
|
</div>
|