Skip to content

Commit a799bed

Browse files
authored
Merge pull request #4317 from easyops-cn/williamcai/easyops-runtime_activeIncludes_and_activeExcludes_support_MatchOptions
feat(menu): activeIncludes and activeExcludes of SidebarMenuSimpleIte…
2 parents e9b122d + e9cb305 commit a799bed

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

etc/runtime.api.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,14 @@ function loadEditors(editors: string[] | Set<string>, brickPackages?: BrickPacka
262262
// @public @deprecated (undocumented)
263263
export function logout(): unknown;
264264

265+
// @public (undocumented)
266+
export interface MatchOptions {
267+
// (undocumented)
268+
exact?: boolean;
269+
// (undocumented)
270+
path: string | string[];
271+
}
272+
265273
// Warning: (ae-forgotten-export) The symbol "MatchPathOptions" needs to be exported by the entry point index.d.ts
266274
// Warning: (ae-forgotten-export) The symbol "MatchResult" needs to be exported by the entry point index.d.ts
267275
//

packages/easyops-runtime/src/menu/interfaces.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { MetaI18n, MicroApp, ResolveConf } from "@next-core/types";
22
import type {
33
RuntimeHooksMenuHelpers,
44
__secret_internals,
5+
MatchOptions,
56
} from "@next-core/runtime";
67
import {
78
symbolAppId,
@@ -79,10 +80,10 @@ export interface SidebarMenuSimpleItem {
7980
exact?: boolean;
8081

8182
/** 设置额外包含的匹配高亮菜单项的地址列表。 */
82-
activeIncludes?: string[];
83+
activeIncludes?: (string | MatchOptions)[];
8384

8485
/** 设置需要被排除的匹配高亮菜单项的地址列表。 */
85-
activeExcludes?: string[];
86+
activeExcludes?: (string | MatchOptions)[];
8687

8788
/** 设置匹配高亮菜单项时是否还对 search 参数进行比较。 */
8889
activeMatchSearch?: boolean;

packages/runtime/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export {
3535
export { registerWidgetFunctions } from "./internal/compute/WidgetFunctions.js";
3636
export { registerWidgetI18n } from "./internal/compute/WidgetI18n.js";
3737
export { StoryboardFunctionRegistryFactory } from "./StoryboardFunctionRegistry.js";
38-
export { matchPath } from "./internal/matchPath.js";
38+
export { matchPath, type MatchOptions } from "./internal/matchPath.js";
3939
export { Notification, type NotificationOptions } from "./Notification.js";
4040
export { Dialog, type DialogOptions } from "./Dialog.js";
4141
export * from "./getV2RuntimeFromDll.js";

packages/runtime/src/internal/matchPath.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ interface CompileResult {
9696
keys: Key[];
9797
}
9898

99-
interface MatchOptions {
99+
export interface MatchOptions {
100100
path: string | string[];
101101
exact?: boolean;
102102
}

0 commit comments

Comments
 (0)