@citruslime/vue-utils 1.0.0 → 1.0.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,39 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { reactive, toRefs } from "vue";
|
|
21
|
-
function useDebouncer(timeout = 500) {
|
|
22
|
-
const debouncerState = reactive({
|
|
1
|
+
import { reactive as r, toRefs as c } from "vue";
|
|
2
|
+
function d(n = 500) {
|
|
3
|
+
const e = r({
|
|
23
4
|
debouncer: null,
|
|
24
|
-
timeout
|
|
5
|
+
timeout: n
|
|
25
6
|
});
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
window.clearTimeout(debouncerState.debouncer);
|
|
29
|
-
}
|
|
30
|
-
debouncerState.debouncer = window.setTimeout(() => event(...eventArgs), debouncerState.timeout);
|
|
7
|
+
function o(t, ...u) {
|
|
8
|
+
e.debouncer !== null && window.clearTimeout(e.debouncer), e.debouncer = window.setTimeout(() => t(...u), e.timeout);
|
|
31
9
|
}
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
return {
|
|
11
|
+
...c(e),
|
|
12
|
+
debounce: o
|
|
13
|
+
};
|
|
35
14
|
}
|
|
36
|
-
function
|
|
37
|
-
return JSON.parse(JSON.stringify(
|
|
15
|
+
function b(n) {
|
|
16
|
+
return JSON.parse(JSON.stringify(n));
|
|
38
17
|
}
|
|
39
|
-
export {
|
|
18
|
+
export {
|
|
19
|
+
b as copy,
|
|
20
|
+
d as useDebouncer
|
|
21
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.CitrusLimeVueUtils={},e.Vue))})(this,function(e,n){"use strict";function o(t=500){const u=n.reactive({debouncer:null,timeout:t});function r(c,...d){u.debouncer!==null&&window.clearTimeout(u.debouncer),u.debouncer=window.setTimeout(()=>c(...d),u.timeout)}return{...n.toRefs(u),debounce:r}}function i(t){return JSON.parse(JSON.stringify(t))}e.copy=i,e.useDebouncer=o,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/env.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citruslime/vue-utils",
|
|
3
|
-
"version": "1.0.0",
|
|
3
|
+
"version": "1.0.1-beta.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"author": {
|
|
5
6
|
"name": "Citrus-Lime Ltd",
|
|
6
7
|
"url": "https://citruslime.com"
|
|
@@ -13,6 +14,9 @@
|
|
|
13
14
|
"files": [
|
|
14
15
|
"dist"
|
|
15
16
|
],
|
|
17
|
+
"maintainers": [
|
|
18
|
+
"Citrus-Lime"
|
|
19
|
+
],
|
|
16
20
|
"main": "dist/citrus-lime-vue-utils.umd.js",
|
|
17
21
|
"module": "dist/citrus-lime-vue-utils.es.js",
|
|
18
22
|
"types": "dist/main.d.ts",
|
|
@@ -25,12 +29,7 @@
|
|
|
25
29
|
"scripts": {
|
|
26
30
|
"build": "vite build && copyfiles -u 2 \"dist/src/**/*\" dist && del-cli dist/src"
|
|
27
31
|
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"copyfiles": "^2.4.1",
|
|
30
|
-
"del-cli": "^4.0.1",
|
|
31
|
-
"vite-plugin-dts": "^0.9.10"
|
|
32
|
-
},
|
|
33
32
|
"peerDependencies": {
|
|
34
|
-
"vue": "^3.2.
|
|
33
|
+
"vue": "^3.2.39"
|
|
35
34
|
}
|
|
36
35
|
}
|