@oiij/naive-ui 0.0.40 → 0.0.42

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.
@@ -1,15 +1,16 @@
1
1
  import { ConfigProviderProps, DialogProviderInst, DialogProviderProps, LoadingBarProviderInst, LoadingBarProviderProps, MessageProviderInst, MessageProviderProps, ModalProviderInst, ModalProviderProps, NotificationProviderInst, NotificationProviderProps } from 'naive-ui';
2
+ import { ClassStyle } from '../data-table-plus';
2
3
  import { FullLoadingProps } from '../full-loading/index';
3
4
  export { default as NConfigProviders } from './ConfigProviders.vue';
4
5
  export interface ConfigProvidersProps {
5
6
  globalStyle?: boolean;
6
- configProviderProps?: ConfigProviderProps;
7
- loadingBarProps?: LoadingBarProviderProps;
8
- fullLoadingProps?: FullLoadingProps;
9
- dialogProviderProps?: DialogProviderProps;
10
- modalProviderProps?: ModalProviderProps;
11
- notificationProviderProps?: NotificationProviderProps;
12
- messageProviderProps?: MessageProviderProps;
7
+ configProviderProps?: ConfigProviderProps & ClassStyle;
8
+ loadingBarProps?: LoadingBarProviderProps & ClassStyle;
9
+ fullLoadingProps?: FullLoadingProps & ClassStyle;
10
+ dialogProviderProps?: DialogProviderProps & ClassStyle;
11
+ modalProviderProps?: ModalProviderProps & ClassStyle;
12
+ notificationProviderProps?: NotificationProviderProps & ClassStyle;
13
+ messageProviderProps?: MessageProviderProps & ClassStyle;
13
14
  }
14
15
  export interface LoadingIns {
15
16
  start: () => void;
@@ -1,9 +1,10 @@
1
1
  import { UseClipboardOptions } from '@vueuse/core';
2
2
  import { ButtonProps, TooltipProps } from 'naive-ui';
3
+ import { ClassStyle } from '../data-table-plus';
3
4
  export { default as NCopyButton } from './CopyButton.vue';
4
5
  export interface CopyButtonProps {
5
6
  value?: string;
6
7
  config?: UseClipboardOptions<string | undefined>;
7
- tooltipProps?: TooltipProps;
8
- buttonProps?: ButtonProps;
8
+ tooltipProps?: TooltipProps & ClassStyle;
9
+ buttonProps?: ButtonProps & ClassStyle;
9
10
  }
@@ -56,6 +56,10 @@ declare const _default: <P extends RObject, D extends RObject, R extends RObject
56
56
  refs: DataTablePlusExposeRefs<P, D, R>;
57
57
  actions: DataTablePlusExposeActions<P, D>;
58
58
  }): any;
59
+ 'filter-modal'?(_: {
60
+ refs: DataTablePlusExposeRefs<P, D, R>;
61
+ actions: DataTablePlusExposeActions<P, D>;
62
+ }): any;
59
63
  };
60
64
  emit: DataTablePlusEmits<P, D, R>;
