@vueuse/components 7.6.2 → 8.0.0-beta.2

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/index.iife.js CHANGED
@@ -152,6 +152,59 @@
152
152
  onClickOutside(el, binding.value);
153
153
  };
154
154
 
155
+ const createKeyPredicate = (keyFilter) => {
156
+ if (typeof keyFilter === "function")
157
+ return keyFilter;
158
+ else if (typeof keyFilter === "string")
159
+ return (event) => event.key === keyFilter;
160
+ else if (Array.isArray(keyFilter))
161
+ return (event) => keyFilter.includes(event.key);
162
+ else if (keyFilter)
163
+ return () => true;
164
+ else
165
+ return () => false;
166
+ };
167
+ function onKeyStroke(key, handler, options = {}) {
168
+ const { target = defaultWindow, eventName = "keydown", passive = false } = options;
169
+ const predicate = createKeyPredicate(key);
170
+ const listener = (e) => {
171
+ if (predicate(e))
172
+ handler(e);
173
+ };
174
+ return useEventListener(target, eventName, listener, passive);
175
+ }
176
+
177
+ var __defProp$b = Object.defineProperty;
178
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
179
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
180
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
181
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
182
+ var __spreadValues$b = (a, b) => {
183
+ for (var prop in b || (b = {}))
184
+ if (__hasOwnProp$b.call(b, prop))
185
+ __defNormalProp$b(a, prop, b[prop]);
186
+ if (__getOwnPropSymbols$b)
187
+ for (var prop of __getOwnPropSymbols$b(b)) {
188
+ if (__propIsEnum$b.call(b, prop))
189
+ __defNormalProp$b(a, prop, b[prop]);
190
+ }
191
+ return a;
192
+ };
193
+ const vOnKeyStroke = (el, binding) => {
194
+ var _a, _b;
195
+ const keys = (_b = (_a = binding.arg) == null ? void 0 : _a.split(",")) != null ? _b : [];
196
+ if (typeof binding.value === "function") {
197
+ onKeyStroke(keys, binding.value, {
198
+ target: el
199
+ });
200
+ } else {
201
+ const [handler, options] = binding.value;
202
+ onKeyStroke(keys, handler, __spreadValues$b({
203
+ target: el
204
+ }, options));
205
+ }
206
+ };
207
+
155
208
  const DEFAULT_DELAY = 500;
156
209
  function onLongPress(target, handler, options) {
157
210
  const elementRef = vueDemi.computed(() => core.unrefElement(target));
@@ -192,7 +245,7 @@
192
245
  if (typeof binding.value === "function")
193
246
  onLongPress(el, binding.value);
194
247
  else
195
- onLongPress(el, binding.value.handler, binding.value.options);
248
+ onLongPress(el, ...binding.value);
196
249
  };
197
250
 
