@varlet/use 3.8.2 → 3.9.0-alpha.1736270797421
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/lib/index.cjs +6 -6
- package/lib/index.js +16 -16
- package/package.json +2 -2
package/lib/index.cjs
CHANGED
|
@@ -65,8 +65,8 @@ __export(src_exports, {
|
|
|
65
65
|
module.exports = __toCommonJS(src_exports);
|
|
66
66
|
|
|
67
67
|
// src/useEventListener.ts
|
|
68
|
-
var import_shared = require("@varlet/shared");
|
|
69
68
|
var import_vue2 = require("vue");
|
|
69
|
+
var import_shared = require("@varlet/shared");
|
|
70
70
|
|
|
71
71
|
// src/onSmartMounted.ts
|
|
72
72
|
var import_vue = require("vue");
|
|
@@ -148,8 +148,8 @@ function useEventListener(target, type, listener, options = {}) {
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
// src/useClickOutside.ts
|
|
151
|
-
var import_shared2 = require("@varlet/shared");
|
|
152
151
|
var import_vue3 = require("vue");
|
|
152
|
+
var import_shared2 = require("@varlet/shared");
|
|
153
153
|
function useClickOutside(target, type, listener) {
|
|
154
154
|
if (!(0, import_shared2.inBrowser)()) {
|
|
155
155
|
return;
|
|
@@ -217,8 +217,8 @@ function useParent(key) {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
// src/useChildren.ts
|
|
220
|
-
var import_shared3 = require("@varlet/shared");
|
|
221
220
|
var import_vue6 = require("vue");
|
|
221
|
+
var import_shared3 = require("@varlet/shared");
|
|
222
222
|
function flatVNodes(subTree) {
|
|
223
223
|
const vNodes = [];
|
|
224
224
|
const flat = (subTree2) => {
|
|
@@ -434,8 +434,8 @@ function useClientId() {
|
|
|
434
434
|
}
|
|
435
435
|
|
|
436
436
|
// src/useWindowSize.ts
|
|
437
|
-
var import_shared7 = require("@varlet/shared");
|
|
438
437
|
var import_vue11 = require("vue");
|
|
438
|
+
var import_shared7 = require("@varlet/shared");
|
|
439
439
|
function useWindowSize(options = {}) {
|
|
440
440
|
const { initialWidth = 0, initialHeight = 0 } = options;
|
|
441
441
|
const width = (0, import_vue11.ref)(initialWidth);
|
|
@@ -456,8 +456,8 @@ function useWindowSize(options = {}) {
|
|
|
456
456
|
}
|
|
457
457
|
|
|
458
458
|
// src/useVModel.ts
|
|
459
|
-
var import_shared8 = require("@varlet/shared");
|
|
460
459
|
var import_vue12 = require("vue");
|
|
460
|
+
var import_shared8 = require("@varlet/shared");
|
|
461
461
|
function useVModel(props, key, options = {}) {
|
|
462
462
|
const { passive = true, eventName, defaultValue, emit } = options;
|
|
463
463
|
const event = eventName != null ? eventName : `onUpdate:${key.toString()}`;
|
|
@@ -500,8 +500,8 @@ function useVModel(props, key, options = {}) {
|
|
|
500
500
|
}
|
|
501
501
|
|
|
502
502
|
// src/useMotion.ts
|
|
503
|
-
var import_shared9 = require("@varlet/shared");
|
|
504
503
|
var import_vue13 = require("vue");
|
|
504
|
+
var import_shared9 = require("@varlet/shared");
|
|
505
505
|
function useMotion(options) {
|
|
506
506
|
const value = (0, import_vue13.ref)(getter(options.from));
|
|
507
507
|
const state = (0, import_vue13.ref)("pending");
|
package/lib/index.js
CHANGED
|
@@ -28,11 +28,11 @@ var __objRest = (source, exclude) => {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
// src/useEventListener.ts
|
|
31
|
+
import { isRef, onBeforeUnmount, onDeactivated, unref, watch } from "vue";
|
|
31
32
|
import { inBrowser, isFunction } from "@varlet/shared";
|
|
32
|
-
import { isRef, onDeactivated, onBeforeUnmount, unref, watch } from "vue";
|
|
33
33
|
|
|
34
34
|
// src/onSmartMounted.ts
|
|
35
|
-
import {
|
|
35
|
+
import { nextTick, onActivated, onMounted } from "vue";
|
|
36
36
|
function onSmartMounted(hook) {
|
|
37
37
|
let isMounted = false;
|
|
38
38
|
onMounted(() => {
|
|
@@ -111,8 +111,8 @@ function useEventListener(target, type, listener, options = {}) {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
// src/useClickOutside.ts
|
|
114
|
-
import { inBrowser as inBrowser2, isFunction as isFunction2 } from "@varlet/shared";
|
|
115
114
|
import { unref as unref2 } from "vue";
|
|
115
|
+
import { inBrowser as inBrowser2, isFunction as isFunction2 } from "@varlet/shared";
|
|
116
116
|
function useClickOutside(target, type, listener) {
|
|
117
117
|
if (!inBrowser2()) {
|
|
118
118
|
return;
|
|
@@ -144,12 +144,12 @@ function onSmartUnmounted(hook) {
|
|
|
144
144
|
|
|
145
145
|
// src/useParent.ts
|
|
146
146
|
import {
|
|
147
|
+
computed,
|
|
147
148
|
getCurrentInstance,
|
|
148
149
|
inject,
|
|
149
|
-
onMounted as onMounted2,
|
|
150
|
-
onBeforeUnmount as onBeforeUnmount2,
|
|
151
150
|
nextTick as nextTick2,
|
|
152
|
-
|
|
151
|
+
onBeforeUnmount as onBeforeUnmount2,
|
|
152
|
+
onMounted as onMounted2
|
|
153
153
|
} from "vue";
|
|
154
154
|
function keyInProvides(key) {
|
|
155
155
|
const instance = getCurrentInstance();
|
|
@@ -187,14 +187,14 @@ function useParent(key) {
|
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
// src/useChildren.ts
|
|
190
|
-
import { removeItem, isArray } from "@varlet/shared";
|
|
191
190
|
import {
|
|
192
|
-
getCurrentInstance as getCurrentInstance2,
|
|
193
191
|
computed as computed2,
|
|
192
|
+
getCurrentInstance as getCurrentInstance2,
|
|
193
|
+
isVNode,
|
|
194
194
|
provide,
|
|
195
|
-
reactive
|
|
196
|
-
isVNode
|
|
195
|
+
reactive
|
|
197
196
|
} from "vue";
|
|
197
|
+
import { isArray, removeItem } from "@varlet/shared";
|
|
198
198
|
function flatVNodes(subTree) {
|
|
199
199
|
const vNodes = [];
|
|
200
200
|
const flat = (subTree2) => {
|
|
@@ -253,7 +253,7 @@ function onWindowResize(listener) {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
// src/useInitialized.ts
|
|
256
|
-
import { watch as watch2
|
|
256
|
+
import { ref, watch as watch2 } from "vue";
|
|
257
257
|
function useInitialized(source, value) {
|
|
258
258
|
const initialized = ref(false);
|
|
259
259
|
watch2(
|
|
@@ -384,7 +384,7 @@ function useTouch() {
|
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
// src/useId.ts
|
|
387
|
-
import {
|
|
387
|
+
import { getCurrentInstance as getCurrentInstance3, ref as ref3 } from "vue";
|
|
388
388
|
import { kebabCase } from "@varlet/shared";
|
|
389
389
|
function useId() {
|
|
390
390
|
const id = ref3();
|
|
@@ -395,7 +395,7 @@ function useId() {
|
|
|
395
395
|
}
|
|
396
396
|
|
|
397
397
|
// src/useClientId.ts
|
|
398
|
-
import {
|
|
398
|
+
import { getCurrentInstance as getCurrentInstance4, onMounted as onMounted3, ref as ref4 } from "vue";
|
|
399
399
|
import { kebabCase as kebabCase2 } from "@varlet/shared";
|
|
400
400
|
function useClientId() {
|
|
401
401
|
const instance = getCurrentInstance4();
|
|
@@ -410,8 +410,8 @@ function useClientId() {
|
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
// src/useWindowSize.ts
|
|
413
|
-
import { inBrowser as inBrowser3 } from "@varlet/shared";
|
|
414
413
|
import { ref as ref5 } from "vue";
|
|
414
|
+
import { inBrowser as inBrowser3 } from "@varlet/shared";
|
|
415
415
|
function useWindowSize(options = {}) {
|
|
416
416
|
const { initialWidth = 0, initialHeight = 0 } = options;
|
|
417
417
|
const width = ref5(initialWidth);
|
|
@@ -432,8 +432,8 @@ function useWindowSize(options = {}) {
|
|
|
432
432
|
}
|
|
433
433
|
|
|
434
434
|
// src/useVModel.ts
|
|
435
|
-
import { call } from "@varlet/shared";
|
|
436
435
|
import { computed as computed3, nextTick as nextTick3, ref as ref6, watch as watch3 } from "vue";
|
|
436
|
+
import { call } from "@varlet/shared";
|
|
437
437
|
function useVModel(props, key, options = {}) {
|
|
438
438
|
const { passive = true, eventName, defaultValue, emit } = options;
|
|
439
439
|
const event = eventName != null ? eventName : `onUpdate:${key.toString()}`;
|
|
@@ -476,8 +476,8 @@ function useVModel(props, key, options = {}) {
|
|
|
476
476
|
}
|
|
477
477
|
|
|
478
478
|
// src/useMotion.ts
|
|
479
|
-
import { isFunction as isFunction3, motion } from "@varlet/shared";
|
|
480
479
|
import { ref as ref7 } from "vue";
|
|
480
|
+
import { isFunction as isFunction3, motion } from "@varlet/shared";
|
|
481
481
|
function useMotion(options) {
|
|
482
482
|
const value = ref7(getter(options.from));
|
|
483
483
|
const state = ref7("pending");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/use",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0-alpha.1736270797421",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"url": "https://github.com/varletjs/varlet/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@varlet/shared": "3.
|
|
36
|
+
"@varlet/shared": "3.9.0-alpha.1736270797421"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^18.7.18",
|