jky-component-lib 0.0.73 → 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/form/index.d.ts +1 -0
- package/dist/es/index.js +3 -12
- package/dist/es/menu/Menu.vue.js +42 -40
- package/dist/es/menu/MenuItem.vue.js +43 -41
- 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 +2 -1
- package/dist/es/page-layout/PageLayout.vue.js +71 -52
- 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 +47 -166
- 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 +9 -42
- package/dist/es/tabs/Tabs.vue.js +108 -287
- 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 +4 -6
- package/dist/es/tabs/index.js +1 -1
- package/dist/es/tabs/style.css +32 -18
- package/dist/es/tabs/useTabsStore.d.ts +5 -52
- package/dist/es/tabs/useTabsStore.js +130 -182
- package/dist/lib/add-input/index.d.ts +1 -0
- package/dist/lib/code-mirror-editor/index.d.ts +1 -0
- package/dist/lib/form/index.d.ts +1 -0
- package/dist/lib/index.js +2 -11
- package/dist/lib/menu/Menu.vue.js +42 -40
- package/dist/lib/menu/MenuItem.vue.js +42 -40
- 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 +2 -1
- package/dist/lib/page-layout/PageLayout.vue.js +69 -50
- 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 +47 -166
- 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 +9 -42
- package/dist/lib/tabs/Tabs.vue.js +106 -285
- 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 +4 -6
- package/dist/lib/tabs/index.js +1 -1
- package/dist/lib/tabs/style.css +32 -18
- package/dist/lib/tabs/useTabsStore.d.ts +5 -52
- package/dist/lib/tabs/useTabsStore.js +129 -181
- package/package.json +1 -1
- package/dist/es/tabs/TabContent.vue.d.ts +0 -16
- package/dist/es/tabs/TabContent.vue.js +0 -65
- package/dist/es/tabs/TabContent.vue3.js +0 -5
- package/dist/es/tabs/routeListener.d.ts +0 -19
- package/dist/es/tabs/routeListener.js +0 -26
- package/dist/es/tabs/useTabs.d.ts +0 -27
- package/dist/es/tabs/useTabs.js +0 -59
- package/dist/lib/tabs/TabContent.vue.d.ts +0 -16
- package/dist/lib/tabs/TabContent.vue.js +0 -65
- package/dist/lib/tabs/TabContent.vue3.js +0 -5
- package/dist/lib/tabs/routeListener.d.ts +0 -19
- package/dist/lib/tabs/routeListener.js +0 -26
- package/dist/lib/tabs/useTabs.d.ts +0 -27
- package/dist/lib/tabs/useTabs.js +0 -59
|
@@ -14,195 +14,143 @@ var __spreadValues = (a, b) => {
|
|
|
14
14
|
}
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
|
+
import { useLocalStorage, useSessionStorage } from "@vueuse/core";
|
|
17
18
|
import { defineStore } from "pinia";
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
+
});
|
|
27
33
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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) || "";
|
|
92
145
|
}
|
|
146
|
+
return true;
|
|
93
147
|
}
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
function setActiveTab(name) {
|
|
98
|
-
activeTab.value = name;
|
|
99
|
-
persistState();
|
|
100
|
-
}
|
|
101
|
-
function addCache(name) {
|
|
102
|
-
if (!cacheSet.value.has(name)) {
|
|
103
|
-
cacheTabs.value = [...cacheTabs.value, name];
|
|
104
|
-
persistState();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
function removeCache(name) {
|
|
108
|
-
cacheTabs.value = cacheTabs.value.filter((t) => t !== name);
|
|
109
|
-
persistState();
|
|
110
|
-
}
|
|
111
|
-
function bulkRemove(names) {
|
|
112
|
-
tabList.value = tabList.value.filter((tab) => !names.includes(tab.name));
|
|
113
|
-
names.forEach((name) => removeCache(name));
|
|
114
|
-
persistState();
|
|
115
|
-
}
|
|
116
|
-
function closeLeft(name) {
|
|
117
|
-
const index = tabList.value.findIndex((t) => t.name === name);
|
|
118
|
-
if (index > 0) {
|
|
119
|
-
const leftTabs = tabList.value.slice(0, index);
|
|
120
|
-
const removableTabs = leftTabs.filter((tab) => !tab.affix);
|
|
121
|
-
bulkRemove(removableTabs.map((tab) => tab.name));
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
function closeRight(name) {
|
|
125
|
-
const index = tabList.value.findIndex((t) => t.name === name);
|
|
126
|
-
if (index >= 0 && index < tabList.value.length - 1) {
|
|
127
|
-
const rightTabs = tabList.value.slice(index + 1);
|
|
128
|
-
const removableTabs = rightTabs.filter((tab) => !tab.affix);
|
|
129
|
-
bulkRemove(removableTabs.map((tab) => tab.name));
|
|
148
|
+
return false;
|
|
130
149
|
}
|
|
131
150
|
}
|
|
132
|
-
function closeOther(name) {
|
|
133
|
-
const removableTabs = tabList.value.filter(
|
|
134
|
-
(tab) => tab.name !== name && !tab.affix
|
|
135
|
-
);
|
|
136
|
-
bulkRemove(removableTabs.map((tab) => tab.name));
|
|
137
|
-
}
|
|
138
|
-
function closeAll() {
|
|
139
|
-
const removableTabs = tabList.value.filter((tab) => !tab.affix);
|
|
140
|
-
bulkRemove(removableTabs.map((tab) => tab.name));
|
|
141
|
-
}
|
|
142
|
-
function refresh(name) {
|
|
143
|
-
removeCache(name);
|
|
144
|
-
setTimeout(() => {
|
|
145
|
-
addCache(name);
|
|
146
|
-
}, 0);
|
|
147
|
-
}
|
|
148
|
-
function getTabList() {
|
|
149
|
-
return [...tabList.value];
|
|
150
|
-
}
|
|
151
|
-
function getCacheTabs() {
|
|
152
|
-
return [...cacheTabs.value];
|
|
153
|
-
}
|
|
154
|
-
function isClosed(name) {
|
|
155
|
-
return closedSet.value.has(name);
|
|
156
|
-
}
|
|
157
|
-
function isCached(name) {
|
|
158
|
-
return cacheSet.value.has(name);
|
|
159
|
-
}
|
|
160
|
-
function reset() {
|
|
161
|
-
tabList.value = [];
|
|
162
|
-
activeTab.value = "";
|
|
163
|
-
cacheTabs.value = [];
|
|
164
|
-
closedTabs.value = [];
|
|
165
|
-
persistState();
|
|
166
|
-
}
|
|
167
|
-
return {
|
|
168
|
-
tabList,
|
|
169
|
-
activeTab,
|
|
170
|
-
cacheTabs,
|
|
171
|
-
closedTabs,
|
|
172
|
-
addTab,
|
|
173
|
-
updateTab,
|
|
174
|
-
removeTab,
|
|
175
|
-
setActiveTab,
|
|
176
|
-
addCache,
|
|
177
|
-
removeCache,
|
|
178
|
-
bulkRemove,
|
|
179
|
-
closeLeft,
|
|
180
|
-
closeRight,
|
|
181
|
-
closeOther,
|
|
182
|
-
closeAll,
|
|
183
|
-
refresh,
|
|
184
|
-
getTabList,
|
|
185
|
-
getCacheTabs,
|
|
186
|
-
isClosed,
|
|
187
|
-
isCached,
|
|
188
|
-
reset
|
|
189
|
-
};
|
|
190
151
|
});
|
|
191
|
-
return
|
|
192
|
-
}
|
|
193
|
-
const storeInstances = /* @__PURE__ */ new Map();
|
|
194
|
-
function useTabsStore(persist, persistKey) {
|
|
195
|
-
const key = persistKey || DEFAULT_PERSIST_KEY;
|
|
196
|
-
if (!storeInstances.has(key)) {
|
|
197
|
-
storeInstances.set(key, () => createTabsStore(persist, persistKey));
|
|
198
|
-
}
|
|
199
|
-
return storeInstances.get(key)();
|
|
200
|
-
}
|
|
201
|
-
function resetTabsStore() {
|
|
202
|
-
storeInstances.clear();
|
|
152
|
+
return { useTabsStore, config: finalConfig };
|
|
203
153
|
}
|
|
204
154
|
export {
|
|
205
|
-
createTabsStore
|
|
206
|
-
resetTabsStore,
|
|
207
|
-
useTabsStore
|
|
155
|
+
createTabsStore
|
|
208
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/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
|
@@ -4,8 +4,6 @@ const components = require("./components.js");
|
|
|
4
4
|
const installer$1 = require("./utils/installer.js");
|
|
5
5
|
;/* empty css */
|
|
6
6
|
const resolver = require("./resolver.js");
|
|
7
|
-
const TabContent_vue_vue_type_script_setup_true_lang = require("./tabs/TabContent.vue.js");
|
|
8
|
-
;/* empty css */
|
|
9
7
|
const index = require("./add-input/index.js");
|
|
10
8
|
const index$1 = require("./button/index.js");
|
|
11
9
|
const index$2 = require("./button-nav/index.js");
|
|
@@ -18,15 +16,13 @@ const index$8 = require("./page-table/index.js");
|
|
|
18
16
|
const index$9 = require("./rich-editor/index.js");
|
|
19
17
|
const index$a = require("./say-hello/index.js");
|
|
20
18
|
const index$b = require("./tabs/index.js");
|
|
21
|
-
const
|
|
19
|
+
const createTabsGuard = require("./tabs/createTabsGuard.js");
|
|
22
20
|
const useTabsStore = require("./tabs/useTabsStore.js");
|
|
23
|
-
const useTabs = require("./tabs/useTabs.js");
|
|
24
21
|
const installer = installer$1.createInstaller(components.components);
|
|
25
22
|
const install = installer.install;
|
|
26
23
|
const version = installer.version;
|
|
27
24
|
exports.components = components.components;
|
|
28
25
|
exports.JkyComponentLibResolver = resolver.JkyComponentLibResolver;
|
|
29
|
-
exports.JkyTabContent = TabContent_vue_vue_type_script_setup_true_lang.default;
|
|
30
26
|
exports.JkyAddInput = index.JkyAddInput;
|
|
31
27
|
exports.JkyButton = index$1.JkyButton;
|
|
32
28
|
exports.JkyButtonNav = index$2.JkyButtonNav;
|
|
@@ -39,13 +35,8 @@ exports.JkyPageTable = index$8.JkyPageTable;
|
|
|
39
35
|
exports.JkyRichEditor = index$9.JkyRichEditor;
|
|
40
36
|
exports.JkySayHello = index$a.JkySayHello;
|
|
41
37
|
exports.JkyTabs = index$b.JkyTabs;
|
|
42
|
-
exports.
|
|
43
|
-
exports.emitRouteChange = routeListener.emitRouteChange;
|
|
44
|
-
exports.onRouteChange = routeListener.onRouteChange;
|
|
38
|
+
exports.createTabsGuard = createTabsGuard.createTabsGuard;
|
|
45
39
|
exports.createTabsStore = useTabsStore.createTabsStore;
|
|
46
|
-
exports.resetTabsStore = useTabsStore.resetTabsStore;
|
|
47
|
-
exports.useTabsStore = useTabsStore.useTabsStore;
|
|
48
|
-
exports.useTabs = useTabs.useTabs;
|
|
49
40
|
exports.default = installer;
|
|
50
41
|
exports.install = install;
|
|
51
42
|
exports.version = version;
|
|
@@ -71,46 +71,48 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
71
71
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
72
72
|
key: item.index
|
|
73
73
|
}, [
|
|
74
|
-
item.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
74
|
+
!item.hideMenu ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
75
|
+
item.children && item.children.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElSubMenu), {
|
|
76
|
+
key: 0,
|
|
77
|
+
index: item.index || "",
|
|
78
|
+
class: vue.normalizeClass(item.customClass),
|
|
79
|
+
disabled: (_a = item.disabled) != null ? _a : false,
|
|
80
|
+
"popper-offset": item.popperOffset
|
|
81
|
+
}, {
|
|
82
|
+
title: vue.withCtx(() => [
|
|
83
|
+
item.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
84
|
+
key: 0,
|
|
85
|
+
class: vue.normalizeClass([item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
86
|
+
}, null, 2)) : vue.createCommentVNode("", true),
|
|
87
|
+
item.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, vue.toDisplayString(item.title), 1)) : vue.createCommentVNode("", true)
|
|
88
|
+
]),
|
|
89
|
+
default: vue.withCtx(() => [
|
|
90
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.children, (child) => {
|
|
91
|
+
return vue.openBlock(), vue.createBlock(MenuItem_vue_vue_type_script_setup_true_lang.default, {
|
|
92
|
+
key: child.index,
|
|
93
|
+
item: child,
|
|
94
|
+
levels: props.levels > 0 ? props.levels - 1 : 0
|
|
95
|
+
}, null, 8, ["item", "levels"]);
|
|
96
|
+
}), 128))
|
|
97
|
+
]),
|
|
98
|
+
_: 2
|
|
99
|
+
}, 1032, ["index", "class", "disabled", "popper-offset"])) : (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElMenuItem), {
|
|
100
|
+
key: 1,
|
|
101
|
+
index: item.index || "",
|
|
102
|
+
class: vue.normalizeClass(item.customClass),
|
|
103
|
+
disabled: (_b = item.disabled) != null ? _b : false,
|
|
104
|
+
route: item.route
|
|
105
|
+
}, {
|
|
106
|
+
default: vue.withCtx(() => [
|
|
107
|
+
item.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
108
|
+
key: 0,
|
|
109
|
+
class: vue.normalizeClass([item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
110
|
+
}, null, 2)) : vue.createCommentVNode("", true),
|
|
111
|
+
item.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, vue.toDisplayString(item.title), 1)) : vue.createCommentVNode("", true)
|
|
112
|
+
]),
|
|
113
|
+
_: 2
|
|
114
|
+
}, 1032, ["index", "class", "disabled", "route"]))
|
|
115
|
+
], 64)) : vue.createCommentVNode("", true)
|
|
114
116
|
], 64);
|
|
115
117
|
}), 128)) : vue.renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
116
118
|
]),
|
|
@@ -21,46 +21,48 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
21
21
|
return (_ctx, _cache) => {
|
|
22
22
|
var _a, _b;
|
|
23
23
|
const _component_MenuItem = vue.resolveComponent("MenuItem", true);
|
|
24
|
-
return props.item.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
24
|
+
return !props.item.hideMenu ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
25
|
+
props.item.children && props.item.children.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElSubMenu), {
|
|
26
|
+
key: 0,
|
|
27
|
+
index: props.item.index || "",
|
|
28
|
+
class: vue.normalizeClass(props.item.customClass),
|
|
29
|
+
disabled: (_a = props.item.disabled) != null ? _a : false,
|
|
30
|
+
"popper-offset": props.item.popperOffset
|
|
31
|
+
}, {
|
|
32
|
+
title: vue.withCtx(() => [
|
|
33
|
+
props.item.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: vue.normalizeClass([props.item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
36
|
+
}, null, 2)) : vue.createCommentVNode("", true),
|
|
37
|
+
props.item.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, vue.toDisplayString(props.item.title), 1)) : vue.createCommentVNode("", true)
|
|
38
|
+
]),
|
|
39
|
+
default: vue.withCtx(() => [
|
|
40
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(props.item.children, (child) => {
|
|
41
|
+
return vue.openBlock(), vue.createBlock(_component_MenuItem, {
|
|
42
|
+
key: child.index,
|
|
43
|
+
item: child,
|
|
44
|
+
levels: props.levels !== void 0 && props.levels > 0 ? props.levels - 1 : 0
|
|
45
|
+
}, null, 8, ["item", "levels"]);
|
|
46
|
+
}), 128))
|
|
47
|
+
]),
|
|
48
|
+
_: 1
|
|
49
|
+
}, 8, ["index", "class", "disabled", "popper-offset"])) : (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElMenuItem), {
|
|
50
|
+
key: 1,
|
|
51
|
+
index: props.item.index || "",
|
|
52
|
+
class: vue.normalizeClass(props.item.customClass),
|
|
53
|
+
disabled: (_b = props.item.disabled) != null ? _b : false,
|
|
54
|
+
route: props.item.route
|
|
55
|
+
}, {
|
|
56
|
+
default: vue.withCtx(() => [
|
|
57
|
+
props.item.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
58
|
+
key: 0,
|
|
59
|
+
class: vue.normalizeClass([props.item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
60
|
+
}, null, 2)) : vue.createCommentVNode("", true),
|
|
61
|
+
props.item.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, vue.toDisplayString(props.item.title), 1)) : vue.createCommentVNode("", true)
|
|
62
|
+
]),
|
|
63
|
+
_: 1
|
|
64
|
+
}, 8, ["index", "class", "disabled", "route"]))
|
|
65
|
+
], 64)) : vue.createCommentVNode("", true);
|
|
64
66
|
};
|
|
65
67
|
}
|
|
66
68
|
});
|
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,6 +1,7 @@
|
|
|
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
3
|
cachable: boolean;
|
|
4
|
+
roundTabs: boolean;
|
|
4
5
|
showTopMenu: boolean;
|
|
5
6
|
showSideMenu: boolean;
|
|
6
7
|
asideWidth: string;
|
|
@@ -12,5 +13,5 @@ declare const _default: import('vue').DefineComponent<PageLayoutProps, {}, {}, {
|
|
|
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;
|