bkui-vue 0.0.1-beta.364 → 0.0.1-beta.366

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/dist/index.esm.js CHANGED
@@ -10907,6 +10907,7 @@ var Component$r = defineComponent({
10907
10907
  underline: PropTypes.bool.def(false),
10908
10908
  target: PropTypes.string.def("_self")
10909
10909
  },
10910
+ emits: ["click"],
10910
10911
  setup(props2, {
10911
10912
  emit
10912
10913
  }) {
@@ -11235,16 +11236,21 @@ const tooltips = {
11235
11236
  const opts = getOpts(binding);
11236
11237
  const { trigger } = opts;
11237
11238
  const popper2 = renderContent(opts);
11239
+ let delayTimeout = null;
11238
11240
  if (trigger === "hover") {
11239
11241
  let hideTimeout = null;
11240
11242
  el.addEventListener("mouseenter", () => {
11241
- show(el);
11242
- clearTimeout(hideTimeout);
11243
+ delayTimeout = setTimeout(() => {
11244
+ show(el);
11245
+ clearTimeout(hideTimeout);
11246
+ clearTimeout(delayTimeout);
11247
+ }, opts.delay);
11243
11248
  });
11244
11249
  popper2.addEventListener("mouseenter", () => {
11245
11250
  clearTimeout(hideTimeout);
11246
11251
  });
11247
11252
  el.addEventListener("mouseleave", () => {
11253
+ clearTimeout(delayTimeout);
11248
11254
  hideTimeout = setTimeout(() => {
11249
11255
  hide$1(el);
11250
11256
  }, 100);
@@ -11253,6 +11259,7 @@ const tooltips = {
11253
11259
  hide$1(el);
11254
11260
  });
11255
11261
  popper2.addEventListener("mouseleave", () => {
11262
+ clearTimeout(delayTimeout);
11256
11263
  hideTimeout = setTimeout(() => {
11257
11264
  hide$1(el);
11258
11265
  }, 100);
@@ -11260,7 +11267,10 @@ const tooltips = {
11260
11267
  } else if (trigger === "click") {
11261
11268
  document.body.addEventListener("click", (event) => {
11262
11269
  if (el.contains(event.target) && !popper2.hasAttribute("data-show")) {
11263
- show(el);
11270
+ delayTimeout = setTimeout(() => {
11271
+ show(el);
11272
+ clearTimeout(delayTimeout);
11273
+ }, opts.delay);
11264
11274
  } else if (popper2.hasAttribute("data-show")) {
11265
11275
  hide$1(el);
11266
11276
  }
@@ -11291,6 +11301,7 @@ function initOptions() {
11291
11301
  placement: "top",
11292
11302
  distance: 8,
11293
11303
  extCls: "",
11304
+ delay: 0,
11294
11305
  onShow: () => {
11295
11306
  },
11296
11307
  onHide: () => {