@copilotkit/a2ui-renderer
Version:
A2UI Renderer for CopilotKit - render A2UI surfaces in React applications
1 lines • 2.51 kB
Source Map (JSON)
{"version":3,"file":"date-time-input.cjs","names":["createLitComponent","DateTimeInputApi","uniqueId","LEAF_MARGIN","nothing","STANDARD_BORDER","STANDARD_RADIUS"],"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,gBAAgBA,mCAC3BC,qDACC,EAAE,YAAY;CACb,MAAM,UAAUC,qBAAS,WAAW;CACpC,IAAI,OAAO;AACX,KAAI,MAAM,cAAc,CAAC,MAAM,WAAY,QAAO;AAClD,KAAI,CAAC,MAAM,cAAc,MAAM,WAAY,QAAO;AAClD,QAAO,QAAI;;wDAEQ;EACf,SAAS;EACT,eAAe;EACf,KAAK;EACL,OAAO;EACP,QAAQC;EACT,CAAC,CAAC;;QAGD,MAAM,QACF,QAAI;kBACE,QAAQ;;eAEX,MAAM,MAAM;eAEfC,YACL;;aAEM,QAAQ;eACN,KAAK;0DACK;EACf,SAAS;EACT,OAAO;EACP,QAAQC;EACR,cAAcC;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"}