semantic-forms 5.3.5 → 5.3.6
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.
- package/CHANGELOG.md +20 -0
- package/CONTRIBUTING.md +39 -7
- package/dist/semantic-forms.cjs +119 -52
- package/dist/semantic-forms.cjs.map +1 -1
- package/dist/semantic-forms.css +497 -177
- package/dist/semantic-forms.css.map +1 -1
- package/dist/semantic-forms.js +153 -80
- package/dist/semantic-forms.js.map +1 -1
- package/dist/semantic-forms.min.js +1 -1
- package/dist/semantic-forms.min.js.map +1 -1
- package/dist/semantic-forms.min.mjs +1 -1
- package/dist/semantic-forms.min.mjs.map +1 -1
- package/dist/semantic-forms.mjs +120 -53
- package/dist/semantic-forms.mjs.map +1 -1
- package/docs/statics/css/semantic-forms-styles.scss +14 -1
- package/docs/statics/js/semantic-forms-demo.js +16 -0
- package/docs/statics/js/semantic-forms-main.js +3 -2
- package/docs/statics/pages/buttons.html +98 -0
- package/docs/statics/pages/checkboxes.html +130 -0
- package/docs/statics/pages/fullDemo.html +1078 -821
- package/docs/statics/pages/inputs.html +384 -0
- package/docs/statics/pages/layout.html +521 -0
- package/docs/statics/pages/layouts/main.html +9 -1
- package/docs/statics/pages/theming.html +39 -0
- package/docs/statics/pages/usage.html +17 -799
- package/package.json +27 -13
- package/semanticForms.js +33 -8
- package/semanticForms.scss +13 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-forms.js","mappings":"CAAA,SAA2CA,KAAMC,SAChD,UAAUC,UAAY,iBAAmBC,SAAW,SACnDA,OAAOD,QAAUD,eACb,UAAUG,SAAW,YAAcA,OAAOC,IAC9CD,OAAO,gBAAiB,GAAIH,cACxB,UAAUC,UAAY,SAC1BA,QAAQ,iBAAmBD,eAE3BD,KAAK,iBAAmBC,SACzB,EATD,CASGK,KAAM,Y;;;6DCTT,MAAM,uBAAwB,kBAAuB,oBAAQ,KAC7D,MAAM,aAAc,gBAAqB,oBAA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BAAoBH,UAAU5L,OAAQA,OAAOD,QAAS4L;;;QAGtD,OAAO3L,OAAOD;QACf;;;;;;;QCnBA,IAAIiM,oBAAsBL,oBAAoB","sources":["webpack://semanticForms/webpack/universalModuleDefinition","webpack://semanticForms/./semanticForms.js","webpack://semanticForms/./lib/keyboardShortcuts.js","webpack://semanticForms/./lib/helpers.js","webpack://semanticForms/./lib/inputEnhancements.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 { createKeyboardShortcut, shortcutListener } = require('./lib/keyboardShortcuts.js')\nconst { enhanceInput, handleUndoRedo } = require('./lib/inputEnhancements.js')\n\nconst 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 // custom keyboard shortcut listener\n const keyboardShortcuts = []\n document.addEventListener('keydown', (e) => shortcutListener(e, keyboardShortcuts))\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 (const input of inputs) {\n enhanceInput(input, form)\n\n // handle keyboard shortcuts\n if (input.getAttribute('data-focus-key') !== null) {\n const shortcut = createKeyboardShortcut(input, keyboardShortcuts)\n keyboardShortcuts.push(shortcut)\n }\n }\n }\n\n // prevents multiple listeners\n document.removeEventListener('keydown', handleUndoRedo)\n document.addEventListener('keydown', handleUndoRedo)\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","const { getOS, insertAfter } = require('./helpers.js')\n\nconst specialCharMap = {\n Minus: '-',\n Equal: '=',\n BracketLeft: '[',\n BracketRight: ']',\n Backslash: '\\\\',\n Semicolon: ';',\n Quote: '\\'',\n Comma: ',',\n Period: '.',\n Slash: '/',\n Backquote: '`'\n}\nconst 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// handles keyboard shortcut events\nconst shortcutListener = (e, shortcuts) => {\n // search for matching shortcut from cached shortcut configs\n const shortcut = shortcuts.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\nconst createKeyboardShortcut = (input, shortcuts) => {\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 (shortcuts.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 }\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\n const label = input.nextSibling\n insertAfter(indicator, label)\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 return {\n key: focusKey,\n modifier: modifierKey,\n input,\n os,\n defaultModifier\n }\n}\n\nmodule.exports = {\n shortcutListener,\n createKeyboardShortcut\n}\n","/**\n * Uses the navigator to best determine the clients operating system.\n * @returns Operating system string (`mac`, `windows`, `linux`)\n */\nconst 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/**\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 */\nconst insertAfter = (newNode, referenceNode) => {\n if (referenceNode.nextSibling) referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)\n else referenceNode.parentNode.appendChild(newNode)\n}\n\nmodule.exports = { getOS, insertAfter }\n","const { insertAfter } = require('./helpers.js')\n\nconst icons = {\n 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 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 helpIcon: '<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\nconst lookups = {\n nodeName: ['TEXTAREA', 'SELECT'],\n inputType: ['checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'image', 'month', 'number', 'password', 'radio', 'range', 'search', 'tel', 'text', 'time', 'url', 'week']\n}\n\nlet lastFocusedInput\nlet lastClearFieldPressed\n\nconst enhanceInput = (input, form) => {\n // ignore input if it has previously been formatted\n if (input.classList.contains('semanticform') || !input.id) return\n\n const type = input.getAttribute('type')\n if (!lookups.nodeName.includes(input.nodeName) && !lookups.inputType.includes(type)) return\n\n // recursively find <dl> element\n let dl = input.parentNode\n while (dl && dl.nodeName !== 'DL') dl = dl.parentNode\n if (!dl) return\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 const isWrapped = input.closest('dd').parentElement.nodeName === 'DIV'\n\n // #region create labels\n\n const newLabel = document.createElement('label')\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\n if (type === 'checkbox' || type === 'radio') {\n const div = isWrapped ? input.closest('dd').parentElement : document.createElement('div')\n const dt = label.closest('dt')\n const dd = input.closest('dd')\n\n if (!dt || !dd) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that is not inside a <dd> element.`)\n return\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\">${icons.helpIcon}</span>`\n newLabel.innerHTML += ` <span title=\"${text}\" class=\"help\">${icons.helpIcon}</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 // if the user did not wrap the input in a div, do it for them\n if (!isWrapped) {\n div.append(dt, dd)\n\n // determine visibility of newly created <div>\n if (dt.style.display === 'none' && dd.style.display === 'none') div.style.display = 'none'\n }\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\">${icons.helpIcon}</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 standard inputs\n\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 = isWrapped ? input.closest('dd').parentElement : document.createElement('div')\n const dt = label.closest('dt')\n const dd = input.closest('dd')\n\n if (!dt || !dd) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that does not have a corresponding ${!dt ? '<dt>' : '<dd>'} element.`)\n return\n }\n\n // 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\n input.addEventListener('focus', event => {\n if (event.target.nodeName === 'INPUT') lastFocusedInput = event.target\n })\n\n // check for colspan- utility class on dd, and move to div\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 }\n adjustWidth()\n input.addEventListener('input', adjustWidth)\n }\n }\n\n // if the user did not wrap the input in a div, do it for them\n if (!isWrapped) {\n div.append(dt, dd)\n\n // determine visibility of newly created <div>\n if (dt.style.display === 'none' && dd.style.display === 'none') div.style.display = 'none'\n }\n\n dl.append(div)\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 // TODO: should this be a data attribute instead?\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 // 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 = icons.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 return\n }\n showBtn.addEventListener('click', () => {\n if (input.type === 'password') {\n showBtn.innerHTML = icons.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 = icons.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\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 if (!('fieldSizing' in document.createElement('input').style)) {\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\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\nconst handleUndoRedo = (event) => {\n // handle undo/redo\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 {\n 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\nmodule.exports = { enhanceInput, handleUndoRedo }\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","keyboardShortcuts","addEventListener","e","shortcutListener","forms","querySelectorAll","form","add","contains","inputs","Array","from","input","enhanceInput","getAttribute","shortcut","createKeyboardShortcut","push","removeEventListener","handleUndoRedo","semanticFormsObserver","mutations","stop","mutation","node","addedNodes","nodeName","observe","attributes","childList","characterData","subtree","reinitialize","remove","specialCharMap","Minus","Equal","BracketLeft","BracketRight","Backslash","Semicolon","Quote","Comma","Period","Slash","Backquote","shiftSpecialCharMap","shortcuts","find","matchesKey","altKey","shiftKey","key","toUpperCase","code","replace","matchesModifier","modifier","defaultModifier","os","ctrlKey","metaKey","preventDefault","focus","getOS","focusKey","length","error","toString","modifierSymbol","modifierKey","modifierAttr","default","linux","mac","windows","recognizedModifiers","includes","some","type","indicator","createElement","innerHTML","label","nextSibling","insertAfter","setAttribute","userAgent","navigator","platform","test","newNode","referenceNode","parentNode","insertBefore","appendChild","icons","passwordShow","passwordHide","helpIcon","lookups","inputType","lastFocusedInput","lastClearFieldPressed","id","dl","isWrapped","closest","parentElement","newLabel","className","div","dt","dd","firstChild","hasAttribute","text","append","style","display","newInput","class","innerText","value","replaceWith","requestSubmit","clearBtn","title","ariaLabel","tabIndex","previousValue","dispatchEvent","Event","bubbles","event","target","match","adjustWidth","placeholder","width","maxWidth","files","output","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","name","redoValue","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","__webpack_exports__"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"semantic-forms.js","mappings":"CAAA,SAAAA,KAAAC,SACA,UAAAC,UAAA,iBAAAC,SAAA,SACAA,OAAAD,QAAAD,eACA,UAAAG,SAAA,YAAAA,OAAAC,IACAD,OAAA,mBAAAH,cACA,UAAAC,UAAA,SACAA,QAAA,iBAAAD,eAEAD,KAAA,iBAAAC,SACC,EATD,CASCK,KAAA;;;;;ACND,MAAAC,MAAA,KACA,MAAAC,UAAAC,OAAAC,UAAAF,UACA,MAAAG,SAAAF,OAAAC,UAAAC,SACA,IAAAC,GAAA,KAEA,GAAAD,SAAAE,SAAA,OACAD,GAAA,eACI,GAAAD,SAAAE,SAAA,2BAAAC,KAAAN,WACJI,GAAA,WACI,GAAAD,SAAAE,SAAA,oBAAAC,KAAAN,WACJI,GAAA,QAEA,OAAAA;;;;0DAOA;MAAAG,YAAA,CAAAC,QAAAC,iBACA,GAAAA,cAAAC,YAAAD,cAAAE,WAAAC,aAAAJ,QAAAC,cAAAC,kBACAD,cAAAE,WAAAE,YAAAL;;;;;sGAQA;MAAAM,WAAA,IAAAC,IACA,MAAAC,aAAA,CAAAC,UAAAC,WAAAC,SAAAC,cACA,MAAAC,IAAA,GAAiBJ,aAAaC,cAAcC,YAAYC,aACxD,GAAAN,WAAAQ,IAAAD,KAAA,OAAAP,WAAAS,IAAAF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,QAAA;;;;QAIAuT,oBAAAH,UAAAnT,OAAAA,OAAAD,QAAA4F;;;QAGA,OAAA3F,OAAAD;QACA;;;;;;;QCnBA,IAAAwT,oBAAA5N,oBAAA","sources":["webpack://semanticForms/webpack/universalModuleDefinition","webpack://semanticForms/./lib/helpers.js","webpack://semanticForms/./lib/inputEnhancements.js","webpack://semanticForms/./lib/keyboardShortcuts.js","webpack://semanticForms/./lib/tabs.js","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 ","// uses the navigator to best determine the client's operating system\n//\n// returns one of `mac`, `windows`, or `linux`\nconst 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// places an element immediately after another element\n//\n// newNode: the element being placed after the reference node\n// referenceNode: the element the new node is placed after\nconst insertAfter = (newNode, referenceNode) => {\n if (referenceNode.nextSibling) referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)\n else referenceNode.parentNode.appendChild(newNode)\n}\n\n// works out how far a font's visible text sits from the middle of its own line box\n//\n// browsers place a line of text by the font's ascent and descent, which are rarely symmetrical, so the letters themselves end up slightly above or below the middle of the box holding them. that is invisible at the half pixel it usually amounts to, until a display without a high pixel density rounds it up to a whole one. the shift is the same for every element using the font, so it is measured once per font and reused\n//\n// returns the number of pixels the text sits below the middle of its box, negative when it sits above\nconst inkOffsets = new Map()\nconst getInkOffset = (fontStyle, fontWeight, fontSize, fontFamily) => {\n const key = `${fontStyle} ${fontWeight} ${fontSize} ${fontFamily}`\n if (inkOffsets.has(key)) return inkOffsets.get(key)\n\n // the ascent is where the baseline falls in a line box, which an inline-block aligned to the baseline reports directly\n const probe = document.createElement('div')\n probe.style.cssText = `position:absolute;left:-9999px;top:0;white-space:nowrap;visibility:hidden;line-height:normal;padding:0;border:0;margin:0;font-style:${fontStyle};font-weight:${fontWeight};font-size:${fontSize};font-family:${fontFamily}`\n const marker = document.createElement('span')\n marker.style.cssText = 'display:inline-block;width:0;height:0;vertical-align:baseline'\n probe.append('Hxn', marker)\n document.body.append(probe)\n const lineBox = probe.getBoundingClientRect()\n const ascent = marker.getBoundingClientRect().top - lineBox.top\n const descent = lineBox.height - ascent\n probe.remove()\n\n // the cap height is where the letters actually start, which only the drawn pixels can say. drawing it large keeps the answer accurate to a fraction of a pixel\n const scale = 8\n const size = parseFloat(fontSize)\n const canvas = document.createElement('canvas')\n canvas.width = Math.ceil(size * scale * 4)\n canvas.height = Math.ceil(size * scale * 3)\n const context = canvas.getContext('2d', { willReadFrequently: true })\n context.fillStyle = '#fff'\n context.fillRect(0, 0, canvas.width, canvas.height)\n context.fillStyle = '#000'\n context.font = `${fontStyle} ${fontWeight} ${size * scale}px ${fontFamily}`\n context.textBaseline = 'alphabetic'\n const baseline = Math.round(size * scale * 2)\n context.fillText('Hxn', 10, baseline)\n const pixels = context.getImageData(0, 0, canvas.width, canvas.height).data\n let inkTop = null\n for (let y = 0; y < canvas.height && inkTop === null; y++) {\n for (let x = 0; x < canvas.width; x++) {\n if (pixels[(y * canvas.width + x) * 4] < 128) {\n inkTop = y\n break\n }\n }\n }\n if (inkTop === null) {\n const none = { offset: 0, fieldOffset: 0 }\n inkOffsets.set(key, none)\n return none\n }\n const capHeight = (baseline - inkTop) / scale\n\n // rounded to whole device pixels, because browsers put a line of text on the pixel grid rather than at the fraction of one asked for. a correction finer than that either does nothing or moves the letters a whole pixel, depending on which side of the halfway mark the sum lands\n //\n // two roundings come out of this, because a measurement landing exactly halfway can go either way and the browser does not send every kind of text the same way. our own labels follow the ordinary rounding; the text a field draws inside itself, and the text on a button, follow the one that rounds a half away from zero. they differ only for a measurement of exactly minus a half, and agree everywhere else\n const ratio = window.devicePixelRatio || 1\n const exact = ((ascent - descent) / 2 - capHeight / 2) * ratio\n const offset = Math.round(exact) / ratio\n const fieldOffset = Math.sign(exact) * Math.round(Math.abs(exact)) / ratio\n const pair = { offset, fieldOffset }\n inkOffsets.set(key, pair)\n return pair\n}\n\n// puts the measured offset on the form as a custom property, for the stylesheet to subtract when it centers the float label on its field\nconst applyInkOffset = (form, label) => {\n if (!label.isConnected) return\n const style = window.getComputedStyle(label)\n const { offset, fieldOffset } = getInkOffset(style.fontStyle, style.fontWeight, style.fontSize, style.fontFamily)\n form.style.setProperty('--semanticFormsTextInkOffset', `${offset}px`)\n form.style.setProperty('--semanticFormsFieldTextInkOffset', `${fieldOffset}px`)\n}\n\n// a web font that is still downloading when a form is enhanced is measured in whichever font the page falls back to, and the letters move once the real one arrives. the forms measured so far are remembered so they can be measured again at that point, which the browser reports once for the page rather than once per font\nconst measured = new Map()\nlet awaitingFonts = false\nconst setInkOffset = (form, label) => {\n measured.set(form, label)\n applyInkOffset(form, label)\n\n if (awaitingFonts || !document.fonts) return\n awaitingFonts = true\n document.fonts.ready.then(() => {\n // the cache is keyed by what the font is called, which does not change when the file behind it finally loads\n inkOffsets.clear()\n for (const [form, label] of measured) applyInkOffset(form, label)\n measured.clear()\n })\n}\n\nmodule.exports = { getOS, insertAfter, setInkOffset }\n","const { insertAfter } = require('./helpers.js')\n\nconst icons = {\n 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 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 helpIcon: '<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\nconst lookups = {\n nodeName: ['TEXTAREA', 'SELECT'],\n inputType: ['checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'image', 'month', 'number', 'password', 'radio', 'range', 'search', 'tel', 'text', 'time', 'url', 'week']\n}\n\nlet lastFocusedInput\nlet lastClearFieldPressed\n\n// browsers that implement the switch attribute expose it on the input prototype, render the control as a switch and report the switch role themselves, so nothing below is needed there\nconst nativeSwitchSupport = 'switch' in window.HTMLInputElement.prototype\n\n// lets a polyfilled switch be toggled by dragging its thumb, which is what the native control does. a pointer that never travels far enough is left alone so it still lands as a click.\nconst enableSwitchDragging = (input) => {\n input.addEventListener('pointerdown', event => {\n if (input.disabled) return\n\n const startX = event.clientX\n const rightToLeft = window.getComputedStyle(input).direction === 'rtl'\n // half the track is the distance the thumb travels between the two positions\n const travel = input.clientWidth / 2 || 1\n const wasChecked = input.checked\n let dragging = false\n\n input.setPointerCapture(event.pointerId)\n\n const drag = moveEvent => {\n const distance = rightToLeft ? startX - moveEvent.clientX : moveEvent.clientX - startX\n if (!dragging && Math.abs(distance) <= 5) return // still within a click\n dragging = true\n moveEvent.preventDefault() // don't select or scroll while dragging\n input.checked = (wasChecked ? 1 : 0) + (distance / travel) > 0.5\n }\n\n const drop = upEvent => {\n input.releasePointerCapture(upEvent.pointerId)\n input.removeEventListener('pointermove', drag)\n input.removeEventListener('pointerup', drop)\n input.removeEventListener('pointercancel', drop)\n if (!dragging) return\n\n // the click that follows the drag would otherwise put the switch back where it started\n input.addEventListener('click', clickEvent => clickEvent.preventDefault(), { once: true, capture: true })\n\n if (input.checked !== wasChecked) {\n input.dispatchEvent(new Event('input', { bubbles: true }))\n input.dispatchEvent(new Event('change', { bubbles: true }))\n }\n }\n\n input.addEventListener('pointermove', drag)\n input.addEventListener('pointerup', drop)\n input.addEventListener('pointercancel', drop)\n })\n}\n\nconst enhanceInput = (input, form) => {\n // ignore input if it has previously been formatted\n if (input.classList.contains('semanticform') || !input.id) return\n\n const type = input.getAttribute('type')\n if (!lookups.nodeName.includes(input.nodeName) && !lookups.inputType.includes(type)) return\n\n // recursively find <dl> element\n let dl = input.parentNode\n while (dl && dl.nodeName !== 'DL') dl = dl.parentNode\n if (!dl) return\n if (!dl.classList.contains('floatLabelForm')) dl.classList.add('floatLabelForm')\n\n // the label is looked up in the input's own tree rather than the document, so that a form inside a shadow root finds its labels instead of coming up empty\n const tree = input.getRootNode()\n const label = input.parentNode.parentNode.id && (type === 'checkbox' || type === 'radio')\n ? tree.querySelector('label[data-for=' + input.parentNode.parentNode.id.replace(/\\./g, '\\\\.') + ']')\n : tree.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 return\n }\n\n input.classList.add('semanticform')\n\n // an input outside a <dd> is reported by the checks further down, so tolerate it here\n const isWrapped = input.closest('dd')?.parentElement.nodeName === 'DIV'\n\n // #region create labels\n\n const newLabel = document.createElement('label')\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\n if (type === 'checkbox' || type === 'radio') {\n const div = isWrapped ? input.closest('dd').parentElement : document.createElement('div')\n const dt = label.closest('dt')\n const dd = input.closest('dd')\n\n if (!dt || !dd) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that is not inside a <dd> element.`)\n return\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\">${icons.helpIcon}</span>`\n newLabel.innerHTML += ` <span title=\"${text}\" class=\"help\">${icons.helpIcon}</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 // if the user did not wrap the input in a div, do it for them\n if (!isWrapped) {\n // the wrapper goes where the <dt> was, so the field keeps its place in the markup. a div the author wrote is already in the right place and is deliberately left where it is: moving it would push the field past anything the enhancer does not touch, such as a <dd> holding only a button\n dt.before(div)\n div.append(dt, dd)\n\n // determine visibility of newly created <div>\n if (dt.style.display === 'none' && dd.style.display === 'none') div.style.display = 'none'\n }\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\">${icons.helpIcon}</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 standard inputs\n\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 = isWrapped ? input.closest('dd').parentElement : document.createElement('div')\n const dt = label.closest('dt')\n const dd = input.closest('dd')\n\n if (!dt || !dd) {\n console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that does not have a corresponding ${!dt ? '<dt>' : '<dd>'} element.`)\n return\n }\n\n // input clear button. a field the user cannot edit does not get one, since the button would empty it anyway. a field that only becomes uneditable later is handled in css\n if (input.nodeName !== 'SELECT' && type !== 'range' && !input.readOnly && !input.disabled) {\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\n input.addEventListener('focus', event => {\n if (event.target.nodeName === 'INPUT') lastFocusedInput = event.target\n })\n\n // the colspan- and col- utility classes are documented as going on the dd, but they size and place the grid item, which is the div wrapping it, so move any of them across\n for (const utility of dd.className.match(/colspan-(?:[0-9]|full)|col-[0-9]/g) || []) {\n dd.classList.remove(utility)\n div.classList.add(utility)\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 }\n adjustWidth()\n input.addEventListener('input', adjustWidth)\n }\n }\n\n // if the user did not wrap the input in a div, do it for them\n if (!isWrapped) {\n // as above, the wrapper takes the <dt>'s position rather than being appended to the end\n dt.before(div)\n div.append(dt, dd)\n\n // determine visibility of newly created <div>\n if (dt.style.display === 'none' && dd.style.display === 'none') div.style.display = 'none'\n }\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 set to display the value. every other per-field flag in the library is a data attribute, so that is the documented way to ask for this, but the original `displayValue` class is still honored\n if (type === 'range' && (input.getAttribute('data-display-value') !== null || 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 // 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 = icons.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 return\n }\n showBtn.addEventListener('click', () => {\n if (input.type === 'password') {\n showBtn.innerHTML = icons.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 = icons.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\n // a checkbox with the switch attribute is a switch; the stylesheet draws one in every browser, and where the attribute is not implemented natively the role and dragging are supplied here\n if (type === 'checkbox' && input.hasAttribute('switch') && !nativeSwitchSupport) {\n input.setAttribute('role', 'switch')\n enableSwitchDragging(input)\n }\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 if (!('fieldSizing' in document.createElement('input').style)) {\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\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\nconst handleUndoRedo = (event) => {\n // handle undo/redo\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 // the browser undoes the field's own edit history on this key too, which would apply on top of the value restored here, so the native behavior is suppressed\n event.preventDefault()\n lastFocusedInput.redoValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.previousValue\n }\n }\n }\n } else {\n 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 // as above, the browser's own redo would otherwise apply on top of this\n event.preventDefault()\n lastFocusedInput.previousValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.redoValue\n }\n }\n }\n }\n }\n}\n\nmodule.exports = { enhanceInput, handleUndoRedo }\n","const { getOS, insertAfter } = require('./helpers.js')\n\nconst specialCharMap = {\n Minus: '-',\n Equal: '=',\n BracketLeft: '[',\n BracketRight: ']',\n Backslash: '\\\\',\n Semicolon: ';',\n Quote: '\\'',\n Comma: ',',\n Period: '.',\n Slash: '/',\n Backquote: '`'\n}\nconst 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// handles keyboard shortcut events\nconst shortcutListener = (e, shortcuts) => {\n // search for matching shortcut from cached shortcut configs\n const shortcut = shortcuts.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\nconst createKeyboardShortcut = (input, shortcuts) => {\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 (shortcuts.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 }\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\n const label = input.nextSibling\n insertAfter(indicator, label)\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 return {\n key: focusKey,\n modifier: modifierKey,\n input,\n os,\n defaultModifier\n }\n}\n\nmodule.exports = {\n shortcutListener,\n createKeyboardShortcut\n}\n","let tabGroupCount = 0\n\n// turns a group of fieldsets into a set of tabs\n//\n// the markup it enhances is an element with the `tabs` class holding one `<fieldset>` per tab, each titled by its `<legend>`. left alone that is a stack of labelled field groups, which is a perfectly usable form, so a browser without JavaScript still gets everything\n//\n// form: form element to search for tab groups\nconst enhanceTabs = (form) => {\n for (const group of form.querySelectorAll('.tabs:not(.semanticFormsTabsActive)')) {\n const panels = Array.from(group.children).filter(child => child.nodeName === 'FIELDSET')\n\n // one fieldset is not a set of tabs, and no fieldsets means the class is on the wrong element\n if (panels.length < 2) {\n if (panels.length === 0) console.error('semantic-forms: Found a .tabs element with no <fieldset> children. Each tab needs to be a <fieldset> with a <legend> naming it.', group)\n continue\n }\n\n group.classList.add('semanticFormsTabsActive')\n const groupId = ++tabGroupCount\n const tabList = document.createElement('div')\n const tabs = []\n\n tabList.classList.add('tabList')\n tabList.setAttribute('role', 'tablist')\n\n // shows one panel and marks its tab as the selected one\n const selectTab = (index, moveFocus) => {\n for (const [i, panel] of panels.entries()) panel.hidden = i !== index\n for (const [i, tab] of tabs.entries()) {\n const selected = i === index\n tab.setAttribute('aria-selected', selected ? 'true' : 'false')\n\n // only the selected tab is in the tab order; the arrow keys reach the others\n tab.tabIndex = selected ? 0 : -1\n }\n if (moveFocus) tabs[index].focus()\n }\n\n for (const [index, panel] of panels.entries()) {\n const legend = panel.querySelector('legend')\n const tab = document.createElement('button')\n\n tab.type = 'button'\n tab.setAttribute('role', 'tab')\n tab.id = `semanticFormsTab_${groupId}_${index}`\n tab.textContent = legend ? legend.textContent : `Tab ${index + 1}`\n\n if (!panel.id) panel.id = `semanticFormsTabPanel_${groupId}_${index}`\n panel.setAttribute('role', 'tabpanel')\n panel.setAttribute('aria-labelledby', tab.id)\n tab.setAttribute('aria-controls', panel.id)\n\n // the tab now names the panel, so the legend would be read out twice\n if (legend) legend.hidden = true\n\n tab.addEventListener('click', () => selectTab(index))\n tabs.push(tab)\n tabList.append(tab)\n }\n\n // the arrow keys move between tabs, which is what a tablist is expected to do\n tabList.addEventListener('keydown', event => {\n const current = tabs.indexOf(document.activeElement)\n if (current === -1) return\n\n const keys = {\n ArrowRight: (current + 1) % tabs.length,\n ArrowLeft: (current - 1 + tabs.length) % tabs.length,\n Home: 0,\n End: tabs.length - 1\n }\n if (!(event.key in keys)) return\n\n event.preventDefault()\n selectTab(keys[event.key], true)\n })\n\n group.prepend(tabList)\n selectTab(0)\n }\n}\n\nmodule.exports = { enhanceTabs }\n","const { createKeyboardShortcut, shortcutListener } = require('./lib/keyboardShortcuts.js')\nconst { enhanceInput, handleUndoRedo } = require('./lib/inputEnhancements.js')\nconst { enhanceTabs } = require('./lib/tabs.js')\nconst { setInkOffset } = require('./lib/helpers.js')\n\n// one observer per tree that has been handed to semanticForms, so that a shadow root gets its own without replacing the document's\nconst observers = new WeakMap()\n\n// progressively enhances every semanticForms form in a tree\n//\n// root: document or shadow root to search; defaults to the main document\nconst semanticForms = (root = document) => {\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 // custom keyboard shortcut listener\n const keyboardShortcuts = []\n document.addEventListener('keydown', (e) => shortcutListener(e, keyboardShortcuts))\n\n // progressively enhance form elements that have the semanticForms class\n const forms = root.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 // how far this font's letters sit from the middle of their own line box, which the stylesheet subtracts wherever it centers text. it is measured per form rather than per field, so that a form holding nothing but buttons is corrected too\n setInkOffset(form, form)\n\n // update each input in the semantic form\n const inputs = Array.from(form.querySelectorAll('input, textarea, select'))\n for (const input of inputs) {\n enhanceInput(input, form)\n\n // handle keyboard shortcuts\n if (input.getAttribute('data-focus-key') !== null) {\n const shortcut = createKeyboardShortcut(input, keyboardShortcuts)\n keyboardShortcuts.push(shortcut)\n }\n }\n\n // done after the inputs so that anything sizing itself measures while it is still on screen\n enhanceTabs(form)\n }\n\n // prevents multiple listeners\n document.removeEventListener('keydown', handleUndoRedo)\n document.addEventListener('keydown', handleUndoRedo)\n\n // monitor changes to this tree and enhance new semanticForms forms that get added to it\n if (!observers.has(root)) {\n const observer = 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(root)\n stop = true\n }\n }\n if (stop) break\n }\n })\n\n // a shadow root is observed directly; the document is observed through its body\n observer.observe(root === document ? document.body : root, { attributes: false, childList: true, characterData: false, subtree: true })\n observers.set(root, observer)\n\n // long standing name for the document's observer, kept for anything already using it\n if (root === document) window.semanticFormsObserver = observer\n }\n\n semanticForms.reinitialize = form => {\n // with no form given this just rescans for forms that are not active yet\n if (!form) return semanticForms(root)\n\n form.classList.remove('semanticFormsActive')\n\n // the form knows which tree it belongs to, so a form in a shadow root reinitializes there\n semanticForms(form.getRootNode())\n }\n}\n\nmodule.exports = semanticForms\n","// The module cache\nconst __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tconst 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\tconst 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\nlet __webpack_exports__ = __webpack_require__(90);\n"],"names":["root","factory","exports","module","define","amd","this","getOS","userAgent","window","navigator","platform","os","includes","test","insertAfter","newNode","referenceNode","nextSibling","parentNode","insertBefore","appendChild","inkOffsets","Map","getInkOffset","fontStyle","fontWeight","fontSize","fontFamily","key","has","get","probe","document","createElement","style","cssText","marker","append","body","lineBox","getBoundingClientRect","ascent","top","descent","height","remove","scale","size","parseFloat","canvas","width","Math","ceil","context","getContext","willReadFrequently","fillStyle","fillRect","font","textBaseline","baseline","round","fillText","pixels","getImageData","data","inkTop","y","x","none","offset","fieldOffset","set","capHeight","ratio","devicePixelRatio","exact","sign","abs","pair","applyInkOffset","form","label","isConnected","getComputedStyle","setProperty","measured","awaitingFonts","setInkOffset","fonts","ready","then","clear","__webpack_require__","icons","passwordShow","passwordHide","helpIcon","lookups","nodeName","inputType","lastFocusedInput","lastClearFieldPressed","nativeSwitchSupport","HTMLInputElement","prototype","enableSwitchDragging","input","addEventListener","event","disabled","startX","clientX","rightToLeft","direction","travel","clientWidth","wasChecked","checked","dragging","setPointerCapture","pointerId","drag","moveEvent","distance","preventDefault","drop","upEvent","releasePointerCapture","removeEventListener","clickEvent","once","capture","dispatchEvent","Event","bubbles","enhanceInput","classList","contains","id","type","getAttribute","dl","add","tree","getRootNode","querySelector","replace","console","error","isWrapped","closest","parentElement","newLabel","className","div","dt","dd","firstChild","setAttribute","innerHTML","hasAttribute","text","before","display","newInput","class","innerText","value","replaceWith","e","shiftKey","requestSubmit","readOnly","clearBtn","title","ariaLabel","tabIndex","previousValue","focus","target","utility","match","adjustWidth","placeholder","length","maxWidth","files","output","showBtn","handleInput","maxRows","isNaN","Number","warn","minRows","inlinePadding","inlineBorderWidth","blockPadding","lineHeight","scrollHeight","removeProperty","rows","min","adjustHeight","borderWidth","parseInt","getPropertyValue","shiftClearBtn","marginRight","clientHeight","handleUndoRedo","ctrlKey","metaKey","name","redoValue","specialCharMap","Minus","Equal","BracketLeft","BracketRight","Backslash","Semicolon","Quote","Comma","Period","Slash","Backquote","shiftSpecialCharMap","shortcutListener","shortcuts","shortcut","find","matchesKey","altKey","toUpperCase","code","matchesModifier","modifier","defaultModifier","createKeyboardShortcut","focusKey","toString","modifierSymbol","modifierKey","modifierAttr","default","linux","mac","windows","recognizedModifiers","some","indicator","tabGroupCount","enhanceTabs","group","querySelectorAll","panels","Array","from","children","filter","child","groupId","tabList","tabs","selectTab","index","moveFocus","i","panel","entries","hidden","tab","selected","legend","textContent","push","current","indexOf","activeElement","keys","ArrowRight","ArrowLeft","Home","End","prepend","observers","WeakMap","semanticForms","getElementsByClassName","MutationObserver","keyboardShortcuts","forms","inputs","observer","mutations","stop","mutation","node","addedNodes","observe","attributes","childList","characterData","subtree","semanticFormsObserver","reinitialize","__webpack_module_cache__","moduleId","cachedModule","undefined","__webpack_modules__","__webpack_exports__"],"sourceRoot":""}
|
|
@@ -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,t,r)=>{const{createKeyboardShortcut:o,shortcutListener:n}=r(497),{enhanceInput:i,handleUndoRedo:a}=r(866),s=()=>{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=[];document.addEventListener("keydown",t=>n(t,e));const t=document.querySelectorAll("form.semanticForms:not(.semanticFormsActive), table.semanticForms:not(.semanticFormsActive)");for(const r of t){if(r.classList.add("semanticFormsActive"),r.classList.contains("lowFlow"))continue;const t=Array.from(r.querySelectorAll("input, textarea, select"));for(const n of t)if(i(n,r),null!==n.getAttribute("data-focus-key")){const t=o(n,e);e.push(t)}}document.removeEventListener("keydown",a),document.addEventListener("keydown",a),window.semanticFormsObserver||(window.semanticFormsObserver=new window.MutationObserver(e=>{let t=!1;for(const r of e){for(const e of r.addedNodes)("FORM"===e.nodeName||e?.querySelector?.("form"))&&(s(),t=!0);if(t)break}}),window.semanticFormsObserver.observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0})),s.reinitialize=e=>{e.classList.remove("semanticFormsActive"),s()}};e.exports=s},497:(e,t,r)=>{const{getOS:o,insertAfter:n}=r(584),i={Minus:"-",Equal:"=",BracketLeft:"[",BracketRight:"]",Backslash:"\\",Semicolon:";",Quote:"'",Comma:",",Period:".",Slash:"/",Backquote:"`"},a={1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")",Minus:"_",Equal:"+",BracketLeft:"{",BracketRight:"}",Backslash:"|",Semicolon:":",Quote:'"',Comma:"<",Period:">",Slash:"?",Backquote:"~"};e.exports={shortcutListener:(e,t)=>{const r=t.find(t=>{let r,o=!1;if(e.altKey&&!e.shiftKey)o="Key"+t.key.toUpperCase()===e.code||"Digit"+t.key.toUpperCase()===e.code||t.key===e.key||i[e.code]===t.key;else if(e.shiftKey){const r=e.code.replace(/Key|Digit/,"");o=(a[r]||a[e.key])&&(a[r]===t.key||a[e.key]===t.key)}else o=t.key.toUpperCase()===e.key.toUpperCase();return!!o&&(t.modifier&&(t.modifier===t.defaultModifier&&(r="windows"===t.os||"linux"===t.os?e.ctrlKey:e.metaKey),"meta"===t.modifier&&(r=e.metaKey),"alt"===t.modifier&&(r=e.altKey),"ctrl"===t.modifier&&(r=e.ctrlKey)),r)});r&&(e.preventDefault(),r.input.focus())},createKeyboardShortcut:(e,t)=>{const r=o(),i="metactrl";let a,s=e.getAttribute("data-focus-key");s.length>1&&(console.error(`Provided focus key "${s}" is more than one character. Using first character only.`),s=s.toString()[0]);let l=i;const d={default:e.getAttribute("data-focus-modifier")||i,linux:e.getAttribute("data-focus-modifier-linux"),mac:e.getAttribute("data-focus-modifier-mac"),windows:e.getAttribute("data-focus-modifier-win")};if(l=r&&d[r]?d[r]:d.default,["ctrl","alt","opt","meta","cmd",i].includes(l)||(console.error(`Received an unrecognized modifier, "${l}," defaulting to "${i}."`,e),l=i),["alt","opt"].includes(l)?a="mac"===r?"⌥":"⎇":["meta","win","cmd"].includes(l)||l===i&&"mac"===r?a="mac"===r?"⌘":"linux"===r?"◆":"⊞":"ctrl"!==l&&(l!==i||"windows"!==r&&"linux"!==r)||(a="mac"===r?"⌃":"Ctrl"),t.some(e=>e.key===s&&e.modifier===l)&&console.error(`Duplicate keyboard shortcut "${l} + ${s}" detected. Only the first input will be focusable using this keyboard shortcut.`,e),"TEXTAREA"===e.nodeName||"text"===e.type||"number"===e.type){const t=document.createElement("span");t.classList.add("focus-key"),t.innerHTML=`<kbd>${a} ${s.toUpperCase()}</kbd>`;const r=e.nextSibling;n(t,r)}else e.getAttribute("title")?e.setAttribute("title",e.getAttribute("title")+` (${a} + ${s})`):e.setAttribute("title",`Focus with ${a} + ${s}`);return{key:s,modifier:l,input:e,os:r,defaultModifier:i}}}},584:e=>{e.exports={getOS:()=>{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},insertAfter:(e,t)=>{t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e)}}},866:(e,t,r)=>{const{insertAfter:o}=r(584),n='<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>',i='<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>',a='<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>',s={nodeName:["TEXTAREA","SELECT"],inputType:["checkbox","color","date","datetime-local","email","file","image","month","number","password","radio","range","search","tel","text","time","url","week"]};let l,d;e.exports={enhanceInput:(e,t)=>{if(e.classList.contains("semanticform")||!e.id)return;const r=e.getAttribute("type");if(!s.nodeName.includes(e.nodeName)&&!s.inputType.includes(r))return;let c=e.parentNode;for(;c&&"DL"!==c.nodeName;)c=c.parentNode;if(!c)return;c.classList.contains("floatLabelForm")||c.classList.add("floatLabelForm");const u=!e.parentNode.parentNode.id||"checkbox"!==r&&"radio"!==r?document.querySelector("label[for="+e.id.replace(/\./g,"\\.")+"]"):document.querySelector("label[data-for="+e.parentNode.parentNode.id.replace(/\./g,"\\.")+"]");u||console.error(`semantic-forms: Found an input (${e.id||e.getAttribute("name")}) without a properly associated label. Make sure there is a label for it and the label has a matching "for" attribute.`),e.classList.add("semanticform");const p="DIV"===e.closest("dd").parentElement.nodeName,m=document.createElement("label");if(m.className="floatLabelFormAnimatedLabel","checkbox"===r||"radio"===r){const t=p?e.closest("dd").parentElement:document.createElement("div"),n=u.closest("dt"),i=e.closest("dd");if(!n||!i)return void console.error(`semantic-forms: Found an input (${e.id||e.getAttribute("name")}) that is not inside a <dd> element.`);if("LABEL"!==i.firstChild.nodeName){if("checkbox"===r&&"DD"===e.parentNode.nodeName&&(m.setAttribute("for",e.id),e.parentNode.classList.add("singleCheckbox"),m.className="",u.setAttribute("hidden","hidden"),o(m,e)),"radio"===r&&"DD"===e.parentNode.nodeName&&(m.setAttribute("for",e.id),e.parentNode.classList.add("singleRadio"),m.className="",u.setAttribute("hidden","hidden"),o(m,e)),m.innerHTML=u.innerHTML,u.hasAttribute("title")&&null!==u.getAttribute("data-show-help-icon")&&!u.querySelector("span.help")){const e=u.getAttribute("title");u.innerHTML+=` <span title="${e}" class="help">${a}</span>`,m.innerHTML+=` <span title="${e}" class="help">${a}</span>`}if(i.querySelector(":required")&&null===u.getAttribute("data-no-asterisk")&&!u.querySelector("span.required")){const e=u.getAttribute("data-asterisk-text")||"This field is required.";u.innerHTML+=` <span title="${e}" class="required">*</span>`,m.innerHTML+=` <span title="${e}" class="required">*</span>`}i.querySelector("label")||i.append(m)}p||(t.append(n,i),"none"===n.style.display&&"none"===i.style.display&&(t.style.display="none")),c.append(t)}else{if(m.setAttribute("for",e.id),m.innerHTML=u.innerHTML,e.hasAttribute("title")&&null!==u.getAttribute("data-show-help-icon")&&!u.querySelector("span.help")){const t=e.getAttribute("title");m.innerHTML+=` <span title="${t}" class="help">${a}</span>`}if(e.hasAttribute("required")&&null===u.getAttribute("data-no-asterisk")&&!u.querySelector("span.required")){const e=u.getAttribute("data-asterisk-text")||"This field is required.";m.innerHTML+=` <span title="${e}" class="required">*</span>`}u.setAttribute("hidden","hidden"),o(m,e)}if(null!==e.getAttribute("data-auto-grow")){if("INPUT"===e.nodeName&&"text"===e.type){const t=document.createElement("textarea");t.id=e.id,t.class=e.class,t.innerText=e.value,t.setAttribute("data-auto-grow",""),e.replaceWith(t),e=t}"TEXTAREA"===e.nodeName&&e.addEventListener("keypress",e=>{"Enter"!==e.key||"Enter"===e.key&&e.shiftKey||(e.preventDefault(),t.requestSubmit())})}if("checkbox"!==r&&"radio"!==r){e.getAttribute("placeholder")||e.setAttribute("placeholder"," ");const t=p?e.closest("dd").parentElement:document.createElement("div"),n=u.closest("dt"),i=e.closest("dd");if(!n||!i)return void console.error(`semantic-forms: Found an input (${e.id||e.getAttribute("name")}) that does not have a corresponding ${n?"<dd>":"<dt>"} element.`);if("SELECT"!==e.nodeName&&"range"!==r){const t=document.createElement("button");t.type="button",t.title=e.getAttribute("data-clear-field-text")||"Clear field",t.ariaLabel=e.getAttribute("data-clear-field-text")||"Clear field",t.tabIndex=-1,t.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" />',t.classList.add("clear"),t.id=`semanticFormsClearButton_${e.id}`,t.addEventListener("click",()=>{e.previousValue=e.value,e.value="",e.focus(),d=e.id,e.dispatchEvent(new Event("input",{bubbles:!0}))}),o(t,i.querySelector("label"))}if(e.addEventListener("focus",e=>{"INPUT"===e.target.nodeName&&(l=e.target)}),/colspan-/.test(i.className)){const e=i.className.match(/colspan-([0-9]|full)/)[0];i.classList.remove(e),t.classList.add(e)}if(null!==e.getAttribute("data-max-content")&&!("fieldSizing"in document.createElement("input").style)){const t=()=>{const t=8*(""!==e.value?e.value:e.placeholder).length+40;e.style.width=t+"px",e.style.maxWidth="100%"};t(),e.addEventListener("input",t)}p||(t.append(n,i),"none"===n.style.display&&"none"===i.style.display&&(t.style.display="none")),c.append(t)}if("file"===r){const t=e.parentElement.querySelector(".clear");e.addEventListener("input",e=>{t.style.display=e.target.files.length?"flex":"none"}),t.addEventListener("click",()=>{t.style.display="none"})}if("range"===r&&e.classList.contains("displayValue")&&(e.parentNode.parentNode.querySelector("dd label").innerHTML+=`<span class="seperator">: </span><output>${e.value}</output>`,e.addEventListener("input",e=>{e.target.parentNode.parentNode.querySelector("output").innerHTML=e.target.value})),"password"===r&&null===e.getAttribute("data-no-reveal")){const t=document.createElement("button");t.type="button",t.title=e.getAttribute("data-show-password-text")||"Show password",t.ariaLabel=e.getAttribute("data-show-password-text")||"Show password",t.tabIndex=-1,t.innerHTML=n,t.classList.add("show"),t.id=`semanticFormsShowButton_${e.id}`;const r=e.closest("dd");if(!r)return void console.error(`semantic-forms: Found an input (${e.id||e.getAttribute("name")}) that is not inside a <dd> element.`);t.addEventListener("click",()=>{"password"===e.type?(t.innerHTML=i,t.title=e.getAttribute("data-hide-password-text")||"Hide password",t.ariaLabel=e.getAttribute("data-hide-password-text")||"Hide password",e.type="text"):(t.innerHTML=n,t.title=e.getAttribute("data-show-password-text")||"Show password",t.ariaLabel=e.getAttribute("data-show-password-text")||"Show password",e.type="password"),e.focus()}),o(t,r.querySelector("label"))}if("TEXTAREA"===e.nodeName){if(null===e.getAttribute("data-disable-autosize")){e.style.setProperty("resize","none"),e.style.setProperty("min-height","0"),e.style.setProperty("max-height","none"),e.style.setProperty("height","auto");const t=()=>{let t=e.getAttribute("data-max-rows");t&&(isNaN(t)||Number(t)<=0)&&(console.warn(`An invalid value was passed to the "data-max-rows" attribute. This value will be ignored.\n\nProvided value: ${e.getAttribute("data-max-rows")}`),t=null);const r=e.getAttribute("data-max-rows")&&Number(e.getAttribute("data-max-rows"))<5?e.getAttribute("data-max-rows"):"5";e.setAttribute("rows",r);const o=window.getComputedStyle(e),n=parseFloat(o["padding-left"])+parseFloat(o["padding-right"]),i=parseFloat(o["border-left-width"])+parseFloat(o["border-right-width"]);e.style.setProperty("overflow","hidden","important"),e.style.setProperty("width",parseFloat(o.width)-n-i+"px"),e.style.setProperty("box-sizing","content-box"),e.style.setProperty("padding-inline","0"),e.style.setProperty("border-width","0");const a=parseFloat(o["padding-top"])+parseFloat(o["padding-bottom"]),s="normal"===o["line-height"]?parseFloat(o.height):parseFloat(o["line-height"]),l=Math.round(e.scrollHeight);e.style.removeProperty("width"),e.style.removeProperty("box-sizing"),e.style.removeProperty("padding-inline"),e.style.removeProperty("border-width"),e.style.removeProperty("overflow");const d=Math.round((l-a)/s);t?e.setAttribute("rows",""+Math.min(d,Number(t))):e.setAttribute("rows",""+d)};e.addEventListener("input",t),e.dispatchEvent(new Event("input",{bubbles:!0}))}if(null!==e.getAttribute("data-auto-grow")&&!("fieldSizing"in document.createElement("input").style)){const r=()=>{if(e.value.length){const t=parseInt(window.getComputedStyle(e).getPropertyValue("border-width"));e.style.height=e.scrollHeight+2*t+"px"}else e.style.height=window.getComputedStyle(t).getPropertyValue("--semanticFormsInputHeight")};e.style.height=window.getComputedStyle(t).getPropertyValue("--semanticFormsInputHeight"),e.addEventListener("input",r)}const r=()=>{const t=e.parentElement?.querySelector("button.clear");t&&(t.style.marginRight=e.clientHeight<e.scrollHeight?"15px":"")};e.addEventListener("input",r),e.addEventListener("mouseup",r),r()}},handleUndoRedo:e=>{!e.ctrlKey&&!e.metaKey||"z"!==e.key||e.shiftKey?(e.ctrlKey&&"y"===e.key||e.metaKey&&e.shiftKey&&"z"===e.key)&&l&&(l?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${d}`&&l?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${d}`||l.redoValue&&(l.previousValue=l.value,l.value=l.redoValue)):l&&(l?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${d}`&&l?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${d}`||l.previousValue&&(l.redoValue=l.value,l.value=l.previousValue))}}}},t={},function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.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,()=>(()=>{var e={584(e){const t=new Map,n=(e,n)=>{if(!n.isConnected)return;const o=window.getComputedStyle(n),{offset:r,fieldOffset:i}=((e,n,o,r)=>{const i=`${e} ${n} ${o} ${r}`;if(t.has(i))return t.get(i);const s=document.createElement("div");s.style.cssText=`position:absolute;left:-9999px;top:0;white-space:nowrap;visibility:hidden;line-height:normal;padding:0;border:0;margin:0;font-style:${e};font-weight:${n};font-size:${o};font-family:${r}`;const a=document.createElement("span");a.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",s.append("Hxn",a),document.body.append(s);const l=s.getBoundingClientRect(),d=a.getBoundingClientRect().top-l.top,c=l.height-d;s.remove();const u=parseFloat(o),p=document.createElement("canvas");p.width=Math.ceil(8*u*4),p.height=Math.ceil(8*u*3);const m=p.getContext("2d",{willReadFrequently:!0});m.fillStyle="#fff",m.fillRect(0,0,p.width,p.height),m.fillStyle="#000",m.font=`${e} ${n} ${8*u}px ${r}`,m.textBaseline="alphabetic";const h=Math.round(8*u*2);m.fillText("Hxn",10,h);const f=m.getImageData(0,0,p.width,p.height).data;let b=null;for(let e=0;e<p.height&&null===b;e++)for(let t=0;t<p.width;t++)if(f[4*(e*p.width+t)]<128){b=e;break}if(null===b){const e={offset:0,fieldOffset:0};return t.set(i,e),e}const y=(h-b)/8,g=window.devicePixelRatio||1,w=((d-c)/2-y/2)*g,v={offset:Math.round(w)/g,fieldOffset:Math.sign(w)*Math.round(Math.abs(w))/g};return t.set(i,v),v})(o.fontStyle,o.fontWeight,o.fontSize,o.fontFamily);e.style.setProperty("--semanticFormsTextInkOffset",`${r}px`),e.style.setProperty("--semanticFormsFieldTextInkOffset",`${i}px`)},o=new Map;let r=!1;e.exports={getOS:()=>{const e=window.navigator.userAgent,t=window.navigator.platform;let n=null;return t.includes("Win")?n="windows":t.includes("Mac")||/iPhone|iPad|iPod/.test(e)?n="mac":(t.includes("Linux")||/Android/.test(e))&&(n="linux"),n},insertAfter:(e,t)=>{t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e)},setInkOffset:(e,i)=>{o.set(e,i),n(e,i),!r&&document.fonts&&(r=!0,document.fonts.ready.then(()=>{t.clear();for(const[e,t]of o)n(e,t);o.clear()}))}}},866(e,t,n){const{insertAfter:o}=n(584),r='<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>',i='<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>',s='<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>',a={nodeName:["TEXTAREA","SELECT"],inputType:["checkbox","color","date","datetime-local","email","file","image","month","number","password","radio","range","search","tel","text","time","url","week"]};let l,d;const c="switch"in window.HTMLInputElement.prototype;e.exports={enhanceInput:(e,t)=>{if(e.classList.contains("semanticform")||!e.id)return;const n=e.getAttribute("type");if(!a.nodeName.includes(e.nodeName)&&!a.inputType.includes(n))return;let u=e.parentNode;for(;u&&"DL"!==u.nodeName;)u=u.parentNode;if(!u)return;u.classList.contains("floatLabelForm")||u.classList.add("floatLabelForm");const p=e.getRootNode(),m=!e.parentNode.parentNode.id||"checkbox"!==n&&"radio"!==n?p.querySelector("label[for="+e.id.replace(/\./g,"\\.")+"]"):p.querySelector("label[data-for="+e.parentNode.parentNode.id.replace(/\./g,"\\.")+"]");if(!m)return void console.error(`semantic-forms: Found an input (${e.id||e.getAttribute("name")}) without a properly associated label. Make sure there is a label for it and the label has a matching "for" attribute.`);e.classList.add("semanticform");const h="DIV"===e.closest("dd")?.parentElement.nodeName,f=document.createElement("label");if(f.className="floatLabelFormAnimatedLabel","checkbox"===n||"radio"===n){const t=h?e.closest("dd").parentElement:document.createElement("div"),r=m.closest("dt"),i=e.closest("dd");if(!r||!i)return void console.error(`semantic-forms: Found an input (${e.id||e.getAttribute("name")}) that is not inside a <dd> element.`);if("LABEL"!==i.firstChild.nodeName){if("checkbox"===n&&"DD"===e.parentNode.nodeName&&(f.setAttribute("for",e.id),e.parentNode.classList.add("singleCheckbox"),f.className="",m.setAttribute("hidden","hidden"),o(f,e)),"radio"===n&&"DD"===e.parentNode.nodeName&&(f.setAttribute("for",e.id),e.parentNode.classList.add("singleRadio"),f.className="",m.setAttribute("hidden","hidden"),o(f,e)),f.innerHTML=m.innerHTML,m.hasAttribute("title")&&null!==m.getAttribute("data-show-help-icon")&&!m.querySelector("span.help")){const e=m.getAttribute("title");m.innerHTML+=` <span title="${e}" class="help">${s}</span>`,f.innerHTML+=` <span title="${e}" class="help">${s}</span>`}if(i.querySelector(":required")&&null===m.getAttribute("data-no-asterisk")&&!m.querySelector("span.required")){const e=m.getAttribute("data-asterisk-text")||"This field is required.";m.innerHTML+=` <span title="${e}" class="required">*</span>`,f.innerHTML+=` <span title="${e}" class="required">*</span>`}i.querySelector("label")||i.append(f)}h||(r.before(t),t.append(r,i),"none"===r.style.display&&"none"===i.style.display&&(t.style.display="none"))}else{if(f.setAttribute("for",e.id),f.innerHTML=m.innerHTML,e.hasAttribute("title")&&null!==m.getAttribute("data-show-help-icon")&&!m.querySelector("span.help")){const t=e.getAttribute("title");f.innerHTML+=` <span title="${t}" class="help">${s}</span>`}if(e.hasAttribute("required")&&null===m.getAttribute("data-no-asterisk")&&!m.querySelector("span.required")){const e=m.getAttribute("data-asterisk-text")||"This field is required.";f.innerHTML+=` <span title="${e}" class="required">*</span>`}m.setAttribute("hidden","hidden"),o(f,e)}if(null!==e.getAttribute("data-auto-grow")){if("INPUT"===e.nodeName&&"text"===e.type){const t=document.createElement("textarea");t.id=e.id,t.class=e.class,t.innerText=e.value,t.setAttribute("data-auto-grow",""),e.replaceWith(t),e=t}"TEXTAREA"===e.nodeName&&e.addEventListener("keypress",e=>{"Enter"!==e.key||"Enter"===e.key&&e.shiftKey||(e.preventDefault(),t.requestSubmit())})}if("checkbox"!==n&&"radio"!==n){e.getAttribute("placeholder")||e.setAttribute("placeholder"," ");const t=h?e.closest("dd").parentElement:document.createElement("div"),r=m.closest("dt"),i=e.closest("dd");if(!r||!i)return void console.error(`semantic-forms: Found an input (${e.id||e.getAttribute("name")}) that does not have a corresponding ${r?"<dd>":"<dt>"} element.`);if("SELECT"!==e.nodeName&&"range"!==n&&!e.readOnly&&!e.disabled){const t=document.createElement("button");t.type="button",t.title=e.getAttribute("data-clear-field-text")||"Clear field",t.ariaLabel=e.getAttribute("data-clear-field-text")||"Clear field",t.tabIndex=-1,t.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" />',t.classList.add("clear"),t.id=`semanticFormsClearButton_${e.id}`,t.addEventListener("click",()=>{e.previousValue=e.value,e.value="",e.focus(),d=e.id,e.dispatchEvent(new Event("input",{bubbles:!0}))}),o(t,i.querySelector("label"))}e.addEventListener("focus",e=>{"INPUT"===e.target.nodeName&&(l=e.target)});for(const e of i.className.match(/colspan-(?:[0-9]|full)|col-[0-9]/g)||[])i.classList.remove(e),t.classList.add(e);if(null!==e.getAttribute("data-max-content")&&!("fieldSizing"in document.createElement("input").style)){const t=()=>{const t=8*(""!==e.value?e.value:e.placeholder).length+40;e.style.width=t+"px",e.style.maxWidth="100%"};t(),e.addEventListener("input",t)}h||(r.before(t),t.append(r,i),"none"===r.style.display&&"none"===i.style.display&&(t.style.display="none"))}if("file"===n){const t=e.parentElement.querySelector(".clear");e.addEventListener("input",e=>{t.style.display=e.target.files.length?"flex":"none"}),t.addEventListener("click",()=>{t.style.display="none"})}if("range"===n&&(null!==e.getAttribute("data-display-value")||e.classList.contains("displayValue"))){e.parentNode.parentNode.querySelector("dd label").innerHTML+=`<span class="seperator">: </span><output>${e.value}</output>`,e.addEventListener("input",e=>{e.target.parentNode.parentNode.querySelector("output").innerHTML=e.target.value})}if("password"===n&&null===e.getAttribute("data-no-reveal")){const t=document.createElement("button");t.type="button",t.title=e.getAttribute("data-show-password-text")||"Show password",t.ariaLabel=e.getAttribute("data-show-password-text")||"Show password",t.tabIndex=-1,t.innerHTML=r,t.classList.add("show"),t.id=`semanticFormsShowButton_${e.id}`;const n=e.closest("dd");if(!n)return void console.error(`semantic-forms: Found an input (${e.id||e.getAttribute("name")}) that is not inside a <dd> element.`);t.addEventListener("click",()=>{"password"===e.type?(t.innerHTML=i,t.title=e.getAttribute("data-hide-password-text")||"Hide password",t.ariaLabel=e.getAttribute("data-hide-password-text")||"Hide password",e.type="text"):(t.innerHTML=r,t.title=e.getAttribute("data-show-password-text")||"Show password",t.ariaLabel=e.getAttribute("data-show-password-text")||"Show password",e.type="password"),e.focus()}),o(t,n.querySelector("label"))}if("checkbox"===n&&e.hasAttribute("switch")&&!c&&(e.setAttribute("role","switch"),(e=>{e.addEventListener("pointerdown",t=>{if(e.disabled)return;const n=t.clientX,o="rtl"===window.getComputedStyle(e).direction,r=e.clientWidth/2||1,i=e.checked;let s=!1;e.setPointerCapture(t.pointerId);const a=t=>{const a=o?n-t.clientX:t.clientX-n;!s&&Math.abs(a)<=5||(s=!0,t.preventDefault(),e.checked=(i?1:0)+a/r>.5)},l=t=>{e.releasePointerCapture(t.pointerId),e.removeEventListener("pointermove",a),e.removeEventListener("pointerup",l),e.removeEventListener("pointercancel",l),s&&(e.addEventListener("click",e=>e.preventDefault(),{once:!0,capture:!0}),e.checked!==i&&(e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))))};e.addEventListener("pointermove",a),e.addEventListener("pointerup",l),e.addEventListener("pointercancel",l)})})(e)),"TEXTAREA"===e.nodeName){if(null===e.getAttribute("data-disable-autosize")){e.style.setProperty("resize","none"),e.style.setProperty("min-height","0"),e.style.setProperty("max-height","none"),e.style.setProperty("height","auto");const t=()=>{let t=e.getAttribute("data-max-rows");t&&(isNaN(t)||Number(t)<=0)&&(console.warn(`An invalid value was passed to the "data-max-rows" attribute. This value will be ignored.\n\nProvided value: ${e.getAttribute("data-max-rows")}`),t=null);const n=e.getAttribute("data-max-rows")&&Number(e.getAttribute("data-max-rows"))<5?e.getAttribute("data-max-rows"):"5";e.setAttribute("rows",n);const o=window.getComputedStyle(e),r=parseFloat(o["padding-left"])+parseFloat(o["padding-right"]),i=parseFloat(o["border-left-width"])+parseFloat(o["border-right-width"]);e.style.setProperty("overflow","hidden","important"),e.style.setProperty("width",parseFloat(o.width)-r-i+"px"),e.style.setProperty("box-sizing","content-box"),e.style.setProperty("padding-inline","0"),e.style.setProperty("border-width","0");const s=parseFloat(o["padding-top"])+parseFloat(o["padding-bottom"]),a="normal"===o["line-height"]?parseFloat(o.height):parseFloat(o["line-height"]),l=Math.round(e.scrollHeight);e.style.removeProperty("width"),e.style.removeProperty("box-sizing"),e.style.removeProperty("padding-inline"),e.style.removeProperty("border-width"),e.style.removeProperty("overflow");const d=Math.round((l-s)/a);t?e.setAttribute("rows",""+Math.min(d,Number(t))):e.setAttribute("rows",""+d)};e.addEventListener("input",t),e.dispatchEvent(new Event("input",{bubbles:!0}))}if(null!==e.getAttribute("data-auto-grow")&&!("fieldSizing"in document.createElement("input").style)){const n=()=>{if(e.value.length){const t=parseInt(window.getComputedStyle(e).getPropertyValue("border-width"));e.style.height=e.scrollHeight+2*t+"px"}else e.style.height=window.getComputedStyle(t).getPropertyValue("--semanticFormsInputHeight")};e.style.height=window.getComputedStyle(t).getPropertyValue("--semanticFormsInputHeight"),e.addEventListener("input",n)}const n=()=>{const t=e.parentElement?.querySelector("button.clear");t&&(t.style.marginRight=e.clientHeight<e.scrollHeight?"15px":"")};e.addEventListener("input",n),e.addEventListener("mouseup",n),n()}},handleUndoRedo:e=>{!e.ctrlKey&&!e.metaKey||"z"!==e.key||e.shiftKey?(e.ctrlKey&&"y"===e.key||e.metaKey&&e.shiftKey&&"z"===e.key)&&l&&(l?.parentNode?.querySelector("button.clear")?.id!==`semanticFormsClearButton_${d}`&&l?.parentNode?.querySelector("button.clear")?.name!==`semanticFormsClearButton_${d}`||l.redoValue&&(e.preventDefault(),l.previousValue=l.value,l.value=l.redoValue)):l&&(l?.parentNode?.querySelector("button.clear")?.id!==`semanticFormsClearButton_${d}`&&l?.parentNode?.querySelector("button.clear")?.name!==`semanticFormsClearButton_${d}`||l.previousValue&&(e.preventDefault(),l.redoValue=l.value,l.value=l.previousValue))}}},497(e,t,n){const{getOS:o,insertAfter:r}=n(584),i={Minus:"-",Equal:"=",BracketLeft:"[",BracketRight:"]",Backslash:"\\",Semicolon:";",Quote:"'",Comma:",",Period:".",Slash:"/",Backquote:"`"},s={1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")",Minus:"_",Equal:"+",BracketLeft:"{",BracketRight:"}",Backslash:"|",Semicolon:":",Quote:'"',Comma:"<",Period:">",Slash:"?",Backquote:"~"};e.exports={shortcutListener:(e,t)=>{const n=t.find(t=>{let n,o=!1;if(e.altKey&&!e.shiftKey)o="Key"+t.key.toUpperCase()===e.code||"Digit"+t.key.toUpperCase()===e.code||t.key===e.key||i[e.code]===t.key;else if(e.shiftKey){const n=e.code.replace(/Key|Digit/,"");o=(s[n]||s[e.key])&&(s[n]===t.key||s[e.key]===t.key)}else o=t.key.toUpperCase()===e.key.toUpperCase();return!!o&&(t.modifier&&(t.modifier===t.defaultModifier&&(n="windows"===t.os||"linux"===t.os?e.ctrlKey:e.metaKey),"meta"===t.modifier&&(n=e.metaKey),"alt"===t.modifier&&(n=e.altKey),"ctrl"===t.modifier&&(n=e.ctrlKey)),n)});n&&(e.preventDefault(),n.input.focus())},createKeyboardShortcut:(e,t)=>{const n=o(),i="metactrl";let s,a=e.getAttribute("data-focus-key");a.length>1&&(console.error(`Provided focus key "${a}" is more than one character. Using first character only.`),a=a.toString()[0]);let l=i;const d={default:e.getAttribute("data-focus-modifier")||i,linux:e.getAttribute("data-focus-modifier-linux"),mac:e.getAttribute("data-focus-modifier-mac"),windows:e.getAttribute("data-focus-modifier-win")};l=n&&d[n]?d[n]:d.default;if(["ctrl","alt","opt","meta","cmd",i].includes(l)||(console.error(`Received an unrecognized modifier, "${l}," defaulting to "${i}."`,e),l=i),["alt","opt"].includes(l)?s="mac"===n?"⌥":"⎇":["meta","win","cmd"].includes(l)||l===i&&"mac"===n?s="mac"===n?"⌘":"linux"===n?"◆":"⊞":"ctrl"!==l&&(l!==i||"windows"!==n&&"linux"!==n)||(s="mac"===n?"⌃":"Ctrl"),t.some(e=>e.key===a&&e.modifier===l)&&console.error(`Duplicate keyboard shortcut "${l} + ${a}" detected. Only the first input will be focusable using this keyboard shortcut.`,e),"TEXTAREA"===e.nodeName||"text"===e.type||"number"===e.type){const t=document.createElement("span");t.classList.add("focus-key"),t.innerHTML=`<kbd>${s} ${a.toUpperCase()}</kbd>`;const n=e.nextSibling;r(t,n)}else e.getAttribute("title")?e.setAttribute("title",e.getAttribute("title")+` (${s} + ${a})`):e.setAttribute("title",`Focus with ${s} + ${a}`);return{key:a,modifier:l,input:e,os:n,defaultModifier:i}}}},61(e){let t=0;e.exports={enhanceTabs:e=>{for(const n of e.querySelectorAll(".tabs:not(.semanticFormsTabsActive)")){const e=Array.from(n.children).filter(e=>"FIELDSET"===e.nodeName);if(e.length<2){0===e.length&&console.error("semantic-forms: Found a .tabs element with no <fieldset> children. Each tab needs to be a <fieldset> with a <legend> naming it.",n);continue}n.classList.add("semanticFormsTabsActive");const o=++t,r=document.createElement("div"),i=[];r.classList.add("tabList"),r.setAttribute("role","tablist");const s=(t,n)=>{for(const[n,o]of e.entries())o.hidden=n!==t;for(const[e,n]of i.entries()){const o=e===t;n.setAttribute("aria-selected",o?"true":"false"),n.tabIndex=o?0:-1}n&&i[t].focus()};for(const[t,n]of e.entries()){const e=n.querySelector("legend"),a=document.createElement("button");a.type="button",a.setAttribute("role","tab"),a.id=`semanticFormsTab_${o}_${t}`,a.textContent=e?e.textContent:`Tab ${t+1}`,n.id||(n.id=`semanticFormsTabPanel_${o}_${t}`),n.setAttribute("role","tabpanel"),n.setAttribute("aria-labelledby",a.id),a.setAttribute("aria-controls",n.id),e&&(e.hidden=!0),a.addEventListener("click",()=>s(t)),i.push(a),r.append(a)}r.addEventListener("keydown",e=>{const t=i.indexOf(document.activeElement);if(-1===t)return;const n={ArrowRight:(t+1)%i.length,ArrowLeft:(t-1+i.length)%i.length,Home:0,End:i.length-1};e.key in n&&(e.preventDefault(),s(n[e.key],!0))}),n.prepend(r),s(0)}}}},90(e,t,n){const{createKeyboardShortcut:o,shortcutListener:r}=n(497),{enhanceInput:i,handleUndoRedo:s}=n(866),{enhanceTabs:a}=n(61),{setInkOffset:l}=n(584),d=new WeakMap,c=(e=document)=>{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 t=[];document.addEventListener("keydown",e=>r(e,t));const n=e.querySelectorAll("form.semanticForms:not(.semanticFormsActive), table.semanticForms:not(.semanticFormsActive)");for(const e of n){if(e.classList.add("semanticFormsActive"),e.classList.contains("lowFlow"))continue;l(e,e);const n=Array.from(e.querySelectorAll("input, textarea, select"));for(const r of n)if(i(r,e),null!==r.getAttribute("data-focus-key")){const e=o(r,t);t.push(e)}a(e)}if(document.removeEventListener("keydown",s),document.addEventListener("keydown",s),!d.has(e)){const t=new window.MutationObserver(t=>{let n=!1;for(const o of t){for(const t of o.addedNodes)("FORM"===t.nodeName||t?.querySelector?.("form"))&&(c(e),n=!0);if(n)break}});t.observe(e===document?document.body:e,{attributes:!1,childList:!0,characterData:!1,subtree:!0}),d.set(e,t),e===document&&(window.semanticFormsObserver=t)}c.reinitialize=t=>{if(!t)return c(e);t.classList.remove("semanticFormsActive"),c(t.getRootNode())}};e.exports=c}};const t={};let n=function n(o){const r=t[o];if(void 0!==r)return r.exports;const i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}(90);return n})());
|
|
2
2
|
//# sourceMappingURL=semantic-forms.min.js.map
|