From 5bca440cd0713feb5a66457fec951ed136a90706 Mon Sep 17 00:00:00 2001 From: Damien Roche Date: Tue, 5 Nov 2024 09:57:21 +0100 Subject: [PATCH 1/8] fix: switch from placeholder: to data-placeholder: prefix class for SelectValue --- apps/www/src/lib/registry/default/ui/select/SelectTrigger.vue | 2 +- apps/www/src/lib/registry/new-york/ui/select/SelectTrigger.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/www/src/lib/registry/default/ui/select/SelectTrigger.vue b/apps/www/src/lib/registry/default/ui/select/SelectTrigger.vue index 97c35149..6b35be4a 100644 --- a/apps/www/src/lib/registry/default/ui/select/SelectTrigger.vue +++ b/apps/www/src/lib/registry/default/ui/select/SelectTrigger.vue @@ -19,7 +19,7 @@ const forwardedProps = useForwardProps(delegatedProps) diff --git a/apps/www/src/lib/registry/new-york/ui/select/SelectTrigger.vue b/apps/www/src/lib/registry/new-york/ui/select/SelectTrigger.vue index d2df9164..892dc352 100644 --- a/apps/www/src/lib/registry/new-york/ui/select/SelectTrigger.vue +++ b/apps/www/src/lib/registry/new-york/ui/select/SelectTrigger.vue @@ -19,7 +19,7 @@ const forwardedProps = useForwardProps(delegatedProps) From 4ed4c6a34fea6971b44183cd5841d1a06bd8c92c Mon Sep 17 00:00:00 2001 From: sadeghbarati Date: Sat, 9 Nov 2024 08:31:15 +0330 Subject: [PATCH 2/8] chore: build registry --- apps/www/src/public/registry/styles/default/select.json | 2 +- apps/www/src/public/registry/styles/default/sidebar.json | 2 +- apps/www/src/public/registry/styles/new-york/select.json | 2 +- apps/www/src/public/registry/styles/new-york/sidebar.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/www/src/public/registry/styles/default/select.json b/apps/www/src/public/registry/styles/default/select.json index 940c820f..7aa71251 100644 --- a/apps/www/src/public/registry/styles/default/select.json +++ b/apps/www/src/public/registry/styles/default/select.json @@ -43,7 +43,7 @@ }, { "name": "SelectTrigger.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "SelectValue.vue", diff --git a/apps/www/src/public/registry/styles/default/sidebar.json b/apps/www/src/public/registry/styles/default/sidebar.json index 4a1f6151..cb945b76 100644 --- a/apps/www/src/public/registry/styles/default/sidebar.json +++ b/apps/www/src/public/registry/styles/default/sidebar.json @@ -62,7 +62,7 @@ }, { "name": "SidebarMenuAction.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "SidebarMenuBadge.vue", diff --git a/apps/www/src/public/registry/styles/new-york/select.json b/apps/www/src/public/registry/styles/new-york/select.json index 48093cd2..db65af3e 100644 --- a/apps/www/src/public/registry/styles/new-york/select.json +++ b/apps/www/src/public/registry/styles/new-york/select.json @@ -43,7 +43,7 @@ }, { "name": "SelectTrigger.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "SelectValue.vue", diff --git a/apps/www/src/public/registry/styles/new-york/sidebar.json b/apps/www/src/public/registry/styles/new-york/sidebar.json index 83f5bc7c..be0ccf58 100644 --- a/apps/www/src/public/registry/styles/new-york/sidebar.json +++ b/apps/www/src/public/registry/styles/new-york/sidebar.json @@ -62,7 +62,7 @@ }, { "name": "SidebarMenuAction.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "SidebarMenuBadge.vue", From cb116f5547e1eea604bd3bbada14fef25295fbb8 Mon Sep 17 00:00:00 2001 From: Damien Roche Date: Thu, 5 Dec 2024 12:15:53 +0100 Subject: [PATCH 3/8] fix: disabled prop for input --- .../lib/registry/new-york/ui/auto-form/AutoFormFieldInput.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/www/src/lib/registry/new-york/ui/auto-form/AutoFormFieldInput.vue b/apps/www/src/lib/registry/new-york/ui/auto-form/AutoFormFieldInput.vue index 2c8676b6..f3892998 100644 --- a/apps/www/src/lib/registry/new-york/ui/auto-form/AutoFormFieldInput.vue +++ b/apps/www/src/lib/registry/new-york/ui/auto-form/AutoFormFieldInput.vue @@ -23,7 +23,7 @@ const inputComponent = computed(() => props.config?.component === 'textarea' ? T :is="inputComponent" type="text" v-bind="{ ...slotProps.componentField, ...config?.inputProps }" - :disabled="disabled" + :disabled="config?.inputProps?.disabled ?? disabled" /> From 3c990aa95387b759e3f0ed4e215ab0a231273235 Mon Sep 17 00:00:00 2001 From: Damien Roche Date: Tue, 17 Dec 2024 08:52:46 +0100 Subject: [PATCH 4/8] fix: update default AutFormFieldInput --- .../lib/registry/default/ui/auto-form/AutoFormFieldInput.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldInput.vue b/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldInput.vue index 6e18433d..685f6c50 100644 --- a/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldInput.vue +++ b/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldInput.vue @@ -23,7 +23,7 @@ const inputComponent = computed(() => props.config?.component === 'textarea' ? T :is="inputComponent" type="text" v-bind="{ ...slotProps.componentField, ...config?.inputProps }" - :disabled="disabled" + :disabled="config?.inputProps?.disabled ?? disabled" /> From 86d265dee4d20d767418896f72c191df012fe1fc Mon Sep 17 00:00:00 2001 From: Damien Roche Date: Tue, 17 Dec 2024 09:01:32 +0100 Subject: [PATCH 5/8] fix: disabled on field number --- .../lib/registry/default/ui/auto-form/AutoFormFieldNumber.vue | 2 +- .../lib/registry/new-york/ui/auto-form/AutoFormFieldNumber.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldNumber.vue b/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldNumber.vue index b978ff25..f08a1a9f 100644 --- a/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldNumber.vue +++ b/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldNumber.vue @@ -20,7 +20,7 @@ defineProps() - + diff --git a/apps/www/src/lib/registry/new-york/ui/auto-form/AutoFormFieldNumber.vue b/apps/www/src/lib/registry/new-york/ui/auto-form/AutoFormFieldNumber.vue index 873f4dba..59acf23d 100644 --- a/apps/www/src/lib/registry/new-york/ui/auto-form/AutoFormFieldNumber.vue +++ b/apps/www/src/lib/registry/new-york/ui/auto-form/AutoFormFieldNumber.vue @@ -20,7 +20,7 @@ defineProps() - + From 0c77d1943f10c662f428dfcf510102d089c0c1cf Mon Sep 17 00:00:00 2001 From: Damien Roche Date: Tue, 17 Dec 2024 09:19:21 +0100 Subject: [PATCH 6/8] fix: add disabled support for boolean --- .../ui/auto-form/AutoFormFieldBoolean.vue | 4 ++-- .../lib/registry/default/ui/auto-form/utils.ts | 17 +++++++++++++++++ .../ui/auto-form/AutoFormFieldBoolean.vue | 4 ++-- .../lib/registry/new-york/ui/auto-form/utils.ts | 17 +++++++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldBoolean.vue b/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldBoolean.vue index e6bb6a25..81b9d6e3 100644 --- a/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldBoolean.vue +++ b/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldBoolean.vue @@ -5,7 +5,7 @@ import { FormControl, FormDescription, FormField, FormItem, FormMessage } from ' import { Switch } from '@/lib/registry/default/ui/switch' import { computed } from 'vue' import AutoFormLabel from './AutoFormLabel.vue' -import { beautifyObjectName } from './utils' +import { beautifyObjectName, maybeBooleanishToBoolean } from './utils' const props = defineProps() @@ -21,7 +21,7 @@ const booleanComponent = computed(() => props.config?.component === 'switch' ? S diff --git a/apps/www/src/lib/registry/default/ui/auto-form/utils.ts b/apps/www/src/lib/registry/default/ui/auto-form/utils.ts index 1fa3a296..160a4dfe 100644 --- a/apps/www/src/lib/registry/default/ui/auto-form/utils.ts +++ b/apps/www/src/lib/registry/default/ui/auto-form/utils.ts @@ -169,3 +169,20 @@ export function getFromPath( return resolvedValue as TValue | undefined } + +type Booleanish = boolean | 'true' | 'false' + +export function booleanishToBoolean(value: Booleanish) { + switch (value) { + case 'true': + case true: + return true + case 'false': + case false: + return false + } +} + +export function maybeBooleanishToBoolean(value?: Booleanish) { + return value ? booleanishToBoolean(value) : undefined +} diff --git a/apps/www/src/lib/registry/new-york/ui/auto-form/AutoFormFieldBoolean.vue b/apps/www/src/lib/registry/new-york/ui/auto-form/AutoFormFieldBoolean.vue index 40fee8cc..21bfbd2b 100644 --- a/apps/www/src/lib/registry/new-york/ui/auto-form/AutoFormFieldBoolean.vue +++ b/apps/www/src/lib/registry/new-york/ui/auto-form/AutoFormFieldBoolean.vue @@ -5,7 +5,7 @@ import { FormControl, FormDescription, FormField, FormItem, FormMessage } from ' import { Switch } from '@/lib/registry/new-york/ui/switch' import { computed } from 'vue' import AutoFormLabel from './AutoFormLabel.vue' -import { beautifyObjectName } from './utils' +import { beautifyObjectName, maybeBooleanishToBoolean } from './utils' const props = defineProps() @@ -21,7 +21,7 @@ const booleanComponent = computed(() => props.config?.component === 'switch' ? S diff --git a/apps/www/src/lib/registry/new-york/ui/auto-form/utils.ts b/apps/www/src/lib/registry/new-york/ui/auto-form/utils.ts index 1fa3a296..160a4dfe 100644 --- a/apps/www/src/lib/registry/new-york/ui/auto-form/utils.ts +++ b/apps/www/src/lib/registry/new-york/ui/auto-form/utils.ts @@ -169,3 +169,20 @@ export function getFromPath( return resolvedValue as TValue | undefined } + +type Booleanish = boolean | 'true' | 'false' + +export function booleanishToBoolean(value: Booleanish) { + switch (value) { + case 'true': + case true: + return true + case 'false': + case false: + return false + } +} + +export function maybeBooleanishToBoolean(value?: Booleanish) { + return value ? booleanishToBoolean(value) : undefined +} From f4684033f17328568253e8767ee2ffe3dca2c0a8 Mon Sep 17 00:00:00 2001 From: Damien Roche Date: Tue, 17 Dec 2024 09:27:11 +0100 Subject: [PATCH 7/8] fix: support disabled for date + enum --- .../lib/registry/default/ui/auto-form/AutoFormFieldDate.vue | 4 ++-- .../lib/registry/default/ui/auto-form/AutoFormFieldEnum.vue | 6 +++--- .../registry/new-york/ui/auto-form/AutoFormFieldDate.vue | 4 ++-- .../registry/new-york/ui/auto-form/AutoFormFieldEnum.vue | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldDate.vue b/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldDate.vue index 161144db..df230c11 100644 --- a/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldDate.vue +++ b/apps/www/src/lib/registry/default/ui/auto-form/AutoFormFieldDate.vue @@ -9,7 +9,7 @@ import { cn } from '@/lib/utils' import { DateFormatter, getLocalTimeZone } from '@internationalized/date' import { CalendarIcon } from 'lucide-vue-next' import AutoFormLabel from './AutoFormLabel.vue' -import { beautifyObjectName } from './utils' +import { beautifyObjectName, maybeBooleanishToBoolean } from './utils' defineProps() @@ -28,7 +28,7 @@ const df = new DateFormatter('en-US', {
- +