mortise-tenon-design 0.0.16 → 0.0.18
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/es/index.mjs +2 -4
- package/es/index.mjs.map +1 -1
- package/lib/index.js +1 -1
- package/package.json +3 -3
- package/es/hooks/index.d.ts +0 -1
- package/es/hooks/use-throttle-control/index.d.ts +0 -14
- package/es/hooks/use-throttle-control/index.mjs +0 -29
- package/es/hooks/use-throttle-control/index.mjs.map +0 -1
- package/lib/components/expand-box/index.d.ts +0 -32
- package/lib/components/expand-box/src/expand-box.d.ts +0 -8
- package/lib/components/expand-box/src/expand-box.vue.d.ts +0 -26
- package/lib/components/index.d.ts +0 -1
- package/lib/hooks/index.d.ts +0 -1
- package/lib/hooks/use-throttle-control/index.d.ts +0 -14
- package/lib/hooks/use-throttle-control/index.js +0 -2
- package/lib/hooks/use-throttle-control/index.js.map +0 -1
- /package/{es/components → types}/expand-box/index.d.ts +0 -0
- /package/{es/components → types}/expand-box/src/expand-box.d.ts +0 -0
- /package/{es/components → types}/expand-box/src/expand-box.vue.d.ts +0 -0
- /package/{es/components → types}/index.d.ts +0 -0
package/es/index.mjs
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
import { MtExpandBox as
|
2
|
-
import { useThrottleControl as x } from "./hooks/use-throttle-control/index.mjs";
|
1
|
+
import { MtExpandBox as p } from "./components/expand-box/index.mjs";
|
3
2
|
export {
|
4
|
-
|
5
|
-
x as useThrottleControl
|
3
|
+
p as MtExpandBox
|
6
4
|
};
|
7
5
|
//# sourceMappingURL=index.mjs.map
|
package/es/index.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/lib/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./components/expand-box/index.js")
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./components/expand-box/index.js");exports.MtExpandBox=e.MtExpandBox;
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "mortise-tenon-design",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.
|
4
|
+
"version": "0.0.18",
|
5
5
|
"description": "榫卯组件库",
|
6
6
|
"author": "nixwai",
|
7
7
|
"license": "ISC",
|
@@ -11,8 +11,8 @@
|
|
11
11
|
},
|
12
12
|
"main": "lib/index.js",
|
13
13
|
"module": "es/index.mjs",
|
14
|
-
"types": "
|
15
|
-
"files": ["es", "lib"],
|
14
|
+
"types": "types/index.d.ts",
|
15
|
+
"files": ["es", "lib", "types"],
|
16
16
|
"peerDependencies": {
|
17
17
|
"vue": "^3.4.0"
|
18
18
|
},
|
package/es/hooks/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './use-throttle-control';
|
@@ -1,14 +0,0 @@
|
|
1
|
-
type AnyFn = (...args: any[]) => any;
|
2
|
-
/**
|
3
|
-
* 节流控制
|
4
|
-
* @param ms 节流时间(ms)
|
5
|
-
* @param fn 节流函数
|
6
|
-
*/
|
7
|
-
export declare function useThrottleControl<Fn extends AnyFn>(ms?: number, fn?: Fn): {
|
8
|
-
throttleOpen: import('vue').Ref<boolean, boolean>;
|
9
|
-
throttleFn: Fn;
|
10
|
-
openThrottle: () => NodeJS.Timeout;
|
11
|
-
closeThrottle: (timer?: NodeJS.Timeout) => void;
|
12
|
-
};
|
13
|
-
export type UseThrottleControlReturn = ReturnType<typeof useThrottleControl>;
|
14
|
-
export {};
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import { ref as c, onBeforeUnmount as f } from "vue";
|
2
|
-
function a(l = 200, n) {
|
3
|
-
const e = c(!1);
|
4
|
-
let t;
|
5
|
-
function u() {
|
6
|
-
return o(), e.value = !0, t = setTimeout(() => {
|
7
|
-
o();
|
8
|
-
}, l), t;
|
9
|
-
}
|
10
|
-
function o(r) {
|
11
|
-
(!r || r === t) && (e.value = !1, t && (clearTimeout(t), t = void 0));
|
12
|
-
}
|
13
|
-
const i = (...r) => {
|
14
|
-
if (!e.value)
|
15
|
-
return u(), n == null ? void 0 : n(...r);
|
16
|
-
};
|
17
|
-
return f(() => {
|
18
|
-
o();
|
19
|
-
}), {
|
20
|
-
throttleOpen: e,
|
21
|
-
throttleFn: i,
|
22
|
-
openThrottle: u,
|
23
|
-
closeThrottle: o
|
24
|
-
};
|
25
|
-
}
|
26
|
-
export {
|
27
|
-
a as useThrottleControl
|
28
|
-
};
|
29
|
-
//# sourceMappingURL=index.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-throttle-control/index.ts"],"sourcesContent":["import { onBeforeUnmount, ref } from 'vue';\r\n\r\ntype AnyFn = (...args: any[]) => any;\r\n\r\n/**\r\n * 节流控制\r\n * @param ms 节流时间(ms)\r\n * @param fn 节流函数\r\n */\r\nexport function useThrottleControl<Fn extends AnyFn>(ms: number = 200, fn?: Fn) {\r\n /** 节流状态 */\r\n const throttleOpen = ref(false);\r\n /** 当前执行的定时器 */\r\n let runningTimer: NodeJS.Timeout | undefined;\r\n\r\n /** 开启节流,已在执行的会被覆盖 */\r\n function openThrottle() {\r\n closeThrottle();\r\n throttleOpen.value = true;\r\n runningTimer = setTimeout(() => {\r\n closeThrottle();\r\n }, ms);\r\n return runningTimer;\r\n }\r\n\r\n /** 关闭节流定时器 */\r\n function closeThrottle(timer?: NodeJS.Timeout) {\r\n // 如果有传入timer时,会判断是否为当前执行开启的定时器\r\n if (!timer || timer === runningTimer) {\r\n throttleOpen.value = false;\r\n if (runningTimer) {\r\n clearTimeout(runningTimer);\r\n runningTimer = undefined;\r\n }\r\n }\r\n }\r\n\r\n /** 节流控制方法 */\r\n const throttleFn = ((...args: any[]) => {\r\n // 节流状态开启中,不可重复执行\r\n if (throttleOpen.value) {\r\n return;\r\n }\r\n openThrottle();\r\n return fn?.(...args);\r\n }) as Fn;\r\n\r\n /** 移除时销毁定时器 */\r\n onBeforeUnmount(() => {\r\n closeThrottle();\r\n });\r\n\r\n return {\r\n throttleOpen,\r\n throttleFn,\r\n openThrottle,\r\n closeThrottle,\r\n };\r\n}\r\n\r\nexport type UseThrottleControlReturn = ReturnType<typeof useThrottleControl>;\r\n"],"names":["useThrottleControl","ms","fn","throttleOpen","ref","runningTimer","openThrottle","closeThrottle","timer","throttleFn","args","onBeforeUnmount"],"mappings":";AASgB,SAAAA,EAAqCC,IAAa,KAAKC,GAAS;AAExE,QAAAC,IAAeC,EAAI,EAAK;AAE1B,MAAAC;AAGJ,WAASC,IAAe;AACR,WAAAC,KACdJ,EAAa,QAAQ,IACrBE,IAAe,WAAW,MAAM;AAChB,MAAAE;OACbN,CAAE,GACEI;AAAA,EACT;AAGA,WAASE,EAAcC,GAAwB;AAEzC,KAAA,CAACA,KAASA,MAAUH,OACtBF,EAAa,QAAQ,IACjBE,MACF,aAAaA,CAAY,GACVA,IAAA;AAAA,EAGrB;AAGM,QAAAI,IAAc,IAAIC,MAAgB;AAEtC,QAAI,CAAAP,EAAa;AAGJ,aAAAG,KACNJ,KAAA,gBAAAA,EAAK,GAAGQ;AAAA,EAAI;AAIrB,SAAAC,EAAgB,MAAM;AACN,IAAAJ;EAAA,CACf,GAEM;AAAA,IACL,cAAAJ;AAAA,IACA,YAAAM;AAAA,IACA,cAAAH;AAAA,IACA,eAAAC;AAAA,EAAA;AAEJ;"}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
export declare const MtExpandBox: {
|
2
|
-
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./src/expand-box').ExpandBoxProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
3
|
-
open: boolean;
|
4
|
-
targetRange: number;
|
5
|
-
transitionTime: number;
|
6
|
-
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
7
|
-
P: {};
|
8
|
-
B: {};
|
9
|
-
D: {};
|
10
|
-
C: {};
|
11
|
-
M: {};
|
12
|
-
Defaults: {};
|
13
|
-
}, Readonly<import('./src/expand-box').ExpandBoxProps> & Readonly<{}>, {}, {}, {}, {}, {
|
14
|
-
open: boolean;
|
15
|
-
targetRange: number;
|
16
|
-
transitionTime: number;
|
17
|
-
}>;
|
18
|
-
__isFragment?: never;
|
19
|
-
__isTeleport?: never;
|
20
|
-
__isSuspense?: never;
|
21
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('./src/expand-box').ExpandBoxProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
22
|
-
open: boolean;
|
23
|
-
targetRange: number;
|
24
|
-
transitionTime: number;
|
25
|
-
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
26
|
-
$slots: {
|
27
|
-
default?(_: {
|
28
|
-
open: boolean;
|
29
|
-
isOutRange: boolean;
|
30
|
-
}): any;
|
31
|
-
};
|
32
|
-
});
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import { ExpandBoxProps } from './expand-box';
|
2
|
-
declare function __VLS_template(): {
|
3
|
-
slots: {
|
4
|
-
default?(_: {
|
5
|
-
open: boolean;
|
6
|
-
isOutRange: boolean;
|
7
|
-
}): any;
|
8
|
-
};
|
9
|
-
refs: {
|
10
|
-
contentRef: HTMLDivElement;
|
11
|
-
};
|
12
|
-
attrs: Partial<{}>;
|
13
|
-
};
|
14
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
15
|
-
declare const __VLS_component: import('vue').DefineComponent<ExpandBoxProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ExpandBoxProps> & Readonly<{}>, {
|
16
|
-
open: boolean;
|
17
|
-
targetRange: number;
|
18
|
-
transitionTime: number;
|
19
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
20
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
21
|
-
export default _default;
|
22
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
23
|
-
new (): {
|
24
|
-
$slots: S;
|
25
|
-
};
|
26
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './expand-box';
|
package/lib/hooks/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './use-throttle-control';
|
@@ -1,14 +0,0 @@
|
|
1
|
-
type AnyFn = (...args: any[]) => any;
|
2
|
-
/**
|
3
|
-
* 节流控制
|
4
|
-
* @param ms 节流时间(ms)
|
5
|
-
* @param fn 节流函数
|
6
|
-
*/
|
7
|
-
export declare function useThrottleControl<Fn extends AnyFn>(ms?: number, fn?: Fn): {
|
8
|
-
throttleOpen: import('vue').Ref<boolean, boolean>;
|
9
|
-
throttleFn: Fn;
|
10
|
-
openThrottle: () => NodeJS.Timeout;
|
11
|
-
closeThrottle: (timer?: NodeJS.Timeout) => void;
|
12
|
-
};
|
13
|
-
export type UseThrottleControlReturn = ReturnType<typeof useThrottleControl>;
|
14
|
-
export {};
|
@@ -1,2 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue");function c(i=200,n){const t=l.ref(!1);let e;function u(){return o(),t.value=!0,e=setTimeout(()=>{o()},i),e}function o(r){(!r||r===e)&&(t.value=!1,e&&(clearTimeout(e),e=void 0))}const s=(...r)=>{if(!t.value)return u(),n==null?void 0:n(...r)};return l.onBeforeUnmount(()=>{o()}),{throttleOpen:t,throttleFn:s,openThrottle:u,closeThrottle:o}}exports.useThrottleControl=c;
|
2
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-throttle-control/index.ts"],"sourcesContent":["import { onBeforeUnmount, ref } from 'vue';\r\n\r\ntype AnyFn = (...args: any[]) => any;\r\n\r\n/**\r\n * 节流控制\r\n * @param ms 节流时间(ms)\r\n * @param fn 节流函数\r\n */\r\nexport function useThrottleControl<Fn extends AnyFn>(ms: number = 200, fn?: Fn) {\r\n /** 节流状态 */\r\n const throttleOpen = ref(false);\r\n /** 当前执行的定时器 */\r\n let runningTimer: NodeJS.Timeout | undefined;\r\n\r\n /** 开启节流,已在执行的会被覆盖 */\r\n function openThrottle() {\r\n closeThrottle();\r\n throttleOpen.value = true;\r\n runningTimer = setTimeout(() => {\r\n closeThrottle();\r\n }, ms);\r\n return runningTimer;\r\n }\r\n\r\n /** 关闭节流定时器 */\r\n function closeThrottle(timer?: NodeJS.Timeout) {\r\n // 如果有传入timer时,会判断是否为当前执行开启的定时器\r\n if (!timer || timer === runningTimer) {\r\n throttleOpen.value = false;\r\n if (runningTimer) {\r\n clearTimeout(runningTimer);\r\n runningTimer = undefined;\r\n }\r\n }\r\n }\r\n\r\n /** 节流控制方法 */\r\n const throttleFn = ((...args: any[]) => {\r\n // 节流状态开启中,不可重复执行\r\n if (throttleOpen.value) {\r\n return;\r\n }\r\n openThrottle();\r\n return fn?.(...args);\r\n }) as Fn;\r\n\r\n /** 移除时销毁定时器 */\r\n onBeforeUnmount(() => {\r\n closeThrottle();\r\n });\r\n\r\n return {\r\n throttleOpen,\r\n throttleFn,\r\n openThrottle,\r\n closeThrottle,\r\n };\r\n}\r\n\r\nexport type UseThrottleControlReturn = ReturnType<typeof useThrottleControl>;\r\n"],"names":["useThrottleControl","ms","fn","throttleOpen","ref","runningTimer","openThrottle","closeThrottle","timer","throttleFn","args","onBeforeUnmount"],"mappings":"uGASgB,SAAAA,EAAqCC,EAAa,IAAKC,EAAS,CAExE,MAAAC,EAAeC,MAAI,EAAK,EAE1B,IAAAC,EAGJ,SAASC,GAAe,CACR,OAAAC,IACdJ,EAAa,MAAQ,GACrBE,EAAe,WAAW,IAAM,CAChBE,KACbN,CAAE,EACEI,CACT,CAGA,SAASE,EAAcC,EAAwB,EAEzC,CAACA,GAASA,IAAUH,KACtBF,EAAa,MAAQ,GACjBE,IACF,aAAaA,CAAY,EACVA,EAAA,QAGrB,CAGM,MAAAI,EAAc,IAAIC,IAAgB,CAEtC,GAAI,CAAAP,EAAa,MAGJ,OAAAG,IACNJ,GAAA,YAAAA,EAAK,GAAGQ,EAAI,EAIrBC,OAAAA,EAAAA,gBAAgB,IAAM,CACNJ,GAAA,CACf,EAEM,CACL,aAAAJ,EACA,WAAAM,EACA,aAAAH,EACA,cAAAC,CAAA,CAEJ"}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|