@vueuse/integrations 6.3.2 → 6.5.3
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/README.md +1 -0
- package/index.cjs +378 -312
- package/index.d.ts +32 -4
- package/index.iife.js +378 -314
- package/index.iife.min.js +1 -1
- package/index.mjs +379 -314
- package/package.json +9 -4
- package/useAxios.cjs +69 -65
- package/useAxios.iife.js +70 -66
- package/useAxios.iife.min.js +1 -1
- package/useAxios.mjs +69 -65
- package/useCookies.cjs +59 -71
- package/useCookies.iife.js +60 -72
- package/useCookies.iife.min.js +1 -1
- package/useCookies.mjs +59 -71
- package/useDrauu.cjs +127 -0
- package/useDrauu.d.ts +32 -0
- package/useDrauu.iife.js +186 -0
- package/useDrauu.iife.min.js +1 -0
- package/useDrauu.mjs +123 -0
- package/useFocusTrap.cjs +78 -104
- package/useFocusTrap.iife.js +83 -109
- package/useFocusTrap.iife.min.js +1 -1
- package/useFocusTrap.mjs +79 -105
- package/useJwt.cjs +20 -24
- package/useJwt.iife.js +21 -25
- package/useJwt.iife.min.js +1 -1
- package/useJwt.mjs +20 -24
- package/useNProgress.cjs +28 -37
- package/useNProgress.iife.js +29 -38
- package/useNProgress.iife.min.js +1 -1
- package/useNProgress.mjs +28 -37
- package/useQRCode.cjs +8 -15
- package/useQRCode.iife.js +9 -16
- package/useQRCode.iife.min.js +1 -1
- package/useQRCode.mjs +8 -15
package/useDrauu.mjs
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { ref, watch } from 'vue-demi';
|
|
2
|
+
import { createDrauu } from 'drauu';
|
|
3
|
+
import { createEventHook, unrefElement } from '@vueuse/core';
|
|
4
|
+
import { tryOnScopeDispose } from '@vueuse/shared';
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
function useDrauu(target, options) {
|
|
23
|
+
const drauuInstance = ref();
|
|
24
|
+
let disposables = [];
|
|
25
|
+
const onChangedHook = createEventHook();
|
|
26
|
+
const onCanceledHook = createEventHook();
|
|
27
|
+
const onCommittedHook = createEventHook();
|
|
28
|
+
const onStartHook = createEventHook();
|
|
29
|
+
const onEndHook = createEventHook();
|
|
30
|
+
const canUndo = ref(false);
|
|
31
|
+
const canRedo = ref(false);
|
|
32
|
+
const altPressed = ref(false);
|
|
33
|
+
const shiftPressed = ref(false);
|
|
34
|
+
const brush = ref({
|
|
35
|
+
color: "black",
|
|
36
|
+
size: 3,
|
|
37
|
+
arrowEnd: false,
|
|
38
|
+
cornerRadius: 0,
|
|
39
|
+
dasharray: void 0,
|
|
40
|
+
fill: "transparent",
|
|
41
|
+
mode: "draw"
|
|
42
|
+
});
|
|
43
|
+
watch(brush, () => {
|
|
44
|
+
const instance = drauuInstance.value;
|
|
45
|
+
if (instance)
|
|
46
|
+
instance.brush = brush.value;
|
|
47
|
+
}, { deep: true });
|
|
48
|
+
const undo = () => {
|
|
49
|
+
var _a;
|
|
50
|
+
return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
|
|
51
|
+
};
|
|
52
|
+
const redo = () => {
|
|
53
|
+
var _a;
|
|
54
|
+
return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
|
|
55
|
+
};
|
|
56
|
+
const clear = () => {
|
|
57
|
+
var _a;
|
|
58
|
+
return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
|
|
59
|
+
};
|
|
60
|
+
const cancel = () => {
|
|
61
|
+
var _a;
|
|
62
|
+
return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
|
|
63
|
+
};
|
|
64
|
+
const load = (svg) => {
|
|
65
|
+
var _a;
|
|
66
|
+
return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
|
|
67
|
+
};
|
|
68
|
+
const dump = () => {
|
|
69
|
+
var _a;
|
|
70
|
+
return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
|
|
71
|
+
};
|
|
72
|
+
const cleanup = () => {
|
|
73
|
+
var _a;
|
|
74
|
+
disposables.forEach((dispose) => dispose());
|
|
75
|
+
(_a = drauuInstance.value) == null ? void 0 : _a.unmount();
|
|
76
|
+
};
|
|
77
|
+
const syncStatus = () => {
|
|
78
|
+
if (drauuInstance.value) {
|
|
79
|
+
canUndo.value = drauuInstance.value.canUndo();
|
|
80
|
+
canRedo.value = drauuInstance.value.canRedo();
|
|
81
|
+
altPressed.value = drauuInstance.value.altPressed;
|
|
82
|
+
shiftPressed.value = drauuInstance.value.shiftPressed;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
watch(() => unrefElement(target), (el) => {
|
|
86
|
+
if (!el || !(el instanceof SVGSVGElement))
|
|
87
|
+
return;
|
|
88
|
+
if (drauuInstance.value)
|
|
89
|
+
cleanup();
|
|
90
|
+
drauuInstance.value = createDrauu(__spreadValues({ el }, options));
|
|
91
|
+
syncStatus();
|
|
92
|
+
disposables = [
|
|
93
|
+
drauuInstance.value.on("canceled", () => onCanceledHook.trigger()),
|
|
94
|
+
drauuInstance.value.on("committed", () => onCommittedHook.trigger()),
|
|
95
|
+
drauuInstance.value.on("start", () => onStartHook.trigger()),
|
|
96
|
+
drauuInstance.value.on("end", () => onEndHook.trigger()),
|
|
97
|
+
drauuInstance.value.on("changed", () => {
|
|
98
|
+
syncStatus();
|
|
99
|
+
onChangedHook.trigger();
|
|
100
|
+
})
|
|
101
|
+
];
|
|
102
|
+
}, { flush: "post" });
|
|
103
|
+
tryOnScopeDispose(() => cleanup());
|
|
104
|
+
return {
|
|
105
|
+
drauuInstance,
|
|
106
|
+
load,
|
|
107
|
+
dump,
|
|
108
|
+
clear,
|
|
109
|
+
cancel,
|
|
110
|
+
undo,
|
|
111
|
+
redo,
|
|
112
|
+
canUndo,
|
|
113
|
+
canRedo,
|
|
114
|
+
brush,
|
|
115
|
+
onChanged: onChangedHook.on,
|
|
116
|
+
onCommitted: onCommittedHook.on,
|
|
117
|
+
onStart: onStartHook.on,
|
|
118
|
+
onEnd: onEndHook.on,
|
|
119
|
+
onCanceled: onCanceledHook.on
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export { useDrauu };
|
package/useFocusTrap.cjs
CHANGED
|
@@ -2,113 +2,87 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var core = require('@vueuse/core');
|
|
5
6
|
var vueDemi = require('vue-demi');
|
|
6
|
-
var shared = require('@vueuse/shared');
|
|
7
7
|
var focusTrap = require('focus-trap');
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
trap = focusTrap.createFocusTrap(el, Object.assign(Object.assign({}, focusTrapOptions), { onActivate() {
|
|
87
|
-
hasFocus.value = true;
|
|
88
|
-
// Apply if user provided onActivate option
|
|
89
|
-
if (options.onActivate)
|
|
90
|
-
options.onActivate();
|
|
91
|
-
},
|
|
92
|
-
onDeactivate() {
|
|
93
|
-
hasFocus.value = false;
|
|
94
|
-
// Apply if user provided onDeactivate option
|
|
95
|
-
if (options.onDeactivate)
|
|
96
|
-
options.onDeactivate();
|
|
97
|
-
} }));
|
|
98
|
-
// Focus if immediate is set to true
|
|
99
|
-
if (immediate)
|
|
100
|
-
activate();
|
|
101
|
-
}, { flush: 'post' });
|
|
102
|
-
// Cleanup on unmount
|
|
103
|
-
shared.tryOnScopeDispose(() => deactivate());
|
|
104
|
-
return {
|
|
105
|
-
hasFocus,
|
|
106
|
-
isPaused,
|
|
107
|
-
activate,
|
|
108
|
-
deactivate,
|
|
109
|
-
pause,
|
|
110
|
-
unpause,
|
|
111
|
-
};
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __defProps = Object.defineProperties;
|
|
11
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
15
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16
|
+
var __spreadValues = (a, b) => {
|
|
17
|
+
for (var prop in b || (b = {}))
|
|
18
|
+
if (__hasOwnProp.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
if (__getOwnPropSymbols)
|
|
21
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
22
|
+
if (__propIsEnum.call(b, prop))
|
|
23
|
+
__defNormalProp(a, prop, b[prop]);
|
|
24
|
+
}
|
|
25
|
+
return a;
|
|
26
|
+
};
|
|
27
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
28
|
+
var __objRest = (source, exclude) => {
|
|
29
|
+
var target = {};
|
|
30
|
+
for (var prop in source)
|
|
31
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
if (source != null && __getOwnPropSymbols)
|
|
34
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
35
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
36
|
+
target[prop] = source[prop];
|
|
37
|
+
}
|
|
38
|
+
return target;
|
|
39
|
+
};
|
|
40
|
+
function useFocusTrap(target, options = {}) {
|
|
41
|
+
let trap;
|
|
42
|
+
const _a = options, { immediate } = _a, focusTrapOptions = __objRest(_a, ["immediate"]);
|
|
43
|
+
const hasFocus = vueDemi.ref(false);
|
|
44
|
+
const isPaused = vueDemi.ref(false);
|
|
45
|
+
const activate = (opts) => trap && trap.activate(opts);
|
|
46
|
+
const deactivate = (opts) => trap && trap.deactivate(opts);
|
|
47
|
+
const pause = () => {
|
|
48
|
+
if (trap) {
|
|
49
|
+
trap.pause();
|
|
50
|
+
isPaused.value = true;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const unpause = () => {
|
|
54
|
+
if (trap) {
|
|
55
|
+
trap.unpause();
|
|
56
|
+
isPaused.value = false;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
vueDemi.watch(() => core.unrefElement(target), (el) => {
|
|
60
|
+
if (!el)
|
|
61
|
+
return;
|
|
62
|
+
trap = focusTrap.createFocusTrap(el, __spreadProps(__spreadValues({}, focusTrapOptions), {
|
|
63
|
+
onActivate() {
|
|
64
|
+
hasFocus.value = true;
|
|
65
|
+
if (options.onActivate)
|
|
66
|
+
options.onActivate();
|
|
67
|
+
},
|
|
68
|
+
onDeactivate() {
|
|
69
|
+
hasFocus.value = false;
|
|
70
|
+
if (options.onDeactivate)
|
|
71
|
+
options.onDeactivate();
|
|
72
|
+
}
|
|
73
|
+
}));
|
|
74
|
+
if (immediate)
|
|
75
|
+
activate();
|
|
76
|
+
}, { flush: "post" });
|
|
77
|
+
core.tryOnScopeDispose(() => deactivate());
|
|
78
|
+
return {
|
|
79
|
+
hasFocus,
|
|
80
|
+
isPaused,
|
|
81
|
+
activate,
|
|
82
|
+
deactivate,
|
|
83
|
+
pause,
|
|
84
|
+
unpause
|
|
85
|
+
};
|
|
112
86
|
}
|
|
113
87
|
|
|
114
88
|
exports.useFocusTrap = useFocusTrap;
|
package/useFocusTrap.iife.js
CHANGED
|
@@ -59,116 +59,90 @@
|
|
|
59
59
|
window.VueDemi = VueDemi
|
|
60
60
|
})(window)
|
|
61
61
|
;
|
|
62
|
-
;(function (exports,
|
|
63
|
-
|
|
62
|
+
;(function (exports, core, vueDemi, focusTrap) {
|
|
63
|
+
'use strict';
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
hasFocus.value = true;
|
|
144
|
-
// Apply if user provided onActivate option
|
|
145
|
-
if (options.onActivate)
|
|
146
|
-
options.onActivate();
|
|
147
|
-
},
|
|
148
|
-
onDeactivate() {
|
|
149
|
-
hasFocus.value = false;
|
|
150
|
-
// Apply if user provided onDeactivate option
|
|
151
|
-
if (options.onDeactivate)
|
|
152
|
-
options.onDeactivate();
|
|
153
|
-
} }));
|
|
154
|
-
// Focus if immediate is set to true
|
|
155
|
-
if (immediate)
|
|
156
|
-
activate();
|
|
157
|
-
}, { flush: 'post' });
|
|
158
|
-
// Cleanup on unmount
|
|
159
|
-
shared.tryOnScopeDispose(() => deactivate());
|
|
160
|
-
return {
|
|
161
|
-
hasFocus,
|
|
162
|
-
isPaused,
|
|
163
|
-
activate,
|
|
164
|
-
deactivate,
|
|
165
|
-
pause,
|
|
166
|
-
unpause,
|
|
167
|
-
};
|
|
168
|
-
}
|
|
65
|
+
var __defProp = Object.defineProperty;
|
|
66
|
+
var __defProps = Object.defineProperties;
|
|
67
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
68
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
69
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
70
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
71
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
72
|
+
var __spreadValues = (a, b) => {
|
|
73
|
+
for (var prop in b || (b = {}))
|
|
74
|
+
if (__hasOwnProp.call(b, prop))
|
|
75
|
+
__defNormalProp(a, prop, b[prop]);
|
|
76
|
+
if (__getOwnPropSymbols)
|
|
77
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
78
|
+
if (__propIsEnum.call(b, prop))
|
|
79
|
+
__defNormalProp(a, prop, b[prop]);
|
|
80
|
+
}
|
|
81
|
+
return a;
|
|
82
|
+
};
|
|
83
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
84
|
+
var __objRest = (source, exclude) => {
|
|
85
|
+
var target = {};
|
|
86
|
+
for (var prop in source)
|
|
87
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
88
|
+
target[prop] = source[prop];
|
|
89
|
+
if (source != null && __getOwnPropSymbols)
|
|
90
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
91
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
92
|
+
target[prop] = source[prop];
|
|
93
|
+
}
|
|
94
|
+
return target;
|
|
95
|
+
};
|
|
96
|
+
function useFocusTrap(target, options = {}) {
|
|
97
|
+
let trap;
|
|
98
|
+
const _a = options, { immediate } = _a, focusTrapOptions = __objRest(_a, ["immediate"]);
|
|
99
|
+
const hasFocus = vueDemi.ref(false);
|
|
100
|
+
const isPaused = vueDemi.ref(false);
|
|
101
|
+
const activate = (opts) => trap && trap.activate(opts);
|
|
102
|
+
const deactivate = (opts) => trap && trap.deactivate(opts);
|
|
103
|
+
const pause = () => {
|
|
104
|
+
if (trap) {
|
|
105
|
+
trap.pause();
|
|
106
|
+
isPaused.value = true;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const unpause = () => {
|
|
110
|
+
if (trap) {
|
|
111
|
+
trap.unpause();
|
|
112
|
+
isPaused.value = false;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
vueDemi.watch(() => core.unrefElement(target), (el) => {
|
|
116
|
+
if (!el)
|
|
117
|
+
return;
|
|
118
|
+
trap = focusTrap.createFocusTrap(el, __spreadProps(__spreadValues({}, focusTrapOptions), {
|
|
119
|
+
onActivate() {
|
|
120
|
+
hasFocus.value = true;
|
|
121
|
+
if (options.onActivate)
|
|
122
|
+
options.onActivate();
|
|
123
|
+
},
|
|
124
|
+
onDeactivate() {
|
|
125
|
+
hasFocus.value = false;
|
|
126
|
+
if (options.onDeactivate)
|
|
127
|
+
options.onDeactivate();
|
|
128
|
+
}
|
|
129
|
+
}));
|
|
130
|
+
if (immediate)
|
|
131
|
+
activate();
|
|
132
|
+
}, { flush: "post" });
|
|
133
|
+
core.tryOnScopeDispose(() => deactivate());
|
|
134
|
+
return {
|
|
135
|
+
hasFocus,
|
|
136
|
+
isPaused,
|
|
137
|
+
activate,
|
|
138
|
+
deactivate,
|
|
139
|
+
pause,
|
|
140
|
+
unpause
|
|
141
|
+
};
|
|
142
|
+
}
|
|
169
143
|
|
|
170
|
-
|
|
144
|
+
exports.useFocusTrap = useFocusTrap;
|
|
171
145
|
|
|
172
|
-
|
|
146
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
173
147
|
|
|
174
|
-
}(this.VueUse = this.VueUse || {},
|
|
148
|
+
})(this.VueUse = this.VueUse || {}, VueUse, VueDemi, focusTrap);
|
package/useFocusTrap.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(f){if(!f.VueDemi){var i={},s=f.Vue;if(s)if(s.version.slice(0,2)==="2."){var v=f.VueCompositionAPI;if(v){for(var c in v)i[c]=v[c];i.isVue2=!0,i.isVue3=!1,i.install=function(){},i.Vue=s,i.Vue2=s,i.version=s.version}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.")}else if(s.version.slice(0,2)==="3."){for(var c in s)i[c]=s[c];i.isVue2=!1,i.isVue3=!0,i.install=function(){},i.Vue=s,i.Vue2=void 0,i.version=s.version,i.set=function(a,o,u){return Array.isArray(a)?(a.length=Math.max(a.length,o),a.splice(o,1,u),u):(a[o]=u,u)},i.del=function(a,o){if(Array.isArray(a)){a.splice(o,1);return}delete a[o]}}else console.error("[vue-demi] Vue version "+s.version+" is unsupported.");else console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.");f.VueDemi=i}})(window),function(f,i,s,v){"use strict";var c=Object.defineProperty,a=Object.defineProperties,o=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,V=(t,r,e)=>r in t?c(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,b=(t,r)=>{for(var e in r||(r={}))_.call(r,e)&&V(t,e,r[e]);if(u)for(var e of u(r))m.call(r,e)&&V(t,e,r[e]);return t},h=(t,r)=>a(t,o(r)),y=(t,r)=>{var e={};for(var n in t)_.call(t,n)&&r.indexOf(n)<0&&(e[n]=t[n]);if(t!=null&&u)for(var n of u(t))r.indexOf(n)<0&&m.call(t,n)&&(e[n]=t[n]);return e};function D(t,r={}){let e;const n=r,{immediate:A}=n,j=y(n,["immediate"]),p=s.ref(!1),d=s.ref(!1),O=l=>e&&e.activate(l),P=l=>e&&e.deactivate(l),T=()=>{e&&(e.pause(),d.value=!0)},w=()=>{e&&(e.unpause(),d.value=!1)};return s.watch(()=>i.unrefElement(t),l=>{!l||(e=v.createFocusTrap(l,h(b({},j),{onActivate(){p.value=!0,r.onActivate&&r.onActivate()},onDeactivate(){p.value=!1,r.onDeactivate&&r.onDeactivate()}})),A&&O())},{flush:"post"}),i.tryOnScopeDispose(()=>P()),{hasFocus:p,isPaused:d,activate:O,deactivate:P,pause:T,unpause:w}}f.useFocusTrap=D,Object.defineProperty(f,"__esModule",{value:!0})}(this.VueUse=this.VueUse||{},VueUse,VueDemi,focusTrap);
|