cosey 0.2.3 → 0.2.5
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 +1 -0
- package/components/config-provider/config-provider.d.ts +1 -1
- package/components/config-provider/config-provider.js +2 -1
- package/components/config-provider/config-provider.vue.js +6 -2
- package/components/table/table.vue.js +7 -4
- package/layout/layout-user-menu/layout-user-menu.vue.js +12 -4
- package/package.json +1 -1
- package/config/component.d.ts +0 -42
- package/config/component.js +0 -40
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ export interface ConfigProviderProps {
|
|
|
11
11
|
export interface ConfigProviderInnerProps {
|
|
12
12
|
getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string;
|
|
13
13
|
theme?: ComputedRef<ThemeConfig | undefined>;
|
|
14
|
-
table
|
|
14
|
+
table: ComputedRef<TableConfig | undefined>;
|
|
15
15
|
prefixCls: ComputedRef<string>;
|
|
16
16
|
}
|
|
17
17
|
export declare const defaultPrefixCls = "co";
|
|
@@ -7,7 +7,8 @@ const defaultConfigProvider = {
|
|
|
7
7
|
if (customizePrefixCls) return customizePrefixCls;
|
|
8
8
|
return suffixCls ? `${defaultPrefixCls}-${suffixCls}` : defaultPrefixCls;
|
|
9
9
|
},
|
|
10
|
-
prefixCls: computed(() => defaultPrefixCls)
|
|
10
|
+
prefixCls: computed(() => defaultPrefixCls),
|
|
11
|
+
table: computed(() => void 0)
|
|
11
12
|
};
|
|
12
13
|
const useConfigProvide = (props) => {
|
|
13
14
|
return provide(configProviderKey, props);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, provide, watch, onUnmounted, onMounted, createElementBlock, openBlock, normalizeClass,
|
|
1
|
+
import { defineComponent, computed, unref, provide, watch, onUnmounted, onMounted, createElementBlock, openBlock, normalizeClass, renderSlot } from 'vue';
|
|
2
2
|
import useMergeTheme from './useMergeTheme.js';
|
|
3
3
|
import { useConfig, useConfigProvide } from './config-provider.js';
|
|
4
4
|
import { ThemeManager, useThemeProvide } from '../theme/theme-context.js';
|
|
@@ -38,10 +38,14 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
38
38
|
return suffixCls ? `${mergedPrefixCls.value}-${suffixCls}` : mergedPrefixCls.value;
|
|
39
39
|
};
|
|
40
40
|
const mergedTheme = useMergeTheme(computed(() => props.theme), computed(() => parentContext.theme?.value));
|
|
41
|
+
const mergedTable = computed(() => {
|
|
42
|
+
return props.table || unref(parentContext.table);
|
|
43
|
+
});
|
|
41
44
|
const configProvider = {
|
|
42
45
|
getPrefixCls,
|
|
43
46
|
theme: mergedTheme,
|
|
44
|
-
prefixCls: mergedPrefixCls
|
|
47
|
+
prefixCls: mergedPrefixCls,
|
|
48
|
+
table: mergedTable
|
|
45
49
|
};
|
|
46
50
|
useConfigProvide(configProvider);
|
|
47
51
|
provide(localeContextKey, computed(() => props.locale));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useSlots, computed, useTemplateRef, mergeProps, ref, watch, resolveComponent, resolveDirective, withDirectives, createElementBlock, openBlock, normalizeStyle, normalizeClass,
|
|
1
|
+
import { defineComponent, useSlots, computed, unref, useTemplateRef, mergeProps, ref, watch, resolveComponent, resolveDirective, withDirectives, createElementBlock, openBlock, normalizeStyle, normalizeClass, createCommentVNode, createElementVNode, createVNode, createBlock, renderSlot, withCtx, createSlots, Fragment, renderList, normalizeProps, guardReactiveProps } from 'vue';
|
|
2
2
|
import { merge, cloneDeep, get } from 'lodash-es';
|
|
3
3
|
import { tableProps, defaultTableConfig, elSlotsName, omittedTableProps, defaultPaginationProps, tableExposeKeys } from './table.js';
|
|
4
4
|
import { useZIndex, ElButton } from 'element-plus';
|
|
@@ -51,9 +51,11 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
51
51
|
const {
|
|
52
52
|
hashId
|
|
53
53
|
} = stdin_default$1(prefixCls);
|
|
54
|
-
const
|
|
54
|
+
const {
|
|
55
|
+
table
|
|
56
|
+
} = useConfig();
|
|
55
57
|
const tableKeys = computed(() => {
|
|
56
|
-
return merge({}, defaultTableConfig.keys,
|
|
58
|
+
return merge({}, defaultTableConfig.keys, unref(table)?.keys, props.keys);
|
|
57
59
|
});
|
|
58
60
|
const passedElSlotsName = computed(() => {
|
|
59
61
|
return elSlotsName.filter(name => !!slots[name]);
|
|
@@ -343,7 +345,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
343
345
|
/* CLASS */)) : createCommentVNode("v-if", true), createElementVNode("div", {
|
|
344
346
|
class: normalizeClass(`${unref(prefixCls)}-table`)
|
|
345
347
|
}, [createVNode(_component_el_table, mergeProps({
|
|
346
|
-
|
|
348
|
+
ref_key: "table",
|
|
349
|
+
ref: table
|
|
347
350
|
}, elTableProps.value, {
|
|
348
351
|
data: tableData.value,
|
|
349
352
|
"expand-row-keys": innerExpandRowKeys.value,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createElementVNode, normalizeClass, unref, createVNode, toDisplayString, createCommentVNode, resolveDynamicComponent } from 'vue';
|
|
1
|
+
import { defineComponent, ref, resolveComponent, resolveDirective, createBlock, openBlock, withCtx, createElementVNode, normalizeClass, unref, createVNode, toDisplayString, createCommentVNode, resolveDynamicComponent, withDirectives, createElementBlock } from 'vue';
|
|
2
2
|
import { useRouter } from 'vue-router';
|
|
3
3
|
import { useGlobalConfig } from '../../config/index.js';
|
|
4
4
|
import { useUserStore } from '../../store/user.js';
|
|
@@ -37,14 +37,19 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
37
37
|
const toChangePassword = () => {
|
|
38
38
|
router.push(routerConfig.changePasswordPath);
|
|
39
39
|
};
|
|
40
|
+
const fullscreenLoading = ref(false);
|
|
40
41
|
const logout = () => {
|
|
41
|
-
|
|
42
|
+
fullscreenLoading.value = true;
|
|
43
|
+
userStore.logout().finally(() => {
|
|
44
|
+
fullscreenLoading.value = false;
|
|
45
|
+
});
|
|
42
46
|
};
|
|
43
47
|
return (_ctx, _cache) => {
|
|
44
48
|
const _component_el_avatar = resolveComponent("el-avatar");
|
|
45
49
|
const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
|
|
46
50
|
const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
|
|
47
51
|
const _component_el_dropdown = resolveComponent("el-dropdown");
|
|
52
|
+
const _directive_loading = resolveDirective("loading");
|
|
48
53
|
return openBlock(), createBlock(_component_el_dropdown, {
|
|
49
54
|
placement: "bottom"
|
|
50
55
|
}, {
|
|
@@ -80,13 +85,16 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
80
85
|
divided: "",
|
|
81
86
|
onClick: logout
|
|
82
87
|
}, {
|
|
83
|
-
default: withCtx(() => [createVNode(unref(_Icon), {
|
|
88
|
+
default: withCtx(() => [withDirectives((openBlock(), createElementBlock("div", null, [createVNode(unref(_Icon), {
|
|
84
89
|
name: "co:logout",
|
|
85
90
|
size: "lg"
|
|
86
91
|
}), createElementVNode("span", {
|
|
87
92
|
class: normalizeClass(`${unref(prefixCls)}-item-title`)
|
|
88
93
|
}, toDisplayString(unref(t)("co.auth.logout")), 3
|
|
89
|
-
/* TEXT, CLASS */)]),
|
|
94
|
+
/* TEXT, CLASS */)])), [[_directive_loading, fullscreenLoading.value, void 0, {
|
|
95
|
+
fullscreen: true,
|
|
96
|
+
lock: true
|
|
97
|
+
}]])]),
|
|
90
98
|
_: 1
|
|
91
99
|
/* STABLE */
|
|
92
100
|
})]),
|
package/package.json
CHANGED
package/config/component.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 组件默认全局配置
|
|
3
|
-
*/
|
|
4
|
-
declare const _default: {
|
|
5
|
-
table: {
|
|
6
|
-
keys: {
|
|
7
|
-
/**
|
|
8
|
-
* 响应数据对象中“列表数据”的 key
|
|
9
|
-
*/
|
|
10
|
-
list: string;
|
|
11
|
-
/**
|
|
12
|
-
* 响应数据对象中“总记录数”的 key
|
|
13
|
-
*/
|
|
14
|
-
total: string;
|
|
15
|
-
/**
|
|
16
|
-
* 请求url查询参数中“当前页数”的参数名
|
|
17
|
-
*/
|
|
18
|
-
page: string;
|
|
19
|
-
/**
|
|
20
|
-
* 请求url查询参数中“每页条数”的参数名
|
|
21
|
-
*/
|
|
22
|
-
pageSize: string;
|
|
23
|
-
/**
|
|
24
|
-
* 请求url查询参数中“排序列”的参数名
|
|
25
|
-
*/
|
|
26
|
-
orderBy: string;
|
|
27
|
-
/**
|
|
28
|
-
* 请求url查询参数中“排序方向”的参数名
|
|
29
|
-
*/
|
|
30
|
-
orderType: string;
|
|
31
|
-
/**
|
|
32
|
-
* 排序方向中“升序”的值
|
|
33
|
-
*/
|
|
34
|
-
asc: string;
|
|
35
|
-
/**
|
|
36
|
-
* 排序方向中“降序”的值
|
|
37
|
-
*/
|
|
38
|
-
desc: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export default _default;
|
package/config/component.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var stdin_default = {
|
|
2
|
-
table: {
|
|
3
|
-
keys: {
|
|
4
|
-
/**
|
|
5
|
-
* 响应数据对象中“列表数据”的 key
|
|
6
|
-
*/
|
|
7
|
-
list: "list",
|
|
8
|
-
/**
|
|
9
|
-
* 响应数据对象中“总记录数”的 key
|
|
10
|
-
*/
|
|
11
|
-
total: "total",
|
|
12
|
-
/**
|
|
13
|
-
* 请求url查询参数中“当前页数”的参数名
|
|
14
|
-
*/
|
|
15
|
-
page: "page",
|
|
16
|
-
/**
|
|
17
|
-
* 请求url查询参数中“每页条数”的参数名
|
|
18
|
-
*/
|
|
19
|
-
pageSize: "pageSize",
|
|
20
|
-
/**
|
|
21
|
-
* 请求url查询参数中“排序列”的参数名
|
|
22
|
-
*/
|
|
23
|
-
orderBy: "orderBy",
|
|
24
|
-
/**
|
|
25
|
-
* 请求url查询参数中“排序方向”的参数名
|
|
26
|
-
*/
|
|
27
|
-
orderType: "orderType",
|
|
28
|
-
/**
|
|
29
|
-
* 排序方向中“升序”的值
|
|
30
|
-
*/
|
|
31
|
-
asc: "asc",
|
|
32
|
-
/**
|
|
33
|
-
* 排序方向中“降序”的值
|
|
34
|
-
*/
|
|
35
|
-
desc: "desc"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export { stdin_default as default };
|