From e555e4ece056f61b05d5fc424fa43af986d7bb45 Mon Sep 17 00:00:00 2001 From: Chirag Chhatrala Date: Fri, 3 Jan 2025 16:02:38 +0530 Subject: [PATCH] Refactor form components and update Tailwind configuration - Removed unused box shadow styles from tailwind.config.js. - Enhanced DateInput, FileInput, MatrixInput, RichTextAreaInput, and VSelect components with improved styling and error handling. - Updated theme settings in form-themes.js to include new styles for MatrixInput and other form elements. - Adjusted labels in FieldOptions.vue for clarity. - Improved overall UI consistency and responsiveness across form components. --- client/components/forms/DateInput.vue | 6 +- client/components/forms/FileInput.vue | 1 + client/components/forms/MatrixInput.vue | 19 ++- .../forms/RichTextAreaInput.client.vue | 24 ++- .../components/forms/components/VSelect.vue | 93 +++++------ .../form-components/FormCustomization.vue | 2 +- .../forms/fields/components/FieldOptions.vue | 2 +- client/lib/forms/themes/form-themes.js | 146 ++++++++++-------- client/tailwind.config.js | 6 +- 9 files changed, 175 insertions(+), 124 deletions(-) diff --git a/client/components/forms/DateInput.vue b/client/components/forms/DateInput.vue index 912c333c6..52156168e 100644 --- a/client/components/forms/DateInput.vue +++ b/client/components/forms/DateInput.vue @@ -59,7 +59,7 @@ - - [] } }) + const emit = defineEmits(['update:modelValue']) + const { compVal, inputStyle, hasError, inputWrapperProps } = useFormInput(props, { emit }) const editor = ref(null) const mentionState = ref(null) @@ -91,6 +97,7 @@ const quillOptions = computed(() => { ] } } + const mergedOptions = { ...defaultOptions, ...props.editorOptions, modules: { ...defaultOptions.modules, ...props.editorOptions.modules } } if (props.enableMentions) { @@ -112,21 +119,26 @@ const quillOptions = computed(() => { border-right: 0px !important; border-left: 0px !important; font-size: var(--font-size); + .ql-editor { min-height: 100px !important; } } + .ql-toolbar { border-top: 0px !important; border-right: 0px !important; border-left: 0px !important; } + .ql-header { @apply rounded-md; } + .ql-editor.ql-blank:before { @apply text-gray-400 dark:text-gray-500 not-italic; } + .ql-snow .ql-toolbar .ql-picker-item.ql-selected, .ql-snow .ql-toolbar .ql-picker-item:hover, .ql-snow .ql-toolbar .ql-picker-label.ql-active, @@ -144,14 +156,16 @@ const quillOptions = computed(() => { @apply text-nt-blue; } } + .ql-mention { padding-top: 0px !important; - margin-top: -5px !important; } .ql-mention::after { content: '@'; font-size: 16px; } + + .rich-editor, .mention-input { span[mention] { @apply inline-flex items-center align-baseline leading-tight text-sm relative bg-blue-100 text-blue-800 border border-blue-200 rounded-md px-1 py-0.5 mx-0.5; diff --git a/client/components/forms/components/VSelect.vue b/client/components/forms/components/VSelect.vue index 3e65b6080..dc851723a 100644 --- a/client/components/forms/components/VSelect.vue +++ b/client/components/forms/components/VSelect.vue @@ -13,7 +13,7 @@ { '!ring-red-500 !ring-2 !border-transparent': hasError, '!cursor-not-allowed !bg-gray-200 dark:!bg-gray-800': disabled, - 'focus-within:ring-2 focus-within:ring-opacity-100 focus-within:border-transparent': !hasError + 'focus-within:ring-2 focus-within:ring-opacity-100 focus-within:border-transparent': !hasError && !disabled }, inputClass ]" @@ -78,9 +78,13 @@
- +