@silver-formily/element-plus 2.0.0 → 2.0.1
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/LICENSE +21 -21
- package/README.md +35 -35
- package/esm/__builtins__/configs/index.mjs.map +1 -1
- package/esm/__builtins__/shared/hooks.mjs.map +1 -1
- package/esm/__builtins__/shared/loading.mjs.map +1 -1
- package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -1
- package/esm/__builtins__/shared/transform-component.d.ts +1 -2
- package/esm/__builtins__/shared/transform-component.mjs +1 -1
- package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
- package/esm/__builtins__/shared/utils.mjs +1 -1
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/array-base/index.mjs +39 -42
- package/esm/array-base/index.mjs.map +1 -1
- package/esm/array-base/symbols.mjs.map +1 -1
- package/esm/array-base/utils.mjs +29 -33
- package/esm/array-base/utils.mjs.map +1 -1
- package/esm/array-cards/array-cards.d.ts +1 -1
- package/esm/array-cards/index.d.ts +3 -3
- package/esm/array-cards/index.mjs +23 -25
- package/esm/array-cards/index.mjs.map +1 -1
- package/esm/array-collapse/array-collapse.d.ts +2 -2
- package/esm/array-collapse/index.d.ts +3 -3
- package/esm/array-collapse/index.mjs +87 -88
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-collapse/utils.mjs +2 -8
- package/esm/array-collapse/utils.mjs.map +1 -1
- package/esm/array-items/index.mjs +29 -32
- package/esm/array-items/index.mjs.map +1 -1
- package/esm/array-list-tabs/array-list-tabs.d.ts +3 -3
- package/esm/array-list-tabs/index.d.ts +6 -6
- package/esm/array-list-tabs/index.mjs +88 -86
- package/esm/array-list-tabs/index.mjs.map +1 -1
- package/esm/array-list-tabs/utils.mjs +5 -11
- package/esm/array-list-tabs/utils.mjs.map +1 -1
- package/esm/array-table/array-table.d.ts +1 -1
- package/esm/array-table/index.d.ts +3 -3
- package/esm/array-table/index.mjs +48 -50
- package/esm/array-table/index.mjs.map +1 -1
- package/esm/array-table/types.d.ts +1 -1
- package/esm/array-table/utils.mjs +12 -18
- package/esm/array-table/utils.mjs.map +1 -1
- package/esm/array-tabs/index.mjs +26 -28
- package/esm/array-tabs/index.mjs.map +1 -1
- package/esm/cascader/cascader.d.ts +1 -6
- package/esm/cascader/index.d.ts +3 -16
- package/esm/cascader/index.mjs +26 -32
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/checkbox-group.d.ts +2 -15
- package/esm/checkbox/index.d.ts +3 -28
- package/esm/checkbox/index.mjs +33 -45
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/date-picker/index.d.ts +442 -1
- package/esm/date-picker/index.mjs +9 -18
- package/esm/date-picker/index.mjs.map +1 -1
- package/esm/editable/index.mjs +34 -36
- package/esm/editable/index.mjs.map +1 -1
- package/esm/form/form.mjs +7 -7
- package/esm/form/form.mjs.map +1 -1
- package/esm/form-button-group/index.mjs +20 -23
- package/esm/form-button-group/index.mjs.map +1 -1
- package/esm/form-button-group/utils.mjs +2 -8
- package/esm/form-button-group/utils.mjs.map +1 -1
- package/esm/form-collapse/index.mjs +31 -32
- package/esm/form-collapse/index.mjs.map +1 -1
- package/esm/form-collapse/utils.mjs.map +1 -1
- package/esm/form-dialog/index.mjs +18 -18
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-drawer/index.mjs +17 -17
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-grid/hooks.mjs.map +1 -1
- package/esm/form-grid/index.mjs +20 -23
- package/esm/form-grid/index.mjs.map +1 -1
- package/esm/form-item/index.mjs +30 -32
- package/esm/form-item/index.mjs.map +1 -1
- package/esm/form-item/utils.mjs.map +1 -1
- package/esm/form-layout/form-layout.mjs +11 -14
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-layout/utils.mjs +19 -24
- package/esm/form-layout/utils.mjs.map +1 -1
- package/esm/form-step/index.mjs +22 -24
- package/esm/form-step/index.mjs.map +1 -1
- package/esm/form-step/utils.mjs.map +1 -1
- package/esm/form-tab/form-tab.d.ts +2 -2
- package/esm/form-tab/hooks.mjs +1 -1
- package/esm/form-tab/hooks.mjs.map +1 -1
- package/esm/form-tab/index.d.ts +5 -5
- package/esm/form-tab/index.mjs +28 -29
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/form-tab/types.d.ts +1 -1
- package/esm/form-tab/utils.mjs.map +1 -1
- package/esm/index.mjs +58 -58
- package/esm/input/index.d.ts +6 -38
- package/esm/input/index.mjs +36 -48
- package/esm/input/index.mjs.map +1 -1
- package/esm/input/input.d.ts +1 -8
- package/esm/input-number/index.d.ts +215 -1
- package/esm/input-number/index.mjs +8 -17
- package/esm/input-number/index.mjs.map +1 -1
- package/esm/pagination/components/jumper.mjs.map +1 -1
- package/esm/pagination/components/next.mjs.map +1 -1
- package/esm/pagination/components/pager.mjs.map +1 -1
- package/esm/pagination/components/prev.mjs.map +1 -1
- package/esm/pagination/components/total.mjs.map +1 -1
- package/esm/pagination/pagination.mjs +1 -1
- package/esm/pagination/pagination.mjs.map +1 -1
- package/esm/password/index.d.ts +6 -38
- package/esm/password/index.mjs +1 -1
- package/esm/password/index.mjs.map +1 -1
- package/esm/preview-text/cascader.d.ts +1 -1
- package/esm/preview-text/date-picker.d.ts +1 -1
- package/esm/preview-text/index.d.ts +13 -13
- package/esm/preview-text/index.mjs +115 -118
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/preview-text/input.d.ts +1 -1
- package/esm/preview-text/select.d.ts +1 -1
- package/esm/preview-text/time-picker.d.ts +1 -1
- package/esm/preview-text/tree.d.ts +1 -1
- package/esm/preview-text/utils.mjs.map +1 -1
- package/esm/radio/index.d.ts +3 -25
- package/esm/radio/index.mjs +34 -44
- package/esm/radio/index.mjs.map +1 -1
- package/esm/radio/radio-group.d.ts +2 -13
- package/esm/reset/index.mjs +1 -1
- package/esm/reset/index.mjs.map +1 -1
- package/esm/select/index.d.ts +3 -16
- package/esm/select/index.mjs +62 -70
- package/esm/select/index.mjs.map +1 -1
- package/esm/select/select.d.ts +1 -6
- package/esm/select-table/index.d.ts +5 -5
- package/esm/select-table/index.mjs +78 -81
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/select-table/select-table.d.ts +2 -2
- package/esm/select-table/types.d.ts +1 -1
- package/esm/submit/index.mjs +1 -1
- package/esm/submit/index.mjs.map +1 -1
- package/esm/switch/index.d.ts +260 -1
- package/esm/switch/index.mjs +5 -11
- package/esm/switch/index.mjs.map +1 -1
- package/esm/time-picker/index.d.ts +442 -1
- package/esm/time-picker/index.mjs +8 -15
- package/esm/time-picker/index.mjs.map +1 -1
- package/esm/time-select/index.d.ts +124 -1
- package/esm/time-select/index.mjs +10 -17
- package/esm/time-select/index.mjs.map +1 -1
- package/esm/transfer/index.mjs +5 -5
- package/esm/transfer/index.mjs.map +1 -1
- package/esm/tree/index.d.ts +5 -5
- package/esm/tree/index.mjs +42 -45
- package/esm/tree/index.mjs.map +1 -1
- package/esm/tree/tree.d.ts +2 -2
- package/esm/tree/types.d.ts +1 -1
- package/esm/tree/utils.mjs.map +1 -1
- package/esm/tree-select/index.d.ts +3 -19
- package/esm/tree-select/index.mjs +22 -32
- package/esm/tree-select/index.mjs.map +1 -1
- package/esm/tree-select/tree-select.d.ts +1 -8
- package/esm/upload/index.d.ts +5 -5
- package/esm/upload/index.mjs +14 -16
- package/esm/upload/index.mjs.map +1 -1
- package/esm/upload/upload.d.ts +2 -2
- package/esm/vendor/sizes.mjs.map +1 -1
- package/package.json +114 -116
package/esm/form-item/index.mjs
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
import { isVoidField as ne } from "@formily/core";
|
|
2
|
-
import { useField as ue, connect as de, mapProps as ce } from "@formily/vue";
|
|
2
|
+
import { useField as ue, connect as de, mapProps as ce } from "@silver-formily/vue";
|
|
3
3
|
import { defineComponent as fe, useSlots as pe, computed as d, ref as b, reactive as ve, watch as me, provide as D, createElementBlock as i, openBlock as t, unref as l, normalizeClass as n, createBlock as f, createCommentVNode as c, createElementVNode as h, resolveDynamicComponent as g, normalizeStyle as W, withCtx as m, isVNode as x, createVNode as _, toDisplayString as y, Fragment as C, createTextVNode as R, renderSlot as G, TransitionGroup as be } from "vue";
|
|
4
|
-
import {
|
|
5
|
-
import "@formily/
|
|
6
|
-
import "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { a as Ee } from "../vendor/shared.esm-bundler.mjs";
|
|
16
|
-
import { getFeedbackMessage as Pe, determineFeedbackStatus as Ve } from "./utils.mjs";
|
|
4
|
+
import { InfoFilled as ye, CircleClose as ke, CircleCheck as ge, Warning as Se } from "@element-plus/icons-vue";
|
|
5
|
+
import { isValid as v, isArr as he } from "@formily/shared";
|
|
6
|
+
import { useNamespace as xe, useFormSize as _e, useId as Ce, formItemContextKey as $e, ElTooltip as E, ElIcon as K } from "element-plus";
|
|
7
|
+
import { FORM_LAYOUT_PROPS_KEYS as Ie, useFormLayout as we, formLayoutShallowContext as We } from "../form-layout/utils.mjs";
|
|
8
|
+
import { p as Fe } from "../vendor/lodash.mjs";
|
|
9
|
+
import { i as Ae, a as Be, d as Le } from "../vendor/types.mjs";
|
|
10
|
+
import { a as ze } from "../vendor/shared.esm-bundler.mjs";
|
|
11
|
+
import { stylePrefix as Te } from "../__builtins__/configs/index.mjs";
|
|
12
|
+
import { useResizeObserver as Re } from "../__builtins__/shared/hooks.mjs";
|
|
13
|
+
import { getFeedbackMessage as Ee, determineFeedbackStatus as Pe } from "./utils.mjs";
|
|
14
|
+
import { composeExport as Ve } from "../__builtins__/shared/utils.mjs";
|
|
17
15
|
import '../styles/form-item/index.css';const Ne = "utils/dom/style";
|
|
18
16
|
function U(s, p = "px") {
|
|
19
17
|
if (!s && s !== 0)
|
|
20
18
|
return "";
|
|
21
|
-
if (
|
|
19
|
+
if (Ae(s) || Be(s))
|
|
22
20
|
return `${s}${p}`;
|
|
23
|
-
if (
|
|
21
|
+
if (ze(s))
|
|
24
22
|
return s;
|
|
25
|
-
|
|
23
|
+
Le(Ne, "binding value must be a string or number");
|
|
26
24
|
}
|
|
27
25
|
const Oe = ["role", "aria-labelledby"], Y = /* @__PURE__ */ fe({
|
|
28
26
|
name: "FFormItem",
|
|
@@ -53,14 +51,14 @@ const Oe = ["role", "aria-labelledby"], Y = /* @__PURE__ */ fe({
|
|
|
53
51
|
tooltipLayout: null
|
|
54
52
|
},
|
|
55
53
|
setup(s, { expose: p }) {
|
|
56
|
-
const e = s, F = pe(), o =
|
|
57
|
-
Object.entries(
|
|
58
|
-
), J =
|
|
54
|
+
const e = s, F = pe(), o = xe("form-item"), u = `${Te}-form-item`, H = Object.fromEntries(
|
|
55
|
+
Object.entries(Fe(e, Ie)).filter(([r, w]) => v(w))
|
|
56
|
+
), J = we(), a = d(() => Object.assign({}, J.value, H)), P = ue(), V = _e(void 0, { formItem: !1 }), A = Ce().value, k = b([]), N = b(""), O = b(), S = b(), q = b();
|
|
59
57
|
p({
|
|
60
58
|
feedbackTooltipRef: q
|
|
61
59
|
});
|
|
62
60
|
const $ = d(
|
|
63
|
-
() => a.value.layout === "vertical" ||
|
|
61
|
+
() => a.value.layout === "vertical" || he(a.value.layout) && a.value.layout.includes("vertical") ? "top" : a.value.labelAlign ?? "right"
|
|
64
62
|
), Q = d(() => {
|
|
65
63
|
if ($.value === "top")
|
|
66
64
|
return {};
|
|
@@ -107,7 +105,7 @@ const Oe = ["role", "aria-labelledby"], Y = /* @__PURE__ */ fe({
|
|
|
107
105
|
}, se = (r) => {
|
|
108
106
|
k.value = k.value.filter((w) => w !== r);
|
|
109
107
|
}, j = b(!1);
|
|
110
|
-
|
|
108
|
+
Re(S, () => {
|
|
111
109
|
j.value = S.value?.scrollWidth > S.value?.clientWidth;
|
|
112
110
|
});
|
|
113
111
|
const T = d(() => j.value && !a.value.labelWrap), ie = b(""), I = ve({
|
|
@@ -143,10 +141,10 @@ const Oe = ["role", "aria-labelledby"], Y = /* @__PURE__ */ fe({
|
|
|
143
141
|
I.validateState = r;
|
|
144
142
|
}, {
|
|
145
143
|
immediate: !0
|
|
146
|
-
}), D(
|
|
144
|
+
}), D(We, b({
|
|
147
145
|
...v(e.size) && { size: e.size },
|
|
148
146
|
...v(e.colon) && { colon: e.colon }
|
|
149
|
-
})), D(
|
|
147
|
+
})), D($e, I), (r, w) => (t(), i("div", {
|
|
150
148
|
ref_key: "formItemRef",
|
|
151
149
|
ref: O,
|
|
152
150
|
class: n([u, a.value.labelWrap && "is-warp", ...te.value]),
|
|
@@ -205,7 +203,7 @@ const Oe = ["role", "aria-labelledby"], Y = /* @__PURE__ */ fe({
|
|
|
205
203
|
class: n(`${u}-label-tooltip`)
|
|
206
204
|
}, {
|
|
207
205
|
default: m(() => [
|
|
208
|
-
_(l(
|
|
206
|
+
_(l(ye))
|
|
209
207
|
]),
|
|
210
208
|
_: 1
|
|
211
209
|
}, 8, ["class"])
|
|
@@ -258,9 +256,9 @@ const Oe = ["role", "aria-labelledby"], Y = /* @__PURE__ */ fe({
|
|
|
258
256
|
}, [
|
|
259
257
|
_(l(K), null, {
|
|
260
258
|
default: m(() => [
|
|
261
|
-
e.feedbackStatus === "error" ? (t(), f(l(
|
|
262
|
-
e.feedbackStatus === "success" ? (t(), f(l(
|
|
263
|
-
e.feedbackStatus === "warning" ? (t(), f(l(
|
|
259
|
+
e.feedbackStatus === "error" ? (t(), f(l(ke), { key: 0 })) : c("", !0),
|
|
260
|
+
e.feedbackStatus === "success" ? (t(), f(l(ge), { key: 1 })) : c("", !0),
|
|
261
|
+
e.feedbackStatus === "warning" ? (t(), f(l(Se), { key: 2 })) : c("", !0)
|
|
264
262
|
]),
|
|
265
263
|
_: 1
|
|
266
264
|
}),
|
|
@@ -300,7 +298,7 @@ const Oe = ["role", "aria-labelledby"], Y = /* @__PURE__ */ fe({
|
|
|
300
298
|
function qe(s, p) {
|
|
301
299
|
if (ne(p) || !p)
|
|
302
300
|
return s;
|
|
303
|
-
const e =
|
|
301
|
+
const e = Ee(p), F = Pe(p), o = "asterisk" in s ? s.asterisk : p.required && p.pattern !== "readPretty";
|
|
304
302
|
return {
|
|
305
303
|
...s,
|
|
306
304
|
feedbackText: e,
|
|
@@ -319,13 +317,13 @@ const Me = de(
|
|
|
319
317
|
},
|
|
320
318
|
qe
|
|
321
319
|
)
|
|
322
|
-
),
|
|
320
|
+
), lt = Ve(Me, {
|
|
323
321
|
BaseItem: Y
|
|
324
322
|
});
|
|
325
323
|
export {
|
|
326
324
|
Y as FormBaseItem,
|
|
327
|
-
|
|
328
|
-
|
|
325
|
+
lt as FormItem,
|
|
326
|
+
lt as default,
|
|
329
327
|
qe as fieldFeedbackMapper
|
|
330
328
|
};
|
|
331
329
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../node_modules/.pnpm/element-plus@2.13.0_vue@3.5.22_typescript@5.9.3_/node_modules/element-plus/es/utils/dom/style.mjs","../../src/form-item/form-item.vue","../../src/form-item/index.ts"],"sourcesContent":["import { isNumber, isStringNumber } from '../types.mjs';\nimport { isClient } from '@vueuse/core';\nimport { camelize, isObject, isString } from '@vue/shared';\nimport { entriesOf, keysOf } from '../objects.mjs';\nimport { debugWarn } from '../error.mjs';\n\nconst SCOPE = \"utils/dom/style\";\nconst classNameToArray = (cls = \"\") => cls.split(\" \").filter((item) => !!item.trim());\nconst hasClass = (el, cls) => {\n if (!el || !cls)\n return false;\n if (cls.includes(\" \"))\n throw new Error(\"className should not contain space.\");\n return el.classList.contains(cls);\n};\nconst addClass = (el, cls) => {\n if (!el || !cls.trim())\n return;\n el.classList.add(...classNameToArray(cls));\n};\nconst removeClass = (el, cls) => {\n if (!el || !cls.trim())\n return;\n el.classList.remove(...classNameToArray(cls));\n};\nconst getStyle = (element, styleName) => {\n var _a;\n if (!isClient || !element || !styleName)\n return \"\";\n let key = camelize(styleName);\n if (key === \"float\")\n key = \"cssFloat\";\n try {\n const style = element.style[key];\n if (style)\n return style;\n const computed = (_a = document.defaultView) == null ? void 0 : _a.getComputedStyle(element, \"\");\n return computed ? computed[key] : \"\";\n } catch (e) {\n return element.style[key];\n }\n};\nconst setStyle = (element, styleName, value) => {\n if (!element || !styleName)\n return;\n if (isObject(styleName)) {\n entriesOf(styleName).forEach(\n ([prop, value2]) => setStyle(element, prop, value2)\n );\n } else {\n const key = camelize(styleName);\n element.style[key] = value;\n }\n};\nconst removeStyle = (element, style) => {\n if (!element || !style)\n return;\n if (isObject(style)) {\n keysOf(style).forEach((prop) => removeStyle(element, prop));\n } else {\n setStyle(element, style, \"\");\n }\n};\nfunction addUnit(value, defaultUnit = \"px\") {\n if (!value && value !== 0)\n return \"\";\n if (isNumber(value) || isStringNumber(value)) {\n return `${value}${defaultUnit}`;\n } else if (isString(value)) {\n return value;\n }\n debugWarn(SCOPE, \"binding value must be a string or number\");\n}\n\nexport { addClass, addUnit, classNameToArray, getStyle, hasClass, removeClass, removeStyle, setStyle };\n//# sourceMappingURL=style.mjs.map\n","<script lang=\"ts\" setup>\nimport type { Field } from '@formily/core'\nimport type {\n FormItemContext,\n FormItemValidateState,\n FormValidationResult,\n TooltipInstance,\n} from 'element-plus'\nimport type { ICalculatedFormLayoutProps } from 'src/form-layout/types'\nimport type { CSSProperties } from 'vue'\nimport type { IFormItemProps } from './types'\nimport { CircleCheck, CircleClose, InfoFilled, Warning } from '@element-plus/icons-vue'\nimport { isArr, isValid } from '@formily/shared'\nimport { useField } from '@formily/vue'\nimport { ElIcon, ElTooltip, formItemContextKey, useFormSize, useId, useNamespace } from 'element-plus'\nimport { addUnit } from 'element-plus/es/utils/index'\nimport { pick } from 'lodash-es'\nimport { computed, isVNode, provide, reactive, ref, useSlots, watch } from 'vue'\nimport { stylePrefix, useResizeObserver } from '../__builtins__'\nimport { FORM_LAYOUT_PROPS_KEYS, formLayoutShallowContext, useFormLayout } from '../form-layout/utils'\n\ndefineOptions({\n name: 'FFormItem',\n})\nconst props = defineProps({\n label: null,\n for: null,\n tooltip: null,\n addonBefore: null,\n addonAfter: null,\n extra: null,\n feedbackText: null,\n feedbackStatus: null,\n asterisk: { type: Boolean },\n colon: { type: Boolean, default: true },\n labelAlign: null,\n wrapperAlign: null,\n labelWrap: { type: Boolean },\n labelWidth: null,\n wrapperWidth: null,\n wrapperWrap: { type: Boolean },\n labelCol: null,\n wrapperCol: null,\n fullness: { type: Boolean, default: false },\n size: null,\n layout: null,\n feedbackLayout: { default: 'loose' },\n tooltipLayout: null\n})\nconst slots = useSlots()\nconst ns = useNamespace('form-item')\nconst prefixCls = `${stylePrefix}-form-item`\nconst formItemConfig: Partial<ICalculatedFormLayoutProps> = Object.fromEntries(\n Object.entries(pick(props, FORM_LAYOUT_PROPS_KEYS))\n .filter(([_, value]) => isValid(value)),\n)\nconst formlayoutConfig = useFormLayout()\nconst formlayout = computed(() => Object.assign({}, formlayoutConfig.value, formItemConfig))\n\nconst field = useField<Field>()\n\nconst _size = useFormSize(undefined, { formItem: false })\n\nconst labelId = useId().value\nconst inputIds = ref<string[]>([])\n\nconst validateState = ref<FormItemValidateState>('')\nconst formItemRef = ref<HTMLDivElement>()\nconst labelRef = ref<HTMLElement>()\nconst feedbackTooltipRef = ref<TooltipInstance>()\ndefineExpose({\n feedbackTooltipRef,\n})\n\nconst labelPosition = computed(\n () => {\n if (formlayout.value.layout === 'vertical' || (isArr(formlayout.value.layout) && formlayout.value.layout.includes('vertical' as any))) {\n return 'top'\n }\n return formlayout.value.labelAlign ?? 'right'\n },\n)\n\nconst labelStyle = computed<CSSProperties>(() => {\n if (labelPosition.value === 'top') {\n return {}\n }\n\n const labelWidth = addUnit(formlayout.value.labelWidth || '')\n if (labelWidth)\n return { width: labelWidth }\n return {}\n})\n\nconst contentStyle = computed<CSSProperties>(() => {\n const contentWidth = addUnit(formlayout.value?.wrapperWidth || '')\n if (contentWidth)\n return { width: contentWidth, flex: 'unset' }\n return {}\n})\n\nconst contentWrapperStyle = computed<CSSProperties>(() => {\n return {\n justifyContent: formlayout.value?.wrapperAlign === 'right' && 'flex-end',\n }\n})\n\nconst isRequired = computed(() =>\n props.asterisk && field.value?.pattern !== 'readPretty',\n)\n\nconst formItemClasses = computed(() => [\n ns.b(),\n // eslint-disable-next-line unicorn/explicit-length-check\n ns.m(props.size || _size.value || 'default'),\n ns.is(props.feedbackStatus),\n ns.is('validating', validateState.value === 'validating'),\n ns.is('success', validateState.value === 'success'),\n ns.is('required', isRequired.value || props.asterisk),\n ns.is('no-asterisk', formlayout.value?.hideRequiredAsterisk),\n ns.is(formlayout.value.feedbackLayout),\n formlayout.value?.requireAsteriskPosition === 'right'\n ? 'asterisk-right'\n : 'asterisk-left',\n {\n [ns.m('feedback')]: formlayout.value?.statusIcon,\n [ns.m(`label-${labelPosition.value}`)]: labelPosition.value,\n },\n])\n\nconst validateClasses = computed(() => [\n `${prefixCls}-feedback`,\n ns.is(props.feedbackStatus),\n ns.is('loose', props.feedbackLayout === 'loose'),\n])\n\nconst hasLabel = computed<boolean>(() => {\n return (props.label !== '' && isValid(props.label)) || isValid(slots.label)\n})\n\nconst labelFor = computed<string | undefined>(() => {\n return (\n props.for || (inputIds.value.length === 1 ? inputIds.value[0] : undefined)\n )\n})\n\nconst isGroup = computed<boolean>(() => {\n return !labelFor.value && hasLabel.value\n})\n\nasync function validate(): FormValidationResult {\n return true\n}\n/* istanbul ignore next -- @preserve */\nconst clearValidate: FormItemContext['clearValidate'] = () => {}\n/* istanbul ignore next -- @preserve */\nconst resetField: FormItemContext['resetField'] = async () => {}\n\nconst addInputId: FormItemContext['addInputId'] = (id: string) => {\n /* istanbul ignore else -- @preserve */\n if (!inputIds.value.includes(id)) {\n inputIds.value.push(id)\n }\n}\n\nconst removeInputId: FormItemContext['removeInputId'] = (id: string) => {\n inputIds.value = inputIds.value.filter(listId => listId !== id)\n}\n\nconst isEllipsisActive = ref(false)\nuseResizeObserver(labelRef, () => {\n isEllipsisActive.value = labelRef.value?.scrollWidth > labelRef.value?.clientWidth\n})\nconst isEllipsis = computed(() => {\n return isEllipsisActive.value && !formlayout.value.labelWrap\n})\n\n// HACK computed无法监听到props.feedbackStatus的变化\nconst _validateState = ref<FormItemValidateState>('')\nconst context: FormItemContext = reactive({\n $el: formItemRef,\n labelWidth: formlayout.value?.labelWidth,\n size: _size,\n validateState: _validateState.value,\n labelId,\n inputIds,\n isGroup,\n hasLabel,\n addInputId,\n removeInputId,\n resetField,\n clearValidate,\n validate,\n labelPosition,\n inlineMessage: true,\n showMessage: true,\n fieldValue: field.value?.value,\n validateMessage: '',\n propString: '',\n})\nwatch(() => props.feedbackStatus, (val) => {\n if (val === 'pending') {\n context.validateState = 'validating'\n return\n }\n if (val === 'warning') {\n context.validateState = ''\n return\n }\n context.validateState = val\n}, {\n immediate: true,\n})\n\nprovide(formLayoutShallowContext, ref({\n ...(isValid(props.size) && { size: props.size }),\n ...(isValid(props.colon) && { colon: props.colon }),\n}))\nprovide(formItemContextKey, context)\n</script>\n\n<template>\n <div\n ref=\"formItemRef\" :class=\"[prefixCls, formlayout.labelWrap && 'is-warp', ...formItemClasses]\"\n :role=\"isGroup ? 'group' : undefined\" :aria-labelledby=\"isGroup ? labelId : undefined\"\n >\n <component\n :is=\"labelFor ? 'label' : 'div'\" v-if=\"hasLabel\" :id=\"labelId\" :for=\"labelFor\"\n :class=\"[ns.e('label'), isValid(formlayout.labelCol) && `${prefixCls}-col-${formlayout.labelCol}`]\"\n :style=\"labelStyle\"\n >\n <!-- label -->\n <template v-if=\"isVNode(props.label)\">\n <component :is=\"props.label\" />\n </template>\n <div v-else :class=\"`${prefixCls}-label__wrapper`\">\n <ElTooltip :disabled=\"!isEllipsis && formlayout.tooltipLayout !== 'text'\">\n <span\n :class=\"{\n [`${prefixCls}-label-content`]: true,\n ['is-tooltip']: isEllipsis || (props.tooltip && formlayout.tooltipLayout === 'text'),\n }\"\n >\n <span ref=\"labelRef\">{{ props.label }}</span>\n </span>\n <template #content>\n <template v-if=\"isVNode(props.tooltip)\">\n <component :is=\"props.tooltip\" />\n </template>\n <div v-else :style=\"`width: ${labelRef?.clientWidth ?? 0}px;`\">\n <template v-if=\"isEllipsis\">\n {{ props.label }}\n </template>\n <template v-if=\"formlayout.tooltipLayout === 'text'\">\n {{ props.tooltip }}\n </template>\n </div>\n </template>\n </ElTooltip>\n <ElTooltip v-if=\"props.tooltip && formlayout.tooltipLayout !== 'text'\" :content=\"props.tooltip\">\n <ElIcon :class=\"`${prefixCls}-label-tooltip`\">\n <InfoFilled />\n </ElIcon>\n </ElTooltip>\n <span v-if=\"props.colon\" :class=\"`${prefixCls}-colon`\">:</span>\n </div>\n </component>\n <!-- content -->\n <div\n :class=\"[\n `${prefixCls}-content__wrapper`,\n isValid(formlayout.wrapperCol) && `${prefixCls}-col-${formlayout.wrapperCol}`,\n ]\"\n :style=\"contentWrapperStyle\"\n >\n <template v-if=\"isValid(props.addonBefore)\">\n <template v-if=\"isVNode(props.addonBefore)\">\n <component :is=\"props.addonBefore\" />\n </template>\n <div v-else :class=\"`${prefixCls}-addon-before`\">\n {{ props.addonBefore }}\n </div>\n </template>\n <div\n :class=\"[\n ns.e('content'),\n formlayout.fullness && 'is-fullness',\n ns.is('addon-after', !!props.addonAfter),\n ]\" :style=\"contentStyle\"\n >\n <ElTooltip\n v-if=\"props.feedbackLayout === 'popover'\"\n ref=\"feedbackTooltipRef\"\n :visible=\"!!props.feedbackText\"\n effect=\"light\"\n :offset=\"6\"\n >\n <template #default>\n <slot />\n </template>\n <template #content>\n <div :class=\"[...validateClasses, ns.is('tooltip')]\">\n <ElIcon>\n <CircleClose v-if=\"props.feedbackStatus === 'error'\" />\n <CircleCheck v-if=\"props.feedbackStatus === 'success'\" />\n <Warning v-if=\"props.feedbackStatus === 'warning'\" />\n </ElIcon>\n {{ props.feedbackText }}\n </div>\n </template>\n </ElTooltip>\n <slot v-else />\n <TransitionGroup :name=\"`${ns.namespace.value}-zoom-in-top`\">\n <div v-if=\"props.feedbackText && props.feedbackLayout !== 'popover'\" :class=\"validateClasses\">\n {{ props.feedbackText }}\n </div>\n <template v-if=\"isValid(props.extra)\">\n <template v-if=\"isVNode(props.extra)\">\n <component :is=\"props.extra\" />\n </template>\n <div v-else :class=\"`${prefixCls}-extra`\">\n {{ props.extra }}\n </div>\n </template>\n </TransitionGroup>\n </div>\n <template v-if=\"isValid(props.addonAfter)\">\n <template v-if=\"isVNode(props.addonAfter)\">\n <component :is=\"props.addonAfter\" />\n </template>\n <div v-else :class=\"`${prefixCls}-addon-after`\">\n {{ props.addonAfter }}\n </div>\n </template>\n </div>\n </div>\n</template>\n","import { isVoidField } from '@formily/core'\nimport { connect, mapProps } from '@formily/vue'\nimport { composeExport } from '../__builtins__'\nimport FormBaseItem from './form-item.vue'\nimport { determineFeedbackStatus, getFeedbackMessage } from './utils'\nimport './style.scss'\n\nexport function fieldFeedbackMapper(props, field) {\n if (isVoidField(field) || !field) {\n return props\n }\n\n const feedbackText = getFeedbackMessage(field)\n const feedbackStatus = determineFeedbackStatus(field)\n const asterisk = 'asterisk' in props\n ? props.asterisk\n : field.required && field.pattern !== 'readPretty'\n\n return {\n ...props,\n feedbackText,\n feedbackStatus,\n asterisk,\n }\n}\n\nconst Item = connect(\n FormBaseItem,\n mapProps(\n {\n validateStatus: true,\n title: 'label',\n required: true,\n description: 'extra',\n },\n fieldFeedbackMapper,\n ),\n)\n\nexport const FormItem = composeExport(Item, {\n BaseItem: FormBaseItem,\n})\n\nexport default FormItem\n\nexport { default as FormBaseItem } from './form-item.vue'\n"],"names":["SCOPE","addUnit","value","defaultUnit","isNumber","isStringNumber","isString","debugWarn","props","__props","slots","useSlots","ns","useNamespace","prefixCls","stylePrefix","formItemConfig","pick","FORM_LAYOUT_PROPS_KEYS","_","isValid","formlayoutConfig","useFormLayout","formlayout","computed","field","useField","_size","useFormSize","labelId","useId","inputIds","ref","validateState","formItemRef","labelRef","feedbackTooltipRef","__expose","labelPosition","isArr","labelStyle","labelWidth","contentStyle","contentWidth","contentWrapperStyle","isRequired","formItemClasses","validateClasses","hasLabel","labelFor","isGroup","validate","clearValidate","resetField","addInputId","id","removeInputId","listId","isEllipsisActive","useResizeObserver","isEllipsis","_validateState","context","reactive","watch","val","provide","formLayoutShallowContext","formItemContextKey","_createElementBlock","_unref","_openBlock","_createBlock","_resolveDynamicComponent","_normalizeClass","isVNode","_createVNode","ElTooltip","_normalizeStyle","_Fragment","_createTextVNode","_toDisplayString","_createElementVNode","ElIcon","InfoFilled","_renderSlot","_ctx","CircleClose","CircleCheck","Warning","_TransitionGroup","fieldFeedbackMapper","isVoidField","feedbackText","getFeedbackMessage","feedbackStatus","determineFeedbackStatus","asterisk","Item","connect","FormBaseItem","mapProps","FormItem","composeExport"],"mappings":";;;;;;;;;;;;;;;;AAMA,MAAMA,KAAQ;AAyDd,SAASC,EAAQC,GAAOC,IAAc,MAAM;AAC1C,MAAI,CAACD,KAASA,MAAU;AACtB,WAAO;AACT,MAAIE,GAASF,CAAK,KAAKG,GAAeH,CAAK;AACzC,WAAO,GAAGA,CAAK,GAAGC,CAAW;AACxB,MAAIG,GAASJ,CAAK;AACvB,WAAOA;AAET,EAAAK,GAAUP,IAAO,0CAA0C;AAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChDA,UAAMQ,IAAQC,GAyBRC,IAAQC,GAAA,GACRC,IAAKC,GAAa,WAAW,GAC7BC,IAAY,GAAGC,EAAW,cAC1BC,IAAsD,OAAO;AAAA,MACjE,OAAO,QAAQC,GAAKT,GAAOU,EAAsB,CAAC,EAC/C,OAAO,CAAC,CAACC,GAAGjB,CAAK,MAAMkB,EAAQlB,CAAK,CAAC;AAAA,IAAA,GAEpCmB,IAAmBC,GAAA,GACnBC,IAAaC,EAAS,MAAM,OAAO,OAAO,CAAA,GAAIH,EAAiB,OAAOL,CAAc,CAAC,GAErFS,IAAQC,GAAA,GAERC,IAAQC,GAAY,QAAW,EAAE,UAAU,I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,UAAU;AAAA,MACV,aAAa;AAAA,IAAA;AAAA,IAEfV;AAAA,EAAA;AAEJ,GAEaW,KAAWC,GAAcL,IAAM;AAAA,EAC1C,UAAUE;AACZ,CAAC;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../node_modules/.pnpm/element-plus@2.13.0_vue@3.5.22_typescript@5.9.3_/node_modules/element-plus/es/utils/dom/style.mjs","../../src/form-item/form-item.vue","../../src/form-item/index.ts"],"sourcesContent":["import { isNumber, isStringNumber } from '../types.mjs';\nimport { isClient } from '@vueuse/core';\nimport { camelize, isObject, isString } from '@vue/shared';\nimport { entriesOf, keysOf } from '../objects.mjs';\nimport { debugWarn } from '../error.mjs';\n\nconst SCOPE = \"utils/dom/style\";\nconst classNameToArray = (cls = \"\") => cls.split(\" \").filter((item) => !!item.trim());\nconst hasClass = (el, cls) => {\n if (!el || !cls)\n return false;\n if (cls.includes(\" \"))\n throw new Error(\"className should not contain space.\");\n return el.classList.contains(cls);\n};\nconst addClass = (el, cls) => {\n if (!el || !cls.trim())\n return;\n el.classList.add(...classNameToArray(cls));\n};\nconst removeClass = (el, cls) => {\n if (!el || !cls.trim())\n return;\n el.classList.remove(...classNameToArray(cls));\n};\nconst getStyle = (element, styleName) => {\n var _a;\n if (!isClient || !element || !styleName)\n return \"\";\n let key = camelize(styleName);\n if (key === \"float\")\n key = \"cssFloat\";\n try {\n const style = element.style[key];\n if (style)\n return style;\n const computed = (_a = document.defaultView) == null ? void 0 : _a.getComputedStyle(element, \"\");\n return computed ? computed[key] : \"\";\n } catch (e) {\n return element.style[key];\n }\n};\nconst setStyle = (element, styleName, value) => {\n if (!element || !styleName)\n return;\n if (isObject(styleName)) {\n entriesOf(styleName).forEach(\n ([prop, value2]) => setStyle(element, prop, value2)\n );\n } else {\n const key = camelize(styleName);\n element.style[key] = value;\n }\n};\nconst removeStyle = (element, style) => {\n if (!element || !style)\n return;\n if (isObject(style)) {\n keysOf(style).forEach((prop) => removeStyle(element, prop));\n } else {\n setStyle(element, style, \"\");\n }\n};\nfunction addUnit(value, defaultUnit = \"px\") {\n if (!value && value !== 0)\n return \"\";\n if (isNumber(value) || isStringNumber(value)) {\n return `${value}${defaultUnit}`;\n } else if (isString(value)) {\n return value;\n }\n debugWarn(SCOPE, \"binding value must be a string or number\");\n}\n\nexport { addClass, addUnit, classNameToArray, getStyle, hasClass, removeClass, removeStyle, setStyle };\n//# sourceMappingURL=style.mjs.map\n","<script lang=\"ts\" setup>\r\nimport type { Field } from '@formily/core'\r\nimport type {\r\n FormItemContext,\r\n FormItemValidateState,\r\n FormValidationResult,\r\n TooltipInstance,\r\n} from 'element-plus'\r\nimport type { ICalculatedFormLayoutProps } from 'src/form-layout/types'\r\nimport type { CSSProperties } from 'vue'\r\nimport type { IFormItemProps } from './types'\r\nimport { CircleCheck, CircleClose, InfoFilled, Warning } from '@element-plus/icons-vue'\r\nimport { isArr, isValid } from '@formily/shared'\r\nimport { useField } from '@silver-formily/vue'\r\nimport { ElIcon, ElTooltip, formItemContextKey, useFormSize, useId, useNamespace } from 'element-plus'\r\nimport { addUnit } from 'element-plus/es/utils/index'\r\nimport { pick } from 'lodash-es'\r\nimport { computed, isVNode, provide, reactive, ref, useSlots, watch } from 'vue'\r\nimport { stylePrefix, useResizeObserver } from '../__builtins__'\r\nimport { FORM_LAYOUT_PROPS_KEYS, formLayoutShallowContext, useFormLayout } from '../form-layout/utils'\r\n\r\ndefineOptions({\r\n name: 'FFormItem',\r\n})\r\nconst props = defineProps({\n label: null,\n for: null,\n tooltip: null,\n addonBefore: null,\n addonAfter: null,\n extra: null,\n feedbackText: null,\n feedbackStatus: null,\n asterisk: { type: Boolean },\n colon: { type: Boolean, default: true },\n labelAlign: null,\n wrapperAlign: null,\n labelWrap: { type: Boolean },\n labelWidth: null,\n wrapperWidth: null,\n wrapperWrap: { type: Boolean },\n labelCol: null,\n wrapperCol: null,\n fullness: { type: Boolean, default: false },\n size: null,\n layout: null,\n feedbackLayout: { default: 'loose' },\n tooltipLayout: null\n})\r\nconst slots = useSlots()\r\nconst ns = useNamespace('form-item')\r\nconst prefixCls = `${stylePrefix}-form-item`\r\nconst formItemConfig: Partial<ICalculatedFormLayoutProps> = Object.fromEntries(\r\n Object.entries(pick(props, FORM_LAYOUT_PROPS_KEYS))\r\n .filter(([_, value]) => isValid(value)),\r\n)\r\nconst formlayoutConfig = useFormLayout()\r\nconst formlayout = computed(() => Object.assign({}, formlayoutConfig.value, formItemConfig))\r\n\r\nconst field = useField<Field>()\r\n\r\nconst _size = useFormSize(undefined, { formItem: false })\r\n\r\nconst labelId = useId().value\r\nconst inputIds = ref<string[]>([])\r\n\r\nconst validateState = ref<FormItemValidateState>('')\r\nconst formItemRef = ref<HTMLDivElement>()\r\nconst labelRef = ref<HTMLElement>()\r\nconst feedbackTooltipRef = ref<TooltipInstance>()\r\ndefineExpose({\r\n feedbackTooltipRef,\r\n})\r\n\r\nconst labelPosition = computed(\r\n () => {\r\n if (formlayout.value.layout === 'vertical' || (isArr(formlayout.value.layout) && formlayout.value.layout.includes('vertical' as any))) {\r\n return 'top'\r\n }\r\n return formlayout.value.labelAlign ?? 'right'\r\n },\r\n)\r\n\r\nconst labelStyle = computed<CSSProperties>(() => {\r\n if (labelPosition.value === 'top') {\r\n return {}\r\n }\r\n\r\n const labelWidth = addUnit(formlayout.value.labelWidth || '')\r\n if (labelWidth)\r\n return { width: labelWidth }\r\n return {}\r\n})\r\n\r\nconst contentStyle = computed<CSSProperties>(() => {\r\n const contentWidth = addUnit(formlayout.value?.wrapperWidth || '')\r\n if (contentWidth)\r\n return { width: contentWidth, flex: 'unset' }\r\n return {}\r\n})\r\n\r\nconst contentWrapperStyle = computed<CSSProperties>(() => {\r\n return {\r\n justifyContent: formlayout.value?.wrapperAlign === 'right' && 'flex-end',\r\n }\r\n})\r\n\r\nconst isRequired = computed(() =>\r\n props.asterisk && field.value?.pattern !== 'readPretty',\r\n)\r\n\r\nconst formItemClasses = computed(() => [\r\n ns.b(),\r\n // eslint-disable-next-line unicorn/explicit-length-check\r\n ns.m(props.size || _size.value || 'default'),\r\n ns.is(props.feedbackStatus),\r\n ns.is('validating', validateState.value === 'validating'),\r\n ns.is('success', validateState.value === 'success'),\r\n ns.is('required', isRequired.value || props.asterisk),\r\n ns.is('no-asterisk', formlayout.value?.hideRequiredAsterisk),\r\n ns.is(formlayout.value.feedbackLayout),\r\n formlayout.value?.requireAsteriskPosition === 'right'\r\n ? 'asterisk-right'\r\n : 'asterisk-left',\r\n {\r\n [ns.m('feedback')]: formlayout.value?.statusIcon,\r\n [ns.m(`label-${labelPosition.value}`)]: labelPosition.value,\r\n },\r\n])\r\n\r\nconst validateClasses = computed(() => [\r\n `${prefixCls}-feedback`,\r\n ns.is(props.feedbackStatus),\r\n ns.is('loose', props.feedbackLayout === 'loose'),\r\n])\r\n\r\nconst hasLabel = computed<boolean>(() => {\r\n return (props.label !== '' && isValid(props.label)) || isValid(slots.label)\r\n})\r\n\r\nconst labelFor = computed<string | undefined>(() => {\r\n return (\r\n props.for || (inputIds.value.length === 1 ? inputIds.value[0] : undefined)\r\n )\r\n})\r\n\r\nconst isGroup = computed<boolean>(() => {\r\n return !labelFor.value && hasLabel.value\r\n})\r\n\r\nasync function validate(): FormValidationResult {\r\n return true\r\n}\r\n/* istanbul ignore next -- @preserve */\r\nconst clearValidate: FormItemContext['clearValidate'] = () => {}\r\n/* istanbul ignore next -- @preserve */\r\nconst resetField: FormItemContext['resetField'] = async () => {}\r\n\r\nconst addInputId: FormItemContext['addInputId'] = (id: string) => {\r\n /* istanbul ignore else -- @preserve */\r\n if (!inputIds.value.includes(id)) {\r\n inputIds.value.push(id)\r\n }\r\n}\r\n\r\nconst removeInputId: FormItemContext['removeInputId'] = (id: string) => {\r\n inputIds.value = inputIds.value.filter(listId => listId !== id)\r\n}\r\n\r\nconst isEllipsisActive = ref(false)\r\nuseResizeObserver(labelRef, () => {\r\n isEllipsisActive.value = labelRef.value?.scrollWidth > labelRef.value?.clientWidth\r\n})\r\nconst isEllipsis = computed(() => {\r\n return isEllipsisActive.value && !formlayout.value.labelWrap\r\n})\r\n\r\n// HACK computed无法监听到props.feedbackStatus的变化\r\nconst _validateState = ref<FormItemValidateState>('')\r\nconst context: FormItemContext = reactive({\r\n $el: formItemRef,\r\n labelWidth: formlayout.value?.labelWidth,\r\n size: _size,\r\n validateState: _validateState.value,\r\n labelId,\r\n inputIds,\r\n isGroup,\r\n hasLabel,\r\n addInputId,\r\n removeInputId,\r\n resetField,\r\n clearValidate,\r\n validate,\r\n labelPosition,\r\n inlineMessage: true,\r\n showMessage: true,\r\n fieldValue: field.value?.value,\r\n validateMessage: '',\r\n propString: '',\r\n})\r\nwatch(() => props.feedbackStatus, (val) => {\r\n if (val === 'pending') {\r\n context.validateState = 'validating'\r\n return\r\n }\r\n if (val === 'warning') {\r\n context.validateState = ''\r\n return\r\n }\r\n context.validateState = val\r\n}, {\r\n immediate: true,\r\n})\r\n\r\nprovide(formLayoutShallowContext, ref({\r\n ...(isValid(props.size) && { size: props.size }),\r\n ...(isValid(props.colon) && { colon: props.colon }),\r\n}))\r\nprovide(formItemContextKey, context)\r\n</script>\r\n\r\n<template>\r\n <div\r\n ref=\"formItemRef\" :class=\"[prefixCls, formlayout.labelWrap && 'is-warp', ...formItemClasses]\"\r\n :role=\"isGroup ? 'group' : undefined\" :aria-labelledby=\"isGroup ? labelId : undefined\"\r\n >\r\n <component\r\n :is=\"labelFor ? 'label' : 'div'\" v-if=\"hasLabel\" :id=\"labelId\" :for=\"labelFor\"\r\n :class=\"[ns.e('label'), isValid(formlayout.labelCol) && `${prefixCls}-col-${formlayout.labelCol}`]\"\r\n :style=\"labelStyle\"\r\n >\r\n <!-- label -->\r\n <template v-if=\"isVNode(props.label)\">\r\n <component :is=\"props.label\" />\r\n </template>\r\n <div v-else :class=\"`${prefixCls}-label__wrapper`\">\r\n <ElTooltip :disabled=\"!isEllipsis && formlayout.tooltipLayout !== 'text'\">\r\n <span\r\n :class=\"{\r\n [`${prefixCls}-label-content`]: true,\r\n ['is-tooltip']: isEllipsis || (props.tooltip && formlayout.tooltipLayout === 'text'),\r\n }\"\r\n >\r\n <span ref=\"labelRef\">{{ props.label }}</span>\r\n </span>\r\n <template #content>\r\n <template v-if=\"isVNode(props.tooltip)\">\r\n <component :is=\"props.tooltip\" />\r\n </template>\r\n <div v-else :style=\"`width: ${labelRef?.clientWidth ?? 0}px;`\">\r\n <template v-if=\"isEllipsis\">\r\n {{ props.label }}\r\n </template>\r\n <template v-if=\"formlayout.tooltipLayout === 'text'\">\r\n {{ props.tooltip }}\r\n </template>\r\n </div>\r\n </template>\r\n </ElTooltip>\r\n <ElTooltip v-if=\"props.tooltip && formlayout.tooltipLayout !== 'text'\" :content=\"props.tooltip\">\r\n <ElIcon :class=\"`${prefixCls}-label-tooltip`\">\r\n <InfoFilled />\r\n </ElIcon>\r\n </ElTooltip>\r\n <span v-if=\"props.colon\" :class=\"`${prefixCls}-colon`\">:</span>\r\n </div>\r\n </component>\r\n <!-- content -->\r\n <div\r\n :class=\"[\r\n `${prefixCls}-content__wrapper`,\r\n isValid(formlayout.wrapperCol) && `${prefixCls}-col-${formlayout.wrapperCol}`,\r\n ]\"\r\n :style=\"contentWrapperStyle\"\r\n >\r\n <template v-if=\"isValid(props.addonBefore)\">\r\n <template v-if=\"isVNode(props.addonBefore)\">\r\n <component :is=\"props.addonBefore\" />\r\n </template>\r\n <div v-else :class=\"`${prefixCls}-addon-before`\">\r\n {{ props.addonBefore }}\r\n </div>\r\n </template>\r\n <div\r\n :class=\"[\r\n ns.e('content'),\r\n formlayout.fullness && 'is-fullness',\r\n ns.is('addon-after', !!props.addonAfter),\r\n ]\" :style=\"contentStyle\"\r\n >\r\n <ElTooltip\r\n v-if=\"props.feedbackLayout === 'popover'\"\r\n ref=\"feedbackTooltipRef\"\r\n :visible=\"!!props.feedbackText\"\r\n effect=\"light\"\r\n :offset=\"6\"\r\n >\r\n <template #default>\r\n <slot />\r\n </template>\r\n <template #content>\r\n <div :class=\"[...validateClasses, ns.is('tooltip')]\">\r\n <ElIcon>\r\n <CircleClose v-if=\"props.feedbackStatus === 'error'\" />\r\n <CircleCheck v-if=\"props.feedbackStatus === 'success'\" />\r\n <Warning v-if=\"props.feedbackStatus === 'warning'\" />\r\n </ElIcon>\r\n {{ props.feedbackText }}\r\n </div>\r\n </template>\r\n </ElTooltip>\r\n <slot v-else />\r\n <TransitionGroup :name=\"`${ns.namespace.value}-zoom-in-top`\">\r\n <div v-if=\"props.feedbackText && props.feedbackLayout !== 'popover'\" :class=\"validateClasses\">\r\n {{ props.feedbackText }}\r\n </div>\r\n <template v-if=\"isValid(props.extra)\">\r\n <template v-if=\"isVNode(props.extra)\">\r\n <component :is=\"props.extra\" />\r\n </template>\r\n <div v-else :class=\"`${prefixCls}-extra`\">\r\n {{ props.extra }}\r\n </div>\r\n </template>\r\n </TransitionGroup>\r\n </div>\r\n <template v-if=\"isValid(props.addonAfter)\">\r\n <template v-if=\"isVNode(props.addonAfter)\">\r\n <component :is=\"props.addonAfter\" />\r\n </template>\r\n <div v-else :class=\"`${prefixCls}-addon-after`\">\r\n {{ props.addonAfter }}\r\n </div>\r\n </template>\r\n </div>\r\n </div>\r\n</template>\r\n","import { isVoidField } from '@formily/core'\r\nimport { connect, mapProps } from '@silver-formily/vue'\r\nimport { composeExport } from '../__builtins__'\r\nimport FormBaseItem from './form-item.vue'\r\nimport { determineFeedbackStatus, getFeedbackMessage } from './utils'\r\nimport './style.scss'\r\n\r\nexport function fieldFeedbackMapper(props, field) {\r\n if (isVoidField(field) || !field) {\r\n return props\r\n }\r\n\r\n const feedbackText = getFeedbackMessage(field)\r\n const feedbackStatus = determineFeedbackStatus(field)\r\n const asterisk = 'asterisk' in props\r\n ? props.asterisk\r\n : field.required && field.pattern !== 'readPretty'\r\n\r\n return {\r\n ...props,\r\n feedbackText,\r\n feedbackStatus,\r\n asterisk,\r\n }\r\n}\r\n\r\nconst Item = connect(\r\n FormBaseItem,\r\n mapProps(\r\n {\r\n validateStatus: true,\r\n title: 'label',\r\n required: true,\r\n description: 'extra',\r\n },\r\n fieldFeedbackMapper,\r\n ),\r\n)\r\n\r\nexport const FormItem = composeExport(Item, {\r\n BaseItem: FormBaseItem,\r\n})\r\n\r\nexport default FormItem\r\n\r\nexport { default as FormBaseItem } from './form-item.vue'\r\n"],"names":["SCOPE","addUnit","value","defaultUnit","isNumber","isStringNumber","isString","debugWarn","props","__props","slots","useSlots","ns","useNamespace","prefixCls","stylePrefix","formItemConfig","pick","FORM_LAYOUT_PROPS_KEYS","_","isValid","formlayoutConfig","useFormLayout","formlayout","computed","field","useField","_size","useFormSize","labelId","useId","inputIds","ref","validateState","formItemRef","labelRef","feedbackTooltipRef","__expose","labelPosition","isArr","labelStyle","labelWidth","contentStyle","contentWidth","contentWrapperStyle","isRequired","formItemClasses","validateClasses","hasLabel","labelFor","isGroup","validate","clearValidate","resetField","addInputId","id","removeInputId","listId","isEllipsisActive","useResizeObserver","isEllipsis","_validateState","context","reactive","watch","val","provide","formLayoutShallowContext","formItemContextKey","_createElementBlock","_unref","_openBlock","_createBlock","_resolveDynamicComponent","_normalizeClass","isVNode","_createVNode","ElTooltip","_normalizeStyle","_Fragment","_createTextVNode","_toDisplayString","_createElementVNode","ElIcon","InfoFilled","_renderSlot","_ctx","CircleClose","CircleCheck","Warning","_TransitionGroup","fieldFeedbackMapper","isVoidField","feedbackText","getFeedbackMessage","feedbackStatus","determineFeedbackStatus","asterisk","Item","connect","FormBaseItem","mapProps","FormItem","composeExport"],"mappings":";;;;;;;;;;;;;;AAMA,MAAMA,KAAQ;AAyDd,SAASC,EAAQC,GAAOC,IAAc,MAAM;AAC1C,MAAI,CAACD,KAASA,MAAU;AACtB,WAAO;AACT,MAAIE,GAASF,CAAK,KAAKG,GAAeH,CAAK;AACzC,WAAO,GAAGA,CAAK,GAAGC,CAAW;AACxB,MAAIG,GAASJ,CAAK;AACvB,WAAOA;AAET,EAAAK,GAAUP,IAAO,0CAA0C;AA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QAAA;;;;;ACpUtB,SAASmF,GAAoBnF,GAAOiB,GAAO;AAChD,MAAImE,GAAYnE,CAAK,KAAK,CAACA;AACzB,WAAOjB;AAGT,QAAMqF,IAAeC,GAAmBrE,CAAK,GACvCsE,IAAiBC,GAAwBvE,CAAK,GAC9CwE,IAAW,cAAczF,IAC3BA,EAAM,WACNiB,EAAM,YAAYA,EAAM,YAAY;AAExC,SAAO;AAAA,IACL,GAAGjB;AAAA,IACH,cAAAqF;AAAA,IACA,gBAAAE;AAAA,IACA,UAAAE;AAAA,EAAA;AAEJ;AAEA,MAAMC,KAAOC;AAAA,EACXC;AAAAA,EACAC;AAAA,IACE;AAAA,MACE,gBAAgB;AAAA,MAChB,OAAO;AAAA,MACP,UAAU;AAAA,MACV,aAAa;AAAA,IAAA;AAAA,IAEfV;AAAA,EAAA;AAEJ,GAEaW,KAAWC,GAAcL,IAAM;AAAA,EAC1C,UAAUE;AACZ,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../src/form-item/utils.ts"],"sourcesContent":["import type { Field } from '@formily/core'\nimport { isArr } from '@formily/shared'\n\nexport function getFeedbackMessage(field: Field) {\n const messages = {\n errors: field.selfErrors.join(', '),\n warnings: field.selfWarnings.join(', '),\n successes: field.selfSuccesses.join(', '),\n }\n\n return messages.errors || messages.warnings || messages.successes\n}\n\nexport function determineFeedbackStatus(field: Field) {\n return isArr(field.decorator)\n ? (field.decorator[1]?.feedbackStatus ?? field.validateStatus)\n : field.validateStatus\n}\n"],"names":["getFeedbackMessage","field","messages","determineFeedbackStatus","isArr"],"mappings":";AAGO,SAASA,EAAmBC,GAAc;AAC/C,QAAMC,IAAW;AAAA,IACf,QAAQD,EAAM,WAAW,KAAK,IAAI;AAAA,IAClC,UAAUA,EAAM,aAAa,KAAK,IAAI;AAAA,IACtC,WAAWA,EAAM,cAAc,KAAK,IAAI;AAAA,EAAA;AAG1C,SAAOC,EAAS,UAAUA,EAAS,YAAYA,EAAS;AAC1D;AAEO,SAASC,EAAwBF,GAAc;AACpD,SAAOG,EAAMH,EAAM,SAAS,IACvBA,EAAM,UAAU,CAAC,GAAG,kBAAkBA,EAAM,iBAC7CA,EAAM;AACZ;"}
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../src/form-item/utils.ts"],"sourcesContent":["import type { Field } from '@formily/core'\r\nimport { isArr } from '@formily/shared'\r\n\r\nexport function getFeedbackMessage(field: Field) {\r\n const messages = {\r\n errors: field.selfErrors.join(', '),\r\n warnings: field.selfWarnings.join(', '),\r\n successes: field.selfSuccesses.join(', '),\r\n }\r\n\r\n return messages.errors || messages.warnings || messages.successes\r\n}\r\n\r\nexport function determineFeedbackStatus(field: Field) {\r\n return isArr(field.decorator)\r\n ? (field.decorator[1]?.feedbackStatus ?? field.validateStatus)\r\n : field.validateStatus\r\n}\r\n"],"names":["getFeedbackMessage","field","messages","determineFeedbackStatus","isArr"],"mappings":";AAGO,SAASA,EAAmBC,GAAc;AAC/C,QAAMC,IAAW;AAAA,IACf,QAAQD,EAAM,WAAW,KAAK,IAAI;AAAA,IAClC,UAAUA,EAAM,aAAa,KAAK,IAAI;AAAA,IACtC,WAAWA,EAAM,cAAc,KAAK,IAAI;AAAA,EAAA;AAG1C,SAAOC,EAAS,UAAUA,EAAS,YAAYA,EAAS;AAC1D;AAEO,SAASC,EAAwBF,GAAc;AACpD,SAAOG,EAAMH,EAAM,SAAS,IACvBA,EAAM,UAAU,CAAC,GAAG,kBAAkBA,EAAM,iBAC7CA,EAAM;AACZ;"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { defineComponent as w, ref as l, provide as s, watch as k, createBlock as C, openBlock as v, resolveDynamicComponent as A, mergeProps as B, unref as a, withModifiers as P, withCtx as b, renderSlot as x } from "vue";
|
|
2
2
|
import { isValid as f, isEmpty as F } from "@formily/shared";
|
|
3
|
-
import { useForm as R } from "@formily/vue";
|
|
3
|
+
import { useForm as R } from "@silver-formily/vue";
|
|
4
4
|
import { formContextKey as _ } from "element-plus";
|
|
5
|
-
import {
|
|
6
|
-
import { useThrottleFn as
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
|
|
10
|
-
import { useCleanAttrs as z } from "../__builtins__/shared/utils.mjs";
|
|
11
|
-
import { useFormDeepLayout as D, useResponsiveFormLayout as W, filterValidFormLayoutProps as o, formLayoutDeepContext as I, formLayoutShallowContext as M } from "./utils.mjs";
|
|
12
|
-
const O = /* @__PURE__ */ w({
|
|
5
|
+
import { useFormDeepLayout as g, useResponsiveFormLayout as q, filterValidFormLayoutProps as o, formLayoutDeepContext as z, formLayoutShallowContext as D } from "./utils.mjs";
|
|
6
|
+
import { useThrottleFn as W } from "../__builtins__/shared/hooks.mjs";
|
|
7
|
+
import { useCleanAttrs as I } from "../__builtins__/shared/utils.mjs";
|
|
8
|
+
import { stylePrefix as M } from "../__builtins__/configs/index.mjs";
|
|
9
|
+
const G = /* @__PURE__ */ w({
|
|
13
10
|
name: "FFormLayout",
|
|
14
11
|
inheritAttrs: !1,
|
|
15
12
|
__name: "form-layout",
|
|
@@ -36,17 +33,17 @@ const O = /* @__PURE__ */ w({
|
|
|
36
33
|
requireAsteriskPosition: null
|
|
37
34
|
},
|
|
38
35
|
setup(m) {
|
|
39
|
-
const e = m, d = `${
|
|
36
|
+
const e = m, d = `${M}-form`, { props: y } = I(), i = l(), c = g(), { props: t } = q(e, i), h = l({
|
|
40
37
|
...c.value,
|
|
41
38
|
...e.shallow ? {
|
|
42
39
|
...f(e.size) && { size: e.size },
|
|
43
40
|
...f(e.colon) && { colon: e.colon }
|
|
44
41
|
} : o(e)
|
|
45
42
|
});
|
|
46
|
-
s(
|
|
43
|
+
s(z, h);
|
|
47
44
|
const n = l(e.shallow ? o(e) : {});
|
|
48
|
-
s(
|
|
49
|
-
const L =
|
|
45
|
+
s(D, n);
|
|
46
|
+
const L = W(() => {
|
|
50
47
|
if (!F(t.value)) {
|
|
51
48
|
const r = o(t.value);
|
|
52
49
|
n.value = o({ ...e, ...r });
|
|
@@ -78,6 +75,6 @@ const O = /* @__PURE__ */ w({
|
|
|
78
75
|
}
|
|
79
76
|
});
|
|
80
77
|
export {
|
|
81
|
-
|
|
78
|
+
G as _
|
|
82
79
|
};
|
|
83
80
|
//# sourceMappingURL=form-layout.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-layout.mjs","sources":["../../src/form-layout/form-layout.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { FormContext } from 'element-plus'\nimport type { IFormLayoutProps } from './types'\nimport { isEmpty, isValid } from '@formily/shared'\nimport { useForm } from '@formily/vue'\nimport { formContextKey } from 'element-plus'\nimport { provide, ref, watch } from 'vue'\nimport { stylePrefix, useCleanAttrs, useThrottleFn } from '../__builtins__'\nimport { filterValidFormLayoutProps, formLayoutDeepContext, formLayoutShallowContext, useFormDeepLayout, useResponsiveFormLayout } from './utils'\n\ndefineOptions({\n name: 'FFormLayout',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n tag: { default: 'form' },\n colon: { type: Boolean, default: true },\n labelAlign: null,\n wrapperAlign: null,\n labelWrap: { type: Boolean, default: true },\n labelWidth: null,\n wrapperWidth: null,\n wrapperWrap: { type: Boolean, default: false },\n labelCol: null,\n wrapperCol: null,\n fullness: { type: Boolean, default: false },\n size: { default: 'default' },\n layout: { default: 'horizontal' },\n feedbackLayout: null,\n tooltipLayout: null,\n breakpoints: null,\n shallow: { type: Boolean, default: true },\n hideRequiredAsterisk: { type: Boolean },\n statusIcon: { type: Boolean, default: true },\n requireAsteriskPosition: null\n})\nconst formPrefixCls = `${stylePrefix}-form`\nconst { props: attrs } = useCleanAttrs()\nconst rootHTMLRef = ref<HTMLElement>()\n\nconst formLayoutDeepConfig = useFormDeepLayout()\nconst { props: responsiveProps } = useResponsiveFormLayout(props, rootHTMLRef)\n\nconst deepLayout = ref({\n ...formLayoutDeepConfig.value,\n ...(props.shallow\n ? {\n ...(isValid(props.size) && { size: props.size }),\n ...(isValid(props.colon) && { colon: props.colon }),\n }\n : filterValidFormLayoutProps(props)),\n})\nprovide(formLayoutDeepContext, deepLayout)\n\nconst shallowLayout = ref(props.shallow ? filterValidFormLayoutProps(props) : {})\nprovide(formLayoutShallowContext, shallowLayout)\n\nconst updateLayout = useThrottleFn(() => {\n if (!isEmpty(responsiveProps.value)) {\n const _responsiveProps = filterValidFormLayoutProps(responsiveProps.value)\n shallowLayout.value = filterValidFormLayoutProps({ ...props, ..._responsiveProps })\n }\n}, 200, true)\n\nwatch(() => [props, responsiveProps], updateLayout, {\n deep: true,\n immediate: true,\n})\n\nprovide(formContextKey, {\n statusIcon: props.statusIcon,\n hideRequiredAsterisk: props.hideRequiredAsterisk,\n requireAsteriskPosition: props.requireAsteriskPosition,\n} as FormContext)\n\nconst formRef = useForm()\n</script>\n\n<template>\n <component\n :is=\"props.tag\"\n :id=\"formRef?.id && `formily-${formRef?.id}`\"\n ref=\"rootHTMLRef\"\n :class=\"formPrefixCls\"\n v-bind=\"attrs\"\n @submit.prevent.stop\n >\n <slot />\n </component>\n</template>\n"],"names":["props","__props","formPrefixCls","stylePrefix","attrs","useCleanAttrs","rootHTMLRef","ref","formLayoutDeepConfig","useFormDeepLayout","responsiveProps","useResponsiveFormLayout","deepLayout","isValid","filterValidFormLayoutProps","provide","formLayoutDeepContext","shallowLayout","formLayoutShallowContext","updateLayout","useThrottleFn","isEmpty","_responsiveProps","watch","formContextKey","formRef","useForm","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_unref","_renderSlot","_ctx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-layout.mjs","sources":["../../src/form-layout/form-layout.vue"],"sourcesContent":["<script lang=\"ts\" setup>\r\nimport type { FormContext } from 'element-plus'\r\nimport type { IFormLayoutProps } from './types'\r\nimport { isEmpty, isValid } from '@formily/shared'\r\nimport { useForm } from '@silver-formily/vue'\r\nimport { formContextKey } from 'element-plus'\r\nimport { provide, ref, watch } from 'vue'\r\nimport { stylePrefix, useCleanAttrs, useThrottleFn } from '../__builtins__'\r\nimport { filterValidFormLayoutProps, formLayoutDeepContext, formLayoutShallowContext, useFormDeepLayout, useResponsiveFormLayout } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FFormLayout',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps({\n tag: { default: 'form' },\n colon: { type: Boolean, default: true },\n labelAlign: null,\n wrapperAlign: null,\n labelWrap: { type: Boolean, default: true },\n labelWidth: null,\n wrapperWidth: null,\n wrapperWrap: { type: Boolean, default: false },\n labelCol: null,\n wrapperCol: null,\n fullness: { type: Boolean, default: false },\n size: { default: 'default' },\n layout: { default: 'horizontal' },\n feedbackLayout: null,\n tooltipLayout: null,\n breakpoints: null,\n shallow: { type: Boolean, default: true },\n hideRequiredAsterisk: { type: Boolean },\n statusIcon: { type: Boolean, default: true },\n requireAsteriskPosition: null\n})\r\nconst formPrefixCls = `${stylePrefix}-form`\r\nconst { props: attrs } = useCleanAttrs()\r\nconst rootHTMLRef = ref<HTMLElement>()\r\n\r\nconst formLayoutDeepConfig = useFormDeepLayout()\r\nconst { props: responsiveProps } = useResponsiveFormLayout(props, rootHTMLRef)\r\n\r\nconst deepLayout = ref({\r\n ...formLayoutDeepConfig.value,\r\n ...(props.shallow\r\n ? {\r\n ...(isValid(props.size) && { size: props.size }),\r\n ...(isValid(props.colon) && { colon: props.colon }),\r\n }\r\n : filterValidFormLayoutProps(props)),\r\n})\r\nprovide(formLayoutDeepContext, deepLayout)\r\n\r\nconst shallowLayout = ref(props.shallow ? filterValidFormLayoutProps(props) : {})\r\nprovide(formLayoutShallowContext, shallowLayout)\r\n\r\nconst updateLayout = useThrottleFn(() => {\r\n if (!isEmpty(responsiveProps.value)) {\r\n const _responsiveProps = filterValidFormLayoutProps(responsiveProps.value)\r\n shallowLayout.value = filterValidFormLayoutProps({ ...props, ..._responsiveProps })\r\n }\r\n}, 200, true)\r\n\r\nwatch(() => [props, responsiveProps], updateLayout, {\r\n deep: true,\r\n immediate: true,\r\n})\r\n\r\nprovide(formContextKey, {\r\n statusIcon: props.statusIcon,\r\n hideRequiredAsterisk: props.hideRequiredAsterisk,\r\n requireAsteriskPosition: props.requireAsteriskPosition,\r\n} as FormContext)\r\n\r\nconst formRef = useForm()\r\n</script>\r\n\r\n<template>\r\n <component\r\n :is=\"props.tag\"\r\n :id=\"formRef?.id && `formily-${formRef?.id}`\"\r\n ref=\"rootHTMLRef\"\r\n :class=\"formPrefixCls\"\r\n v-bind=\"attrs\"\r\n @submit.prevent.stop\r\n >\r\n <slot />\r\n </component>\r\n</template>\r\n"],"names":["props","__props","formPrefixCls","stylePrefix","attrs","useCleanAttrs","rootHTMLRef","ref","formLayoutDeepConfig","useFormDeepLayout","responsiveProps","useResponsiveFormLayout","deepLayout","isValid","filterValidFormLayoutProps","provide","formLayoutDeepContext","shallowLayout","formLayoutShallowContext","updateLayout","useThrottleFn","isEmpty","_responsiveProps","watch","formContextKey","formRef","useForm","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_unref","_renderSlot","_ctx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,UAAMA,IAAQC,GAsBRC,IAAgB,GAAGC,CAAW,SAC9B,EAAE,OAAOC,EAAA,IAAUC,EAAA,GACnBC,IAAcC,EAAA,GAEdC,IAAuBC,EAAA,GACvB,EAAE,OAAOC,EAAA,IAAoBC,EAAwBX,GAAOM,CAAW,GAEvEM,IAAaL,EAAI;AAAA,MACrB,GAAGC,EAAqB;AAAA,MACxB,GAAIR,EAAM,UACN;AAAA,QACE,GAAIa,EAAQb,EAAM,IAAI,KAAK,EAAE,MAAMA,EAAM,KAAA;AAAA,QACzC,GAAIa,EAAQb,EAAM,KAAK,KAAK,EAAE,OAAOA,EAAM,MAAA;AAAA,MAAM,IAEnDc,EAA2Bd,CAAK;AAAA,IAAA,CACrC;AACD,IAAAe,EAAQC,GAAuBJ,CAAU;AAEzC,UAAMK,IAAgBV,EAAIP,EAAM,UAAUc,EAA2Bd,CAAK,IAAI,EAAE;AAChF,IAAAe,EAAQG,GAA0BD,CAAa;AAE/C,UAAME,IAAeC,EAAc,MAAM;AACvC,UAAI,CAACC,EAAQX,EAAgB,KAAK,GAAG;AACnC,cAAMY,IAAmBR,EAA2BJ,EAAgB,KAAK;AACzE,QAAAO,EAAc,QAAQH,EAA2B,EAAE,GAAGd,GAAO,GAAGsB,GAAkB;AAAA,MACpF;AAAA,IACF,GAAG,KAAK,EAAI;AAEZ,IAAAC,EAAM,MAAM,CAACvB,GAAOU,CAAe,GAAGS,GAAc;AAAA,MAClD,MAAM;AAAA,MACN,WAAW;AAAA,IAAA,CACZ,GAEDJ,EAAQS,GAAgB;AAAA,MACtB,YAAYxB,EAAM;AAAA,MAClB,sBAAsBA,EAAM;AAAA,MAC5B,yBAAyBA,EAAM;AAAA,IAAA,CACjB;AAEhB,UAAMyB,IAAUC,EAAA;sBAIdC,KAAAC,EASYC,EARL7B,EAAM,GAAG,GADhB8B,EASY;AAAA,MAPT,IAAIC,EAAAN,CAAA,GAAS,MAAE,WAAeM,EAAAN,CAAA,GAAS,EAAE;AAAA,eACtC;AAAA,MAAJ,KAAInB;AAAA,MACH,OAAOJ;AAAA,IAAA,GACA6B,EAAA3B,CAAA,GAAK;AAAA,MACZ,4BAAD,MAAA;AAAA,MAAA,GAAoB,CAAA,WAAA,MAAA,CAAA;AAAA,IAAA;iBAEpB,MAAQ;AAAA,QAAR4B,EAAQC,EAAA,QAAA,SAAA;AAAA,MAAA;;;;;"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { isArr as L, isValid as u } from "@formily/shared";
|
|
2
|
-
import { inject as
|
|
2
|
+
import { inject as i, ref as l, computed as d } from "vue";
|
|
3
3
|
import { useResizeObserver as h } from "../__builtins__/shared/hooks.mjs";
|
|
4
|
-
import "element-plus";
|
|
5
|
-
import "@formily/reactive";
|
|
6
|
-
import "@formily/core";
|
|
7
|
-
import "@formily/reactive-vue";
|
|
8
|
-
import "@formily/vue";
|
|
9
4
|
function w(t, o) {
|
|
10
5
|
for (const [r, e] of t.entries())
|
|
11
6
|
if (o <= e)
|
|
@@ -24,7 +19,7 @@ function a(t, o) {
|
|
|
24
19
|
function C(t, o) {
|
|
25
20
|
const { clientWidth: r } = t, {
|
|
26
21
|
breakpoints: e,
|
|
27
|
-
layout:
|
|
22
|
+
layout: p,
|
|
28
23
|
labelAlign: c,
|
|
29
24
|
wrapperAlign: f,
|
|
30
25
|
labelCol: m,
|
|
@@ -35,7 +30,7 @@ function C(t, o) {
|
|
|
35
30
|
r
|
|
36
31
|
);
|
|
37
32
|
return {
|
|
38
|
-
layout: a(
|
|
33
|
+
layout: a(p, n),
|
|
39
34
|
labelAlign: a(c, n),
|
|
40
35
|
wrapperAlign: a(f, n),
|
|
41
36
|
labelCol: a(m, n),
|
|
@@ -43,33 +38,33 @@ function C(t, o) {
|
|
|
43
38
|
...b
|
|
44
39
|
};
|
|
45
40
|
}
|
|
46
|
-
function
|
|
41
|
+
function O(t, o) {
|
|
47
42
|
const { breakpoints: r } = t;
|
|
48
43
|
if (!L(r))
|
|
49
44
|
return {
|
|
50
|
-
props:
|
|
45
|
+
props: l(t)
|
|
51
46
|
};
|
|
52
|
-
const e =
|
|
47
|
+
const e = l({});
|
|
53
48
|
return h(o, () => {
|
|
54
49
|
e.value = C(o.value, t);
|
|
55
50
|
}), {
|
|
56
51
|
props: e
|
|
57
52
|
};
|
|
58
53
|
}
|
|
59
|
-
const
|
|
54
|
+
const s = Symbol(
|
|
60
55
|
"formLayoutDeepContext"
|
|
61
56
|
), x = Symbol("formLayoutShallowContext");
|
|
62
|
-
function
|
|
63
|
-
return
|
|
57
|
+
function P() {
|
|
58
|
+
return i(s, l({}));
|
|
64
59
|
}
|
|
65
|
-
function
|
|
66
|
-
const t =
|
|
60
|
+
function S() {
|
|
61
|
+
const t = i(x, l({})), o = i(s, l({}));
|
|
67
62
|
return d(() => ({
|
|
68
63
|
...o.value,
|
|
69
64
|
...t.value
|
|
70
65
|
}));
|
|
71
66
|
}
|
|
72
|
-
const
|
|
67
|
+
const R = [
|
|
73
68
|
"colon",
|
|
74
69
|
"labelAlign",
|
|
75
70
|
"wrapperAlign",
|
|
@@ -88,22 +83,22 @@ const D = [
|
|
|
88
83
|
"hideRequiredAsterisk",
|
|
89
84
|
"statusIcon"
|
|
90
85
|
];
|
|
91
|
-
function
|
|
86
|
+
function W(t) {
|
|
92
87
|
return Object.fromEntries(
|
|
93
88
|
Object.entries(t).filter(([o, r]) => u(r))
|
|
94
89
|
);
|
|
95
90
|
}
|
|
96
91
|
export {
|
|
97
|
-
|
|
92
|
+
R as FORM_LAYOUT_PROPS_KEYS,
|
|
98
93
|
w as calcBreakpointIndex,
|
|
99
94
|
A as calcFactor,
|
|
100
95
|
C as calculateProps,
|
|
101
96
|
a as factor,
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
W as filterValidFormLayoutProps,
|
|
98
|
+
s as formLayoutDeepContext,
|
|
104
99
|
x as formLayoutShallowContext,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
P as useFormDeepLayout,
|
|
101
|
+
S as useFormLayout,
|
|
102
|
+
O as useResponsiveFormLayout
|
|
108
103
|
};
|
|
109
104
|
//# sourceMappingURL=utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../src/form-layout/utils.ts"],"sourcesContent":["import type { InjectionKey, Ref } from 'vue'\nimport type { IFormLayoutProps } from './types'\nimport { isArr, isValid } from '@formily/shared'\nimport { computed, inject, ref } from 'vue'\nimport { useResizeObserver } from '../__builtins__'\n\nexport function calcBreakpointIndex(breakpoints: number[], width: number): number {\n for (const [i, breakpoint] of breakpoints.entries()) {\n if (width <= breakpoint) {\n return i\n }\n }\n return -1\n}\n\nexport function calcFactor<T>(value: T | readonly T[], breakpointIndex: number): T {\n if (!Array.isArray(value) || value.length === 0) {\n return value as T\n }\n const safeIndex = Math.max(-1, Math.min(breakpointIndex, value.length - 1))\n return value.at(safeIndex)\n}\n\nexport function factor<T>(value: T | T[], breakpointIndex: number): T {\n return isValid(value) ? calcFactor<T>(value, breakpointIndex) : value as T\n}\n\nexport function calculateProps(target: Element, props: IFormLayoutProps): IFormLayoutProps {\n const { clientWidth } = target\n const {\n breakpoints,\n layout,\n labelAlign,\n wrapperAlign,\n labelCol,\n wrapperCol,\n ...otherProps\n } = props\n const breakpointIndex = calcBreakpointIndex(\n breakpoints as number[],\n clientWidth,\n )\n\n return {\n layout: factor(layout, breakpointIndex),\n labelAlign: factor(labelAlign, breakpointIndex),\n wrapperAlign: factor(wrapperAlign, breakpointIndex),\n labelCol: factor(labelCol, breakpointIndex),\n wrapperCol: factor(wrapperCol, breakpointIndex),\n ...otherProps,\n }\n}\n\nexport function useResponsiveFormLayout(props: IFormLayoutProps, root: Ref<HTMLElement | null>) {\n const { breakpoints } = props\n if (!isArr(breakpoints)) {\n return {\n props: ref(props),\n }\n }\n\n const layoutProps = ref<IFormLayoutProps>({})\n\n useResizeObserver(root, () => {\n layoutProps.value = calculateProps(root.value, props)\n })\n\n return {\n props: layoutProps,\n }\n}\n\nexport const formLayoutDeepContext: InjectionKey<Ref<IFormLayoutProps>> = Symbol(\n 'formLayoutDeepContext',\n)\n\nexport const formLayoutShallowContext: InjectionKey<Ref<IFormLayoutProps>>\n = Symbol('formLayoutShallowContext')\n\nexport function useFormDeepLayout(): Ref<IFormLayoutProps> {\n return inject(formLayoutDeepContext, ref({}))\n}\n\nexport function useFormLayout(): Ref<IFormLayoutProps> {\n const shallowLayout = inject(formLayoutShallowContext, ref({}))\n const deepLayout = inject(formLayoutDeepContext, ref({}))\n\n const formLayout = computed(() => {\n return {\n ...deepLayout.value,\n ...shallowLayout.value,\n }\n })\n\n return formLayout\n}\n\nexport const FORM_LAYOUT_PROPS_KEYS: ReadonlyArray<keyof IFormLayoutProps> = [\n 'colon',\n 'labelAlign',\n 'wrapperAlign',\n 'labelWrap',\n 'labelWidth',\n 'wrapperWidth',\n 'wrapperWrap',\n 'labelCol',\n 'wrapperCol',\n 'fullness',\n 'size',\n 'layout',\n 'feedbackLayout',\n 'tooltipLayout',\n 'breakpoints',\n 'hideRequiredAsterisk',\n 'statusIcon',\n] as const\n\nexport function filterValidFormLayoutProps(props: IFormLayoutProps): IFormLayoutProps {\n return Object.fromEntries(\n Object.entries(props)\n .filter(([_, value]) => isValid(value)),\n )\n}\n"],"names":["calcBreakpointIndex","breakpoints","width","i","breakpoint","calcFactor","value","breakpointIndex","safeIndex","factor","isValid","calculateProps","target","props","clientWidth","layout","labelAlign","wrapperAlign","labelCol","wrapperCol","otherProps","useResponsiveFormLayout","root","isArr","ref","layoutProps","useResizeObserver","formLayoutDeepContext","formLayoutShallowContext","useFormDeepLayout","inject","useFormLayout","shallowLayout","deepLayout","computed","FORM_LAYOUT_PROPS_KEYS","filterValidFormLayoutProps","_"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../src/form-layout/utils.ts"],"sourcesContent":["import type { InjectionKey, Ref } from 'vue'\r\nimport type { IFormLayoutProps } from './types'\r\nimport { isArr, isValid } from '@formily/shared'\r\nimport { computed, inject, ref } from 'vue'\r\nimport { useResizeObserver } from '../__builtins__'\r\n\r\nexport function calcBreakpointIndex(breakpoints: number[], width: number): number {\r\n for (const [i, breakpoint] of breakpoints.entries()) {\r\n if (width <= breakpoint) {\r\n return i\r\n }\r\n }\r\n return -1\r\n}\r\n\r\nexport function calcFactor<T>(value: T | readonly T[], breakpointIndex: number): T {\r\n if (!Array.isArray(value) || value.length === 0) {\r\n return value as T\r\n }\r\n const safeIndex = Math.max(-1, Math.min(breakpointIndex, value.length - 1))\r\n return value.at(safeIndex)\r\n}\r\n\r\nexport function factor<T>(value: T | T[], breakpointIndex: number): T {\r\n return isValid(value) ? calcFactor<T>(value, breakpointIndex) : value as T\r\n}\r\n\r\nexport function calculateProps(target: Element, props: IFormLayoutProps): IFormLayoutProps {\r\n const { clientWidth } = target\r\n const {\r\n breakpoints,\r\n layout,\r\n labelAlign,\r\n wrapperAlign,\r\n labelCol,\r\n wrapperCol,\r\n ...otherProps\r\n } = props\r\n const breakpointIndex = calcBreakpointIndex(\r\n breakpoints as number[],\r\n clientWidth,\r\n )\r\n\r\n return {\r\n layout: factor(layout, breakpointIndex),\r\n labelAlign: factor(labelAlign, breakpointIndex),\r\n wrapperAlign: factor(wrapperAlign, breakpointIndex),\r\n labelCol: factor(labelCol, breakpointIndex),\r\n wrapperCol: factor(wrapperCol, breakpointIndex),\r\n ...otherProps,\r\n }\r\n}\r\n\r\nexport function useResponsiveFormLayout(props: IFormLayoutProps, root: Ref<HTMLElement | null>) {\r\n const { breakpoints } = props\r\n if (!isArr(breakpoints)) {\r\n return {\r\n props: ref(props),\r\n }\r\n }\r\n\r\n const layoutProps = ref<IFormLayoutProps>({})\r\n\r\n useResizeObserver(root, () => {\r\n layoutProps.value = calculateProps(root.value, props)\r\n })\r\n\r\n return {\r\n props: layoutProps,\r\n }\r\n}\r\n\r\nexport const formLayoutDeepContext: InjectionKey<Ref<IFormLayoutProps>> = Symbol(\r\n 'formLayoutDeepContext',\r\n)\r\n\r\nexport const formLayoutShallowContext: InjectionKey<Ref<IFormLayoutProps>>\r\n = Symbol('formLayoutShallowContext')\r\n\r\nexport function useFormDeepLayout(): Ref<IFormLayoutProps> {\r\n return inject(formLayoutDeepContext, ref({}))\r\n}\r\n\r\nexport function useFormLayout(): Ref<IFormLayoutProps> {\r\n const shallowLayout = inject(formLayoutShallowContext, ref({}))\r\n const deepLayout = inject(formLayoutDeepContext, ref({}))\r\n\r\n const formLayout = computed(() => {\r\n return {\r\n ...deepLayout.value,\r\n ...shallowLayout.value,\r\n }\r\n })\r\n\r\n return formLayout\r\n}\r\n\r\nexport const FORM_LAYOUT_PROPS_KEYS: ReadonlyArray<keyof IFormLayoutProps> = [\r\n 'colon',\r\n 'labelAlign',\r\n 'wrapperAlign',\r\n 'labelWrap',\r\n 'labelWidth',\r\n 'wrapperWidth',\r\n 'wrapperWrap',\r\n 'labelCol',\r\n 'wrapperCol',\r\n 'fullness',\r\n 'size',\r\n 'layout',\r\n 'feedbackLayout',\r\n 'tooltipLayout',\r\n 'breakpoints',\r\n 'hideRequiredAsterisk',\r\n 'statusIcon',\r\n] as const\r\n\r\nexport function filterValidFormLayoutProps(props: IFormLayoutProps): IFormLayoutProps {\r\n return Object.fromEntries(\r\n Object.entries(props)\r\n .filter(([_, value]) => isValid(value)),\r\n )\r\n}\r\n"],"names":["calcBreakpointIndex","breakpoints","width","i","breakpoint","calcFactor","value","breakpointIndex","safeIndex","factor","isValid","calculateProps","target","props","clientWidth","layout","labelAlign","wrapperAlign","labelCol","wrapperCol","otherProps","useResponsiveFormLayout","root","isArr","ref","layoutProps","useResizeObserver","formLayoutDeepContext","formLayoutShallowContext","useFormDeepLayout","inject","useFormLayout","shallowLayout","deepLayout","computed","FORM_LAYOUT_PROPS_KEYS","filterValidFormLayoutProps","_"],"mappings":";;;AAMO,SAASA,EAAoBC,GAAuBC,GAAuB;AAChF,aAAW,CAACC,GAAGC,CAAU,KAAKH,EAAY;AACxC,QAAIC,KAASE;AACX,aAAOD;AAGX,SAAO;AACT;AAEO,SAASE,EAAcC,GAAyBC,GAA4B;AACjF,MAAI,CAAC,MAAM,QAAQD,CAAK,KAAKA,EAAM,WAAW;AAC5C,WAAOA;AAET,QAAME,IAAY,KAAK,IAAI,IAAI,KAAK,IAAID,GAAiBD,EAAM,SAAS,CAAC,CAAC;AAC1E,SAAOA,EAAM,GAAGE,CAAS;AAC3B;AAEO,SAASC,EAAUH,GAAgBC,GAA4B;AACpE,SAAOG,EAAQJ,CAAK,IAAID,EAAcC,GAAOC,CAAe,IAAID;AAClE;AAEO,SAASK,EAAeC,GAAiBC,GAA2C;AACzF,QAAM,EAAE,aAAAC,MAAgBF,GAClB;AAAA,IACJ,aAAAX;AAAA,IACA,QAAAc;AAAA,IACA,YAAAC;AAAA,I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AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,SAASC,EAA2BvB,GAA2C;AACpF,SAAO,OAAO;AAAA,IACZ,OAAO,QAAQA,CAAK,EACjB,OAAO,CAAC,CAACwB,GAAG/B,CAAK,MAAMI,EAAQJ,CAAK,CAAC;AAAA,EAAA;AAE5C;"}
|
package/esm/form-step/index.mjs
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import { observer as g } from "@formily/reactive-vue";
|
|
2
|
-
import { defineComponent as $, renderSlot as P, computed as B, createElementBlock as o, openBlock as r, normalizeClass as E, createVNode as N, unref as t, mergeProps as h, withCtx as u, Fragment as c, renderList as x, createBlock as
|
|
3
|
-
import { ElSteps as A, ElStep as D } from "element-plus";
|
|
4
|
-
import "@formily/reactive";
|
|
5
|
-
import "@formily/core";
|
|
6
|
-
import { useField as O, useFieldSchema as R, RecursionField as j } from "@formily/vue";
|
|
7
|
-
import { composeExport as w } from "../__builtins__/shared/utils.mjs";
|
|
2
|
+
import { defineComponent as $, renderSlot as P, computed as B, createElementBlock as o, openBlock as r, normalizeClass as E, createVNode as N, unref as t, mergeProps as h, withCtx as u, Fragment as c, renderList as x, createBlock as m, createSlots as V, resolveDynamicComponent as _, createTextVNode as v, toDisplayString as y, createCommentVNode as b } from "vue";
|
|
8
3
|
import { isObj as k } from "@formily/shared";
|
|
4
|
+
import { useField as A, useFieldSchema as D, RecursionField as O } from "@silver-formily/vue";
|
|
5
|
+
import { ElSteps as R, ElStep as j } from "element-plus";
|
|
6
|
+
import { createFormStep as S, parseSteps as w } from "./utils.mjs";
|
|
9
7
|
import { stylePrefix as z } from "../__builtins__/configs/index.mjs";
|
|
10
|
-
import {
|
|
8
|
+
import { composeExport as I } from "../__builtins__/shared/utils.mjs";
|
|
11
9
|
const L = $({
|
|
12
10
|
name: "FFormStepPane",
|
|
13
11
|
inheritAttrs: !1
|
|
14
12
|
}), T = (n, i) => {
|
|
15
|
-
const
|
|
16
|
-
for (const [
|
|
17
|
-
|
|
18
|
-
return
|
|
13
|
+
const a = n.__vccOpts || n;
|
|
14
|
+
for (const [s, p] of i)
|
|
15
|
+
a[s] = p;
|
|
16
|
+
return a;
|
|
19
17
|
};
|
|
20
|
-
function q(n, i,
|
|
18
|
+
function q(n, i, a, s, p, f) {
|
|
21
19
|
return P(n.$slots, "default");
|
|
22
20
|
}
|
|
23
21
|
const G = /* @__PURE__ */ T(L, [["render", q]]), H = /* @__PURE__ */ $({
|
|
@@ -29,22 +27,22 @@ const G = /* @__PURE__ */ T(L, [["render", q]]), H = /* @__PURE__ */ $({
|
|
|
29
27
|
active: null
|
|
30
28
|
},
|
|
31
29
|
setup(n) {
|
|
32
|
-
const i = n,
|
|
33
|
-
i.formStep.connect?.(f,
|
|
30
|
+
const i = n, a = A().value, s = `${z}-form-step`, p = D(), f = w(p.value);
|
|
31
|
+
i.formStep.connect?.(f, a);
|
|
34
32
|
const F = B(() => i.active ?? i.formStep?.current ?? 0);
|
|
35
33
|
return (C, K) => (r(), o("div", {
|
|
36
|
-
class: E(
|
|
34
|
+
class: E(s)
|
|
37
35
|
}, [
|
|
38
|
-
N(t(
|
|
36
|
+
N(t(R), h(C.$attrs, {
|
|
39
37
|
active: F.value,
|
|
40
38
|
style: [{ marginBottom: "10px" }]
|
|
41
39
|
}), {
|
|
42
40
|
default: u(() => [
|
|
43
|
-
(r(!0), o(c, null, x(t(f), ({ props: l, slots: e }, d) => (r(),
|
|
41
|
+
(r(!0), o(c, null, x(t(f), ({ props: l, slots: e }, d) => (r(), m(t(j), h({ key: d }, { ref_for: !0 }, l), V({ _: 2 }, [
|
|
44
42
|
e?.title ? {
|
|
45
43
|
name: "title",
|
|
46
44
|
fn: u(() => [
|
|
47
|
-
t(k)(e.title) ? (r(),
|
|
45
|
+
t(k)(e.title) ? (r(), m(_(e.title), { key: 0 })) : (r(), o(c, { key: 1 }, [
|
|
48
46
|
v(y(e.title), 1)
|
|
49
47
|
], 64))
|
|
50
48
|
]),
|
|
@@ -53,7 +51,7 @@ const G = /* @__PURE__ */ T(L, [["render", q]]), H = /* @__PURE__ */ $({
|
|
|
53
51
|
e?.icon ? {
|
|
54
52
|
name: "icon",
|
|
55
53
|
fn: u(() => [
|
|
56
|
-
t(k)(e.icon) ? (r(),
|
|
54
|
+
t(k)(e.icon) ? (r(), m(_(e.icon), { key: 0 })) : (r(), o(c, { key: 1 }, [
|
|
57
55
|
v(y(e.icon), 1)
|
|
58
56
|
], 64))
|
|
59
57
|
]),
|
|
@@ -62,7 +60,7 @@ const G = /* @__PURE__ */ T(L, [["render", q]]), H = /* @__PURE__ */ $({
|
|
|
62
60
|
e?.description ? {
|
|
63
61
|
name: "description",
|
|
64
62
|
fn: u(() => [
|
|
65
|
-
t(k)(e.description) ? (r(),
|
|
63
|
+
t(k)(e.description) ? (r(), m(_(e.description), { key: 0 })) : (r(), o(c, { key: 1 }, [
|
|
66
64
|
v(y(e.description), 1)
|
|
67
65
|
], 64))
|
|
68
66
|
]),
|
|
@@ -73,7 +71,7 @@ const G = /* @__PURE__ */ T(L, [["render", q]]), H = /* @__PURE__ */ $({
|
|
|
73
71
|
_: 1
|
|
74
72
|
}, 16, ["active"]),
|
|
75
73
|
(r(!0), o(c, null, x(t(f), ({ name: l, schema: e }, d) => (r(), o(c, { key: l }, [
|
|
76
|
-
d === F.value ? (r(),
|
|
74
|
+
d === F.value ? (r(), m(t(O), {
|
|
77
75
|
key: 0,
|
|
78
76
|
name: l,
|
|
79
77
|
schema: e
|
|
@@ -81,12 +79,12 @@ const G = /* @__PURE__ */ T(L, [["render", q]]), H = /* @__PURE__ */ $({
|
|
|
81
79
|
], 64))), 128))
|
|
82
80
|
]));
|
|
83
81
|
}
|
|
84
|
-
}), J = g(H),
|
|
82
|
+
}), J = g(H), re = I(J, {
|
|
85
83
|
StepPane: G,
|
|
86
84
|
createFormStep: S
|
|
87
85
|
});
|
|
88
86
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
re as FormStep,
|
|
88
|
+
re as default
|
|
91
89
|
};
|
|
92
90
|
//# sourceMappingURL=index.mjs.map
|