new functionality: Add project coding configuration feature for projects
This commit is contained in:
@@ -22,17 +22,33 @@ class CodeEdit extends Component
|
||||
'maxLength' => 'required|integer|min:2|max:12',
|
||||
];
|
||||
|
||||
public function mount($componentId, $initialName = '')
|
||||
public function mount($componentId, $initialName = '', $initialMaxLength = 3, $initialDocumentTypes = [])
|
||||
{
|
||||
$this->componentId = $componentId;
|
||||
$this->name = $initialName;
|
||||
$this->maxLength = 3;
|
||||
$this->maxLength = $initialMaxLength;
|
||||
$this->documentTypes = $initialDocumentTypes;
|
||||
|
||||
// Disparar evento inicial para establecer el nombre
|
||||
// Guardar datos iniciales
|
||||
$this->initialData = [
|
||||
'name' => $initialName,
|
||||
'maxLength' => $initialMaxLength,
|
||||
'documentTypes' => $initialDocumentTypes
|
||||
];
|
||||
|
||||
// Disparar eventos iniciales
|
||||
$this->dispatch('nameUpdated',
|
||||
componentId: $this->componentId,
|
||||
data: [
|
||||
'name' => $this->name
|
||||
'name' => $this->name,
|
||||
]
|
||||
);
|
||||
|
||||
$this->dispatch('componentUpdated',
|
||||
componentId: $this->componentId,
|
||||
data: [
|
||||
'documentTypes' => $this->documentTypes,
|
||||
'maxLength' => $this->maxLength
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -74,7 +90,7 @@ class CodeEdit extends Component
|
||||
$this->documentTypes[] = [
|
||||
'code' => $this->codeInput,
|
||||
'label' => $this->labelInput,
|
||||
'max_length' => $this->maxLength,
|
||||
//'max_length' => $this->maxLength,
|
||||
];
|
||||
|
||||
$this->sortList();
|
||||
|
||||
Reference in New Issue
Block a user