ep-craft 0.1.26 → 0.1.28

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 (87) hide show
  1. package/dist/components/date-picker/src/date-picker.js +38 -34
  2. package/dist/components/date-picker/src/props.js +19 -7
  3. package/dist/components/form/EpForm.vue.d.ts +61 -0
  4. package/dist/components/form/EpForm.vue.js +199 -0
  5. package/dist/components/form/EpForm2.vue.js +4 -0
  6. package/dist/components/form/index.d.ts +12 -2
  7. package/dist/components/form/index.js +9 -3
  8. package/dist/components/form/instance.d.ts +2 -0
  9. package/dist/components/form/src/form-item.d.ts +103 -0
  10. package/dist/components/form/src/form-item.js +91 -0
  11. package/dist/components/form/src/form-label-wrap.d.ts +11 -0
  12. package/dist/components/form/src/form-label-wrap.js +74 -0
  13. package/dist/components/form/src/form.d.ts +127 -0
  14. package/dist/components/form/src/form.js +112 -0
  15. package/dist/components/form/src/types.d.ts +48 -19
  16. package/dist/components/form/src/utils.d.ts +9 -0
  17. package/dist/components/form/src/utils.js +45 -0
  18. package/dist/components/form-item/EpFormItem.vue.d.ts +55 -0
  19. package/dist/components/form-item/EpFormItem.vue.js +257 -0
  20. package/dist/components/form-item/EpFormItem2.vue.js +4 -0
  21. package/dist/components/form-item/index.d.ts +5 -2
  22. package/dist/components/form-item/index.js +5 -3
  23. package/dist/components/form-item/instance.d.ts +2 -0
  24. package/dist/components/scrollbar/index.d.ts +1 -0
  25. package/dist/components/scrollbar/src/util.d.ts +40 -0
  26. package/dist/components/scrollbar/src/util.js +25 -0
  27. package/dist/components/select/select.vue.d.ts +9 -9
  28. package/dist/components/select/src/useSelect.d.ts +3 -3
  29. package/dist/components/select-v2/index.d.ts +6 -2
  30. package/dist/components/select-v2/index.js +7 -4
  31. package/dist/components/select-v2/src/defaults.d.ts +258 -0
  32. package/dist/components/select-v2/src/defaults.js +359 -0
  33. package/dist/components/select-v2/src/group-item.vue.d.ts +40 -0
  34. package/dist/components/select-v2/src/group-item.vue.js +13 -0
  35. package/dist/components/select-v2/src/group-item2.vue.js +33 -0
  36. package/dist/components/select-v2/src/option-item.vue.d.ts +66 -0
  37. package/dist/components/select-v2/src/option-item.vue.js +37 -0
  38. package/dist/components/select-v2/src/option-item2.vue.js +46 -0
  39. package/dist/components/select-v2/src/select-dropdown.d.ts +53 -0
  40. package/dist/components/select-v2/src/select-dropdown.js +209 -0
  41. package/dist/components/select-v2/src/select.types.d.ts +2 -1
  42. package/dist/components/select-v2/src/select.vue.d.ts +918 -0
  43. package/dist/components/select-v2/src/select.vue.js +388 -0
  44. package/dist/components/select-v2/src/select2.vue.js +86 -0
  45. package/dist/components/select-v2/src/token.d.ts +16 -0
  46. package/dist/components/select-v2/src/token.js +6 -0
  47. package/dist/components/select-v2/src/useAllowCreate.d.ts +8 -0
  48. package/dist/components/select-v2/src/useAllowCreate.js +64 -0
  49. package/dist/components/select-v2/src/useOption.d.ts +7 -0
  50. package/dist/components/select-v2/src/useOption.js +13 -0
  51. package/dist/components/select-v2/src/useProps.d.ts +2 -3
  52. package/dist/components/select-v2/src/useSelect.d.ts +129 -0
  53. package/dist/components/select-v2/src/useSelect.js +501 -0
  54. package/dist/components/time-picker/index.js +10 -11
  55. package/dist/components/time-picker/src/common/picker.vue.d.ts +131 -125
  56. package/dist/components/time-picker/src/common/picker.vue.js +163 -160
  57. package/dist/components/time-picker/src/common/props.d.ts +0 -1
  58. package/dist/components/time-picker/src/common/props.js +13 -14
  59. package/dist/components/time-picker/src/time-picker.d.ts +0 -3
  60. package/dist/components/virtual-list/index.d.ts +8 -0
  61. package/dist/components/virtual-list/src/builders/build-list.d.ts +187 -0
  62. package/dist/components/virtual-list/src/builders/build-list.js +363 -0
  63. package/dist/components/virtual-list/src/components/dynamic-size-list.d.ts +186 -0
  64. package/dist/components/virtual-list/src/components/dynamic-size-list.js +112 -0
  65. package/dist/components/virtual-list/src/components/fixed-size-list.d.ts +185 -0
  66. package/dist/components/virtual-list/src/components/fixed-size-list.js +68 -0
  67. package/dist/components/virtual-list/src/components/scrollbar.d.ts +79 -0
  68. package/dist/components/virtual-list/src/components/scrollbar.js +134 -0
  69. package/dist/components/virtual-list/src/defaults.d.ts +27 -0
  70. package/dist/components/virtual-list/src/defaults.js +26 -0
  71. package/dist/components/virtual-list/src/hooks/use-cache.d.ts +1 -0
  72. package/dist/components/virtual-list/src/hooks/use-cache.js +13 -0
  73. package/dist/components/virtual-list/src/hooks/use-wheel.d.ts +13 -0
  74. package/dist/components/virtual-list/src/hooks/use-wheel.js +26 -0
  75. package/dist/components/virtual-list/src/props.d.ts +211 -0
  76. package/dist/components/virtual-list/src/props.js +151 -0
  77. package/dist/components/virtual-list/src/types.d.ts +152 -0
  78. package/dist/components/virtual-list/src/utils.d.ts +16 -0
  79. package/dist/components/virtual-list/src/utils.js +22 -0
  80. package/dist/hooks/use-float-label/index.d.ts +6 -2
  81. package/dist/hooks/use-float-label/index.js +11 -7
  82. package/dist/index.css +1 -1
  83. package/dist/utils/objects.js +11 -3
  84. package/dist/vendored-components.d.ts +1 -1
  85. package/dist/vendored-components.js +1 -0
  86. package/package.json +3 -1
  87. package/theme-chalk/src/float-label.scss +57 -0
