import { h } from "@stencil/core";
export const buildComboBox = ({ name, label, readOnly, required, props, contextName, canShowError }) => {
  const prop = props === null || props === void 0 ? void 0 : props.options;
  let options;
  if (typeof prop === "string") {
    const parsed = JSON.parse(prop);
    options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
  }
  else {
    options = prop;
  }
  return (h("div", { class: "ez-col ez-col--sd-12" }, h("ez-combo-box", { class: "ez-input__no-margin", enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, options: options, canShowError: canShowError })));
};
