@silver-formily/element-plus 2.3.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 +32 -32
- package/README.md +32 -32
- package/esm/__builtins__/configs/index.mjs.map +1 -1
- package/esm/__builtins__/index.mjs +12 -11
- package/esm/__builtins__/shared/index.mjs +11 -10
- 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.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/index.mjs +24 -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/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/form/form.mjs +6 -6
- package/esm/form/form.mjs.map +1 -1
- package/esm/form-button-group/form-button-group.d.ts +9 -0
- package/esm/form-button-group/index.d.ts +15 -0
- 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/index.mjs +22 -22
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-drawer/index.mjs +21 -21
- package/esm/form-drawer/index.mjs.map +1 -1
- 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 +14 -10
- 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 +2 -0
- package/esm/index.mjs +82 -78
- 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.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 +57 -53
- 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.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.mjs +14 -11
- 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/styles/form-button-group/index.css +1 -1
- package/esm/styles/form-item/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.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/lodash.mjs +751 -663
- package/esm/vendor/lodash.mjs.map +1 -1
- package/esm/vendor/sizes.mjs.map +1 -1
- package/package.json +115 -115
|
@@ -1,19 +1,26 @@
|
|
|
1
|
-
import { isOperationComponent as r, isAdditionComponent as t } from "../array-base/utils.mjs";
|
|
2
1
|
import { stylePrefix as i } from "../__builtins__/configs/index.mjs";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
+
import { isOperationComponent as n, isAdditionComponent as e } from "../array-base/utils.mjs";
|
|
10
|
+
const c = `${i}-array-table`;
|
|
11
|
+
function p(o) {
|
|
12
|
+
return o["x-component"]?.indexOf("Column") > -1;
|
|
6
13
|
}
|
|
7
|
-
function
|
|
8
|
-
return p(
|
|
14
|
+
function y(o) {
|
|
15
|
+
return p(o) || n(o) || e(o);
|
|
9
16
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
17
|
+
function P(o) {
|
|
18
|
+
return o.reduceProperties((r, t) => r || !!t.required, !1);
|
|
12
19
|
}
|
|
13
20
|
export {
|
|
14
|
-
|
|
21
|
+
P as hasRequiredProperty,
|
|
15
22
|
p as isColumnComponent,
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
y as isTableComponent,
|
|
24
|
+
c as prefixCls
|
|
18
25
|
};
|
|
19
26
|
//# sourceMappingURL=utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../src/array-table/utils.ts"],"sourcesContent":["import type { Schema } from '@formily/json-schema'\
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../src/array-table/utils.ts"],"sourcesContent":["import type { Schema } from '@formily/json-schema'\nimport { stylePrefix } from '../__builtins__'\nimport { isAdditionComponent, isOperationComponent } from '../array-base/utils'\n\nexport const prefixCls = `${stylePrefix}-array-table`\n\nexport function isColumnComponent(schema: Schema) {\n return schema['x-component']?.indexOf('Column') > -1\n}\n\nexport function isTableComponent(schema: Schema): boolean {\n return isColumnComponent(schema) || isOperationComponent(schema) || isAdditionComponent(schema)\n}\n\nexport function hasRequiredProperty(schema: Schema): boolean {\n return schema.reduceProperties((hasRequired, property) =>\n hasRequired || !!property.required, false)\n}\n"],"names":["prefixCls","stylePrefix","isColumnComponent","schema","isTableComponent","isOperationComponent","isAdditionComponent","hasRequiredProperty","hasRequired","property"],"mappings":";;;;;;;;;AAIO,MAAMA,IAAY,GAAGC,CAAW;AAEhC,SAASC,EAAkBC,GAAgB;AAChD,SAAOA,EAAO,aAAa,GAAG,QAAQ,QAAQ,IAAI;AACpD;AAEO,SAASC,EAAiBD,GAAyB;AACxD,SAAOD,EAAkBC,CAAM,KAAKE,EAAqBF,CAAM,KAAKG,EAAoBH,CAAM;AAChG;AAEO,SAASI,EAAoBJ,GAAyB;AAC3D,SAAOA,EAAO,iBAAiB,CAACK,GAAaC,MAC3CD,KAAe,CAAC,CAACC,EAAS,UAAU,EAAK;AAC7C;"}
|
package/esm/array-tabs/index.mjs
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { defineComponent as C, ref as p, onUnmounted as E, createBlock as f, openBlock as s, unref as e, mergeProps as F, withCtx as
|
|
1
|
+
import { defineComponent as C, ref as p, onUnmounted as E, createBlock as f, openBlock as s, unref as e, mergeProps as F, withCtx as m, createElementBlock as i, Fragment as _, renderList as A, createVNode as b, normalizeClass as B, createTextVNode as N, toDisplayString as v } from "vue";
|
|
2
2
|
import { reaction as P } from "@formily/reactive";
|
|
3
3
|
import { isEqual as R, isFn as h } from "@formily/shared";
|
|
4
4
|
import { useField as S, useFieldSchema as V, RecursionField as q } from "@silver-formily/vue";
|
|
5
5
|
import { ElTabs as U, ElTabPane as L, ElBadge as w } from "element-plus";
|
|
6
6
|
import { stylePrefix as z } from "../__builtins__/configs/index.mjs";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import "@vueuse/core";
|
|
8
|
+
import "@formily/core";
|
|
9
|
+
import "@silver-formily/reactive-vue";
|
|
10
|
+
import { useCleanAttrs as D } from "../__builtins__/shared/utils.mjs";
|
|
11
|
+
import { getArrayItemSchema as I } from "../array-base/utils.mjs";
|
|
9
12
|
import '../styles/array-tabs/index.css';const K = { key: 0 }, j = { key: 1 }, G = /* @__PURE__ */ C({
|
|
10
13
|
name: "FArrayTabs",
|
|
11
14
|
inheritAttrs: !1,
|
|
@@ -18,53 +21,53 @@ import '../styles/array-tabs/index.css';const K = { key: 0 }, j = { key: 1 }, G
|
|
|
18
21
|
function d(r) {
|
|
19
22
|
return `${t.title || "Untitled"} ${r + 1}`;
|
|
20
23
|
}
|
|
21
|
-
const
|
|
24
|
+
const u = p([]), T = P(() => t.value.map((r, l) => t.form.queryFeedbacks({
|
|
22
25
|
type: "error",
|
|
23
|
-
address: `${t.address.concat(
|
|
26
|
+
address: `${t.address.concat(l)}.**`
|
|
24
27
|
}).length), (r) => {
|
|
25
|
-
|
|
28
|
+
u.value = r;
|
|
26
29
|
}, {
|
|
27
30
|
equals: R
|
|
28
31
|
});
|
|
29
32
|
E(() => {
|
|
30
33
|
T();
|
|
31
34
|
});
|
|
32
|
-
const { props: k } =
|
|
33
|
-
return (r,
|
|
35
|
+
const { props: k } = D(["value", "modelValue", "onUpdate:modelValue"]);
|
|
36
|
+
return (r, l) => (s(), f(e(U), F(e(k), {
|
|
34
37
|
"model-value": n.value,
|
|
35
38
|
class: c,
|
|
36
39
|
type: "card",
|
|
37
40
|
addable: !0,
|
|
38
|
-
onTabRemove:
|
|
39
|
-
const a =
|
|
40
|
-
e(t).remove(Number(a)), n.value ===
|
|
41
|
+
onTabRemove: l[0] || (l[0] = (o) => {
|
|
42
|
+
const a = o.toString().match(/tab-(\d+)/)?.[1];
|
|
43
|
+
e(t).remove(Number(a)), n.value === o && (n.value = `tab-${Number(a) - 1}`), e(h)(r.$attrs["tab-remove"]) && r.$attrs["tab-remove"](o);
|
|
41
44
|
}),
|
|
42
|
-
onTabAdd:
|
|
43
|
-
const
|
|
44
|
-
e(t).value.push(null), n.value = `tab-${
|
|
45
|
+
onTabAdd: l[1] || (l[1] = () => {
|
|
46
|
+
const o = e(t).value.length;
|
|
47
|
+
e(t).value.push(null), n.value = `tab-${o}`, e(h)(r.$attrs["tab-add"]) && r.$attrs["tab-add"]();
|
|
45
48
|
}),
|
|
46
49
|
onChange: () => {
|
|
47
50
|
}
|
|
48
51
|
}), {
|
|
49
|
-
default:
|
|
50
|
-
(s(!0), i(_, null, A(e(t).value, (
|
|
52
|
+
default: m(() => [
|
|
53
|
+
(s(!0), i(_, null, A(e(t).value, (o, a) => (s(), f(e(L), {
|
|
51
54
|
key: `tab-${a}`,
|
|
52
55
|
closable: a !== 0,
|
|
53
56
|
name: `tab-${a}`
|
|
54
57
|
}, {
|
|
55
|
-
default:
|
|
58
|
+
default: m(() => [
|
|
56
59
|
b(e(q), {
|
|
57
|
-
schema: e(
|
|
60
|
+
schema: e(I)(e(g), a),
|
|
58
61
|
name: a
|
|
59
62
|
}, null, 8, ["schema", "name"])
|
|
60
63
|
]),
|
|
61
|
-
label:
|
|
62
|
-
|
|
64
|
+
label: m(() => [
|
|
65
|
+
u.value[a] > 0 ? (s(), i("span", K, [
|
|
63
66
|
b(e(w), {
|
|
64
67
|
class: B([`${c}-errors-badge`]),
|
|
65
|
-
value:
|
|
68
|
+
value: u.value[a]
|
|
66
69
|
}, {
|
|
67
|
-
default:
|
|
70
|
+
default: m(() => [
|
|
68
71
|
N(v(d(a)), 1)
|
|
69
72
|
]),
|
|
70
73
|
_: 2
|
|
@@ -77,9 +80,9 @@ import '../styles/array-tabs/index.css';const K = { key: 0 }, j = { key: 1 }, G
|
|
|
77
80
|
_: 1
|
|
78
81
|
}, 16, ["model-value"]));
|
|
79
82
|
}
|
|
80
|
-
}),
|
|
83
|
+
}), te = G;
|
|
81
84
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
te as ArrayTabs,
|
|
86
|
+
te as default
|
|
84
87
|
};
|
|
85
88
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/array-tabs/array-tabs.vue","../../src/array-tabs/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/array-tabs/array-tabs.vue","../../src/array-tabs/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ArrayField } from '@formily/core'\nimport type { TabPaneName } from 'element-plus'\nimport { reaction } from '@formily/reactive'\nimport { isEqual, isFn } from '@formily/shared'\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\nimport { ElBadge, ElTabPane, ElTabs } from 'element-plus'\nimport { onUnmounted, ref } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\nimport { stylePrefix } from '../__builtins__/configs'\nimport { getArrayItemSchema } from '../array-base/utils'\n\ndefineOptions({\n name: 'FArrayTabs',\n inheritAttrs: false,\n})\n\nconst fieldRef = useField<ArrayField>()\nconst schemaRef = useFieldSchema()\n\nconst prefixCls = `${stylePrefix}-array-tabs`\nconst activeKey = ref<TabPaneName>('tab-0')\n\nconst field = fieldRef.value\n/* istanbul ignore else -- @preserve */\nif (field.value.length === 0) {\n field.value.push(null)\n}\nconst schema = schemaRef.value\nfunction getTabTitle(index: number) {\n return `${field.title || 'Untitled'} ${index + 1}`\n}\n\nconst errorCountList = ref([])\nconst dispose = reaction(() => {\n return field.value.map((item, index) => {\n const panelErrors = field.form.queryFeedbacks({\n type: 'error',\n address: `${field.address.concat(index)}.**`,\n })\n return panelErrors.length\n })\n}, (newVal) => {\n errorCountList.value = newVal\n}, {\n equals: isEqual,\n})\nonUnmounted(() => {\n dispose()\n})\nconst { props: elTabProps } = useCleanAttrs(['value', 'modelValue', 'onUpdate:modelValue'])\n</script>\n\n<template>\n <ElTabs\n v-bind=\"elTabProps\"\n :model-value=\"activeKey\"\n :class=\"prefixCls\"\n type=\"card\"\n :addable=\"true\"\n @tab-remove=\"(target) => {\n const index = target.toString().match(/tab-(\\d+)/)?.[1]\n field.remove(Number(index))\n if (activeKey === target) {\n activeKey = `tab-${Number(index) - 1}`\n }\n\n if (isFn($attrs['tab-remove'])) {\n $attrs['tab-remove'](target)\n }\n }\"\n @tab-add=\"() => {\n const id = field.value.length\n field.value.push(null)\n activeKey = `tab-${id}`\n if (isFn($attrs['tab-add'])) {\n $attrs['tab-add']()\n }\n }\"\n @change=\"() => {}\"\n >\n <ElTabPane\n v-for=\"(item, index) of field.value\"\n :key=\"`tab-${index}`\"\n :closable=\"index !== 0\"\n :name=\"`tab-${index}`\"\n >\n <template #default>\n <RecursionField\n :schema=\"getArrayItemSchema(schema, index)\"\n :name=\"index\"\n />\n </template>\n <template #label>\n <span v-if=\"errorCountList[index] > 0\">\n <ElBadge\n :class=\"[`${prefixCls}-errors-badge`]\"\n :value=\"errorCountList[index]\"\n >\n {{ getTabTitle(index) }}\n </ElBadge>\n </span>\n <span v-else>\n {{ getTabTitle(index) }}\n </span>\n </template>\n </ElTabPane>\n </ElTabs>\n</template>\n","import FArrayTabs from './array-tabs.vue'\nimport './style.scss'\n\nexport const ArrayTabs = FArrayTabs\n\nexport default ArrayTabs\n"],"names":["fieldRef","useField","schemaRef","useFieldSchema","prefixCls","stylePrefix","activeKey","ref","field","schema","getTabTitle","index","errorCountList","dispose","reaction","item","newVal","isEqual","onUnmounted","elTabProps","useCleanAttrs","_createBlock","_unref","ElTabs","_mergeProps","target","isFn","$attrs","_cache","id","_openBlock","_createElementBlock","_Fragment","ElTabPane","_createVNode","RecursionField","getArrayItemSchema","_hoisted_1","ElBadge","_createTextVNode","_toDisplayString","_hoisted_2","ArrayTabs","FArrayTabs"],"mappings":"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"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { useField as S, connect as $, mapProps as P } from "@silver-formily/vue";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { mapReadPretty as
|
|
2
|
+
import { ElAutocomplete as A } from "element-plus";
|
|
3
|
+
import "@formily/reactive";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import { defineComponent as R, useSlots as w, ref as C, computed as d, createBlock as F, openBlock as x, unref as p, mergeProps as z, createSlots as B, withCtx as n, renderSlot as r, normalizeProps as E, guardReactiveProps as K } from "vue";
|
|
6
|
+
import { mapReadPretty as L } from "../__builtins__/shared/transform-component.mjs";
|
|
7
|
+
import { PreviewText as O } from "../preview-text/index.mjs";
|
|
8
|
+
import "@formily/core";
|
|
9
|
+
import "@silver-formily/reactive-vue";
|
|
10
|
+
import { useCleanAttrs as b } from "../__builtins__/shared/utils.mjs";
|
|
7
11
|
const j = /* @__PURE__ */ R({
|
|
8
12
|
name: "FAutocomplete",
|
|
9
13
|
inheritAttrs: !1,
|
|
@@ -12,23 +16,25 @@ const j = /* @__PURE__ */ R({
|
|
|
12
16
|
options: {}
|
|
13
17
|
},
|
|
14
18
|
setup(m) {
|
|
15
|
-
const
|
|
19
|
+
const u = m, o = w(), { props: i } = b(), t = S(), f = C();
|
|
16
20
|
t.value?.inject({
|
|
17
|
-
getElAutocompleteRef: () =>
|
|
21
|
+
getElAutocompleteRef: () => f
|
|
18
22
|
});
|
|
19
23
|
const c = d(() => {
|
|
20
24
|
const e = i.value.fetchSuggestions;
|
|
21
25
|
if (e)
|
|
22
26
|
return ((a, s) => e(a, s, t.value));
|
|
23
|
-
|
|
27
|
+
/* istanbul ignore next -- @preserve defensive: allow autocomplete to run without options and remote fetch */
|
|
28
|
+
if (u.options)
|
|
24
29
|
return (a, s) => {
|
|
25
30
|
t.value.loading = !0;
|
|
26
|
-
const l = (a ?? "").toLowerCase(), y = i.value.valueKey ?? "value", k = l ?
|
|
31
|
+
const l = (a ?? "").toLowerCase(), y = i.value.valueKey ?? "value", k = l ? u.options.filter((h) => v(h, y, l)) : u.options;
|
|
27
32
|
s(k), t.value.loading = !1;
|
|
28
33
|
};
|
|
29
34
|
});
|
|
30
35
|
function v(e, a, s) {
|
|
31
36
|
const l = e?.[a];
|
|
37
|
+
/* istanbul ignore next -- @preserve defensive: tolerate invalid option shape from external data source */
|
|
32
38
|
return l == null ? !1 : String(l).toLowerCase().includes(s);
|
|
33
39
|
}
|
|
34
40
|
const g = d(() => ({
|
|
@@ -36,28 +42,28 @@ const j = /* @__PURE__ */ R({
|
|
|
36
42
|
loading: i.value.loading ?? t.value?.loading,
|
|
37
43
|
fetchSuggestions: c.value
|
|
38
44
|
}));
|
|
39
|
-
return (e, a) => (x(), F(
|
|
45
|
+
return (e, a) => (x(), F(p(A), z({
|
|
40
46
|
ref_key: "autocompleteRef",
|
|
41
|
-
ref:
|
|
47
|
+
ref: f
|
|
42
48
|
}, g.value), B({ _: 2 }, [
|
|
43
49
|
o.default ? {
|
|
44
50
|
name: "default",
|
|
45
51
|
fn: n((s) => [
|
|
46
|
-
r(e.$slots, "default", E(K({ ...s, field:
|
|
52
|
+
r(e.$slots, "default", E(K({ ...s, field: p(t) })))
|
|
47
53
|
]),
|
|
48
54
|
key: "0"
|
|
49
55
|
} : void 0,
|
|
50
56
|
o.header ? {
|
|
51
57
|
name: "header",
|
|
52
58
|
fn: n(() => [
|
|
53
|
-
r(e.$slots, "header", { field:
|
|
59
|
+
r(e.$slots, "header", { field: p(t) })
|
|
54
60
|
]),
|
|
55
61
|
key: "1"
|
|
56
62
|
} : void 0,
|
|
57
63
|
o.footer ? {
|
|
58
64
|
name: "footer",
|
|
59
65
|
fn: n(() => [
|
|
60
|
-
r(e.$slots, "footer", { field:
|
|
66
|
+
r(e.$slots, "footer", { field: p(t) })
|
|
61
67
|
]),
|
|
62
68
|
key: "2"
|
|
63
69
|
} : void 0,
|
|
@@ -98,13 +104,13 @@ const j = /* @__PURE__ */ R({
|
|
|
98
104
|
} : void 0
|
|
99
105
|
]), 1040));
|
|
100
106
|
}
|
|
101
|
-
}),
|
|
107
|
+
}), U = $(
|
|
102
108
|
j,
|
|
103
109
|
P({ dataSource: "options", readOnly: "readonly", disabled: !0 }),
|
|
104
|
-
|
|
110
|
+
L(O.Input)
|
|
105
111
|
);
|
|
106
112
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
U as Autocomplete,
|
|
114
|
+
U as default
|
|
109
115
|
};
|
|
110
116
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/autocomplete/autocomplete.vue","../../src/autocomplete/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/autocomplete/autocomplete.vue","../../src/autocomplete/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Field } from '@formily/core'\nimport type { AutocompleteInstance } from 'element-plus'\nimport type { AutocompleteData, AutocompleteFetchSuggestions } from 'element-plus/es/components/autocomplete'\nimport { useField } from '@silver-formily/vue'\nimport { ElAutocomplete } from 'element-plus'\nimport { computed, ref } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FAutocomplete',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n options?: AutocompleteData\n}>()\n\nconst slots = defineSlots<{\n default?: (scope: { item: AutocompleteData[number], field: Field | undefined }) => any\n header?: (scope: { field: Field | undefined }) => any\n footer?: (scope: { field: Field | undefined }) => any\n loading?: () => any\n prefix?: () => any\n suffix?: () => any\n prepend?: () => any\n append?: () => any\n}>()\n\nconst { props: attrs } = useCleanAttrs()\nconst fieldRef = useField<Field>()\nconst autocompleteRef = ref<AutocompleteInstance>()\n\nfieldRef.value?.inject({\n getElAutocompleteRef: () => autocompleteRef,\n})\n\nconst normalizedFetchSuggestions = computed<AutocompleteFetchSuggestions | undefined>(() => {\n const attrFetch = attrs.value.fetchSuggestions as AutocompleteFetchSuggestions | undefined\n if (attrFetch) {\n return ((queryString, cb) => {\n return (attrFetch as (...args: any[]) => any)(queryString, cb, fieldRef.value)\n }) as AutocompleteFetchSuggestions\n }\n\n /* istanbul ignore next -- @preserve defensive: allow autocomplete to run without options and remote fetch */\n if (!props.options) {\n return\n }\n\n return (queryString: string, cb) => {\n fieldRef.value.loading = true\n const keyword = (queryString ?? '').toLowerCase()\n const valueKey = (attrs.value.valueKey ?? 'value') as string\n const results = keyword\n ? props.options!.filter(option => matchOption(option, valueKey, keyword))\n : props.options!\n cb(results)\n fieldRef.value.loading = false\n }\n})\n\nfunction matchOption(option: AutocompleteData[number], valueKey: string, keyword: string) {\n const target = option?.[valueKey]\n /* istanbul ignore next -- @preserve defensive: tolerate invalid option shape from external data source */\n if (target === undefined || target === null) {\n return false\n }\n return String(target).toLowerCase().includes(keyword)\n}\n\nconst autocompleteProps = computed(() => ({\n ...attrs.value,\n loading: attrs.value.loading ?? fieldRef.value?.loading,\n fetchSuggestions: normalizedFetchSuggestions.value,\n}))\n</script>\n\n<template>\n <ElAutocomplete ref=\"autocompleteRef\" v-bind=\"autocompleteProps\">\n <template v-if=\"slots.default\" #default=\"slotProps\">\n <slot name=\"default\" v-bind=\"{ ...slotProps, field: fieldRef }\" />\n </template>\n <template v-if=\"slots.header\" #header>\n <slot name=\"header\" :field=\"fieldRef\" />\n </template>\n <template v-if=\"slots.footer\" #footer>\n <slot name=\"footer\" :field=\"fieldRef\" />\n </template>\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 <template v-if=\"slots.loading\" #loading>\n <slot name=\"loading\" />\n </template>\n </ElAutocomplete>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FAutocomplete from './autocomplete.vue'\n\nexport const Autocomplete = connect<typeof FAutocomplete>(\n FAutocomplete,\n mapProps({ dataSource: 'options', readOnly: 'readonly', disabled: true }),\n mapReadPretty(PreviewText.Input),\n)\n\nexport default Autocomplete\n"],"names":["props","__props","slots","_useSlots","attrs","useCleanAttrs","fieldRef","useField","autocompleteRef","ref","normalizedFetchSuggestions","computed","attrFetch","queryString","cb","keyword","valueKey","results","option","matchOption","target","autocompleteProps","_openBlock","_createBlock","_unref","_mergeProps","_createSlots","_withCtx","slotProps","_renderSlot","_ctx","_normalizeProps","_guardReactiveProps","Autocomplete","connect","FAutocomplete","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;;;;;AAcA,UAAMA,IAAQC,GAIRC,IAAQC,EAAA,GAWR,EAAE,OAAOC,EAAA,IAAUC,EAAA,GACnBC,IAAWC,EAAA,GACXC,IAAkBC,EAAA;AAExB,IAAAH,EAAS,OAAO,OAAO;AAAA,MACrB,sBAAsB,MAAME;AAAA,IAAA,CAC7B;AAED,UAAME,IAA6BC,EAAmD,MAAM;AAC1F,YAAMC,IAAYR,EAAM,MAAM;AAC9B,UAAIQ;AACF,gBAAQ,CAACC,GAAaC,MACZF,EAAsCC,GAAaC,GAAIR,EAAS,KAAK;AAAA,MAEjF;AAGA,UAAKN,EAAM;AAIX,eAAO,CAACa,GAAqBC,MAAO;AAClC,UAAAR,EAAS,MAAM,UAAU;AACzB,gBAAMS,KAAWF,KAAe,IAAI,YAAA,GAC9BG,IAAYZ,EAAM,MAAM,YAAY,SACpCa,IAAUF,IACZf,EAAM,QAAS,OAAO,CAAAkB,MAAUC,EAAYD,GAAQF,GAAUD,CAAO,CAAC,IACtEf,EAAM;AACV,UAAAc,EAAGG,CAAO,GACVX,EAAS,MAAM,UAAU;AAAA,QAC3B;AAAA,IACF,CAAC;AAED,aAASa,EAAYD,GAAkCF,GAAkBD,GAAiB;AACxF,YAAMK,IAASF,IAASF,CAAQ;AAAA,MAAA;AAEhC,aAA4BI,KAAW,OAC9B,KAEF,OAAOA,CAAM,EAAE,YAAA,EAAc,SAASL,CAAO;AAAA,IACtD;AAEA,UAAMM,IAAoBV,EAAS,OAAO;AAAA,MACxC,GAAGP,EAAM;AAAA,MACT,SAASA,EAAM,MAAM,WAAWE,EAAS,OAAO;AAAA,MAChD,kBAAkBI,EAA2B;AAAA,IAAA,EAC7C;sBAIAY,KAAAC,EAyBiBC,MAzBjBC,EAyBiB;AAAA,eAzBG;AAAA,MAAJ,KAAIjB;AAAA,IAAA,GAA0Ba,EAAA,KAAiB,GAAAK,EAAA,EAAA,GAAA,KAAA;AAAA,MAC7CxB,EAAM;cAAU;AAAA,QAC9B,IAAAyB,EAAA,CADuCC,MAAS;AAAA,UAChDC,EAAkEC,EAAA,QAAA,WAAAC,EAAAC,EAAA,EAAA,GAAhCJ,GAAS,OAASJ,EAAAlB,CAAA,EAAA,CAAQ,CAAA,CAAA;AAAA,QAAA;;;MAE9CJ,EAAM;cAAS;AAAA,cAC7B,MAAwC;AAAA,UAAxC2B,EAAwCC,EAAA,QAAA,UAAA,EAAnB,OAAON,EAAAlB,CAAA,EAAA,CAAQ;AAAA,QAAA;;;MAEtBJ,EAAM;cAAS;AAAA,cAC7B,MAAwC;AAAA,UAAxC2B,EAAwCC,EAAA,QAAA,UAAA,EAAnB,OAAON,EAAAlB,CAAA,EAAA,CAAQ;AAAA,QAAA;;;MAEtBJ,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtB2B,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;MAER5B,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtB2B,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;MAER5B,EAAM;cAAU;AAAA,cAC9B,MAAuB;AAAA,UAAvB2B,EAAuBC,EAAA,QAAA,SAAA;AAAA,QAAA;;;MAET5B,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtB2B,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;MAER5B,EAAM;cAAU;AAAA,cAC9B,MAAuB;AAAA,UAAvB2B,EAAuBC,EAAA,QAAA,SAAA;AAAA,QAAA;;;;;ICjGhBG,IAAeC;AAAA,EAC1BC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,UAAU,YAAY,UAAU,IAAM;AAAA,EACxEC,EAAcC,EAAY,KAAK;AACjC;"}
|
package/esm/cascader/index.mjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { connect as i, mapProps as c } from "@silver-formily/vue";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { mapReadPretty as
|
|
2
|
+
import { ElCascader as d } from "element-plus";
|
|
3
|
+
import "@formily/reactive";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import { defineComponent as f, createBlock as l, openBlock as u, unref as e, mergeProps as C, createSlots as y, withCtx as t, renderSlot as r } from "vue";
|
|
6
|
+
import { mapReadPretty as P } from "../__builtins__/shared/transform-component.mjs";
|
|
7
|
+
import { PreviewText as k } from "../preview-text/index.mjs";
|
|
8
|
+
import "@formily/core";
|
|
9
|
+
import "@silver-formily/reactive-vue";
|
|
10
|
+
import { useCleanAttrs as $ } from "../__builtins__/shared/utils.mjs";
|
|
7
11
|
const h = /* @__PURE__ */ f({
|
|
8
12
|
name: "FCascader",
|
|
9
13
|
inheritAttrs: !1,
|
|
@@ -12,36 +16,36 @@ const h = /* @__PURE__ */ f({
|
|
|
12
16
|
options: {}
|
|
13
17
|
},
|
|
14
18
|
setup(s) {
|
|
15
|
-
const a = s, { props: p } =
|
|
16
|
-
return (
|
|
19
|
+
const a = s, { props: p } = $();
|
|
20
|
+
return (o, v) => (u(), l(e(d), C(e(p), {
|
|
17
21
|
options: a.options
|
|
18
22
|
}), y({ _: 2 }, [
|
|
19
|
-
|
|
23
|
+
o.$slots.default ? {
|
|
20
24
|
name: "default",
|
|
21
|
-
fn: t(({ node:
|
|
22
|
-
r(
|
|
23
|
-
node:
|
|
24
|
-
data:
|
|
25
|
+
fn: t(({ node: m, data: n }) => [
|
|
26
|
+
r(o.$slots, "default", {
|
|
27
|
+
node: m,
|
|
28
|
+
data: n
|
|
25
29
|
})
|
|
26
30
|
]),
|
|
27
31
|
key: "0"
|
|
28
32
|
} : void 0,
|
|
29
|
-
|
|
33
|
+
o.$slots.empty ? {
|
|
30
34
|
name: "empty",
|
|
31
35
|
fn: t(() => [
|
|
32
|
-
r(
|
|
36
|
+
r(o.$slots, "empty")
|
|
33
37
|
]),
|
|
34
38
|
key: "1"
|
|
35
39
|
} : void 0
|
|
36
40
|
]), 1040, ["options"]));
|
|
37
41
|
}
|
|
38
|
-
}),
|
|
42
|
+
}), T = i(
|
|
39
43
|
h,
|
|
40
44
|
c({ dataSource: "options", disabled: !0 }),
|
|
41
|
-
|
|
45
|
+
P(k.Cascader)
|
|
42
46
|
);
|
|
43
47
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
T as Cascader,
|
|
49
|
+
T as default
|
|
46
50
|
};
|
|
47
51
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/cascader/cascader.vue","../../src/cascader/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/cascader/cascader.vue","../../src/cascader/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CascaderOption } from 'element-plus'\nimport { ElCascader } from 'element-plus'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FCascader',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n options?: CascaderOption[]\n}>()\n\nconst { props: cascaderProps } = useCleanAttrs()\n</script>\n\n<template>\n <ElCascader\n v-bind=\"cascaderProps\"\n :options=\"props.options\"\n >\n <template v-if=\"$slots.default\" #default=\"{ node, data }\">\n <slot :node=\"node\" :data=\"data\" />\n </template>\n <template v-if=\"$slots.empty\" #empty>\n <slot name=\"empty\" />\n </template>\n </ElCascader>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FCascader from './cascader.vue'\n\nexport const Cascader = connect<typeof FCascader>(\n FCascader,\n mapProps({ dataSource: 'options', disabled: true }),\n mapReadPretty(PreviewText.Cascader),\n)\n\nexport default Cascader\n"],"names":["props","__props","cascaderProps","useCleanAttrs","_createBlock","_unref","ElCascader","_mergeProps","$slots","node","data","_renderSlot","_ctx","Cascader","connect","FCascader","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAIR,EAAE,OAAOC,EAAA,IAAkBC,EAAA;2BAI/BC,EAUaC,EAAAC,CAAA,GAVbC,EAUaF,EAAAH,CAAA,GATU;AAAA,MACpB,SAASF,EAAM;AAAA,IAAA;MAEAQ,EAAAA,OAAO;cAAU;AAAA,cAC/B,CAAkC,EADQ,MAAAC,GAAM,MAAAC,QAAI;AAAA,UACpDC,EAAkCC,EAAA,QAAA,WAAA;AAAA,YAA3B,MAAAH;AAAA,YAAa,MAAAC;AAAA,UAAA;;;;MAENF,EAAAA,OAAO;cAAQ;AAAA,cAC7B,MAAqB;AAAA,UAArBG,EAAqBC,EAAA,QAAA,OAAA;AAAA,QAAA;;;;;ICrBdC,IAAWC;AAAA,EACtBC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,UAAU,IAAM;AAAA,EAClDC,EAAcC,EAAY,QAAQ;AACpC;"}
|
package/esm/checkbox/index.mjs
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { connect as _, mapProps as y } from "@silver-formily/vue";
|
|
2
2
|
import { ElCheckboxButton as S, ElCheckbox as h, ElCheckboxGroup as g, version as E } from "element-plus";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import "@formily/reactive";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import { defineComponent as T, computed as c, useSlots as A, createBlock as a, openBlock as o, unref as n, normalizeProps as B, guardReactiveProps as G, withCtx as l, createElementBlock as m, Fragment as i, renderList as f, resolveDynamicComponent as b, mergeProps as d, createTextVNode as w, toDisplayString as D, renderSlot as F } from "vue";
|
|
6
|
+
import { mapReadPretty as I } from "../__builtins__/shared/transform-component.mjs";
|
|
7
|
+
import { useCleanAttrs as L, composeExport as N } from "../__builtins__/shared/utils.mjs";
|
|
8
|
+
import { PreviewText as O } from "../preview-text/index.mjs";
|
|
5
9
|
import { isPlainObj as k } from "@formily/shared";
|
|
6
|
-
import { lt as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const j = /* @__PURE__ */
|
|
10
|
+
import { lt as R } from "../__builtins__/shared/simple-version-compare.mjs";
|
|
11
|
+
import "@formily/core";
|
|
12
|
+
import "@silver-formily/reactive-vue";
|
|
13
|
+
const j = /* @__PURE__ */ T({
|
|
10
14
|
name: "FCheckboxGroup",
|
|
11
15
|
inheritAttrs: !1,
|
|
12
16
|
__name: "checkbox-group",
|
|
@@ -21,7 +25,7 @@ const j = /* @__PURE__ */ A({
|
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
setup(x) {
|
|
24
|
-
const
|
|
28
|
+
const p = x, s = c(() => p.optionType === "button" ? S : h), C = R(E, "2.6.0"), u = c(() => p.options.map((e) => {
|
|
25
29
|
if (!k(e))
|
|
26
30
|
return {
|
|
27
31
|
label: e,
|
|
@@ -32,17 +36,17 @@ const j = /* @__PURE__ */ A({
|
|
|
32
36
|
...e,
|
|
33
37
|
label: e.value
|
|
34
38
|
} : e;
|
|
35
|
-
})), v =
|
|
36
|
-
return (e, V) => (o(), a(
|
|
39
|
+
})), v = A(), { props: P } = L();
|
|
40
|
+
return (e, V) => (o(), a(n(g), B(G(n(P))), {
|
|
37
41
|
default: l(() => [
|
|
38
|
-
|
|
42
|
+
n(v).option ? (o(!0), m(i, { key: 1 }, f(u.value, (t, r) => (o(), a(b(s.value), d({ key: r }, { ref_for: !0 }, t), {
|
|
39
43
|
default: l(() => [
|
|
40
|
-
|
|
44
|
+
F(e.$slots, "option", { option: t })
|
|
41
45
|
]),
|
|
42
46
|
_: 2
|
|
43
47
|
}, 1040))), 128)) : (o(!0), m(i, { key: 0 }, f(u.value, (t, r) => (o(), a(b(s.value), d({ key: r }, { ref_for: !0 }, t), {
|
|
44
48
|
default: l(() => [
|
|
45
|
-
D(
|
|
49
|
+
w(D(n(k)(p.options[r]) ? p.options[r]?.label : t.label), 1)
|
|
46
50
|
]),
|
|
47
51
|
_: 2
|
|
48
52
|
}, 1040))), 128))
|
|
@@ -53,7 +57,7 @@ const j = /* @__PURE__ */ A({
|
|
|
53
57
|
}), z = _(
|
|
54
58
|
j,
|
|
55
59
|
y({ dataSource: "options", disabled: !0 }),
|
|
56
|
-
|
|
60
|
+
I(O.Select, {
|
|
57
61
|
multiple: !0
|
|
58
62
|
})
|
|
59
63
|
), H = _(
|
|
@@ -61,11 +65,11 @@ const j = /* @__PURE__ */ A({
|
|
|
61
65
|
y({
|
|
62
66
|
disabled: !0
|
|
63
67
|
})
|
|
64
|
-
),
|
|
68
|
+
), te = N(H, {
|
|
65
69
|
Group: z
|
|
66
70
|
});
|
|
67
71
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
te as Checkbox,
|
|
73
|
+
te as default
|
|
70
74
|
};
|
|
71
75
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/checkbox/checkbox-group.vue","../../src/checkbox/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/checkbox/checkbox-group.vue","../../src/checkbox/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CheckboxProps } from 'element-plus'\nimport type { PropType } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { ElCheckbox, ElCheckboxButton, ElCheckboxGroup, version } from 'element-plus'\nimport { computed, useSlots } from 'vue'\nimport { lt, useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FCheckboxGroup',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n options: {\n type: Array as PropType<Array<CheckboxProps>>,\n default: () => [],\n },\n optionType: {\n type: String as PropType<'default' | 'button'>,\n default: 'default',\n },\n})\n\nconst OptionType = computed(() => {\n return props.optionType === 'button' ? ElCheckboxButton : ElCheckbox\n})\nconst IS_LESS_THAN_2_6_0 = lt(version, '2.6.0')\nconst compatiableProps = computed(() => {\n return props.options.map((option) => {\n if (!isPlainObj(option)) {\n return {\n label: option,\n value: option,\n }\n }\n /* istanbul ignore if -- @preserve */\n if (IS_LESS_THAN_2_6_0) {\n return {\n ...option,\n label: option.value,\n }\n }\n return option\n })\n})\n\nconst slots = useSlots()\nconst { props: checkboxProps } = useCleanAttrs()\n</script>\n\n<template>\n <ElCheckboxGroup v-bind=\"checkboxProps\">\n <template v-if=\"!slots.option\">\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\n {{ isPlainObj(props.options[index]) ? props.options[index]?.label : option.label }}\n </component>\n </template>\n <template v-else>\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\n <slot name=\"option\" :option=\"option\" />\n </component>\n </template>\n </ElCheckboxGroup>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { ElCheckbox } from 'element-plus'\nimport { composeExport, mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FCheckboxGroup from './checkbox-group.vue'\n\nconst CheckboxGroup = connect<typeof FCheckboxGroup>(\n FCheckboxGroup,\n mapProps({ dataSource: 'options', disabled: true }),\n mapReadPretty(PreviewText.Select, {\n multiple: true,\n }),\n)\n\nconst InnerCheckbox = connect<typeof ElCheckbox>(\n ElCheckbox,\n mapProps({\n disabled: true,\n }),\n)\n\nexport const Checkbox = composeExport(InnerCheckbox, {\n Group: CheckboxGroup,\n})\n\nexport default Checkbox\n"],"names":["props","__props","OptionType","computed","ElCheckboxButton","ElCheckbox","IS_LESS_THAN_2_6_0","lt","version","compatiableProps","option","isPlainObj","slots","useSlots","checkboxProps","useCleanAttrs","_openBlock","_createBlock","_unref","_createElementBlock","_Fragment","_renderList","index","_resolveDynamicComponent","_mergeProps","_renderSlot","_ctx","_createTextVNode","_toDisplayString","CheckboxGroup","connect","FCheckboxGroup","mapProps","mapReadPretty","PreviewText","InnerCheckbox","Checkbox","composeExport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,UAAMA,IAAQC,GAWRC,IAAaC,EAAS,MACnBH,EAAM,eAAe,WAAWI,IAAmBC,CAC3D,GACKC,IAAqBC,EAAGC,GAAS,OAAO,GACxCC,IAAmBN,EAAS,MACzBH,EAAM,QAAQ,IAAI,CAACU,MAAW;AACnC,UAAI,CAACC,EAAWD,CAAM;AACpB,eAAO;AAAA,UACL,OAAOA;AAAA,UACP,OAAOA;AAAA,QAAA;AAAA,MAEX;AAEA,aAAIJ,IACK;AAAA,QACL,GAAGI;AAAA,QACH,OAAOA,EAAO;AAAA,MAAA,IAGXA;AAAA,IACT,CAAC,CACF,GAEKE,IAAQC,EAAA,GACR,EAAE,OAAOC,EAAA,IAAkBC,EAAA;sBAI/BC,EAAA,GAAAC,EAWkBC,UAXOA,EAAAJ,CAAA,CAAa,CAAA,GAAA;AAAA,iBACpC,MAIW;AAAA,QAJMI,EAAAN,CAAA,EAAM,UAMrBI,EAAA,EAAA,GAAAG,EAEYC,GAAA,EAAA,KAAA,KAAAC,EAF0CZ,EAAA,OAAgB,CAAlCC,GAAQY,YAA5CL,EAEYM,EAFIrB,OAAU,GAA1BsB,EAEY,EAF6D,KAAKF,KAAK,EAAA,SAAA,GAAA,GAAUZ,CAAM,GAAA;AAAA,qBACjG,MAAuC;AAAA,YAAvCe,EAAuCC,EAAA,QAAA,UAAA,EAAlB,QAAAhB,GAAc;AAAA,UAAA;;6BANrCM,EAAA,EAAA,GAAAG,EAEYC,GAAA,EAAA,KAAA,KAAAC,EAF0CZ,EAAA,OAAgB,CAAlCC,GAAQY,YAA5CL,EAEYM,EAFIrB,OAAU,GAA1BsB,EAEY,EAF6D,KAAKF,KAAK,EAAA,SAAA,GAAA,GAAUZ,CAAM,GAAA;AAAA,qBACjG,MAAmF;AAAA,YAAhFiB,EAAAC,EAAAV,EAAAP,CAAA,EAAWX,EAAM,QAAQsB,CAAK,CAAA,IAAKtB,EAAM,QAAQsB,CAAK,GAAG,QAAQZ,EAAO,KAAK,GAAA,CAAA;AAAA,UAAA;;;;;;;ICjDlFmB,IAAgBC;AAAA,EACpBC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,UAAU,IAAM;AAAA,EAClDC,EAAcC,EAAY,QAAQ;AAAA,IAChC,UAAU;AAAA,EAAA,CACX;AACH,GAEMC,IAAgBL;AAAA,EACpBzB;AAAA,EACA2B,EAAS;AAAA,IACP,UAAU;AAAA,EAAA,CACX;AACH,GAEaI,KAAWC,EAAcF,GAAe;AAAA,EACnD,OAAON;AACT,CAAC;"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { connect as r, mapProps as o } from "@silver-formily/vue";
|
|
2
2
|
import { ElColorPicker as e } from "element-plus";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
3
|
+
import "@formily/reactive";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "vue";
|
|
6
|
+
import { mapReadPretty as t } from "../__builtins__/shared/transform-component.mjs";
|
|
7
|
+
import { PreviewText as m } from "../preview-text/index.mjs";
|
|
8
|
+
const f = r(
|
|
6
9
|
e,
|
|
7
10
|
o({ readOnly: "readonly", disabled: !0 }),
|
|
8
|
-
m
|
|
11
|
+
t(m.ColorPicker)
|
|
9
12
|
);
|
|
10
13
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
f as ColorPicker,
|
|
15
|
+
f as default
|
|
13
16
|
};
|
|
14
17
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/color-picker/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/color-picker/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\nimport { ElColorPicker } from 'element-plus'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\n\nexport type ColorPickerProps = typeof ElColorPicker\n\nexport const ColorPicker = connect<typeof ElColorPicker>(\n ElColorPicker,\n mapProps({ readOnly: 'readonly', disabled: true }),\n mapReadPretty(PreviewText.ColorPicker),\n)\n\nexport default ColorPicker\n"],"names":["ColorPicker","connect","ElColorPicker","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;AAOO,MAAMA,IAAcC;AAAA,EACzBC;AAAA,EACAC,EAAS,EAAE,UAAU,YAAY,UAAU,IAAM;AAAA,EACjDC,EAAcC,EAAY,WAAW;AACvC;"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { connect as e, mapProps as o } from "@silver-formily/vue";
|
|
2
2
|
import { ElColorPickerPanel as t } from "element-plus";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
3
|
+
import "@formily/reactive";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "vue";
|
|
6
|
+
import { mapReadPretty as i } from "../__builtins__/shared/transform-component.mjs";
|
|
7
|
+
import { PreviewText as m } from "../preview-text/index.mjs";
|
|
8
|
+
const f = e(
|
|
6
9
|
t,
|
|
7
10
|
o(
|
|
8
11
|
{
|
|
@@ -13,10 +16,10 @@ const d = e(
|
|
|
13
16
|
disabled: !0
|
|
14
17
|
} : r
|
|
15
18
|
),
|
|
16
|
-
|
|
19
|
+
i(m.ColorPicker)
|
|
17
20
|
);
|
|
18
21
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
f as ColorPickerPanel,
|
|
23
|
+
f as default
|
|
21
24
|
};
|
|
22
25
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/color-picker-panel/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/color-picker-panel/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\nimport { ElColorPickerPanel } from 'element-plus'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\n\nexport type ColorPickerPanelProps = typeof ElColorPickerPanel\n\nexport const ColorPickerPanel = connect<typeof ElColorPickerPanel>(\n ElColorPickerPanel,\n mapProps(\n {\n disabled: true,\n },\n (props: any) => {\n if (!props.readOnly) {\n return props\n }\n\n return {\n ...props,\n disabled: true,\n }\n },\n ),\n mapReadPretty(PreviewText.ColorPicker),\n)\n\nexport default ColorPickerPanel\n"],"names":["ColorPickerPanel","connect","ElColorPickerPanel","mapProps","props","mapReadPretty","PreviewText"],"mappings":";;;;;;;AAOO,MAAMA,IAAmBC;AAAA,EAC9BC;AAAA,EACAC;AAAA,IACE;AAAA,MACE,UAAU;AAAA,IAAA;AAAA,IAEZ,CAACC,MACMA,EAAM,WAIJ;AAAA,MACL,GAAGA;AAAA,MACH,UAAU;AAAA,IAAA,IALHA;AAAA,EAOX;AAAA,EAEFC,EAAcC,EAAY,WAAW;AACvC;"}
|