@oiij/naive-ui 0.0.3 → 0.0.4

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.
@@ -0,0 +1,75 @@
1
+ import { DataTableBaseColumn, DataTableColumns, DataTableFilterState, DataTableInst, DataTableProps, DataTableSortState, DropdownOption, PaginationProps } from 'naive-ui';
2
+ import { CSSProperties } from 'vue';
3
+ import { UseRequestOptions, UseRequestPlugin } from 'vue-hooks-plus/es/useRequest/types';
4
+ import { ClickRowType, ContextMenuSelectType, DataTableFilterOptions } from './index';
5
+ declare const _default: <P extends Record<string, any>, D extends Record<string, any>, R extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
+ props: __VLS_PrettifyLocal<any & {
7
+ api: (params: P) => Promise<D>;
8
+ defaultParams?: P;
9
+ columns?: DataTableColumns<R>;
10
+ filterOptions?: DataTableFilterOptions<P, D>;
11
+ contextMenuOptions?: DropdownOption[];
12
+ fields?: Record<"page" | "pageSize" | "filter" | "sorter" | "list" | "count" | "rowKey", string>;
13
+ pagination?: Omit<PaginationProps, "page" | "pageSize">;
14
+ dataTableProps?: DataTableProps;
15
+ requestOptions?: UseRequestOptions<D, P[]>;
16
+ requestPlugins?: UseRequestPlugin<D, P[]>[];
17
+ customStyle?: CSSProperties;
18
+ customClass?: string;
19
+ } & Partial<{}>> & import('vue').PublicProps;
20
+ expose(exposed: import('vue').ShallowUnwrapRef<{
21
+ data: Readonly<import('vue').Ref<D | undefined, D | undefined>>;
22
+ params: Readonly<import('vue').Ref<[] | P[], [] | P[]>>;
23
+ error: Readonly<import('vue').Ref<Error | undefined, Error | undefined>>;
24
+ actions: {
25
+ run: (_params: Partial<P>) => void;
26
+ runAsync: (_params: Partial<P>) => Promise<D>;
27
+ refresh: () => void;
28
+ refreshAsync: () => Promise<D>;
29
+ cancel: () => void;
30
+ mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
31
+ setParams: (_params: Partial<P>) => void;
32
+ };
33
+ dataTableRef: Readonly<import('vue').ShallowRef<DataTableInst | null>>;
34
+ }>): void;
35
+ attrs: any;
36
+ slots: {
37
+ filter?(_: {
38
+ params: P;
39
+ data: D | undefined;
40
+ actions: {
41
+ run: (_params: Partial<P>) => void;
42
+ runAsync: (_params: Partial<P>) => Promise<D>;
43
+ refresh: () => void;
44
+ refreshAsync: () => Promise<D>;
45
+ cancel: () => void;
46
+ mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
47
+ setParams: (_params: Partial<P>) => void;
48
+ };
49
+ dataTableRef: DataTableInst | null;
50
+ }): any;
51
+ };
52
+ emit: {
53
+ (e: "loaded", data: D): void;
54
+ (e: "clickRow", data: ClickRowType<R>): void;
55
+ (e: "contextMenuRow", data: ClickRowType<R>): void;
56
+ (e: "contextMenuSelect", data: ContextMenuSelectType<R>): void;
57
+ (e: "load", rowData: object): Promise<void>;
58
+ (e: "scroll", ev: Event): void;
59
+ (e: "update:checkedRowKeys", keys: (number | string)[], rows: object[], meta: {
60
+ row: object | undefined;
61
+ action: "check" | "uncheck" | "checkAll" | "uncheckAll";
62
+ }): void;
63
+ (e: "update:expandedRowKeys", keys: (number | string)[]): void;
64
+ (e: "update:filters", filters: DataTableFilterState, initiatorColumn: DataTableBaseColumn): void;
65
+ (e: "update:sorter", options: DataTableSortState | DataTableSortState[] | null): void;
66
+ (e: "update:page", page: number): void;
67
+ (e: "update:pageSize", pageSize: number): void;
68
+ };
69
+ }>) => import('vue').VNode & {
70
+ __ctx?: Awaited<typeof __VLS_setup>;
71
+ };
72
+ export default _default;
73
+ type __VLS_PrettifyLocal<T> = {
74
+ [K in keyof T]: T[K];
75
+ } & {};
@@ -0,0 +1,20 @@
1
+ import { DataTableFilterOptions } from './index';
2
+ declare const _default: <P extends Record<string, any>, D extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly "onUpdate:value"?: ((val?: unknown) => any) | undefined;
5
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:value"> & {
6
+ options?: DataTableFilterOptions<P, D>[0];
7
+ value?: unknown;
8
+ loading?: boolean;
9
+ } & Partial<{}>> & import('vue').PublicProps;
10
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
11
+ attrs: any;
12
+ slots: {};
13
+ emit: (e: "update:value", val?: unknown) => void;
14
+ }>) => import('vue').VNode & {
15
+ __ctx?: Awaited<typeof __VLS_setup>;
16
+ };
17
+ export default _default;
18
+ type __VLS_PrettifyLocal<T> = {
19
+ [K in keyof T]: T[K];
20
+ } & {};
@@ -0,0 +1,53 @@
1
+ import { DataTableInst, DatePickerProps, DropdownOption, FormItemProps, InputProps, SelectProps, SwitchProps, TimePickerProps } from 'naive-ui';
2
+ import { CSSProperties, VNode } from 'vue';
3
+ import { SearchInputProps } from '../index';
4
+ export { default as NDataTablePlus } from './DataTablePlus.vue';
5
+ interface FilterTypeProps {
6
+ 'date-picker': DatePickerProps;
7
+ 'input': InputProps;
8
+ 'search': SearchInputProps;
9
+ 'select': SelectProps;
10
+ 'switch': SwitchProps;
11
+ 'time-picker': TimePickerProps;
12
+ }
13
+ interface Actions<P extends Record<string, any>, D extends Record<string, any>> {
14
+ run: (params: P) => void;
15
+ runAsync: (params: P) => Promise<D>;
16
+ refresh: () => void;
17
+ refreshAsync: () => Promise<D>;
18
+ cancel: () => void;
19
+ mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
20
+ setParams: (params: P) => void;
21
+ }
22
+ export type DataTableFilterOptions<P extends Record<string, any>, D extends Record<string, any>> = {
23
+ [K in keyof FilterTypeProps]: {
24
+ key?: keyof P;
25
+ title?: string;
26
+ type?: K;
27
+ collapsed?: boolean;
28
+ props?: FilterTypeProps[K] & {
29
+ style?: CSSProperties;
30
+ class?: string;
31
+ };
32
+ labelProps?: FormItemProps & {
33
+ style?: CSSProperties;
34
+ class?: string;
35
+ };
36
+ render?: (opt: {
37
+ params: P;
38
+ data?: D;
39
+ actions: Actions<P, D>;
40
+ dataTableRef: DataTableInst | null;
41
+ }) => VNode;
42
+ };
43
+ }[keyof FilterTypeProps][];
44
+ export interface ClickRowType<R extends Record<string, any>> {
45
+ row: R;
46
+ index: number;
47
+ event: MouseEvent;
48
+ }
49
+ export interface ContextMenuSelectType<R extends Record<string, any>> {
50
+ key: string | number;
51
+ option: DropdownOption;
52
+ row?: R;
53
+ }
@@ -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, {}, any>;
2
+ export default _default;
@@ -1,6 +1,8 @@
1
1
  export * from './bubble';
2
2
  export * from './config-providers';
3
3
  export * from './copy-button';
4
+ export * from './data-table-plus';
4
5
  export * from './search-input';
6
+ export * from './toggle-editor';
5
7
  export * from './tooltip-button';
6
8
  export * from './type-writer';