@oiij/naive-ui 0.0.28 → 0.0.29
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/dist/components/data-table-plus/index.d.ts +3 -14
- package/dist/components/icons/MageMultiplyCircleFill.vue.d.ts +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/preset-form/index.d.ts +2 -2
- package/dist/components/preset-picker/PresetPicker.vue.d.ts +15 -0
- package/dist/components/preset-picker/index.d.ts +27 -0
- package/dist/components/preset-select/index.d.ts +4 -3
- package/dist/components.cjs +25 -25
- package/dist/components.js +2594 -2442
- package/dist/components.umd.cjs +25 -25
- package/dist/composables/useNaiveForm.d.cts +4 -4
- package/dist/composables/useNaiveTheme.d.cts +2 -2
- package/package.json +3 -3
|
@@ -39,17 +39,7 @@ export type DataTablePlusFilterOptions<P extends RObject, D extends RObject, R e
|
|
|
39
39
|
gridItemProps?: GridItemProps;
|
|
40
40
|
render?: (refs: DataTablePlusExposeRefs<P, D, R>, actions: DataTablePlusExposeActions<P, D>) => VNode;
|
|
41
41
|
})[];
|
|
42
|
-
export
|
|
43
|
-
row: R;
|
|
44
|
-
index: number;
|
|
45
|
-
event: MouseEvent;
|
|
46
|
-
}
|
|
47
|
-
export interface ContextMenuSelectType<R extends RObject> {
|
|
48
|
-
key: string | number;
|
|
49
|
-
option: DropdownOption;
|
|
50
|
-
row?: R;
|
|
51
|
-
}
|
|
52
|
-
export type DataTablePlusFields = Partial<Record<'page' | 'pageSize' | 'filter' | 'sorter' | 'list' | 'count' | 'rowKey' | 'search', string>>;
|
|
42
|
+
export type DataTablePlusFields = Partial<Record<'page' | 'pageSize' | 'filter' | 'sorter' | 'list' | 'count' | 'rowKey' | 'search' | 'children', string>>;
|
|
53
43
|
export type DataTablePlusProps<P extends RObject, D extends RObject, R extends RObject> = RemoteRequestProps<P, D> & {
|
|
54
44
|
title?: string;
|
|
55
45
|
columns?: DataTableColumns<R>;
|
|
@@ -66,9 +56,8 @@ export type DataTablePlusProps<P extends RObject, D extends RObject, R extends R
|
|
|
66
56
|
customClass?: string;
|
|
67
57
|
};
|
|
68
58
|
export type DataTablePlusEmits<P extends RObject, D extends RObject, R extends RObject> = RemoteRequestEmits<P, D> & {
|
|
69
|
-
(e: 'clickRow',
|
|
70
|
-
(e: 'contextMenuRow',
|
|
71
|
-
(e: 'contextMenuSelect', data: ContextMenuSelectType<R>): void;
|
|
59
|
+
(e: 'clickRow', row: R, index: number, event: MouseEvent): void;
|
|
60
|
+
(e: 'contextMenuRow', row: R, index: number, event: MouseEvent): void;
|
|
72
61
|
(e: 'load', row: R): Promise<void>;
|
|
73
62
|
(e: 'scroll', ev: Event): void;
|
|
74
63
|
(e: 'update:checkedRowKeys', keys: (string | number)[], rows: (R | undefined)[], meta: {
|
|
@@ -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;
|
|
@@ -5,6 +5,7 @@ export * from './data-table-plus';
|
|
|
5
5
|
export * from './full-loading';
|
|
6
6
|
export * from './preset-form';
|
|
7
7
|
export * from './preset-input';
|
|
8
|
+
export * from './preset-picker';
|
|
8
9
|
export * from './preset-select';
|
|
9
10
|
export * from './remote-request';
|
|
10
11
|
export * from './search-input';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FlexProps, FormItemProps, FormItemRule, FormProps, FormRules, GridItemProps, GridProps } from 'naive-ui';
|
|
2
2
|
import { CSSProperties, VNode } from 'vue';
|
|
3
3
|
import { NaiveFormClearRules, NaiveFormReturns, NaiveFormRules } from '../../composables/useNaiveForm';
|
|
4
|
-
import { PresetInputOptions } from '../preset-input';
|
|
5
|
-
export type { NaiveFormRules } from '../../';
|
|
4
|
+
import { PresetInputOptions } from '../preset-input/index';
|
|
5
|
+
export type { NaiveFormRules } from '../../composables/useNaiveForm';
|
|
6
6
|
export { default as NPresetForm } from './PresetForm.vue';
|
|
7
7
|
export type PresetFormExposeRefs<V extends Record<string, any> = Record<string, any>> = Pick<NaiveFormReturns<V>, 'formValue' | 'formRef' | 'formRules'>;
|
|
8
8
|
export type PresetFormExposeActions<V extends Record<string, any> = Record<string, any>> = Pick<NaiveFormReturns<V>, 'validate' | 'resetValidation' | 'resetForm' | 'reset' | 'clear' | 'onValidated'> & {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RObject } from '../remote-request/index';
|
|
2
|
+
import { PresetPickerEmits, PresetPickerProps, PresetPickerValue } from './index';
|
|
3
|
+
declare const _default: <V extends PresetPickerValue, P extends RObject, D extends RObject, R extends RObject>(__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<{
|
|
4
|
+
props: __VLS_PrettifyLocal<any & PresetPickerProps<V, P, D, R> & Partial<{}>> & import('vue').PublicProps;
|
|
5
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
6
|
+
attrs: any;
|
|
7
|
+
slots: {};
|
|
8
|
+
emit: PresetPickerEmits<V, P, D, R>;
|
|
9
|
+
}>) => import('vue').VNode & {
|
|
10
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_PrettifyLocal<T> = {
|
|
14
|
+
[K in keyof T]: T[K];
|
|
15
|
+
} & {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BadgeProps, ButtonProps, ModalProps, SelectInst } from 'naive-ui';
|
|
2
|
+
import { TableSelectionColumn } from 'naive-ui/es/data-table/src/interface';
|
|
3
|
+
import { ShallowRef } from 'vue';
|
|
4
|
+
import { DataTablePlusEmits, DataTablePlusExposeActions, DataTablePlusExposeRefsBase, DataTablePlusProps } from '../data-table-plus/index';
|
|
5
|
+
import { RObject } from '../remote-request/index';
|
|
6
|
+
export { default as NPresetPicker } from './PresetPicker.vue';
|
|
7
|
+
export type PresetPickerValue = string | number | (string | number)[] | null;
|
|
8
|
+
export type PresetPickerExposeRefs<P extends RObject, D extends RObject, R extends RObject> = DataTablePlusExposeRefsBase<P, D, R> & {
|
|
9
|
+
selectRef: Readonly<ShallowRef<SelectInst | null>>;
|
|
10
|
+
};
|
|
11
|
+
export type PresetPickerExposeActions<P extends RObject, D extends RObject> = DataTablePlusExposeActions<P, D>;
|
|
12
|
+
export type PresetPickerProps<V extends PresetPickerValue, P extends RObject, D extends RObject, R extends RObject> = DataTablePlusProps<P, D, R> & {
|
|
13
|
+
value?: V;
|
|
14
|
+
fallbackLabel?: string;
|
|
15
|
+
multiple?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
clearable?: boolean;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
type?: ButtonProps['type'];
|
|
20
|
+
selectionOptions?: TableSelectionColumn;
|
|
21
|
+
buttonProps?: ButtonProps;
|
|
22
|
+
badgeProps?: BadgeProps;
|
|
23
|
+
modalProps?: ModalProps;
|
|
24
|
+
};
|
|
25
|
+
export type PresetPickerEmits<V extends PresetPickerValue, P extends RObject, D extends RObject, R extends RObject> = DataTablePlusEmits<P, D, R> & {
|
|
26
|
+
(e: 'update:value', val: V | null, raw: R | R[] | null): void;
|
|
27
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PaginationProps, SelectGroupOption, SelectInst, SelectOption, SelectProps } from 'naive-ui';
|
|
2
2
|
import { ShallowRef } from 'vue';
|
|
3
|
-
import { DataTablePlusExposeActions, DataTablePlusExposeRefsBase } from '../data-table-plus';
|
|
4
|
-
import { RemoteRequestEmits, RemoteRequestProps, RObject } from '../remote-request';
|
|
3
|
+
import { DataTablePlusExposeActions, DataTablePlusExposeRefsBase } from '../data-table-plus/index';
|
|
4
|
+
import { RemoteRequestEmits, RemoteRequestProps, RObject } from '../remote-request/index';
|
|
5
5
|
export { default as NPresetSelect } from './PresetSelect.vue';
|
|
6
6
|
export type ArrayAwareType<V, T> = V extends null ? null : (V extends any[] ? T[] : T) | null;
|
|
7
7
|
export type OptionFormat<R extends RObject> = (row: R) => SelectOption | SelectGroupOption | false | undefined | null;
|
|
@@ -21,6 +21,7 @@ export type PresetSelectProps<V extends PresetSelectValue, P extends RObject, D
|
|
|
21
21
|
fallbackLabel?: string;
|
|
22
22
|
multiple?: boolean;
|
|
23
23
|
disabled?: boolean;
|
|
24
|
+
clearable?: boolean;
|
|
24
25
|
debounce?: boolean | number;
|
|
25
26
|
optionFormat?: OptionFormat<R>;
|
|
26
27
|
fields?: PresetSelectFields;
|
|
@@ -34,7 +35,7 @@ export type PresetSelectEmits<V extends PresetSelectValue, P extends RObject, D
|
|
|
34
35
|
(e: 'focus', ev: FocusEvent): void;
|
|
35
36
|
(e: 'scroll', ev: Event): void;
|
|
36
37
|
(e: 'search', value: string): void;
|
|
37
|
-
(e: 'update:value', val: V | null, option:
|
|
38
|
+
(e: 'update:value', val: V | null, option: SelectOption | SelectOption[] | null, raw: R | R[] | null): void;
|
|
38
39
|
(e: 'update:page', page: number): void;
|
|
39
40
|
(e: 'update:pageSize', pageSize: number): void;
|
|
40
41
|
};
|