@zgfe/modules-event 0.1.7 → 0.1.8-alpha.0

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.
@@ -16,7 +16,8 @@ import './styles/index.less';
16
16
  var classPrefix = 'search-panel';
17
17
  var SearchPanel = function SearchPanel(props) {
18
18
  var _useContext = useContext(EventContext),
19
- includeToday = _useContext.includeToday;
19
+ includeToday = _useContext.includeToday,
20
+ searchData = _useContext.searchData;
20
21
  var _useState = useState(props.time || getInitDate(includeToday)),
21
22
  _useState2 = _slicedToArray(_useState, 2),
22
23
  time = _useState2[0],
@@ -36,30 +37,30 @@ var SearchPanel = function SearchPanel(props) {
36
37
  dimension = _useState8[0],
37
38
  setDimension = _useState8[1];
38
39
  useEffect(function () {
39
- if (props.chartType && props.chartType !== chart.value) {
40
- if (props.chartType.indexOf(',') !== -1) {
40
+ if (searchData.chartType && searchData.chartType !== chart.value) {
41
+ if (searchData.chartType.indexOf(',') !== -1) {
41
42
  setChart({
42
- value: props.chartType.split(',')[0]
43
+ value: searchData.chartType.split(',')[0]
43
44
  });
44
45
  } else {
45
46
  setChart({
46
- value: props.chartType
47
+ value: searchData.chartType
47
48
  });
48
49
  }
49
50
  }
50
51
  var _dimension = {
51
52
  analysisIndex: 'number'
52
53
  };
53
- if (props.analysisIndex) {
54
+ if (searchData.analysisIndex) {
54
55
  _dimension = {
55
- analysisIndex: props.analysisIndex
56
+ analysisIndex: searchData.analysisIndex
56
57
  };
57
58
  }
58
- if (props.analysisAttr) {
59
- _dimension['analysisAttr'] = props.analysisAttr;
59
+ if (searchData.analysisAttr) {
60
+ _dimension['analysisAttr'] = searchData.analysisAttr;
60
61
  }
61
62
  setDimension(_objectSpread({}, _dimension));
62
- }, []);
63
+ }, [searchData]);
63
64
  useEffect(function () {
64
65
  if (!props.enableSelectChart && chart.value === 'map') {
65
66
  setChart({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-event",
3
- "version": "0.1.7",
3
+ "version": "0.1.8-alpha.0",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -49,7 +49,7 @@
49
49
  "react": "^16.12.0 || ^17.0.0",
50
50
  "yorkie": "^2.0.0"
51
51
  },
52
- "gitHead": "503e6bdfdefb7bf6e99cb74290273bf2b8e8dec0",
52
+ "gitHead": "407c01609bf6d86be468b4ff1612dafd644cd983",
53
53
  "dependencies": {
54
54
  "react-copy-to-clipboard": "^5.1.0",
55
55
  "react-highlight": "^0.15.0"