@silver-formily/element-plus 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/esm/__builtins__/configs/index.mjs.map +1 -1
- package/esm/__builtins__/index.mjs +18 -21
- package/esm/__builtins__/index.mjs.map +1 -1
- package/esm/__builtins__/shared/index.d.ts +0 -1
- package/esm/__builtins__/shared/index.mjs +18 -21
- package/esm/__builtins__/shared/index.mjs.map +1 -1
- package/esm/__builtins__/shared/loading.mjs +5 -5
- 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.d.ts +9 -0
- package/esm/__builtins__/shared/use-enter-submit.mjs +25 -0
- package/esm/__builtins__/shared/use-enter-submit.mjs.map +1 -0
- package/esm/__builtins__/shared/utils.d.ts +1 -0
- package/esm/__builtins__/shared/utils.mjs +23 -17
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/array-base/index.mjs +56 -52
- package/esm/array-base/index.mjs.map +1 -1
- package/esm/array-base/symbols.mjs.map +1 -1
- package/esm/array-base/utils.d.ts +0 -1
- package/esm/array-base/utils.mjs +45 -46
- 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 +63 -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/autocomplete.d.ts +1222 -0
- package/esm/autocomplete/index.d.ts +639 -0
- package/esm/autocomplete/index.mjs +116 -0
- package/esm/autocomplete/index.mjs.map +1 -0
- package/esm/cascader/index.mjs +22 -18
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/index.d.ts +42 -42
- package/esm/checkbox/index.mjs +20 -16
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/color-picker/index.d.ts +210 -0
- package/esm/color-picker/index.mjs +17 -0
- package/esm/color-picker/index.mjs.map +1 -0
- package/esm/color-picker-panel/index.d.ts +129 -0
- package/esm/color-picker-panel/index.mjs +25 -0
- package/esm/color-picker-panel/index.mjs.map +1 -0
- package/esm/date-picker/index.mjs +18 -37
- package/esm/date-picker/index.mjs.map +1 -1
- package/esm/date-picker/utils.d.ts +4 -0
- package/esm/date-picker/utils.mjs +27 -0
- package/esm/date-picker/utils.mjs.map +1 -0
- package/esm/date-picker-panel/index.d.ts +143 -0
- package/esm/date-picker-panel/index.mjs +30 -0
- package/esm/date-picker-panel/index.mjs.map +1 -0
- package/esm/editable/editable.d.ts +2 -0
- package/esm/editable/index.d.ts +1 -0
- package/esm/editable/index.mjs +71 -66
- package/esm/editable/index.mjs.map +1 -1
- package/esm/env.d.mjs +2 -0
- package/esm/env.d.mjs.map +1 -0
- package/esm/form/form.mjs +6 -6
- package/esm/form/form.mjs.map +1 -1
- package/esm/form-button-group/form-button-group.d.ts +10 -1
- package/esm/form-button-group/index.d.ts +18 -3
- package/esm/form-button-group/index.mjs +47 -28
- 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/dialog-content.d.ts +789 -3
- package/esm/form-dialog/index.mjs +97 -86
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-dialog/types.d.ts +1 -0
- package/esm/form-drawer/drawer-content.d.ts +919 -3
- package/esm/form-drawer/index.mjs +92 -82
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-drawer/types.d.ts +1 -0
- package/esm/form-grid/hooks.mjs.map +1 -1
- package/esm/form-grid/index.mjs +26 -22
- package/esm/form-grid/index.mjs.map +1 -1
- package/esm/form-item/index.d.ts +1 -0
- package/esm/form-item/index.mjs +102 -99
- package/esm/form-item/index.mjs.map +1 -1
- package/esm/form-item/types.d.ts +4 -0
- package/esm/form-item/utils.mjs.map +1 -1
- package/esm/form-layout/form-layout.mjs +18 -14
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-layout/utils.mjs +23 -23
- 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 +24 -22
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/form-tab/utils.mjs.map +1 -1
- package/esm/index.d.ts +8 -0
- package/esm/index.mjs +90 -74
- package/esm/index.mjs.map +1 -1
- package/esm/input/index.mjs +30 -26
- package/esm/input/index.mjs.map +1 -1
- package/esm/input-number/index.d.ts +21 -21
- package/esm/input-number/index.mjs +11 -8
- package/esm/input-number/index.mjs.map +1 -1
- package/esm/input-tag/index.d.ts +32 -0
- package/esm/input-tag/index.mjs +50 -0
- package/esm/input-tag/index.mjs.map +1 -0
- package/esm/input-tag/input-tag.d.ts +32 -0
- package/esm/mention/index.d.ts +50 -0
- package/esm/mention/index.mjs +97 -0
- package/esm/mention/index.mjs.map +1 -0
- package/esm/mention/mention.d.ts +51 -0
- 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/color-picker.d.ts +5 -0
- package/esm/preview-text/index.d.ts +5 -0
- package/esm/preview-text/index.mjs +184 -145
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/preview-text/utils.mjs.map +1 -1
- package/esm/query-form/default-components.d.ts +5 -0
- package/esm/query-form/default-components.mjs +47 -0
- package/esm/query-form/default-components.mjs.map +1 -0
- package/esm/query-form/hooks.d.ts +25 -0
- package/esm/query-form/hooks.mjs +29 -0
- package/esm/query-form/hooks.mjs.map +1 -0
- package/esm/query-form/index.d.ts +117 -0
- package/esm/query-form/index.mjs +337 -0
- package/esm/query-form/index.mjs.map +1 -0
- package/esm/query-form/query-form-light.d.ts +27 -0
- package/esm/query-form/query-form.d.ts +52 -0
- package/esm/query-form/types.d.ts +44 -0
- package/esm/query-form/types.mjs +2 -0
- package/esm/query-form/types.mjs.map +1 -0
- package/esm/query-form-item/index.d.ts +151 -0
- package/esm/query-form-item/index.mjs +188 -0
- package/esm/query-form-item/index.mjs.map +1 -0
- package/esm/query-form-item/query-form-item.d.ts +96 -0
- package/esm/query-form-item/types.d.ts +46 -0
- package/esm/query-form-item/types.mjs +2 -0
- package/esm/query-form-item/types.mjs.map +1 -0
- package/esm/radio/index.d.ts +36 -36
- 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 +36 -33
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/shared/overlay-elements.d.ts +6 -0
- package/esm/shared/overlay-elements.mjs +19 -0
- package/esm/shared/overlay-elements.mjs.map +1 -0
- package/esm/slider/index.mjs +13 -10
- package/esm/slider/index.mjs.map +1 -1
- package/esm/styles/form-button-group/index.css +1 -1
- package/esm/styles/form-item/index.css +1 -1
- package/esm/styles/preview-text/index.css +1 -1
- package/esm/styles/query-form/index.css +1 -0
- package/esm/styles/query-form-item/index.css +1 -0
- package/esm/submit/index.mjs.map +1 -1
- package/esm/switch/index.d.ts +12 -12
- 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.d.ts +1 -1
- package/esm/upload/index.mjs +10 -7
- package/esm/upload/index.mjs.map +1 -1
- package/esm/upload/upload.d.ts +2 -2
- package/esm/vendor/lodash.mjs +751 -663
- package/esm/vendor/lodash.mjs.map +1 -1
- package/esm/vendor/sizes.mjs.map +1 -1
- package/package.json +115 -113
- package/esm/__builtins__/shared/hooks.d.ts +0 -7
- package/esm/__builtins__/shared/hooks.mjs +0 -59
- package/esm/__builtins__/shared/hooks.mjs.map +0 -1
|
@@ -1,27 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
1
|
+
import { useAttrs as y, ElAffix as g, ElSpace as m } from "element-plus";
|
|
2
|
+
import "@formily/reactive";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import { defineComponent as p, computed as _, createBlock as s, openBlock as n, unref as e, mergeProps as a, withCtx as l, renderSlot as u, createVNode as $, normalizeStyle as v } from "vue";
|
|
5
|
+
import "@formily/core";
|
|
6
|
+
import "@silver-formily/reactive-vue";
|
|
7
|
+
import { useForm as h } from "@silver-formily/vue";
|
|
8
|
+
import { composeExport as F } from "../__builtins__/shared/utils.mjs";
|
|
9
|
+
import { useFormLayoutId as k } from "../form-layout/utils.mjs";
|
|
10
|
+
import { prefixCls as r } from "./utils.mjs";
|
|
11
|
+
import { FormItem as x } from "../form-item/index.mjs";
|
|
12
|
+
import '../styles/form-button-group/index.css';const B = /* @__PURE__ */ p({
|
|
9
13
|
__name: "form-button-group-sticky",
|
|
10
14
|
setup(f) {
|
|
11
|
-
const t =
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
const t = y(), o = h(), i = k(), c = _(() => {
|
|
16
|
+
if (t.value.target)
|
|
17
|
+
return t.value.target;
|
|
18
|
+
if (i.value)
|
|
19
|
+
return `#${i.value}`;
|
|
20
|
+
/* istanbul ignore next -- @preserve */
|
|
21
|
+
return o.value?.id ? `#formily-${o.value.id}` : void 0;
|
|
22
|
+
});
|
|
23
|
+
return (d, z) => (n(), s(e(g), a({
|
|
24
|
+
class: `${e(r)}__sticky`
|
|
14
25
|
}, e(t), {
|
|
15
26
|
position: e(t).position ?? "bottom",
|
|
16
27
|
target: c.value
|
|
17
28
|
}), {
|
|
18
|
-
default:
|
|
29
|
+
default: l(() => [
|
|
19
30
|
u(d.$slots, "default")
|
|
20
31
|
]),
|
|
21
32
|
_: 3
|
|
22
33
|
}, 16, ["class", "position", "target"]));
|
|
23
34
|
}
|
|
24
|
-
}),
|
|
35
|
+
}), b = /* @__PURE__ */ p({
|
|
25
36
|
name: "FFormButtonGroup",
|
|
26
37
|
inheritAttrs: !1,
|
|
27
38
|
__name: "form-button-group",
|
|
@@ -30,6 +41,10 @@ import '../styles/form-button-group/index.css';const b = /* @__PURE__ */ p({
|
|
|
30
41
|
type: String,
|
|
31
42
|
default: "left"
|
|
32
43
|
},
|
|
44
|
+
inline: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
33
48
|
gutter: {
|
|
34
49
|
type: Number,
|
|
35
50
|
default: 8
|
|
@@ -41,45 +56,49 @@ import '../styles/form-button-group/index.css';const b = /* @__PURE__ */ p({
|
|
|
41
56
|
},
|
|
42
57
|
setup(f) {
|
|
43
58
|
const t = f;
|
|
44
|
-
return (o,
|
|
59
|
+
return (o, i) => t.alignFormItem ? (n(), s(e(x), a({
|
|
45
60
|
key: 0,
|
|
46
|
-
|
|
47
|
-
label: " "
|
|
61
|
+
label: " "
|
|
48
62
|
}, o.$attrs, {
|
|
49
|
-
class: e(
|
|
63
|
+
class: [e(r), t.inline && `${e(r)}--inline`],
|
|
50
64
|
style: {
|
|
51
65
|
width: "100%"
|
|
52
66
|
}
|
|
53
67
|
}), {
|
|
54
|
-
default:
|
|
55
|
-
|
|
56
|
-
size: t.gutter
|
|
68
|
+
default: l(() => [
|
|
69
|
+
$(e(m), {
|
|
70
|
+
size: t.gutter,
|
|
71
|
+
style: v(t.align === "left" ? void 0 : {
|
|
72
|
+
justifyContent: t.align === "right" ? "flex-end" : "center",
|
|
73
|
+
display: "flex",
|
|
74
|
+
width: "100%"
|
|
75
|
+
})
|
|
57
76
|
}, {
|
|
58
|
-
default:
|
|
77
|
+
default: l(() => [
|
|
59
78
|
u(o.$slots, "default")
|
|
60
79
|
]),
|
|
61
80
|
_: 3
|
|
62
|
-
}, 8, ["size"])
|
|
81
|
+
}, 8, ["size", "style"])
|
|
63
82
|
]),
|
|
64
83
|
_: 3
|
|
65
|
-
}, 16, ["class"])) : (
|
|
66
|
-
class: e(
|
|
84
|
+
}, 16, ["class"])) : (n(), s(e(m), a({ key: 1 }, o.$attrs, {
|
|
85
|
+
class: [e(r), t.inline && `${e(r)}--inline`],
|
|
67
86
|
style: {
|
|
68
87
|
justifyContent: t.align === "left" ? "flex-start" : t.align === "right" ? "flex-end" : "center",
|
|
69
88
|
display: "flex"
|
|
70
89
|
},
|
|
71
90
|
size: t.gutter
|
|
72
91
|
}), {
|
|
73
|
-
default:
|
|
92
|
+
default: l(() => [
|
|
74
93
|
u(o.$slots, "default")
|
|
75
94
|
]),
|
|
76
95
|
_: 3
|
|
77
96
|
}, 16, ["class", "style", "size"]));
|
|
78
97
|
}
|
|
79
|
-
}),
|
|
80
|
-
Sticky:
|
|
98
|
+
}), R = F(b, {
|
|
99
|
+
Sticky: B
|
|
81
100
|
});
|
|
82
101
|
export {
|
|
83
|
-
|
|
102
|
+
R as FormButtonGroup
|
|
84
103
|
};
|
|
85
104
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/form-button-group/form-button-group-sticky.vue","../../src/form-button-group/form-button-group.vue","../../src/form-button-group/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/form-button-group/form-button-group-sticky.vue","../../src/form-button-group/form-button-group.vue","../../src/form-button-group/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { AffixProps } from 'element-plus'\nimport type { ComputedRef } from 'vue'\nimport { useForm } from '@silver-formily/vue'\nimport { ElAffix, useAttrs } from 'element-plus'\nimport { computed } from 'vue'\nimport { useFormLayoutId } from '../form-layout/utils'\nimport { prefixCls } from './utils'\n\nconst attrs = useAttrs() as ComputedRef<Partial<AffixProps>>\nconst formRef = useForm()\nconst formLayoutId = useFormLayoutId()\n\nconst target = computed(() => {\n if (attrs.value.target) {\n return attrs.value.target\n }\n if (formLayoutId.value) {\n return `#${formLayoutId.value}`\n }\n /* istanbul ignore next -- @preserve */\n return formRef.value?.id ? `#formily-${formRef.value.id}` : undefined\n})\n</script>\n\n<template>\n <ElAffix\n :class=\"`${prefixCls}__sticky`\"\n v-bind=\"attrs\"\n :position=\"attrs.position ?? 'bottom'\"\n :target=\"target\"\n >\n <slot />\n </ElAffix>\n</template>\n","<script lang=\"ts\" setup>\nimport { ElSpace } from 'element-plus'\nimport FormItem from '../form-item/index'\nimport { prefixCls } from './utils'\n\ndefineOptions({\n name: 'FFormButtonGroup',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n align: {\n type: String,\n default: 'left',\n },\n inline: {\n type: Boolean,\n default: false,\n },\n gutter: {\n type: Number,\n default: 8,\n },\n alignFormItem: {\n type: Boolean,\n default: false,\n },\n})\n</script>\n\n<template>\n <FormItem\n v-if=\"props.alignFormItem\"\n label=\" \"\n v-bind=\"$attrs\"\n :class=\"[prefixCls, props.inline && `${prefixCls}--inline`]\"\n :style=\"{\n width: '100%',\n }\"\n >\n <ElSpace\n :size=\"props.gutter\"\n :style=\"props.align === 'left'\n ? undefined\n : {\n justifyContent: props.align === 'right' ? 'flex-end' : 'center',\n display: 'flex',\n width: '100%',\n }\"\n >\n <slot />\n </ElSpace>\n </FormItem>\n <ElSpace\n v-else\n v-bind=\"$attrs\"\n :class=\"[prefixCls, props.inline && `${prefixCls}--inline`]\"\n :style=\"{\n justifyContent: props.align === 'left'\n ? 'flex-start'\n : (props.align === 'right'\n ? 'flex-end'\n : 'center'),\n display: 'flex',\n }\"\n :size=\"props.gutter\"\n >\n <slot />\n </ElSpace>\n</template>\n","import { composeExport } from '../__builtins__/shared'\nimport FormButtonGroupSticky from './form-button-group-sticky.vue'\nimport FormButtonGroupInner from './form-button-group.vue'\nimport './style.scss'\n\nexport const FormButtonGroup = composeExport(FormButtonGroupInner, {\n Sticky: FormButtonGroupSticky,\n})\n"],"names":["attrs","useAttrs","formRef","useForm","formLayoutId","useFormLayoutId","target","computed","_openBlock","_createBlock","_unref","_mergeProps","prefixCls","_renderSlot","_ctx","props","__props","$attrs","_createVNode","ElSpace","_normalizeStyle","FormButtonGroup","composeExport","FormButtonGroupInner","FormButtonGroupSticky"],"mappings":";;;;;;;;;;;;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AK;AAAA,QAA0B,gBAAAG,EAAM,UAAK,wBAA8CA,EAAM,UAAK;;;MAQnG,MAAMA,EAAM;AAAA,IAAA;iBAEb,MAAQ;AAAA,QAARF,EAAQC,EAAA,QAAA,SAAA;AAAA,MAAA;;;;IC9DCO,IAAkBC,EAAcC,GAAsB;AAAA,EACjE,QAAQC;AACV,CAAC;"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { stylePrefix as o } from "../__builtins__/configs/index.mjs";
|
|
2
|
-
|
|
2
|
+
import "element-plus";
|
|
3
|
+
import "@formily/reactive";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "vue";
|
|
6
|
+
import "@formily/core";
|
|
7
|
+
import "@silver-formily/reactive-vue";
|
|
8
|
+
import "@silver-formily/vue";
|
|
9
|
+
const x = `${o}-form-button-group`;
|
|
3
10
|
export {
|
|
4
|
-
|
|
11
|
+
x as prefixCls
|
|
5
12
|
};
|
|
6
13
|
//# sourceMappingURL=utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../src/form-button-group/utils.ts"],"sourcesContent":["import { stylePrefix } from '../__builtins__'\
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../src/form-button-group/utils.ts"],"sourcesContent":["import { stylePrefix } from '../__builtins__'\n\nexport const prefixCls = `${stylePrefix}-form-button-group`\n"],"names":["prefixCls","stylePrefix"],"mappings":";;;;;;;;AAEO,MAAMA,IAAY,GAAGC,CAAW;"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { defineComponent as K, computed as V, createBlock as s, openBlock as o, unref as e, mergeProps as k, withCtx as c, createElementBlock as u, Fragment as m, renderList as N, normalizeClass as P, resolveDynamicComponent as F, toDisplayString as _, createTextVNode as $, createVNode as D, h as R } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { ElCollapse as h, ElCollapseItem as j, ElBadge as q } from "element-plus";
|
|
3
|
+
import "@formily/reactive";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "@formily/core";
|
|
6
|
+
import { formilyComputed as g } from "@silver-formily/reactive-vue";
|
|
7
|
+
import { useField as w, useFieldSchema as z, RecursionField as L } from "@silver-formily/vue";
|
|
8
|
+
import { useCleanAttrs as O, composeExport as T } from "../__builtins__/shared/utils.mjs";
|
|
9
|
+
import { isFn as E } from "@formily/shared";
|
|
10
|
+
import { stylePrefix as U } from "../__builtins__/configs/index.mjs";
|
|
11
|
+
import { usePanels as G, createFormCollapse as A } from "./utils.mjs";
|
|
9
12
|
import '../styles/form-collapse/index.css';const H = { key: 1 }, J = /* @__PURE__ */ K({
|
|
10
13
|
inheritAttrs: !1,
|
|
11
14
|
__name: "form-collapse",
|
|
@@ -16,17 +19,17 @@ import '../styles/form-collapse/index.css';const H = { key: 1 }, J = /* @__PURE_
|
|
|
16
19
|
}
|
|
17
20
|
},
|
|
18
21
|
setup(C) {
|
|
19
|
-
const r = C, x = `${
|
|
22
|
+
const r = C, x = `${U}-form-collapse`, { props: b } = O(["modelValue", "onUpdate:modelValue"]), i = w(), B = z(), f = g(() => G(i.value, B.value)), d = V(
|
|
20
23
|
() => r.formCollapse ?? A()
|
|
21
24
|
);
|
|
22
25
|
function I(a) {
|
|
23
26
|
return r.activeKey ? r.activeKey : d.value?.activeKeys ? d.value?.activeKeys : a.map((l) => l.name);
|
|
24
27
|
}
|
|
25
|
-
const n =
|
|
28
|
+
const n = g(() => f.value.map((a) => i.value.form.queryFeedbacks({
|
|
26
29
|
type: "error",
|
|
27
30
|
address: `${i.value.address.concat(a.name)}.*`
|
|
28
31
|
}).length));
|
|
29
|
-
return (a, l) => (o(), s(e(
|
|
32
|
+
return (a, l) => (o(), s(e(h), k({
|
|
30
33
|
class: x,
|
|
31
34
|
"model-value": I(e(f))
|
|
32
35
|
}, e(b), {
|
|
@@ -35,28 +38,28 @@ import '../styles/form-collapse/index.css';const H = { key: 1 }, J = /* @__PURE_
|
|
|
35
38
|
})
|
|
36
39
|
}), {
|
|
37
40
|
default: c(() => [
|
|
38
|
-
(o(!0), u(m, null, N(e(f), ({ props: y, schema: t, name: v }, p) => (o(), s(e(
|
|
41
|
+
(o(!0), u(m, null, N(e(f), ({ props: y, schema: t, name: v }, p) => (o(), s(e(j), k({
|
|
39
42
|
key: v,
|
|
40
43
|
ref_for: !0
|
|
41
44
|
}, y, { name: v }), {
|
|
42
45
|
default: c(() => [
|
|
43
|
-
D(e(
|
|
46
|
+
D(e(L), {
|
|
44
47
|
schema: t,
|
|
45
48
|
name: v
|
|
46
49
|
}, null, 8, ["schema", "name"])
|
|
47
50
|
]),
|
|
48
51
|
title: c(() => [
|
|
49
|
-
e(n)[p] !== 0 ? (o(), s(e(
|
|
52
|
+
e(n)[p] !== 0 ? (o(), s(e(q), {
|
|
50
53
|
key: 0,
|
|
51
54
|
class: P(`${x}-errors-badge`),
|
|
52
55
|
value: e(n)[p]
|
|
53
56
|
}, {
|
|
54
57
|
default: c(() => [
|
|
55
|
-
t["x-content"]?.title ? (o(), s(F(() => e(
|
|
58
|
+
t["x-content"]?.title ? (o(), s(F(() => e(E)(t["x-content"]?.title) ? t["x-content"]?.title(e(n)[p]) : t["x-content"]?.title), { key: 0 })) : (o(), u("span", H, _(t["x-component-props"]?.title), 1))
|
|
56
59
|
]),
|
|
57
60
|
_: 2
|
|
58
61
|
}, 1032, ["class", "value"])) : (o(), u(m, { key: 1 }, [
|
|
59
|
-
t["x-content"]?.title ? (o(), s(F(() => e(
|
|
62
|
+
t["x-content"]?.title ? (o(), s(F(() => e(E)(t["x-content"]?.title) ? t["x-content"]?.title(e(n)[p]) : t["x-content"]?.title), { key: 0 })) : (o(), u(m, { key: 1 }, [
|
|
60
63
|
$(_(t["x-component-props"]?.title), 1)
|
|
61
64
|
], 64))
|
|
62
65
|
], 64))
|
|
@@ -73,13 +76,13 @@ import '../styles/form-collapse/index.css';const H = { key: 1 }, J = /* @__PURE_
|
|
|
73
76
|
setup(C, { slots: r }) {
|
|
74
77
|
return () => R(m, r.default?.());
|
|
75
78
|
}
|
|
76
|
-
}),
|
|
79
|
+
}), se = T(J, {
|
|
77
80
|
Item: M,
|
|
78
81
|
createFormCollapse: A
|
|
79
82
|
});
|
|
80
83
|
export {
|
|
81
|
-
|
|
84
|
+
se as FormCollapse,
|
|
82
85
|
M as FormCollapseItem,
|
|
83
|
-
|
|
86
|
+
se as default
|
|
84
87
|
};
|
|
85
88
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/form-collapse/form-collapse.vue","../../src/form-collapse/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/form-collapse/form-collapse.vue","../../src/form-collapse/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { PropType } from 'vue'\nimport type { IFormCollapse } from './utils'\nimport { isFn } from '@formily/shared'\nimport { formilyComputed } from '@silver-formily/reactive-vue'\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\nimport { ElBadge, ElCollapse, ElCollapseItem } from 'element-plus'\nimport { computed } from 'vue'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { createFormCollapse, usePanels } from './utils'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n formCollapse: { type: Object as PropType<IFormCollapse> },\n activeKey: {\n type: [String, Number],\n },\n})\nconst prefixCls = `${stylePrefix}-form-collapse`\nconst { props: collapseAttrs } = useCleanAttrs(['modelValue', 'onUpdate:modelValue'])\n\nconst field = useField()\nconst schema = useFieldSchema()\nconst panels = formilyComputed(() => usePanels(field.value, schema.value))\nconst formCollapseRef = computed(\n () => props.formCollapse ?? createFormCollapse(),\n)\n\nfunction takeActiveKeys(panelList) {\n if (props.activeKey)\n return props.activeKey\n if (formCollapseRef.value?.activeKeys)\n return formCollapseRef.value?.activeKeys\n return panelList.map(item => item.name)\n}\n\nconst panelErrorCounts = formilyComputed(() => {\n return panels.value.map((item) => {\n const panelErrors = field.value.form.queryFeedbacks({\n type: 'error',\n address: `${field.value.address.concat(item.name)}.*`,\n })\n return panelErrors.length\n })\n})\n</script>\n\n<template>\n <ElCollapse\n :class=\"prefixCls\"\n :model-value=\"takeActiveKeys(panels)\"\n v-bind=\"collapseAttrs\"\n @change=\"(key) => {\n formCollapseRef.setActiveKeys(key)\n }\"\n >\n <template v-for=\"({ props: itemProps, schema: itemSchema, name }, index) of panels\" :key=\"name\">\n <ElCollapseItem v-bind=\"itemProps\" :name=\"name\">\n <template #default>\n <RecursionField :schema=\"itemSchema\" :name=\"name\" />\n </template>\n <template #title>\n <ElBadge\n v-if=\"panelErrorCounts[index] !== 0\"\n :class=\"`${prefixCls}-errors-badge`\"\n :value=\"panelErrorCounts[index]\"\n >\n <component\n :is=\"() => isFn(itemSchema['x-content']?.title)\n ? itemSchema['x-content']?.title(panelErrorCounts[index])\n : itemSchema['x-content']?.title\"\n v-if=\"itemSchema['x-content']?.title\"\n />\n <span v-else>{{ itemSchema['x-component-props']?.title }}</span>\n </ElBadge>\n <template v-else>\n <component\n :is=\"() => isFn(itemSchema['x-content']?.title)\n ? itemSchema['x-content']?.title(panelErrorCounts[index])\n : itemSchema['x-content']?.title\"\n v-if=\"itemSchema['x-content']?.title\"\n />\n <template v-else>\n {{ itemSchema['x-component-props']?.title }}\n </template>\n </template>\n </template>\n </ElCollapseItem>\n </template>\n </ElCollapse>\n</template>\n","import { defineComponent, Fragment, h } from 'vue'\nimport { composeExport } from '../__builtins__'\nimport FormCollapse from './form-collapse.vue'\nimport { createFormCollapse } from './utils'\nimport './style.scss'\n\nexport const FormCollapseItem = defineComponent({\n name: 'FFormCollapseItem',\n inheritAttrs: false,\n setup(_props, { slots }) {\n return () => h(Fragment, slots.default?.())\n },\n})\n\nconst composeFormCollapse = composeExport(FormCollapse, {\n Item: FormCollapseItem,\n createFormCollapse,\n})\n\nexport { composeFormCollapse as FormCollapse }\nexport default composeFormCollapse\n"],"names":["props","__props","prefixCls","stylePrefix","collapseAttrs","useCleanAttrs","field","useField","schema","useFieldSchema","panels","formilyComputed","usePanels","formCollapseRef","computed","createFormCollapse","takeActiveKeys","panelList","item","panelErrorCounts","_openBlock","_createBlock","_unref","_mergeProps","key","_createElementBlock","_Fragment","_renderList","itemProps","itemSchema","name","index","_createVNode","RecursionField","ElBadge","_resolveDynamicComponent","isFn","_hoisted_1","_toDisplayString","_createTextVNode","FormCollapseItem","defineComponent","_props","slots","h","Fragment","composeFormCollapse","composeExport","FormCollapse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA,UAAMA,IAAQC,GAMRC,IAAY,GAAGC,CAAW,kBAC1B,EAAE,OAAOC,EAAA,IAAkBC,EAAc,CAAC,cAAc,qBAAqB,CAAC,GAE9EC,IAAQC,EAAA,GACRC,IAASC,EAAA,GACTC,IAASC,EAAgB,MAAMC,EAAUN,EAAM,OAAOE,EAAO,KAAK,CAAC,GACnEK,IAAkBC;AAAA,MACtB,MAAMd,EAAM,gBAAgBe,EAAA;AAAA,IAAmB;AAGjD,aAASC,EAAeC,GAAW;AACjC,aAAIjB,EAAM,YACDA,EAAM,YACXa,EAAgB,OAAO,aAClBA,EAAgB,OAAO,aACzBI,EAAU,IAAI,CAAAC,MAAQA,EAAK,IAAI;AAAA,IACxC;AAEA,UAAMC,IAAmBR,EAAgB,MAChCD,EAAO,MAAM,IAAI,CAACQ,MACHZ,EAAM,MAAM,KAAK,eAAe;AAAA,MAClD,MAAM;AAAA,MACN,SAAS,GAAGA,EAAM,MAAM,QAAQ,OAAOY,EAAK,IAAI,CAAC;AAAA,IAAA,CAClD,EACkB,MACpB,CACF;sBAICE,KAAAC,EAyCaC,MAzCbC,EAyCa;AAAA,MAxCV,OAAOrB;AAAA,MACP,eAAac,EAAeM,EAAAZ,CAAA,CAAM;AAA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EWC,GAAA,EAAA,KAAA,KAAA;AAAA,gBADNa,EAAAD,EAAAT,wBAAiC,KAAK,GAAA,CAAA;AAAA,cAAA;;;;;;;;;IChF1CW,IAAmBC,EAAgB;AAAA,EAC9C,MAAM;AAAA,EACN,cAAc;AAAA,EACd,MAAMC,GAAQ,EAAE,OAAAC,KAAS;AACvB,WAAO,MAAMC,EAAEC,GAAUF,EAAM,WAAW;AAAA,EAC5C;AACF,CAAC,GAEKG,KAAsBC,EAAcC,GAAc;AAAA,EACtD,MAAMR;AAAA,EACN,oBAAAzB;AACF,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../src/form-collapse/utils.ts"],"sourcesContent":["import type { GeneralField } from '@formily/core'\
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../src/form-collapse/utils.ts"],"sourcesContent":["import type { GeneralField } from '@formily/core'\nimport type { Schema, SchemaKey } from '@formily/json-schema'\nimport { model } from '@formily/reactive'\nimport { toArr } from '@formily/shared'\n\ntype ActiveKeys = string | number | Array<string | number>\n\ntype ActiveKey = string | number\n\ntype Panels = { name: SchemaKey, props: any, schema: Schema }[]\n\nexport interface IFormCollapse {\n activeKeys: ActiveKeys\n hasActiveKey: (key: ActiveKey) => boolean\n setActiveKeys: (key: ActiveKeys) => void\n addActiveKey: (key: ActiveKey) => void\n removeActiveKey: (key: ActiveKey) => void\n toggleActiveKey: (key: ActiveKey) => void\n}\n\nexport interface IFormCollapseProps {\n formCollapse?: IFormCollapse\n activeKey?: ActiveKey\n}\n\nexport function usePanels(collapseField: GeneralField, schema: Schema) {\n const schemaList = schema.mapProperties((schema, name) => ({\n name,\n props: {\n ...schema?.['x-component-props'],\n key: schema?.['x-component-props']?.key || name,\n },\n schema,\n }))\n\n const panels: Panels = schemaList.filter((item) => {\n const field = collapseField.query(collapseField.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('FormCollapse.Item') ?? false\n })\n\n return panels\n}\n\nexport function createFormCollapse(defaultActiveKeys?: ActiveKeys) {\n const formCollapse = model({\n activeKeys: defaultActiveKeys,\n setActiveKeys(keys: ActiveKeys) {\n /* istanbul ignore if -- @preserve */\n if (keys === formCollapse.activeKeys)\n return\n formCollapse.activeKeys = keys\n },\n hasActiveKey(key: ActiveKey) {\n if (Array.isArray(formCollapse.activeKeys)) {\n if (formCollapse.activeKeys.includes(key)) {\n return true\n }\n }\n else if (formCollapse.activeKeys === key) {\n return true\n }\n return false\n },\n addActiveKey(key: ActiveKey) {\n /* istanbul ignore if -- @preserve */\n if (formCollapse.hasActiveKey(key))\n return\n formCollapse.activeKeys = toArr(formCollapse.activeKeys).concat(key)\n },\n removeActiveKey(key: ActiveKey) {\n formCollapse.activeKeys = Array.isArray(formCollapse.activeKeys)\n ? formCollapse.activeKeys.filter(\n item => item !== key,\n )\n : ''\n },\n toggleActiveKey(key: ActiveKey) {\n if (formCollapse.hasActiveKey(key)) {\n formCollapse.removeActiveKey(key)\n }\n else {\n formCollapse.addActiveKey(key)\n }\n },\n })\n return formCollapse\n}\n"],"names":["usePanels","collapseField","schema","name","item","field","createFormCollapse","defaultActiveKeys","formCollapse","model","keys","key","toArr"],"mappings":";;AAyBO,SAASA,EAAUC,GAA6BC,GAAgB;AAkBrE,SAjBmBA,EAAO,cAAc,CAACA,GAAQC,OAAU;AAAA,IACzD,MAAAA;AAAA,IACA,OAAO;AAAA,MACL,GAAGD,IAAS,mBAAmB;AAAA,MAC/B,KAAKA,IAAS,mBAAmB,GAAG,OAAOC;AAAA,IAAA;AAAA,IAE7C,QAAAD;AAAAA,EAAA,EACA,EAEgC,OAAO,CAACE,MAAS;AACjD,UAAMC,IAAQJ,EAAc,MAAMA,EAAc,QAAQ,OAAOG,EAAK,IAAI,CAAC,EAAE,KAAA;AAE3E,WADiBC,GAAO,YAAY,UAAUA,GAAO,YAAY,WAExD,KACFD,GAAM,SAAS,aAAa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