bootstrap-italia 2.9.0 → 2.9.1
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/dist/css/bootstrap-italia.min.css +1 -1
- package/dist/css/bootstrap-italia.min.css.map +1 -1
- package/dist/js/bootstrap-italia.bundle.min.js +3 -3
- package/dist/js/bootstrap-italia.min.js +3 -3
- package/dist/plugins/form-validate.js +7 -2
- package/dist/plugins/form-validate.js.map +1 -1
- package/dist/plugins/select-autocomplete.js +19 -0
- package/dist/plugins/select-autocomplete.js.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/src/js/plugins/form-validate.js +7 -2
- package/src/js/plugins/select-autocomplete.js +19 -0
- package/src/js/version.js +1 -1
- package/src/scss/bootstrap-italia.scss +0 -1
- package/src/scss/custom/_alert.scss +3 -7
- package/src/scss/custom/_version.scss +1 -1
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
const DATA_MOUSE_FOCUS="data-focus-mouse";class TrackFocus{constructor(){this._usingMouse=!1,this._bindEvents();}_bindEvents(){if("undefined"==typeof document)return;["keydown","mousedown"].forEach((t=>{document.addEventListener(t,(t=>{this._usingMouse="mousedown"===t.type;}));})),document.addEventListener("focusin",(t=>{this._usingMouse&&t.target&&(t.target.classList.add("focus--mouse"),t.target.setAttribute(DATA_MOUSE_FOCUS,!0));})),document.addEventListener("focusout",(t=>{t.target&&(t.target.classList.remove("focus--mouse"),t.target.setAttribute(DATA_MOUSE_FOCUS,!1));}));}}new TrackFocus;const TrackFocus$1 = TrackFocus;
|
|
22
22
|
|
|
23
|
-
const BOOTSTRAP_ITALIA_VERSION = "2.9.
|
|
23
|
+
const BOOTSTRAP_ITALIA_VERSION = "2.9.1";
|
|
24
24
|
|
|
25
25
|
const init=()=>{"undefined"==typeof window||window.BOOTSTRAP_ITALIA_VERSION||(new TrackFocus$1,window.BOOTSTRAP_ITALIA_VERSION=BOOTSTRAP_ITALIA_VERSION);};const init$1 = init;init();
|
|
26
26
|
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
|
|
104
104
|
class CssClassObserver{constructor(t,e,s,a,l){this.targetNode=t,this.classToWatch=e,this.classAddedCallback=s,this.classRemovedCallback=a,this.observer=null,this.lastClassState=t.classList.contains(this.classToWatch),this.ignoreToggle=!!l,this.init();}init(){this.observer=new MutationObserver((t=>this.mutationCallback(t))),this.observe();}observe(){this.observer.observe(this.targetNode,{attributes:!0});}disconnect(){this.observer.disconnect();}mutationCallback(t){for(let e of t)if("attributes"===e.type&&"class"===e.attributeName){let t=e.target.classList.contains(this.classToWatch);(this.ignoreToggle||this.lastClassState!==t)&&(this.lastClassState=t,t?"function"==typeof this.classAddedCallback&&this.classAddedCallback():"function"==typeof this.classRemovedCallback&&this.classRemovedCallback());}}}class ContentObserver{constructor(t,e,s,a){this.targetNode=t,this.contentSelector=e,this.contentAddedCallback=s,this.contentRemovedCallback=a,this.observer=null,this.init();}init(){this.observer=new MutationObserver((t=>this.mutationCallback(t))),this.observe();}observe(){this.observer.observe(this.targetNode,{childList:!0,subtree:!0});}disconnect(){this.observer.disconnect();}mutationCallback(t){for(let e of t)"childList"===e.type&&(e.addedNodes.forEach((t=>{this._callbackExec(t);})),e.removedNodes.forEach((t=>{this._callbackExec(t,!0);})));}_callbackExec(t,e){const s=t.matches&&t.matches(this.contentSelector)?[t]:t.querySelectorAll?t.querySelectorAll(this.contentSelector):null,a=e&&"function"==typeof this.contentRemovedCallback?this.contentRemovedCallback:"function"==typeof this.contentAddedCallback?this.contentAddedCallback:null;s&&a&&s.forEach((t=>a(t)));}}
|
|
105
105
|
|
|
106
|
-
const CONFIG_DEFAULT={errorFieldCssClass:"is-invalid",errorLabelCssClass:"just-validate-error-label"},NAME$u="justvalidatebi",CLASS_NAME_SRONLY="sr-only-justvalidate-bi",SELECTOR_SPAN_SRONLY=`.${CLASS_NAME_SRONLY}`;class FormValidate{constructor(e,t){return this.formSelector=e,this.target=document.querySelector(e),this.validate=new JustValidate(e,t),this.config=Object.assign({},CONFIG_DEFAULT,this.validate.globalConfig),this.formItems=[],this.init(),this.validate}init(){this.target.querySelectorAll("input, select").forEach((e=>{const t=new CssClassObserver(e,this.config.errorFieldCssClass,(()=>this.onInputError(e)),(()=>this.onInputErrorRemove(e)),!0);e.id||e.setAttribute("id",NAME$u+"-input-"+Math.random()),this.formItems.push({item:e,watcher:t});}));this.target.querySelectorAll("fieldset").forEach((e=>{if(e.querySelectorAll("input[type=radio],input[type=checkbox]").length>0){const t=new ContentObserver(e,"."+this.config.errorLabelCssClass,(()=>this.onFieldsetError(e)),(()=>this.onFieldsetErrorRemove(e)));e.id||e.setAttribute("id",NAME$u+"-fieldset-"+Math.random()),this.formItems.push({item:e,watcher:t});}}));}onInputError(e){const t=this.getErrorMessages(e),r=[];t.forEach(((t,s)=>{const i=e.id+"-error-"+s;t.setAttribute("id",i),r.push(i);})),r.length>0&&(e.setAttribute("aria-describedby",r.join(" ")),e.setAttribute("aria-invalid","true"));}onInputErrorRemove(e){e.removeAttribute("aria-describedby"),e.setAttribute("aria-invalid","false");}onFieldsetError(e){const t=this.getErrorMessages(e),r=[],s=[];if(t.forEach(((t,i)=>{const o=e.id+"-error-"+i;t.setAttribute("id",o),r.push(o),s.push(t.textContent);})),r.length>0){const t=e.querySelector("legend");t&&(t.setAttribute("aria-describedby",r.join(" ")),t.setAttribute("aria-invalid","true"));}}onFieldsetErrorRemove(e){const t=e.querySelector("legend");if(t){t.removeAttribute("aria-describedby"),t.setAttribute("aria-invalid","false");const e=t.querySelector(SELECTOR_SPAN_SRONLY);e&&e.remove();}}getErrorMessages(e){let t=e,r=t.querySelectorAll("."+this.config.errorLabelCssClass);for(;null!=t&&0===r.length;)t=t.parentNode,r=t.querySelectorAll("."+this.config.errorLabelCssClass);return r}}const ValidatorSelectAutocomplete=(e,t={})=>(r,s)=>{let i=!1;const o=s[e];if(!o)throw new Error("ValidatorSelectAutocomplete: "+e+" not found as form field");return t.required||r?document.querySelector("#"+o.elem.id+"-select").querySelectorAll("option").forEach((e=>{e.text===r&&(i=!0);})):i=!0,i};
|
|
106
|
+
const CONFIG_DEFAULT={errorFieldCssClass:"is-invalid",errorLabelCssClass:"just-validate-error-label"},NAME$u="justvalidatebi",CLASS_NAME_SRONLY="sr-only-justvalidate-bi",SELECTOR_SPAN_SRONLY=`.${CLASS_NAME_SRONLY}`;class FormValidate{constructor(e,t,r){return this.formSelector=e,this.target=document.querySelector(e),this.validate=null!=r?new JustValidate(e,t,r):new JustValidate(e,t),this.config=Object.assign({},CONFIG_DEFAULT,this.validate.globalConfig),this.formItems=[],this.init(),this.validate}init(){this.target.querySelectorAll("input, select").forEach((e=>{const t=new CssClassObserver(e,this.config.errorFieldCssClass,(()=>this.onInputError(e)),(()=>this.onInputErrorRemove(e)),!0);e.id||e.setAttribute("id",NAME$u+"-input-"+Math.random()),this.formItems.push({item:e,watcher:t});}));this.target.querySelectorAll("fieldset").forEach((e=>{if(e.querySelectorAll("input[type=radio],input[type=checkbox]").length>0){const t=new ContentObserver(e,"."+this.config.errorLabelCssClass,(()=>this.onFieldsetError(e)),(()=>this.onFieldsetErrorRemove(e)));e.id||e.setAttribute("id",NAME$u+"-fieldset-"+Math.random()),this.formItems.push({item:e,watcher:t});}}));}onInputError(e){const t=this.getErrorMessages(e),r=[];t.forEach(((t,s)=>{const i=e.id+"-error-"+s;t.setAttribute("id",i),r.push(i);})),r.length>0&&(e.setAttribute("aria-describedby",r.join(" ")),e.setAttribute("aria-invalid","true"));}onInputErrorRemove(e){e.removeAttribute("aria-describedby"),e.setAttribute("aria-invalid","false");}onFieldsetError(e){const t=this.getErrorMessages(e),r=[],s=[];if(t.forEach(((t,i)=>{const o=e.id+"-error-"+i;t.setAttribute("id",o),r.push(o),s.push(t.textContent);})),r.length>0){const t=e.querySelector("legend");t&&(t.setAttribute("aria-describedby",r.join(" ")),t.setAttribute("aria-invalid","true"));}}onFieldsetErrorRemove(e){const t=e.querySelector("legend");if(t){t.removeAttribute("aria-describedby"),t.setAttribute("aria-invalid","false");const e=t.querySelector(SELECTOR_SPAN_SRONLY);e&&e.remove();}}getErrorMessages(e){let t=e,r=t.querySelectorAll("."+this.config.errorLabelCssClass);for(;null!=t&&0===r.length;)t=t.parentNode,r=t.querySelectorAll("."+this.config.errorLabelCssClass);return r}}const ValidatorSelectAutocomplete=(e,t={})=>(r,s)=>{let i=!1;const o=s[e];if(!o)throw new Error("ValidatorSelectAutocomplete: "+e+" not found as form field");return t.required||r?document.querySelector("#"+o.elem.id+"-select").querySelectorAll("option").forEach((e=>{e.text===r&&(i=!0);})):i=!0,i};
|
|
107
107
|
|
|
108
108
|
const NAME$t="input",EVENT_CHANGE="change.bs.input";class Input extends BaseComponent{constructor(e){super(e),this._label=new InputLabel$1(e),this._bindEvents();}static get NAME(){return NAME$t}_bindEvents(){"file"===this._element.getAttribute("type")&&EventHandler$1.on(this._element,EVENT_CHANGE,(()=>{this._handleFileDescription();}));}_handleFileDescription(){const e=[];let t="";Array.from(this._element.files).forEach((t=>{const n=Math.round(parseInt(t.size,10)/1024);e.push(t.name+" ("+n+"kb)");})),this._element.files.length>1&&(t=this._element.files.length+" file da caricare: ");const n=SelectorEngine$1.findOne('label[for="'+this._element.getAttribute("id")+'"] label.form-file-name',this._element);n&&(n.innerText=t+e.join("; "));}}const excludes=["select",'input[data-bs-input][type="password"]',"input.input-password[data-bs-input]",'input[data-bs-autocomplete][type="search"]','input[type="time"]','input[type="radio"]','input[type="checkbox"]'],createInput$2=e=>{const t=!!excludes.find((t=>e.matches(t))),n=!("number"!==e.getAttribute("type")||!e.parentNode.querySelector('button[class^="input-number-"]'));return t||n?null:Input.getOrCreateInstance(e)};"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll("input, textarea, label").forEach((function(e){const t=InputLabel$1.getInputFromLabel(e)||e;createInput$2(t);}));}));const Input$1 = Input;
|
|
109
109
|
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
|
|
124
124
|
var accessibleAutocomplete_min=createCommonjsModule((function(e,t){var n;n=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r});},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=37)}([function(e,t,n){var r=n(1),o=n(6),i=n(7),u=n(16),a=n(18),s="prototype",l=function(e,t,n){var c,p,f,d,h=e&l.F,v=e&l.G,m=e&l.S,y=e&l.P,_=e&l.B,g=v?r:m?r[t]||(r[t]={}):(r[t]||{})[s],b=v?o:o[t]||(o[t]={}),w=b[s]||(b[s]={});for(c in v&&(n=t),n)f=((p=!h&&g&&void 0!==g[c])?g:n)[c],d=_&&p?a(f,r):y&&"function"==typeof f?a(Function.call,f):f,g&&u(g,c,f,e&l.U),b[c]!=f&&i(b,c,d),y&&w[c]!=f&&(w[c]=f);};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l;},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n);},function(e,t){e.exports=function(e){return "object"==typeof e?null!==e:"function"==typeof e};},function(e,t,n){e.exports=!n(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}));},function(e,t){e.exports=function(e){try{return !!e()}catch(e){return !0}};},function(e,t,n){n.r(t),n.d(t,"h",(function(){return a})),n.d(t,"createElement",(function(){return a})),n.d(t,"cloneElement",(function(){return c})),n.d(t,"Component",(function(){return L})),n.d(t,"render",(function(){return T})),n.d(t,"rerender",(function(){return h})),n.d(t,"options",(function(){return o}));var r=function(){},o={},i=[],u=[];function a(e,t){var n,a,s,l,c=u;for(l=arguments.length;2<l--;)i.push(arguments[l]);for(t&&null!=t.children&&(i.length||i.push(t.children),delete t.children);i.length;)if((a=i.pop())&&void 0!==a.pop)for(l=a.length;l--;)i.push(a[l]);else "boolean"==typeof a&&(a=null),(s="function"!=typeof e)&&(null==a?a="":"number"==typeof a?a=String(a):"string"!=typeof a&&(s=!1)),s&&n?c[c.length-1]+=a:c===u?c=[a]:c.push(a),n=s;var p=new r;return p.nodeName=e,p.children=c,p.attributes=null==t?void 0:t,p.key=null==t?void 0:t.key,void 0!==o.vnode&&o.vnode(p),p}function s(e,t){for(var n in t)e[n]=t[n];return e}var l="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function c(e,t){return a(e.nodeName,s(s({},e.attributes),t),2<arguments.length?[].slice.call(arguments,2):e.children)}var p=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,f=[];function d(e){!e._dirty&&(e._dirty=!0)&&1==f.push(e)&&(o.debounceRendering||l)(h);}function h(){var e,t=f;for(f=[];e=t.pop();)e._dirty&&j(e);}function v(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function m(e){var t=s({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function y(e){var t=e.parentNode;t&&t.removeChild(e);}function _(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===p.test(i)?r[i]+"px":r[i];}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var u=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,g,u):e.removeEventListener(t,g,u),(e._listeners||(e._listeners={}))[t]=r;}else if("list"!==t&&"type"!==t&&!o&&t in e){try{e[t]=null==r?"":r;}catch(e){}null!=r&&!1!==r||"spellcheck"==t||e.removeAttribute(t);}else {var a=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r));}else e.className=r||"";}function g(e){return this._listeners[e.type](o.event&&o.event(e)||e)}var b=[],w=0,x=!1,O=!1;function C(){for(var e;e=b.pop();)o.afterMount&&o.afterMount(e),e.componentDidMount&&e.componentDidMount();}function S(e,t,n,r,o){var i=e,u=x;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||o)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),E(e,!0))),i.__preactattr_=!0,i;var a=t.nodeName;if("function"==typeof a)return function(e,t,n,r){for(var o=e&&e._component,i=o,u=e,a=o&&e._componentConstructor===t.nodeName,s=a,l=m(t);o&&!s&&(o=o._parentComponent);)s=o.constructor===t.nodeName;return o&&s&&(!r||o._component)?(k(o,l,3,n,r),e=o.base):(i&&!a&&(P(i),e=u=null),o=I(t.nodeName,l,n),e&&!o.nextBase&&(o.nextBase=e,u=null),k(o,l,1,n,r),e=o.base,u&&e!==u&&(u._component=null,E(u,!1))),e}(e,t,n,r);if(x="svg"===a||"foreignObject"!==a&&x,a=String(a),(!e||!v(e,a))&&(i=function(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.normalizedNodeName=e,n}(a,x),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),E(e,!0);}var s=i.firstChild,l=i.__preactattr_,c=t.children;if(null==l){l=i.__preactattr_={};for(var p=i.attributes,f=p.length;f--;)l[p[f].name]=p[f].value;}return !O&&c&&1===c.length&&"string"==typeof c[0]&&null!=s&&void 0!==s.splitText&&null==s.nextSibling?s.nodeValue!=c[0]&&(s.nodeValue=c[0]):(c&&c.length||null!=s)&&function(e,t,n,r,o){var i,u,a,s,l,c,p,f,d=e.childNodes,h=[],m={},_=0,g=0,b=d.length,w=0,x=t?t.length:0;if(0!==b)for(var O=0;O<b;O++){var C=d[O],M=C.__preactattr_;null!=(N=x&&M?C._component?C._component.__key:M.key:null)?(_++,m[N]=C):(M||(void 0!==C.splitText?!o||C.nodeValue.trim():o))&&(h[w++]=C);}if(0!==x)for(O=0;O<x;O++){var N;if(l=null,null!=(N=(s=t[O]).key))_&&void 0!==m[N]&&(l=m[N],m[N]=void 0,_--);else if(g<w)for(i=g;i<w;i++)if(void 0!==h[i]&&(c=u=h[i],f=o,"string"==typeof(p=s)||"number"==typeof p?void 0!==c.splitText:"string"==typeof p.nodeName?!c._componentConstructor&&v(c,p.nodeName):f||c._componentConstructor===p.nodeName)){l=u,h[i]=void 0,i===w-1&&w--,i===g&&g++;break}l=S(l,s,n,r),a=d[O],l&&l!==e&&l!==a&&(null==a?e.appendChild(l):l===a.nextSibling?y(a):e.insertBefore(l,a));}if(_)for(var O in m)void 0!==m[O]&&E(m[O],!1);for(;g<=w;)void 0!==(l=h[w--])&&E(l,!1);}(i,c,n,r,O||null!=l.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||_(e,r,n[r],n[r]=void 0,x);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||_(e,r,n[r],n[r]=t[r],x);}(i,t.attributes,l),x=u,i}function E(e,t){var n=e._component;n?P(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||y(e),M(e));}function M(e){for(e=e.lastChild;e;){var t=e.previousSibling;E(e,!0),e=t;}}var N=[];function I(e,t,n){var r,o=N.length;for(e.prototype&&e.prototype.render?(r=new e(t,n),L.call(r,t,n)):((r=new L(t,n)).constructor=e,r.render=A);o--;)if(N[o].constructor===e)return r.nextBase=N[o].nextBase,N.splice(o,1),r;return r}function A(e,t,n){return this.constructor(e,n)}function k(e,t,n,r,i){e._disable||(e._disable=!0,e.__ref=t.ref,e.__key=t.key,delete t.ref,delete t.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,r)),r&&r!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=r),e.prevProps||(e.prevProps=e.props),e.props=t,e._disable=!1,0!==n&&(1!==n&&!1===o.syncComponentUpdates&&e.base?d(e):j(e,1,i)),e.__ref&&e.__ref(e));}function j(e,t,n,r){if(!e._disable){var i,u,a,l=e.props,c=e.state,p=e.context,f=e.prevProps||l,d=e.prevState||c,h=e.prevContext||p,v=e.base,y=e.nextBase,_=v||y,g=e._component,M=!1,N=h;if(e.constructor.getDerivedStateFromProps&&(c=s(s({},c),e.constructor.getDerivedStateFromProps(l,c)),e.state=c),v&&(e.props=f,e.state=d,e.context=h,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(l,c,p)?M=!0:e.componentWillUpdate&&e.componentWillUpdate(l,c,p),e.props=l,e.state=c,e.context=p),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!M){i=e.render(l,c,p),e.getChildContext&&(p=s(s({},p),e.getChildContext())),v&&e.getSnapshotBeforeUpdate&&(N=e.getSnapshotBeforeUpdate(f,d));var A,L,T=i&&i.nodeName;if("function"==typeof T){var B=m(i);(u=g)&&u.constructor===T&&B.key==u.__key?k(u,B,1,p,!1):(A=u,e._component=u=I(T,B,p),u.nextBase=u.nextBase||y,u._parentComponent=e,k(u,B,0,p,!1),j(u,1,n,!0)),L=u.base;}else a=_,(A=g)&&(a=e._component=null),(_||1===t)&&(a&&(a._component=null),L=function(e,t,n,r,o,i){w++||(x=null!=o&&void 0!==o.ownerSVGElement,O=null!=e&&!("__preactattr_"in e));var u=S(e,t,n,r,i);return o&&u.parentNode!==o&&o.appendChild(u),--w||(O=!1,i||C()),u}(a,i,p,n||!v,_&&_.parentNode,!0));if(_&&L!==_&&u!==g){var D=_.parentNode;D&&L!==D&&(D.replaceChild(L,_),A||(_._component=null,E(_,!1)));}if(A&&P(A),(e.base=L)&&!r){for(var F=e,R=e;R=R._parentComponent;)(F=R).base=L;L._component=F,L._componentConstructor=F.constructor;}}for(!v||n?b.unshift(e):M||(e.componentDidUpdate&&e.componentDidUpdate(f,d,N),o.afterUpdate&&o.afterUpdate(e));e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);w||r||C();}}function P(e){o.beforeUnmount&&o.beforeUnmount(e);var t=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?P(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),y(e.nextBase=t),N.push(e),M(t)),e.__ref&&e.__ref(null);}function L(e,t){this._dirty=!0,this.context=t,this.props=e,this.state=this.state||{},this._renderCallbacks=[];}function T(e,t,n){return function(e,t,n,r,o,i){w++||(x=null!=o&&void 0!==o.ownerSVGElement,O=null!=e&&!("__preactattr_"in e));var u=S(e,t,n,r,i);return o&&u.parentNode!==o&&o.appendChild(u),--w||(O=!1,i||C()),u}(n,e,{},!1,t,!1)}s(L.prototype,{setState:function(e,t){this.prevState||(this.prevState=this.state),this.state=s(s({},this.state),"function"==typeof e?e(this.state,this.props):e),t&&this._renderCallbacks.push(t),d(this);},forceUpdate:function(e){e&&this._renderCallbacks.push(e),j(this,2);},render:function(){}});var B={h:a,createElement:a,cloneElement:c,Component:L,render:T,rerender:h,options:o};t.default=B;},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n);},function(e,t,n){var r=n(8),o=n(40);e.exports=n(3)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e};},function(e,t,n){var r=n(9),o=n(38),i=n(39),u=Object.defineProperty;t.f=n(3)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return u(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return "value"in n&&(e[t]=n.value),e};},function(e,t,n){var r=n(2);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e};},function(e,t){var n=0,r=Math.random();e.exports=function(e){return "Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))};},function(e,t,n){var r=n(22);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return "String"==r(e)?e.split(""):Object(e)};},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e};},function(e,t,n){var r=n(4);e.exports=function(e,t){return !!e&&r((function(){t?e.call(null,(function(){}),1):e.call(null);}))};},function(e,t,n){var r=n(0);r(r.S+r.F,"Object",{assign:n(41)});},function(e,t,n){var r=n(2),o=n(1).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}};},function(e,t,n){var r=n(1),o=n(7),i=n(17),u=n(10)("src"),a="toString",s=Function[a],l=(""+s).split(a);n(6).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,a){var s="function"==typeof n;s&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(s&&(i(n,u)||o(n,u,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=n:a?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)));})(Function.prototype,a,(function(){return "function"==typeof this&&this[u]||s.call(this)}));},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)};},function(e,t,n){var r=n(19);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}};},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e};},function(e,t,n){var r=n(42),o=n(28);e.exports=Object.keys||function(e){return r(e,o)};},function(e,t,n){var r=n(11),o=n(12);e.exports=function(e){return r(o(e))};},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)};},function(e,t,n){var r=n(21),o=n(24),i=n(43);e.exports=function(e){return function(t,n,u){var a,s=r(t),l=o(s.length),c=i(u,l);if(e&&n!=n){for(;c<l;)if((a=s[c++])!=a)return !0}else for(;c<l;c++)if((e||c in s)&&s[c]===n)return e||c||0;return !e&&-1}};},function(e,t,n){var r=n(25),o=Math.min;e.exports=function(e){return 0<e?o(r(e),9007199254740991):0};},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(0<e?r:n)(e)};},function(e,t,n){var r=n(27)("keys"),o=n(10);e.exports=function(e){return r[e]||(r[e]=o(e))};},function(e,t,n){var r=n(6),o=n(1),i="__core-js_shared__",u=o[i]||(o[i]={});(e.exports=function(e,t){return u[e]||(u[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(44)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"});},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},function(e,t,n){var r=n(12);e.exports=function(e){return Object(r(e))};},function(e,t,n){var r=n(8).f,o=Function.prototype,i=/^\s*function ([^ (]*)/;"name"in o||n(3)&&r(o,"name",{configurable:!0,get:function(){try{return (""+this).match(i)[1]}catch(e){return ""}}});},function(e,t,n){var r=n(0),o=n(32)(1);r(r.P+r.F*!n(13)([].map,!0),"Array",{map:function(e){return o(this,e,arguments[1])}});},function(e,t,n){var r=n(18),o=n(11),i=n(29),u=n(24),a=n(47);e.exports=function(e,t){var n=1==e,s=2==e,l=3==e,c=4==e,p=6==e,f=5==e||p,d=t||a;return function(t,a,h){for(var v,m,y=i(t),_=o(y),g=r(a,h,3),b=u(_.length),w=0,x=n?d(t,b):s?d(t,0):void 0;w<b;w++)if((f||w in _)&&(m=g(v=_[w],w,y),e))if(n)x[w]=m;else if(m)switch(e){case 3:return !0;case 5:return v;case 6:return w;case 2:x.push(v);}else if(c)return !1;return p?-1:l||c?c:x}};},function(e,t,n){var r=n(22);e.exports=Array.isArray||function(e){return "Array"==r(e)};},function(e,t,n){var r=n(27)("wks"),o=n(10),i=n(1).Symbol,u="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=u&&i[e]||(u?i:o)("Symbol."+e))}).store=r;},function(e,t,n){var r=n(0),o=n(23)(!1),i=[].indexOf,u=!!i&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(u||!n(13)(i)),"Array",{indexOf:function(e){return u?i.apply(this,arguments)||0:o(this,e,arguments[1])}});},function(e,t,n){var r=n(0);r(r.S,"Object",{create:n(52)});},function(e,t,n){t.__esModule=!0,t.default=void 0,n(14),n(30),n(31),n(35),n(49),n(50);var r=n(5),o=function(e){return e&&e.__esModule?e:{default:e}}(n(51));function i(e){if(!e.element)throw new Error("element is not defined");if(!e.id)throw new Error("id is not defined");if(!e.source)throw new Error("source is not defined");Array.isArray(e.source)&&(e.source=u(e.source)),(0, r.render)((0, r.createElement)(o.default,e),e.element);}var u=function(e){return function(t,n){n(e.filter((function(e){return -1!==e.toLowerCase().indexOf(t.toLowerCase())})));}};i.enhanceSelectElement=function(e){if(!e.selectElement)throw new Error("selectElement is not defined");if(!e.source){var t=[].filter.call(e.selectElement.options,(function(t){return t.value||e.preserveNullOptions}));e.source=t.map((function(e){return e.textContent||e.innerText}));}if(e.onConfirm=e.onConfirm||function(t){var n=[].filter.call(e.selectElement.options,(function(e){return (e.textContent||e.innerText)===t}))[0];n&&(n.selected=!0);},e.selectElement.value||void 0===e.defaultValue){var n=e.selectElement.options[e.selectElement.options.selectedIndex];e.defaultValue=n.textContent||n.innerText;}void 0===e.name&&(e.name=""),void 0===e.id&&(void 0===e.selectElement.id?e.id="":e.id=e.selectElement.id),void 0===e.autoselect&&(e.autoselect=!0);var r=document.createElement("div");e.selectElement.parentNode.insertBefore(r,e.selectElement),i(Object.assign({},e,{element:r})),e.selectElement.style.display="none",e.selectElement.id=e.selectElement.id+"-select";};var a=i;t.default=a;},function(e,t,n){e.exports=!n(3)&&!n(4)((function(){return 7!=Object.defineProperty(n(15)("div"),"a",{get:function(){return 7}}).a}));},function(e,t,n){var r=n(2);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")};},function(e,t){e.exports=function(e,t){return {enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}};},function(e,t,n){var r=n(20),o=n(45),i=n(46),u=n(29),a=n(11),s=Object.assign;e.exports=!s||n(4)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e;})),7!=s({},e)[n]||Object.keys(s({},t)).join("")!=r}))?function(e,t){for(var n=u(e),s=arguments.length,l=1,c=o.f,p=i.f;l<s;)for(var f,d=a(arguments[l++]),h=c?r(d).concat(c(d)):r(d),v=h.length,m=0;m<v;)p.call(d,f=h[m++])&&(n[f]=d[f]);return n}:s;},function(e,t,n){var r=n(17),o=n(21),i=n(23)(!1),u=n(26)("IE_PROTO");e.exports=function(e,t){var n,a=o(e),s=0,l=[];for(n in a)n!=u&&r(a,n)&&l.push(n);for(;t.length>s;)r(a,n=t[s++])&&(~i(l,n)||l.push(n));return l};},function(e,t,n){var r=n(25),o=Math.max,i=Math.min;e.exports=function(e,t){return (e=r(e))<0?o(e+t,0):i(e,t)};},function(e,t){e.exports=!1;},function(e,t){t.f=Object.getOwnPropertySymbols;},function(e,t){t.f={}.propertyIsEnumerable;},function(e,t,n){var r=n(48);e.exports=function(e,t){return new(r(e))(t)};},function(e,t,n){var r=n(2),o=n(33),i=n(34)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[i])&&(t=void 0)),void 0===t?Array:t};},function(e,t,n){var r=n(0),o=n(32)(2);r(r.P+r.F*!n(13)([].filter,!0),"Array",{filter:function(e){return o(this,e,arguments[1])}});},function(e,t,n){var r=n(0);r(r.S,"Array",{isArray:n(33)});},function(e,t,n){t.__esModule=!0,t.default=void 0,n(14),n(36),n(30),n(31),n(35),n(55),n(58);var r=n(5),o=u(n(60)),i=u(n(61));function u(e){return e&&e.__esModule?e:{default:e}}function a(){return (a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e}).apply(this,arguments)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var l={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function c(){return "undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var p=function(e){function t(t){var n;return (n=e.call(this,t)||this).elementReferences={},n.state={focused:null,hovered:null,menuOpen:!1,options:t.defaultValue?[t.defaultValue]:[],query:t.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},n.handleComponentBlur=n.handleComponentBlur.bind(s(s(n))),n.handleKeyDown=n.handleKeyDown.bind(s(s(n))),n.handleUpArrow=n.handleUpArrow.bind(s(s(n))),n.handleDownArrow=n.handleDownArrow.bind(s(s(n))),n.handleEnter=n.handleEnter.bind(s(s(n))),n.handlePrintableKey=n.handlePrintableKey.bind(s(s(n))),n.handleListMouseLeave=n.handleListMouseLeave.bind(s(s(n))),n.handleOptionBlur=n.handleOptionBlur.bind(s(s(n))),n.handleOptionClick=n.handleOptionClick.bind(s(s(n))),n.handleOptionFocus=n.handleOptionFocus.bind(s(s(n))),n.handleOptionMouseDown=n.handleOptionMouseDown.bind(s(s(n))),n.handleOptionMouseEnter=n.handleOptionMouseEnter.bind(s(s(n))),n.handleInputBlur=n.handleInputBlur.bind(s(s(n))),n.handleInputChange=n.handleInputChange.bind(s(s(n))),n.handleInputFocus=n.handleInputFocus.bind(s(s(n))),n.pollInputElement=n.pollInputElement.bind(s(s(n))),n.getDirectInputChanges=n.getDirectInputChanges.bind(s(s(n))),n}!function(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;}(t,e);var n=t.prototype;return n.isQueryAnOption=function(e,t){var n=this;return -1!==t.map((function(e){return n.templateInputValue(e).toLowerCase()})).indexOf(e.toLowerCase())},n.componentDidMount=function(){this.pollInputElement();},n.componentWillUnmount=function(){clearTimeout(this.$pollInput);},n.pollInputElement=function(){var e=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){e.pollInputElement();}),100);},n.getDirectInputChanges=function(){var e=this.elementReferences[-1];e&&e.value!==this.state.query&&this.handleInputChange({target:{value:e.value}});},n.componentDidUpdate=function(e,t){var n=this.state.focused,r=null===n,o=t.focused!==n;o&&!r&&this.elementReferences[n].focus();var i=-1===n,u=o&&null===t.focused;if(i&&u){var a=this.elementReferences[n];a.setSelectionRange(0,a.value.length);}},n.hasAutoselect=function(){return !c()&&this.props.autoselect},n.templateInputValue=function(e){var t=this.props.templates&&this.props.templates.inputValue;return t?t(e):e},n.templateSuggestion=function(e){var t=this.props.templates&&this.props.templates.suggestion;return t?t(e):e},n.handleComponentBlur=function(e){var t,n=this.state,r=n.options,o=n.query,i=n.selected;this.props.confirmOnBlur?(t=e.query||o,this.props.onConfirm(r[i])):t=o,this.setState({focused:null,menuOpen:e.menuOpen||!1,query:t,selected:null,validChoiceMade:this.isQueryAnOption(t,r)});},n.handleListMouseLeave=function(e){this.setState({hovered:null});},n.handleOptionBlur=function(e,t){var n=this.state,r=n.focused,o=n.menuOpen,i=n.options,u=n.selected,a=null===e.relatedTarget,s=e.relatedTarget===this.elementReferences[-1],l=r!==t&&-1!==r;if(!l&&a||!l&&!s){var p=o&&c();this.handleComponentBlur({menuOpen:p,query:this.templateInputValue(i[u])});}},n.handleInputBlur=function(e){var t=this.state,n=t.focused,r=t.menuOpen,o=t.options,i=t.query,u=t.selected;if(-1===n){var a=r&&c(),s=c()?i:this.templateInputValue(o[u]);this.handleComponentBlur({menuOpen:a,query:s});}},n.handleInputChange=function(e){var t=this,n=this.props,r=n.minLength,o=n.source,i=n.showAllValues,u=this.hasAutoselect(),a=e.target.value,s=0===a.length,l=this.state.query.length!==a.length,c=a.length>=r;this.setState({query:a,ariaHint:s}),i||!s&&l&&c?o(a,(function(e){var n=0<e.length;t.setState({menuOpen:n,options:e,selected:u&&n?0:-1,validChoiceMade:!1});})):!s&&c||this.setState({menuOpen:!1,options:[]});},n.handleInputClick=function(e){this.handleInputChange(e);},n.handleInputFocus=function(e){var t=this.state,n=t.query,r=t.validChoiceMade,o=t.options,i=this.props.minLength,u=!r&&n.length>=i&&0<o.length;u?this.setState((function(e){var t=e.menuOpen;return {focused:-1,menuOpen:u||t,selected:-1}})):this.setState({focused:-1});},n.handleOptionFocus=function(e){this.setState({focused:e,hovered:null,selected:e});},n.handleOptionMouseEnter=function(e,t){c()||this.setState({hovered:t});},n.handleOptionClick=function(e,t){var n=this.state.options[t],r=this.templateInputValue(n);this.props.onConfirm(n),this.setState({focused:-1,hovered:null,menuOpen:!1,query:r,selected:-1,validChoiceMade:!0}),this.forceUpdate();},n.handleOptionMouseDown=function(e){e.preventDefault();},n.handleUpArrow=function(e){e.preventDefault();var t=this.state,n=t.menuOpen,r=t.selected;-1!==r&&n&&this.handleOptionFocus(r-1);},n.handleDownArrow=function(e){var t=this;if(e.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)e.preventDefault(),this.props.source("",(function(e){t.setState({menuOpen:!0,options:e,selected:0,focused:0,hovered:null});}));else if(!0===this.state.menuOpen){var n=this.state,r=n.menuOpen,o=n.options,i=n.selected;i!==o.length-1&&r&&this.handleOptionFocus(i+1);}},n.handleSpace=function(e){var t=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(e.preventDefault(),this.props.source("",(function(e){t.setState({menuOpen:!0,options:e});}))),-1!==this.state.focused&&(e.preventDefault(),this.handleOptionClick(e,this.state.focused));},n.handleEnter=function(e){this.state.menuOpen&&(e.preventDefault(),0<=this.state.selected&&this.handleOptionClick(e,this.state.selected));},n.handlePrintableKey=function(e){var t=this.elementReferences[-1];e.target===t||t.focus();},n.handleKeyDown=function(e){switch(l[e.keyCode]){case"up":this.handleUpArrow(e);break;case"down":this.handleDownArrow(e);break;case"space":this.handleSpace(e);break;case"enter":this.handleEnter(e);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:(function(e){return 47<e&&e<58||32===e||8===e||64<e&&e<91||95<e&&e<112||185<e&&e<193||218<e&&e<223})(e.keyCode)&&this.handlePrintableKey(e);}},n.render=function(){var e,t=this,n=this.props,i=n.cssNamespace,u=n.displayMenu,s=n.id,l=n.minLength,p=n.name,f=n.placeholder,d=n.required,h=n.showAllValues,v=n.tNoResults,m=n.tStatusQueryTooShort,y=n.tStatusNoResults,_=n.tStatusSelectedOption,g=n.tStatusResults,b=n.tAssistiveHint,w=n.dropdownArrow,x=this.state,O=x.focused,C=x.hovered,S=x.menuOpen,E=x.options,M=x.query,N=x.selected,I=x.ariaHint,A=x.validChoiceMade,k=this.hasAutoselect(),j=-1===O,P=0===E.length,L=0!==M.length,T=M.length>=l,B=this.props.showNoOptionsFound&&j&&P&&L&&T,D=i+"__wrapper",F=i+"__input",R=null!==O?" "+F+"--focused":"",U=this.props.showAllValues?" "+F+"--show-all-values":" "+F+"--default",V=i+"__dropdown-arrow-down",q=-1!==O&&null!==O,H=i+"__menu",W=H+"--"+u,K=H+"--"+(S||B?"visible":"hidden"),Q=i+"__option",z=i+"__hint",G=this.templateInputValue(E[N]),$=G&&0===G.toLowerCase().indexOf(M.toLowerCase())&&k?M+G.substr(M.length):"",J=s+"__assistiveHint",X=I?{"aria-describedby":J}:null;return h&&"string"==typeof(e=w({className:V}))&&(e=(0, r.createElement)("div",{className:i+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:e}})),(0, r.createElement)("div",{className:D,onKeyDown:this.handleKeyDown},(0, r.createElement)(o.default,{id:s,length:E.length,queryLength:M.length,minQueryLength:l,selectedOption:this.templateInputValue(E[N]),selectedOptionIndex:N,validChoiceMade:A,isInFocus:null!==this.state.focused,tQueryTooShort:m,tNoResults:y,tSelectedOption:_,tResults:g}),$&&(0, r.createElement)("span",null,(0, r.createElement)("input",{className:z,readonly:!0,tabIndex:"-1",value:$})),(0, r.createElement)("input",a({"aria-expanded":S?"true":"false","aria-activedescendant":!!q&&s+"__option--"+O,"aria-owns":s+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"},X,{autoComplete:"off",className:""+F+R+U,id:s,onClick:function(e){return t.handleInputClick(e)},onBlur:this.handleInputBlur},function(e){return {onInput:e}}(this.handleInputChange),{onFocus:this.handleInputFocus,name:p,placeholder:f,ref:function(e){t.elementReferences[-1]=e;},type:"text",role:"combobox",required:d,value:M})),e,(0, r.createElement)("ul",{className:H+" "+W+" "+K,onMouseLeave:function(e){return t.handleListMouseLeave(e)},id:s+"__listbox",role:"listbox"},E.map((function(e,n){var o=(-1===O?N===n:O===n)&&null===C?" "+Q+"--focused":"",i=n%2?" "+Q+"--odd":"",u=c()?"<span id="+s+"__option-suffix--"+n+' style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> '+(n+1)+" of "+E.length+"</span>":"";return (0, r.createElement)("li",{"aria-selected":O===n?"true":"false",className:""+Q+o+i,dangerouslySetInnerHTML:{__html:t.templateSuggestion(e)+u},id:s+"__option--"+n,key:n,onBlur:function(e){return t.handleOptionBlur(e,n)},onClick:function(e){return t.handleOptionClick(e,n)},onMouseDown:t.handleOptionMouseDown,onMouseEnter:function(e){return t.handleOptionMouseEnter(e,n)},ref:function(e){t.elementReferences[n]=e;},role:"option",tabIndex:"-1","aria-posinset":n+1,"aria-setsize":E.length})})),B&&(0, r.createElement)("li",{className:Q+" "+Q+"--no-results"},v())),(0, r.createElement)("span",{id:J,style:{display:"none"}},b()))},t}(r.Component);(t.default=p).defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return "No results found"},tAssistiveHint:function(){return "When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:i.default};},function(e,t,n){var r=n(9),o=n(53),i=n(28),u=n(26)("IE_PROTO"),a=function(){},s="prototype",l=function(){var e,t=n(15)("iframe"),r=i.length;for(t.style.display="none",n(54).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),l=e.F;r--;)delete l[s][i[r]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(a[s]=r(e),n=new a,a[s]=null,n[u]=e):n=l(),void 0===t?n:o(n,t)};},function(e,t,n){var r=n(8),o=n(9),i=n(20);e.exports=n(3)?Object.defineProperties:function(e,t){o(e);for(var n,u=i(t),a=u.length,s=0;s<a;)r.f(e,n=u[s++],t[n]);return e};},function(e,t,n){var r=n(1).document;e.exports=r&&r.documentElement;},function(e,t,n){var r=n(0);r(r.P,"Function",{bind:n(56)});},function(e,t,n){var r=n(19),o=n(2),i=n(57),u=[].slice,a={};e.exports=Function.bind||function(e){var t=r(this),n=u.call(arguments,1),s=function(){var r=n.concat(u.call(arguments));return this instanceof s?function(e,t,n){if(!(t in a)){for(var r=[],o=0;o<t;o++)r[o]="a["+o+"]";a[t]=Function("F,a","return new F("+r.join(",")+")");}return a[t](e,n)}(t,r.length,r):i(t,r,e)};return o(t.prototype)&&(s.prototype=t.prototype),s};},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)};},function(e,t,n){n(59)("match",1,(function(e,t,n){return [function(n){var r=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},n]}));},function(e,t,n){var r=n(7),o=n(16),i=n(4),u=n(12),a=n(34);e.exports=function(e,t,n){var s=a(e),l=n(u,s,""[e]),c=l[0],p=l[1];i((function(){var t={};return t[s]=function(){return 7},7!=""[e](t)}))&&(o(String.prototype,e,c),r(RegExp.prototype,s,2==t?function(e,t){return p.call(e,this,t)}:function(e){return p.call(e,this)}));};},function(e,t,n){t.__esModule=!0,t.default=void 0,n(36);var r=n(5),o=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return (t=e.call.apply(e,[this].concat(r))||this).state={bump:!1,debounced:!1},t}!function(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;}(t,e);var n=t.prototype;return n.componentWillMount=function(){var e=this;this.debounceStatusUpdate=function(e,t,n){var r;return function(){var o=this,i=arguments,u=function(){r=null,n||e.apply(o,i);},a=n&&!r;clearTimeout(r),r=setTimeout(u,t),a&&e.apply(o,i);}}((function(){if(!e.state.debounced){var t=!e.props.isInFocus||e.props.validChoiceMade;e.setState((function(e){return {bump:!e.bump,debounced:!0,silenced:t}}));}}),1400);},n.componentWillReceiveProps=function(e){e.queryLength,this.setState({debounced:!1});},n.render=function(){var e,t=this.props,n=t.id,o=t.length,i=t.queryLength,u=t.minQueryLength,a=t.selectedOption,s=t.selectedOptionIndex,l=t.tQueryTooShort,c=t.tNoResults,p=t.tSelectedOption,f=t.tResults,d=this.state,h=d.bump,v=d.debounced,m=d.silenced,y=i<u,_=0===o,g=a?p(a,o,s):"";return e=y?l(u):_?c():f(o,g),this.debounceStatusUpdate(),(0, r.createElement)("div",{style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},(0, r.createElement)("div",{id:n+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!m&&v&&h?e:""),(0, r.createElement)("div",{id:n+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},m||!v||h?"":e))},t}(r.Component);(t.default=o).defaultProps={tQueryTooShort:function(e){return "Type in "+e+" or more characters for results"},tNoResults:function(){return "No search results"},tSelectedOption:function(e,t,n){return e+" "+(n+1)+" of "+t+" is highlighted"},tResults:function(e,t){return e+" "+(1===e?"result":"results")+" "+(1===e?"is":"are")+" available. "+t}};},function(e,t,n){t.__esModule=!0,t.default=void 0;var r=n(5);t.default=function(e){var t=e.className;return (0, r.createElement)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:t,focusable:"false"},(0, r.createElement)("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},(0, r.createElement)("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))};}]).default},e.exports=n();}));const accessibleAutocomplete = unwrapExports(accessibleAutocomplete_min);
|
|
125
125
|
|
|
126
|
-
const NAME$s="selectautocomplete";function onClassChange(e
|
|
126
|
+
const NAME$s="selectautocomplete";function onClassChange(t,e){const o=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"class"===t.attributeName&&e(t.target);}));}));return o.observe(t,{attributes:!0}),o.disconnect}class SelectAutocomplete extends BaseComponent{constructor(t,e){super(t),this._hasFormControl=t.classList.contains("form-control"),this.element_original_id=this._element.id,this._config=e,this._config.tAssistiveHint||(this._config.tAssistiveHint=()=>"Quando i risultati del completamento automatico sono disponibili, usa le frecce su e giù per rivedere e Invio per selezionare. Utenti di dispositivi touch, esplora tramite tocco o con gesti di scorrimento"),this._config.tNoResults||(this._config.tNoResults=()=>"Nessun risultato trovato"),this._config.tStatusQueryTooShort||(this._config.tStatusQueryTooShort=t=>`Digita ${t} o più caratteri per mostrare le opzioni di ricerca`),this._config.tStatusNoResults||(this._config.tStatusNoResults=()=>"Nessun risultato di ricerca"),this._config.tStatusSelectedOption||(this._config.tStatusSelectedOption=(t,e,o)=>`${t} ${o+1} di ${e} è sottolineato`),this._config.tStatusResults||(this._config.tStatusResults=(t,e)=>`${t} ${1===t?"risultato":"risultati"} ${1===t?"è":"sono"} ${1===t?"disponibile":"disponibili"}. ${e}`),this._enhance();}static get NAME(){return NAME$s}_enhance(){accessibleAutocomplete.enhanceSelectElement(Object.assign({},{selectElement:this._element},this._config)),setTimeout((()=>{if(this._hasFormControl){if("undefined"==typeof document)return;const t=document.getElementById(this.element_original_id);t.classList.add("form-control"),onClassChange(t,(t=>{t.classList.contains("form-control")||t.classList.add("form-control");}));}}),100);}}const SelectAutocomplete$1 = SelectAutocomplete;
|
|
127
127
|
|
|
128
128
|
const NAME$r="inputsearchautocomplete",DATA_KEY$7="bs.inputsearchautocomplete",EVENT_KEY$9=`.${DATA_KEY$7}`,Default$j={autocomplete:[]},EVENT_KEYUP$1=`keyup${EVENT_KEY$9}`,CLASS_NAME_SHOW$1="autocomplete-list-show",DATA_AUTOCOMPLETE="data-bs-autocomplete",SELECTOR_SEARCH='input[data-bs-autocomplete][type="search"]';class InputSearch extends BaseComponent{constructor(e,t){super(e),this._config=this._getConfig(t),this._items=[],this._autocompleteElement=null,this._label=new InputLabel$1(e),this._init(),this._bindEvents();}static get NAME(){return NAME$r}search(){const e=this._element.value;
|
|
129
129
|
//!!! $autocomplete.empty()
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
|
|
48
48
|
const DATA_MOUSE_FOCUS="data-focus-mouse";class TrackFocus{constructor(){this._usingMouse=!1,this._bindEvents();}_bindEvents(){if("undefined"==typeof document)return;["keydown","mousedown"].forEach((t=>{document.addEventListener(t,(t=>{this._usingMouse="mousedown"===t.type;}));})),document.addEventListener("focusin",(t=>{this._usingMouse&&t.target&&(t.target.classList.add("focus--mouse"),t.target.setAttribute(DATA_MOUSE_FOCUS,!0));})),document.addEventListener("focusout",(t=>{t.target&&(t.target.classList.remove("focus--mouse"),t.target.setAttribute(DATA_MOUSE_FOCUS,!1));}));}}new TrackFocus;const TrackFocus$1 = TrackFocus;
|
|
49
49
|
|
|
50
|
-
const BOOTSTRAP_ITALIA_VERSION = "2.9.
|
|
50
|
+
const BOOTSTRAP_ITALIA_VERSION = "2.9.1";
|
|
51
51
|
|
|
52
52
|
const init=()=>{"undefined"==typeof window||window.BOOTSTRAP_ITALIA_VERSION||(new TrackFocus$1,window.BOOTSTRAP_ITALIA_VERSION=BOOTSTRAP_ITALIA_VERSION);};const init$1 = init;init();
|
|
53
53
|
|
|
@@ -121,11 +121,11 @@
|
|
|
121
121
|
|
|
122
122
|
class CssClassObserver{constructor(t,e,s,a,l){this.targetNode=t,this.classToWatch=e,this.classAddedCallback=s,this.classRemovedCallback=a,this.observer=null,this.lastClassState=t.classList.contains(this.classToWatch),this.ignoreToggle=!!l,this.init();}init(){this.observer=new MutationObserver((t=>this.mutationCallback(t))),this.observe();}observe(){this.observer.observe(this.targetNode,{attributes:!0});}disconnect(){this.observer.disconnect();}mutationCallback(t){for(let e of t)if("attributes"===e.type&&"class"===e.attributeName){let t=e.target.classList.contains(this.classToWatch);(this.ignoreToggle||this.lastClassState!==t)&&(this.lastClassState=t,t?"function"==typeof this.classAddedCallback&&this.classAddedCallback():"function"==typeof this.classRemovedCallback&&this.classRemovedCallback());}}}class ContentObserver{constructor(t,e,s,a){this.targetNode=t,this.contentSelector=e,this.contentAddedCallback=s,this.contentRemovedCallback=a,this.observer=null,this.init();}init(){this.observer=new MutationObserver((t=>this.mutationCallback(t))),this.observe();}observe(){this.observer.observe(this.targetNode,{childList:!0,subtree:!0});}disconnect(){this.observer.disconnect();}mutationCallback(t){for(let e of t)"childList"===e.type&&(e.addedNodes.forEach((t=>{this._callbackExec(t);})),e.removedNodes.forEach((t=>{this._callbackExec(t,!0);})));}_callbackExec(t,e){const s=t.matches&&t.matches(this.contentSelector)?[t]:t.querySelectorAll?t.querySelectorAll(this.contentSelector):null,a=e&&"function"==typeof this.contentRemovedCallback?this.contentRemovedCallback:"function"==typeof this.contentAddedCallback?this.contentAddedCallback:null;s&&a&&s.forEach((t=>a(t)));}}
|
|
123
123
|
|
|
124
|
-
const CONFIG_DEFAULT={errorFieldCssClass:"is-invalid",errorLabelCssClass:"just-validate-error-label"},NAME$u="justvalidatebi",CLASS_NAME_SRONLY="sr-only-justvalidate-bi",SELECTOR_SPAN_SRONLY=`.${CLASS_NAME_SRONLY}`;class FormValidate{constructor(e,t){return this.formSelector=e,this.target=document.querySelector(e),this.validate=new JustValidate(e,t),this.config=Object.assign({},CONFIG_DEFAULT,this.validate.globalConfig),this.formItems=[],this.init(),this.validate}init(){this.target.querySelectorAll("input, select").forEach((e=>{const t=new CssClassObserver(e,this.config.errorFieldCssClass,(()=>this.onInputError(e)),(()=>this.onInputErrorRemove(e)),!0);e.id||e.setAttribute("id",NAME$u+"-input-"+Math.random()),this.formItems.push({item:e,watcher:t});}));this.target.querySelectorAll("fieldset").forEach((e=>{if(e.querySelectorAll("input[type=radio],input[type=checkbox]").length>0){const t=new ContentObserver(e,"."+this.config.errorLabelCssClass,(()=>this.onFieldsetError(e)),(()=>this.onFieldsetErrorRemove(e)));e.id||e.setAttribute("id",NAME$u+"-fieldset-"+Math.random()),this.formItems.push({item:e,watcher:t});}}));}onInputError(e){const t=this.getErrorMessages(e),r=[];t.forEach(((t,s)=>{const i=e.id+"-error-"+s;t.setAttribute("id",i),r.push(i);})),r.length>0&&(e.setAttribute("aria-describedby",r.join(" ")),e.setAttribute("aria-invalid","true"));}onInputErrorRemove(e){e.removeAttribute("aria-describedby"),e.setAttribute("aria-invalid","false");}onFieldsetError(e){const t=this.getErrorMessages(e),r=[],s=[];if(t.forEach(((t,i)=>{const o=e.id+"-error-"+i;t.setAttribute("id",o),r.push(o),s.push(t.textContent);})),r.length>0){const t=e.querySelector("legend");t&&(t.setAttribute("aria-describedby",r.join(" ")),t.setAttribute("aria-invalid","true"));}}onFieldsetErrorRemove(e){const t=e.querySelector("legend");if(t){t.removeAttribute("aria-describedby"),t.setAttribute("aria-invalid","false");const e=t.querySelector(SELECTOR_SPAN_SRONLY);e&&e.remove();}}getErrorMessages(e){let t=e,r=t.querySelectorAll("."+this.config.errorLabelCssClass);for(;null!=t&&0===r.length;)t=t.parentNode,r=t.querySelectorAll("."+this.config.errorLabelCssClass);return r}}const ValidatorSelectAutocomplete=(e,t={})=>(r,s)=>{let i=!1;const o=s[e];if(!o)throw new Error("ValidatorSelectAutocomplete: "+e+" not found as form field");return t.required||r?document.querySelector("#"+o.elem.id+"-select").querySelectorAll("option").forEach((e=>{e.text===r&&(i=!0);})):i=!0,i};
|
|
124
|
+
const CONFIG_DEFAULT={errorFieldCssClass:"is-invalid",errorLabelCssClass:"just-validate-error-label"},NAME$u="justvalidatebi",CLASS_NAME_SRONLY="sr-only-justvalidate-bi",SELECTOR_SPAN_SRONLY=`.${CLASS_NAME_SRONLY}`;class FormValidate{constructor(e,t,r){return this.formSelector=e,this.target=document.querySelector(e),this.validate=null!=r?new JustValidate(e,t,r):new JustValidate(e,t),this.config=Object.assign({},CONFIG_DEFAULT,this.validate.globalConfig),this.formItems=[],this.init(),this.validate}init(){this.target.querySelectorAll("input, select").forEach((e=>{const t=new CssClassObserver(e,this.config.errorFieldCssClass,(()=>this.onInputError(e)),(()=>this.onInputErrorRemove(e)),!0);e.id||e.setAttribute("id",NAME$u+"-input-"+Math.random()),this.formItems.push({item:e,watcher:t});}));this.target.querySelectorAll("fieldset").forEach((e=>{if(e.querySelectorAll("input[type=radio],input[type=checkbox]").length>0){const t=new ContentObserver(e,"."+this.config.errorLabelCssClass,(()=>this.onFieldsetError(e)),(()=>this.onFieldsetErrorRemove(e)));e.id||e.setAttribute("id",NAME$u+"-fieldset-"+Math.random()),this.formItems.push({item:e,watcher:t});}}));}onInputError(e){const t=this.getErrorMessages(e),r=[];t.forEach(((t,s)=>{const i=e.id+"-error-"+s;t.setAttribute("id",i),r.push(i);})),r.length>0&&(e.setAttribute("aria-describedby",r.join(" ")),e.setAttribute("aria-invalid","true"));}onInputErrorRemove(e){e.removeAttribute("aria-describedby"),e.setAttribute("aria-invalid","false");}onFieldsetError(e){const t=this.getErrorMessages(e),r=[],s=[];if(t.forEach(((t,i)=>{const o=e.id+"-error-"+i;t.setAttribute("id",o),r.push(o),s.push(t.textContent);})),r.length>0){const t=e.querySelector("legend");t&&(t.setAttribute("aria-describedby",r.join(" ")),t.setAttribute("aria-invalid","true"));}}onFieldsetErrorRemove(e){const t=e.querySelector("legend");if(t){t.removeAttribute("aria-describedby"),t.setAttribute("aria-invalid","false");const e=t.querySelector(SELECTOR_SPAN_SRONLY);e&&e.remove();}}getErrorMessages(e){let t=e,r=t.querySelectorAll("."+this.config.errorLabelCssClass);for(;null!=t&&0===r.length;)t=t.parentNode,r=t.querySelectorAll("."+this.config.errorLabelCssClass);return r}}const ValidatorSelectAutocomplete=(e,t={})=>(r,s)=>{let i=!1;const o=s[e];if(!o)throw new Error("ValidatorSelectAutocomplete: "+e+" not found as form field");return t.required||r?document.querySelector("#"+o.elem.id+"-select").querySelectorAll("option").forEach((e=>{e.text===r&&(i=!0);})):i=!0,i};
|
|
125
125
|
|
|
126
126
|
const NAME$t="input",EVENT_CHANGE="change.bs.input";class Input extends BaseComponent{constructor(e){super(e),this._label=new InputLabel$1(e),this._bindEvents();}static get NAME(){return NAME$t}_bindEvents(){"file"===this._element.getAttribute("type")&&EventHandler$1.on(this._element,EVENT_CHANGE,(()=>{this._handleFileDescription();}));}_handleFileDescription(){const e=[];let t="";Array.from(this._element.files).forEach((t=>{const n=Math.round(parseInt(t.size,10)/1024);e.push(t.name+" ("+n+"kb)");})),this._element.files.length>1&&(t=this._element.files.length+" file da caricare: ");const n=SelectorEngine$1.findOne('label[for="'+this._element.getAttribute("id")+'"] label.form-file-name',this._element);n&&(n.innerText=t+e.join("; "));}}const excludes=["select",'input[data-bs-input][type="password"]',"input.input-password[data-bs-input]",'input[data-bs-autocomplete][type="search"]','input[type="time"]','input[type="radio"]','input[type="checkbox"]'],createInput$2=e=>{const t=!!excludes.find((t=>e.matches(t))),n=!("number"!==e.getAttribute("type")||!e.parentNode.querySelector('button[class^="input-number-"]'));return t||n?null:Input.getOrCreateInstance(e)};"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll("input, textarea, label").forEach((function(e){const t=InputLabel$1.getInputFromLabel(e)||e;createInput$2(t);}));}));const Input$1 = Input;
|
|
127
127
|
|
|
128
|
-
const NAME$s="selectautocomplete";function onClassChange(e
|
|
128
|
+
const NAME$s="selectautocomplete";function onClassChange(t,e){const o=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"class"===t.attributeName&&e(t.target);}));}));return o.observe(t,{attributes:!0}),o.disconnect}class SelectAutocomplete extends BaseComponent{constructor(t,e){super(t),this._hasFormControl=t.classList.contains("form-control"),this.element_original_id=this._element.id,this._config=e,this._config.tAssistiveHint||(this._config.tAssistiveHint=()=>"Quando i risultati del completamento automatico sono disponibili, usa le frecce su e giù per rivedere e Invio per selezionare. Utenti di dispositivi touch, esplora tramite tocco o con gesti di scorrimento"),this._config.tNoResults||(this._config.tNoResults=()=>"Nessun risultato trovato"),this._config.tStatusQueryTooShort||(this._config.tStatusQueryTooShort=t=>`Digita ${t} o più caratteri per mostrare le opzioni di ricerca`),this._config.tStatusNoResults||(this._config.tStatusNoResults=()=>"Nessun risultato di ricerca"),this._config.tStatusSelectedOption||(this._config.tStatusSelectedOption=(t,e,o)=>`${t} ${o+1} di ${e} è sottolineato`),this._config.tStatusResults||(this._config.tStatusResults=(t,e)=>`${t} ${1===t?"risultato":"risultati"} ${1===t?"è":"sono"} ${1===t?"disponibile":"disponibili"}. ${e}`),this._enhance();}static get NAME(){return NAME$s}_enhance(){accessibleAutocomplete__default.default.enhanceSelectElement(Object.assign({},{selectElement:this._element},this._config)),setTimeout((()=>{if(this._hasFormControl){if("undefined"==typeof document)return;const t=document.getElementById(this.element_original_id);t.classList.add("form-control"),onClassChange(t,(t=>{t.classList.contains("form-control")||t.classList.add("form-control");}));}}),100);}}const SelectAutocomplete$1 = SelectAutocomplete;
|
|
129
129
|
|
|
130
130
|
const NAME$r="inputsearchautocomplete",DATA_KEY$7="bs.inputsearchautocomplete",EVENT_KEY$9=`.${DATA_KEY$7}`,Default$j={autocomplete:[]},EVENT_KEYUP$1=`keyup${EVENT_KEY$9}`,CLASS_NAME_SHOW$1="autocomplete-list-show",DATA_AUTOCOMPLETE="data-bs-autocomplete",SELECTOR_SEARCH='input[data-bs-autocomplete][type="search"]';class InputSearch extends BaseComponent{constructor(e,t){super(e),this._config=this._getConfig(t),this._items=[],this._autocompleteElement=null,this._label=new InputLabel$1(e),this._init(),this._bindEvents();}static get NAME(){return NAME$r}search(){const e=this._element.value;
|
|
131
131
|
//!!! $autocomplete.empty()
|
|
@@ -13,10 +13,15 @@ const CLASS_NAME_SRONLY = 'sr-only-justvalidate-bi';
|
|
|
13
13
|
const SELECTOR_SPAN_SRONLY = `.${CLASS_NAME_SRONLY}`;
|
|
14
14
|
|
|
15
15
|
class FormValidate {
|
|
16
|
-
constructor(selector, config) {
|
|
16
|
+
constructor(selector, config, dictLocale) {
|
|
17
17
|
this.formSelector = selector;
|
|
18
18
|
this.target = document.querySelector(selector);
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
if (dictLocale != undefined) this.validate = new JustValidate(selector, config, dictLocale);
|
|
21
|
+
else {
|
|
22
|
+
this.validate = new JustValidate(selector, config);
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
this.config = Object.assign({}, CONFIG_DEFAULT, this.validate.globalConfig);
|
|
21
26
|
this.formItems = [];
|
|
22
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-validate.js","sources":["../../src/js/plugins/form-validate.js"],"sourcesContent":["import JustValidate from 'just-validate'\nimport { CssClassObserver, ContentObserver } from './util/observer'\n\nconst CONFIG_DEFAULT = {\n errorFieldCssClass: 'is-invalid',\n errorLabelCssClass: 'just-validate-error-label',\n}\n\nconst NAME = 'justvalidatebi'\n\nconst CLASS_NAME_SRONLY = 'sr-only-justvalidate-bi'\n\nconst SELECTOR_SPAN_SRONLY = `.${CLASS_NAME_SRONLY}`\n\nclass FormValidate {\n constructor(selector, config) {\n this.formSelector = selector\n this.target = document.querySelector(selector)\n this.validate = new JustValidate(selector, config)\n this.config = Object.assign({}, CONFIG_DEFAULT, this.validate.globalConfig)\n this.formItems = []\n\n this.init()\n\n return this.validate\n }\n\n init() {\n const inputs = this.target.querySelectorAll('input, select')\n inputs.forEach((input) => {\n const watcher = new CssClassObserver(\n input,\n this.config.errorFieldCssClass,\n () => this.onInputError(input),\n () => this.onInputErrorRemove(input),\n true\n )\n if (!input.id) {\n input.setAttribute('id', NAME + '-input-' + Math.random())\n }\n this.formItems.push({\n item: input,\n watcher,\n })\n })\n const fieldsets = this.target.querySelectorAll('fieldset')\n fieldsets.forEach((field) => {\n const inputs = field.querySelectorAll('input[type=radio],input[type=checkbox]')\n if (inputs.length > 0) {\n const watcher = new ContentObserver(\n field,\n '.' + this.config.errorLabelCssClass,\n () => this.onFieldsetError(field),\n () => this.onFieldsetErrorRemove(field)\n )\n if (!field.id) {\n field.setAttribute('id', NAME + '-fieldset-' + Math.random())\n }\n this.formItems.push({\n item: field,\n watcher,\n })\n }\n })\n }\n\n /**\n * Adds ARIA attributes to the input and to the error message\n * @param {Object} target - the input element\n */\n onInputError(target) {\n const errElements = this.getErrorMessages(target)\n const errIds = []\n errElements.forEach((el, idx) => {\n const id = target.id + '-error-' + idx\n el.setAttribute('id', id)\n errIds.push(id)\n })\n\n if (errIds.length > 0) {\n target.setAttribute('aria-describedby', errIds.join(' '))\n target.setAttribute('aria-invalid', 'true')\n } /*else {\n console.warn('[JustValidateIt] the element is invalid but no error message was found', { target })\n }*/\n }\n /**\n * Removes input ARIA attributes\n * @param {Object} target - the input element\n */\n onInputErrorRemove(target) {\n target.removeAttribute('aria-describedby')\n target.setAttribute('aria-invalid', 'false')\n }\n /**\n * Adds ARIA attributes to the fieldset and to the error message\n * @param {Object} target - the fieldset element\n */\n onFieldsetError(target) {\n const errElements = this.getErrorMessages(target)\n const errIds = []\n const errTexts = []\n errElements.forEach((el, idx) => {\n const id = target.id + '-error-' + idx\n el.setAttribute('id', id)\n errIds.push(id)\n errTexts.push(el.textContent)\n })\n\n if (errIds.length > 0) {\n const legend = target.querySelector('legend')\n if (legend) {\n legend.setAttribute('aria-describedby', errIds.join(' '))\n legend.setAttribute('aria-invalid', 'true')\n }\n }\n }\n /**\n * Removes the fieldset ARIA attributes\n * @param {Object} target - the fieldset element\n */\n onFieldsetErrorRemove(target) {\n const legend = target.querySelector('legend')\n if (legend) {\n legend.removeAttribute('aria-describedby')\n legend.setAttribute('aria-invalid', 'false')\n const span = legend.querySelector(SELECTOR_SPAN_SRONLY)\n if (span) {\n span.remove()\n }\n }\n }\n\n /**\n * get the error messages for the target\n * @param {Object} target - target node\n */\n getErrorMessages(target) {\n let parent = target\n let messages = parent.querySelectorAll('.' + this.config.errorLabelCssClass)\n while (parent != null && messages.length === 0) {\n parent = parent.parentNode\n messages = parent.querySelectorAll('.' + this.config.errorLabelCssClass)\n }\n return messages\n }\n}\n\n//Plugins\n/**\n * Validate a custom autocomplete select\n * @param {string} inputId - the input id\n * @param {Object} config - { required }\n */\nconst ValidatorSelectAutocomplete = (inputId, config = {}) => {\n return (value, fields) => {\n let result = false\n const field = fields[inputId]\n if (field) {\n if (!config.required && !value) {\n result = true\n } else {\n document\n .querySelector('#' + field.elem.id + '-select')\n .querySelectorAll('option')\n .forEach((option) => {\n if (option.text === value) {\n result = true\n }\n })\n }\n } else {\n throw new Error('ValidatorSelectAutocomplete: ' + inputId + ' not found as form field')\n }\n\n return result\n }\n}\n\nexport { FormValidate, ValidatorSelectAutocomplete }\n"],"names":[],"mappings":";;;AAGA,MAAM,cAAc,GAAG;AACvB,EAAE,kBAAkB,EAAE,YAAY;AAClC,EAAE,kBAAkB,EAAE,2BAA2B;AACjD,EAAC;AACD;AACA,MAAM,IAAI,GAAG,iBAAgB;AAC7B;AACA,MAAM,iBAAiB,GAAG,0BAAyB;AACnD;AACA,MAAM,oBAAoB,GAAG,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAC;AACpD;AACA,MAAM,YAAY,CAAC;AACnB,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE;AAChC,IAAI,IAAI,CAAC,YAAY,GAAG,SAAQ;AAChC,IAAI,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,EAAC;AAClD,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAC;AACtD,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAC;AAC/E,IAAI,IAAI,CAAC,SAAS,GAAG,GAAE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,GAAG,KAAI;AAC3B,aAAa;AACb,WAAW,EAAC;AACZ,OAAO;AACP,KAAK,MAAM;AACX,MAAM,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,OAAO,GAAG,0BAA0B,CAAC;AAC7F,KAAK;AACL;AACA,IAAI,OAAO,MAAM;AACjB,GAAG;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"form-validate.js","sources":["../../src/js/plugins/form-validate.js"],"sourcesContent":["import JustValidate from 'just-validate'\nimport { CssClassObserver, ContentObserver } from './util/observer'\n\nconst CONFIG_DEFAULT = {\n errorFieldCssClass: 'is-invalid',\n errorLabelCssClass: 'just-validate-error-label',\n}\n\nconst NAME = 'justvalidatebi'\n\nconst CLASS_NAME_SRONLY = 'sr-only-justvalidate-bi'\n\nconst SELECTOR_SPAN_SRONLY = `.${CLASS_NAME_SRONLY}`\n\nclass FormValidate {\n constructor(selector, config, dictLocale) {\n this.formSelector = selector\n this.target = document.querySelector(selector)\n\n if (dictLocale != undefined) this.validate = new JustValidate(selector, config, dictLocale)\n else {\n this.validate = new JustValidate(selector, config)\n }\n\n this.config = Object.assign({}, CONFIG_DEFAULT, this.validate.globalConfig)\n this.formItems = []\n\n this.init()\n\n return this.validate\n }\n\n init() {\n const inputs = this.target.querySelectorAll('input, select')\n inputs.forEach((input) => {\n const watcher = new CssClassObserver(\n input,\n this.config.errorFieldCssClass,\n () => this.onInputError(input),\n () => this.onInputErrorRemove(input),\n true\n )\n if (!input.id) {\n input.setAttribute('id', NAME + '-input-' + Math.random())\n }\n this.formItems.push({\n item: input,\n watcher,\n })\n })\n const fieldsets = this.target.querySelectorAll('fieldset')\n fieldsets.forEach((field) => {\n const inputs = field.querySelectorAll('input[type=radio],input[type=checkbox]')\n if (inputs.length > 0) {\n const watcher = new ContentObserver(\n field,\n '.' + this.config.errorLabelCssClass,\n () => this.onFieldsetError(field),\n () => this.onFieldsetErrorRemove(field)\n )\n if (!field.id) {\n field.setAttribute('id', NAME + '-fieldset-' + Math.random())\n }\n this.formItems.push({\n item: field,\n watcher,\n })\n }\n })\n }\n\n /**\n * Adds ARIA attributes to the input and to the error message\n * @param {Object} target - the input element\n */\n onInputError(target) {\n const errElements = this.getErrorMessages(target)\n const errIds = []\n errElements.forEach((el, idx) => {\n const id = target.id + '-error-' + idx\n el.setAttribute('id', id)\n errIds.push(id)\n })\n\n if (errIds.length > 0) {\n target.setAttribute('aria-describedby', errIds.join(' '))\n target.setAttribute('aria-invalid', 'true')\n } /*else {\n console.warn('[JustValidateIt] the element is invalid but no error message was found', { target })\n }*/\n }\n /**\n * Removes input ARIA attributes\n * @param {Object} target - the input element\n */\n onInputErrorRemove(target) {\n target.removeAttribute('aria-describedby')\n target.setAttribute('aria-invalid', 'false')\n }\n /**\n * Adds ARIA attributes to the fieldset and to the error message\n * @param {Object} target - the fieldset element\n */\n onFieldsetError(target) {\n const errElements = this.getErrorMessages(target)\n const errIds = []\n const errTexts = []\n errElements.forEach((el, idx) => {\n const id = target.id + '-error-' + idx\n el.setAttribute('id', id)\n errIds.push(id)\n errTexts.push(el.textContent)\n })\n\n if (errIds.length > 0) {\n const legend = target.querySelector('legend')\n if (legend) {\n legend.setAttribute('aria-describedby', errIds.join(' '))\n legend.setAttribute('aria-invalid', 'true')\n }\n }\n }\n /**\n * Removes the fieldset ARIA attributes\n * @param {Object} target - the fieldset element\n */\n onFieldsetErrorRemove(target) {\n const legend = target.querySelector('legend')\n if (legend) {\n legend.removeAttribute('aria-describedby')\n legend.setAttribute('aria-invalid', 'false')\n const span = legend.querySelector(SELECTOR_SPAN_SRONLY)\n if (span) {\n span.remove()\n }\n }\n }\n\n /**\n * get the error messages for the target\n * @param {Object} target - target node\n */\n getErrorMessages(target) {\n let parent = target\n let messages = parent.querySelectorAll('.' + this.config.errorLabelCssClass)\n while (parent != null && messages.length === 0) {\n parent = parent.parentNode\n messages = parent.querySelectorAll('.' + this.config.errorLabelCssClass)\n }\n return messages\n }\n}\n\n//Plugins\n/**\n * Validate a custom autocomplete select\n * @param {string} inputId - the input id\n * @param {Object} config - { required }\n */\nconst ValidatorSelectAutocomplete = (inputId, config = {}) => {\n return (value, fields) => {\n let result = false\n const field = fields[inputId]\n if (field) {\n if (!config.required && !value) {\n result = true\n } else {\n document\n .querySelector('#' + field.elem.id + '-select')\n .querySelectorAll('option')\n .forEach((option) => {\n if (option.text === value) {\n result = true\n }\n })\n }\n } else {\n throw new Error('ValidatorSelectAutocomplete: ' + inputId + ' not found as form field')\n }\n\n return result\n }\n}\n\nexport { FormValidate, ValidatorSelectAutocomplete }\n"],"names":[],"mappings":";;;AAGA,MAAM,cAAc,GAAG;AACvB,EAAE,kBAAkB,EAAE,YAAY;AAClC,EAAE,kBAAkB,EAAE,2BAA2B;AACjD,EAAC;AACD;AACA,MAAM,IAAI,GAAG,iBAAgB;AAC7B;AACA,MAAM,iBAAiB,GAAG,0BAAyB;AACnD;AACA,MAAM,oBAAoB,GAAG,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAC;AACpD;AACA,MAAM,YAAY,CAAC;AACnB,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE;AAC5C,IAAI,IAAI,CAAC,YAAY,GAAG,SAAQ;AAChC,IAAI,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,EAAC;AAClD;AACA,IAAI,IAAI,UAAU,IAAI,SAAS,EAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAC;AAC/F,SAAS;AACT,MAAM,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAC;AACxD,KAAK;AACL;AACA,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAC;AAC/E,IAAI,IAAI,CAAC,SAAS,GAAG,GAAE;AACvB;AACA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I;AAC3B,aAAa;AACb,WAAW,EAAC;AACZ,OAAO;AACP,KAAK,MAAM;AACX,MAAM,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,OAAO,GAAG,0BAA0B,CAAC;AAC7F,KAAK;AACL;AACA,IAAI,OAAO,MAAM;AACjB,GAAG;AACH;;;;"}
|
|
@@ -21,6 +21,25 @@ class SelectAutocomplete extends BaseComponent {
|
|
|
21
21
|
this._hasFormControl = element.classList.contains('form-control');
|
|
22
22
|
this.element_original_id = this._element.id;
|
|
23
23
|
this._config = config;
|
|
24
|
+
if (!this._config.tAssistiveHint)
|
|
25
|
+
this._config.tAssistiveHint = () =>
|
|
26
|
+
'Quando i risultati del completamento automatico sono disponibili, usa le frecce su e giù per rivedere e Invio per selezionare. Utenti di dispositivi touch, esplora tramite tocco o con gesti di scorrimento';
|
|
27
|
+
if (!this._config.tNoResults) this._config.tNoResults = () => 'Nessun risultato trovato';
|
|
28
|
+
if (!this._config.tStatusQueryTooShort)
|
|
29
|
+
this._config.tStatusQueryTooShort = (minQueryLength) => `Digita ${minQueryLength} o più caratteri per mostrare le opzioni di ricerca`;
|
|
30
|
+
if (!this._config.tStatusNoResults) this._config.tStatusNoResults = () => 'Nessun risultato di ricerca';
|
|
31
|
+
if (!this._config.tStatusSelectedOption)
|
|
32
|
+
this._config.tStatusSelectedOption = (selectedOption, length, index) => `${selectedOption} ${index + 1} di ${length} è sottolineato`;
|
|
33
|
+
if (!this._config.tStatusResults)
|
|
34
|
+
this._config.tStatusResults = (length, contentSelectedOption) => {
|
|
35
|
+
const words = {
|
|
36
|
+
result: length === 1 ? 'risultato' : 'risultati',
|
|
37
|
+
is: length === 1 ? 'è' : 'sono',
|
|
38
|
+
available: length === 1 ? 'disponibile' : 'disponibili',
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return `${length} ${words.result} ${words.is} ${words.available}. ${contentSelectedOption}`
|
|
42
|
+
};
|
|
24
43
|
this._enhance();
|
|
25
44
|
}
|
|
26
45
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-autocomplete.js","sources":["../../src/js/plugins/select-autocomplete.js"],"sourcesContent":["import accessibleAutocomplete from 'accessible-autocomplete'\n\nimport BaseComponent from 'bootstrap/js/src/base-component.js'\n\nconst NAME = 'selectautocomplete'\n\nfunction onClassChange(element, callback) {\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'attributes' && mutation.attributeName === 'class') {\n callback(mutation.target)\n }\n })\n })\n observer.observe(element, { attributes: true })\n return observer.disconnect\n}\n\nclass SelectAutocomplete extends BaseComponent {\n constructor(element, config) {\n super(element)\n this._hasFormControl = element.classList.contains('form-control')\n this.element_original_id = this._element.id\n this._config = config\n this._enhance()\n }\n\n // Getters\n\n static get NAME() {\n return NAME\n }\n\n // Private\n _enhance() {\n accessibleAutocomplete.enhanceSelectElement(Object.assign({}, { selectElement: this._element }, this._config))\n setTimeout(() => {\n if (this._hasFormControl) {\n if (typeof document === 'undefined') {\n return\n }\n const inputField = document.getElementById(this.element_original_id)\n inputField.classList.add('form-control')\n onClassChange(inputField, (node) => {\n if (!node.classList.contains('form-control')) {\n node.classList.add('form-control')\n }\n })\n }\n }, 100)\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\nexport default SelectAutocomplete\n"],"names":[],"mappings":";;;AAIA,MAAM,IAAI,GAAG,qBAAoB;AACjC;AACA,SAAS,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE;AAC1C,EAAE,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,SAAS,KAAK;AACvD,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK;AACpC,MAAM,IAAI,QAAQ,CAAC,IAAI,KAAK,YAAY,IAAI,QAAQ,CAAC,aAAa,KAAK,OAAO,EAAE;AAChF,QAAQ,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAC;AACjC,O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C,cAAc,CAAC,EAAE;AACxD,YAAY,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,EAAC;AAC9C,WAAW;AACX,SAAS,EAAC;AACV,OAAO;AACP,KAAK,EAAE,GAAG,EAAC;AACX,GAAG;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"select-autocomplete.js","sources":["../../src/js/plugins/select-autocomplete.js"],"sourcesContent":["import accessibleAutocomplete from 'accessible-autocomplete'\n\nimport BaseComponent from 'bootstrap/js/src/base-component.js'\n\nconst NAME = 'selectautocomplete'\n\nfunction onClassChange(element, callback) {\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'attributes' && mutation.attributeName === 'class') {\n callback(mutation.target)\n }\n })\n })\n observer.observe(element, { attributes: true })\n return observer.disconnect\n}\n\nclass SelectAutocomplete extends BaseComponent {\n constructor(element, config) {\n super(element)\n this._hasFormControl = element.classList.contains('form-control')\n this.element_original_id = this._element.id\n this._config = config\n if (!this._config.tAssistiveHint)\n this._config.tAssistiveHint = () =>\n 'Quando i risultati del completamento automatico sono disponibili, usa le frecce su e giù per rivedere e Invio per selezionare. Utenti di dispositivi touch, esplora tramite tocco o con gesti di scorrimento'\n if (!this._config.tNoResults) this._config.tNoResults = () => 'Nessun risultato trovato'\n if (!this._config.tStatusQueryTooShort)\n this._config.tStatusQueryTooShort = (minQueryLength) => `Digita ${minQueryLength} o più caratteri per mostrare le opzioni di ricerca`\n if (!this._config.tStatusNoResults) this._config.tStatusNoResults = () => 'Nessun risultato di ricerca'\n if (!this._config.tStatusSelectedOption)\n this._config.tStatusSelectedOption = (selectedOption, length, index) => `${selectedOption} ${index + 1} di ${length} è sottolineato`\n if (!this._config.tStatusResults)\n this._config.tStatusResults = (length, contentSelectedOption) => {\n const words = {\n result: length === 1 ? 'risultato' : 'risultati',\n is: length === 1 ? 'è' : 'sono',\n available: length === 1 ? 'disponibile' : 'disponibili',\n }\n\n return `${length} ${words.result} ${words.is} ${words.available}. ${contentSelectedOption}`\n }\n this._enhance()\n }\n\n // Getters\n\n static get NAME() {\n return NAME\n }\n\n // Private\n _enhance() {\n accessibleAutocomplete.enhanceSelectElement(Object.assign({}, { selectElement: this._element }, this._config))\n setTimeout(() => {\n if (this._hasFormControl) {\n if (typeof document === 'undefined') {\n return\n }\n const inputField = document.getElementById(this.element_original_id)\n inputField.classList.add('form-control')\n onClassChange(inputField, (node) => {\n if (!node.classList.contains('form-control')) {\n node.classList.add('form-control')\n }\n })\n }\n }, 100)\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\nexport default SelectAutocomplete\n"],"names":[],"mappings":";;;AAIA,MAAM,IAAI,GAAG,qBAAoB;AACjC;AACA,SAAS,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE;AAC1C,EAAE,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,SAAS,KAAK;AACvD,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK;AACpC,MAAM,IAAI,QAAQ,CAAC,IAAI,KAAK,YAAY,IAAI,QAAQ,CAAC,aAAa,KAAK,OAAO,EAAE;AAChF,QAAQ,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAC;AACjC,OAAO;AACP,KAAK,EAAC;AACN,GAAG,EAAC;AACJ,EAAE,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAC;AACjD,EAAE,OAAO,QAAQ,CAAC,UAAU;AAC5B,CAAC;AACD;AACA,MAAM,kBAAkB,SAAS,aAAa,CAAC;AAC/C,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE;AAC/B,IAAI,KAAK,CAAC,OAAO,EAAC;AAClB,IAAI,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAC;AACrE,IAAI,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,QAA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CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,qBAAqB,CAAC,CAAC;AACnG,QAAO;AACP,IAAI,IAAI,CAAC,QAAQ,GAAE;AACnB,GAAG;AACH;AACA;AACA;AACA,EAAE,WAAW,IAAI,GAAG;AACpB,IAAI,OAAO,IAAI;AACf,GAAG;AACH;AACA;AACA,EAAE,QAAQ,GAAG;AACb,IAAI,sBAAsB,CAAC,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAC;AAClH,IAAI,UAAU,CAAC,MAAM;AACrB,MAAM,IAAI,IAAI,CAAC,eAAe,EAAE;AAChC,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;AAC7C,UAAU,MAAM;AAChB,SAAS;AACT,QAAQ,MAAM,UAAU,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,mBAAmB,EAAC;AAC5E,QAAQ,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,EAAC;AAChD,QAAQ,aAAa,CAAC,UAAU,EAAE,CAAC,IAAI,KAAK;AAC5C,UAAU,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE;AACxD,YAAY,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,EAAC;AAC9C,WAAW;AACX,SAAS,EAAC;AACV,OAAO;AACP,KAAK,EAAE,GAAG,EAAC;AACX,GAAG;AACH;;;;"}
|
package/dist/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// bootstrap italia version variable
|
|
2
2
|
// useful to check for the current version
|
|
3
3
|
// eslint-disable-next-line no-unused-vars
|
|
4
|
-
const BOOTSTRAP_ITALIA_VERSION = '2.9.
|
|
4
|
+
const BOOTSTRAP_ITALIA_VERSION = '2.9.1';
|
|
5
5
|
|
|
6
6
|
export { BOOTSTRAP_ITALIA_VERSION as default };
|
|
7
7
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../src/js/version.js"],"sourcesContent":["// bootstrap italia version variable\n// useful to check for the current version\n// eslint-disable-next-line no-unused-vars\nconst BOOTSTRAP_ITALIA_VERSION = '2.9.
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../src/js/version.js"],"sourcesContent":["// bootstrap italia version variable\n// useful to check for the current version\n// eslint-disable-next-line no-unused-vars\nconst BOOTSTRAP_ITALIA_VERSION = '2.9.1'\nexport default BOOTSTRAP_ITALIA_VERSION\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACK,MAAC,wBAAwB,GAAG;;;;"}
|
package/package.json
CHANGED
|
@@ -13,10 +13,15 @@ const CLASS_NAME_SRONLY = 'sr-only-justvalidate-bi'
|
|
|
13
13
|
const SELECTOR_SPAN_SRONLY = `.${CLASS_NAME_SRONLY}`
|
|
14
14
|
|
|
15
15
|
class FormValidate {
|
|
16
|
-
constructor(selector, config) {
|
|
16
|
+
constructor(selector, config, dictLocale) {
|
|
17
17
|
this.formSelector = selector
|
|
18
18
|
this.target = document.querySelector(selector)
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
if (dictLocale != undefined) this.validate = new JustValidate(selector, config, dictLocale)
|
|
21
|
+
else {
|
|
22
|
+
this.validate = new JustValidate(selector, config)
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
this.config = Object.assign({}, CONFIG_DEFAULT, this.validate.globalConfig)
|
|
21
26
|
this.formItems = []
|
|
22
27
|
|
|
@@ -22,6 +22,25 @@ class SelectAutocomplete extends BaseComponent {
|
|
|
22
22
|
this._hasFormControl = element.classList.contains('form-control')
|
|
23
23
|
this.element_original_id = this._element.id
|
|
24
24
|
this._config = config
|
|
25
|
+
if (!this._config.tAssistiveHint)
|
|
26
|
+
this._config.tAssistiveHint = () =>
|
|
27
|
+
'Quando i risultati del completamento automatico sono disponibili, usa le frecce su e giù per rivedere e Invio per selezionare. Utenti di dispositivi touch, esplora tramite tocco o con gesti di scorrimento'
|
|
28
|
+
if (!this._config.tNoResults) this._config.tNoResults = () => 'Nessun risultato trovato'
|
|
29
|
+
if (!this._config.tStatusQueryTooShort)
|
|
30
|
+
this._config.tStatusQueryTooShort = (minQueryLength) => `Digita ${minQueryLength} o più caratteri per mostrare le opzioni di ricerca`
|
|
31
|
+
if (!this._config.tStatusNoResults) this._config.tStatusNoResults = () => 'Nessun risultato di ricerca'
|
|
32
|
+
if (!this._config.tStatusSelectedOption)
|
|
33
|
+
this._config.tStatusSelectedOption = (selectedOption, length, index) => `${selectedOption} ${index + 1} di ${length} è sottolineato`
|
|
34
|
+
if (!this._config.tStatusResults)
|
|
35
|
+
this._config.tStatusResults = (length, contentSelectedOption) => {
|
|
36
|
+
const words = {
|
|
37
|
+
result: length === 1 ? 'risultato' : 'risultati',
|
|
38
|
+
is: length === 1 ? 'è' : 'sono',
|
|
39
|
+
available: length === 1 ? 'disponibile' : 'disponibili',
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return `${length} ${words.result} ${words.is} ${words.available}. ${contentSelectedOption}`
|
|
43
|
+
}
|
|
25
44
|
this._enhance()
|
|
26
45
|
}
|
|
27
46
|
|
package/src/js/version.js
CHANGED
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
@import 'bootstrap/scss/breadcrumb';
|
|
45
45
|
@import 'bootstrap/scss/pagination';
|
|
46
46
|
@import 'bootstrap/scss/badge';
|
|
47
|
-
@import 'bootstrap/scss/alert';
|
|
48
47
|
@import 'bootstrap/scss/progress';
|
|
49
48
|
@import 'bootstrap/scss/list-group';
|
|
50
49
|
@import 'bootstrap/scss/close';
|
|
@@ -11,9 +11,6 @@
|
|
|
11
11
|
background-position: 20px 12px;
|
|
12
12
|
background-repeat: no-repeat;
|
|
13
13
|
background-size: 32px 32px;
|
|
14
|
-
.alert-link {
|
|
15
|
-
color: $link-color;
|
|
16
|
-
}
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
// Headings for larger alerts
|
|
@@ -25,13 +22,13 @@
|
|
|
25
22
|
|
|
26
23
|
// Provide class for links that match alerts
|
|
27
24
|
.alert-link {
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
color: $link-color;
|
|
26
|
+
font-weight: $font-weight-semibold;
|
|
27
|
+
text-decoration: underline;
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
// Dismissible alerts
|
|
33
31
|
// Expand the right padding and account for the close button's positioning.
|
|
34
|
-
|
|
35
32
|
.alert-dismissible {
|
|
36
33
|
padding-right: ($alert-padding-x * 2);
|
|
37
34
|
// Adjust close link position
|
|
@@ -47,7 +44,6 @@
|
|
|
47
44
|
|
|
48
45
|
// Alternate styles
|
|
49
46
|
// Generate contextual modifier classes for colorizing the alert.
|
|
50
|
-
|
|
51
47
|
@each $color, $value in $theme-colors {
|
|
52
48
|
@if ($color == 'danger' or $color == 'warning' or $color == 'success' or $color == 'info' or $color == 'primary') {
|
|
53
49
|
.alert-#{$color} {
|