@epic-designer/antd 1.1.9-beta.0 → 1.1.9

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.
@@ -5,11 +5,26 @@ const antDesignVue = require('ant-design-vue');
5
5
 
6
6
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
7
7
  __name: "formItem",
8
+ props: {
9
+ checkPayload: { type: [Object, null], required: false }
10
+ },
8
11
  setup(__props) {
9
- const attrs = vue.useAttrs();
12
+ const props = __props;
13
+ const rawAttrs = vue.useAttrs();
14
+ const attrs = vue.computed(() => {
15
+ var _a;
16
+ if (!props.checkPayload) {
17
+ return rawAttrs;
18
+ }
19
+ return {
20
+ ...rawAttrs,
21
+ help: (_a = props.checkPayload.message) != null ? _a : props.checkPayload.result ? "\u6821\u9A8C\u901A\u8FC7" : "\u6821\u9A8C\u5931\u8D25",
22
+ validateStatus: props.checkPayload.result ? "success" : "error"
23
+ };
24
+ });
10
25
  return (_ctx, _cache) => {
11
- return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.FormItem), vue.mergeProps(vue.unref(attrs), {
12
- name: vue.unref(attrs).field
26
+ return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.FormItem), vue.mergeProps(attrs.value, {
27
+ name: attrs.value.field
13
28
  }), {
14
29
  default: vue.withCtx(() => [
15
30
  vue.renderSlot(_ctx.$slots, "default")
@@ -1,13 +1,28 @@
1
- import { defineComponent, useAttrs, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue';
1
+ import { defineComponent, useAttrs, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue';
2
2
  import { FormItem } from 'ant-design-vue';
3
3
 
4
4
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  __name: "formItem",
6
+ props: {
7
+ checkPayload: { type: [Object, null], required: false }
8
+ },
6
9
  setup(__props) {
7
- const attrs = useAttrs();
10
+ const props = __props;
11
+ const rawAttrs = useAttrs();
12
+ const attrs = computed(() => {
13
+ var _a;
14
+ if (!props.checkPayload) {
15
+ return rawAttrs;
16
+ }
17
+ return {
18
+ ...rawAttrs,
19
+ help: (_a = props.checkPayload.message) != null ? _a : props.checkPayload.result ? "\u6821\u9A8C\u901A\u8FC7" : "\u6821\u9A8C\u5931\u8D25",
20
+ validateStatus: props.checkPayload.result ? "success" : "error"
21
+ };
22
+ });
8
23
  return (_ctx, _cache) => {
9
- return openBlock(), createBlock(unref(FormItem), mergeProps(unref(attrs), {
10
- name: unref(attrs).field
24
+ return openBlock(), createBlock(unref(FormItem), mergeProps(attrs.value, {
25
+ name: attrs.value.field
11
26
  }), {
12
27
  default: withCtx(() => [
13
28
  renderSlot(_ctx.$slots, "default")
package/dist/index.cjs CHANGED
@@ -1742,7 +1742,7 @@ const Row = {
1742
1742
  props: {
1743
1743
  placeholder: "\u8BF7\u8F93\u5165"
1744
1744
  },
1745
- type: "input"
1745
+ type: "number"
1746
1746
  },
1747
1747
  {
1748
1748
  field: "children",
package/dist/index.mjs CHANGED
@@ -1740,7 +1740,7 @@ const Row = {
1740
1740
  props: {
1741
1741
  placeholder: "\u8BF7\u8F93\u5165"
1742
1742
  },
1743
- type: "input"
1743
+ type: "number"
1744
1744
  },
1745
1745
  {
1746
1746
  field: "children",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epic-designer/antd",
3
- "version": "1.1.9-beta.0",
3
+ "version": "1.1.9",
4
4
  "description": "epic-designer base antd ui",
5
5
  "private": false,
6
6
  "author": "kchengz",
@@ -1,9 +1,31 @@
1
1
  <script lang="ts" setup>
2
- import { useAttrs } from 'vue';
2
+ import { computed, useAttrs } from 'vue';
3
3
 
4
4
  import { FormItem } from 'ant-design-vue';
5
5
 
6
- const attrs = useAttrs() as any;
6
+ type FormItemCheckPayload = {
7
+ message?: string;
8
+ result?: boolean;
9
+ };
10
+
11
+ const props = defineProps<{
12
+ checkPayload?: FormItemCheckPayload | null;
13
+ }>();
14
+
15
+ const rawAttrs = useAttrs();
16
+ const attrs = computed<any>(() => {
17
+ if (!props.checkPayload) {
18
+ return rawAttrs;
19
+ }
20
+
21
+ return {
22
+ ...rawAttrs,
23
+ help:
24
+ props.checkPayload.message ??
25
+ (props.checkPayload.result ? '校验通过' : '校验失败'),
26
+ validateStatus: props.checkPayload.result ? 'success' : 'error',
27
+ };
28
+ });
7
29
  </script>
8
30
  <template>
9
31
  <FormItem v-bind="attrs" :name="attrs.field">
package/src/row/index.ts CHANGED
@@ -64,7 +64,7 @@ export default {
64
64
  props: {
65
65
  placeholder: '请输入',
66
66
  },
67
- type: 'input',
67
+ type: 'number',
68
68
  },
69
69
  {
70
70
  field: 'children',