@polymarbot/nuxt-layer-shadcn-ui 0.8.7 → 0.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.
- package/app/components/ui/Checkbox/index.stories.ts +9 -0
- package/app/components/ui/Checkbox/index.vue +4 -1
- package/app/components/ui/Checkbox/types.ts +3 -1
- package/app/components/ui/DatePicker/index.stories.ts +9 -0
- package/app/components/ui/DatePicker/index.vue +3 -0
- package/app/components/ui/DatePicker/types.ts +2 -0
- package/app/components/ui/DateRangePicker/index.stories.ts +9 -0
- package/app/components/ui/DateRangePicker/index.vue +3 -0
- package/app/components/ui/DateRangePicker/types.ts +2 -0
- package/app/components/ui/Drawer/index.stories.ts +78 -1
- package/app/components/ui/Drawer/index.vue +31 -9
- package/app/components/ui/Drawer/types.ts +5 -0
- package/app/components/ui/FormItem/index.stories.ts +137 -10
- package/app/components/ui/FormItem/index.vue +10 -3
- package/app/components/ui/Input/index.vue +3 -1
- package/app/components/ui/InputCurrency/index.stories.ts +9 -0
- package/app/components/ui/InputCurrency/types.ts +3 -1
- package/app/components/ui/InputNumber/index.vue +10 -7
- package/app/components/ui/InputOtp/index.stories.ts +10 -0
- package/app/components/ui/InputOtp/index.vue +5 -1
- package/app/components/ui/InputOtp/types.ts +1 -0
- package/app/components/ui/InputPercent/index.stories.ts +11 -0
- package/app/components/ui/InputPercent/index.vue +6 -0
- package/app/components/ui/InputPercent/types.ts +3 -0
- package/app/components/ui/InputRange/index.stories.ts +11 -0
- package/app/components/ui/Modal/index.stories.ts +78 -0
- package/app/components/ui/Modal/index.vue +31 -9
- package/app/components/ui/Modal/types.ts +5 -0
- package/app/components/ui/RadioCardGroup/index.stories.ts +9 -0
- package/app/components/ui/RadioCardGroup/index.vue +4 -0
- package/app/components/ui/RadioCardGroup/types.ts +1 -0
- package/app/components/ui/RadioGroup/index.stories.ts +9 -0
- package/app/components/ui/RadioGroup/index.vue +4 -0
- package/app/components/ui/RadioGroup/types.ts +1 -0
- package/app/components/ui/SearchSelect/index.stories.ts +9 -0
- package/app/components/ui/SearchSelect/index.vue +2 -0
- package/app/components/ui/SearchSelect/types.ts +1 -0
- package/app/components/ui/Select/index.stories.ts +9 -0
- package/app/components/ui/Select/index.vue +6 -0
- package/app/components/ui/Select/types.ts +1 -0
- package/app/components/ui/Textarea/index.vue +3 -1
- package/app/composables/useFormItemInvalid.ts +16 -0
- package/package.json +2 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { InjectionKey, MaybeRefOrGetter, Ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
const formItemInvalidKey: InjectionKey<Ref<boolean>> = Symbol('formItemInvalid')
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the effective invalid state for an input-like component, combining
|
|
7
|
+
* its own `invalid` prop with any ancestor FormItem's error state. Re-provides
|
|
8
|
+
* the combined state so nested input-likes (e.g. Input inside DatePicker)
|
|
9
|
+
* inherit it without manual prop forwarding.
|
|
10
|
+
*/
|
|
11
|
+
export function useFormItemInvalid (localInvalid?: MaybeRefOrGetter<boolean | undefined>) {
|
|
12
|
+
const ancestor = inject(formItemInvalidKey, ref(false))
|
|
13
|
+
const effective = computed(() => !!toValue(localInvalid) || ancestor.value)
|
|
14
|
+
provide(formItemInvalidKey, effective)
|
|
15
|
+
return effective
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polymarbot/nuxt-layer-shadcn-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Nuxt layer providing shadcn-vue based UI components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"vue-i18n": "^11",
|
|
43
43
|
"vue-router": "^4 || ^5"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "aedca95dc524baad501d555838cae7ffefd4a853"
|
|
46
46
|
}
|