198
251
  const UseActiveElement = vueDemi.defineComponent({
@@ -373,19 +426,19 @@
373
426
  return useMediaQuery("(prefers-color-scheme: dark)", options);
374
427
  }
375
428
 
376
- var __defProp$8 = Object.defineProperty;
377
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
378
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
379
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
380
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
381
- var __spreadValues$8 = (a, b) => {
429
+ var __defProp$a = Object.defineProperty;
430
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
431
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
432
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
433
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
434
+ var __spreadValues$a = (a, b) => {
382
435
  for (var prop in b || (b = {}))
383
- if (__hasOwnProp$8.call(b, prop))
384
- __defNormalProp$8(a, prop, b[prop]);
385
- if (__getOwnPropSymbols$8)
386
- for (var prop of __getOwnPropSymbols$8(b)) {
387
- if (__propIsEnum$8.call(b, prop))
388
- __defNormalProp$8(a, prop, b[prop]);
436
+ if (__hasOwnProp$a.call(b, prop))
437
+ __defNormalProp$a(a, prop, b[prop]);
438
+ if (__getOwnPropSymbols$a)
439
+ for (var prop of __getOwnPropSymbols$a(b)) {
440
+ if (__propIsEnum$a.call(b, prop))
441
+ __defNormalProp$a(a, prop, b[prop]);
389
442
  }
390
443
  return a;
391
444
  };
@@ -399,7 +452,7 @@
399
452
  listenToStorageChanges = true,
400
453
  storageRef
401
454
  } = options;
402
- const modes = __spreadValues$8({
455
+ const modes = __spreadValues$a({
403
456
  auto: "",
404
457
  light: "light",
405
458
  dark: "dark"
@@ -537,25 +590,25 @@
537
590
  }
538
591
  });
539
592
 
540
- var __defProp$7 = Object.defineProperty;
541
- var __defProps$6 = Object.defineProperties;
542
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
543
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
544
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
545
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
546
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
547
- var __spreadValues$7 = (a, b) => {
593
+ var __defProp$9 = Object.defineProperty;
594
+ var __defProps$8 = Object.defineProperties;
595
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
596
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
597
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
598
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
599
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
600
+ var __spreadValues$9 = (a, b) => {
548
601
  for (var prop in b || (b = {}))
549
- if (__hasOwnProp$7.call(b, prop))
550
- __defNormalProp$7(a, prop, b[prop]);
551
- if (__getOwnPropSymbols$7)
552
- for (var prop of __getOwnPropSymbols$7(b)) {
553
- if (__propIsEnum$7.call(b, prop))
554
- __defNormalProp$7(a, prop, b[prop]);
602
+ if (__hasOwnProp$9.call(b, prop))
603
+ __defNormalProp$9(a, prop, b[prop]);
604
+ if (__getOwnPropSymbols$9)
605
+ for (var prop of __getOwnPropSymbols$9(b)) {
606
+ if (__propIsEnum$9.call(b, prop))
607
+ __defNormalProp$9(a, prop, b[prop]);
555
608
  }
556
609
  return a;
557
610
  };
558
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
611
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
559
612
  const UseDraggable = vueDemi.defineComponent({
560
613
  name: "UseDraggable",
561
614
  props: [
@@ -570,7 +623,7 @@
570
623
  setup(props, { slots }) {
571
624
  const target = vueDemi.ref();
572
625
  const initialValue = props.storageKey ? core.useStorage(props.storageKey, vueDemi.unref(props.initialValue) || { x: 0, y: 0 }, core.isClient ? props.storageType === "session" ? sessionStorage : localStorage : void 0) : props.initialValue || { x: 0, y: 0 };
573
- const data = vueDemi.reactive(core.useDraggable(target, __spreadProps$6(__spreadValues$7({}, props), {
626
+ const data = vueDemi.reactive(core.useDraggable(target, __spreadProps$8(__spreadValues$9({}, props), {
574
627
  initialValue
575
628
  })));
576
629
  return () => {
@@ -593,6 +646,20 @@
593
646
  }
594
647
  });
595
648
 
649
+ function useElementHover(el) {
650
+ const isHovered = vueDemi.ref(false);
651
+ useEventListener(el, "mouseenter", () => isHovered.value = true);
652
+ useEventListener(el, "mouseleave", () => isHovered.value = false);
653
+ return isHovered;
654
+ }
655
+
656
+ const vElementHover = (el, binding) => {
657
+ if (typeof binding.value === "function") {
658
+ const isHovered = useElementHover(el);
659
+ vueDemi.watch(isHovered, (v) => binding.value(v));
660
+ }
661
+ };
662
+
596
663
  const UseElementSize = vueDemi.defineComponent({
597
664
  name: "UseElementSize",
598
665
  props: ["width", "height", "box"],
@@ -672,6 +739,160 @@
672
739
  }
673
740
  });
674
741
 
742
+ function useScroll(element, options = {}) {
743
+ const {
744
+ throttle = 0,
745
+ idle = 200,
746
+ onStop = shared.noop,
747
+ onScroll = shared.noop,
748
+ offset = {
749
+ left: 0,
750
+ right: 0,
751
+ top: 0,
752
+ bottom: 0
753
+ },
754
+ eventListenerOptions = {
755
+ capture: false,
756
+ passive: true
757
+ }
758
+ } = options;
759
+ const x = vueDemi.ref(0);
760
+ const y = vueDemi.ref(0);
761
+ const isScrolling = vueDemi.ref(false);
762
+ const arrivedState = vueDemi.reactive({
763
+ left: true,
764
+ right: false,
765
+ top: true,
766
+ bottom: false
767
+ });
768
+ const directions = vueDemi.reactive({
769
+ left: false,
770
+ right: false,
771
+ top: false,
772
+ bottom: false
773
+ });
774
+ if (element) {
775
+ const onScrollEnd = shared.useDebounceFn((e) => {
776
+ isScrolling.value = false;
777
+ directions.left = false;
778
+ directions.right = false;
779
+ directions.top = false;
780
+ directions.bottom = false;
781
+ onStop(e);
782
+ }, throttle + idle);
783
+ const onScrollHandler = (e) => {
784
+ const eventTarget = e.target === document ? e.target.documentElement : e.target;
785
+ const scrollLeft = eventTarget.scrollLeft;
786
+ directions.left = scrollLeft < x.value;
787
+ directions.right = scrollLeft > x.value;
788
+ arrivedState.left = scrollLeft <= 0 + (offset.left || 0);
789
+ arrivedState.right = scrollLeft + eventTarget.clientWidth >= eventTarget.scrollWidth - (offset.right || 0);
790
+ x.value = scrollLeft;
791
+ const scrollTop = eventTarget.scrollTop;
792
+ directions.top = scrollTop < y.value;
793
+ directions.bottom = scrollTop > y.value;
794
+ arrivedState.top = scrollTop <= 0 + (offset.top || 0);
795
+ arrivedState.bottom = scrollTop + eventTarget.clientHeight >= eventTarget.scrollHeight - (offset.bottom || 0);
796
+ y.value = scrollTop;
797
+ isScrolling.value = true;
798
+ onScrollEnd(e);
799
+ onScroll(e);
800
+ };
801
+ useEventListener(element, "scroll", throttle ? shared.useThrottleFn(onScrollHandler, throttle) : onScrollHandler, eventListenerOptions);
802
+ }
803
+ return {
804
+ x,
805
+ y,
806
+ isScrolling,
807
+ arrivedState,
808
+ directions
809
+ };
810
+ }
811
+
812
+ var __defProp$8 = Object.defineProperty;
813
+ var __defProps$7 = Object.defineProperties;
814
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
815
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
816
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
817
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
818
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
819
+ var __spreadValues$8 = (a, b) => {
820
+ for (var prop in b || (b = {}))
821
+ if (__hasOwnProp$8.call(b, prop))
822
+ __defNormalProp$8(a, prop, b[prop]);
823
+ if (__getOwnPropSymbols$8)
824
+ for (var prop of __getOwnPropSymbols$8(b)) {
825
+ if (__propIsEnum$8.call(b, prop))
826
+ __defNormalProp$8(a, prop, b[prop]);
827
+ }
828
+ return a;
829
+ };
830
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
831
+ function useInfiniteScroll(element, onLoadMore, options = {}) {
832
+ var _a;
833
+ const state = vueDemi.reactive(useScroll(element, __spreadProps$7(__spreadValues$8({}, options), {
834
+ offset: __spreadValues$8({
835
+ bottom: (_a = options.distance) != null ? _a : 0
836
+ }, options.offset)
837
+ })));
838
+ vueDemi.watch(() => state.arrivedState.bottom, (v) => {
839
+ if (v)
840
+ onLoadMore(state);
841
+ });
842
+ }
843
+
844
+ const vInfiniteScroll = (el, binding) => {
845
+ if (typeof binding.value === "function")
846
+ useInfiniteScroll(el, binding.value);
847
+ else
848
+ useInfiniteScroll(el, ...binding.value);
849
+ };
850
+
851
+ function useIntersectionObserver(target, callback, options = {}) {
852
+ const {
853
+ root,
854
+ rootMargin = "0px",
855
+ threshold = 0.1,
856
+ window = defaultWindow
857
+ } = options;
858
+ const isSupported = window && "IntersectionObserver" in window;
859
+ let cleanup = shared.noop;
860
+ const stopWatch = isSupported ? vueDemi.watch(() => ({
861
+ el: unrefElement(target),
862
+ root: unrefElement(root)
863
+ }), ({ el, root: root2 }) => {
864
+ cleanup();
865
+ if (!el)
866
+ return;
867
+ const observer = new window.IntersectionObserver(callback, {
868
+ root: root2,
869
+ rootMargin,
870
+ threshold
871
+ });
872
+ observer.observe(el);
873
+ cleanup = () => {
874
+ observer.disconnect();
875
+ cleanup = shared.noop;
876
+ };
877
+ }, { immediate: true, flush: "post" }) : shared.noop;
878
+ const stop = () => {
879
+ cleanup();
880
+ stopWatch();
881
+ };
882
+ shared.tryOnScopeDispose(stop);
883
+ return {
884
+ isSupported,
885
+ stop
886
+ };
887
+ }
888
+
889
+ const vIntersectionObserver = (el, binding) => {
890
+ if (typeof binding.value === "function")
891
+ useIntersectionObserver(el, binding.value);
892
+ else
893
+ useIntersectionObserver(el, ...binding.value);
894
+ };
895
+
675
896
  const UseMouse = vueDemi.defineComponent({
676
897
  name: "UseMouse",
677
898
  props: ["touch", "resetOnTouchEnds", "initialValue"],
@@ -697,31 +918,31 @@
697
918
  }
698
919
  });
699
920
 
700
- var __defProp$6 = Object.defineProperty;
701
- var __defProps$5 = Object.defineProperties;
702
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
703
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
704
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
705
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
706
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
707
- var __spreadValues$6 = (a, b) => {
921
+ var __defProp$7 = Object.defineProperty;
922
+ var __defProps$6 = Object.defineProperties;
923
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
924
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
925
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
926
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
927
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
928
+ var __spreadValues$7 = (a, b) => {
708
929
  for (var prop in b || (b = {}))
709
- if (__hasOwnProp$6.call(b, prop))
710
- __defNormalProp$6(a, prop, b[prop]);
711
- if (__getOwnPropSymbols$6)
712
- for (var prop of __getOwnPropSymbols$6(b)) {
713
- if (__propIsEnum$6.call(b, prop))
714
- __defNormalProp$6(a, prop, b[prop]);
930
+ if (__hasOwnProp$7.call(b, prop))
931
+ __defNormalProp$7(a, prop, b[prop]);
932
+ if (__getOwnPropSymbols$7)
933
+ for (var prop of __getOwnPropSymbols$7(b)) {
934
+ if (__propIsEnum$7.call(b, prop))
935
+ __defNormalProp$7(a, prop, b[prop]);
715
936
  }
716
937
  return a;
717
938
  };
718
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
939
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
719
940
  const UseMousePressed = vueDemi.defineComponent({
720
941
  name: "UseMousePressed",
721
942
  props: ["touch", "initialValue", "as"],
722
943
  setup(props, { slots }) {
723
944
  const target = vueDemi.ref();
724
- const data = vueDemi.reactive(core.useMousePressed(__spreadProps$5(__spreadValues$6({}, props), { target })));
945
+ const data = vueDemi.reactive(core.useMousePressed(__spreadProps$6(__spreadValues$7({}, props), { target })));
725
946
  return () => {
726
947
  if (slots.default)
727
948
  return vueDemi.h(props.as || "div", { ref: target }, slots.default(data));
@@ -740,30 +961,30 @@
740
961
  }
741
962
  });
742
963
 
743
- var __defProp$5 = Object.defineProperty;
744
- var __defProps$4 = Object.defineProperties;
745
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
746
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
747
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
748
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
749
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
750
- var __spreadValues$5 = (a, b) => {
964
+ var __defProp$6 = Object.defineProperty;
965
+ var __defProps$5 = Object.defineProperties;
966
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
967
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
968
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
969
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
970
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
971
+ var __spreadValues$6 = (a, b) => {
751
972
  for (var prop in b || (b = {}))
752
- if (__hasOwnProp$5.call(b, prop))
753
- __defNormalProp$5(a, prop, b[prop]);
754
- if (__getOwnPropSymbols$5)
755
- for (var prop of __getOwnPropSymbols$5(b)) {
756
- if (__propIsEnum$5.call(b, prop))
757
- __defNormalProp$5(a, prop, b[prop]);
973
+ if (__hasOwnProp$6.call(b, prop))
974
+ __defNormalProp$6(a, prop, b[prop]);
975
+ if (__getOwnPropSymbols$6)
976
+ for (var prop of __getOwnPropSymbols$6(b)) {
977
+ if (__propIsEnum$6.call(b, prop))
978
+ __defNormalProp$6(a, prop, b[prop]);
758
979
  }
759
980
  return a;
760
981
  };
761
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
982
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
762
983
  const UseNow = vueDemi.defineComponent({
763
984
  name: "UseNow",
764
985
  props: ["interval"],
765
986
  setup(props, { slots }) {
766
- const data = vueDemi.reactive(core.useNow(__spreadProps$4(__spreadValues$5({}, props), { controls: true })));
987
+ const data = vueDemi.reactive(core.useNow(__spreadProps$5(__spreadValues$6({}, props), { controls: true })));
767
988
  return () => {
768
989
  if (slots.default)
769
990
  return slots.default(data);
@@ -771,25 +992,25 @@
771
992
  }
772
993
  });
773
994
 
774
- var __defProp$4 = Object.defineProperty;
775
- var __defProps$3 = Object.defineProperties;
776
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
777
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
778
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
779
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
780
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
781
- var __spreadValues$4 = (a, b) => {
995
+ var __defProp$5 = Object.defineProperty;
996
+ var __defProps$4 = Object.defineProperties;
997
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
998
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
999
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1000
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1001
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1002
+ var __spreadValues$5 = (a, b) => {
782
1003
  for (var prop in b || (b = {}))
783
- if (__hasOwnProp$4.call(b, prop))
784
- __defNormalProp$4(a, prop, b[prop]);
785
- if (__getOwnPropSymbols$4)
786
- for (var prop of __getOwnPropSymbols$4(b)) {
787
- if (__propIsEnum$4.call(b, prop))
788
- __defNormalProp$4(a, prop, b[prop]);
1004
+ if (__hasOwnProp$5.call(b, prop))
1005
+ __defNormalProp$5(a, prop, b[prop]);
1006
+ if (__getOwnPropSymbols$5)
1007
+ for (var prop of __getOwnPropSymbols$5(b)) {
1008
+ if (__propIsEnum$5.call(b, prop))
1009
+ __defNormalProp$5(a, prop, b[prop]);
789
1010
  }
790
1011
  return a;
791
1012
  };
792
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
1013
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
793
1014
  const UseOffsetPagination = vueDemi.defineComponent({
794
1015
  name: "UseOffsetPagination",
795
1016
  props: [
@@ -806,7 +1027,7 @@
806
1027
  "page-count-change"
807
1028
  ],
808
1029
  setup(props, { slots, emit }) {
809
- const data = vueDemi.reactive(core.useOffsetPagination(__spreadProps$3(__spreadValues$4({}, props), {
1030
+ const data = vueDemi.reactive(core.useOffsetPagination(__spreadProps$4(__spreadValues$5({}, props), {
810
1031
  onPageChange(...args) {
811
1032
  var _a;
812
1033
  (_a = props.onPageChange) == null ? void 0 : _a.call(props, ...args);
@@ -856,25 +1077,25 @@
856
1077
  }
857
1078
  });
858
1079
 
859
- var __defProp$3 = Object.defineProperty;
860
- var __defProps$2 = Object.defineProperties;
861
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
862
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
863
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
864
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
865
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
866
- var __spreadValues$3 = (a, b) => {
1080
+ var __defProp$4 = Object.defineProperty;
1081
+ var __defProps$3 = Object.defineProperties;
1082
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
1083
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1084
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1085
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1086
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1087
+ var __spreadValues$4 = (a, b) => {
867
1088
  for (var prop in b || (b = {}))
868
- if (__hasOwnProp$3.call(b, prop))
869
- __defNormalProp$3(a, prop, b[prop]);
870
- if (__getOwnPropSymbols$3)
871
- for (var prop of __getOwnPropSymbols$3(b)) {
872
- if (__propIsEnum$3.call(b, prop))
873
- __defNormalProp$3(a, prop, b[prop]);
1089
+ if (__hasOwnProp$4.call(b, prop))
1090
+ __defNormalProp$4(a, prop, b[prop]);
1091
+ if (__getOwnPropSymbols$4)
1092
+ for (var prop of __getOwnPropSymbols$4(b)) {
1093
+ if (__propIsEnum$4.call(b, prop))
1094
+ __defNormalProp$4(a, prop, b[prop]);
874
1095
  }
875
1096
  return a;
876
1097
  };
877
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
1098
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
878
1099
  const UsePointer = vueDemi.defineComponent({
879
1100
  name: "UsePointer",
880
1101
  props: [
@@ -884,7 +1105,7 @@
884
1105
  ],
885
1106
  setup(props, { slots }) {
886
1107
  const el = vueDemi.ref(null);
887
- const data = vueDemi.reactive(core.usePointer(__spreadProps$2(__spreadValues$3({}, props), {
1108
+ const data = vueDemi.reactive(core.usePointer(__spreadProps$3(__spreadValues$4({}, props), {
888
1109
  target: props.target === "self" ? el : defaultWindow
889
1110
  })));
890
1111
  return () => {
@@ -1024,6 +1245,122 @@
1024
1245
  }
1025
1246
  });
1026
1247
 
1248
+ var __defProp$3 = Object.defineProperty;
1249
+ var __defProps$2 = Object.defineProperties;
1250
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
1251
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1252
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1253
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1254
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1255
+ var __spreadValues$3 = (a, b) => {
1256
+ for (var prop in b || (b = {}))
1257
+ if (__hasOwnProp$3.call(b, prop))
1258
+ __defNormalProp$3(a, prop, b[prop]);
1259
+ if (__getOwnPropSymbols$3)
1260
+ for (var prop of __getOwnPropSymbols$3(b)) {
1261
+ if (__propIsEnum$3.call(b, prop))
1262
+ __defNormalProp$3(a, prop, b[prop]);
1263
+ }
1264
+ return a;
1265
+ };
1266
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
1267
+ const vScroll = (el, binding) => {
1268
+ if (typeof binding.value === "function") {
1269
+ const handler = binding.value;
1270
+ const state = useScroll(el, {
1271
+ onScroll() {
1272
+ handler(state);
1273
+ },
1274
+ onStop() {
1275
+ handler(state);
1276
+ }
1277
+ });
1278
+ } else {
1279
+ const [handler, options] = binding.value;
1280
+ const state = useScroll(el, __spreadProps$2(__spreadValues$3({}, options), {
1281
+ onScroll(e) {
1282
+ var _a;
1283
+ (_a = options.onScroll) == null ? void 0 : _a.call(options, e);
1284
+ handler(state);
1285
+ },
1286
+ onStop(e) {
1287
+ var _a;
1288
+ (_a = options.onStop) == null ? void 0 : _a.call(options, e);
1289
+ handler(state);
1290
+ }
1291
+ }));
1292
+ }
1293
+ };
1294
+
1295
+ var _a, _b;
1296
+ function preventDefault(rawEvent) {
1297
+ const e = rawEvent || window.event;
1298
+ if (e.touches.length > 1)
1299
+ return true;
1300
+ if (e.preventDefault)
1301
+ e.preventDefault();
1302
+ return false;
1303
+ }
1304
+ const isIOS = shared.isClient && (window == null ? void 0 : window.navigator) && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.platform) && /iP(ad|hone|od)/.test((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.platform);
1305
+ function useScrollLock(element, initialState = false) {
1306
+ const isLocked = vueDemi.ref(initialState);
1307
+ let touchMoveListener = null;
1308
+ let initialOverflow;
1309
+ vueDemi.watch(() => vueDemi.unref(element), (el) => {
1310
+ if (el) {
1311
+ const ele = el;
1312
+ initialOverflow = ele.style.overflow;
1313
+ if (isLocked.value)
1314
+ ele.style.overflow = "hidden";
1315
+ }
1316
+ }, {
1317
+ immediate: true
1318
+ });
1319
+ const lock = () => {
1320
+ const ele = vueDemi.unref(element);
1321
+ if (!ele || isLocked.value)
1322
+ return;
1323
+ if (isIOS) {
1324
+ touchMoveListener = useEventListener(document, "touchmove", preventDefault, { passive: false });
1325
+ }
1326
+ ele.style.overflow = "hidden";
1327
+ isLocked.value = true;
1328
+ };
1329
+ const unlock = () => {
1330
+ const ele = vueDemi.unref(element);
1331
+ if (!ele || !isLocked.value)
1332
+ return;
1333
+ isIOS && (touchMoveListener == null ? void 0 : touchMoveListener());
1334
+ ele.style.overflow = initialOverflow;
1335
+ isLocked.value = false;
1336
+ };
1337
+ return vueDemi.computed({
1338
+ get() {
1339
+ return isLocked.value;
1340
+ },
1341
+ set(v) {
1342
+ if (v)
1343
+ lock();
1344
+ else
1345
+ unlock();
1346
+ }
1347
+ });
1348
+ }
1349
+
1350
+ const onScrollLock = () => {
1351
+ let isMounted = false;
1352
+ const state = vueDemi.ref(false);
1353
+ return (el, binding) => {
1354
+ state.value = binding.value;
1355
+ if (isMounted)
1356
+ return;
1357
+ isMounted = true;
1358
+ const isLocked = useScrollLock(el, binding.value);
1359
+ vueDemi.watch(state, (v) => isLocked.value = v);
1360
+ };
1361
+ };
1362
+ const vScrollLock = onScrollLock();
1363
+
1027
1364
  var __defProp$2 = Object.defineProperty;
1028
1365
  var __defProps$1 = Object.defineProperties;
1029
1366
  var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
@@ -1185,6 +1522,12 @@
1185
1522
  exports.UseWindowSize = UseWindowSize;
1186
1523
  exports.VOnClickOutside = VOnClickOutside;
1187
1524
  exports.VOnLongPress = VOnLongPress;
1525
+ exports.vElementHover = vElementHover;
1526
+ exports.vInfiniteScroll = vInfiniteScroll;
1527
+ exports.vIntersectionObserver = vIntersectionObserver;
1528
+ exports.vOnKeyStroke = vOnKeyStroke;
1529
+ exports.vScroll = vScroll;
1530
+ exports.vScrollLock = vScrollLock;
1188
1531
 
1189
1532
  Object.defineProperty(exports, '__esModule', { value: true });
1190
1533