ep-craft 0.1.27 → 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.
@@ -0,0 +1,61 @@
1
+ import type { Arrayable } from '@element-plus/utils';
2
+ import type { FormProps } from './src/form';
3
+ import type { FormItemContext, FormValidateCallback, FormValidationResult } from './src/types';
4
+ import type { FormItemProp } from './src/form-item';
5
+ declare var __VLS_1: {};
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_1) => any;
8
+ };
9
+ declare const __VLS_component: import("vue").DefineComponent<FormProps, {
10
+ /**
11
+ * @description Validate the whole form. Receives a callback or returns `Promise`.
12
+ */
13
+ validate: (callback?: FormValidateCallback) => FormValidationResult;
14
+ /**
15
+ * @description Validate specified fields.
16
+ */
17
+ validateField: (props?: Arrayable<FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
18
+ /**
19
+ * @description Reset specified fields and remove validation result.
20
+ */
21
+ resetFields: (props?: Arrayable<FormItemProp>) => void;
22
+ /**
23
+ * @description Clear validation message for specified fields.
24
+ */
25
+ clearValidate: (props?: Arrayable<FormItemProp>) => void;
26
+ /**
27
+ * @description Scroll to the specified fields.
28
+ */
29
+ scrollToField: (prop: FormItemProp) => void;
30
+ /**
31
+ * @description Get a field context.
32
+ */
33
+ getField: (prop: FormItemProp) => FormItemContext | undefined;
34
+ /**
35
+ * @description All fields context.
36
+ */
37
+ fields: import("vue").Reactive<FormItemContext[]>;
38
+ /**
39
+ * @description Set initial values for form fields. When `resetFields` is called, fields will reset to these values.
40
+ */
41
+ setInitialValues: (initModel: Record<string, any>) => void;
42
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
43
+ validate: (prop: FormItemProp, isValid: boolean, message: string) => void;
44
+ }, string, import("vue").PublicProps, Readonly<FormProps> & Readonly<{
45
+ onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
46
+ }>, {
47
+ labelWidth: string | number;
48
+ labelPosition: "left" | "right" | "top";
49
+ showMessage: boolean;
50
+ requireAsteriskPosition: "left" | "right";
51
+ labelSuffix: string;
52
+ validateOnRuleChange: boolean;
53
+ scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
54
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
55
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
56
+ export default _default;
57
+ type __VLS_WithSlots<T, S> = T & {
58
+ new (): {
59
+ $slots: S;
60
+ };
61
+ };
@@ -0,0 +1,199 @@
1
+ import { defineComponent as j, ref as k, reactive as E, computed as B, watch as z, provide as $, toRefs as b, openBlock as W, createElementBlock as D, normalizeClass as K, renderSlot as L } from "vue";
2
+ import { cloneDeep as p, castArray as G } from "lodash-unified";
3
+ import { NOOP as H, isArray as J, isFunction as Q } from "@vue/shared";
4
+ import "@vueuse/core";
5
+ import { debugWarn as u } from "../../utils/error.js";
6
+ import { getProp as y } from "../../utils/objects.js";
7
+ import "@element-plus/icons-vue";
8
+ import { useNamespace as U } from "../../hooks/use-namespace/index.js";
9
+ import "../../hooks/use-size/index.js";
10
+ import "@popperjs/core";
11
+ import "../../hooks/use-z-index/index.js";
12
+ import "../../hooks/use-delayed-toggle/index.js";
13
+ import "../../hooks/use-aria/index.js";
14
+ import "../../hooks/use-model-toggle/index.js";
15
+ import "../../hooks/use-empty-values/index.js";
16
+ import { useFormSize as X } from "./src/hooks/use-form-common-props.js";
17
+ import { formContextKey as Y } from "./src/constants.js";
18
+ import { formEmits as Z } from "./src/form.js";
19
+ import { useFormLabelWidth as ee, filterFields as m } from "./src/utils.js";
20
+ const l = "ElForm", Fe = /* @__PURE__ */ j({
21
+ name: l,
22
+ __name: "EpForm",
23
+ props: {
24
+ model: {},
25
+ rules: {},
26
+ labelPosition: { default: "right" },
27
+ requireAsteriskPosition: { default: "left" },
28
+ labelWidth: { default: "" },
29
+ labelSuffix: { default: "" },
30
+ inline: { type: Boolean },
31
+ inlineMessage: { type: Boolean },
32
+ statusIcon: { type: Boolean },
33
+ showMessage: { type: Boolean, default: !0 },
34
+ validateOnRuleChange: { type: Boolean, default: !0 },
35
+ hideRequiredAsterisk: { type: Boolean },
36
+ scrollToError: { type: Boolean },
37
+ scrollIntoViewOptions: { type: Boolean, default: !0 },
38
+ size: {},
39
+ disabled: { type: Boolean }
40
+ },
41
+ emits: Z,
42
+ setup(I, { expose: O, emit: C }) {
43
+ const s = I, P = C, d = k(), i = E([]), n = /* @__PURE__ */ new Map(), q = X(), a = U("form"), _ = B(() => {
44
+ const { labelPosition: e, inline: t } = s;
45
+ return [
46
+ a.b(),
47
+ a.m(q.value || "default"),
48
+ {
49
+ [a.m(`label-${e}`)]: e,
50
+ [a.m("inline")]: t
51
+ }
52
+ ];
53
+ }), c = (e) => m(i, [e])[0], x = (e) => {
54
+ i.includes(e) || i.push(e), e.propString && (n.has(e.propString) ? e.setInitialValue(n.get(e.propString)) : n.set(e.propString, p(e.fieldValue)));
55
+ }, R = (e, t) => {
56
+ if (t) {
57
+ n.delete(t);
58
+ return;
59
+ }
60
+ const r = i.indexOf(e);
61
+ r > -1 && (i.splice(r, 1), e.propString && n.set(e.propString, p(e.getInitialValue())));
62
+ }, v = (e) => {
63
+ if (!s.model) {
64
+ u(l, "model is required for setInitialValues to work.");
65
+ return;
66
+ }
67
+ if (!e) {
68
+ u(
69
+ l,
70
+ "initModel is required for setInitialValues to work."
71
+ );
72
+ return;
73
+ }
74
+ for (const t of n.keys())
75
+ n.set(t, p(y(e, t).value));
76
+ i.forEach((t) => {
77
+ t.prop && t.setInitialValue(y(e, t.prop).value);
78
+ });
79
+ }, w = (e = []) => {
80
+ if (!s.model) {
81
+ u(l, "model is required for resetFields to work.");
82
+ return;
83
+ }
84
+ m(i, e).forEach((o) => o.resetField());
85
+ const t = new Set(
86
+ i.map((o) => o.propString).filter(Boolean)
87
+ ), r = e.length > 0 ? G(e).map((o) => J(o) ? o.join(".") : o) : [...n.keys()];
88
+ for (const o of r)
89
+ !t.has(o) && n.has(o) && (y(s.model, o).value = p(
90
+ n.get(o)
91
+ ));
92
+ }, F = (e = []) => {
93
+ m(i, e).forEach((t) => t.clearValidate());
94
+ }, T = B(() => {
95
+ const e = !!s.model;
96
+ return e || u(l, "model is required for validate to work."), e;
97
+ }), A = (e) => {
98
+ if (i.length === 0) return [];
99
+ const t = m(i, e);
100
+ return t.length ? t : (u(l, "please pass correct props!"), []);
101
+ }, V = async (e) => h(void 0, e), M = async (e = []) => {
102
+ if (!T.value) return !1;
103
+ const t = A(e);
104
+ if (t.length === 0) return !0;
105
+ let r = {};
106
+ for (const o of t)
107
+ try {
108
+ await o.validate(""), o.validateState === "error" && !o.error && o.resetField();
109
+ } catch (f) {
110
+ r = {
111
+ ...r,
112
+ ...f
113
+ };
114
+ }
115
+ return Object.keys(r).length === 0 ? !0 : Promise.reject(r);
116
+ }, h = async (e = [], t) => {
117
+ let r = !1;
118
+ const o = !Q(t);
119
+ try {
120
+ return r = await M(e), r === !0 && await (t == null ? void 0 : t(r)), r;
121
+ } catch (f) {
122
+ if (f instanceof Error) throw f;
123
+ const S = f;
124
+ if (s.scrollToError && d.value) {
125
+ const g = d.value.querySelector(`.${a.b()}-item.is-error`);
126
+ g == null || g.scrollIntoView(s.scrollIntoViewOptions);
127
+ }
128
+ return !r && await (t == null ? void 0 : t(!1, S)), o && Promise.reject(S);
129
+ }
130
+ }, N = (e) => {
131
+ var r;
132
+ const t = c(e);
133
+ t && ((r = t.$el) == null || r.scrollIntoView(s.scrollIntoViewOptions));
134
+ };
135
+ return z(
136
+ () => s.rules,
137
+ () => {
138
+ s.validateOnRuleChange && V().catch(H);
139
+ },
140
+ { deep: !0, flush: "post" }
141
+ ), $(
142
+ Y,
143
+ E({
144
+ ...b(s),
145
+ emit: P,
146
+ resetFields: w,
147
+ clearValidate: F,
148
+ validateField: h,
149
+ getField: c,
150
+ addField: x,
151
+ removeField: R,
152
+ setInitialValues: v,
153
+ ...ee()
154
+ })
155
+ ), O({
156
+ /**
157
+ * @description Validate the whole form. Receives a callback or returns `Promise`.
158
+ */
159
+ validate: V,
160
+ /**
161
+ * @description Validate specified fields.
162
+ */
163
+ validateField: h,
164
+ /**
165
+ * @description Reset specified fields and remove validation result.
166
+ */
167
+ resetFields: w,
168
+ /**
169
+ * @description Clear validation message for specified fields.
170
+ */
171
+ clearValidate: F,
172
+ /**
173
+ * @description Scroll to the specified fields.
174
+ */
175
+ scrollToField: N,
176
+ /**
177
+ * @description Get a field context.
178
+ */
179
+ getField: c,
180
+ /**
181
+ * @description All fields context.
182
+ */
183
+ fields: i,
184
+ /**
185
+ * @description Set initial values for form fields. When `resetFields` is called, fields will reset to these values.
186
+ */
187
+ setInitialValues: v
188
+ }), (e, t) => (W(), D("form", {
189
+ ref_key: "formRef",
190
+ ref: d,
191
+ class: K(_.value)
192
+ }, [
193
+ L(e.$slots, "default")
194
+ ], 2));
195
+ }
196
+ });
197
+ export {
198
+ Fe as default
199
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./EpForm.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,7 +1,17 @@
1
1
  import type { Plugin } from 'vue';
2
- import { ElForm } from 'element-plus';
3
- export declare const EpForm: typeof ElForm & Plugin;
2
+ import _EpForm from './EpForm.vue';
3
+ import _EpFormItem from '../form-item/EpFormItem.vue';
4
+ export declare const EpForm: typeof _EpForm & Plugin & {
5
+ FormItem: typeof _EpFormItem;
6
+ };
4
7
  export default EpForm;
5
8
  export * from './src/constants';
6
9
  export * from './src/hooks/use-form-common-props';
7
10
  export * from './src/hooks/use-form-item';
11
+ export { formEmits, formMetaProps, formProps } from './src/form';
12
+ export { formItemProps, formItemValidateStates } from './src/form-item';
13
+ export type { FormEmits, FormMetaProps, FormMetaPropsPublic, FormProps, FormPropsPublic, } from './src/form';
14
+ export type { FormItemProp, FormItemProps, FormItemPropsPublic, FormItemValidateState, } from './src/form-item';
15
+ export type { FormContext, FormItemContext, FormItemRule, FormLabelWidthContext, FormRules, FormValidateCallback, FormValidateFailure, FormValidationResult, } from './src/types';
16
+ export type { FormInstance } from './instance';
17
+ export type { FormItemInstance } from '../form-item/instance';
@@ -1,12 +1,18 @@
1
- import { ElForm as o } from "element-plus";
2
1
  import { withInstall as m } from "../../utils/with-install.js";
2
+ import o from "./EpForm.vue.js";
3
+ import r from "../form-item/EpFormItem.vue.js";
3
4
  import "vue";
4
5
  import "../../hooks/use-size/index.js";
5
6
  import "@vueuse/core";
6
7
  import "@vue/shared";
7
8
  import "lodash-unified";
8
9
  import "@element-plus/icons-vue";
9
- const r = Object.assign({}, o, { name: "EpForm" }), a = m(r, "ep-form");
10
+ import { formEmits as I, formMetaProps as E } from "./src/form.js";
11
+ import { formItemValidateStates as b } from "./src/form-item.js";
12
+ const _ = Object.assign(m(o, "ep-form"), { FormItem: r });
10
13
  export {
11
- a as EpForm
14
+ _ as EpForm,
15
+ I as formEmits,
16
+ b as formItemValidateStates,
17
+ E as formMetaProps
12
18
  };
@@ -0,0 +1,2 @@
1
+ import type _EpForm from './EpForm.vue';
2
+ export type FormInstance = InstanceType<typeof _EpForm>;
@@ -0,0 +1,103 @@
1
+ import type { ExtractPublicPropTypes } from 'vue';
2
+ import type { ComponentSize } from '@element-plus/constants';
3
+ import type { Arrayable } from '@element-plus/utils';
4
+ import type { FormItemRule } from './types';
5
+ export declare const formItemValidateStates: readonly ["", "error", "validating", "success"];
6
+ export type FormItemValidateState = (typeof formItemValidateStates)[number];
7
+ export type FormItemProp = Arrayable<string>;
8
+ export interface FormItemProps {
9
+ /**
10
+ * @description Label text.
11
+ */
12
+ label?: string;
13
+ /**
14
+ * @description Width of label, e.g. `'50px'`. `'auto'` is supported.
15
+ */
16
+ labelWidth?: string | number;
17
+ /**
18
+ * @description Position of label. If set to `'left'` or `'right'`, `label-width` prop is also required. The default is extend from `form label-position`.
19
+ */
20
+ labelPosition?: 'left' | 'right' | 'top' | '';
21
+ /**
22
+ * @description A key of `model`. It could be an array of property paths (e.g `['a', 'b', '0']`). In the use of `validate` and `resetFields` method, the attribute is required.
23
+ */
24
+ prop?: FormItemProp;
25
+ /**
26
+ * @description Whether the field is required or not, will be determined by validation rules if omitted.
27
+ */
28
+ required?: boolean;
29
+ /**
30
+ * @description Validation rules of form, see the [following table](#formitemrule), more advanced usage at [async-validator](https://github.com/yiminghe/async-validator).
31
+ */
32
+ rules?: Arrayable<FormItemRule>;
33
+ /**
34
+ * @description Field error message, set its value and the field will validate error and show this message immediately.
35
+ */
36
+ error?: string;
37
+ /**
38
+ * @description Validation state of formItem.
39
+ */
40
+ validateStatus?: FormItemValidateState;
41
+ /**
42
+ * @description Same as for in native label.
43
+ */
44
+ for?: string;
45
+ /**
46
+ * @description Inline style validate message.
47
+ */
48
+ inlineMessage?: boolean;
49
+ /**
50
+ * @description Whether to show the error message.
51
+ */
52
+ showMessage?: boolean;
53
+ /**
54
+ * @description Control the size of components in this form-item.
55
+ */
56
+ size?: ComponentSize;
57
+ }
58
+ /**
59
+ * @deprecated Removed after 3.0.0, Use `FormItemProps` instead.
60
+ */
61
+ export declare const formItemProps: {
62
+ readonly label: StringConstructor;
63
+ readonly labelWidth: {
64
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
65
+ readonly required: false;
66
+ readonly validator: ((val: unknown) => boolean) | undefined;
67
+ __epPropKey: true;
68
+ };
69
+ readonly labelPosition: import("@element-plus/utils").EpPropFinalized<StringConstructor, "" | "left" | "right" | "top", unknown, "", boolean>;
70
+ readonly prop: {
71
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | string[]) | (() => FormItemProp) | (((new (...args: any[]) => string | string[]) | (() => FormItemProp)) | null)[], unknown, unknown>>;
72
+ readonly required: false;
73
+ readonly validator: ((val: unknown) => boolean) | undefined;
74
+ __epPropKey: true;
75
+ };
76
+ readonly required: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
77
+ readonly rules: {
78
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => FormItemRule | FormItemRule[]) | (() => Arrayable<FormItemRule>) | (((new (...args: any[]) => FormItemRule | FormItemRule[]) | (() => Arrayable<FormItemRule>)) | null)[], unknown, unknown>>;
79
+ readonly required: false;
80
+ readonly validator: ((val: unknown) => boolean) | undefined;
81
+ __epPropKey: true;
82
+ };
83
+ readonly error: StringConstructor;
84
+ readonly validateStatus: {
85
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
86
+ readonly required: false;
87
+ readonly validator: ((val: unknown) => boolean) | undefined;
88
+ __epPropKey: true;
89
+ };
90
+ readonly for: StringConstructor;
91
+ readonly inlineMessage: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
92
+ readonly showMessage: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
93
+ readonly size: {
94
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
95
+ readonly required: false;
96
+ readonly validator: ((val: unknown) => boolean) | undefined;
97
+ __epPropKey: true;
98
+ };
99
+ };
100
+ /**
101
+ * @deprecated Removed after 3.0.0, Use `FormItemProps` instead.
102
+ */
103
+ export type FormItemPropsPublic = ExtractPublicPropTypes<typeof formItemProps>;
@@ -0,0 +1,91 @@
1
+ import { componentSizes as t } from "../../../constants/size.js";
2
+ import "@vue/shared";
3
+ import "lodash-unified";
4
+ import "@vueuse/core";
5
+ import "@element-plus/icons-vue";
6
+ import { buildProps as r, definePropType as e } from "../../../utils/vue/props/runtime.js";
7
+ import "vue";
8
+ const i = [
9
+ "",
10
+ "error",
11
+ "validating",
12
+ "success"
13
+ ];
14
+ r({
15
+ /**
16
+ * @description Label text.
17
+ */
18
+ label: String,
19
+ /**
20
+ * @description Width of label, e.g. `'50px'`. `'auto'` is supported.
21
+ */
22
+ labelWidth: {
23
+ type: [String, Number]
24
+ },
25
+ /**
26
+ * @description Position of label. If set to `'left'` or `'right'`, `label-width` prop is also required. The default is extend from `form label-position`.
27
+ */
28
+ labelPosition: {
29
+ type: String,
30
+ values: ["left", "right", "top", ""],
31
+ default: ""
32
+ },
33
+ /**
34
+ * @description A key of `model`. It could be an array of property paths (e.g `['a', 'b', '0']`). In the use of `validate` and `resetFields` method, the attribute is required.
35
+ */
36
+ prop: {
37
+ type: e([String, Array])
38
+ },
39
+ /**
40
+ * @description Whether the field is required or not, will be determined by validation rules if omitted.
41
+ */
42
+ required: {
43
+ type: Boolean,
44
+ default: void 0
45
+ },
46
+ /**
47
+ * @description Validation rules of form, see the [following table](#formitemrule), more advanced usage at [async-validator](https://github.com/yiminghe/async-validator).
48
+ */
49
+ rules: {
50
+ type: e([Object, Array])
51
+ },
52
+ /**
53
+ * @description Field error message, set its value and the field will validate error and show this message immediately.
54
+ */
55
+ error: String,
56
+ /**
57
+ * @description Validation state of formItem.
58
+ */
59
+ validateStatus: {
60
+ type: String,
61
+ values: i
62
+ },
63
+ /**
64
+ * @description Same as for in native label.
65
+ */
66
+ for: String,
67
+ /**
68
+ * @description Inline style validate message.
69
+ */
70
+ inlineMessage: {
71
+ type: Boolean,
72
+ default: void 0
73
+ },
74
+ /**
75
+ * @description Whether to show the error message.
76
+ */
77
+ showMessage: {
78
+ type: Boolean,
79
+ default: !0
80
+ },
81
+ /**
82
+ * @description Control the size of components in this form-item.
83
+ */
84
+ size: {
85
+ type: String,
86
+ values: t
87
+ }
88
+ });
89
+ export {
90
+ i as formItemValidateStates
91
+ };
@@ -0,0 +1,11 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ isAutoWidth: BooleanConstructor;
3
+ updateAll: BooleanConstructor;
4
+ }>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
5
+ isAutoWidth: BooleanConstructor;
6
+ updateAll: BooleanConstructor;
7
+ }>> & Readonly<{}>, {
8
+ isAutoWidth: boolean;
9
+ updateAll: boolean;
10
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
11
+ export default _default;
@@ -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
+ };