2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-05-06 18:09:44 +02:00
|
|
|
class EditableChamp::AnnuaireEducationComponent < EditableChamp::EditableChampBaseComponent
|
2023-08-21 16:18:31 +02:00
|
|
|
def dsfr_input_classname
|
2024-05-06 18:09:44 +02:00
|
|
|
'fr-select'
|
2023-08-21 16:18:31 +02:00
|
|
|
end
|
2024-04-12 07:57:27 +02:00
|
|
|
|
2024-05-06 18:09:44 +02:00
|
|
|
def react_props
|
|
|
|
react_input_opts(id: @champ.input_id,
|
|
|
|
class: "fr-mt-1w",
|
|
|
|
name: @form.field_name(:external_id),
|
|
|
|
selected_key: @champ.external_id,
|
|
|
|
items: @champ.selected_items,
|
2024-07-12 17:31:38 +02:00
|
|
|
loader: 'https://data.education.gouv.fr/api/records/1.0/search?dataset=fr-en-annuaire-education&rows=5',
|
|
|
|
coerce: 'AnnuaireEducation',
|
2024-07-12 16:30:43 +02:00
|
|
|
debounce: 500,
|
|
|
|
minimum_input_length: 5)
|
2024-04-12 07:57:27 +02:00
|
|
|
end
|
2022-08-12 10:45:04 +02:00
|
|
|
end
|