@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
|
@@ -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;AAKjF,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;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, openBlock as l, createBlock 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) => (l(), u(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, openBlock as o, createBlock as a, 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,23 +25,23 @@ 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) => k(e) ? C ? {
|
|
25
29
|
...e,
|
|
26
30
|
label: e.value
|
|
27
31
|
} : e : {
|
|
28
32
|
label: e,
|
|
29
33
|
value: e
|
|
30
|
-
})), v =
|
|
31
|
-
return (e, V) => (o(), a(
|
|
34
|
+
})), v = A(), { props: P } = L();
|
|
35
|
+
return (e, V) => (o(), a(n(g), B(G(n(P))), {
|
|
32
36
|
default: l(() => [
|
|
33
|
-
|
|
37
|
+
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), {
|
|
34
38
|
default: l(() => [
|
|
35
|
-
|
|
39
|
+
F(e.$slots, "option", { option: t })
|
|
36
40
|
]),
|
|
37
41
|
_: 2
|
|
38
42
|
}, 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), {
|
|
39
43
|
default: l(() => [
|
|
40
|
-
D(
|
|
44
|
+
w(D(n(k)(p.options[r]) ? p.options[r]?.label : t.label), 1)
|
|
41
45
|
]),
|
|
42
46
|
_: 2
|
|
43
47
|
}, 1040))), 128))
|
|
@@ -48,7 +52,7 @@ const j = /* @__PURE__ */ A({
|
|
|
48
52
|
}), z = _(
|
|
49
53
|
j,
|
|
50
54
|
y({ dataSource: "options", disabled: !0 }),
|
|
51
|
-
|
|
55
|
+
I(O.Select, {
|
|
52
56
|
multiple: !0
|
|
53
57
|
})
|
|
54
58
|
), H = _(
|
|
@@ -56,11 +60,11 @@ const j = /* @__PURE__ */ A({
|
|
|
56
60
|
y({
|
|
57
61
|
disabled: !0
|
|
58
62
|
})
|
|
59
|
-
),
|
|
63
|
+
), te = N(H, {
|
|
60
64
|
Group: z
|
|
61
65
|
});
|
|
62
66
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
te as Checkbox,
|
|
68
|
+
te as default
|
|
65
69
|
};
|
|
66
70
|
//# 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,MACnBC,EAAWD,CAAM,IAOlBJ,IACK;AAAA,MACL,GAAGI;AAAA,MACH,OAAOA,EAAO;AAAA,IAAA,IAGXA,IAZE;AAAA,MACL,OAAOA;AAAA,MACP,OAAOA;AAAA,IAAA,CAWZ,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;"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { connect as r, mapProps as a } from "@silver-formily/vue";
|
|
2
2
|
import { ElDatePicker as m } from "element-plus";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
3
|
+
import "@formily/reactive";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "vue";
|
|
6
|
+
import { mapReadPretty as o } from "../__builtins__/shared/transform-component.mjs";
|
|
7
|
+
import { PreviewText as i } from "../preview-text/index.mjs";
|
|
8
|
+
import { getDefaultFormat as e } from "./utils.mjs";
|
|
9
|
+
const y = r(
|
|
7
10
|
m,
|
|
8
11
|
a(
|
|
9
12
|
{
|
|
@@ -11,16 +14,16 @@ const n = r(
|
|
|
11
14
|
disabled: !0,
|
|
12
15
|
editable: !0
|
|
13
16
|
},
|
|
14
|
-
(
|
|
15
|
-
...
|
|
16
|
-
format:
|
|
17
|
-
valueFormat:
|
|
17
|
+
(t) => ({
|
|
18
|
+
...t,
|
|
19
|
+
format: t.format || e(t.type),
|
|
20
|
+
valueFormat: t.valueFormat || e(t.type, "valueFormat")
|
|
18
21
|
})
|
|
19
22
|
),
|
|
20
|
-
i
|
|
23
|
+
o(i.DatePicker)
|
|
21
24
|
);
|
|
22
25
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
y as DatePicker,
|
|
27
|
+
y as default
|
|
25
28
|
};
|
|
26
29
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/date-picker/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/date-picker/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\nimport { ElDatePicker } from 'element-plus'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport { getDefaultFormat } from './utils'\n\nexport const DatePicker = connect<typeof ElDatePicker>(\n ElDatePicker,\n mapProps(\n {\n readOnly: 'readonly',\n disabled: true,\n editable: true,\n },\n (props: any) => {\n return {\n ...props,\n format: props.format || getDefaultFormat(props.type),\n valueFormat:\n props.valueFormat || getDefaultFormat(props.type, 'valueFormat'),\n }\n },\n ),\n mapReadPretty(PreviewText.DatePicker),\n)\n\nexport default DatePicker\n"],"names":["DatePicker","connect","ElDatePicker","mapProps","props","getDefaultFormat","mapReadPretty","PreviewText"],"mappings":";;;;;;;;AAMO,MAAMA,IAAaC;AAAA,EACxBC;AAAA,EACAC;AAAA,IACE;AAAA,MACE,UAAU;AAAA,MACV,UAAU;AAAA,MACV,UAAU;AAAA,IAAA;AAAA,IAEZ,CAACC,OACQ;AAAA,MACL,GAAGA;AAAA,MACH,QAAQA,EAAM,UAAUC,EAAiBD,EAAM,IAAI;AAAA,MACnD,aACEA,EAAM,eAAeC,EAAiBD,EAAM,MAAM,aAAa;AAAA,IAAA;AAAA,EAErE;AAAA,EAEFE,EAAcC,EAAY,UAAU;AACtC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../src/date-picker/utils.ts"],"sourcesContent":["import type { DatePickerProps } from 'element-plus'\
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../src/date-picker/utils.ts"],"sourcesContent":["import type { DatePickerProps } from 'element-plus'\n\ntype FormatType = 'format' | 'valueFormat'\n\nexport function getDefaultFormat(type: DatePickerProps['type'] = 'date', formatType: FormatType = 'format') {\n if (type === 'week' && formatType === 'format') {\n return '[Week] ww'\n }\n else {\n switch (type) {\n case 'year':\n case 'years':\n case 'yearrange': {\n return 'YYYY'\n }\n case 'month':\n case 'months':\n case 'monthrange': {\n return 'YYYY-MM'\n }\n case 'week': {\n return 'ww'\n }\n case 'date':\n case 'dates':\n case 'daterange': {\n return 'YYYY-MM-DD'\n }\n case 'datetime':\n case 'datetimerange': {\n return 'YYYY-MM-DD HH:mm:ss'\n }\n }\n }\n}\n"],"names":["getDefaultFormat","type","formatType"],"mappings":"AAIO,SAASA,EAAiBC,IAAgC,QAAQC,IAAyB,UAAU;AAC1G,MAAID,MAAS,UAAUC,MAAe;AACpC,WAAO;AAGP,UAAQD,GAAA;AAAA,IACN,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IAET,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IAET,KAAK;AACH,aAAO;AAAA,IAET,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IAET,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,EACT;AAGN;"}
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import { connect as r, mapProps as m } from "@silver-formily/vue";
|
|
2
2
|
import { ElDatePickerPanel as o } from "element-plus";
|
|
3
|
+
import "@formily/reactive";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "vue";
|
|
6
|
+
import { mapReadPretty as i } from "../__builtins__/shared/transform-component.mjs";
|
|
3
7
|
import { getDefaultFormat as a } from "../date-picker/utils.mjs";
|
|
4
|
-
import { PreviewText as
|
|
5
|
-
|
|
6
|
-
const c = r(
|
|
8
|
+
import { PreviewText as l } from "../preview-text/index.mjs";
|
|
9
|
+
const v = r(
|
|
7
10
|
o,
|
|
8
11
|
m(
|
|
9
12
|
{
|
|
10
13
|
disabled: !0,
|
|
11
14
|
editable: !0
|
|
12
15
|
},
|
|
13
|
-
(
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
...
|
|
17
|
-
...
|
|
16
|
+
(t) => {
|
|
17
|
+
const e = {};
|
|
18
|
+
return t.readOnly && (e.editable = !1), t.valueFormat || (e.valueFormat = a(t.type, "valueFormat")), t.dateFormat || (e.dateFormat = a(t.type)), {
|
|
19
|
+
...t,
|
|
20
|
+
...e
|
|
18
21
|
};
|
|
19
22
|
}
|
|
20
23
|
),
|
|
21
|
-
l
|
|
24
|
+
i(l.DatePicker)
|
|
22
25
|
);
|
|
23
26
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
v as DatePickerPanel,
|
|
28
|
+
v as default
|
|
26
29
|
};
|
|
27
30
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/date-picker-panel/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/date-picker-panel/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\nimport { ElDatePickerPanel } from 'element-plus'\nimport { mapReadPretty } from '../__builtins__'\nimport { getDefaultFormat } from '../date-picker/utils'\nimport { PreviewText } from '../preview-text'\n\nexport const DatePickerPanel = connect<typeof ElDatePickerPanel>(\n ElDatePickerPanel,\n mapProps(\n {\n disabled: true,\n editable: true,\n },\n (props: any) => {\n const next: Record<string, any> = {}\n\n if (props.readOnly) {\n next.editable = false\n }\n\n if (!props.valueFormat) {\n next.valueFormat = getDefaultFormat(props.type, 'valueFormat')\n }\n\n if (!props.dateFormat) {\n next.dateFormat = getDefaultFormat(props.type)\n }\n\n return {\n ...props,\n ...next,\n }\n },\n ),\n mapReadPretty(PreviewText.DatePicker),\n)\n\nexport default DatePickerPanel\n"],"names":["DatePickerPanel","connect","ElDatePickerPanel","mapProps","props","next","getDefaultFormat","mapReadPretty","PreviewText"],"mappings":";;;;;;;;AAMO,MAAMA,IAAkBC;AAAA,EAC7BC;AAAA,EACAC;AAAA,IACE;AAAA,MACE,UAAU;AAAA,MACV,UAAU;AAAA,IAAA;AAAA,IAEZ,CAACC,MAAe;AACd,YAAMC,IAA4B,CAAA;AAElC,aAAID,EAAM,aACRC,EAAK,WAAW,KAGbD,EAAM,gBACTC,EAAK,cAAcC,EAAiBF,EAAM,MAAM,aAAa,IAG1DA,EAAM,eACTC,EAAK,aAAaC,EAAiBF,EAAM,IAAI,IAGxC;AAAA,QACL,GAAGA;AAAA,QACH,GAAGC;AAAA,MAAA;AAAA,IAEP;AAAA,EAAA;AAAA,EAEFE,EAAcC,EAAY,UAAU;AACtC;"}
|
package/esm/editable/index.mjs
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { useField as E, connect as h, mapProps as w } from "@silver-formily/vue";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
2
|
+
import { ElPopover as W, ElText as S, ClickOutside as R } from "element-plus";
|
|
3
|
+
import { reaction as V } from "@formily/reactive";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import { defineComponent as z, ref as m, openBlock as n, createElementBlock as f, normalizeClass as i, createVNode as u, unref as t, mergeProps as P, withCtx as d, withDirectives as F, createBlock as C, createElementVNode as _, createTextVNode as q, toDisplayString as D, renderSlot as T, computed as g, Fragment as N, createCommentVNode as M, nextTick as x } from "vue";
|
|
6
|
+
import "@formily/core";
|
|
7
|
+
import "@silver-formily/reactive-vue";
|
|
8
|
+
import { composeExport as j } from "../__builtins__/shared/utils.mjs";
|
|
9
|
+
import { FormBaseItem as c, fieldFeedbackMapper as A } from "../form-item/index.mjs";
|
|
10
|
+
import { Edit as I, Close as G } from "@element-plus/icons-vue";
|
|
11
|
+
import { isValid as $, isPlainObj as H } from "@formily/shared";
|
|
8
12
|
import { stylePrefix as L } from "../__builtins__/configs/index.mjs";
|
|
9
13
|
import { o as k } from "../vendor/lodash.mjs";
|
|
10
|
-
import { composeExport as H } from "../__builtins__/shared/utils.mjs";
|
|
11
14
|
import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
12
15
|
name: "FEditablePopover",
|
|
13
16
|
inheritAttrs: !1,
|
|
@@ -46,7 +49,7 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
46
49
|
function y() {
|
|
47
50
|
l.value = !0;
|
|
48
51
|
}
|
|
49
|
-
return
|
|
52
|
+
return V(
|
|
50
53
|
() => e.value.form.queryFeedbacks({
|
|
51
54
|
type: "error",
|
|
52
55
|
address: `${e.value.address.entire}.*`
|
|
@@ -54,10 +57,10 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
54
57
|
(o) => {
|
|
55
58
|
o.length > 0 && (l.value = !0);
|
|
56
59
|
}
|
|
57
|
-
), (o, p) => (n(),
|
|
60
|
+
), (o, p) => (n(), f("div", {
|
|
58
61
|
class: i(r)
|
|
59
62
|
}, [
|
|
60
|
-
u(t(
|
|
63
|
+
u(t(W), P(o.$attrs, {
|
|
61
64
|
visible: l.value,
|
|
62
65
|
title: o.$attrs.title || t(e).title,
|
|
63
66
|
trigger: "click",
|
|
@@ -73,7 +76,7 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
73
76
|
], 2)
|
|
74
77
|
]),
|
|
75
78
|
reference: d(() => [
|
|
76
|
-
F((n(), C(t(
|
|
79
|
+
F((n(), C(t(c), P(a, {
|
|
77
80
|
class: `${r}-trigger`
|
|
78
81
|
}), {
|
|
79
82
|
default: d(() => [
|
|
@@ -81,20 +84,20 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
81
84
|
class: i(`${r}-content`),
|
|
82
85
|
onClick: y
|
|
83
86
|
}, [
|
|
84
|
-
u(t(
|
|
87
|
+
u(t(S), null, {
|
|
85
88
|
default: d(() => [
|
|
86
|
-
|
|
89
|
+
q(D(t(e).title), 1)
|
|
87
90
|
]),
|
|
88
91
|
_: 1
|
|
89
92
|
}),
|
|
90
|
-
u(t(
|
|
93
|
+
u(t(I), {
|
|
91
94
|
class: i(`${r}-edit-btn`)
|
|
92
95
|
}, null, 8, ["class"])
|
|
93
96
|
], 2)
|
|
94
97
|
]),
|
|
95
98
|
_: 1
|
|
96
99
|
}, 16, ["class"])), [
|
|
97
|
-
[t(
|
|
100
|
+
[t(R), v]
|
|
98
101
|
])
|
|
99
102
|
]),
|
|
100
103
|
_: 3
|
|
@@ -131,7 +134,7 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
131
134
|
editProps: {}
|
|
132
135
|
},
|
|
133
136
|
setup(b) {
|
|
134
|
-
const a = b, e = E(), r = m(null), s = `${L}-editable`, l = m(null), v = g(() => k(a, "editProps")), y = g(() =>
|
|
137
|
+
const a = b, e = E(), r = m(null), s = `${L}-editable`, l = m(null), v = g(() => k(a, "editProps")), y = g(() => H(a.editProps) ? { ...k(a, "editProps"), ...a.editProps } : k(a, "editProps"));
|
|
135
138
|
function o() {
|
|
136
139
|
$(e.value.data) || (e.value.data = {});
|
|
137
140
|
}
|
|
@@ -144,15 +147,15 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
144
147
|
e.value.data.readPretty = !0, await x(), l.value?.feedbackTooltipRef.updatePopper();
|
|
145
148
|
}, 0));
|
|
146
149
|
}
|
|
147
|
-
return (O, X) => (n(),
|
|
150
|
+
return (O, X) => (n(), f("div", {
|
|
148
151
|
ref_key: "innerRef",
|
|
149
152
|
ref: r,
|
|
150
153
|
class: i([s, t(e).disabled && "is-disabled"])
|
|
151
154
|
}, [
|
|
152
|
-
F((n(),
|
|
155
|
+
F((n(), f("div", {
|
|
153
156
|
class: i(`${s}-content`)
|
|
154
157
|
}, [
|
|
155
|
-
u(t(
|
|
158
|
+
u(t(c), P({
|
|
156
159
|
ref_key: "formItemRef",
|
|
157
160
|
ref: l
|
|
158
161
|
}, t(e).data?.readPretty === !1 ? y.value : v.value, { onClick: p }), {
|
|
@@ -163,26 +166,26 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
163
166
|
]),
|
|
164
167
|
_: 3
|
|
165
168
|
}, 16),
|
|
166
|
-
t(e).disabled ?
|
|
167
|
-
t(e).data?.readPretty === !0 ? (n(), C(t(
|
|
169
|
+
t(e).disabled ? M("", !0) : (n(), f(N, { key: 0 }, [
|
|
170
|
+
t(e).data?.readPretty === !0 ? (n(), C(t(c), {
|
|
168
171
|
key: 0,
|
|
169
172
|
size: a.size,
|
|
170
173
|
"feedback-layout": a.feedbackLayout
|
|
171
174
|
}, {
|
|
172
175
|
default: d(() => [
|
|
173
|
-
u(t(
|
|
176
|
+
u(t(I), {
|
|
174
177
|
class: i(`${s}-edit-btn`),
|
|
175
178
|
onClick: p
|
|
176
179
|
}, null, 8, ["class"])
|
|
177
180
|
]),
|
|
178
181
|
_: 1
|
|
179
|
-
}, 8, ["size", "feedback-layout"])) : (n(), C(t(
|
|
182
|
+
}, 8, ["size", "feedback-layout"])) : (n(), C(t(c), {
|
|
180
183
|
key: 1,
|
|
181
184
|
size: a.size,
|
|
182
185
|
"feedback-layout": a.feedbackLayout
|
|
183
186
|
}, {
|
|
184
187
|
default: d(() => [
|
|
185
|
-
u(t(
|
|
188
|
+
u(t(G), {
|
|
186
189
|
class: i(`${s}-close-btn`),
|
|
187
190
|
onClick: B
|
|
188
191
|
}, null, 8, ["class"])
|
|
@@ -191,7 +194,7 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
191
194
|
}, 8, ["size", "feedback-layout"]))
|
|
192
195
|
], 64))
|
|
193
196
|
], 2)), [
|
|
194
|
-
[t(
|
|
197
|
+
[t(R), B]
|
|
195
198
|
])
|
|
196
199
|
], 2));
|
|
197
200
|
}
|
|
@@ -200,18 +203,18 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
200
203
|
required: !0,
|
|
201
204
|
description: "extra"
|
|
202
205
|
},
|
|
203
|
-
|
|
206
|
+
A
|
|
204
207
|
)), U = h(J, w(
|
|
205
208
|
{
|
|
206
209
|
required: !0,
|
|
207
210
|
description: "extra"
|
|
208
211
|
},
|
|
209
|
-
|
|
210
|
-
)),
|
|
212
|
+
A
|
|
213
|
+
)), pe = j(Q, {
|
|
211
214
|
Popover: U
|
|
212
215
|
});
|
|
213
216
|
export {
|
|
214
|
-
|
|
215
|
-
|
|
217
|
+
pe as Editable,
|
|
218
|
+
pe as default
|
|
216
219
|
};
|
|
217
220
|
//# sourceMappingURL=index.mjs.map
|