@streamline-pulse/formkrafter-wc 0.37.0 → 0.38.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/components/fk-address-search.js +1 -1
- package/dist/components/fk-brick-actions.js +1 -1
- package/dist/components/fk-brick-list.js +1 -1
- package/dist/components/fk-brick-mold-item.js +1 -1
- package/dist/components/fk-brick-render.js +1 -1
- package/dist/components/fk-data-grid.js +1 -1
- package/dist/components/fk-document-reader.js +1 -1
- package/dist/components/fk-drop-area.js +1 -1
- package/dist/components/fk-empty-form.js +1 -1
- package/dist/components/fk-file-input.js +1 -1
- package/dist/components/fk-form-builder.js +1 -1
- package/dist/components/fk-form-render.js +1 -1
- package/dist/components/fk-form-review.js +1 -1
- package/dist/components/fk-geo-map.js +1 -1
- package/dist/components/fk-key-value.js +1 -1
- package/dist/components/fk-property-panel.js +1 -1
- package/dist/components/fk-rules-editor.js +1 -1
- package/dist/components/fk-select-input.js +1 -1
- package/dist/components/fk-signature-input.js +1 -1
- package/dist/components/fk-slot-picker.js +1 -1
- package/dist/components/fk-stepper.js +1 -1
- package/dist/components/fk-tabs.js +1 -1
- package/dist/components/fk-variable-picker.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-CnxpFa-9.js → p-B1GlI_Hr.js} +1 -1
- package/dist/components/{p-B-INxJBg.js → p-B22Z6Vu_.js} +1 -1
- package/dist/components/{p-CNu8nwtf.js → p-BgkVuGfo.js} +1 -1
- package/dist/components/{p-CIBi00IY.js → p-BjjJ9dQ-.js} +1 -1
- package/dist/components/{p-CimJudBw.js → p-BpwtxhSr.js} +1 -1
- package/dist/components/{p-DWSCT2ur.js → p-C3lh3RIu.js} +1 -1
- package/dist/components/{p-C6_gsHBy.js → p-C6A-ONnV.js} +1 -1
- package/dist/components/{p-2qasp9rP.js → p-CBuIUYeI.js} +1 -1
- package/dist/components/{p-Da741snY.js → p-CR5WtUWs.js} +1 -1
- package/dist/components/{p-CzRN0mMY.js → p-CRKfZc8F.js} +1 -1
- package/dist/components/{p-DYcM9V1l.js → p-CT6E7MdF.js} +1 -1
- package/dist/components/{p-BdiKh9d2.js → p-CUli9A8K.js} +1 -1
- package/dist/components/{p-ClRRfTDD.js → p-C_3Cb1pX.js} +1 -1
- package/dist/components/{p-jEx6mM9z.js → p-Ca7Vz8hh.js} +1 -1
- package/dist/components/{p-CmPkfuLt.js → p-D1rC6paR.js} +1 -1
- package/dist/components/{p-BPXhxOFW.js → p-DUuYfn0a.js} +1 -1
- package/dist/components/{p-Cqsmxwly.js → p-Ddnb-hw4.js} +1 -1
- package/dist/components/{p-DWjr7-NA.js → p-DfCT35Th.js} +1 -1
- package/dist/components/{p-Bza6nE37.js → p-Doa3hlEQ.js} +1 -1
- package/dist/components/{p-D5nPxZXV.js → p-DrbcL_4W.js} +1 -1
- package/dist/components/{p-CtbPH5C7.js → p-DxH4cD0Z.js} +1 -1
- package/dist/components/{p-JQ8Ve1UU.js → p-irwwRRFn.js} +5 -5
- package/dist/formkrafter-wc/formkrafter-wc.esm.js +1 -1
- package/dist/formkrafter-wc/index.esm.js +1 -1
- package/dist/formkrafter-wc/{p-86373a08.entry.js → p-291bbeac.entry.js} +1 -1
- package/dist/formkrafter-wc/{p-3dfe2d5c.entry.js → p-9be743e6.entry.js} +1 -1
- package/dist/formkrafter-wc/{p-CqcWR060.js → p-AEhPr5oS.js} +1 -1
- package/dist/formkrafter-wc/{p-CndT4oMV.js → p-XJo4Hw4r.js} +5 -5
- package/dist/formkrafter-wc/{p-a51534db.entry.js → p-af66a199.entry.js} +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as s,p as t,H as e,c as i,h as r}from"./p-8ICOcloT.js";import{b as a}from"./p-
|
|
1
|
+
import{t as s,p as t,H as e,c as i,h as r}from"./p-8ICOcloT.js";import{b as a}from"./p-irwwRRFn.js";const o=s=>Math.round(1e6*s)/1e6,d=s=>{var t,e,i,r,a,d,n,h,l;const c=null!==(t=s.address)&&void 0!==t?t:{},u=[c.house_number,null!==(i=null!==(e=c.road)&&void 0!==e?e:c.pedestrian)&&void 0!==i?i:c.footway].filter(Boolean).join(" ");return{type:"Feature",geometry:{type:"Point",coordinates:[o(Number(s.lon)),o(Number(s.lat))]},properties:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({label:s.display_name},u&&{street:u}),(null!==(d=null!==(a=null!==(r=c.city)&&void 0!==r?r:c.town)&&void 0!==a?a:c.village)&&void 0!==d?d:c.municipality)&&{city:null!==(l=null!==(h=null!==(n=c.city)&&void 0!==n?n:c.town)&&void 0!==h?h:c.village)&&void 0!==l?l:c.municipality}),c.postcode&&{postcode:c.postcode}),c.country&&{country:c.country}),c.country_code&&{countryCode:c.country_code}),void 0!==s.place_id&&{placeId:String(s.place_id)})}},n=t(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.addressChange=i(this,"addressChange"),this.searchUrl="https://nominatim.openstreetmap.org/search?format=jsonv2&addressdetails=1&limit=5&q={q}",this.disabled=!1,this.readOnly=!1,this.minChars=3,this.query="",this.results=[],this.open=!1,this.loading=!1,this.failed=!1,this.index=0,this.request=0,this.focused=!1,this.onInput=s=>{const t=s.target.value;if(this.query=t,this.timer&&clearTimeout(this.timer),this.addressChange.emit(t.trim()?{type:"Feature",geometry:null,properties:{label:t}}:void 0),t.trim().length<this.minChars)return this.open=!1,void(this.results=[]);this.timer=setTimeout((()=>{this.search(t.trim())}),400)},this.onKeyDown=s=>{this.open&&this.results.length&&("ArrowDown"===s.key?(this.index=(this.index+1)%this.results.length,s.preventDefault()):"ArrowUp"===s.key?(this.index=(this.index-1+this.results.length)%this.results.length,s.preventDefault()):"Enter"===s.key?(this.pick(this.results[this.index]),s.preventDefault()):"Escape"===s.key&&(this.open=!1))}}componentWillLoad(){var s,t;this.query=null!==(t=null===(s=this.value)||void 0===s?void 0:s.properties.label)&&void 0!==t?t:""}onValueChange(s){var t;const e=null!==(t=null==s?void 0:s.properties.label)&&void 0!==t?t:"";this.focused||e===this.query||(this.query=e)}get locked(){return this.disabled||this.readOnly}buildUrl(s){let t=this.searchUrl.replace("{q}",encodeURIComponent(s));return this.countryCodes&&(t+=`${t.includes("?")?"&":"?"}countrycodes=${encodeURIComponent(this.countryCodes)}`),this.language&&(t+=`${t.includes("?")?"&":"?"}accept-language=${encodeURIComponent(this.language)}`),t}async search(s){const t=++this.request;this.loading=!0,this.failed=!1;try{const e=await fetch(this.buildUrl(s),{headers:{Accept:"application/json"}});if(!e.ok)throw new Error(String(e.status));const i=await e.json();if(t!==this.request)return;this.results=Array.isArray(i)?i.map(d):[],this.index=0,this.open=!0}catch(s){if(t!==this.request)return;this.results=[],this.failed=!0,this.open=!0}finally{t===this.request&&(this.loading=!1)}}pick(s){this.query=s.properties.label,this.open=!1,this.results=[],this.addressChange.emit(s)}render(){var s,t;const e=!!(null===(s=this.value)||void 0===s?void 0:s.geometry);return r("div",{key:"d5d4f73ae70e094df80b2b71ae0462a628af886d",class:"fk-address"},r("input",{key:"1911fe734e37dd07698629d8e5229bac432b299c",class:"fk-field__input",type:"text",autocomplete:"off",value:this.query,placeholder:null!==(t=this.placeholder)&&void 0!==t?t:a("address.search"),disabled:this.disabled,readOnly:this.readOnly,onInput:this.onInput,onKeyDown:this.onKeyDown,onFocus:()=>{this.focused=!0},onBlur:()=>{this.focused=!1,setTimeout((()=>{this.open=!1}),120)}}),this.query&&!this.locked?r("span",{class:{"fk-address__status":!0,"fk-address__status--located":e}},a(this.loading?"address.searching":e?"address.located":"address.notLocated")):null,this.open&&!this.locked?r("div",{class:"fk-address__list",role:"listbox"},this.failed?r("div",{class:"fk-address__empty"},a("address.unavailable")):0===this.results.length?r("div",{class:"fk-address__empty"},a("address.noResult")):this.results.map(((s,t)=>r("button",{type:"button",role:"option","aria-selected":t===this.index?"true":"false",class:{"fk-address__item":!0,"fk-address__item--active":t===this.index},onMouseDown:t=>{t.preventDefault(),this.pick(s)},onMouseEnter:()=>{this.index=t}},s.properties.label)))):null)}get el(){return this}static get watchers(){return{value:[{onValueChange:0}]}}static get style(){return".sc-fk-address-search-h{display:block}.fk-address.sc-fk-address-search{display:block;position:relative}.fk-address__status.sc-fk-address-search{display:block;margin-top:0.25rem;font-size:0.75rem;color:var(--fk-color-muted, #71717a)}.fk-address__status--located.sc-fk-address-search{color:var(--fk-color-primary, #16a34a)}.fk-address__list.sc-fk-address-search{position:absolute;z-index:20;left:0;right:0;margin-top:0.25rem;max-height:14rem;overflow-y:auto;border:1px solid var(--fk-color-border, #d4d4d8);border-radius:var(--fk-radius, 0.375rem);background:var(--fk-color-surface, #fff);box-shadow:0 8px 24px rgba(0, 0, 0, 0.12)}.fk-address__item.sc-fk-address-search{display:block;width:100%;padding:0.375rem 0.625rem;border:0;background:transparent;color:inherit;font:inherit;font-size:0.8125rem;text-align:left;cursor:pointer}.fk-address__item--active.sc-fk-address-search,.fk-address__item.sc-fk-address-search:hover{background:var(--fk-color-hover, rgba(127, 127, 127, 0.12))}.fk-address__empty.sc-fk-address-search{padding:0.5rem 0.625rem;font-size:0.75rem;color:var(--fk-color-muted, #71717a)}"}},[2,"fk-address-search",{value:[16],searchUrl:[1,"search-url"],countryCodes:[1,"country-codes"],language:[1],placeholder:[1],disabled:[4],readOnly:[4,"read-only"],minChars:[2,"min-chars"],query:[32],results:[32],open:[32],loading:[32],failed:[32],index:[32]},void 0,{value:[{onValueChange:0}]}]);function h(){"undefined"!=typeof customElements&&["fk-address-search"].forEach((t=>{"fk-address-search"===t&&(customElements.get(s(t))||customElements.define(s(t),n))}))}h();export{n as F,h as d}
|