new functionality: Add project coding configuration feature for projects
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled

This commit is contained in:
2025-12-09 23:02:35 +01:00
parent 7b00887372
commit e42ce8b092
13 changed files with 1169 additions and 28 deletions

View File

@@ -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();