import { html, when } from '@microsoft/fast-element';
import { JSONForms } from './jsonforms/json-forms';
import { ControlWrapper } from './jsonforms/renderers/ControlWrapperRenderer';
import { DispatchRenderer } from './jsonforms/renderers/dispatch-renderer';
JSONForms;
ControlWrapper;
DispatchRenderer;
export const foundationFormTemplate = html `
  <template>
    <json-forms
      ?readonly=${(x) => x.readonly}
      ?submitted=${(x) => x.submitted}
      :renderers=${(x) => x.renderers}
      :uischema=${(x) => x.uischema}
      :schema=${(x) => x.jsonSchema}
      :data=${(x) => x.data}
      @data-change=${(x, c) => x.onChange(c.event)}
    ></json-forms>
    ${when((x) => !x.readonly, html `
        <div class="actions">
          <div class="errors">${(x) => x.submissionErrors}</div>
          <fast-button
            @click="${(x) => x._submit()}"
            ?disable=${(x) => !x.submitting}
            class="submit-button"
            appearance="accent"
          >
            Submit
          </fast-button>
        </div>
      `)}
  </template>
`;
//# sourceMappingURL=form.template.js.map