jky-component-lib 0.0.75 → 0.0.77
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/es/add-input/index.d.ts +1 -0
- package/dist/es/code-mirror-editor/index.d.ts +1 -0
- package/dist/es/components.d.ts +1 -0
- package/dist/es/components.js +4 -1
- package/dist/es/form/index.d.ts +1 -0
- package/dist/es/index.js +6 -0
- package/dist/es/menu/Menu.vue.js +2 -2
- package/dist/es/menu/MenuItem.vue.js +2 -2
- package/dist/es/menu/index.d.ts +1 -0
- package/dist/es/package.json.js +1 -1
- package/dist/es/page-header/index.d.ts +1 -0
- package/dist/es/page-layout/PageLayout.vue.d.ts +3 -2
- package/dist/es/page-layout/PageLayout.vue.js +45 -8
- package/dist/es/page-layout/index.d.ts +1 -0
- package/dist/es/page-table/PageTable.vue.d.ts +9 -9
- package/dist/es/page-table/index.d.ts +1 -0
- package/dist/es/rich-editor/index.d.ts +1 -0
- package/dist/es/style.css +57 -120
- package/dist/es/styles.css +1 -1
- package/dist/es/tabs/ContextMenu.vue.d.ts +30 -0
- package/dist/es/tabs/ContextMenu.vue.js +118 -0
- package/dist/es/tabs/ContextMenu.vue3.js +5 -0
- package/dist/es/tabs/Tabs.vue.d.ts +13 -0
- package/dist/es/tabs/Tabs.vue.js +132 -0
- package/dist/es/tabs/Tabs.vue3.js +5 -0
- package/dist/es/tabs/config.d.ts +2 -0
- package/dist/es/tabs/config.js +8 -0
- package/dist/es/tabs/createTabsGuard.d.ts +5 -0
- package/dist/es/tabs/createTabsGuard.js +18 -0
- package/dist/es/tabs/index.d.ts +7 -0
- package/dist/es/tabs/index.js +8 -0
- package/dist/es/tabs/style.css +43 -0
- package/dist/es/tabs/useTabsStore.d.ts +6 -0
- package/dist/es/tabs/useTabsStore.js +156 -0
- package/dist/lib/add-input/index.d.ts +1 -0
- package/dist/lib/code-mirror-editor/index.d.ts +1 -0
- package/dist/lib/components.d.ts +1 -0
- package/dist/lib/components.js +4 -1
- package/dist/lib/form/index.d.ts +1 -0
- package/dist/lib/index.js +6 -0
- package/dist/lib/menu/Menu.vue.js +2 -2
- package/dist/lib/menu/MenuItem.vue.js +2 -2
- package/dist/lib/menu/index.d.ts +1 -0
- package/dist/lib/package.json.js +1 -1
- package/dist/lib/page-header/index.d.ts +1 -0
- package/dist/lib/page-layout/PageLayout.vue.d.ts +3 -2
- package/dist/lib/page-layout/PageLayout.vue.js +44 -7
- package/dist/lib/page-layout/index.d.ts +1 -0
- package/dist/lib/page-table/PageTable.vue.d.ts +9 -9
- package/dist/lib/page-table/index.d.ts +1 -0
- package/dist/lib/rich-editor/index.d.ts +1 -0
- package/dist/lib/style.css +57 -120
- package/dist/lib/styles.css +1 -1
- package/dist/lib/tabs/ContextMenu.vue.d.ts +30 -0
- package/dist/lib/tabs/ContextMenu.vue.js +118 -0
- package/dist/lib/tabs/ContextMenu.vue3.js +5 -0
- package/dist/lib/tabs/Tabs.vue.d.ts +13 -0
- package/dist/lib/tabs/Tabs.vue.js +132 -0
- package/dist/lib/tabs/Tabs.vue3.js +5 -0
- package/dist/lib/tabs/config.d.ts +2 -0
- package/dist/lib/tabs/config.js +8 -0
- package/dist/lib/tabs/createTabsGuard.d.ts +5 -0
- package/dist/lib/tabs/createTabsGuard.js +18 -0
- package/dist/lib/tabs/index.d.ts +7 -0
- package/dist/lib/tabs/index.js +8 -0
- package/dist/lib/tabs/style.css +43 -0
- package/dist/lib/tabs/useTabsStore.d.ts +6 -0
- package/dist/lib/tabs/useTabsStore.js +156 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createTabsStore } from "./useTabsStore.js";
|
|
2
|
+
function createTabsGuard(router, config) {
|
|
3
|
+
const { useTabsStore } = createTabsStore(config);
|
|
4
|
+
const tabsStore = useTabsStore();
|
|
5
|
+
tabsStore.loadFromCache();
|
|
6
|
+
router.afterEach((to) => {
|
|
7
|
+
tabsStore.addTab(to);
|
|
8
|
+
});
|
|
9
|
+
return {
|
|
10
|
+
syncCurrentRoute: () => {
|
|
11
|
+
const currentRoute = router.currentRoute.value;
|
|
12
|
+
tabsStore.addTab(currentRoute);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
createTabsGuard
|
|
18
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InstallWithSFC } from '../utils/types';
|
|
2
|
+
import { default as Tabs } from './Tabs.vue';
|
|
3
|
+
export { createTabsGuard } from './createTabsGuard';
|
|
4
|
+
export type { TabItem, TabsConfig, TabsContextMenuEmits, TabsContextMenuItem, TabsContextMenuProps, TabsProps, TabsStoreActions, TabsStoreState, } from './types';
|
|
5
|
+
export { createTabsStore } from './useTabsStore';
|
|
6
|
+
export declare const JkyTabs: InstallWithSFC<typeof Tabs>;
|
|
7
|
+
export default JkyTabs;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* Tabs 组件样式 */
|
|
2
|
+
.jky-tabs {
|
|
3
|
+
/* Tabs 组件样式定义 */
|
|
4
|
+
.el-tabs__content {
|
|
5
|
+
display: none;
|
|
6
|
+
}
|
|
7
|
+
.el-tabs__header {
|
|
8
|
+
margin-bottom: 0;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/* Tabs 圆角样式 */
|
|
12
|
+
.jky-tabs-round {
|
|
13
|
+
--el-tabs-header-height: 32px;
|
|
14
|
+
--el-tabs-item-background: white;
|
|
15
|
+
--el-tabs-active-item-background: var(--el-color-primary);
|
|
16
|
+
.el-tabs__header {
|
|
17
|
+
--el-border-color-light: transparent;
|
|
18
|
+
}
|
|
19
|
+
.el-tabs__item {
|
|
20
|
+
border-radius: 999px;
|
|
21
|
+
margin-left: 1rem;
|
|
22
|
+
background-color: var(--el-tabs-item-background);
|
|
23
|
+
.jky-tabs-__item-label {
|
|
24
|
+
/* Tabs 项标签样式定义 */
|
|
25
|
+
}
|
|
26
|
+
&.is-active {
|
|
27
|
+
background-color: var(--el-tabs-active-item-background);
|
|
28
|
+
.jky-tabs-__item-label {
|
|
29
|
+
color: var(--el-color-white);
|
|
30
|
+
}
|
|
31
|
+
.el-icon {
|
|
32
|
+
color: var(--el-color-white);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
&.first-child {
|
|
36
|
+
margin-left: 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/* 右键菜单样式 */
|
|
41
|
+
.jky-tabs-context-menu {
|
|
42
|
+
display: inline-block;
|
|
43
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Store } from 'pinia';
|
|
2
|
+
import { TabsConfig, TabsStoreActions, TabsStoreState } from './types';
|
|
3
|
+
export declare function createTabsStore(config?: Partial<TabsConfig>): {
|
|
4
|
+
useTabsStore: () => Store<'tabs', TabsStoreState, object, TabsStoreActions>;
|
|
5
|
+
config: TabsConfig;
|
|
6
|
+
};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import { useLocalStorage, useSessionStorage } from "@vueuse/core";
|
|
18
|
+
import { defineStore } from "pinia";
|
|
19
|
+
import { defaultTabsConfig } from "./config.js";
|
|
20
|
+
function createTabsStore(config = {}) {
|
|
21
|
+
const finalConfig = __spreadValues(__spreadValues({}, defaultTabsConfig), config);
|
|
22
|
+
const getStorage = () => {
|
|
23
|
+
if (!finalConfig.enableCache) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return finalConfig.storageType === "localStorage" ? useLocalStorage(finalConfig.storageKey, {
|
|
27
|
+
tabs: [],
|
|
28
|
+
activeTabFullPath: ""
|
|
29
|
+
}) : useSessionStorage(finalConfig.storageKey, {
|
|
30
|
+
tabs: [],
|
|
31
|
+
activeTabFullPath: ""
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const useTabsStore = defineStore("tabs", {
|
|
35
|
+
state: () => ({
|
|
36
|
+
tabs: [],
|
|
37
|
+
activeTabFullPath: ""
|
|
38
|
+
}),
|
|
39
|
+
actions: {
|
|
40
|
+
generateTab(route) {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
const title = ((_a = route.meta) == null ? void 0 : _a.title) || route.name;
|
|
43
|
+
if (!title) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
title,
|
|
48
|
+
path: route.path,
|
|
49
|
+
fullPath: route.fullPath,
|
|
50
|
+
query: route.query,
|
|
51
|
+
params: route.params,
|
|
52
|
+
name: route.name,
|
|
53
|
+
icon: (_b = route.meta) == null ? void 0 : _b.icon
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
addTab(route) {
|
|
57
|
+
const newTab = this.generateTab(route);
|
|
58
|
+
if (!newTab) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const existTab = this.tabs.find((tab) => tab.fullPath === newTab.fullPath);
|
|
62
|
+
if (!existTab) {
|
|
63
|
+
this.tabs.push(newTab);
|
|
64
|
+
}
|
|
65
|
+
this.activeTabFullPath = newTab.fullPath;
|
|
66
|
+
this.saveToCache();
|
|
67
|
+
},
|
|
68
|
+
setActiveTab(fullPath) {
|
|
69
|
+
const existTab = this.tabs.find((tab) => tab.fullPath === fullPath);
|
|
70
|
+
if (existTab) {
|
|
71
|
+
this.activeTabFullPath = fullPath;
|
|
72
|
+
this.saveToCache();
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
closeTab(fullPath, currentActivePath) {
|
|
76
|
+
const index = this.tabs.findIndex((tab) => tab.fullPath === fullPath);
|
|
77
|
+
if (index === -1) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
if (this.tabs.length === 1) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
if (fullPath !== currentActivePath) {
|
|
84
|
+
this.tabs.splice(index, 1);
|
|
85
|
+
this.saveToCache();
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
let nextActivePath = null;
|
|
89
|
+
if (index + 1 < this.tabs.length) {
|
|
90
|
+
nextActivePath = this.tabs[index + 1].fullPath;
|
|
91
|
+
} else if (index - 1 >= 0) {
|
|
92
|
+
nextActivePath = this.tabs[index - 1].fullPath;
|
|
93
|
+
}
|
|
94
|
+
this.tabs.splice(index, 1);
|
|
95
|
+
if (nextActivePath) {
|
|
96
|
+
this.activeTabFullPath = nextActivePath;
|
|
97
|
+
} else if (this.tabs.length > 0) {
|
|
98
|
+
this.activeTabFullPath = this.tabs[0].fullPath;
|
|
99
|
+
}
|
|
100
|
+
this.saveToCache();
|
|
101
|
+
return nextActivePath;
|
|
102
|
+
},
|
|
103
|
+
closeOthers(fullPath) {
|
|
104
|
+
const targetTab = this.tabs.find((tab) => tab.fullPath === fullPath);
|
|
105
|
+
if (targetTab) {
|
|
106
|
+
this.tabs = [targetTab];
|
|
107
|
+
this.activeTabFullPath = targetTab.fullPath;
|
|
108
|
+
this.saveToCache();
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
closeAll() {
|
|
112
|
+
if (this.tabs.length === 0) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const firstTab = this.tabs[0];
|
|
116
|
+
this.tabs = [firstTab];
|
|
117
|
+
this.activeTabFullPath = firstTab.fullPath;
|
|
118
|
+
this.saveToCache();
|
|
119
|
+
},
|
|
120
|
+
saveToCache() {
|
|
121
|
+
if (!finalConfig.enableCache) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const storage = getStorage();
|
|
125
|
+
if (storage) {
|
|
126
|
+
storage.value = {
|
|
127
|
+
tabs: this.tabs,
|
|
128
|
+
activeTabFullPath: this.activeTabFullPath
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
loadFromCache() {
|
|
133
|
+
var _a;
|
|
134
|
+
if (!finalConfig.enableCache) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
const storage = getStorage();
|
|
138
|
+
if (storage && storage.value) {
|
|
139
|
+
const { tabs, activeTabFullPath } = storage.value;
|
|
140
|
+
const validTabs = (tabs || []).filter((tab) => tab.title && tab.fullPath);
|
|
141
|
+
this.tabs = validTabs;
|
|
142
|
+
this.activeTabFullPath = activeTabFullPath || "";
|
|
143
|
+
if (this.activeTabFullPath && !this.tabs.find((t) => t.fullPath === this.activeTabFullPath)) {
|
|
144
|
+
this.activeTabFullPath = ((_a = this.tabs[0]) == null ? void 0 : _a.fullPath) || "";
|
|
145
|
+
}
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
return { useTabsStore, config: finalConfig };
|
|
153
|
+
}
|
|
154
|
+
export {
|
|
155
|
+
createTabsStore
|
|
156
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InstallWithSFC } from '../utils';
|
|
2
2
|
import { default as AddInput } from './AddInput.vue';
|
|
3
|
+
export type { AddInputEmits, AddInputItem, AddInputProps } from './types';
|
|
3
4
|
export declare const JkyAddInput: InstallWithSFC<typeof AddInput>;
|
|
4
5
|
export default JkyAddInput;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InstallWithSFC } from '../utils';
|
|
2
2
|
import { default as CodeMirrorEditor } from './CodeMirrorEditor.vue';
|
|
3
|
+
export type { CodeMirrorEditorEmits, CodeMirrorEditorProps } from './types';
|
|
3
4
|
export declare const JkyCodeMirrorEditor: InstallWithSFC<typeof CodeMirrorEditor>;
|
|
4
5
|
export default JkyCodeMirrorEditor;
|
package/dist/lib/components.d.ts
CHANGED
package/dist/lib/components.js
CHANGED
|
@@ -11,6 +11,7 @@ const index$7 = require("./page-layout/index.js");
|
|
|
11
11
|
const index$8 = require("./page-table/index.js");
|
|
12
12
|
const index$9 = require("./rich-editor/index.js");
|
|
13
13
|
const index$a = require("./say-hello/index.js");
|
|
14
|
+
const index$b = require("./tabs/index.js");
|
|
14
15
|
const components = [
|
|
15
16
|
index$a.JkySayHello,
|
|
16
17
|
index$1.JkyButton,
|
|
@@ -22,7 +23,8 @@ const components = [
|
|
|
22
23
|
index.JkyAddInput,
|
|
23
24
|
index$9.JkyRichEditor,
|
|
24
25
|
index$8.JkyPageTable,
|
|
25
|
-
index$7.JkyPageLayout
|
|
26
|
+
index$7.JkyPageLayout,
|
|
27
|
+
index$b.JkyTabs
|
|
26
28
|
];
|
|
27
29
|
exports.JkyAddInput = index.JkyAddInput;
|
|
28
30
|
exports.JkyButton = index$1.JkyButton;
|
|
@@ -35,4 +37,5 @@ exports.JkyPageLayout = index$7.JkyPageLayout;
|
|
|
35
37
|
exports.JkyPageTable = index$8.JkyPageTable;
|
|
36
38
|
exports.JkyRichEditor = index$9.JkyRichEditor;
|
|
37
39
|
exports.JkySayHello = index$a.JkySayHello;
|
|
40
|
+
exports.JkyTabs = index$b.JkyTabs;
|
|
38
41
|
exports.components = components;
|
package/dist/lib/form/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InstallWithSFC } from '../utils';
|
|
2
2
|
import { default as Form } from './Form.vue';
|
|
3
|
+
export type { ComponentPropsMap, ComponentPropsType, DynamicComponentProps, FormComponentType, FormItemChildConfig, FormItemConfig, FormItemOption, FormItemProps, FormItemPropsContext, FormProps, FormValidateResult, GridConfig, HelpConfig, HelpType, ResponsiveBreakpoint, ResponsiveConfig, SelectTableComponentProps, SelectTableProps, StaticComponentProps, } from './types';
|
|
3
4
|
export declare const JkyForm: InstallWithSFC<typeof Form>;
|
|
4
5
|
export default JkyForm;
|
package/dist/lib/index.js
CHANGED
|
@@ -15,6 +15,9 @@ const index$7 = require("./page-layout/index.js");
|
|
|
15
15
|
const index$8 = require("./page-table/index.js");
|
|
16
16
|
const index$9 = require("./rich-editor/index.js");
|
|
17
17
|
const index$a = require("./say-hello/index.js");
|
|
18
|
+
const index$b = require("./tabs/index.js");
|
|
19
|
+
const createTabsGuard = require("./tabs/createTabsGuard.js");
|
|
20
|
+
const useTabsStore = require("./tabs/useTabsStore.js");
|
|
18
21
|
const installer = installer$1.createInstaller(components.components);
|
|
19
22
|
const install = installer.install;
|
|
20
23
|
const version = installer.version;
|
|
@@ -31,6 +34,9 @@ exports.JkyPageLayout = index$7.JkyPageLayout;
|
|
|
31
34
|
exports.JkyPageTable = index$8.JkyPageTable;
|
|
32
35
|
exports.JkyRichEditor = index$9.JkyRichEditor;
|
|
33
36
|
exports.JkySayHello = index$a.JkySayHello;
|
|
37
|
+
exports.JkyTabs = index$b.JkyTabs;
|
|
38
|
+
exports.createTabsGuard = createTabsGuard.createTabsGuard;
|
|
39
|
+
exports.createTabsStore = useTabsStore.createTabsStore;
|
|
34
40
|
exports.default = installer;
|
|
35
41
|
exports.install = install;
|
|
36
42
|
exports.version = version;
|
|
@@ -82,7 +82,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
82
82
|
title: vue.withCtx(() => [
|
|
83
83
|
item.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
84
84
|
key: 0,
|
|
85
|
-
class: vue.normalizeClass([item.icon, "jky-menu-item__icon"])
|
|
85
|
+
class: vue.normalizeClass([item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
86
86
|
}, null, 2)) : vue.createCommentVNode("", true),
|
|
87
87
|
item.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, vue.toDisplayString(item.title), 1)) : vue.createCommentVNode("", true)
|
|
88
88
|
]),
|
|
@@ -106,7 +106,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
106
106
|
default: vue.withCtx(() => [
|
|
107
107
|
item.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
108
108
|
key: 0,
|
|
109
|
-
class: vue.normalizeClass([item.icon, "jky-menu-item__icon"])
|
|
109
|
+
class: vue.normalizeClass([item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
110
110
|
}, null, 2)) : vue.createCommentVNode("", true),
|
|
111
111
|
item.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, vue.toDisplayString(item.title), 1)) : vue.createCommentVNode("", true)
|
|
112
112
|
]),
|
|
@@ -32,7 +32,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
32
32
|
title: vue.withCtx(() => [
|
|
33
33
|
props.item.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
34
34
|
key: 0,
|
|
35
|
-
class: vue.normalizeClass([props.item.icon, "jky-menu-item__icon"])
|
|
35
|
+
class: vue.normalizeClass([props.item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
36
36
|
}, null, 2)) : vue.createCommentVNode("", true),
|
|
37
37
|
props.item.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, vue.toDisplayString(props.item.title), 1)) : vue.createCommentVNode("", true)
|
|
38
38
|
]),
|
|
@@ -56,7 +56,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
56
56
|
default: vue.withCtx(() => [
|
|
57
57
|
props.item.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
58
58
|
key: 0,
|
|
59
|
-
class: vue.normalizeClass([props.item.icon, "jky-menu-item__icon"])
|
|
59
|
+
class: vue.normalizeClass([props.item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
60
60
|
}, null, 2)) : vue.createCommentVNode("", true),
|
|
61
61
|
props.item.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, vue.toDisplayString(props.item.title), 1)) : vue.createCommentVNode("", true)
|
|
62
62
|
]),
|
package/dist/lib/menu/index.d.ts
CHANGED
package/dist/lib/package.json.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InstallWithSFC } from '../utils';
|
|
2
2
|
import { default as PageHeader } from './PageHeader.vue';
|
|
3
|
+
export type { PageHeaderPopoverMenuItem, PageHeaderPopoverMenuProps, PageHeaderProps, PageHeaderStatusIcon, PageHeaderUserDropdonItem, } from './types';
|
|
3
4
|
export declare const JkyPageHeader: InstallWithSFC<typeof PageHeader>;
|
|
4
5
|
export default JkyPageHeader;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { PageLayoutProps } from './types';
|
|
2
2
|
declare const _default: import('vue').DefineComponent<PageLayoutProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<PageLayoutProps> & Readonly<{}>, {
|
|
3
|
+
cachable: boolean;
|
|
4
|
+
roundTabs: boolean;
|
|
3
5
|
showTopMenu: boolean;
|
|
4
6
|
showSideMenu: boolean;
|
|
5
7
|
asideWidth: string;
|
|
6
8
|
asideWithScrollbar: boolean;
|
|
7
9
|
mainWithCard: boolean;
|
|
8
10
|
mainWithScrollbar: boolean;
|
|
9
|
-
cachable: boolean;
|
|
10
11
|
transitionName: string;
|
|
11
12
|
tabsWithCard: boolean;
|
|
12
13
|
cardPadding: string;
|
|
13
14
|
topMenuTrigger: "hover" | "click";
|
|
14
15
|
topMenuSingleLevel: boolean;
|
|
15
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {},
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
17
|
export default _default;
|
|
@@ -37,13 +37,18 @@ const lodashEs = require("lodash-es");
|
|
|
37
37
|
const vueRouter = require("vue-router");
|
|
38
38
|
const Menu_vue_vue_type_script_setup_true_lang = require("../menu/Menu.vue.js");
|
|
39
39
|
;/* empty css */
|
|
40
|
+
const Tabs_vue_vue_type_script_setup_true_lang = require("../tabs/Tabs.vue.js");
|
|
41
|
+
;/* empty css */
|
|
42
|
+
const useTabsStore = require("../tabs/useTabsStore.js");
|
|
40
43
|
const _hoisted_1 = { class: "w-full flex justify-center" };
|
|
41
44
|
const _hoisted_2 = { class: "flex flex-1 min-h-0 overflow-hidden gap-3" };
|
|
42
45
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
|
|
43
|
-
name: "JkyPageLayout"
|
|
46
|
+
name: "JkyPageLayout",
|
|
47
|
+
inheritAttrs: false
|
|
44
48
|
}), {
|
|
45
49
|
__name: "PageLayout",
|
|
46
50
|
props: {
|
|
51
|
+
roundTabs: { type: Boolean, default: true },
|
|
47
52
|
showTopMenu: { type: Boolean, default: true },
|
|
48
53
|
showSideMenu: { type: Boolean, default: true },
|
|
49
54
|
asideWidth: { default: "200px" },
|
|
@@ -56,7 +61,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
56
61
|
cachable: { type: Boolean, default: true },
|
|
57
62
|
transitionName: { default: "fade" },
|
|
58
63
|
className: {},
|
|
59
|
-
tabsWithCard: { type: Boolean, default:
|
|
64
|
+
tabsWithCard: { type: Boolean, default: false },
|
|
60
65
|
cardPadding: { default: "0px" },
|
|
61
66
|
topLevels: {},
|
|
62
67
|
sideLevels: {},
|
|
@@ -67,11 +72,16 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
67
72
|
const props = __props;
|
|
68
73
|
const router = vueRouter.useRouter();
|
|
69
74
|
const route = vueRouter.useRoute();
|
|
70
|
-
const
|
|
75
|
+
const { useTabsStore: useTabsStore$1 } = useTabsStore.createTabsStore({
|
|
76
|
+
enableCache: props.cachable
|
|
77
|
+
});
|
|
78
|
+
const tabsStore = useTabsStore$1();
|
|
71
79
|
const activeTopMenu = vue.ref("");
|
|
72
80
|
const activeSideMenu = vue.ref("");
|
|
73
81
|
const routes = router.getRoutes();
|
|
74
|
-
const cacheInclude =
|
|
82
|
+
const cacheInclude = vue.computed(() => {
|
|
83
|
+
return tabsStore.tabs.map((tab) => tab.name).filter(Boolean);
|
|
84
|
+
});
|
|
75
85
|
function buildMenuFromRoutes(routes2) {
|
|
76
86
|
const menuRoutes = routes2.filter((r) => {
|
|
77
87
|
var _a;
|
|
@@ -112,7 +122,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
112
122
|
return buildMenuFromRoutes(routes);
|
|
113
123
|
});
|
|
114
124
|
const topMenuData = vue.computed(() => {
|
|
115
|
-
console.warn("topMenuData:", menuData.value, props, attrs);
|
|
116
125
|
if (props.topMenuSingleLevel) {
|
|
117
126
|
return lodashEs.cloneDeep(menuData.value).map((item) => {
|
|
118
127
|
const _a = item, { children } = _a, rest = __objRest(_a, ["children"]);
|
|
@@ -179,6 +188,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
179
188
|
router.push(index);
|
|
180
189
|
}
|
|
181
190
|
return (_ctx, _cache) => {
|
|
191
|
+
var _a;
|
|
182
192
|
const _component_ElAutoResizer = vue.resolveComponent("ElAutoResizer");
|
|
183
193
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
184
194
|
class: vue.normalizeClass(["jky-page-layout flex h-full w-full flex-col overflow-hidden gap-3", props.className])
|
|
@@ -242,6 +252,33 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
242
252
|
vue.createElementVNode("div", {
|
|
243
253
|
class: vue.normalizeClass(["jky-page-layout__main flex-1 flex flex-col min-w-0 overflow-hidden", props.mainClass])
|
|
244
254
|
}, [
|
|
255
|
+
props.tabsWithCard ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElCard), {
|
|
256
|
+
key: 0,
|
|
257
|
+
class: "jky-page-layout__tabs shrink-0 mb-3",
|
|
258
|
+
style: vue.normalizeStyle({ "--el-card-padding": props.cardPadding })
|
|
259
|
+
}, {
|
|
260
|
+
default: vue.withCtx(() => {
|
|
261
|
+
var _a2;
|
|
262
|
+
return [
|
|
263
|
+
vue.createVNode(Tabs_vue_vue_type_script_setup_true_lang.default, {
|
|
264
|
+
store: vue.unref(tabsStore),
|
|
265
|
+
round: (_a2 = props.roundTabs) != null ? _a2 : _ctx.$attrs["round-tabs"],
|
|
266
|
+
mode: "route",
|
|
267
|
+
cachable: props.cachable,
|
|
268
|
+
closable: true
|
|
269
|
+
}, null, 8, ["store", "round", "cachable"])
|
|
270
|
+
];
|
|
271
|
+
}),
|
|
272
|
+
_: 1
|
|
273
|
+
}, 8, ["style"])) : (vue.openBlock(), vue.createBlock(Tabs_vue_vue_type_script_setup_true_lang.default, {
|
|
274
|
+
key: 1,
|
|
275
|
+
class: "jky-page-layout__tabs shrink-0 mb-3",
|
|
276
|
+
store: vue.unref(tabsStore),
|
|
277
|
+
mode: "route",
|
|
278
|
+
cachable: props.cachable,
|
|
279
|
+
round: (_a = props.roundTabs) != null ? _a : _ctx.$attrs["round-tabs"],
|
|
280
|
+
closable: true
|
|
281
|
+
}, null, 8, ["store", "cachable", "round"])),
|
|
245
282
|
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.mainWithCard ? vue.unref(ElementPlus.ElCard) : "div"), {
|
|
246
283
|
class: vue.normalizeClass(["jky-page-layout__content flex-1 min-h-0 overflow-hidden", props.contentClass]),
|
|
247
284
|
"body-class": props.mainWithScrollbar ? "" : "pb-0!"
|
|
@@ -258,7 +295,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
258
295
|
}, {
|
|
259
296
|
default: vue.withCtx(() => [
|
|
260
297
|
(vue.openBlock(), vue.createBlock(vue.KeepAlive, {
|
|
261
|
-
include: props.cachable ? cacheInclude : []
|
|
298
|
+
include: props.cachable ? cacheInclude.value : []
|
|
262
299
|
}, [
|
|
263
300
|
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(Component), {
|
|
264
301
|
key: currentRoute.name,
|
|
@@ -281,7 +318,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
281
318
|
}, {
|
|
282
319
|
default: vue.withCtx(() => [
|
|
283
320
|
(vue.openBlock(), vue.createBlock(vue.KeepAlive, {
|
|
284
|
-
include: props.cachable ? cacheInclude : []
|
|
321
|
+
include: props.cachable ? cacheInclude.value : []
|
|
285
322
|
}, [
|
|
286
323
|
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(Component), {
|
|
287
324
|
key: currentRoute.name,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InstallWithSFC } from '../utils';
|
|
2
2
|
import { default as PageLayout } from './PageLayout.vue';
|
|
3
|
+
export type { BreadcrumbConfig, PageLayoutProps } from './types';
|
|
3
4
|
export declare const JkyPageLayout: InstallWithSFC<typeof PageLayout>;
|
|
4
5
|
export default JkyPageLayout;
|
|
@@ -17,7 +17,7 @@ declare function __VLS_template(): {
|
|
|
17
17
|
pageTableRef: HTMLDivElement;
|
|
18
18
|
formRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
19
19
|
modelValue: Record<string, any>;
|
|
20
|
-
} & import('../form
|
|
20
|
+
} & import('../form').FormProps> & Readonly<{
|
|
21
21
|
"onUpdate:modelValue"?: ((value: Record<string, any>) => any) | undefined;
|
|
22
22
|
onChange?: ((value: Record<string, any>) => any) | undefined;
|
|
23
23
|
onReset?: (() => any) | undefined;
|
|
@@ -337,7 +337,7 @@ declare function __VLS_template(): {
|
|
|
337
337
|
}) => any;
|
|
338
338
|
}, import('vue').PublicProps, {
|
|
339
339
|
size: import('element-plus').ComponentSize;
|
|
340
|
-
grid: import('../form
|
|
340
|
+
grid: import('../form').GridConfig;
|
|
341
341
|
inline: boolean;
|
|
342
342
|
labelPosition: "left" | "right" | "top";
|
|
343
343
|
labelWidth: string | number;
|
|
@@ -460,7 +460,7 @@ declare function __VLS_template(): {
|
|
|
460
460
|
Defaults: {};
|
|
461
461
|
}, Readonly<{
|
|
462
462
|
modelValue: Record<string, any>;
|
|
463
|
-
} & import('../form
|
|
463
|
+
} & import('../form').FormProps> & Readonly<{
|
|
464
464
|
"onUpdate:modelValue"?: ((value: Record<string, any>) => any) | undefined;
|
|
465
465
|
onChange?: ((value: Record<string, any>) => any) | undefined;
|
|
466
466
|
onReset?: (() => any) | undefined;
|
|
@@ -771,7 +771,7 @@ declare function __VLS_template(): {
|
|
|
771
771
|
}) | undefined>;
|
|
772
772
|
}, {}, {}, {}, {
|
|
773
773
|
size: import('element-plus').ComponentSize;
|
|
774
|
-
grid: import('../form
|
|
774
|
+
grid: import('../form').GridConfig;
|
|
775
775
|
inline: boolean;
|
|
776
776
|
labelPosition: "left" | "right" | "top";
|
|
777
777
|
labelWidth: string | number;
|
|
@@ -2960,7 +2960,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
2960
2960
|
border: boolean;
|
|
2961
2961
|
stripe: boolean;
|
|
2962
2962
|
emptyText: string;
|
|
2963
|
-
formProps: Partial<import('../form
|
|
2963
|
+
formProps: Partial<import('../form').FormProps>;
|
|
2964
2964
|
tableProps: Partial<import('element-plus').TableProps>;
|
|
2965
2965
|
paginationProps: Partial<import('element-plus').PaginationProps>;
|
|
2966
2966
|
autoSearchDelay: number;
|
|
@@ -2968,7 +2968,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
2968
2968
|
pageTableRef: HTMLDivElement;
|
|
2969
2969
|
formRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
2970
2970
|
modelValue: Record<string, any>;
|
|
2971
|
-
} & import('../form
|
|
2971
|
+
} & import('../form').FormProps> & Readonly<{
|
|
2972
2972
|
"onUpdate:modelValue"?: ((value: Record<string, any>) => any) | undefined;
|
|
2973
2973
|
onChange?: ((value: Record<string, any>) => any) | undefined;
|
|
2974
2974
|
onReset?: (() => any) | undefined;
|
|
@@ -3288,7 +3288,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
3288
3288
|
}) => any;
|
|
3289
3289
|
}, import('vue').PublicProps, {
|
|
3290
3290
|
size: import('element-plus').ComponentSize;
|
|
3291
|
-
grid: import('../form
|
|
3291
|
+
grid: import('../form').GridConfig;
|
|
3292
3292
|
inline: boolean;
|
|
3293
3293
|
labelPosition: "left" | "right" | "top";
|
|
3294
3294
|
labelWidth: string | number;
|
|
@@ -3411,7 +3411,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
3411
3411
|
Defaults: {};
|
|
3412
3412
|
}, Readonly<{
|
|
3413
3413
|
modelValue: Record<string, any>;
|
|
3414
|
-
} & import('../form
|
|
3414
|
+
} & import('../form').FormProps> & Readonly<{
|
|
3415
3415
|
"onUpdate:modelValue"?: ((value: Record<string, any>) => any) | undefined;
|
|
3416
3416
|
onChange?: ((value: Record<string, any>) => any) | undefined;
|
|
3417
3417
|
onReset?: (() => any) | undefined;
|
|
@@ -3722,7 +3722,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
3722
3722
|
}) | undefined>;
|
|
3723
3723
|
}, {}, {}, {}, {
|
|
3724
3724
|
size: import('element-plus').ComponentSize;
|
|
3725
|
-
grid: import('../form
|
|
3725
|
+
grid: import('../form').GridConfig;
|
|
3726
3726
|
inline: boolean;
|
|
3727
3727
|
labelPosition: "left" | "right" | "top";
|
|
3728
3728
|
labelWidth: string | number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InstallWithSFC } from '../utils/types';
|
|
2
2
|
import { default as PageTable } from './PageTable.vue';
|
|
3
|
+
export type { ApiParamsGetter, FilterItemConfig, PageTableEmits, PageTableExpose, PageTableProps, PaginationConfig, TableApiFunction, TableApiResponse, TableColumnConfig, TableDataSource, TableResponseProps, ToolbarButtonConfig, ToolbarEmits, ToolbarProps, } from './types';
|
|
3
4
|
export declare const JkyPageTable: InstallWithSFC<typeof PageTable>;
|
|
4
5
|
export default JkyPageTable;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InstallWithSFC } from '../utils';
|
|
2
2
|
import { default as RichEditor } from './RichEditor.vue';
|
|
3
|
+
export type { RichEditorEmits, RichEditorProps } from './types';
|
|
3
4
|
export declare const JkyRichEditor: InstallWithSFC<typeof RichEditor>;
|
|
4
5
|
export default JkyRichEditor;
|