2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-03-21 14:44:03 +01:00
|
|
|
class EditableChamp::CommunesComponent < EditableChamp::EditableChampBaseComponent
|
|
|
|
include ApplicationHelper
|
2024-04-11 09:06:14 +02:00
|
|
|
|
|
|
|
def dsfr_input_classname
|
|
|
|
'fr-select'
|
|
|
|
end
|
2024-05-06 21:44:41 +02:00
|
|
|
|
|
|
|
def react_props
|
|
|
|
react_input_opts(id: @champ.input_id,
|
|
|
|
class: 'fr-mt-1w',
|
|
|
|
name: @form.field_name(:code),
|
|
|
|
selected_key: @champ.selected,
|
|
|
|
items: @champ.selected_items,
|
|
|
|
loader: data_sources_data_source_commune_path(with_combined_code: true),
|
|
|
|
limit: 20,
|
|
|
|
minimum_input_length: 2)
|
|
|
|
end
|
2022-08-12 10:45:04 +02:00
|
|
|
end
|