@1337exp/taoui 1.10.3 → 1.11.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.
package/dist/index.cjs CHANGED
@@ -2417,7 +2417,7 @@
2417
2417
  };
2418
2418
  }
2419
2419
  });
2420
- const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-f6b0e565"]]);
2420
+ const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-bb1ea2fb"]]);
2421
2421
  const _hoisted_1$z = {
2422
2422
  key: 0,
2423
2423
  class: "tao-tag__prefix"
@@ -2967,7 +2967,8 @@
2967
2967
  placeholder: { default: "" },
2968
2968
  modelValue: {},
2969
2969
  disabled: { type: Boolean, default: false },
2970
- size: { default: "medium" }
2970
+ size: { default: "medium" },
2971
+ wheel: { default: 0 }
2971
2972
  },
2972
2973
  emits: ["update:modelValue"],
2973
2974
  setup(__props, { emit: __emit }) {
@@ -3094,6 +3095,14 @@
3094
3095
  commit(props.max);
3095
3096
  }
3096
3097
  }
3098
+ function onWheel(event) {
3099
+ if (props.disabled || props.wheel <= 0 || showShadowModel.value) {
3100
+ return;
3101
+ }
3102
+ event.preventDefault();
3103
+ const delta = event.deltaY < 0 ? props.wheel : -props.wheel;
3104
+ commit(current.value + delta);
3105
+ }
3097
3106
  function onBlurShadowModel() {
3098
3107
  if (shadowModel.value) {
3099
3108
  const newValue = packModelValue(clampValue(parseFloat(shadowModel.value) || 0));
@@ -3149,7 +3158,8 @@
3149
3158
  onPointerup: onPointerEnd,
3150
3159
  onPointercancel: onPointerEnd,
3151
3160
  onLostpointercapture: onLostPointerCapture,
3152
- onKeydown
3161
+ onKeydown,
3162
+ onWheel
3153
3163
  }, [
3154
3164
  _cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "tao-slider__track" }, null, -1)),
3155
3165
  vue.createElementVNode("div", {
@@ -3184,7 +3194,7 @@
3184
3194
  };
3185
3195
  }
3186
3196
  });
3187
- const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-24a38782"]]);
3197
+ const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-a0a9cca1"]]);
3188
3198
  const _hoisted_1$s = { class: "tao-file-drop" };
3189
3199
  const _hoisted_2$p = { class: "tao-file-drop__row" };
3190
3200
  const _hoisted_3$k = ["aria-label"];
@@ -7259,6 +7269,7 @@
7259
7269
  let dragMoved = 0;
7260
7270
  let dragPointer = -1;
7261
7271
  let scrollFrame = 0;
7272
+ let focusFrame = 0;
7262
7273
  let autoplayTimer = 0;
7263
7274
  const step = vue.computed(() => Math.max(1, Math.round(props.perView)));
7264
7275
  const lastIndex = vue.computed(() => Math.max(count.value - step.value, 0));
@@ -7367,18 +7378,32 @@
7367
7378
  hoverPaused.value = false;
7368
7379
  syncAutoplay();
7369
7380
  }
7370
- function onFocusIn() {
7371
- focusPaused.value = true;
7372
- stopAutoplay();
7381
+ function hasKeyboardFocus(root) {
7382
+ const active = document.activeElement;
7383
+ if (!(active instanceof HTMLElement) || !root.contains(active)) {
7384
+ return false;
7385
+ }
7386
+ try {
7387
+ return active.matches(":focus-visible");
7388
+ } catch {
7389
+ return true;
7390
+ }
7373
7391
  }
7374
- function onFocusOut(event) {
7392
+ function scheduleFocusPause(event) {
7375
7393
  const root = event.currentTarget;
7376
- const next = event.relatedTarget;
7377
- if (next && root.contains(next)) {
7378
- return;
7379
- }
7380
- focusPaused.value = false;
7381
- syncAutoplay();
7394
+ cancelAnimationFrame(focusFrame);
7395
+ focusFrame = requestAnimationFrame(() => {
7396
+ if (!track.value) {
7397
+ return;
7398
+ }
7399
+ const next = hasKeyboardFocus(root);
7400
+ focusPaused.value = next;
7401
+ if (next) {
7402
+ stopAutoplay();
7403
+ return;
7404
+ }
7405
+ syncAutoplay();
7406
+ });
7382
7407
  }
7383
7408
  function onScroll() {
7384
7409
  if (dragging.value) {
@@ -7515,6 +7540,7 @@
7515
7540
  vue.onBeforeUnmount(() => {
7516
7541
  endDrag();
7517
7542
  cancelAnimationFrame(scrollFrame);
7543
+ cancelAnimationFrame(focusFrame);
7518
7544
  stopAutoplay();
7519
7545
  document.removeEventListener("visibilitychange", onVisibilityChange);
7520
7546
  window.removeEventListener("blur", onWindowBlur);
@@ -7526,8 +7552,8 @@
7526
7552
  style: vue.normalizeStyle(trackStyle.value),
7527
7553
  onMouseenter: onMouseEnter,
7528
7554
  onMouseleave: onMouseLeave,
7529
- onFocusin: onFocusIn,
7530
- onFocusout: onFocusOut
7555
+ onFocusin: scheduleFocusPause,
7556
+ onFocusout: scheduleFocusPause
7531
7557
  }, [
7532
7558
  vue.createElementVNode("div", _hoisted_1$4, [
7533
7559
  vue.renderSlot(_ctx.$slots, "prev", {
@@ -7650,7 +7676,7 @@
7650
7676
  };
7651
7677
  }
7652
7678
  });
7653
- const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-bc396e5d"]]);
7679
+ const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-b4139b57"]]);
7654
7680
  const _hoisted_1$3 = ["aria-label"];
7655
7681
  const _hoisted_2$2 = ["aria-label"];
7656
7682
  const _hoisted_3$2 = {