@silver-formily/element-plus 3.0.0 → 3.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/README.en-US.md +32 -32
- package/README.md +32 -32
- package/esm/__builtins__/configs/index.mjs.map +1 -1
- package/esm/__builtins__/index.mjs +18 -18
- 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.mjs.map +1 -1
- package/esm/__builtins__/shared/use-enter-submit.mjs.map +1 -1
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/array-base/index.mjs +63 -59
- package/esm/array-base/index.mjs.map +1 -1
- package/esm/array-base/symbols.mjs.map +1 -1
- package/esm/array-base/utils.mjs +37 -31
- package/esm/array-base/utils.mjs.map +1 -1
- package/esm/array-cards/index.mjs +36 -33
- package/esm/array-cards/index.mjs.map +1 -1
- package/esm/array-collapse/index.mjs +39 -37
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-collapse/utils.mjs +9 -2
- package/esm/array-collapse/utils.mjs.map +1 -1
- package/esm/array-items/index.mjs +38 -34
- package/esm/array-items/index.mjs.map +1 -1
- package/esm/array-list-tabs/index.mjs +38 -36
- package/esm/array-list-tabs/index.mjs.map +1 -1
- package/esm/array-list-tabs/utils.mjs +12 -5
- package/esm/array-list-tabs/utils.mjs.map +1 -1
- package/esm/array-table/index.mjs +62 -60
- package/esm/array-table/index.mjs.map +1 -1
- package/esm/array-table/utils.mjs +18 -11
- package/esm/array-table/utils.mjs.map +1 -1
- package/esm/array-tabs/index.mjs +28 -25
- package/esm/array-tabs/index.mjs.map +1 -1
- package/esm/autocomplete/index.mjs +22 -18
- package/esm/autocomplete/index.mjs.map +1 -1
- package/esm/cascader/index.mjs +22 -18
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/index.mjs +20 -16
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/color-picker/index.mjs +9 -6
- package/esm/color-picker/index.mjs.map +1 -1
- package/esm/color-picker-panel/index.mjs +9 -6
- package/esm/color-picker-panel/index.mjs.map +1 -1
- package/esm/date-picker/index.mjs +14 -11
- package/esm/date-picker/index.mjs.map +1 -1
- package/esm/date-picker/utils.mjs.map +1 -1
- package/esm/date-picker-panel/index.mjs +14 -11
- package/esm/date-picker-panel/index.mjs.map +1 -1
- package/esm/editable/index.mjs +33 -30
- package/esm/editable/index.mjs.map +1 -1
- package/esm/form/form.mjs +6 -6
- package/esm/form/form.mjs.map +1 -1
- package/esm/form-button-group/index.mjs +18 -14
- package/esm/form-button-group/index.mjs.map +1 -1
- package/esm/form-button-group/utils.mjs +9 -2
- package/esm/form-button-group/utils.mjs.map +1 -1
- package/esm/form-collapse/index.mjs +21 -18
- package/esm/form-collapse/index.mjs.map +1 -1
- package/esm/form-collapse/utils.mjs.map +1 -1
- package/esm/form-dialog/index.d.ts +1 -1
- package/esm/form-dialog/index.mjs +22 -22
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-dialog/types.d.ts +13 -5
- package/esm/form-drawer/index.d.ts +1 -1
- package/esm/form-drawer/index.mjs +21 -21
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-drawer/types.d.ts +13 -5
- package/esm/form-grid/hooks.mjs.map +1 -1
- package/esm/form-grid/index.mjs +21 -18
- package/esm/form-grid/index.mjs.map +1 -1
- package/esm/form-item/index.mjs +55 -53
- 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 +14 -10
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-layout/utils.mjs.map +1 -1
- package/esm/form-step/index.mjs +30 -27
- package/esm/form-step/index.mjs.map +1 -1
- package/esm/form-step/utils.mjs.map +1 -1
- package/esm/form-tab/hooks.mjs.map +1 -1
- package/esm/form-tab/index.mjs +25 -23
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/form-tab/utils.mjs.map +1 -1
- package/esm/index.mjs +72 -72
- package/esm/input/index.mjs +30 -26
- package/esm/input/index.mjs.map +1 -1
- package/esm/input-number/index.mjs +11 -8
- package/esm/input-number/index.mjs.map +1 -1
- package/esm/input-tag/index.mjs +20 -16
- package/esm/input-tag/index.mjs.map +1 -1
- package/esm/mention/index.mjs +24 -20
- package/esm/mention/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.map +1 -1
- package/esm/password/index.mjs.map +1 -1
- package/esm/preview-text/index.mjs +31 -27
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/preview-text/utils.mjs.map +1 -1
- package/esm/query-form/default-components.mjs.map +1 -1
- package/esm/query-form/hooks.mjs.map +1 -1
- package/esm/query-form/index.mjs +51 -48
- package/esm/query-form/index.mjs.map +1 -1
- package/esm/query-form-item/index.mjs +37 -34
- package/esm/query-form-item/index.mjs.map +1 -1
- package/esm/radio/index.mjs +29 -25
- package/esm/radio/index.mjs.map +1 -1
- package/esm/rate/index.mjs +13 -10
- package/esm/rate/index.mjs.map +1 -1
- package/esm/reset/index.mjs.map +1 -1
- package/esm/segmented/index.mjs +16 -12
- package/esm/segmented/index.mjs.map +1 -1
- package/esm/select/index.mjs +26 -22
- package/esm/select/index.mjs.map +1 -1
- package/esm/select-table/index.mjs +16 -12
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/shared/overlay-elements.mjs.map +1 -1
- package/esm/slider/index.mjs +13 -10
- package/esm/slider/index.mjs.map +1 -1
- package/esm/submit/index.mjs.map +1 -1
- package/esm/switch/index.mjs.map +1 -1
- package/esm/time-picker/index.mjs +9 -6
- package/esm/time-picker/index.mjs.map +1 -1
- package/esm/time-select/index.mjs +9 -6
- package/esm/time-select/index.mjs.map +1 -1
- package/esm/transfer/index.mjs.map +1 -1
- package/esm/tree/index.mjs +33 -29
- package/esm/tree/index.mjs.map +1 -1
- package/esm/tree/utils.mjs.map +1 -1
- package/esm/tree-select/index.mjs +18 -14
- package/esm/tree-select/index.mjs.map +1 -1
- package/esm/upload/index.mjs +10 -7
- package/esm/upload/index.mjs.map +1 -1
- package/esm/vendor/sizes.mjs.map +1 -1
- package/package.json +6 -5
package/esm/form-step/index.mjs
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElSteps as g, ElStep as P } from "element-plus";
|
|
2
|
+
import "@formily/reactive";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import { defineComponent as $, renderSlot as B, computed as E, openBlock as r, createElementBlock as o, normalizeClass as N, createVNode as O, unref as t, mergeProps as h, withCtx as u, Fragment as c, renderList as x, createBlock as a, createSlots as V, resolveDynamicComponent as _, createTextVNode as v, toDisplayString as y, createCommentVNode as b } from "vue";
|
|
5
|
+
import "@formily/core";
|
|
6
|
+
import { useObserver as A } from "@silver-formily/reactive-vue";
|
|
7
|
+
import { useField as D, useFieldSchema as R, RecursionField as j } from "@silver-formily/vue";
|
|
8
|
+
import { composeExport as w } from "../__builtins__/shared/utils.mjs";
|
|
2
9
|
import { isObj as k } from "@formily/shared";
|
|
3
|
-
import { useObserver as V } from "@silver-formily/reactive-vue";
|
|
4
|
-
import { useField as b, useFieldSchema as A, RecursionField as D } from "@silver-formily/vue";
|
|
5
|
-
import { ElSteps as R, ElStep as j } from "element-plus";
|
|
6
|
-
import { parseSteps as w, createFormStep as C } from "./utils.mjs";
|
|
7
10
|
import { stylePrefix as z } from "../__builtins__/configs/index.mjs";
|
|
8
|
-
import {
|
|
11
|
+
import { parseSteps as L, createFormStep as C } from "./utils.mjs";
|
|
9
12
|
const T = $({
|
|
10
13
|
name: "FFormStepPane",
|
|
11
14
|
inheritAttrs: !1
|
|
12
15
|
}), q = (n, i) => {
|
|
13
|
-
const
|
|
14
|
-
for (const [
|
|
15
|
-
|
|
16
|
-
return
|
|
16
|
+
const m = n.__vccOpts || n;
|
|
17
|
+
for (const [p, s] of i)
|
|
18
|
+
m[p] = s;
|
|
19
|
+
return m;
|
|
17
20
|
};
|
|
18
|
-
function G(n, i,
|
|
19
|
-
return
|
|
21
|
+
function G(n, i, m, p, s, f) {
|
|
22
|
+
return B(n.$slots, "default");
|
|
20
23
|
}
|
|
21
24
|
const H = /* @__PURE__ */ q(T, [["render", G]]), I = /* @__PURE__ */ $({
|
|
22
25
|
name: "FFormStep",
|
|
@@ -28,23 +31,23 @@ const H = /* @__PURE__ */ q(T, [["render", G]]), I = /* @__PURE__ */ $({
|
|
|
28
31
|
},
|
|
29
32
|
setup(n) {
|
|
30
33
|
const i = n;
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
i.formStep.connect?.(f,
|
|
34
|
-
const F =
|
|
34
|
+
A();
|
|
35
|
+
const m = D().value, p = `${z}-form-step`, s = R(), f = L(s.value);
|
|
36
|
+
i.formStep.connect?.(f, m);
|
|
37
|
+
const F = E(() => i.active ?? i.formStep?.current ?? 0);
|
|
35
38
|
return (S, J) => (r(), o("div", {
|
|
36
|
-
class:
|
|
39
|
+
class: N(p)
|
|
37
40
|
}, [
|
|
38
|
-
|
|
41
|
+
O(t(g), h(S.$attrs, {
|
|
39
42
|
active: F.value,
|
|
40
43
|
style: [{ marginBottom: "10px" }]
|
|
41
44
|
}), {
|
|
42
45
|
default: u(() => [
|
|
43
|
-
(r(!0), o(c, null, x(t(f), ({ props: l, slots: e }, d) => (r(),
|
|
46
|
+
(r(!0), o(c, null, x(t(f), ({ props: l, slots: e }, d) => (r(), a(t(P), h({ key: d }, { ref_for: !0 }, l), V({ _: 2 }, [
|
|
44
47
|
e?.title ? {
|
|
45
48
|
name: "title",
|
|
46
49
|
fn: u(() => [
|
|
47
|
-
t(k)(e.title) ? (r(),
|
|
50
|
+
t(k)(e.title) ? (r(), a(_(e.title), { key: 0 })) : (r(), o(c, { key: 1 }, [
|
|
48
51
|
v(y(e.title), 1)
|
|
49
52
|
], 64))
|
|
50
53
|
]),
|
|
@@ -53,7 +56,7 @@ const H = /* @__PURE__ */ q(T, [["render", G]]), I = /* @__PURE__ */ $({
|
|
|
53
56
|
e?.icon ? {
|
|
54
57
|
name: "icon",
|
|
55
58
|
fn: u(() => [
|
|
56
|
-
t(k)(e.icon) ? (r(),
|
|
59
|
+
t(k)(e.icon) ? (r(), a(_(e.icon), { key: 0 })) : (r(), o(c, { key: 1 }, [
|
|
57
60
|
v(y(e.icon), 1)
|
|
58
61
|
], 64))
|
|
59
62
|
]),
|
|
@@ -62,7 +65,7 @@ const H = /* @__PURE__ */ q(T, [["render", G]]), I = /* @__PURE__ */ $({
|
|
|
62
65
|
e?.description ? {
|
|
63
66
|
name: "description",
|
|
64
67
|
fn: u(() => [
|
|
65
|
-
t(k)(e.description) ? (r(),
|
|
68
|
+
t(k)(e.description) ? (r(), a(_(e.description), { key: 0 })) : (r(), o(c, { key: 1 }, [
|
|
66
69
|
v(y(e.description), 1)
|
|
67
70
|
], 64))
|
|
68
71
|
]),
|
|
@@ -73,20 +76,20 @@ const H = /* @__PURE__ */ q(T, [["render", G]]), I = /* @__PURE__ */ $({
|
|
|
73
76
|
_: 1
|
|
74
77
|
}, 16, ["active"]),
|
|
75
78
|
(r(!0), o(c, null, x(t(f), ({ name: l, schema: e }, d) => (r(), o(c, { key: l }, [
|
|
76
|
-
d === F.value ? (r(),
|
|
79
|
+
d === F.value ? (r(), a(t(j), {
|
|
77
80
|
key: 0,
|
|
78
81
|
name: l,
|
|
79
82
|
schema: e
|
|
80
|
-
}, null, 8, ["name", "schema"])) :
|
|
83
|
+
}, null, 8, ["name", "schema"])) : b("", !0)
|
|
81
84
|
], 64))), 128))
|
|
82
85
|
]));
|
|
83
86
|
}
|
|
84
|
-
}),
|
|
87
|
+
}), oe = w(I, {
|
|
85
88
|
StepPane: H,
|
|
86
89
|
createFormStep: C
|
|
87
90
|
});
|
|
88
91
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
oe as FormStep,
|
|
93
|
+
oe as default
|
|
91
94
|
};
|
|
92
95
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/form-step/form-step-pane.vue","../../src/form-step/form-step
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/form-step/form-step-pane.vue","../../src/form-step/form-step.vue","../../src/form-step/index.ts"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent } from 'vue'\n\nexport default defineComponent({\n name: 'FFormStepPane',\n inheritAttrs: false,\n})\n</script>\n\n<template>\n <slot />\n</template>\n","<script setup lang=\"ts\">\nimport type { VoidField } from '@formily/core'\nimport type { IFormStepProps } from './types'\nimport { isObj } from '@formily/shared'\nimport { useObserver } from '@silver-formily/reactive-vue'\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\nimport { ElStep, ElSteps } from 'element-plus'\nimport { computed } from 'vue'\nimport { stylePrefix } from '../__builtins__'\nimport { createFormStep, parseSteps } from './utils'\n\ndefineOptions({\n name: 'FFormStep',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<IFormStepProps>(), {\n formStep: () => createFormStep(),\n})\n\nuseObserver()\n\nconst field = useField<VoidField>().value\nconst prefixCls = `${stylePrefix}-form-step`\nconst fieldSchemaRef = useFieldSchema()\n\nconst steps = parseSteps(fieldSchemaRef.value)\n\nprops.formStep.connect?.(steps, field)\n\nconst current = computed(() => props.active ?? props.formStep?.current ?? 0)\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <ElSteps\n v-bind=\"$attrs\"\n :active=\"current\"\n :style=\"[{ marginBottom: '10px' }]\"\n >\n <ElStep\n v-for=\"({ props: stepProps, slots: stepSlots }, key) of steps\"\n :key=\"key\"\n v-bind=\"stepProps\"\n >\n <template v-if=\"stepSlots?.title\" #title>\n <template v-if=\"isObj(stepSlots.title)\">\n <component :is=\"stepSlots.title\" />\n </template>\n <template v-else>\n {{ stepSlots.title }}\n </template>\n </template>\n <template v-if=\"stepSlots?.icon\" #icon>\n <template v-if=\"isObj(stepSlots.icon)\">\n <component :is=\"stepSlots.icon\" />\n </template>\n <template v-else>\n {{ stepSlots.icon }}\n </template>\n </template>\n <template v-if=\"stepSlots?.description\" #description>\n <template v-if=\"isObj(stepSlots.description)\">\n <component :is=\"stepSlots.description\" />\n </template>\n <template v-else>\n {{ stepSlots.description }}\n </template>\n </template>\n </ElStep>\n </ElSteps>\n\n <template v-for=\"({ name, schema }, key) of steps\" :key=\"name\">\n <RecursionField\n v-if=\"key === current\"\n :name=\"name\"\n :schema=\"schema\"\n />\n </template>\n </div>\n</template>\n","import { composeExport } from '../__builtins__'\nimport FFormStepPane from './form-step-pane.vue'\nimport FFormStep from './form-step.vue'\nimport { createFormStep } from './utils'\n\nexport const FormStep = composeExport(FFormStep, {\n StepPane: FFormStepPane,\n createFormStep,\n})\n\nexport default FormStep\n"],"names":["_sfc_main$1","defineComponent","_renderSlot","_ctx","props","__props","useObserver","field","useField","prefixCls","stylePrefix","fieldSchemaRef","useFieldSchema","steps","parseSteps","current","computed","_createElementBlock","_createVNode","_unref","ElSteps","_mergeProps","_openBlock","_Fragment","stepProps","stepSlots","key","_createBlock","_createSlots","isObj","_resolveDynamicComponent","_createTextVNode","_toDisplayString","name","schema","RecursionField","FormStep","composeExport","FFormStep","FFormStepPane","createFormStep"],"mappings":";;;;;;;;;;;AAGA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;;;;;SAICC,EAAQC,EAAA,QAAA,SAAA;;;;;;;;;;;ACMV,UAAMC,IAAQC;AAId,IAAAC,EAAA;AAEA,UAAMC,IAAQC,IAAsB,OAC9BC,IAAY,GAAGC,CAAW,cAC1BC,IAAiBC,EAAA,GAEjBC,IAAQC,EAAWH,EAAe,KAAK;AAE7C,IAAAP,EAAM,SAAS,U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WM,GAAA,EAAA,KAAA,KAAA;AAAA,kBADNQ,EAAAC,EAAAP,EAAU,WAAW,GAAA,CAAA;AAAA,gBAAA;;;;;;;;OAMhCH,EAAA,EAAA,GAAAL,EAMWM,WANiCJ,EAAAN,CAAA,GAAK,CAAA,EAA7B,MAAAoB,GAAM,QAAAC,EAAA,GAAUR,wBAAqBO,KAAI;AAAA,QAEnDP,MAAQX,EAAA,cADhBY,EAIER,EAAAgB,CAAA,GAAA;AAAA;UAFC,MAAAF;AAAA,UACA,QAAAC;AAAA,QAAA;;;;ICvEIE,KAAWC,EAAcC,GAAW;AAAA,EAC/C,UAAUC;AAAA,EACV,gBAAAC;AACF,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../src/form-step/utils.ts"],"sourcesContent":["import type { Schema, SchemaKey } from '@formily/json-schema'\
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../src/form-step/utils.ts"],"sourcesContent":["import type { Schema, SchemaKey } from '@formily/json-schema'\nimport type { Slots } from 'vue'\nimport type { FormStepEnv, IFormStep } from './types'\nimport { action, model, observable } from '@formily/reactive'\n\nexport interface SchemaStep {\n name: SchemaKey\n props: any\n schema: Schema\n slots: Slots\n}\n\nexport function createFormStep(defaultCurrent = 0): IFormStep {\n const env: FormStepEnv = observable({\n form: null,\n field: null,\n steps: [],\n })\n\n const setDisplay = action.bound((target: number) => {\n const currentStep = env.steps[target]\n for (const { name } of env.steps) {\n env.form.query(`${env.field.address}.${name}`).take((field) => {\n if (name === currentStep.name) {\n field.setDisplay('visible')\n }\n else {\n field.setDisplay('hidden')\n }\n })\n }\n })\n\n const formStep: IFormStep = model({\n connect(steps, field) {\n env.steps = steps\n env.form = field?.form\n env.field = field\n },\n current: defaultCurrent,\n setCurrent(key: number) {\n formStep.current = key\n },\n get allowNext() {\n return formStep.current < env.steps.length - 1\n },\n get allowBack() {\n return formStep.current > 0\n },\n async next() {\n try {\n await env.form.validate()\n // eslint-disable-next-line ts/no-use-before-define\n next()\n }\n catch {}\n },\n async back() {\n // eslint-disable-next-line ts/no-use-before-define\n back()\n },\n async submit(onSubmit) {\n return env.form?.submit?.(onSubmit)\n },\n })\n\n const next = action.bound(() => {\n /* istanbul ignore else -- @preserve */\n if (formStep.allowNext) {\n setDisplay(formStep.current + 1)\n formStep.setCurrent(formStep.current + 1)\n }\n })\n\n const back = action.bound(() => {\n /* istanbul ignore else -- @preserve */\n if (formStep.allowBack) {\n setDisplay(formStep.current - 1)\n formStep.setCurrent(formStep.current - 1)\n }\n })\n return formStep\n}\n\nexport function parseSteps(schema: Schema) {\n const steps: SchemaStep[] = []\n schema.mapProperties((schema, name) => {\n /* istanbul ignore else -- @preserve */\n if (schema['x-component']?.indexOf('StepPane') > -1) {\n steps.push({\n name,\n props: schema['x-component-props'],\n schema,\n slots: schema['x-content'],\n })\n }\n })\n return steps\n}\n"],"names":["createFormStep","defaultCurrent","env","observable","setDisplay","action","target","currentStep","name","field","formStep","model","steps","key","next","back","onSubmit","parseSteps","schema"],"mappings":";AAYO,SAASA,EAAeC,IAAiB,GAAc;AAC5D,QAAMC,IAAmBC,EAAW;AAAA,IAClC,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO,CAAA;AAAA,EAAC,CACT,GAEKC,IAAaC,EAAO,MAAM,CAACC,MAAmB;AAClD,UAAMC,IAAcL,EAAI,MAAMI,CAAM;AACpC,eAAW,EAAE,MAAAE,OAAUN,EAAI;AACzB,MAAAA,EAAI,KAAK,MAAM,GAAGA,EAAI,MAAM,OAAO,IAAIM,CAAI,EAAE,EAAE,KAAK,CAACC,MAAU;AAC7D,QAAID,MAASD,EAAY,OACvBE,EAAM,WAAW,SAAS,IAG1BA,EAAM,WAAW,QAAQ;AAAA,MAE7B,CAAC;AAAA,EAEL,CAAC,GAEKC,IAAsBC,EAAM;AAAA,IAChC,QAAQC,GAAOH,GAAO;AACpB,MAAAP,EAAI,QAAQU,GACZV,EAAI,OAAOO,GAAO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Content":["import type { GeneralField } from '@formily/core'\
|
|
1
|
+
{"version":3,"file":"hooks.mjs","sources":["../../src/form-tab/hooks.ts"],"sourcesContent":["import type { GeneralField } from '@formily/core'\nimport type { Schema, SchemaKey } from '@formily/json-schema'\n\nexport type Tabs = { name: SchemaKey, props: any, schema: Schema }[]\n\nexport function useTabs(tabField: GeneralField, schema: Schema) {\n const schemaList = schema.mapProperties((item, name) => ({\n name,\n props: {\n name: item?.['x-component-props']?.name || name,\n ...item?.['x-component-props'],\n },\n schema: item,\n }))\n\n const tabs: Tabs = schemaList.filter((item) => {\n const field = tabField.query(tabField.address.concat(item.name)).take()\n const isHidden = field?.display === 'none' || field?.display === 'hidden'\n if (isHidden)\n return false\n return item?.schema?.['x-component']?.includes('TabPane') ?? false\n })\n\n return tabs\n}\n"],"names":["useTabs","tabField","schema","item","name","field"],"mappings":"AAKO,SAASA,EAAQC,GAAwBC,GAAgB;AAkB9D,SAjBmBA,EAAO,cAAc,CAACC,GAAMC,OAAU;AAAA,IACvD,MAAAA;AAAA,IACA,OAAO;AAAA,MACL,MAAMD,IAAO,mBAAmB,GAAG,QAAQC;AAAA,MAC3C,GAAGD,IAAO,mBAAmB;AAAA,IAAA;AAAA,IAE/B,QAAQA;AAAA,EAAA,EACR,EAE4B,OAAO,CAACA,MAAS;AAC7C,UAAME,IAAQJ,EAAS,MAAMA,EAAS,QAAQ,OAAOE,EAAK,IAAI,CAAC,EAAE,KAAA;AAEjE,WADiBE,GAAO,YAAY,UAAUA,GAAO,YAAY,WAExD,KACFF,GAAM,SAAS,aAAa,GAAG,SAAS,SAAS,KAAK;AAAA,EAC/D,CAAC;AAGH;"}
|
package/esm/form-tab/index.mjs
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { formilyComputed as
|
|
2
|
-
import {
|
|
3
|
-
import { reaction as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
1
|
+
import { formilyComputed as d, observer as k } from "@silver-formily/reactive-vue";
|
|
2
|
+
import { ElTabs as B, ElTabPane as K, ElBadge as w } from "element-plus";
|
|
3
|
+
import { reaction as $ } from "@formily/reactive";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import { defineComponent as L, computed as N, ref as R, watch as S, openBlock as t, createBlock as n, unref as a, withCtx as l, createElementBlock as v, Fragment as b, renderList as q, mergeProps as z, normalizeClass as A, createTextVNode as h, toDisplayString as T, createVNode as D } from "vue";
|
|
6
|
+
import "@formily/core";
|
|
7
|
+
import { useField as I, useFieldSchema as P, RecursionField as j } from "@silver-formily/vue";
|
|
8
|
+
import { composeExport as G } from "../__builtins__/shared/utils.mjs";
|
|
8
9
|
import { stylePrefix as H } from "../__builtins__/configs/index.mjs";
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
10
|
+
import { useTabs as J } from "./hooks.mjs";
|
|
11
|
+
import { createFormTab as y } from "./utils.mjs";
|
|
12
|
+
import '../styles/form-tab/index.css';const M = /* @__PURE__ */ L({
|
|
11
13
|
name: "FFormTab",
|
|
12
14
|
__name: "form-tab",
|
|
13
15
|
props: {
|
|
@@ -16,39 +18,39 @@ import '../styles/form-tab/index.css';const M = /* @__PURE__ */ B({
|
|
|
16
18
|
},
|
|
17
19
|
emits: ["update:modelValue"],
|
|
18
20
|
setup(F, { emit: _ }) {
|
|
19
|
-
const c = F, g = _, m =
|
|
20
|
-
|
|
21
|
+
const c = F, g = _, m = I(), x = P(), C = `${H}-form-tab`, u = N(() => c.formTab ?? y()), r = d(() => J(m.value, x.value)), o = R(c?.modelValue ?? u.value.activeKey ?? r.value?.[0]?.name);
|
|
22
|
+
$(() => r.value.length, () => {
|
|
21
23
|
!r.value.some((e) => e.name === o.value) && (o.value = r.value?.[0]?.name);
|
|
22
24
|
}, {
|
|
23
25
|
fireImmediately: !0
|
|
24
|
-
}),
|
|
26
|
+
}), S(() => u.value.activeKey, (e) => {
|
|
25
27
|
o.value = e;
|
|
26
28
|
});
|
|
27
|
-
const i =
|
|
29
|
+
const i = d(() => r.value.map((e) => m.value.form.queryFeedbacks({
|
|
28
30
|
type: "error",
|
|
29
31
|
address: `${m.value.address}.${e.name}.*`
|
|
30
32
|
}).length));
|
|
31
33
|
function V(e) {
|
|
32
34
|
typeof e == "string" && (g("update:modelValue", e), u.value.setActiveKey?.(e));
|
|
33
35
|
}
|
|
34
|
-
return (e, Q) => (t(), n(a(
|
|
36
|
+
return (e, Q) => (t(), n(a(B), {
|
|
35
37
|
"model-value": o.value,
|
|
36
38
|
style: { width: "100%" },
|
|
37
39
|
onTabChange: V
|
|
38
40
|
}, {
|
|
39
41
|
default: l(() => [
|
|
40
|
-
(t(!0), v(b, null,
|
|
42
|
+
(t(!0), v(b, null, q(a(r), ({ props: s, schema: E, name: f }, p) => (t(), n(a(K), z({ key: f }, { ref_for: !0 }, s), {
|
|
41
43
|
default: l(() => [
|
|
42
|
-
|
|
44
|
+
D(a(j), {
|
|
43
45
|
schema: E,
|
|
44
46
|
name: f
|
|
45
47
|
}, null, 8, ["schema", "name"])
|
|
46
48
|
]),
|
|
47
49
|
label: l(() => [
|
|
48
|
-
a(i)[
|
|
50
|
+
a(i)[p] !== 0 ? (t(), n(a(w), {
|
|
49
51
|
key: 0,
|
|
50
|
-
class:
|
|
51
|
-
value: a(i)[
|
|
52
|
+
class: A(C),
|
|
53
|
+
value: a(i)[p]
|
|
52
54
|
}, {
|
|
53
55
|
default: l(() => [
|
|
54
56
|
h(T(s.label), 1)
|
|
@@ -64,12 +66,12 @@ import '../styles/form-tab/index.css';const M = /* @__PURE__ */ B({
|
|
|
64
66
|
_: 1
|
|
65
67
|
}, 8, ["model-value"]));
|
|
66
68
|
}
|
|
67
|
-
}), O = k(M),
|
|
69
|
+
}), O = k(M), me = G(O, {
|
|
68
70
|
createFormTab: y
|
|
69
71
|
});
|
|
70
72
|
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
me as FormTab,
|
|
74
|
+
me as composeFormTab,
|
|
75
|
+
me as default
|
|
74
76
|
};
|
|
75
77
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/form-tab/form-tab.vue","../../src/form-tab/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/form-tab/form-tab.vue","../../src/form-tab/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { IFormTabProps } from './types.ts'\nimport { reaction } from '@formily/reactive'\nimport { formilyComputed } from '@silver-formily/reactive-vue'\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\nimport { ElBadge, ElTabPane, ElTabs } from 'element-plus'\nimport { computed, ref, watch } from 'vue'\nimport { stylePrefix } from '../__builtins__'\nimport { useTabs } from './hooks'\nimport { createFormTab } from './utils'\n\ndefineOptions({\n name: 'FFormTab',\n})\n\nconst props = defineProps<IFormTabProps>()\nconst emit = defineEmits(['update:modelValue'])\n\nconst field = useField()\nconst schema = useFieldSchema()\nconst prefixCls = `${stylePrefix}-form-tab`\nconst formTabRef = computed(() => props.formTab ?? createFormTab())\nconst tabs = formilyComputed(() => useTabs(field.value, schema.value))\nconst _activeKey = ref(props?.modelValue ?? formTabRef.value.activeKey ?? tabs.value?.[0]?.name)\n\nreaction(() => {\n return tabs.value.length\n}, () => {\n !tabs.value.some(tab => tab.name === _activeKey.value) && (_activeKey.value = tabs.value?.[0]?.name)\n}, {\n fireImmediately: true,\n})\nwatch(() => formTabRef.value.activeKey, (val) => {\n _activeKey.value = val\n})\n\nconst errorList = formilyComputed(() => {\n return tabs.value.map((tab) => {\n return field.value.form.queryFeedbacks({\n type: 'error',\n address: `${field.value.address}.${tab.name}.*`,\n }).length\n })\n})\n\nfunction handleTabChange(key: string) {\n /* istanbul ignore if -- @preserve */\n if (typeof key !== 'string')\n return\n emit('update:modelValue', key)\n formTabRef.value.setActiveKey?.(key)\n}\n</script>\n\n<template>\n <ElTabs\n :model-value=\"_activeKey\"\n style=\"width: 100%;\"\n @tab-change=\"handleTabChange\"\n >\n <ElTabPane\n v-for=\"({ props: tabProps, schema: tabSchema, name }, key) in tabs\"\n :key=\"name\"\n v-bind=\"tabProps\"\n >\n <template #default>\n <RecursionField :schema=\"tabSchema\" :name=\"name\" />\n </template>\n <template #label>\n <ElBadge\n v-if=\"errorList[key] !== 0\"\n :class=\"prefixCls\"\n :value=\"errorList[key]\"\n >\n {{ tabProps.label }}\n </ElBadge>\n <template v-else>\n {{ tabProps.label }}\n </template>\n </template>\n </ElTabPane>\n </ElTabs>\n</template>\n","import { observer } from '@silver-formily/reactive-vue'\nimport { composeExport } from '../__builtins__'\nimport FFormTab from './form-tab.vue'\nimport { createFormTab } from './utils'\nimport './style.scss'\n\nconst FormTab = observer(FFormTab)\n\nexport const composeFormTab = composeExport(FormTab, {\n createFormTab,\n})\n\nexport { composeFormTab as FormTab }\nexport default composeFormTab\n"],"names":["props","__props","emit","__emit","field","useField","schema","useFieldSchema","prefixCls","stylePrefix","formTabRef","computed","createFormTab","tabs","formilyComputed","useTabs","_activeKey","ref","reaction","tab","watch","val","errorList","handleTabChange","key","_createBlock","_unref","ElTabs","_createElementBlock","_Fragment","_renderList","tabProps","tabSchema","name","_openBlock","_mergeProps","_createVNode","RecursionField","ElBadge","_createTextVNode","_toDisplayString","FormTab","observer","FFormTab","composeFormTab","composeExport"],"mappings":";;;;;;;;;;;;;;;;;;;;AAeA,UAAMA,IAAQC,GACRC,IAAOC,GAEPC,IAAQC,EAAA,GACRC,IAASC,EAAA,GACTC,IAAY,GAAGC,CAAW,aAC1BC,IAAaC,EAAS,MAAMX,EAAM,WAAWY,GAAe,GAC5DC,IAAOC,EAAgB,MAAMC,EAAQX,EAAM,OAAOE,EAAO,KAAK,CAAC,GAC/DU,IAAaC,EAAIjB,GAAO,cAAcU,EAAW,MAAM,aAAaG,EAAK,QAAQ,CAAC,GAAG,IAAI;AAE/F,IAAAK,EAAS,MACAL,EAAK,MAA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;AAAA,YAAA;yBAErB,MAAoB;AAAA,gBAAjBe,EAAAC,EAAAT,EAAS,KAAK,GAAA,CAAA;AAAA,cAAA;;yCAEnBH,EAEWC,GAAA,EAAA,KAAA,KAAA;AAAA,cADNU,EAAAC,EAAAT,EAAS,KAAK,GAAA,CAAA;AAAA,YAAA;;;;;;;;ICvErBU,IAAUC,EAASC,CAAQ,GAEpBC,KAAiBC,EAAcJ,GAAS;AAAA,EACnD,eAAA7B;AACF,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../src/form-tab/utils.ts"],"sourcesContent":["import { model } from '@formily/reactive'\
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../src/form-tab/utils.ts"],"sourcesContent":["import { model } from '@formily/reactive'\n\nexport function createFormTab(defaultActiveKey?: string) {\n const formTab = model({\n activeKey: defaultActiveKey,\n setActiveKey(key: string) {\n formTab.activeKey = key\n },\n })\n return formTab\n}\n"],"names":["createFormTab","defaultActiveKey","formTab","model","key"],"mappings":";AAEO,SAASA,EAAcC,GAA2B;AACvD,QAAMC,IAAUC,EAAM;AAAA,IACpB,WAAWF;AAAA,IACX,aAAaG,GAAa;AACxB,MAAAF,EAAQ,YAAYE;AAAA,IACtB;AAAA,EAAA,CACD;AACD,SAAOF;AACT;"}
|
package/esm/index.mjs
CHANGED
|
@@ -12,40 +12,40 @@ import { ColorPickerPanel as C } from "./color-picker-panel/index.mjs";
|
|
|
12
12
|
import { DatePicker as k } from "./date-picker/index.mjs";
|
|
13
13
|
import { DatePickerPanel as w } from "./date-picker-panel/index.mjs";
|
|
14
14
|
import { Editable as g } from "./editable/index.mjs";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
15
|
+
import { _ as h } from "./form/form.mjs";
|
|
16
|
+
import { FormButtonGroup as E } from "./form-button-group/index.mjs";
|
|
17
|
+
import { FormCollapse as L, FormCollapseItem as M } from "./form-collapse/index.mjs";
|
|
18
|
+
import { FormDialog as _ } from "./form-dialog/index.mjs";
|
|
19
|
+
import { FormDrawer as N } from "./form-drawer/index.mjs";
|
|
20
|
+
import { FormGrid as j } from "./form-grid/index.mjs";
|
|
21
|
+
import { FormBaseItem as z, FormItem as H, fieldFeedbackMapper as J } from "./form-item/index.mjs";
|
|
22
|
+
import { _ as O } from "./form-layout/form-layout.mjs";
|
|
23
|
+
import { FormStep as W } from "./form-step/index.mjs";
|
|
24
|
+
import { FormTab as Y, FormTab as Z } from "./form-tab/index.mjs";
|
|
25
|
+
import { Input as rr } from "./input/index.mjs";
|
|
26
|
+
import { InputNumber as er } from "./input-number/index.mjs";
|
|
27
|
+
import { InputTag as mr } from "./input-tag/index.mjs";
|
|
28
|
+
import { Mention as fr } from "./mention/index.mjs";
|
|
29
|
+
import { Password as ar } from "./password/index.mjs";
|
|
30
|
+
import { PreviewText as sr } from "./preview-text/index.mjs";
|
|
31
|
+
import { QueryForm as cr } from "./query-form/index.mjs";
|
|
32
|
+
import { QueryFormItem as Tr } from "./query-form-item/index.mjs";
|
|
33
|
+
import { Radio as dr } from "./radio/index.mjs";
|
|
34
|
+
import { Rate as Sr } from "./rate/index.mjs";
|
|
35
|
+
import { Reset as yr } from "./reset/index.mjs";
|
|
36
|
+
import { Segmented as Cr } from "./segmented/index.mjs";
|
|
37
|
+
import { Select as kr } from "./select/index.mjs";
|
|
38
|
+
import { SelectTable as wr } from "./select-table/index.mjs";
|
|
39
|
+
import { Slider as gr } from "./slider/index.mjs";
|
|
40
|
+
import { ElSpace as hr } from "element-plus";
|
|
41
|
+
import { Submit as Er } from "./submit/index.mjs";
|
|
42
|
+
import { Switch as Lr } from "./switch/index.mjs";
|
|
43
|
+
import { TimePicker as Qr } from "./time-picker/index.mjs";
|
|
44
|
+
import { TimeSelect as vr } from "./time-select/index.mjs";
|
|
45
|
+
import { Transfer as Ur } from "./transfer/index.mjs";
|
|
46
|
+
import { Tree as qr } from "./tree/index.mjs";
|
|
47
|
+
import { TreeSelect as Hr } from "./tree-select/index.mjs";
|
|
48
|
+
import { Upload as Kr } from "./upload/index.mjs";
|
|
49
49
|
export {
|
|
50
50
|
e as ArrayCards,
|
|
51
51
|
m as ArrayCollapse,
|
|
@@ -61,43 +61,43 @@ export {
|
|
|
61
61
|
k as DatePicker,
|
|
62
62
|
w as DatePickerPanel,
|
|
63
63
|
g as Editable,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
64
|
+
h as Form,
|
|
65
|
+
z as FormBaseItem,
|
|
66
|
+
E as FormButtonGroup,
|
|
67
|
+
L as FormCollapse,
|
|
68
|
+
M as FormCollapseItem,
|
|
69
|
+
_ as FormDialog,
|
|
70
|
+
N as FormDrawer,
|
|
71
|
+
j as FormGrid,
|
|
72
|
+
H as FormItem,
|
|
73
|
+
O as FormLayout,
|
|
74
|
+
W as FormStep,
|
|
75
|
+
Y as FormTab,
|
|
76
|
+
rr as Input,
|
|
77
|
+
er as InputNumber,
|
|
78
|
+
mr as InputTag,
|
|
79
|
+
fr as Mention,
|
|
80
|
+
ar as Password,
|
|
81
|
+
sr as PreviewText,
|
|
82
|
+
cr as QueryForm,
|
|
83
|
+
Tr as QueryFormItem,
|
|
84
|
+
dr as Radio,
|
|
85
|
+
Sr as Rate,
|
|
86
|
+
yr as Reset,
|
|
87
|
+
Cr as Segmented,
|
|
88
|
+
kr as Select,
|
|
89
|
+
wr as SelectTable,
|
|
90
|
+
gr as Slider,
|
|
91
|
+
hr as Space,
|
|
92
|
+
Er as Submit,
|
|
93
|
+
Lr as Switch,
|
|
94
|
+
Qr as TimePicker,
|
|
95
|
+
vr as TimeSelect,
|
|
96
|
+
Ur as Transfer,
|
|
97
|
+
qr as Tree,
|
|
98
|
+
Hr as TreeSelect,
|
|
99
|
+
Kr as Upload,
|
|
100
|
+
Z as composeFormTab,
|
|
101
|
+
J as fieldFeedbackMapper
|
|
102
102
|
};
|
|
103
103
|
//# sourceMappingURL=index.mjs.map
|
package/esm/input/index.mjs
CHANGED
|
@@ -1,65 +1,69 @@
|
|
|
1
1
|
import { connect as s, mapProps as a } from "@silver-formily/vue";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { ElInput as d } from "element-plus";
|
|
3
|
+
import "@formily/reactive";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import { defineComponent as l, useSlots as c, openBlock as y, createBlock as x, unref as p, normalizeProps as I, guardReactiveProps as k, createSlots as v, withCtx as r, renderSlot as o } from "vue";
|
|
6
|
+
import { mapReadPretty as i } from "../__builtins__/shared/transform-component.mjs";
|
|
5
7
|
import { useCleanAttrs as P, composeExport as _ } from "../__builtins__/shared/utils.mjs";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
+
import { PreviewText as m } from "../preview-text/index.mjs";
|
|
9
|
+
import "@formily/core";
|
|
10
|
+
import "@silver-formily/reactive-vue";
|
|
11
|
+
const f = /* @__PURE__ */ l({
|
|
8
12
|
name: "FInput",
|
|
9
13
|
inheritAttrs: !1,
|
|
10
14
|
__name: "input",
|
|
11
|
-
setup(
|
|
12
|
-
const e =
|
|
13
|
-
return (
|
|
15
|
+
setup(n) {
|
|
16
|
+
const e = c(), { props: u } = P();
|
|
17
|
+
return (t, A) => (y(), x(p(d), I(k(p(u))), v({ _: 2 }, [
|
|
14
18
|
e.prefix ? {
|
|
15
19
|
name: "prefix",
|
|
16
|
-
fn:
|
|
17
|
-
|
|
20
|
+
fn: r(() => [
|
|
21
|
+
o(t.$slots, "prefix")
|
|
18
22
|
]),
|
|
19
23
|
key: "0"
|
|
20
24
|
} : void 0,
|
|
21
25
|
e.suffix ? {
|
|
22
26
|
name: "suffix",
|
|
23
|
-
fn:
|
|
24
|
-
|
|
27
|
+
fn: r(() => [
|
|
28
|
+
o(t.$slots, "suffix")
|
|
25
29
|
]),
|
|
26
30
|
key: "1"
|
|
27
31
|
} : void 0,
|
|
28
32
|
e.prepend ? {
|
|
29
33
|
name: "prepend",
|
|
30
|
-
fn:
|
|
31
|
-
|
|
34
|
+
fn: r(() => [
|
|
35
|
+
o(t.$slots, "prepend")
|
|
32
36
|
]),
|
|
33
37
|
key: "2"
|
|
34
38
|
} : void 0,
|
|
35
39
|
e.append ? {
|
|
36
40
|
name: "append",
|
|
37
|
-
fn:
|
|
38
|
-
|
|
41
|
+
fn: r(() => [
|
|
42
|
+
o(t.$slots, "append")
|
|
39
43
|
]),
|
|
40
44
|
key: "3"
|
|
41
45
|
} : void 0
|
|
42
46
|
]), 1040));
|
|
43
47
|
}
|
|
44
48
|
}), $ = s(
|
|
45
|
-
|
|
49
|
+
f,
|
|
46
50
|
a({
|
|
47
51
|
readOnly: "readonly"
|
|
48
52
|
}),
|
|
49
|
-
|
|
53
|
+
i(m.Input)
|
|
50
54
|
), h = s(
|
|
51
|
-
|
|
52
|
-
a((
|
|
53
|
-
...
|
|
54
|
-
readonly:
|
|
55
|
+
f,
|
|
56
|
+
a((n) => ({
|
|
57
|
+
...n,
|
|
58
|
+
readonly: n.readOnly,
|
|
55
59
|
type: "textarea"
|
|
56
60
|
})),
|
|
57
|
-
|
|
58
|
-
),
|
|
61
|
+
i(m.Input)
|
|
62
|
+
), F = _($, {
|
|
59
63
|
TextArea: h
|
|
60
64
|
});
|
|
61
65
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
F as Input,
|
|
67
|
+
F as default
|
|
64
68
|
};
|
|
65
69
|
//# sourceMappingURL=index.mjs.map
|
package/esm/input/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/input/input.vue","../../src/input/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/input/input.vue","../../src/input/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ElInput } from 'element-plus'\nimport { useCleanAttrs } from '../__builtins__/index'\n\ndefineOptions({\n name: 'FInput',\n inheritAttrs: false,\n})\n\nconst slots = defineSlots<{\n prefix?: () => any\n suffix?: () => any\n prepend?: () => any\n append?: () => any\n}>()\n\nconst { props: inputProps } = useCleanAttrs()\n</script>\n\n<template>\n <ElInput\n v-bind=\"inputProps\"\n >\n <template v-if=\"slots.prefix\" #prefix>\n <slot name=\"prefix\" />\n </template>\n <template v-if=\"slots.suffix\" #suffix>\n <slot name=\"suffix\" />\n </template>\n <template v-if=\"slots.prepend\" #prepend>\n <slot name=\"prepend\" />\n </template>\n <template v-if=\"slots.append\" #append>\n <slot name=\"append\" />\n </template>\n </ElInput>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { composeExport, mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FInput from './input.vue'\n\nconst InnerInput = connect<typeof FInput>(\n FInput,\n mapProps({\n readOnly: 'readonly',\n }),\n mapReadPretty(PreviewText.Input),\n)\n\nconst TextArea = connect<typeof FInput>(\n FInput,\n mapProps((props) => {\n return {\n ...props,\n readonly: props.readOnly,\n type: 'textarea',\n }\n }),\n mapReadPretty(PreviewText.Input),\n)\n\nexport const Input = composeExport(InnerInput, {\n TextArea,\n})\n\nexport default Input\n"],"names":["slots","_useSlots","inputProps","useCleanAttrs","_openBlock","_createBlock","_unref","_createSlots","_renderSlot","_ctx","InnerInput","connect","FInput","mapProps","mapReadPretty","PreviewText","TextArea","props","Input","composeExport"],"mappings":";;;;;;;;;;;;;;;AASA,UAAMA,IAAQC,EAAA,GAOR,EAAE,OAAOC,EAAA,IAAeC,EAAA;sBAI5BC,KAAAC,EAeUC,UAdAA,EAAAJ,CAAA,CAAU,CAAA,GAAAK,EAAA,EAAA,GAAA,KAAA;AAAA,MAEFP,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtBQ,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;MAERT,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtBQ,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;MAERT,EAAM;cAAU;AAAA,cAC9B,MAAuB;AAAA,UAAvBQ,EAAuBC,EAAA,QAAA,SAAA;AAAA,QAAA;;;MAETT,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtBQ,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;;;IC5BtBC,IAAaC;AAAA,EACjBC;AAAAA,EACAC,EAAS;AAAA,IACP,UAAU;AAAA,EAAA,CACX;AAAA,EACDC,EAAcC,EAAY,KAAK;AACjC,GAEMC,IAAWL;AAAA,EACfC;AAAAA,EACAC,EAAS,CAACI,OACD;AAAA,IACL,GAAGA;AAAA,IACH,UAAUA,EAAM;AAAA,IAChB,MAAM;AAAA,EAAA,EAET;AAAA,EACDH,EAAcC,EAAY,KAAK;AACjC,GAEaG,IAAQC,EAAcT,GAAY;AAAA,EAC7C,UAAAM;AACF,CAAC;"}
|