element_comboLookupEdit.erl 1.0 KB

12345678910111213141516171819202122232425262728
  1. -module(element_comboLookupEdit).
  2. -include_lib("nitro/include/comboLookupEdit.hrl").
  3. -include_lib("nitro/include/comboLookup.hrl").
  4. -include_lib("nitro/include/nitro.hrl").
  5. -include_lib("nitro/include/event.hrl").
  6. -export([render_element/1]).
  7. render_element(#comboLookupEdit{id=Id, input=Input, disabled=Disabled, validation=Validation, form=Form}) ->
  8. InputId = element(#element.id, Input),
  9. nitro:render(
  10. #panel{
  11. id = Id,
  12. validation = Validation,
  13. data_fields = [{<<"data-edit-input">>,<<"data-edit-input">>}],
  14. body = [
  15. #panel{
  16. style = "display: flex; position: relative; width: 100%; justify-content: center;",
  17. body =
  18. [ Input,
  19. case Disabled of
  20. true -> [];
  21. _ ->
  22. #panel{
  23. id = form:atom([InputId, "form"]),
  24. class = ['dropdown-content'],
  25. body = #panel{class = ['dropdown-item'], body = Form}
  26. } end ]}
  27. ]}).