Provide backend implementation of some svelte custom elements (svelecte and svelty-picker)
composer require mskocik/formsextensions:ext.forms:Mskocik\Forms\Bridges\NetteDI\FormsExtensionIf you are using nette/forms standalone, call control registration manually:
\Mskocik\Forms\Bridges\NetteDI\FormsExtension::init()Extend Nette\Application\UI\Form (or Nette\Forms\Form if using standalone forms) and also Nette\Forms\Container with extended PHPDoc block:
<?phpdeclare(strict_types=1);
useNette\Application\UI\Form;
useNette\Forms\Container;
/** * @method SveltyPicker addDatePicker(string $name, ?string $label = null, ?string $format = null) * @method SvelecteSelect addSvelecteSelect(string $name, ?string $label = null, ?array $items = null) * @method SvelecteMultiSelect addSvelecteMultiSelect(string $name, ?string $label = null, ?array $items = null) */class AppForm extends Form
{}
/** * @method SveltyPicker addDatePicker(string $name, ?string $label = null, ?string $format = null) * @method SvelecteSelect addSvelecteSelect(string $name, ?string $label = null, ?array $items = null) * @method SvelecteMultiSelect addSvelecteMultiSelect(string $name, ?string $label = null, ?array $items = null) */class AppFormContainer extends Container
{}$form = newForm();
$form->addSvelecteSelect('select', 'My Select', [/** item array */])
->setFetch($presenter->link('Api:fetch', ['id' => '[query]']))
->setRequired();
// ...