@oiij/naive-ui 0.0.27 → 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.
@@ -8,27 +8,32 @@ declare const _default: <P extends RObject, D extends RObject, R extends RObject
8
8
  }>): void;
9
9
  attrs: any;
10
10
  slots: {
11
- filter?(_: {
11
+ header?(_: {
12
12
  refs: DataTablePlusExposeRefs<P, D, R>;
13
13
  actions: DataTablePlusExposeActions<P, D>;
14
14
  }): any;
15
- empty?(_: {
15
+ title?(_: {}): any;
16
+ 'header-extra'?(_: {
16
17
  refs: DataTablePlusExposeRefs<P, D, R>;
17
18
  actions: DataTablePlusExposeActions<P, D>;
18
19
  }): any;
19
- loading?(_: {
20
+ filter?(_: {
20
21
  refs: DataTablePlusExposeRefs<P, D, R>;
21
22
  actions: DataTablePlusExposeActions<P, D>;
22
23
  }): any;
23
- actions?(_: {
24
+ empty?(_: {
25
+ refs: DataTablePlusExposeRefs<P, D, R>;
26
+ actions: DataTablePlusExposeActions<P, D>;
27
+ }): any;
28
+ loading?(_: {
24
29
  refs: DataTablePlusExposeRefs<P, D, R>;
25
30
  actions: DataTablePlusExposeActions<P, D>;
26
31
  }): any;
27
- extra?(_: {
32
+ footer?(_: {
28
33
  refs: DataTablePlusExposeRefs<P, D, R>;
29
34
  actions: DataTablePlusExposeActions<P, D>;
30
35
  }): any;
31
- pagination?(_: {
36
+ 'footer-extra'?(_: {
32
37
  refs: DataTablePlusExposeRefs<P, D, R>;
33
38
  actions: DataTablePlusExposeActions<P, D>;
34
39
  }): any;
@@ -4,6 +4,7 @@ import { ComputedRef, CSSProperties, Ref, ShallowRef, VNode } from 'vue';
4
4
  import { useRequestResult } from 'vue-hooks-plus/es/useRequest/types';
5
5
  import { PresetInputOptions } from '../preset-input/index';
6
6
  import { RemoteRequestEmits, RemoteRequestProps, RObject } from '../remote-request/index';
7
+ import { SearchInputProps } from '../search-input/index';
7
8
  export { default as NDataTablePlus } from './DataTablePlus.vue';
8
9
  export interface DataTablePlusExposeActions<P extends RObject, D extends RObject> {
9
10
  run: (params: P) => void;
@@ -38,18 +39,9 @@ export type DataTablePlusFilterOptions<P extends RObject, D extends RObject, R e
38
39
  gridItemProps?: GridItemProps;
39
40
  render?: (refs: DataTablePlusExposeRefs<P, D, R>, actions: DataTablePlusExposeActions<P, D>) => VNode;
40
41
  })[];
41
- export interface DataTablePlusClickRowType<R extends RObject> {
42
- row: R;
43
- index: number;
44
- event: MouseEvent;
45
- }
46
- export interface ContextMenuSelectType<R extends RObject> {
47
- key: string | number;
48
- option: DropdownOption;
49
- row?: R;
50
- }
51
- export type DataTablePlusFields = Partial<Record<'page' | 'pageSize' | 'filter' | 'sorter' | 'list' | 'count' | 'rowKey', string>>;
42
+ export type DataTablePlusFields = Partial<Record<'page' | 'pageSize' | 'filter' | 'sorter' | 'list' | 'count' | 'rowKey' | 'search' | 'children', string>>;
52
43
  export type DataTablePlusProps<P extends RObject, D extends RObject, R extends RObject> = RemoteRequestProps<P, D> & {
44
+ title?: string;
53
45
  columns?: DataTableColumns<R>;
54
46
  filterOptions?: DataTablePlusFilterOptions<P, D, R>;
55
47
  filterGridProps?: GridProps;
@@ -57,15 +49,15 @@ export type DataTablePlusProps<P extends RObject, D extends RObject, R extends R
57
49
  filterLayout?: 'grid' | 'flex' | ['grid' | 'flex'];
58
50
  contextMenuOptions?: DropdownOption[];
59
51
  fields?: DataTablePlusFields;
52
+ search?: SearchInputProps | boolean;
60
53
  pagination?: Omit<PaginationProps, 'page' | 'pageSize'> | boolean;
61
54
  dataTableProps?: DataTableProps;
62
55
  customStyle?: CSSProperties;
63
56
  customClass?: string;
64
57
  };
65
58
  export type DataTablePlusEmits<P extends RObject, D extends RObject, R extends RObject> = RemoteRequestEmits<P, D> & {
66
- (e: 'clickRow', data: DataTablePlusClickRowType<R>): void;
67
- (e: 'contextMenuRow', data: DataTablePlusClickRowType<R>): void;
68
- (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;
69
61
  (e: 'load', row: R): Promise<void>;
70
62
  (e: 'scroll', ev: Event): void;
71
63
  (e: 'update:checkedRowKeys', keys: (string | number)[], rows: (R | undefined)[], meta: {
@@ -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
+ };
@@ -12,15 +12,11 @@ declare const _default: <V extends PresetSelectValue, P extends RObject, D exten
12
12
  refs: PresetSelectExposeRefs<P, D, R>;
13
13
  actions: PresetSelectExposeActions<P, D>;
14
14
  }): any;
15
- action?(_: {
15
+ footer?(_: {
16
16
  refs: PresetSelectExposeRefs<P, D, R>;
17
17
  actions: PresetSelectExposeActions<P, D>;
18
18
  }): any;
19
- extra?(_: {
20
- refs: PresetSelectExposeRefs<P, D, R>;
21
- actions: PresetSelectExposeActions<P, D>;
22
- }): any;
23
- pagination?(_: {
19
+ 'footer-extra'?(_: {
24
20
  refs: PresetSelectExposeRefs<P, D, R>;
25
21
  actions: PresetSelectExposeActions<P, D>;
26
22
  }): any;
@@ -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: ArrayAwareType<V, SelectOption>, raw: ArrayAwareType<V, R>): void;
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
  };
@@ -4,7 +4,10 @@ declare function __VLS_template(): {
4
4
  slots: {
5
5
  prefix?(_: {}): any;
6
6
  'prefix-icon'?(_: {}): any;
7
- button?(_: {}): any;
7
+ button?(_: {
8
+ value: string | null | undefined;
9
+ loading: boolean;
10
+ }): any;
8
11
  'button-icon'?(_: {}): any;
9
12
  };
10
13
  refs: {
@@ -1045,9 +1048,9 @@ declare function __VLS_template(): {
1045
1048
  };
1046
1049
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
1047
1050
  declare const __VLS_component: import('vue').DefineComponent<SearchInputProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
1048
- "update:value": (v: string) => any;
1051
+ "update:value": (v: string | null | undefined) => any;
1049
1052
  }, string, import('vue').PublicProps, Readonly<SearchInputProps> & Readonly<{
1050
- "onUpdate:value"?: ((v: string) => any) | undefined;
1053
+ "onUpdate:value"?: ((v: string | null | undefined) => any) | undefined;
1051
1054
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
1052
1055
  'input-ref': import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
1053
1056
  bordered: {
@@ -1,11 +1,12 @@
1
1
  import { ButtonProps, InputProps } from 'naive-ui';
2
2
  export { default as NSearchInput } from './SearchInput.vue';
3
3
  export interface SearchInputProps {
4
- value?: string;
4
+ value?: string | null;
5
5
  type?: ButtonProps['type'];
6
+ placeholder?: string;
7
+ loading?: boolean;
6
8
  autoTrigger?: boolean | number;
7
- searchButton?: boolean;
9
+ searchButton?: 'text' | 'icon' | boolean;
8
10
  inputProps?: InputProps;
9
11
  buttonProps?: ButtonProps;
10
- loading?: boolean;
11
12
  }