@devkitvue/admin
Version:
Devkit Base Components is a Vue plugin offering a collection of reusable, headless components designed to streamline your Vue.js development workflow. Built for flexibility and maintainability, this library gives you complete control over styling and beha
85 lines (84 loc) • 2.57 kB
TypeScript
import { FormKitSchemaNode } from '@formkit/core';
import { DatalistColumnsBase } from '@devkitvue/datalist';
import { StringUnknownRecord } from '@devkitvue/apiclient';
import { CommandPallete } from '@devkitvue/config';
import { AppMenuItem } from '@devkitvue/base-components';
export type AppHeaderProps<SUPPORTE_LOCALES_TYPE> = {
setLanguage?: (locale: SUPPORTE_LOCALES_TYPE) => Promise<Record<string, string> | undefined>;
};
export type AppHeaderEmits<SUPPORTE_LOCALES_TYPE> = {
(e: "localeChanged", locale: SUPPORTE_LOCALES_TYPE): void;
(e: "loggedOut"): void;
(e: "sidebarToggled"): void;
(e: "searchToggled"): void;
(e: "searchSelected", item: CommandPallete): void;
};
export type AdminMenuProps = {
injectedItems?: {
rootItems?: AppMenuItem[];
subItems?: Record<string, AppMenuItem[]>;
};
logo?: string | {
src: string;
type?: "image" | "icon";
size?: "small" | "medium" | "large";
};
};
export type AppHeaderSlots = {
logo?: (props: {}) => any;
"sidebar-toggler"?: (props: {
toggle: () => void;
}) => any;
search?: (props: {
isSearching: boolean;
toggle: () => void;
suggestions: CommandPallete[];
}) => any;
"theme-toggler"?: (props: {}) => any;
"locale-toggler"?: (props: {
toggle: (locale: string) => Promise<void>;
}) => any;
"profile-menu"?: (props: {
toggle: (event?: Event) => void;
items: AppMenuItem[];
}) => any;
breadcrumb?: (props: {}) => any;
};
export interface FeatureConstants<TApi extends Record<string, Function>, TView extends StringUnknownRecord> {
ROUTE_PARAM_NAME: string;
FIND_REQUEST_PROP_NAME: string;
FIND_RESPONSE_PROP_NAME: string;
TITLE: string;
DESCRIPTION: string;
ROUTES: {
LIST: RouteConfig;
CREATE: RouteConfig;
FIND: RouteConfig;
UPDATE: RouteConfig;
};
ENDPOINTS: {
list?: keyof TApi;
create?: keyof TApi;
update?: keyof TApi;
findForUpdate?: keyof TApi;
deleteRestore?: keyof TApi;
delete?: keyof TApi;
};
KEYS: Record<string, string>;
FORM_INPUTS: {
baseInputs: FormKitSchemaNode[];
[key: string]: FormKitSchemaNode | FormKitSchemaNode[];
};
COLUMNS: DatalistColumnsBase<TView>;
ROW_IDENTIFIER: keyof TView & string;
}
interface RouteConfig {
path: string;
name: string;
breadcrumbs: {
label: string;
icon?: string;
route?: string;
}[];
}
export {};