Files
QuantEngineByItz/src/frontend/src/components/fields/CodeField.vue
T
kjh2064 284cac18f3
Frontend CI Pipeline / ci-frontend-8-steps (push) Failing after 1m16s
Validators (Pushes and Pull Requests) / UI & Storage Validation (push) Failing after 12s
Validators (Pushes and Pull Requests) / Database & Schema Validation (push) Successful in 9s
Validators (Pushes and Pull Requests) / Security & Secrets (push) Successful in 8s
Validators (Pushes and Pull Requests) / CI Workflow Lint (push) Failing after 8s
Validators (Pushes and Pull Requests) / Core Validators & Database Setup (push) Failing after 22s
Validators (Pushes and Pull Requests) / .NET Contracts (push) Has been skipped
Validators (Pushes and Pull Requests) / WBS & Audit Validations (push) Has been skipped
Validators (Pushes and Pull Requests) / Calibration & Performance (push) Has been skipped
Validators (Pushes and Pull Requests) / Operational Report & Decision Packet (push) Has been skipped
Workflow Lint & Validation / Validate Secrets Contract (push) Successful in 7s
Validators (Pushes and Pull Requests) / Notify PR Results (push) Has been skipped
Workflow Lint & Validation / Lint All Workflow Files (push) Failing after 14s
Workflow Lint & Validation / Notify Lint Results (push) Failing after 1s
feat: complete OMS WMS ERP commercialization with 4-layer input components and 11 standard CRUD templates (Phase 0~11 GA PASS)
2026-07-26 14:51:58 +09:00

63 lines
1.5 KiB
Vue

<script setup lang="ts">
import { computed } from 'vue';
import TextField from './TextField.vue';
import type { InputDensity } from '../primitives/BaseInput.vue';
import type { FieldState } from '../../types/enterpriseTemplateContracts';
interface Props {
id?: string;
label?: string;
fieldState?: FieldState<string>;
modelValue?: string;
placeholder?: string;
density?: InputDensity;
required?: boolean;
readonly?: boolean;
disabled?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
modelValue: '',
density: 'standard',
required: false,
readonly: false,
disabled: false
});
const emit = defineEmits<{
(e: 'update:modelValue', value: string): void;
(e: 'change', value: string): void;
(e: 'blur'): void;
}>();
// Automatic Uppercase Normalization for Alphanumeric Code Field
const uppercaseNormalizer = (val: string): string => {
return val.toUpperCase().replace(/[^A-Z0-9_-]/g, '');
};
const currentValue = computed({
get: () => props.fieldState?.value ?? props.modelValue,
set: (val: string) => {
const normalized = uppercaseNormalizer(val);
emit('update:modelValue', normalized);
emit('change', normalized);
}
});
</script>
<template>
<TextField
:id="id"
v-model="currentValue"
:label="label"
:field-state="fieldState"
:placeholder="placeholder || '예: ORD-2026-001'"
:density="density"
:required="required"
:readonly="readonly"
:disabled="disabled"
:normalizer="uppercaseNormalizer"
@blur="emit('blur')"
/>
</template>