From e2b797c03d7abfcbcd79330cd7f696df8ae4f21c Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sun, 26 Jul 2026 02:54:06 +0900 Subject: [PATCH] refactor(frontend): implement Full Transparent Wrapper Pattern with v-bind=\ and \ passthrough to expose 100% PrimeVue native capabilities without feature loss --- src/frontend/src/components/QuantComboBox.vue | 26 ++++++++++++++-- src/frontend/src/components/QuantDataGrid.vue | 16 ++++++++-- src/frontend/src/components/QuantInput.vue | 31 +++++++++---------- .../src/components/QuantMasterGrid.vue | 16 ++++++++-- 4 files changed, 66 insertions(+), 23 deletions(-) diff --git a/src/frontend/src/components/QuantComboBox.vue b/src/frontend/src/components/QuantComboBox.vue index a82d1b52..2f16addf 100644 --- a/src/frontend/src/components/QuantComboBox.vue +++ b/src/frontend/src/components/QuantComboBox.vue @@ -1,7 +1,11 @@ - + @@ -19,12 +31,20 @@ import { computed } from 'vue'; import Select from 'primevue/select'; +defineOptions({ + inheritAttrs: false +}); + const props = defineProps<{ id?: string; + label?: string; modelValue?: string | number; options: Array; placeholder?: string; + required?: boolean; disabled?: boolean; + showClear?: boolean; + filter?: boolean; }>(); const emit = defineEmits(['update:modelValue', 'change']); diff --git a/src/frontend/src/components/QuantDataGrid.vue b/src/frontend/src/components/QuantDataGrid.vue index e8d9d61f..0fe64e35 100644 --- a/src/frontend/src/components/QuantDataGrid.vue +++ b/src/frontend/src/components/QuantDataGrid.vue @@ -1,14 +1,17 @@ - + + + + + @@ -23,6 +29,10 @@ import { computed } from 'vue'; import InputText from 'primevue/inputtext'; +defineOptions({ + inheritAttrs: false +}); + const props = defineProps<{ id?: string; label?: string; @@ -37,7 +47,6 @@ const props = defineProps<{ const emit = defineEmits(['update:modelValue', 'change']); const isNumeric = computed(() => props.type === 'number'); - const inputType = computed(() => (isNumeric.value ? 'text' : props.type || 'text')); const displayValue = computed(() => { @@ -47,37 +56,27 @@ const displayValue = computed(() => { const onKeyDown = (e: KeyboardEvent) => { if (!isNumeric.value) return; - const allowedKeys = [ 'Backspace', 'Delete', 'Tab', 'Escape', 'Enter', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End', '.', '-' ]; - - if (allowedKeys.includes(e.key) || e.ctrlKey || e.metaKey) { - return; - } - - if (!/^[0-9]$/.test(e.key)) { - e.preventDefault(); - } + if (allowedKeys.includes(e.key) || e.ctrlKey || e.metaKey) return; + if (!/^[0-9]$/.test(e.key)) e.preventDefault(); }; const onPaste = (e: ClipboardEvent) => { if (!isNumeric.value) return; - const pasteData = e.clipboardData?.getData('text') || ''; if (/[^0-9.-]/g.test(pasteData)) { e.preventDefault(); - const sanitized = pasteData.replace(/[^0-9.-]/g, ''); - onInput(sanitized); + onInput(pasteData.replace(/[^0-9.-]/g, '')); } }; const onInput = (val: string | undefined) => { let finalVal = val ?? ''; if (isNumeric.value) { - // 숫자가 아닌 모든 문자 원천 정제 finalVal = finalVal.replace(/[^0-9.-]/g, ''); } emit('update:modelValue', finalVal); diff --git a/src/frontend/src/components/QuantMasterGrid.vue b/src/frontend/src/components/QuantMasterGrid.vue index 3bbfbf15..024db191 100644 --- a/src/frontend/src/components/QuantMasterGrid.vue +++ b/src/frontend/src/components/QuantMasterGrid.vue @@ -1,10 +1,13 @@ - + + + +