evui 3.3.41 → 3.3.43

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.
@@ -290,20 +290,6 @@ $({ target: 'Object', stat: true }, {
290
290
  });
291
291
 
292
292
 
293
- /***/ }),
294
-
295
- /***/ "08a2":
296
- /***/ (function(module, exports, __webpack_require__) {
297
-
298
- // Imports
299
- var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb");
300
- exports = ___CSS_LOADER_API_IMPORT___(false);
301
- // Module
302
- exports.push([module.i, ".ev-chart-group__wrapper[data-v-bd8c6660]{display:flex;height:100%;flex-direction:column}", ""]);
303
- // Exports
304
- module.exports = exports;
305
-
306
-
307
293
  /***/ }),
308
294
 
309
295
  /***/ "0924":
@@ -7575,6 +7561,17 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
7575
7561
  };
7576
7562
 
7577
7563
 
7564
+ /***/ }),
7565
+
7566
+ /***/ "7f2c":
7567
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
7568
+
7569
+ "use strict";
7570
+ /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_ChartGroup_vue_vue_type_style_index_0_id_2db10c44_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("97ea");
7571
+ /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_ChartGroup_vue_vue_type_style_index_0_id_2db10c44_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_ChartGroup_vue_vue_type_style_index_0_id_2db10c44_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
7572
+ /* unused harmony reexport * */
7573
+
7574
+
7578
7575
  /***/ }),
7579
7576
 
7580
7577
  /***/ "7f9a":
@@ -7638,17 +7635,6 @@ module.exports = function (it) {
7638
7635
  };
7639
7636
 
7640
7637
 
7641
- /***/ }),
7642
-
7643
- /***/ "8352":
7644
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
7645
-
7646
- "use strict";
7647
- /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_ChartGroup_vue_vue_type_style_index_0_id_bd8c6660_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("c920");
7648
- /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_ChartGroup_vue_vue_type_style_index_0_id_bd8c6660_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_ChartGroup_vue_vue_type_style_index_0_id_bd8c6660_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
7649
- /* unused harmony reexport * */
7650
-
7651
-
7652
7638
  /***/ }),
7653
7639
 
7654
7640
  /***/ "83ab":
@@ -7971,7 +7957,7 @@ $({ target: 'Number', stat: true }, {
7971
7957
  /***/ "9224":
7972
7958
  /***/ (function(module) {
7973
7959
 
7974
- module.exports = JSON.parse("{\"a\":\"3.3.41\"}");
7960
+ module.exports = JSON.parse("{\"a\":\"3.3.43\"}");
7975
7961
 
7976
7962
  /***/ }),
7977
7963
 
@@ -8882,6 +8868,21 @@ var update = add("6e9caba0", content, true, {"sourceMap":false,"shadowMode":fals
8882
8868
 
8883
8869
  /***/ }),
8884
8870
 
8871
+ /***/ "97ea":
8872
+ /***/ (function(module, exports, __webpack_require__) {
8873
+
8874
+ // style-loader: Adds some css to the DOM by adding a <style> tag
8875
+
8876
+ // load the styles
8877
+ var content = __webpack_require__("d9d2");
8878
+ if(typeof content === 'string') content = [[module.i, content, '']];
8879
+ if(content.locals) module.exports = content.locals;
8880
+ // add the styles to the DOM
8881
+ var add = __webpack_require__("499e").default
8882
+ var update = add("05d41eae", content, true, {"sourceMap":false,"shadowMode":false});
8883
+
8884
+ /***/ }),
8885
+
8885
8886
  /***/ "99af":
8886
8887
  /***/ (function(module, exports, __webpack_require__) {
8887
8888
 
@@ -10599,21 +10600,6 @@ module.exports = function (METHOD_NAME) {
10599
10600
  };
10600
10601
 
10601
10602
 
10602
- /***/ }),
10603
-
10604
- /***/ "c920":
10605
- /***/ (function(module, exports, __webpack_require__) {
10606
-
10607
- // style-loader: Adds some css to the DOM by adding a <style> tag
10608
-
10609
- // load the styles
10610
- var content = __webpack_require__("08a2");
10611
- if(typeof content === 'string') content = [[module.i, content, '']];
10612
- if(content.locals) module.exports = content.locals;
10613
- // add the styles to the DOM
10614
- var add = __webpack_require__("499e").default
10615
- var update = add("7946d016", content, true, {"sourceMap":false,"shadowMode":false});
10616
-
10617
10603
  /***/ }),
10618
10604
 
10619
10605
  /***/ "c975":
@@ -11238,6 +11224,20 @@ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGT
11238
11224
  });
11239
11225
 
11240
11226
 
11227
+ /***/ }),
11228
+
11229
+ /***/ "d9d2":
11230
+ /***/ (function(module, exports, __webpack_require__) {
11231
+
11232
+ // Imports
11233
+ var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb");
11234
+ exports = ___CSS_LOADER_API_IMPORT___(false);
11235
+ // Module
11236
+ exports.push([module.i, ".ev-chart-group__wrapper[data-v-2db10c44]{display:flex;height:100%;flex-direction:column}", ""]);
11237
+ // Exports
11238
+ module.exports = exports;
11239
+
11240
+
11241
11241
  /***/ }),
11242
11242
 
11243
11243
  /***/ "da84":
