import { h } from "@stencil/core";
export const buildDecimal = ({ name, label, readOnly, props, contextName, canShowError }) => {
  var _a, _b;
  const precision = Number((_a = props === null || props === void 0 ? void 0 : props.precision) !== null && _a !== void 0 ? _a : 2);
  const prettyPrecision = Number((_b = props === null || props === void 0 ? void 0 : props.prettyPrecision) !== null && _b !== void 0 ? _b : precision);
  return buildNumeric(name, label, readOnly, precision, prettyPrecision, contextName, canShowError);
};
export const buildInteger = ({ name, label, readOnly, contextName, canShowError }) => {
  return buildNumeric(name, label, readOnly, 0, 0, contextName, canShowError);
};
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision, contextName, canShowError) {
  return (h("div", { class: "ez-col ez-col--sd-12" }, h("ez-number-input", { class: "ez-input__no-margin", enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName, canShowError: canShowError })));
}
