@digibib/deichman-admin-frontend-common
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -11,2 +11,10 @@ # Changelog | ||
## 2.3.0 | ||
* `Added` Autocomplete - `allowFreeText` flag to enable submitting free text values. Read the docs for details! | ||
* `Added` Autocomplete - improved dev app to test diverse setup options. | ||
* `Fixed` Autocomplete - More robustness when it comes to component hiding. Related methods are checking if the | ||
component is part of the dom (`component !== null`) before executing calls, that might end up in erroneous scenarios. | ||
* `Fixed` Autocomplete - sourcemap files are now part of the distribution. | ||
## 2.2.0 | ||
@@ -13,0 +21,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("svelte/internal"),require("svelte")):"function"==typeof define&&define.amd?define(["exports","svelte/internal","svelte"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Autocomplete={},e["svelte/internal"],e.svelte)}(this,(function(e,t,i){"use strict";class n{constructor({originalItem:e,displayLabel:t,originalLabel:i,highlighted:n}){this._originalItem=e,this._displayLabel=t,this._originalLabel=i,this._highlighted=n,this.key=Symbol(),this._index=0}get originalItem(){return this._originalItem}get originalLabel(){return this._originalLabel}get index(){return this._index}set index(e){this._index=e}get displayLabel(){return this._displayLabel}set displayLabel(e){this._displayLabel=e}get highlighted(){return this._highlighted}set highlighted(e){this._highlighted=e}}class s{constructor(e,t){this.labelFunction=t,this.items=e.map(this.convertItem.bind(this)),this.sortItems()}filter(e,t=!1){const i=new RegExp(s.escapeRegExp(e),t?"":"i");return this.items.filter(t=>""===e||t.originalLabel.match(i)).map((e,t)=>(e.index=t,e.displayLabel=e.originalLabel.replace(i,(function(e){return""!=e?`<B>${e}</B>`:""})),e))}addItem(e){this.items=[...this.items,this.convertItem(e)],this.sortItems()}remove(e){this.items=this.items.filter(t=>t.key!==e.key)}hasItems(){return 0!==this.items.length}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}sortItems(){this.items.sort((e,t)=>e.originalLabel.localeCompare(t.originalLabel))}convertItem(e){return new n({originalItem:e,displayLabel:this.labelFunction(e),originalLabel:this.labelFunction(e),highlighted:!1})}}class l{constructor(e=!1){this._opened=!1,this._userOpened=!1,this._highlightedItem=null,this.filterText="",this._filteredItems=[],this.internalItems=null,this.filterCaseSensitive=e}highlight(e){return null!=this._highlightedItem&&(this._highlightedItem.highlighted=!1,this._highlightedItem=null),null!=e?(e.highlighted=!0,this._highlightedItem=e):this._highlightedItem=null,this}highlightNext(){if(null!=this._highlightedItem){const e=this._highlightedItem.index+1<this._filteredItems.length?this._highlightedItem.index+1:0;this.highlight(this._filteredItems[e])}return this}highlightPrev(){if(null!=this._highlightedItem){const e=0===this._highlightedItem.index?this._filteredItems.length-1:this._highlightedItem.index-1;this.highlight(this._filteredItems[e])}return this}shiftHighlightBy(e){if(null!=this._highlightedItem){const t=this._highlightedItem.index,i=Math.min(Math.max(0,t+e),this._filteredItems.length-1);this.highlight(this._filteredItems[i])}return this}setOpened(e){return this._opened=e,e?this._userClosed=!1:this._userOpened=!1,this}get opened(){return this._opened}setUserOpened(e){return this._userOpened=e,this}setItems(e,t){return this.internalItems=new s(e,t),this.filter(this.filterText),this.highlight(null),this}hasItems(){return this.internalItems.hasItems()}addItem(e){var t;return null===(t=this.internalItems)||void 0===t||t.addItem(e),this.filter(this.filterText),this}filter(e){var t,i;return this.filterText=e,this._filteredItems=null!==(i=null===(t=this.internalItems)||void 0===t?void 0:t.filter(this.filterText,this.filterCaseSensitive))&&void 0!==i?i:[],null!=this._highlightedItem&&this._filteredItems.some(e=>e.key===this._highlightedItem.key)||this.highlight(this._filteredItems[0]),this}isHighlighted(e){return this._highlightedItem.key===e.key}removeHighlighted(){if(null!=this._highlightedItem){const e=Math.max(this._highlightedItem.index-1,0);this.internalItems.remove(this._highlightedItem),this.filter(this.filterText),this._filteredItems.length>0?this.highlight(this._filteredItems[e]):this.highlight(null)}return this}get userClosed(){return this._userClosed}set userClosed(e){this._userClosed=e}get userOpened(){return this._userOpened}set userOpened(e){this._userOpened=e}get highlightedItem(){return this._highlightedItem}get filteredItems(){return this._filteredItems}}var o;!function(e){e.AC_LIST="ac-list",e.AC_LIST_ITEM="ac-list-item",e.CLOSE_LIST="close-list",e.OPEN_LIST="open-list",e.ROOT="root"}(o||(o={}));var a=o;const{window:r}=t.globals;function h(e){t.append_styles(e,"svelte-aniw8a","div.autocomplete.svelte-aniw8a{position:relative;display:flex;align-content:center;justify-content:start}label.input-label.svelte-aniw8a{text-align:right;color:#aaaaaa;white-space:nowrap;min-width:6rem;margin:auto 0}input.svelte-aniw8a{display:inline-block;width:auto;min-width:10rem}input.wide.svelte-aniw8a{width:100%}div.input-and-icons.svelte-aniw8a{position:relative;display:flex;align-items:center;justify-content:stretch}div.input-and-icons.wide.svelte-aniw8a{width:100%}div.dropdown.svelte-aniw8a{background:#fff;position:absolute;max-width:100%;min-width:200px;overflow-y:auto;z-index:99;padding:0 0;top:0;border:1px solid #999;max-height:calc(10 * (1rem + 10px) + 15px);user-select:none}div.dropdown.hidden.svelte-aniw8a{visibility:hidden}div.list-item.highlighted.svelte-aniw8a{background-color:#bbbb}div.openClose.svelte-aniw8a{display:inline-block;position:relative;left:-1.2rem;font-size:0.7rem;user-select:none;width:1.5rem}div.openClose.wide.svelte-aniw8a{position:absolute;left:calc(100% - 1.2rem)}div.openClose.arrow.svelte-aniw8a{transform:scale(1.5, 1)}div.openClose.circle.svelte-aniw8a{transform:scale(1.5, 1.5)}div.openClose.svelte-aniw8a:hover{cursor:pointer}")}function d(e,t,i){const n=e.slice();return n[60]=t[i],n}const u=e=>({item:4096&e[0],displayLabel:4096&e[0]}),c=e=>({item:e[60].originalItem,displayLabel:e[60].displayLabel}),g=e=>({}),p=e=>({}),m=e=>({}),f=e=>({});function _(e){let i,n,s,l;const o=[I,v],a=[];function r(e,t){return e[12].opened?0:1}return i=r(e),n=a[i]=o[i](e),{c(){n.c(),s=t.empty()},m(e,n){a[i].m(e,n),t.insert(e,s,n),l=!0},p(e,l){let h=i;i=r(e),i===h?a[i].p(e,l):(t.group_outros(),t.transition_out(a[h],1,1,()=>{a[h]=null}),t.check_outros(),n=a[i],n?n.p(e,l):(n=a[i]=o[i](e),n.c()),t.transition_in(n,1),n.m(s.parentNode,s))},i(e){l||(t.transition_in(n),l=!0)},o(e){t.transition_out(n),l=!1},d(e){a[i].d(e),e&&t.detach(s)}}}function v(e){let i,n,s,l;const o=e[38].openIcon,r=t.create_slot(o,e,e[37],p),h=r||function(e){let i;return{c(){i=t.text("ᐯ")},m(e,n){t.insert(e,i,n)},d(e){e&&t.detach(i)}}}();return{c(){i=t.element("div"),h&&h.c(),t.attr(i,"class","openClose arrow svelte-aniw8a"),t.attr(i,"data-testid",a.OPEN_LIST),t.toggle_class(i,"wide",e[7])},m(o,a){t.insert(o,i,a),h&&h.m(i,null),n=!0,s||(l=t.listen(i,"mousedown",e[43]),s=!0)},p(e,s){r&&r.p&&(!n||64&s[1])&&t.update_slot_base(r,o,e,e[37],n?t.get_slot_changes(o,e[37],s,g):t.get_all_dirty_from_scope(e[37]),p),128&s[0]&&t.toggle_class(i,"wide",e[7])},i(e){n||(t.transition_in(h,e),n=!0)},o(e){t.transition_out(h,e),n=!1},d(e){e&&t.detach(i),h&&h.d(e),s=!1,l()}}}function I(e){let i,n,s,l;const o=e[38].closeIcon,r=t.create_slot(o,e,e[37],f),h=r||function(e){let i;return{c(){i=t.text("Ⓧ")},m(e,n){t.insert(e,i,n)},d(e){e&&t.detach(i)}}}();return{c(){i=t.element("div"),h&&h.c(),t.attr(i,"class","openClose circle svelte-aniw8a"),t.attr(i,"data-testid",a.CLOSE_LIST),t.toggle_class(i,"wide",e[7])},m(o,a){t.insert(o,i,a),h&&h.m(i,null),n=!0,s||(l=t.listen(i,"mousedown",e[42]),s=!0)},p(e,s){r&&r.p&&(!n||64&s[1])&&t.update_slot_base(r,o,e,e[37],n?t.get_slot_changes(o,e[37],s,m):t.get_all_dirty_from_scope(e[37]),f),128&s[0]&&t.toggle_class(i,"wide",e[7])},i(e){n||(t.transition_in(h,e),n=!0)},o(e){t.transition_out(h,e),n=!1},d(e){e&&t.detach(i),h&&h.d(e),s=!1,l()}}}function w(e){let i,n,s=`${e[12].filteredItems.length} ${e[12].filteredItems.length>1?e[4].hits:e[4].hit}`;return{c(){i=t.element("label"),n=t.text(s),t.attr(i,"class","input-label svelte-aniw8a"),t.attr(i,"for",e[15])},m(e,s){t.insert(e,i,s),t.append(i,n)},p(e,i){4112&i[0]&&s!==(s=`${e[12].filteredItems.length} ${e[12].filteredItems.length>1?e[4].hits:e[4].hit}`)&&t.set_data(n,s)},d(e){e&&t.detach(i)}}}function b(e){let i,n,s=e[4].noHit+"";return{c(){i=t.element("div"),n=t.text(s),t.attr(i,"class","list-item")},m(e,s){t.insert(e,i,s),t.append(i,n)},p(e,i){16&i[0]&&s!==(s=e[4].noHit+"")&&t.set_data(n,s)},i:t.noop,o:t.noop,d(e){e&&t.detach(i)}}}function y(e){let i,n,s=e[12].filteredItems,l=[];for(let t=0;t<s.length;t+=1)l[t]=x(d(e,s,t));const o=e=>t.transition_out(l[e],1,1,()=>{l[e]=null});return{c(){for(let e=0;e<l.length;e+=1)l[e].c();i=t.empty()},m(e,s){for(let t=0;t<l.length;t+=1)l[t].m(e,s);t.insert(e,i,s),n=!0},p(e,n){if(21008384&n[0]|64&n[1]){let a;for(s=e[12].filteredItems,a=0;a<s.length;a+=1){const o=d(e,s,a);l[a]?(l[a].p(o,n),t.transition_in(l[a],1)):(l[a]=x(o),l[a].c(),t.transition_in(l[a],1),l[a].m(i.parentNode,i))}for(t.group_outros(),a=s.length;a<l.length;a+=1)o(a);t.check_outros()}},i(e){if(!n){for(let e=0;e<s.length;e+=1)t.transition_in(l[e]);n=!0}},o(e){l=l.filter(Boolean);for(let e=0;e<l.length;e+=1)t.transition_out(l[e]);n=!1},d(e){t.destroy_each(l,e),e&&t.detach(i)}}}function x(e){let i,n,s,l,o;const r=e[38].listItem,h=t.create_slot(r,e,e[37],c),d=h||function(e){let i,n,s=e[60].displayLabel+"";return{c(){i=new t.HtmlTag(!1),n=t.empty(),i.a=n},m(e,l){i.m(s,e,l),t.insert(e,n,l)},p(e,t){4096&t[0]&&s!==(s=e[60].displayLabel+"")&&i.p(s)},d(e){e&&t.detach(n),e&&i.d()}}}(e);function g(){return e[44](e[60])}return{c(){i=t.element("div"),d&&d.c(),n=t.space(),t.attr(i,"data-testid",a.AC_LIST_ITEM),t.attr(i,"class",t.null_to_empty("list-item "+e[15])+" svelte-aniw8a"),t.toggle_class(i,"highlighted",e[12].isHighlighted(e[60]))},m(a,r){t.insert(a,i,r),d&&d.m(i,null),t.append(i,n),s=!0,l||(o=[t.listen(i,"pointerenter",g),t.listen(i,"mousedown",e[45])],l=!0)},p(n,l){e=n,h?h.p&&(!s||4096&l[0]|64&l[1])&&t.update_slot_base(h,r,e,e[37],s?t.get_slot_changes(r,e[37],l,u):t.get_all_dirty_from_scope(e[37]),c):d&&d.p&&(!s||4096&l[0])&&d.p(e,s?l:[-1,-1,-1]),4096&l[0]&&t.toggle_class(i,"highlighted",e[12].isHighlighted(e[60]))},i(e){s||(t.transition_in(d,e),s=!0)},o(e){t.transition_out(d,e),s=!1},d(e){e&&t.detach(i),d&&d.d(e),l=!1,t.run_all(o)}}}function O(e){let i,n,s,l,o,h,d,u,c,g,p,m,f,v,I,x,O,S=e[12].hasItems(),L=[{autocomplete:"off"},{class:l=e[3].join(" ")},{id:e[15]},{style:e[2]},{tabindex:e[8]},{placeholder:o=e[12].hasItems()?e[9]:void 0},{disabled:h=!e[12].hasItems()},{type:"text"},e[10]],k={};for(let e=0;e<L.length;e+=1)k=t.assign(k,L[e]);let T=S&&_(e),N=e[6]&&w(e);const H=[y,b],E=[];function P(e,t){return e[12].filteredItems.length>0?0:1}return p=P(e),m=E[p]=H[p](e),{c(){i=t.element("div"),n=t.element("div"),s=t.element("input"),d=t.space(),T&&T.c(),u=t.space(),N&&N.c(),c=t.space(),g=t.element("div"),m.c(),t.set_attributes(s,k),t.toggle_class(s,"wide",e[7]),t.toggle_class(s,"svelte-aniw8a",!0),t.attr(n,"class","input-and-icons svelte-aniw8a"),t.toggle_class(n,"wide",e[7]),t.attr(g,"data-testid",a.AC_LIST),t.attr(g,"class","dropdown svelte-aniw8a"),t.attr(g,"style",f="z-index: "+(e[5]+1)),t.toggle_class(g,"hidden",!(e[12].opened&&e[12].hasItems())),t.attr(i,"class",v=t.null_to_empty(`autocomplete ${e[15]} ${e[0].join(" ")}`)+" svelte-aniw8a"),t.attr(i,"style",e[1]),t.attr(i,"data-testid",a.ROOT)},m(l,o){t.insert(l,i,o),t.append(i,n),t.append(n,s),s.autofocus&&s.focus(),e[40](s),t.set_input_value(s,e[11]),t.append(n,d),T&&T.m(n,null),t.append(i,u),N&&N.m(i,null),t.append(i,c),t.append(i,g),E[p].m(g,null),e[46](g),I=!0,x||(O=[t.listen(r,"mousedown",e[23]),t.listen(r,"scroll",e[39]),t.listen(s,"input",e[41]),t.listen(s,"blur",e[17]),t.listen(s,"dblclick",e[21]),t.listen(s,"focus",e[16]),t.listen(s,"keydown",e[20]),t.listen(g,"keydown",t.prevent_default(C)),t.listen(g,"scroll",t.stop_propagation(t.prevent_default($))),t.listen(i,"mousedown",t.stop_propagation(t.prevent_default(e[47])))],x=!0)},p(e,a){t.set_attributes(s,k=t.get_spread_update(L,[{autocomplete:"off"},(!I||8&a[0]&&l!==(l=e[3].join(" ")))&&{class:l},{id:e[15]},(!I||4&a[0])&&{style:e[2]},(!I||256&a[0])&&{tabindex:e[8]},(!I||4608&a[0]&&o!==(o=e[12].hasItems()?e[9]:void 0))&&{placeholder:o},(!I||4096&a[0]&&h!==(h=!e[12].hasItems()))&&{disabled:h},{type:"text"},1024&a[0]&&e[10]])),2048&a[0]&&s.value!==e[11]&&t.set_input_value(s,e[11]),t.toggle_class(s,"wide",e[7]),t.toggle_class(s,"svelte-aniw8a",!0),4096&a[0]&&(S=e[12].hasItems()),S?T?(T.p(e,a),4096&a[0]&&t.transition_in(T,1)):(T=_(e),T.c(),t.transition_in(T,1),T.m(n,null)):T&&(t.group_outros(),t.transition_out(T,1,1,()=>{T=null}),t.check_outros()),128&a[0]&&t.toggle_class(n,"wide",e[7]),e[6]?N?N.p(e,a):(N=w(e),N.c(),N.m(i,c)):N&&(N.d(1),N=null);let r=p;p=P(e),p===r?E[p].p(e,a):(t.group_outros(),t.transition_out(E[r],1,1,()=>{E[r]=null}),t.check_outros(),m=E[p],m?m.p(e,a):(m=E[p]=H[p](e),m.c()),t.transition_in(m,1),m.m(g,null)),(!I||32&a[0]&&f!==(f="z-index: "+(e[5]+1)))&&t.attr(g,"style",f),4096&a[0]&&t.toggle_class(g,"hidden",!(e[12].opened&&e[12].hasItems())),(!I||1&a[0]&&v!==(v=t.null_to_empty(`autocomplete ${e[15]} ${e[0].join(" ")}`)+" svelte-aniw8a"))&&t.attr(i,"class",v),(!I||2&a[0])&&t.attr(i,"style",e[1])},i(e){I||(t.transition_in(T),t.transition_in(m),I=!0)},o(e){t.transition_out(T),t.transition_out(m),I=!1},d(n){n&&t.detach(i),e[40](null),T&&T.d(),N&&N.d(),E[p].d(),e[46](null),x=!1,t.run_all(O)}}}let S=0;const C=()=>!1,$=()=>!1;function L(e,n,s){let o,a,{$$slots:r={},$$scope:h}=n;const d=i.createEventDispatcher();let{items:u=[]}=n,{labelFieldName:c=null}=n,{labelFunction:g=null}=n,{containerClassNames:p=[]}=n,{containerStyle:m=""}=n,{inputStyle:f=""}=n,{inputClassNames:_=[]}=n,{i18n:v={hit:" treff",hits:" treff",noHit:"Ingen treff"}}=n,{minCharsToSuggest:I=3}=n,{removeOnSelect:w=!1}=n,{closeOnSelect:b=!0}=n,{zIndexOffset:y=0}=n,{preferOpenUpwards:x=!1}=n,{showNumberOfHits:O=!0}=n,{caseSensitive:C=!1}=n,{wide:$=!1}=n,{tabIndex:L=null}=n,{placeholder:k=null}=n,{inputProps:T={}}=n;const N="autocomplete-"+S++;let H,E,P=!1,A=!1,F="",U=[];function B(e=!1){s(12,a=a.setOpened(!0).setUserOpened(e)),V()}function j(e=!1){s(12,a.userClosed=e,a),s(12,a=a.setOpened(!1))}i.afterUpdate(()=>{U.forEach(e=>e()),U=[]});const z={Escape:function(){s(11,F=""),E.blur(),s(35,P=!1),j(!0)},ArrowDown:R,ArrowUp:R,Enter:D,Backspace:function(){F.length<=1&&j()},Tab:function(){A=!0},PageDown:M,PageUp:M};function R(e){e.stopPropagation(),e.preventDefault(),a.opened?("ArrowDown"===(null==e?void 0:e.key)&&s(12,a=a.highlightNext()),"ArrowUp"===(null==e?void 0:e.key)&&s(12,a=a.highlightPrev()),G()):B(!0)}function D(e){a.opened&&(null!==a.highlightedItem&&(d("select",{selected:a.highlightedItem.originalItem}),w&&(s(12,a=a.removeHighlighted()),a.hasItems()||s(11,F=""),V())),b?j(!0):e&&w&&U.push(()=>{const e=Array.from(document.querySelectorAll(":hover")).find(e=>{var t,i;return(null===(t=e.classList)||void 0===t?void 0:t.contains(N))&&(null===(i=e.classList)||void 0===i?void 0:i.contains("list-item"))});null==e||e.dispatchEvent(new PointerEvent("pointerenter"))}))}function M(e){if(e.stopPropagation(),e.preventDefault(),a.opened){const t="PageDown"===e.key?1:-1,i=H.scrollHeight/a.filteredItems.length,n=Math.floor(H.getBoundingClientRect().height/i)-1;s(12,a=a.shiftHighlightBy(t*n)),G()}else B(!0)}function q(e){a.isHighlighted(e)||s(12,a=a.highlight(e))}function V(){U.push(()=>J()),G()}function G(){U.push(()=>{var e;a.opened&&(null===(e=H.querySelector(".highlighted"))||void 0===e||e.scrollIntoView({behavior:"auto",block:"nearest",inline:"start"}))})}function J(){const{height:e,pageLeft:t}=window.visualViewport,{bottom:i,height:n,top:l}=E.getBoundingClientRect(),{height:o}=H.getBoundingClientRect();s(13,H.style.top=i+o>e||x&&l-o>t?`-${o}px`:n+"px",H)}return e.$$set=e=>{"items"in e&&s(26,u=e.items),"labelFieldName"in e&&s(27,c=e.labelFieldName),"labelFunction"in e&&s(28,g=e.labelFunction),"containerClassNames"in e&&s(0,p=e.containerClassNames),"containerStyle"in e&&s(1,m=e.containerStyle),"inputStyle"in e&&s(2,f=e.inputStyle),"inputClassNames"in e&&s(3,_=e.inputClassNames),"i18n"in e&&s(4,v=e.i18n),"minCharsToSuggest"in e&&s(29,I=e.minCharsToSuggest),"removeOnSelect"in e&&s(30,w=e.removeOnSelect),"closeOnSelect"in e&&s(31,b=e.closeOnSelect),"zIndexOffset"in e&&s(5,y=e.zIndexOffset),"preferOpenUpwards"in e&&s(32,x=e.preferOpenUpwards),"showNumberOfHits"in e&&s(6,O=e.showNumberOfHits),"caseSensitive"in e&&s(33,C=e.caseSensitive),"wide"in e&&s(7,$=e.wide),"tabIndex"in e&&s(8,L=e.tabIndex),"placeholder"in e&&s(9,k=e.placeholder),"inputProps"in e&&s(10,T=e.inputProps),"$$scope"in e&&s(37,h=e.$$scope)},e.$$.update=()=>{402653184&e.$$.dirty[0]&&s(36,o=null!=g?g:null!=c?e=>e[c]:e=>e),67108864&e.$$.dirty[0]|36&e.$$.dirty[1]&&s(12,a=new l(C).setItems(u||[],o)),6144&e.$$.dirty[0]&&(!function(e){s(12,a=a.filter(e)),G()}(F),a.opened&&V()),536877056&e.$$.dirty[0]|16&e.$$.dirty[1]&&(F.length>=I&&!a.opened&&P&&!a.userClosed?B(!1):(a.opened&&!a.userOpened&&F.length<I||!P||a.userClosed)&&j())},[p,m,f,_,v,y,O,$,L,k,T,F,a,H,E,N,function(){s(35,P=!0)},function(){const e=Array.from(document.querySelectorAll(":hover")).some(e=>{var t;return null===(t=e.classList)||void 0===t?void 0:t.contains(N)});s(35,P=!A&&e),U.push(()=>A=!1)},B,j,function(e){return z[e.key]&&z[e.key](e)},function(){!a.opened&&B(!0)},D,function(){s(35,P=!1),j()},q,J,u,c,g,I,w,b,x,C,function(e){s(12,a=a.addItem(e))},P,o,h,r,()=>{a.opened&&J()},function(e){t.binding_callbacks[e?"unshift":"push"](()=>{E=e,s(14,E)})},function(){F=this.value,s(11,F)},()=>j(!0),()=>B(!0),e=>q(e),()=>D(!0),function(e){t.binding_callbacks[e?"unshift":"push"](()=>{H=e,s(13,H)})},()=>E.focus()]}class k extends t.SvelteComponent{constructor(e){super(),t.init(this,e,L,O,t.safe_not_equal,{items:26,labelFieldName:27,labelFunction:28,containerClassNames:0,containerStyle:1,inputStyle:2,inputClassNames:3,i18n:4,minCharsToSuggest:29,removeOnSelect:30,closeOnSelect:31,zIndexOffset:5,preferOpenUpwards:32,showNumberOfHits:6,caseSensitive:33,wide:7,tabIndex:8,placeholder:9,inputProps:10,addItem:34},h,[-1,-1,-1])}get addItem(){return this.$$.ctx[34]}}e.Autocomplete=k,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("svelte/internal"),require("svelte")):"function"==typeof define&&define.amd?define(["exports","svelte/internal","svelte"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Autocomplete={},e["svelte/internal"],e.svelte)}(this,(function(e,t,i){"use strict";class n{constructor({originalItem:e,displayLabel:t,originalLabel:i,highlighted:n}){this._originalItem=e,this._displayLabel=t,this._originalLabel=i,this._highlighted=n,this.key=Symbol(),this._index=0}get originalItem(){return this._originalItem}get originalLabel(){return this._originalLabel}get index(){return this._index}set index(e){this._index=e}get displayLabel(){return this._displayLabel}set displayLabel(e){this._displayLabel=e}get highlighted(){return this._highlighted}set highlighted(e){this._highlighted=e}}class s{constructor(e,t){this.labelFunction=t,this.items=e.map(this.convertItem.bind(this)),this.sortItems()}filter(e,t=!1){const i=new RegExp(s.escapeRegExp(e),t?"":"i");return this.items.filter(t=>""===e||t.originalLabel.match(i)).map((e,t)=>(e.index=t,e.displayLabel=e.originalLabel.replace(i,(function(e){return""!=e?`<B>${e}</B>`:""})),e))}addItem(e){this.items=[...this.items,this.convertItem(e)],this.sortItems()}remove(e){this.items=this.items.filter(t=>t.key!==e.key)}hasItems(){return 0!==this.items.length}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}sortItems(){this.items.sort((e,t)=>e.originalLabel.localeCompare(t.originalLabel))}convertItem(e){return new n({originalItem:e,displayLabel:this.labelFunction(e),originalLabel:this.labelFunction(e),highlighted:!1})}}class l{constructor(e=!1){this._opened=!1,this._userOpened=!1,this._highlightedItem=null,this.filterText="",this._filteredItems=[],this.internalItems=null,this.filterCaseSensitive=e}highlight(e){return null!=this._highlightedItem&&(this._highlightedItem.highlighted=!1,this._highlightedItem=null),null!=e?(e.highlighted=!0,this._highlightedItem=e):this._highlightedItem=null,this}highlightNext(){if(null!=this._highlightedItem){const e=this._highlightedItem.index+1<this._filteredItems.length?this._highlightedItem.index+1:0;this.highlight(this._filteredItems[e])}return this}highlightPrev(){if(null!=this._highlightedItem){const e=0===this._highlightedItem.index?this._filteredItems.length-1:this._highlightedItem.index-1;this.highlight(this._filteredItems[e])}return this}shiftHighlightBy(e){if(null!=this._highlightedItem){const t=this._highlightedItem.index,i=Math.min(Math.max(0,t+e),this._filteredItems.length-1);this.highlight(this._filteredItems[i])}return this}setOpened(e){return this._opened=e,e?this._userClosed=!1:this._userOpened=!1,this}get opened(){return this._opened}setUserOpened(e){return this._userOpened=e,this}setItems(e,t){return this.internalItems=new s(e,t),this.filter(this.filterText),this.highlight(null),this}hasItems(){return this.internalItems.hasItems()}addItem(e){var t;return null===(t=this.internalItems)||void 0===t||t.addItem(e),this.filter(this.filterText),this}filter(e){var t,i;return this.filterText=e,this._filteredItems=null!==(i=null===(t=this.internalItems)||void 0===t?void 0:t.filter(this.filterText,this.filterCaseSensitive))&&void 0!==i?i:[],null!=this._highlightedItem&&this._filteredItems.some(e=>e.key===this._highlightedItem.key)||this.highlight(this._filteredItems[0]),this}isHighlighted(e){return this._highlightedItem.key===e.key}removeHighlighted(){if(null!=this._highlightedItem){const e=Math.max(this._highlightedItem.index-1,0);this.internalItems.remove(this._highlightedItem),this.filter(this.filterText),this._filteredItems.length>0?this.highlight(this._filteredItems[e]):this.highlight(null)}return this}get userClosed(){return this._userClosed}set userClosed(e){this._userClosed=e}get userOpened(){return this._userOpened}set userOpened(e){this._userOpened=e}get highlightedItem(){return this._highlightedItem}get filteredItems(){return this._filteredItems}}var o;!function(e){e.AC_LIST="ac-list",e.AC_LIST_ITEM="ac-list-item",e.CLOSE_LIST="close-list",e.OPEN_LIST="open-list",e.ROOT="root"}(o||(o={}));var a=o;const{window:r}=t.globals;function h(e){t.append_styles(e,"svelte-aniw8a","div.autocomplete.svelte-aniw8a{position:relative;display:flex;align-content:center;justify-content:start}label.input-label.svelte-aniw8a{text-align:right;color:#aaaaaa;white-space:nowrap;min-width:6rem;margin:auto 0}input.svelte-aniw8a{display:inline-block;width:auto;min-width:10rem}input.wide.svelte-aniw8a{width:100%}div.input-and-icons.svelte-aniw8a{position:relative;display:flex;align-items:center;justify-content:stretch}div.input-and-icons.wide.svelte-aniw8a{width:100%}div.dropdown.svelte-aniw8a{background:#fff;position:absolute;max-width:100%;min-width:200px;overflow-y:auto;z-index:99;padding:0 0;top:0;border:1px solid #999;max-height:calc(10 * (1rem + 10px) + 15px);user-select:none}div.dropdown.hidden.svelte-aniw8a{visibility:hidden}div.list-item.highlighted.svelte-aniw8a{background-color:#bbbb}div.openClose.svelte-aniw8a{display:inline-block;position:relative;left:-1.2rem;font-size:0.7rem;user-select:none;width:1.5rem}div.openClose.wide.svelte-aniw8a{position:absolute;left:calc(100% - 1.2rem)}div.openClose.arrow.svelte-aniw8a{transform:scale(1.5, 1)}div.openClose.circle.svelte-aniw8a{transform:scale(1.5, 1.5)}div.openClose.svelte-aniw8a:hover{cursor:pointer}")}function d(e,t,i){const n=e.slice();return n[64]=t[i],n}const u=e=>({item:8192&e[0],displayLabel:8192&e[0]}),c=e=>({item:e[64].originalItem,displayLabel:e[64].displayLabel}),p=e=>({}),g=e=>({}),m=e=>({}),f=e=>({});function _(e){let i,n,s,l;const o=[I,v],a=[];function r(e,t){return e[13].opened?0:1}return i=r(e),n=a[i]=o[i](e),{c(){n.c(),s=t.empty()},m(e,n){a[i].m(e,n),t.insert(e,s,n),l=!0},p(e,l){let h=i;i=r(e),i===h?a[i].p(e,l):(t.group_outros(),t.transition_out(a[h],1,1,()=>{a[h]=null}),t.check_outros(),n=a[i],n?n.p(e,l):(n=a[i]=o[i](e),n.c()),t.transition_in(n,1),n.m(s.parentNode,s))},i(e){l||(t.transition_in(n),l=!0)},o(e){t.transition_out(n),l=!1},d(e){a[i].d(e),e&&t.detach(s)}}}function v(e){let i,n,s,l;const o=e[40].openIcon,r=t.create_slot(o,e,e[39],g),h=r||function(e){let i;return{c(){i=t.text("ᐯ")},m(e,n){t.insert(e,i,n)},d(e){e&&t.detach(i)}}}();return{c(){i=t.element("div"),h&&h.c(),t.attr(i,"class","openClose arrow svelte-aniw8a"),t.attr(i,"data-testid",a.OPEN_LIST),t.toggle_class(i,"wide",e[7])},m(o,a){t.insert(o,i,a),h&&h.m(i,null),n=!0,s||(l=t.listen(i,"mousedown",e[45]),s=!0)},p(e,s){r&&r.p&&(!n||256&s[1])&&t.update_slot_base(r,o,e,e[39],n?t.get_slot_changes(o,e[39],s,p):t.get_all_dirty_from_scope(e[39]),g),128&s[0]&&t.toggle_class(i,"wide",e[7])},i(e){n||(t.transition_in(h,e),n=!0)},o(e){t.transition_out(h,e),n=!1},d(e){e&&t.detach(i),h&&h.d(e),s=!1,l()}}}function I(e){let i,n,s,l;const o=e[40].closeIcon,r=t.create_slot(o,e,e[39],f),h=r||function(e){let i;return{c(){i=t.text("Ⓧ")},m(e,n){t.insert(e,i,n)},d(e){e&&t.detach(i)}}}();return{c(){i=t.element("div"),h&&h.c(),t.attr(i,"class","openClose circle svelte-aniw8a"),t.attr(i,"data-testid",a.CLOSE_LIST),t.toggle_class(i,"wide",e[7])},m(o,a){t.insert(o,i,a),h&&h.m(i,null),n=!0,s||(l=t.listen(i,"mousedown",e[44]),s=!0)},p(e,s){r&&r.p&&(!n||256&s[1])&&t.update_slot_base(r,o,e,e[39],n?t.get_slot_changes(o,e[39],s,m):t.get_all_dirty_from_scope(e[39]),f),128&s[0]&&t.toggle_class(i,"wide",e[7])},i(e){n||(t.transition_in(h,e),n=!0)},o(e){t.transition_out(h,e),n=!1},d(e){e&&t.detach(i),h&&h.d(e),s=!1,l()}}}function w(e){let i,n,s=`${e[13].filteredItems.length} ${e[13].filteredItems.length>1?e[4].hits:e[4].hit}`;return{c(){i=t.element("label"),n=t.text(s),t.attr(i,"class","input-label svelte-aniw8a"),t.attr(i,"for",e[17])},m(e,s){t.insert(e,i,s),t.append(i,n)},p(e,i){8208&i[0]&&s!==(s=`${e[13].filteredItems.length} ${e[13].filteredItems.length>1?e[4].hits:e[4].hit}`)&&t.set_data(n,s)},d(e){e&&t.detach(i)}}}function b(e){let i;function n(e,t){return e[11]?O:x}let s=n(e),l=s(e);return{c(){i=t.element("div"),l.c(),t.attr(i,"class","list-item")},m(e,n){t.insert(e,i,n),l.m(i,null)},p(e,t){s===(s=n(e))&&l?l.p(e,t):(l.d(1),l=s(e),l&&(l.c(),l.m(i,null)))},i:t.noop,o:t.noop,d(e){e&&t.detach(i),l.d()}}}function y(e){let i,n,s=e[13].filteredItems,l=[];for(let t=0;t<s.length;t+=1)l[t]=C(d(e,s,t));const o=e=>t.transition_out(l[e],1,1,()=>{l[e]=null});return{c(){for(let e=0;e<l.length;e+=1)l[e].c();i=t.empty()},m(e,s){for(let t=0;t<l.length;t+=1)l[t].m(e,s);t.insert(e,i,s),n=!0},p(e,n){if(84025344&n[0]|256&n[1]){let a;for(s=e[13].filteredItems,a=0;a<s.length;a+=1){const o=d(e,s,a);l[a]?(l[a].p(o,n),t.transition_in(l[a],1)):(l[a]=C(o),l[a].c(),t.transition_in(l[a],1),l[a].m(i.parentNode,i))}for(t.group_outros(),a=s.length;a<l.length;a+=1)o(a);t.check_outros()}},i(e){if(!n){for(let e=0;e<s.length;e+=1)t.transition_in(l[e]);n=!0}},o(e){l=l.filter(Boolean);for(let e=0;e<l.length;e+=1)t.transition_out(l[e]);n=!1},d(e){t.destroy_each(l,e),e&&t.detach(i)}}}function x(e){let i,n=e[4].noHit+"";return{c(){i=t.text(n)},m(e,n){t.insert(e,i,n)},p(e,s){16&s[0]&&n!==(n=e[4].noHit+"")&&t.set_data(i,n)},d(e){e&&t.detach(i)}}}function O(e){let i,n=e[4].add+"";return{c(){i=t.text(n)},m(e,n){t.insert(e,i,n)},p(e,s){16&s[0]&&n!==(n=e[4].add+"")&&t.set_data(i,n)},d(e){e&&t.detach(i)}}}function C(e){let i,n,s,l,o;const r=e[40].listItem,h=t.create_slot(r,e,e[39],c),d=h||function(e){let i,n,s=e[64].displayLabel+"";return{c(){i=new t.HtmlTag(!1),n=t.empty(),i.a=n},m(e,l){i.m(s,e,l),t.insert(e,n,l)},p(e,t){8192&t[0]&&s!==(s=e[64].displayLabel+"")&&i.p(s)},d(e){e&&t.detach(n),e&&i.d()}}}(e);function p(){return e[46](e[64])}return{c(){i=t.element("div"),d&&d.c(),n=t.space(),t.attr(i,"data-testid",a.AC_LIST_ITEM),t.attr(i,"class",t.null_to_empty("list-item "+e[17])+" svelte-aniw8a"),t.toggle_class(i,"highlighted",e[13].isHighlighted(e[64]))},m(a,r){t.insert(a,i,r),d&&d.m(i,null),t.append(i,n),s=!0,l||(o=[t.listen(i,"pointerenter",p),t.listen(i,"mousedown",e[47])],l=!0)},p(n,l){e=n,h?h.p&&(!s||8192&l[0]|256&l[1])&&t.update_slot_base(h,r,e,e[39],s?t.get_slot_changes(r,e[39],l,u):t.get_all_dirty_from_scope(e[39]),c):d&&d.p&&(!s||8192&l[0])&&d.p(e,s?l:[-1,-1,-1]),8192&l[0]&&t.toggle_class(i,"highlighted",e[13].isHighlighted(e[64]))},i(e){s||(t.transition_in(d,e),s=!0)},o(e){t.transition_out(d,e),s=!1},d(e){e&&t.detach(i),d&&d.d(e),l=!1,t.run_all(o)}}}function S(e){let i,n,s,l,o,h,d,u,c,p,g,m,f,v,I,x,O,C=e[13].hasItems(),S=[{autocomplete:"off"},{class:l=e[3].join(" ")},{id:e[17]},{style:e[2]},{tabindex:e[8]},{placeholder:o=e[13].hasItems()?e[9]:void 0},{disabled:h=!e[13].hasItems()},{type:"text"},e[10]],$={};for(let e=0;e<S.length;e+=1)$=t.assign($,S[e]);let k=C&&_(e),N=e[6]&&w(e);const H=[y,b],P=[];function A(e,t){return e[13].filteredItems.length>0?0:1}return g=A(e),m=P[g]=H[g](e),{c(){i=t.element("div"),n=t.element("div"),s=t.element("input"),d=t.space(),k&&k.c(),u=t.space(),N&&N.c(),c=t.space(),p=t.element("div"),m.c(),t.set_attributes(s,$),t.toggle_class(s,"wide",e[7]),t.toggle_class(s,"svelte-aniw8a",!0),t.attr(n,"class","input-and-icons svelte-aniw8a"),t.toggle_class(n,"wide",e[7]),t.attr(p,"data-testid",a.AC_LIST),t.attr(p,"class","dropdown svelte-aniw8a"),t.attr(p,"style",f="z-index: "+(e[5]+1)),t.toggle_class(p,"hidden",!(e[13].opened&&e[13].hasItems())),t.attr(i,"class",v=t.null_to_empty(`autocomplete ${e[17]} ${e[0].join(" ")}`)+" svelte-aniw8a"),t.attr(i,"style",e[1]),t.attr(i,"data-testid",a.ROOT)},m(l,o){t.insert(l,i,o),t.append(i,n),t.append(n,s),s.autofocus&&s.focus(),e[42](s),t.set_input_value(s,e[12]),t.append(n,d),k&&k.m(n,null),t.append(i,u),N&&N.m(i,null),t.append(i,c),t.append(i,p),P[g].m(p,null),e[48](p),e[49](i),I=!0,x||(O=[t.listen(r,"mousedown",e[25]),t.listen(r,"scroll",e[41]),t.listen(s,"input",e[43]),t.listen(s,"blur",e[19]),t.listen(s,"dblclick",e[23]),t.listen(s,"focus",e[18]),t.listen(s,"keydown",e[22]),t.listen(p,"keydown",t.prevent_default(L)),t.listen(p,"scroll",t.stop_propagation(t.prevent_default(T))),t.listen(i,"mousedown",t.stop_propagation(t.prevent_default(e[50])))],x=!0)},p(e,a){t.set_attributes(s,$=t.get_spread_update(S,[{autocomplete:"off"},(!I||8&a[0]&&l!==(l=e[3].join(" ")))&&{class:l},{id:e[17]},(!I||4&a[0])&&{style:e[2]},(!I||256&a[0])&&{tabindex:e[8]},(!I||8704&a[0]&&o!==(o=e[13].hasItems()?e[9]:void 0))&&{placeholder:o},(!I||8192&a[0]&&h!==(h=!e[13].hasItems()))&&{disabled:h},{type:"text"},1024&a[0]&&e[10]])),4096&a[0]&&s.value!==e[12]&&t.set_input_value(s,e[12]),t.toggle_class(s,"wide",e[7]),t.toggle_class(s,"svelte-aniw8a",!0),8192&a[0]&&(C=e[13].hasItems()),C?k?(k.p(e,a),8192&a[0]&&t.transition_in(k,1)):(k=_(e),k.c(),t.transition_in(k,1),k.m(n,null)):k&&(t.group_outros(),t.transition_out(k,1,1,()=>{k=null}),t.check_outros()),128&a[0]&&t.toggle_class(n,"wide",e[7]),e[6]?N?N.p(e,a):(N=w(e),N.c(),N.m(i,c)):N&&(N.d(1),N=null);let r=g;g=A(e),g===r?P[g].p(e,a):(t.group_outros(),t.transition_out(P[r],1,1,()=>{P[r]=null}),t.check_outros(),m=P[g],m?m.p(e,a):(m=P[g]=H[g](e),m.c()),t.transition_in(m,1),m.m(p,null)),(!I||32&a[0]&&f!==(f="z-index: "+(e[5]+1)))&&t.attr(p,"style",f),8192&a[0]&&t.toggle_class(p,"hidden",!(e[13].opened&&e[13].hasItems())),(!I||1&a[0]&&v!==(v=t.null_to_empty(`autocomplete ${e[17]} ${e[0].join(" ")}`)+" svelte-aniw8a"))&&t.attr(i,"class",v),(!I||2&a[0])&&t.attr(i,"style",e[1])},i(e){I||(t.transition_in(k),t.transition_in(m),I=!0)},o(e){t.transition_out(k),t.transition_out(m),I=!1},d(n){n&&t.detach(i),e[42](null),k&&k.d(),N&&N.d(),P[g].d(),e[48](null),e[49](null),x=!1,t.run_all(O)}}}let $=0;const L=()=>!1,T=()=>!1;function k(e,n,s){let o,a,{$$slots:r={},$$scope:h}=n;const d=i.createEventDispatcher();let{items:u=[]}=n,{labelFieldName:c=null}=n,{labelFunction:p=null}=n,{containerClassNames:g=[]}=n,{containerStyle:m=""}=n,{inputStyle:f=""}=n,{inputClassNames:_=[]}=n,{i18n:v={hit:" treff",hits:" treff",noHit:"Ingen treff",add:"[CTRL+a]: opprett ny verdi"}}=n,{minCharsToSuggest:I=3}=n,{removeOnSelect:w=!1}=n,{closeOnSelect:b=!0}=n,{zIndexOffset:y=0}=n,{preferOpenUpwards:x=!1}=n,{showNumberOfHits:O=!0}=n,{caseSensitive:C=!1}=n,{wide:S=!1}=n,{tabIndex:L=null}=n,{placeholder:T=null}=n,{inputProps:k={}}=n,{allowFreeText:N=!1}=n;const H="autocomplete-"+$++;let P,A,E,F=!1,U=!1,B="",R=[];function j(e=!1){s(13,a=a.setOpened(!0).setUserOpened(e)),G()}function z(e=!1){s(13,a.userClosed=e,a),s(13,a=a.setOpened(!1))}i.afterUpdate(()=>{R.forEach(e=>e()),R=[]});const D={Escape:function(){s(12,B=""),A.blur(),s(37,F=!1),z(!0)},ArrowDown:M,ArrowUp:M,Enter:q,Backspace:function(){B.length<=1&&z()},Tab:function(){U=!0},PageDown:K,PageUp:K,KeyA:function(e){N&&e.ctrlKey&&B.length>0&&(e.stopPropagation(),e.preventDefault(),d("select",{selected:B}),s(12,B=""))}};function M(e){e.stopPropagation(),e.preventDefault(),a.opened?("ArrowDown"===(null==e?void 0:e.key)&&s(13,a=a.highlightNext()),"ArrowUp"===(null==e?void 0:e.key)&&s(13,a=a.highlightPrev()),J()):j(!0)}function q(e){a.opened&&(null!==a.highlightedItem&&(d("select",{selected:a.highlightedItem.originalItem}),w&&(s(13,a=a.removeHighlighted()),a.hasItems()||s(12,B=""),G())),b?z(!0):e&&w&&R.push(()=>{const e=Array.from(document.querySelectorAll(":hover")).find(e=>{var t,i;return(null===(t=e.classList)||void 0===t?void 0:t.contains(H))&&(null===(i=e.classList)||void 0===i?void 0:i.contains("list-item"))});null==e||e.dispatchEvent(new PointerEvent("pointerenter"))}))}function K(e){if(e.stopPropagation(),e.preventDefault(),a.opened){const t="PageDown"===e.key?1:-1,i=P.scrollHeight/a.filteredItems.length,n=Math.floor(P.getBoundingClientRect().height/i)-1;s(13,a=a.shiftHighlightBy(t*n)),J()}else j(!0)}function V(e){a.isHighlighted(e)||s(13,a=a.highlight(e))}function G(){R.push(()=>Q()),J()}function J(){R.push(()=>{var e;null!=E&&a.opened&&(null===(e=null==P?void 0:P.querySelector(".highlighted"))||void 0===e||e.scrollIntoView({behavior:"auto",block:"nearest",inline:"start"}))})}function Q(){if(null==E)return;const{height:e,pageLeft:t}=window.visualViewport,{bottom:i,height:n,top:l}=A.getBoundingClientRect(),{height:o}=P.getBoundingClientRect();s(14,P.style.top=i+o>e||x&&l-o>t?`-${o}px`:n+"px",P)}return e.$$set=e=>{"items"in e&&s(28,u=e.items),"labelFieldName"in e&&s(29,c=e.labelFieldName),"labelFunction"in e&&s(30,p=e.labelFunction),"containerClassNames"in e&&s(0,g=e.containerClassNames),"containerStyle"in e&&s(1,m=e.containerStyle),"inputStyle"in e&&s(2,f=e.inputStyle),"inputClassNames"in e&&s(3,_=e.inputClassNames),"i18n"in e&&s(4,v=e.i18n),"minCharsToSuggest"in e&&s(31,I=e.minCharsToSuggest),"removeOnSelect"in e&&s(32,w=e.removeOnSelect),"closeOnSelect"in e&&s(33,b=e.closeOnSelect),"zIndexOffset"in e&&s(5,y=e.zIndexOffset),"preferOpenUpwards"in e&&s(34,x=e.preferOpenUpwards),"showNumberOfHits"in e&&s(6,O=e.showNumberOfHits),"caseSensitive"in e&&s(35,C=e.caseSensitive),"wide"in e&&s(7,S=e.wide),"tabIndex"in e&&s(8,L=e.tabIndex),"placeholder"in e&&s(9,T=e.placeholder),"inputProps"in e&&s(10,k=e.inputProps),"allowFreeText"in e&&s(11,N=e.allowFreeText),"$$scope"in e&&s(39,h=e.$$scope)},e.$$.update=()=>{1610612736&e.$$.dirty[0]&&s(38,o=null!=p?p:null!=c?e=>e[c]:e=>e),268435456&e.$$.dirty[0]|144&e.$$.dirty[1]&&s(13,a=new l(C).setItems(u||[],o)),12288&e.$$.dirty[0]&&(!function(e){s(13,a=a.filter(e)),J()}(B),a.opened&&G()),12288&e.$$.dirty[0]|65&e.$$.dirty[1]&&(B.length>=I&&!a.opened&&F&&!a.userClosed?j(!1):(a.opened&&!a.userOpened&&B.length<I||!F||a.userClosed)&&z())},[g,m,f,_,v,y,O,S,L,T,k,N,B,a,P,A,E,H,function(){s(37,F=!0)},function(){const e=Array.from(document.querySelectorAll(":hover")).some(e=>{var t;return null===(t=e.classList)||void 0===t?void 0:t.contains(H)});s(37,F=!U&&e),R.push(()=>U=!1)},j,z,function(e){return D[e.code]&&D[e.code](e)},function(){!a.opened&&j(!0)},q,function(){s(37,F=!1),z()},V,Q,u,c,p,I,w,b,x,C,function(e){s(13,a=a.addItem(e))},F,o,h,r,()=>{a.opened&&Q()},function(e){t.binding_callbacks[e?"unshift":"push"](()=>{A=e,s(15,A)})},function(){B=this.value,s(12,B)},()=>z(!0),()=>j(!0),e=>V(e),()=>q(!0),function(e){t.binding_callbacks[e?"unshift":"push"](()=>{P=e,s(14,P)})},function(e){t.binding_callbacks[e?"unshift":"push"](()=>{E=e,s(16,E)})},()=>A.focus()]}class N extends t.SvelteComponent{constructor(e){super(),t.init(this,e,k,S,t.safe_not_equal,{items:28,labelFieldName:29,labelFunction:30,containerClassNames:0,containerStyle:1,inputStyle:2,inputClassNames:3,i18n:4,minCharsToSuggest:31,removeOnSelect:32,closeOnSelect:33,zIndexOffset:5,preferOpenUpwards:34,showNumberOfHits:6,caseSensitive:35,wide:7,tabIndex:8,placeholder:9,inputProps:10,allowFreeText:11,addItem:36},h,[-1,-1,-1])}get addItem(){return this.$$.ctx[36]}}e.Autocomplete=N,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@digibib/deichman-admin-frontend-common", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Set of common Deichman Svelte components", | ||
@@ -9,4 +9,6 @@ "svelte": "src/index.js", | ||
"files": [ | ||
"index.js", | ||
"index.js.map", | ||
"index.mjs", | ||
"index.js" | ||
"index.mjs.map" | ||
], | ||
@@ -13,0 +15,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156968
8
141