@webitel/ui-datalist 1.1.73 → 1.1.74
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/package.json +1 -1
- package/src/modules/card/composables/useCardValidation.ts +7 -1
- package/types/.tsbuildinfo +1 -1
- package/types/modules/card/composables/useCardComponent.d.ts +1 -1
- package/types/modules/card/composables/useCardValidation.d.ts +2 -1
- package/types/modules/card/composables/useNestedCardComponent.d.ts +1 -1
package/package.json
CHANGED
|
@@ -2,6 +2,8 @@ import type { RegleShortcutDefinition } from '@regle/core';
|
|
|
2
2
|
import type { RegleSchema } from '@regle/schemas';
|
|
3
3
|
import { computed, type Ref } from 'vue';
|
|
4
4
|
|
|
5
|
+
import type { CardValidationFields } from '../types/CardValidationFields.types';
|
|
6
|
+
|
|
5
7
|
export const useCardValidation = <
|
|
6
8
|
// biome-ignore lint/suspicious/noExplicitAny: matches RegleSchema's own state constraint
|
|
7
9
|
TState extends Record<string, any>,
|
|
@@ -16,7 +18,11 @@ export const useCardValidation = <
|
|
|
16
18
|
});
|
|
17
19
|
|
|
18
20
|
const validationFields = computed(() => {
|
|
19
|
-
|
|
21
|
+
// Regle types $fields as a union with an empty-object arm to also
|
|
22
|
+
// support discriminated-union state shapes; TState here is always a
|
|
23
|
+
// plain card entity, so that arm never applies — narrow it away once,
|
|
24
|
+
// here, instead of at every card component consuming this composable.
|
|
25
|
+
return validationSchema.value.r$.$fields as CardValidationFields<TState>;
|
|
20
26
|
});
|
|
21
27
|
|
|
22
28
|
const hasValidationErrors = computed(() => {
|