semantic-forms 4.0.4 → 5.0.0
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/LICENSE.md +1 -1
- package/README.md +39 -11
- package/dist/semantic-forms.cjs +92 -0
- package/dist/semantic-forms.cjs.map +1 -0
- package/{semanticForms.css → dist/semantic-forms.css} +19 -8
- package/dist/semantic-forms.css.map +1 -0
- package/dist/semantic-forms.js +91 -0
- package/dist/semantic-forms.js.map +1 -0
- package/dist/semantic-forms.min.js +2 -0
- package/dist/semantic-forms.min.js.map +1 -0
- package/dist/semantic-forms.min.mjs +2 -0
- package/dist/semantic-forms.min.mjs.map +1 -0
- package/dist/semantic-forms.mjs +89 -0
- package/dist/semantic-forms.mjs.map +1 -0
- package/package.json +21 -12
- package/semanticForms.js +73 -7
- package/semanticForms.scss +14 -5
package/LICENSE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
License
|
|
2
2
|
===
|
|
3
3
|
|
|
4
|
-
All original code in is licensed under the [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/). Commercial and noncommercial use is permitted with attribution.
|
|
4
|
+
All original code in this project is licensed under the [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/). Commercial and noncommercial use is permitted with attribution.
|
package/README.md
CHANGED
|
@@ -15,13 +15,25 @@ A pattern library of attractive forms for your website with the following design
|
|
|
15
15
|
- Sets no global styles and is scoped by a single class name `semanticForms` applied to `<form>` elements.
|
|
16
16
|
- No dependencies.
|
|
17
17
|
|
|
18
|
-
See a [live demo here](https://rooseveltframework.github.io/semantic-forms/semanticForms.html).
|
|
18
|
+
See a [live demo here](https://rooseveltframework.github.io/semantic-forms/test/semanticForms.html).
|
|
19
19
|
|
|
20
20
|
This module was built and is maintained by the [Roosevelt web framework](https://github.com/rooseveltframework/roosevelt) [team](https://github.com/orgs/rooseveltframework/people), but it can be used independently of Roosevelt as well.
|
|
21
21
|
|
|
22
|
+
# Install
|
|
23
|
+
|
|
24
|
+
`npm install semantic-forms`
|
|
25
|
+
|
|
26
|
+
The package is distributed with the following builds available:
|
|
27
|
+
|
|
28
|
+
- `dist/semantic-forms.cjs`: CommonJS bundle: `const semanticForms = require('semantic-forms')`
|
|
29
|
+
- `dist/semantic-forms.js`: Standalone bundle that can be included via `<script>` tags. Declares a global variable called: `semanticForms`
|
|
30
|
+
- `dist/semantic-forms.min.js`: Minified standalone bundle that can be included via `<script>` tags. Declares a global variable called: `semanticForms`
|
|
31
|
+
- `dist/semantic-forms.mjs`: ES module: `import semanticForms from 'semantic-forms'`
|
|
32
|
+
- `dist/semantic-forms.min.mjs`: Minified ES module: `import semanticForms from 'semantic-forms/min'`
|
|
33
|
+
|
|
22
34
|
# Usage
|
|
23
35
|
|
|
24
|
-
Include the `
|
|
36
|
+
Include the `dist/semantic-forms.css` and whichever of the above versions of the JS file you prefer from this repo into your project.
|
|
25
37
|
|
|
26
38
|
Then apply the `semanticForms` class to your `<form>` elements:
|
|
27
39
|
|
|
@@ -85,6 +97,20 @@ Include a label in the `<dd>` element with a matching `for` attribute to place h
|
|
|
85
97
|
</form>
|
|
86
98
|
```
|
|
87
99
|
|
|
100
|
+
#### Customizing input fields
|
|
101
|
+
|
|
102
|
+
By default, input fields will display an X icon to clear the text and password fields will also display a show/hide toggle for displaying the password in plain text. You can customize this behavior as follows:
|
|
103
|
+
|
|
104
|
+
- Customize the hover text of the clear field button by applying a `data-clear-field-text="your text"` attribute to the input.
|
|
105
|
+
|
|
106
|
+
- Customize the hover text of the show password button by applying a `data-show-password-text="your text"` attribute to the input.
|
|
107
|
+
|
|
108
|
+
- Customize the hover text of the hide password button by applying a `data-hide-password-text="your text"` attribute to the input.
|
|
109
|
+
|
|
110
|
+
- Prevent the show/hide toggle from appearing on password fields by applying a `data-no-reveal` attribute to the input.
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
88
114
|
## Responsive columns
|
|
89
115
|
|
|
90
116
|
This feature makes it so the form fields will grow, shrink, expand the number of columns, or reduce the number of columns based on how much space exists in the container. You can customize it by applying various `colspan-#` classes to various elements in the form markup structure.
|
|
@@ -142,8 +168,8 @@ You can also apply the class to a `<fieldset>` which will apply that styling to
|
|
|
142
168
|
```
|
|
143
169
|
|
|
144
170
|
### Set number of columns a single input field takes up
|
|
145
|
-
You can specify the number of columns an input will span using the `colspan-#` class on the `<dd>` element. The inputs are responsive and will shrink according to available space. Available numbered classes are `colspan-1` through `colspan-5`:
|
|
146
171
|
|
|
172
|
+
You can specify the number of columns an input will span using the `colspan-#` class on the `<dd>` element. The inputs are responsive and will shrink according to available space. Available numbered classes are `colspan-1` through `colspan-5`:
|
|
147
173
|
|
|
148
174
|
```html
|
|
149
175
|
<form class="semanticForms">
|
|
@@ -199,7 +225,7 @@ To apply `colspan-#` styles to low flow (JavaScript disabled flow) form inputs,
|
|
|
199
225
|
<dt><label for="input-a">Input A</label></dt>
|
|
200
226
|
<!-- this spans 2 columns on row 1 -->
|
|
201
227
|
<dd class="colspan-2"><input type="text" id="input-a" name="input-a"></dd>
|
|
202
|
-
|
|
228
|
+
</div>
|
|
203
229
|
</dl>
|
|
204
230
|
</fieldset>
|
|
205
231
|
</form>
|
|
@@ -248,8 +274,8 @@ Not too different than other inputs:
|
|
|
248
274
|
```html
|
|
249
275
|
<form class="semanticForms">
|
|
250
276
|
<dl>
|
|
251
|
-
<dt><label for="
|
|
252
|
-
<dd><input
|
|
277
|
+
<dt><label for="some_field_name">Single checkbox</label></dt>
|
|
278
|
+
<dd><input type="checkbox" name="some_field_name" id="checkbox"></dd>
|
|
253
279
|
</dl>
|
|
254
280
|
</form>
|
|
255
281
|
```
|
|
@@ -261,15 +287,16 @@ Not too different than other inputs:
|
|
|
261
287
|
<dl>
|
|
262
288
|
<dt><label data-for="some_field_name">Checkboxes:</label></dt>
|
|
263
289
|
<dd class="checkboxes">
|
|
264
|
-
<ul id="
|
|
265
|
-
<li><input type="checkbox" name="some_field_name" id="
|
|
266
|
-
<li><input type="checkbox" name="some_field_name" id="
|
|
267
|
-
<li><input type="checkbox" name="some_field_name" id="
|
|
290
|
+
<ul id="some_field_name_checkboxes">
|
|
291
|
+
<li><input type="checkbox" name="some_field_name" id="some_field_name_checkboxes_one"> <label for="some_field_name_checkboxes_one">One</label></li>
|
|
292
|
+
<li><input type="checkbox" name="some_field_name" id="some_field_name_checkboxes_two"> <label for="some_field_name_checkboxes_two">Two</label></li>
|
|
293
|
+
<li><input type="checkbox" name="some_field_name" id="some_field_name_checkboxes_three"> <label for="some_field_name_checkboxes_three">Three</label></li>
|
|
268
294
|
</ul>
|
|
269
295
|
</dd>
|
|
270
296
|
</dl>
|
|
271
297
|
</form>
|
|
272
298
|
```
|
|
299
|
+
|
|
273
300
|
### Radio buttons
|
|
274
301
|
|
|
275
302
|
```html
|
|
@@ -324,6 +351,7 @@ You can adjust the tooltip text of the asterisk with the `data-asterisk-text` at
|
|
|
324
351
|
</dl>
|
|
325
352
|
</form>
|
|
326
353
|
```
|
|
354
|
+
|
|
327
355
|
## Dark mode
|
|
328
356
|
|
|
329
357
|
To set the dark mode, apply an additional class of `dark` to your `<form>` elements to force the dark mode.
|
|
@@ -344,5 +372,5 @@ The low-flow mode reverts the float label pattern to traditional labels and does
|
|
|
344
372
|
- `npm run build`. The build step compiles the SCSS file into CSS.
|
|
345
373
|
- You can also run `npm run watch` automatically compiles the CSS file after a change is detected in the SCSS file.
|
|
346
374
|
- Test your changes by opening `semanticForms.html` in your browser.
|
|
347
|
-
- If you want to test your work on an actual HTTP server, run `npm run dev` or `npm run d
|
|
375
|
+
- If you want to test your work on an actual HTTP server, run `npm run dev` or `npm run d`, and then visit http://localhost:3000/test/semanticForms
|
|
348
376
|
- Commit, push, open pull request.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
(function(root,factory){if(typeof exports==="object"&&typeof module==="object")module.exports=factory();else if(typeof define==="function"&&define.amd)define("semanticForms",[],factory);else if(typeof exports==="object")exports["semanticForms"]=factory();else root["semanticForms"]=factory()})(this,(()=>/******/(()=>{// webpackBootstrap
|
|
2
|
+
/******/var __webpack_modules__={
|
|
3
|
+
/***/"./semanticForms.js":
|
|
4
|
+
/*!**************************!*\
|
|
5
|
+
!*** ./semanticForms.js ***!
|
|
6
|
+
\**************************/
|
|
7
|
+
/***/module=>{module.exports=()=>{
|
|
8
|
+
// do some feature detection so none of the JS executes if the browser is too old
|
|
9
|
+
if(typeof document.getElementsByClassName!=="function"||typeof document.querySelector!=="function"||!document.body.classList||!window.MutationObserver)return;const passwordShow='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m1 12s4-8 11-8 11 8 11 8"/><path d="m1 12s4 8 11 8 11-8 11-8"/><circle cx="12" cy="12" r="3"/></g></svg>';const passwordHide='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m2 2 20 20"/><path d="m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335"/><path d="m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192"/></g></svg>';const nodeNameLookup=["TEXTAREA","SELECT"];const inputTypeLookup=["checkbox","color","date","datetime-local","email","file","image","month","number","password","radio","range","search","tel","text","time","url","week"];
|
|
10
|
+
// progressively enhance form elements that have the semanticForms class
|
|
11
|
+
const forms=document.querySelectorAll("form.semanticForms:not(.semanticFormsActive)");for(const form of forms){form.classList.add("semanticFormsActive");if(form.classList.contains("lowFlow"))continue;
|
|
12
|
+
// update each input in the semantic form
|
|
13
|
+
const inputs=Array.from(form.querySelectorAll("input, textarea, select"));for(const input of inputs){
|
|
14
|
+
// ignore input if it has previously been formatted
|
|
15
|
+
if(input.classList.contains("semanticform")||!input.id)continue;const type=input.getAttribute("type");if(nodeNameLookup.includes(input.nodeName)||inputTypeLookup.includes(type)){
|
|
16
|
+
// recursively find <dl> element
|
|
17
|
+
let dl=input.parentNode;while(dl&&dl.nodeName!=="DL")dl=dl.parentNode;if(!dl)continue;if(!dl.classList.contains("floatLabelForm"))dl.classList.add("floatLabelForm");const label=input.parentNode.parentNode.id&&(type==="checkbox"||type==="radio")?document.querySelector("label[data-for="+input.parentNode.parentNode.id.replace(/\./g,"\\.")+"]"):document.querySelector("label[for="+input.id.replace(/\./g,"\\.")+"]");input.classList.add("semanticform");
|
|
18
|
+
// #region create labels
|
|
19
|
+
if(type==="checkbox"||type==="radio"){
|
|
20
|
+
// recursively find <dd> element
|
|
21
|
+
let dd=input.parentNode;while(dd&&dd.nodeName!=="DD")dd=dd.parentNode;if(dd.firstChild.nodeName!=="LABEL"){const newLabel=document.createElement("label");newLabel.className="floatLabelFormAnimatedLabel";if(type==="checkbox"&&input.parentNode.nodeName==="DD"){newLabel.setAttribute("for",input.id);input.parentNode.classList.add("singleCheckbox");newLabel.className="";label.setAttribute("hidden","hidden");insertAfter(newLabel,input)}newLabel.innerHTML=label.innerHTML;if(dd.querySelector(":required")&&label.getAttribute("data-no-asterisk")===null&&!label.querySelector("span")){const text=label.getAttribute("data-asterisk-text")||"This field is required.";label.innerHTML+=`<span title="${text}">*</span>`}if(!dd.querySelector("label"))dd.append(newLabel)}
|
|
22
|
+
// removes old div that a radio or checkbox may have been added to
|
|
23
|
+
if(dd.parentElement.nodeName==="DIV")dd.parentElement.remove();const div=document.createElement("div");div.append(label.closest("dt"),dd);dl.append(div)}else{const newLabel=document.createElement("label");newLabel.setAttribute("for",input.id);newLabel.className="floatLabelFormAnimatedLabel";newLabel.innerHTML=label.innerHTML;if(input.hasAttribute("required")&&label.getAttribute("data-no-asterisk")===null&&!label.querySelector("span")){const text=label.getAttribute("data-asterisk-text")||"This field is required.";newLabel.innerHTML+=` <span title="${text}">*</span>`}label.setAttribute("hidden","hidden");insertAfter(newLabel,input)}
|
|
24
|
+
// #endregion
|
|
25
|
+
// standard inputs
|
|
26
|
+
if(type!=="checkbox"&&type!=="radio"){if(!input.getAttribute("placeholder"))input.setAttribute("placeholder"," ");const div=document.createElement("div");const dt=label.closest("dt");const dd=input.closest("dd");
|
|
27
|
+
// #region clear button
|
|
28
|
+
if(input.nodeName!=="SELECT"&&type!=="range"){const clearBtn=document.createElement("button");clearBtn.type="button";clearBtn.title=input.getAttribute("data-clear-field-text")||"Clear field";clearBtn.ariaLabel=input.getAttribute("data-clear-field-text")||"Clear field";clearBtn.tabIndex=-1;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" />';clearBtn.classList.add("clear");clearBtn.id=`semanticFormsClearButton_${input.id}`;clearBtn.addEventListener("click",(event=>{input.previousValue=input.value;input.value="";input.focus();lastClearFieldPressed=input.id}));insertAfter(clearBtn,dd.querySelector("label"))}input.addEventListener("focus",(event=>{if(event.target.nodeName==="INPUT")lastFocusedInput=event.target}));
|
|
29
|
+
// #endregion
|
|
30
|
+
// check for colspan- utility class
|
|
31
|
+
if(/colspan-/.test(dd.className)){const match=dd.className.match(/colspan-([0-9]|full)/)[0];dd.classList.remove(match);div.classList.add(match)}div.append(dt,dd);dl.append(div);
|
|
32
|
+
// determine visibility of newly created <div>
|
|
33
|
+
if(dt.style.display==="none"&&dd.style.display==="none")div.style.display="none"}
|
|
34
|
+
// handle file input clear btn, cannot be handled with CSS
|
|
35
|
+
if(type==="file"){const clearBtn=input.parentElement.querySelector(".clear");input.addEventListener("input",(e=>{clearBtn.style.display=e.target.files.length?"flex":"none"}));clearBtn.addEventListener("click",(()=>{clearBtn.style.display="none"}))}
|
|
36
|
+
// #region show password button
|
|
37
|
+
if(type==="password"&&input.getAttribute("data-no-reveal")===null){const showBtn=document.createElement("button");showBtn.type="button";showBtn.title=input.getAttribute("data-show-password-text")||"Show password";showBtn.ariaLabel=input.getAttribute("data-show-password-text")||"Show password";showBtn.tabIndex=-1;showBtn.innerHTML=passwordShow;showBtn.classList.add("show");showBtn.id=`semanticFormsShowButton_${input.id}`;const dd=input.closest("dd");showBtn.addEventListener("click",(event=>{if(input.type==="password"){showBtn.innerHTML=passwordHide;showBtn.title=input.getAttribute("data-hide-password-text")||"Hide password";showBtn.ariaLabel=input.getAttribute("data-hide-password-text")||"Hide password";input.type="text"}else{showBtn.innerHTML=passwordShow;showBtn.title=input.getAttribute("data-show-password-text")||"Show password";showBtn.ariaLabel=input.getAttribute("data-show-password-text")||"Show password";input.type="password"}input.focus()}));insertAfter(showBtn,dd.querySelector("label"))}
|
|
38
|
+
// #endregion
|
|
39
|
+
// add listener to shift clear button when scrollbar present
|
|
40
|
+
for(const textarea of document.querySelectorAll("textarea")){
|
|
41
|
+
// shifts the close button to the right if a scrollbar is present
|
|
42
|
+
const shiftCloseBtn=()=>{const clearBtn=textarea.parentElement?.querySelector("button.clear");if(clearBtn)clearBtn.style.marginRight=textarea.clientHeight<textarea.scrollHeight?"15px":""};textarea.addEventListener("input",shiftCloseBtn);textarea.addEventListener("mouseup",shiftCloseBtn)}}}}
|
|
43
|
+
/**
|
|
44
|
+
* Places an element immediately after another element
|
|
45
|
+
* @param {Object} newNode element being placed after the reference node
|
|
46
|
+
* @param {*} referenceNode element to be used as reference for new node
|
|
47
|
+
*/function insertAfter(newNode,referenceNode){if(referenceNode.nextSibling)referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);else referenceNode.parentNode.appendChild(newNode)}
|
|
48
|
+
// handle undo/redo
|
|
49
|
+
let lastFocusedInput;let lastClearFieldPressed;document.addEventListener("keydown",(event=>{if((event.ctrlKey||event.metaKey)&&event.key==="z"&&!event.shiftKey){
|
|
50
|
+
// undo clearing a field
|
|
51
|
+
if(lastFocusedInput)if(lastFocusedInput?.parentNode?.querySelector("button.clear").id===`semanticFormsClearButton_${lastClearFieldPressed}`||lastFocusedInput?.parentNode?.querySelector("button.clear").name===`semanticFormsClearButton_${lastClearFieldPressed}`)if(lastFocusedInput.previousValue){lastFocusedInput.redoValue=lastFocusedInput.value;lastFocusedInput.value=lastFocusedInput.previousValue}}else if(event.ctrlKey&&event.key==="y"||event.metaKey&&event.shiftKey&&event.key==="z")
|
|
52
|
+
// redo clearing a field
|
|
53
|
+
if(lastFocusedInput)if(lastFocusedInput?.parentNode?.querySelector("button.clear").id===`semanticFormsClearButton_${lastClearFieldPressed}`||lastFocusedInput?.parentNode?.querySelector("button.clear").name===`semanticFormsClearButton_${lastClearFieldPressed}`)if(lastFocusedInput.redoValue){lastFocusedInput.previousValue=lastFocusedInput.value;lastFocusedInput.value=lastFocusedInput.redoValue}}));
|
|
54
|
+
// monitor changes to the DOM and enhance new semanticForms forms that get added
|
|
55
|
+
if(!window.semanticFormsObserver){window.semanticFormsObserver=new window.MutationObserver((mutations=>{let stop=false;for(const mutation of mutations){for(const node of mutation.addedNodes)if(node.nodeName==="FORM"){window.semanticForms();stop=true}if(stop)break}}));window.semanticFormsObserver.observe(document.body,{attributes:false,childList:true,characterData:false,subtree:true})}window.semanticForms.reinitialize=form=>{form.classList.remove("semanticFormsActive");window.semanticForms()}}
|
|
56
|
+
/***/
|
|
57
|
+
/******/}};
|
|
58
|
+
/************************************************************************/
|
|
59
|
+
/******/ // The module cache
|
|
60
|
+
/******/var __webpack_module_cache__={};
|
|
61
|
+
/******/
|
|
62
|
+
/******/ // The require function
|
|
63
|
+
/******/function __webpack_require__(moduleId){
|
|
64
|
+
/******/ // Check if module is in cache
|
|
65
|
+
/******/var cachedModule=__webpack_module_cache__[moduleId];
|
|
66
|
+
/******/if(cachedModule!==void 0)
|
|
67
|
+
/******/return cachedModule.exports;
|
|
68
|
+
/******/
|
|
69
|
+
/******/ // Create a new module (and put it into the cache)
|
|
70
|
+
/******/var module=__webpack_module_cache__[moduleId]={
|
|
71
|
+
/******/ // no module.id needed
|
|
72
|
+
/******/ // no module.loaded needed
|
|
73
|
+
/******/exports:{}
|
|
74
|
+
/******/};
|
|
75
|
+
/******/
|
|
76
|
+
/******/ // Execute the module function
|
|
77
|
+
/******/__webpack_modules__[moduleId](module,module.exports,__webpack_require__);
|
|
78
|
+
/******/
|
|
79
|
+
/******/ // Return the exports of the module
|
|
80
|
+
/******/return module.exports;
|
|
81
|
+
/******/}
|
|
82
|
+
/******/
|
|
83
|
+
/************************************************************************/
|
|
84
|
+
/******/
|
|
85
|
+
/******/ // startup
|
|
86
|
+
/******/ // Load entry module and return exports
|
|
87
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
88
|
+
/******/var __webpack_exports__=__webpack_require__("./semanticForms.js");
|
|
89
|
+
/******/
|
|
90
|
+
/******/return __webpack_exports__;
|
|
91
|
+
/******/})()));
|
|
92
|
+
//# sourceMappingURL=semantic-forms.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantic-forms.cjs","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,MAAM,Y;;;;;;cCTTH,OAAOD,QAAU;;AAEf,UAAWK,SAASC,yBAA2B,mBAAqBD,SAASE,gBAAkB,aAAeF,SAASG,KAAKC,YAAcC,OAAOC,iBAAkB,OAEnK,MAAMC,aAAe,8SACrB,MAAMC,aAAe,siBAErB,MAAMC,eAAiB,CAAC,WAAY,UACpC,MAAMC,gBAAkB,CAAC,WAAY,QAAS,OAAQ,iBAAkB,QAAS,OAAQ,QAAS,QAAS,SAAU,WAAY,QAAS,QAA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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 ","module.exports = () => {\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) return\n\n const passwordShow = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m1 12s4-8 11-8 11 8 11 8\"/><path d=\"m1 12s4 8 11 8 11-8 11-8\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></g></svg>'\n const passwordHide = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m2 2 20 20\"/><path d=\"m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335\"/><path d=\"m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192\"/></g></svg>'\n\n const nodeNameLookup = ['TEXTAREA', 'SELECT']\n const inputTypeLookup = ['checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'image', 'month', 'number', 'password', 'radio', 'range', 'search', 'tel', 'text', 'time', 'url', 'week']\n\n // progressively enhance form elements that have the semanticForms class\n const forms = document.querySelectorAll('form.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 // ignore input if it has previously been formatted\n if (input.classList.contains('semanticform') || !input.id) continue\n\n const type = input.getAttribute('type')\n if (nodeNameLookup.includes(input.nodeName) || inputTypeLookup.includes(type)) {\n // recursively find <dl> element\n let dl = input.parentNode\n while (dl && dl.nodeName !== 'DL') dl = dl.parentNode\n\n if (!dl) continue\n if (!dl.classList.contains('floatLabelForm')) dl.classList.add('floatLabelForm')\n\n const label = input.parentNode.parentNode.id && (type === 'checkbox' || type === 'radio')\n ? document.querySelector('label[data-for=' + input.parentNode.parentNode.id.replace(/\\./g, '\\\\.') + ']')\n : document.querySelector('label[for=' + input.id.replace(/\\./g, '\\\\.') + ']')\n\n input.classList.add('semanticform')\n\n // #region create labels\n if (type === 'checkbox' || type === 'radio') {\n // recursively find <dd> element\n let dd = input.parentNode\n while (dd && dd.nodeName !== 'DD') dd = dd.parentNode\n\n if (dd.firstChild.nodeName !== 'LABEL') {\n const newLabel = document.createElement('label')\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\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 newLabel.innerHTML = label.innerHTML\n\n if (dd.querySelector(':required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n label.innerHTML += `<span title=\"${text}\">*</span>`\n }\n\n if (!dd.querySelector('label')) dd.append(newLabel)\n }\n\n // removes old div that a radio or checkbox may have been added to\n if (dd.parentElement.nodeName === 'DIV') dd.parentElement.remove()\n\n const div = document.createElement('div')\n div.append(label.closest('dt'), dd)\n dl.append(div)\n } else {\n const newLabel = document.createElement('label')\n newLabel.setAttribute('for', input.id)\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\n newLabel.innerHTML = label.innerHTML\n\n if (input.hasAttribute('required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n newLabel.innerHTML += ` <span title=\"${text}\">*</span>`\n }\n\n label.setAttribute('hidden', 'hidden')\n\n insertAfter(newLabel, input)\n }\n // #endregion\n\n // standard inputs\n if (type !== 'checkbox' && type !== 'radio') {\n if (!input.getAttribute('placeholder')) {\n input.setAttribute('placeholder', ' ')\n }\n\n const div = document.createElement('div')\n const dt = label.closest('dt')\n const dd = input.closest('dd')\n\n // #region 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', (event) => {\n input.previousValue = input.value\n input.value = ''\n input.focus()\n lastClearFieldPressed = input.id\n })\n insertAfter(clearBtn, dd.querySelector('label'))\n }\n input.addEventListener('focus', (event) => {\n if (event.target.nodeName === 'INPUT') lastFocusedInput = event.target\n })\n // #endregion\n\n // check for colspan- utility class\n if (/colspan-/.test(dd.className)) {\n const match = dd.className.match(/colspan-([0-9]|full)/)[0]\n dd.classList.remove(match)\n div.classList.add(match)\n }\n\n div.append(dt, dd)\n dl.append(div)\n\n // determine visibility of newly created <div>\n if (dt.style.display === 'none' && dd.style.display === 'none') div.style.display = 'none'\n }\n\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', e => {\n clearBtn.style.display = e.target.files.length ? 'flex' : 'none'\n })\n clearBtn.addEventListener('click', () => {\n clearBtn.style.display = 'none'\n })\n }\n\n // #region show password button\n if (type === 'password' && input.getAttribute('data-no-reveal') === null) {\n const showBtn = document.createElement('button')\n showBtn.type = 'button'\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.tabIndex = -1\n showBtn.innerHTML = passwordShow\n showBtn.classList.add('show')\n showBtn.id = `semanticFormsShowButton_${input.id}`\n const dd = input.closest('dd')\n showBtn.addEventListener('click', (event) => {\n if (input.type === 'password') {\n showBtn.innerHTML = passwordHide\n showBtn.title = input.getAttribute('data-hide-password-text') || 'Hide password'\n showBtn.ariaLabel = input.getAttribute('data-hide-password-text') || 'Hide password'\n input.type = 'text'\n } else {\n showBtn.innerHTML = passwordShow\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n input.type = 'password'\n }\n input.focus()\n })\n insertAfter(showBtn, dd.querySelector('label'))\n }\n // #endregion\n\n // add listener to shift clear button when scrollbar present\n for (const textarea of document.querySelectorAll('textarea')) {\n // shifts the close button to the right if a scrollbar is present\n const shiftCloseBtn = () => {\n const clearBtn = textarea.parentElement?.querySelector('button.clear')\n if (clearBtn) {\n clearBtn.style.marginRight = textarea.clientHeight < textarea.scrollHeight ? '15px' : ''\n }\n }\n\n textarea.addEventListener('input', shiftCloseBtn)\n textarea.addEventListener('mouseup', shiftCloseBtn)\n }\n }\n }\n }\n\n /**\n * Places an element immediately after another element\n * @param {Object} newNode element being placed after the reference node\n * @param {*} referenceNode element to be used as reference for new node\n */\n function insertAfter (newNode, referenceNode) {\n if (referenceNode.nextSibling) referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)\n else referenceNode.parentNode.appendChild(newNode)\n }\n\n // handle undo/redo\n let lastFocusedInput\n let lastClearFieldPressed\n document.addEventListener('keydown', (event) => {\n if ((event.ctrlKey || event.metaKey) && event.key === 'z' && !event.shiftKey) {\n // undo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.previousValue) {\n lastFocusedInput.redoValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.previousValue\n }\n }\n }\n } else if ((event.ctrlKey && event.key === 'y') || (event.metaKey && event.shiftKey && event.key === 'z')) {\n // redo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.redoValue) {\n lastFocusedInput.previousValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.redoValue\n }\n }\n }\n }\n })\n\n // monitor changes to the DOM and enhance new semanticForms forms that get added\n if (!window.semanticFormsObserver) {\n window.semanticFormsObserver = new window.MutationObserver((mutations) => {\n let stop = false\n for (const mutation of mutations) {\n for (const node of mutation.addedNodes) {\n if (node.nodeName === 'FORM') {\n window.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 window.semanticForms.reinitialize = (form) => {\n form.classList.remove('semanticFormsActive')\n window.semanticForms()\n }\n}\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__(\"./semanticForms.js\");\n"],"names":["root","factory","exports","module","define","amd","this","document","getElementsByClassName","querySelector","body","classList","window","MutationObserver","passwordShow","passwordHide","nodeNameLookup","inputTypeLookup","forms","querySelectorAll","form","add","contains","inputs","Array","from","input","id","type","getAttribute","includes","nodeName","dl","parentNode","label","replace","dd","firstChild","newLabel","createElement","className","setAttribute","insertAfter","innerHTML","text","append","parentElement","remove","div","closest","hasAttribute","dt","clearBtn","title","ariaLabel","tabIndex","addEventListener","event","previousValue","value","focus","lastClearFieldPressed","target","lastFocusedInput","test","match","style","display","e","files","length","showBtn","textarea","shiftCloseBtn","marginRight","clientHeight","scrollHeight","newNode","referenceNode","nextSibling","insertBefore","appendChild","ctrlKey","metaKey","key","shiftKey","name","redoValue","semanticFormsObserver","mutations","stop","mutation","node","addedNodes","semanticForms","observe","attributes","childList","characterData","subtree","reinitialize","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","__webpack_exports__"],"sourceRoot":""}
|
|
@@ -171,6 +171,13 @@ form.semanticForms select:not([type=range]),
|
|
|
171
171
|
form.semanticForms textarea:not([type=range]) {
|
|
172
172
|
padding: 6px 30px 6px 20px;
|
|
173
173
|
}
|
|
174
|
+
form.semanticForms input:not([type=submit], [type=reset], [type=image], [type=checkbox], [type=radio])[type=password], form.semanticForms input:not([type=submit], [type=reset], [type=image], [type=checkbox], [type=radio])[type=text]:has(~ button.show),
|
|
175
|
+
form.semanticForms select[type=password],
|
|
176
|
+
form.semanticForms select[type=text]:has(~ button.show),
|
|
177
|
+
form.semanticForms textarea[type=password],
|
|
178
|
+
form.semanticForms textarea[type=text]:has(~ button.show) {
|
|
179
|
+
padding: 6px 55px 6px 20px;
|
|
180
|
+
}
|
|
174
181
|
form.semanticForms input:not([type=submit], [type=reset], [type=image], [type=checkbox], [type=radio])[disabled],
|
|
175
182
|
form.semanticForms select[disabled],
|
|
176
183
|
form.semanticForms textarea[disabled] {
|
|
@@ -206,7 +213,7 @@ form.semanticForms input[type=checkbox],
|
|
|
206
213
|
form.semanticForms input[type=radio] {
|
|
207
214
|
width: 1.4em;
|
|
208
215
|
height: 1.4em;
|
|
209
|
-
margin:
|
|
216
|
+
margin: 3px 0;
|
|
210
217
|
cursor: pointer;
|
|
211
218
|
}
|
|
212
219
|
form.semanticForms input[type=checkbox] ~ label:first-of-type,
|
|
@@ -233,7 +240,7 @@ form.semanticForms textarea {
|
|
|
233
240
|
min-height: 38px;
|
|
234
241
|
height: 100px;
|
|
235
242
|
}
|
|
236
|
-
form.semanticForms button.clear {
|
|
243
|
+
form.semanticForms button.clear, form.semanticForms button.show {
|
|
237
244
|
cursor: pointer;
|
|
238
245
|
appearance: none;
|
|
239
246
|
-webkit-appearance: none;
|
|
@@ -252,17 +259,21 @@ form.semanticForms button.clear {
|
|
|
252
259
|
align-items: center;
|
|
253
260
|
justify-content: center;
|
|
254
261
|
}
|
|
262
|
+
form.semanticForms button.show {
|
|
263
|
+
right: 25px;
|
|
264
|
+
}
|
|
255
265
|
form.semanticForms textarea ~ .clear {
|
|
256
266
|
bottom: auto;
|
|
257
267
|
}
|
|
258
268
|
form.semanticForms input:placeholder-shown ~ .clear,
|
|
269
|
+
form.semanticForms input:placeholder-shown ~ .show,
|
|
259
270
|
form.semanticForms textarea:placeholder-shown ~ .clear,
|
|
260
271
|
form.semanticForms input[type=file] ~ .clear {
|
|
261
272
|
display: none;
|
|
262
273
|
}
|
|
263
274
|
form.semanticForms input[type=submit],
|
|
264
275
|
form.semanticForms input[type=reset],
|
|
265
|
-
form.semanticForms button:not(.clear) {
|
|
276
|
+
form.semanticForms button:not(.clear):not(.show) {
|
|
266
277
|
appearance: none;
|
|
267
278
|
-moz-appearance: none;
|
|
268
279
|
-webkit-appearance: none;
|
|
@@ -278,20 +289,20 @@ form.semanticForms button:not(.clear) {
|
|
|
278
289
|
form.semanticForms input[type=submit]:active, form.semanticForms input[type=submit]:focus,
|
|
279
290
|
form.semanticForms input[type=reset]:active,
|
|
280
291
|
form.semanticForms input[type=reset]:focus,
|
|
281
|
-
form.semanticForms button:not(.clear):active,
|
|
282
|
-
form.semanticForms button:not(.clear):focus {
|
|
292
|
+
form.semanticForms button:not(.clear):not(.show):active,
|
|
293
|
+
form.semanticForms button:not(.clear):not(.show):focus {
|
|
283
294
|
background-image: linear-gradient(to bottom, var(--buttonGradientDark) 0%, var(--buttonGradientLight) 100%);
|
|
284
295
|
}
|
|
285
296
|
form.semanticForms input[type=submit],
|
|
286
297
|
form.semanticForms input[type=reset],
|
|
287
298
|
form.semanticForms input[type=image],
|
|
288
|
-
form.semanticForms button:not(.clear) {
|
|
299
|
+
form.semanticForms button:not(.clear):not(.show) {
|
|
289
300
|
transition: filter 0.1s;
|
|
290
301
|
}
|
|
291
302
|
form.semanticForms input[type=submit]:hover,
|
|
292
303
|
form.semanticForms input[type=reset]:hover,
|
|
293
304
|
form.semanticForms input[type=image]:hover,
|
|
294
|
-
form.semanticForms button:not(.clear):hover {
|
|
305
|
+
form.semanticForms button:not(.clear):not(.show):hover {
|
|
295
306
|
filter: brightness(1.05);
|
|
296
307
|
}
|
|
297
308
|
form.semanticForms input[type=checkbox] + label:first-of-type,
|
|
@@ -741,4 +752,4 @@ form.semanticForms.lowFlow .radios ul {
|
|
|
741
752
|
}
|
|
742
753
|
}
|
|
743
754
|
|
|
744
|
-
/*# sourceMappingURL=
|
|
755
|
+
/*# sourceMappingURL=semantic-forms.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../semanticForms.scss"],"names":[],"mappings":"AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAKJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAYE;EACA;EACA;EACA;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGA;EACE;EACA;;AAGA;AAAA;AAAA;EAGE;;AAKN;EACE;EACA;EACA;EACA;;AAEA;EACE;;AAEA;EACE;EACA;;AAGA;EACE;EACA;;AAGF;EACE;EACA;;AAEA;EACE;;AAKN;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAQN;EACE;EACA;EACA;;AAIF;EACE;EACA;EACA;EACA;;AAIJ;AAAA;EAEE;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAKF;AAAA;AAAA;EAGE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;EACE;EACA;;AAEA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;EACE;;AAUJ;AAAA;AAAA;EACE;EACA;;AAIJ;AAAA;EAEE;;AAIF;EACE;EACA;EACA;;AAGF;AAAA;EAGE;EACA;EACA;EACA;;AAEA;AAAA;EACE;;AAIJ;EACE;EACA;;AAGF;EACE;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;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E;;AAIF;EAEE;;AAIJ;EAEE;;AAEA;EAEE;;AAGF;EAEE;;AAIJ;EAEE;;AAEA;EAEE;;AAOJ;EACE;EACA;;AAMA;AAAA;AAAA;AAAA;AAAA;EAEE;;AAEA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EACE;EACA;;AAQN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAYE;EACA;EACA;EACA;;AAIF;EACE;IACE;;EAEA;IACE;IACA;IACA;IACA;IACA;IACA;;;AAOJ;EACE;EACA;EACA;;AAGA;EAEE;;AAIF;EAEE;;AAME;EACE;EACA;;AAMN;EACE;;AAIE;EACE;;AAKJ;AAAA;AAAA;EAGE;;AAIF;EACE;EACA;EACA;;AAKN;AAAA;EAEE;;AAOJ;EACE;IAEE;;EAEA;IAEE;;EAGF;IAEE;;EAGF;IAEE;;EAGF;IAEE;;EAGF;IAEE;;EAGF;IAEE;;;AAKN;EACE;IAEE;;EAEA;IAEE;;EAGF;IAEE;;EAGF;IAEE;;EAGF;IAEE;;EAGF;IAEE;;;AAKN;EACE;AAAA;IAEE;;EAGF;IACE;;EAGF;IAIE;;EAEA;IAEE;;EAGF;IAEE;;EAGF;IAEE;;EAGF;IAEE;;;AAKN;EACE;AAAA;AAAA;AAAA;IAIE;;EAGF;IACE;;EAGF;IAME;;EAEA;IAEE;;EAGF;IAEE;;EAGF;IAEE;;;AAKN;EACE;AAAA;AAAA;AAAA;AAAA;AAAA;IAME;;EAGF;AAAA;AAAA;IAGE;;EAGF;IAQE;;EAEA;IAEE;;EAGF;IAEE;;;AAKN;EACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;IASE;;EAGF;IACE;;EAGF;IAUE;;EAEA;IAEE","file":"semantic-forms.css"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
(function(root,factory){if(typeof exports==="object"&&typeof module==="object")module.exports=factory();else if(typeof define==="function"&&define.amd)define("semanticForms",[],factory);else if(typeof exports==="object")exports["semanticForms"]=factory();else root["semanticForms"]=factory()})(this,(()=>/******/(()=>{// webpackBootstrap
|
|
2
|
+
/******/var __webpack_modules__={
|
|
3
|
+
/***/806:
|
|
4
|
+
/***/module=>{function cov_buxls47iu(){var path="/Users/kethinov/Projects/git/GitHub/semantic-forms/semanticForms.js";var hash="2c190106fdebf5bf491e789ca3ce32f65c35c3eb";var global=new Function("return this")();var gcv="__coverage__";var coverageData={path:"/Users/kethinov/Projects/git/GitHub/semantic-forms/semanticForms.js",statementMap:{0:{start:{line:1,column:0},end:{line:253,column:1}},1:{start:{line:3,column:2},end:{line:3,column:171}},2:{start:{line:3,column:165},end:{line:3,column:171}},3:{start:{line:5,column:23},end:{line:5,column:324}},4:{start:{line:6,column:23},end:{line:6,column:572}},5:{start:{line:8,column:25},end:{line:8,column:47}},6:{start:{line:9,column:26},end:{line:9,column:196}},7:{start:{line:12,column:16},end:{line:12,column:89}},8:{start:{line:14,column:2},end:{line:193,column:3}},9:{start:{line:15,column:4},end:{line:15,column:45}},10:{start:{line:16,column:4},end:{line:16,column:52}},11:{start:{line:16,column:44},end:{line:16,column:52}},12:{start:{line:19,column:19},end:{line:19,column:79}},13:{start:{line:20,column:4},end:{line:192,column:5}},14:{start:{line:22,column:6},end:{line:22,column:73}},15:{start:{line:22,column:65},end:{line:22,column:73}},16:{start:{line:24,column:19},end:{line:24,column:45}},17:{start:{line:25,column:6},end:{line:191,column:7}},18:{start:{line:27,column:17},end:{line:27,column:33}},19:{start:{line:28,column:8},end:{line:28,column:61}},20:{start:{line:28,column:43},end:{line:28,column:61}},21:{start:{line:30,column:8},end:{line:30,column:25}},22:{start:{line:30,column:17},end:{line:30,column:25}},23:{start:{line:31,column:8},end:{line:31,column:88}},24:{start:{line:31,column:54},end:{line:31,column:88}},25:{start:{line:33,column:22},end:{line:35,column:87}},26:{start:{line:37,column:8},end:{line:37,column:43}},27:{start:{line:40,column:8},end:{line:88,column:9}},28:{start:{line:42,column:19},end:{line:42,column:35}},29:{start:{line:43,column:10},end:{line:43,column:63}},30:{start:{line:43,column:45},end:{line:43,column:63}},31:{start:{line:45,column:10},end:{line:65,column:11}},32:{start:{line:46,column:29},end:{line:46,column:60}},33:{start:{line:47,column:12},end:{line:47,column:62}},34:{start:{line:49,column:12},end:{line:55,column:13}},35:{start:{line:50,column:14},end:{line:50,column:52}},36:{start:{line:51,column:14},end:{line:51,column:62}},37:{start:{line:52,column:14},end:{line:52,column:37}},38:{start:{line:53,column:14},end:{line:53,column:52}},39:{start:{line:54,column:14},end:{line:54,column:42}},40:{start:{line:57,column:12},end:{line:57,column:48}},41:{start:{line:59,column:12},end:{line:62,column:13}},42:{start:{line:60,column:27},end:{line:60,column:96}},43:{start:{line:61,column:14},end:{line:61,column:65}},44:{start:{line:64,column:12},end:{line:64,column:63}},45:{start:{line:64,column:44},end:{line:64,column:63}},46:{start:{line:68,column:10},end:{line:68,column:76}},47:{start:{line:68,column:51},end:{line:68,column:76}},48:{start:{line:70,column:22},end:{line:70,column:51}},49:{start:{line:71,column:10},end:{line:71,column:45}},50:{start:{line:72,column:10},end:{line:72,column:24}},51:{start:{line:74,column:27},end:{line:74,column:58}},52:{start:{line:75,column:10},end:{line:75,column:48}},53:{start:{line:76,column:10},end:{line:76,column:60}},54:{start:{line:78,column:10},end:{line:78,column:46}},55:{start:{line:80,column:10},end:{line:83,column:11}},56:{start:{line:81,column:25},end:{line:81,column:94}},57:{start:{line:82,column:12},end:{line:82,column:67}},58:{start:{line:85,column:10},end:{line:85,column:48}},59:{start:{line:87,column:10},end:{line:87,column:38}},60:{start:{line:92,column:8},end:{line:136,column:9}},61:{start:{line:93,column:10},end:{line:95,column:11}},62:{start:{line:94,column:12},end:{line:94,column:50}},63:{start:{line:97,column:22},end:{line:97,column:51}},64:{start:{line:98,column:21},end:{line:98,column:40}},65:{start:{line:99,column:21},end:{line:99,column:40}},66:{start:{line:102,column:10},end:{line:118,column:11}},67:{start:{line:103,column:29},end:{line:103,column:61}},68:{start:{line:104,column:12},end:{line:104,column:36}},69:{start:{line:105,column:12},end:{line:105,column:89}},70:{start:{line:106,column:12},end:{line:106,column:93}},71:{start:{line:107,column:12},end:{line:107,column:34}},72:{start:{line:108,column:12},end:{line:108,column:174}},73:{start:{line:109,column:12},end:{line:109,column:43}},74:{start:{line:110,column:12},end:{line:110,column:64}},75:{start:{line:111,column:12},end:{line:116,column:14}},76:{start:{line:112,column:14},end:{line:112,column:47}},77:{start:{line:113,column:14},end:{line:113,column:30}},78:{start:{line:114,column:14},end:{line:114,column:27}},79:{start:{line:115,column:14},end:{line:115,column:46}},80:{start:{line:117,column:12},end:{line:117,column:60}},81:{start:{line:119,column:10},end:{line:121,column:12}},82:{start:{line:120,column:12},end:{line:120,column:82}},83:{start:{line:120,column:51},end:{line:120,column:82}},84:{start:{line:125,column:10},end:{line:129,column:11}},85:{start:{line:126,column:26},end:{line:126,column:71}},86:{start:{line:127,column:12},end:{line:127,column:38}},87:{start:{line:128,column:12},end:{line:128,column:36}},88:{start:{line:131,column:10},end:{line:131,column:28}},89:{start:{line:132,column:10},end:{line:132,column:24}},90:{start:{line:135,column:10},end:{line:135,column:100}},91:{start:{line:135,column:74},end:{line:135,column:100}},92:{start:{line:139,column:8},end:{line:147,column:9}},93:{start:{line:140,column:27},end:{line:140,column:70}},94:{start:{line:141,column:10},end:{line:143,column:12}},95:{start:{line:142,column:12},end:{line:142,column:76}},96:{start:{line:144,column:10},end:{line:146,column:12}},97:{start:{line:145,column:12},end:{line:145,column:43}},98:{start:{line:150,column:8},end:{line:175,column:9}},99:{start:{line:151,column:26},end:{line:151,column:58}},100:{start:{line:152,column:10},end:{line:152,column:33}},101:{start:{line:153,column:10},end:{line:153,column:90}},102:{start:{line:154,column:10},end:{line:154,column:94}},103:{start:{line:155,column:10},end:{line:155,column:31}},104:{start:{line:156,column:10},end:{line:156,column:42}},105:{start:{line:157,column:10},end:{line:157,column:39}},106:{start:{line:158,column:10},end:{line:158,column:60}},107:{start:{line:159,column:21},end:{line:159,column:40}},108:{start:{line:160,column:10},end:{line:173,column:12}},109:{start:{line:161,column:12},end:{line:171,column:13}},110:{start:{line:162,column:14},end:{line:162,column:46}},111:{start:{line:163,column:14},end:{line:163,column:94}},112:{start:{line:164,column:14},end:{line:164,column:98}},113:{start:{line:165,column:14},end:{line:165,column:33}},114:{start:{line:167,column:14},end:{line:167,column:46}},115:{start:{line:168,column:14},end:{line:168,column:94}},116:{start:{line:169,column:14},end:{line:169,column:98}},117:{start:{line:170,column:14},end:{line:170,column:37}},118:{start:{line:172,column:12},end:{line:172,column:25}},119:{start:{line:174,column:10},end:{line:174,column:57}},120:{start:{line:179,column:8},end:{line:190,column:9}},121:{start:{line:181,column:32},end:{line:186,column:11}},122:{start:{line:182,column:29},end:{line:182,column:82}},123:{start:{line:183,column:12},end:{line:185,column:13}},124:{start:{line:184,column:14},end:{line:184,column:102}},125:{start:{line:188,column:10},end:{line:188,column:59}},126:{start:{line:189,column:10},end:{line:189,column:61}},127:{start:{line:201,column:4},end:{line:202,column:54}},128:{start:{line:201,column:35},end:{line:201,column:108}},129:{start:{line:202,column:9},end:{line:202,column:54}},130:{start:{line:208,column:2},end:{line:230,column:4}},131:{start:{line:209,column:4},end:{line:229,column:5}},132:{start:{line:211,column:6},end:{line:218,column:7}},133:{start:{line:212,column:8},end:{line:217,column:9}},134:{start:{line:213,column:10},end:{line:216,column:11}},135:{start:{line:214,column:12},end:{line:214,column:63}},136:{start:{line:215,column:12},end:{line:215,column:67}},137:{start:{line:219,column:11},end:{line:229,column:5}},138:{start:{line:221,column:6},end:{line:228,column:7}},139:{start:{line:222,column:8},end:{line:227,column:9}},140:{start:{line:223,column:10},end:{line:226,column:11}},141:{start:{line:224,column:12},end:{line:224,column:67}},142:{start:{line:225,column:12},end:{line:225,column:63}},143:{start:{line:233,column:2},end:{line:247,column:3}},144:{start:{line:234,column:4},end:{line:245,column:6}},145:{start:{line:235,column:17},end:{line:235,column:22}},146:{start:{line:236,column:6},end:{line:244,column:7}},147:{start:{line:237,column:8},end:{line:242,column:9}},148:{start:{line:238,column:10},end:{line:241,column:11}},149:{start:{line:239,column:12},end:{line:239,column:34}},150:{start:{line:240,column:12},end:{line:240,column:23}},151:{start:{line:243,column:8},end:{line:243,column:23}},152:{start:{line:243,column:18},end:{line:243,column:23}},153:{start:{line:246,column:4},end:{line:246,column:132}},154:{start:{line:249,column:2},end:{line:252,column:3}},155:{start:{line:250,column:4},end:{line:250,column:48}},156:{start:{line:251,column:4},end:{line:251,column:26}}},fnMap:{0:{name:"(anonymous_0)",decl:{start:{line:1,column:17},end:{line:1,column:18}},loc:{start:{line:1,column:23},end:{line:253,column:1}},line:1},1:{name:"(anonymous_1)",decl:{start:{line:111,column:47},end:{line:111,column:48}},loc:{start:{line:111,column:58},end:{line:116,column:13}},line:111},2:{name:"(anonymous_2)",decl:{start:{line:119,column:42},end:{line:119,column:43}},loc:{start:{line:119,column:53},end:{line:121,column:11}},line:119},3:{name:"(anonymous_3)",decl:{start:{line:141,column:42},end:{line:141,column:43}},loc:{start:{line:141,column:47},end:{line:143,column:11}},line:141},4:{name:"(anonymous_4)",decl:{start:{line:144,column:45},end:{line:144,column:46}},loc:{start:{line:144,column:51},end:{line:146,column:11}},line:144},5:{name:"(anonymous_5)",decl:{start:{line:160,column:44},end:{line:160,column:45}},loc:{start:{line:160,column:55},end:{line:173,column:11}},line:160},6:{name:"(anonymous_6)",decl:{start:{line:181,column:32},end:{line:181,column:33}},loc:{start:{line:181,column:38},end:{line:186,column:11}},line:181},7:{name:"insertAfter",decl:{start:{line:200,column:11},end:{line:200,column:22}},loc:{start:{line:200,column:48},end:{line:203,column:3}},line:200},8:{name:"(anonymous_8)",decl:{start:{line:208,column:39},end:{line:208,column:40}},loc:{start:{line:208,column:50},end:{line:230,column:3}},line:208},9:{name:"(anonymous_9)",decl:{start:{line:234,column:63},end:{line:234,column:64}},loc:{start:{line:234,column:78},end:{line:245,column:5}},line:234},10:{name:"(anonymous_10)",decl:{start:{line:249,column:38},end:{line:249,column:39}},loc:{start:{line:249,column:48},end:{line:252,column:3}},line:249}},branchMap:{0:{loc:{start:{line:3,column:2},end:{line:3,column:171}},type:"if",locations:[{start:{line:3,column:2},end:{line:3,column:171}},{start:{line:3,column:2},end:{line:3,column:171}}],line:3},1:{loc:{start:{line:3,column:6},end:{line:3,column:163}},type:"binary-expr",locations:[{start:{line:3,column:6},end:{line:3,column:59}},{start:{line:3,column:63},end:{line:3,column:107}},{start:{line:3,column:111},end:{line:3,column:135}},{start:{line:3,column:139},end:{line:3,column:163}}],line:3},2:{loc:{start:{line:16,column:4},end:{line:16,column:52}},type:"if",locations:[{start:{line:16,column:4},end:{line:16,column:52}},{start:{line:16,column:4},end:{line:16,column:52}}],line:16},3:{loc:{start:{line:22,column:6},end:{line:22,column:73}},type:"if",locations:[{start:{line:22,column:6},end:{line:22,column:73}},{start:{line:22,column:6},end:{line:22,column:73}}],line:22},4:{loc:{start:{line:22,column:10},end:{line:22,column:63}},type:"binary-expr",locations:[{start:{line:22,column:10},end:{line:22,column:50}},{start:{line:22,column:54},end:{line:22,column:63}}],line:22},5:{loc:{start:{line:25,column:6},end:{line:191,column:7}},type:"if",locations:[{start:{line:25,column:6},end:{line:191,column:7}},{start:{line:25,column:6},end:{line:191,column:7}}],line:25},6:{loc:{start:{line:25,column:10},end:{line:25,column:83}},type:"binary-expr",locations:[{start:{line:25,column:10},end:{line:25,column:49}},{start:{line:25,column:53},end:{line:25,column:83}}],line:25},7:{loc:{start:{line:28,column:15},end:{line:28,column:41}},type:"binary-expr",locations:[{start:{line:28,column:15},end:{line:28,column:17}},{start:{line:28,column:21},end:{line:28,column:41}}],line:28},8:{loc:{start:{line:30,column:8},end:{line:30,column:25}},type:"if",locations:[{start:{line:30,column:8},end:{line:30,column:25}},{start:{line:30,column:8},end:{line:30,column:25}}],line:30},9:{loc:{start:{line:31,column:8},end:{line:31,column:88}},type:"if",locations:[{start:{line:31,column:8},end:{line:31,column:88}},{start:{line:31,column:8},end:{line:31,column:88}}],line:31},10:{loc:{start:{line:33,column:22},end:{line:35,column:87}},type:"cond-expr",locations:[{start:{line:34,column:12},end:{line:34,column:114}},{start:{line:35,column:12},end:{line:35,column:87}}],line:33},11:{loc:{start:{line:33,column:22},end:{line:33,column:97}},type:"binary-expr",locations:[{start:{line:33,column:22},end:{line:33,column:52}},{start:{line:33,column:57},end:{line:33,column:76}},{start:{line:33,column:80},end:{line:33,column:96}}],line:33},12:{loc:{start:{line:40,column:8},end:{line:88,column:9}},type:"if",locations:[{start:{line:40,column:8},end:{line:88,column:9}},{start:{line:40,column:8},end:{line:88,column:9}}],line:40},13:{loc:{start:{line:40,column:12},end:{line:40,column:51}},type:"binary-expr",locations:[{start:{line:40,column:12},end:{line:40,column:31}},{start:{line:40,column:35},end:{line:40,column:51}}],line:40},14:{loc:{start:{line:43,column:17},end:{line:43,column:43}},type:"binary-expr",locations:[{start:{line:43,column:17},end:{line:43,column:19}},{start:{line:43,column:23},end:{line:43,column:43}}],line:43},15:{loc:{start:{line:45,column:10},end:{line:65,column:11}},type:"if",locations:[{start:{line:45,column:10},end:{line:65,column:11}},{start:{line:45,column:10},end:{line:65,column:11}}],line:45},16:{loc:{start:{line:49,column:12},end:{line:55,column:13}},type:"if",locations:[{start:{line:49,column:12},end:{line:55,column:13}},{start:{line:49,column:12},end:{line:55,column:13}}],line:49},17:{loc:{start:{line:49,column:16},end:{line:49,column:73}},type:"binary-expr",locations:[{start:{line:49,column:16},end:{line:49,column:35}},{start:{line:49,column:39},end:{line:49,column:73}}],line:49},18:{loc:{start:{line:59,column:12},end:{line:62,column:13}},type:"if",locations:[{start:{line:59,column:12},end:{line:62,column:13}},{start:{line:59,column:12},end:{line:62,column:13}}],line:59},19:{loc:{start:{line:59,column:16},end:{line:59,column:128}},type:"binary-expr",locations:[{start:{line:59,column:16},end:{line:59,column:45}},{start:{line:59,column:49},end:{line:59,column:96}},{start:{line:59,column:100},end:{line:59,column:128}}],line:59},20:{loc:{start:{line:60,column:27},end:{line:60,column:96}},type:"binary-expr",locations:[{start:{line:60,column:27},end:{line:60,column:67}},{start:{line:60,column:71},end:{line:60,column:96}}],line:60},21:{loc:{start:{line:64,column:12},end:{line:64,column:63}},type:"if",locations:[{start:{line:64,column:12},end:{line:64,column:63}},{start:{line:64,column:12},end:{line:64,column:63}}],line:64},22:{loc:{start:{line:68,column:10},end:{line:68,column:76}},type:"if",locations:[{start:{line:68,column:10},end:{line:68,column:76}},{start:{line:68,column:10},end:{line:68,column:76}}],line:68},23:{loc:{start:{line:80,column:10},end:{line:83,column:11}},type:"if",locations:[{start:{line:80,column:10},end:{line:83,column:11}},{start:{line:80,column:10},end:{line:83,column:11}}],line:80},24:{loc:{start:{line:80,column:14},end:{line:80,column:127}},type:"binary-expr",locations:[{start:{line:80,column:14},end:{line:80,column:44}},{start:{line:80,column:48},end:{line:80,column:95}},{start:{line:80,column:99},end:{line:80,column:127}}],line:80},25:{loc:{start:{line:81,column:25},end:{line:81,column:94}},type:"binary-expr",locations:[{start:{line:81,column:25},end:{line:81,column:65}},{start:{line:81,column:69},end:{line:81,column:94}}],line:81},26:{loc:{start:{line:92,column:8},end:{line:136,column:9}},type:"if",locations:[{start:{line:92,column:8},end:{line:136,column:9}},{start:{line:92,column:8},end:{line:136,column:9}}],line:92},27:{loc:{start:{line:92,column:12},end:{line:92,column:51}},type:"binary-expr",locations:[{start:{line:92,column:12},end:{line:92,column:31}},{start:{line:92,column:35},end:{line:92,column:51}}],line:92},28:{loc:{start:{line:93,column:10},end:{line:95,column:11}},type:"if",locations:[{start:{line:93,column:10},end:{line:95,column:11}},{start:{line:93,column:10},end:{line:95,column:11}}],line:93},29:{loc:{start:{line:102,column:10},end:{line:118,column:11}},type:"if",locations:[{start:{line:102,column:10},end:{line:118,column:11}},{start:{line:102,column:10},end:{line:118,column:11}}],line:102},30:{loc:{start:{line:102,column:14},end:{line:102,column:61}},type:"binary-expr",locations:[{start:{line:102,column:14},end:{line:102,column:41}},{start:{line:102,column:45},end:{line:102,column:61}}],line:102},31:{loc:{start:{line:105,column:29},end:{line:105,column:89}},type:"binary-expr",locations:[{start:{line:105,column:29},end:{line:105,column:72}},{start:{line:105,column:76},end:{line:105,column:89}}],line:105},32:{loc:{start:{line:106,column:33},end:{line:106,column:93}},type:"binary-expr",locations:[{start:{line:106,column:33},end:{line:106,column:76}},{start:{line:106,column:80},end:{line:106,column:93}}],line:106},33:{loc:{start:{line:120,column:12},end:{line:120,column:82}},type:"if",locations:[{start:{line:120,column:12},end:{line:120,column:82}},{start:{line:120,column:12},end:{line:120,column:82}}],line:120},34:{loc:{start:{line:125,column:10},end:{line:129,column:11}},type:"if",locations:[{start:{line:125,column:10},end:{line:129,column:11}},{start:{line:125,column:10},end:{line:129,column:11}}],line:125},35:{loc:{start:{line:135,column:10},end:{line:135,column:100}},type:"if",locations:[{start:{line:135,column:10},end:{line:135,column:100}},{start:{line:135,column:10},end:{line:135,column:100}}],line:135},36:{loc:{start:{line:135,column:14},end:{line:135,column:72}},type:"binary-expr",locations:[{start:{line:135,column:14},end:{line:135,column:41}},{start:{line:135,column:45},end:{line:135,column:72}}],line:135},37:{loc:{start:{line:139,column:8},end:{line:147,column:9}},type:"if",locations:[{start:{line:139,column:8},end:{line:147,column:9}},{start:{line:139,column:8},end:{line:147,column:9}}],line:139},38:{loc:{start:{line:142,column:37},end:{line:142,column:76}},type:"cond-expr",locations:[{start:{line:142,column:61},end:{line:142,column:67}},{start:{line:142,column:70},end:{line:142,column:76}}],line:142},39:{loc:{start:{line:150,column:8},end:{line:175,column:9}},type:"if",locations:[{start:{line:150,column:8},end:{line:175,column:9}},{start:{line:150,column:8},end:{line:175,column:9}}],line:150},40:{loc:{start:{line:150,column:12},end:{line:150,column:80}},type:"binary-expr",locations:[{start:{line:150,column:12},end:{line:150,column:31}},{start:{line:150,column:35},end:{line:150,column:80}}],line:150},41:{loc:{start:{line:153,column:26},end:{line:153,column:90}},type:"binary-expr",locations:[{start:{line:153,column:26},end:{line:153,column:71}},{start:{line:153,column:75},end:{line:153,column:90}}],line:153},42:{loc:{start:{line:154,column:30},end:{line:154,column:94}},type:"binary-expr",locations:[{start:{line:154,column:30},end:{line:154,column:75}},{start:{line:154,column:79},end:{line:154,column:94}}],line:154},43:{loc:{start:{line:161,column:12},end:{line:171,column:13}},type:"if",locations:[{start:{line:161,column:12},end:{line:171,column:13}},{start:{line:161,column:12},end:{line:171,column:13}}],line:161},44:{loc:{start:{line:163,column:30},end:{line:163,column:94}},type:"binary-expr",locations:[{start:{line:163,column:30},end:{line:163,column:75}},{start:{line:163,column:79},end:{line:163,column:94}}],line:163},45:{loc:{start:{line:164,column:34},end:{line:164,column:98}},type:"binary-expr",locations:[{start:{line:164,column:34},end:{line:164,column:79}},{start:{line:164,column:83},end:{line:164,column:98}}],line:164},46:{loc:{start:{line:168,column:30},end:{line:168,column:94}},type:"binary-expr",locations:[{start:{line:168,column:30},end:{line:168,column:75}},{start:{line:168,column:79},end:{line:168,column:94}}],line:168},47:{loc:{start:{line:169,column:34},end:{line:169,column:98}},type:"binary-expr",locations:[{start:{line:169,column:34},end:{line:169,column:79}},{start:{line:169,column:83},end:{line:169,column:98}}],line:169},48:{loc:{start:{line:183,column:12},end:{line:185,column:13}},type:"if",locations:[{start:{line:183,column:12},end:{line:185,column:13}},{start:{line:183,column:12},end:{line:185,column:13}}],line:183},49:{loc:{start:{line:184,column:43},end:{line:184,column:102}},type:"cond-expr",locations:[{start:{line:184,column:91},end:{line:184,column:97}},{start:{line:184,column:100},end:{line:184,column:102}}],line:184},50:{loc:{start:{line:201,column:4},end:{line:202,column:54}},type:"if",locations:[{start:{line:201,column:4},end:{line:202,column:54}},{start:{line:201,column:4},end:{line:202,column:54}}],line:201},51:{loc:{start:{line:209,column:4},end:{line:229,column:5}},type:"if",locations:[{start:{line:209,column:4},end:{line:229,column:5}},{start:{line:209,column:4},end:{line:229,column:5}}],line:209},52:{loc:{start:{line:209,column:8},end:{line:209,column:80}},type:"binary-expr",locations:[{start:{line:209,column:9},end:{line:209,column:22}},{start:{line:209,column:26},end:{line:209,column:39}},{start:{line:209,column:44},end:{line:209,column:61}},{start:{line:209,column:65},end:{line:209,column:80}}],line:209},53:{loc:{start:{line:211,column:6},end:{line:218,column:7}},type:"if",locations:[{start:{line:211,column:6},end:{line:218,column:7}},{start:{line:211,column:6},end:{line:218,column:7}}],line:211},54:{loc:{start:{line:212,column:8},end:{line:217,column:9}},type:"if",locations:[{start:{line:212,column:8},end:{line:217,column:9}},{start:{line:212,column:8},end:{line:217,column:9}}],line:212},55:{loc:{start:{line:212,column:12},end:{line:212,column:254}},type:"binary-expr",locations:[{start:{line:212,column:12},end:{line:212,column:130}},{start:{line:212,column:134},end:{line:212,column:254}}],line:212},56:{loc:{start:{line:213,column:10},end:{line:216,column:11}},type:"if",locations:[{start:{line:213,column:10},end:{line:216,column:11}},{start:{line:213,column:10},end:{line:216,column:11}}],line:213},57:{loc:{start:{line:219,column:11},end:{line:229,column:5}},type:"if",locations:[{start:{line:219,column:11},end:{line:229,column:5}},{start:{line:219,column:11},end:{line:229,column:5}}],line:219},58:{loc:{start:{line:219,column:15},end:{line:219,column:109}},type:"binary-expr",locations:[{start:{line:219,column:16},end:{line:219,column:29}},{start:{line:219,column:33},end:{line:219,column:50}},{start:{line:219,column:56},end:{line:219,column:69}},{start:{line:219,column:73},end:{line:219,column:87}},{start:{line:219,column:91},end:{line:219,column:108}}],line:219},59:{loc:{start:{line:221,column:6},end:{line:228,column:7}},type:"if",locations:[{start:{line:221,column:6},end:{line:228,column:7}},{start:{line:221,column:6},end:{line:228,column:7}}],line:221},60:{loc:{start:{line:222,column:8},end:{line:227,column:9}},type:"if",locations:[{start:{line:222,column:8},end:{line:227,column:9}},{start:{line:222,column:8},end:{line:227,column:9}}],line:222},61:{loc:{start:{line:222,column:12},end:{line:222,column:254}},type:"binary-expr",locations:[{start:{line:222,column:12},end:{line:222,column:130}},{start:{line:222,column:134},end:{line:222,column:254}}],line:222},62:{loc:{start:{line:223,column:10},end:{line:226,column:11}},type:"if",locations:[{start:{line:223,column:10},end:{line:226,column:11}},{start:{line:223,column:10},end:{line:226,column:11}}],line:223},63:{loc:{start:{line:233,column:2},end:{line:247,column:3}},type:"if",locations:[{start:{line:233,column:2},end:{line:247,column:3}},{start:{line:233,column:2},end:{line:247,column:3}}],line:233},64:{loc:{start:{line:238,column:10},end:{line:241,column:11}},type:"if",locations:[{start:{line:238,column:10},end:{line:241,column:11}},{start:{line:238,column:10},end:{line:241,column:11}}],line:238},65:{loc:{start:{line:243,column:8},end:{line:243,column:23}},type:"if",locations:[{start:{line:243,column:8},end:{line:243,column:23}},{start:{line:243,column:8},end:{line:243,column:23}}],line:243}},s:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:0,16:0,17:0,18:0,19:0,20:0,21:0,22:0,23:0,24:0,25:0,26:0,27:0,28:0,29:0,30:0,31:0,32:0,33:0,34:0,35:0,36:0,37:0,38:0,39:0,40:0,41:0,42:0,43:0,44:0,45:0,46:0,47:0,48:0,49:0,50:0,51:0,52:0,53:0,54:0,55:0,56:0,57:0,58:0,59:0,60:0,61:0,62:0,63:0,64:0,65:0,66:0,67:0,68:0,69:0,70:0,71:0,72:0,73:0,74:0,75:0,76:0,77:0,78:0,79:0,80:0,81:0,82:0,83:0,84:0,85:0,86:0,87:0,88:0,89:0,90:0,91:0,92:0,93:0,94:0,95:0,96:0,97:0,98:0,99:0,100:0,101:0,102:0,103:0,104:0,105:0,106:0,107:0,108:0,109:0,110:0,111:0,112:0,113:0,114:0,115:0,116:0,117:0,118:0,119:0,120:0,121:0,122:0,123:0,124:0,125:0,126:0,127:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:0,136:0,137:0,138:0,139:0,140:0,141:0,142:0,143:0,144:0,145:0,146:0,147:0,148:0,149:0,150:0,151:0,152:0,153:0,154:0,155:0,156:0},f:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0},b:{0:[0,0],1:[0,0,0,0],2:[0,0],3:[0,0],4:[0,0],5:[0,0],6:[0,0],7:[0,0],8:[0,0],9:[0,0],10:[0,0],11:[0,0,0],12:[0,0],13:[0,0],14:[0,0],15:[0,0],16:[0,0],17:[0,0],18:[0,0],19:[0,0,0],20:[0,0],21:[0,0],22:[0,0],23:[0,0],24:[0,0,0],25:[0,0],26:[0,0],27:[0,0],28:[0,0],29:[0,0],30:[0,0],31:[0,0],32:[0,0],33:[0,0],34:[0,0],35:[0,0],36:[0,0],37:[0,0],38:[0,0],39:[0,0],40:[0,0],41:[0,0],42:[0,0],43:[0,0],44:[0,0],45:[0,0],46:[0,0],47:[0,0],48:[0,0],49:[0,0],50:[0,0],51:[0,0],52:[0,0,0,0],53:[0,0],54:[0,0],55:[0,0],56:[0,0],57:[0,0],58:[0,0,0,0,0],59:[0,0],60:[0,0],61:[0,0],62:[0,0],63:[0,0],64:[0,0],65:[0,0]},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"2c190106fdebf5bf491e789ca3ce32f65c35c3eb"};var coverage=global[gcv]||(global[gcv]={});if(!coverage[path]||coverage[path].hash!==hash)coverage[path]=coverageData;var actualCoverage=coverage[path];
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
cov_buxls47iu=function(){return actualCoverage};return actualCoverage}cov_buxls47iu();cov_buxls47iu().s[0]++;module.exports=()=>{cov_buxls47iu().f[0]++;cov_buxls47iu().s[1]++;
|
|
7
|
+
// do some feature detection so none of the JS executes if the browser is too old
|
|
8
|
+
if((cov_buxls47iu().b[1][0]++,typeof document.getElementsByClassName!=="function")||(cov_buxls47iu().b[1][1]++,typeof document.querySelector!=="function")||(cov_buxls47iu().b[1][2]++,!document.body.classList)||(cov_buxls47iu().b[1][3]++,!window.MutationObserver)){cov_buxls47iu().b[0][0]++;cov_buxls47iu().s[2]++;return}else cov_buxls47iu().b[0][1]++;const passwordShow=(cov_buxls47iu().s[3]++,'<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>');const passwordHide=(cov_buxls47iu().s[4]++,'<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>');const nodeNameLookup=(cov_buxls47iu().s[5]++,["TEXTAREA","SELECT"]);const inputTypeLookup=(cov_buxls47iu().s[6]++,["checkbox","color","date","datetime-local","email","file","image","month","number","password","radio","range","search","tel","text","time","url","week"]);
|
|
9
|
+
// progressively enhance form elements that have the semanticForms class
|
|
10
|
+
const forms=(cov_buxls47iu().s[7]++,document.querySelectorAll("form.semanticForms:not(.semanticFormsActive)"));cov_buxls47iu().s[8]++;for(const form of forms){cov_buxls47iu().s[9]++;form.classList.add("semanticFormsActive");cov_buxls47iu().s[10]++;if(form.classList.contains("lowFlow")){cov_buxls47iu().b[2][0]++;cov_buxls47iu().s[11]++;continue}else cov_buxls47iu().b[2][1]++;
|
|
11
|
+
// update each input in the semantic form
|
|
12
|
+
const inputs=(cov_buxls47iu().s[12]++,Array.from(form.querySelectorAll("input, textarea, select")));cov_buxls47iu().s[13]++;for(const input of inputs){cov_buxls47iu().s[14]++;
|
|
13
|
+
// ignore input if it has previously been formatted
|
|
14
|
+
if((cov_buxls47iu().b[4][0]++,input.classList.contains("semanticform"))||(cov_buxls47iu().b[4][1]++,!input.id)){cov_buxls47iu().b[3][0]++;cov_buxls47iu().s[15]++;continue}else cov_buxls47iu().b[3][1]++;const type=(cov_buxls47iu().s[16]++,input.getAttribute("type"));cov_buxls47iu().s[17]++;if((cov_buxls47iu().b[6][0]++,nodeNameLookup.includes(input.nodeName))||(cov_buxls47iu().b[6][1]++,inputTypeLookup.includes(type))){cov_buxls47iu().b[5][0]++;
|
|
15
|
+
// recursively find <dl> element
|
|
16
|
+
let dl=(cov_buxls47iu().s[18]++,input.parentNode);cov_buxls47iu().s[19]++;while((cov_buxls47iu().b[7][0]++,dl)&&(cov_buxls47iu().b[7][1]++,dl.nodeName!=="DL")){cov_buxls47iu().s[20]++;dl=dl.parentNode}cov_buxls47iu().s[21]++;if(!dl){cov_buxls47iu().b[8][0]++;cov_buxls47iu().s[22]++;continue}else cov_buxls47iu().b[8][1]++;cov_buxls47iu().s[23]++;if(!dl.classList.contains("floatLabelForm")){cov_buxls47iu().b[9][0]++;cov_buxls47iu().s[24]++;dl.classList.add("floatLabelForm")}else cov_buxls47iu().b[9][1]++;const label=(cov_buxls47iu().s[25]++,(cov_buxls47iu().b[11][0]++,input.parentNode.parentNode.id)&&((cov_buxls47iu().b[11][1]++,type==="checkbox")||(cov_buxls47iu().b[11][2]++,type==="radio"))?(cov_buxls47iu().b[10][0]++,document.querySelector("label[data-for="+input.parentNode.parentNode.id.replace(/\./g,"\\.")+"]")):(cov_buxls47iu().b[10][1]++,document.querySelector("label[for="+input.id.replace(/\./g,"\\.")+"]")));cov_buxls47iu().s[26]++;input.classList.add("semanticform");
|
|
17
|
+
// #region create labels
|
|
18
|
+
cov_buxls47iu().s[27]++;if((cov_buxls47iu().b[13][0]++,type==="checkbox")||(cov_buxls47iu().b[13][1]++,type==="radio")){cov_buxls47iu().b[12][0]++;
|
|
19
|
+
// recursively find <dd> element
|
|
20
|
+
let dd=(cov_buxls47iu().s[28]++,input.parentNode);cov_buxls47iu().s[29]++;while((cov_buxls47iu().b[14][0]++,dd)&&(cov_buxls47iu().b[14][1]++,dd.nodeName!=="DD")){cov_buxls47iu().s[30]++;dd=dd.parentNode}cov_buxls47iu().s[31]++;if(dd.firstChild.nodeName!=="LABEL"){cov_buxls47iu().b[15][0]++;const newLabel=(cov_buxls47iu().s[32]++,document.createElement("label"));cov_buxls47iu().s[33]++;newLabel.className="floatLabelFormAnimatedLabel";cov_buxls47iu().s[34]++;if((cov_buxls47iu().b[17][0]++,type==="checkbox")&&(cov_buxls47iu().b[17][1]++,input.parentNode.nodeName==="DD")){cov_buxls47iu().b[16][0]++;cov_buxls47iu().s[35]++;newLabel.setAttribute("for",input.id);cov_buxls47iu().s[36]++;input.parentNode.classList.add("singleCheckbox");cov_buxls47iu().s[37]++;newLabel.className="";cov_buxls47iu().s[38]++;label.setAttribute("hidden","hidden");cov_buxls47iu().s[39]++;insertAfter(newLabel,input)}else cov_buxls47iu().b[16][1]++;cov_buxls47iu().s[40]++;newLabel.innerHTML=label.innerHTML;cov_buxls47iu().s[41]++;if((cov_buxls47iu().b[19][0]++,dd.querySelector(":required"))&&(cov_buxls47iu().b[19][1]++,label.getAttribute("data-no-asterisk")===null)&&(cov_buxls47iu().b[19][2]++,!label.querySelector("span"))){cov_buxls47iu().b[18][0]++;const text=(cov_buxls47iu().s[42]++,(cov_buxls47iu().b[20][0]++,label.getAttribute("data-asterisk-text"))||(cov_buxls47iu().b[20][1]++,"This field is required."));cov_buxls47iu().s[43]++;label.innerHTML+=`<span title="${text}">*</span>`}else cov_buxls47iu().b[18][1]++;cov_buxls47iu().s[44]++;if(!dd.querySelector("label")){cov_buxls47iu().b[21][0]++;cov_buxls47iu().s[45]++;dd.append(newLabel)}else cov_buxls47iu().b[21][1]++}else cov_buxls47iu().b[15][1]++;
|
|
21
|
+
// removes old div that a radio or checkbox may have been added to
|
|
22
|
+
cov_buxls47iu().s[46]++;if(dd.parentElement.nodeName==="DIV"){cov_buxls47iu().b[22][0]++;cov_buxls47iu().s[47]++;dd.parentElement.remove()}else cov_buxls47iu().b[22][1]++;const div=(cov_buxls47iu().s[48]++,document.createElement("div"));cov_buxls47iu().s[49]++;div.append(label.closest("dt"),dd);cov_buxls47iu().s[50]++;dl.append(div)}else{cov_buxls47iu().b[12][1]++;const newLabel=(cov_buxls47iu().s[51]++,document.createElement("label"));cov_buxls47iu().s[52]++;newLabel.setAttribute("for",input.id);cov_buxls47iu().s[53]++;newLabel.className="floatLabelFormAnimatedLabel";cov_buxls47iu().s[54]++;newLabel.innerHTML=label.innerHTML;cov_buxls47iu().s[55]++;if((cov_buxls47iu().b[24][0]++,input.hasAttribute("required"))&&(cov_buxls47iu().b[24][1]++,label.getAttribute("data-no-asterisk")===null)&&(cov_buxls47iu().b[24][2]++,!label.querySelector("span"))){cov_buxls47iu().b[23][0]++;const text=(cov_buxls47iu().s[56]++,(cov_buxls47iu().b[25][0]++,label.getAttribute("data-asterisk-text"))||(cov_buxls47iu().b[25][1]++,"This field is required."));cov_buxls47iu().s[57]++;newLabel.innerHTML+=` <span title="${text}">*</span>`}else cov_buxls47iu().b[23][1]++;cov_buxls47iu().s[58]++;label.setAttribute("hidden","hidden");cov_buxls47iu().s[59]++;insertAfter(newLabel,input)}
|
|
23
|
+
// #endregion
|
|
24
|
+
// standard inputs
|
|
25
|
+
cov_buxls47iu().s[60]++;if((cov_buxls47iu().b[27][0]++,type!=="checkbox")&&(cov_buxls47iu().b[27][1]++,type!=="radio")){cov_buxls47iu().b[26][0]++;cov_buxls47iu().s[61]++;if(!input.getAttribute("placeholder")){cov_buxls47iu().b[28][0]++;cov_buxls47iu().s[62]++;input.setAttribute("placeholder"," ")}else cov_buxls47iu().b[28][1]++;const div=(cov_buxls47iu().s[63]++,document.createElement("div"));const dt=(cov_buxls47iu().s[64]++,label.closest("dt"));const dd=(cov_buxls47iu().s[65]++,input.closest("dd"));
|
|
26
|
+
// #region clear button
|
|
27
|
+
cov_buxls47iu().s[66]++;if((cov_buxls47iu().b[30][0]++,input.nodeName!=="SELECT")&&(cov_buxls47iu().b[30][1]++,type!=="range")){cov_buxls47iu().b[29][0]++;const clearBtn=(cov_buxls47iu().s[67]++,document.createElement("button"));cov_buxls47iu().s[68]++;clearBtn.type="button";cov_buxls47iu().s[69]++;clearBtn.title=(cov_buxls47iu().b[31][0]++,input.getAttribute("data-clear-field-text"))||(cov_buxls47iu().b[31][1]++,"Clear field");cov_buxls47iu().s[70]++;clearBtn.ariaLabel=(cov_buxls47iu().b[32][0]++,input.getAttribute("data-clear-field-text"))||(cov_buxls47iu().b[32][1]++,"Clear field");cov_buxls47iu().s[71]++;clearBtn.tabIndex=-1;cov_buxls47iu().s[72]++;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" />';cov_buxls47iu().s[73]++;clearBtn.classList.add("clear");cov_buxls47iu().s[74]++;clearBtn.id=`semanticFormsClearButton_${input.id}`;cov_buxls47iu().s[75]++;clearBtn.addEventListener("click",(event=>{cov_buxls47iu().f[1]++;cov_buxls47iu().s[76]++;input.previousValue=input.value;cov_buxls47iu().s[77]++;input.value="";cov_buxls47iu().s[78]++;input.focus();cov_buxls47iu().s[79]++;lastClearFieldPressed=input.id}));cov_buxls47iu().s[80]++;insertAfter(clearBtn,dd.querySelector("label"))}else cov_buxls47iu().b[29][1]++;cov_buxls47iu().s[81]++;input.addEventListener("focus",(event=>{cov_buxls47iu().f[2]++;cov_buxls47iu().s[82]++;if(event.target.nodeName==="INPUT"){cov_buxls47iu().b[33][0]++;cov_buxls47iu().s[83]++;lastFocusedInput=event.target}else cov_buxls47iu().b[33][1]++}));
|
|
28
|
+
// #endregion
|
|
29
|
+
// check for colspan- utility class
|
|
30
|
+
cov_buxls47iu().s[84]++;if(/colspan-/.test(dd.className)){cov_buxls47iu().b[34][0]++;const match=(cov_buxls47iu().s[85]++,dd.className.match(/colspan-([0-9]|full)/)[0]);cov_buxls47iu().s[86]++;dd.classList.remove(match);cov_buxls47iu().s[87]++;div.classList.add(match)}else cov_buxls47iu().b[34][1]++;cov_buxls47iu().s[88]++;div.append(dt,dd);cov_buxls47iu().s[89]++;dl.append(div);
|
|
31
|
+
// determine visibility of newly created <div>
|
|
32
|
+
cov_buxls47iu().s[90]++;if((cov_buxls47iu().b[36][0]++,dt.style.display==="none")&&(cov_buxls47iu().b[36][1]++,dd.style.display==="none")){cov_buxls47iu().b[35][0]++;cov_buxls47iu().s[91]++;div.style.display="none"}else cov_buxls47iu().b[35][1]++}else cov_buxls47iu().b[26][1]++;
|
|
33
|
+
// handle file input clear btn, cannot be handled with CSS
|
|
34
|
+
cov_buxls47iu().s[92]++;if(type==="file"){cov_buxls47iu().b[37][0]++;const clearBtn=(cov_buxls47iu().s[93]++,input.parentElement.querySelector(".clear"));cov_buxls47iu().s[94]++;input.addEventListener("input",(e=>{cov_buxls47iu().f[3]++;cov_buxls47iu().s[95]++;clearBtn.style.display=e.target.files.length?(cov_buxls47iu().b[38][0]++,"flex"):(cov_buxls47iu().b[38][1]++,"none")}));cov_buxls47iu().s[96]++;clearBtn.addEventListener("click",(()=>{cov_buxls47iu().f[4]++;cov_buxls47iu().s[97]++;clearBtn.style.display="none"}))}else cov_buxls47iu().b[37][1]++;
|
|
35
|
+
// #region show password button
|
|
36
|
+
cov_buxls47iu().s[98]++;if((cov_buxls47iu().b[40][0]++,type==="password")&&(cov_buxls47iu().b[40][1]++,input.getAttribute("data-no-reveal")===null)){cov_buxls47iu().b[39][0]++;const showBtn=(cov_buxls47iu().s[99]++,document.createElement("button"));cov_buxls47iu().s[100]++;showBtn.type="button";cov_buxls47iu().s[101]++;showBtn.title=(cov_buxls47iu().b[41][0]++,input.getAttribute("data-show-password-text"))||(cov_buxls47iu().b[41][1]++,"Show password");cov_buxls47iu().s[102]++;showBtn.ariaLabel=(cov_buxls47iu().b[42][0]++,input.getAttribute("data-show-password-text"))||(cov_buxls47iu().b[42][1]++,"Show password");cov_buxls47iu().s[103]++;showBtn.tabIndex=-1;cov_buxls47iu().s[104]++;showBtn.innerHTML=passwordShow;cov_buxls47iu().s[105]++;showBtn.classList.add("show");cov_buxls47iu().s[106]++;showBtn.id=`semanticFormsShowButton_${input.id}`;const dd=(cov_buxls47iu().s[107]++,input.closest("dd"));cov_buxls47iu().s[108]++;showBtn.addEventListener("click",(event=>{cov_buxls47iu().f[5]++;cov_buxls47iu().s[109]++;if(input.type==="password"){cov_buxls47iu().b[43][0]++;cov_buxls47iu().s[110]++;showBtn.innerHTML=passwordHide;cov_buxls47iu().s[111]++;showBtn.title=(cov_buxls47iu().b[44][0]++,input.getAttribute("data-hide-password-text"))||(cov_buxls47iu().b[44][1]++,"Hide password");cov_buxls47iu().s[112]++;showBtn.ariaLabel=(cov_buxls47iu().b[45][0]++,input.getAttribute("data-hide-password-text"))||(cov_buxls47iu().b[45][1]++,"Hide password");cov_buxls47iu().s[113]++;input.type="text"}else{cov_buxls47iu().b[43][1]++;cov_buxls47iu().s[114]++;showBtn.innerHTML=passwordShow;cov_buxls47iu().s[115]++;showBtn.title=(cov_buxls47iu().b[46][0]++,input.getAttribute("data-show-password-text"))||(cov_buxls47iu().b[46][1]++,"Show password");cov_buxls47iu().s[116]++;showBtn.ariaLabel=(cov_buxls47iu().b[47][0]++,input.getAttribute("data-show-password-text"))||(cov_buxls47iu().b[47][1]++,"Show password");cov_buxls47iu().s[117]++;input.type="password"}cov_buxls47iu().s[118]++;input.focus()}));cov_buxls47iu().s[119]++;insertAfter(showBtn,dd.querySelector("label"))}else cov_buxls47iu().b[39][1]++;
|
|
37
|
+
// #endregion
|
|
38
|
+
// add listener to shift clear button when scrollbar present
|
|
39
|
+
cov_buxls47iu().s[120]++;for(const textarea of document.querySelectorAll("textarea")){cov_buxls47iu().s[121]++;
|
|
40
|
+
// shifts the close button to the right if a scrollbar is present
|
|
41
|
+
const shiftCloseBtn=()=>{cov_buxls47iu().f[6]++;const clearBtn=(cov_buxls47iu().s[122]++,textarea.parentElement?.querySelector("button.clear"));cov_buxls47iu().s[123]++;if(clearBtn){cov_buxls47iu().b[48][0]++;cov_buxls47iu().s[124]++;clearBtn.style.marginRight=textarea.clientHeight<textarea.scrollHeight?(cov_buxls47iu().b[49][0]++,"15px"):(cov_buxls47iu().b[49][1]++,"")}else cov_buxls47iu().b[48][1]++};cov_buxls47iu().s[125]++;textarea.addEventListener("input",shiftCloseBtn);cov_buxls47iu().s[126]++;textarea.addEventListener("mouseup",shiftCloseBtn)}}else cov_buxls47iu().b[5][1]++}}
|
|
42
|
+
/**
|
|
43
|
+
* Places an element immediately after another element
|
|
44
|
+
* @param {Object} newNode element being placed after the reference node
|
|
45
|
+
* @param {*} referenceNode element to be used as reference for new node
|
|
46
|
+
*/function insertAfter(newNode,referenceNode){cov_buxls47iu().f[7]++;cov_buxls47iu().s[127]++;if(referenceNode.nextSibling){cov_buxls47iu().b[50][0]++;cov_buxls47iu().s[128]++;referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}else{cov_buxls47iu().b[50][1]++;cov_buxls47iu().s[129]++;referenceNode.parentNode.appendChild(newNode)}}
|
|
47
|
+
// handle undo/redo
|
|
48
|
+
let lastFocusedInput;let lastClearFieldPressed;cov_buxls47iu().s[130]++;document.addEventListener("keydown",(event=>{cov_buxls47iu().f[8]++;cov_buxls47iu().s[131]++;if(((cov_buxls47iu().b[52][0]++,event.ctrlKey)||(cov_buxls47iu().b[52][1]++,event.metaKey))&&(cov_buxls47iu().b[52][2]++,event.key==="z")&&(cov_buxls47iu().b[52][3]++,!event.shiftKey)){cov_buxls47iu().b[51][0]++;cov_buxls47iu().s[132]++;
|
|
49
|
+
// undo clearing a field
|
|
50
|
+
if(lastFocusedInput){cov_buxls47iu().b[53][0]++;cov_buxls47iu().s[133]++;if((cov_buxls47iu().b[55][0]++,lastFocusedInput?.parentNode?.querySelector("button.clear").id===`semanticFormsClearButton_${lastClearFieldPressed}`)||(cov_buxls47iu().b[55][1]++,lastFocusedInput?.parentNode?.querySelector("button.clear").name===`semanticFormsClearButton_${lastClearFieldPressed}`)){cov_buxls47iu().b[54][0]++;cov_buxls47iu().s[134]++;if(lastFocusedInput.previousValue){cov_buxls47iu().b[56][0]++;cov_buxls47iu().s[135]++;lastFocusedInput.redoValue=lastFocusedInput.value;cov_buxls47iu().s[136]++;lastFocusedInput.value=lastFocusedInput.previousValue}else cov_buxls47iu().b[56][1]++}else cov_buxls47iu().b[54][1]++}else cov_buxls47iu().b[53][1]++}else{cov_buxls47iu().b[51][1]++;cov_buxls47iu().s[137]++;if((cov_buxls47iu().b[58][0]++,event.ctrlKey)&&(cov_buxls47iu().b[58][1]++,event.key==="y")||(cov_buxls47iu().b[58][2]++,event.metaKey)&&(cov_buxls47iu().b[58][3]++,event.shiftKey)&&(cov_buxls47iu().b[58][4]++,event.key==="z")){cov_buxls47iu().b[57][0]++;cov_buxls47iu().s[138]++;
|
|
51
|
+
// redo clearing a field
|
|
52
|
+
if(lastFocusedInput){cov_buxls47iu().b[59][0]++;cov_buxls47iu().s[139]++;if((cov_buxls47iu().b[61][0]++,lastFocusedInput?.parentNode?.querySelector("button.clear").id===`semanticFormsClearButton_${lastClearFieldPressed}`)||(cov_buxls47iu().b[61][1]++,lastFocusedInput?.parentNode?.querySelector("button.clear").name===`semanticFormsClearButton_${lastClearFieldPressed}`)){cov_buxls47iu().b[60][0]++;cov_buxls47iu().s[140]++;if(lastFocusedInput.redoValue){cov_buxls47iu().b[62][0]++;cov_buxls47iu().s[141]++;lastFocusedInput.previousValue=lastFocusedInput.value;cov_buxls47iu().s[142]++;lastFocusedInput.value=lastFocusedInput.redoValue}else cov_buxls47iu().b[62][1]++}else cov_buxls47iu().b[60][1]++}else cov_buxls47iu().b[59][1]++}else cov_buxls47iu().b[57][1]++}}));
|
|
53
|
+
// monitor changes to the DOM and enhance new semanticForms forms that get added
|
|
54
|
+
cov_buxls47iu().s[143]++;if(!window.semanticFormsObserver){cov_buxls47iu().b[63][0]++;cov_buxls47iu().s[144]++;window.semanticFormsObserver=new window.MutationObserver((mutations=>{cov_buxls47iu().f[9]++;let stop=(cov_buxls47iu().s[145]++,false);cov_buxls47iu().s[146]++;for(const mutation of mutations){cov_buxls47iu().s[147]++;for(const node of mutation.addedNodes){cov_buxls47iu().s[148]++;if(node.nodeName==="FORM"){cov_buxls47iu().b[64][0]++;cov_buxls47iu().s[149]++;window.semanticForms();cov_buxls47iu().s[150]++;stop=true}else cov_buxls47iu().b[64][1]++}cov_buxls47iu().s[151]++;if(stop){cov_buxls47iu().b[65][0]++;cov_buxls47iu().s[152]++;break}else cov_buxls47iu().b[65][1]++}}));cov_buxls47iu().s[153]++;window.semanticFormsObserver.observe(document.body,{attributes:false,childList:true,characterData:false,subtree:true})}else cov_buxls47iu().b[63][1]++;cov_buxls47iu().s[154]++;window.semanticForms.reinitialize=form=>{cov_buxls47iu().f[10]++;cov_buxls47iu().s[155]++;form.classList.remove("semanticFormsActive");cov_buxls47iu().s[156]++;window.semanticForms()}};
|
|
55
|
+
/***/
|
|
56
|
+
/******/}};
|
|
57
|
+
/************************************************************************/
|
|
58
|
+
/******/ // The module cache
|
|
59
|
+
/******/var __webpack_module_cache__={};
|
|
60
|
+
/******/
|
|
61
|
+
/******/ // The require function
|
|
62
|
+
/******/function __webpack_require__(moduleId){
|
|
63
|
+
/******/ // Check if module is in cache
|
|
64
|
+
/******/var cachedModule=__webpack_module_cache__[moduleId];
|
|
65
|
+
/******/if(cachedModule!==void 0)
|
|
66
|
+
/******/return cachedModule.exports;
|
|
67
|
+
/******/
|
|
68
|
+
/******/ // Create a new module (and put it into the cache)
|
|
69
|
+
/******/var module=__webpack_module_cache__[moduleId]={
|
|
70
|
+
/******/ // no module.id needed
|
|
71
|
+
/******/ // no module.loaded needed
|
|
72
|
+
/******/exports:{}
|
|
73
|
+
/******/};
|
|
74
|
+
/******/
|
|
75
|
+
/******/ // Execute the module function
|
|
76
|
+
/******/__webpack_modules__[moduleId](module,module.exports,__webpack_require__);
|
|
77
|
+
/******/
|
|
78
|
+
/******/ // Return the exports of the module
|
|
79
|
+
/******/return module.exports;
|
|
80
|
+
/******/}
|
|
81
|
+
/******/
|
|
82
|
+
/************************************************************************/
|
|
83
|
+
/******/
|
|
84
|
+
/******/ // startup
|
|
85
|
+
/******/ // Load entry module and return exports
|
|
86
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
87
|
+
/******/var __webpack_exports__=__webpack_require__(806);
|
|
88
|
+
/******/
|
|
89
|
+
/******/return __webpack_exports__;
|
|
90
|
+
/******/})()));
|
|
91
|
+
//# sourceMappingURL=semantic-forms.js.map
|
|
@@ -0,0 +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,MAAM,Y;;;;;ACMGC,cAAA,kBAAAC,cAAA,SAAAA,cAAA,CAAAD,gBAAAA,gBAAAE,EAAA,KAfZN,OAAOD,QAAU,KAAMK,gBAAAG,EAAA,KAAAH,gBAAAE,EAAA;iFAErB;IAAIF,gBAAAI,EAAA,eAAOC,SAASC,yBAA2B,cAAUN,gBAAAI,EAAA,eAAWC,SAASE,gBAAkB,cAAUP,gBAAAI,EAAA,SAAKC,SAASG,KAAKC,aAAST,gBAAAI,EAAA,SAAKM,OAAOC,kBAAkB,CAAAX,gBAAAI,EAAA,QAAAJ,gBAAAE,EAAA,WAAK,MAACF,gBAAAI,EAAA,QAEzK,MAAMQ,cAAYZ,gBAAAE,EAAA,KAAG,+SACrB,MAAMW,cAAYb,gBAAAE,EAAA,KAAG,uiBAErB,MAAMY,gBAAcd,gBAAAE,EA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CAAA3F,gBAAAE,EAAA,OACtC,GAAIwF,KAAK7D,WAAa,OAAQ,CAAA7B,gBAAAI,EAAA,SAAAJ,gBAAAE,EAAA,OAC5BQ,OAAOkF,gBAAe5F,gBAAAE,EAAA,OACtBsF,KAAO,IACT,MAACxF,gBAAAI,EAAA,QACH,CAACJ,gBAAAE,EAAA,OACD,GAAIsF,KAAM,CAAAxF,gBAAAI,EAAA,SAAAJ,gBAAAE,EAAA,YAAI,MAACF,gBAAAI,EAAA,QACjB,KACAJ,gBAAAE,EAAA,OACFQ,OAAO4E,sBAAsBO,QAAQxF,SAASG,KAAM,CAAEsF,WAAY,MAAOC,UAAW,KAAMC,cAAe,MAAOC,QAAS,MAC3H,MAACjG,gBAAAI,EAAA,SAAAJ,gBAAAE,EAAA,OAEDQ,OAAOkF,cAAcM,aAAgBhF,OAASlB,gBAAAG,EAAA,MAAAH,gBAAAE,EAAA,OAC5CgB,KAAKT,UAAUoC,OAAO,uBAAsB7C,gBAAAE,EAAA,OAC5CQ,OAAOkF,eAAe,CACvB;;;;;QC1PH,IAAIO,yBAA2B,CAAC;;;QAGhC,SAASC,oBAAoBC;;QAE5B,IAAIC,aAAeH,yBAAyBE;QAC5C,GAAIC,oBAAiBC;QACpB,OAAOD,aAAa3G;;;QAGrB,IAAIC,OAASuG,yBAAyBE,UAAY;;;QAGjD1G,QAAS,CAAC;;;;QAIX6G,oBAAoBH,UAAUzG,OAAQA,OAAOD,QAASyG;;;QAGtD,OAAOxG,OAAOD;QACf;;;;;;;QCnBA,IAAI8G,oBAAsBL,oBAAoB","sources":["webpack://semanticForms/webpack/universalModuleDefinition","webpack://semanticForms/semanticForms.js","webpack://semanticForms/webpack/bootstrap","webpack://semanticForms/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"semanticForms\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"semanticForms\"] = factory();\n\telse\n\t\troot[\"semanticForms\"] = factory();\n})(this, () => {\nreturn ","module.exports = () => {\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) return\n\n const passwordShow = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m1 12s4-8 11-8 11 8 11 8\"/><path d=\"m1 12s4 8 11 8 11-8 11-8\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></g></svg>'\n const passwordHide = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m2 2 20 20\"/><path d=\"m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335\"/><path d=\"m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192\"/></g></svg>'\n\n const nodeNameLookup = ['TEXTAREA', 'SELECT']\n const inputTypeLookup = ['checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'image', 'month', 'number', 'password', 'radio', 'range', 'search', 'tel', 'text', 'time', 'url', 'week']\n\n // progressively enhance form elements that have the semanticForms class\n const forms = document.querySelectorAll('form.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 // ignore input if it has previously been formatted\n if (input.classList.contains('semanticform') || !input.id) continue\n\n const type = input.getAttribute('type')\n if (nodeNameLookup.includes(input.nodeName) || inputTypeLookup.includes(type)) {\n // recursively find <dl> element\n let dl = input.parentNode\n while (dl && dl.nodeName !== 'DL') dl = dl.parentNode\n\n if (!dl) continue\n if (!dl.classList.contains('floatLabelForm')) dl.classList.add('floatLabelForm')\n\n const label = input.parentNode.parentNode.id && (type === 'checkbox' || type === 'radio')\n ? document.querySelector('label[data-for=' + input.parentNode.parentNode.id.replace(/\\./g, '\\\\.') + ']')\n : document.querySelector('label[for=' + input.id.replace(/\\./g, '\\\\.') + ']')\n\n input.classList.add('semanticform')\n\n // #region create labels\n if (type === 'checkbox' || type === 'radio') {\n // recursively find <dd> element\n let dd = input.parentNode\n while (dd && dd.nodeName !== 'DD') dd = dd.parentNode\n\n if (dd.firstChild.nodeName !== 'LABEL') {\n const newLabel = document.createElement('label')\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\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 newLabel.innerHTML = label.innerHTML\n\n if (dd.querySelector(':required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n label.innerHTML += `<span title=\"${text}\">*</span>`\n }\n\n if (!dd.querySelector('label')) dd.append(newLabel)\n }\n\n // removes old div that a radio or checkbox may have been added to\n if (dd.parentElement.nodeName === 'DIV') dd.parentElement.remove()\n\n const div = document.createElement('div')\n div.append(label.closest('dt'), dd)\n dl.append(div)\n } else {\n const newLabel = document.createElement('label')\n newLabel.setAttribute('for', input.id)\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\n newLabel.innerHTML = label.innerHTML\n\n if (input.hasAttribute('required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n newLabel.innerHTML += ` <span title=\"${text}\">*</span>`\n }\n\n label.setAttribute('hidden', 'hidden')\n\n insertAfter(newLabel, input)\n }\n // #endregion\n\n // standard inputs\n if (type !== 'checkbox' && type !== 'radio') {\n if (!input.getAttribute('placeholder')) {\n input.setAttribute('placeholder', ' ')\n }\n\n const div = document.createElement('div')\n const dt = label.closest('dt')\n const dd = input.closest('dd')\n\n // #region 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', (event) => {\n input.previousValue = input.value\n input.value = ''\n input.focus()\n lastClearFieldPressed = input.id\n })\n insertAfter(clearBtn, dd.querySelector('label'))\n }\n input.addEventListener('focus', (event) => {\n if (event.target.nodeName === 'INPUT') lastFocusedInput = event.target\n })\n // #endregion\n\n // check for colspan- utility class\n if (/colspan-/.test(dd.className)) {\n const match = dd.className.match(/colspan-([0-9]|full)/)[0]\n dd.classList.remove(match)\n div.classList.add(match)\n }\n\n div.append(dt, dd)\n dl.append(div)\n\n // determine visibility of newly created <div>\n if (dt.style.display === 'none' && dd.style.display === 'none') div.style.display = 'none'\n }\n\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', e => {\n clearBtn.style.display = e.target.files.length ? 'flex' : 'none'\n })\n clearBtn.addEventListener('click', () => {\n clearBtn.style.display = 'none'\n })\n }\n\n // #region show password button\n if (type === 'password' && input.getAttribute('data-no-reveal') === null) {\n const showBtn = document.createElement('button')\n showBtn.type = 'button'\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.tabIndex = -1\n showBtn.innerHTML = passwordShow\n showBtn.classList.add('show')\n showBtn.id = `semanticFormsShowButton_${input.id}`\n const dd = input.closest('dd')\n showBtn.addEventListener('click', (event) => {\n if (input.type === 'password') {\n showBtn.innerHTML = passwordHide\n showBtn.title = input.getAttribute('data-hide-password-text') || 'Hide password'\n showBtn.ariaLabel = input.getAttribute('data-hide-password-text') || 'Hide password'\n input.type = 'text'\n } else {\n showBtn.innerHTML = passwordShow\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n input.type = 'password'\n }\n input.focus()\n })\n insertAfter(showBtn, dd.querySelector('label'))\n }\n // #endregion\n\n // add listener to shift clear button when scrollbar present\n for (const textarea of document.querySelectorAll('textarea')) {\n // shifts the close button to the right if a scrollbar is present\n const shiftCloseBtn = () => {\n const clearBtn = textarea.parentElement?.querySelector('button.clear')\n if (clearBtn) {\n clearBtn.style.marginRight = textarea.clientHeight < textarea.scrollHeight ? '15px' : ''\n }\n }\n\n textarea.addEventListener('input', shiftCloseBtn)\n textarea.addEventListener('mouseup', shiftCloseBtn)\n }\n }\n }\n }\n\n /**\n * Places an element immediately after another element\n * @param {Object} newNode element being placed after the reference node\n * @param {*} referenceNode element to be used as reference for new node\n */\n function insertAfter (newNode, referenceNode) {\n if (referenceNode.nextSibling) referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)\n else referenceNode.parentNode.appendChild(newNode)\n }\n\n // handle undo/redo\n let lastFocusedInput\n let lastClearFieldPressed\n document.addEventListener('keydown', (event) => {\n if ((event.ctrlKey || event.metaKey) && event.key === 'z' && !event.shiftKey) {\n // undo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.previousValue) {\n lastFocusedInput.redoValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.previousValue\n }\n }\n }\n } else if ((event.ctrlKey && event.key === 'y') || (event.metaKey && event.shiftKey && event.key === 'z')) {\n // redo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.redoValue) {\n lastFocusedInput.previousValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.redoValue\n }\n }\n }\n }\n })\n\n // monitor changes to the DOM and enhance new semanticForms forms that get added\n if (!window.semanticFormsObserver) {\n window.semanticFormsObserver = new window.MutationObserver((mutations) => {\n let stop = false\n for (const mutation of mutations) {\n for (const node of mutation.addedNodes) {\n if (node.nodeName === 'FORM') {\n window.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 window.semanticForms.reinitialize = (form) => {\n form.classList.remove('semanticFormsActive')\n window.semanticForms()\n }\n}\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__(806);\n"],"names":["root","factory","exports","module","define","amd","this","cov_buxls47iu","actualCoverage","s","f","b","document","getElementsByClassName","querySelector","body","classList","window","MutationObserver","passwordShow","passwordHide","nodeNameLookup","inputTypeLookup","forms","querySelectorAll","form","add","contains","inputs","Array","from","input","id","type","getAttribute","includes","nodeName","dl","parentNode","label","replace","dd","firstChild","newLabel","createElement","className","setAttribute","insertAfter","innerHTML","text","append","parentElement","remove","div","closest","hasAttribute","dt","clearBtn","title","ariaLabel","tabIndex","addEventListener","event","previousValue","value","focus","lastClearFieldPressed","target","lastFocusedInput","test","match","style","display","e","files","length","showBtn","textarea","shiftCloseBtn","marginRight","clientHeight","scrollHeight","newNode","referenceNode","nextSibling","insertBefore","appendChild","ctrlKey","metaKey","key","shiftKey","name","redoValue","semanticFormsObserver","mutations","stop","mutation","node","addedNodes","semanticForms","observe","attributes","childList","characterData","subtree","reinitialize","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","__webpack_exports__"],"sourceRoot":""}
|
|
@@ -0,0 +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=>{e.exports=()=>{if("function"!=typeof document.getElementsByClassName||"function"!=typeof document.querySelector||!document.body.classList||!window.MutationObserver)return;const e='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m1 12s4-8 11-8 11 8 11 8"/><path d="m1 12s4 8 11 8 11-8 11-8"/><circle cx="12" cy="12" r="3"/></g></svg>',t=["TEXTAREA","SELECT"],o=["checkbox","color","date","datetime-local","email","file","image","month","number","password","radio","range","search","tel","text","time","url","week"],r=document.querySelectorAll("form.semanticForms:not(.semanticFormsActive)");for(const i of r){if(i.classList.add("semanticFormsActive"),i.classList.contains("lowFlow"))continue;const r=Array.from(i.querySelectorAll("input, textarea, select"));for(const i of r){if(i.classList.contains("semanticform")||!i.id)continue;const r=i.getAttribute("type");if(t.includes(i.nodeName)||o.includes(r)){let t=i.parentNode;for(;t&&"DL"!==t.nodeName;)t=t.parentNode;if(!t)continue;t.classList.contains("floatLabelForm")||t.classList.add("floatLabelForm");const o=!i.parentNode.parentNode.id||"checkbox"!==r&&"radio"!==r?document.querySelector("label[for="+i.id.replace(/\./g,"\\.")+"]"):document.querySelector("label[data-for="+i.parentNode.parentNode.id.replace(/\./g,"\\.")+"]");if(i.classList.add("semanticform"),"checkbox"===r||"radio"===r){let e=i.parentNode;for(;e&&"DD"!==e.nodeName;)e=e.parentNode;if("LABEL"!==e.firstChild.nodeName){const t=document.createElement("label");if(t.className="floatLabelFormAnimatedLabel","checkbox"===r&&"DD"===i.parentNode.nodeName&&(t.setAttribute("for",i.id),i.parentNode.classList.add("singleCheckbox"),t.className="",o.setAttribute("hidden","hidden"),a(t,i)),t.innerHTML=o.innerHTML,e.querySelector(":required")&&null===o.getAttribute("data-no-asterisk")&&!o.querySelector("span")){const e=o.getAttribute("data-asterisk-text")||"This field is required.";o.innerHTML+=`<span title="${e}">*</span>`}e.querySelector("label")||e.append(t)}"DIV"===e.parentElement.nodeName&&e.parentElement.remove();const n=document.createElement("div");n.append(o.closest("dt"),e),t.append(n)}else{const e=document.createElement("label");if(e.setAttribute("for",i.id),e.className="floatLabelFormAnimatedLabel",e.innerHTML=o.innerHTML,i.hasAttribute("required")&&null===o.getAttribute("data-no-asterisk")&&!o.querySelector("span")){const t=o.getAttribute("data-asterisk-text")||"This field is required.";e.innerHTML+=` <span title="${t}">*</span>`}o.setAttribute("hidden","hidden"),a(e,i)}if("checkbox"!==r&&"radio"!==r){i.getAttribute("placeholder")||i.setAttribute("placeholder"," ");const e=document.createElement("div"),d=o.closest("dt"),l=i.closest("dd");if("SELECT"!==i.nodeName&&"range"!==r){const e=document.createElement("button");e.type="button",e.title=i.getAttribute("data-clear-field-text")||"Clear field",e.ariaLabel=i.getAttribute("data-clear-field-text")||"Clear field",e.tabIndex=-1,e.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" />',e.classList.add("clear"),e.id=`semanticFormsClearButton_${i.id}`,e.addEventListener("click",(e=>{i.previousValue=i.value,i.value="",i.focus(),s=i.id})),a(e,l.querySelector("label"))}if(i.addEventListener("focus",(e=>{"INPUT"===e.target.nodeName&&(n=e.target)})),/colspan-/.test(l.className)){const t=l.className.match(/colspan-([0-9]|full)/)[0];l.classList.remove(t),e.classList.add(t)}e.append(d,l),t.append(e),"none"===d.style.display&&"none"===l.style.display&&(e.style.display="none")}if("file"===r){const e=i.parentElement.querySelector(".clear");i.addEventListener("input",(t=>{e.style.display=t.target.files.length?"flex":"none"})),e.addEventListener("click",(()=>{e.style.display="none"}))}if("password"===r&&null===i.getAttribute("data-no-reveal")){const t=document.createElement("button");t.type="button",t.title=i.getAttribute("data-show-password-text")||"Show password",t.ariaLabel=i.getAttribute("data-show-password-text")||"Show password",t.tabIndex=-1,t.innerHTML=e,t.classList.add("show"),t.id=`semanticFormsShowButton_${i.id}`;const o=i.closest("dd");t.addEventListener("click",(o=>{"password"===i.type?(t.innerHTML='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m2 2 20 20"/><path d="m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335"/><path d="m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192"/></g></svg>',t.title=i.getAttribute("data-hide-password-text")||"Hide password",t.ariaLabel=i.getAttribute("data-hide-password-text")||"Hide password",i.type="text"):(t.innerHTML=e,t.title=i.getAttribute("data-show-password-text")||"Show password",t.ariaLabel=i.getAttribute("data-show-password-text")||"Show password",i.type="password"),i.focus()})),a(t,o.querySelector("label"))}for(const e of document.querySelectorAll("textarea")){const t=()=>{const t=e.parentElement?.querySelector("button.clear");t&&(t.style.marginRight=e.clientHeight<e.scrollHeight?"15px":"")};e.addEventListener("input",t),e.addEventListener("mouseup",t)}}}}function a(e,t){t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e)}let n,s;document.addEventListener("keydown",(e=>{!e.ctrlKey&&!e.metaKey||"z"!==e.key||e.shiftKey?(e.ctrlKey&&"y"===e.key||e.metaKey&&e.shiftKey&&"z"===e.key)&&n&&(n?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${s}`&&n?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${s}`||n.redoValue&&(n.previousValue=n.value,n.value=n.redoValue)):n&&(n?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${s}`&&n?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${s}`||n.previousValue&&(n.redoValue=n.value,n.value=n.previousValue))})),window.semanticFormsObserver||(window.semanticFormsObserver=new window.MutationObserver((e=>{let t=!1;for(const o of e){for(const e of o.addedNodes)"FORM"===e.nodeName&&(window.semanticForms(),t=!0);if(t)break}})),window.semanticFormsObserver.observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0})),window.semanticForms.reinitialize=e=>{e.classList.remove("semanticFormsActive"),window.semanticForms()}}}},t={},function o(r){var a=t[r];if(void 0!==a)return a.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}(90);var e,t}));
|
|
2
|
+
//# sourceMappingURL=semantic-forms.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantic-forms.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,gBAAiB,GAAIH,GACF,iBAAZC,QACdA,QAAuB,cAAID,IAE3BD,EAAoB,cAAIC,GACzB,CATD,CASGK,MAAM,KACT,O,UCVAH,EAAOD,QAAU,KAEf,GAA+C,mBAApCK,SAASC,wBAA2E,mBAA3BD,SAASE,gBAAiCF,SAASG,KAAKC,YAAcC,OAAOC,iBAAkB,OAEnK,MAAMC,EAAe,8SAGfC,EAAiB,CAAC,WAAY,UAC9BC,EAAkB,CAAC,WAAY,QAAS,OAAQ,iBAAkB,QAAS,OAAQ,QAAS,QAAS,SAAU,WAAY,QAAS,QAAS,SAAU,MAAO,OAAQ,OAAQ,MAAO,QAGrLC,EAAQV,SAASW,iBAAiB,gDAExC,IAAK,MAAMC,KAAQF,EAAO,CAExB,GADAE,EAAKR,UAAUS,IAAI,uBACfD,EAAKR,UAAUU,SAAS,WAAY,SAGxC,MAAMC,EAASC,MAAMC,KAAKL,EAAKD,iBAAiB,4BAChD,IAAK,MAAMO,KAASH,EAAQ,CAE1B,GAAIG,EAAMd,UAAUU,SAAS,kBAAoBI,EAAMC,GAAI,SAE3D,MAAMC,EAAOF,EAAMG,aAAa,QAChC,GAAIb,EAAec,SAASJ,EAAMK,WAAad,EAAgBa,SAASF,GAAO,CAE7E,IAAII,EAAKN,EAAMO,WACf,KAAOD,GAAsB,OAAhBA,EAAGD,UAAmBC,EAAKA,EAAGC,WAE3C,IAAKD,EAAI,SACJA,EAAGpB,UAAUU,SAAS,mBAAmBU,EAAGpB,UAAUS,IAAI,kBAE/D,MAAMa,GAAQR,EAAM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C,OAAOiF,eAAc,CACvB,C,GC1PEO,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAarG,QAGrB,IAAIC,EAASiG,EAAyBE,GAAY,CAGjDpG,QAAS,CAAC,GAOX,OAHAuG,EAAoBH,GAAUnG,EAAQA,EAAOD,QAASmG,GAG/ClG,EAAOD,OACf,CCnB0BmG,CAAoB,I,MDF1CD,C","sources":["webpack://semanticForms/webpack/universalModuleDefinition","webpack://semanticForms/./semanticForms.js","webpack://semanticForms/webpack/bootstrap","webpack://semanticForms/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"semanticForms\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"semanticForms\"] = factory();\n\telse\n\t\troot[\"semanticForms\"] = factory();\n})(this, () => {\nreturn ","module.exports = () => {\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) return\n\n const passwordShow = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m1 12s4-8 11-8 11 8 11 8\"/><path d=\"m1 12s4 8 11 8 11-8 11-8\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></g></svg>'\n const passwordHide = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m2 2 20 20\"/><path d=\"m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335\"/><path d=\"m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192\"/></g></svg>'\n\n const nodeNameLookup = ['TEXTAREA', 'SELECT']\n const inputTypeLookup = ['checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'image', 'month', 'number', 'password', 'radio', 'range', 'search', 'tel', 'text', 'time', 'url', 'week']\n\n // progressively enhance form elements that have the semanticForms class\n const forms = document.querySelectorAll('form.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 // ignore input if it has previously been formatted\n if (input.classList.contains('semanticform') || !input.id) continue\n\n const type = input.getAttribute('type')\n if (nodeNameLookup.includes(input.nodeName) || inputTypeLookup.includes(type)) {\n // recursively find <dl> element\n let dl = input.parentNode\n while (dl && dl.nodeName !== 'DL') dl = dl.parentNode\n\n if (!dl) continue\n if (!dl.classList.contains('floatLabelForm')) dl.classList.add('floatLabelForm')\n\n const label = input.parentNode.parentNode.id && (type === 'checkbox' || type === 'radio')\n ? document.querySelector('label[data-for=' + input.parentNode.parentNode.id.replace(/\\./g, '\\\\.') + ']')\n : document.querySelector('label[for=' + input.id.replace(/\\./g, '\\\\.') + ']')\n\n input.classList.add('semanticform')\n\n // #region create labels\n if (type === 'checkbox' || type === 'radio') {\n // recursively find <dd> element\n let dd = input.parentNode\n while (dd && dd.nodeName !== 'DD') dd = dd.parentNode\n\n if (dd.firstChild.nodeName !== 'LABEL') {\n const newLabel = document.createElement('label')\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\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 newLabel.innerHTML = label.innerHTML\n\n if (dd.querySelector(':required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n label.innerHTML += `<span title=\"${text}\">*</span>`\n }\n\n if (!dd.querySelector('label')) dd.append(newLabel)\n }\n\n // removes old div that a radio or checkbox may have been added to\n if (dd.parentElement.nodeName === 'DIV') dd.parentElement.remove()\n\n const div = document.createElement('div')\n div.append(label.closest('dt'), dd)\n dl.append(div)\n } else {\n const newLabel = document.createElement('label')\n newLabel.setAttribute('for', input.id)\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\n newLabel.innerHTML = label.innerHTML\n\n if (input.hasAttribute('required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n newLabel.innerHTML += ` <span title=\"${text}\">*</span>`\n }\n\n label.setAttribute('hidden', 'hidden')\n\n insertAfter(newLabel, input)\n }\n // #endregion\n\n // standard inputs\n if (type !== 'checkbox' && type !== 'radio') {\n if (!input.getAttribute('placeholder')) {\n input.setAttribute('placeholder', ' ')\n }\n\n const div = document.createElement('div')\n const dt = label.closest('dt')\n const dd = input.closest('dd')\n\n // #region 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', (event) => {\n input.previousValue = input.value\n input.value = ''\n input.focus()\n lastClearFieldPressed = input.id\n })\n insertAfter(clearBtn, dd.querySelector('label'))\n }\n input.addEventListener('focus', (event) => {\n if (event.target.nodeName === 'INPUT') lastFocusedInput = event.target\n })\n // #endregion\n\n // check for colspan- utility class\n if (/colspan-/.test(dd.className)) {\n const match = dd.className.match(/colspan-([0-9]|full)/)[0]\n dd.classList.remove(match)\n div.classList.add(match)\n }\n\n div.append(dt, dd)\n dl.append(div)\n\n // determine visibility of newly created <div>\n if (dt.style.display === 'none' && dd.style.display === 'none') div.style.display = 'none'\n }\n\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', e => {\n clearBtn.style.display = e.target.files.length ? 'flex' : 'none'\n })\n clearBtn.addEventListener('click', () => {\n clearBtn.style.display = 'none'\n })\n }\n\n // #region show password button\n if (type === 'password' && input.getAttribute('data-no-reveal') === null) {\n const showBtn = document.createElement('button')\n showBtn.type = 'button'\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.tabIndex = -1\n showBtn.innerHTML = passwordShow\n showBtn.classList.add('show')\n showBtn.id = `semanticFormsShowButton_${input.id}`\n const dd = input.closest('dd')\n showBtn.addEventListener('click', (event) => {\n if (input.type === 'password') {\n showBtn.innerHTML = passwordHide\n showBtn.title = input.getAttribute('data-hide-password-text') || 'Hide password'\n showBtn.ariaLabel = input.getAttribute('data-hide-password-text') || 'Hide password'\n input.type = 'text'\n } else {\n showBtn.innerHTML = passwordShow\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n input.type = 'password'\n }\n input.focus()\n })\n insertAfter(showBtn, dd.querySelector('label'))\n }\n // #endregion\n\n // add listener to shift clear button when scrollbar present\n for (const textarea of document.querySelectorAll('textarea')) {\n // shifts the close button to the right if a scrollbar is present\n const shiftCloseBtn = () => {\n const clearBtn = textarea.parentElement?.querySelector('button.clear')\n if (clearBtn) {\n clearBtn.style.marginRight = textarea.clientHeight < textarea.scrollHeight ? '15px' : ''\n }\n }\n\n textarea.addEventListener('input', shiftCloseBtn)\n textarea.addEventListener('mouseup', shiftCloseBtn)\n }\n }\n }\n }\n\n /**\n * Places an element immediately after another element\n * @param {Object} newNode element being placed after the reference node\n * @param {*} referenceNode element to be used as reference for new node\n */\n function insertAfter (newNode, referenceNode) {\n if (referenceNode.nextSibling) referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)\n else referenceNode.parentNode.appendChild(newNode)\n }\n\n // handle undo/redo\n let lastFocusedInput\n let lastClearFieldPressed\n document.addEventListener('keydown', (event) => {\n if ((event.ctrlKey || event.metaKey) && event.key === 'z' && !event.shiftKey) {\n // undo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.previousValue) {\n lastFocusedInput.redoValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.previousValue\n }\n }\n }\n } else if ((event.ctrlKey && event.key === 'y') || (event.metaKey && event.shiftKey && event.key === 'z')) {\n // redo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.redoValue) {\n lastFocusedInput.previousValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.redoValue\n }\n }\n }\n }\n })\n\n // monitor changes to the DOM and enhance new semanticForms forms that get added\n if (!window.semanticFormsObserver) {\n window.semanticFormsObserver = new window.MutationObserver((mutations) => {\n let stop = false\n for (const mutation of mutations) {\n for (const node of mutation.addedNodes) {\n if (node.nodeName === 'FORM') {\n window.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 window.semanticForms.reinitialize = (form) => {\n form.classList.remove('semanticFormsActive')\n window.semanticForms()\n }\n}\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","document","getElementsByClassName","querySelector","body","classList","window","MutationObserver","passwordShow","nodeNameLookup","inputTypeLookup","forms","querySelectorAll","form","add","contains","inputs","Array","from","input","id","type","getAttribute","includes","nodeName","dl","parentNode","label","replace","dd","firstChild","newLabel","createElement","className","setAttribute","insertAfter","innerHTML","text","append","parentElement","remove","div","closest","hasAttribute","dt","clearBtn","title","ariaLabel","tabIndex","addEventListener","event","previousValue","value","focus","lastClearFieldPressed","target","lastFocusedInput","test","match","style","display","e","files","length","showBtn","textarea","shiftCloseBtn","marginRight","clientHeight","scrollHeight","newNode","referenceNode","nextSibling","insertBefore","appendChild","ctrlKey","metaKey","key","shiftKey","name","redoValue","semanticFormsObserver","mutations","stop","mutation","node","addedNodes","semanticForms","observe","attributes","childList","characterData","subtree","reinitialize","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e={90:e=>{e.exports=()=>{if("function"!=typeof document.getElementsByClassName||"function"!=typeof document.querySelector||!document.body.classList||!window.MutationObserver)return;const e='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m1 12s4-8 11-8 11 8 11 8"/><path d="m1 12s4 8 11 8 11-8 11-8"/><circle cx="12" cy="12" r="3"/></g></svg>',t=["TEXTAREA","SELECT"],r=["checkbox","color","date","datetime-local","email","file","image","month","number","password","radio","range","search","tel","text","time","url","week"],a=document.querySelectorAll("form.semanticForms:not(.semanticFormsActive)");for(const i of a){if(i.classList.add("semanticFormsActive"),i.classList.contains("lowFlow"))continue;const a=Array.from(i.querySelectorAll("input, textarea, select"));for(const i of a){if(i.classList.contains("semanticform")||!i.id)continue;const a=i.getAttribute("type");if(t.includes(i.nodeName)||r.includes(a)){let t=i.parentNode;for(;t&&"DL"!==t.nodeName;)t=t.parentNode;if(!t)continue;t.classList.contains("floatLabelForm")||t.classList.add("floatLabelForm");const r=!i.parentNode.parentNode.id||"checkbox"!==a&&"radio"!==a?document.querySelector("label[for="+i.id.replace(/\./g,"\\.")+"]"):document.querySelector("label[data-for="+i.parentNode.parentNode.id.replace(/\./g,"\\.")+"]");if(i.classList.add("semanticform"),"checkbox"===a||"radio"===a){let e=i.parentNode;for(;e&&"DD"!==e.nodeName;)e=e.parentNode;if("LABEL"!==e.firstChild.nodeName){const t=document.createElement("label");if(t.className="floatLabelFormAnimatedLabel","checkbox"===a&&"DD"===i.parentNode.nodeName&&(t.setAttribute("for",i.id),i.parentNode.classList.add("singleCheckbox"),t.className="",r.setAttribute("hidden","hidden"),o(t,i)),t.innerHTML=r.innerHTML,e.querySelector(":required")&&null===r.getAttribute("data-no-asterisk")&&!r.querySelector("span")){const e=r.getAttribute("data-asterisk-text")||"This field is required.";r.innerHTML+=`<span title="${e}">*</span>`}e.querySelector("label")||e.append(t)}"DIV"===e.parentElement.nodeName&&e.parentElement.remove();const n=document.createElement("div");n.append(r.closest("dt"),e),t.append(n)}else{const e=document.createElement("label");if(e.setAttribute("for",i.id),e.className="floatLabelFormAnimatedLabel",e.innerHTML=r.innerHTML,i.hasAttribute("required")&&null===r.getAttribute("data-no-asterisk")&&!r.querySelector("span")){const t=r.getAttribute("data-asterisk-text")||"This field is required.";e.innerHTML+=` <span title="${t}">*</span>`}r.setAttribute("hidden","hidden"),o(e,i)}if("checkbox"!==a&&"radio"!==a){i.getAttribute("placeholder")||i.setAttribute("placeholder"," ");const e=document.createElement("div"),l=r.closest("dt"),d=i.closest("dd");if("SELECT"!==i.nodeName&&"range"!==a){const e=document.createElement("button");e.type="button",e.title=i.getAttribute("data-clear-field-text")||"Clear field",e.ariaLabel=i.getAttribute("data-clear-field-text")||"Clear field",e.tabIndex=-1,e.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" />',e.classList.add("clear"),e.id=`semanticFormsClearButton_${i.id}`,e.addEventListener("click",(e=>{i.previousValue=i.value,i.value="",i.focus(),s=i.id})),o(e,d.querySelector("label"))}if(i.addEventListener("focus",(e=>{"INPUT"===e.target.nodeName&&(n=e.target)})),/colspan-/.test(d.className)){const t=d.className.match(/colspan-([0-9]|full)/)[0];d.classList.remove(t),e.classList.add(t)}e.append(l,d),t.append(e),"none"===l.style.display&&"none"===d.style.display&&(e.style.display="none")}if("file"===a){const e=i.parentElement.querySelector(".clear");i.addEventListener("input",(t=>{e.style.display=t.target.files.length?"flex":"none"})),e.addEventListener("click",(()=>{e.style.display="none"}))}if("password"===a&&null===i.getAttribute("data-no-reveal")){const t=document.createElement("button");t.type="button",t.title=i.getAttribute("data-show-password-text")||"Show password",t.ariaLabel=i.getAttribute("data-show-password-text")||"Show password",t.tabIndex=-1,t.innerHTML=e,t.classList.add("show"),t.id=`semanticFormsShowButton_${i.id}`;const r=i.closest("dd");t.addEventListener("click",(r=>{"password"===i.type?(t.innerHTML='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m2 2 20 20"/><path d="m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335"/><path d="m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192"/></g></svg>',t.title=i.getAttribute("data-hide-password-text")||"Hide password",t.ariaLabel=i.getAttribute("data-hide-password-text")||"Hide password",i.type="text"):(t.innerHTML=e,t.title=i.getAttribute("data-show-password-text")||"Show password",t.ariaLabel=i.getAttribute("data-show-password-text")||"Show password",i.type="password"),i.focus()})),o(t,r.querySelector("label"))}for(const e of document.querySelectorAll("textarea")){const t=()=>{const t=e.parentElement?.querySelector("button.clear");t&&(t.style.marginRight=e.clientHeight<e.scrollHeight?"15px":"")};e.addEventListener("input",t),e.addEventListener("mouseup",t)}}}}function o(e,t){t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e)}let n,s;document.addEventListener("keydown",(e=>{!e.ctrlKey&&!e.metaKey||"z"!==e.key||e.shiftKey?(e.ctrlKey&&"y"===e.key||e.metaKey&&e.shiftKey&&"z"===e.key)&&n&&(n?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${s}`&&n?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${s}`||n.redoValue&&(n.previousValue=n.value,n.value=n.redoValue)):n&&(n?.parentNode?.querySelector("button.clear").id!==`semanticFormsClearButton_${s}`&&n?.parentNode?.querySelector("button.clear").name!==`semanticFormsClearButton_${s}`||n.previousValue&&(n.redoValue=n.value,n.value=n.previousValue))})),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&&(window.semanticForms(),t=!0);if(t)break}})),window.semanticFormsObserver.observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0})),window.semanticForms.reinitialize=e=>{e.classList.remove("semanticFormsActive"),window.semanticForms()}}}},t={};(function r(a){var o=t[a];if(void 0!==o)return o.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,r),n.exports})(90);
|
|
2
|
+
//# sourceMappingURL=semantic-forms.min.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantic-forms.min.mjs","mappings":"cAAAA,EAAOC,QAAU,KAEf,GAA+C,mBAApCC,SAASC,wBAA2E,mBAA3BD,SAASE,gBAAiCF,SAASG,KAAKC,YAAcC,OAAOC,iBAAkB,OAEnK,MAAMC,EAAe,8SAGfC,EAAiB,CAAC,WAAY,UAC9BC,EAAkB,CAAC,WAAY,QAAS,OAAQ,iBAAkB,QAAS,OAAQ,QAAS,QAAS,SAAU,WAAY,QAAS,QAAS,SAAU,MAAO,OAAQ,OAAQ,MAAO,QAGrLC,EAAQV,SAASW,iBAAiB,gDAExC,IAAK,MAAMC,KAAQF,EAAO,CAExB,GADAE,EAAKR,UAAUS,IAAI,uBACfD,EAAKR,UAAUU,SAAS,WAAY,SAGxC,MAAMC,EAASC,MAAMC,KAAKL,EAAKD,iBAAiB,4BAChD,IAAK,MAAMO,KAASH,EAAQ,CAE1B,GAAIG,EAAMd,UAAUU,SAAS,kBAAoBI,EAAMC,GAAI,SAE3D,MAAMC,EAAOF,EAAMG,aAAa,QAChC,GAAIb,EAAec,SAASJ,EAAMK,WAAad,EAAgBa,SAASF,GAAO,CAE7E,IAAII,E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KACZ,KAEF7E,OAAO2E,sBAAsBO,QAAQvF,SAASG,KAAM,CAAEqF,YAAY,EAAOC,WAAW,EAAMC,eAAe,EAAOC,SAAS,KAG3HtF,OAAOiF,cAAcM,aAAgBhF,IACnCA,EAAKR,UAAUmC,OAAO,uBACtBlC,OAAOiF,eAAc,CACvB,C,GC1PEO,EAA2B,CAAC,GAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAajG,QAGrB,IAAID,EAAS+F,EAAyBE,GAAY,CAGjDhG,QAAS,CAAC,GAOX,OAHAmG,EAAoBH,GAAUjG,EAAQA,EAAOC,QAAS+F,GAG/ChG,EAAOC,OACf,ECnB0B+F,CAAoB","sources":["webpack://semantic-forms/./semanticForms.js","webpack://semantic-forms/webpack/bootstrap","webpack://semantic-forms/webpack/startup"],"sourcesContent":["module.exports = () => {\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) return\n\n const passwordShow = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m1 12s4-8 11-8 11 8 11 8\"/><path d=\"m1 12s4 8 11 8 11-8 11-8\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></g></svg>'\n const passwordHide = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m2 2 20 20\"/><path d=\"m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335\"/><path d=\"m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192\"/></g></svg>'\n\n const nodeNameLookup = ['TEXTAREA', 'SELECT']\n const inputTypeLookup = ['checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'image', 'month', 'number', 'password', 'radio', 'range', 'search', 'tel', 'text', 'time', 'url', 'week']\n\n // progressively enhance form elements that have the semanticForms class\n const forms = document.querySelectorAll('form.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 // ignore input if it has previously been formatted\n if (input.classList.contains('semanticform') || !input.id) continue\n\n const type = input.getAttribute('type')\n if (nodeNameLookup.includes(input.nodeName) || inputTypeLookup.includes(type)) {\n // recursively find <dl> element\n let dl = input.parentNode\n while (dl && dl.nodeName !== 'DL') dl = dl.parentNode\n\n if (!dl) continue\n if (!dl.classList.contains('floatLabelForm')) dl.classList.add('floatLabelForm')\n\n const label = input.parentNode.parentNode.id && (type === 'checkbox' || type === 'radio')\n ? document.querySelector('label[data-for=' + input.parentNode.parentNode.id.replace(/\\./g, '\\\\.') + ']')\n : document.querySelector('label[for=' + input.id.replace(/\\./g, '\\\\.') + ']')\n\n input.classList.add('semanticform')\n\n // #region create labels\n if (type === 'checkbox' || type === 'radio') {\n // recursively find <dd> element\n let dd = input.parentNode\n while (dd && dd.nodeName !== 'DD') dd = dd.parentNode\n\n if (dd.firstChild.nodeName !== 'LABEL') {\n const newLabel = document.createElement('label')\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\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 newLabel.innerHTML = label.innerHTML\n\n if (dd.querySelector(':required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n label.innerHTML += `<span title=\"${text}\">*</span>`\n }\n\n if (!dd.querySelector('label')) dd.append(newLabel)\n }\n\n // removes old div that a radio or checkbox may have been added to\n if (dd.parentElement.nodeName === 'DIV') dd.parentElement.remove()\n\n const div = document.createElement('div')\n div.append(label.closest('dt'), dd)\n dl.append(div)\n } else {\n const newLabel = document.createElement('label')\n newLabel.setAttribute('for', input.id)\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\n newLabel.innerHTML = label.innerHTML\n\n if (input.hasAttribute('required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n newLabel.innerHTML += ` <span title=\"${text}\">*</span>`\n }\n\n label.setAttribute('hidden', 'hidden')\n\n insertAfter(newLabel, input)\n }\n // #endregion\n\n // standard inputs\n if (type !== 'checkbox' && type !== 'radio') {\n if (!input.getAttribute('placeholder')) {\n input.setAttribute('placeholder', ' ')\n }\n\n const div = document.createElement('div')\n const dt = label.closest('dt')\n const dd = input.closest('dd')\n\n // #region 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', (event) => {\n input.previousValue = input.value\n input.value = ''\n input.focus()\n lastClearFieldPressed = input.id\n })\n insertAfter(clearBtn, dd.querySelector('label'))\n }\n input.addEventListener('focus', (event) => {\n if (event.target.nodeName === 'INPUT') lastFocusedInput = event.target\n })\n // #endregion\n\n // check for colspan- utility class\n if (/colspan-/.test(dd.className)) {\n const match = dd.className.match(/colspan-([0-9]|full)/)[0]\n dd.classList.remove(match)\n div.classList.add(match)\n }\n\n div.append(dt, dd)\n dl.append(div)\n\n // determine visibility of newly created <div>\n if (dt.style.display === 'none' && dd.style.display === 'none') div.style.display = 'none'\n }\n\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', e => {\n clearBtn.style.display = e.target.files.length ? 'flex' : 'none'\n })\n clearBtn.addEventListener('click', () => {\n clearBtn.style.display = 'none'\n })\n }\n\n // #region show password button\n if (type === 'password' && input.getAttribute('data-no-reveal') === null) {\n const showBtn = document.createElement('button')\n showBtn.type = 'button'\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.tabIndex = -1\n showBtn.innerHTML = passwordShow\n showBtn.classList.add('show')\n showBtn.id = `semanticFormsShowButton_${input.id}`\n const dd = input.closest('dd')\n showBtn.addEventListener('click', (event) => {\n if (input.type === 'password') {\n showBtn.innerHTML = passwordHide\n showBtn.title = input.getAttribute('data-hide-password-text') || 'Hide password'\n showBtn.ariaLabel = input.getAttribute('data-hide-password-text') || 'Hide password'\n input.type = 'text'\n } else {\n showBtn.innerHTML = passwordShow\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n input.type = 'password'\n }\n input.focus()\n })\n insertAfter(showBtn, dd.querySelector('label'))\n }\n // #endregion\n\n // add listener to shift clear button when scrollbar present\n for (const textarea of document.querySelectorAll('textarea')) {\n // shifts the close button to the right if a scrollbar is present\n const shiftCloseBtn = () => {\n const clearBtn = textarea.parentElement?.querySelector('button.clear')\n if (clearBtn) {\n clearBtn.style.marginRight = textarea.clientHeight < textarea.scrollHeight ? '15px' : ''\n }\n }\n\n textarea.addEventListener('input', shiftCloseBtn)\n textarea.addEventListener('mouseup', shiftCloseBtn)\n }\n }\n }\n }\n\n /**\n * Places an element immediately after another element\n * @param {Object} newNode element being placed after the reference node\n * @param {*} referenceNode element to be used as reference for new node\n */\n function insertAfter (newNode, referenceNode) {\n if (referenceNode.nextSibling) referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)\n else referenceNode.parentNode.appendChild(newNode)\n }\n\n // handle undo/redo\n let lastFocusedInput\n let lastClearFieldPressed\n document.addEventListener('keydown', (event) => {\n if ((event.ctrlKey || event.metaKey) && event.key === 'z' && !event.shiftKey) {\n // undo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.previousValue) {\n lastFocusedInput.redoValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.previousValue\n }\n }\n }\n } else if ((event.ctrlKey && event.key === 'y') || (event.metaKey && event.shiftKey && event.key === 'z')) {\n // redo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.redoValue) {\n lastFocusedInput.previousValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.redoValue\n }\n }\n }\n }\n })\n\n // monitor changes to the DOM and enhance new semanticForms forms that get added\n if (!window.semanticFormsObserver) {\n window.semanticFormsObserver = new window.MutationObserver((mutations) => {\n let stop = false\n for (const mutation of mutations) {\n for (const node of mutation.addedNodes) {\n if (node.nodeName === 'FORM') {\n window.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 window.semanticForms.reinitialize = (form) => {\n form.classList.remove('semanticFormsActive')\n window.semanticForms()\n }\n}\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":["module","exports","document","getElementsByClassName","querySelector","body","classList","window","MutationObserver","passwordShow","nodeNameLookup","inputTypeLookup","forms","querySelectorAll","form","add","contains","inputs","Array","from","input","id","type","getAttribute","includes","nodeName","dl","parentNode","label","replace","dd","firstChild","newLabel","createElement","className","setAttribute","insertAfter","innerHTML","text","append","parentElement","remove","div","closest","hasAttribute","dt","clearBtn","title","ariaLabel","tabIndex","addEventListener","event","previousValue","value","focus","lastClearFieldPressed","target","lastFocusedInput","test","match","style","display","e","files","length","showBtn","textarea","shiftCloseBtn","marginRight","clientHeight","scrollHeight","newNode","referenceNode","nextSibling","insertBefore","appendChild","ctrlKey","metaKey","key","shiftKey","name","redoValue","semanticFormsObserver","mutations","stop","mutation","node","addedNodes","semanticForms","observe","attributes","childList","characterData","subtree","reinitialize","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/******/var __webpack_modules__={
|
|
2
|
+
/***/"./semanticForms.js":
|
|
3
|
+
/*!**************************!*\
|
|
4
|
+
!*** ./semanticForms.js ***!
|
|
5
|
+
\**************************/
|
|
6
|
+
/***/module=>{module.exports=()=>{
|
|
7
|
+
// do some feature detection so none of the JS executes if the browser is too old
|
|
8
|
+
if(typeof document.getElementsByClassName!=="function"||typeof document.querySelector!=="function"||!document.body.classList||!window.MutationObserver)return;const passwordShow='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m1 12s4-8 11-8 11 8 11 8"/><path d="m1 12s4 8 11 8 11-8 11-8"/><circle cx="12" cy="12" r="3"/></g></svg>';const passwordHide='<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m2 2 20 20"/><path d="m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335"/><path d="m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192"/></g></svg>';const nodeNameLookup=["TEXTAREA","SELECT"];const inputTypeLookup=["checkbox","color","date","datetime-local","email","file","image","month","number","password","radio","range","search","tel","text","time","url","week"];
|
|
9
|
+
// progressively enhance form elements that have the semanticForms class
|
|
10
|
+
const forms=document.querySelectorAll("form.semanticForms:not(.semanticFormsActive)");for(const form of forms){form.classList.add("semanticFormsActive");if(form.classList.contains("lowFlow"))continue;
|
|
11
|
+
// update each input in the semantic form
|
|
12
|
+
const inputs=Array.from(form.querySelectorAll("input, textarea, select"));for(const input of inputs){
|
|
13
|
+
// ignore input if it has previously been formatted
|
|
14
|
+
if(input.classList.contains("semanticform")||!input.id)continue;const type=input.getAttribute("type");if(nodeNameLookup.includes(input.nodeName)||inputTypeLookup.includes(type)){
|
|
15
|
+
// recursively find <dl> element
|
|
16
|
+
let dl=input.parentNode;while(dl&&dl.nodeName!=="DL")dl=dl.parentNode;if(!dl)continue;if(!dl.classList.contains("floatLabelForm"))dl.classList.add("floatLabelForm");const label=input.parentNode.parentNode.id&&(type==="checkbox"||type==="radio")?document.querySelector("label[data-for="+input.parentNode.parentNode.id.replace(/\./g,"\\.")+"]"):document.querySelector("label[for="+input.id.replace(/\./g,"\\.")+"]");input.classList.add("semanticform");
|
|
17
|
+
// #region create labels
|
|
18
|
+
if(type==="checkbox"||type==="radio"){
|
|
19
|
+
// recursively find <dd> element
|
|
20
|
+
let dd=input.parentNode;while(dd&&dd.nodeName!=="DD")dd=dd.parentNode;if(dd.firstChild.nodeName!=="LABEL"){const newLabel=document.createElement("label");newLabel.className="floatLabelFormAnimatedLabel";if(type==="checkbox"&&input.parentNode.nodeName==="DD"){newLabel.setAttribute("for",input.id);input.parentNode.classList.add("singleCheckbox");newLabel.className="";label.setAttribute("hidden","hidden");insertAfter(newLabel,input)}newLabel.innerHTML=label.innerHTML;if(dd.querySelector(":required")&&label.getAttribute("data-no-asterisk")===null&&!label.querySelector("span")){const text=label.getAttribute("data-asterisk-text")||"This field is required.";label.innerHTML+=`<span title="${text}">*</span>`}if(!dd.querySelector("label"))dd.append(newLabel)}
|
|
21
|
+
// removes old div that a radio or checkbox may have been added to
|
|
22
|
+
if(dd.parentElement.nodeName==="DIV")dd.parentElement.remove();const div=document.createElement("div");div.append(label.closest("dt"),dd);dl.append(div)}else{const newLabel=document.createElement("label");newLabel.setAttribute("for",input.id);newLabel.className="floatLabelFormAnimatedLabel";newLabel.innerHTML=label.innerHTML;if(input.hasAttribute("required")&&label.getAttribute("data-no-asterisk")===null&&!label.querySelector("span")){const text=label.getAttribute("data-asterisk-text")||"This field is required.";newLabel.innerHTML+=` <span title="${text}">*</span>`}label.setAttribute("hidden","hidden");insertAfter(newLabel,input)}
|
|
23
|
+
// #endregion
|
|
24
|
+
// standard inputs
|
|
25
|
+
if(type!=="checkbox"&&type!=="radio"){if(!input.getAttribute("placeholder"))input.setAttribute("placeholder"," ");const div=document.createElement("div");const dt=label.closest("dt");const dd=input.closest("dd");
|
|
26
|
+
// #region clear button
|
|
27
|
+
if(input.nodeName!=="SELECT"&&type!=="range"){const clearBtn=document.createElement("button");clearBtn.type="button";clearBtn.title=input.getAttribute("data-clear-field-text")||"Clear field";clearBtn.ariaLabel=input.getAttribute("data-clear-field-text")||"Clear field";clearBtn.tabIndex=-1;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" />';clearBtn.classList.add("clear");clearBtn.id=`semanticFormsClearButton_${input.id}`;clearBtn.addEventListener("click",(event=>{input.previousValue=input.value;input.value="";input.focus();lastClearFieldPressed=input.id}));insertAfter(clearBtn,dd.querySelector("label"))}input.addEventListener("focus",(event=>{if(event.target.nodeName==="INPUT")lastFocusedInput=event.target}));
|
|
28
|
+
// #endregion
|
|
29
|
+
// check for colspan- utility class
|
|
30
|
+
if(/colspan-/.test(dd.className)){const match=dd.className.match(/colspan-([0-9]|full)/)[0];dd.classList.remove(match);div.classList.add(match)}div.append(dt,dd);dl.append(div);
|
|
31
|
+
// determine visibility of newly created <div>
|
|
32
|
+
if(dt.style.display==="none"&&dd.style.display==="none")div.style.display="none"}
|
|
33
|
+
// handle file input clear btn, cannot be handled with CSS
|
|
34
|
+
if(type==="file"){const clearBtn=input.parentElement.querySelector(".clear");input.addEventListener("input",(e=>{clearBtn.style.display=e.target.files.length?"flex":"none"}));clearBtn.addEventListener("click",(()=>{clearBtn.style.display="none"}))}
|
|
35
|
+
// #region show password button
|
|
36
|
+
if(type==="password"&&input.getAttribute("data-no-reveal")===null){const showBtn=document.createElement("button");showBtn.type="button";showBtn.title=input.getAttribute("data-show-password-text")||"Show password";showBtn.ariaLabel=input.getAttribute("data-show-password-text")||"Show password";showBtn.tabIndex=-1;showBtn.innerHTML=passwordShow;showBtn.classList.add("show");showBtn.id=`semanticFormsShowButton_${input.id}`;const dd=input.closest("dd");showBtn.addEventListener("click",(event=>{if(input.type==="password"){showBtn.innerHTML=passwordHide;showBtn.title=input.getAttribute("data-hide-password-text")||"Hide password";showBtn.ariaLabel=input.getAttribute("data-hide-password-text")||"Hide password";input.type="text"}else{showBtn.innerHTML=passwordShow;showBtn.title=input.getAttribute("data-show-password-text")||"Show password";showBtn.ariaLabel=input.getAttribute("data-show-password-text")||"Show password";input.type="password"}input.focus()}));insertAfter(showBtn,dd.querySelector("label"))}
|
|
37
|
+
// #endregion
|
|
38
|
+
// add listener to shift clear button when scrollbar present
|
|
39
|
+
for(const textarea of document.querySelectorAll("textarea")){
|
|
40
|
+
// shifts the close button to the right if a scrollbar is present
|
|
41
|
+
const shiftCloseBtn=()=>{const clearBtn=textarea.parentElement?.querySelector("button.clear");if(clearBtn)clearBtn.style.marginRight=textarea.clientHeight<textarea.scrollHeight?"15px":""};textarea.addEventListener("input",shiftCloseBtn);textarea.addEventListener("mouseup",shiftCloseBtn)}}}}
|
|
42
|
+
/**
|
|
43
|
+
* Places an element immediately after another element
|
|
44
|
+
* @param {Object} newNode element being placed after the reference node
|
|
45
|
+
* @param {*} referenceNode element to be used as reference for new node
|
|
46
|
+
*/function insertAfter(newNode,referenceNode){if(referenceNode.nextSibling)referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);else referenceNode.parentNode.appendChild(newNode)}
|
|
47
|
+
// handle undo/redo
|
|
48
|
+
let lastFocusedInput;let lastClearFieldPressed;document.addEventListener("keydown",(event=>{if((event.ctrlKey||event.metaKey)&&event.key==="z"&&!event.shiftKey){
|
|
49
|
+
// undo clearing a field
|
|
50
|
+
if(lastFocusedInput)if(lastFocusedInput?.parentNode?.querySelector("button.clear").id===`semanticFormsClearButton_${lastClearFieldPressed}`||lastFocusedInput?.parentNode?.querySelector("button.clear").name===`semanticFormsClearButton_${lastClearFieldPressed}`)if(lastFocusedInput.previousValue){lastFocusedInput.redoValue=lastFocusedInput.value;lastFocusedInput.value=lastFocusedInput.previousValue}}else if(event.ctrlKey&&event.key==="y"||event.metaKey&&event.shiftKey&&event.key==="z")
|
|
51
|
+
// redo clearing a field
|
|
52
|
+
if(lastFocusedInput)if(lastFocusedInput?.parentNode?.querySelector("button.clear").id===`semanticFormsClearButton_${lastClearFieldPressed}`||lastFocusedInput?.parentNode?.querySelector("button.clear").name===`semanticFormsClearButton_${lastClearFieldPressed}`)if(lastFocusedInput.redoValue){lastFocusedInput.previousValue=lastFocusedInput.value;lastFocusedInput.value=lastFocusedInput.redoValue}}));
|
|
53
|
+
// monitor changes to the DOM and enhance new semanticForms forms that get added
|
|
54
|
+
if(!window.semanticFormsObserver){window.semanticFormsObserver=new window.MutationObserver((mutations=>{let stop=false;for(const mutation of mutations){for(const node of mutation.addedNodes)if(node.nodeName==="FORM"){window.semanticForms();stop=true}if(stop)break}}));window.semanticFormsObserver.observe(document.body,{attributes:false,childList:true,characterData:false,subtree:true})}window.semanticForms.reinitialize=form=>{form.classList.remove("semanticFormsActive");window.semanticForms()}}
|
|
55
|
+
/***/
|
|
56
|
+
/******/}};
|
|
57
|
+
/************************************************************************/
|
|
58
|
+
/******/ // The module cache
|
|
59
|
+
/******/var __webpack_module_cache__={};
|
|
60
|
+
/******/
|
|
61
|
+
/******/ // The require function
|
|
62
|
+
/******/function __webpack_require__(moduleId){
|
|
63
|
+
/******/ // Check if module is in cache
|
|
64
|
+
/******/var cachedModule=__webpack_module_cache__[moduleId];
|
|
65
|
+
/******/if(cachedModule!==void 0)
|
|
66
|
+
/******/return cachedModule.exports;
|
|
67
|
+
/******/
|
|
68
|
+
/******/ // Create a new module (and put it into the cache)
|
|
69
|
+
/******/var module=__webpack_module_cache__[moduleId]={
|
|
70
|
+
/******/ // no module.id needed
|
|
71
|
+
/******/ // no module.loaded needed
|
|
72
|
+
/******/exports:{}
|
|
73
|
+
/******/};
|
|
74
|
+
/******/
|
|
75
|
+
/******/ // Execute the module function
|
|
76
|
+
/******/__webpack_modules__[moduleId](module,module.exports,__webpack_require__);
|
|
77
|
+
/******/
|
|
78
|
+
/******/ // Return the exports of the module
|
|
79
|
+
/******/return module.exports;
|
|
80
|
+
/******/}
|
|
81
|
+
/******/
|
|
82
|
+
/************************************************************************/
|
|
83
|
+
/******/
|
|
84
|
+
/******/ // startup
|
|
85
|
+
/******/ // Load entry module and return exports
|
|
86
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
87
|
+
/******/__webpack_require__("./semanticForms.js");
|
|
88
|
+
/******/
|
|
89
|
+
//# sourceMappingURL=semantic-forms.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantic-forms.mjs","mappings":";;;;;cAAAA,OAAOC,QAAU;;AAEf,UAAWC,SAASC,yBAA2B,mBAAqBD,SAASE,gBAAkB,aAAeF,SAASG,KAAKC,YAAcC,OAAOC,iBAAkB,OAEnK,MAAMC,aAAe,8SACrB,MAAMC,aAAe,siBAErB,MAAMC,eAAiB,CAAC,WAAY,UACpC,MAAMC,gBAAkB,CAAC,WAAY,QAAS,OAAQ,iBAAkB,QAAS,OAAQ,QAAS,QAAS,SAAU,WAAY,QAAS,QAAS,SAAU,MAAO,OAAQ,OAAQ,MAAO;wEAG3L;MAAMC,MAAQX,SAASY,iBAAiB,gDAExC,IAAK,MAAMC,QAAQF,MAAO,CACxBE,KAAKT,UAAUU,IAAI,uBACnB,GAAID,KAAKT,UAAUW,SAAS,WAAY;yCAGxC;MAAMC,OAASC,MAAMC,KAAKL,KAAKD,iBAAiB,4BAChD,IAAK,MAAMO,SAASH,OAAQ;;AAE1B,GAAIG,MAAMf,UAAUW,SAAS,kBAAoBI,MAAMC,GAAI,SAE3D,MAAMC,KAAOF,MAAMG,aAAa,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,MAClDI,iBAAiBJ,MAAQI,iBAAiBwB,SAC5C,CAGN;gFAIF;IAAK3E,OAAO4E,sBAAuB,CACjC5E,OAAO4E,sBAAwB,IAAI5E,OAAOC,kBAAkB4E,YAC1D,IAAIC,KAAO,MACX,IAAK,MAAMC,YAAYF,UAAW,CAChC,IAAK,MAAMG,QAAQD,SAASE,WAC1B,GAAID,KAAK7D,WAAa,OAAQ,CAC5BnB,OAAOkF,gBACPJ,KAAO,IACT,CAEF,GAAIA,KAAM,KACZ,KAEF9E,OAAO4E,sBAAsBO,QAAQxF,SAASG,KAAM,CAAEsF,WAAY,MAAOC,UAAW,KAAMC,cAAe,MAAOC,QAAS,MAC3H,CAEAvF,OAAOkF,cAAcM,aAAgBhF,OACnCA,KAAKT,UAAUoC,OAAO,uBACtBnC,OAAOkF,eAAc,CACvB;;;;;QC1PF,IAAIO,yBAA2B,CAAC;;;QAGhC,SAASC,oBAAoBC;;QAE5B,IAAIC,aAAeH,yBAAyBE;QAC5C,GAAIC,oBAAiBC;QACpB,OAAOD,aAAalG;;;QAGrB,IAAID,OAASgG,yBAAyBE,UAAY;;;QAGjDjG,QAAS,CAAC;;;;QAIXoG,oBAAoBH,UAAUlG,OAAQA,OAAOC,QAASgG;;;QAGtD,OAAOjG,OAAOC;QACf;;;;;;;QCnB0BgG,oBAAoB","sources":["webpack://semantic-forms/./semanticForms.js","webpack://semantic-forms/webpack/bootstrap","webpack://semantic-forms/webpack/startup"],"sourcesContent":["module.exports = () => {\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) return\n\n const passwordShow = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m1 12s4-8 11-8 11 8 11 8\"/><path d=\"m1 12s4 8 11 8 11-8 11-8\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></g></svg>'\n const passwordHide = '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m2 2 20 20\"/><path d=\"m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335\"/><path d=\"m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192\"/></g></svg>'\n\n const nodeNameLookup = ['TEXTAREA', 'SELECT']\n const inputTypeLookup = ['checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'image', 'month', 'number', 'password', 'radio', 'range', 'search', 'tel', 'text', 'time', 'url', 'week']\n\n // progressively enhance form elements that have the semanticForms class\n const forms = document.querySelectorAll('form.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 // ignore input if it has previously been formatted\n if (input.classList.contains('semanticform') || !input.id) continue\n\n const type = input.getAttribute('type')\n if (nodeNameLookup.includes(input.nodeName) || inputTypeLookup.includes(type)) {\n // recursively find <dl> element\n let dl = input.parentNode\n while (dl && dl.nodeName !== 'DL') dl = dl.parentNode\n\n if (!dl) continue\n if (!dl.classList.contains('floatLabelForm')) dl.classList.add('floatLabelForm')\n\n const label = input.parentNode.parentNode.id && (type === 'checkbox' || type === 'radio')\n ? document.querySelector('label[data-for=' + input.parentNode.parentNode.id.replace(/\\./g, '\\\\.') + ']')\n : document.querySelector('label[for=' + input.id.replace(/\\./g, '\\\\.') + ']')\n\n input.classList.add('semanticform')\n\n // #region create labels\n if (type === 'checkbox' || type === 'radio') {\n // recursively find <dd> element\n let dd = input.parentNode\n while (dd && dd.nodeName !== 'DD') dd = dd.parentNode\n\n if (dd.firstChild.nodeName !== 'LABEL') {\n const newLabel = document.createElement('label')\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\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 newLabel.innerHTML = label.innerHTML\n\n if (dd.querySelector(':required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n label.innerHTML += `<span title=\"${text}\">*</span>`\n }\n\n if (!dd.querySelector('label')) dd.append(newLabel)\n }\n\n // removes old div that a radio or checkbox may have been added to\n if (dd.parentElement.nodeName === 'DIV') dd.parentElement.remove()\n\n const div = document.createElement('div')\n div.append(label.closest('dt'), dd)\n dl.append(div)\n } else {\n const newLabel = document.createElement('label')\n newLabel.setAttribute('for', input.id)\n newLabel.className = 'floatLabelFormAnimatedLabel'\n\n newLabel.innerHTML = label.innerHTML\n\n if (input.hasAttribute('required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span')) {\n const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n newLabel.innerHTML += ` <span title=\"${text}\">*</span>`\n }\n\n label.setAttribute('hidden', 'hidden')\n\n insertAfter(newLabel, input)\n }\n // #endregion\n\n // standard inputs\n if (type !== 'checkbox' && type !== 'radio') {\n if (!input.getAttribute('placeholder')) {\n input.setAttribute('placeholder', ' ')\n }\n\n const div = document.createElement('div')\n const dt = label.closest('dt')\n const dd = input.closest('dd')\n\n // #region 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', (event) => {\n input.previousValue = input.value\n input.value = ''\n input.focus()\n lastClearFieldPressed = input.id\n })\n insertAfter(clearBtn, dd.querySelector('label'))\n }\n input.addEventListener('focus', (event) => {\n if (event.target.nodeName === 'INPUT') lastFocusedInput = event.target\n })\n // #endregion\n\n // check for colspan- utility class\n if (/colspan-/.test(dd.className)) {\n const match = dd.className.match(/colspan-([0-9]|full)/)[0]\n dd.classList.remove(match)\n div.classList.add(match)\n }\n\n div.append(dt, dd)\n dl.append(div)\n\n // determine visibility of newly created <div>\n if (dt.style.display === 'none' && dd.style.display === 'none') div.style.display = 'none'\n }\n\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', e => {\n clearBtn.style.display = e.target.files.length ? 'flex' : 'none'\n })\n clearBtn.addEventListener('click', () => {\n clearBtn.style.display = 'none'\n })\n }\n\n // #region show password button\n if (type === 'password' && input.getAttribute('data-no-reveal') === null) {\n const showBtn = document.createElement('button')\n showBtn.type = 'button'\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.tabIndex = -1\n showBtn.innerHTML = passwordShow\n showBtn.classList.add('show')\n showBtn.id = `semanticFormsShowButton_${input.id}`\n const dd = input.closest('dd')\n showBtn.addEventListener('click', (event) => {\n if (input.type === 'password') {\n showBtn.innerHTML = passwordHide\n showBtn.title = input.getAttribute('data-hide-password-text') || 'Hide password'\n showBtn.ariaLabel = input.getAttribute('data-hide-password-text') || 'Hide password'\n input.type = 'text'\n } else {\n showBtn.innerHTML = passwordShow\n showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n input.type = 'password'\n }\n input.focus()\n })\n insertAfter(showBtn, dd.querySelector('label'))\n }\n // #endregion\n\n // add listener to shift clear button when scrollbar present\n for (const textarea of document.querySelectorAll('textarea')) {\n // shifts the close button to the right if a scrollbar is present\n const shiftCloseBtn = () => {\n const clearBtn = textarea.parentElement?.querySelector('button.clear')\n if (clearBtn) {\n clearBtn.style.marginRight = textarea.clientHeight < textarea.scrollHeight ? '15px' : ''\n }\n }\n\n textarea.addEventListener('input', shiftCloseBtn)\n textarea.addEventListener('mouseup', shiftCloseBtn)\n }\n }\n }\n }\n\n /**\n * Places an element immediately after another element\n * @param {Object} newNode element being placed after the reference node\n * @param {*} referenceNode element to be used as reference for new node\n */\n function insertAfter (newNode, referenceNode) {\n if (referenceNode.nextSibling) referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)\n else referenceNode.parentNode.appendChild(newNode)\n }\n\n // handle undo/redo\n let lastFocusedInput\n let lastClearFieldPressed\n document.addEventListener('keydown', (event) => {\n if ((event.ctrlKey || event.metaKey) && event.key === 'z' && !event.shiftKey) {\n // undo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.previousValue) {\n lastFocusedInput.redoValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.previousValue\n }\n }\n }\n } else if ((event.ctrlKey && event.key === 'y') || (event.metaKey && event.shiftKey && event.key === 'z')) {\n // redo clearing a field\n if (lastFocusedInput) {\n if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n if (lastFocusedInput.redoValue) {\n lastFocusedInput.previousValue = lastFocusedInput.value\n lastFocusedInput.value = lastFocusedInput.redoValue\n }\n }\n }\n }\n })\n\n // monitor changes to the DOM and enhance new semanticForms forms that get added\n if (!window.semanticFormsObserver) {\n window.semanticFormsObserver = new window.MutationObserver((mutations) => {\n let stop = false\n for (const mutation of mutations) {\n for (const node of mutation.addedNodes) {\n if (node.nodeName === 'FORM') {\n window.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 window.semanticForms.reinitialize = (form) => {\n form.classList.remove('semanticFormsActive')\n window.semanticForms()\n }\n}\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__(\"./semanticForms.js\");\n"],"names":["module","exports","document","getElementsByClassName","querySelector","body","classList","window","MutationObserver","passwordShow","passwordHide","nodeNameLookup","inputTypeLookup","forms","querySelectorAll","form","add","contains","inputs","Array","from","input","id","type","getAttribute","includes","nodeName","dl","parentNode","label","replace","dd","firstChild","newLabel","createElement","className","setAttribute","insertAfter","innerHTML","text","append","parentElement","remove","div","closest","hasAttribute","dt","clearBtn","title","ariaLabel","tabIndex","addEventListener","event","previousValue","value","focus","lastClearFieldPressed","target","lastFocusedInput","test","match","style","display","e","files","length","showBtn","textarea","shiftCloseBtn","marginRight","clientHeight","scrollHeight","newNode","referenceNode","nextSibling","insertBefore","appendChild","ctrlKey","metaKey","key","shiftKey","name","redoValue","semanticFormsObserver","mutations","stop","mutation","node","addedNodes","semanticForms","observe","attributes","childList","characterData","subtree","reinitialize","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
"url": "https://github.com/rooseveltframework/semantic-forms/graphs/contributors"
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
|
-
"version": "
|
|
11
|
+
"version": "5.0.0",
|
|
12
12
|
"files": [
|
|
13
|
-
"
|
|
14
|
-
"semanticForms.js",
|
|
13
|
+
"dist",
|
|
15
14
|
"semanticForms.scss"
|
|
16
15
|
],
|
|
17
16
|
"homepage": "https://github.com/rooseveltframework/semantic-forms",
|
|
@@ -19,23 +18,33 @@
|
|
|
19
18
|
"main": "semanticForms.js",
|
|
20
19
|
"readmeFilename": "README.md",
|
|
21
20
|
"devDependencies": {
|
|
22
|
-
"
|
|
21
|
+
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
|
|
22
|
+
"@playwright/test": "1.50.1",
|
|
23
|
+
"eslint": "9.21.0",
|
|
23
24
|
"eslint-plugin-html": "8.1.2",
|
|
25
|
+
"express": "4.21.2",
|
|
24
26
|
"nodemon": "3.1.9",
|
|
25
|
-
"
|
|
27
|
+
"nyc": "17.1.0",
|
|
28
|
+
"sass": "1.85.1",
|
|
26
29
|
"serve": "14.2.4",
|
|
27
|
-
"standard": "17.1.2"
|
|
30
|
+
"standard": "17.1.2",
|
|
31
|
+
"webpack-cli": "6.0.1"
|
|
28
32
|
},
|
|
29
33
|
"scripts": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"lint": "standard && standard --plugin html *.html",
|
|
33
|
-
"lint-fix": "standard --fix && standard --plugin html *.html --fix",
|
|
34
|
+
"build": "webpack && sass semanticForms.scss dist/semantic-forms.css",
|
|
35
|
+
"watch": "webpack && sass --watch semanticForms.scss dist/semantic-forms.css",
|
|
34
36
|
"d": "nodemon --exec \"npm run build && serve\"",
|
|
35
37
|
"dev": "nodemon --exec \"npm run build && serve\"",
|
|
36
38
|
"development": "nodemon --exec \"npm run build && serve\"",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
+
"lint": "standard && standard --plugin html test/*.html",
|
|
40
|
+
"lint-fix": "standard --fix && standard --plugin html test/*.html --fix",
|
|
41
|
+
"test": "npm run build && playwright test",
|
|
42
|
+
"coverage": "npm run build && nyc playwright test"
|
|
43
|
+
},
|
|
44
|
+
"standard": {
|
|
45
|
+
"ignore": [
|
|
46
|
+
"dist/"
|
|
47
|
+
]
|
|
39
48
|
},
|
|
40
49
|
"repository": {
|
|
41
50
|
"type": "git",
|
package/semanticForms.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
module.exports = () => {
|
|
2
2
|
// do some feature detection so none of the JS executes if the browser is too old
|
|
3
3
|
if (typeof document.getElementsByClassName !== 'function' || typeof document.querySelector !== 'function' || !document.body.classList || !window.MutationObserver) return
|
|
4
4
|
|
|
5
|
+
const passwordShow = '<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m1 12s4-8 11-8 11 8 11 8"/><path d="m1 12s4 8 11 8 11-8 11-8"/><circle cx="12" cy="12" r="3"/></g></svg>'
|
|
6
|
+
const passwordHide = '<svg fill="none" height="256" viewBox="0 0 24 24" width="256" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m2 2 20 20"/><path d="m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335"/><path d="m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192"/></g></svg>'
|
|
7
|
+
|
|
5
8
|
const nodeNameLookup = ['TEXTAREA', 'SELECT']
|
|
6
9
|
const inputTypeLookup = ['checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'image', 'month', 'number', 'password', 'radio', 'range', 'search', 'tel', 'text', 'time', 'url', 'week']
|
|
7
10
|
|
|
@@ -99,16 +102,23 @@ window.semanticForms = () => {
|
|
|
99
102
|
if (input.nodeName !== 'SELECT' && type !== 'range') {
|
|
100
103
|
const clearBtn = document.createElement('button')
|
|
101
104
|
clearBtn.type = 'button'
|
|
102
|
-
clearBtn.
|
|
105
|
+
clearBtn.title = input.getAttribute('data-clear-field-text') || 'Clear field'
|
|
106
|
+
clearBtn.ariaLabel = input.getAttribute('data-clear-field-text') || 'Clear field'
|
|
103
107
|
clearBtn.tabIndex = -1
|
|
104
108
|
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" />'
|
|
105
109
|
clearBtn.classList.add('clear')
|
|
106
|
-
clearBtn.
|
|
110
|
+
clearBtn.id = `semanticFormsClearButton_${input.id}`
|
|
111
|
+
clearBtn.addEventListener('click', (event) => {
|
|
112
|
+
input.previousValue = input.value
|
|
107
113
|
input.value = ''
|
|
108
114
|
input.focus()
|
|
115
|
+
lastClearFieldPressed = input.id
|
|
109
116
|
})
|
|
110
117
|
insertAfter(clearBtn, dd.querySelector('label'))
|
|
111
118
|
}
|
|
119
|
+
input.addEventListener('focus', (event) => {
|
|
120
|
+
if (event.target.nodeName === 'INPUT') lastFocusedInput = event.target
|
|
121
|
+
})
|
|
112
122
|
// #endregion
|
|
113
123
|
|
|
114
124
|
// check for colspan- utility class
|
|
@@ -136,6 +146,35 @@ window.semanticForms = () => {
|
|
|
136
146
|
})
|
|
137
147
|
}
|
|
138
148
|
|
|
149
|
+
// #region show password button
|
|
150
|
+
if (type === 'password' && input.getAttribute('data-no-reveal') === null) {
|
|
151
|
+
const showBtn = document.createElement('button')
|
|
152
|
+
showBtn.type = 'button'
|
|
153
|
+
showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'
|
|
154
|
+
showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'
|
|
155
|
+
showBtn.tabIndex = -1
|
|
156
|
+
showBtn.innerHTML = passwordShow
|
|
157
|
+
showBtn.classList.add('show')
|
|
158
|
+
showBtn.id = `semanticFormsShowButton_${input.id}`
|
|
159
|
+
const dd = input.closest('dd')
|
|
160
|
+
showBtn.addEventListener('click', (event) => {
|
|
161
|
+
if (input.type === 'password') {
|
|
162
|
+
showBtn.innerHTML = passwordHide
|
|
163
|
+
showBtn.title = input.getAttribute('data-hide-password-text') || 'Hide password'
|
|
164
|
+
showBtn.ariaLabel = input.getAttribute('data-hide-password-text') || 'Hide password'
|
|
165
|
+
input.type = 'text'
|
|
166
|
+
} else {
|
|
167
|
+
showBtn.innerHTML = passwordShow
|
|
168
|
+
showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'
|
|
169
|
+
showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'
|
|
170
|
+
input.type = 'password'
|
|
171
|
+
}
|
|
172
|
+
input.focus()
|
|
173
|
+
})
|
|
174
|
+
insertAfter(showBtn, dd.querySelector('label'))
|
|
175
|
+
}
|
|
176
|
+
// #endregion
|
|
177
|
+
|
|
139
178
|
// add listener to shift clear button when scrollbar present
|
|
140
179
|
for (const textarea of document.querySelectorAll('textarea')) {
|
|
141
180
|
// shifts the close button to the right if a scrollbar is present
|
|
@@ -163,6 +202,33 @@ window.semanticForms = () => {
|
|
|
163
202
|
else referenceNode.parentNode.appendChild(newNode)
|
|
164
203
|
}
|
|
165
204
|
|
|
205
|
+
// handle undo/redo
|
|
206
|
+
let lastFocusedInput
|
|
207
|
+
let lastClearFieldPressed
|
|
208
|
+
document.addEventListener('keydown', (event) => {
|
|
209
|
+
if ((event.ctrlKey || event.metaKey) && event.key === 'z' && !event.shiftKey) {
|
|
210
|
+
// undo clearing a field
|
|
211
|
+
if (lastFocusedInput) {
|
|
212
|
+
if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {
|
|
213
|
+
if (lastFocusedInput.previousValue) {
|
|
214
|
+
lastFocusedInput.redoValue = lastFocusedInput.value
|
|
215
|
+
lastFocusedInput.value = lastFocusedInput.previousValue
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
} else if ((event.ctrlKey && event.key === 'y') || (event.metaKey && event.shiftKey && event.key === 'z')) {
|
|
220
|
+
// redo clearing a field
|
|
221
|
+
if (lastFocusedInput) {
|
|
222
|
+
if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {
|
|
223
|
+
if (lastFocusedInput.redoValue) {
|
|
224
|
+
lastFocusedInput.previousValue = lastFocusedInput.value
|
|
225
|
+
lastFocusedInput.value = lastFocusedInput.redoValue
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
})
|
|
231
|
+
|
|
166
232
|
// monitor changes to the DOM and enhance new semanticForms forms that get added
|
|
167
233
|
if (!window.semanticFormsObserver) {
|
|
168
234
|
window.semanticFormsObserver = new window.MutationObserver((mutations) => {
|
|
@@ -179,9 +245,9 @@ window.semanticForms = () => {
|
|
|
179
245
|
})
|
|
180
246
|
window.semanticFormsObserver.observe(document.body, { attributes: false, childList: true, characterData: false, subtree: true })
|
|
181
247
|
}
|
|
182
|
-
}
|
|
183
248
|
|
|
184
|
-
window.semanticForms.reinitialize = (form) => {
|
|
185
|
-
|
|
186
|
-
|
|
249
|
+
window.semanticForms.reinitialize = (form) => {
|
|
250
|
+
form.classList.remove('semanticFormsActive')
|
|
251
|
+
window.semanticForms()
|
|
252
|
+
}
|
|
187
253
|
}
|
package/semanticForms.scss
CHANGED
|
@@ -201,6 +201,10 @@ form.semanticForms {
|
|
|
201
201
|
padding: 6px 30px 6px 20px;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
+
&[type="password"], &[type="text"]:has(~ button.show) {
|
|
205
|
+
padding: 6px 55px 6px 20px;
|
|
206
|
+
}
|
|
207
|
+
|
|
204
208
|
&[disabled] {
|
|
205
209
|
cursor: not-allowed;
|
|
206
210
|
opacity: 0.5;
|
|
@@ -243,7 +247,7 @@ form.semanticForms {
|
|
|
243
247
|
// 30% larger based on parent font size
|
|
244
248
|
width: 1.4em;
|
|
245
249
|
height: 1.4em;
|
|
246
|
-
margin:
|
|
250
|
+
margin: 3px 0;
|
|
247
251
|
cursor: pointer;
|
|
248
252
|
|
|
249
253
|
& ~ label:first-of-type {
|
|
@@ -277,7 +281,7 @@ form.semanticForms {
|
|
|
277
281
|
// #endregion
|
|
278
282
|
|
|
279
283
|
// #region buttons
|
|
280
|
-
button.clear {
|
|
284
|
+
button.clear, button.show {
|
|
281
285
|
cursor: pointer;
|
|
282
286
|
appearance: none;
|
|
283
287
|
-webkit-appearance: none;
|
|
@@ -298,13 +302,18 @@ form.semanticForms {
|
|
|
298
302
|
justify-content: center;
|
|
299
303
|
}
|
|
300
304
|
|
|
305
|
+
button.show {
|
|
306
|
+
right: 25px;
|
|
307
|
+
}
|
|
308
|
+
|
|
301
309
|
// custom styling of clear button on textarea
|
|
302
310
|
textarea ~ .clear {
|
|
303
311
|
bottom: auto;
|
|
304
312
|
}
|
|
305
313
|
|
|
306
|
-
// hide clear button while placeholder text is visible
|
|
314
|
+
// hide clear/show button while placeholder text is visible
|
|
307
315
|
input:placeholder-shown ~ .clear,
|
|
316
|
+
input:placeholder-shown ~ .show,
|
|
308
317
|
textarea:placeholder-shown ~ .clear,
|
|
309
318
|
input[type=file] ~ .clear {
|
|
310
319
|
display: none;
|
|
@@ -313,7 +322,7 @@ form.semanticForms {
|
|
|
313
322
|
// button styling
|
|
314
323
|
input[type='submit'],
|
|
315
324
|
input[type='reset'],
|
|
316
|
-
button:not(.clear) {
|
|
325
|
+
button:not(.clear):not(.show) {
|
|
317
326
|
appearance: none;
|
|
318
327
|
-moz-appearance: none;
|
|
319
328
|
-webkit-appearance: none;
|
|
@@ -335,7 +344,7 @@ form.semanticForms {
|
|
|
335
344
|
input[type='submit'],
|
|
336
345
|
input[type='reset'],
|
|
337
346
|
input[type='image'],
|
|
338
|
-
button:not(.clear) {
|
|
347
|
+
button:not(.clear):not(.show) {
|
|
339
348
|
transition: filter 0.1s;
|
|
340
349
|
|
|
341
350
|
&:hover {
|