semantic-forms 5.2.1 → 5.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("semanticForms",[],t):"object"==typeof exports?exports.semanticForms=t():e.semanticForms=t()}(this,()=>{return e={90:e=>{const t=()=>{if("function"!=typeof document.getElementsByClassName||"function"!=typeof document.querySelector||!document.body.classList||!window.MutationObserver)return void console.warn("semantic-forms was loaded into an unsupported browser and will not execute.");const e='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m1 12s4-8 11-8 11 8 11 8"/><path d="m1 12s4 8 11 8 11-8 11-8"/><circle cx="12" cy="12" r="3"/></g></svg>',r='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16" version="1.1" style="overflow:visible;"><rect width="16" height="16" fill="none"/><path fill="currentColor" d="M8,10.5c-0.552,0-1,0.448-1,1c0,0.552,0.448,1,1,1c0.552,0,1-0.448,1-1C9,10.948,8.552,10.5,8,10.5z M8,0 C3.582,0,0,3.582,0,8c0,4.418,3.582,8,8,8s8-3.582,8-8C16,3.582,12.418,0,8,0z M12.243,12.243C11.109,13.376,9.603,14,8,14 s-3.109-0.624-4.243-1.757C2.624,11.109,2,9.603,2,8s0.624-3.109,1.757-4.243C4.891,2.624,6.397,2,8,2s3.109,0.624,4.243,1.757 C13.376,4.891,14,6.397,14,8C14,9.603,13.376,11.109,12.243,12.243z M7.927,3.755c-2.248,0-2.76,1.695-2.802,2.906h1.571 c0.028-0.256,0.101-1.418,1.221-1.418c0.672,0,1.206,0.406,1.206,1.175c0,0.695-0.724,1.155-1.303,1.711 C7.241,8.685,7.168,9.325,7.168,9.824V10c0.146,0,1.615,0,1.615,0V9.824c0-1.256,1.967-1.594,1.967-3.541 C10.75,5.059,9.874,3.755,7.927,3.755z"/></svg>',o=["TEXTAREA","SELECT"],i=["checkbox","color","date","datetime-local","email","file","image","month","number","password","radio","range","search","tel","text","time","url","week"],n=[];document.addEventListener("keydown",e=>{const t={Minus:"-",Equal:"=",BracketLeft:"[",BracketRight:"]",Backslash:"\\",Semicolon:";",Quote:"'",Comma:",",Period:".",Slash:"/",Backquote:"`"},r={1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")",Minus:"_",Equal:"+",BracketLeft:"{",BracketRight:"}",Backslash:"|",Semicolon:":",Quote:'"',Comma:"<",Period:">",Slash:"?",Backquote:"~"},o=n.find(o=>{let i,n=!1;if(e.altKey&&!e.shiftKey)n="Key"+o.key.toUpperCase()===e.code||"Digit"+o.key.toUpperCase()===e.code||o.key===e.key||t[e.code]===o.key;else if(e.shiftKey){const t=e.code.replace(/Key|Digit/,"");n=(r[t]||r[e.key])&&(r[t]===o.key||r[e.key]===o.key)}else n=o.key.toUpperCase()===e.key.toUpperCase();return!!n&&(o.modifier&&(o.modifier===o.defaultModifier&&(i="windows"===o.os||"linux"===o.os?e.ctrlKey:e.metaKey),"meta"===o.modifier&&(i=e.metaKey),"alt"===o.modifier&&(i=e.altKey),"ctrl"===o.modifier&&(i=e.ctrlKey)),i)});o&&(e.preventDefault(),o.input.focus())});const a=document.querySelectorAll("form.semanticForms:not(.semanticFormsActive), table.semanticForms:not(.semanticFormsActive)");for(const p of a){if(p.classList.add("semanticFormsActive"),p.classList.contains("lowFlow"))continue;const m=Array.from(p.querySelectorAll("input, textarea, select"));for(let h of m){if(h.classList.contains("semanticform")||!h.id)continue;const f=h.getAttribute("type");if(o.includes(h.nodeName)||i.includes(f)){let y=h.parentNode;for(;y&&"DL"!==y.nodeName;)y=y.parentNode;if(!y)continue;y.classList.contains("floatLabelForm")||y.classList.add("floatLabelForm");const b=!h.parentNode.parentNode.id||"checkbox"!==f&&"radio"!==f?document.querySelector("label[for="+h.id.replace(/\./g,"\\.")+"]"):document.querySelector("label[data-for="+h.parentNode.parentNode.id.replace(/\./g,"\\.")+"]");b||console.error(`semantic-forms: Found an input (${h.id||h.getAttribute("name")}) without a properly associated label. Make sure there is a label for it and the label has a matching "for" attribute.`),h.classList.add("semanticform");const g=document.createElement("label");if(g.className="floatLabelFormAnimatedLabel","checkbox"===f||"radio"===f){let w=h.parentNode;for(;w&&"DD"!==w.nodeName;)w=w.parentNode;if(!w){console.error(`semantic-forms: Found an input (${h.id||h.getAttribute("name")}) that is not inside a <dd> element.`);continue}if("LABEL"!==w.firstChild.nodeName){if("checkbox"===f&&"DD"===h.parentNode.nodeName&&(g.setAttribute("for",h.id),h.parentNode.classList.add("singleCheckbox"),g.className="",b.setAttribute("hidden","hidden"),l(g,h)),"radio"===f&&"DD"===h.parentNode.nodeName&&(g.setAttribute("for",h.id),h.parentNode.classList.add("singleRadio"),g.className="",b.setAttribute("hidden","hidden"),l(g,h)),g.innerHTML=b.innerHTML,b.hasAttribute("title")&&null!==b.getAttribute("data-show-help-icon")&&!b.querySelector("span.help")){const A=b.getAttribute("title");b.innerHTML+=` <span title="${A}" class="help">${r}</span>`,g.innerHTML+=` <span title="${A}" class="help">${r}</span>`}if(w.querySelector(":required")&&null===b.getAttribute("data-no-asterisk")&&!b.querySelector("span.required")){const x=b.getAttribute("data-asterisk-text")||"This field is required.";b.innerHTML+=` <span title="${x}" class="required">*</span>`,g.innerHTML+=` <span title="${x}" class="required">*</span>`}w.querySelector("label")||w.append(g)}"DIV"===w.parentElement.nodeName&&w.parentElement.remove();const v=document.createElement("div");v.append(b.closest("dt"),w),y.append(v)}else{if(g.setAttribute("for",h.id),g.innerHTML=b.innerHTML,h.hasAttribute("title")&&null!==b.getAttribute("data-show-help-icon")&&!b.querySelector("span.help")){const L=h.getAttribute("title");g.innerHTML+=` <span title="${L}" class="help">${r}</span>`}if(h.hasAttribute("required")&&null===b.getAttribute("data-no-asterisk")&&!b.querySelector("span.required")){const k=b.getAttribute("data-asterisk-text")||"This field is required.";g.innerHTML+=` <span title="${k}" class="required">*</span>`}b.setAttribute("hidden","hidden"),l(g,h)}if(null!==h.getAttribute("data-focus-key")){function s(){const e=d(),t="metactrl";let r,o=h.getAttribute("data-focus-key");o.length>1&&(console.error(`Provided focus key "${o}" is more than one character. Using first character only.`),o=o.toString()[0]);let i=t;const a={default:h.getAttribute("data-focus-modifier")||t,linux:h.getAttribute("data-focus-modifier-linux"),mac:h.getAttribute("data-focus-modifier-mac"),windows:h.getAttribute("data-focus-modifier-win")};if(i=e&&a[e]?a[e]:a.default,["ctrl","alt","opt","meta","cmd",t].includes(i)||(console.error(`Received an unrecognized modifier, "${i}," defaulting to "${t}."`,h),i=t),["alt","opt"].includes(i)?r="mac"===e?"⌥":"⎇":["meta","win","cmd"].includes(i)||i===t&&"mac"===e?r="mac"===e?"⌘":"linux"===e?"◆":"⊞":"ctrl"!==i&&(i!==t||"windows"!==e&&"linux"!==e)||(r="mac"===e?"⌃":"Ctrl"),n.some(e=>e.key===o&&e.modifier===i)?console.error(`Duplicate keyboard shortcut "${i} + ${o}" detected. Only the first input will be focusable using this keyboard shortcut.`,h):n.push({key:o,modifier:i,input:h,os:e,defaultModifier:t}),"TEXTAREA"===h.nodeName||"text"===h.type||"number"===h.type){const e=document.createElement("span");e.classList.add("focus-key"),e.innerHTML=`<kbd>${r} ${o.toUpperCase()}</kbd>`,l(e,g)}else h.getAttribute("title")?h.setAttribute("title",h.getAttribute("title")+` (${r} + ${o})`):h.setAttribute("title",`Focus with ${r} + ${o}`)}s()}if(null!==h.getAttribute("data-auto-grow")){if("INPUT"===h.nodeName&&"text"===h.type){const N=document.createElement("textarea");N.id=h.id,N.class=h.class,N.innerText=h.value,N.setAttribute("data-auto-grow",""),h.replaceWith(N),h=N}"TEXTAREA"===h.nodeName&&h.addEventListener("keypress",e=>{"Enter"!==e.key||"Enter"===e.key&&e.shiftKey||(e.preventDefault(),p.requestSubmit())})}if("checkbox"!==f&&"radio"!==f){h.getAttribute("placeholder")||h.setAttribute("placeholder"," ");const E=document.createElement("div"),S=b.closest("dt"),F=h.closest("dd");if(!S){console.error(`semantic-forms: Found an input (${h.id||h.getAttribute("name")}) that does not have a corresponding <dt> element.`);continue}if(!F){console.error(`semantic-forms: Found an input (${h.id||h.getAttribute("name")}) that does not have a corresponding <dd> element.`);continue}if("SELECT"!==h.nodeName&&"range"!==f){const C=document.createElement("button");C.type="button",C.title=h.getAttribute("data-clear-field-text")||"Clear field",C.ariaLabel=h.getAttribute("data-clear-field-text")||"Clear field",C.tabIndex=-1,C.innerHTML='<svg viewBox="0 0 16 16" width="18" height="18"><path d="M 1 1 L 15 15 M 1 15 L 15 1" fill="none" stroke-width="2" stroke="currentColor" />',C.classList.add("clear"),C.id=`semanticFormsClearButton_${h.id}`,C.addEventListener("click",()=>{h.previousValue=h.value,h.value="",h.focus(),u=h.id,h.dispatchEvent(new Event("input",{bubbles:!0}))}),l(C,F.querySelector("label"))}if(h.addEventListener("focus",e=>{"INPUT"===e.target.nodeName&&(c=e.target)}),/colspan-/.test(F.className)){const q=F.className.match(/colspan-([0-9]|full)/)[0];F.classList.remove(q),E.classList.add(q)}if(null!==h.getAttribute("data-max-content")&&!("fieldSizing"in document.createElement("input").style)){const M=()=>{const e=8*(""!==h.value?h.value:h.placeholder).length+40;h.style.width=e+"px",h.style.maxWidth="100%",E.style.width=e+"px"};M(),h.addEventListener("input",M)}E.append(S,F),y.append(E),"none"===S.style.display&&"none"===F.style.display&&(E.style.display="none")}if("file"===f){const $=h.parentElement.querySelector(".clear");h.addEventListener("input",e=>{$.style.display=e.target.files.length?"flex":"none"}),$.addEventListener("click",()=>{$.style.display="none"})}if("range"===f&&h.classList.contains("displayValue")&&(h.parentNode.parentNode.querySelector("dd label").innerHTML+=`<span class="seperator">: </span><output>${h.value}</output>`,h.addEventListener("input",e=>{e.target.parentNode.parentNode.querySelector("output").innerHTML=e.target.value})),"password"===f&&null===h.getAttribute("data-no-reveal")){const T=document.createElement("button");T.type="button",T.title=h.getAttribute("data-show-password-text")||"Show password",T.ariaLabel=h.getAttribute("data-show-password-text")||"Show password",T.tabIndex=-1,T.innerHTML=e,T.classList.add("show"),T.id=`semanticFormsShowButton_${h.id}`;const H=h.closest("dd");if(!H){console.error(`semantic-forms: Found an input (${h.id||h.getAttribute("name")}) that is not inside a <dd> element.`);continue}T.addEventListener("click",()=>{"password"===h.type?(T.innerHTML='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m2 2 20 20"/><path d="m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335"/><path d="m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192"/></g></svg>',T.title=h.getAttribute("data-hide-password-text")||"Hide password",T.ariaLabel=h.getAttribute("data-hide-password-text")||"Hide password",h.type="text"):(T.innerHTML=e,T.title=h.getAttribute("data-show-password-text")||"Show password",T.ariaLabel=h.getAttribute("data-show-password-text")||"Show password",h.type="password"),h.focus()}),l(T,H.querySelector("label"))}if("TEXTAREA"===h.nodeName){if(null===h.getAttribute("data-disable-autosize")){h.style.setProperty("resize","none"),h.style.setProperty("min-height","0"),h.style.setProperty("max-height","none"),h.style.setProperty("height","auto");const B=()=>{let e=h.getAttribute("data-max-rows");e&&(isNaN(e)||Number(e)<=0)&&(console.warn(`An invalid value was passed to the "data-max-rows" attribute. This value will be ignored.\n\nProvided value: ${h.getAttribute("data-max-rows")}`),e=null);const t=h.getAttribute("data-max-rows")&&Number(h.getAttribute("data-max-rows"))<5?h.getAttribute("data-max-rows"):"5";h.setAttribute("rows",t);const r=window.getComputedStyle(h),o=parseFloat(r["padding-left"])+parseFloat(r["padding-right"]),i=parseFloat(r["border-left-width"])+parseFloat(r["border-right-width"]);h.style.setProperty("overflow","hidden","important"),h.style.setProperty("width",parseFloat(r.width)-o-i+"px"),h.style.setProperty("box-sizing","content-box"),h.style.setProperty("padding-inline","0"),h.style.setProperty("border-width","0");const n=parseFloat(r["padding-top"])+parseFloat(r["padding-bottom"]),a="normal"===r["line-height"]?parseFloat(r.height):parseFloat(r["line-height"]),s=Math.round(h.scrollHeight);h.style.removeProperty("width"),h.style.removeProperty("box-sizing"),h.style.removeProperty("padding-inline"),h.style.removeProperty("border-width"),h.style.removeProperty("overflow");const l=Math.round((s-n)/a);e?h.setAttribute("rows",""+Math.min(l,Number(e))):h.setAttribute("rows",""+l)};h.addEventListener("input",B),h.dispatchEvent(new Event("input",{bubbles:!0}))}if(null!==h.getAttribute("data-auto-grow")){const K=()=>{h.value.length?h.style.height=h.scrollHeight+"px":h.style.height=window.getComputedStyle(p).getPropertyValue("--semanticFormsInputHeight")};h.style.height=window.getComputedStyle(p).getPropertyValue("--semanticFormsInputHeight"),h.addEventListener("input",K)}const P=()=>{const e=h.parentElement?.querySelector("button.clear");e&&(e.style.marginRight=h.clientHeight<h.scrollHeight?"15px":"")};h.addEventListener("input",P),h.addEventListener("mouseup",P),P()}}}}function l(e,t){t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e)}function d(){const e=window.navigator.userAgent,t=window.navigator.platform;let r=null;return t.includes("Win")?r="windows":t.includes("Mac")||/iPhone|iPad|iPod/.test(e)?r="mac":(t.includes("Linux")||/Android/.test(e))&&(r="linux"),r}let c,u;document.addEventListener("keydown",e=>{!e.ctrlKey&&!e.metaKey||"z"!==e.key||e.shiftKey?(e.ctrlKey&&"y"===e.key||e.metaKey&&e.shiftKey&&"z"===e.key)&&c&&(c?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${u}`&&c?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${u}`||c.redoValue&&(c.previousValue=c.value,c.value=c.redoValue)):c&&(c?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${u}`&&c?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${u}`||c.previousValue&&(c.redoValue=c.value,c.value=c.previousValue))}),window.semanticFormsObserver||(window.semanticFormsObserver=new window.MutationObserver(e=>{let r=!1;for(const o of e){for(const e of o.addedNodes)("FORM"===e.nodeName||e?.querySelector?.("form"))&&(t(),r=!0);if(r)break}}),window.semanticFormsObserver.observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0})),t.reinitialize=e=>{e.classList.remove("semanticFormsActive"),t()}};e.exports=t}},t={},function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}(90);var e,t});
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("semanticForms",[],t):"object"==typeof exports?exports.semanticForms=t():e.semanticForms=t()}(this,()=>{return e={90:e=>{const t=()=>{if("function"!=typeof document.getElementsByClassName||"function"!=typeof document.querySelector||!document.body.classList||!window.MutationObserver)return void console.warn("semantic-forms was loaded into an unsupported browser and will not execute.");const e='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m1 12s4-8 11-8 11 8 11 8"/><path d="m1 12s4 8 11 8 11-8 11-8"/><circle cx="12" cy="12" r="3"/></g></svg>',r='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16" version="1.1" style="overflow:visible;"><rect width="16" height="16" fill="none"/><path fill="currentColor" d="M8,10.5c-0.552,0-1,0.448-1,1c0,0.552,0.448,1,1,1c0.552,0,1-0.448,1-1C9,10.948,8.552,10.5,8,10.5z M8,0 C3.582,0,0,3.582,0,8c0,4.418,3.582,8,8,8s8-3.582,8-8C16,3.582,12.418,0,8,0z M12.243,12.243C11.109,13.376,9.603,14,8,14 s-3.109-0.624-4.243-1.757C2.624,11.109,2,9.603,2,8s0.624-3.109,1.757-4.243C4.891,2.624,6.397,2,8,2s3.109,0.624,4.243,1.757 C13.376,4.891,14,6.397,14,8C14,9.603,13.376,11.109,12.243,12.243z M7.927,3.755c-2.248,0-2.76,1.695-2.802,2.906h1.571 c0.028-0.256,0.101-1.418,1.221-1.418c0.672,0,1.206,0.406,1.206,1.175c0,0.695-0.724,1.155-1.303,1.711 C7.241,8.685,7.168,9.325,7.168,9.824V10c0.146,0,1.615,0,1.615,0V9.824c0-1.256,1.967-1.594,1.967-3.541 C10.75,5.059,9.874,3.755,7.927,3.755z"/></svg>',o=["TEXTAREA","SELECT"],i=["checkbox","color","date","datetime-local","email","file","image","month","number","password","radio","range","search","tel","text","time","url","week"],n=[];document.addEventListener("keydown",e=>{const t={Minus:"-",Equal:"=",BracketLeft:"[",BracketRight:"]",Backslash:"\\",Semicolon:";",Quote:"'",Comma:",",Period:".",Slash:"/",Backquote:"`"},r={1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")",Minus:"_",Equal:"+",BracketLeft:"{",BracketRight:"}",Backslash:"|",Semicolon:":",Quote:'"',Comma:"<",Period:">",Slash:"?",Backquote:"~"},o=n.find(o=>{let i,n=!1;if(e.altKey&&!e.shiftKey)n="Key"+o.key.toUpperCase()===e.code||"Digit"+o.key.toUpperCase()===e.code||o.key===e.key||t[e.code]===o.key;else if(e.shiftKey){const t=e.code.replace(/Key|Digit/,"");n=(r[t]||r[e.key])&&(r[t]===o.key||r[e.key]===o.key)}else n=o.key.toUpperCase()===e.key.toUpperCase();return!!n&&(o.modifier&&(o.modifier===o.defaultModifier&&(i="windows"===o.os||"linux"===o.os?e.ctrlKey:e.metaKey),"meta"===o.modifier&&(i=e.metaKey),"alt"===o.modifier&&(i=e.altKey),"ctrl"===o.modifier&&(i=e.ctrlKey)),i)});o&&(e.preventDefault(),o.input.focus())});const a=document.querySelectorAll("form.semanticForms:not(.semanticFormsActive), table.semanticForms:not(.semanticFormsActive)");for(const p of a){if(p.classList.add("semanticFormsActive"),p.classList.contains("lowFlow"))continue;const m=Array.from(p.querySelectorAll("input, textarea, select"));for(let h of m){if(h.classList.contains("semanticform")||!h.id)continue;const f=h.getAttribute("type");if(o.includes(h.nodeName)||i.includes(f)){let y=h.parentNode;for(;y&&"DL"!==y.nodeName;)y=y.parentNode;if(!y)continue;y.classList.contains("floatLabelForm")||y.classList.add("floatLabelForm");const b=!h.parentNode.parentNode.id||"checkbox"!==f&&"radio"!==f?document.querySelector("label[for="+h.id.replace(/\./g,"\\.")+"]"):document.querySelector("label[data-for="+h.parentNode.parentNode.id.replace(/\./g,"\\.")+"]");b||console.error(`semantic-forms: Found an input (${h.id||h.getAttribute("name")}) without a properly associated label. Make sure there is a label for it and the label has a matching "for" attribute.`),h.classList.add("semanticform");const g=document.createElement("label");if(g.className="floatLabelFormAnimatedLabel","checkbox"===f||"radio"===f){let w=h.parentNode;for(;w&&"DD"!==w.nodeName;)w=w.parentNode;if(!w){console.error(`semantic-forms: Found an input (${h.id||h.getAttribute("name")}) that is not inside a <dd> element.`);continue}if("LABEL"!==w.firstChild.nodeName){if("checkbox"===f&&"DD"===h.parentNode.nodeName&&(g.setAttribute("for",h.id),h.parentNode.classList.add("singleCheckbox"),g.className="",b.setAttribute("hidden","hidden"),l(g,h)),"radio"===f&&"DD"===h.parentNode.nodeName&&(g.setAttribute("for",h.id),h.parentNode.classList.add("singleRadio"),g.className="",b.setAttribute("hidden","hidden"),l(g,h)),g.innerHTML=b.innerHTML,b.hasAttribute("title")&&null!==b.getAttribute("data-show-help-icon")&&!b.querySelector("span.help")){const A=b.getAttribute("title");b.innerHTML+=` <span title="${A}" class="help">${r}</span>`,g.innerHTML+=` <span title="${A}" class="help">${r}</span>`}if(w.querySelector(":required")&&null===b.getAttribute("data-no-asterisk")&&!b.querySelector("span.required")){const x=b.getAttribute("data-asterisk-text")||"This field is required.";b.innerHTML+=` <span title="${x}" class="required">*</span>`,g.innerHTML+=` <span title="${x}" class="required">*</span>`}w.querySelector("label")||w.append(g)}"DIV"===w.parentElement.nodeName&&w.parentElement.remove();const v=document.createElement("div");v.append(b.closest("dt"),w),y.append(v)}else{if(g.setAttribute("for",h.id),g.innerHTML=b.innerHTML,h.hasAttribute("title")&&null!==b.getAttribute("data-show-help-icon")&&!b.querySelector("span.help")){const L=h.getAttribute("title");g.innerHTML+=` <span title="${L}" class="help">${r}</span>`}if(h.hasAttribute("required")&&null===b.getAttribute("data-no-asterisk")&&!b.querySelector("span.required")){const k=b.getAttribute("data-asterisk-text")||"This field is required.";g.innerHTML+=` <span title="${k}" class="required">*</span>`}b.setAttribute("hidden","hidden"),l(g,h)}if(null!==h.getAttribute("data-focus-key")){function s(){const e=d(),t="metactrl";let r,o=h.getAttribute("data-focus-key");o.length>1&&(console.error(`Provided focus key "${o}" is more than one character. Using first character only.`),o=o.toString()[0]);let i=t;const a={default:h.getAttribute("data-focus-modifier")||t,linux:h.getAttribute("data-focus-modifier-linux"),mac:h.getAttribute("data-focus-modifier-mac"),windows:h.getAttribute("data-focus-modifier-win")};if(i=e&&a[e]?a[e]:a.default,["ctrl","alt","opt","meta","cmd",t].includes(i)||(console.error(`Received an unrecognized modifier, "${i}," defaulting to "${t}."`,h),i=t),["alt","opt"].includes(i)?r="mac"===e?"⌥":"⎇":["meta","win","cmd"].includes(i)||i===t&&"mac"===e?r="mac"===e?"⌘":"linux"===e?"◆":"⊞":"ctrl"!==i&&(i!==t||"windows"!==e&&"linux"!==e)||(r="mac"===e?"⌃":"Ctrl"),n.some(e=>e.key===o&&e.modifier===i)?console.error(`Duplicate keyboard shortcut "${i} + ${o}" detected. Only the first input will be focusable using this keyboard shortcut.`,h):n.push({key:o,modifier:i,input:h,os:e,defaultModifier:t}),"TEXTAREA"===h.nodeName||"text"===h.type||"number"===h.type){const e=document.createElement("span");e.classList.add("focus-key"),e.innerHTML=`<kbd>${r} ${o.toUpperCase()}</kbd>`,l(e,g)}else h.getAttribute("title")?h.setAttribute("title",h.getAttribute("title")+` (${r} + ${o})`):h.setAttribute("title",`Focus with ${r} + ${o}`)}s()}if(null!==h.getAttribute("data-auto-grow")){if("INPUT"===h.nodeName&&"text"===h.type){const N=document.createElement("textarea");N.id=h.id,N.class=h.class,N.innerText=h.value,N.setAttribute("data-auto-grow",""),h.replaceWith(N),h=N}"TEXTAREA"===h.nodeName&&h.addEventListener("keypress",e=>{"Enter"!==e.key||"Enter"===e.key&&e.shiftKey||(e.preventDefault(),p.requestSubmit())})}if("checkbox"!==f&&"radio"!==f){h.getAttribute("placeholder")||h.setAttribute("placeholder"," ");const E=document.createElement("div"),S=b.closest("dt"),F=h.closest("dd");if(!S){console.error(`semantic-forms: Found an input (${h.id||h.getAttribute("name")}) that does not have a corresponding <dt> element.`);continue}if(!F){console.error(`semantic-forms: Found an input (${h.id||h.getAttribute("name")}) that does not have a corresponding <dd> element.`);continue}if("SELECT"!==h.nodeName&&"range"!==f){const C=document.createElement("button");C.type="button",C.title=h.getAttribute("data-clear-field-text")||"Clear field",C.ariaLabel=h.getAttribute("data-clear-field-text")||"Clear field",C.tabIndex=-1,C.innerHTML='<svg viewBox="0 0 16 16" width="18" height="18"><path d="M 1 1 L 15 15 M 1 15 L 15 1" fill="none" stroke-width="2" stroke="currentColor" />',C.classList.add("clear"),C.id=`semanticFormsClearButton_${h.id}`,C.addEventListener("click",()=>{h.previousValue=h.value,h.value="",h.focus(),u=h.id,h.dispatchEvent(new Event("input",{bubbles:!0}))}),l(C,F.querySelector("label"))}if(h.addEventListener("focus",e=>{"INPUT"===e.target.nodeName&&(c=e.target)}),/colspan-/.test(F.className)){const q=F.className.match(/colspan-([0-9]|full)/)[0];F.classList.remove(q),E.classList.add(q)}if(null!==h.getAttribute("data-max-content")&&!("fieldSizing"in document.createElement("input").style)){const M=()=>{const e=8*(""!==h.value?h.value:h.placeholder).length+40;h.style.width=e+"px",h.style.maxWidth="100%",E.style.width=e+"px"};M(),h.addEventListener("input",M)}E.append(S,F),y.append(E),"none"===S.style.display&&"none"===F.style.display&&(E.style.display="none")}if("file"===f){const $=h.parentElement.querySelector(".clear");h.addEventListener("input",e=>{$.style.display=e.target.files.length?"flex":"none"}),$.addEventListener("click",()=>{$.style.display="none"})}if("range"===f&&h.classList.contains("displayValue")&&(h.parentNode.parentNode.querySelector("dd label").innerHTML+=`<span class="seperator">: </span><output>${h.value}</output>`,h.addEventListener("input",e=>{e.target.parentNode.parentNode.querySelector("output").innerHTML=e.target.value})),"password"===f&&null===h.getAttribute("data-no-reveal")){const T=document.createElement("button");T.type="button",T.title=h.getAttribute("data-show-password-text")||"Show password",T.ariaLabel=h.getAttribute("data-show-password-text")||"Show password",T.tabIndex=-1,T.innerHTML=e,T.classList.add("show"),T.id=`semanticFormsShowButton_${h.id}`;const P=h.closest("dd");if(!P){console.error(`semantic-forms: Found an input (${h.id||h.getAttribute("name")}) that is not inside a <dd> element.`);continue}T.addEventListener("click",()=>{"password"===h.type?(T.innerHTML='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m2 2 20 20"/><path d="m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335"/><path d="m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192"/></g></svg>',T.title=h.getAttribute("data-hide-password-text")||"Hide password",T.ariaLabel=h.getAttribute("data-hide-password-text")||"Hide password",h.type="text"):(T.innerHTML=e,T.title=h.getAttribute("data-show-password-text")||"Show password",T.ariaLabel=h.getAttribute("data-show-password-text")||"Show password",h.type="password"),h.focus()}),l(T,P.querySelector("label"))}if("TEXTAREA"===h.nodeName){if(null===h.getAttribute("data-disable-autosize")){h.style.setProperty("resize","none"),h.style.setProperty("min-height","0"),h.style.setProperty("max-height","none"),h.style.setProperty("height","auto");const B=()=>{let e=h.getAttribute("data-max-rows");e&&(isNaN(e)||Number(e)<=0)&&(console.warn(`An invalid value was passed to the "data-max-rows" attribute. This value will be ignored.\n\nProvided value: ${h.getAttribute("data-max-rows")}`),e=null);const t=h.getAttribute("data-max-rows")&&Number(h.getAttribute("data-max-rows"))<5?h.getAttribute("data-max-rows"):"5";h.setAttribute("rows",t);const r=window.getComputedStyle(h),o=parseFloat(r["padding-left"])+parseFloat(r["padding-right"]),i=parseFloat(r["border-left-width"])+parseFloat(r["border-right-width"]);h.style.setProperty("overflow","hidden","important"),h.style.setProperty("width",parseFloat(r.width)-o-i+"px"),h.style.setProperty("box-sizing","content-box"),h.style.setProperty("padding-inline","0"),h.style.setProperty("border-width","0");const n=parseFloat(r["padding-top"])+parseFloat(r["padding-bottom"]),a="normal"===r["line-height"]?parseFloat(r.height):parseFloat(r["line-height"]),s=Math.round(h.scrollHeight);h.style.removeProperty("width"),h.style.removeProperty("box-sizing"),h.style.removeProperty("padding-inline"),h.style.removeProperty("border-width"),h.style.removeProperty("overflow");const l=Math.round((s-n)/a);e?h.setAttribute("rows",""+Math.min(l,Number(e))):h.setAttribute("rows",""+l)};h.addEventListener("input",B),h.dispatchEvent(new Event("input",{bubbles:!0}))}if(null!==h.getAttribute("data-auto-grow")){const K=()=>{if(h.value.length){const e=parseInt(window.getComputedStyle(h).getPropertyValue("border-width"));h.style.height=h.scrollHeight+2*e+"px"}else h.style.height=window.getComputedStyle(p).getPropertyValue("--semanticFormsInputHeight")};h.style.height=window.getComputedStyle(p).getPropertyValue("--semanticFormsInputHeight"),h.addEventListener("input",K)}const H=()=>{const e=h.parentElement?.querySelector("button.clear");e&&(e.style.marginRight=h.clientHeight<h.scrollHeight?"15px":"")};h.addEventListener("input",H),h.addEventListener("mouseup",H),H()}}}}function l(e,t){t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e)}function d(){const e=window.navigator.userAgent,t=window.navigator.platform;let r=null;return t.includes("Win")?r="windows":t.includes("Mac")||/iPhone|iPad|iPod/.test(e)?r="mac":(t.includes("Linux")||/Android/.test(e))&&(r="linux"),r}let c,u;document.addEventListener("keydown",e=>{!e.ctrlKey&&!e.metaKey||"z"!==e.key||e.shiftKey?(e.ctrlKey&&"y"===e.key||e.metaKey&&e.shiftKey&&"z"===e.key)&&c&&(c?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${u}`&&c?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${u}`||c.redoValue&&(c.previousValue=c.value,c.value=c.redoValue)):c&&(c?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${u}`&&c?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${u}`||c.previousValue&&(c.redoValue=c.value,c.value=c.previousValue))}),window.semanticFormsObserver||(window.semanticFormsObserver=new window.MutationObserver(e=>{let r=!1;for(const o of e){for(const e of o.addedNodes)("FORM"===e.nodeName||e?.querySelector?.("form"))&&(t(),r=!0);if(r)break}}),window.semanticFormsObserver.observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0})),t.reinitialize=e=>{e.classList.remove("semanticFormsActive"),t()}};e.exports=t}},t={},function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}(90);var e,t});
2
2
  //# sourceMappingURL=semantic-forms.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"semantic-forms.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,gBA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4C,YAd5C5C,IACEA,GAAkBnD,YAAY3D,cAAc,gBAAgBqD,KAAO,4BAA4BmD,KAA2BM,GAAkBnD,YAAY3D,cAAc,gBAAgByJ,OAAS,4BAA4BjD,KACzNM,EAAiBP,gBACnBO,EAAiB4C,UAAY5C,EAAiBf,MAC9Ce,EAAiBf,MAAQe,EAAiBP,kBAkB/CpG,OAAOwJ,wBACVxJ,OAAOwJ,sBAAwB,IAAIxJ,OAAOC,iBAAiBwJ,IACzD,IAAIC,GAAO,EACX,IAAK,MAAMC,KAAYF,EAAW,CAChC,IAAK,MAAMG,KAAQD,EAASE,YACJ,SAAlBD,EAAKtG,UAAuBsG,GAAM/J,gBAAgB,WACpDH,IACAgK,GAAO,GAGX,GAAIA,EAAM,KACZ,IAEF1J,OAAOwJ,sBAAsBM,QAAQnK,SAASG,KAAM,CAAEiK,YAAY,EAAOC,WAAW,EAAMC,eAAe,EAAOC,SAAS,KAG3HxK,EAAcyK,aAAevH,IAC3BA,EAAK7C,UAAUwE,OAAO,uBACtB7E,MAIJJ,EAAOD,QAAUK,C,GCrmBb0K,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAalL,QAGrB,IAAIC,EAAS8K,EAAyBE,GAAY,CAGjDjL,QAAS,CAAC,GAOX,OAHAoL,EAAoBH,GAAUhL,EAAQA,EAAOD,QAASgL,GAG/C/K,EAAOD,OACf,CCnB0BgL,CAAoB,I,MDF1CD","sources":["webpack://semanticForms/webpack/universalModuleDefinition","webpack://semanticForms/./semanticForms.js","webpack://semanticForms/webpack/bootstrap","webpack://semanticForms/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"semanticForms\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"semanticForms\"] = factory();\n\telse\n\t\troot[\"semanticForms\"] = factory();\n})(this, () => {\nreturn ","const semanticForms = () => {\n // do some feature detection so none of the JS executes if the browser is too old\n if (typeof document.getElementsByClassName !== 'function' || typeof document.querySelector !== 'function' || !document.body.classList || !window.MutationObserver) {\n console.warn('semantic-forms was loaded into an unsupported browser and will not execute.')\n return\n }\n\n const passwordShow = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m1 12s4-8 11-8 11 8 11 8\"/><path d=\"m1 12s4 8 11 8 11-8 11-8\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></g></svg>'\n const passwordHide = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m2 2 20 20\"/><path d=\"m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335\"/><path d=\"m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192\"/></g></svg>'\n const helpTextIcon = '<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" style=\"overflow:visible;\"><rect width=\"16\" height=\"16\" fill=\"none\"/><path fill=\"currentColor\" d=\"M8,10.5c-0.552,0-1,0.448-1,1c0,0.552,0.448,1,1,1c0.552,0,1-0.448,1-1C9,10.948,8.552,10.5,8,10.5z M8,0 C3.582,0,0,3.582,0,8c0,4.418,3.582,8,8,8s8-3.582,8-8C16,3.582,12.418,0,8,0z M12.243,12.243C11.109,13.376,9.603,14,8,14 s-3.109-0.624-4.243-1.757C2.624,11.109,2,9.603,2,8s0.624-3.109,1.757-4.243C4.891,2.624,6.397,2,8,2s3.109,0.624,4.243,1.757 C13.376,4.891,14,6.397,14,8C14,9.603,13.376,11.109,12.243,12.243z M7.927,3.755c-2.248,0-2.76,1.695-2.802,2.906h1.571 c0.028-0.256,0.101-1.418,1.221-1.418c0.672,0,1.206,0.406,1.206,1.175c0,0.695-0.724,1.155-1.303,1.711 C7.241,8.685,7.168,9.325,7.168,9.824V10c0.146,0,1.615,0,1.615,0V9.824c0-1.256,1.967-1.594,1.967-3.541 C10.75,5.059,9.874,3.755,7.927,3.755z\"/></svg>'\n\n const nodeNameLookup = ['TEXTAREA', 'SELECT']\n const inputTypeLookup = ['checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'image', 'month', 'number', 'password', 'radio', 'range', 'search', 'tel', 'text', 'time', 'url', 'week']\n const keyboardShortcuts = []\n\n // custom keyboard shortcut listener\n document.addEventListener('keydown', (e) => {\n const specialCharMap = {\n Minus: '-',\n Equal: '=',\n BracketLeft: '[',\n BracketRight: ']',\n Backslash: '\\\\',\n Semicolon: ';',\n Quote: '\\'',\n Comma: ',',\n Period: '.',\n Slash: '/',\n Backquote: '`'\n }\n\n const shiftSpecialCharMap = {\n 1: '!',\n 2: '@',\n 3: '#',\n 4: '$',\n 5: '%',\n 6: '^',\n 7: '&',\n 8: '*',\n 9: '(',\n 0: ')',\n Minus: '_',\n Equal: '+',\n BracketLeft: '{',\n BracketRight: '}',\n Backslash: '|',\n Semicolon: ':',\n Quote: '\"',\n Comma: '<',\n Period: '>',\n Slash: '?',\n Backquote: '~'\n }\n\n const shortcut = keyboardShortcuts.find(shortcut => {\n let matchesKey = false\n if (e.altKey && !e.shiftKey) {\n // mac adjusts the key value if altKey is pressed\n matchesKey = 'Key' + shortcut.key.toUpperCase() === e.code ||\n 'Digit' + shortcut.key.toUpperCase() === e.code ||\n shortcut.key === e.key ||\n specialCharMap[e.code] === shortcut.key\n } else if (e.shiftKey) {\n // check shift special character map\n const code = e.code.replace(/Key|Digit/, '')\n matchesKey = (shiftSpecialCharMap[code] || shiftSpecialCharMap[e.key]) &&\n (shiftSpecialCharMap[code] === shortcut.key || shiftSpecialCharMap[e.key] === shortcut.key)\n } else {\n matchesKey = shortcut.key.toUpperCase() === e.key.toUpperCase()\n }\n if (!matchesKey) return false\n\n let matchesModifier\n if (shortcut.modifier) {\n if (shortcut.modifier === shortcut.defaultModifier) matchesModifier = shortcut.os === 'windows' || shortcut.os === 'linux' ? e.ctrlKey : e.metaKey\n if (shortcut.modifier === 'meta') matchesModifier = e.metaKey\n if (shortcut.modifier === 'alt') matchesModifier = e.altKey\n if (shortcut.modifier === 'ctrl') matchesModifier = e.ctrlKey\n }\n return matchesModifier\n })\n\n if (shortcut) {\n e.preventDefault()\n shortcut.input.focus()\n }\n })\n\n // progressively enhance form elements that have the semanticForms class\n const forms = document.querySelectorAll('form.semanticForms:not(.semanticFormsActive), table.semanticForms:not(.semanticFormsActive)')\n\n for (const form of forms) {\n form.classList.add('semanticFormsActive')\n if (form.classList.contains('lowFlow')) continue\n\n // update each input in the semantic form\n const inputs = Array.from(form.querySelectorAll('input, textarea, select'))\n for (let input of inputs) {\n // ignore input if it has previously been formatted\n if (input.classList.contains('semanticform') || !input.id) continue\n\n const type = input.getAttribute('type')\n if (nodeNameLookup.includes(input.nodeName) || inputTypeLookup.includes(type)) {\n // recursively find <dl> element\n let dl = input.parentNode\n while (dl && dl.nodeName !== 'DL') dl = dl.parentNode\n\n if (!dl) continue\n if (!dl.classList.contains('floatLabelForm')) dl.classList.add('floatLabelForm')\n\n const label = input.parentNode.parentNode.id && (type === 'checkbox' || type === 'radio')\n ? document.querySelector('label[data-for=' + input.parentNode.parentNode.id.replace(/\\./g, '\\\\.') + ']')\n : document.querySelector('label[for=' + input.id.replace(/\\./g, '\\\\.') + ']')\n\n if (!label) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) without a properly associated label. Make sure there is a label for it and the label has a matching \"for\" attribute.`)\n }\n\n input.classList.add('semanticform')\n\n // #region create labels\n\n const newLabel = document.createElement('label')\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\n if (type === 'checkbox' || type === 'radio') {\n // recursively find <dd> element\n let dd = input.parentNode\n while (dd && dd.nodeName !== 'DD') dd = dd.parentNode\n\n if (!dd) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that is not inside a <dd> element.`)\n continue\n }\n\n if (dd.firstChild.nodeName !== 'LABEL') {\n if (type === 'checkbox' && input.parentNode.nodeName === 'DD') {\n newLabel.setAttribute('for', input.id)\n input.parentNode.classList.add('singleCheckbox')\n newLabel.className = ''\n label.setAttribute('hidden', 'hidden')\n insertAfter(newLabel, input)\n }\n\n if (type === 'radio' && input.parentNode.nodeName === 'DD') {\n newLabel.setAttribute('for', input.id)\n input.parentNode.classList.add('singleRadio')\n newLabel.className = ''\n label.setAttribute('hidden', 'hidden')\n insertAfter(newLabel, input)\n }\n\n newLabel.innerHTML = label.innerHTML\n\n if (label.hasAttribute('title') && label.getAttribute('data-show-help-icon') !== null && !label.querySelector('span.help')) {\n const text = label.getAttribute('title')\n label.innerHTML += ` <span title=\"${text}\" class=\"help\">${helpTextIcon}</span>`\n newLabel.innerHTML += ` <span title=\"${text}\" class=\"help\">${helpTextIcon}</span>`\n }\n\n if (dd.querySelector(':required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span.required')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n label.innerHTML += ` <span title=\"${text}\" class=\"required\">*</span>`\n newLabel.innerHTML += ` <span title=\"${text}\" class=\"required\">*</span>`\n }\n\n if (!dd.querySelector('label')) dd.append(newLabel)\n }\n\n // removes old div that a radio or checkbox may have been added to\n if (dd.parentElement.nodeName === 'DIV') dd.parentElement.remove()\n\n const div = document.createElement('div')\n div.append(label.closest('dt'), dd)\n dl.append(div)\n } else {\n newLabel.setAttribute('for', input.id)\n newLabel.innerHTML = label.innerHTML\n\n if (input.hasAttribute('title') && label.getAttribute('data-show-help-icon') !== null && !label.querySelector('span.help')) {\n const text = input.getAttribute('title')\n newLabel.innerHTML += ` <span title=\"${text}\" class=\"help\">${helpTextIcon}</span>`\n }\n\n if (input.hasAttribute('required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span.required')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n newLabel.innerHTML += ` <span title=\"${text}\" class=\"required\">*</span>`\n }\n\n label.setAttribute('hidden', 'hidden')\n\n insertAfter(newLabel, input)\n }\n // #endregion\n\n // #region keyboard shortcuts\n if (input.getAttribute('data-focus-key') !== null) {\n function handleKeyboardShortcut () {\n const os = getOS()\n // this is the custom keyword for meta on linux/mac, ctrl on windows\n const defaultModifier = 'metactrl'\n\n // get focus key value\n let focusKey = input.getAttribute('data-focus-key')\n if (focusKey.length > 1) {\n console.error(`Provided focus key \"${focusKey}\" is more than one character. Using first character only.`)\n focusKey = focusKey.toString()[0]\n }\n\n // get focus modifier value\n let modifierSymbol\n let modifierKey = defaultModifier\n const modifierAttr = {\n default: input.getAttribute('data-focus-modifier') || defaultModifier,\n linux: input.getAttribute('data-focus-modifier-linux'),\n mac: input.getAttribute('data-focus-modifier-mac'),\n windows: input.getAttribute('data-focus-modifier-win')\n }\n if (os && modifierAttr[os]) {\n // a specific modifier key has been set by the user\n modifierKey = modifierAttr[os]\n } else {\n modifierKey = modifierAttr.default\n }\n\n // validate passed in modifier\n const recognizedModifiers = ['ctrl', 'alt', 'opt', 'meta', 'cmd', defaultModifier]\n if (!recognizedModifiers.includes(modifierKey)) {\n console.error(`Received an unrecognized modifier, \"${modifierKey},\" defaulting to \"${defaultModifier}.\"`, input)\n modifierKey = defaultModifier\n }\n\n // retrieve modifier symbol\n if (['alt', 'opt'].includes(modifierKey)) {\n modifierSymbol = os === 'mac' ? '⌥' : '⎇'\n } else if (['meta', 'win', 'cmd'].includes(modifierKey) || (modifierKey === defaultModifier && os === 'mac')) {\n if (os === 'mac') {\n modifierSymbol = '⌘'\n } else if (os === 'linux') {\n modifierSymbol = '◆'\n } else {\n modifierSymbol = '⊞'\n }\n } else if (modifierKey === 'ctrl' || (modifierKey === defaultModifier && (os === 'windows' || os === 'linux'))) {\n if (os === 'mac') {\n modifierSymbol = '⌃'\n } else {\n modifierSymbol = 'Ctrl'\n }\n }\n\n // add the shortcut to the cached array, if not a duplicate\n if (keyboardShortcuts.some(shortcut => shortcut.key === focusKey && shortcut.modifier === modifierKey)) {\n console.error(`Duplicate keyboard shortcut \"${modifierKey} + ${focusKey}\" detected. Only the first input will be focusable using this keyboard shortcut.`, input)\n } else {\n keyboardShortcuts.push({\n key: focusKey,\n modifier: modifierKey,\n input,\n os,\n defaultModifier\n })\n }\n\n // set the shortcut indicator/title\n if (input.nodeName === 'TEXTAREA' || input.type === 'text' || input.type === 'number') {\n // create focus indicator for valid inputs\n const indicator = document.createElement('span')\n indicator.classList.add('focus-key')\n indicator.innerHTML = `<kbd>${modifierSymbol} ${focusKey.toUpperCase()}</kbd>`\n insertAfter(indicator, newLabel)\n } else {\n // update the input title\n if (input.getAttribute('title')) {\n input.setAttribute('title', input.getAttribute('title') + ` (${modifierSymbol} + ${focusKey})`)\n } else {\n input.setAttribute('title', `Focus with ${modifierSymbol} + ${focusKey}`)\n }\n }\n }\n\n // placed in a function so that it may exit while still completing other semantic-form enhancements\n handleKeyboardShortcut()\n }\n // #endregion\n\n // #region standard inputs\n // check for auto-grow attribute on textareas\n if (input.getAttribute('data-auto-grow') !== null) {\n // progressively enhance inputs into textareas\n if (input.nodeName === 'INPUT' && input.type === 'text') {\n const newInput = document.createElement('textarea')\n newInput.id = input.id\n newInput.class = input.class\n newInput.innerText = input.value\n newInput.setAttribute('data-auto-grow', '')\n input.replaceWith(newInput)\n input = newInput\n }\n\n if (input.nodeName === 'TEXTAREA') {\n // when pressing enter while this input is focused, we want to submit\n input.addEventListener('keypress', (e) => {\n if (e.key !== 'Enter' || (e.key === 'Enter' && e.shiftKey)) return\n e.preventDefault()\n form.requestSubmit()\n })\n }\n }\n\n if (type !== 'checkbox' && type !== 'radio') {\n if (!input.getAttribute('placeholder')) input.setAttribute('placeholder', ' ')\n\n const div = document.createElement('div')\n const dt = label.closest('dt')\n const dd = input.closest('dd')\n\n if (!dt) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that does not have a corresponding <dt> element.`)\n continue\n }\n if (!dd) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that does not have a corresponding <dd> element.`)\n continue\n }\n\n // #region input clear button\n if (input.nodeName !== 'SELECT' && type !== 'range') {\n const clearBtn = document.createElement('button')\n clearBtn.type = 'button'\n clearBtn.title = input.getAttribute('data-clear-field-text') || 'Clear field'\n clearBtn.ariaLabel = input.getAttribute('data-clear-field-text') || 'Clear field'\n clearBtn.tabIndex = -1\n clearBtn.innerHTML = '<svg viewBox=\"0 0 16 16\" width=\"18\" height=\"18\"><path d=\"M 1 1 L 15 15 M 1 15 L 15 1\" fill=\"none\" stroke-width=\"2\" stroke=\"currentColor\" />'\n clearBtn.classList.add('clear')\n clearBtn.id = `semanticFormsClearButton_${input.id}`\n clearBtn.addEventListener('click', () => {\n input.previousValue = input.value\n input.value = ''\n input.focus()\n lastClearFieldPressed = input.id\n\n // used for any other updates required by various inputs\n input.dispatchEvent(new Event('input', { bubbles: true }))\n })\n insertAfter(clearBtn, dd.querySelector('label'))\n }\n input.addEventListener('focus', event => {\n if (event.target.nodeName === 'INPUT') lastFocusedInput = event.target\n })\n // #endregion\n\n // check for colspan- utility class\n if (/colspan-/.test(dd.className)) {\n const match = dd.className.match(/colspan-([0-9]|full)/)[0]\n dd.classList.remove(match)\n div.classList.add(match)\n }\n\n // check for max-content attribute\n // this may be removed once fully supported in Firefox and Safari: https://caniuse.com/wf-field-sizing\n if (input.getAttribute('data-max-content') !== null) {\n if (!('fieldSizing' in document.createElement('input').style)) {\n const adjustWidth = () => {\n const value = input.value !== '' ? input.value : input.placeholder\n const width = value.length * 8 + 40\n input.style.width = width + 'px'\n input.style.maxWidth = '100%'\n div.style.width = width + 'px'\n }\n adjustWidth()\n input.addEventListener('input', adjustWidth)\n }\n }\n\n div.append(dt, dd)\n dl.append(div)\n\n // determine visibility of newly created <div>\n if (dt.style.display === 'none' && dd.style.display === 'none') div.style.display = 'none'\n }\n // #endregion\n\n // handle file input clear btn, cannot be handled with CSS\n if (type === 'file') {\n const clearBtn = input.parentElement.querySelector('.clear')\n input.addEventListener('input', event => {\n clearBtn.style.display = event.target.files.length ? 'flex' : 'none'\n })\n clearBtn.addEventListener('click', () => {\n clearBtn.style.display = 'none'\n })\n }\n\n // handle range inputs with a class to display the value\n if (type === 'range' && input.classList.contains('displayValue')) {\n const label = input.parentNode.parentNode.querySelector('dd label')\n label.innerHTML += `<span class=\"seperator\">: </span><output>${input.value}</output>`\n input.addEventListener('input', event => {\n const output = event.target.parentNode.parentNode.querySelector('output')\n output.innerHTML = event.target.value\n })\n }\n\n // #region show password button\n if (type === 'password' && input.getAttribute('data-no-reveal') === null) {\n const showBtn = document.createElement('button')\n showBtn.type = 'button'\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.tabIndex = -1\n showBtn.innerHTML = passwordShow\n showBtn.classList.add('show')\n showBtn.id = `semanticFormsShowButton_${input.id}`\n const dd = input.closest('dd')\n if (!dd) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that is not inside a <dd> element.`)\n continue\n }\n showBtn.addEventListener('click', () => {\n if (input.type === 'password') {\n showBtn.innerHTML = passwordHide\n showBtn.title = input.getAttribute('data-hide-password-text') || 'Hide password'\n showBtn.ariaLabel = input.getAttribute('data-hide-password-text') || 'Hide password'\n input.type = 'text'\n } else {\n showBtn.innerHTML = passwordShow\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n input.type = 'password'\n }\n input.focus()\n })\n insertAfter(showBtn, dd.querySelector('label'))\n }\n // #endregion\n\n // add listener to shift clear button when scrollbar present\n if (input.nodeName === 'TEXTAREA') {\n if (input.getAttribute('data-disable-autosize') === null) {\n // add auto-sizing\n input.style.setProperty('resize', 'none')\n input.style.setProperty('min-height', '0')\n input.style.setProperty('max-height', 'none')\n input.style.setProperty('height', 'auto')\n\n const handleInput = () => {\n // reset rows attribute to get accurate scrollHeight\n let maxRows = input.getAttribute('data-max-rows')\n\n if (maxRows) {\n if (isNaN(maxRows) || Number(maxRows) <= 0) {\n console.warn(`An invalid value was passed to the \"data-max-rows\" attribute. This value will be ignored.\\n\\nProvided value: ${input.getAttribute('data-max-rows')}`)\n maxRows = null\n }\n }\n\n const minRows = input.getAttribute('data-max-rows') && Number(input.getAttribute('data-max-rows')) < 5 ? input.getAttribute('data-max-rows') : '5'\n input.setAttribute('rows', minRows)\n\n // get the computed values object reference\n const style = window.getComputedStyle(input)\n\n // force content-box for size accurate line-height calculation, remove scrollbars, lock width (subtract inline padding and inline border widths), and remove inline padding and borders to keep width consistent (for text wrapping accuracy)\n const inlinePadding = parseFloat(style['padding-left']) + parseFloat(style['padding-right'])\n const inlineBorderWidth = parseFloat(style['border-left-width']) + parseFloat(style['border-right-width'])\n input.style.setProperty('overflow', 'hidden', 'important')\n input.style.setProperty('width', (parseFloat(style.width) - inlinePadding - inlineBorderWidth) + 'px')\n input.style.setProperty('box-sizing', 'content-box')\n input.style.setProperty('padding-inline', '0')\n input.style.setProperty('border-width', '0')\n\n // get the base line height, and top / bottom padding\n const blockPadding = parseFloat(style['padding-top']) + parseFloat(style['padding-bottom'])\n const lineHeight = style['line-height'] === 'normal'\n ? parseFloat(style.height) // if line-height is not explicitly set, use the computed height value (ignore padding due to content-box)\n : parseFloat(style['line-height']) // otherwise (line-height is explicitly set), use the computed line-height value\n\n // get the scroll height (rounding to be safe to ensure cross browser consistency)\n const scrollHeight = Math.round(input.scrollHeight)\n\n // undo overflow, width, border-width, box-sizing & inline padding overrides\n input.style.removeProperty('width')\n input.style.removeProperty('box-sizing')\n input.style.removeProperty('padding-inline')\n input.style.removeProperty('border-width')\n input.style.removeProperty('overflow')\n\n // subtract blockPadding from scrollHeight and divide that by our lineHeight to get the row count, round to nearest integer as it will always be within ~.1 of the correct whole number\n const rows = Math.round((scrollHeight - blockPadding) / lineHeight)\n\n // set the calculated rows attribute (limited by rowLimit)\n if (maxRows) {\n input.setAttribute('rows', '' + Math.min(rows, Number(maxRows)))\n } else {\n input.setAttribute('rows', '' + rows)\n }\n }\n\n input.addEventListener('input', handleInput)\n\n // trigger the event to set the initial rows value\n input.dispatchEvent(new Event('input', { bubbles: true }))\n }\n\n // progressively enhance textarea for Firefox and Safari\n // this may be removed once fully supported in Firefox and Safari: https://caniuse.com/wf-field-sizing\n if (input.getAttribute('data-auto-grow') !== null) {\n const adjustHeight = () => {\n if (input.value.length) {\n input.style.height = input.scrollHeight + 'px'\n } else {\n input.style.height = window.getComputedStyle(form).getPropertyValue('--semanticFormsInputHeight')\n }\n }\n\n // set initial height to semantic-forms CSS variable\n input.style.height = window.getComputedStyle(form).getPropertyValue('--semanticFormsInputHeight')\n input.addEventListener('input', adjustHeight)\n }\n\n // shifts the clear button to the right if a scrollbar is present\n const shiftClearBtn = () => {\n const clearBtn = input.parentElement?.querySelector('button.clear')\n if (clearBtn) clearBtn.style.marginRight = input.clientHeight < input.scrollHeight ? '15px' : ''\n }\n input.addEventListener('input', shiftClearBtn)\n input.addEventListener('mouseup', shiftClearBtn)\n shiftClearBtn()\n }\n }\n }\n }\n\n /**\n * Places an element immediately after another element\n * @param {Object} newNode element being placed after the reference node\n * @param {*} referenceNode element to be used as reference for new node\n */\n function insertAfter (newNode, referenceNode) {\n if (referenceNode.nextSibling) referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)\n else referenceNode.parentNode.appendChild(newNode)\n }\n\n /**\n * Uses the navigator to best determine the clients operating system.\n * @returns Operating system string (`mac`, `windows`, `linux`)\n */\n function getOS () {\n const userAgent = window.navigator.userAgent\n const platform = window.navigator.platform\n let os = null\n\n if (platform.includes('Win')) {\n os = 'windows'\n } else if (platform.includes('Mac') || /iPhone|iPad|iPod/.test(userAgent)) {\n os = 'mac'\n } else if (platform.includes('Linux') || /Android/.test(userAgent)) {\n os = 'linux'\n }\n return os\n }\n\n // handle undo/redo\n let lastFocusedInput\n let lastClearFieldPressed\n document.addEventListener('keydown', event => {\n if ((event.ctrlKey || event.metaKey) && event.key === 'z' && !event.shiftKey) {\n // undo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.previousValue) {\n lastFocusedInput.redoValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.previousValue\n }\n }\n }\n } else if ((event.ctrlKey && event.key === 'y') || (event.metaKey && event.shiftKey && event.key === 'z')) {\n // redo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.redoValue) {\n lastFocusedInput.previousValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.redoValue\n }\n }\n }\n }\n })\n\n // monitor changes to the DOM and enhance new semanticForms forms that get added\n if (!window.semanticFormsObserver) {\n window.semanticFormsObserver = new window.MutationObserver(mutations => {\n let stop = false\n for (const mutation of mutations) {\n for (const node of mutation.addedNodes) {\n if (node.nodeName === 'FORM' || node?.querySelector?.('form')) {\n semanticForms()\n stop = true\n }\n }\n if (stop) break\n }\n })\n window.semanticFormsObserver.observe(document.body, { attributes: false, childList: true, characterData: false, subtree: true })\n }\n\n semanticForms.reinitialize = form => {\n form.classList.remove('semanticFormsActive')\n semanticForms()\n }\n}\n\nmodule.exports = semanticForms\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(90);\n"],"names":["root","factory","exports","module","define","amd","this","semanticForms","document","getElementsByClassName","querySelector","body","classList","window","MutationObserver","console","warn","passwordShow","helpTextIcon","nodeNameLookup","inputTypeLookup","keyboardShortcuts","addEventListener","e","specialCharMap","Minus","Equal","BracketLeft","BracketRight","Backslash","Semicolon","Quote","Comma","Period","Slash","Backquote","shiftSpecialCharMap","shortcut","find","matchesModifier","matchesKey","altKey","shiftKey","key","toUpperCase","code","replace","modifier","defaultModifier","os","ctrlKey","metaKey","preventDefault","input","focus","forms","querySelectorAll","form","add","contains","inputs","Array","from","id","type","getAttribute","includes","nodeName","dl","parentNode","label","error","newLabel","createElement","className","dd","firstChild","setAttribute","insertAfter","innerHTML","hasAttribute","text","append","parentElement","remove","div","closest","handleKeyboardShortcut","getOS","modifierSymbol","focusKey","length","toString","modifierKey","modifierAttr","default","linux","mac","windows","some","push","indicator","newInput","class","innerText","value","replaceWith","requestSubmit","dt","clearBtn","title","ariaLabel","tabIndex","previousValue","lastClearFieldPressed","dispatchEvent","Event","bubbles","event","target","lastFocusedInput","test","match","style","adjustWidth","width","placeholder","maxWidth","display","files","showBtn","setProperty","handleInput","maxRows","isNaN","Number","minRows","getComputedStyle","inlinePadding","parseFloat","inlineBorderWidth","blockPadding","lineHeight","height","scrollHeight","Math","round","removeProperty","rows","min","adjustHeight","getPropertyValue","shiftClearBtn","marginRight","clientHeight","newNode","referenceNode","nextSibling","insertBefore","appendChild","userAgent","navigator","platform","name","redoValue","semanticFormsObserver","mutations","stop","mutation","node","addedNodes","observe","attributes","childList","characterData","subtree","reinitialize","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""}
