|
- import{c as e,g as T}from"./helpers-DemszZkW.js";import{c as s}from"./LabelFormCentricComponent-DldnRP_r.js";import{c as C}from"./InputCheckboxRadioComponent-BUByQ9fr.js";import{c as re,I as te}from"./InputSelectComponent-_Ezyl0h8.js";import"./iframe-CLehcUMy.js";import"./preload-helper-C1FmrZbK.js";import"./ButtonComponent-C1nc5If8.js";const ne=({wrapperClasses:F="form-element-form-centric",name:c="name",id:t=null,id2:v=null,inputType:a="text",isRequired:n=!1,placeholder:k="",label:d="Benutzername",label2:Y="Benutzername",selectOptions:E=[]})=>{const l=e("div",F.split(" "));if((!t||t.length===0)&&(t=c),a==="text"){const r=e("div",["mwf-textinput"],null,l);r.appendChild(T({placeholder:k,isRequired:n,name:c,id:t,type:a,classes:"mwf-textinput__input"})),r.appendChild(s({forAttribute:t,isRequired:n,text:d,labelType:"text"}));const o=e("div",["mwf-textinput__hint"],null,r);e("p",[],"Bitte tragen Sie hier ihren Vornamen ein.",o),e("div",["mwf-textinput__error"],"Dieses Feld darf nicht leer sein.",r)}if(a==="checkbox"){const r=e("fieldset",["mwf-checkboxgroup"],null,l);e("legend",["mwf-checkboxgroup__legend"],"Legend Header",r),e("div",["mwf-checkboxgroup__error"],"Dieses Feld darf nicht leer sein.",r);const o=e("div",["mwf-checkboxgroup__options"],null,r),i=e("div",["mwf-checkbox"],null,o);i.appendChild(C({type:a,isRequired:n,name:c,id:t})),i.appendChild(s({forAttribute:t,isRequired:n,text:d,labelType:"checkbox"}))}if(a==="radio"){const r=e("fieldset",["mwf-radiogroup"],null,l);e("legend",["mwf-radiogroup__legend"],"Legend Header",r),e("div",["mwf-radiogroup__error"],"Dieses Feld darf nicht leer sein.",r);const o=e("div",["mwf-radiogroup__options"],null,r),i=e("div",["mwf-radio"],null,o);i.appendChild(C({type:a,isRequired:n,name:c,id:t})),i.appendChild(s({forAttribute:t,isRequired:n,text:d,labelType:"radio"}));const m=e("div",["mwf-radio"],null,o);m.appendChild(C({type:a,isRequired:n,name:c,id:v})),m.appendChild(s({forAttribute:v,isRequired:n,text:Y,labelType:"radio"}))}if(a==="select"){const r=e("div",["mwf-select"],null,l);r.appendChild(re({placeholder:k,isRequired:n,name:c,id:t,classes:"mwf-select__select",options:E.length>0?E:te})),r.appendChild(s({forAttribute:t,isRequired:n,text:d,labelType:"select"})),e("div",["mwf-select__error"],"Dieses Feld darf nicht leer sein.",r)}if(a==="textarea"){const r=e("div",["mwf-textarea"],null,l);r.appendChild(T({placeholder:k,isRequired:n,name:c,id:t,type:a,classes:"mwf-textarea__input"})),r.appendChild(s({forAttribute:t,isRequired:n,text:d,labelType:"text"}));const o=e("div",["mwf-textarea__hint"],null,r);e("p",[],"Hier können Sie uns einen Kommentar hinterlassen (max. 1500 Zeichen).",o),e("div",["mwf-textarea__error"],"Dieses Feld darf nicht leer sein.",r)}if(a==="checkboxGroup"){const r=e("legend",["mwf-checkboxgroup__legend"],"Legend Header",l);if(n){const m=e("span",["mwf-checkboxgroup__required","mwf-required"],"*",r);m.title="Pflichtfeld"}e("div",["mwf-checkboxgroup__error"],"Dieses Feld darf nicht leer sein.",l);const o=e("div",["mwf-checkboxgroup__options"],null,l),i=e("div",["mwf-checkbox"],null,o);i.appendChild(C({type:"checkbox",name:c,id:t})),i.appendChild(s({forAttribute:t,text:d,labelType:"checkbox"}))}if(a==="file"){const r=e("div",["mwf-file"],null,l),o=e("div",["mwf-file__legend"],null,r);e("p",["mwf-file__label"],"Upload",o),e("div",["mwf-file__error"],"Dieses Feld darf nicht leer sein.",o);const i=e("div",["mwf-file__uploaded"],null,r),m=e("ul",["mwf-file__ul"],null,i),y=e("div",["mwf-upload-row"],null,m),D=e("div",["mwf-upload-fileinfo"],null,y);e("div",["mwf-upload-preview"],null,D);const $=e("div",["mwf-upload-metadata"],null,D),S=e("ul",[],null,$);e("li",[],"Name: data.pdf",S),e("li",[],"Size: 92.73 KB",S);const U=e("div",["mwf-upload-actions"],null,y);e("button",["mwf-upload-delete"],"Delete",U),e("button",["mwf-upload-upload"],"Upload",U);const ee=e("div",["mwf-file__dropzone"],null,r).appendChild(s({forAttribute:t,text:d,labelType:"text"})),u=e("input",[],null,ee);u.type="file",u.id=t,u.name=c,u.classes=["mwf-file__input"],u.setAttribute("aria-hidden","true")}return l},me={title:"Components/Form Element Form Centric",args:{inputType:"text"},argTypes:{inputType:{control:"select",options:["text","checkbox","radio","select","password","textarea"]}}},p=({...F})=>ne({...F}),f=p.bind({});f.args={inputType:"text",isRequired:!0,placeholder:"Platzhalter"};const h=p.bind({});h.args={inputType:"checkbox",isRequired:!0,label:'Ich akzeptiere die <a href="#">Datenschutzbestimmungen</a>.'};const x=p.bind({});x.args={inputType:"radio",isRequired:!0,label:"Option 1",id:"option1",label2:"Option 2",id2:"option2"};const b=p.bind({});b.args={inputType:"select",label:"Auswahl",isRequired:!0};const g=p.bind({});g.args={inputType:"textarea",placeholder:"Platzhalter",label:"Ihre Nachricht",isRequired:!0};const _=p.bind({});_.args={inputType:"checkboxGroup",isRequired:!0,label:'Ich akzeptiere die <a href="#">Datenschutzbestimmungen</a>.'};const w=p.bind({});w.args={inputType:"file",isRequired:!0};var z,A,I;f.parameters={...f.parameters,docs:{...(z=f.parameters)==null?void 0:z.docs,source:{originalSource:`({
- ...args
- }) => {
- return createFormCentricElement({
- ...args
- });
- }`,...(I=(A=f.parameters)==null?void 0:A.docs)==null?void 0:I.source}}};var R,q,G;h.parameters={...h.parameters,docs:{...(R=h.parameters)==null?void 0:R.docs,source:{originalSource:`({
- ...args
- }) => {
- return createFormCentricElement({
- ...args
- });
- }`,...(G=(q=h.parameters)==null?void 0:q.docs)==null?void 0:G.source}}};var L,B,H;x.parameters={...x.parameters,docs:{...(L=x.parameters)==null?void 0:L.docs,source:{originalSource:`({
- ...args
- }) => {
- return createFormCentricElement({
- ...args
- });
- }`,...(H=(B=x.parameters)==null?void 0:B.docs)==null?void 0:H.source}}};var O,P,K;b.parameters={...b.parameters,docs:{...(O=b.parameters)==null?void 0:O.docs,source:{originalSource:`({
- ...args
- }) => {
- return createFormCentricElement({
- ...args
- });
- }`,...(K=(P=b.parameters)==null?void 0:P.docs)==null?void 0:K.source}}};var M,N,V;g.parameters={...g.parameters,docs:{...(M=g.parameters)==null?void 0:M.docs,source:{originalSource:`({
- ...args
- }) => {
- return createFormCentricElement({
- ...args
- });
- }`,...(V=(N=g.parameters)==null?void 0:N.docs)==null?void 0:V.source}}};var Z,j,J;_.parameters={..._.parameters,docs:{...(Z=_.parameters)==null?void 0:Z.docs,source:{originalSource:`({
- ...args
- }) => {
- return createFormCentricElement({
- ...args
- });
- }`,...(J=(j=_.parameters)==null?void 0:j.docs)==null?void 0:J.source}}};var Q,W,X;w.parameters={...w.parameters,docs:{...(Q=w.parameters)==null?void 0:Q.docs,source:{originalSource:`({
- ...args
- }) => {
- return createFormCentricElement({
- ...args
- });
- }`,...(X=(W=w.parameters)==null?void 0:W.docs)==null?void 0:X.source}}};const ue=["TextFormCentricElement","CheckboxFormCentricElement","RadioFormCentricElement","SelectFormCentricElement","TextareaFormCentricElement","CheckboxGroupFormCentricElement","FileFormCentricElement"];export{h as CheckboxFormCentricElement,_ as CheckboxGroupFormCentricElement,w as FileFormCentricElement,x as RadioFormCentricElement,b as SelectFormCentricElement,f as TextFormCentricElement,g as TextareaFormCentricElement,ue as __namedExportsOrder,me as default};
|