{"version":3,"file":"date-time-input.mjs","names":[],"sources":["../../../../src/web-components/catalog/basic/date-time-input.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { DateTimeInputApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { createLitComponent } from \"../../adapter\";\nimport { uniqueId } from \"./ids\";\nimport { LEAF_MARGIN, STANDARD_BORDER, STANDARD_RADIUS } from \"./utils\";\n\nexport const DateTimeInput = createLitComponent(\n  DateTimeInputApi,\n  ({ props }) => {\n    const inputId = uniqueId(\"datetime\");\n    let type = \"datetime-local\";\n    if (props.enableDate && !props.enableTime) type = \"date\";\n    if (!props.enableDate && props.enableTime) type = \"time\";\n    return html`\n    <div\n      style=${styleMap({\n        display: \"flex\",\n        flexDirection: \"column\",\n        gap: \"4px\",\n        width: \"100%\",\n        margin: LEAF_MARGIN,\n      })}\n    >\n      ${\n        props.label\n          ? html`<label\n            for=${inputId}\n            style=\"font-size: 14px; font-weight: bold;\"\n            >${props.label}</label\n          >`\n          : nothing\n      }\n      <input\n        id=${inputId}\n        type=${type}\n        style=${styleMap({\n          padding: \"8px\",\n          width: \"100%\",\n          border: STANDARD_BORDER,\n          borderRadius: STANDARD_RADIUS,\n          boxSizing: \"border-box\",\n        })}\n        .value=${props.value || \"\"}\n        min=${typeof props.min === \"string\" ? props.min : \"\"}\n        max=${typeof props.max === \"string\" ? props.max : \"\"}\n        @input=${(e: Event) =>\n          props.setValue((e.target as HTMLInputElement).value)}\n      />\n    </div>\n  `;\n  },\n);\n"],"mappings":";;;;;;;;AAOA,MAAa,gBAAgB,mBAC3B,mBACC,EAAE,YAAY;CACb,MAAM,UAAU,SAAS,WAAW;CACpC,IAAI,OAAO;AACX,KAAI,MAAM,cAAc,CAAC,MAAM,WAAY,QAAO;AAClD,KAAI,CAAC,MAAM,cAAc,MAAM,WAAY,QAAO;AAClD,QAAO,IAAI;;cAED,SAAS;EACf,SAAS;EACT,eAAe;EACf,KAAK;EACL,OAAO;EACP,QAAQ;EACT,CAAC,CAAC;;QAGD,MAAM,QACF,IAAI;kBACE,QAAQ;;eAEX,MAAM,MAAM;eAEf,QACL;;aAEM,QAAQ;eACN,KAAK;gBACJ,SAAS;EACf,SAAS;EACT,OAAO;EACP,QAAQ;EACR,cAAc;EACd,WAAW;EACZ,CAAC,CAAC;iBACM,MAAM,SAAS,GAAG;cACrB,OAAO,MAAM,QAAQ,WAAW,MAAM,MAAM,GAAG;cAC/C,OAAO,MAAM,QAAQ,WAAW,MAAM,MAAM,GAAG;kBAC3C,MACR,MAAM,SAAU,EAAE,OAA4B,MAAM,CAAC;;;;EAK9D"}