@modelmenu/navigation 1.0.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.
@@ -0,0 +1,43 @@
1
+ let Router: any;
2
+ let MenuBar: any;
3
+ export let Loading: any;
4
+
5
+ export const router = (router: any) => {
6
+ Router = router;
7
+ }
8
+
9
+ export const menubar = (menubar: any) => {
10
+ MenuBar = menubar;
11
+ }
12
+
13
+ export const load = (loading: any) => {
14
+ Loading = loading;
15
+ }
16
+
17
+ export const to = (path: string) => {
18
+ if(Router != null){
19
+ Loading = true;
20
+ MenuBar.loading = Loading;
21
+ setTimeout(() => {
22
+ Router.push({ path: `${path}` }).finally(() => {
23
+ Loading = false;
24
+ MenuBar.loading = Loading;
25
+ });
26
+ }, 400)
27
+ }
28
+ }
29
+
30
+ export const toTop = (path: string) => {
31
+ console.log('toTop', path);
32
+ console.log('Router', Router);
33
+ if(Router != null){
34
+ Loading = true;
35
+ MenuBar.loading = Loading;
36
+ setTimeout(() => {
37
+ Router.push({ path: `${path}` }).finally(() => {
38
+ Loading = false;
39
+ MenuBar.loading = Loading;
40
+ });
41
+ }, 400)
42
+ }
43
+ }
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@modelmenu/navigation",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "./menu/index.d.ts",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "default": "./dist/index.es.js",
10
+ "types": "./dist/index.umd.js"
11
+ }
12
+ },
13
+ "module": "./menu/index.d.ts",
14
+ "types": "./menu/index.d.ts",
15
+ "keywords": [],
16
+ "author": "",
17
+ "license": "MIT",
18
+ "collaborators": [
19
+ "datamit"
20
+ ],
21
+ "devDependencies": {
22
+ "@types/node": "^25.4.0",
23
+ "@vitejs/plugin-vue": "^5.2.4",
24
+ "@vue/cli-plugin-typescript": "^5.0.9",
25
+ "vite": "^5.4.21",
26
+ "vite-plugin-css-injected-by-js": "^4.0.1",
27
+ "vue-tsc": "^3.2.5"
28
+ },
29
+ "dependencies": {
30
+ "@fortawesome/fontawesome-svg-core": "^7.2.0",
31
+ "@fortawesome/free-solid-svg-icons": "^7.2.0",
32
+ "@fortawesome/vue-fontawesome": "^3.1.3",
33
+ "@vitejs/plugin-vue": "5.0.0",
34
+ "@vue/cli-service": "^5.0.9",
35
+ "tsconfig": "^7.0.0",
36
+ "typescript": "^5.9.3",
37
+ "vite": "5.4.2",
38
+ "vite-plugin-vue-devtools": "8.0.5",
39
+ "vite-plugin-vuetify": "2.1.2",
40
+ "vue": "^3.5.30",
41
+ "webpack": "^5.105.4"
42
+ },
43
+ "scripts": {
44
+ "dev": "vite",
45
+ "build": "vite build",
46
+ "preview": "vite preview",
47
+ "cli-build": "vue-cli-service build",
48
+ "test": "echo \"Error: no test specified\" && exit 1"
49
+ }
50
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "include": [
3
+ "menu/**/*.ts",
4
+ "menu/**/*.d.ts",
5
+ "menu/**/*.tsx",
6
+ "menu/**/*.vue"
7
+ ],
8
+ // Visit https://aka.ms/tsconfig to read more about this file
9
+ "compilerOptions": {
10
+ "baseUrl": ".",
11
+ "paths": {
12
+ "@/*": ["menu/*"]
13
+ },
14
+ // File Layout
15
+ // "rootDir": "./src",
16
+ "outDir": "./dist",
17
+
18
+ // Environment Settings
19
+ // See also https://aka.ms/tsconfig/module
20
+ "module": "preserve",
21
+ "moduleResolution": "bundler",
22
+ "target": "esnext",
23
+ "types": [],
24
+ // For nodejs:
25
+ // "lib": ["esnext"],
26
+ // "types": ["node"],
27
+ // and npm install -D @types/node
28
+
29
+ // Other Outputs
30
+ "sourceMap": true,
31
+ "declaration": true,
32
+ "declarationMap": true,
33
+
34
+ // Stricter Typechecking Options
35
+ "noUncheckedIndexedAccess": true,
36
+ "exactOptionalPropertyTypes": false,
37
+
38
+ // Style Options
39
+ // "noImplicitReturns": true,
40
+ // "noImplicitOverride": true,
41
+ // "noUnusedLocals": true,
42
+ // "noUnusedParameters": true,
43
+ // "noFallthroughCasesInSwitch": true,
44
+ // "noPropertyAccessFromIndexSignature": true,
45
+
46
+ // Recommended Options
47
+ "strict": false,
48
+ "jsx": "react-jsx",
49
+ "verbatimModuleSyntax": true,
50
+ "isolatedModules": true,
51
+ "noUncheckedSideEffectImports": true,
52
+ "moduleDetection": "force",
53
+ "skipLibCheck": true,
54
+ }
55
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,25 @@
1
+ import { defineConfig } from 'vite'
2
+ import vue from '@vitejs/plugin-vue'
3
+ import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
4
+
5
+ export default defineConfig({
6
+ plugins: [vue(), cssInjectedByJsPlugin({
7
+ relativeCSSInjection: false
8
+ })],
9
+ build: {
10
+ lib: {
11
+ entry: 'menu/index.d.ts',
12
+ name: 'MenuPlate',
13
+ formats: ['es', 'umd'],
14
+ fileName: (format) => `index.${format}.js`
15
+ },
16
+ rollupOptions: {
17
+ external: ['vue'],
18
+ output: {
19
+ globals: {
20
+ vue: 'Vue'
21
+ }
22
+ }
23
+ }
24
+ }
25
+ })
package/vue.config.js ADDED
@@ -0,0 +1,30 @@
1
+ import { defineConfig } from "@vue/cli-service";
2
+
3
+ export default defineConfig({
4
+ transpileDependencies: true,
5
+ configureWebpack: {
6
+ entry: './menu/index.ts',
7
+ output: {
8
+ library: 'MenuPlate',
9
+ libraryTarget: 'umd',
10
+ filename: 'menu-plate.js',
11
+ globalObject: 'this'
12
+ },
13
+ externals: {
14
+ vue: 'Vue'
15
+ },
16
+ resolve: {
17
+ extensions: ['.ts', '.tsx', '.js', '.vue', '.json']
18
+ }
19
+ },
20
+ chainWebpack: config => {
21
+ config.optimization.delete('splitChunks')
22
+ config.plugins.delete('html')
23
+ config.plugins.delete('preload')
24
+ config.plugins.delete('prefetch')
25
+ config.entryPoints.delete('app')
26
+ },
27
+ css: {
28
+ extract: false
29
+ }
30
+ });