cosey 0.4.53 → 0.5.0
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/components/components.d.ts +3 -1
- package/components/components.js +1 -0
- package/components/field/components/checkbox-group/checkbox-group.d.ts +2 -2
- package/components/field/components/checkbox-group/checkbox-group.vue.js +8 -3
- package/components/field/components/radio-group/radio-group.d.ts +2 -2
- package/components/field/components/radio-group/radio-group.vue.js +7 -2
- package/components/field/components/remote-select/remote-select.d.ts +16 -0
- package/components/field/components/remote-select/remote-select.js +1 -0
- package/components/field/components/remote-select/remote-select.vue.d.ts +3 -0
- package/components/field/components/remote-select/remote-select.vue.js +32 -0
- package/components/field/components/select/select.d.ts +6 -3
- package/components/field/components/select/select.js +1 -1
- package/components/field/components/select/select.vue.js +21 -9
- package/components/field/components/select-v2/select-v2.d.ts +1 -2
- package/components/field/components/select-v2/select-v2.js +2 -1
- package/components/field/components/select-v2/select-v2.vue.js +11 -5
- package/components/field/field.d.ts +3 -0
- package/components/field/field.js +44 -42
- package/components/form/form-item.vue.js +1 -1
- package/components/form-group/form-group.vue.js +0 -1
- package/components/form-query/form-query.vue.d.ts +2 -2
- package/components/form-query/form-query.vue.js +42 -41
- package/components/form-query/index.d.ts +6 -6
- package/components/form-query/style/index.js +4 -1
- package/components/image-card/image-card.vue.js +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +2 -0
- package/components/remote-select/index.d.ts +1149 -0
- package/components/remote-select/index.js +8 -0
- package/components/remote-select/remote-select.d.ts +263 -0
- package/components/remote-select/remote-select.js +37 -0
- package/components/remote-select/remote-select.vue.d.ts +530 -0
- package/components/remote-select/remote-select.vue.js +187 -0
- package/components/remote-select/style/index.d.ts +4 -0
- package/components/remote-select/style/index.js +33 -0
- package/components/table/table-query/table-query.vue.d.ts +3 -3
- package/components/table/table.vue.js +5 -5
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +1 -0
- package/hooks/useProps.d.ts +24 -0
- package/hooks/useProps.js +29 -0
- package/package.json +1 -1
- package/utils/components.d.ts +29 -0
- package/utils/components.js +13 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/components/table/utils.d.ts +0 -6
- package/components/table/utils.js +0 -7
|
@@ -32,6 +32,7 @@ import { NumberFormat } from './number-format';
|
|
|
32
32
|
import { OnlyChild } from './only-child';
|
|
33
33
|
import { OptionalWrapper } from './optional-wrapper';
|
|
34
34
|
import { Panel } from './panel';
|
|
35
|
+
import { RemoteSelect } from './remote-select';
|
|
35
36
|
import { Row } from './row';
|
|
36
37
|
import { ScrollView } from './scroll-view';
|
|
37
38
|
import { SnugMenu, SnugMenuItem } from './snug-menu';
|
|
@@ -85,6 +86,7 @@ declare module 'vue' {
|
|
|
85
86
|
CoOnlyChild: typeof OnlyChild;
|
|
86
87
|
CoOptionalWrapper: typeof OptionalWrapper;
|
|
87
88
|
CoPanel: typeof Panel;
|
|
89
|
+
CoRemoteSelect: typeof RemoteSelect;
|
|
88
90
|
CoRow: typeof Row;
|
|
89
91
|
CoScrollView: typeof ScrollView;
|
|
90
92
|
CoSnugMenu: typeof SnugMenu;
|
|
@@ -101,4 +103,4 @@ declare module 'vue' {
|
|
|
101
103
|
CoVideoViewer: typeof VideoViewer;
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
|
-
export { AudioCard, AudioViewer, Card, Close, Col, ConfigProvider, Container, ContextMenu, ContextMenuItem, ContextSubMenu, Copy, DndSort, DndSortItem, Editor, Field, FileCard, Form, FormDialog, FormDrawer, FormGroup, FormItem, FormList, FormQuery, Highlight, HorizontalTree, Icon, IconifyIcon, ImageCard, InputNumberRange, LongText, Mask, MediaCard, MediaCardGroup, MediaViewer, NumberFormat, OnlyChild, OptionalWrapper, Panel, Row, ScrollView, SnugMenu, SnugMenuItem, StackDialog, SvgIcon, Table, TableAction, Toggle, Transition, TransitionGroup, Upload, VideoCard, VideoViewer, };
|
|
106
|
+
export { AudioCard, AudioViewer, Card, Close, Col, ConfigProvider, Container, ContextMenu, ContextMenuItem, ContextSubMenu, Copy, DndSort, DndSortItem, Editor, Field, FileCard, Form, FormDialog, FormDrawer, FormGroup, FormItem, FormList, FormQuery, Highlight, HorizontalTree, Icon, IconifyIcon, ImageCard, InputNumberRange, LongText, Mask, MediaCard, MediaCardGroup, MediaViewer, NumberFormat, OnlyChild, OptionalWrapper, Panel, RemoteSelect, Row, ScrollView, SnugMenu, SnugMenuItem, StackDialog, SvgIcon, Table, TableAction, Toggle, Transition, TransitionGroup, Upload, VideoCard, VideoViewer, };
|
package/components/components.js
CHANGED
|
@@ -32,6 +32,7 @@ export { NumberFormat } from './number-format/index.js';
|
|
|
32
32
|
export { OnlyChild } from './only-child/index.js';
|
|
33
33
|
export { OptionalWrapper } from './optional-wrapper/index.js';
|
|
34
34
|
export { Panel } from './panel/index.js';
|
|
35
|
+
export { RemoteSelect } from './remote-select/index.js';
|
|
35
36
|
export { Row } from './row/index.js';
|
|
36
37
|
export { ScrollView } from './scroll-view/index.js';
|
|
37
38
|
export { SnugMenu, SnugMenuItem } from './snug-menu/index.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CheckboxGroupValueType, type CheckboxGroupInstance, type CheckboxGroupProps, type CheckboxValueType, type CheckboxProps } from 'element-plus';
|
|
2
2
|
import { type FieldComponentCommonProps } from '../common';
|
|
3
|
+
import { Props } from '../../../../hooks';
|
|
3
4
|
export type FieldCheckboxGroupOption = Partial<CheckboxProps> | string | number;
|
|
4
5
|
export interface FieldCheckboxGroupProps extends FieldComponentCommonProps {
|
|
5
6
|
componentProps?: Partial<CheckboxGroupProps> & {
|
|
@@ -8,8 +9,7 @@ export interface FieldCheckboxGroupProps extends FieldComponentCommonProps {
|
|
|
8
9
|
[key: PropertyKey]: any;
|
|
9
10
|
} & {
|
|
10
11
|
options?: FieldCheckboxGroupOption[];
|
|
11
|
-
|
|
12
|
-
valueKey?: string;
|
|
12
|
+
props?: Props;
|
|
13
13
|
type?: 'button' | 'checkbox';
|
|
14
14
|
checkboxWidth?: string | number;
|
|
15
15
|
indeterminate?: boolean;
|
|
@@ -2,6 +2,7 @@ import { ElCheckboxButton, ElCheckbox, ElCheckboxGroup } from 'element-plus';
|
|
|
2
2
|
import { defineComponent, computed, h, mergeProps } from 'vue';
|
|
3
3
|
import stdin_default$1 from './panel.vue.js';
|
|
4
4
|
import { omit } from 'lodash-es';
|
|
5
|
+
import { useProps } from '../../../../hooks/useProps.js';
|
|
5
6
|
import { getLabelByValue } from '../../../../utils/collection.js';
|
|
6
7
|
import { isNumber } from '../../../../utils/is.js';
|
|
7
8
|
import { addNullablePlaceholder } from '../../../../utils/vue.js';
|
|
@@ -9,15 +10,19 @@ import { addNullablePlaceholder } from '../../../../utils/vue.js';
|
|
|
9
10
|
var stdin_default = defineComponent(props => {
|
|
10
11
|
const componentProps = computed(() => props.componentProps || {});
|
|
11
12
|
const checkboxGroupProps = computed(() => {
|
|
12
|
-
return omit(componentProps.value, ["options", "
|
|
13
|
+
return omit(componentProps.value, ["options", "props", "type", "checkboxWidth", "maxHeight"]);
|
|
13
14
|
});
|
|
15
|
+
const {
|
|
16
|
+
getLabel,
|
|
17
|
+
getValue
|
|
18
|
+
} = useProps(componentProps);
|
|
14
19
|
const convertedOptions = computed(() => {
|
|
15
20
|
return (componentProps.value.options ?? []).map(option => {
|
|
16
21
|
if (typeof option === "object") {
|
|
17
22
|
return {
|
|
18
23
|
...option,
|
|
19
|
-
label: option
|
|
20
|
-
value: option
|
|
24
|
+
label: getLabel(option),
|
|
25
|
+
value: getValue(option)
|
|
21
26
|
};
|
|
22
27
|
}
|
|
23
28
|
return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type RadioProps, type RadioGroupInstance, type RadioGroupProps } from 'element-plus';
|
|
2
2
|
import { type FieldComponentCommonProps } from '../common';
|
|
3
|
+
import { Props } from '../../../../hooks';
|
|
3
4
|
export type FieldRadioGroupOption = Partial<RadioProps> | string | number;
|
|
4
5
|
export interface FieldRadioGroupProps extends FieldComponentCommonProps {
|
|
5
6
|
componentProps?: Partial<RadioGroupProps> & {
|
|
@@ -8,8 +9,7 @@ export interface FieldRadioGroupProps extends FieldComponentCommonProps {
|
|
|
8
9
|
[key: PropertyKey]: any;
|
|
9
10
|
} & {
|
|
10
11
|
options?: FieldRadioGroupOption[];
|
|
11
|
-
|
|
12
|
-
valueKey?: string;
|
|
12
|
+
props?: Props;
|
|
13
13
|
type?: 'button' | 'radio';
|
|
14
14
|
};
|
|
15
15
|
componentSlots?: Partial<FieldRadioGroupSlots>;
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { ElRadioButton, ElRadio, ElRadioGroup } from 'element-plus';
|
|
2
2
|
import { defineComponent, computed, h, mergeProps } from 'vue';
|
|
3
|
+
import { useProps } from '../../../../hooks/useProps.js';
|
|
3
4
|
import { addNullablePlaceholder } from '../../../../utils/vue.js';
|
|
4
5
|
import { getLabelByValue } from '../../../../utils/collection.js';
|
|
5
6
|
|
|
6
7
|
var stdin_default = defineComponent(props => {
|
|
7
8
|
const componentProps = computed(() => props.componentProps || {});
|
|
9
|
+
const {
|
|
10
|
+
getLabel,
|
|
11
|
+
getValue
|
|
12
|
+
} = useProps(componentProps);
|
|
8
13
|
const convertedOptions = computed(() => {
|
|
9
14
|
return (componentProps.value.options ?? []).map(option => {
|
|
10
15
|
if (typeof option === "object") {
|
|
11
16
|
return {
|
|
12
17
|
...option,
|
|
13
|
-
label: option
|
|
14
|
-
value: option
|
|
18
|
+
label: getLabel(option),
|
|
19
|
+
value: getValue(option)
|
|
15
20
|
};
|
|
16
21
|
}
|
|
17
22
|
return {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type FieldComponentCommonProps } from '../common';
|
|
2
|
+
import { type RemoteSelectEmits, type RemoteSelectSlots, type RemoteSelectProps } from '../../../remote-select';
|
|
3
|
+
import { type ExtractPropTypes } from 'vue';
|
|
4
|
+
export interface FieldRemoteSelectProps extends FieldComponentCommonProps {
|
|
5
|
+
componentProps?: Partial<ExtractPropTypes<RemoteSelectProps>> & {
|
|
6
|
+
'onUpdate:modelValue'?: (value: any) => void;
|
|
7
|
+
onChange?: (value: any) => void;
|
|
8
|
+
[key: PropertyKey]: any;
|
|
9
|
+
};
|
|
10
|
+
componentSlots?: Partial<FieldRemoteSelectSlots>;
|
|
11
|
+
}
|
|
12
|
+
export interface FieldRemoteSelectSlots extends RemoteSelectSlots {
|
|
13
|
+
}
|
|
14
|
+
export interface FieldRemoteSelectEmits extends RemoteSelectEmits {
|
|
15
|
+
}
|
|
16
|
+
export type FieldRemoteSelectExpose = {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type FieldRemoteSelectProps, type FieldRemoteSelectSlots } from './remote-select';
|
|
2
|
+
declare const _default: import("vue").DefineSetupFnComponent<FieldRemoteSelectProps, {}, FieldRemoteSelectSlots, FieldRemoteSelectProps & {}, import("vue").PublicProps>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineComponent, h, mergeProps } from 'vue';
|
|
2
|
+
import { RemoteSelect as _RemoteSelect } from '../../../remote-select/index.js';
|
|
3
|
+
import { useLocale } from '../../../../hooks/useLocale.js';
|
|
4
|
+
import { addNullablePlaceholder } from '../../../../utils/vue.js';
|
|
5
|
+
|
|
6
|
+
var stdin_default = defineComponent((props, {
|
|
7
|
+
slots
|
|
8
|
+
}) => {
|
|
9
|
+
const {
|
|
10
|
+
t
|
|
11
|
+
} = useLocale();
|
|
12
|
+
return () => {
|
|
13
|
+
if (props.readonly) {
|
|
14
|
+
const value = props.componentProps?.modelValue;
|
|
15
|
+
return addNullablePlaceholder(value, val => val);
|
|
16
|
+
}
|
|
17
|
+
return h(_RemoteSelect, mergeProps({
|
|
18
|
+
placeholder: t("co.common.pleaseSelect"),
|
|
19
|
+
clearable: true,
|
|
20
|
+
style: {
|
|
21
|
+
verticalAlign: "top"
|
|
22
|
+
}
|
|
23
|
+
}, props.componentProps || {}), slots);
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
name: "FieldRemoteSelect",
|
|
27
|
+
inheritAttrs: false,
|
|
28
|
+
props: ["componentProps", "componentSlots", "readonly"],
|
|
29
|
+
slots: {}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export { stdin_default as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type SelectProps } from 'element-plus/es/components/select/src/select.mjs';
|
|
2
2
|
import { type FieldComponentCommonProps } from '../common';
|
|
3
3
|
import { type ExtractPropTypes } from 'vue';
|
|
4
|
+
import { Props } from '../../../../hooks';
|
|
4
5
|
export interface FieldSelectObjectOption {
|
|
5
6
|
label?: string | number;
|
|
6
7
|
value?: string | number | boolean;
|
|
@@ -29,8 +30,7 @@ export interface FieldSelectProps extends FieldComponentCommonProps {
|
|
|
29
30
|
[key: PropertyKey]: any;
|
|
30
31
|
} & {
|
|
31
32
|
options?: FieldSelectOption[];
|
|
32
|
-
|
|
33
|
-
valueKey?: string;
|
|
33
|
+
props?: Props;
|
|
34
34
|
optionProps?: Record<PropertyKey, any> | ((props: FieldSelectObjectOption, index: number) => Record<PropertyKey, any>);
|
|
35
35
|
};
|
|
36
36
|
componentSlots?: Partial<FieldSelectSlots>;
|
|
@@ -45,7 +45,10 @@ export interface FieldSelectSlots {
|
|
|
45
45
|
tag?: (props: Record<string, any>) => any;
|
|
46
46
|
loading?: (props: Record<string, any>) => any;
|
|
47
47
|
label?: (props: Record<string, any>) => any;
|
|
48
|
-
option?: (props:
|
|
48
|
+
option?: (props: {
|
|
49
|
+
option: FieldSelectObjectOption;
|
|
50
|
+
index: number;
|
|
51
|
+
}) => any;
|
|
49
52
|
}
|
|
50
53
|
export interface FieldSelectEmits {
|
|
51
54
|
(e: 'update:modelValue', value: any): void;
|
|
@@ -2,9 +2,10 @@ import { ElSelect, ElOptionGroup, ElOption } from 'element-plus';
|
|
|
2
2
|
import { defineComponent, computed, unref, h, mergeProps } from 'vue';
|
|
3
3
|
import { fieldSelectOmitKeys, flatGroup } from './select.js';
|
|
4
4
|
import { omit } from 'lodash-es';
|
|
5
|
-
import { isFunction, isObject } from '../../../../utils/is.js';
|
|
6
5
|
import { useLocale } from '../../../../hooks/useLocale.js';
|
|
6
|
+
import { useProps } from '../../../../hooks/useProps.js';
|
|
7
7
|
import { addNullablePlaceholder } from '../../../../utils/vue.js';
|
|
8
|
+
import { isFunction } from '../../../../utils/is.js';
|
|
8
9
|
import { getLabelByValue } from '../../../../utils/collection.js';
|
|
9
10
|
|
|
10
11
|
var stdin_default = defineComponent((props, {
|
|
@@ -15,19 +16,26 @@ var stdin_default = defineComponent((props, {
|
|
|
15
16
|
} = useLocale();
|
|
16
17
|
const componentProps = computed(() => props.componentProps || {});
|
|
17
18
|
const omittedProps = computed(() => omit(componentProps.value, fieldSelectOmitKeys));
|
|
19
|
+
const {
|
|
20
|
+
getLabel,
|
|
21
|
+
getValue,
|
|
22
|
+
getOptions,
|
|
23
|
+
getKey,
|
|
24
|
+
aliasProps
|
|
25
|
+
} = useProps(componentProps);
|
|
18
26
|
function convertRecur(options) {
|
|
19
27
|
return options.map(option => {
|
|
20
28
|
if (typeof option === "object") {
|
|
21
|
-
if (
|
|
29
|
+
if (aliasProps.value.options in option) {
|
|
22
30
|
return {
|
|
23
31
|
...option,
|
|
24
|
-
|
|
32
|
+
options: convertRecur(getOptions(option))
|
|
25
33
|
};
|
|
26
34
|
}
|
|
27
35
|
return {
|
|
28
36
|
...option,
|
|
29
|
-
label: option
|
|
30
|
-
value: option
|
|
37
|
+
label: getLabel(option),
|
|
38
|
+
value: getValue(option)
|
|
31
39
|
};
|
|
32
40
|
}
|
|
33
41
|
return {
|
|
@@ -41,11 +49,15 @@ var stdin_default = defineComponent((props, {
|
|
|
41
49
|
});
|
|
42
50
|
function renderOption(option, index) {
|
|
43
51
|
const optionProps = componentProps.value.optionProps;
|
|
52
|
+
const value = getValue(option);
|
|
44
53
|
return h(ElOption, {
|
|
45
54
|
...option,
|
|
46
|
-
key:
|
|
55
|
+
key: getKey(value),
|
|
47
56
|
...(isFunction(optionProps) ? optionProps(option, index) : optionProps)
|
|
48
|
-
}, slots.option ? () => slots.option(
|
|
57
|
+
}, slots.option ? () => slots.option({
|
|
58
|
+
option,
|
|
59
|
+
index
|
|
60
|
+
}) : void 0);
|
|
49
61
|
}
|
|
50
62
|
return () => {
|
|
51
63
|
if (props.readonly) {
|
|
@@ -63,10 +75,10 @@ var stdin_default = defineComponent((props, {
|
|
|
63
75
|
}
|
|
64
76
|
}, omittedProps.value), {
|
|
65
77
|
...slots,
|
|
66
|
-
default: () => convertedOptions.value.map((item, index) => "
|
|
78
|
+
default: () => convertedOptions.value.map((item, index) => "options" in item ? h(ElOptionGroup, {
|
|
67
79
|
label: item.label,
|
|
68
80
|
disabled: item.disabled
|
|
69
|
-
}, () => item.
|
|
81
|
+
}, () => item.options.map((item2, index2) => renderOption(item2, index2))) : renderOption(item, index))
|
|
70
82
|
});
|
|
71
83
|
};
|
|
72
84
|
}, {
|
|
@@ -11,12 +11,11 @@ export interface FieldSelectV2Props extends FieldComponentCommonProps {
|
|
|
11
11
|
onFocus?: (event: FocusEvent) => void;
|
|
12
12
|
[key: PropertyKey]: any;
|
|
13
13
|
} & {
|
|
14
|
-
labelKey?: string;
|
|
15
|
-
valueKey?: string;
|
|
16
14
|
optionProps?: (props: Record<PropertyKey, any>, index: number) => Record<PropertyKey, any>;
|
|
17
15
|
};
|
|
18
16
|
componentSlots?: Partial<FieldSelectV2Slots>;
|
|
19
17
|
}
|
|
18
|
+
export declare const fieldSelectOmitKeys: string[];
|
|
20
19
|
export interface FieldSelectV2Slots {
|
|
21
20
|
default?: (props: Record<string, any>) => any;
|
|
22
21
|
header?: (props: Record<string, any>) => any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const fieldSelectOmitKeys = ["optionProps"];
|
|
1
2
|
function flatGroup(options, children = "options") {
|
|
2
3
|
return options.map((option) => {
|
|
3
4
|
if (children in option) {
|
|
@@ -7,4 +8,4 @@ function flatGroup(options, children = "options") {
|
|
|
7
8
|
}).flat();
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
export { flatGroup };
|
|
11
|
+
export { fieldSelectOmitKeys, flatGroup };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ElSelectV2 } from 'element-plus';
|
|
2
2
|
import { defineComponent, computed, unref, h, mergeProps } from 'vue';
|
|
3
|
-
import { flatGroup } from './select-v2.js';
|
|
3
|
+
import { fieldSelectOmitKeys, flatGroup } from './select-v2.js';
|
|
4
|
+
import { omit } from 'lodash-es';
|
|
4
5
|
import { useLocale } from '../../../../hooks/useLocale.js';
|
|
6
|
+
import { useProps } from '../../../../hooks/useProps.js';
|
|
5
7
|
import { addNullablePlaceholder } from '../../../../utils/vue.js';
|
|
6
8
|
import { getLabelByValue } from '../../../../utils/collection.js';
|
|
7
9
|
|
|
@@ -12,14 +14,18 @@ var stdin_default = defineComponent((props, {
|
|
|
12
14
|
t
|
|
13
15
|
} = useLocale();
|
|
14
16
|
const componentProps = computed(() => props.componentProps || {});
|
|
15
|
-
const
|
|
17
|
+
const omittedProps = computed(() => omit(componentProps.value, fieldSelectOmitKeys));
|
|
18
|
+
const {
|
|
19
|
+
getOptions,
|
|
20
|
+
aliasProps
|
|
21
|
+
} = useProps(componentProps);
|
|
16
22
|
const optionProps = computed(() => componentProps.value.optionProps || (option => option));
|
|
17
23
|
function convertRecur(options) {
|
|
18
24
|
return options.map((option, index) => {
|
|
19
|
-
if (
|
|
25
|
+
if (aliasProps.value.options in option) {
|
|
20
26
|
return {
|
|
21
27
|
...optionProps.value(option, index),
|
|
22
|
-
[
|
|
28
|
+
[aliasProps.value.options]: convertRecur(getOptions(option))
|
|
23
29
|
};
|
|
24
30
|
}
|
|
25
31
|
return optionProps.value(option, index);
|
|
@@ -42,7 +48,7 @@ var stdin_default = defineComponent((props, {
|
|
|
42
48
|
style: {
|
|
43
49
|
verticalAlign: "top"
|
|
44
50
|
}
|
|
45
|
-
},
|
|
51
|
+
}, omittedProps.value, {
|
|
46
52
|
options: convertedOptions.value
|
|
47
53
|
}), slots);
|
|
48
54
|
};
|
|
@@ -19,6 +19,7 @@ import { type FieldNumberRangeProps } from './components/number-range/number-ran
|
|
|
19
19
|
import { type FieldPasswordProps } from './components/password/password';
|
|
20
20
|
import { type FieldRadioGroupProps } from './components/radio-group/radio-group';
|
|
21
21
|
import { type FieldRateProps } from './components/rate/rate';
|
|
22
|
+
import { type FieldRemoteSelectProps } from './components/remote-select/remote-select';
|
|
22
23
|
import { type FieldSegmentedProps } from './components/segmented/segmented';
|
|
23
24
|
import { type FieldSelectProps } from './components/select/select';
|
|
24
25
|
import { type FieldSelectV2Props } from './components/select-v2/select-v2';
|
|
@@ -57,6 +58,7 @@ export interface MapFieldTypeComponentProps {
|
|
|
57
58
|
password: FieldPasswordProps;
|
|
58
59
|
radiogroup: FieldRadioGroupProps;
|
|
59
60
|
rate: FieldRateProps;
|
|
61
|
+
remoteselect: FieldRemoteSelectProps;
|
|
60
62
|
segmented: FieldSegmentedProps;
|
|
61
63
|
select: FieldSelectProps;
|
|
62
64
|
selectv2: FieldSelectV2Props;
|
|
@@ -97,6 +99,7 @@ export declare const mapFieldTypeComponent: {
|
|
|
97
99
|
password: import("vue").DefineSetupFnComponent<FieldInputProps, {}, import("vue").SlotsType<import("./components/input/input").FieldInputSlots>, FieldInputProps & {}, import("vue").PublicProps>;
|
|
98
100
|
radiogroup: import("vue").DefineSetupFnComponent<FieldRadioGroupProps, {}, import("vue").SlotsType<import("./components/radio-group/radio-group").FieldRadioGroupSlots>, FieldRadioGroupProps & {}, import("vue").PublicProps>;
|
|
99
101
|
rate: import("vue").DefineSetupFnComponent<FieldRateProps, {}, import("vue").SlotsType<import("./components/rate/rate").FieldRateSlots>, FieldRateProps & {}, import("vue").PublicProps>;
|
|
102
|
+
remoteselect: import("vue").DefineSetupFnComponent<FieldRemoteSelectProps, {}, import("./components/remote-select/remote-select").FieldRemoteSelectSlots, FieldRemoteSelectProps & {}, import("vue").PublicProps>;
|
|
100
103
|
segmented: import("vue").DefineSetupFnComponent<FieldSegmentedProps, {}, import("vue").SlotsType<import("./components/segmented/segmented").FieldSegmentedSlots>, FieldSegmentedProps & {}, import("vue").PublicProps>;
|
|
101
104
|
select: import("vue").DefineSetupFnComponent<FieldSelectProps, {}, import("vue").SlotsType<import("./components/select/select").FieldSelectSlots>, FieldSelectProps & {}, import("vue").PublicProps>;
|
|
102
105
|
selectv2: import("vue").DefineSetupFnComponent<FieldSelectV2Props, {}, import("vue").SlotsType<import("./components/select-v2/select-v2").FieldSelectV2Slots>, FieldSelectV2Props & {}, import("vue").PublicProps>;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import stdin_default$
|
|
2
|
-
import stdin_default$
|
|
3
|
-
import stdin_default$
|
|
4
|
-
import stdin_default$
|
|
5
|
-
import stdin_default$
|
|
6
|
-
import stdin_default$
|
|
7
|
-
import stdin_default$
|
|
8
|
-
import stdin_default$
|
|
9
|
-
import stdin_default$
|
|
10
|
-
import stdin_default$
|
|
11
|
-
import stdin_default$
|
|
12
|
-
import stdin_default$
|
|
13
|
-
import stdin_default$
|
|
14
|
-
import stdin_default$
|
|
15
|
-
import stdin_default$
|
|
16
|
-
import stdin_default$
|
|
17
|
-
import stdin_default$
|
|
18
|
-
import stdin_default$
|
|
19
|
-
import stdin_default$
|
|
20
|
-
import stdin_default$
|
|
21
|
-
import stdin_default$
|
|
1
|
+
import stdin_default$B from './components/autocomplete/autocomplete.vue.js';
|
|
2
|
+
import stdin_default$A from './components/cascader/cascader.vue.js';
|
|
3
|
+
import stdin_default$z from './components/checkbox/checkbox.vue.js';
|
|
4
|
+
import stdin_default$y from './components/checkbox-group/checkbox-group.vue.js';
|
|
5
|
+
import stdin_default$x from './components/color/color.vue.js';
|
|
6
|
+
import stdin_default$w from './components/date/date.vue.js';
|
|
7
|
+
import stdin_default$v from './components/date-range/date-range.vue.js';
|
|
8
|
+
import stdin_default$t from './components/date-time/date-time.vue.js';
|
|
9
|
+
import stdin_default$s from './components/date-time-range/date-time-range.vue.js';
|
|
10
|
+
import stdin_default$u from './components/dates/dates.vue.js';
|
|
11
|
+
import stdin_default$r from './components/input/input.vue.js';
|
|
12
|
+
import stdin_default$q from './components/input-tag/input-tag.vue.js';
|
|
13
|
+
import stdin_default$p from './components/mention/mention.vue.js';
|
|
14
|
+
import stdin_default$o from './components/month/month.vue.js';
|
|
15
|
+
import stdin_default$n from './components/month-range/month-range.vue.js';
|
|
16
|
+
import stdin_default$m from './components/months/months.vue.js';
|
|
17
|
+
import stdin_default$l from './components/number/number.vue.js';
|
|
18
|
+
import stdin_default$k from './components/number-range/number-range.vue.js';
|
|
19
|
+
import stdin_default$j from './components/password/password.vue.js';
|
|
20
|
+
import stdin_default$i from './components/radio-group/radio-group.vue.js';
|
|
21
|
+
import stdin_default$h from './components/rate/rate.vue.js';
|
|
22
|
+
import stdin_default$g from './components/remote-select/remote-select.vue.js';
|
|
22
23
|
import stdin_default$f from './components/segmented/segmented.vue.js';
|
|
23
24
|
import stdin_default$e from './components/select/select.vue.js';
|
|
24
25
|
import stdin_default$d from './components/select-v2/select-v2.vue.js';
|
|
@@ -37,27 +38,28 @@ import stdin_default$1 from './components/year-range/year-range.vue.js';
|
|
|
37
38
|
import stdin_default from './components/years/years.vue.js';
|
|
38
39
|
|
|
39
40
|
const mapFieldTypeComponent = {
|
|
40
|
-
autocomplete: stdin_default$
|
|
41
|
-
cascader: stdin_default$
|
|
42
|
-
checkbox: stdin_default$
|
|
43
|
-
checkboxgroup: stdin_default$
|
|
44
|
-
color: stdin_default$
|
|
45
|
-
date: stdin_default$
|
|
46
|
-
daterange: stdin_default$
|
|
47
|
-
dates: stdin_default$
|
|
48
|
-
datetime: stdin_default$
|
|
49
|
-
datetimerange: stdin_default$
|
|
50
|
-
input: stdin_default$
|
|
51
|
-
inputtag: stdin_default$
|
|
52
|
-
mention: stdin_default$
|
|
53
|
-
month: stdin_default$
|
|
54
|
-
monthrange: stdin_default$
|
|
55
|
-
months: stdin_default$
|
|
56
|
-
number: stdin_default$
|
|
57
|
-
numberrange: stdin_default$
|
|
58
|
-
password: stdin_default$
|
|
59
|
-
radiogroup: stdin_default$
|
|
60
|
-
rate: stdin_default$
|
|
41
|
+
autocomplete: stdin_default$B,
|
|
42
|
+
cascader: stdin_default$A,
|
|
43
|
+
checkbox: stdin_default$z,
|
|
44
|
+
checkboxgroup: stdin_default$y,
|
|
45
|
+
color: stdin_default$x,
|
|
46
|
+
date: stdin_default$w,
|
|
47
|
+
daterange: stdin_default$v,
|
|
48
|
+
dates: stdin_default$u,
|
|
49
|
+
datetime: stdin_default$t,
|
|
50
|
+
datetimerange: stdin_default$s,
|
|
51
|
+
input: stdin_default$r,
|
|
52
|
+
inputtag: stdin_default$q,
|
|
53
|
+
mention: stdin_default$p,
|
|
54
|
+
month: stdin_default$o,
|
|
55
|
+
monthrange: stdin_default$n,
|
|
56
|
+
months: stdin_default$m,
|
|
57
|
+
number: stdin_default$l,
|
|
58
|
+
numberrange: stdin_default$k,
|
|
59
|
+
password: stdin_default$j,
|
|
60
|
+
radiogroup: stdin_default$i,
|
|
61
|
+
rate: stdin_default$h,
|
|
62
|
+
remoteselect: stdin_default$g,
|
|
61
63
|
segmented: stdin_default$f,
|
|
62
64
|
select: stdin_default$e,
|
|
63
65
|
selectv2: stdin_default$d,
|
|
@@ -12,9 +12,9 @@ import { reactiveOmit } from '@vueuse/core';
|
|
|
12
12
|
import { useToken } from '../theme/util/useToken.js';
|
|
13
13
|
import { omit } from 'lodash-es';
|
|
14
14
|
import { omitUndefined } from '../../utils/object.js';
|
|
15
|
+
import { createMergedExpose, defineTemplate } from '../../utils/vue.js';
|
|
15
16
|
import { useComponentConfig } from '../config-provider/config-provider.js';
|
|
16
17
|
import { useLocale } from '../../hooks/useLocale.js';
|
|
17
|
-
import { createMergedExpose, defineTemplate } from '../../utils/vue.js';
|
|
18
18
|
import { toArray } from '../../utils/array.js';
|
|
19
19
|
import { isString, isNumber } from '../../utils/is.js';
|
|
20
20
|
|
|
@@ -295,6 +295,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
295
295
|
inlineMessage: boolean;
|
|
296
296
|
showMessage: boolean;
|
|
297
297
|
colProps: import("..").ColProps;
|
|
298
|
+
minFields: number;
|
|
299
|
+
collapsed: boolean;
|
|
298
300
|
submitText: string;
|
|
299
301
|
resetText: string;
|
|
300
302
|
hideSubmit: boolean;
|
|
@@ -306,8 +308,6 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
306
308
|
hideRequiredAsterisk: boolean;
|
|
307
309
|
scrollToError: boolean;
|
|
308
310
|
scrollIntoViewOptions: boolean | Record<string, any>;
|
|
309
|
-
minFields: number;
|
|
310
|
-
collapsed: boolean;
|
|
311
311
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
312
312
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
313
313
|
export default _default;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { defineComponent, useSlots, computed, ref, Fragment, provide, createBlock, openBlock, unref, mergeProps, withCtx,
|
|
1
|
+
import { defineComponent, useSlots, computed, ref, Fragment, provide, createBlock, openBlock, unref, mergeProps, withCtx, createElementBlock, resolveDynamicComponent, renderSlot, cloneVNode, isVNode, createVNode } from 'vue';
|
|
2
2
|
import { formQueryProps, defaultMapSizeColNumber, formQueryContextSymbol } from './form-query.js';
|
|
3
3
|
import { ElForm, ElButton } from 'element-plus';
|
|
4
4
|
import { FormItem as _FormItem } from '../form/index.js';
|
|
5
5
|
import { Row as _Row } from '../row/index.js';
|
|
6
6
|
import { Toggle as _Toggle } from '../toggle/index.js';
|
|
7
7
|
import stdin_default$1 from './style/index.js';
|
|
8
|
+
import { Search } from '@element-plus/icons-vue';
|
|
8
9
|
import { useFormTemplate } from '../form/useFormTemplate.js';
|
|
9
10
|
import { useComponentConfig } from '../config-provider/config-provider.js';
|
|
10
11
|
import { useLocale } from '../../hooks/useLocale.js';
|
|
11
12
|
import { useTwoWayBinding } from '../../hooks/useTwoWayBinding.js';
|
|
12
13
|
import { defineTemplate } from '../../utils/vue.js';
|
|
13
14
|
|
|
15
|
+
function _isSlot(s) {
|
|
16
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
17
|
+
}
|
|
14
18
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
15
19
|
...{
|
|
16
20
|
name: "FormQuery"
|
|
@@ -90,6 +94,37 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
90
94
|
}) : item;
|
|
91
95
|
});
|
|
92
96
|
});
|
|
97
|
+
const buttonsTemplate = defineTemplate(() => {
|
|
98
|
+
let _slot, _slot2;
|
|
99
|
+
return createVNode(_FormItem, {
|
|
100
|
+
"class": `${prefixCls.value}-form-item-buttons`,
|
|
101
|
+
"width": props.inline ? "auto" : void 0
|
|
102
|
+
}, {
|
|
103
|
+
default: () => [createVNode("div", {
|
|
104
|
+
"class": [`${prefixCls.value}-buttons`, {
|
|
105
|
+
"is-inline": props.inline
|
|
106
|
+
}]
|
|
107
|
+
}, [slots.button ? slots.button({
|
|
108
|
+
reset,
|
|
109
|
+
submit,
|
|
110
|
+
submitting: submitting.value
|
|
111
|
+
}) : createVNode(Fragment, null, [!props.hideSubmit && createVNode(ElButton, {
|
|
112
|
+
"onClick": () => submit(),
|
|
113
|
+
"type": "primary",
|
|
114
|
+
"loading": submitting.value,
|
|
115
|
+
"icon": Search
|
|
116
|
+
}, _isSlot(_slot = t("co.form.search")) ? _slot : {
|
|
117
|
+
default: () => [_slot]
|
|
118
|
+
}), !props.hideReset && createVNode(ElButton, {
|
|
119
|
+
"onClick": () => reset()
|
|
120
|
+
}, _isSlot(_slot2 = t("co.form.reset")) ? _slot2 : {
|
|
121
|
+
default: () => [_slot2]
|
|
122
|
+
})]), props.grid && showToggle.value && createVNode(_Toggle, {
|
|
123
|
+
"modelValue": innerCollapsed.value,
|
|
124
|
+
"onUpdate:modelValue": $event => innerCollapsed.value = $event
|
|
125
|
+
}, null)])]
|
|
126
|
+
});
|
|
127
|
+
});
|
|
93
128
|
__expose(expose);
|
|
94
129
|
return (_ctx, _cache) => {
|
|
95
130
|
return openBlock(), createBlock(unref(ElForm), mergeProps({
|
|
@@ -102,48 +137,14 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
102
137
|
}, mergedRowProps.value, {
|
|
103
138
|
onSizeChange: handleSizeChange
|
|
104
139
|
}), {
|
|
105
|
-
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(unref(template)))),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
default: withCtx(() => [createElementVNode("div", {
|
|
109
|
-
class: normalizeClass(`${unref(prefixCls)}-buttons`)
|
|
110
|
-
}, [renderSlot(_ctx.$slots, "button", {
|
|
111
|
-
reset: unref(reset),
|
|
112
|
-
submit: unref(submit),
|
|
113
|
-
submitting: unref(submitting)
|
|
114
|
-
}, () => [!_ctx.hideSubmit ? (openBlock(), createBlock(unref(ElButton), {
|
|
115
|
-
key: 0,
|
|
116
|
-
onClick: _cache[0] || (_cache[0] = () => unref(submit)()),
|
|
117
|
-
type: "primary",
|
|
118
|
-
loading: unref(submitting)
|
|
119
|
-
}, {
|
|
120
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.form.search")), 1
|
|
121
|
-
/* TEXT */)]),
|
|
122
|
-
_: 1
|
|
123
|
-
/* STABLE */
|
|
124
|
-
}, 8, ["loading"])) : createCommentVNode("v-if", true), !_ctx.hideReset ? (openBlock(), createBlock(unref(ElButton), {
|
|
125
|
-
key: 1,
|
|
126
|
-
onClick: unref(reset)
|
|
127
|
-
}, {
|
|
128
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.form.reset")), 1
|
|
129
|
-
/* TEXT */)]),
|
|
130
|
-
_: 1
|
|
131
|
-
/* STABLE */
|
|
132
|
-
}, 8, ["onClick"])) : createCommentVNode("v-if", true)]), showToggle.value ? (openBlock(), createBlock(unref(_Toggle), {
|
|
133
|
-
key: 0,
|
|
134
|
-
modelValue: unref(innerCollapsed),
|
|
135
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => isRef(innerCollapsed) ? innerCollapsed.value = $event : null)
|
|
136
|
-
}, null, 8, ["modelValue"])) : createCommentVNode("v-if", true)], 2
|
|
137
|
-
/* CLASS */)]),
|
|
138
|
-
_: 3
|
|
139
|
-
/* FORWARDED */
|
|
140
|
-
}, 8, ["class"])]),
|
|
141
|
-
_: 3
|
|
142
|
-
/* FORWARDED */
|
|
140
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(unref(template)))), (openBlock(), createBlock(resolveDynamicComponent(unref(buttonsTemplate))))]),
|
|
141
|
+
_: 1
|
|
142
|
+
/* STABLE */
|
|
143
143
|
}, 16
|
|
144
|
-
/* FULL_PROPS */)) :
|
|
144
|
+
/* FULL_PROPS */)) : (openBlock(), createElementBlock(Fragment, {
|
|
145
145
|
key: 1
|
|
146
|
-
})
|
|
146
|
+
}, [renderSlot(_ctx.$slots, "default"), (openBlock(), createBlock(resolveDynamicComponent(unref(buttonsTemplate))))], 64
|
|
147
|
+
/* STABLE_FRAGMENT */))]),
|
|
147
148
|
_: 3
|
|
148
149
|
/* FORWARDED */
|
|
149
150
|
}, 16, ["class"]);
|