@done-coding/admin-core 0.26.1 → 0.27.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/es/bridge/badge.mjs +5 -0
- package/es/bridge/index.mjs +2 -0
- package/es/bridge/theme/index.mjs +6 -1
- package/es/components/app-layout/AppHeader.vue.mjs +1 -1
- package/es/components/app-layout/AppHeader.vue2.mjs +2 -1
- package/es/components/display/ActionBtn.vue.mjs +6 -2
- package/es/components/display/BadgeMark.vue.mjs +1 -1
- package/es/components/display/BadgeMark.vue2.mjs +39 -6
- package/es/components/display/TabsTile.vue.mjs +1 -1
- package/es/components/display/TabsTile.vue2.mjs +1 -0
- package/es/components/display/use-badge-mask.mjs +83 -0
- package/es/components/display/use-badge.mjs +32 -5
- package/es/components/icon/IconHammer.vue.mjs +26 -0
- package/es/components/icon/IconHammer.vue2.mjs +4 -0
- package/es/components/menu/MenuItemSub.vue.mjs +4 -2
- package/es/components/menu/MenuTree.vue.mjs +4 -2
- package/es/index.mjs +120 -116
- package/es/style.css +25 -20
- package/package.json +2 -2
- package/src/bridge/docs/README.md +22 -0
- package/src/components/icon/README.md +38 -0
- package/types/bridge/badge.d.ts +29 -1
- package/types/bridge/index.d.ts +1 -0
- package/types/bridge/theme/types.d.ts +11 -0
- package/types/components/display/BadgeMark.vue.d.ts +153 -2
- package/types/components/display/TabsTile.vue.d.ts +2 -2
- package/types/components/display/use-badge-mask.d.ts +8 -0
- package/types/components/display/use-badge.d.ts +13 -1
- package/types/components/icon/IconHammer.vue.d.ts +2 -0
- package/types/components/icon/index.d.ts +7 -0
- package/types/index.d.ts +1 -0
- package/types/injectInfo.json.d.ts +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ComponentPublicInstance } from 'vue';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/**
|
|
3
4
|
* 徽标键;命中 `bridge.badge` 注册表且未过期才渲染角标。
|
|
@@ -43,11 +44,161 @@ declare function __VLS_template(): {
|
|
|
43
44
|
default?(_: {}): any;
|
|
44
45
|
default?(_: {}): any;
|
|
45
46
|
};
|
|
46
|
-
refs: {
|
|
47
|
+
refs: {
|
|
48
|
+
badgeRef: ({
|
|
49
|
+
$: import('vue').ComponentInternalInstance;
|
|
50
|
+
$data: {};
|
|
51
|
+
$props: {
|
|
52
|
+
readonly value?: string | number | undefined;
|
|
53
|
+
readonly max?: number | undefined;
|
|
54
|
+
readonly isDot?: boolean | undefined;
|
|
55
|
+
readonly hidden?: boolean | undefined;
|
|
56
|
+
readonly type?: "primary" | "success" | "warning" | "info" | "danger" | undefined;
|
|
57
|
+
readonly showZero?: boolean | undefined;
|
|
58
|
+
readonly color?: string | undefined;
|
|
59
|
+
readonly badgeStyle?: import('vue').StyleValue;
|
|
60
|
+
readonly offset?: [number, number] | undefined;
|
|
61
|
+
readonly badgeClass?: string | undefined;
|
|
62
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
63
|
+
$attrs: import('vue').Attrs;
|
|
64
|
+
$refs: {
|
|
65
|
+
[x: string]: unknown;
|
|
66
|
+
};
|
|
67
|
+
$slots: Readonly<{
|
|
68
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
$root: ComponentPublicInstance | null;
|
|
71
|
+
$parent: ComponentPublicInstance | null;
|
|
72
|
+
$host: Element | null;
|
|
73
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
74
|
+
$el: any;
|
|
75
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('element-plus').BadgeProps> & Readonly<{}>, {
|
|
76
|
+
content: import('vue').ComputedRef<string>;
|
|
77
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
78
|
+
offset: [number, number];
|
|
79
|
+
type: "primary" | "success" | "warning" | "info" | "danger";
|
|
80
|
+
value: string | number;
|
|
81
|
+
max: number;
|
|
82
|
+
showZero: boolean;
|
|
83
|
+
badgeStyle: string | false | import('vue').CSSProperties | import('vue').StyleValue[] | null;
|
|
84
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
85
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
86
|
+
created?: (() => void) | (() => void)[];
|
|
87
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
88
|
+
mounted?: (() => void) | (() => void)[];
|
|
89
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
90
|
+
updated?: (() => void) | (() => void)[];
|
|
91
|
+
activated?: (() => void) | (() => void)[];
|
|
92
|
+
deactivated?: (() => void) | (() => void)[];
|
|
93
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
94
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
95
|
+
destroyed?: (() => void) | (() => void)[];
|
|
96
|
+
unmounted?: (() => void) | (() => void)[];
|
|
97
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
98
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
99
|
+
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
100
|
+
};
|
|
101
|
+
$forceUpdate: () => void;
|
|
102
|
+
$nextTick: typeof import('vue').nextTick;
|
|
103
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
104
|
+
} & Readonly<{
|
|
105
|
+
offset: [number, number];
|
|
106
|
+
type: "primary" | "success" | "warning" | "info" | "danger";
|
|
107
|
+
value: string | number;
|
|
108
|
+
max: number;
|
|
109
|
+
showZero: boolean;
|
|
110
|
+
badgeStyle: string | false | import('vue').CSSProperties | import('vue').StyleValue[] | null;
|
|
111
|
+
}> & Omit<Readonly<import('element-plus').BadgeProps> & Readonly<{}>, "value" | "max" | "content" | "offset" | "type" | "showZero" | "badgeStyle"> & {
|
|
112
|
+
content: string;
|
|
113
|
+
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
114
|
+
$slots: {
|
|
115
|
+
default?: (props: {}) => any;
|
|
116
|
+
} & {
|
|
117
|
+
content?: (props: {
|
|
118
|
+
value: string;
|
|
119
|
+
}) => any;
|
|
120
|
+
};
|
|
121
|
+
}) | null;
|
|
122
|
+
};
|
|
47
123
|
rootEl: any;
|
|
48
124
|
};
|
|
49
125
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
50
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
126
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
127
|
+
badgeRef: ({
|
|
128
|
+
$: import('vue').ComponentInternalInstance;
|
|
129
|
+
$data: {};
|
|
130
|
+
$props: {
|
|
131
|
+
readonly value?: string | number | undefined;
|
|
132
|
+
readonly max?: number | undefined;
|
|
133
|
+
readonly isDot?: boolean | undefined;
|
|
134
|
+
readonly hidden?: boolean | undefined;
|
|
135
|
+
readonly type?: "primary" | "success" | "warning" | "info" | "danger" | undefined;
|
|
136
|
+
readonly showZero?: boolean | undefined;
|
|
137
|
+
readonly color?: string | undefined;
|
|
138
|
+
readonly badgeStyle?: import('vue').StyleValue;
|
|
139
|
+
readonly offset?: [number, number] | undefined;
|
|
140
|
+
readonly badgeClass?: string | undefined;
|
|
141
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
142
|
+
$attrs: import('vue').Attrs;
|
|
143
|
+
$refs: {
|
|
144
|
+
[x: string]: unknown;
|
|
145
|
+
};
|
|
146
|
+
$slots: Readonly<{
|
|
147
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
148
|
+
}>;
|
|
149
|
+
$root: ComponentPublicInstance | null;
|
|
150
|
+
$parent: ComponentPublicInstance | null;
|
|
151
|
+
$host: Element | null;
|
|
152
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
153
|
+
$el: any;
|
|
154
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('element-plus').BadgeProps> & Readonly<{}>, {
|
|
155
|
+
content: import('vue').ComputedRef<string>;
|
|
156
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
157
|
+
offset: [number, number];
|
|
158
|
+
type: "primary" | "success" | "warning" | "info" | "danger";
|
|
159
|
+
value: string | number;
|
|
160
|
+
max: number;
|
|
161
|
+
showZero: boolean;
|
|
162
|
+
badgeStyle: string | false | import('vue').CSSProperties | import('vue').StyleValue[] | null;
|
|
163
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
164
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
165
|
+
created?: (() => void) | (() => void)[];
|
|
166
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
167
|
+
mounted?: (() => void) | (() => void)[];
|
|
168
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
169
|
+
updated?: (() => void) | (() => void)[];
|
|
170
|
+
activated?: (() => void) | (() => void)[];
|
|
171
|
+
deactivated?: (() => void) | (() => void)[];
|
|
172
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
173
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
174
|
+
destroyed?: (() => void) | (() => void)[];
|
|
175
|
+
unmounted?: (() => void) | (() => void)[];
|
|
176
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
177
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
178
|
+
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
179
|
+
};
|
|
180
|
+
$forceUpdate: () => void;
|
|
181
|
+
$nextTick: typeof import('vue').nextTick;
|
|
182
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
183
|
+
} & Readonly<{
|
|
184
|
+
offset: [number, number];
|
|
185
|
+
type: "primary" | "success" | "warning" | "info" | "danger";
|
|
186
|
+
value: string | number;
|
|
187
|
+
max: number;
|
|
188
|
+
showZero: boolean;
|
|
189
|
+
badgeStyle: string | false | import('vue').CSSProperties | import('vue').StyleValue[] | null;
|
|
190
|
+
}> & Omit<Readonly<import('element-plus').BadgeProps> & Readonly<{}>, "value" | "max" | "content" | "offset" | "type" | "showZero" | "badgeStyle"> & {
|
|
191
|
+
content: string;
|
|
192
|
+
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
193
|
+
$slots: {
|
|
194
|
+
default?: (props: {}) => any;
|
|
195
|
+
} & {
|
|
196
|
+
content?: (props: {
|
|
197
|
+
value: string;
|
|
198
|
+
}) => any;
|
|
199
|
+
};
|
|
200
|
+
}) | null;
|
|
201
|
+
}, any>;
|
|
51
202
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
52
203
|
export default _default;
|
|
53
204
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -204,7 +204,7 @@ declare function __VLS_template(): {
|
|
|
204
204
|
* 无单一"可用视口高度"语义)。
|
|
205
205
|
*/
|
|
206
206
|
?: string | undefined) => any) | undefined;
|
|
207
|
-
}>, "offset" | "type" | "marker" | "scrollTo" | "direction" | "
|
|
207
|
+
}>, "offset" | "type" | "marker" | "scrollTo" | "direction" | "duration" | "bound"> & {
|
|
208
208
|
scrollTo: (href
|
|
209
209
|
/**
|
|
210
210
|
* TabsTile —— TabsMain 平铺(tile)模式渲染分支(仅 TabsMain 内部经 `v-if=tile` 消费,不对外单独发布)。
|
|
@@ -414,7 +414,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
414
414
|
* 无单一"可用视口高度"语义)。
|
|
415
415
|
*/
|
|
416
416
|
?: string | undefined) => any) | undefined;
|
|
417
|
-
}>, "offset" | "type" | "marker" | "scrollTo" | "direction" | "
|
|
417
|
+
}>, "offset" | "type" | "marker" | "scrollTo" | "direction" | "duration" | "bound"> & {
|
|
418
418
|
scrollTo: (href
|
|
419
419
|
/**
|
|
420
420
|
* TabsTile —— TabsMain 平铺(tile)模式渲染分支(仅 TabsMain 内部经 `v-if=tile` 消费,不对外单独发布)。
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BadgeEntry } from '../../bridge';
|
|
2
|
+
/**
|
|
3
|
+
* 启动徽标遮挡。
|
|
4
|
+
*
|
|
5
|
+
* @param getAnchor 取 `BadgeMark` 自身的 DOM 落点(用于向上 `closest` 找宿主)
|
|
6
|
+
* @param getEntry 取当前命中的标(未命中 / 已过期为 `undefined`)
|
|
7
|
+
*/
|
|
8
|
+
export declare const useBadgeMask: (getAnchor: () => HTMLElement | undefined, getEntry: () => BadgeEntry | undefined) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ComputedRef } from 'vue';
|
|
1
|
+
import { ComputedRef, Component } from 'vue';
|
|
2
2
|
import { BadgeProps } from 'element-plus';
|
|
3
|
+
import { BadgeEntry } from '../../bridge';
|
|
3
4
|
/** 徽标解析结果——已过滤过期项,直接可渲染 */
|
|
4
5
|
export interface BadgeResolved {
|
|
5
6
|
/** ElBadge value(数量标为数字,其余为文案) */
|
|
@@ -8,6 +9,10 @@ export interface BadgeResolved {
|
|
|
8
9
|
max?: number;
|
|
9
10
|
/** ElBadge 语义色档 */
|
|
10
11
|
type: BadgeProps["type"];
|
|
12
|
+
/** 图标(状态三档走图标而非文字);有它则 `value` 不渲染、改由 `#content` 出图标 */
|
|
13
|
+
icon?: Component;
|
|
14
|
+
/** 完整文案——图标档的悬浮气泡用它把语义补回来 */
|
|
15
|
+
label?: string;
|
|
11
16
|
}
|
|
12
17
|
/**
|
|
13
18
|
* 按 key 解析出可渲染的徽标;无 key / 未 `app.use(bridge)` / 未命中 / 已过期 → `undefined`。
|
|
@@ -16,4 +21,11 @@ export interface BadgeResolved {
|
|
|
16
21
|
* `ActionBtn` 可用在 AppLayout 之外的任何地方。**opt-in**:未 `app.use(bridge)` 时静默不显,
|
|
17
22
|
* [MUST NOT] 抛错。
|
|
18
23
|
*/
|
|
24
|
+
/**
|
|
25
|
+
* 按 key 取**原始标条目**(未命中 / 已过期 → `undefined`)。
|
|
26
|
+
*
|
|
27
|
+
* 与 {@link useBadgeResolved} 的分工:后者产「可渲染的展示数据」,本函数产「标本身」——
|
|
28
|
+
* 遮挡功能要读 `kind` 判是否该挡、读 `onTrigger` 决定点击归宿,那些不是展示数据。
|
|
29
|
+
*/
|
|
30
|
+
export declare function useBadgeEntry(getKey: () => string | undefined): ComputedRef<BadgeEntry | undefined>;
|
|
19
31
|
export declare function useBadgeResolved(getKey: () => string | undefined): ComputedRef<BadgeResolved | undefined>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
package/types/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { InfiniteListView, DataGridView } from './components/data-view';
|
|
|
3
3
|
export type { DataGridViewInstance, DataGridViewPageInfo, DataGridViewProps, InfiniteListViewConfig, InfiniteListViewInstance, InfiniteListViewProps, } from './components/data-view';
|
|
4
4
|
export * from './components/menu';
|
|
5
5
|
export * from './components/display';
|
|
6
|
+
export * from './components/icon';
|
|
6
7
|
export * from './components/misc';
|
|
7
8
|
export * from './components/modal';
|
|
8
9
|
export * from './components/table';
|