@vue-ui-kit/ant 1.8.7 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ declare const _default: <F = Recordable<any>>(__VLS_props: NonNullable<Awaited<t
11
11
  activeKey: import('vue').ComputedRef<number>;
12
12
  setActiveKey: (key: number) => void;
13
13
  validateAll: () => Promise<PromiseSettledResult<any>[]>;
14
- validate: (__index: number) => Promise<void>;
14
+ validate: (__index: number, ignoreTabError?: boolean) => Promise<void>;
15
15
  }>): void;
16
16
  attrs: any;
17
17
  slots: ReturnType<() => {
@@ -1,7 +1,9 @@
1
1
  import { PBlockProps } from '../../declarations/antProxy';
2
2
  declare const _default: <F = Recordable<any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_Prettify<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_Prettify<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<{}> & Readonly<{}>, never>, never> & PBlockProps<F>> & import('vue').PublicProps;
4
- expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
4
+ expose(exposed: import('vue').ShallowUnwrapRef<{
5
+ $form: import('vue').ComputedRef<Recordable<any> | undefined>;
6
+ }>): void;
5
7
  attrs: any;
6
8
  slots: ReturnType<() => {}>;
7
9
  emit: {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-ui-kit/ant",
3
- "version": "1.8.7",
3
+ "version": "1.9.0",
4
4
  "description": "Vue3 UI Kit based on Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -161,7 +161,7 @@
161
161
  return Promise.resolve(results)
162
162
  })
163
163
  },
164
- validate: async (__index: number) => {
164
+ validate: async (__index: number, ignoreTabError?: boolean) => {
165
165
  const index = model.value.findIndex(f => f.__index === __index)
166
166
  try {
167
167
  await (fr.value
@@ -173,7 +173,7 @@
173
173
  }
174
174
  catch (e) {
175
175
  // 校验失败,加入error_indexes
176
- if (!error_indexes.value.includes(__index)) {
176
+ if (!error_indexes.value.includes(__index) && !ignoreTabError) {
177
177
  error_indexes.value = [...error_indexes.value, __index]
178
178
  }
179
179
  return Promise.reject(e)
@@ -1,12 +1,17 @@
1
1
  <script lang="ts" setup name="PGroupBlock" generic="F = Recordable">
2
- import { PBlockProps, PFormProps } from '#/antProxy';
3
- import { computed, toRefs } from 'vue';
2
+ import { PBlockProps, PFormInstance, PFormProps } from '#/antProxy';
3
+ import { computed, ref, toRefs } from 'vue';
4
4
  import PForm from '@/components/PForm.vue';
5
5
 
6
6
  const props = defineProps<PBlockProps<F>>();
7
+ const formEl = ref<PFormInstance>()
7
8
  const { source } = toRefs(props);
9
+ const $form = computed(() => formEl.value?.$form)
8
10
  const formSetting = computed<PFormProps<Partial<F>>>(() => props.getFormSetting(source.value));
11
+ defineExpose({
12
+ $form,
13
+ })
9
14
  </script>
10
15
  <template>
11
- <p-form v-bind="formSetting" :data="source!" />
16
+ <p-form ref="formEl" v-bind="formSetting" :data="source!" />
12
17
  </template>
@@ -629,7 +629,7 @@ export const addRender = (
629
629
  },
630
630
  ) => {
631
631
  if (renders.hasOwnProperty(name)) {
632
- console.warn(`render ${name} already exists`);
632
+ console.warn(`render ${name} already exists, you are trying to override it`);
633
633
  }
634
634
  renders[name] = {
635
635
  renderItemContent,