cosey 0.4.52 → 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.
Files changed (50) hide show
  1. package/components/components.d.ts +3 -1
  2. package/components/components.js +1 -0
  3. package/components/field/components/checkbox-group/checkbox-group.d.ts +2 -2
  4. package/components/field/components/checkbox-group/checkbox-group.vue.js +8 -3
  5. package/components/field/components/radio-group/radio-group.d.ts +2 -2
  6. package/components/field/components/radio-group/radio-group.vue.js +7 -2
  7. package/components/field/components/remote-select/remote-select.d.ts +16 -0
  8. package/components/field/components/remote-select/remote-select.js +1 -0
  9. package/components/field/components/remote-select/remote-select.vue.d.ts +3 -0
  10. package/components/field/components/remote-select/remote-select.vue.js +32 -0
  11. package/components/field/components/select/select.d.ts +6 -3
  12. package/components/field/components/select/select.js +1 -1
  13. package/components/field/components/select/select.vue.js +21 -9
  14. package/components/field/components/select-v2/select-v2.d.ts +1 -2
  15. package/components/field/components/select-v2/select-v2.js +2 -1
  16. package/components/field/components/select-v2/select-v2.vue.js +11 -5
  17. package/components/field/field.d.ts +3 -0
  18. package/components/field/field.js +44 -42
  19. package/components/form/form-item.vue.js +1 -1
  20. package/components/form-group/form-group.d.ts +2 -2
  21. package/components/form-group/form-group.vue.js +9 -13
  22. package/components/form-group/style/index.js +2 -3
  23. package/components/form-query/form-query.vue.d.ts +2 -2
  24. package/components/form-query/form-query.vue.js +42 -41
  25. package/components/form-query/index.d.ts +6 -6
  26. package/components/form-query/style/index.js +4 -1
  27. package/components/image-card/image-card.vue.js +1 -1
  28. package/components/index.d.ts +1 -0
  29. package/components/index.js +2 -0
  30. package/components/remote-select/index.d.ts +1149 -0
  31. package/components/remote-select/index.js +8 -0
  32. package/components/remote-select/remote-select.d.ts +263 -0
  33. package/components/remote-select/remote-select.js +37 -0
  34. package/components/remote-select/remote-select.vue.d.ts +530 -0
  35. package/components/remote-select/remote-select.vue.js +187 -0
  36. package/components/remote-select/style/index.d.ts +4 -0
  37. package/components/remote-select/style/index.js +33 -0
  38. package/components/table/table-query/table-query.vue.d.ts +3 -3
  39. package/components/table/table.vue.js +5 -5
  40. package/hooks/index.d.ts +1 -0
  41. package/hooks/index.js +1 -0
  42. package/hooks/useProps.d.ts +24 -0
  43. package/hooks/useProps.js +29 -0
  44. package/package.json +1 -1
  45. package/utils/components.d.ts +29 -0
  46. package/utils/components.js +13 -0
  47. package/utils/index.d.ts +1 -0
  48. package/utils/index.js +1 -0
  49. package/components/table/utils.d.ts +0 -6
  50. 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, };
