swico 2.4.0-beta.2 → 2.4.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.
package/package.json
CHANGED
package/src/index.vue.d.ts
CHANGED
|
@@ -6,25 +6,7 @@ export { RouterView as Outlet } from 'vue-router';
|
|
|
6
6
|
export { useLocation, useNav } from './project-path/.swico-vue/vue-hooks';
|
|
7
7
|
export { history } from './mock-history';
|
|
8
8
|
export type { GlobalSwicoConfigType };
|
|
9
|
-
export
|
|
10
|
-
to: {
|
|
11
|
-
type: StringConstructor;
|
|
12
|
-
};
|
|
13
|
-
replace: {
|
|
14
|
-
type: BooleanConstructor;
|
|
15
|
-
};
|
|
16
|
-
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
-
to: {
|
|
18
|
-
type: StringConstructor;
|
|
19
|
-
};
|
|
20
|
-
replace: {
|
|
21
|
-
type: BooleanConstructor;
|
|
22
|
-
};
|
|
23
|
-
}>> & Readonly<{}>, {
|
|
24
|
-
replace: boolean;
|
|
25
|
-
}, {}, {
|
|
26
|
-
RouterLink: import("vue-router")._RouterLinkI;
|
|
27
|
-
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
9
|
+
export { default as Link } from './project-path/.swico-vue/Link';
|
|
28
10
|
export interface DefineSwicoConfigType {
|
|
29
11
|
(env: 'base', config: CustomConfigType['base']): any;
|
|
30
12
|
(env: 'dev', config: CustomConfigType['dev']): any;
|
package/src/index.vue.js
CHANGED
|
@@ -1,29 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.defineGlobal = exports.defineConfig = exports.Link = exports.history = exports.useNav = exports.useLocation = exports.Outlet = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var vue_router_2 = require("vue-router");
|
|
7
|
-
Object.defineProperty(exports, "Outlet", { enumerable: true, get: function () { return vue_router_2.RouterView; } });
|
|
7
|
+
var vue_router_1 = require("vue-router");
|
|
8
|
+
Object.defineProperty(exports, "Outlet", { enumerable: true, get: function () { return vue_router_1.RouterView; } });
|
|
8
9
|
var vue_hooks_1 = require("./project-path/.swico-vue/vue-hooks");
|
|
9
10
|
Object.defineProperty(exports, "useLocation", { enumerable: true, get: function () { return vue_hooks_1.useLocation; } });
|
|
10
11
|
Object.defineProperty(exports, "useNav", { enumerable: true, get: function () { return vue_hooks_1.useNav; } });
|
|
11
12
|
var mock_history_1 = require("./mock-history");
|
|
12
13
|
Object.defineProperty(exports, "history", { enumerable: true, get: function () { return mock_history_1.history; } });
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
RouterLink: vue_router_1.RouterLink
|
|
16
|
-
},
|
|
17
|
-
props: {
|
|
18
|
-
to: {
|
|
19
|
-
type: String
|
|
20
|
-
},
|
|
21
|
-
replace: {
|
|
22
|
-
type: Boolean
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
template: '<RouterLink :to="to" :replace="replace" ><slot></slot></RouterLink>'
|
|
26
|
-
});
|
|
14
|
+
var Link_1 = require("./project-path/.swico-vue/Link");
|
|
15
|
+
Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return __importDefault(Link_1).default; } });
|
|
27
16
|
const defineConfig = (env, config) => config;
|
|
28
17
|
exports.defineConfig = defineConfig;
|
|
29
18
|
const defineGlobal = (config) => config;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CSSProperties, FC, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { SwicoHistoryOptionType } from '../../typings/global-type';
|
|
3
|
+
interface PropsType {
|
|
4
4
|
replace?: boolean;
|
|
5
|
-
to:
|
|
5
|
+
to: string | number | SwicoHistoryOptionType;
|
|
6
6
|
style?: CSSProperties;
|
|
7
7
|
className?: string;
|
|
8
8
|
children: ReactNode;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
|
+
declare const Link: FC<PropsType>;
|
|
10
11
|
export default Link;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
to: {
|
|
3
|
+
required: true;
|
|
4
|
+
};
|
|
5
|
+
replace: {
|
|
6
|
+
type: BooleanConstructor;
|
|
7
|
+
};
|
|
8
|
+
}>, {
|
|
9
|
+
nav: {
|
|
10
|
+
(to: string, options?: import("../../typings/global-type").NavOptionsType): void;
|
|
11
|
+
(to: number): void;
|
|
12
|
+
(to: import("../../typings/global-type").SwicoHistoryOptionType, options?: import("../../typings/global-type").NavOptionsType): void;
|
|
13
|
+
};
|
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
+
to: {
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
replace: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
};
|
|
21
|
+
}>> & Readonly<{}>, {
|
|
22
|
+
replace: boolean;
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vue_1 = require("vue");
|
|
4
|
+
const vue_hooks_1 = require("./vue-hooks");
|
|
5
|
+
exports.default = (0, vue_1.defineComponent)({
|
|
6
|
+
name: 'Link',
|
|
7
|
+
props: {
|
|
8
|
+
to: {
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
replace: {
|
|
12
|
+
type: Boolean
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(props) {
|
|
16
|
+
const nav = (0, vue_hooks_1.useNav)();
|
|
17
|
+
return { nav };
|
|
18
|
+
},
|
|
19
|
+
template: `<a
|
|
20
|
+
@click="
|
|
21
|
+
() => {
|
|
22
|
+
nav(to, { replace });
|
|
23
|
+
}
|
|
24
|
+
"
|
|
25
|
+
>
|
|
26
|
+
<slot></slot>
|
|
27
|
+
</a>`
|
|
28
|
+
});
|
package/src/utils/config.js
CHANGED
|
@@ -142,14 +142,6 @@ const initCliIndexFile = (templateType, env) => __awaiter(void 0, void 0, void 0
|
|
|
142
142
|
.resolve(projectPath, './.swico/react-hooks')
|
|
143
143
|
.replaceAll('\\', '/');
|
|
144
144
|
replaceFileText = replaceFileText.replaceAll('require("./project-path/.swico-react/react-hooks");', `require("${formatHooksPath}");`);
|
|
145
|
-
}
|
|
146
|
-
if (templateType === 'react') {
|
|
147
|
-
const formatHooksPath = path_1.default
|
|
148
|
-
.resolve(projectPath, './.swico/react-hooks')
|
|
149
|
-
.replaceAll('\\', '/');
|
|
150
|
-
replaceFileText = replaceFileText.replaceAll('require("./project-path/.swico-react/react-hooks");', `require("${formatHooksPath}");`);
|
|
151
|
-
}
|
|
152
|
-
if (templateType === 'react') {
|
|
153
145
|
const formatLinkComponentPath = path_1.default
|
|
154
146
|
.resolve(projectPath, './.swico/Link')
|
|
155
147
|
.replaceAll('\\', '/');
|