@@ -0,0 +1,74 @@
1
+ import { defineComponent as E, inject as c, ref as h, onMounted as N, onBeforeUnmount as A, onUpdated as P, watch as y, computed as M, createVNode as b, Fragment as F, nextTick as B } from "vue";
2
+ import { useResizeObserver as O } from "@vueuse/core";
3
+ import "@vue/shared";
4
+ import "lodash-unified";
5
+ import { throwError as C } from "../../../utils/error.js";
6
+ import "@element-plus/icons-vue";
7
+ import { useNamespace as K } from "../../../hooks/use-namespace/index.js";
8
+ import "../../../hooks/use-size/index.js";
9
+ import "@popperjs/core";
10
+ import "../../../hooks/use-z-index/index.js";
11
+ import "../../../hooks/use-delayed-toggle/index.js";
12
+ import "../../../hooks/use-aria/index.js";
13
+ import "../../../hooks/use-model-toggle/index.js";
14
+ import "../../../hooks/use-empty-values/index.js";
15
+ import { formContextKey as R, formItemContextKey as T } from "./constants.js";
16
+ const W = "ElLabelWrap", X = /* @__PURE__ */ E({
17
+ name: W,
18
+ props: {
19
+ isAutoWidth: Boolean,
20
+ updateAll: Boolean
21
+ },
22
+ setup(l, {
23
+ slots: i
24
+ }) {
25
+ const t = c(R, void 0), a = c(T);
26
+ a || C(W, "usage: <el-form-item><label-wrap /></el-form-item>");
27
+ const L = K("form"), o = h(), n = h(0), g = () => {
28
+ var e;
29
+ if ((e = o.value) != null && e.firstElementChild) {
30
+ const r = window.getComputedStyle(o.value.firstElementChild).width;
31
+ return Math.ceil(Number.parseFloat(r));
32
+ } else
33
+ return 0;
34
+ }, d = (e = "update") => {
35
+ B(() => {
36
+ i.default && l.isAutoWidth && (e === "update" ? n.value = g() : e === "remove" && (t == null || t.deregisterLabelWidth(n.value)));
37
+ });
38
+ }, m = () => d("update");
39
+ return N(() => {
40
+ m();
41
+ }), A(() => {
42
+ d("remove");
43
+ }), P(() => m()), y(n, (e, r) => {
44
+ l.updateAll && (t == null || t.registerLabelWidth(e, r));
45
+ }), O(M(() => {
46
+ var e;
47
+ return ((e = o.value) == null ? void 0 : e.firstElementChild) ?? null;
48
+ }), m), () => {
49
+ var r, p;
50
+ if (!i) return null;
51
+ const {
52
+ isAutoWidth: e
53
+ } = l;
54
+ if (e) {
55
+ const u = t == null ? void 0 : t.autoLabelWidth, v = a == null ? void 0 : a.hasLabel, f = {};
56
+ if (v && u && u !== "auto") {
57
+ const s = Math.max(0, Number.parseInt(u, 10) - n.value), w = (a.labelPosition || t.labelPosition) === "left" ? "marginRight" : "marginLeft";
58
+ s && (f[w] = `${s}px`);
59
+ }
60
+ return b("div", {
61
+ ref: o,
62
+ class: [L.be("item", "label-wrap")],
63
+ style: f
64
+ }, [(r = i.default) == null ? void 0 : r.call(i)]);
65
+ } else
66
+ return b(F, {
67
+ ref: o
68
+ }, [(p = i.default) == null ? void 0 : p.call(i)]);
69
+ };
70
+ }
71
+ });
72
+ export {
73
+ X as default
74
+ };
@@ -0,0 +1,127 @@
1
+ import type { ExtractPublicPropTypes } from 'vue';
2
+ import type { ComponentSize } from '@element-plus/constants';
3
+ import type { FormItemProp } from './form-item';
4
+ import type { FormRules } from './types';
5
+ export interface FormMetaProps {
6
+ /**
7
+ * @description Control the size of components in this form.
8
+ */
9
+ size?: ComponentSize;
10
+ /**
11
+ * @description Whether to disable all components in this form. If set to `true`, it will override the `disabled` prop of the inner component.
12
+ */
13
+ disabled?: boolean;
14
+ }
15
+ /**
16
+ * @deprecated Removed after 3.0.0, Use `FormMetaProps` instead.
17
+ */
18
+ export declare const formMetaProps: {
19
+ readonly size: {
20
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
21
+ readonly required: false;
22
+ readonly validator: ((val: unknown) => boolean) | undefined;
23
+ __epPropKey: true;
24
+ };
25
+ readonly disabled: BooleanConstructor;
26
+ };
27
+ export interface FormProps extends FormMetaProps {
28
+ /**
29
+ * @description Data of form component.
30
+ */
31
+ model?: Record<string, any>;
32
+ /**
33
+ * @description Validation rules of form.
34
+ */
35
+ rules?: FormRules;
36
+ /**
37
+ * @description Position of label. If set to `'left'` or `'right'`, `label-width` prop is also required.
38
+ */
39
+ labelPosition?: 'left' | 'right' | 'top';
40
+ /**
41
+ * @description Position of asterisk.
42
+ */
43
+ requireAsteriskPosition?: 'left' | 'right';
44
+ /**
45
+ * @description Width of label, e.g. `'50px'`. All its direct child form items will inherit this value. `auto` is supported.
46
+ */
47
+ labelWidth?: string | number;
48
+ /**
49
+ * @description Suffix of the label.
50
+ */
51
+ labelSuffix?: string;
52
+ /**
53
+ * @description Whether the form is inline.
54
+ */
55
+ inline?: boolean;
56
+ /**
57
+ * @description Whether to display the error message inline with the form item.
58
+ */
59
+ inlineMessage?: boolean;
60
+ /**
61
+ * @description Whether to display an icon indicating the validation result.
62
+ */
63
+ statusIcon?: boolean;
64
+ /**
65
+ * @description Whether to show the error message.
66
+ */
67
+ showMessage?: boolean;
68
+ /**
69
+ * @description Whether to trigger validation when the `rules` prop is changed.
70
+ */
71
+ validateOnRuleChange?: boolean;
72
+ /**
73
+ * @description Whether to hide required fields should have a red asterisk (star) beside their labels.
74
+ */
75
+ hideRequiredAsterisk?: boolean;
76
+ /**
77
+ * @description When validation fails, scroll to the first error form entry.
78
+ */
79
+ scrollToError?: boolean;
80
+ /**
81
+ * @description When validation fails, it scrolls to the first error item based on the scrollIntoView option.
82
+ */
83
+ scrollIntoViewOptions?: ScrollIntoViewOptions | boolean;
84
+ }
85
+ /**
86
+ * @deprecated Removed after 3.0.0, Use `FormProps` instead.
87
+ */
88
+ export declare const formProps: {
89
+ readonly model: ObjectConstructor;
90
+ readonly rules: {
91
+ readonly type: import("vue").PropType<Partial<Record<string, Record<string, any> | import("@element-plus/utils").Arrayable<import("./types").FormItemRule>>>>;
92
+ readonly required: false;
93
+ readonly validator: ((val: unknown) => boolean) | undefined;
94
+ __epPropKey: true;
95
+ };
96
+ readonly labelPosition: import("@element-plus/utils").EpPropFinalized<StringConstructor, "left" | "right" | "top", unknown, "right", boolean>;
97
+ readonly requireAsteriskPosition: import("@element-plus/utils").EpPropFinalized<StringConstructor, "left" | "right", unknown, "left", boolean>;
98
+ readonly labelWidth: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
99
+ readonly labelSuffix: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
100
+ readonly inline: BooleanConstructor;
101
+ readonly inlineMessage: BooleanConstructor;
102
+ readonly statusIcon: BooleanConstructor;
103
+ readonly showMessage: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
104
+ readonly validateOnRuleChange: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
105
+ readonly hideRequiredAsterisk: BooleanConstructor;
106
+ readonly scrollToError: BooleanConstructor;
107
+ readonly scrollIntoViewOptions: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions) | (((new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions)) | null)[], unknown, unknown, true, boolean>;
108
+ readonly size: {
109
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
110
+ readonly required: false;
111
+ readonly validator: ((val: unknown) => boolean) | undefined;
112
+ __epPropKey: true;
113
+ };
114
+ readonly disabled: BooleanConstructor;
115
+ };
116
+ /**
117
+ * @deprecated Removed after 3.0.0, Use `FormProps` instead.
118
+ */
119
+ export type FormPropsPublic = ExtractPublicPropTypes<typeof formProps>;
120
+ /**
121
+ * @deprecated Removed after 3.0.0, Use `FormMetaProps` instead.
122
+ */
123
+ export type FormMetaPropsPublic = ExtractPublicPropTypes<typeof formMetaProps>;
124
+ export declare const formEmits: {
125
+ validate: (prop: FormItemProp, isValid: boolean, message: string) => boolean;
126
+ };
127
+ export type FormEmits = typeof formEmits;
@@ -0,0 +1,112 @@
1
+ import { componentSizes as a } from "../../../constants/size.js";
2
+ import { isBoolean as n } from "../../../utils/types.js";
3
+ import "lodash-unified";
4
+ import "@vueuse/core";
5
+ import { isArray as s, isString as t } from "@vue/shared";
6
+ import "@element-plus/icons-vue";
7
+ import { buildProps as i, definePropType as o } from "../../../utils/vue/props/runtime.js";
8
+ import "vue";
9
+ const p = i({
10
+ /**
11
+ * @description Control the size of components in this form.
12
+ */
13
+ size: {
14
+ type: String,
15
+ values: a
16
+ },
17
+ /**
18
+ * @description Whether to disable all components in this form. If set to `true`, it will override the `disabled` prop of the inner component.
19
+ */
20
+ disabled: Boolean
21
+ });
22
+ i({
23
+ ...p,
24
+ /**
25
+ * @description Data of form component.
26
+ */
27
+ model: Object,
28
+ /**
29
+ * @description Validation rules of form.
30
+ */
31
+ rules: {
32
+ type: o(Object)
33
+ },
34
+ /**
35
+ * @description Position of label. If set to `'left'` or `'right'`, `label-width` prop is also required.
36
+ */
37
+ labelPosition: {
38
+ type: String,
39
+ values: ["left", "right", "top"],
40
+ default: "right"
41
+ },
42
+ /**
43
+ * @description Position of asterisk.
44
+ */
45
+ requireAsteriskPosition: {
46
+ type: String,
47
+ values: ["left", "right"],
48
+ default: "left"
49
+ },
50
+ /**
51
+ * @description Width of label, e.g. `'50px'`. All its direct child form items will inherit this value. `auto` is supported.
52
+ */
53
+ labelWidth: {
54
+ type: [String, Number],
55
+ default: ""
56
+ },
57
+ /**
58
+ * @description Suffix of the label.
59
+ */
60
+ labelSuffix: {
61
+ type: String,
62
+ default: ""
63
+ },
64
+ /**
65
+ * @description Whether the form is inline.
66
+ */
67
+ inline: Boolean,
68
+ /**
69
+ * @description Whether to display the error message inline with the form item.
70
+ */
71
+ inlineMessage: Boolean,
72
+ /**
73
+ * @description Whether to display an icon indicating the validation result.
74
+ */
75
+ statusIcon: Boolean,
76
+ /**
77
+ * @description Whether to show the error message.
78
+ */
79
+ showMessage: {
80
+ type: Boolean,
81
+ default: !0
82
+ },
83
+ /**
84
+ * @description Whether to trigger validation when the `rules` prop is changed.
85
+ */
86
+ validateOnRuleChange: {
87
+ type: Boolean,
88
+ default: !0
89
+ },
90
+ /**
91
+ * @description Whether to hide required fields should have a red asterisk (star) beside their labels.
92
+ */
93
+ hideRequiredAsterisk: Boolean,
94
+ /**
95
+ * @description When validation fails, scroll to the first error form entry.
96
+ */
97
+ scrollToError: Boolean,
98
+ /**
99
+ * @description When validation fails, it scrolls to the first error item based on the scrollIntoView option.
100
+ */
101
+ scrollIntoViewOptions: {
102
+ type: o([Object, Boolean]),
103
+ default: !0
104
+ }
105
+ });
106
+ const c = {
107
+ validate: (e, r, l) => (s(e) || t(e)) && n(r) && t(l)
108
+ };
109
+ export {
110
+ c as formEmits,
111
+ p as formMetaProps
112
+ };
@@ -1,24 +1,53 @@
1
+ import { useFormLabelWidth } from './utils';
1
2
  import type { ComponentSize } from '@element-plus/constants';