@@ -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
- labelKey?: string;
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", "labelKey", "valueKey", "type", "checkboxWidth", "maxHeight"]);
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[componentProps.value.labelKey || "label"],
20
- value: option[componentProps.value.valueKey || "value"]
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
- labelKey?: string;
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[componentProps.value.labelKey || "label"],
14
- value: option[componentProps.value.valueKey || "value"]
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,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
- labelKey?: string;
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: FieldSelectObjectOption, index: number) => any;
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;
@@ -1,4 +1,4 @@
1
- const fieldSelectOmitKeys = ["options", "labelKey", "valueKey"];
1
+ const fieldSelectOmitKeys = ["options", "props", "optionProps"];
2
2
  function flatGroup(options, children = "children") {
3
3
  return options.map((option) => {
4
4
  if (children in option) {
@@ -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 ("children" in option) {
29
+ if (aliasProps.value.options in option) {
22
30
  return {
23
31
  ...option,
24
- children: convertRecur(option.children)
32
+ options: convertRecur(getOptions(option))
25
33
  };
26
34
  }
27
35
  return {
28
36
  ...option,
29
- label: option[componentProps.value.labelKey || "label"],
30
- value: option[componentProps.value.valueKey || "value"]
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: isObject(option.value) && componentProps.value.valueKey ? option.value[componentProps.value.valueKey] : option.value,
55
+ key: getKey(value),
47
56
  ...(isFunction(optionProps) ? optionProps(option, index) : optionProps)
48
- }, slots.option ? () => slots.option(option, index) : void 0);
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) => "children" in item ? h(ElOptionGroup, {
78
+ default: () => convertedOptions.value.map((item, index) => "options" in item ? h(ElOptionGroup, {
67
79
  label: item.label,
68
80
  disabled: item.disabled
69
- }, () => item.children.map((item2, index2) => renderOption(item2, index2))) : renderOption(item, index))
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 childrenKey = computed(() => componentProps.value.props?.options || "children");
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 (childrenKey.value in option) {
25
+ if (aliasProps.value.options in option) {
20
26
  return {
21
27
  ...optionProps.value(option, index),
22
- [childrenKey.value]: convertRecur(option[childrenKey.value])
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
- }, componentProps.value, {
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$A from './components/autocomplete/autocomplete.vue.js';
2
- import stdin_default$z from './components/cascader/cascader.vue.js';
3
- import stdin_default$y from './components/checkbox/checkbox.vue.js';
4
- import stdin_default$x from './components/checkbox-group/checkbox-group.vue.js';
5
- import stdin_default$w from './components/color/color.vue.js';
6
- import stdin_default$v from './components/date/date.vue.js';
7
- import stdin_default$u from './components/date-range/date-range.vue.js';
8
- import stdin_default$s from './components/date-time/date-time.vue.js';
9
- import stdin_default$r from './components/date-time-range/date-time-range.vue.js';
10
- import stdin_default$t from './components/dates/dates.vue.js';
11
- import stdin_default$q from './components/input/input.vue.js';
12
- import stdin_default$p from './components/input-tag/input-tag.vue.js';
13
- import stdin_default$o from './components/mention/mention.vue.js';
14
- import stdin_default$n from './components/month/month.vue.js';
15
- import stdin_default$m from './components/month-range/month-range.vue.js';
16
- import stdin_default$l from './components/months/months.vue.js';
17
- import stdin_default$k from './components/number/number.vue.js';
18
- import stdin_default$j from './components/number-range/number-range.vue.js';
19
- import stdin_default$i from './components/password/password.vue.js';
20
- import stdin_default$h from './components/radio-group/radio-group.vue.js';
21
- import stdin_default$g from './components/rate/rate.vue.js';
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$A,
41
- cascader: stdin_default$z,
42
- checkbox: stdin_default$y,
43
- checkboxgroup: stdin_default$x,
44
- color: stdin_default$w,
45
- date: stdin_default$v,
46
- daterange: stdin_default$u,
47
- dates: stdin_default$t,
48
- datetime: stdin_default$s,
49
- datetimerange: stdin_default$r,
50
- input: stdin_default$q,
51
- inputtag: stdin_default$p,
52
- mention: stdin_default$o,
53
- month: stdin_default$n,
54
- monthrange: stdin_default$m,
55
- months: stdin_default$l,
56
- number: stdin_default$k,
57
- numberrange: stdin_default$j,
58
- password: stdin_default$i,
59
- radiogroup: stdin_default$h,
60
- rate: stdin_default$g,
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
 
@@ -1,7 +1,7 @@
1
1
  import { type SpaceProps } from 'element-plus';
2
- export interface FormGroupProps extends Partial<SpaceProps> {
2
+ export interface FormGroupProps extends Partial<Omit<SpaceProps, 'class' | 'style'>> {
3
3
  title?: string;
4
- borderStyle?: 'none' | 'solid' | 'dashed';
4
+ borderStyle?: 'none' | 'solid' | 'dashed' | 'dotted';
5
5
  position?: 'left' | 'right' | 'center';
6
6
  collapsible?: boolean;
7
7
  collapsed?: boolean;
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, watch, resolveComponent, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, withDirectives, createElementVNode, normalizeStyle, createBlock, createTextVNode, toDisplayString, createVNode, mergeProps, withCtx, renderSlot, vShow } from 'vue';
1
+ import { defineComponent, ref, computed, watch, resolveComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createCommentVNode, withDirectives, createElementVNode, createBlock, createTextVNode, toDisplayString, createVNode, mergeProps, withCtx, renderSlot, vShow } from 'vue';
2
2
  import { reactiveOmit } from '@vueuse/core';
3
3
  import stdin_default$2 from '../icon/icon.vue.js';
4
4
  import stdin_default$1 from './style/index.js';
@@ -35,14 +35,6 @@ var stdin_default = /* @__PURE__ */defineComponent({
35
35
  type: String,
36
36
  required: false
37
37
  },
38
- class: {
39
- type: null,
40
- required: false
41
- },
42
- style: {
43
- type: null,
44
- required: false
45
- },
46
38
  alignment: {
47
39
  type: null,
48
40
  required: false,
@@ -89,6 +81,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
89
81
  } = stdin_default$1(prefixCls);
90
82
  const spaceProps = reactiveOmit(props, ["title", "borderStyle", "position", "collapsible", "collapsed"]);
91
83
  const innerCollapsed = ref(false);
84
+ const isBordered = computed(() => !!props.title);
92
85
  watch(() => props.collapsed, () => {
93
86
  innerCollapsed.value = !!props.collapsed;
94
87
  }, {
@@ -104,9 +97,12 @@ var stdin_default = /* @__PURE__ */defineComponent({
104
97
  const _component_el_space = resolveComponent("el-space");
105
98
  return openBlock(), createElementBlock("div", {
106
99
  class: normalizeClass([unref(hashId), unref(prefixCls), {
107
- "is-bordered": !!_ctx.title,
100
+ "is-bordered": isBordered.value,
108
101
  "is-collapsed": innerCollapsed.value
109
- }])
102
+ }]),
103
+ style: normalizeStyle({
104
+ borderStyle: isBordered.value ? props.borderStyle : void 0
105
+ })
110
106
  }, [_ctx.title ? (openBlock(), createElementBlock("div", {
111
107
  key: 0,
112
108
  class: normalizeClass([`${unref(prefixCls)}-title`, `is-${_ctx.position}`])
@@ -134,8 +130,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
134
130
  _: 3
135
131
  /* FORWARDED */
136
132
  }, 16
137
- /* FULL_PROPS */), [[vShow, !innerCollapsed.value]])], 2
138
- /* CLASS */);
133
+ /* FULL_PROPS */), [[vShow, !innerCollapsed.value]])], 6
134
+ /* CLASS, STYLE */);
139
135
  };
140
136
  }
141
137
  });
@@ -6,10 +6,9 @@ var stdin_default = getSimpleStyleHook("FromGroup", (token) => {
6
6
  [componentCls]: {
7
7
  "&.is-bordered": {
8
8
  position: "relative",
9
- marginBlockStart: token.marginSM,
9
+ marginBlock: token.marginLG,
10
+ padding: token.paddingMD,
10
11
  paddingBlockStart: token.paddingLG,
11
- paddingBlockEnd: token.paddingMD,
12
- paddingInline: token.paddingMD,
13
12
  border: `${token.lineWidth} ${token.lineType} ${token.colorBorder}`,
14
13
  borderRadius: token.borderRadius,
15
14
  "&.is-collapsed": {
@@ -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;