UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

56 lines (54 loc) 1.61 kB
/** * WARNING: This file is intended to be used within MySheerID. * This file is not intended for use in other contexts and there are no guarantees about its behavior outside of MySheerID. */ /** * VERSION: 2.230.0-alpha.0 * BUILD_TIMESTAMP: 1778694697559 * BUILD_DATE: Wed May 13 2026 17:51:37 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: 7af1c105d5485ac4ed1190c56d492bb4590667a9 */ import { i as h, g as r, R as I, j as t, F as o } from "../_mysheerid-preview.js"; import { F as S } from "./FormFieldInputSelect-CjWY_ush.js"; const j = ({ value: a, isErrored: f, errorId: c = "invalidStatus", options: e, onChange: d, intl: g, placeholder: i = "", onKeyDown: m = void 0, segmentId: l, disabled: F = !1 }) => { const n = `${l}-status`, u = e.length === 1, M = r("status")?.hidden || r("statuses")?.hidden; return I.useEffect(() => { u && d(e[0]); }, []), u || M ? null : /* @__PURE__ */ t.jsx( S, { fieldId: n, options: e, onChange: (s) => d(s), onKeyDown: m, value: e.find((s) => s.value === (a && a.value)), placeholder: i || g.formatHTMLMessage({ id: "statusPlaceholder", defaultMessage: "Status" }), showPlaceholderAndHideLabel: !!i, isRequired: !0, containerId: `sid-${n}`, label: /* @__PURE__ */ t.jsx(o, { id: "status", defaultMessage: "Status" }), disabled: F, errorMessage: f && /* @__PURE__ */ t.jsx( o, { id: `errorId.${c}`, defaultMessage: `Invalid ${l} status` } ) } ); }, v = h(j); export { v as S };