cosey 0.1.4 → 0.2.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/README.md +61 -0
- package/components/close/style/index.js +2 -2
- package/components/col/col.vue.js +1 -1
- package/components/col/style/index.js +3 -3
- package/components/config-provider/config-provider.d.ts +2 -0
- package/components/config-provider/config-provider.vue.js +13 -3
- package/components/context-menu/context-menu.vue.js +4 -4
- package/components/context-menu/context-sub-menu.vue.js +2 -2
- package/components/context-menu/style/index.js +2 -2
- package/components/editor/components/color-picker/color-picker.vue.js +15 -11
- package/components/editor/components/color-picker/useHistoryColor.js +3 -3
- package/components/editor/components/resize/resize.js +9 -9
- package/components/editor/components/resize/resize.style.js +20 -20
- package/components/editor/components/resize/resize.vue.js +2 -2
- package/components/editor/components/table-toolbar/table-toolbar.style.js +2 -2
- package/components/editor/components/table-toolbar/table-toolbar.vue.js +2 -2
- package/components/editor/components/toolbar/formats/font.vue.js +5 -1
- package/components/editor/components/toolbar/formats/header.vue.js +6 -2
- package/components/editor/components/toolbar/formats/link.vue.js +17 -13
- package/components/editor/components/toolbar/formats/size.vue.js +5 -1
- package/components/editor/components/toolbar/formats/source.vue.d.ts +2 -0
- package/components/editor/components/toolbar/formats/source.vue.js +78 -0
- package/components/editor/components/toolbar/formats/table.style.js +2 -2
- package/components/editor/components/toolbar/formats/video.vue.js +9 -5
- package/components/editor/components/toolbar/toolbar.vue.js +5 -0
- package/components/editor/formats/font.js +2 -2
- package/components/editor/formats/indent.js +1 -1
- package/components/editor/formats/kbd.d.ts +7 -0
- package/components/editor/formats/kbd.js +13 -0
- package/components/editor/modules/image-uploader/formats/image-loading.style.js +2 -2
- package/components/editor/quill.js +8 -6
- package/components/editor/style/index.js +25 -16
- package/components/field/components/autocomplete/autocomplete.vue.js +5 -1
- package/components/field/components/cascader/cascader.vue.js +5 -1
- package/components/field/components/checkbox-group/checkbox-group.vue.js +1 -1
- package/components/field/components/checkbox-group/panel.vue.js +10 -5
- package/components/field/components/date/date.vue.js +5 -1
- package/components/field/components/date-range/date-range.vue.js +6 -2
- package/components/field/components/date-time/date-time.vue.js +5 -1
- package/components/field/components/date-time-range/date-time-range.vue.js +6 -2
- package/components/field/components/dates/dates.vue.js +5 -1
- package/components/field/components/input/input.vue.js +5 -1
- package/components/field/components/input-tag/input-tag.vue.js +5 -1
- package/components/field/components/mention/mention.vue.js +5 -1
- package/components/field/components/month/month.vue.js +5 -1
- package/components/field/components/month-range/month-range.vue.js +6 -2
- package/components/field/components/months/months.vue.js +5 -1
- package/components/field/components/password/password.vue.js +5 -1
- package/components/field/components/select/select.d.ts +2 -2
- package/components/field/components/select/select.js +3 -3
- package/components/field/components/select/select.vue.js +5 -1
- package/components/field/components/select-v2/select-v2.d.ts +6 -3
- package/components/field/components/select-v2/select-v2.js +9 -0
- package/components/field/components/select-v2/select-v2.vue.js +21 -3
- package/components/field/components/textarea/textarea.vue.js +5 -1
- package/components/field/components/time/time.vue.js +5 -1
- package/components/field/components/time-range/time-range.vue.js +6 -2
- package/components/field/components/time-select/time-select.vue.js +5 -1
- package/components/field/components/tree-select/tree-select.vue.js +5 -1
- package/components/field/components/week/week.vue.js +6 -2
- package/components/field/components/year/year.vue.js +5 -1
- package/components/field/components/year-range/year-range.vue.js +6 -2
- package/components/field/components/years/years.vue.js +5 -1
- package/components/form/form-item.d.ts +1 -1
- package/components/form/form.d.ts +2 -0
- package/components/form/form.js +2 -2
- package/components/form/form.vue.d.ts +5 -0
- package/components/form/form.vue.js +6 -2
- package/components/form/index.d.ts +10 -1
- package/components/form/useBubbleTemplate.js +13 -5
- package/components/form-dialog/form-dialog.js +2 -2
- package/components/form-dialog/index.d.ts +4 -1552
- package/components/form-list/form-list.js +1 -1
- package/components/form-list/form-list.vue.js +5 -1
- package/components/form-list/index.d.ts +1 -1
- package/components/form-query/form-query.d.ts +2 -0
- package/components/form-query/form-query.vue.d.ts +5 -0
- package/components/form-query/form-query.vue.js +13 -7
- package/components/form-query/index.d.ts +9 -0
- package/components/highlight/style/index.js +2 -2
- package/components/horizontal-tree/horizontal-tree.vue.js +11 -6
- package/components/image-card/image-card.d.ts +1 -8
- package/components/image-card/image-card.vue.d.ts +4 -18
- package/components/image-card/index.d.ts +8 -29
- package/components/long-text/style/index.js +2 -2
- package/components/mask/style/index.js +2 -2
- package/components/row/row.vue.js +1 -1
- package/components/scroll-view/scroll-view.vue.js +1 -1
- package/components/scroll-view/style/index.js +9 -9
- package/components/table/index.d.ts +73 -78
- package/components/table/table-column/renderer.d.ts +2 -1
- package/components/table/table-column/renderer.js +2 -2
- package/components/table/table-column/table-column.d.ts +15 -15
- package/components/table/table-column/table-column.vue.d.ts +9 -5
- package/components/table/table-column/table-column.vue.js +5 -1
- package/components/table/table-column-editor/table-column-editor.vue.js +22 -14
- package/components/table/table-export/table-export.vue.js +31 -26
- package/components/table/table-query/table-query.d.ts +2 -0
- package/components/table/table-query/table-query.vue.d.ts +5 -0
- package/components/table/table.d.ts +22 -25
- package/components/table/table.vue.d.ts +45 -51
- package/components/table/table.vue.js +13 -9
- package/components/table/useTable.d.ts +2 -1
- package/components/table/useTable.js +2 -2
- package/components/table-action/index.d.ts +48 -6
- package/components/table-action/item.d.ts +16 -2
- package/components/table-action/item.vue.d.ts +34 -6
- package/components/table-action/item.vue.js +15 -9
- package/components/table-action/table-action.vue.d.ts +16 -2
- package/components/toggle/toggle.vue.js +5 -1
- package/components/upload/style/index.js +2 -2
- package/components/upload/upload-item.vue.d.ts +2 -2
- package/components/upload/upload-item.vue.js +16 -9
- package/components/upload/upload.vue.js +7 -1
- package/config/index.d.ts +1 -2
- package/config/index.js +2 -2
- package/config/nprogress.style.js +5 -5
- package/config/root-config-provider.vue.js +5 -5
- package/constant.d.ts +2 -2
- package/constant.js +2 -2
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/useColorScheme.js +4 -4
- package/hooks/useDir.d.ts +2 -0
- package/hooks/useDir.js +20 -0
- package/hooks/useEcharts.d.ts +3 -2
- package/hooks/useEcharts.js +15 -3
- package/hooks/useLocale.d.ts +23 -371
- package/hooks/useLocale.js +26 -35
- package/hooks/useUpsert.d.ts +5 -3
- package/hooks/useUpsert.js +33 -25
- package/index.d.ts +1 -1
- package/index.js +4 -4
- package/layout/layout-auth/style/index.js +6 -6
- package/layout/layout-breadcrumb/layout-breadcrumb.vue.js +6 -2
- package/layout/layout-change-password/layout-change-password.vue.js +28 -22
- package/layout/layout-content/layout-content.vue.js +1 -1
- package/layout/layout-content/style/index.js +1 -1
- package/layout/layout-forbidden/layout-forbidden.vue.js +11 -6
- package/layout/layout-header/layout-header.vue.js +4 -4
- package/layout/layout-header/style/index.js +3 -3
- package/layout/layout-iframe/style/index.js +2 -2
- package/layout/layout-internal-server-error/layout-internal-server-error.vue.js +11 -6
- package/layout/layout-login/layout-login.vue.js +19 -14
- package/layout/layout-main/layout-main.vue.js +1 -1
- package/layout/layout-menu/layout-menu.vue.js +5 -1
- package/layout/layout-menu/style/index.js +1 -1
- package/layout/layout-not-found/layout-not-found.vue.js +11 -6
- package/layout/layout-search/layout-search.vue.js +22 -14
- package/layout/layout-sidebar/layout-sidebar.vue.js +8 -5
- package/layout/layout-sidebar/style/index.js +2 -2
- package/layout/layout-snug-aside/style/index.js +1 -1
- package/layout/layout-tabbar/layout-tabbar.vue.js +21 -13
- package/layout/layout-tabbar/style/index.js +1 -1
- package/layout/layout-top-snug-menu/layout-top-snug-menu.vue.js +24 -17
- package/layout/layout-user-menu/layout-user-menu.vue.js +10 -6
- package/locale/index.d.ts +10 -0
- package/locale/index.js +2 -0
- package/locale/lang/ar.d.ts +280 -0
- package/locale/lang/ar.js +129 -0
- package/locale/lang/en.d.ts +302 -0
- package/locale/lang/en.js +129 -0
- package/locale/lang/zh-cn.d.ts +301 -0
- package/locale/lang/zh-cn.js +129 -0
- package/package.json +10 -8
- package/request/useRequest.js +31 -23
- package/store/index.d.ts +1 -1
- package/store/index.js +6 -3
- package/store/layout.js +208 -190
- package/store/plugin.d.ts +9 -0
- package/store/plugin.js +22 -0
- package/store/user.d.ts +1 -1
- package/utils/css.d.ts +4 -0
- package/utils/css.js +5 -2
- package/utils/excel/bookFormats.js +5 -5
- package/utils/excel/xlsx.js +2 -2
- package/utils/index.js +1 -1
- package/utils/message-box.js +3 -1
- package/utils/tree.js +2 -2
- package/components/form-dialog/form-dialog.vue.d.ts +0 -675
|
@@ -3,6 +3,7 @@ import { useRoute, useRouter } from 'vue-router';
|
|
|
3
3
|
import { ElMenu, ElMenuItemGroup, ElSubMenu, ElMenuItem } from 'element-plus';
|
|
4
4
|
import { useLayoutStore } from '../../store/layout.js';
|
|
5
5
|
import stdin_default$1 from './style/index.js';
|
|
6
|
+
import { useI18n } from 'vue-i18n';
|
|
6
7
|
import { useComponentConfig } from '../../components/config-provider/config-provider.js';
|
|
7
8
|
import { defineTemplate } from '../../utils/vue.js';
|
|
8
9
|
import { Icon as _Icon } from '../../components/icon/index.js';
|
|
@@ -20,6 +21,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
20
21
|
}
|
|
21
22
|
},
|
|
22
23
|
setup(__props) {
|
|
24
|
+
const {
|
|
25
|
+
t
|
|
26
|
+
} = useI18n();
|
|
23
27
|
const props = __props;
|
|
24
28
|
const {
|
|
25
29
|
prefixCls
|
|
@@ -61,7 +65,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
61
65
|
margin: collapse.value ? 0 : void 0
|
|
62
66
|
}
|
|
63
67
|
}, null);
|
|
64
|
-
const titleVNode = () => createVNode("span", null, [item.title]);
|
|
68
|
+
const titleVNode = () => createVNode("span", null, [t(item.title ?? "")]);
|
|
65
69
|
if (item.children && item.children.length > 0) {
|
|
66
70
|
const slots = {
|
|
67
71
|
title: () => [iconVNode(), titleVNode()],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createVNode,
|
|
1
|
+
import { defineComponent, resolveComponent, createBlock, openBlock, unref, withCtx, createVNode, createTextVNode, toDisplayString } from 'vue';
|
|
2
2
|
import { ElButton } from 'element-plus';
|
|
3
3
|
import { useGlobalConfig } from '../../config/index.js';
|
|
4
|
+
import { useLocale } from '../../hooks/useLocale.js';
|
|
4
5
|
|
|
5
6
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
6
7
|
...{
|
|
@@ -8,6 +9,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
8
9
|
},
|
|
9
10
|
__name: "layout-not-found",
|
|
10
11
|
setup(__props) {
|
|
12
|
+
const {
|
|
13
|
+
t
|
|
14
|
+
} = useLocale();
|
|
11
15
|
const routerConfig = useGlobalConfig().router;
|
|
12
16
|
return (_ctx, _cache) => {
|
|
13
17
|
const _component_router_link = resolveComponent("router-link");
|
|
@@ -15,7 +19,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
15
19
|
return openBlock(), createBlock(_component_el_result, {
|
|
16
20
|
icon: "error",
|
|
17
21
|
title: "404",
|
|
18
|
-
"sub-title": "
|
|
22
|
+
"sub-title": unref(t)("co.exception.pageNotFound")
|
|
19
23
|
}, {
|
|
20
24
|
extra: withCtx(() => [createVNode(_component_router_link, {
|
|
21
25
|
to: unref(routerConfig).homePath
|
|
@@ -23,16 +27,17 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
23
27
|
default: withCtx(() => [createVNode(unref(ElButton), {
|
|
24
28
|
type: "primary"
|
|
25
29
|
}, {
|
|
26
|
-
default: withCtx(() =>
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.exception.backToHome")), 1
|
|
31
|
+
/* TEXT */)]),
|
|
32
|
+
_: 1
|
|
33
|
+
/* STABLE */
|
|
29
34
|
})]),
|
|
30
35
|
_: 1
|
|
31
36
|
/* STABLE */
|
|
32
37
|
}, 8, ["to"])]),
|
|
33
38
|
_: 1
|
|
34
39
|
/* STABLE */
|
|
35
|
-
});
|
|
40
|
+
}, 8, ["sub-title"]);
|
|
36
41
|
};
|
|
37
42
|
}
|
|
38
43
|
});
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, useTemplateRef, watch, resolveComponent, createElementBlock, openBlock, createVNode, unref, normalizeClass, withCtx, createBlock, createElementVNode,
|
|
1
|
+
import { defineComponent, computed, ref, useTemplateRef, watch, resolveComponent, createElementBlock, openBlock, createVNode, unref, normalizeClass, withCtx, createBlock, createElementVNode, toDisplayString, createTextVNode, Fragment, renderList, withDirectives, vShow } from 'vue';
|
|
2
2
|
import { useRouter } from 'vue-router';
|
|
3
3
|
import { throttle } from 'lodash-es';
|
|
4
4
|
import { useLayoutStore } from '../../store/layout.js';
|
|
5
5
|
import stdin_default$1 from './style/index.js';
|
|
6
6
|
import { ElButton } from 'element-plus';
|
|
7
7
|
import { useTimeoutFn } from '@vueuse/core';
|
|
8
|
+
import { useI18n } from 'vue-i18n';
|
|
8
9
|
import { getControlKey } from '../../utils/browser.js';
|
|
10
|
+
import { useLocale } from '../../hooks/useLocale.js';
|
|
9
11
|
import { useComponentConfig } from '../../components/config-provider/config-provider.js';
|
|
10
12
|
import { useDocumentEvent } from '../../hooks/useDocumentEvent.js';
|
|
11
13
|
import { Icon as _Icon } from '../../components/icon/index.js';
|
|
@@ -17,6 +19,12 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
17
19
|
},
|
|
18
20
|
__name: "layout-search",
|
|
19
21
|
setup(__props) {
|
|
22
|
+
const {
|
|
23
|
+
t
|
|
24
|
+
} = useLocale();
|
|
25
|
+
const {
|
|
26
|
+
t: _t
|
|
27
|
+
} = useI18n();
|
|
20
28
|
const {
|
|
21
29
|
prefixCls
|
|
22
30
|
} = useComponentConfig("layout-search");
|
|
@@ -30,7 +38,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
30
38
|
const result = [];
|
|
31
39
|
function recur(items, parent) {
|
|
32
40
|
items.forEach(item => {
|
|
33
|
-
const label = parent ? parent + " > " + item.title : item.title;
|
|
41
|
+
const label = parent ? parent + " > " + _t(item.title) : _t(item.title);
|
|
34
42
|
if (!item.children || item.children.length === 0) {
|
|
35
43
|
result.push({
|
|
36
44
|
label,
|
|
@@ -160,8 +168,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
160
168
|
size: "lg"
|
|
161
169
|
}), createElementVNode("span", {
|
|
162
170
|
class: normalizeClass(`${unref(prefixCls)}-button-text`)
|
|
163
|
-
}, "
|
|
164
|
-
/* CLASS */), createElementVNode("span", {
|
|
171
|
+
}, toDisplayString(unref(t)("co.form.search")), 3
|
|
172
|
+
/* TEXT, CLASS */), createElementVNode("span", {
|
|
165
173
|
class: normalizeClass(`${unref(prefixCls)}-button-kbd`)
|
|
166
174
|
}, [createTextVNode(toDisplayString(unref(controlKey)) + " ", 1
|
|
167
175
|
/* TEXT */), _cache[3] || (_cache[3] = createElementVNode("kbd", null, "K", -1
|
|
@@ -182,7 +190,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
182
190
|
ref: "input",
|
|
183
191
|
modelValue: searchValue.value,
|
|
184
192
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => searchValue.value = $event),
|
|
185
|
-
placeholder: "
|
|
193
|
+
placeholder: unref(t)("co.search.searchPage"),
|
|
186
194
|
size: "large",
|
|
187
195
|
class: normalizeClass(`${unref(prefixCls)}-input`),
|
|
188
196
|
clearable: "",
|
|
@@ -195,26 +203,26 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
195
203
|
}, null, 8, ["class"])]),
|
|
196
204
|
_: 1
|
|
197
205
|
/* STABLE */
|
|
198
|
-
}, 8, ["modelValue", "class"])]),
|
|
206
|
+
}, 8, ["modelValue", "placeholder", "class"])]),
|
|
199
207
|
footer: withCtx(() => [createElementVNode("div", {
|
|
200
208
|
class: normalizeClass(`${unref(prefixCls)}-footer`)
|
|
201
209
|
}, [createElementVNode("div", null, [createVNode(unref(_Icon), {
|
|
202
210
|
name: "co:return"
|
|
203
211
|
}), createElementVNode("span", {
|
|
204
212
|
class: normalizeClass(`${unref(prefixCls)}-footer-text`)
|
|
205
|
-
}, "
|
|
206
|
-
/* CLASS */)]), createElementVNode("div", null, [createVNode(unref(_Icon), {
|
|
213
|
+
}, toDisplayString(unref(t)("co.search.select")), 3
|
|
214
|
+
/* TEXT, CLASS */)]), createElementVNode("div", null, [createVNode(unref(_Icon), {
|
|
207
215
|
name: "co:arrow-up"
|
|
208
216
|
}), createVNode(unref(_Icon), {
|
|
209
217
|
name: "co:arrow-down"
|
|
210
218
|
}), createElementVNode("span", {
|
|
211
219
|
class: normalizeClass(`${unref(prefixCls)}-footer-text`)
|
|
212
|
-
}, "
|
|
213
|
-
/* CLASS */)]), createElementVNode("div", null, [_cache[4] || (_cache[4] = createElementVNode("small", null, "Esc", -1
|
|
220
|
+
}, toDisplayString(unref(t)("co.search.switch")), 3
|
|
221
|
+
/* TEXT, CLASS */)]), createElementVNode("div", null, [_cache[4] || (_cache[4] = createElementVNode("small", null, "Esc", -1
|
|
214
222
|
/* HOISTED */)), createElementVNode("span", {
|
|
215
223
|
class: normalizeClass(`${unref(prefixCls)}-footer-text`)
|
|
216
|
-
}, "
|
|
217
|
-
/* CLASS */)])], 2
|
|
224
|
+
}, toDisplayString(unref(t)("co.common.close")), 3
|
|
225
|
+
/* TEXT, CLASS */)])], 2
|
|
218
226
|
/* CLASS */)]),
|
|
219
227
|
default: withCtx(() => [createVNode(_component_el_scrollbar, {
|
|
220
228
|
class: normalizeClass(`${unref(prefixCls)}-content`),
|
|
@@ -223,8 +231,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
223
231
|
default: withCtx(() => [searchResult.value.length === 0 ? (openBlock(), createElementBlock("div", {
|
|
224
232
|
key: 0,
|
|
225
233
|
class: normalizeClass(`${unref(prefixCls)}-empty`)
|
|
226
|
-
}, "
|
|
227
|
-
/* CLASS */)) : (openBlock(true), createElementBlock(Fragment, {
|
|
234
|
+
}, toDisplayString(unref(t)("co.search.noResults")), 3
|
|
235
|
+
/* TEXT, CLASS */)) : (openBlock(true), createElementBlock(Fragment, {
|
|
228
236
|
key: 1
|
|
229
237
|
}, renderList(searchResult.value, (item, index) => {
|
|
230
238
|
return openBlock(), createElementBlock("div", {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, renderSlot } from 'vue';
|
|
1
|
+
import { defineComponent, useTemplateRef, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, renderSlot } from 'vue';
|
|
2
2
|
import { useLayoutStore } from '../../store/layout.js';
|
|
3
3
|
import stdin_default$1 from './style/index.js';
|
|
4
|
+
import { useDir } from '../../hooks/useDir.js';
|
|
4
5
|
import { useComponentConfig } from '../../components/config-provider/config-provider.js';
|
|
5
6
|
|
|
6
7
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
@@ -16,12 +17,14 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
16
17
|
hashId
|
|
17
18
|
} = stdin_default$1(prefixCls);
|
|
18
19
|
const layoutStore = useLayoutStore();
|
|
20
|
+
const sidebarRef = useTemplateRef("sidebar");
|
|
21
|
+
const dir = useDir(sidebarRef);
|
|
19
22
|
const sidebarStyle = computed(() => {
|
|
20
|
-
const
|
|
23
|
+
const marginBlockStart = layoutStore.isMobile || !layoutStore.includeHorizontal ? 0 : layoutStore.topbarHeight;
|
|
21
24
|
return {
|
|
22
|
-
|
|
23
|
-
height: `calc(100vh - ${
|
|
24
|
-
transform: !layoutStore.sidebarVisible ?
|
|
25
|
+
marginBlockStart: marginBlockStart + "px",
|
|
26
|
+
height: `calc(100vh - ${marginBlockStart}px)`,
|
|
27
|
+
transform: !layoutStore.sidebarVisible ? `translateX(${dir.value === "ltr" ? "-100%" : "100%"})` : void 0
|
|
25
28
|
};
|
|
26
29
|
});
|
|
27
30
|
return (_ctx, _cache) => {
|
|
@@ -5,8 +5,8 @@ var stdin_default = getSimpleStyleHook("LayoutSidebar", (token) => {
|
|
|
5
5
|
return {
|
|
6
6
|
[componentCls]: {
|
|
7
7
|
position: "fixed",
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
insetBlockStart: 0,
|
|
9
|
+
insetInlineStart: 0,
|
|
10
10
|
zIndex: 1020,
|
|
11
11
|
display: "flex",
|
|
12
12
|
backgroundColor: token.colorBgContainer,
|
|
@@ -7,7 +7,7 @@ var stdin_default = getSimpleStyleHook("LayoutSnugAside", (token) => {
|
|
|
7
7
|
display: "flex",
|
|
8
8
|
flexDirection: "column",
|
|
9
9
|
overflow: "hidden",
|
|
10
|
-
|
|
10
|
+
borderInlineEnd: `${token.lineWidth} ${token.lineType} ${token.colorBorder}`,
|
|
11
11
|
transition: `width ${token.motionDurationSlow}`,
|
|
12
12
|
"&.is-hide": {
|
|
13
13
|
border: "none"
|
|
@@ -4,8 +4,10 @@ import { useGlobalConfig } from '../../config/index.js';
|
|
|
4
4
|
import { useLayoutStore } from '../../store/layout.js';
|
|
5
5
|
import stdin_default$2 from './reload.vue.js';
|
|
6
6
|
import stdin_default$1 from './style/index.js';
|
|
7
|
+
import { useI18n } from 'vue-i18n';
|
|
7
8
|
import { useToken } from '../../components/theme/util/useToken.js';
|
|
8
9
|
import { ContextMenu as _ContextMenu, ContextMenuItem as _ContextMenuItem } from '../../components/context-menu/index.js';
|
|
10
|
+
import { useLocale } from '../../hooks/useLocale.js';
|
|
9
11
|
import { useComponentConfig } from '../../components/config-provider/config-provider.js';
|
|
10
12
|
import { Icon as _Icon } from '../../components/icon/index.js';
|
|
11
13
|
|
|
@@ -15,6 +17,12 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
15
17
|
},
|
|
16
18
|
__name: "layout-tabbar",
|
|
17
19
|
setup(__props) {
|
|
20
|
+
const {
|
|
21
|
+
t
|
|
22
|
+
} = useLocale();
|
|
23
|
+
const {
|
|
24
|
+
t: _t
|
|
25
|
+
} = useI18n();
|
|
18
26
|
const {
|
|
19
27
|
prefixCls
|
|
20
28
|
} = useComponentConfig("layout-tabbar");
|
|
@@ -86,9 +94,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
86
94
|
closeTab(name);
|
|
87
95
|
};
|
|
88
96
|
const tabbarStyle = computed(() => {
|
|
89
|
-
const
|
|
97
|
+
const marginInlineStart = layoutStore.includeHorizontal ? layoutStore.sidebarWidth + "px" : 0;
|
|
90
98
|
return {
|
|
91
|
-
|
|
99
|
+
marginInlineStart
|
|
92
100
|
};
|
|
93
101
|
});
|
|
94
102
|
return (_ctx, _cache) => {
|
|
@@ -120,36 +128,36 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
120
128
|
key: 0,
|
|
121
129
|
name: item.meta.icon,
|
|
122
130
|
class: normalizeClass(`${unref(prefixCls)}-icon`)
|
|
123
|
-
}, null, 8, ["name", "class"])) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(item.meta.title) + " ", 1
|
|
131
|
+
}, null, 8, ["name", "class"])) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(unref(_t)(item.meta.title ?? "")) + " ", 1
|
|
124
132
|
/* TEXT */), createVNode(unref(_ContextMenu), null, {
|
|
125
133
|
reference: withCtx(() => [createElementVNode("div", {
|
|
126
134
|
class: normalizeClass(`${unref(prefixCls)}-context-menu-reference`)
|
|
127
135
|
}, null, 2
|
|
128
136
|
/* CLASS */)]),
|
|
129
137
|
default: withCtx(() => [createVNode(unref(_ContextMenuItem), {
|
|
130
|
-
title: "
|
|
138
|
+
title: unref(t)("co.common.reload"),
|
|
131
139
|
icon: "co:rotate-360",
|
|
132
140
|
disabled: item.name !== unref(layoutStore).activeTab,
|
|
133
141
|
onClick: _cache[0] || (_cache[0] = $event => unref(layoutStore).reload())
|
|
134
|
-
}, null, 8, ["disabled"]), createVNode(unref(_ContextMenuItem), {
|
|
135
|
-
title: "
|
|
142
|
+
}, null, 8, ["title", "disabled"]), createVNode(unref(_ContextMenuItem), {
|
|
143
|
+
title: unref(t)("co.common.close"),
|
|
136
144
|
icon: "co:close-large",
|
|
137
145
|
disabled: !item.meta.closable,
|
|
138
146
|
divided: "",
|
|
139
147
|
onClick: $event => closeTab(item.name)
|
|
140
|
-
}, null, 8, ["disabled", "onClick"]), createVNode(unref(_ContextMenuItem), {
|
|
141
|
-
title: "
|
|
148
|
+
}, null, 8, ["title", "disabled", "onClick"]), createVNode(unref(_ContextMenuItem), {
|
|
149
|
+
title: unref(t)("co.tabbar.closeLeftTabs"),
|
|
142
150
|
disabled: index === 0 || index === 1,
|
|
143
151
|
onClick: $event => closeLeftTabs(item.name, index)
|
|
144
|
-
}, null, 8, ["disabled", "onClick"]), createVNode(unref(_ContextMenuItem), {
|
|
145
|
-
title: "
|
|
152
|
+
}, null, 8, ["title", "disabled", "onClick"]), createVNode(unref(_ContextMenuItem), {
|
|
153
|
+
title: unref(t)("co.tabbar.closeRightTabs"),
|
|
146
154
|
disabled: index === unref(layoutStore).tabList.length - 1,
|
|
147
155
|
onClick: $event => closeRightTabs(item.name, index)
|
|
148
|
-
}, null, 8, ["disabled", "onClick"]), createVNode(unref(_ContextMenuItem), {
|
|
149
|
-
title: "
|
|
156
|
+
}, null, 8, ["title", "disabled", "onClick"]), createVNode(unref(_ContextMenuItem), {
|
|
157
|
+
title: unref(t)("co.tabbar.closeOtherTabs"),
|
|
150
158
|
disabled: unref(layoutStore).tabList.length === 1 || unref(layoutStore).tabList.length === 2 && index === 1,
|
|
151
159
|
onClick: $event => closeOtherTabs(item.name)
|
|
152
|
-
}, null, 8, ["disabled", "onClick"])]),
|
|
160
|
+
}, null, 8, ["title", "disabled", "onClick"])]),
|
|
153
161
|
_: 2
|
|
154
162
|
/* DYNAMIC */
|
|
155
163
|
}, 1024
|
|
@@ -8,7 +8,7 @@ var stdin_default = getSimpleStyleHook("LayoutTabbar", (token) => {
|
|
|
8
8
|
display: "flex",
|
|
9
9
|
alignItems: "stretch",
|
|
10
10
|
paddingBlockStart: token.paddingXS,
|
|
11
|
-
transition: `margin-
|
|
11
|
+
transition: `margin-inline-start ${token.motionDurationSlow}`,
|
|
12
12
|
"&::before, &::after": {
|
|
13
13
|
content: '""',
|
|
14
14
|
display: "flex",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent, createBlock, openBlock, unref, withCtx, createElementBlock, Fragment, renderList } from 'vue';
|
|
1
|
+
import { defineComponent, createBlock, openBlock, unref, withCtx, createVNode, createElementBlock, Fragment, renderList } from 'vue';
|
|
2
2
|
import { useRouter } from 'vue-router';
|
|
3
3
|
import { useLayoutStore } from '../../store/layout.js';
|
|
4
|
+
import { ElScrollbar } from 'element-plus';
|
|
4
5
|
import { SnugMenu as _SnugMenu, SnugMenuItem as _SnugMenuItem } from '../../components/snug-menu/index.js';
|
|
5
6
|
|
|
6
7
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
@@ -24,25 +25,31 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
24
25
|
}
|
|
25
26
|
};
|
|
26
27
|
return (_ctx, _cache) => {
|
|
27
|
-
return openBlock(), createBlock(unref(
|
|
28
|
-
|
|
29
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => unref(layoutStore).topActive = $event),
|
|
30
|
-
mode: "horizontal"
|
|
28
|
+
return openBlock(), createBlock(unref(ElScrollbar), {
|
|
29
|
+
"wrap-style": "display: flex; align-items: center"
|
|
31
30
|
}, {
|
|
32
|
-
default: withCtx(() => [(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
default: withCtx(() => [createVNode(unref(_SnugMenu), {
|
|
32
|
+
modelValue: unref(layoutStore).topActive,
|
|
33
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => unref(layoutStore).topActive = $event),
|
|
34
|
+
mode: "horizontal"
|
|
35
|
+
}, {
|
|
36
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(layoutStore).topMenus, (item, i) => {
|
|
37
|
+
return openBlock(), createBlock(unref(_SnugMenuItem), {
|
|
38
|
+
key: i,
|
|
39
|
+
name: item.name,
|
|
40
|
+
index: item.name,
|
|
41
|
+
icon: item.icon,
|
|
42
|
+
title: item.title,
|
|
43
|
+
onClick: $event => onClick(item)
|
|
44
|
+
}, null, 8, ["name", "index", "icon", "title", "onClick"]);
|
|
45
|
+
}), 128
|
|
46
|
+
/* KEYED_FRAGMENT */))]),
|
|
47
|
+
_: 1
|
|
48
|
+
/* STABLE */
|
|
49
|
+
}, 8, ["modelValue"])]),
|
|
43
50
|
_: 1
|
|
44
51
|
/* STABLE */
|
|
45
|
-
}
|
|
52
|
+
});
|
|
46
53
|
};
|
|
47
54
|
}
|
|
48
55
|
});
|
|
@@ -3,6 +3,7 @@ import { useRouter } from 'vue-router';
|
|
|
3
3
|
import { useGlobalConfig } from '../../config/index.js';
|
|
4
4
|
import { useUserStore } from '../../store/user.js';
|
|
5
5
|
import stdin_default$1 from './style/index.js';
|
|
6
|
+
import { useLocale } from '../../hooks/useLocale.js';
|
|
6
7
|
import { useComponentConfig } from '../../components/config-provider/config-provider.js';
|
|
7
8
|
import { Icon as _Icon } from '../../components/icon/index.js';
|
|
8
9
|
import { defineTemplate } from '../../utils/vue.js';
|
|
@@ -13,6 +14,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
13
14
|
},
|
|
14
15
|
__name: "layout-user-menu",
|
|
15
16
|
setup(__props) {
|
|
17
|
+
const {
|
|
18
|
+
t
|
|
19
|
+
} = useLocale();
|
|
16
20
|
const {
|
|
17
21
|
prefixCls
|
|
18
22
|
} = useComponentConfig("layout-user-menu");
|
|
@@ -54,8 +58,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
54
58
|
size: "lg"
|
|
55
59
|
}), createElementVNode("span", {
|
|
56
60
|
class: normalizeClass(`${unref(prefixCls)}-item-title`)
|
|
57
|
-
}, "
|
|
58
|
-
/* CLASS */)]),
|
|
61
|
+
}, toDisplayString(unref(t)("co.common.home")), 3
|
|
62
|
+
/* TEXT, CLASS */)]),
|
|
59
63
|
_: 1
|
|
60
64
|
/* STABLE */
|
|
61
65
|
}), (openBlock(), createBlock(resolveDynamicComponent(unref(UserMenu)))), createVNode(_component_el_dropdown_item, {
|
|
@@ -66,8 +70,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
66
70
|
size: "lg"
|
|
67
71
|
}), createElementVNode("span", {
|
|
68
72
|
class: normalizeClass(`${unref(prefixCls)}-item-title`)
|
|
69
|
-
}, "
|
|
70
|
-
/* CLASS */)]),
|
|
73
|
+
}, toDisplayString(unref(t)("co.auth.changePassword")), 3
|
|
74
|
+
/* TEXT, CLASS */)]),
|
|
71
75
|
_: 1
|
|
72
76
|
/* STABLE */
|
|
73
77
|
}), createVNode(_component_el_dropdown_item, {
|
|
@@ -79,8 +83,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
79
83
|
size: "lg"
|
|
80
84
|
}), createElementVNode("span", {
|
|
81
85
|
class: normalizeClass(`${unref(prefixCls)}-item-title`)
|
|
82
|
-
}, "
|
|
83
|
-
/* CLASS */)]),
|
|
86
|
+
}, toDisplayString(unref(t)("co.auth.logout")), 3
|
|
87
|
+
/* TEXT, CLASS */)]),
|
|
84
88
|
_: 1
|
|
85
89
|
/* STABLE */
|
|
86
90
|
})]),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as zhCn } from './lang/zh-cn';
|
|
2
|
+
export { default as en } from './lang/en';
|
|
3
|
+
export type TranslatePair = {
|
|
4
|
+
[key: string]: string | string[] | TranslatePair;
|
|
5
|
+
};
|
|
6
|
+
export type Language = {
|
|
7
|
+
name: string;
|
|
8
|
+
el: TranslatePair;
|
|
9
|
+
co: TranslatePair;
|
|
10
|
+
};
|
package/locale/index.js
ADDED