gi-component 0.0.32 → 0.0.34
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/button/index.d.ts +4 -0
- package/dist/components/button/src/button.vue.d.ts +25 -0
- package/dist/components/button/src/type.d.ts +4 -0
- package/dist/components/card/index.d.ts +4 -0
- package/dist/components/card/src/card.vue.d.ts +35 -0
- package/dist/components/card/src/type.d.ts +11 -0
- package/dist/components/dialog/index.d.ts +5 -0
- package/dist/components/dialog/src/dialog-content.vue.d.ts +9 -0
- package/dist/components/dialog/src/dialog.d.ts +26 -0
- package/dist/components/dialog/src/dialog.vue.d.ts +43 -0
- package/dist/components/dialog/src/type.d.ts +15 -0
- package/dist/components/dot/index.d.ts +4 -0
- package/dist/components/dot/src/dot.vue.d.ts +7 -0
- package/dist/components/dot/src/type.d.ts +6 -0
- package/dist/components/drawer/index.d.ts +5 -0
- package/dist/components/drawer/src/drawer.d.ts +18 -0
- package/dist/components/drawer/src/drawer.vue.d.ts +47 -0
- package/dist/components/drawer/src/type.d.ts +14 -0
- package/dist/components/edit-table/index.d.ts +4 -0
- package/dist/components/edit-table/src/type.d.ts +23 -0
- package/dist/components/form/index.d.ts +4 -0
- package/dist/components/form/src/type.d.ts +50 -0
- package/dist/components/grid/index.d.ts +6 -0
- package/dist/components/grid/src/context.d.ts +19 -0
- package/dist/components/grid/src/grid-item.vue.d.ts +78 -0
- package/dist/components/grid/src/grid.vue.d.ts +103 -0
- package/dist/components/grid/src/hook/use-index.d.ts +9 -0
- package/dist/components/grid/src/hook/use-responsive-state.d.ts +3 -0
- package/dist/components/grid/src/hook/use-responsive-value.d.ts +24 -0
- package/dist/components/grid/src/interface.d.ts +80 -0
- package/dist/components/grid/src/type.d.ts +0 -0
- package/dist/components/grid/src/utils/global-config.d.ts +1 -0
- package/dist/components/grid/src/utils/index.d.ts +11 -0
- package/dist/components/grid/src/utils/is.d.ts +2 -0
- package/dist/components/grid/src/utils/responsive-observe.d.ts +24 -0
- package/dist/components/input-group/index.d.ts +4 -0
- package/dist/components/input-group/src/input-group.vue.d.ts +17 -0
- package/dist/components/input-group/src/type.d.ts +2 -0
- package/dist/components/input-search/index.d.ts +4 -0
- package/dist/components/input-search/src/input-search.vue.d.ts +22 -0
- package/dist/components/input-search/src/type.d.ts +6 -0
- package/dist/components/page-layout/index.d.ts +4 -0
- package/dist/components/page-layout/src/page-layout.vue.d.ts +19 -0
- package/dist/components/page-layout/src/split-button.vue.d.ts +26 -0
- package/dist/components/page-layout/src/type.d.ts +11 -0
- package/dist/components/table/index.d.ts +4 -0
- package/dist/components/table/src/TableColumn.vue.d.ts +10 -0
- package/dist/components/table/src/type.d.ts +20 -0
- package/dist/components/tabs/index.d.ts +4 -0
- package/dist/components/tabs/src/tabs.vue.d.ts +79 -0
- package/dist/components/tabs/src/type.d.ts +12 -0
- package/dist/components/tree-transfer/index.d.ts +4 -0
- package/dist/components/tree-transfer/src/tree-transfer.vue.d.ts +14436 -0
- package/dist/components/tree-transfer/src/type.d.ts +6 -0
- package/dist/components/tree-transfer/src/utils.d.ts +9 -0
- package/dist/gi.css +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useBemClass.d.ts +3 -0
- package/dist/index.d.ts +55 -15372
- package/dist/index.es.js +18 -12
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/tool.d.ts +6 -0
- package/dist/utils/createSelectDialog.d.ts +29 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +9 -1
- package/packages/components/card/src/card.vue +9 -5
- package/packages/components/dialog/src/dialog-content.vue +14 -1
- package/packages/components/page-layout/src/page-layout.vue +12 -13
- package/packages/components/tabs/src/tabs.vue +2 -2
- package/packages/styles/index.scss +0 -5
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ButtonProps as ElButtonProps } from 'element-plus';
|
|
2
|
+
import { ButtonProps } from './type.ts';
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
attrs: Partial<{}>;
|
|
5
|
+
slots: {
|
|
6
|
+
default?(_: {}): any;
|
|
7
|
+
};
|
|
8
|
+
refs: {};
|
|
9
|
+
rootEl: any;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
13
|
+
click: (event: MouseEvent) => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{
|
|
15
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
type: "add" | "edit" | "delete" | "search" | "reset" | "upload" | "download" | "print" | "" | ElButtonProps["type"];
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CardProps } from './type';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: Readonly<{
|
|
5
|
+
default: () => void;
|
|
6
|
+
title: () => void;
|
|
7
|
+
extra: () => void;
|
|
8
|
+
footer: () => void;
|
|
9
|
+
}> & {
|
|
10
|
+
default: () => void;
|
|
11
|
+
title: () => void;
|
|
12
|
+
extra: () => void;
|
|
13
|
+
footer: () => void;
|
|
14
|
+
};
|
|
15
|
+
refs: {};
|
|
16
|
+
rootEl: HTMLDivElement;
|
|
17
|
+
};
|
|
18
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
19
|
+
declare const __VLS_component: import('vue').DefineComponent<CardProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CardProps> & Readonly<{}>, {
|
|
20
|
+
size: "small" | "middle";
|
|
21
|
+
title: string;
|
|
22
|
+
extra: string;
|
|
23
|
+
bordered: boolean;
|
|
24
|
+
headerBordered: boolean;
|
|
25
|
+
headerStyle: import('vue').CSSProperties;
|
|
26
|
+
bodyStyle: import('vue').CSSProperties;
|
|
27
|
+
inner: boolean;
|
|
28
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
29
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CSSProperties } from 'vue';
|
|
2
|
+
export interface CardProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
extra?: string;
|
|
5
|
+
bordered?: boolean;
|
|
6
|
+
size?: 'small' | 'middle';
|
|
7
|
+
headerBordered?: boolean;
|
|
8
|
+
headerStyle?: CSSProperties;
|
|
9
|
+
bodyStyle?: CSSProperties;
|
|
10
|
+
inner?: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
type?: 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
content?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
6
|
+
type: "info" | "success" | "warning" | "error";
|
|
7
|
+
content: string;
|
|
8
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DialogInstance } from '../index';
|
|
2
|
+
export type DialogOptions = Partial<DialogInstance['$props']>;
|
|
3
|
+
export interface DialogReturnObject {
|
|
4
|
+
close: () => void;
|
|
5
|
+
update: (newProps?: Record<string, any>) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createDialog(): {
|
|
8
|
+
_context: {};
|
|
9
|
+
create(options: DialogOptions): DialogReturnObject;
|
|
10
|
+
/** 对话框-打开 */
|
|
11
|
+
open(options: DialogOptions): DialogReturnObject;
|
|
12
|
+
info(options: DialogOptions): DialogReturnObject;
|
|
13
|
+
success(options: DialogOptions): DialogReturnObject;
|
|
14
|
+
warning(options: DialogOptions): DialogReturnObject;
|
|
15
|
+
error(options: DialogOptions): DialogReturnObject;
|
|
16
|
+
};
|
|
17
|
+
export declare const Dialog: {
|
|
18
|
+
_context: {};
|
|
19
|
+
create(options: DialogOptions): DialogReturnObject;
|
|
20
|
+
/** 对话框-打开 */
|
|
21
|
+
open(options: DialogOptions): DialogReturnObject;
|
|
22
|
+
info(options: DialogOptions): DialogReturnObject;
|
|
23
|
+
success(options: DialogOptions): DialogReturnObject;
|
|
24
|
+
warning(options: DialogOptions): DialogReturnObject;
|
|
25
|
+
error(options: DialogOptions): DialogReturnObject;
|
|
26
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
import { DialogProps } from './type';
|
|
3
|
+
declare const visible: import('vue').ModelRef<boolean, string, boolean, boolean>;
|
|
4
|
+
type __VLS_Props = DialogProps;
|
|
5
|
+
type __VLS_PublicProps = {
|
|
6
|
+
'modelValue'?: typeof visible['value'];
|
|
7
|
+
} & __VLS_Props;
|
|
8
|
+
declare function __VLS_template(): {
|
|
9
|
+
attrs: Partial<{}>;
|
|
10
|
+
slots: Readonly<{
|
|
11
|
+
title: () => VNode;
|
|
12
|
+
footer: () => VNode;
|
|
13
|
+
default: () => VNode;
|
|
14
|
+
}> & {
|
|
15
|
+
title: () => VNode;
|
|
16
|
+
footer: () => VNode;
|
|
17
|
+
default: () => VNode;
|
|
18
|
+
};
|
|
19
|
+
refs: {};
|
|
20
|
+
rootEl: any;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
23
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
|
+
"update:modelValue": (value: boolean) => any;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
26
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
footer: boolean | (() => VNode);
|
|
29
|
+
readonly closeOnClickModal: boolean;
|
|
30
|
+
readonly lockScroll: boolean;
|
|
31
|
+
readonly width: string | number;
|
|
32
|
+
readonly alignCenter: boolean;
|
|
33
|
+
readonly showClose: boolean;
|
|
34
|
+
okText: string;
|
|
35
|
+
cancelText: string;
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
37
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ButtonProps, DialogProps as ElDialogProps } from 'element-plus';
|
|
2
|
+
import { CSSProperties, VNode } from 'vue';
|
|
3
|
+
export interface DialogProps extends Partial<ElDialogProps> {
|
|
4
|
+
content?: string | (() => VNode);
|
|
5
|
+
footer?: boolean | (() => VNode);
|
|
6
|
+
okText?: string;
|
|
7
|
+
cancelText?: string;
|
|
8
|
+
okButtonProps?: Partial<ButtonProps>;
|
|
9
|
+
cancelButtonProps?: Partial<ButtonProps>;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
simple?: boolean;
|
|
12
|
+
onOk?: () => void;
|
|
13
|
+
onBeforeOk?: () => Promise<boolean>;
|
|
14
|
+
onCancel?: () => void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DotProps } from './type.ts';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<DotProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<DotProps> & Readonly<{}>, {
|
|
3
|
+
size: number;
|
|
4
|
+
type: "circle" | "square";
|
|
5
|
+
color: string | "primary" | "success" | "warning" | "danger" | "info";
|
|
6
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DrawerInstance } from '../index';
|
|
2
|
+
export type DrawerOptions = Partial<DrawerInstance['$props']>;
|
|
3
|
+
export interface DrawerReturnObject {
|
|
4
|
+
close: () => void;
|
|
5
|
+
update: (newProps?: Record<string, any>) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createDrawer(): {
|
|
8
|
+
_context: {};
|
|
9
|
+
create(options: DrawerOptions): DrawerReturnObject;
|
|
10
|
+
/** 抽屉-打开 */
|
|
11
|
+
open(options: DrawerOptions): DrawerReturnObject;
|
|
12
|
+
};
|
|
13
|
+
export declare const Drawer: {
|
|
14
|
+
_context: {};
|
|
15
|
+
create(options: DrawerOptions): DrawerReturnObject;
|
|
16
|
+
/** 抽屉-打开 */
|
|
17
|
+
open(options: DrawerOptions): DrawerReturnObject;
|
|
18
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
import { DrawerProps } from './type';
|
|
3
|
+
declare const visible: import('vue').ModelRef<boolean, string, boolean, boolean>;
|
|
4
|
+
type __VLS_Props = DrawerProps;
|
|
5
|
+
type __VLS_PublicProps = {
|
|
6
|
+
'modelValue'?: typeof visible['value'];
|
|
7
|
+
} & __VLS_Props;
|
|
8
|
+
declare function __VLS_template(): {
|
|
9
|
+
attrs: Partial<{}>;
|
|
10
|
+
slots: Readonly<{
|
|
11
|
+
title: () => VNode;
|
|
12
|
+
footer: () => VNode;
|
|
13
|
+
default: () => VNode;
|
|
14
|
+
}> & {
|
|
15
|
+
title: () => VNode;
|
|
16
|
+
footer: () => VNode;
|
|
17
|
+
default: () => VNode;
|
|
18
|
+
};
|
|
19
|
+
refs: {};
|
|
20
|
+
rootEl: any;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
23
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
|
+
"update:modelValue": (value: boolean) => any;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
26
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
readonly size: string | number;
|
|
29
|
+
readonly title: string;
|
|
30
|
+
footer: boolean | (() => VNode);
|
|
31
|
+
readonly appendTo: string | HTMLElement;
|
|
32
|
+
readonly closeOnClickModal: boolean;
|
|
33
|
+
readonly closeOnPressEscape: boolean;
|
|
34
|
+
readonly lockScroll: boolean;
|
|
35
|
+
readonly modal: boolean;
|
|
36
|
+
readonly showClose: boolean;
|
|
37
|
+
okText: string;
|
|
38
|
+
cancelText: string;
|
|
39
|
+
readonly withHeader: boolean;
|
|
40
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
42
|
+
export default _default;
|
|
43
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
44
|
+
new (): {
|
|
45
|
+
$slots: S;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ButtonProps, DrawerProps as ElDrawerProps } from 'element-plus';
|
|
2
|
+
import { CSSProperties, VNode } from 'vue';
|
|
3
|
+
export interface DrawerProps extends Partial<ElDrawerProps> {
|
|
4
|
+
content?: string | (() => VNode);
|
|
5
|
+
footer?: boolean | (() => VNode);
|
|
6
|
+
okText?: string;
|
|
7
|
+
cancelText?: string;
|
|
8
|
+
okButtonProps?: Partial<ButtonProps>;
|
|
9
|
+
cancelButtonProps?: Partial<ButtonProps>;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
onOk?: () => void;
|
|
12
|
+
onBeforeOk?: () => Promise<boolean>;
|
|
13
|
+
onCancel?: () => void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MergeMultiple } from '../../../types/tool';
|
|
2
|
+
import { InputSearchInstance } from '../../input-search';
|
|
3
|
+
import type * as El from 'element-plus';
|
|
4
|
+
export type EditTableColumnItemType = 'input' | 'textarea' | 'input-number' | 'input-tag' | 'select' | 'select-v2' | 'tree-select' | 'cascader' | 'slider' | 'switch' | 'rate' | 'checkbox-group' | 'checkbox' | 'radio-group' | 'radio' | 'date-picker' | 'time-picker' | 'time-select' | 'color-picker' | 'transfer' | 'autocomplete' | 'upload' | 'slot' | 'input-search';
|
|
5
|
+
export interface EditTableColumnItem {
|
|
6
|
+
type?: EditTableColumnItemType;
|
|
7
|
+
label: string;
|
|
8
|
+
prop: string;
|
|
9
|
+
width?: number | string;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
rules?: El.FormItemRule[];
|
|
12
|
+
componentProps?: EditTableColumnItemProps;
|
|
13
|
+
columnProps?: El.TableColumnInstance['$props'];
|
|
14
|
+
formItemProps?: El.FormItemProps;
|
|
15
|
+
slotName?: string;
|
|
16
|
+
}
|
|
17
|
+
export type EditTableColumnItemProps = MergeMultiple<[El.InputProps, El.InputNumberProps, El.InputTagProps, El.SelectProps, El.SelectV2Props, El.TreeInstance['$props'], El.CascaderProps, El.SliderProps, El.SwitchProps, El.RateProps, El.CheckboxGroupProps, El.CheckboxProps, El.RadioGroupProps, El.RadioProps, El.DatePickerProps, El.TimePickerDefaultProps, El.TimeSelectProps, El.ColorPickerProps, El.TransferProps, El.AutocompleteProps, El.UploadProps, InputSearchInstance['$props']]>;
|
|
18
|
+
export interface EditTableProps {
|
|
19
|
+
rowKey?: string;
|
|
20
|
+
data?: any[];
|
|
21
|
+
columns?: EditTableColumnItem[];
|
|
22
|
+
cellDisabled?: any;
|
|
23
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { FormProps as ElFormProps } from 'element-plus';
|
|
2
|
+
import { VNode } from 'vue';
|
|
3
|
+
import { MergeMultiple } from '../../../types/tool';
|
|
4
|
+
import { GridItemProps, GridProps } from '../../grid/src/interface';
|
|
5
|
+
import { InputSearchInstance } from '../../input-search';
|
|
6
|
+
import type * as El from 'element-plus';
|
|
7
|
+
export type FormColumnType = 'input' | 'textarea' | 'input-number' | 'input-tag' | 'input-search' | 'select' | 'select-v2' | 'tree-select' | 'cascader' | 'slider' | 'switch' | 'rate' | 'checkbox-group' | 'checkbox' | 'radio-group' | 'radio' | 'date-picker' | 'time-picker' | 'time-select' | 'color-picker' | 'transfer' | 'autocomplete' | 'upload' | 'title' | 'slot';
|
|
8
|
+
/**
|
|
9
|
+
* 表单列属性类型,根据组件类型使用对应的属性类型
|
|
10
|
+
*/
|
|
11
|
+
export type FormColumnProps = MergeMultiple<[El.InputProps, El.InputNumberProps, El.InputTagProps, El.SelectProps, El.SelectV2Props, El.TreeInstance['$props'], El.CascaderProps, El.SliderProps, El.SwitchProps, El.RateProps, El.CheckboxGroupProps, El.CheckboxProps, El.RadioGroupProps, El.RadioProps, El.DatePickerProps, El.TimePickerDefaultProps, El.TimeSelectProps, El.ColorPickerProps, El.TransferProps, El.AutocompleteProps, El.UploadProps, InputSearchInstance['$props']]>;
|
|
12
|
+
export type FormColumnItemHide<F> = boolean | ((form: F) => boolean);
|
|
13
|
+
/**
|
|
14
|
+
* 表单列插槽类型,根据组件类型使用对应的插槽类型
|
|
15
|
+
*/
|
|
16
|
+
export type FormColumnSlots = Partial<El.InputInstance['$slots'] | El.InputNumberInstance['$slots'] | El.InputTagInstance['$slots'] | El.AutocompleteInstance['$slots'] | El.CascaderInstance['$slots'] | El.DatePickerInstance['$slots']>;
|
|
17
|
+
export interface FormColumnItem<F = any> {
|
|
18
|
+
type: FormColumnType;
|
|
19
|
+
label?: string;
|
|
20
|
+
labelRender?: () => VNode;
|
|
21
|
+
field: string;
|
|
22
|
+
fieldName?: string;
|
|
23
|
+
span?: number | GridItemProps['span'];
|
|
24
|
+
props?: FormColumnProps;
|
|
25
|
+
formItemProps?: El.FormItemProps;
|
|
26
|
+
gridItemProps?: any;
|
|
27
|
+
required?: boolean;
|
|
28
|
+
rules?: El.FormItemRule[];
|
|
29
|
+
hide?: FormColumnItemHide<F>;
|
|
30
|
+
tip?: string;
|
|
31
|
+
dictCode?: string;
|
|
32
|
+
slotName?: string;
|
|
33
|
+
slots?: FormColumnSlots;
|
|
34
|
+
extra?: string | (() => VNode);
|
|
35
|
+
}
|
|
36
|
+
export interface FormProps extends Partial<ElFormProps> {
|
|
37
|
+
modelValue: any;
|
|
38
|
+
columns?: FormColumnItem[];
|
|
39
|
+
fc?: Record<string, {
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
hidden?: boolean;
|
|
42
|
+
required?: boolean;
|
|
43
|
+
}>;
|
|
44
|
+
gridProps?: GridProps;
|
|
45
|
+
gridItemProps?: GridItemProps;
|
|
46
|
+
search?: boolean;
|
|
47
|
+
searchText?: string;
|
|
48
|
+
hideFoldBtn?: boolean;
|
|
49
|
+
defaultCollapsed?: boolean | undefined;
|
|
50
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as GridItem } from './src/grid-item.vue';
|
|
2
|
+
import { default as Grid } from './src/grid.vue';
|
|
3
|
+
export type GridInstance = InstanceType<typeof Grid>;
|
|
4
|
+
export type GridItemInstance = InstanceType<typeof GridItem>;
|
|
5
|
+
export * from './src/interface';
|
|
6
|
+
export { Grid, GridItem };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { InjectionKey } from 'vue';
|
|
2
|
+
import { GridItemData } from './interface';
|
|
3
|
+
export type RowContextContext = Readonly<{
|
|
4
|
+
gutter?: [number, number];
|
|
5
|
+
div?: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const RowContextInjectionKey: InjectionKey<RowContextContext>;
|
|
8
|
+
export type GridContext = Readonly<{
|
|
9
|
+
overflow: boolean;
|
|
10
|
+
displayIndexList: number[];
|
|
11
|
+
cols: number;
|
|
12
|
+
colGap: number;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const GridContextInjectionKey: InjectionKey<GridContext>;
|
|
15
|
+
export type GridDataCollector = Readonly<{
|
|
16
|
+
collectItemData: (index: number, itemData: GridItemData) => void;
|
|
17
|
+
removeItemData: (index: number) => void;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const GridDataCollectorInjectionKey: InjectionKey<GridDataCollector>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { ResponsiveValue } from './interface';
|
|
3
|
+
/**
|
|
4
|
+
* @version 2.15.0
|
|
5
|
+
* @zh 响应式配置从 `2.18.0` 开始支持,具体配置 [ResponsiveValue](#responsivevalue)
|
|
6
|
+
* @en Responsive configuration has been supported since `2.18.0`, the specific configuration [ResponsiveValue](#responsivevalue)
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
9
|
+
/**
|
|
10
|
+
* @zh 跨越的格数
|
|
11
|
+
* @en Number of grids spanned
|
|
12
|
+
*/
|
|
13
|
+
span: {
|
|
14
|
+
type: PropType<number | ResponsiveValue>;
|
|
15
|
+
default: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @zh 左侧的间隔格数
|
|
19
|
+
* @en Number of grids on the left
|
|
20
|
+
*/
|
|
21
|
+
offset: {
|
|
22
|
+
type: PropType<number | ResponsiveValue>;
|
|
23
|
+
default: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* @zh 是否是后缀元素
|
|
27
|
+
* @en Is it a suffix element
|
|
28
|
+
*/
|
|
29
|
+
suffix: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
}>, {
|
|
34
|
+
classNames: import('vue').ComputedRef<string[]>;
|
|
35
|
+
style: import('vue').ComputedRef<({
|
|
36
|
+
'margin-left': string;
|
|
37
|
+
} | {
|
|
38
|
+
'margin-left'?: undefined;
|
|
39
|
+
} | {
|
|
40
|
+
'grid-column': string;
|
|
41
|
+
display?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
display: string;
|
|
44
|
+
'grid-column'?: undefined;
|
|
45
|
+
})[]>;
|
|
46
|
+
domRef: import('vue').Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
|
|
47
|
+
overflow: import('vue').ComputedRef<boolean>;
|
|
48
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
49
|
+
/**
|
|
50
|
+
* @zh 跨越的格数
|
|
51
|
+
* @en Number of grids spanned
|
|
52
|
+
*/
|
|
53
|
+
span: {
|
|
54
|
+
type: PropType<number | ResponsiveValue>;
|
|
55
|
+
default: number;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* @zh 左侧的间隔格数
|
|
59
|
+
* @en Number of grids on the left
|
|
60
|
+
*/
|
|
61
|
+
offset: {
|
|
62
|
+
type: PropType<number | ResponsiveValue>;
|
|
63
|
+
default: number;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* @zh 是否是后缀元素
|
|
67
|
+
* @en Is it a suffix element
|
|
68
|
+
*/
|
|
69
|
+
suffix: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
73
|
+
}>> & Readonly<{}>, {
|
|
74
|
+
span: number | ResponsiveValue;
|
|
75
|
+
offset: number | ResponsiveValue;
|
|
76
|
+
suffix: boolean;
|
|
77
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
78
|
+
export default _default;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { ResponsiveValue } from './interface';
|
|
3
|
+
/**
|
|
4
|
+
* @version 2.15.0
|
|
5
|
+
* @zh 响应式配置从 `2.18.0` 开始支持,具体配置 [ResponsiveValue](#responsivevalue)
|
|
6
|
+
* @en Responsive configuration has been supported since `2.18.0`, the specific configuration [ResponsiveValue](#responsivevalue)
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
9
|
+
/**
|
|
10
|
+
* @zh 每一行展示的列数
|
|
11
|
+
* @en Number of columns displayed in each row
|
|
12
|
+
*/
|
|
13
|
+
cols: {
|
|
14
|
+
type: PropType<number | ResponsiveValue>;
|
|
15
|
+
default: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @zh 行与行之间的间距
|
|
19
|
+
* @en The space in row-to-row
|
|
20
|
+
*/
|
|
21
|
+
rowGap: {
|
|
22
|
+
type: PropType<number | ResponsiveValue>;
|
|
23
|
+
default: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* @zh 列与列之间的间距
|
|
27
|
+
* @en The space in column-to-column
|
|
28
|
+
*/
|
|
29
|
+
colGap: {
|
|
30
|
+
type: PropType<number | ResponsiveValue>;
|
|
31
|
+
default: number;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @zh 是否折叠
|
|
35
|
+
* @en Whether to collapsed
|
|
36
|
+
*/
|
|
37
|
+
collapsed: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
default: boolean;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @zh 折叠时显示的行数
|
|
43
|
+
* @en Number of rows displayed when collapsed
|
|
44
|
+
*/
|
|
45
|
+
collapsedRows: {
|
|
46
|
+
type: NumberConstructor;
|
|
47
|
+
default: number;
|
|
48
|
+
};
|
|
49
|
+
}>, {
|
|
50
|
+
classNames: import('vue').ComputedRef<string[]>;
|
|
51
|
+
style: import('vue').ComputedRef<{
|
|
52
|
+
gap: string;
|
|
53
|
+
'grid-template-columns': string;
|
|
54
|
+
}[]>;
|
|
55
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
56
|
+
/**
|
|
57
|
+
* @zh 每一行展示的列数
|
|
58
|
+
* @en Number of columns displayed in each row
|
|
59
|
+
*/
|
|
60
|
+
cols: {
|
|
61
|
+
type: PropType<number | ResponsiveValue>;
|
|
62
|
+
default: number;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* @zh 行与行之间的间距
|
|
66
|
+
* @en The space in row-to-row
|
|
67
|
+
*/
|
|
68
|
+
rowGap: {
|
|
69
|
+
type: PropType<number | ResponsiveValue>;
|
|
70
|
+
default: number;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* @zh 列与列之间的间距
|
|
74
|
+
* @en The space in column-to-column
|
|
75
|
+
*/
|
|
76
|
+
colGap: {
|
|
77
|
+
type: PropType<number | ResponsiveValue>;
|
|
78
|
+
default: number;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* @zh 是否折叠
|
|
82
|
+
* @en Whether to collapsed
|
|
83
|
+
*/
|
|
84
|
+
collapsed: {
|
|
85
|
+
type: BooleanConstructor;
|
|
86
|
+
default: boolean;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* @zh 折叠时显示的行数
|
|
90
|
+
* @en Number of rows displayed when collapsed
|
|
91
|
+
*/
|
|
92
|
+
collapsedRows: {
|
|
93
|
+
type: NumberConstructor;
|
|
94
|
+
default: number;
|
|
95
|
+
};
|
|
96
|
+
}>> & Readonly<{}>, {
|
|
97
|
+
rowGap: number | ResponsiveValue;
|
|
98
|
+
cols: number | ResponsiveValue;
|
|
99
|
+
collapsed: boolean;
|
|
100
|
+
collapsedRows: number;
|
|
101
|
+
colGap: number | ResponsiveValue;
|
|
102
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
103
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export declare function useIndex({ itemRef, selector, index, parentClassName }: {
|
|
3
|
+
itemRef: Ref<HTMLElement | undefined>;
|
|
4
|
+
selector: string;
|
|
5
|
+
index?: Ref<number | undefined>;
|
|
6
|
+
parentClassName?: string;
|
|
7
|
+
}): {
|
|
8
|
+
computedIndex: import('vue').ComputedRef<number>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ResponsiveValue } from '../interface';
|
|
3
|
+
export declare function useResponsiveValue(props: Ref<{
|
|
4
|
+
val: number;
|
|
5
|
+
key: string;
|
|
6
|
+
xs?: number | {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
sm?: number | {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
md?: number | {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
};
|
|
15
|
+
lg?: number | {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
xl?: number | {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
};
|
|
21
|
+
xxl?: number | {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
};
|
|
24
|
+
}>): import('vue').ComputedRef<number | ResponsiveValue>;
|