1
+ {"version":3,"file":"semantic-forms.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,gBAAiB,GAAIH,GACF,iBAAZC,QACdA,QAAuB,cAAID,IAE3BD,EAAoB,cAAIC,GACzB,CATD,CASGK,KAAM,KACT,O,UCVA,MAAMC,EAAgB,KAEpB,GAA+C,mBAApCC,SAASC,wBAA2E,mBAA3BD,SAASE,gBAAiCF,SAASG,KAAKC,YAAcC,OAAOC,iBAE/I,YADAC,QAAQC,KAAK,+EAIf,MAAMC,EAAe,8SAEfC,EAAe,s7BAEfC,EAAiB,CAAC,WAAY,UAC9BC,EAAkB,CAAC,WAAY,QAAS,OAAQ,iBAAkB,QAAS,OAAQ,QAAS,QAAS,SAAU,WAAY,QAAS,QAAS,SAAU,MAAO,OAAQ,OAAQ,MAAO,QACrLC,EAAoB,GAG1Bb,SAASc,iBAAiB,UAAYC,IACpC,MAAMC,EAAiB,CACrBC,MAAO,IACPC,MAAO,IACPC,YAAa,IACbC,aAAc,IACdC,UAAW,KACXC,UAAW,IACXC,MAAO,IACPC,MAAO,IACPC,OAAQ,IACRC,MAAO,IACPC,UAAW,KAGPC,EAAsB,CAC1B,EAAG,IACH,EAAG,IACH,EAAG,IAC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AezH,IAC3BA,EAAK7C,UAAUwE,OAAO,uBACtB7E,MAIJJ,EAAOD,QAAUK,C,GCtmBb4K,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAapL,QAGrB,IAAIC,EAASgL,EAAyBE,GAAY,CAGjDnL,QAAS,CAAC,GAOX,OAHAsL,EAAoBH,GAAUlL,EAAQA,EAAOD,QAASkL,GAG/CjL,EAAOD,OACf,CCnB0BkL,CAAoB,I,MDF1CD","sources":["webpack://semanticForms/webpack/universalModuleDefinition","webpack://semanticForms/./semanticForms.js","webpack://semanticForms/webpack/bootstrap","webpack://semanticForms/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"semanticForms\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"semanticForms\"] = factory();\n\telse\n\t\troot[\"semanticForms\"] = factory();\n})(this, () => {\nreturn ","const semanticForms = () => {\n // do some feature detection so none of the JS executes if the browser is too old\n if (typeof document.getElementsByClassName !== 'function' || typeof document.querySelector !== 'function' || !document.body.classList || !window.MutationObserver) {\n console.warn('semantic-forms was loaded into an unsupported browser and will not execute.')\n return\n }\n\n const passwordShow = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m1 12s4-8 11-8 11 8 11 8\"/><path d=\"m1 12s4 8 11 8 11-8 11-8\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></g></svg>'\n const passwordHide = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m2 2 20 20\"/><path d=\"m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335\"/><path d=\"m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192\"/></g></svg>'\n const helpTextIcon = '<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" style=\"overflow:visible;\"><rect width=\"16\" height=\"16\" fill=\"none\"/><path fill=\"currentColor\" d=\"M8,10.5c-0.552,0-1,0.448-1,1c0,0.552,0.448,1,1,1c0.552,0,1-0.448,1-1C9,10.948,8.552,10.5,8,10.5z M8,0 C3.582,0,0,3.582,0,8c0,4.418,3.582,8,8,8s8-3.582,8-8C16,3.582,12.418,0,8,0z M12.243,12.243C11.109,13.376,9.603,14,8,14 s-3.109-0.624-4.243-1.757C2.624,11.109,2,9.603,2,8s0.624-3.109,1.757-4.243C4.891,2.624,6.397,2,8,2s3.109,0.624,4.243,1.757 C13.376,4.891,14,6.397,14,8C14,9.603,13.376,11.109,12.243,12.243z M7.927,3.755c-2.248,0-2.76,1.695-2.802,2.906h1.571 c0.028-0.256,0.101-1.418,1.221-1.418c0.672,0,1.206,0.406,1.206,1.175c0,0.695-0.724,1.155-1.303,1.711 C7.241,8.685,7.168,9.325,7.168,9.824V10c0.146,0,1.615,0,1.615,0V9.824c0-1.256,1.967-1.594,1.967-3.541 C10.75,5.059,9.874,3.755,7.927,3.755z\"/></svg>'\n\n const nodeNameLookup = ['TEXTAREA', 'SELECT']\n const inputTypeLookup = ['checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'image', 'month', 'number', 'password', 'radio', 'range', 'search', 'tel', 'text', 'time', 'url', 'week']\n const keyboardShortcuts = []\n\n // custom keyboard shortcut listener\n document.addEventListener('keydown', (e) => {\n const specialCharMap = {\n Minus: '-',\n Equal: '=',\n BracketLeft: '[',\n BracketRight: ']',\n Backslash: '\\\\',\n Semicolon: ';',\n Quote: '\\'',\n Comma: ',',\n Period: '.',\n Slash: '/',\n Backquote: '`'\n }\n\n const shiftSpecialCharMap = {\n 1: '!',\n 2: '@',\n 3: '#',\n 4: '$',\n 5: '%',\n 6: '^',\n 7: '&',\n 8: '*',\n 9: '(',\n 0: ')',\n Minus: '_',\n Equal: '+',\n BracketLeft: '{',\n BracketRight: '}',\n Backslash: '|',\n Semicolon: ':',\n Quote: '\"',\n Comma: '<',\n Period: '>',\n Slash: '?',\n Backquote: '~'\n }\n\n const shortcut = keyboardShortcuts.find(shortcut => {\n let matchesKey = false\n if (e.altKey && !e.shiftKey) {\n // mac adjusts the key value if altKey is pressed\n matchesKey = 'Key' + shortcut.key.toUpperCase() === e.code ||\n 'Digit' + shortcut.key.toUpperCase() === e.code ||\n shortcut.key === e.key ||\n specialCharMap[e.code] === shortcut.key\n } else if (e.shiftKey) {\n // check shift special character map\n const code = e.code.replace(/Key|Digit/, '')\n matchesKey = (shiftSpecialCharMap[code] || shiftSpecialCharMap[e.key]) &&\n (shiftSpecialCharMap[code] === shortcut.key || shiftSpecialCharMap[e.key] === shortcut.key)\n } else {\n matchesKey = shortcut.key.toUpperCase() === e.key.toUpperCase()\n }\n if (!matchesKey) return false\n\n let matchesModifier\n if (shortcut.modifier) {\n if (shortcut.modifier === shortcut.defaultModifier) matchesModifier = shortcut.os === 'windows' || shortcut.os === 'linux' ? e.ctrlKey : e.metaKey\n if (shortcut.modifier === 'meta') matchesModifier = e.metaKey\n if (shortcut.modifier === 'alt') matchesModifier = e.altKey\n if (shortcut.modifier === 'ctrl') matchesModifier = e.ctrlKey\n }\n return matchesModifier\n })\n\n if (shortcut) {\n e.preventDefault()\n shortcut.input.focus()\n }\n })\n\n // progressively enhance form elements that have the semanticForms class\n const forms = document.querySelectorAll('form.semanticForms:not(.semanticFormsActive), table.semanticForms:not(.semanticFormsActive)')\n\n for (const form of forms) {\n form.classList.add('semanticFormsActive')\n if (form.classList.contains('lowFlow')) continue\n\n // update each input in the semantic form\n const inputs = Array.from(form.querySelectorAll('input, textarea, select'))\n for (let input of inputs) {\n // ignore input if it has previously been formatted\n if (input.classList.contains('semanticform') || !input.id) continue\n\n const type = input.getAttribute('type')\n if (nodeNameLookup.includes(input.nodeName) || inputTypeLookup.includes(type)) {\n // recursively find <dl> element\n let dl = input.parentNode\n while (dl && dl.nodeName !== 'DL') dl = dl.parentNode\n\n if (!dl) continue\n if (!dl.classList.contains('floatLabelForm')) dl.classList.add('floatLabelForm')\n\n const label = input.parentNode.parentNode.id && (type === 'checkbox' || type === 'radio')\n ? document.querySelector('label[data-for=' + input.parentNode.parentNode.id.replace(/\\./g, '\\\\.') + ']')\n : document.querySelector('label[for=' + input.id.replace(/\\./g, '\\\\.') + ']')\n\n if (!label) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) without a properly associated label. Make sure there is a label for it and the label has a matching \"for\" attribute.`)\n }\n\n input.classList.add('semanticform')\n\n // #region create labels\n\n const newLabel = document.createElement('label')\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\n if (type === 'checkbox' || type === 'radio') {\n // recursively find <dd> element\n let dd = input.parentNode\n while (dd && dd.nodeName !== 'DD') dd = dd.parentNode\n\n if (!dd) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that is not inside a <dd> element.`)\n continue\n }\n\n if (dd.firstChild.nodeName !== 'LABEL') {\n if (type === 'checkbox' && input.parentNode.nodeName === 'DD') {\n newLabel.setAttribute('for', input.id)\n input.parentNode.classList.add('singleCheckbox')\n newLabel.className = ''\n label.setAttribute('hidden', 'hidden')\n insertAfter(newLabel, input)\n }\n\n if (type === 'radio' && input.parentNode.nodeName === 'DD') {\n newLabel.setAttribute('for', input.id)\n input.parentNode.classList.add('singleRadio')\n newLabel.className = ''\n label.setAttribute('hidden', 'hidden')\n insertAfter(newLabel, input)\n }\n\n newLabel.innerHTML = label.innerHTML\n\n if (label.hasAttribute('title') && label.getAttribute('data-show-help-icon') !== null && !label.querySelector('span.help')) {\n const text = label.getAttribute('title')\n label.innerHTML += ` <span title=\"${text}\" class=\"help\">${helpTextIcon}</span>`\n newLabel.innerHTML += ` <span title=\"${text}\" class=\"help\">${helpTextIcon}</span>`\n }\n\n if (dd.querySelector(':required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span.required')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n label.innerHTML += ` <span title=\"${text}\" class=\"required\">*</span>`\n newLabel.innerHTML += ` <span title=\"${text}\" class=\"required\">*</span>`\n }\n\n if (!dd.querySelector('label')) dd.append(newLabel)\n }\n\n // removes old div that a radio or checkbox may have been added to\n if (dd.parentElement.nodeName === 'DIV') dd.parentElement.remove()\n\n const div = document.createElement('div')\n div.append(label.closest('dt'), dd)\n dl.append(div)\n } else {\n newLabel.setAttribute('for', input.id)\n newLabel.innerHTML = label.innerHTML\n\n if (input.hasAttribute('title') && label.getAttribute('data-show-help-icon') !== null && !label.querySelector('span.help')) {\n const text = input.getAttribute('title')\n newLabel.innerHTML += ` <span title=\"${text}\" class=\"help\">${helpTextIcon}</span>`\n }\n\n if (input.hasAttribute('required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span.required')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n newLabel.innerHTML += ` <span title=\"${text}\" class=\"required\">*</span>`\n }\n\n label.setAttribute('hidden', 'hidden')\n\n insertAfter(newLabel, input)\n }\n // #endregion\n\n // #region keyboard shortcuts\n if (input.getAttribute('data-focus-key') !== null) {\n function handleKeyboardShortcut () {\n const os = getOS()\n // this is the custom keyword for meta on linux/mac, ctrl on windows\n const defaultModifier = 'metactrl'\n\n // get focus key value\n let focusKey = input.getAttribute('data-focus-key')\n if (focusKey.length > 1) {\n console.error(`Provided focus key \"${focusKey}\" is more than one character. Using first character only.`)\n focusKey = focusKey.toString()[0]\n }\n\n // get focus modifier value\n let modifierSymbol\n let modifierKey = defaultModifier\n const modifierAttr = {\n default: input.getAttribute('data-focus-modifier') || defaultModifier,\n linux: input.getAttribute('data-focus-modifier-linux'),\n mac: input.getAttribute('data-focus-modifier-mac'),\n windows: input.getAttribute('data-focus-modifier-win')\n }\n if (os && modifierAttr[os]) {\n // a specific modifier key has been set by the user\n modifierKey = modifierAttr[os]\n } else {\n modifierKey = modifierAttr.default\n }\n\n // validate passed in modifier\n const recognizedModifiers = ['ctrl', 'alt', 'opt', 'meta', 'cmd', defaultModifier]\n if (!recognizedModifiers.includes(modifierKey)) {\n console.error(`Received an unrecognized modifier, \"${modifierKey},\" defaulting to \"${defaultModifier}.\"`, input)\n modifierKey = defaultModifier\n }\n\n // retrieve modifier symbol\n if (['alt', 'opt'].includes(modifierKey)) {\n modifierSymbol = os === 'mac' ? '⌥' : '⎇'\n } else if (['meta', 'win', 'cmd'].includes(modifierKey) || (modifierKey === defaultModifier && os === 'mac')) {\n if (os === 'mac') {\n modifierSymbol = '⌘'\n } else if (os === 'linux') {\n modifierSymbol = '◆'\n } else {\n modifierSymbol = '⊞'\n }\n } else if (modifierKey === 'ctrl' || (modifierKey === defaultModifier && (os === 'windows' || os === 'linux'))) {\n if (os === 'mac') {\n modifierSymbol = '⌃'\n } else {\n modifierSymbol = 'Ctrl'\n }\n }\n\n // add the shortcut to the cached array, if not a duplicate\n if (keyboardShortcuts.some(shortcut => shortcut.key === focusKey && shortcut.modifier === modifierKey)) {\n console.error(`Duplicate keyboard shortcut \"${modifierKey} + ${focusKey}\" detected. Only the first input will be focusable using this keyboard shortcut.`, input)\n } else {\n keyboardShortcuts.push({\n key: focusKey,\n modifier: modifierKey,\n input,\n os,\n defaultModifier\n })\n }\n\n // set the shortcut indicator/title\n if (input.nodeName === 'TEXTAREA' || input.type === 'text' || input.type === 'number') {\n // create focus indicator for valid inputs\n const indicator = document.createElement('span')\n indicator.classList.add('focus-key')\n indicator.innerHTML = `<kbd>${modifierSymbol} ${focusKey.toUpperCase()}</kbd>`\n insertAfter(indicator, newLabel)\n } else {\n // update the input title\n if (input.getAttribute('title')) {\n input.setAttribute('title', input.getAttribute('title') + ` (${modifierSymbol} + ${focusKey})`)\n } else {\n input.setAttribute('title', `Focus with ${modifierSymbol} + ${focusKey}`)\n }\n }\n }\n\n // placed in a function so that it may exit while still completing other semantic-form enhancements\n handleKeyboardShortcut()\n }\n // #endregion\n\n // #region standard inputs\n // check for auto-grow attribute on textareas\n if (input.getAttribute('data-auto-grow') !== null) {\n // progressively enhance inputs into textareas\n if (input.nodeName === 'INPUT' && input.type === 'text') {\n const newInput = document.createElement('textarea')\n newInput.id = input.id\n newInput.class = input.class\n newInput.innerText = input.value\n newInput.setAttribute('data-auto-grow', '')\n input.replaceWith(newInput)\n input = newInput\n }\n\n if (input.nodeName === 'TEXTAREA') {\n // when pressing enter while this input is focused, we want to submit\n input.addEventListener('keypress', (e) => {\n if (e.key !== 'Enter' || (e.key === 'Enter' && e.shiftKey)) return\n e.preventDefault()\n form.requestSubmit()\n })\n }\n }\n\n if (type !== 'checkbox' && type !== 'radio') {\n if (!input.getAttribute('placeholder')) input.setAttribute('placeholder', ' ')\n\n const div = document.createElement('div')\n const dt = label.closest('dt')\n const dd = input.closest('dd')\n\n if (!dt) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that does not have a corresponding <dt> element.`)\n continue\n }\n if (!dd) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that does not have a corresponding <dd> element.`)\n continue\n }\n\n // #region input clear button\n if (input.nodeName !== 'SELECT' && type !== 'range') {\n const clearBtn = document.createElement('button')\n clearBtn.type = 'button'\n clearBtn.title = input.getAttribute('data-clear-field-text') || 'Clear field'\n clearBtn.ariaLabel = input.getAttribute('data-clear-field-text') || 'Clear field'\n clearBtn.tabIndex = -1\n clearBtn.innerHTML = '<svg viewBox=\"0 0 16 16\" width=\"18\" height=\"18\"><path d=\"M 1 1 L 15 15 M 1 15 L 15 1\" fill=\"none\" stroke-width=\"2\" stroke=\"currentColor\" />'\n clearBtn.classList.add('clear')\n clearBtn.id = `semanticFormsClearButton_${input.id}`\n clearBtn.addEventListener('click', () => {\n input.previousValue = input.value\n input.value = ''\n input.focus()\n lastClearFieldPressed = input.id\n\n // used for any other updates required by various inputs\n input.dispatchEvent(new Event('input', { bubbles: true }))\n })\n insertAfter(clearBtn, dd.querySelector('label'))\n }\n input.addEventListener('focus', event => {\n if (event.target.nodeName === 'INPUT') lastFocusedInput = event.target\n })\n // #endregion\n\n // check for colspan- utility class\n if (/colspan-/.test(dd.className)) {\n const match = dd.className.match(/colspan-([0-9]|full)/)[0]\n dd.classList.remove(match)\n div.classList.add(match)\n }\n\n // check for max-content attribute\n // this may be removed once fully supported in Firefox and Safari: https://caniuse.com/wf-field-sizing\n if (input.getAttribute('data-max-content') !== null) {\n if (!('fieldSizing' in document.createElement('input').style)) {\n const adjustWidth = () => {\n const value = input.value !== '' ? input.value : input.placeholder\n const width = value.length * 8 + 40\n input.style.width = width + 'px'\n input.style.maxWidth = '100%'\n div.style.width = width + 'px'\n }\n adjustWidth()\n input.addEventListener('input', adjustWidth)\n }\n }\n\n div.append(dt, dd)\n dl.append(div)\n\n // determine visibility of newly created <div>\n if (dt.style.display === 'none' && dd.style.display === 'none') div.style.display = 'none'\n }\n // #endregion\n\n // handle file input clear btn, cannot be handled with CSS\n if (type === 'file') {\n const clearBtn = input.parentElement.querySelector('.clear')\n input.addEventListener('input', event => {\n clearBtn.style.display = event.target.files.length ? 'flex' : 'none'\n })\n clearBtn.addEventListener('click', () => {\n clearBtn.style.display = 'none'\n })\n }\n\n // handle range inputs with a class to display the value\n if (type === 'range' && input.classList.contains('displayValue')) {\n const label = input.parentNode.parentNode.querySelector('dd label')\n label.innerHTML += `<span class=\"seperator\">: </span><output>${input.value}</output>`\n input.addEventListener('input', event => {\n const output = event.target.parentNode.parentNode.querySelector('output')\n output.innerHTML = event.target.value\n })\n }\n\n // #region show password button\n if (type === 'password' && input.getAttribute('data-no-reveal') === null) {\n const showBtn = document.createElement('button')\n showBtn.type = 'button'\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.tabIndex = -1\n showBtn.innerHTML = passwordShow\n showBtn.classList.add('show')\n showBtn.id = `semanticFormsShowButton_${input.id}`\n const dd = input.closest('dd')\n if (!dd) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that is not inside a <dd> element.`)\n continue\n }\n showBtn.addEventListener('click', () => {\n if (input.type === 'password') {\n showBtn.innerHTML = passwordHide\n showBtn.title = input.getAttribute('data-hide-password-text') || 'Hide password'\n showBtn.ariaLabel = input.getAttribute('data-hide-password-text') || 'Hide password'\n input.type = 'text'\n } else {\n showBtn.innerHTML = passwordShow\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n input.type = 'password'\n }\n input.focus()\n })\n insertAfter(showBtn, dd.querySelector('label'))\n }\n // #endregion\n\n // add listener to shift clear button when scrollbar present\n if (input.nodeName === 'TEXTAREA') {\n if (input.getAttribute('data-disable-autosize') === null) {\n // add auto-sizing\n input.style.setProperty('resize', 'none')\n input.style.setProperty('min-height', '0')\n input.style.setProperty('max-height', 'none')\n input.style.setProperty('height', 'auto')\n\n const handleInput = () => {\n // reset rows attribute to get accurate scrollHeight\n let maxRows = input.getAttribute('data-max-rows')\n\n if (maxRows) {\n if (isNaN(maxRows) || Number(maxRows) <= 0) {\n console.warn(`An invalid value was passed to the \"data-max-rows\" attribute. This value will be ignored.\\n\\nProvided value: ${input.getAttribute('data-max-rows')}`)\n maxRows = null\n }\n }\n\n const minRows = input.getAttribute('data-max-rows') && Number(input.getAttribute('data-max-rows')) < 5 ? input.getAttribute('data-max-rows') : '5'\n input.setAttribute('rows', minRows)\n\n // get the computed values object reference\n const style = window.getComputedStyle(input)\n\n // force content-box for size accurate line-height calculation, remove scrollbars, lock width (subtract inline padding and inline border widths), and remove inline padding and borders to keep width consistent (for text wrapping accuracy)\n const inlinePadding = parseFloat(style['padding-left']) + parseFloat(style['padding-right'])\n const inlineBorderWidth = parseFloat(style['border-left-width']) + parseFloat(style['border-right-width'])\n input.style.setProperty('overflow', 'hidden', 'important')\n input.style.setProperty('width', (parseFloat(style.width) - inlinePadding - inlineBorderWidth) + 'px')\n input.style.setProperty('box-sizing', 'content-box')\n input.style.setProperty('padding-inline', '0')\n input.style.setProperty('border-width', '0')\n\n // get the base line height, and top / bottom padding\n const blockPadding = parseFloat(style['padding-top']) + parseFloat(style['padding-bottom'])\n const lineHeight = style['line-height'] === 'normal'\n ? parseFloat(style.height) // if line-height is not explicitly set, use the computed height value (ignore padding due to content-box)\n : parseFloat(style['line-height']) // otherwise (line-height is explicitly set), use the computed line-height value\n\n // get the scroll height (rounding to be safe to ensure cross browser consistency)\n const scrollHeight = Math.round(input.scrollHeight)\n\n // undo overflow, width, border-width, box-sizing & inline padding overrides\n input.style.removeProperty('width')\n input.style.removeProperty('box-sizing')\n input.style.removeProperty('padding-inline')\n input.style.removeProperty('border-width')\n input.style.removeProperty('overflow')\n\n // subtract blockPadding from scrollHeight and divide that by our lineHeight to get the row count, round to nearest integer as it will always be within ~.1 of the correct whole number\n const rows = Math.round((scrollHeight - blockPadding) / lineHeight)\n\n // set the calculated rows attribute (limited by rowLimit)\n if (maxRows) {\n input.setAttribute('rows', '' + Math.min(rows, Number(maxRows)))\n } else {\n input.setAttribute('rows', '' + rows)\n }\n }\n\n input.addEventListener('input', handleInput)\n\n // trigger the event to set the initial rows value\n input.dispatchEvent(new Event('input', { bubbles: true }))\n }\n\n // progressively enhance textarea for Firefox and Safari\n // this may be removed once fully supported in Firefox and Safari: https://caniuse.com/wf-field-sizing\n if (input.getAttribute('data-auto-grow') !== null) {\n const adjustHeight = () => {\n if (input.value.length) {\n const borderWidth = parseInt(window.getComputedStyle(input).getPropertyValue('border-width'))\n input.style.height = (input.scrollHeight + (borderWidth * 2)) + 'px'\n } else {\n input.style.height = window.getComputedStyle(form).getPropertyValue('--semanticFormsInputHeight')\n }\n }\n\n // set initial height to semantic-forms CSS variable\n input.style.height = window.getComputedStyle(form).getPropertyValue('--semanticFormsInputHeight')\n input.addEventListener('input', adjustHeight)\n }\n\n // shifts the clear button to the right if a scrollbar is present\n const shiftClearBtn = () => {\n const clearBtn = input.parentElement?.querySelector('button.clear')\n if (clearBtn) clearBtn.style.marginRight = input.clientHeight < input.scrollHeight ? '15px' : ''\n }\n input.addEventListener('input', shiftClearBtn)\n input.addEventListener('mouseup', shiftClearBtn)\n shiftClearBtn()\n }\n }\n }\n }\n\n /**\n * Places an element immediately after another element\n * @param {Object} newNode element being placed after the reference node\n * @param {*} referenceNode element to be used as reference for new node\n */\n function insertAfter (newNode, referenceNode) {\n if (referenceNode.nextSibling) referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)\n else referenceNode.parentNode.appendChild(newNode)\n }\n\n /**\n * Uses the navigator to best determine the clients operating system.\n * @returns Operating system string (`mac`, `windows`, `linux`)\n */\n function getOS () {\n const userAgent = window.navigator.userAgent\n const platform = window.navigator.platform\n let os = null\n\n if (platform.includes('Win')) {\n os = 'windows'\n } else if (platform.includes('Mac') || /iPhone|iPad|iPod/.test(userAgent)) {\n os = 'mac'\n } else if (platform.includes('Linux') || /Android/.test(userAgent)) {\n os = 'linux'\n }\n return os\n }\n\n // handle undo/redo\n let lastFocusedInput\n let lastClearFieldPressed\n document.addEventListener('keydown', event => {\n if ((event.ctrlKey || event.metaKey) && event.key === 'z' && !event.shiftKey) {\n // undo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.previousValue) {\n lastFocusedInput.redoValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.previousValue\n }\n }\n }\n } else if ((event.ctrlKey && event.key === 'y') || (event.metaKey && event.shiftKey && event.key === 'z')) {\n // redo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.redoValue) {\n lastFocusedInput.previousValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.redoValue\n }\n }\n }\n }\n })\n\n // monitor changes to the DOM and enhance new semanticForms forms that get added\n if (!window.semanticFormsObserver) {\n window.semanticFormsObserver = new window.MutationObserver(mutations => {\n let stop = false\n for (const mutation of mutations) {\n for (const node of mutation.addedNodes) {\n if (node.nodeName === 'FORM' || node?.querySelector?.('form')) {\n semanticForms()\n stop = true\n }\n }\n if (stop) break\n }\n })\n window.semanticFormsObserver.observe(document.body, { attributes: false, childList: true, characterData: false, subtree: true })\n }\n\n semanticForms.reinitialize = form => {\n form.classList.remove('semanticFormsActive')\n semanticForms()\n }\n}\n\nmodule.exports = semanticForms\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(90);\n"],"names":["root","factory","exports","module","define","amd","this","semanticForms","document","getElementsByClassName","querySelector","body","classList","window","MutationObserver","console","warn","passwordShow","helpTextIcon","nodeNameLookup","inputTypeLookup","keyboardShortcuts","addEventListener","e","specialCharMap","Minus","Equal","BracketLeft","BracketRight","Backslash","Semicolon","Quote","Comma","Period","Slash","Backquote","shiftSpecialCharMap","shortcut","find","matchesModifier","matchesKey","altKey","shiftKey","key","toUpperCase","code","replace","modifier","defaultModifier","os","ctrlKey","metaKey","preventDefault","input","focus","forms","querySelectorAll","form","add","contains","inputs","Array","from","id","type","getAttribute","includes","nodeName","dl","parentNode","label","error","newLabel","createElement","className","dd","firstChild","setAttribute","insertAfter","innerHTML","hasAttribute","text","append","parentElement","remove","div","closest","handleKeyboardShortcut","getOS","modifierSymbol","focusKey","length","toString","modifierKey","modifierAttr","default","linux","mac","windows","some","push","indicator","newInput","class","innerText","value","replaceWith","requestSubmit","dt","clearBtn","title","ariaLabel","tabIndex","previousValue","lastClearFieldPressed","dispatchEvent","Event","bubbles","event","target","lastFocusedInput","test","match","style","adjustWidth","width","placeholder","maxWidth","display","files","showBtn","setProperty","handleInput","maxRows","isNaN","Number","minRows","getComputedStyle","inlinePadding","parseFloat","inlineBorderWidth","blockPadding","lineHeight","height","scrollHeight","Math","round","removeProperty","rows","min","adjustHeight","borderWidth","parseInt","getPropertyValue","shiftClearBtn","marginRight","clientHeight","newNode","referenceNode","nextSibling","insertBefore","appendChild","userAgent","navigator","platform","name","redoValue","semanticFormsObserver","mutations","stop","mutation","node","addedNodes","observe","attributes","childList","characterData","subtree","reinitialize","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- var e={90:e=>{const t=()=>{if("function"!=typeof document.getElementsByClassName||"function"!=typeof document.querySelector||!document.body.classList||!window.MutationObserver)return void console.warn("semantic-forms was loaded into an unsupported browser and will not execute.");const e='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m1 12s4-8 11-8 11 8 11 8"/><path d="m1 12s4 8 11 8 11-8 11-8"/><circle cx="12" cy="12" r="3"/></g></svg>',r='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16" version="1.1" style="overflow:visible;"><rect width="16" height="16" fill="none"/><path fill="currentColor" d="M8,10.5c-0.552,0-1,0.448-1,1c0,0.552,0.448,1,1,1c0.552,0,1-0.448,1-1C9,10.948,8.552,10.5,8,10.5z M8,0 C3.582,0,0,3.582,0,8c0,4.418,3.582,8,8,8s8-3.582,8-8C16,3.582,12.418,0,8,0z M12.243,12.243C11.109,13.376,9.603,14,8,14 s-3.109-0.624-4.243-1.757C2.624,11.109,2,9.603,2,8s0.624-3.109,1.757-4.243C4.891,2.624,6.397,2,8,2s3.109,0.624,4.243,1.757 C13.376,4.891,14,6.397,14,8C14,9.603,13.376,11.109,12.243,12.243z M7.927,3.755c-2.248,0-2.76,1.695-2.802,2.906h1.571 c0.028-0.256,0.101-1.418,1.221-1.418c0.672,0,1.206,0.406,1.206,1.175c0,0.695-0.724,1.155-1.303,1.711 C7.241,8.685,7.168,9.325,7.168,9.824V10c0.146,0,1.615,0,1.615,0V9.824c0-1.256,1.967-1.594,1.967-3.541 C10.75,5.059,9.874,3.755,7.927,3.755z"/></svg>',o=["TEXTAREA","SELECT"],a=["checkbox","color","date","datetime-local","email","file","image","month","number","password","radio","range","search","tel","text","time","url","week"],i=[];document.addEventListener("keydown",e=>{const t={Minus:"-",Equal:"=",BracketLeft:"[",BracketRight:"]",Backslash:"\\",Semicolon:";",Quote:"'",Comma:",",Period:".",Slash:"/",Backquote:"`"},r={1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")",Minus:"_",Equal:"+",BracketLeft:"{",BracketRight:"}",Backslash:"|",Semicolon:":",Quote:'"',Comma:"<",Period:">",Slash:"?",Backquote:"~"},o=i.find(o=>{let a,i=!1;if(e.altKey&&!e.shiftKey)i="Key"+o.key.toUpperCase()===e.code||"Digit"+o.key.toUpperCase()===e.code||o.key===e.key||t[e.code]===o.key;else if(e.shiftKey){const t=e.code.replace(/Key|Digit/,"");i=(r[t]||r[e.key])&&(r[t]===o.key||r[e.key]===o.key)}else i=o.key.toUpperCase()===e.key.toUpperCase();return!!i&&(o.modifier&&(o.modifier===o.defaultModifier&&(a="windows"===o.os||"linux"===o.os?e.ctrlKey:e.metaKey),"meta"===o.modifier&&(a=e.metaKey),"alt"===o.modifier&&(a=e.altKey),"ctrl"===o.modifier&&(a=e.ctrlKey)),a)});o&&(e.preventDefault(),o.input.focus())});const n=document.querySelectorAll("form.semanticForms:not(.semanticFormsActive), table.semanticForms:not(.semanticFormsActive)");for(const u of n){if(u.classList.add("semanticFormsActive"),u.classList.contains("lowFlow"))continue;const p=Array.from(u.querySelectorAll("input, textarea, select"));for(let m of p){if(m.classList.contains("semanticform")||!m.id)continue;const h=m.getAttribute("type");if(o.includes(m.nodeName)||a.includes(h)){let f=m.parentNode;for(;f&&"DL"!==f.nodeName;)f=f.parentNode;if(!f)continue;f.classList.contains("floatLabelForm")||f.classList.add("floatLabelForm");const y=!m.parentNode.parentNode.id||"checkbox"!==h&&"radio"!==h?document.querySelector("label[for="+m.id.replace(/\./g,"\\.")+"]"):document.querySelector("label[data-for="+m.parentNode.parentNode.id.replace(/\./g,"\\.")+"]");y||console.error(`semantic-forms: Found an input (${m.id||m.getAttribute("name")}) without a properly associated label. Make sure there is a label for it and the label has a matching "for" attribute.`),m.classList.add("semanticform");const b=document.createElement("label");if(b.className="floatLabelFormAnimatedLabel","checkbox"===h||"radio"===h){let g=m.parentNode;for(;g&&"DD"!==g.nodeName;)g=g.parentNode;if(!g){console.error(`semantic-forms: Found an input (${m.id||m.getAttribute("name")}) that is not inside a <dd> element.`);continue}if("LABEL"!==g.firstChild.nodeName){if("checkbox"===h&&"DD"===m.parentNode.nodeName&&(b.setAttribute("for",m.id),m.parentNode.classList.add("singleCheckbox"),b.className="",y.setAttribute("hidden","hidden"),s(b,m)),"radio"===h&&"DD"===m.parentNode.nodeName&&(b.setAttribute("for",m.id),m.parentNode.classList.add("singleRadio"),b.className="",y.setAttribute("hidden","hidden"),s(b,m)),b.innerHTML=y.innerHTML,y.hasAttribute("title")&&null!==y.getAttribute("data-show-help-icon")&&!y.querySelector("span.help")){const v=y.getAttribute("title");y.innerHTML+=` <span title="${v}" class="help">${r}</span>`,b.innerHTML+=` <span title="${v}" class="help">${r}</span>`}if(g.querySelector(":required")&&null===y.getAttribute("data-no-asterisk")&&!y.querySelector("span.required")){const A=y.getAttribute("data-asterisk-text")||"This field is required.";y.innerHTML+=` <span title="${A}" class="required">*</span>`,b.innerHTML+=` <span title="${A}" class="required">*</span>`}g.querySelector("label")||g.append(b)}"DIV"===g.parentElement.nodeName&&g.parentElement.remove();const w=document.createElement("div");w.append(y.closest("dt"),g),f.append(w)}else{if(b.setAttribute("for",m.id),b.innerHTML=y.innerHTML,m.hasAttribute("title")&&null!==y.getAttribute("data-show-help-icon")&&!y.querySelector("span.help")){const x=m.getAttribute("title");b.innerHTML+=` <span title="${x}" class="help">${r}</span>`}if(m.hasAttribute("required")&&null===y.getAttribute("data-no-asterisk")&&!y.querySelector("span.required")){const L=y.getAttribute("data-asterisk-text")||"This field is required.";b.innerHTML+=` <span title="${L}" class="required">*</span>`}y.setAttribute("hidden","hidden"),s(b,m)}if(null!==m.getAttribute("data-focus-key")){function k(){const e=l(),t="metactrl";let r,o=m.getAttribute("data-focus-key");o.length>1&&(console.error(`Provided focus key "${o}" is more than one character. Using first character only.`),o=o.toString()[0]);let a=t;const n={default:m.getAttribute("data-focus-modifier")||t,linux:m.getAttribute("data-focus-modifier-linux"),mac:m.getAttribute("data-focus-modifier-mac"),windows:m.getAttribute("data-focus-modifier-win")};a=e&&n[e]?n[e]:n.default;if(["ctrl","alt","opt","meta","cmd",t].includes(a)||(console.error(`Received an unrecognized modifier, "${a}," defaulting to "${t}."`,m),a=t),["alt","opt"].includes(a)?r="mac"===e?"⌥":"⎇":["meta","win","cmd"].includes(a)||a===t&&"mac"===e?r="mac"===e?"⌘":"linux"===e?"◆":"⊞":"ctrl"!==a&&(a!==t||"windows"!==e&&"linux"!==e)||(r="mac"===e?"⌃":"Ctrl"),i.some(e=>e.key===o&&e.modifier===a)?console.error(`Duplicate keyboard shortcut "${a} + ${o}" detected. Only the first input will be focusable using this keyboard shortcut.`,m):i.push({key:o,modifier:a,input:m,os:e,defaultModifier:t}),"TEXTAREA"===m.nodeName||"text"===m.type||"number"===m.type){const e=document.createElement("span");e.classList.add("focus-key"),e.innerHTML=`<kbd>${r} ${o.toUpperCase()}</kbd>`,s(e,b)}else m.getAttribute("title")?m.setAttribute("title",m.getAttribute("title")+` (${r} + ${o})`):m.setAttribute("title",`Focus with ${r} + ${o}`)}k()}if(null!==m.getAttribute("data-auto-grow")){if("INPUT"===m.nodeName&&"text"===m.type){const N=document.createElement("textarea");N.id=m.id,N.class=m.class,N.innerText=m.value,N.setAttribute("data-auto-grow",""),m.replaceWith(N),m=N}"TEXTAREA"===m.nodeName&&m.addEventListener("keypress",e=>{"Enter"!==e.key||"Enter"===e.key&&e.shiftKey||(e.preventDefault(),u.requestSubmit())})}if("checkbox"!==h&&"radio"!==h){m.getAttribute("placeholder")||m.setAttribute("placeholder"," ");const E=document.createElement("div"),S=y.closest("dt"),C=m.closest("dd");if(!S){console.error(`semantic-forms: Found an input (${m.id||m.getAttribute("name")}) that does not have a corresponding <dt> element.`);continue}if(!C){console.error(`semantic-forms: Found an input (${m.id||m.getAttribute("name")}) that does not have a corresponding <dd> element.`);continue}if("SELECT"!==m.nodeName&&"range"!==h){const F=document.createElement("button");F.type="button",F.title=m.getAttribute("data-clear-field-text")||"Clear field",F.ariaLabel=m.getAttribute("data-clear-field-text")||"Clear field",F.tabIndex=-1,F.innerHTML='<svg viewBox="0 0 16 16" width="18" height="18"><path d="M 1 1 L 15 15 M 1 15 L 15 1" fill="none" stroke-width="2" stroke="currentColor" />',F.classList.add("clear"),F.id=`semanticFormsClearButton_${m.id}`,F.addEventListener("click",()=>{m.previousValue=m.value,m.value="",m.focus(),c=m.id,m.dispatchEvent(new Event("input",{bubbles:!0}))}),s(F,C.querySelector("label"))}if(m.addEventListener("focus",e=>{"INPUT"===e.target.nodeName&&(d=e.target)}),/colspan-/.test(C.className)){const q=C.className.match(/colspan-([0-9]|full)/)[0];C.classList.remove(q),E.classList.add(q)}if(null!==m.getAttribute("data-max-content")&&!("fieldSizing"in document.createElement("input").style)){const M=()=>{const e=8*(""!==m.value?m.value:m.placeholder).length+40;m.style.width=e+"px",m.style.maxWidth="100%",E.style.width=e+"px"};M(),m.addEventListener("input",M)}E.append(S,C),f.append(E),"none"===S.style.display&&"none"===C.style.display&&(E.style.display="none")}if("file"===h){const $=m.parentElement.querySelector(".clear");m.addEventListener("input",e=>{$.style.display=e.target.files.length?"flex":"none"}),$.addEventListener("click",()=>{$.style.display="none"})}if("range"===h&&m.classList.contains("displayValue")){m.parentNode.parentNode.querySelector("dd label").innerHTML+=`<span class="seperator">: </span><output>${m.value}</output>`,m.addEventListener("input",e=>{e.target.parentNode.parentNode.querySelector("output").innerHTML=e.target.value})}if("password"===h&&null===m.getAttribute("data-no-reveal")){const T=document.createElement("button");T.type="button",T.title=m.getAttribute("data-show-password-text")||"Show password",T.ariaLabel=m.getAttribute("data-show-password-text")||"Show password",T.tabIndex=-1,T.innerHTML=e,T.classList.add("show"),T.id=`semanticFormsShowButton_${m.id}`;const H=m.closest("dd");if(!H){console.error(`semantic-forms: Found an input (${m.id||m.getAttribute("name")}) that is not inside a <dd> element.`);continue}T.addEventListener("click",()=>{"password"===m.type?(T.innerHTML='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m2 2 20 20"/><path d="m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335"/><path d="m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192"/></g></svg>',T.title=m.getAttribute("data-hide-password-text")||"Hide password",T.ariaLabel=m.getAttribute("data-hide-password-text")||"Hide password",m.type="text"):(T.innerHTML=e,T.title=m.getAttribute("data-show-password-text")||"Show password",T.ariaLabel=m.getAttribute("data-show-password-text")||"Show password",m.type="password"),m.focus()}),s(T,H.querySelector("label"))}if("TEXTAREA"===m.nodeName){if(null===m.getAttribute("data-disable-autosize")){m.style.setProperty("resize","none"),m.style.setProperty("min-height","0"),m.style.setProperty("max-height","none"),m.style.setProperty("height","auto");const B=()=>{let e=m.getAttribute("data-max-rows");e&&(isNaN(e)||Number(e)<=0)&&(console.warn(`An invalid value was passed to the "data-max-rows" attribute. This value will be ignored.\n\nProvided value: ${m.getAttribute("data-max-rows")}`),e=null);const t=m.getAttribute("data-max-rows")&&Number(m.getAttribute("data-max-rows"))<5?m.getAttribute("data-max-rows"):"5";m.setAttribute("rows",t);const r=window.getComputedStyle(m),o=parseFloat(r["padding-left"])+parseFloat(r["padding-right"]),a=parseFloat(r["border-left-width"])+parseFloat(r["border-right-width"]);m.style.setProperty("overflow","hidden","important"),m.style.setProperty("width",parseFloat(r.width)-o-a+"px"),m.style.setProperty("box-sizing","content-box"),m.style.setProperty("padding-inline","0"),m.style.setProperty("border-width","0");const i=parseFloat(r["padding-top"])+parseFloat(r["padding-bottom"]),n="normal"===r["line-height"]?parseFloat(r.height):parseFloat(r["line-height"]),s=Math.round(m.scrollHeight);m.style.removeProperty("width"),m.style.removeProperty("box-sizing"),m.style.removeProperty("padding-inline"),m.style.removeProperty("border-width"),m.style.removeProperty("overflow");const l=Math.round((s-i)/n);e?m.setAttribute("rows",""+Math.min(l,Number(e))):m.setAttribute("rows",""+l)};m.addEventListener("input",B),m.dispatchEvent(new Event("input",{bubbles:!0}))}if(null!==m.getAttribute("data-auto-grow")){const K=()=>{m.value.length?m.style.height=m.scrollHeight+"px":m.style.height=window.getComputedStyle(u).getPropertyValue("--semanticFormsInputHeight")};m.style.height=window.getComputedStyle(u).getPropertyValue("--semanticFormsInputHeight"),m.addEventListener("input",K)}const P=()=>{const e=m.parentElement?.querySelector("button.clear");e&&(e.style.marginRight=m.clientHeight<m.scrollHeight?"15px":"")};m.addEventListener("input",P),m.addEventListener("mouseup",P),P()}}}}function s(e,t){t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e)}function l(){const e=window.navigator.userAgent,t=window.navigator.platform;let r=null;return t.includes("Win")?r="windows":t.includes("Mac")||/iPhone|iPad|iPod/.test(e)?r="mac":(t.includes("Linux")||/Android/.test(e))&&(r="linux"),r}let d,c;document.addEventListener("keydown",e=>{!e.ctrlKey&&!e.metaKey||"z"!==e.key||e.shiftKey?(e.ctrlKey&&"y"===e.key||e.metaKey&&e.shiftKey&&"z"===e.key)&&d&&(d?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${c}`&&d?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${c}`||d.redoValue&&(d.previousValue=d.value,d.value=d.redoValue)):d&&(d?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${c}`&&d?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${c}`||d.previousValue&&(d.redoValue=d.value,d.value=d.previousValue))}),window.semanticFormsObserver||(window.semanticFormsObserver=new window.MutationObserver(e=>{let r=!1;for(const o of e){for(const e of o.addedNodes)("FORM"===e.nodeName||e?.querySelector?.("form"))&&(t(),r=!0);if(r)break}}),window.semanticFormsObserver.observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0})),t.reinitialize=e=>{e.classList.remove("semanticFormsActive"),t()}};e.exports=t}},t={};var r=function r(o){var a=t[o];if(void 0!==a)return a.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}(90);export{r as default};
1
+ var e={90:e=>{const t=()=>{if("function"!=typeof document.getElementsByClassName||"function"!=typeof document.querySelector||!document.body.classList||!window.MutationObserver)return void console.warn("semantic-forms was loaded into an unsupported browser and will not execute.");const e='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m1 12s4-8 11-8 11 8 11 8"/><path d="m1 12s4 8 11 8 11-8 11-8"/><circle cx="12" cy="12" r="3"/></g></svg>',r='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16" version="1.1" style="overflow:visible;"><rect width="16" height="16" fill="none"/><path fill="currentColor" d="M8,10.5c-0.552,0-1,0.448-1,1c0,0.552,0.448,1,1,1c0.552,0,1-0.448,1-1C9,10.948,8.552,10.5,8,10.5z M8,0 C3.582,0,0,3.582,0,8c0,4.418,3.582,8,8,8s8-3.582,8-8C16,3.582,12.418,0,8,0z M12.243,12.243C11.109,13.376,9.603,14,8,14 s-3.109-0.624-4.243-1.757C2.624,11.109,2,9.603,2,8s0.624-3.109,1.757-4.243C4.891,2.624,6.397,2,8,2s3.109,0.624,4.243,1.757 C13.376,4.891,14,6.397,14,8C14,9.603,13.376,11.109,12.243,12.243z M7.927,3.755c-2.248,0-2.76,1.695-2.802,2.906h1.571 c0.028-0.256,0.101-1.418,1.221-1.418c0.672,0,1.206,0.406,1.206,1.175c0,0.695-0.724,1.155-1.303,1.711 C7.241,8.685,7.168,9.325,7.168,9.824V10c0.146,0,1.615,0,1.615,0V9.824c0-1.256,1.967-1.594,1.967-3.541 C10.75,5.059,9.874,3.755,7.927,3.755z"/></svg>',o=["TEXTAREA","SELECT"],a=["checkbox","color","date","datetime-local","email","file","image","month","number","password","radio","range","search","tel","text","time","url","week"],i=[];document.addEventListener("keydown",e=>{const t={Minus:"-",Equal:"=",BracketLeft:"[",BracketRight:"]",Backslash:"\\",Semicolon:";",Quote:"'",Comma:",",Period:".",Slash:"/",Backquote:"`"},r={1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")",Minus:"_",Equal:"+",BracketLeft:"{",BracketRight:"}",Backslash:"|",Semicolon:":",Quote:'"',Comma:"<",Period:">",Slash:"?",Backquote:"~"},o=i.find(o=>{let a,i=!1;if(e.altKey&&!e.shiftKey)i="Key"+o.key.toUpperCase()===e.code||"Digit"+o.key.toUpperCase()===e.code||o.key===e.key||t[e.code]===o.key;else if(e.shiftKey){const t=e.code.replace(/Key|Digit/,"");i=(r[t]||r[e.key])&&(r[t]===o.key||r[e.key]===o.key)}else i=o.key.toUpperCase()===e.key.toUpperCase();return!!i&&(o.modifier&&(o.modifier===o.defaultModifier&&(a="windows"===o.os||"linux"===o.os?e.ctrlKey:e.metaKey),"meta"===o.modifier&&(a=e.metaKey),"alt"===o.modifier&&(a=e.altKey),"ctrl"===o.modifier&&(a=e.ctrlKey)),a)});o&&(e.preventDefault(),o.input.focus())});const n=document.querySelectorAll("form.semanticForms:not(.semanticFormsActive), table.semanticForms:not(.semanticFormsActive)");for(const u of n){if(u.classList.add("semanticFormsActive"),u.classList.contains("lowFlow"))continue;const p=Array.from(u.querySelectorAll("input, textarea, select"));for(let m of p){if(m.classList.contains("semanticform")||!m.id)continue;const h=m.getAttribute("type");if(o.includes(m.nodeName)||a.includes(h)){let f=m.parentNode;for(;f&&"DL"!==f.nodeName;)f=f.parentNode;if(!f)continue;f.classList.contains("floatLabelForm")||f.classList.add("floatLabelForm");const y=!m.parentNode.parentNode.id||"checkbox"!==h&&"radio"!==h?document.querySelector("label[for="+m.id.replace(/\./g,"\\.")+"]"):document.querySelector("label[data-for="+m.parentNode.parentNode.id.replace(/\./g,"\\.")+"]");y||console.error(`semantic-forms: Found an input (${m.id||m.getAttribute("name")}) without a properly associated label. Make sure there is a label for it and the label has a matching "for" attribute.`),m.classList.add("semanticform");const b=document.createElement("label");if(b.className="floatLabelFormAnimatedLabel","checkbox"===h||"radio"===h){let g=m.parentNode;for(;g&&"DD"!==g.nodeName;)g=g.parentNode;if(!g){console.error(`semantic-forms: Found an input (${m.id||m.getAttribute("name")}) that is not inside a <dd> element.`);continue}if("LABEL"!==g.firstChild.nodeName){if("checkbox"===h&&"DD"===m.parentNode.nodeName&&(b.setAttribute("for",m.id),m.parentNode.classList.add("singleCheckbox"),b.className="",y.setAttribute("hidden","hidden"),s(b,m)),"radio"===h&&"DD"===m.parentNode.nodeName&&(b.setAttribute("for",m.id),m.parentNode.classList.add("singleRadio"),b.className="",y.setAttribute("hidden","hidden"),s(b,m)),b.innerHTML=y.innerHTML,y.hasAttribute("title")&&null!==y.getAttribute("data-show-help-icon")&&!y.querySelector("span.help")){const v=y.getAttribute("title");y.innerHTML+=` <span title="${v}" class="help">${r}</span>`,b.innerHTML+=` <span title="${v}" class="help">${r}</span>`}if(g.querySelector(":required")&&null===y.getAttribute("data-no-asterisk")&&!y.querySelector("span.required")){const A=y.getAttribute("data-asterisk-text")||"This field is required.";y.innerHTML+=` <span title="${A}" class="required">*</span>`,b.innerHTML+=` <span title="${A}" class="required">*</span>`}g.querySelector("label")||g.append(b)}"DIV"===g.parentElement.nodeName&&g.parentElement.remove();const w=document.createElement("div");w.append(y.closest("dt"),g),f.append(w)}else{if(b.setAttribute("for",m.id),b.innerHTML=y.innerHTML,m.hasAttribute("title")&&null!==y.getAttribute("data-show-help-icon")&&!y.querySelector("span.help")){const x=m.getAttribute("title");b.innerHTML+=` <span title="${x}" class="help">${r}</span>`}if(m.hasAttribute("required")&&null===y.getAttribute("data-no-asterisk")&&!y.querySelector("span.required")){const L=y.getAttribute("data-asterisk-text")||"This field is required.";b.innerHTML+=` <span title="${L}" class="required">*</span>`}y.setAttribute("hidden","hidden"),s(b,m)}if(null!==m.getAttribute("data-focus-key")){function k(){const e=l(),t="metactrl";let r,o=m.getAttribute("data-focus-key");o.length>1&&(console.error(`Provided focus key "${o}" is more than one character. Using first character only.`),o=o.toString()[0]);let a=t;const n={default:m.getAttribute("data-focus-modifier")||t,linux:m.getAttribute("data-focus-modifier-linux"),mac:m.getAttribute("data-focus-modifier-mac"),windows:m.getAttribute("data-focus-modifier-win")};a=e&&n[e]?n[e]:n.default;if(["ctrl","alt","opt","meta","cmd",t].includes(a)||(console.error(`Received an unrecognized modifier, "${a}," defaulting to "${t}."`,m),a=t),["alt","opt"].includes(a)?r="mac"===e?"⌥":"⎇":["meta","win","cmd"].includes(a)||a===t&&"mac"===e?r="mac"===e?"⌘":"linux"===e?"◆":"⊞":"ctrl"!==a&&(a!==t||"windows"!==e&&"linux"!==e)||(r="mac"===e?"⌃":"Ctrl"),i.some(e=>e.key===o&&e.modifier===a)?console.error(`Duplicate keyboard shortcut "${a} + ${o}" detected. Only the first input will be focusable using this keyboard shortcut.`,m):i.push({key:o,modifier:a,input:m,os:e,defaultModifier:t}),"TEXTAREA"===m.nodeName||"text"===m.type||"number"===m.type){const e=document.createElement("span");e.classList.add("focus-key"),e.innerHTML=`<kbd>${r} ${o.toUpperCase()}</kbd>`,s(e,b)}else m.getAttribute("title")?m.setAttribute("title",m.getAttribute("title")+` (${r} + ${o})`):m.setAttribute("title",`Focus with ${r} + ${o}`)}k()}if(null!==m.getAttribute("data-auto-grow")){if("INPUT"===m.nodeName&&"text"===m.type){const N=document.createElement("textarea");N.id=m.id,N.class=m.class,N.innerText=m.value,N.setAttribute("data-auto-grow",""),m.replaceWith(N),m=N}"TEXTAREA"===m.nodeName&&m.addEventListener("keypress",e=>{"Enter"!==e.key||"Enter"===e.key&&e.shiftKey||(e.preventDefault(),u.requestSubmit())})}if("checkbox"!==h&&"radio"!==h){m.getAttribute("placeholder")||m.setAttribute("placeholder"," ");const E=document.createElement("div"),S=y.closest("dt"),C=m.closest("dd");if(!S){console.error(`semantic-forms: Found an input (${m.id||m.getAttribute("name")}) that does not have a corresponding <dt> element.`);continue}if(!C){console.error(`semantic-forms: Found an input (${m.id||m.getAttribute("name")}) that does not have a corresponding <dd> element.`);continue}if("SELECT"!==m.nodeName&&"range"!==h){const F=document.createElement("button");F.type="button",F.title=m.getAttribute("data-clear-field-text")||"Clear field",F.ariaLabel=m.getAttribute("data-clear-field-text")||"Clear field",F.tabIndex=-1,F.innerHTML='<svg viewBox="0 0 16 16" width="18" height="18"><path d="M 1 1 L 15 15 M 1 15 L 15 1" fill="none" stroke-width="2" stroke="currentColor" />',F.classList.add("clear"),F.id=`semanticFormsClearButton_${m.id}`,F.addEventListener("click",()=>{m.previousValue=m.value,m.value="",m.focus(),c=m.id,m.dispatchEvent(new Event("input",{bubbles:!0}))}),s(F,C.querySelector("label"))}if(m.addEventListener("focus",e=>{"INPUT"===e.target.nodeName&&(d=e.target)}),/colspan-/.test(C.className)){const q=C.className.match(/colspan-([0-9]|full)/)[0];C.classList.remove(q),E.classList.add(q)}if(null!==m.getAttribute("data-max-content")&&!("fieldSizing"in document.createElement("input").style)){const M=()=>{const e=8*(""!==m.value?m.value:m.placeholder).length+40;m.style.width=e+"px",m.style.maxWidth="100%",E.style.width=e+"px"};M(),m.addEventListener("input",M)}E.append(S,C),f.append(E),"none"===S.style.display&&"none"===C.style.display&&(E.style.display="none")}if("file"===h){const $=m.parentElement.querySelector(".clear");m.addEventListener("input",e=>{$.style.display=e.target.files.length?"flex":"none"}),$.addEventListener("click",()=>{$.style.display="none"})}if("range"===h&&m.classList.contains("displayValue")){m.parentNode.parentNode.querySelector("dd label").innerHTML+=`<span class="seperator">: </span><output>${m.value}</output>`,m.addEventListener("input",e=>{e.target.parentNode.parentNode.querySelector("output").innerHTML=e.target.value})}if("password"===h&&null===m.getAttribute("data-no-reveal")){const T=document.createElement("button");T.type="button",T.title=m.getAttribute("data-show-password-text")||"Show password",T.ariaLabel=m.getAttribute("data-show-password-text")||"Show password",T.tabIndex=-1,T.innerHTML=e,T.classList.add("show"),T.id=`semanticFormsShowButton_${m.id}`;const P=m.closest("dd");if(!P){console.error(`semantic-forms: Found an input (${m.id||m.getAttribute("name")}) that is not inside a <dd> element.`);continue}T.addEventListener("click",()=>{"password"===m.type?(T.innerHTML='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m2 2 20 20"/><path d="m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335"/><path d="m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192"/></g></svg>',T.title=m.getAttribute("data-hide-password-text")||"Hide password",T.ariaLabel=m.getAttribute("data-hide-password-text")||"Hide password",m.type="text"):(T.innerHTML=e,T.title=m.getAttribute("data-show-password-text")||"Show password",T.ariaLabel=m.getAttribute("data-show-password-text")||"Show password",m.type="password"),m.focus()}),s(T,P.querySelector("label"))}if("TEXTAREA"===m.nodeName){if(null===m.getAttribute("data-disable-autosize")){m.style.setProperty("resize","none"),m.style.setProperty("min-height","0"),m.style.setProperty("max-height","none"),m.style.setProperty("height","auto");const B=()=>{let e=m.getAttribute("data-max-rows");e&&(isNaN(e)||Number(e)<=0)&&(console.warn(`An invalid value was passed to the "data-max-rows" attribute. This value will be ignored.\n\nProvided value: ${m.getAttribute("data-max-rows")}`),e=null);const t=m.getAttribute("data-max-rows")&&Number(m.getAttribute("data-max-rows"))<5?m.getAttribute("data-max-rows"):"5";m.setAttribute("rows",t);const r=window.getComputedStyle(m),o=parseFloat(r["padding-left"])+parseFloat(r["padding-right"]),a=parseFloat(r["border-left-width"])+parseFloat(r["border-right-width"]);m.style.setProperty("overflow","hidden","important"),m.style.setProperty("width",parseFloat(r.width)-o-a+"px"),m.style.setProperty("box-sizing","content-box"),m.style.setProperty("padding-inline","0"),m.style.setProperty("border-width","0");const i=parseFloat(r["padding-top"])+parseFloat(r["padding-bottom"]),n="normal"===r["line-height"]?parseFloat(r.height):parseFloat(r["line-height"]),s=Math.round(m.scrollHeight);m.style.removeProperty("width"),m.style.removeProperty("box-sizing"),m.style.removeProperty("padding-inline"),m.style.removeProperty("border-width"),m.style.removeProperty("overflow");const l=Math.round((s-i)/n);e?m.setAttribute("rows",""+Math.min(l,Number(e))):m.setAttribute("rows",""+l)};m.addEventListener("input",B),m.dispatchEvent(new Event("input",{bubbles:!0}))}if(null!==m.getAttribute("data-auto-grow")){const K=()=>{if(m.value.length){const e=parseInt(window.getComputedStyle(m).getPropertyValue("border-width"));m.style.height=m.scrollHeight+2*e+"px"}else m.style.height=window.getComputedStyle(u).getPropertyValue("--semanticFormsInputHeight")};m.style.height=window.getComputedStyle(u).getPropertyValue("--semanticFormsInputHeight"),m.addEventListener("input",K)}const H=()=>{const e=m.parentElement?.querySelector("button.clear");e&&(e.style.marginRight=m.clientHeight<m.scrollHeight?"15px":"")};m.addEventListener("input",H),m.addEventListener("mouseup",H),H()}}}}function s(e,t){t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e)}function l(){const e=window.navigator.userAgent,t=window.navigator.platform;let r=null;return t.includes("Win")?r="windows":t.includes("Mac")||/iPhone|iPad|iPod/.test(e)?r="mac":(t.includes("Linux")||/Android/.test(e))&&(r="linux"),r}let d,c;document.addEventListener("keydown",e=>{!e.ctrlKey&&!e.metaKey||"z"!==e.key||e.shiftKey?(e.ctrlKey&&"y"===e.key||e.metaKey&&e.shiftKey&&"z"===e.key)&&d&&(d?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${c}`&&d?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${c}`||d.redoValue&&(d.previousValue=d.value,d.value=d.redoValue)):d&&(d?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${c}`&&d?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${c}`||d.previousValue&&(d.redoValue=d.value,d.value=d.previousValue))}),window.semanticFormsObserver||(window.semanticFormsObserver=new window.MutationObserver(e=>{let r=!1;for(const o of e){for(const e of o.addedNodes)("FORM"===e.nodeName||e?.querySelector?.("form"))&&(t(),r=!0);if(r)break}}),window.semanticFormsObserver.observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0})),t.reinitialize=e=>{e.classList.remove("semanticFormsActive"),t()}};e.exports=t}},t={};var r=function r(o){var a=t[o];if(void 0!==a)return a.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}(90);export{r as default};
2
2
  //# sourceMappingURL=semantic-forms.min.mjs.map