@@ -21146,7 +21146,9 @@ var calendar_uses_useEvent = function useEvent(param) {
21146
21146
  }, function (curr) {
21147
21147
  selectedValue.value = curr;
21148
21148
 
21149
- if (props.mode.includes('Time')) {
21149
+ if (props.mode === 'dateRange') {
21150
+ updateCalendarPage(selectedValue.value);
21151
+ } else if (props.mode.includes('Time')) {
21150
21152
  var updateValue = [];
21151
21153
 
21152
21154
  if (props.mode === 'dateTime') {
@@ -35340,27 +35342,33 @@ var element_line_Line = /*#__PURE__*/function () {
35340
35342
  color: this.color
35341
35343
  };
35342
35344
  var gdata = this.data;
35343
- var s = 0;
35344
- var e = gdata.length - 1;
35345
35345
 
35346
- while (s <= e) {
35347
- var m = Math.floor((s + e) / 2);
35348
- var x = gdata[m].xp;
35349
- var y = gdata[m].yp;
35346
+ if (gdata !== null && gdata !== void 0 && gdata.length) {
35347
+ var _gdata$;
35350
35348
 
35351
- if (x - 6 <= xp && xp <= x + 6) {
35352
- item.data = gdata[m];
35353
- item.index = m;
35349
+ var s = 0;
35350
+ var e = gdata.length - 1;
35351
+ var xpInterval = ((_gdata$ = gdata[1]) === null || _gdata$ === void 0 ? void 0 : _gdata$.xp) - gdata[0].xp < 6 ? 1.5 : 6;
35354
35352
 
35355
- if (y - 6 <= yp && yp <= y + 6) {
35356
- item.hit = true;
35357
- }
35353
+ while (s <= e) {
35354
+ var m = Math.floor((s + e) / 2);
35355
+ var x = gdata[m].xp;
35356
+ var y = gdata[m].yp;
35358
35357
 
35359
- return item;
35360
- } else if (x + 6 < xp) {
35361
- s = m + 1;
35362
- } else {
35363
- e = m - 1;
35358
+ if (x - xpInterval < xp && xp < x + xpInterval) {
35359
+ item.data = gdata[m];
35360
+ item.index = m;
35361
+
35362
+ if (y - 6 <= yp && yp <= y + 6) {
35363
+ item.hit = true;
35364
+ }
35365
+
35366
+ return item;
35367
+ } else if (x + xpInterval > xp) {
35368
+ e = m - 1;
35369
+ } else {
35370
+ s = m + 1;
35371
+ }
35364
35372
  }
35365
35373
  }
35366
35374
 
@@ -37901,7 +37909,7 @@ var scale_Scale = /*#__PURE__*/function () {
37901
37909
 
37902
37910
  labelPoint = this.position === 'top' ? offsetPoint - 10 : offsetPoint + 10;
37903
37911
 
37904
- if (options !== null && options !== void 0 && (_options$brush = options.brush) !== null && _options$brush !== void 0 && _options$brush.showLabel || !options.brush) {
37912
+ if (options !== null && options !== void 0 && (_options$brush = options.brush) !== null && _options$brush !== void 0 && _options$brush.showLabel || !(options !== null && options !== void 0 && options.brush)) {
37905
37913
  ctx.fillText(labelText, labelCenter, labelPoint);
37906
37914
  }
37907
37915
 
@@ -37936,7 +37944,7 @@ var scale_Scale = /*#__PURE__*/function () {
37936
37944
 
37937
37945
  labelPoint = this.position === 'left' ? offsetPoint - 10 : offsetPoint + 10;
37938
37946
 
37939
- if (options !== null && options !== void 0 && (_options$brush2 = options.brush) !== null && _options$brush2 !== void 0 && _options$brush2.showLabel || !options.brush) {
37947
+ if (options !== null && options !== void 0 && (_options$brush2 = options.brush) !== null && _options$brush2 !== void 0 && _options$brush2.showLabel || !(options !== null && options !== void 0 && options.brush)) {
37940
37948
  ctx.fillText(labelText, labelPoint, labelCenter);
37941
37949
  }
37942
37950
 
@@ -46481,33 +46489,33 @@ Chart.install = function (app) {
46481
46489
  };
46482
46490
 
46483
46491
  /* harmony default export */ var chart = (Chart);
46484
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/chartGroup/ChartGroup.vue?vue&type=template&id=bd8c6660&scoped=true
46492
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/chartGroup/ChartGroup.vue?vue&type=template&id=2db10c44&scoped=true
46485
46493
 
46486
46494
 
46487
- var ChartGroupvue_type_template_id_bd8c6660_scoped_true_withId = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withScopeId"])("data-v-bd8c6660");
46495
+ var ChartGroupvue_type_template_id_2db10c44_scoped_true_withId = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withScopeId"])("data-v-2db10c44");
46488
46496
 
46489
- Object(external_commonjs_vue_commonjs2_vue_root_Vue_["pushScopeId"])("data-v-bd8c6660");
46497
+ Object(external_commonjs_vue_commonjs2_vue_root_Vue_["pushScopeId"])("data-v-2db10c44");
46490
46498
 
46491
- var ChartGroupvue_type_template_id_bd8c6660_scoped_true_hoisted_1 = {
46499
+ var ChartGroupvue_type_template_id_2db10c44_scoped_true_hoisted_1 = {
46492
46500
  key: 0,
46493
46501
  ref: "evChartToolbarRef"
46494
46502
  };
46495
- var ChartGroupvue_type_template_id_bd8c6660_scoped_true_hoisted_2 = {
46503
+ var ChartGroupvue_type_template_id_2db10c44_scoped_true_hoisted_2 = {
46496
46504
  ref: "evChartGroupRef",
46497
46505
  class: "ev-chart-group__wrapper"
46498
46506
  };
46499
46507
 
46500
46508
  Object(external_commonjs_vue_commonjs2_vue_root_Vue_["popScopeId"])();
46501
46509
 
46502
- var ChartGroupvue_type_template_id_bd8c6660_scoped_true_render = /*#__PURE__*/ChartGroupvue_type_template_id_bd8c6660_scoped_true_withId(function (_ctx, _cache, $props, $setup, $data, $options) {
46510
+ var ChartGroupvue_type_template_id_2db10c44_scoped_true_render = /*#__PURE__*/ChartGroupvue_type_template_id_2db10c44_scoped_true_withId(function (_ctx, _cache, $props, $setup, $data, $options) {
46503
46511
  var _component_ev_chart_toolbar = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ev-chart-toolbar");
46504
46512
 
46505
- return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [$setup.zoomOptions.toolbar.show ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])("div", ChartGroupvue_type_template_id_bd8c6660_scoped_true_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ev_chart_toolbar, {
46513
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [$setup.zoomOptions.toolbar.show ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])("div", ChartGroupvue_type_template_id_2db10c44_scoped_true_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ev_chart_toolbar, {
46506
46514
  toolbar: $setup.zoomOptions.toolbar,
46507
46515
  onOnClickToolbar: $setup.onClickToolbar
46508
- }, null, 8, ["toolbar", "onOnClickToolbar"])], 512)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", ChartGroupvue_type_template_id_bd8c6660_scoped_true_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 512)], 64);
46516
+ }, null, 8, ["toolbar", "onOnClickToolbar"])], 512)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", ChartGroupvue_type_template_id_2db10c44_scoped_true_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 512)], 64);
46509
46517
  });
46510
- // CONCATENATED MODULE: ./src/components/chartGroup/ChartGroup.vue?vue&type=template&id=bd8c6660&scoped=true
46518
+ // CONCATENATED MODULE: ./src/components/chartGroup/ChartGroup.vue?vue&type=template&id=2db10c44&scoped=true
46511
46519
 
46512
46520
  // CONCATENATED MODULE: ./src/components/chartGroup/uses.js
46513
46521
 
@@ -46594,8 +46602,10 @@ var uses_useGroupModel = function useGroupModel() {
46594
46602
  default: null
46595
46603
  }
46596
46604
  },
46597
- emits: ['update:zoomStartIdx', 'update:zoomEndIdx'],
46598
- setup: function setup(props) {
46605
+ emits: ['update:groupSelectedLabel', 'update:zoomStartIdx', 'update:zoomEndIdx'],
46606
+ setup: function setup(props, _ref) {
46607
+ var emit = _ref.emit;
46608
+
46599
46609
  var _useGroupModel = uses_useGroupModel(),
46600
46610
  getNormalizedOptions = _useGroupModel.getNormalizedOptions,
46601
46611
  isExecuteZoom = _useGroupModel.isExecuteZoom,
@@ -46606,8 +46616,13 @@ var uses_useGroupModel = function useGroupModel() {
46606
46616
  Object(external_commonjs_vue_commonjs2_vue_root_Vue_["provide"])('isExecuteZoom', isExecuteZoom);
46607
46617
  Object(external_commonjs_vue_commonjs2_vue_root_Vue_["provide"])('isChartGroup', true);
46608
46618
  Object(external_commonjs_vue_commonjs2_vue_root_Vue_["provide"])('brushSeries', brushSeries);
46609
- var groupSelectedLabel = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
46610
- return props.groupSelectedLabel;
46619
+ var groupSelectedLabel = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])({
46620
+ get: function get() {
46621
+ return props.groupSelectedLabel;
46622
+ },
46623
+ set: function set(val) {
46624
+ return emit('update:groupSelectedLabel', val);
46625
+ }
46611
46626
  });
46612
46627
  Object(external_commonjs_vue_commonjs2_vue_root_Vue_["provide"])('groupSelectedLabel', groupSelectedLabel);
46613
46628
 
@@ -46649,10 +46664,10 @@ var uses_useGroupModel = function useGroupModel() {
46649
46664
  });
46650
46665
  Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(function () {
46651
46666
  return [props.zoomStartIdx, props.zoomEndIdx];
46652
- }, function (_ref) {
46653
- var _ref2 = _slicedToArray(_ref, 2),
46654
- zoomStartIdx = _ref2[0],
46655
- zoomEndIdx = _ref2[1];
46667
+ }, function (_ref2) {
46668
+ var _ref3 = _slicedToArray(_ref2, 2),
46669
+ zoomStartIdx = _ref3[0],
46670
+ zoomEndIdx = _ref3[1];
46656
46671
 
46657
46672
  if (brushIdx.isUseButton || brushIdx.isUseScroll) {
46658
46673
  return;
@@ -46670,8 +46685,8 @@ var uses_useGroupModel = function useGroupModel() {
46670
46685
  });
46671
46686
  // CONCATENATED MODULE: ./src/components/chartGroup/ChartGroup.vue?vue&type=script&lang=js
46672
46687
 
46673
- // EXTERNAL MODULE: ./src/components/chartGroup/ChartGroup.vue?vue&type=style&index=0&id=bd8c6660&lang=scss&scoped=true
46674
- var ChartGroupvue_type_style_index_0_id_bd8c6660_lang_scss_scoped_true = __webpack_require__("8352");
46688
+ // EXTERNAL MODULE: ./src/components/chartGroup/ChartGroup.vue?vue&type=style&index=0&id=2db10c44&lang=scss&scoped=true
46689
+ var ChartGroupvue_type_style_index_0_id_2db10c44_lang_scss_scoped_true = __webpack_require__("7f2c");
46675
46690
 
46676
46691
  // CONCATENATED MODULE: ./src/components/chartGroup/ChartGroup.vue
46677
46692
 
@@ -46681,7 +46696,7 @@ var ChartGroupvue_type_style_index_0_id_bd8c6660_lang_scss_scoped_true = __webpa
46681
46696
 
46682
46697
 
46683
46698
 
46684
- const ChartGroup_exports_ = /*#__PURE__*/exportHelper_default()(ChartGroupvue_type_script_lang_js, [['render',ChartGroupvue_type_template_id_bd8c6660_scoped_true_render],['__scopeId',"data-v-bd8c6660"]])
46699
+ const ChartGroup_exports_ = /*#__PURE__*/exportHelper_default()(ChartGroupvue_type_script_lang_js, [['render',ChartGroupvue_type_template_id_2db10c44_scoped_true_render],['__scopeId',"data-v-2db10c44"]])
46685
46700
 
46686
46701
  /* harmony default export */ var ChartGroup = (ChartGroup_exports_);
46687
46702
  // CONCATENATED MODULE: ./src/components/chartGroup/index.js
@@ -46716,14 +46731,33 @@ function ChartBrushvue_type_template_id_7d0c10ab_render(_ctx, _cache, $props, $s
46716
46731
 
46717
46732
 
46718
46733
 
46734
+ var BRUSH_UPDATE_MODE = {
46735
+ WHEEL: {
46736
+ UP: 'MOVEUP_WHEEL',
46737
+ DOWN: 'MOVEDOWN_WHEEL'
46738
+ },
46739
+ GRAB: {
46740
+ UP: 'MOVEUP_GRAB',
46741
+ DOWN: 'MOVEDOWN_GRAB'
46742
+ },
46743
+ BUTTON: {
46744
+ INCREASE: 'INCREASE',
46745
+ DECREASE: 'DECREASE'
46746
+ }
46747
+ };
46748
+ var BUTTON_TYPE = {
46749
+ LEFT: 'leftX',
46750
+ RIGHT: 'rightX'
46751
+ };
46752
+
46719
46753
  var chartBrush_core_EvChartBrush = /*#__PURE__*/function () {
46720
46754
  function EvChartBrush(evChart, evChartData, evChartBrushOptions, brushIdx, evChartBrushRef) {
46721
46755
  _classCallCheck(this, EvChartBrush);
46722
46756
 
46723
46757
  this.evChart = evChart;
46724
- this.evChartData = evChartData;
46725
46758
  this.evChartBrushOptions = evChartBrushOptions;
46726
46759
  this.evChartBrushRef = evChartBrushRef;
46760
+ this.evChartData = evChartData;
46727
46761
  this.brushIdx = brushIdx;
46728
46762
 
46729
46763
  if (evChartBrushOptions.value.useDebounce) {
@@ -46738,7 +46772,6 @@ var chartBrush_core_EvChartBrush = /*#__PURE__*/function () {
46738
46772
  key: "init",
46739
46773
  value: function init(isResize) {
46740
46774
  if (this.brushIdx.start > this.brushIdx.end) {
46741
- this.initEventState();
46742
46775
  this.removeBrushCanvas();
46743
46776
  return;
46744
46777
  }
@@ -46770,11 +46803,11 @@ var chartBrush_core_EvChartBrush = /*#__PURE__*/function () {
46770
46803
  }, {
46771
46804
  key: "drawBrushRect",
46772
46805
  value: function drawBrushRect(_ref) {
46773
- var _this$debounceBrushId;
46774
-
46775
46806
  var brushCanvas = _ref.brushCanvas,
46776
46807
  isResize = _ref.isResize,
46777
- isDebounce = _ref.isDebounce;
46808
+ isDebounce = _ref.isDebounce,
46809
+ mode = _ref.mode,
46810
+ offsetX = _ref.offsetX;
46778
46811
  var _this$evChart = this.evChart,
46779
46812
  chartRect = _this$evChart.chartRect,
46780
46813
  labelOffset = _this$evChart.labelOffset;
@@ -46783,21 +46816,57 @@ var chartBrush_core_EvChartBrush = /*#__PURE__*/function () {
46783
46816
  return;
46784
46817
  }
46785
46818
 
46819
+ var labelEndIdx = this.evChartData.value.labels.length - 1;
46820
+ this.labelEndIdx = labelEndIdx;
46786
46821
  var evChartRange = {
46787
46822
  x1: chartRect.x1 + labelOffset.left,
46788
46823
  x2: chartRect.x2 - labelOffset.right,
46789
46824
  y1: chartRect.y1 + labelOffset.top,
46790
46825
  y2: chartRect.y2 - labelOffset.bottom
46791
46826
  };
46792
- var pixelRatio = window.devicePixelRatio || 1;
46827
+ var canvasPosInfo = this.setCanvasWidthHeight(evChartRange, brushCanvas);
46828
+
46829
+ if (isResize && this.isEqualWidth) {
46830
+ return;
46831
+ }
46832
+
46833
+ if (labelEndIdx >= 0) {
46834
+ var brushPosInfo = this.setBrushXAndWidth(canvasPosInfo, offsetX, isDebounce, mode);
46835
+
46836
+ if (canvasPosInfo && brushPosInfo) {
46837
+ this.drawBrush(canvasPosInfo, brushPosInfo, evChartRange, brushCanvas);
46838
+ }
46839
+ }
46840
+ }
46841
+ }, {
46842
+ key: "setCanvasWidthHeight",
46843
+ value: function setCanvasWidthHeight(evChartRange, brushCanvas) {
46793
46844
  var brushButtonWidth = 6;
46794
46845
  var brushCanvasWidth = evChartRange.x2 - evChartRange.x1 + brushButtonWidth;
46795
46846
  var brushCanvasHeight = evChartRange.y2 - evChartRange.y1;
46796
- var isEqualWidth = brushCanvas.width === Math.floor(brushCanvasWidth * pixelRatio);
46847
+ var axesXInterval = (evChartRange.x2 - evChartRange.x1) / this.labelEndIdx;
46848
+ var pixelRatio = window.devicePixelRatio || 1;
46849
+ this.isEqualWidth = brushCanvas.width === Math.floor(brushCanvasWidth * pixelRatio);
46850
+ return {
46851
+ brushButtonWidth: brushButtonWidth,
46852
+ brushCanvasHeight: brushCanvasHeight,
46853
+ brushCanvasWidth: brushCanvasWidth,
46854
+ axesXInterval: axesXInterval,
46855
+ pixelRatio: pixelRatio
46856
+ };
46857
+ }
46858
+ }, {
46859
+ key: "setBrushXAndWidth",
46860
+ value: function setBrushXAndWidth(canvasPosInfo) {
46861
+ var _this$debounceBrushId;
46797
46862
 
46798
- if (isResize && isEqualWidth) {
46799
- return;
46800
- }
46863
+ var offsetX = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
46864
+ var isDebounce = arguments.length > 2 ? arguments[2] : undefined;
46865
+ var mode = arguments.length > 3 ? arguments[3] : undefined;
46866
+ var brushButtonWidth = canvasPosInfo.brushButtonWidth,
46867
+ brushCanvasWidth = canvasPosInfo.brushCanvasWidth,
46868
+ axesXInterval = canvasPosInfo.axesXInterval,
46869
+ pixelRatio = canvasPosInfo.pixelRatio;
46801
46870
 
46802
46871
  if (!isDebounce && this.debounceBrushIdx) {
46803
46872
  this.debounceBrushIdx.start = this.brushIdx.start;
@@ -46805,44 +46874,109 @@ var chartBrush_core_EvChartBrush = /*#__PURE__*/function () {
46805
46874
  }
46806
46875
 
46807
46876
  var brushIdx = (_this$debounceBrushId = this.debounceBrushIdx) !== null && _this$debounceBrushId !== void 0 ? _this$debounceBrushId : this.brushIdx;
46808
- var labelEndIdx = this.evChartData.value.labels.length - 1;
46809
46877
 
46810
- if (labelEndIdx >= 0) {
46811
- this.labelEndIdx = labelEndIdx;
46812
- var axesXInterval = (evChartRange.x2 - evChartRange.x1) / labelEndIdx;
46813
- var brushRectX = brushIdx.start * axesXInterval * pixelRatio;
46814
- var brushRectWidth = (brushCanvasWidth - (labelEndIdx - (brushIdx.end - brushIdx.start)) * axesXInterval) * pixelRatio;
46815
- var brushRectHeight = this.evChartBrushOptions.value.height - evChartRange.y1;
46816
- var brushButtonLeftXPos = brushRectX;
46817
- var brushButtonRightXPos = brushRectX + brushRectWidth;
46818
-
46819
- if (!brushCanvas.style.position) {
46820
- brushCanvas.style.position = 'absolute';
46821
- brushCanvas.style.top = "".concat(evChartRange.y1, "px");
46822
- brushCanvas.style.left = "".concat(evChartRange.x1 - brushButtonWidth / 2, "px");
46823
- }
46824
-
46825
- if (!isEqualWidth) {
46826
- brushCanvas.width = brushCanvasWidth * pixelRatio;
46827
- brushCanvas.style.width = "".concat(brushCanvasWidth, "px");
46828
- brushCanvas.height = brushCanvasHeight * pixelRatio;
46829
- brushCanvas.style.height = "".concat(brushCanvasHeight, "px");
46830
- }
46831
-
46832
- var ctx = brushCanvas.getContext('2d');
46833
- ctx.clearRect(0, 0, brushCanvasWidth * pixelRatio, brushCanvasHeight * pixelRatio);
46834
- ctx.fillStyle = this.evChartBrushOptions.value.selection.fillColor;
46835
- ctx.globalAlpha = this.evChartBrushOptions.value.selection.opacity;
46836
- ctx.fillRect(brushRectX, 0, brushRectWidth, brushRectHeight);
46837
- ctx.fillRect(brushButtonLeftXPos, 0, brushButtonWidth, brushRectHeight);
46838
- ctx.fillRect(brushButtonRightXPos - brushButtonWidth, 0, brushButtonWidth, brushRectHeight);
46839
- this.evChartBrushPos = {
46840
- leftX: brushButtonLeftXPos / pixelRatio,
46841
- rightX: brushButtonRightXPos / pixelRatio,
46842
- buttonWidth: brushButtonWidth,
46843
- axesXInterval: axesXInterval
46844
- };
46878
+ switch (mode) {
46879
+ case BRUSH_UPDATE_MODE.BUTTON.INCREASE:
46880
+ case BRUSH_UPDATE_MODE.BUTTON.DECREASE:
46881
+ this.brushRectWidth = brushCanvasWidth * pixelRatio;
46882
+
46883
+ if (this.curBrushButtonType === BUTTON_TYPE.LEFT) {
46884
+ this.brushRectWidth = this.beforeBrushRectWidth ? this.beforeBrushRectWidth - offsetX : this.brushRectWidth - offsetX;
46885
+
46886
+ if (this.brushRectWidth <= brushButtonWidth) {
46887
+ this.brushRectWidth = brushButtonWidth;
46888
+ } else {
46889
+ this.brushRectX = offsetX * pixelRatio;
46890
+ this.beforeBrushRectX = this.brushRectX;
46891
+ }
46892
+ } else if (this.curBrushButtonType === BUTTON_TYPE.RIGHT) {
46893
+ this.brushRectWidth = offsetX - this.beforeBrushRectX;
46894
+
46895
+ if (this.brushRectWidth <= brushButtonWidth) {
46896
+ this.brushRectWidth = brushButtonWidth;
46897
+ } else {
46898
+ this.brushRectX = this.beforeBrushRectX;
46899
+ this.beforeBrushRectWidth = this.brushRectWidth + this.brushRectX;
46900
+ }
46901
+ }
46902
+
46903
+ break;
46904
+
46905
+ case BRUSH_UPDATE_MODE.GRAB.UP:
46906
+ case BRUSH_UPDATE_MODE.GRAB.DOWN:
46907
+ if (this.brushRectX <= 0 && mode === BRUSH_UPDATE_MODE.GRAB.DOWN || this.brushRectX + this.brushRectWidth >= brushCanvasWidth && mode === BRUSH_UPDATE_MODE.GRAB.UP) {
46908
+ this.offsetXAndRectXInterval = null;
46909
+ } else {
46910
+ if (!this.offsetXAndRectXInterval) {
46911
+ this.offsetXAndRectXInterval = offsetX - this.brushRectX;
46912
+ }
46913
+
46914
+ this.brushRectX = offsetX - this.offsetXAndRectXInterval;
46915
+ }
46916
+
46917
+ break;
46918
+
46919
+ default:
46920
+ if (!offsetX) {
46921
+ this.brushRectX = brushIdx.start * axesXInterval * pixelRatio;
46922
+ this.brushRectWidth = (brushCanvasWidth - (this.labelEndIdx - (brushIdx.end - brushIdx.start)) * axesXInterval) * pixelRatio;
46923
+ this.beforeBrushRectX = this.brushRectX;
46924
+ this.beforeBrushRectWidth = this.brushRectWidth + this.brushRectX;
46925
+ }
46926
+
46927
+ break;
46845
46928
  }
46929
+
46930
+ return {
46931
+ brushRectX: this.brushRectX,
46932
+ brushRectWidth: this.brushRectWidth
46933
+ };
46934
+ }
46935
+ }, {
46936
+ key: "drawBrush",
46937
+ value: function drawBrush(canvasPosInfo, brushPosInfo, evChartRange, brushCanvas) {
46938
+ var brushButtonWidth = canvasPosInfo.brushButtonWidth,
46939
+ brushCanvasHeight = canvasPosInfo.brushCanvasHeight,
46940
+ brushCanvasWidth = canvasPosInfo.brushCanvasWidth,
46941
+ axesXInterval = canvasPosInfo.axesXInterval,
46942
+ pixelRatio = canvasPosInfo.pixelRatio;
46943
+ var brushRectX = brushPosInfo.brushRectX,
46944
+ brushRectWidth = brushPosInfo.brushRectWidth;
46945
+ var _this$evChartBrushOpt = this.evChartBrushOptions.value,
46946
+ height = _this$evChartBrushOpt.height,
46947
+ _this$evChartBrushOpt2 = _this$evChartBrushOpt.selection,
46948
+ fillColor = _this$evChartBrushOpt2.fillColor,
46949
+ opacity = _this$evChartBrushOpt2.opacity;
46950
+ var brushRectHeight = height - evChartRange.y1;
46951
+ var brushButtonLeftXPos = brushRectX;
46952
+ var brushButtonRightXPos = brushRectX + brushRectWidth;
46953
+
46954
+ if (!brushCanvas.style.position) {
46955
+ brushCanvas.style.position = 'absolute';
46956
+ brushCanvas.style.top = "".concat(evChartRange.y1, "px");
46957
+ brushCanvas.style.left = "".concat(evChartRange.x1 - brushButtonWidth / 2, "px");
46958
+ }
46959
+
46960
+ if (!this.isEqualWidth) {
46961
+ brushCanvas.width = brushCanvasWidth * pixelRatio;
46962
+ brushCanvas.style.width = "".concat(brushCanvasWidth, "px");
46963
+ brushCanvas.height = brushCanvasHeight * pixelRatio;
46964
+ brushCanvas.style.height = "".concat(brushCanvasHeight, "px");
46965
+ }
46966
+
46967
+ var ctx = brushCanvas.getContext('2d');
46968
+ ctx.clearRect(0, 0, brushCanvasWidth * pixelRatio, brushCanvasHeight * pixelRatio);
46969
+ ctx.fillStyle = fillColor;
46970
+ ctx.globalAlpha = opacity;
46971
+ ctx.fillRect(brushRectX, 0, brushRectWidth, brushRectHeight);
46972
+ ctx.fillRect(brushButtonLeftXPos, 0, brushButtonWidth, brushRectHeight);
46973
+ ctx.fillRect(brushButtonRightXPos - brushButtonWidth, 0, brushButtonWidth, brushRectHeight);
46974
+ this.brushPosInfo = _objectSpread2(_objectSpread2({
46975
+ leftX: brushButtonLeftXPos / pixelRatio,
46976
+ rightX: brushButtonRightXPos / pixelRatio,
46977
+ buttonWidth: brushButtonWidth,
46978
+ axesXInterval: axesXInterval
46979
+ }, canvasPosInfo), brushPosInfo);
46846
46980
  }
46847
46981
  }, {
46848
46982
  key: "addEvent",
@@ -46877,8 +47011,19 @@ var chartBrush_core_EvChartBrush = /*#__PURE__*/function () {
46877
47011
 
46878
47012
  this.onWheel = function (e) {
46879
47013
  e.preventDefault();
47014
+ var mode = e.deltaY > 0 ? BRUSH_UPDATE_MODE.WHEEL.DOWN : BRUSH_UPDATE_MODE.WHEEL.UP;
47015
+
47016
+ _this.updateBrushIdx(mode);
47017
+
47018
+ if (_this.debounceBrushIdx) {
47019
+ _this.drawBrushRect({
47020
+ brushCanvas: _this.brushCanvas,
47021
+ isDebounce: true,
47022
+ mode: mode
47023
+ });
47024
+ }
46880
47025
 
46881
- _this.updateBrushIdx(e.deltaY > 0 ? 'movedown' : 'moveup');
47026
+ _this.brushIdx.isUseScroll = true;
46882
47027
  };
46883
47028
 
46884
47029
  this.onMouseUp = function () {
@@ -46904,23 +47049,23 @@ var chartBrush_core_EvChartBrush = /*#__PURE__*/function () {
46904
47049
  var _this2 = this;
46905
47050
 
46906
47051
  var calDisToCurMouseX = function calDisToCurMouseX(xPos) {
46907
- return Math.abs(_this2.evChartBrushPos[xPos] - e.offsetX);
47052
+ return Math.abs(_this2.brushPosInfo[xPos] - e.offsetX);
46908
47053
  };
46909
47054
 
46910
- var buttonType = calDisToCurMouseX('rightX') > calDisToCurMouseX('leftX') ? 'leftX' : 'rightX';
46911
- this.curBrushButtonType = buttonType;
47055
+ var buttonType = calDisToCurMouseX(BUTTON_TYPE.RIGHT) > calDisToCurMouseX(BUTTON_TYPE.LEFT) ? BUTTON_TYPE.LEFT : BUTTON_TYPE.RIGHT;
46912
47056
 
46913
47057
  var isMoveRight = function isMoveRight(xPos) {
46914
- return e.offsetX > _this2.evChartBrushPos[xPos];
47058
+ return e.offsetX > _this2.brushPosInfo[xPos];
46915
47059
  };
46916
47060
 
46917
47061
  var isMoveLeft = function isMoveLeft(xPos) {
46918
- return e.offsetX < _this2.evChartBrushPos[xPos];
47062
+ return e.offsetX < _this2.brushPosInfo[xPos];
46919
47063
  };
46920
47064
 
46921
- var isOutsideBrush = isMoveLeft('leftX') || isMoveRight('rightX');
46922
- var isInsideBrush = isMoveRight('leftX') && isMoveLeft('rightX');
46923
- var isInsideButton = e.offsetX + this.evChartBrushPos.buttonWidth >= this.evChartBrushPos[buttonType] && e.offsetX - this.evChartBrushPos.buttonWidth <= this.evChartBrushPos[buttonType];
47065
+ var isOutsideBrush = isMoveLeft(BUTTON_TYPE.LEFT) || isMoveRight(BUTTON_TYPE.RIGHT);
47066
+ var isInsideBrush = isMoveRight(BUTTON_TYPE.LEFT) && isMoveLeft(BUTTON_TYPE.RIGHT);
47067
+ var isInsideButton = e.offsetX + this.brushPosInfo.buttonWidth >= this.brushPosInfo[buttonType] && e.offsetX - this.brushPosInfo.buttonWidth <= this.brushPosInfo[buttonType];
47068
+ this.curBrushButtonType = isInsideButton && buttonType;
46924
47069
  return {
46925
47070
  isInsideButton: isInsideButton,
46926
47071
  isInsideBrush: isInsideBrush,
@@ -46992,18 +47137,18 @@ var chartBrush_core_EvChartBrush = /*#__PURE__*/function () {
46992
47137
 
46993
47138
  if (middle > 0.5) {
46994
47139
  if ((brushIdx.end - brushIdx.start) % 2 === 0) {
46995
- clickIdx = Math.round(e.offsetX / this.evChartBrushPos.axesXInterval);
47140
+ clickIdx = Math.round(e.offsetX / this.brushPosInfo.axesXInterval);
46996
47141
  left = Math.ceil(middle);
46997
47142
  right = Math.floor(middle);
46998
47143
  } else {
46999
- clickIdx = Math.ceil(e.offsetX / this.evChartBrushPos.axesXInterval);
47144
+ clickIdx = Math.ceil(e.offsetX / this.brushPosInfo.axesXInterval);
47000
47145
  left = Math.ceil(middle);
47001
47146
  right = Math.floor(middle);
47002
47147
  }
47003
47148
  } else {
47004
- clickIdx = Math.floor(e.offsetX / this.evChartBrushPos.axesXInterval);
47149
+ clickIdx = Math.floor(e.offsetX / this.brushPosInfo.axesXInterval);
47005
47150
 
47006
- if (e.offsetX - clickIdx * this.evChartBrushPos.axesXInterval > this.evChartBrushPos.axesXInterval / 2) {
47151
+ if (e.offsetX - clickIdx * this.brushPosInfo.axesXInterval > this.brushPosInfo.axesXInterval / 2) {
47007
47152
  left = Math.floor(middle);
47008
47153
  right = Math.ceil(middle);
47009
47154
  } else {
@@ -47045,40 +47190,53 @@ var chartBrush_core_EvChartBrush = /*#__PURE__*/function () {
47045
47190
  }, {
47046
47191
  key: "mouseDownAndMove",
47047
47192
  value: function mouseDownAndMove(e) {
47048
- var moveSensitive = this.evChartBrushPos.axesXInterval / 3;
47193
+ var moveSensitive = this.debounceBrushIdx ? 0 : this.brushPosInfo.axesXInterval / 3;
47049
47194
  var mode;
47050
47195
 
47051
47196
  if (e.offsetX > this.beforeMouseXPos) {
47052
47197
  // 오른쪽 이동
47053
47198
  if (this.clickBrushInsideX > 0) {
47054
47199
  if (this.clickBrushInsideX < e.offsetX - moveSensitive) {
47055
- mode = 'moveup';
47200
+ mode = BRUSH_UPDATE_MODE.GRAB.UP;
47201
+ this.isUseBrushGrab = true;
47202
+ this.brushIdx.isUseScroll = true;
47056
47203
  this.clickBrushInsideX = e.offsetX + moveSensitive;
47057
47204
  }
47058
47205
  } else {
47059
- var isMoveRight = e.offsetX - this.evChartBrushPos[this.curBrushButtonType] > moveSensitive;
47206
+ var isMoveRight = e.offsetX - this.brushPosInfo[this.curBrushButtonType] > moveSensitive;
47060
47207
 
47061
47208
  if (isMoveRight) {
47062
- mode = this.curBrushButtonType === 'leftX' ? 'decrease' : 'increase';
47209
+ mode = this.curBrushButtonType === BUTTON_TYPE.LEFT ? BRUSH_UPDATE_MODE.BUTTON.DECREASE : BRUSH_UPDATE_MODE.BUTTON.INCREASE;
47210
+ this.brushIdx.isUseButton = true;
47063
47211
  }
47064
47212
  }
47065
47213
  } else if (e.offsetX < this.beforeMouseXPos) {
47066
47214
  // 왼쪽 이동
47067
47215
  if (this.clickBrushInsideX > 0) {
47068
47216
  if (this.clickBrushInsideX > e.offsetX + moveSensitive) {
47069
- mode = 'movedown';
47217
+ mode = BRUSH_UPDATE_MODE.GRAB.DOWN;
47218
+ this.isUseBrushGrab = true;
47219
+ this.brushIdx.isUseScroll = true;
47070
47220
  this.clickBrushInsideX = e.offsetX - moveSensitive;
47071
47221
  }
47072
47222
  } else {
47073
- var isMoveLeft = this.evChartBrushPos[this.curBrushButtonType] - e.offsetX > moveSensitive;
47223
+ var isMoveLeft = this.brushPosInfo[this.curBrushButtonType] - e.offsetX > moveSensitive;
47074
47224
 
47075
47225
  if (isMoveLeft) {
47076
- mode = this.curBrushButtonType === 'leftX' ? 'increase' : 'decrease';
47226
+ mode = this.curBrushButtonType === BUTTON_TYPE.LEFT ? BRUSH_UPDATE_MODE.BUTTON.INCREASE : BRUSH_UPDATE_MODE.BUTTON.DECREASE;
47227
+ this.brushIdx.isUseButton = true;
47077
47228
  }
47078
47229
  }
47079
47230
  }
47080
47231
 
47081
- if (mode) {
47232
+ if (this.debounceBrushIdx) {
47233
+ this.drawBrushRect({
47234
+ brushCanvas: this.brushCanvas,
47235
+ isDebounce: true,
47236
+ mode: mode,
47237
+ offsetX: e.offsetX
47238
+ });
47239
+ } else {
47082
47240
  this.updateBrushIdx(mode);
47083
47241
  }
47084
47242
 
@@ -47098,28 +47256,28 @@ var chartBrush_core_EvChartBrush = /*#__PURE__*/function () {
47098
47256
  var brushIdx = (_this$debounceBrushId3 = this.debounceBrushIdx) !== null && _this$debounceBrushId3 !== void 0 ? _this$debounceBrushId3 : this.brushIdx;
47099
47257
 
47100
47258
  switch (mode) {
47101
- case 'moveup':
47102
- if (brushIdx.end === this.labelEndIdx) {
47259
+ case BRUSH_UPDATE_MODE.WHEEL.UP:
47260
+ case BRUSH_UPDATE_MODE.GRAB.UP:
47261
+ if (brushIdx.end >= this.labelEndIdx) {
47103
47262
  return;
47104
47263
  }
47105
47264
 
47106
47265
  brushIdx.start += 1;
47107
47266
  brushIdx.end += 1;
47108
- this.brushIdx.isUseScroll = true;
47109
47267
  break;
47110
47268
 
47111
- case 'movedown':
47112
- if (!brushIdx.start) {
47269
+ case BRUSH_UPDATE_MODE.WHEEL.DOWN:
47270
+ case BRUSH_UPDATE_MODE.GRAB.DOWN:
47271
+ if (brushIdx.start <= 0) {
47113
47272
  return;
47114
47273
  }
47115
47274
 
47116
47275
  brushIdx.start -= 1;
47117
47276
  brushIdx.end -= 1;
47118
- this.brushIdx.isUseScroll = true;
47119
47277
  break;
47120
47278
 
47121
- case 'increase':
47122
- if (this.curBrushButtonType === 'leftX') {
47279
+ case BRUSH_UPDATE_MODE.BUTTON.INCREASE:
47280
+ if (this.curBrushButtonType === BUTTON_TYPE.LEFT) {
47123
47281
  if (!brushIdx.start) {
47124
47282
  return;
47125
47283
  }
@@ -47133,37 +47291,104 @@ var chartBrush_core_EvChartBrush = /*#__PURE__*/function () {
47133
47291
  brushIdx.end += 1;
47134
47292
  }
47135
47293
 
47136
- this.brushIdx.isUseButton = true;
47137
47294
  break;
47138
47295
 
47139
- case 'decrease':
47296
+ case BRUSH_UPDATE_MODE.BUTTON.DECREASE:
47140
47297
  if (brushIdx.start === brushIdx.end - 1) {
47141
47298
  return;
47142
47299
  }
47143
47300
 
47144
- if (this.curBrushButtonType === 'leftX') {
47301
+ if (this.curBrushButtonType === BUTTON_TYPE.LEFT) {
47145
47302
  brushIdx.start += 1;
47146
47303
  } else {
47147
47304
  brushIdx.end -= 1;
47148
47305
  }
47149
47306
 
47150
- this.brushIdx.isUseButton = true;
47151
47307
  break;
47152
47308
 
47153
47309
  default:
47154
47310
  break;
47155
47311
  }
47312
+ }
47313
+ }, {
47314
+ key: "updateBrushIdxUseXPos",
47315
+ value: function updateBrushIdxUseXPos() {
47316
+ var _this3 = this;
47317
+
47318
+ if (!this.debounceBrushIdx) {
47319
+ return;
47320
+ }
47321
+
47322
+ var calculateBrushIdxByPos = function calculateBrushIdxByPos() {
47323
+ var brushStartIdx;
47324
+ var brushEndIdx;
47325
+
47326
+ if (_this3.brushPosInfo) {
47327
+ var _this3$brushPosInfo = _this3.brushPosInfo,
47328
+ brushRectX = _this3$brushPosInfo.brushRectX,
47329
+ brushRectWidth = _this3$brushPosInfo.brushRectWidth,
47330
+ brushCanvasWidth = _this3$brushPosInfo.brushCanvasWidth,
47331
+ axesXInterval = _this3$brushPosInfo.axesXInterval;
47332
+
47333
+ if (_this3.brushIdx.isUseButton || _this3.isUseBrushGrab) {
47334
+ brushStartIdx = brushRectX / axesXInterval;
47335
+ brushEndIdx = _this3.labelEndIdx - (brushCanvasWidth - (brushRectX + brushRectWidth)) / axesXInterval;
47156
47336
 
47157
- if (mode && this.debounceBrushIdx) {
47337
+ if (_this3.curBrushButtonType === BUTTON_TYPE.LEFT) {
47338
+ brushStartIdx = Math.round(brushStartIdx);
47339
+ brushEndIdx = _this3.brushIdx.end;
47340
+
47341
+ if (brushStartIdx === brushEndIdx) {
47342
+ brushStartIdx -= 1;
47343
+ }
47344
+ } else if (_this3.curBrushButtonType === BUTTON_TYPE.RIGHT) {
47345
+ brushStartIdx = _this3.brushIdx.start;
47346
+ brushEndIdx = Math.round(brushEndIdx);
47347
+
47348
+ if (brushStartIdx === brushEndIdx) {
47349
+ brushEndIdx += 1;
47350
+ }
47351
+ } else {
47352
+ brushStartIdx = Math.round(brushStartIdx);
47353
+ brushEndIdx = Math.round(brushEndIdx);
47354
+ }
47355
+
47356
+ if (brushEndIdx > _this3.labelEndIdx) {
47357
+ var excessIdx = brushEndIdx - _this3.labelEndIdx;
47358
+ brushStartIdx -= excessIdx;
47359
+ brushEndIdx -= excessIdx;
47360
+ }
47361
+
47362
+ if (brushStartIdx < 0) {
47363
+ var _excessIdx = Math.abs(brushStartIdx);
47364
+
47365
+ brushStartIdx = 0;
47366
+ brushEndIdx += _excessIdx;
47367
+ }
47368
+ }
47369
+ }
47370
+
47371
+ return {
47372
+ brushStartIdx: brushStartIdx,
47373
+ brushEndIdx: brushEndIdx
47374
+ };
47375
+ };
47376
+
47377
+ var _calculateBrushIdxByP = calculateBrushIdxByPos(),
47378
+ brushStartIdx = _calculateBrushIdxByP.brushStartIdx,
47379
+ brushEndIdx = _calculateBrushIdxByP.brushEndIdx;
47380
+
47381
+ if (this.brushIdx.start === brushStartIdx && this.brushIdx.end === brushEndIdx) {
47158
47382
  this.drawBrushRect({
47159
- brushCanvas: this.brushCanvas,
47160
- isResize: false,
47161
- isDebounce: true
47383
+ brushCanvas: this.brushCanvas
47162
47384
  });
47163
47385
  }
47386
+
47387
+ this.brushIdx.start = brushStartIdx !== null && brushStartIdx !== void 0 ? brushStartIdx : this.debounceBrushIdx.start;
47388
+ this.brushIdx.end = brushEndIdx !== null && brushEndIdx !== void 0 ? brushEndIdx : this.debounceBrushIdx.end;
47164
47389
  }
47165
47390
  /**
47166
- * @param {boolean} isUpdateBrushIdx to initialize state after update brush index value
47391
+ * @param {boolean} updateBrushIdxUseXPos to initialize state after update brush index value
47167
47392
  *
47168
47393
  * @returns {undefined}
47169
47394
  */
@@ -47171,23 +47396,22 @@ var chartBrush_core_EvChartBrush = /*#__PURE__*/function () {
47171
47396
  }, {
47172
47397
  key: "initEventState",
47173
47398
  value: function initEventState() {
47174
- var _this3 = this;
47399
+ var _this4 = this;
47175
47400
 
47176
47401
  var promise = new Promise(function (resolve) {
47177
- if (_this3.debounceBrushIdx && (_this3.brushIdx.isUseButton || _this3.brushIdx.isUseScroll)) {
47178
- _this3.brushIdx.start = _this3.debounceBrushIdx.start;
47179
- _this3.brushIdx.end = _this3.debounceBrushIdx.end;
47180
- }
47402
+ _this4.updateBrushIdxUseXPos();
47181
47403
 
47182
47404
  resolve(true);
47183
47405
  });
47184
47406
  promise.then(function (isUpdateBrushIdx) {
47185
47407
  if (isUpdateBrushIdx) {
47186
- _this3.clickBrushInsideX = null;
47187
- _this3.beforeMouseXPos = null;
47188
- _this3.curBrushButtonType = null;
47189
- _this3.brushIdx.isUseButton = false;
47190
- _this3.brushIdx.isUseScroll = false;
47408
+ _this4.clickBrushInsideX = null;
47409
+ _this4.beforeMouseXPos = null;
47410
+ _this4.curBrushButtonType = null;
47411
+ _this4.isUseBrushGrab = false;
47412
+ _this4.offsetXAndRectXInterval = null;
47413
+ _this4.brushIdx.isUseButton = false;
47414
+ _this4.brushIdx.isUseScroll = false;
47191
47415
  }
47192
47416
  });
47193
47417
  }