61
65
  }>) => import('vue').VNode & {
@@ -0,0 +1,24 @@
1
+ import { FlexProps } from 'naive-ui';
2
+ import { RObject } from '../remote-request/index';
3
+ import { DataTablePlusExposeActions, DataTablePlusExposeRefs, DataTablePlusFilterOptionItem } from './index';
4
+ declare const _default: <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<{
5
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
6
+ readonly "onUpdate:value"?: ((val: unknown, key: keyof P) => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:value"> & {
8
+ options?: DataTablePlusFilterOptionItem<P, D, R>[];
9
+ exposeRefs: DataTablePlusExposeRefs<P, D, R>;
10
+ exposeActions: DataTablePlusExposeActions<P, D>;
11
+ params: P[];
12
+ flexProps?: FlexProps;
13
+ } & Partial<{}>> & import('vue').PublicProps;
14
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
15
+ attrs: any;
16
+ slots: {};
17
+ emit: (e: "update:value", val: unknown, key: keyof P) => void;
18
+ }>) => import('vue').VNode & {
19
+ __ctx?: Awaited<typeof __VLS_setup>;
20
+ };
21
+ export default _default;
22
+ type __VLS_PrettifyLocal<T> = {
23
+ [K in keyof T]: T[K];
24
+ } & {};
@@ -0,0 +1,24 @@
1
+ import { GridProps } from 'naive-ui';
2
+ import { RObject } from '../remote-request/index';
3
+ import { DataTablePlusExposeActions, DataTablePlusExposeRefs, DataTablePlusFilterOptionItem } from './index';
4
+ declare const _default: <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<{
5
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
6
+ readonly "onUpdate:value"?: ((val: unknown, key: keyof P) => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:value"> & {
8
+ options?: DataTablePlusFilterOptionItem<P, D, R>[];
9
+ exposeRefs: DataTablePlusExposeRefs<P, D, R>;
10
+ exposeActions: DataTablePlusExposeActions<P, D>;
11
+ params: P[];
12
+ gridProps?: GridProps;
13
+ } & Partial<{}>> & import('vue').PublicProps;
14
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
15
+ attrs: any;
16
+ slots: {};
17
+ emit: (e: "update:value", val: unknown, key: keyof P) => void;
18
+ }>) => import('vue').VNode & {
19
+ __ctx?: Awaited<typeof __VLS_setup>;
20
+ };
21
+ export default _default;
22
+ type __VLS_PrettifyLocal<T> = {
23
+ [K in keyof T]: T[K];
24
+ } & {};
@@ -1,4 +1,4 @@
1
- import { DataTableColumns, DataTableFilterState, DataTableInst, DataTableProps, DataTableSortState, DropdownOption, FlexProps, FormItemProps, GridItemProps, GridProps, PaginationProps } from 'naive-ui';
1
+ import { DataTableColumns, DataTableFilterState, DataTableInst, DataTableProps, DataTableSortState, DropdownOption, FlexProps, FormItemProps, GridItemProps, GridProps, ModalProps, PaginationProps } from 'naive-ui';
2
2
  import { FilterState, TableBaseColumn } from 'naive-ui/es/data-table/src/interface';
3
3
  import { ComputedRef, CSSProperties, Ref, ShallowRef, VNode } from 'vue';
4
4
  import { useRequestResult } from 'vue-hooks-plus/es/useRequest/types';
@@ -6,7 +6,11 @@ import { PresetInputOptions } from '../preset-input/index';
6
6
  import { RemoteRequestEmits, RemoteRequestProps, RObject } from '../remote-request/index';
7
7
  import { SearchInputProps } from '../search-input/index';
8
8
  export { default as NDataTablePlus } from './DataTablePlus.vue';