2
- export interface FormContext {
3
- size?: ComponentSize;
4
- disabled?: boolean;
5
- [key: string]: any;
3
+ import type { Arrayable, FieldPath } from '@element-plus/utils';
4
+ import type { RuleItem, ValidateError, ValidateFieldsError } from 'async-validator';
5
+ import type { MaybeRef, SetupContext, UnwrapRef } from 'vue';
6
+ import type { FormItemProp, FormItemProps, FormItemValidateState } from './form-item';
7
+ import type { FormEmits, FormProps } from './form';
8
+ type FormLabelWidthContext = ReturnType<typeof useFormLabelWidth>;
9
+ interface FormItemRule extends RuleItem {
10
+ trigger?: Arrayable<string>;
6
11
  }
7
- export interface FormItemContext {
8
- size?: ComponentSize;
9
- $el?: HTMLDivElement | undefined;
10
- validateMessage?: string;
11
- validateState?: string;
12
- isGroup?: boolean;
13
- labelId?: string;
14
- inputIds?: string[];
15
- hasLabel?: boolean;
16
- fieldValue?: any;
17
- propString?: string;
12
+ type FormRuleValue<V> = V extends any[] ? Arrayable<FormItemRule> : V extends Record<string, any> ? Arrayable<FormItemRule> | {
13
+ [K in keyof V]?: FormRuleValue<V[K]>;
14
+ } : Arrayable<FormItemRule>;
15
+ type FormRules<T extends MaybeRef<Record<string, any> | string> = string> = UnwrapRef<T> extends Record<string, any> ? {
16
+ [P in FieldPath<UnwrapRef<T>>]?: P extends keyof UnwrapRef<T> ? FormRuleValue<UnwrapRef<T>[P]> : Arrayable<FormItemRule>;
17
+ } : Partial<Record<string, Arrayable<FormItemRule> | Record<string, any>>>;
18
+ type FormValidationResult = Promise<boolean>;
19
+ type FormValidateCallback = (isValid: boolean, invalidFields?: ValidateFieldsError) => Promise<void> | void;
20
+ interface FormValidateFailure {
21
+ errors: ValidateError[] | null;
22
+ fields: ValidateFieldsError;
23
+ }
24
+ type FormContext = FormProps & UnwrapRef<FormLabelWidthContext> & {
25
+ emit: SetupContext<FormEmits>['emit'];
26
+ getField: (prop: FormItemProp) => FormItemContext | undefined;
27
+ addField: (field: FormItemContext) => void;
28
+ removeField: (field: FormItemContext, oldPropString?: string) => void;
29
+ resetFields: (props?: Arrayable<FormItemProp>) => void;
30
+ setInitialValues: (initModel: Record<string, any>) => void;
31
+ clearValidate: (props?: Arrayable<FormItemProp>) => void;
32
+ validateField: (props?: Arrayable<FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
33
+ };
34
+ interface FormItemContext extends FormItemProps {
35
+ $el: HTMLDivElement | undefined;
36
+ size: ComponentSize;
37
+ validateMessage: string;
38
+ validateState: FormItemValidateState;
39
+ isGroup: boolean;
40
+ labelId: string;
41
+ inputIds: string[];
42
+ hasLabel: boolean;
43
+ fieldValue: any;
44
+ propString: string;
18
45
  addInputId: (id: string) => void;
19
46
  removeInputId: (id: string) => void;
20
- validate?: (...args: any[]) => any;
21
- resetField?: () => void;
22
- clearValidate?: () => void;
23
- [key: string]: any;
47
+ validate: (trigger: string, callback?: FormValidateCallback) => FormValidationResult;
48
+ resetField(): void;
49
+ clearValidate(): void;
50
+ setInitialValue: (value: any) => void;
51
+ getInitialValue: () => any;
24
52
  }
53
+ export type { FormContext, FormItemContext, FormItemRule, FormLabelWidthContext, FormRules, FormValidateCallback, FormValidateFailure, FormValidationResult, };
@@ -0,0 +1,9 @@
1
+ import type { Arrayable } from '@element-plus/utils';
2
+ import type { FormItemContext } from './types';
3
+ import type { FormItemProp } from './form-item';
4
+ export declare function useFormLabelWidth(): {
5
+ autoLabelWidth: import("vue").ComputedRef<string>;
6
+ registerLabelWidth: (val: number, oldVal: number) => void;
7
+ deregisterLabelWidth: (val: number) => void;
8
+ };
9
+ export declare const filterFields: (fields: FormItemContext[], props: Arrayable<FormItemProp>) => FormItemContext[];
@@ -0,0 +1,45 @@
1
+ import { ref as c, computed as s } from "vue";
2
+ import { isArray as l } from "@vue/shared";
3
+ import { castArray as m } from "lodash-unified";
4
+ import "@vueuse/core";
5
+ import { debugWarn as d } from "../../../utils/error.js";
6
+ import "@element-plus/icons-vue";
7
+ const f = "ElForm";
8
+ function L() {
9
+ const t = c([]), o = s(() => {
10
+ if (!t.value.length) return "0";
11
+ const e = Math.max(...t.value);
12
+ return e ? `${e}px` : "";
13
+ });
14
+ function n(e) {
15
+ const i = t.value.indexOf(e);
16
+ return i === -1 && o.value === "0" && d(f, `unexpected width ${e}`), i;
17
+ }
18
+ function r(e, i) {
19
+ if (e && i) {
20
+ const a = n(i);
21
+ t.value.splice(a, 1, e);
22
+ } else e && t.value.push(e);
23
+ }
24
+ function u(e) {
25
+ const i = n(e);
26
+ i > -1 && t.value.splice(i, 1);
27
+ }
28
+ return {
29
+ autoLabelWidth: o,
30
+ registerLabelWidth: r,
31
+ deregisterLabelWidth: u
32
+ };
33
+ }
34
+ const v = (t, o) => {
35
+ const n = m(o).map(
36
+ (r) => l(r) ? r.join(".") : r
37
+ );
38
+ return n.length > 0 ? t.filter(
39
+ (r) => r.propString && n.includes(r.propString)
40
+ ) : t;
41
+ };
42
+ export {
43
+ v as filterFields,
44
+ L as useFormLabelWidth
45
+ };
@@ -0,0 +1,55 @@
1
+ import type { FormItemProps } from '../form/src/form-item';
2
+ declare var __VLS_9: {
3
+ label: string;
4
+ }, __VLS_11: {}, __VLS_17: {
5
+ error: string;
6
+ };
7
+ type __VLS_Slots = {} & {
8
+ label?: (props: typeof __VLS_9) => any;
9
+ } & {
10
+ default?: (props: typeof __VLS_11) => any;
11
+ } & {
12
+ error?: (props: typeof __VLS_17) => any;
13
+ };
14
+ declare const __VLS_component: import("vue").DefineComponent<FormItemProps, {
15
+ /**
16
+ * @description Form item size.
17
+ */
18
+ size: import("vue").ComputedRef<"" | "small" | "default" | "large">;
19
+ /**
20
+ * @description Validation message.
21
+ */
22
+ validateMessage: import("vue").Ref<string, string>;
23
+ /**
24
+ * @description Validation state.
25
+ */
26
+ validateState: import("vue").Ref<"" | "error" | "success" | "validating", "" | "error" | "success" | "validating">;
27
+ /**
28
+ * @description Validate form item.
29
+ */
30
+ validate: (trigger: string, callback?: import("../form").FormValidateCallback) => import("../form").FormValidationResult;
31
+ /**
32
+ * @description Remove validation status of the field.
33
+ */
34
+ clearValidate: () => void;
35
+ /**
36
+ * @description Reset current field and remove validation result.
37
+ */
38
+ resetField: () => void;
39
+ /**
40
+ * @description Set initial value for this field. When `resetField` is called, the field will reset to this value.
41
+ */
42
+ setInitialValue: (value: any) => void;
43
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormItemProps> & Readonly<{}>, {
44
+ required: boolean;
45
+ labelPosition: "left" | "right" | "top" | "";
46
+ inlineMessage: boolean;
47
+ showMessage: boolean;
48
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
49
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
50
+ export default _default;
51
+ type __VLS_WithSlots<T, S> = T & {
52
+ new (): {
53
+ $slots: S;
54
+ };
55
+ };