@vueuse/integrations 7.7.0 → 8.0.0-beta.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 +42 -3
- package/index.d.ts +41 -10
- package/index.iife.js +42 -4
- package/index.iife.min.js +1 -1
- package/index.mjs +43 -5
- package/package.json +11 -4
- package/useAxios.cjs +13 -2
- package/useAxios.d.ts +3 -3
- package/useAxios.iife.js +14 -4
- package/useAxios.iife.min.js +1 -1
- package/useAxios.mjs +13 -2
- package/useChangeCase.cjs +35 -0
- package/useChangeCase.d.ts +35 -0
- package/useChangeCase.iife.js +96 -0
- package/useChangeCase.iife.min.js +1 -0
- package/useChangeCase.mjs +31 -0
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ npm i <b>@vueuse/integrations</b>
|
|
|
15
15
|
<!--GENERATED LIST, DO NOT MODIFY MANUALLY-->
|
|
16
16
|
<!--FUNCTIONS_LIST_STARTS-->
|
|
17
17
|
- [`useAxios`](https://vueuse.org/integrations/useAxios/) — wrapper for [`axios`](https://github.com/axios/axios)
|
|
18
|
+
- [`useChangeCase`](https://vueuse.org/integrations/useChangeCase/) — wrapper for [`change-case`](https://github.com/blakeembrey/change-case)
|
|
18
19
|
- [`useCookies`](https://vueuse.org/integrations/useCookies/) — wrapper for [`universal-cookie`](https://www.npmjs.com/package/universal-cookie)
|
|
19
20
|
- [`useDrauu`](https://vueuse.org/integrations/useDrauu/) — reactive instance for [drauu](https://github.com/antfu/drauu)
|
|
20
21
|
- [`useFocusTrap`](https://vueuse.org/integrations/useFocusTrap/) — reactive wrapper for [`focus-trap`](https://github.com/focus-trap/focus-trap)
|
package/index.cjs
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vueDemi = require('vue-demi');
|
|
6
|
-
var axios = require('axios');
|
|
7
6
|
var shared = require('@vueuse/shared');
|
|
7
|
+
var axios = require('axios');
|
|
8
|
+
var changeCase$1 = require('change-case');
|
|
8
9
|
var Cookie = require('universal-cookie');
|
|
9
10
|
var drauu = require('drauu');
|
|
10
11
|
var core = require('@vueuse/core');
|
|
@@ -56,7 +57,7 @@ function useAxios(url, ...args) {
|
|
|
56
57
|
if ("request" in args[1])
|
|
57
58
|
instance = args[1];
|
|
58
59
|
}
|
|
59
|
-
if (args.length
|
|
60
|
+
if (args.length === 2 && !("request" in args[1]) || args.length === 3)
|
|
60
61
|
options = args[args.length - 1];
|
|
61
62
|
const response = vueDemi.shallowRef();
|
|
62
63
|
const data = vueDemi.shallowRef();
|
|
@@ -90,7 +91,7 @@ function useAxios(url, ...args) {
|
|
|
90
91
|
};
|
|
91
92
|
if (options.immediate)
|
|
92
93
|
execute();
|
|
93
|
-
|
|
94
|
+
const result = {
|
|
94
95
|
response,
|
|
95
96
|
data,
|
|
96
97
|
error,
|
|
@@ -104,6 +105,43 @@ function useAxios(url, ...args) {
|
|
|
104
105
|
abort,
|
|
105
106
|
execute
|
|
106
107
|
};
|
|
108
|
+
function waitUntilFinished() {
|
|
109
|
+
return new Promise((resolve, reject) => {
|
|
110
|
+
shared.until(isFinished).toBe(true).then(() => resolve(result)).catch((error2) => reject(error2));
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return __spreadProps$1(__spreadValues$3({}, result), {
|
|
114
|
+
then(onFulfilled, onRejected) {
|
|
115
|
+
return waitUntilFinished().then(onFulfilled, onRejected);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
var changeCase = /*#__PURE__*/Object.freeze({
|
|
121
|
+
__proto__: null,
|
|
122
|
+
camelCase: changeCase$1.camelCase,
|
|
123
|
+
capitalCase: changeCase$1.capitalCase,
|
|
124
|
+
constantCase: changeCase$1.constantCase,
|
|
125
|
+
dotCase: changeCase$1.dotCase,
|
|
126
|
+
headerCase: changeCase$1.headerCase,
|
|
127
|
+
noCase: changeCase$1.noCase,
|
|
128
|
+
paramCase: changeCase$1.paramCase,
|
|
129
|
+
pascalCase: changeCase$1.pascalCase,
|
|
130
|
+
pathCase: changeCase$1.pathCase,
|
|
131
|
+
sentenceCase: changeCase$1.sentenceCase,
|
|
132
|
+
snakeCase: changeCase$1.snakeCase
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
function useChangeCase(input, type, options) {
|
|
136
|
+
const text = vueDemi.ref(input);
|
|
137
|
+
return vueDemi.computed({
|
|
138
|
+
get() {
|
|
139
|
+
return changeCase[type](text.value, options);
|
|
140
|
+
},
|
|
141
|
+
set(value) {
|
|
142
|
+
text.value = value;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
107
145
|
}
|
|
108
146
|
|
|
109
147
|
var __defProp$2 = Object.defineProperty;
|
|
@@ -456,6 +494,7 @@ function useQRCode(text, options) {
|
|
|
456
494
|
|
|
457
495
|
exports.createCookies = createCookies;
|
|
458
496
|
exports.useAxios = useAxios;
|
|
497
|
+
exports.useChangeCase = useChangeCase;
|
|
459
498
|
exports.useCookies = useCookies;
|
|
460
499
|
exports.useDrauu = useDrauu;
|
|
461
500
|
exports.useFocusTrap = useFocusTrap;
|
package/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as vue_demi from 'vue-demi';
|
|
2
|
-
import { Ref, ComputedRef } from 'vue-demi';
|
|
2
|
+
import { Ref, WritableComputedRef, ComputedRef } from 'vue-demi';
|
|
3
3
|
import { AxiosResponse, AxiosError, AxiosRequestConfig, AxiosInstance } from 'axios';
|
|
4
|
+
import { camelCase, capitalCase, constantCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase, Options } from 'change-case';
|
|
5
|
+
import { MaybeRef } from '@vueuse/shared';
|
|
4
6
|
import * as universal_cookie from 'universal-cookie';
|
|
5
7
|
import universal_cookie__default from 'universal-cookie';
|
|
6
8
|
import { IncomingMessage } from 'http';
|
|
7
|
-
import { Options, Drauu, Brush } from 'drauu';
|
|
9
|
+
import { Options as Options$1, Drauu, Brush } from 'drauu';
|
|
8
10
|
import { EventHookOn, MaybeElementRef, Fn } from '@vueuse/core';
|
|
9
|
-
import { Options as Options$
|
|
11
|
+
import { Options as Options$2, ActivateOptions, DeactivateOptions } from 'focus-trap';
|
|
10
12
|
import Fuse from 'fuse.js';
|
|
11
|
-
import { MaybeRef } from '@vueuse/shared';
|
|
12
13
|
import { JwtPayload, JwtHeader } from 'jwt-decode';
|
|
13
14
|
import nprogress, { NProgressOptions } from 'nprogress';
|
|
14
15
|
import QRCode from 'qrcode';
|
|
@@ -55,9 +56,39 @@ interface UseAxiosOptions {
|
|
|
55
56
|
*/
|
|
56
57
|
immediate?: boolean;
|
|
57
58
|
}
|
|
58
|
-
declare function useAxios<T = any>(url: string, config?: AxiosRequestConfig, options?: UseAxiosOptions): UseAxiosReturn<T
|
|
59
|
-
declare function useAxios<T = any>(url: string, instance?: AxiosInstance, options?: UseAxiosOptions): UseAxiosReturn<T
|
|
60
|
-
declare function useAxios<T = any>(url: string, config: AxiosRequestConfig, instance: AxiosInstance, options?: UseAxiosOptions): UseAxiosReturn<T
|
|
59
|
+
declare function useAxios<T = any>(url: string, config?: AxiosRequestConfig, options?: UseAxiosOptions): UseAxiosReturn<T> & PromiseLike<UseAxiosReturn<T>>;
|
|
60
|
+
declare function useAxios<T = any>(url: string, instance?: AxiosInstance, options?: UseAxiosOptions): UseAxiosReturn<T> & PromiseLike<UseAxiosReturn<T>>;
|
|
61
|
+
declare function useAxios<T = any>(url: string, config: AxiosRequestConfig, instance: AxiosInstance, options?: UseAxiosOptions): UseAxiosReturn<T> & PromiseLike<UseAxiosReturn<T>>;
|
|
62
|
+
|
|
63
|
+
declare const changeCase_camelCase: typeof camelCase;
|
|
64
|
+
declare const changeCase_capitalCase: typeof capitalCase;
|
|
65
|
+
declare const changeCase_constantCase: typeof constantCase;
|
|
66
|
+
declare const changeCase_dotCase: typeof dotCase;
|
|
67
|
+
declare const changeCase_headerCase: typeof headerCase;
|
|
68
|
+
declare const changeCase_noCase: typeof noCase;
|
|
69
|
+
declare const changeCase_paramCase: typeof paramCase;
|
|
70
|
+
declare const changeCase_pascalCase: typeof pascalCase;
|
|
71
|
+
declare const changeCase_pathCase: typeof pathCase;
|
|
72
|
+
declare const changeCase_sentenceCase: typeof sentenceCase;
|
|
73
|
+
declare const changeCase_snakeCase: typeof snakeCase;
|
|
74
|
+
declare namespace changeCase {
|
|
75
|
+
export {
|
|
76
|
+
changeCase_camelCase as camelCase,
|
|
77
|
+
changeCase_capitalCase as capitalCase,
|
|
78
|
+
changeCase_constantCase as constantCase,
|
|
79
|
+
changeCase_dotCase as dotCase,
|
|
80
|
+
changeCase_headerCase as headerCase,
|
|
81
|
+
changeCase_noCase as noCase,
|
|
82
|
+
changeCase_paramCase as paramCase,
|
|
83
|
+
changeCase_pascalCase as pascalCase,
|
|
84
|
+
changeCase_pathCase as pathCase,
|
|
85
|
+
changeCase_sentenceCase as sentenceCase,
|
|
86
|
+
changeCase_snakeCase as snakeCase,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare type ChangeCaseType = keyof typeof changeCase;
|
|
91
|
+
declare function useChangeCase(input: MaybeRef<string>, type: ChangeCaseType, options?: Options | undefined): WritableComputedRef<string>;
|
|
61
92
|
|
|
62
93
|
/**
|
|
63
94
|
* Creates a new {@link useCookies} function
|
|
@@ -108,7 +139,7 @@ declare function useCookies(dependencies?: string[] | null, { doNotParse, autoUp
|
|
|
108
139
|
removeChangeListener: (callback: universal_cookie.CookieChangeListener) => void;
|
|
109
140
|
};
|
|
110
141
|
|
|
111
|
-
declare type UseDrauuOptions = Omit<Options, 'el'>;
|
|
142
|
+
declare type UseDrauuOptions = Omit<Options$1, 'el'>;
|
|
112
143
|
interface UseDrauuReturn {
|
|
113
144
|
drauuInstance: Ref<Drauu | undefined>;
|
|
114
145
|
load: (svg: string) => void;
|
|
@@ -135,7 +166,7 @@ interface UseDrauuReturn {
|
|
|
135
166
|
*/
|
|
136
167
|
declare function useDrauu(target: MaybeElementRef, options?: UseDrauuOptions): UseDrauuReturn;
|
|
137
168
|
|
|
138
|
-
interface UseFocusTrapOptions extends Options$
|
|
169
|
+
interface UseFocusTrapOptions extends Options$2 {
|
|
139
170
|
/**
|
|
140
171
|
* Immediately activate the trap
|
|
141
172
|
*/
|
|
@@ -246,4 +277,4 @@ declare function useNProgress(currentProgress?: MaybeRef<number | null | undefin
|
|
|
246
277
|
*/
|
|
247
278
|
declare function useQRCode(text: MaybeRef<string>, options?: QRCode.QRCodeToDataURLOptions): vue_demi.Ref<string>;
|
|
248
279
|
|
|
249
|
-
export { FuseOptions, JwtOptions, JwtResult, UseAxiosOptions, UseAxiosReturn, UseDrauuOptions, UseDrauuReturn, UseFocusTrapOptions, UseFocusTrapReturn, UseFuseOptions, UseFuseReturn, createCookies, useAxios, useCookies, useDrauu, useFocusTrap, useFuse, useJwt, useNProgress, useQRCode };
|
|
280
|
+
export { ChangeCaseType, FuseOptions, JwtOptions, JwtResult, UseAxiosOptions, UseAxiosReturn, UseDrauuOptions, UseDrauuReturn, UseFocusTrapOptions, UseFocusTrapReturn, UseFuseOptions, UseFuseReturn, createCookies, useAxios, useChangeCase, useCookies, useDrauu, useFocusTrap, useFuse, useJwt, useNProgress, useQRCode };
|
package/index.iife.js
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
window.VueDemi = VueDemi
|
|
60
60
|
})(window)
|
|
61
61
|
;
|
|
62
|
-
;(function (exports, vueDemi, axios,
|
|
62
|
+
;(function (exports, vueDemi, shared, axios, changeCase$1, Cookie, drauu, core, focusTrap, Fuse, jwt_decode, nprogress, QRCode) {
|
|
63
63
|
'use strict';
|
|
64
64
|
|
|
65
65
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
if ("request" in args[1])
|
|
105
105
|
instance = args[1];
|
|
106
106
|
}
|
|
107
|
-
if (args.length
|
|
107
|
+
if (args.length === 2 && !("request" in args[1]) || args.length === 3)
|
|
108
108
|
options = args[args.length - 1];
|
|
109
109
|
const response = vueDemi.shallowRef();
|
|
110
110
|
const data = vueDemi.shallowRef();
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
};
|
|
139
139
|
if (options.immediate)
|
|
140
140
|
execute();
|
|
141
|
-
|
|
141
|
+
const result = {
|
|
142
142
|
response,
|
|
143
143
|
data,
|
|
144
144
|
error,
|
|
@@ -152,6 +152,43 @@
|
|
|
152
152
|
abort,
|
|
153
153
|
execute
|
|
154
154
|
};
|
|
155
|
+
function waitUntilFinished() {
|
|
156
|
+
return new Promise((resolve, reject) => {
|
|
157
|
+
shared.until(isFinished).toBe(true).then(() => resolve(result)).catch((error2) => reject(error2));
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
return __spreadProps$1(__spreadValues$3({}, result), {
|
|
161
|
+
then(onFulfilled, onRejected) {
|
|
162
|
+
return waitUntilFinished().then(onFulfilled, onRejected);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
var changeCase = /*#__PURE__*/Object.freeze({
|
|
168
|
+
__proto__: null,
|
|
169
|
+
camelCase: changeCase$1.camelCase,
|
|
170
|
+
capitalCase: changeCase$1.capitalCase,
|
|
171
|
+
constantCase: changeCase$1.constantCase,
|
|
172
|
+
dotCase: changeCase$1.dotCase,
|
|
173
|
+
headerCase: changeCase$1.headerCase,
|
|
174
|
+
noCase: changeCase$1.noCase,
|
|
175
|
+
paramCase: changeCase$1.paramCase,
|
|
176
|
+
pascalCase: changeCase$1.pascalCase,
|
|
177
|
+
pathCase: changeCase$1.pathCase,
|
|
178
|
+
sentenceCase: changeCase$1.sentenceCase,
|
|
179
|
+
snakeCase: changeCase$1.snakeCase
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
function useChangeCase(input, type, options) {
|
|
183
|
+
const text = vueDemi.ref(input);
|
|
184
|
+
return vueDemi.computed({
|
|
185
|
+
get() {
|
|
186
|
+
return changeCase[type](text.value, options);
|
|
187
|
+
},
|
|
188
|
+
set(value) {
|
|
189
|
+
text.value = value;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
155
192
|
}
|
|
156
193
|
|
|
157
194
|
var __defProp$2 = Object.defineProperty;
|
|
@@ -504,6 +541,7 @@
|
|
|
504
541
|
|
|
505
542
|
exports.createCookies = createCookies;
|
|
506
543
|
exports.useAxios = useAxios;
|
|
544
|
+
exports.useChangeCase = useChangeCase;
|
|
507
545
|
exports.useCookies = useCookies;
|
|
508
546
|
exports.useDrauu = useDrauu;
|
|
509
547
|
exports.useFocusTrap = useFocusTrap;
|
|
@@ -514,4 +552,4 @@
|
|
|
514
552
|
|
|
515
553
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
516
554
|
|
|
517
|
-
})(this.VueUse = this.VueUse || {}, VueDemi, axios,
|
|
555
|
+
})(this.VueUse = this.VueUse || {}, VueDemi, VueUse, axios, changeCase$1, UniversalCookie, Drauu, VueUse, focusTrap, Fuse, jwt_decode, nprogress, QRCode);
|
package/index.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(v){if(!v.VueDemi){var n={},c=v.Vue;if(c)if(c.version.slice(0,2)==="2."){var E=v.VueCompositionAPI;if(E){for(var i in E)n[i]=E[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=c,n.Vue2=c,n.version=c.version}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.")}else if(c.version.slice(0,2)==="3."){for(var i in c)n[i]=c[i];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=c,n.Vue2=void 0,n.version=c.version,n.set=function(C,y,_){return Array.isArray(C)?(C.length=Math.max(C.length,y),C.splice(y,1,_),_):(C[y]=_,_)},n.del=function(C,y){if(Array.isArray(C)){C.splice(y,1);return}delete C[y]}}else console.error("[vue-demi] Vue version "+c.version+" is unsupported.");else console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.");v.VueDemi=n}})(window),function(v,n,c,E,i,C,y,_,Y,Z,x,D,ee){"use strict";function b(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var H=b(E),I=b(C),te=b(Z),re=b(x),P=b(D),ne=b(ee),ae=Object.defineProperty,oe=Object.defineProperties,le=Object.getOwnPropertyDescriptors,k=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,N=(r,t,e)=>t in r?ae(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,F=(r,t)=>{for(var e in t||(t={}))se.call(t,e)&&N(r,e,t[e]);if(k)for(var e of k(t))ue.call(t,e)&&N(r,e,t[e]);return r},U=(r,t)=>oe(r,le(t));function fe(r,...t){let e={},a=H.default,s={immediate:!0};t.length>0&&("request"in t[0]?a=t[0]:e=t[0]),t.length>1&&"request"in t[1]&&(a=t[1]),(t.length===2&&!("request"in t[1])||t.length===3)&&(s=t[t.length-1]);const f=n.shallowRef(),p=n.shallowRef(),l=n.ref(!1),o=n.ref(!1),d=n.ref(!1),h=n.shallowRef(),g=H.default.CancelToken.source(),w=O=>{l.value||!o.value||(g.cancel(O),d.value=!0,o.value=!1,l.value=!1)},V=O=>{o.value=O,l.value=!O},j=(O={})=>{V(!0),a(r,U(F(F({},e),O),{cancelToken:g.token})).then(m=>{f.value=m,p.value=m.data}).catch(m=>{h.value=m}).finally(()=>{V(!1)})};s.immediate&&j();const A={response:f,data:p,error:h,finished:l,loading:o,isFinished:l,isLoading:o,cancel:w,canceled:d,aborted:d,abort:w,execute:j};function $(){return new Promise((O,m)=>{c.until(l).toBe(!0).then(()=>O(A)).catch(L=>m(L))})}return U(F({},A),{then(O,m){return $().then(O,m)}})}var ce=Object.freeze({__proto__:null,camelCase:i.camelCase,capitalCase:i.capitalCase,constantCase:i.constantCase,dotCase:i.dotCase,headerCase:i.headerCase,noCase:i.noCase,paramCase:i.paramCase,pascalCase:i.pascalCase,pathCase:i.pathCase,sentenceCase:i.sentenceCase,snakeCase:i.snakeCase});function ie(r,t,e){const a=n.ref(r);return n.computed({get(){return ce[t](a.value,e)},set(s){a.value=s}})}var de=Object.defineProperty,T=Object.getOwnPropertySymbols,ve=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,G=(r,t,e)=>t in r?de(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Q=(r,t)=>{for(var e in t||(t={}))ve.call(t,e)&&G(r,e,t[e]);if(T)for(var e of T(t))pe.call(t,e)&&G(r,e,t[e]);return r};function _e(r){const t=new I.default(r?r.headers.cookie:null);return(e,{doNotParse:a=!1,autoUpdateDependencies:s=!1}={})=>J(e,{doNotParse:a,autoUpdateDependencies:s},t)}function J(r,{doNotParse:t=!1,autoUpdateDependencies:e=!1}={},a=new I.default){const s=e?[...r||[]]:r;let f=a.getAll({doNotParse:!0});const p=n.ref(0),l=()=>{const o=a.getAll({doNotParse:!0});he(s||null,o,f)&&p.value++,f=o};return a.addChangeListener(l),c.tryOnScopeDispose(()=>{a.removeChangeListener(l)}),{get:(...o)=>(e&&s&&!s.includes(o[0])&&s.push(o[0]),p.value,a.get(o[0],Q({doNotParse:t},o[1]))),getAll:(...o)=>(p.value,a.getAll(Q({doNotParse:t},o[0]))),set:(...o)=>a.set(...o),remove:(...o)=>a.remove(...o),addChangeListener:(...o)=>a.addChangeListener(...o),removeChangeListener:(...o)=>a.removeChangeListener(...o)}}function he(r,t,e){if(!r)return!0;for(const a of r)if(t[a]!==e[a])return!0;return!1}var Oe=Object.defineProperty,q=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,z=(r,t,e)=>t in r?Oe(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,we=(r,t)=>{for(var e in t||(t={}))Ce.call(t,e)&&z(r,e,t[e]);if(q)for(var e of q(t))Pe.call(t,e)&&z(r,e,t[e]);return r};function me(r,t){const e=n.ref();let a=[];const s=_.createEventHook(),f=_.createEventHook(),p=_.createEventHook(),l=_.createEventHook(),o=_.createEventHook(),d=n.ref(!1),h=n.ref(!1),g=n.ref(!1),w=n.ref(!1),V=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw"});n.watch(V,()=>{const u=e.value;u&&(u.brush=V.value)},{deep:!0});const j=()=>{var u;return(u=e.value)==null?void 0:u.undo()},A=()=>{var u;return(u=e.value)==null?void 0:u.redo()},$=()=>{var u;return(u=e.value)==null?void 0:u.clear()},O=()=>{var u;return(u=e.value)==null?void 0:u.cancel()},m=u=>{var R;return(R=e.value)==null?void 0:R.load(u)},L=()=>{var u;return(u=e.value)==null?void 0:u.dump()},K=()=>{var u;a.forEach(R=>R()),(u=e.value)==null||u.unmount()},X=()=>{e.value&&(d.value=e.value.canUndo(),h.value=e.value.canRedo(),g.value=e.value.altPressed,w.value=e.value.shiftPressed)};return n.watch(()=>_.unrefElement(r),u=>{!u||typeof SVGSVGElement=="undefined"||!(u instanceof SVGSVGElement)||(e.value&&K(),e.value=y.createDrauu(we({el:u},t)),X(),a=[e.value.on("canceled",()=>f.trigger()),e.value.on("committed",()=>p.trigger()),e.value.on("start",()=>l.trigger()),e.value.on("end",()=>o.trigger()),e.value.on("changed",()=>{X(),s.trigger()})])},{flush:"post"}),c.tryOnScopeDispose(()=>K()),{drauuInstance:e,load:m,dump:L,clear:$,cancel:O,undo:j,redo:A,canUndo:d,canRedo:h,brush:V,onChanged:s.on,onCommitted:p.on,onStart:l.on,onEnd:o.on,onCanceled:f.on}}var ye=Object.defineProperty,ge=Object.defineProperties,be=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,B=(r,t,e)=>t in r?ye(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ve=(r,t)=>{for(var e in t||(t={}))M.call(t,e)&&B(r,e,t[e]);if(S)for(var e of S(t))W.call(t,e)&&B(r,e,t[e]);return r},Ee=(r,t)=>ge(r,be(t)),Se=(r,t)=>{var e={};for(var a in r)M.call(r,a)&&t.indexOf(a)<0&&(e[a]=r[a]);if(r!=null&&S)for(var a of S(r))t.indexOf(a)<0&&W.call(r,a)&&(e[a]=r[a]);return e};function je(r,t={}){let e;const a=t,{immediate:s}=a,f=Se(a,["immediate"]),p=n.ref(!1),l=n.ref(!1),o=w=>e&&e.activate(w),d=w=>e&&e.deactivate(w),h=()=>{e&&(e.pause(),l.value=!0)},g=()=>{e&&(e.unpause(),l.value=!1)};return n.watch(()=>_.unrefElement(r),w=>{!w||(e=Y.createFocusTrap(w,Ee(Ve({},f),{onActivate(){p.value=!0,t.onActivate&&t.onActivate()},onDeactivate(){p.value=!1,t.onDeactivate&&t.onDeactivate()}})),s&&o())},{flush:"post"}),_.tryOnScopeDispose(()=>d()),{hasFocus:p,isPaused:l,activate:o,deactivate:d,pause:h,unpause:g}}function Ae(r,t,e){var a;const s=(l,o)=>{var d;const h=o;return new te.default((d=n.unref(l))!=null?d:[],h)},f=n.ref(s(t,(a=n.unref(e))==null?void 0:a.fuseOptions));return n.watch(()=>{var l;return(l=n.unref(e))==null?void 0:l.fuseOptions},l=>{f.value=s(t,l)},{deep:!0}),n.watch(()=>n.unref(t),l=>{f.value.setCollection(l)},{deep:!0}),{results:n.computed(()=>{var l,o;if(((l=n.unref(e))==null?void 0:l.matchAllWhenSearchEmpty)&&!n.unref(r))return n.unref(t).map((h,g)=>({item:h,refIndex:g}));const d=(o=n.unref(e))==null?void 0:o.resultLimit;return f.value.search(n.unref(r),d?{limit:d}:void 0)})}}function Re(r,t={}){const e=n.ref(r),{onError:a,fallbackValue:s=null}=t,f=(o,d)=>{try{return re.default(o,d)}catch(h){return a==null||a(h),s}},p=n.computed(()=>f(e.value,{header:!0})),l=n.computed(()=>f(e.value));return{header:p,payload:l}}function Fe(r=null,t){const e=n.isRef(r)?r:n.ref(r),a=n.computed({set:f=>f?P.default.start():P.default.done(),get:()=>c.isNumber(e.value)&&e.value<1});t&&P.default.configure(t);const s=P.default.set;return P.default.set=f=>(e.value=f,s.call(P.default,f)),n.watchEffect(()=>{c.isNumber(e.value)&&s.call(P.default,e.value)}),c.tryOnScopeDispose(P.default.remove),{isLoading:a,progress:e,start:P.default.start,done:P.default.done,remove:()=>{e.value=null,P.default.remove()}}}function $e(r,t){const e=n.ref(r),a=n.ref("");return n.watch(e,async s=>{e.value&&c.isClient&&(a.value=await ne.default.toDataURL(s,t))},{immediate:!0}),a}v.createCookies=_e,v.useAxios=fe,v.useChangeCase=ie,v.useCookies=J,v.useDrauu=me,v.useFocusTrap=je,v.useFuse=Ae,v.useJwt=Re,v.useNProgress=Fe,v.useQRCode=$e,Object.defineProperty(v,"__esModule",{value:!0})}(this.VueUse=this.VueUse||{},VueDemi,VueUse,axios,changeCase$1,UniversalCookie,Drauu,VueUse,focusTrap,Fuse,jwt_decode,nprogress,QRCode);
|
package/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { shallowRef, ref, watch, unref,
|
|
1
|
+
import { shallowRef, ref, computed, watch, unref, isRef, watchEffect } from 'vue-demi';
|
|
2
|
+
import { until, tryOnScopeDispose, isNumber, isClient } from '@vueuse/shared';
|
|
2
3
|
import axios from 'axios';
|
|
3
|
-
import {
|
|
4
|
+
import { camelCase, capitalCase, constantCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase } from 'change-case';
|
|
4
5
|
import Cookie from 'universal-cookie';
|
|
5
6
|
import { createDrauu } from 'drauu';
|
|
6
7
|
import { createEventHook, unrefElement, tryOnScopeDispose as tryOnScopeDispose$1 } from '@vueuse/core';
|
|
@@ -43,7 +44,7 @@ function useAxios(url, ...args) {
|
|
|
43
44
|
if ("request" in args[1])
|
|
44
45
|
instance = args[1];
|
|
45
46
|
}
|
|
46
|
-
if (args.length
|
|
47
|
+
if (args.length === 2 && !("request" in args[1]) || args.length === 3)
|
|
47
48
|
options = args[args.length - 1];
|
|
48
49
|
const response = shallowRef();
|
|
49
50
|
const data = shallowRef();
|
|
@@ -77,7 +78,7 @@ function useAxios(url, ...args) {
|
|
|
77
78
|
};
|
|
78
79
|
if (options.immediate)
|
|
79
80
|
execute();
|
|
80
|
-
|
|
81
|
+
const result = {
|
|
81
82
|
response,
|
|
82
83
|
data,
|
|
83
84
|
error,
|
|
@@ -91,6 +92,43 @@ function useAxios(url, ...args) {
|
|
|
91
92
|
abort,
|
|
92
93
|
execute
|
|
93
94
|
};
|
|
95
|
+
function waitUntilFinished() {
|
|
96
|
+
return new Promise((resolve, reject) => {
|
|
97
|
+
until(isFinished).toBe(true).then(() => resolve(result)).catch((error2) => reject(error2));
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return __spreadProps$1(__spreadValues$3({}, result), {
|
|
101
|
+
then(onFulfilled, onRejected) {
|
|
102
|
+
return waitUntilFinished().then(onFulfilled, onRejected);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
var changeCase = /*#__PURE__*/Object.freeze({
|
|
108
|
+
__proto__: null,
|
|
109
|
+
camelCase: camelCase,
|
|
110
|
+
capitalCase: capitalCase,
|
|
111
|
+
constantCase: constantCase,
|
|
112
|
+
dotCase: dotCase,
|
|
113
|
+
headerCase: headerCase,
|
|
114
|
+
noCase: noCase,
|
|
115
|
+
paramCase: paramCase,
|
|
116
|
+
pascalCase: pascalCase,
|
|
117
|
+
pathCase: pathCase,
|
|
118
|
+
sentenceCase: sentenceCase,
|
|
119
|
+
snakeCase: snakeCase
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
function useChangeCase(input, type, options) {
|
|
123
|
+
const text = ref(input);
|
|
124
|
+
return computed({
|
|
125
|
+
get() {
|
|
126
|
+
return changeCase[type](text.value, options);
|
|
127
|
+
},
|
|
128
|
+
set(value) {
|
|
129
|
+
text.value = value;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
94
132
|
}
|
|
95
133
|
|
|
96
134
|
var __defProp$2 = Object.defineProperty;
|
|
@@ -441,4 +479,4 @@ function useQRCode(text, options) {
|
|
|
441
479
|
return result;
|
|
442
480
|
}
|
|
443
481
|
|
|
444
|
-
export { createCookies, useAxios, useCookies, useDrauu, useFocusTrap, useFuse, useJwt, useNProgress, useQRCode };
|
|
482
|
+
export { createCookies, useAxios, useChangeCase, useCookies, useDrauu, useFocusTrap, useFuse, useJwt, useNProgress, useQRCode };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueuse/integrations",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-beta.3",
|
|
4
4
|
"description": "Integration wrappers for utility libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -71,6 +71,11 @@
|
|
|
71
71
|
"import": "./useQRCode.mjs",
|
|
72
72
|
"require": "./useQRCode.cjs",
|
|
73
73
|
"types": "./useQRCode.d.ts"
|
|
74
|
+
},
|
|
75
|
+
"./useChangeCase": {
|
|
76
|
+
"import": "./useChangeCase.mjs",
|
|
77
|
+
"require": "./useChangeCase.cjs",
|
|
78
|
+
"types": "./useChangeCase.d.ts"
|
|
74
79
|
}
|
|
75
80
|
},
|
|
76
81
|
"main": "./index.cjs",
|
|
@@ -80,6 +85,7 @@
|
|
|
80
85
|
"types": "./index.d.ts",
|
|
81
86
|
"peerDependencies": {
|
|
82
87
|
"axios": "*",
|
|
88
|
+
"change-case": "*",
|
|
83
89
|
"drauu": "*",
|
|
84
90
|
"focus-trap": "*",
|
|
85
91
|
"fuse.js": "*",
|
|
@@ -115,15 +121,16 @@
|
|
|
115
121
|
}
|
|
116
122
|
},
|
|
117
123
|
"dependencies": {
|
|
118
|
-
"@vueuse/core": "
|
|
119
|
-
"@vueuse/shared": "
|
|
124
|
+
"@vueuse/core": "8.0.0-beta.3",
|
|
125
|
+
"@vueuse/shared": "8.0.0-beta.3",
|
|
120
126
|
"vue-demi": "*"
|
|
121
127
|
},
|
|
122
128
|
"devDependencies": {
|
|
123
129
|
"@types/nprogress": "^0.2.0",
|
|
124
130
|
"@types/qrcode": "^1.4.2",
|
|
125
131
|
"axios": "^0.26.0",
|
|
126
|
-
"
|
|
132
|
+
"change-case": "^4.1.2",
|
|
133
|
+
"drauu": "^0.3.0",
|
|
127
134
|
"focus-trap": "^6.7.3",
|
|
128
135
|
"fuse.js": "^6.5.3",
|
|
129
136
|
"jwt-decode": "^3.1.2",
|
package/useAxios.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vueDemi = require('vue-demi');
|
|
6
|
+
var shared = require('@vueuse/shared');
|
|
6
7
|
var axios = require('axios');
|
|
7
8
|
|
|
8
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -42,7 +43,7 @@ function useAxios(url, ...args) {
|
|
|
42
43
|
if ("request" in args[1])
|
|
43
44
|
instance = args[1];
|
|
44
45
|
}
|
|
45
|
-
if (args.length
|
|
46
|
+
if (args.length === 2 && !("request" in args[1]) || args.length === 3)
|
|
46
47
|
options = args[args.length - 1];
|
|
47
48
|
const response = vueDemi.shallowRef();
|
|
48
49
|
const data = vueDemi.shallowRef();
|
|
@@ -76,7 +77,7 @@ function useAxios(url, ...args) {
|
|
|
76
77
|
};
|
|
77
78
|
if (options.immediate)
|
|
78
79
|
execute();
|
|
79
|
-
|
|
80
|
+
const result = {
|
|
80
81
|
response,
|
|
81
82
|
data,
|
|
82
83
|
error,
|
|
@@ -90,6 +91,16 @@ function useAxios(url, ...args) {
|
|
|
90
91
|
abort,
|
|
91
92
|
execute
|
|
92
93
|
};
|
|
94
|
+
function waitUntilFinished() {
|
|
95
|
+
return new Promise((resolve, reject) => {
|
|
96
|
+
shared.until(isFinished).toBe(true).then(() => resolve(result)).catch((error2) => reject(error2));
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return __spreadProps(__spreadValues({}, result), {
|
|
100
|
+
then(onFulfilled, onRejected) {
|
|
101
|
+
return waitUntilFinished().then(onFulfilled, onRejected);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
93
104
|
}
|
|
94
105
|
|
|
95
106
|
exports.useAxios = useAxios;
|
package/useAxios.d.ts
CHANGED
|
@@ -43,8 +43,8 @@ interface UseAxiosOptions {
|
|
|
43
43
|
*/
|
|
44
44
|
immediate?: boolean;
|
|
45
45
|
}
|
|
46
|
-
declare function useAxios<T = any>(url: string, config?: AxiosRequestConfig, options?: UseAxiosOptions): UseAxiosReturn<T
|
|
47
|
-
declare function useAxios<T = any>(url: string, instance?: AxiosInstance, options?: UseAxiosOptions): UseAxiosReturn<T
|
|
48
|
-
declare function useAxios<T = any>(url: string, config: AxiosRequestConfig, instance: AxiosInstance, options?: UseAxiosOptions): UseAxiosReturn<T
|
|
46
|
+
declare function useAxios<T = any>(url: string, config?: AxiosRequestConfig, options?: UseAxiosOptions): UseAxiosReturn<T> & PromiseLike<UseAxiosReturn<T>>;
|
|
47
|
+
declare function useAxios<T = any>(url: string, instance?: AxiosInstance, options?: UseAxiosOptions): UseAxiosReturn<T> & PromiseLike<UseAxiosReturn<T>>;
|
|
48
|
+
declare function useAxios<T = any>(url: string, config: AxiosRequestConfig, instance: AxiosInstance, options?: UseAxiosOptions): UseAxiosReturn<T> & PromiseLike<UseAxiosReturn<T>>;
|
|
49
49
|
|
|
50
50
|
export { UseAxiosOptions, UseAxiosReturn, useAxios };
|
package/useAxios.iife.js
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
window.VueDemi = VueDemi
|
|
60
60
|
})(window)
|
|
61
61
|
;
|
|
62
|
-
;(function (exports, vueDemi, axios) {
|
|
62
|
+
;(function (exports, vueDemi, shared, axios) {
|
|
63
63
|
'use strict';
|
|
64
64
|
|
|
65
65
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
if ("request" in args[1])
|
|
100
100
|
instance = args[1];
|
|
101
101
|
}
|
|
102
|
-
if (args.length
|
|
102
|
+
if (args.length === 2 && !("request" in args[1]) || args.length === 3)
|
|
103
103
|
options = args[args.length - 1];
|
|
104
104
|
const response = vueDemi.shallowRef();
|
|
105
105
|
const data = vueDemi.shallowRef();
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
};
|
|
134
134
|
if (options.immediate)
|
|
135
135
|
execute();
|
|
136
|
-
|
|
136
|
+
const result = {
|
|
137
137
|
response,
|
|
138
138
|
data,
|
|
139
139
|
error,
|
|
@@ -147,10 +147,20 @@
|
|
|
147
147
|
abort,
|
|
148
148
|
execute
|
|
149
149
|
};
|
|
150
|
+
function waitUntilFinished() {
|
|
151
|
+
return new Promise((resolve, reject) => {
|
|
152
|
+
shared.until(isFinished).toBe(true).then(() => resolve(result)).catch((error2) => reject(error2));
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return __spreadProps(__spreadValues({}, result), {
|
|
156
|
+
then(onFulfilled, onRejected) {
|
|
157
|
+
return waitUntilFinished().then(onFulfilled, onRejected);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
150
160
|
}
|
|
151
161
|
|
|
152
162
|
exports.useAxios = useAxios;
|
|
153
163
|
|
|
154
164
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
155
165
|
|
|
156
|
-
})(this.VueUse = this.VueUse || {}, VueDemi, axios);
|
|
166
|
+
})(this.VueUse = this.VueUse || {}, VueDemi, VueUse, axios);
|
package/useAxios.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(a){if(!a.VueDemi){var n={},t=a.Vue;if(t)if(t.version.slice(0,2)==="2."){var p=a.VueCompositionAPI;if(p){for(var f in p)n[f]=p[f];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.")}else if(t.version.slice(0,2)==="3."){for(var f in t)n[f]=t[f];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=t,n.Vue2=void 0,n.version=t.version,n.set=function(o,u,c){return Array.isArray(o)?(o.length=Math.max(o.length,u),o.splice(u,1,c),c):(o[u]=c,c)},n.del=function(o,u){if(Array.isArray(o)){o.splice(u,1);return}delete o[u]}}else console.error("[vue-demi] Vue version "+t.version+" is unsupported.");else console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.");a.VueDemi=n}})(window),function(a,n,t,p){"use strict";function f(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var o=f(p),u=Object.defineProperty,c=Object.defineProperties,T=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable,P=(r,e,i)=>e in r?u(r,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[e]=i,h=(r,e)=>{for(var i in e||(e={}))C.call(e,i)&&P(r,i,e[i]);if(m)for(var i of m(e))D.call(e,i)&&P(r,i,e[i]);return r},O=(r,e)=>c(r,T(e));function E(r,...e){let i={},_=o.default,b={immediate:!0};e.length>0&&("request"in e[0]?_=e[0]:i=e[0]),e.length>1&&"request"in e[1]&&(_=e[1]),(e.length===2&&!("request"in e[1])||e.length===3)&&(b=e[e.length-1]);const y=n.shallowRef(),w=n.shallowRef(),d=n.ref(!1),v=n.ref(!1),V=n.ref(!1),j=n.shallowRef(),A=o.default.CancelToken.source(),x=s=>{d.value||!v.value||(A.cancel(s),V.value=!0,v.value=!1,d.value=!1)},U=s=>{v.value=s,d.value=!s},q=(s={})=>{U(!0),_(r,O(h(h({},i),s),{cancelToken:A.token})).then(l=>{y.value=l,w.value=l.data}).catch(l=>{j.value=l}).finally(()=>{U(!1)})};b.immediate&&q();const R={response:y,data:w,error:j,finished:d,loading:v,isFinished:d,isLoading:v,cancel:x,canceled:V,aborted:V,abort:x,execute:q};function F(){return new Promise((s,l)=>{t.until(d).toBe(!0).then(()=>s(R)).catch(I=>l(I))})}return O(h({},R),{then(s,l){return F().then(s,l)}})}a.useAxios=E,Object.defineProperty(a,"__esModule",{value:!0})}(this.VueUse=this.VueUse||{},VueDemi,VueUse,axios);
|
package/useAxios.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { shallowRef, ref } from 'vue-demi';
|
|
2
|
+
import { until } from '@vueuse/shared';
|
|
2
3
|
import axios from 'axios';
|
|
3
4
|
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
@@ -34,7 +35,7 @@ function useAxios(url, ...args) {
|
|
|
34
35
|
if ("request" in args[1])
|
|
35
36
|
instance = args[1];
|
|
36
37
|
}
|
|
37
|
-
if (args.length
|
|
38
|
+
if (args.length === 2 && !("request" in args[1]) || args.length === 3)
|
|
38
39
|
options = args[args.length - 1];
|
|
39
40
|
const response = shallowRef();
|
|
40
41
|
const data = shallowRef();
|
|
@@ -68,7 +69,7 @@ function useAxios(url, ...args) {
|
|
|
68
69
|
};
|
|
69
70
|
if (options.immediate)
|
|
70
71
|
execute();
|
|
71
|
-
|
|
72
|
+
const result = {
|
|
72
73
|
response,
|
|
73
74
|
data,
|
|
74
75
|
error,
|
|
@@ -82,6 +83,16 @@ function useAxios(url, ...args) {
|
|
|
82
83
|
abort,
|
|
83
84
|
execute
|
|
84
85
|
};
|
|
86
|
+
function waitUntilFinished() {
|
|
87
|
+
return new Promise((resolve, reject) => {
|
|
88
|
+
until(isFinished).toBe(true).then(() => resolve(result)).catch((error2) => reject(error2));
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return __spreadProps(__spreadValues({}, result), {
|
|
92
|
+
then(onFulfilled, onRejected) {
|
|
93
|
+
return waitUntilFinished().then(onFulfilled, onRejected);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
85
96
|
}
|
|
86
97
|
|
|
87
98
|
export { useAxios };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vueDemi = require('vue-demi');
|
|
6
|
+
var changeCase$1 = require('change-case');
|
|
7
|
+
|
|
8
|
+
var changeCase = /*#__PURE__*/Object.freeze({
|
|
9
|
+
__proto__: null,
|
|
10
|
+
camelCase: changeCase$1.camelCase,
|
|
11
|
+
capitalCase: changeCase$1.capitalCase,
|
|
12
|
+
constantCase: changeCase$1.constantCase,
|
|
13
|
+
dotCase: changeCase$1.dotCase,
|
|
14
|
+
headerCase: changeCase$1.headerCase,
|
|
15
|
+
noCase: changeCase$1.noCase,
|
|
16
|
+
paramCase: changeCase$1.paramCase,
|
|
17
|
+
pascalCase: changeCase$1.pascalCase,
|
|
18
|
+
pathCase: changeCase$1.pathCase,
|
|
19
|
+
sentenceCase: changeCase$1.sentenceCase,
|
|
20
|
+
snakeCase: changeCase$1.snakeCase
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
function useChangeCase(input, type, options) {
|
|
24
|
+
const text = vueDemi.ref(input);
|
|
25
|
+
return vueDemi.computed({
|
|
26
|
+
get() {
|
|
27
|
+
return changeCase[type](text.value, options);
|
|
28
|
+
},
|
|
29
|
+
set(value) {
|
|
30
|
+
text.value = value;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
exports.useChangeCase = useChangeCase;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { camelCase, capitalCase, constantCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase, Options } from 'change-case';
|
|
2
|
+
import { MaybeRef } from '@vueuse/shared';
|
|
3
|
+
import { WritableComputedRef } from 'vue-demi';
|
|
4
|
+
|
|
5
|
+
declare const changeCase_camelCase: typeof camelCase;
|
|
6
|
+
declare const changeCase_capitalCase: typeof capitalCase;
|
|
7
|
+
declare const changeCase_constantCase: typeof constantCase;
|
|
8
|
+
declare const changeCase_dotCase: typeof dotCase;
|
|
9
|
+
declare const changeCase_headerCase: typeof headerCase;
|
|
10
|
+
declare const changeCase_noCase: typeof noCase;
|
|
11
|
+
declare const changeCase_paramCase: typeof paramCase;
|
|
12
|
+
declare const changeCase_pascalCase: typeof pascalCase;
|
|
13
|
+
declare const changeCase_pathCase: typeof pathCase;
|
|
14
|
+
declare const changeCase_sentenceCase: typeof sentenceCase;
|
|
15
|
+
declare const changeCase_snakeCase: typeof snakeCase;
|
|
16
|
+
declare namespace changeCase {
|
|
17
|
+
export {
|
|
18
|
+
changeCase_camelCase as camelCase,
|
|
19
|
+
changeCase_capitalCase as capitalCase,
|
|
20
|
+
changeCase_constantCase as constantCase,
|
|
21
|
+
changeCase_dotCase as dotCase,
|
|
22
|
+
changeCase_headerCase as headerCase,
|
|
23
|
+
changeCase_noCase as noCase,
|
|
24
|
+
changeCase_paramCase as paramCase,
|
|
25
|
+
changeCase_pascalCase as pascalCase,
|
|
26
|
+
changeCase_pathCase as pathCase,
|
|
27
|
+
changeCase_sentenceCase as sentenceCase,
|
|
28
|
+
changeCase_snakeCase as snakeCase,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare type ChangeCaseType = keyof typeof changeCase;
|
|
33
|
+
declare function useChangeCase(input: MaybeRef<string>, type: ChangeCaseType, options?: Options | undefined): WritableComputedRef<string>;
|
|
34
|
+
|
|
35
|
+
export { ChangeCaseType, useChangeCase };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
;(function (window) {
|
|
2
|
+
if (window.VueDemi) {
|
|
3
|
+
return
|
|
4
|
+
}
|
|
5
|
+
var VueDemi = {}
|
|
6
|
+
var Vue = window.Vue
|
|
7
|
+
if (Vue) {
|
|
8
|
+
if (Vue.version.slice(0, 2) === '2.') {
|
|
9
|
+
var VueCompositionAPI = window.VueCompositionAPI
|
|
10
|
+
if (VueCompositionAPI) {
|
|
11
|
+
for (var key in VueCompositionAPI) {
|
|
12
|
+
VueDemi[key] = VueCompositionAPI[key]
|
|
13
|
+
}
|
|
14
|
+
VueDemi.isVue2 = true
|
|
15
|
+
VueDemi.isVue3 = false
|
|
16
|
+
VueDemi.install = function (){}
|
|
17
|
+
VueDemi.Vue = Vue
|
|
18
|
+
VueDemi.Vue2 = Vue
|
|
19
|
+
VueDemi.version = Vue.version
|
|
20
|
+
} else {
|
|
21
|
+
console.error(
|
|
22
|
+
'[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.'
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
} else if (Vue.version.slice(0, 2) === '3.') {
|
|
26
|
+
for (var key in Vue) {
|
|
27
|
+
VueDemi[key] = Vue[key]
|
|
28
|
+
}
|
|
29
|
+
VueDemi.isVue2 = false
|
|
30
|
+
VueDemi.isVue3 = true
|
|
31
|
+
VueDemi.install = function (){}
|
|
32
|
+
VueDemi.Vue = Vue
|
|
33
|
+
VueDemi.Vue2 = undefined
|
|
34
|
+
VueDemi.version = Vue.version
|
|
35
|
+
VueDemi.set = function(target, key, val) {
|
|
36
|
+
if (Array.isArray(target)) {
|
|
37
|
+
target.length = Math.max(target.length, key)
|
|
38
|
+
target.splice(key, 1, val)
|
|
39
|
+
return val
|
|
40
|
+
}
|
|
41
|
+
target[key] = val
|
|
42
|
+
return val
|
|
43
|
+
}
|
|
44
|
+
VueDemi.del = function(target, key) {
|
|
45
|
+
if (Array.isArray(target)) {
|
|
46
|
+
target.splice(key, 1)
|
|
47
|
+
return
|
|
48
|
+
}
|
|
49
|
+
delete target[key]
|
|
50
|
+
}
|
|
51
|
+
} else {
|
|
52
|
+
console.error('[vue-demi] Vue version ' + Vue.version + ' is unsupported.')
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
console.error(
|
|
56
|
+
'[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.'
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
window.VueDemi = VueDemi
|
|
60
|
+
})(window)
|
|
61
|
+
;
|
|
62
|
+
;(function (exports, vueDemi, changeCase$1) {
|
|
63
|
+
'use strict';
|
|
64
|
+
|
|
65
|
+
var changeCase = /*#__PURE__*/Object.freeze({
|
|
66
|
+
__proto__: null,
|
|
67
|
+
camelCase: changeCase$1.camelCase,
|
|
68
|
+
capitalCase: changeCase$1.capitalCase,
|
|
69
|
+
constantCase: changeCase$1.constantCase,
|
|
70
|
+
dotCase: changeCase$1.dotCase,
|
|
71
|
+
headerCase: changeCase$1.headerCase,
|
|
72
|
+
noCase: changeCase$1.noCase,
|
|
73
|
+
paramCase: changeCase$1.paramCase,
|
|
74
|
+
pascalCase: changeCase$1.pascalCase,
|
|
75
|
+
pathCase: changeCase$1.pathCase,
|
|
76
|
+
sentenceCase: changeCase$1.sentenceCase,
|
|
77
|
+
snakeCase: changeCase$1.snakeCase
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
function useChangeCase(input, type, options) {
|
|
81
|
+
const text = vueDemi.ref(input);
|
|
82
|
+
return vueDemi.computed({
|
|
83
|
+
get() {
|
|
84
|
+
return changeCase[type](text.value, options);
|
|
85
|
+
},
|
|
86
|
+
set(value) {
|
|
87
|
+
text.value = value;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
exports.useChangeCase = useChangeCase;
|
|
93
|
+
|
|
94
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
95
|
+
|
|
96
|
+
})(this.VueUse = this.VueUse || {}, VueDemi, changeCase$1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n){if(!n.VueDemi){var s={},e=n.Vue;if(e)if(e.version.slice(0,2)==="2."){var a=n.VueCompositionAPI;if(a){for(var u in a)s[u]=a[u];s.isVue2=!0,s.isVue3=!1,s.install=function(){},s.Vue=e,s.Vue2=e,s.version=e.version}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.")}else if(e.version.slice(0,2)==="3."){for(var u in e)s[u]=e[u];s.isVue2=!1,s.isVue3=!0,s.install=function(){},s.Vue=e,s.Vue2=void 0,s.version=e.version,s.set=function(r,i,o){return Array.isArray(r)?(r.length=Math.max(r.length,i),r.splice(i,1,o),o):(r[i]=o,o)},s.del=function(r,i){if(Array.isArray(r)){r.splice(i,1);return}delete r[i]}}else console.error("[vue-demi] Vue version "+e.version+" is unsupported.");else console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.");n.VueDemi=s}})(window),function(n,s,e){"use strict";var a=Object.freeze({__proto__:null,camelCase:e.camelCase,capitalCase:e.capitalCase,constantCase:e.constantCase,dotCase:e.dotCase,headerCase:e.headerCase,noCase:e.noCase,paramCase:e.paramCase,pascalCase:e.pascalCase,pathCase:e.pathCase,sentenceCase:e.sentenceCase,snakeCase:e.snakeCase});function u(r,i,o){const t=s.ref(r);return s.computed({get(){return a[i](t.value,o)},set(l){t.value=l}})}n.useChangeCase=u,Object.defineProperty(n,"__esModule",{value:!0})}(this.VueUse=this.VueUse||{},VueDemi,changeCase$1);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ref, computed } from 'vue-demi';
|
|
2
|
+
import { camelCase, capitalCase, constantCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase } from 'change-case';
|
|
3
|
+
|
|
4
|
+
var changeCase = /*#__PURE__*/Object.freeze({
|
|
5
|
+
__proto__: null,
|
|
6
|
+
camelCase: camelCase,
|
|
7
|
+
capitalCase: capitalCase,
|
|
8
|
+
constantCase: constantCase,
|
|
9
|
+
dotCase: dotCase,
|
|
10
|
+
headerCase: headerCase,
|
|
11
|
+
noCase: noCase,
|
|
12
|
+
paramCase: paramCase,
|
|
13
|
+
pascalCase: pascalCase,
|
|
14
|
+
pathCase: pathCase,
|
|
15
|
+
sentenceCase: sentenceCase,
|
|
16
|
+
snakeCase: snakeCase
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
function useChangeCase(input, type, options) {
|
|
20
|
+
const text = ref(input);
|
|
21
|
+
return computed({
|
|
22
|
+
get() {
|
|
23
|
+
return changeCase[type](text.value, options);
|
|
24
|
+
},
|
|
25
|
+
set(value) {
|
|
26
|
+
text.value = value;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { useChangeCase };
|