zzz-pc-view 0.0.170 → 0.0.172

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zzz-pc-view",
3
- "version": "0.0.170",
3
+ "version": "0.0.172",
4
4
  "main": "src/index.umd.js",
5
5
  "module": "src/index.es.js",
6
6
  "types": "src/index.d.ts",
package/src/index.es.js CHANGED
@@ -1997,11 +1997,33 @@ const useDebounce = (callback, wait = 300) => {
1997
1997
  }, wait);
1998
1998
  };
1999
1999
  };
2000
+ const useTimeout = (callback, wait) => {
2001
+ let timeout;
2002
+ const stopTimer = () => {
2003
+ if (timeout === void 0) {
2004
+ return;
2005
+ }
2006
+ clearTimeout(timeout);
2007
+ timeout = void 0;
2008
+ };
2009
+ const execTimer = (...args) => {
2010
+ stopTimer();
2011
+ timeout = setTimeout(() => {
2012
+ timeout = void 0;
2013
+ callback(...args);
2014
+ }, wait);
2015
+ };
2016
+ return {
2017
+ execTimer,
2018
+ stopTimer
2019
+ };
2020
+ };
2000
2021
  const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2001
2022
  __proto__: null,
2002
2023
  useDebounce,
2003
2024
  useHttpRequestInterval,
2004
- useInterval
2025
+ useInterval,
2026
+ useTimeout
2005
2027
  }, Symbol.toStringTag, { value: "Module" }));
2006
2028
  const selectCtrlByAll = (param) => {
2007
2029
  const { keyProp } = param;
@@ -4238,13 +4260,15 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
4238
4260
  emit("ready", chartInstance);
4239
4261
  setChartOption();
4240
4262
  };
4241
- const destroy = () => {
4263
+ const destroy = (clear2 = true) => {
4242
4264
  const chartInstance = chartInstanceRef.value;
4243
4265
  if (!chartInstance) {
4244
4266
  return;
4245
4267
  }
4246
4268
  emit("destroy", chartInstance);
4247
- chartInstance.clear();
4269
+ if (clear2) {
4270
+ chartInstance.clear();
4271
+ }
4248
4272
  chartInstance.dispose();
4249
4273
  chartInstanceRef.value = void 0;
4250
4274
  };
@@ -4272,7 +4296,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
4272
4296
  if (!chartInstance) {
4273
4297
  return;
4274
4298
  }
4275
- destroy();
4299
+ destroy(false);
4276
4300
  init();
4277
4301
  if (chartOption) {
4278
4302
  chartInstanceRef.value.setOption(chartOption, true);