diff --git a/CHANGELOG.md b/CHANGELOG.md index 76d800e..025ccd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ ## Unreleased -### Fixes +## 2.0.0 - 2024-09-12 + +### Breaking changes - [Pull request #125: Update Accessible Autocomplete to v3.0.1](https://github.com/alphagov/govuk-country-and-territory-autocomplete/pull/125) diff --git a/dist/location-autocomplete.min.css b/dist/location-autocomplete.min.css index 586fd16..65463a1 100644 --- a/dist/location-autocomplete.min.css +++ b/dist/location-autocomplete.min.css @@ -1 +1,3 @@ -.autocomplete__wrapper{position:relative}.autocomplete__hint,.autocomplete__input{-webkit-appearance:none;border:2px solid #0b0c0c;border-radius:0;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;margin-bottom:0;width:100%}.autocomplete__input{background-color:transparent;position:relative}.autocomplete__hint{color:#b1b4b6;position:absolute}.autocomplete__input--default{padding:5px}.autocomplete__input--focused{outline:3px solid #fd0;outline-offset:0;box-shadow:inset 0 0 0 2px}.autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:rgba(0,0,0,.256863) 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:solid #b1b4b6;border-width:1px 0;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}@media (-ms-high-contrast:active),(forced-colors:active){.autocomplete__menu{border-color:FieldText}.autocomplete__option{background-color:Field;color:FieldText}.autocomplete__option--focused,.autocomplete__option:hover{forced-color-adjust:none;background-color:SelectedItem;border-color:SelectedItem;color:SelectedItemText;outline-color:SelectedItemText}}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:16px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:19px;line-height:1.31579}} \ No newline at end of file +.autocomplete__wrapper{position:relative}.autocomplete__hint,.autocomplete__input{-webkit-appearance:none;appearance:none;border:2px solid #0b0c0c;border-radius:0;box-sizing:border-box;height:2.5rem;line-height:1.25;margin-bottom:0;width:100%}.autocomplete__input{background-color:transparent;position:relative}.autocomplete__hint{color:#505a5f;position:absolute}.autocomplete__input--default{padding:5px}.autocomplete__input--focused{box-shadow:inset 0 0 0 2px;outline:3px solid #fd0;outline-offset:0}.autocomplete__input--show-all-values{cursor:pointer;padding:5px 35px 5px 5px}.autocomplete__dropdown-arrow-down{display:inline-block;height:24px;position:absolute;right:8px;top:10px;width:24px;z-index:-1}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:0 2px 6px rgba(0,0,0,.257);left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:1px solid #b1b4b6;border-left-width:0;border-right-width:0;border-top-width:1px;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#f3f2f1}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:none}@media (-ms-high-contrast:active),(forced-colors:active){.autocomplete__menu{border-color:FieldText}.autocomplete__option{background-color:Field;color:FieldText}.autocomplete__option--focused,.autocomplete__option:hover{background-color:Highlight;background-color:SelectedItem;border-color:SelectedItem;color:HighlightText;color:SelectedItemText;forced-color-adjust:none;outline-color:SelectedItemText}}.autocomplete__option--no-results{background-color:#f3f2f1;color:#505a5f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:1rem;font-weight:400}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:1.1875rem;line-height:1.3157894737}} + +/*# sourceMappingURL=accessible-autocomplete.min.css.map*/ \ No newline at end of file diff --git a/dist/location-autocomplete.min.js b/dist/location-autocomplete.min.js index bd07294..60da61b 100644 --- a/dist/location-autocomplete.min.js +++ b/dist/location-autocomplete.min.js @@ -1,2 +1,2 @@ -(function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["openregisterLocationPicker"]=t():e["openregisterLocationPicker"]=t()})(self,(function(){return function(){var e={2204:function(e){var t;window,t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.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 i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));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),i=n(6),o=n(7),a=n(16),u=n(18),s="prototype",c=function(e,t,n){var l,f,p,d,h=e&c.F,m=e&c.G,v=e&c.S,g=e&c.P,y=e&c.B,x=m?r:v?r[t]||(r[t]={}):(r[t]||{})[s],b=m?i:i[t]||(i[t]={}),w=b[s]||(b[s]={});for(l in m&&(n=t),n)p=((f=!h&&x&&x[l]!==undefined)?x:n)[l],d=y&&f?u(p,r):g&&"function"==typeof p?u(Function.call,p):p,x&&a(x,l,p,e&c.U),b[l]!=p&&o(b,l,d),g&&w[l]!=p&&(w[l]=p)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},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(t){return!0}}},function(e,t,n){"use strict";n.r(t),n.d(t,"h",(function(){return u})),n.d(t,"createElement",(function(){return u})),n.d(t,"cloneElement",(function(){return l})),n.d(t,"Component",(function(){return q})),n.d(t,"render",(function(){return P})),n.d(t,"rerender",(function(){return h})),n.d(t,"options",(function(){return i}));var r=function(){},i={},o=[],a=[];function u(e,t){var n,u,s,c,l=a;for(c=arguments.length;2s;)r(u,n=t[s++])&&(~o(c,n)||c.push(n));return c}},function(e,t,n){var r=n(25),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):o(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),i=n(33),o=n(34)("species");e.exports=function(e){var t;return i(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!i(t.prototype)||(t=undefined),r(t)&&null===(t=t[o])&&(t=undefined)),t===undefined?Array:t}},function(e,t,n){"use strict";var r=n(0),i=n(32)(2);r(r.P+r.F*!n(13)([].filter,!0),"Array",{filter:function(e){return i(this,e,arguments[1])}})},function(e,t,n){var r=n(0);r(r.S,"Array",{isArray:n(33)})},function(e,t,n){"use strict";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),i=a(n(60)),o=a(n(61));function a(e){return e&&e.__esModule?e:{"default":e}}function u(){return(u=Object.assign||function(e){for(var t=1;t=r;this.setState({query:u,ariaHint:s}),o||!s&&c&&l?i(u,(function(e){var n=0=o&&0=c,M=this.props.showNoOptionsFound&&D&&L&&q&&P,F=o+"__wrapper",R=o+"__input",I=null!==T?" "+R+"--focused":"",H=this.props.showAllValues?" "+R+"--show-all-values":" "+R+"--default",B=o+"__dropdown-arrow-down",W=-1!==T&&null!==T,z=o+"__menu",$=z+"--"+a,U=z+"--"+(_||M?"visible":"hidden"),V=o+"__option",K=o+"__hint",X=this.templateInputValue(E[O]),G=X&&0===X.toLowerCase().indexOf(k.toLowerCase())&&N?k+X.substr(k.length):"",Q=s+"__assistiveHint",J=j?{"aria-describedby":Q}:null;return h&&"string"==typeof(e=w({className:B}))&&(e=(0,r.createElement)("div",{className:o+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:e}})),(0,r.createElement)("div",{className:F,onKeyDown:this.handleKeyDown},(0,r.createElement)(i["default"],{id:s,length:E.length,queryLength:k.length,minQueryLength:c,selectedOption:this.templateInputValue(E[O]),selectedOptionIndex:O,validChoiceMade:A,isInFocus:null!==this.state.focused,tQueryTooShort:v,tNoResults:g,tSelectedOption:y,tResults:x}),G&&(0,r.createElement)("span",null,(0,r.createElement)("input",{className:K,readonly:!0,tabIndex:"-1",value:G})),(0,r.createElement)("input",u({"aria-expanded":_?"true":"false","aria-activedescendant":!!W&&s+"__option--"+T,"aria-owns":s+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"},J,{autoComplete:"off",className:""+R+I+H,id:s,onClick:function(e){return t.handleInputClick(e)},onBlur:this.handleInputBlur},function(e){return{onInput:e}}(this.handleInputChange),{onFocus:this.handleInputFocus,name:f,placeholder:p,ref:function(e){t.elementReferences[-1]=e},type:"text",role:"combobox",required:d,value:k})),e,(0,r.createElement)("ul",{className:z+" "+$+" "+U,onMouseLeave:function(e){return t.handleListMouseLeave(e)},id:s+"__listbox",role:"listbox"},E.map((function(e,n){var i=(-1===T?O===n:T===n)&&null===S?" "+V+"--focused":"",o=n%2?" "+V+"--odd":"",a=l()?" '+(n+1)+" of "+E.length+"":"";return(0,r.createElement)("li",{"aria-selected":T===n?"true":"false",className:""+V+i+o,dangerouslySetInnerHTML:{__html:t.templateSuggestion(e)+a},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})})),M&&(0,r.createElement)("li",{className:V+" "+V+"--no-results"},m())),(0,r.createElement)("span",{id:Q,style:{display:"none"}},b()))},t}(r.Component);(t["default"]=f).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:o["default"]}},function(e,t,n){var r=n(9),i=n(53),o=n(28),a=n(26)("IE_PROTO"),u=function(){},s="prototype",c=function(){var e,t=n(15)("iframe"),r=o.length;for(t.style.display="none",n(54).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("