@tonar/vue-kit 0.3.1 → 0.3.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/dist/components.es.js +1 -1
- package/dist/composables.es.js +1 -2
- package/dist/index.es.js +1 -1
- package/dist/js/{components.Pdybuv0e.js → components.29YtMKby.js} +3 -6
- package/dist/types/components/so-authority/composables/index.d.ts +0 -2
- package/dist/types/components/so-authority/index.d.ts +0 -2
- package/dist/types/components/so-test/so-test.vue.d.ts +0 -2
- package/dist/types/composables/storage/index.d.ts +0 -2
- package/package.json +6 -5
package/dist/components.es.js
CHANGED
package/dist/composables.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, ref } from "vue";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/composables/storage/index.ts
|
|
4
4
|
const useStorage = ({ key, defaultValue, hasDiff, onChange, storage = localStorage, checkType = () => true, beforeunload }) => {
|
|
5
5
|
const normalizedValue = (val) => {
|
|
6
6
|
try {
|
|
@@ -56,5 +56,4 @@ const useStorage = ({ key, defaultValue, hasDiff, onChange, storage = localStora
|
|
|
56
56
|
];
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
//#endregion
|
|
60
59
|
export { useStorage };
|
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as so_authority_default, t as _sfc_main } from "./js/components.
|
|
1
|
+
import { n as so_authority_default, t as _sfc_main } from "./js/components.29YtMKby.js";
|
|
2
2
|
import { useStorage } from "./composables.es.js";
|
|
3
3
|
|
|
4
4
|
export { so_authority_default as SoAuthority, _sfc_main as SoTest, useStorage };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed, createElementBlock, createElementVNode, defineComponent, openBlock, ref, toDisplayString } from "vue";
|
|
2
2
|
import { isNil } from "@tonar/utils";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/components/so-authority/composables/index.ts
|
|
5
5
|
/**
|
|
6
6
|
* @author sonion
|
|
7
7
|
* @description 检查是否为合法权限值
|
|
@@ -49,8 +49,7 @@ const usePermission = (props) => {
|
|
|
49
49
|
})];
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
//#region src/components/so-authority/index.ts
|
|
52
|
+
// src/components/so-authority/index.ts
|
|
54
53
|
var so_authority_default = defineComponent({
|
|
55
54
|
name: "SoAuthority",
|
|
56
55
|
props: {
|
|
@@ -87,8 +86,7 @@ var so_authority_default = defineComponent({
|
|
|
87
86
|
}
|
|
88
87
|
});
|
|
89
88
|
|
|
90
|
-
|
|
91
|
-
//#region src/components/so-test/so-test.vue
|
|
89
|
+
// src/components/so-test/so-test.vue
|
|
92
90
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
93
91
|
__name: "so-test",
|
|
94
92
|
setup(__props) {
|
|
@@ -110,5 +108,4 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
110
108
|
}
|
|
111
109
|
});
|
|
112
110
|
|
|
113
|
-
//#endregion
|
|
114
111
|
export { so_authority_default as n, _sfc_main as t };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
//#region src/components/so-authority/composables/index.d.ts
|
|
2
1
|
type PermissionValue = string | number | bigint;
|
|
3
2
|
type PermissionType = PermissionValue | PermissionValue[];
|
|
4
3
|
type AuthorityProps = {
|
|
5
4
|
requiredPermissions: PermissionType | ((userPermissions: PermissionType) => boolean);
|
|
6
5
|
userPermissions: PermissionType;
|
|
7
6
|
};
|
|
8
|
-
//#endregion
|
|
9
7
|
export { AuthorityProps };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AuthorityProps } from "./composables/index.js";
|
|
2
2
|
import { PropType } from "vue";
|
|
3
|
-
//#region src/components/so-authority/index.d.ts
|
|
4
3
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
4
|
/** 组件需要的权限 */
|
|
6
5
|
requiredPermissions: {
|
|
@@ -26,5 +25,4 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
26
25
|
required: true;
|
|
27
26
|
};
|
|
28
27
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
29
|
-
//#endregion
|
|
30
28
|
export { _default as default };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
//#region src/components/so-test/so-test.vue.d.ts
|
|
2
1
|
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
3
2
|
declare const _default: typeof __VLS_export;
|
|
4
|
-
//#endregion
|
|
5
3
|
export { _default as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/composables/storage/index.d.ts
|
|
2
1
|
type StorageParams<T> = {
|
|
3
2
|
/** 储存的key */
|
|
4
3
|
key: string;
|
|
@@ -16,5 +15,4 @@ type StorageParams<T> = {
|
|
|
16
15
|
beforeunload?: () => void;
|
|
17
16
|
};
|
|
18
17
|
declare const useStorage: <T>({ key, defaultValue, hasDiff, onChange, storage, checkType, beforeunload }: StorageParams<T>) => readonly [import("vue").WritableComputedRef<T, T>, () => void, () => void | undefined];
|
|
19
|
-
//#endregion
|
|
20
18
|
export { useStorage };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonar/vue-kit",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "@tonar/vue-kit: Vue 3 ESM toolkit with permission-based rendering components such as SoAuthority.",
|
|
6
6
|
"keywords": [
|
|
@@ -43,12 +43,13 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@tonar/utils": "0.3.
|
|
46
|
+
"@tonar/utils": "0.3.3"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@vue/test-utils": "^2.
|
|
49
|
+
"@vue/test-utils": "^2.5.1",
|
|
50
50
|
"unplugin-vue": "^7.2.0",
|
|
51
|
-
"vue": "^3.5.
|
|
51
|
+
"vue": "^3.5.45",
|
|
52
|
+
"vue-tsc": "^3.3.14"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|
|
54
55
|
"vue": "^3.0.0"
|
|
@@ -62,6 +63,6 @@
|
|
|
62
63
|
"scripts": {
|
|
63
64
|
"build": "tsdown",
|
|
64
65
|
"test": "vitest --run",
|
|
65
|
-
"typecheck": "pnpm exec tsc --noEmit"
|
|
66
|
+
"typecheck": "pnpm exec vue-tsc --noEmit"
|
|
66
67
|
}
|
|
67
68
|
}
|