9
- export interface DataTablePlusExposeActions<P extends RObject, D extends RObject> {
9
+ export type ClassStyle = {
10
+ class?: string;
11
+ style?: CSSProperties;
12
+ };
13
+ export interface DataTablePlusExposeActions<P extends RObject = RObject, D extends RObject = RObject> {
10
14
  run: (params: P) => void;
11
15
  runAsync: (params: P) => Promise<D>;
12
16
  refresh: () => void;
@@ -16,22 +20,24 @@ export interface DataTablePlusExposeActions<P extends RObject, D extends RObject
16
20
  setParams: (params: Partial<P>) => void;
17
21
  runParams: (params: Partial<P>) => void;
18
22
  runParamsAsync: (params: Partial<P>) => Promise<D>;
23
+ showFilterModal: () => void;
24
+ resetParams: () => void;
19
25
  }
20
26
  export interface DataTablePlusPagination {
21
27
  page: number;
22
28
  pageSize: number;
23
29
  itemCount: number;
24
30
  }
25
- export type DataTablePlusExposeRefsBase<P extends RObject, D extends RObject, R extends RObject> = Pick<useRequestResult<D, P[], false, false>, 'loading' | 'data' | 'error' | 'params'> & {
31
+ export type DataTablePlusExposeRefsBase<P extends RObject = RObject, D extends RObject = RObject, R extends RObject = RObject> = Pick<useRequestResult<D, P[], false, false>, 'loading' | 'data' | 'error' | 'params'> & {
26
32
  pagination: Readonly<Ref<DataTablePlusPagination, DataTablePlusPagination>>;
27
33
  rawList: ComputedRef<R[]>;
28
34
  };
29
- export type DataTablePlusExposeRefs<P extends RObject, D extends RObject, R extends RObject> = DataTablePlusExposeRefsBase<P, D, R> & {
35
+ export type DataTablePlusExposeRefs<P extends RObject = RObject, D extends RObject = RObject, R extends RObject = RObject> = DataTablePlusExposeRefsBase<P, D, R> & {
30
36
  filters: Ref<DataTableFilterState | undefined>;
31
37
  sorters: Ref<Record<string, DataTableSortState> | undefined>;
32
38
  dataTableRef: Readonly<ShallowRef<DataTableInst | null>>;
33
39
  };
34
- export type DataTablePlusFilterOptions<P extends RObject, D extends RObject, R extends RObject> = (PresetInputOptions & {
40
+ export type DataTablePlusFilterOptionItem<P extends RObject = RObject, D extends RObject = RObject, R extends RObject = RObject> = PresetInputOptions & {
35
41
  key?: keyof P;
36
42
  label?: string | boolean | (FormItemProps & {
37
43
  style?: CSSProperties;
@@ -42,26 +48,32 @@ export type DataTablePlusFilterOptions<P extends RObject, D extends RObject, R e
42
48
  gridSpan?: string | number;
43
49
  gridItemProps?: GridItemProps;
44
50
  render?: (refs: DataTablePlusExposeRefs<P, D, R>, actions: DataTablePlusExposeActions<P, D>) => VNode | null;
45
- })[];
51
+ };
52
+ export type DataTablePlusFilterOptions<P extends RObject = RObject, D extends RObject = RObject, R extends RObject = RObject> = DataTablePlusFilterOptionItem<P, D, R>[];
46
53
  export type DataTablePlusFields = Partial<Record<'page' | 'pageSize' | 'filter' | 'sorter' | 'list' | 'count' | 'rowKey' | 'search' | 'children', string>>;
47
- export type DataTablePlusProps<P extends RObject, D extends RObject, R extends RObject> = RemoteRequestProps<P, D> & {
54
+ export type DataTablePlusProps<P extends RObject = RObject, D extends RObject = RObject, R extends RObject = RObject> = RemoteRequestProps<P, D> & {
48
55
  title?: string;
49
56
  columns?: DataTableColumns<R>;
50
57
  filterOptions?: DataTablePlusFilterOptions<P, D, R>;
51
- filterGridProps?: GridProps;
52
- filterFlexProps?: FlexProps;
58
+ filterGridProps?: GridProps & ClassStyle;
59
+ filterFlexProps?: FlexProps & ClassStyle;
53
60
  filterLayout?: 'grid' | 'flex' | ['grid' | 'flex'];
61
+ filterCollapsedType?: 'collapsed' | 'modal';
62
+ filterModalTrigger?: 'manual' | 'auto';
63
+ filterLabel?: string;
64
+ filterModalProps?: ModalProps & ClassStyle;
54
65
  contextMenuOptions?: DropdownOption[];
55
66
  fields?: DataTablePlusFields;
56
- search?: SearchInputProps | boolean;
57
- pagination?: Omit<PaginationProps, 'page' | 'pageSize'> | boolean;
67
+ search?: SearchInputProps & ClassStyle | boolean;
68
+ pagination?: Omit<PaginationProps, 'page' | 'pageSize'> & ClassStyle | boolean;
69
+ clearable?: boolean;
58
70
  columnsFilterOptions?: (filters: DataTableFilterState) => Record<string, any>;
59
71
  columnsSorterOptions?: (sorters: Record<string, DataTableSortState>) => Record<string, any>;
60
- dataTableProps?: DataTableProps;
61
- customStyle?: CSSProperties;
62
- customClass?: string;
72
+ dataTableProps?: DataTableProps & ClassStyle;
73
+ style?: CSSProperties;
74
+ class?: string;
63
75
  };
64
- export type DataTablePlusEmits<P extends RObject, D extends RObject, R extends RObject> = RemoteRequestEmits<P, D> & {
76
+ export type DataTablePlusEmits<P extends RObject = RObject, D extends RObject = RObject, R extends RObject = RObject> = RemoteRequestEmits<P, D> & {
65
77
  (e: 'clickRow', row: R, index: number, event: MouseEvent, currentData: R[]): void;
66
78
  (e: 'contextMenuRow', row: R, index: number, event: MouseEvent, currentData: R[]): void;
67
79
  (e: 'load', row: R): Promise<void>;
@@ -1,6 +1,7 @@
1
1
  import { FlexProps, FormItemProps, FormItemRule, FormProps, FormRules, GridItemProps, GridProps } from 'naive-ui';
2
- import { CSSProperties, VNode } from 'vue';
2
+ import { VNode } from 'vue';
3
3
  import { NaiveFormClearRules, NaiveFormReturns, NaiveFormRules } from '../../composables/useNaiveForm';
4
+ import { ClassStyle } from '../data-table-plus';
4
5
  import { PresetInputOptions } from '../preset-input/index';
5
6
  export type { NaiveFormRules } from '../../composables/useNaiveForm';
6
7
  export { default as NPresetForm } from './PresetForm.vue';
@@ -8,27 +9,25 @@ export type PresetFormExposeRefs<V extends Record<string, any> = Record<string,
8
9
  export type PresetFormExposeActions<V extends Record<string, any> = Record<string, any>> = Pick<NaiveFormReturns<V>, 'validate' | 'resetValidation' | 'resetForm' | 'reset' | 'clear' | 'onValidated'> & {
9
10
  setValues: (value: Partial<V>) => void;
10
11
  };
11
- export type PresetFormOptions<V extends Record<string, any> = Record<string, any>> = (PresetInputOptions & {
12
+ export type PresetFormOptionsItem<V extends Record<string, any> = Record<string, any>> = PresetInputOptions & {
12
13
  key?: keyof V;
13
- label?: string | boolean | (FormItemProps & {
14
- style?: CSSProperties;
15
- class?: string;
16
- });
14
+ label?: string | boolean | FormItemProps & ClassStyle;
17
15
  rules?: FormRules | FormItemRule | FormItemRule[];
18
16
  required?: boolean;
19
17
  collapsed?: boolean;
20
18
  hidden?: boolean | ((refs: PresetFormExposeRefs<V>) => boolean);
21
19
  gridSpan?: string | number;
22
- gridItemProps?: GridItemProps;
20
+ gridItemProps?: GridItemProps & ClassStyle;
23
21
  render?: (refs: PresetFormExposeRefs<V>, actions: PresetFormExposeActions<V>) => VNode | null;
24
- })[];
22
+ };
23
+ export type PresetFormOptions<V extends Record<string, any> = Record<string, any>> = PresetFormOptionsItem<V>[];
25
24
  export interface PresetFormProps<V extends Record<string, any> = Record<string, any>> {
26
25
  options?: PresetFormOptions<V>;
27
26
  values?: V;
28
27
  rules?: NaiveFormRules<V>;
29
28
  clearRules?: NaiveFormClearRules;
30
- formProps?: FormProps;
31
- gridProps?: GridProps;
32
- flexProps?: FlexProps;
29
+ formProps?: FormProps & ClassStyle;
30
+ gridProps?: GridProps & ClassStyle;
31
+ flexProps?: FlexProps & ClassStyle;
33
32
  layout?: 'grid' | 'flex' | ['grid' | 'flex'];
34
33
  }
@@ -1,5 +1,5 @@
1
1
  import { ButtonProps, CheckboxGroupProps, CheckboxProps, ColorPickerProps, DatePickerProps, DividerProps, DynamicTagsProps, InputNumberProps, InputProps, RadioGroupProps, RadioProps, RateProps, SelectProps, SliderProps, SwitchProps, TimePickerProps } from 'naive-ui';
2
- import { CSSProperties } from 'vue';
2
+ import { ClassStyle } from '../data-table-plus';
3
3
  import { SearchInputProps } from '../search-input/index';
4
4
  export { default as NPresetInput } from './PresetInput.vue';
5
5
  export interface PresetInputType {
@@ -28,10 +28,7 @@ export interface PresetInputType {
28
28
  export type PresetInputOptions = {
29
29
  [K in keyof PresetInputType]: {
30
30
  type?: K;
31
- props?: PresetInputType[K] & {
32
- style?: CSSProperties;
33
- class?: string;
34
- };
31
+ props?: PresetInputType[K] & ClassStyle;
35
32
  };
36
33
  }[keyof PresetInputType];
37
34
  export interface PresetInputProps<V> {
@@ -4,14 +4,14 @@ declare const _default: <V extends PresetPickerValue, R extends RObject>(__VLS_p
4
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
5
  readonly onClose?: (() => any) | undefined;
6
6
  readonly "onUpdate:value"?: ((val: V | null, raw: R | R[] | null) => any) | undefined;
7
+ readonly onPositiveClick?: (() => any) | undefined;
7
8
  readonly onAfterEnter?: (() => any) | undefined;
8
9
  readonly onAfterLeave?: (() => any) | undefined;
9
10
  readonly onEsc?: (() => any) | undefined;
10
11
  readonly onMaskClick?: (() => any) | undefined;
11
12
  readonly onNegativeClick?: (() => any) | undefined;
12
- readonly onPositiveClick?: (() => any) | undefined;
13
13
  readonly "onUpdate:show"?: ((value: boolean) => any) | undefined;
14
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onAfterEnter" | "onAfterLeave" | "onUpdate:show" | "onUpdate:value" | "onClose" | "onEsc" | "onMaskClick" | "onNegativeClick" | "onPositiveClick"> & PresetPickerProps<V, R> & Partial<{}>> & import('vue').PublicProps;
14
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:value" | "onUpdate:show" | "onClose" | "onEsc" | "onAfterEnter" | "onAfterLeave" | "onPositiveClick" | "onNegativeClick" | "onMaskClick"> & PresetPickerProps<V, R> & Partial<{}>> & import('vue').PublicProps;
15
15
  expose(exposed: import('vue').ShallowUnwrapRef<{
16
16
  refs: PresetPickerExposeRefs<R>;
17
17
  actions: PresetPickerExposeActions<R>;
@@ -1,16 +1,17 @@
1
1
  import { BadgeProps, ButtonProps, DataTableColumns, ModalProps } from 'naive-ui';
2
2
  import { TableSelectionColumn } from 'naive-ui/es/data-table/src/interface';
3
3
  import { Ref } from 'vue';
4
+ import { ClassStyle } from '../data-table-plus';
4
5
  import { RObject } from '../remote-request/index';
5
6
  export { default as NPresetPicker } from './PresetPicker.vue';
6
7
  export type PresetPickerValue = string | number | (string | number)[] | null;
7
- export type PresetPickerExposeRefs<R extends RObject> = {
8
+ export type PresetPickerExposeRefs<R extends RObject = RObject> = {
8
9
  showModalFlag: Ref<boolean, boolean>;
9
10
  checkedRowKeys: Ref<(string | number)[], (string | number)[]>;
10
11
  checkedRows: Ref<R[], R[]>;
11
12
  columns: DataTableColumns<any>;
12
13
  };
13
- export type PresetPickerExposeActions<R extends RObject> = {
14
+ export type PresetPickerExposeActions<R extends RObject = RObject> = {
14
15
  showModal: () => void;
15
16
  updateCheckedRowKeysEffect: (keys: (string | number)[], rows: (R | undefined)[], meta: {
16
17
  row: R | undefined;
@@ -21,7 +22,7 @@ export type PresetPickerExposeActions<R extends RObject> = {
21
22
  setCheckedRowKeys: (keys: (string | number)[]) => void;
22
23
  setCheckedRows: (rows: R[]) => void;
23
24
  };
24
- export type PresetPickerProps<V extends PresetPickerValue, R extends RObject> = {
25
+ export type PresetPickerProps<V extends PresetPickerValue, R extends RObject = RObject> = {
25
26
  value?: V;
26
27
  fallbackLabel?: string | ((val: string | number) => string);
27
28
  multiple?: boolean;
@@ -35,12 +36,12 @@ export type PresetPickerProps<V extends PresetPickerValue, R extends RObject> =
35
36
  label?: string;
36
37
  value?: string;
37
38
  };
38
- buttonProps?: ButtonProps;
39
- clearButtonProps?: ButtonProps;
40
- badgeProps?: BadgeProps;
41
- modalProps?: ModalProps;
39
+ buttonProps?: ButtonProps & ClassStyle;
40
+ clearButtonProps?: ButtonProps & ClassStyle;
41
+ badgeProps?: BadgeProps & ClassStyle;
42
+ modalProps?: ModalProps & ClassStyle;
42
43
  };
43
- export type PresetPickerEmits<V extends PresetPickerValue, R extends RObject> = {
44
+ export type PresetPickerEmits<V extends PresetPickerValue, R extends RObject = RObject> = {
44
45
  (e: 'update:value', val: V | null, raw: R | R[] | null): void;
45
46
  (e: 'afterEnter'): void;
46
47
  (e: 'afterLeave'): void;
@@ -7,16 +7,16 @@ declare const _default: <V extends PresetSelectValue, P extends RObject, D exten
7
7
  readonly onError?: ((err: Error, params: P[]) => any) | undefined;
8
8
  readonly onFocus?: ((ev: FocusEvent) => any) | undefined;
9
9
  readonly onScroll?: ((ev: Event) => any) | undefined;
10
- readonly onClear?: (() => any) | undefined;
11
- readonly onSearch?: ((value: string) => any) | undefined;
12
- readonly onCreate?: ((label: string) => any) | undefined;
13
10
  readonly onSuccess?: ((data: D, params: P[]) => any) | undefined;
14
11
  readonly "onUpdate:value"?: ((val: V | null, option: SelectOption | SelectOption[] | null, raw: R | R[] | null) => any) | undefined;
12
+ readonly onClear?: (() => any) | undefined;
13
+ readonly onSearch?: ((value: string) => any) | undefined;
15
14
  readonly onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
16
15
  readonly onBefore?: ((params: P[]) => any) | undefined;
17
16
  readonly "onUpdate:page"?: ((page: number) => any) | undefined;
18
17
  readonly "onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
19
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onFocus" | "onBlur" | "onError" | "onScroll" | "onClear" | "onUpdate:value" | "onCreate" | "onSearch" | "onSuccess" | "onFinally" | "onBefore" | "onUpdate:page" | "onUpdate:pageSize"> & PresetSelectProps<V, P, D, R> & Partial<{}>> & import('vue').PublicProps;
18
+ readonly onCreate?: ((label: string) => any) | undefined;
19
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onFocus" | "onBlur" | "onClear" | "onUpdate:value" | "onError" | "onScroll" | "onCreate" | "onSearch" | "onSuccess" | "onFinally" | "onBefore" | "onUpdate:page" | "onUpdate:pageSize"> & PresetSelectProps<V, P, D, R> & Partial<{}>> & import('vue').PublicProps;
20
20
  expose(exposed: import('vue').ShallowUnwrapRef<{
21
21
  refs: PresetSelectExposeRefs<P, D, R>;
22
22
  actions: PresetSelectExposeActions<P, D>;
@@ -1,10 +1,11 @@
1
1
  import { PaginationProps, SelectGroupOption, SelectInst, SelectOption, SelectProps } from 'naive-ui';
2
2
  import { ShallowRef } from 'vue';
3
+ import { ClassStyle } from '../data-table-plus';
3
4
  import { DataTablePlusExposeActions, DataTablePlusExposeRefsBase } from '../data-table-plus/index';
4
5
  import { RemoteRequestEmits, RemoteRequestProps, RObject } from '../remote-request/index';
5
6
  export { default as NPresetSelect } from './PresetSelect.vue';
6
7
  export type ArrayAwareType<V, T> = V extends null ? null : (V extends any[] ? T[] : T) | null;
7
- export type OptionFormat<R extends RObject> = (row: R) => SelectOption | SelectGroupOption | false | undefined | null;
8
+ export type OptionFormat<R extends RObject = RObject> = (row: R) => SelectOption | SelectGroupOption | false | undefined | null;
8
9
  export type PresetSelectValue = string | number | (string | number)[] | null;
9
10
  export type PresetSelectFields = Partial<Record<'page' | 'pageSize' | 'search' | 'list' | 'count' | 'rowKey' | 'label' | 'value' | 'children', string>>;
10
11
  export interface PresetSelectPagination {
@@ -12,11 +13,11 @@ export interface PresetSelectPagination {
12
13
  pageSize: number;
13
14
  itemCount: number;
14
15
  }
15
- export type PresetSelectExposeRefs<P extends RObject, D extends RObject, R extends RObject> = DataTablePlusExposeRefsBase<P, D, R> & {
16
+ export type PresetSelectExposeRefs<P extends RObject = RObject, D extends RObject = RObject, R extends RObject = RObject> = DataTablePlusExposeRefsBase<P, D, R> & {
16
17
  selectRef: Readonly<ShallowRef<SelectInst | null>>;
17
18
  };
18
- export type PresetSelectExposeActions<P extends RObject, D extends RObject> = DataTablePlusExposeActions<P, D>;
19
- export type PresetSelectProps<V extends PresetSelectValue, P extends RObject, D extends RObject, R extends RObject> = RemoteRequestProps<P, D> & {
19
+ export type PresetSelectExposeActions<P extends RObject = RObject, D extends RObject = RObject> = Omit<DataTablePlusExposeActions<P, D>, 'showFilterModal' | 'resetParams'>;
20
+ export type PresetSelectProps<V extends PresetSelectValue, P extends RObject = RObject, D extends RObject = RObject, R extends RObject = RObject> = RemoteRequestProps<P, D> & {
20
21
  value?: V;
21
22
  fallbackLabel?: string | ((val: string | number) => SelectOption);
22
23
  multiple?: boolean;
@@ -25,10 +26,10 @@ export type PresetSelectProps<V extends PresetSelectValue, P extends RObject, D
25
26
  debounce?: boolean | number;
26
27
  optionFormat?: OptionFormat<R>;
27
28
  fields?: PresetSelectFields;
28
- selectProps?: SelectProps;
29
- pagination?: Omit<PaginationProps, 'page' | 'pageSize'> | boolean;
29
+ selectProps?: SelectProps & ClassStyle;
30
+ pagination?: Omit<PaginationProps, 'page' | 'pageSize'> & ClassStyle | boolean;
30
31
  };
31
- export type PresetSelectEmits<V extends PresetSelectValue, P extends RObject, D extends RObject, R extends RObject> = RemoteRequestEmits<P, D> & {
32
+ export type PresetSelectEmits<V extends PresetSelectValue, P extends RObject = RObject, D extends RObject = RObject, R extends RObject = RObject> = RemoteRequestEmits<P, D> & {
32
33
  (e: 'blur', ev: FocusEvent): void;
33
34
  (e: 'clear'): void;
34
35
  (e: 'create', label: string): SelectOption;
@@ -2,7 +2,7 @@ import { UseRequestOptions, UseRequestPlugin } from 'vue-hooks-plus/es/useReques
2
2
  export { default as NRemoteRequest } from './RemoteRequest.vue';
3
3
  export type RObject = Record<string, any>;
4
4
  export type RemoteRequestFields = Partial<Record<string, string>>;
5
- export interface RemoteRequestProps<P extends RObject, D extends RObject> {
5
+ export interface RemoteRequestProps<P extends RObject = RObject, D extends RObject = RObject> {
6
6
  api: (...args: P[]) => Promise<D>;
7
7
  defaultParams?: Partial<P>;
8
8
  manual?: boolean;
@@ -10,7 +10,7 @@ export interface RemoteRequestProps<P extends RObject, D extends RObject> {
10
10
  requestOptions?: UseRequestOptions<D, P[]>;
11
11
  requestPlugins?: UseRequestPlugin<D, P[]>[];
12
12
  }
13
- export interface RemoteRequestEmits<P extends RObject, D extends RObject> {
13
+ export interface RemoteRequestEmits<P extends RObject = RObject, D extends RObject = RObject> {
14
14
  (e: 'before', params: P[]): void;
15
15
  (e: 'success', data: D, params: P[]): void;
16
16
  (e: 'error', err: Error, params: P[]): void;
@@ -1,4 +1,5 @@
1
1
  import { ButtonProps, InputProps } from 'naive-ui';
2
+ import { ClassStyle } from '../data-table-plus';
2
3
  export { default as NSearchInput } from './SearchInput.vue';
3
4
  export interface SearchInputProps {
4
5
  value?: string | null;
@@ -7,6 +8,6 @@ export interface SearchInputProps {
7
8
  loading?: boolean;
8
9
  autoTrigger?: boolean | number;
9
10
  searchButton?: 'text' | 'icon' | boolean;
10
- inputProps?: InputProps;
11
- buttonProps?: ButtonProps;
11
+ inputProps?: InputProps & ClassStyle;
12
+ buttonProps?: ButtonProps & ClassStyle;
12
13
  }
@@ -1,6 +1,7 @@
1
1
  import { InputProps } from 'naive-ui';
2
+ import { ClassStyle } from '../data-table-plus';
2
3
  type __VLS_Props = {
3
- inputProps?: InputProps;
4
+ inputProps?: InputProps & ClassStyle;
4
5
  };
5
6
  type __VLS_PublicProps = {
6
7
  'value'?: string;
@@ -1,7 +1,8 @@
1
1
  import { ButtonProps, TooltipProps } from 'naive-ui';
2
+ import { ClassStyle } from '../data-table-plus';
2
3
  export { default as NTooltipButton } from './TooltipButton.vue';
3
4
  export interface TooltipButtonProps {
4
5
  value?: string;
5
- tooltipProps?: TooltipProps;
6
- buttonProps?: ButtonProps;
6
+ tooltipProps?: TooltipProps & ClassStyle;
7
+ buttonProps?: ButtonProps & ClassStyle;
7
8
  }
@@ -1,6 +1,7 @@
1
1
  import { TransitionProps as BaseTransitionProps } from 'vue';
2
+ import { ClassStyle } from '../data-table-plus';
2
3
  export { default as NTransition } from './BaseTransition.vue';
3
4
  export interface TransitionProps {
4
5
  name?: string;
5
- transitionProps?: BaseTransitionProps;
6
+ transitionProps?: BaseTransitionProps & ClassStyle;
6
7
  }
@@ -1,17 +1,17 @@
1
1
  import { TypeWriterProps } from './index';
2
2
  declare const _default: import('vue').DefineComponent<TypeWriterProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
3
3
  start: () => any;
4
+ stop: (v: string) => any;
4
5
  update: (v: {
5
6
  index: number;
6
7
  value: string;
7
8
  }) => any;
8
- stop: (v: string) => any;
9
9
  }, string, import('vue').PublicProps, Readonly<TypeWriterProps> & Readonly<{
10
10
  onStart?: (() => any) | undefined;
11
+ onStop?: ((v: string) => any) | undefined;
11
12
  onUpdate?: ((v: {
12
13
  index: number;
13
14
  value: string;
14
15
  }) => any) | undefined;
15
- onStop?: ((v: string) => any) | undefined;
16
16
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
17
17
  export default _default;