@duxweb/dvha-naiveui 0.0.3 → 0.0.6

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.
@@ -0,0 +1 @@
1
+ export * from './hooks';
package/package.json CHANGED
@@ -1,10 +1,36 @@
1
1
  {
2
2
  "name": "@duxweb/dvha-naiveui",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.0.6",
5
5
  "author": "DuxWeb",
6
6
  "license": "LGPL-3.0",
7
- "main": "src/index.ts",
7
+ "exports": {
8
+ ".": {
9
+ "dvha:development": {
10
+ "types": "./src/index.ts",
11
+ "import": "./src/index.ts"
12
+ },
13
+ "types": "./dist/types/index.d.ts",
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.cjs"
16
+ }
17
+ },
18
+ "main": "dist/cjs/index.cjs",
19
+ "module": "dist/esm/index.js",
20
+ "types": "dist/types/index.d.ts",
21
+ "files": [
22
+ "LICENSE",
23
+ "README.md",
24
+ "dist"
25
+ ],
26
+ "scripts": {
27
+ "clean": "rimraf dist",
28
+ "build": "bun run clean && vite build && bun run build:types",
29
+ "build:types": "vue-tsc --declaration --emitDeclarationOnly --outDir dist/types",
30
+ "prepublishOnly": "bun run build",
31
+ "lint": "eslint .",
32
+ "lint:fix": "eslint . --fix"
33
+ },
8
34
  "dependencies": {
9
35
  "@duxweb/dvha-core": "latest",
10
36
  "naive-ui": "^2.41.0"
package/CHANGELOG.md DELETED
@@ -1,17 +0,0 @@
1
- # @duxweb/dvha-naiveui
2
-
3
- ## 0.0.3
4
-
5
- ### Patch Changes
6
-
7
- - fix: 更新内部依赖
8
- - Updated dependencies
9
- - @duxweb/dvha-core@0.0.3
10
-
11
- ## 0.0.2
12
-
13
- ### Patch Changes
14
-
15
- - init
16
- - Updated dependencies
17
- - @duxweb/dvha-core@0.0.2
@@ -1,2 +0,0 @@
1
- export * from './menu'
2
- export * from './tab'
package/src/hooks/menu.ts DELETED
@@ -1,51 +0,0 @@
1
- import type { UseMenuProps } from '@duxweb/dvha-core'
2
- import type { MenuOption } from 'naive-ui'
3
- import { arrayToTree, useMenu } from '@duxweb/dvha-core'
4
- import { computed, h } from 'vue'
5
- import { RouterLink } from 'vue-router'
6
-
7
- export function useNaiveMenu(props?: UseMenuProps) {
8
- const menu = useMenu(props)
9
-
10
- const options = computed((): MenuOption[] => {
11
- const data = menu.getMenu(true).map((item) => {
12
- return {
13
- ...item,
14
- key: item.name,
15
- icon: item?.icon
16
- ? () => {
17
- return h('div', {
18
- class: `${item.icon} size-4`,
19
- })
20
- }
21
- : undefined,
22
- labelName: item.label,
23
- label: () => {
24
- return item.path
25
- ? h(
26
- RouterLink,
27
- {
28
- to: {
29
- path: item.path,
30
- },
31
- },
32
- { default: () => item.label },
33
- )
34
- : item.label
35
- },
36
- }
37
- })
38
-
39
- return arrayToTree(data, {
40
- idKey: 'key',
41
- parentKey: 'parent',
42
- childrenKey: 'children',
43
- sortKey: 'sort',
44
- }, undefined)
45
- })
46
-
47
- return {
48
- options,
49
- ...menu,
50
- }
51
- }
package/src/hooks/tab.ts DELETED
@@ -1,31 +0,0 @@
1
- import { useTabStore } from "@duxweb/dvha-core"
2
- import { computed} from "vue"
3
- import { useRouter } from "vue-router"
4
- import type { TabProps } from 'naive-ui'
5
-
6
-
7
- export const useNaiveTab = () => {
8
- const tab = useTabStore()
9
- const router = useRouter()
10
-
11
- const props = computed(() => {
12
- return {
13
- value: tab.current,
14
- onClose: (value) => {
15
- tab.delTab(value, (item) => {
16
- router.push(item.path || '')
17
- })
18
- },
19
- onUpdateValue: (value) => {
20
- tab.changeTab(value, (item) => {
21
- router.push(item.path || '')
22
- })
23
- },
24
- } as TabProps
25
- })
26
-
27
- return {
28
- ...tab,
29
- props,
30
- }
31
- }
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './hooks'
package/tsconfig.json DELETED
@@ -1,40 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "jsx": "preserve",
5
- "jsxImportSource": "vue",
6
- "lib": [
7
- "ESNext",
8
- "DOM"
9
- ],
10
- "moduleDetection": "force",
11
- "useDefineForClassFields": true,
12
- "baseUrl": ".",
13
- "rootDir": "src",
14
- "module": "ESNext",
15
- "moduleResolution": "bundler",
16
- "resolveJsonModule": true,
17
- "allowJs": true,
18
- "strict": true,
19
- "noFallthroughCasesInSwitch": true,
20
- "noImplicitAny": false,
21
- "noUnusedLocals": true,
22
- "noUnusedParameters": true,
23
- "declaration": true,
24
- "noEmit": false,
25
- "outDir": "dist",
26
- "allowSyntheticDefaultImports": true,
27
- "esModuleInterop": true,
28
- "isolatedModules": true,
29
- "skipLibCheck": true
30
- },
31
- "include": [
32
- "src/**/*.ts",
33
- "src/**/*.tsx",
34
- "src/**/*.vue"
35
- ],
36
- "exclude": [
37
- "node_modules",
38
- "dist"
39
- ]
40
- }