@silver-formily/element-plus 3.0.1 → 3.0.2
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/esm/__builtins__/shared/loading.mjs +1 -1
- package/esm/__builtins__/shared/loading.mjs.map +1 -1
- package/esm/__builtins__/shared/use-enter-submit.mjs +57 -16
- package/esm/__builtins__/shared/use-enter-submit.mjs.map +1 -1
- package/esm/array-base/index.mjs +21 -22
- package/esm/array-base/index.mjs.map +1 -1
- package/esm/array-base/utils.mjs +17 -18
- package/esm/array-base/utils.mjs.map +1 -1
- package/esm/array-cards/index.mjs +11 -12
- package/esm/array-cards/index.mjs.map +1 -1
- package/esm/array-collapse/index.mjs +26 -27
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-collapse/utils.mjs +3 -4
- package/esm/array-collapse/utils.mjs.map +1 -1
- package/esm/array-items/index.mjs +20 -21
- package/esm/array-items/index.mjs.map +1 -1
- package/esm/array-list-tabs/index.mjs +28 -29
- package/esm/array-list-tabs/index.mjs.map +1 -1
- package/esm/array-list-tabs/utils.mjs +5 -6
- package/esm/array-list-tabs/utils.mjs.map +1 -1
- package/esm/array-table/index.mjs +52 -53
- package/esm/array-table/index.mjs.map +1 -1
- package/esm/array-table/utils.mjs +10 -11
- package/esm/array-table/utils.mjs.map +1 -1
- package/esm/array-tabs/index.mjs +40 -43
- package/esm/array-tabs/index.mjs.map +1 -1
- package/esm/autocomplete/index.mjs +4 -5
- package/esm/autocomplete/index.mjs.map +1 -1
- package/esm/cascader/index.mjs +7 -8
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/index.mjs +4 -5
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/color-picker/index.mjs +1 -1
- package/esm/color-picker-panel/index.mjs +1 -1
- package/esm/date-picker/index.mjs +1 -1
- package/esm/date-picker-panel/index.mjs +1 -1
- package/esm/editable/index.mjs +28 -29
- package/esm/editable/index.mjs.map +1 -1
- package/esm/form-button-group/index.mjs +8 -9
- package/esm/form-button-group/index.mjs.map +1 -1
- package/esm/form-button-group/utils.mjs +3 -4
- package/esm/form-button-group/utils.mjs.map +1 -1
- package/esm/form-collapse/index.mjs +4 -5
- package/esm/form-collapse/index.mjs.map +1 -1
- package/esm/form-grid/index.mjs +3 -4
- package/esm/form-grid/index.mjs.map +1 -1
- package/esm/form-item/index.mjs +4 -5
- package/esm/form-item/index.mjs.map +1 -1
- package/esm/form-layout/form-layout.mjs +3 -4
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-step/index.mjs +12 -13
- package/esm/form-step/index.mjs.map +1 -1
- package/esm/form-tab/index.mjs +19 -20
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/input/index.mjs +13 -14
- package/esm/input/index.mjs.map +1 -1
- package/esm/input-number/index.mjs +1 -1
- package/esm/input-tag/index.mjs +12 -13
- package/esm/input-tag/index.mjs.map +1 -1
- package/esm/mention/index.mjs +12 -13
- package/esm/mention/index.mjs.map +1 -1
- package/esm/preview-text/index.mjs +4 -5
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/query-form/index.mjs +135 -136
- package/esm/query-form/index.mjs.map +1 -1
- package/esm/query-form-item/index.mjs +23 -24
- package/esm/query-form-item/index.mjs.map +1 -1
- package/esm/radio/index.mjs +4 -5
- package/esm/radio/index.mjs.map +1 -1
- package/esm/rate/index.mjs +1 -1
- package/esm/segmented/index.mjs +4 -5
- package/esm/segmented/index.mjs.map +1 -1
- package/esm/select/index.mjs +13 -14
- package/esm/select/index.mjs.map +1 -1
- package/esm/select-table/index.mjs +4 -5
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/slider/index.mjs +1 -1
- package/esm/time-picker/index.mjs +1 -1
- package/esm/time-select/index.d.ts +8 -8
- package/esm/time-select/index.mjs +1 -1
- package/esm/tree/index.mjs +8 -9
- package/esm/tree/index.mjs.map +1 -1
- package/esm/tree-select/index.mjs +4 -5
- package/esm/tree-select/index.mjs.map +1 -1
- package/esm/upload/index.mjs +36 -40
- package/esm/upload/index.mjs.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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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from "@silver-formily/vue";
|
|
2
2
|
import { ElCascader as d } from "element-plus";
|
|
3
|
-
import "@formily/reactive";
|
|
3
|
+
import "@silver-formily/reactive-vue";
|
|
4
4
|
import "@vueuse/core";
|
|
5
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
6
|
import { mapReadPretty as P } from "../__builtins__/shared/transform-component.mjs";
|
|
7
7
|
import { PreviewText as k } from "../preview-text/index.mjs";
|
|
8
8
|
import "@formily/core";
|
|
9
|
-
import "@silver-formily/reactive-vue";
|
|
10
9
|
import { useCleanAttrs as $ } from "../__builtins__/shared/utils.mjs";
|
|
11
10
|
const h = /* @__PURE__ */ f({
|
|
12
11
|
name: "FCascader",
|
|
@@ -22,10 +21,10 @@ const h = /* @__PURE__ */ f({
|
|
|
22
21
|
}), y({ _: 2 }, [
|
|
23
22
|
o.$slots.default ? {
|
|
24
23
|
name: "default",
|
|
25
|
-
fn: t(({ node:
|
|
24
|
+
fn: t(({ node: n, data: m }) => [
|
|
26
25
|
r(o.$slots, "default", {
|
|
27
|
-
node:
|
|
28
|
-
data:
|
|
26
|
+
node: n,
|
|
27
|
+
data: m
|
|
29
28
|
})
|
|
30
29
|
]),
|
|
31
30
|
key: "0"
|
|
@@ -39,13 +38,13 @@ const h = /* @__PURE__ */ f({
|
|
|
39
38
|
} : void 0
|
|
40
39
|
]), 1040, ["options"]));
|
|
41
40
|
}
|
|
42
|
-
}),
|
|
41
|
+
}), R = i(
|
|
43
42
|
h,
|
|
44
43
|
c({ dataSource: "options", disabled: !0 }),
|
|
45
44
|
P(k.Cascader)
|
|
46
45
|
);
|
|
47
46
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
R as Cascader,
|
|
48
|
+
R as default
|
|
50
49
|
};
|
|
51
50
|
//# 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\">\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":"
|
|
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,6 +1,6 @@
|
|
|
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 "@formily/reactive";
|
|
3
|
+
import "@silver-formily/reactive-vue";
|
|
4
4
|
import "@vueuse/core";
|
|
5
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
6
|
import { mapReadPretty as I } from "../__builtins__/shared/transform-component.mjs";
|
|
@@ -9,7 +9,6 @@ import { PreviewText as O } from "../preview-text/index.mjs";
|
|
|
9
9
|
import { isPlainObj as k } from "@formily/shared";
|
|
10
10
|
import { lt as R } from "../__builtins__/shared/simple-version-compare.mjs";
|
|
11
11
|
import "@formily/core";
|
|
12
|
-
import "@silver-formily/reactive-vue";
|
|
13
12
|
const j = /* @__PURE__ */ T({
|
|
14
13
|
name: "FCheckboxGroup",
|
|
15
14
|
inheritAttrs: !1,
|
|
@@ -60,11 +59,11 @@ const j = /* @__PURE__ */ T({
|
|
|
60
59
|
y({
|
|
61
60
|
disabled: !0
|
|
62
61
|
})
|
|
63
|
-
),
|
|
62
|
+
), ee = N(H, {
|
|
64
63
|
Group: z
|
|
65
64
|
});
|
|
66
65
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
ee as Checkbox,
|
|
67
|
+
ee as default
|
|
69
68
|
};
|
|
70
69
|
//# 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\">\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":"
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { connect as r, mapProps as o } from "@silver-formily/vue";
|
|
2
2
|
import { ElColorPicker as e } from "element-plus";
|
|
3
|
-
import "@formily/reactive";
|
|
3
|
+
import "@silver-formily/reactive-vue";
|
|
4
4
|
import "@vueuse/core";
|
|
5
5
|
import "vue";
|
|
6
6
|
import { mapReadPretty as t } from "../__builtins__/shared/transform-component.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { connect as e, mapProps as o } from "@silver-formily/vue";
|
|
2
2
|
import { ElColorPickerPanel as t } from "element-plus";
|
|
3
|
-
import "@formily/reactive";
|
|
3
|
+
import "@silver-formily/reactive-vue";
|
|
4
4
|
import "@vueuse/core";
|
|
5
5
|
import "vue";
|
|
6
6
|
import { mapReadPretty as i } from "../__builtins__/shared/transform-component.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { connect as r, mapProps as a } from "@silver-formily/vue";
|
|
2
2
|
import { ElDatePicker as m } from "element-plus";
|
|
3
|
-
import "@formily/reactive";
|
|
3
|
+
import "@silver-formily/reactive-vue";
|
|
4
4
|
import "@vueuse/core";
|
|
5
5
|
import "vue";
|
|
6
6
|
import { mapReadPretty as o } from "../__builtins__/shared/transform-component.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
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";
|
|
3
|
+
import "@silver-formily/reactive-vue";
|
|
4
4
|
import "@vueuse/core";
|
|
5
5
|
import "vue";
|
|
6
6
|
import { mapReadPretty as i } from "../__builtins__/shared/transform-component.mjs";
|
package/esm/editable/index.mjs
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { useField as
|
|
2
|
-
import { ElPopover as
|
|
3
|
-
import {
|
|
1
|
+
import { useField as x, connect as E, mapProps as w } from "@silver-formily/vue";
|
|
2
|
+
import { ElPopover as O, ElText as S, ClickOutside as R } from "element-plus";
|
|
3
|
+
import { reactionWatch as V } from "@silver-formily/reactive-vue";
|
|
4
4
|
import "@vueuse/core";
|
|
5
|
-
import { defineComponent as z, ref as m, openBlock as n, createElementBlock as
|
|
5
|
+
import { defineComponent as z, ref as m, openBlock as n, createElementBlock as c, 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 h } from "vue";
|
|
6
6
|
import "@formily/core";
|
|
7
|
-
import "@silver-formily/reactive-vue";
|
|
8
7
|
import { composeExport as j } from "../__builtins__/shared/utils.mjs";
|
|
9
|
-
import { FormBaseItem as
|
|
10
|
-
import { Edit as
|
|
8
|
+
import { FormBaseItem as f, fieldFeedbackMapper as A } from "../form-item/index.mjs";
|
|
9
|
+
import { Edit as W, Close as G } from "@element-plus/icons-vue";
|
|
11
10
|
import { isValid as $, isPlainObj as H } from "@formily/shared";
|
|
12
|
-
import { stylePrefix as
|
|
11
|
+
import { stylePrefix as I } from "../__builtins__/configs/index.mjs";
|
|
13
12
|
import { o as k } from "../vendor/lodash.mjs";
|
|
14
13
|
import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
15
14
|
name: "FEditablePopover",
|
|
@@ -41,7 +40,7 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
41
40
|
tooltipLayout: {}
|
|
42
41
|
},
|
|
43
42
|
setup(b) {
|
|
44
|
-
const a = b, e =
|
|
43
|
+
const a = b, e = x(), r = `${I}-editable`, s = m(), l = m(!1);
|
|
45
44
|
$(e.value.data) ? $(e.value.data.readPretty) || (e.value.data.readPretty = !0) : (e.value.data = {}, e.value.data.readPretty = !0);
|
|
46
45
|
function v(o) {
|
|
47
46
|
s.value.parentElement.contains(o.target) || (l.value = !1);
|
|
@@ -57,10 +56,10 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
57
56
|
(o) => {
|
|
58
57
|
o.length > 0 && (l.value = !0);
|
|
59
58
|
}
|
|
60
|
-
), (o, p) => (n(),
|
|
59
|
+
), (o, p) => (n(), c("div", {
|
|
61
60
|
class: i(r)
|
|
62
61
|
}, [
|
|
63
|
-
u(t(
|
|
62
|
+
u(t(O), P(o.$attrs, {
|
|
64
63
|
visible: l.value,
|
|
65
64
|
title: o.$attrs.title || t(e).title,
|
|
66
65
|
trigger: "click",
|
|
@@ -76,7 +75,7 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
76
75
|
], 2)
|
|
77
76
|
]),
|
|
78
77
|
reference: d(() => [
|
|
79
|
-
F((n(), C(t(
|
|
78
|
+
F((n(), C(t(f), P(a, {
|
|
80
79
|
class: `${r}-trigger`
|
|
81
80
|
}), {
|
|
82
81
|
default: d(() => [
|
|
@@ -90,7 +89,7 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
90
89
|
]),
|
|
91
90
|
_: 1
|
|
92
91
|
}),
|
|
93
|
-
u(t(
|
|
92
|
+
u(t(W), {
|
|
94
93
|
class: i(`${r}-edit-btn`)
|
|
95
94
|
}, null, 8, ["class"])
|
|
96
95
|
], 2)
|
|
@@ -134,52 +133,52 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
134
133
|
editProps: {}
|
|
135
134
|
},
|
|
136
135
|
setup(b) {
|
|
137
|
-
const a = b, e =
|
|
136
|
+
const a = b, e = x(), r = m(null), s = `${I}-editable`, l = m(null), v = g(() => k(a, "editProps")), y = g(() => H(a.editProps) ? { ...k(a, "editProps"), ...a.editProps } : k(a, "editProps"));
|
|
138
137
|
function o() {
|
|
139
138
|
$(e.value.data) || (e.value.data = {});
|
|
140
139
|
}
|
|
141
140
|
o(), e.value.data.readPretty = !0;
|
|
142
141
|
async function p() {
|
|
143
|
-
e.value.disabled || (o(), e.value.data.readPretty = !1, await
|
|
142
|
+
e.value.disabled || (o(), e.value.data.readPretty = !1, await h(), l.value.feedbackTooltipRef.updatePopper(), r.value?.querySelector("input")?.focus());
|
|
144
143
|
}
|
|
145
144
|
function B() {
|
|
146
145
|
e.value.data?.readPretty !== !0 && (o(), setTimeout(async () => {
|
|
147
|
-
e.value.data.readPretty = !0, await
|
|
146
|
+
e.value.data.readPretty = !0, await h(), l.value?.feedbackTooltipRef.updatePopper();
|
|
148
147
|
}, 0));
|
|
149
148
|
}
|
|
150
|
-
return (
|
|
149
|
+
return (L, X) => (n(), c("div", {
|
|
151
150
|
ref_key: "innerRef",
|
|
152
151
|
ref: r,
|
|
153
152
|
class: i([s, t(e).disabled && "is-disabled"])
|
|
154
153
|
}, [
|
|
155
|
-
F((n(),
|
|
154
|
+
F((n(), c("div", {
|
|
156
155
|
class: i(`${s}-content`)
|
|
157
156
|
}, [
|
|
158
|
-
u(t(
|
|
157
|
+
u(t(f), P({
|
|
159
158
|
ref_key: "formItemRef",
|
|
160
159
|
ref: l
|
|
161
160
|
}, t(e).data?.readPretty === !1 ? y.value : v.value, { onClick: p }), {
|
|
162
161
|
default: d(() => [
|
|
163
162
|
_("div", null, [
|
|
164
|
-
T(
|
|
163
|
+
T(L.$slots, "default")
|
|
165
164
|
])
|
|
166
165
|
]),
|
|
167
166
|
_: 3
|
|
168
167
|
}, 16),
|
|
169
|
-
t(e).disabled ? M("", !0) : (n(),
|
|
170
|
-
t(e).data?.readPretty === !0 ? (n(), C(t(
|
|
168
|
+
t(e).disabled ? M("", !0) : (n(), c(N, { key: 0 }, [
|
|
169
|
+
t(e).data?.readPretty === !0 ? (n(), C(t(f), {
|
|
171
170
|
key: 0,
|
|
172
171
|
size: a.size,
|
|
173
172
|
"feedback-layout": a.feedbackLayout
|
|
174
173
|
}, {
|
|
175
174
|
default: d(() => [
|
|
176
|
-
u(t(
|
|
175
|
+
u(t(W), {
|
|
177
176
|
class: i(`${s}-edit-btn`),
|
|
178
177
|
onClick: p
|
|
179
178
|
}, null, 8, ["class"])
|
|
180
179
|
]),
|
|
181
180
|
_: 1
|
|
182
|
-
}, 8, ["size", "feedback-layout"])) : (n(), C(t(
|
|
181
|
+
}, 8, ["size", "feedback-layout"])) : (n(), C(t(f), {
|
|
183
182
|
key: 1,
|
|
184
183
|
size: a.size,
|
|
185
184
|
"feedback-layout": a.feedbackLayout
|
|
@@ -198,23 +197,23 @@ import '../styles/editable/index.css';const J = /* @__PURE__ */ z({
|
|
|
198
197
|
])
|
|
199
198
|
], 2));
|
|
200
199
|
}
|
|
201
|
-
}), Q =
|
|
200
|
+
}), Q = E(K, w(
|
|
202
201
|
{
|
|
203
202
|
required: !0,
|
|
204
203
|
description: "extra"
|
|
205
204
|
},
|
|
206
205
|
A
|
|
207
|
-
)), U =
|
|
206
|
+
)), U = E(J, w(
|
|
208
207
|
{
|
|
209
208
|
required: !0,
|
|
210
209
|
description: "extra"
|
|
211
210
|
},
|
|
212
211
|
A
|
|
213
|
-
)),
|
|
212
|
+
)), ue = j(Q, {
|
|
214
213
|
Popover: U
|
|
215
214
|
});
|
|
216
215
|
export {
|
|
217
|
-
|
|
218
|
-
|
|
216
|
+
ue as Editable,
|
|
217
|
+
ue as default
|
|
219
218
|
};
|
|
220
219
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/editable/editable-popover.vue","../../src/editable/editable.vue","../../src/editable/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { Field } from '@formily/core'\nimport type { IFormItemProps } from '../form-item/types'\nimport { Edit } from '@element-plus/icons-vue'\nimport { reaction } from '@formily/reactive'\nimport { isValid } from '@formily/shared'\nimport { useField } from '@silver-formily/vue'\nimport { ElPopover, ElText, ClickOutside as vClickOutside } from 'element-plus'\nimport { ref } from 'vue'\nimport { stylePrefix } from '../__builtins__/configs'\nimport { FormBaseItem } from '../form-item'\n\ndefineOptions({\n name: 'FEditablePopover',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<IFormItemProps>(), {\n feedbackLayout: 'popover',\n size: 'default',\n})\n\nconst fieldRef = useField<Field>()\nconst prefixCls = `${stylePrefix}-editable`\nconst contentRef = ref<HTMLElement>()\nconst visible = ref(false)\n\nif (isValid(fieldRef.value.data)) {\n /* istanbul ignore else -- @preserve */\n if (!isValid(fieldRef.value.data.readPretty)) {\n fieldRef.value.data.readPretty = true\n }\n}\nelse {\n fieldRef.value.data = {}\n fieldRef.value.data.readPretty = true\n}\n\nfunction onClickOutside(e) {\n const popoverDOM = contentRef.value.parentElement\n /* istanbul ignore else -- @preserve */\n if (!popoverDOM.contains(e.target)) {\n visible.value = false\n }\n}\nfunction onClick() {\n visible.value = true\n}\n\nreaction(\n () => fieldRef.value.form.queryFeedbacks({\n type: 'error',\n address: `${fieldRef.value.address.entire}.*`,\n }),\n (errorList) => {\n if (errorList.length > 0) {\n visible.value = true\n }\n },\n)\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <ElPopover\n v-bind=\"$attrs\"\n :visible=\"visible\"\n :title=\"$attrs.title || fieldRef.title\" trigger=\"click\" width=\"auto\"\n >\n <template #default>\n <div ref=\"contentRef\" :class=\"`${prefixCls}-popover-wrapper`\">\n <slot />\n </div>\n </template>\n <template #reference>\n <FormBaseItem v-click-outside=\"onClickOutside\" v-bind=\"props\" :class=\"`${prefixCls}-trigger`\">\n <div :class=\"`${prefixCls}-content`\" @click=\"onClick\">\n <ElText>\n {{ fieldRef.title }}\n </ElText>\n <Edit :class=\"`${prefixCls}-edit-btn`\" />\n </div>\n </FormBaseItem>\n </template>\n </ElPopover>\n </div>\n</template>\n","<script lang=\"ts\" setup>\nimport type { Field } from '@formily/core'\nimport type { IFormItemProps } from '../form-item/types'\nimport { Close, Edit } from '@element-plus/icons-vue'\nimport { isPlainObj, isValid } from '@formily/shared'\nimport { useField } from '@silver-formily/vue'\nimport { ClickOutside as vClickOutside } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { computed, nextTick, ref } from 'vue'\nimport { stylePrefix } from '../__builtins__/configs'\nimport { FormBaseItem } from '../form-item'\n\ndefineOptions({\n name: 'FEditable',\n})\n\nconst props = withDefaults(defineProps<IFormItemProps & { editProps?: IFormItemProps }>(), {\n feedbackLayout: 'popover',\n size: 'default',\n})\n\nconst fieldRef = useField<Field>()\nconst innerRef = ref<HTMLElement>(null)\nconst prefixCls = `${stylePrefix}-editable`\nconst formItemRef = ref<InstanceType<typeof FormBaseItem>>(null)\n\nconst commonProps = computed(() => omit(props, 'editProps'))\nconst editProps = computed(() => {\n if (isPlainObj(props.editProps)) {\n return { ...omit(props, 'editProps'), ...props.editProps }\n }\n return omit(props, 'editProps')\n})\n\nfunction handleEnsureReadPretty() {\n if (!isValid(fieldRef.value.data)) {\n fieldRef.value.data = {}\n }\n}\n\nhandleEnsureReadPretty()\nfieldRef.value.data.readPretty = true\n\nasync function onClick() {\n if (fieldRef.value.disabled)\n return\n handleEnsureReadPretty()\n fieldRef.value.data.readPretty = false\n await nextTick()\n formItemRef.value.feedbackTooltipRef.updatePopper()\n innerRef.value?.querySelector('input')?.focus()\n}\n\nfunction onClickOutside() {\n if (fieldRef.value.data?.readPretty === true)\n return\n handleEnsureReadPretty()\n // 使用下拉菜单等触发的事件完成应有的操作\n setTimeout(async () => {\n fieldRef.value.data.readPretty = true\n await nextTick()\n formItemRef.value?.feedbackTooltipRef.updatePopper()\n }, 0)\n}\n</script>\n\n<template>\n <div ref=\"innerRef\" :class=\"[prefixCls, fieldRef.disabled && 'is-disabled']\">\n <div v-click-outside=\"onClickOutside\" :class=\"`${prefixCls}-content`\">\n <FormBaseItem ref=\"formItemRef\" v-bind=\"fieldRef.data?.readPretty === false ? editProps : commonProps\" @click=\"onClick\">\n <div>\n <slot />\n </div>\n </FormBaseItem>\n <template v-if=\"!fieldRef.disabled\">\n <template v-if=\"fieldRef.data?.readPretty === true\">\n <FormBaseItem :size=\"props.size\" :feedback-layout=\"props.feedbackLayout\">\n <Edit :class=\"`${prefixCls}-edit-btn`\" @click=\"onClick\" />\n </FormBaseItem>\n </template>\n <template v-else>\n <FormBaseItem :size=\"props.size\" :feedback-layout=\"props.feedbackLayout\">\n <Close :class=\"`${prefixCls}-close-btn`\" @click=\"onClickOutside\" />\n </FormBaseItem>\n </template>\n </template>\n </div>\n </div>\n</template>\n","import type { ElPopover } from 'element-plus'\nimport type { IFormItemProps } from '../form-item/types'\nimport { connect, mapProps } from '@silver-formily/vue'\nimport { composeExport } from '../__builtins__/shared'\nimport { fieldFeedbackMapper } from '../form-item'\nimport FEditablePopover from './editable-popover.vue'\nimport FEditable from './editable.vue'\nimport './style.scss'\n\nexport type EditableProps = IFormItemProps\nexport type EditablePopoverProps = typeof ElPopover\n\nconst EditableInner = connect<typeof FEditable>(FEditable, mapProps(\n {\n required: true,\n description: 'extra',\n },\n fieldFeedbackMapper,\n))\n\nconst EditablePopover = connect<typeof FEditablePopover>(FEditablePopover, mapProps(\n {\n required: true,\n description: 'extra',\n },\n fieldFeedbackMapper,\n))\n\nexport const Editable = composeExport(EditableInner, {\n Popover: EditablePopover,\n})\n\nexport default Editable\n"],"names":["props","__props","fieldRef","useField","prefixCls","stylePrefix","contentRef","ref","visible","isValid","onClickOutside","e","onClick","reaction","errorList","_createElementBlock","_createVNode","_unref","ElPopover","_mergeProps","_ctx","$attrs","_createElementVNode","_renderSlot","_createBlock","FormBaseItem","ElText","_createTextVNode","_toDisplayString","Edit","innerRef","formItemRef","commonProps","computed","omit","editProps","isPlainObj","handleEnsureReadPretty","nextTick","_normalizeClass","_Fragment","Close","EditableInner","connect","FEditable","mapProps","fieldFeedbackMapper","EditablePopover","FEditablePopover","Editable","composeExport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,UAAMA,IAAQC,GAKRC,IAAWC,EAAA,GACXC,IAAY,GAAGC,CAAW,aAC1BC,IAAaC,EAAA,GACbC,IAAUD,EAAI,EAAK;AAEzB,IAAIE,EAAQP,EAAS,MAAM,IAAI,IAExBO,EAAQP,EAAS,MAAM,KAAK,UAAU,MACzCA,EAAS,MAAM,KAAK,aAAa,OAInCA,EAAS,MAAM,OAAO,CAAA,GACtBA,EAAS,MAAM,KAAK,aAAa;AAGnC,aAASQ,EAAeC,GAAG;AAGzB,MAFmBL,EAAW,MAAM,cAEpB,SAASK,E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IY;AAAA,QAAA,GAAsBd,EAAAf,CAAA,EAAS,MAAM,eAAU,KAAaiC,EAAA,QAAYH,EAAA,OAAW,EAAG,SAAApB,EAAA,CAAc,GAAA;AAAA,qBACpH,MAEM;AAAA,YAFNU,EAEM,OAAA,MAAA;AAAA,cADJC,EAAQH,EAAA,QAAA,SAAA;AAAA,YAAA;;;;QAGKH,EAAAf,CAAA,EAAS,6BAA1Ba,EAWWyB,GAAA,EAAA,KAAA,KAAA;AAAA,UAVOvB,EAAAf,CAAA,EAAS,MAAM,eAAU,WACvCsB,EAEeP,EAAAQ,CAAA,GAAA;AAAA;YAFA,MAAMzB,EAAM;AAAA,YAAO,mBAAiBA,EAAM;AAAA,UAAA;uBACvD,MAA0D;AAAA,cAA1DgB,EAA0DC,EAAAY,CAAA,GAAA;AAAA,gBAAnD,YAAUzB,CAAS,WAAA;AAAA,gBAAc,SAAAQ;AAAA,cAAA;;;sDAI1CY,EAEeP,EAAAQ,CAAA,GAAA;AAAA;YAFA,MAAMzB,EAAM;AAAA,YAAO,mBAAiBA,EAAM;AAAA,UAAA;uBACvD,MAAmE;AAAA,cAAnEgB,EAAmEC,EAAAwB,CAAA,GAAA;AAAA,gBAA3D,YAAUrC,CAAS,YAAA;AAAA,gBAAe,SAAOM;AAAA,cAAA;;;;;;eAdnCA,CAAc;AAAA,MAAA;;;ICxDlCgC,IAAgBC,EAA0BC,GAAWC;AAAA,EACzD;AAAA,IACE,UAAU;AAAA,IACV,aAAa;AAAA,EAAA;AAAA,EAEfC;AACF,CAAC,GAEKC,IAAkBJ,EAAiCK,GAAkBH;AAAA,EACzE;AAAA,IACE,UAAU;AAAA,IACV,aAAa;AAAA,EAAA;AAAA,EAEfC;AACF,CAAC,GAEYG,KAAWC,EAAcR,GAAe;AAAA,EACnD,SAASK;AACX,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/editable/editable-popover.vue","../../src/editable/editable.vue","../../src/editable/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { Field } from '@formily/core'\nimport type { IFormItemProps } from '../form-item/types'\nimport { Edit } from '@element-plus/icons-vue'\nimport { isValid } from '@formily/shared'\nimport { reactionWatch } from '@silver-formily/reactive-vue'\nimport { useField } from '@silver-formily/vue'\nimport { ElPopover, ElText, ClickOutside as vClickOutside } from 'element-plus'\nimport { ref } from 'vue'\nimport { stylePrefix } from '../__builtins__/configs'\nimport { FormBaseItem } from '../form-item'\n\ndefineOptions({\n name: 'FEditablePopover',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<IFormItemProps>(), {\n feedbackLayout: 'popover',\n size: 'default',\n})\n\nconst fieldRef = useField<Field>()\nconst prefixCls = `${stylePrefix}-editable`\nconst contentRef = ref<HTMLElement>()\nconst visible = ref(false)\n\nif (isValid(fieldRef.value.data)) {\n /* istanbul ignore else -- @preserve */\n if (!isValid(fieldRef.value.data.readPretty)) {\n fieldRef.value.data.readPretty = true\n }\n}\nelse {\n fieldRef.value.data = {}\n fieldRef.value.data.readPretty = true\n}\n\nfunction onClickOutside(e) {\n const popoverDOM = contentRef.value.parentElement\n /* istanbul ignore else -- @preserve */\n if (!popoverDOM.contains(e.target)) {\n visible.value = false\n }\n}\nfunction onClick() {\n visible.value = true\n}\n\nreactionWatch(\n () => fieldRef.value.form.queryFeedbacks({\n type: 'error',\n address: `${fieldRef.value.address.entire}.*`,\n }),\n (errorList) => {\n if (errorList.length > 0) {\n visible.value = true\n }\n },\n)\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <ElPopover\n v-bind=\"$attrs\"\n :visible=\"visible\"\n :title=\"$attrs.title || fieldRef.title\" trigger=\"click\" width=\"auto\"\n >\n <template #default>\n <div ref=\"contentRef\" :class=\"`${prefixCls}-popover-wrapper`\">\n <slot />\n </div>\n </template>\n <template #reference>\n <FormBaseItem v-click-outside=\"onClickOutside\" v-bind=\"props\" :class=\"`${prefixCls}-trigger`\">\n <div :class=\"`${prefixCls}-content`\" @click=\"onClick\">\n <ElText>\n {{ fieldRef.title }}\n </ElText>\n <Edit :class=\"`${prefixCls}-edit-btn`\" />\n </div>\n </FormBaseItem>\n </template>\n </ElPopover>\n </div>\n</template>\n","<script lang=\"ts\" setup>\nimport type { Field } from '@formily/core'\nimport type { IFormItemProps } from '../form-item/types'\nimport { Close, Edit } from '@element-plus/icons-vue'\nimport { isPlainObj, isValid } from '@formily/shared'\nimport { useField } from '@silver-formily/vue'\nimport { ClickOutside as vClickOutside } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { computed, nextTick, ref } from 'vue'\nimport { stylePrefix } from '../__builtins__/configs'\nimport { FormBaseItem } from '../form-item'\n\ndefineOptions({\n name: 'FEditable',\n})\n\nconst props = withDefaults(defineProps<IFormItemProps & { editProps?: IFormItemProps }>(), {\n feedbackLayout: 'popover',\n size: 'default',\n})\n\nconst fieldRef = useField<Field>()\nconst innerRef = ref<HTMLElement>(null)\nconst prefixCls = `${stylePrefix}-editable`\nconst formItemRef = ref<InstanceType<typeof FormBaseItem>>(null)\n\nconst commonProps = computed(() => omit(props, 'editProps'))\nconst editProps = computed(() => {\n if (isPlainObj(props.editProps)) {\n return { ...omit(props, 'editProps'), ...props.editProps }\n }\n return omit(props, 'editProps')\n})\n\nfunction handleEnsureReadPretty() {\n if (!isValid(fieldRef.value.data)) {\n fieldRef.value.data = {}\n }\n}\n\nhandleEnsureReadPretty()\nfieldRef.value.data.readPretty = true\n\nasync function onClick() {\n if (fieldRef.value.disabled)\n return\n handleEnsureReadPretty()\n fieldRef.value.data.readPretty = false\n await nextTick()\n formItemRef.value.feedbackTooltipRef.updatePopper()\n innerRef.value?.querySelector('input')?.focus()\n}\n\nfunction onClickOutside() {\n if (fieldRef.value.data?.readPretty === true)\n return\n handleEnsureReadPretty()\n // 使用下拉菜单等触发的事件完成应有的操作\n setTimeout(async () => {\n fieldRef.value.data.readPretty = true\n await nextTick()\n formItemRef.value?.feedbackTooltipRef.updatePopper()\n }, 0)\n}\n</script>\n\n<template>\n <div ref=\"innerRef\" :class=\"[prefixCls, fieldRef.disabled && 'is-disabled']\">\n <div v-click-outside=\"onClickOutside\" :class=\"`${prefixCls}-content`\">\n <FormBaseItem ref=\"formItemRef\" v-bind=\"fieldRef.data?.readPretty === false ? editProps : commonProps\" @click=\"onClick\">\n <div>\n <slot />\n </div>\n </FormBaseItem>\n <template v-if=\"!fieldRef.disabled\">\n <template v-if=\"fieldRef.data?.readPretty === true\">\n <FormBaseItem :size=\"props.size\" :feedback-layout=\"props.feedbackLayout\">\n <Edit :class=\"`${prefixCls}-edit-btn`\" @click=\"onClick\" />\n </FormBaseItem>\n </template>\n <template v-else>\n <FormBaseItem :size=\"props.size\" :feedback-layout=\"props.feedbackLayout\">\n <Close :class=\"`${prefixCls}-close-btn`\" @click=\"onClickOutside\" />\n </FormBaseItem>\n </template>\n </template>\n </div>\n </div>\n</template>\n","import type { ElPopover } from 'element-plus'\nimport type { IFormItemProps } from '../form-item/types'\nimport { connect, mapProps } from '@silver-formily/vue'\nimport { composeExport } from '../__builtins__/shared'\nimport { fieldFeedbackMapper } from '../form-item'\nimport FEditablePopover from './editable-popover.vue'\nimport FEditable from './editable.vue'\nimport './style.scss'\n\nexport type EditableProps = IFormItemProps\nexport type EditablePopoverProps = typeof ElPopover\n\nconst EditableInner = connect<typeof FEditable>(FEditable, mapProps(\n {\n required: true,\n description: 'extra',\n },\n fieldFeedbackMapper,\n))\n\nconst EditablePopover = connect<typeof FEditablePopover>(FEditablePopover, mapProps(\n {\n required: true,\n description: 'extra',\n },\n fieldFeedbackMapper,\n))\n\nexport const Editable = composeExport(EditableInner, {\n Popover: EditablePopover,\n})\n\nexport default Editable\n"],"names":["props","__props","fieldRef","useField","prefixCls","stylePrefix","contentRef","ref","visible","isValid","onClickOutside","e","onClick","reactionWatch","errorList","_createElementBlock","_createVNode","_unref","ElPopover","_mergeProps","_ctx","$attrs","_createElementVNode","_renderSlot","_createBlock","FormBaseItem","ElText","_createTextVNode","_toDisplayString","Edit","innerRef","formItemRef","commonProps","computed","omit","editProps","isPlainObj","handleEnsureReadPretty","nextTick","_normalizeClass","_Fragment","Close","EditableInner","connect","FEditable","mapProps","fieldFeedbackMapper","EditablePopover","FEditablePopover","Editable","composeExport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,UAAMA,IAAQC,GAKRC,IAAWC,EAAA,GACXC,IAAY,GAAGC,CAAW,aAC1BC,IAAaC,EAAA,GACbC,IAAUD,EAAI,EAAK;AAEzB,IAAIE,EAAQP,EAAS,MAAM,IAAI,IAExBO,EAAQP,EAAS,MAAM,KAAK,UAAU,MACzCA,EAAS,MAAM,KAAK,aAAa,OAInCA,EAAS,MAAM,OAAO,CAAA,GACtBA,EAAS,MAAM,KAAK,aAAa;AAGnC,aAASQ,EAAeC,GAAG;AAGzB,MAFmBL,EAAW,MAAM,cAEpB,SAASK,EAAE,MAAM,MAC/BH,EAAQ,QAAQ;AAAA,IAEpB;AACA,aAASI,IAAU;AACjB,MAAAJ,EAAQ,QAAQ;AAAA,IAClB;AAEA,WAAAK;AAAA,MACE,MAAMX,EAAS,MAAM,KAAK,eAAe;AAAA,QACvC,MAAM;AAAA,QACN,SAAS,GAAGA,EAAS,MAAM,QAAQ,MAAM;AAAA,MAAA,CAC1C;AAAA,MACD,CAACY,MAAc;AACb,QAAIA,EAAU,SAAS,MACrBN,EAAQ,QAAQ;AAAA,MAEpB;AAAA,IAAA,mBAKAO,EAsBM,OAAA;AAAA,MAtBA,SAAOX,CAAS;AAAA,IAAA;MACpBY,EAoBYC,EAAAC,CAAA,GApBZC,EAoBYC,EAAA,QAnBI;AAAA,QACb,SAASZ,EAAA;AAAA,QACT,OAAOa,EAAAA,OAAO,SAASJ,EAAAf,CAAA,EAAS;AAAA,QAAO,SAAQ;AAAA,QAAQ,OAAM;AAAA,MAAA;QAEnD,WACT,MAEM;AAAA,UAFNoB,EAEM,OAAA;AAAA,qBAFG;AAAA,YAAJ,KAAIhB;AAAA,YAAc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MAAmE;AAAA,cAAnEgB,EAAmEC,EAAAwB,CAAA,GAAA;AAAA,gBAA3D,YAAUrC,CAAS,YAAA;AAAA,gBAAe,SAAOM;AAAA,cAAA;;;;;;eAdnCA,CAAc;AAAA,MAAA;;;ICxDlCgC,IAAgBC,EAA0BC,GAAWC;AAAA,EACzD;AAAA,IACE,UAAU;AAAA,IACV,aAAa;AAAA,EAAA;AAAA,EAEfC;AACF,CAAC,GAEKC,IAAkBJ,EAAiCK,GAAkBH;AAAA,EACzE;AAAA,IACE,UAAU;AAAA,IACV,aAAa;AAAA,EAAA;AAAA,EAEfC;AACF,CAAC,GAEYG,KAAWC,EAAcR,GAAe;AAAA,EACnD,SAASK;AACX,CAAC;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { useAttrs as y, ElAffix as g, ElSpace as m } from "element-plus";
|
|
2
|
-
import "@formily/reactive";
|
|
2
|
+
import "@silver-formily/reactive-vue";
|
|
3
3
|
import "@vueuse/core";
|
|
4
|
-
import { defineComponent as p, computed as _, openBlock as
|
|
4
|
+
import { defineComponent as p, computed as _, openBlock as i, createBlock as n, unref as e, mergeProps as a, withCtx as l, renderSlot as u, createVNode as $, normalizeStyle as v } from "vue";
|
|
5
5
|
import "@formily/core";
|
|
6
|
-
import "@silver-formily/reactive-vue";
|
|
7
6
|
import { useForm as h } from "@silver-formily/vue";
|
|
8
7
|
import { composeExport as F } from "../__builtins__/shared/utils.mjs";
|
|
9
8
|
import { useFormLayoutId as k } from "../form-layout/utils.mjs";
|
|
@@ -12,8 +11,8 @@ import { FormItem as x } from "../form-item/index.mjs";
|
|
|
12
11
|
import '../styles/form-button-group/index.css';const B = /* @__PURE__ */ p({
|
|
13
12
|
__name: "form-button-group-sticky",
|
|
14
13
|
setup(f) {
|
|
15
|
-
const t = y(), o = h(),
|
|
16
|
-
return (d, z) => (
|
|
14
|
+
const t = y(), o = h(), s = k(), c = _(() => t.value.target ? t.value.target : s.value ? `#${s.value}` : o.value?.id ? `#formily-${o.value.id}` : void 0);
|
|
15
|
+
return (d, z) => (i(), n(e(g), a({
|
|
17
16
|
class: `${e(r)}__sticky`
|
|
18
17
|
}, e(t), {
|
|
19
18
|
position: e(t).position ?? "bottom",
|
|
@@ -49,7 +48,7 @@ import '../styles/form-button-group/index.css';const B = /* @__PURE__ */ p({
|
|
|
49
48
|
},
|
|
50
49
|
setup(f) {
|
|
51
50
|
const t = f;
|
|
52
|
-
return (o,
|
|
51
|
+
return (o, s) => t.alignFormItem ? (i(), n(e(x), a({
|
|
53
52
|
key: 0,
|
|
54
53
|
label: " "
|
|
55
54
|
}, o.$attrs, {
|
|
@@ -74,7 +73,7 @@ import '../styles/form-button-group/index.css';const B = /* @__PURE__ */ p({
|
|
|
74
73
|
}, 8, ["size", "style"])
|
|
75
74
|
]),
|
|
76
75
|
_: 3
|
|
77
|
-
}, 16, ["class"])) : (
|
|
76
|
+
}, 16, ["class"])) : (i(), n(e(m), a({ key: 1 }, o.$attrs, {
|
|
78
77
|
class: [e(r), t.inline && `${e(r)}--inline`],
|
|
79
78
|
style: {
|
|
80
79
|
justifyContent: t.align === "left" ? "flex-start" : t.align === "right" ? "flex-end" : "center",
|
|
@@ -88,10 +87,10 @@ import '../styles/form-button-group/index.css';const B = /* @__PURE__ */ p({
|
|
|
88
87
|
_: 3
|
|
89
88
|
}, 16, ["class", "style", "size"]));
|
|
90
89
|
}
|
|
91
|
-
}),
|
|
90
|
+
}), P = F(b, {
|
|
92
91
|
Sticky: B
|
|
93
92
|
});
|
|
94
93
|
export {
|
|
95
|
-
|
|
94
|
+
P as FormButtonGroup
|
|
96
95
|
};
|
|
97
96
|
//# 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\">\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":"
|
|
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":";;;;;;;;;;;;;AASA,UAAMA,IAAQC,EAAA,GACRC,IAAUC,EAAA,GACVC,IAAeC,EAAA,GAEfC,IAASC,EAAS,MAClBP,EAAM,MAAM,SACPA,EAAM,MAAM,SAEjBI,EAAa,QACR,IAAIA,EAAa,KAAK,KAGxBF,EAAQ,OAAO,KAAK,YAAYA,EAAQ,MAAM,EAAE,KAAK,MAC7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ins__/configs/index.mjs";
|
|
2
2
|
import "element-plus";
|
|
3
|
-
import "@formily/reactive";
|
|
3
|
+
import "@silver-formily/reactive-vue";
|
|
4
4
|
import "@vueuse/core";
|
|
5
5
|
import "vue";
|
|
6
6
|
import "@formily/core";
|
|
7
|
-
import "@silver-formily/reactive-vue";
|
|
8
7
|
import "@silver-formily/vue";
|
|
9
|
-
const
|
|
8
|
+
const s = `${o}-form-button-group`;
|
|
10
9
|
export {
|
|
11
|
-
|
|
10
|
+
s as prefixCls
|
|
12
11
|
};
|
|
13
12
|
//# sourceMappingURL=utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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,9 +1,8 @@
|
|
|
1
1
|
import { defineComponent as K, computed as V, openBlock as o, createBlock as s, 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
2
|
import { ElCollapse as h, ElCollapseItem as j, ElBadge as q } from "element-plus";
|
|
3
|
-
import "@formily/reactive";
|
|
3
|
+
import { formilyComputed as g } from "@silver-formily/reactive-vue";
|
|
4
4
|
import "@vueuse/core";
|
|
5
5
|
import "@formily/core";
|
|
6
|
-
import { formilyComputed as g } from "@silver-formily/reactive-vue";
|
|
7
6
|
import { useField as w, useFieldSchema as z, RecursionField as L } from "@silver-formily/vue";
|
|
8
7
|
import { useCleanAttrs as O, composeExport as T } from "../__builtins__/shared/utils.mjs";
|
|
9
8
|
import { isFn as E } from "@formily/shared";
|
|
@@ -76,13 +75,13 @@ import '../styles/form-collapse/index.css';const H = { key: 1 }, J = /* @__PURE_
|
|
|
76
75
|
setup(C, { slots: r }) {
|
|
77
76
|
return () => R(m, r.default?.());
|
|
78
77
|
}
|
|
79
|
-
}),
|
|
78
|
+
}), le = T(J, {
|
|
80
79
|
Item: M,
|
|
81
80
|
createFormCollapse: A
|
|
82
81
|
});
|
|
83
82
|
export {
|
|
84
|
-
|
|
83
|
+
le as FormCollapse,
|
|
85
84
|
M as FormCollapseItem,
|
|
86
|
-
|
|
85
|
+
le as default
|
|
87
86
|
};
|
|
88
87
|
//# 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>\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":"
|
|
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;AAAA,IAAA,GAC3BY,EAAAlB,CAAA,GAAa;AAAA,MACpB,2BAASoB,MAAG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C,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;"}
|
package/esm/form-grid/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { observer as s } from "@silver-formily/reactive-vue";
|
|
2
2
|
import "element-plus";
|
|
3
|
-
import "@formily/reactive";
|
|
4
3
|
import "@vueuse/core";
|
|
5
4
|
import { defineComponent as l, computed as u, openBlock as d, createElementBlock as c, normalizeStyle as f, renderSlot as y, ref as b, provide as G, watchEffect as _, normalizeClass as C } from "vue";
|
|
6
5
|
import "@formily/core";
|
|
@@ -100,11 +99,11 @@ import '../styles/form-grid/index.css';const N = ["data-grid-span"], x = /* @__P
|
|
|
100
99
|
y(o.$slots, "default")
|
|
101
100
|
], 4));
|
|
102
101
|
}
|
|
103
|
-
}), $ = s(A), k = s(x),
|
|
102
|
+
}), $ = s(A), k = s(x), T = v($, {
|
|
104
103
|
GridColumn: k
|
|
105
104
|
});
|
|
106
105
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
T as FormGrid,
|
|
107
|
+
T as default
|
|
109
108
|
};
|
|
110
109
|
//# sourceMappingURL=index.mjs.map
|