//~OPTIONS
{
  clientRendering:  true,
  lockTemplate:     false,
  autoUpdate:       false,
}

//~ARGUMENTS
{
  value:        undefined,
  defaultValue: undefined,
  defaultFlag:  true,
}

//~TEMPLATE
<table @{{!fcf.empty(args.width) ? `width="${args.width}" ` : ""}}@>
<tr>
  <td @{{!fcf.empty(args.width) ? `width="${args.width}" ` : ""}}@>
  %{{
    let view        = fcf.filter(args, (key)=>{ return key.indexOf("fcf") != 0; });
    if (view.args)
      delete view.args.value;
    delete view.value;

    let elementArgs = fcf.map(view, (key)=>{ return [key, fcf.argRef(key)] });
    elementArgs.value        = fcf.argRef("value");
    elementArgs.defaultValue = fcf.argRef("defaultValue");
    elementArgs.defaultFlag  = fcf.argRef("defaultFlag");
    delete elementArgs.template;
  }}%
  @{{
    render.view({
      view:   view,
      record: [],
      args:   elementArgs,
      mode:   args.mode,
    });
  }}@
  </td>
  <td>
    <span style="font-size:1.2em;">@{{ args.defaultFlag ? "&#128435;" : "&#128393;" }}@</span>
  </td>
  %{{ if (!args.defaultFlag) { }}%
  <td>
    <span style="font-size:1.2em; cursor:pointer"  fcfEventClick="wrapper.onClear()"> &#128465; </span>
  </td>
  %{{ } }}%
</tr>
</table>
