@streamline-pulse/formkrafter-wc 0.28.1 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-not-found.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.d.ts +11 -0
- package/dist/components/fk-document-reader.js +1 -0
- 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-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-CuF0gbWB.js → p-66Xzy1Vh.js} +1 -1
- package/dist/components/{p-Di7uMflS.js → p-BFnqPIpW.js} +1 -1
- package/dist/components/{p-lOT7NMxD.js → p-BJuHN3Uu.js} +1 -1
- package/dist/components/{p-YMLbA4H2.js → p-BO5VWpZE.js} +1 -1
- package/dist/components/{p-xvN-OJAU.js → p-BRITIZrd.js} +1 -1
- package/dist/components/{p-DK2UgrV9.js → p-BSdc_x3o.js} +1 -1
- package/dist/components/{p-CIZUeonQ.js → p-BUgHGozZ.js} +1 -1
- package/dist/components/p-BY2wuPHY.js +1 -0
- package/dist/components/{p-CVsWXbzX.js → p-BYCjTLjB.js} +1 -1
- package/dist/components/{p-DtPhC0nx.js → p-BlgDQ0t7.js} +1 -1
- package/dist/components/{p-BGax6QkM.js → p-BuoiPCr-.js} +1 -1
- package/dist/components/p-CIgvEKbO.js +1 -0
- package/dist/components/{p-Dt5tFknh.js → p-CuWGcxtN.js} +1 -1
- package/dist/components/{p-B5gG7fHb.js → p-Cys4PksI.js} +1 -1
- package/dist/components/{p-DJxeNTfC.js → p-D6W-SOWV.js} +1 -1
- package/dist/components/p-DGCzE6o_.js +1 -0
- package/dist/components/{p-C8yXvs3g.js → p-DMwau-fb.js} +1 -1
- package/dist/components/{p-BEft-cf2.js → p-DPidm5sJ.js} +1 -1
- package/dist/components/{p-DskfAsd6.js → p-DPz8CWwm.js} +1 -1
- package/dist/components/p-D_BgQRLv.js +1 -0
- package/dist/components/{p-Ddiv4Djm.js → p-DdGjQ53Y.js} +7 -7
- package/dist/components/p-bOrdd5ri.js +1 -0
- package/dist/formkrafter-wc/formkrafter-wc.esm.js +1 -1
- package/dist/formkrafter-wc/index.esm.js +1 -1
- package/dist/formkrafter-wc/p-3a516b41.entry.js +1 -0
- package/dist/formkrafter-wc/p-96c82d88.entry.js +1 -0
- package/dist/formkrafter-wc/{p-730cac62.entry.js → p-996cdc3f.entry.js} +1 -1
- package/dist/formkrafter-wc/{p-D3ItRsmP.js → p-Dozlw09a.js} +7 -7
- package/dist/formkrafter-wc/{p-CiXmtjEN.js → p-FupO-_0D.js} +1 -1
- package/dist/types/components/fk-document-reader/fk-document-reader.d.ts +44 -0
- package/dist/types/components.d.ts +135 -2
- package/dist/types/registry/default-bricks.d.ts +72 -0
- package/package.json +2 -2
- package/dist/components/p-DIW5FtAy.js +0 -1
- package/dist/components/p-DMLnAgzb.js +0 -1
- package/dist/components/p-FSCguIuu.js +0 -1
- package/dist/components/p-t-OoJsHu.js +0 -1
- package/dist/formkrafter-wc/p-7bc82da2.entry.js +0 -1
- package/dist/formkrafter-wc/p-f867357b.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as o,c as l,h as a}from"./p-8ICOcloT.js";import{b as i}from"./p-Ddiv4Djm.js";const r=new Map,n=e=>Math.round(1e6*e)/1e6,s=e=>[n(e.lng),n(e.lat)],f=t(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.geoChange=l(this,"geoChange"),this.layerChange=l(this,"layerChange"),this.mode="point",this.zoom=6,this.tileUrl="https://tile.openstreetmap.org/{z}/{x}/{y}.png",this.attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',this.height=320,this.disabled=!1,this.readOnly=!1,this.manual=!0,this.layerCodeProperty="code",this.layerNameProperty="name",this.selected=[],this.multiple=!1,this.failed=!1,this.vertexCount=0,this.zones=[],this.layerFailed=!1,this.shapes=[],this.vertices=[],this.lastEmitted="",this.clear=()=>{this.locked||this.setVertices([])}}get locked(){return this.disabled||this.readOnly}async componentDidLoad(){var e;"layer"===this.mode&&this.fetchLayer();try{const t=await import("./p-CuF0gbWB.js").then((function(e){return e.l}));this.L=null!==(e=t.default)&&void 0!==e?e:t}catch(e){return void(this.failed=!0)}this.container&&this.initMap()}disconnectedCallback(){var e,t;null===(e=this.observer)||void 0===e||e.disconnect(),null===(t=this.map)||void 0===t||t.remove(),this.map=void 0}onValueChange(e){JSON.stringify(null!=e?e:null)!==this.lastEmitted&&this.draw(e)}onLockChange(){this.draw(this.value),this.restyleLayer()}onSelectedChange(){this.restyleLayer()}onLayerUrlChange(){this.fetchLayer()}initMap(){var e;const t=this.L,o=this.container,l=t.map(o,{attributionControl:!0,zoomControl:!this.locked});t.tileLayer(this.tileUrl,{attribution:this.attribution,maxZoom:19}).addTo(l),l.setView(null!==(e=this.center)&&void 0!==e?e:[0,0],this.center?this.zoom:2),this.locked&&(l.dragging.disable(),l.scrollWheelZoom.disable()),l.on("click",(e=>{this.locked||"layer"===this.mode||this.setVertices("point"===this.mode?[e.latlng]:[...this.vertices,e.latlng])})),this.map=l,this.draw(this.value),this.drawLayer(),"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((()=>l.invalidateSize())),this.observer.observe(o)),setTimeout((()=>l.invalidateSize()),50)}draw(e){var t;const o=this.L,l=this.map;if(!o||!l)return void(this.vertexCount=this.countVertices(e));const a=[];if("Point"===(null==e?void 0:e.type)&&a.push(o.latLng(e.coordinates[1],e.coordinates[0])),"LineString"===(null==e?void 0:e.type))for(const[t,l]of e.coordinates)a.push(o.latLng(l,t));if("Polygon"===(null==e?void 0:e.type)){const l=null!==(t=e.coordinates[0])&&void 0!==t?t:[],i=l.length>1&&l[0][0]===l[l.length-1][0]&&l[0][1]===l[l.length-1][1]?l.slice(0,-1):l;for(const[e,t]of i)a.push(o.latLng(t,e))}this.vertices=a,this.vertexCount=a.length,this.render_shapes(),1===a.length?l.setView(a[0],Math.max(l.getZoom(),this.zoom)):a.length>1&&l.fitBounds(o.latLngBounds(a),{padding:[24,24]})}countVertices(e){var t,o;return e?"Point"===e.type?1:"LineString"===e.type?e.coordinates.length:Math.max((null!==(o=null===(t=e.coordinates[0])||void 0===t?void 0:t.length)&&void 0!==o?o:1)-1,0):0}render_shapes(){const e=this.L,t=this.map;if(!e||!t)return;for(const e of this.shapes)e.remove();this.shapes=[];const o=this.vertices;"polygon"===this.mode&&o.length>=3&&this.shapes.push(e.polygon(o,{className:"fk-geo__shape"}).addTo(t)),"line"===this.mode&&o.length>=2&&this.shapes.push(e.polyline(o,{className:"fk-geo__shape"}).addTo(t)),o.forEach(((o,l)=>{const a=e.marker(o,{draggable:!this.locked,icon:e.divIcon({className:"fk-geo__marker",iconSize:[14,14],iconAnchor:[7,7]})}).addTo(t);a.on("dragend",(()=>{const e=[...this.vertices];e[l]=a.getLatLng(),this.setVertices(e)})),"point"!==this.mode&&a.on("contextmenu",(()=>{this.locked||this.setVertices(this.vertices.filter(((e,t)=>t!==l)))})),this.shapes.push(a)}))}setVertices(e){this.vertices=e,this.vertexCount=e.length,this.render_shapes(),this.emit()}geometry(){const e=this.vertices;if("point"===this.mode)return e[0]?{type:"Point",coordinates:s(e[0])}:void 0;if("line"===this.mode)return e.length>=2?{type:"LineString",coordinates:e.map(s)}:void 0;if(e.length<3)return;const t=e.map(s);return{type:"Polygon",coordinates:[[...t,t[0]]]}}emit(){const e=this.geometry();this.lastEmitted=JSON.stringify(null!=e?e:null),this.geoChange.emit(e)}setManual(e,t){var o,l,a;if(this.locked)return;if(""===t.trim())return this.vertices=[],this.vertexCount=0,this.render_shapes(),void this.emit();const i="Point"===(null===(o=this.value)||void 0===o?void 0:o.type)?this.value.coordinates:void 0,r="lat"===e?Number(t):null!==(l=null==i?void 0:i[1])&&void 0!==l?l:NaN,n="lng"===e?Number(t):null!==(a=null==i?void 0:i[0])&&void 0!==a?a:NaN;if(Number.isNaN(r)||Number.isNaN(n))return;const s=this.L?this.L.latLng(r,n):{lat:r,lng:n};this.vertices=[s],this.vertexCount=1,this.render_shapes(),this.map&&this.map.setView(s,Math.max(this.map.getZoom(),this.zoom)),this.emit()}componentDidRender(){var e;this.selectEl&&"layer"===this.mode&&(this.selectEl.value=null!==(e=this.selected[0])&&void 0!==e?e:"")}zoneOf(e){var t;const o=null!==(t=e.properties)&&void 0!==t?t:{},l=o[this.layerCodeProperty],a=o[this.layerNameProperty];return null==l||""===l?null:{code:String(l),name:String(null==a?l:a)}}async fetchLayer(){var e;if(this.layerFailed=!1,!this.layerUrl)return this.layerData=void 0,this.zones=[],void this.drawLayer();try{const t=await(e=>{let t=r.get(e);return t||(t=fetch(e,{headers:{Accept:"application/geo+json, application/json"}}).then((async e=>{if(!e.ok)throw new Error(String(e.status));return await e.json()})),t.catch((()=>r.delete(e))),r.set(e,t)),t})(this.layerUrl);this.layerData=t,this.zones=(null!==(e=t.features)&&void 0!==e?e:[]).map((e=>this.zoneOf(e))).filter((e=>null!==e)).sort(((e,t)=>e.name.localeCompare(t.name))),this.drawLayer()}catch(e){this.layerFailed=!0}}layerStyle(e){const t=null!==e&&this.selected.includes(e);return{className:t?"fk-geo__zone fk-geo__zone--selected":"fk-geo__zone",weight:t?2:1,fillOpacity:t?.45:.1}}drawLayer(){var e;const t=this.L,o=this.map;if(!t||!o||"layer"!==this.mode)return;if(null===(e=this.layer)||void 0===e||e.remove(),this.layer=void 0,!this.layerData)return;const l=t.geoJSON(this.layerData,{style:e=>{var t,o;return this.layerStyle(e&&null!==(o=null===(t=this.zoneOf(e))||void 0===t?void 0:t.code)&&void 0!==o?o:null)},onEachFeature:(e,t)=>{const o=this.zoneOf(e);o&&(t.bindTooltip(o.name,{sticky:!0}),t.on("click",(()=>{this.locked||this.toggleZone(o)})))}}).addTo(o);this.layer=l;const a=l.getBounds();(a.isValid()&&!this.selected.length||a.isValid()&&this.selected.length)&&o.fitBounds(a,{padding:[16,16]})}restyleLayer(){const e=this.layer;e&&e.setStyle((e=>{var t,o;return this.layerStyle(e&&null!==(o=null===(t=this.zoneOf(e))||void 0===t?void 0:t.code)&&void 0!==o?o:null)}))}toggleZone(e){const t=this.selected.includes(e.code),o=this.multiple?t?this.selected.filter((t=>t!==e.code)):[...this.selected,e.code]:t?[]:[e.code];this.emitZones(o)}emitZones(e){const t=new Map(this.zones.map((e=>[e.code,e])));this.layerChange.emit(e.map((e=>{var o;return null!==(o=t.get(e))&&void 0!==o?o:{code:e,name:e}})))}renderLayerBar(){const e=this.selected.map((e=>{var t;return null!==(t=this.zones.find((t=>t.code===e)))&&void 0!==t?t:{code:e,name:e}}));return a("div",{class:"fk-geo__bar"},this.layerFailed?a("span",{class:"fk-geo__summary"},i("layer.unavailable")):this.multiple?a("span",{class:"fk-geo__chips"},0===e.length?a("span",{class:"fk-geo__summary"},i("layer.pickMany")):e.map((e=>a("span",{class:"fk-geo__chip"},e.name,this.locked?null:a("button",{type:"button",class:"fk-geo__chip-remove","aria-label":i("geo.clear"),onClick:()=>this.toggleZone(e)},"×"))))):a("select",{class:"fk-field__input fk-geo__select",ref:e=>{this.selectEl=e},disabled:this.locked,onChange:e=>{const t=e.target.value;this.emitZones(t?[t]:[])}},a("option",{value:"",selected:!this.selected.length},i("layer.pick")),this.zones.map((e=>a("option",{value:e.code,selected:this.selected[0]===e.code},e.name)))),this.locked||this.layerFailed?null:a("span",{class:"fk-geo__hint"},i("layer.hint")))}render(){var e;const t="Point"===(null===(e=this.value)||void 0===e?void 0:e.type)?this.value.coordinates:void 0,o=i("point"===this.mode?"geo.hintPoint":"geo.hintArea");return a("div",{key:"ba4c59daf0ed18f7702ef91fe8b400dd1f3021fd",class:{"fk-geo":!0,"fk-geo--locked":this.locked}},a("div",{key:"341d1e70707f152ff067e4ee39df140eb56c4994",class:"fk-geo__map",style:{height:`${this.height}px`},ref:e=>{this.container=e}},this.failed?a("div",{class:"fk-geo__unavailable"},i("geo.unavailable")):null),"layer"===this.mode?this.renderLayerBar():a("div",{class:"fk-geo__bar"},"point"===this.mode&&this.manual?a("div",{class:"fk-geo__manual"},a("label",{class:"fk-geo__coord"},a("span",null,i("geo.latitude")),a("input",{class:"fk-field__input",type:"number",step:"any",min:"-90",max:"90",value:t?String(t[1]):"",disabled:this.disabled,readOnly:this.readOnly,onChange:e=>this.setManual("lat",e.target.value)})),a("label",{class:"fk-geo__coord"},a("span",null,i("geo.longitude")),a("input",{class:"fk-field__input",type:"number",step:"any",min:"-180",max:"180",value:t?String(t[0]):"",disabled:this.disabled,readOnly:this.readOnly,onChange:e=>this.setManual("lng",e.target.value)}))):a("span",{class:"fk-geo__summary"},this.vertexCount," ",i("geo.points")),this.locked?null:a("span",{class:"fk-geo__actions"},a("span",{class:"fk-geo__hint"},o),this.vertexCount>0?a("button",{type:"button",class:"fk-geo__clear",onClick:this.clear},i("geo.clear")):null)))}get el(){return this}static get watchers(){return{value:[{onValueChange:0}],disabled:[{onLockChange:0}],readOnly:[{onLockChange:0}],selected:[{onSelectedChange:0}],layerUrl:[{onLayerUrlChange:0}]}}static get style(){return'.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none !important;max-height:none !important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none !important;max-height:none !important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;transition:opacity 0.2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);-moz-transition:-moz-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078A8}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,0.5)}.leaflet-container{font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,0.65);border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:bold 18px \'Lucida Console\', Monaco, monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255, 255, 255, 0.8);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline !important;vertical-align:baseline !important;width:1em;height:0.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;-moz-box-sizing:border-box;box-sizing:border-box;background:rgba(255, 255, 255, 0.8);text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,0.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:17px 0;margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:white;color:#333;box-shadow:0 3px 14px rgba(0,0,0,0.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma, Verdana, sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,0.4)}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}fk-geo-map{display:block;width:100%}.fk-geo__map{width:100%;border:1px solid var(--fk-border, #d4d4d8);border-radius:var(--fk-radius, 0.375rem);overflow:hidden;background:var(--fk-bg-muted, #f4f4f5);position:relative}.fk-geo--locked .fk-geo__map{cursor:default}.fk-geo__unavailable{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:0.875rem;color:var(--fk-text-muted, #71717a)}.fk-geo__marker{width:14px;height:14px;border-radius:50%;background:var(--fk-primary, #16a34a);border:2px solid #fff;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25)}.fk-geo__shape{stroke:var(--fk-primary, #16a34a);fill:var(--fk-primary, #16a34a);fill-opacity:0.15}.fk-geo__bar{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:0.5rem 1rem;margin-top:0.5rem}.fk-geo__manual{display:flex;gap:0.75rem}.fk-geo__coord{display:flex;flex-direction:column;gap:0.25rem;font-size:0.75rem;color:var(--fk-text-muted, #71717a)}.fk-geo__coord input{width:9rem}.fk-geo__summary,.fk-geo__hint{font-size:0.75rem;color:var(--fk-text-muted, #71717a)}.fk-geo__actions{display:flex;align-items:center;gap:0.75rem}.fk-geo__clear{border:1px solid var(--fk-border, #d4d4d8);border-radius:var(--fk-radius, 0.375rem);background:transparent;color:inherit;font:inherit;font-size:0.75rem;padding:0.25rem 0.625rem;cursor:pointer}.fk-geo__clear:hover{background:var(--fk-bg-muted, rgba(127, 127, 127, 0.12))}.fk-geo__zone{stroke:var(--fk-primary, #16a34a);fill:var(--fk-primary, #16a34a);cursor:pointer}.fk-geo__select{min-width:14rem}.fk-geo__chips{display:flex;flex-wrap:wrap;gap:0.375rem}.fk-geo__chip{display:inline-flex;align-items:center;gap:0.25rem;padding:0.125rem 0.5rem;border-radius:999px;background:var(--fk-bg-muted, rgba(127, 127, 127, 0.12));font-size:0.75rem}.fk-geo__chip-remove{border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;line-height:1}'}},[0,"fk-geo-map",{value:[16],mode:[1],center:[16],zoom:[2],tileUrl:[1,"tile-url"],attribution:[1],height:[2],disabled:[4],readOnly:[4,"read-only"],manual:[4],layerUrl:[1,"layer-url"],layerCodeProperty:[1,"layer-code-property"],layerNameProperty:[1,"layer-name-property"],selected:[16],multiple:[4],failed:[32],vertexCount:[32],zones:[32],layerFailed:[32]},void 0,{value:[{onValueChange:0}],disabled:[{onLockChange:0}],readOnly:[{onLockChange:0}],selected:[{onSelectedChange:0}],layerUrl:[{onLayerUrlChange:0}]}]);function p(){"undefined"!=typeof customElements&&["fk-geo-map"].forEach((t=>{"fk-geo-map"===t&&(customElements.get(e(t))||customElements.define(e(t),f))}))}p();export{f as F,p as d}
|
|
1
|
+
import{t as e,p as t,H as o,c as l,h as a}from"./p-8ICOcloT.js";import{b as i}from"./p-DdGjQ53Y.js";const r=new Map,n=e=>Math.round(1e6*e)/1e6,s=e=>[n(e.lng),n(e.lat)],f=t(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.geoChange=l(this,"geoChange"),this.layerChange=l(this,"layerChange"),this.mode="point",this.zoom=6,this.tileUrl="https://tile.openstreetmap.org/{z}/{x}/{y}.png",this.attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',this.height=320,this.disabled=!1,this.readOnly=!1,this.manual=!0,this.layerCodeProperty="code",this.layerNameProperty="name",this.selected=[],this.multiple=!1,this.failed=!1,this.vertexCount=0,this.zones=[],this.layerFailed=!1,this.shapes=[],this.vertices=[],this.lastEmitted="",this.clear=()=>{this.locked||this.setVertices([])}}get locked(){return this.disabled||this.readOnly}async componentDidLoad(){var e;"layer"===this.mode&&this.fetchLayer();try{const t=await import("./p-66Xzy1Vh.js").then((function(e){return e.l}));this.L=null!==(e=t.default)&&void 0!==e?e:t}catch(e){return void(this.failed=!0)}this.container&&this.initMap()}disconnectedCallback(){var e,t;null===(e=this.observer)||void 0===e||e.disconnect(),null===(t=this.map)||void 0===t||t.remove(),this.map=void 0}onValueChange(e){JSON.stringify(null!=e?e:null)!==this.lastEmitted&&this.draw(e)}onLockChange(){this.draw(this.value),this.restyleLayer()}onSelectedChange(){this.restyleLayer()}onLayerUrlChange(){this.fetchLayer()}initMap(){var e;const t=this.L,o=this.container,l=t.map(o,{attributionControl:!0,zoomControl:!this.locked});t.tileLayer(this.tileUrl,{attribution:this.attribution,maxZoom:19}).addTo(l),l.setView(null!==(e=this.center)&&void 0!==e?e:[0,0],this.center?this.zoom:2),this.locked&&(l.dragging.disable(),l.scrollWheelZoom.disable()),l.on("click",(e=>{this.locked||"layer"===this.mode||this.setVertices("point"===this.mode?[e.latlng]:[...this.vertices,e.latlng])})),this.map=l,this.draw(this.value),this.drawLayer(),"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((()=>l.invalidateSize())),this.observer.observe(o)),setTimeout((()=>l.invalidateSize()),50)}draw(e){var t;const o=this.L,l=this.map;if(!o||!l)return void(this.vertexCount=this.countVertices(e));const a=[];if("Point"===(null==e?void 0:e.type)&&a.push(o.latLng(e.coordinates[1],e.coordinates[0])),"LineString"===(null==e?void 0:e.type))for(const[t,l]of e.coordinates)a.push(o.latLng(l,t));if("Polygon"===(null==e?void 0:e.type)){const l=null!==(t=e.coordinates[0])&&void 0!==t?t:[],i=l.length>1&&l[0][0]===l[l.length-1][0]&&l[0][1]===l[l.length-1][1]?l.slice(0,-1):l;for(const[e,t]of i)a.push(o.latLng(t,e))}this.vertices=a,this.vertexCount=a.length,this.render_shapes(),1===a.length?l.setView(a[0],Math.max(l.getZoom(),this.zoom)):a.length>1&&l.fitBounds(o.latLngBounds(a),{padding:[24,24]})}countVertices(e){var t,o;return e?"Point"===e.type?1:"LineString"===e.type?e.coordinates.length:Math.max((null!==(o=null===(t=e.coordinates[0])||void 0===t?void 0:t.length)&&void 0!==o?o:1)-1,0):0}render_shapes(){const e=this.L,t=this.map;if(!e||!t)return;for(const e of this.shapes)e.remove();this.shapes=[];const o=this.vertices;"polygon"===this.mode&&o.length>=3&&this.shapes.push(e.polygon(o,{className:"fk-geo__shape"}).addTo(t)),"line"===this.mode&&o.length>=2&&this.shapes.push(e.polyline(o,{className:"fk-geo__shape"}).addTo(t)),o.forEach(((o,l)=>{const a=e.marker(o,{draggable:!this.locked,icon:e.divIcon({className:"fk-geo__marker",iconSize:[14,14],iconAnchor:[7,7]})}).addTo(t);a.on("dragend",(()=>{const e=[...this.vertices];e[l]=a.getLatLng(),this.setVertices(e)})),"point"!==this.mode&&a.on("contextmenu",(()=>{this.locked||this.setVertices(this.vertices.filter(((e,t)=>t!==l)))})),this.shapes.push(a)}))}setVertices(e){this.vertices=e,this.vertexCount=e.length,this.render_shapes(),this.emit()}geometry(){const e=this.vertices;if("point"===this.mode)return e[0]?{type:"Point",coordinates:s(e[0])}:void 0;if("line"===this.mode)return e.length>=2?{type:"LineString",coordinates:e.map(s)}:void 0;if(e.length<3)return;const t=e.map(s);return{type:"Polygon",coordinates:[[...t,t[0]]]}}emit(){const e=this.geometry();this.lastEmitted=JSON.stringify(null!=e?e:null),this.geoChange.emit(e)}setManual(e,t){var o,l,a;if(this.locked)return;if(""===t.trim())return this.vertices=[],this.vertexCount=0,this.render_shapes(),void this.emit();const i="Point"===(null===(o=this.value)||void 0===o?void 0:o.type)?this.value.coordinates:void 0,r="lat"===e?Number(t):null!==(l=null==i?void 0:i[1])&&void 0!==l?l:NaN,n="lng"===e?Number(t):null!==(a=null==i?void 0:i[0])&&void 0!==a?a:NaN;if(Number.isNaN(r)||Number.isNaN(n))return;const s=this.L?this.L.latLng(r,n):{lat:r,lng:n};this.vertices=[s],this.vertexCount=1,this.render_shapes(),this.map&&this.map.setView(s,Math.max(this.map.getZoom(),this.zoom)),this.emit()}componentDidRender(){var e;this.selectEl&&"layer"===this.mode&&(this.selectEl.value=null!==(e=this.selected[0])&&void 0!==e?e:"")}zoneOf(e){var t;const o=null!==(t=e.properties)&&void 0!==t?t:{},l=o[this.layerCodeProperty],a=o[this.layerNameProperty];return null==l||""===l?null:{code:String(l),name:String(null==a?l:a)}}async fetchLayer(){var e;if(this.layerFailed=!1,!this.layerUrl)return this.layerData=void 0,this.zones=[],void this.drawLayer();try{const t=await(e=>{let t=r.get(e);return t||(t=fetch(e,{headers:{Accept:"application/geo+json, application/json"}}).then((async e=>{if(!e.ok)throw new Error(String(e.status));return await e.json()})),t.catch((()=>r.delete(e))),r.set(e,t)),t})(this.layerUrl);this.layerData=t,this.zones=(null!==(e=t.features)&&void 0!==e?e:[]).map((e=>this.zoneOf(e))).filter((e=>null!==e)).sort(((e,t)=>e.name.localeCompare(t.name))),this.drawLayer()}catch(e){this.layerFailed=!0}}layerStyle(e){const t=null!==e&&this.selected.includes(e);return{className:t?"fk-geo__zone fk-geo__zone--selected":"fk-geo__zone",weight:t?2:1,fillOpacity:t?.45:.1}}drawLayer(){var e;const t=this.L,o=this.map;if(!t||!o||"layer"!==this.mode)return;if(null===(e=this.layer)||void 0===e||e.remove(),this.layer=void 0,!this.layerData)return;const l=t.geoJSON(this.layerData,{style:e=>{var t,o;return this.layerStyle(e&&null!==(o=null===(t=this.zoneOf(e))||void 0===t?void 0:t.code)&&void 0!==o?o:null)},onEachFeature:(e,t)=>{const o=this.zoneOf(e);o&&(t.bindTooltip(o.name,{sticky:!0}),t.on("click",(()=>{this.locked||this.toggleZone(o)})))}}).addTo(o);this.layer=l;const a=l.getBounds();(a.isValid()&&!this.selected.length||a.isValid()&&this.selected.length)&&o.fitBounds(a,{padding:[16,16]})}restyleLayer(){const e=this.layer;e&&e.setStyle((e=>{var t,o;return this.layerStyle(e&&null!==(o=null===(t=this.zoneOf(e))||void 0===t?void 0:t.code)&&void 0!==o?o:null)}))}toggleZone(e){const t=this.selected.includes(e.code),o=this.multiple?t?this.selected.filter((t=>t!==e.code)):[...this.selected,e.code]:t?[]:[e.code];this.emitZones(o)}emitZones(e){const t=new Map(this.zones.map((e=>[e.code,e])));this.layerChange.emit(e.map((e=>{var o;return null!==(o=t.get(e))&&void 0!==o?o:{code:e,name:e}})))}renderLayerBar(){const e=this.selected.map((e=>{var t;return null!==(t=this.zones.find((t=>t.code===e)))&&void 0!==t?t:{code:e,name:e}}));return a("div",{class:"fk-geo__bar"},this.layerFailed?a("span",{class:"fk-geo__summary"},i("layer.unavailable")):this.multiple?a("span",{class:"fk-geo__chips"},0===e.length?a("span",{class:"fk-geo__summary"},i("layer.pickMany")):e.map((e=>a("span",{class:"fk-geo__chip"},e.name,this.locked?null:a("button",{type:"button",class:"fk-geo__chip-remove","aria-label":i("geo.clear"),onClick:()=>this.toggleZone(e)},"×"))))):a("select",{class:"fk-field__input fk-geo__select",ref:e=>{this.selectEl=e},disabled:this.locked,onChange:e=>{const t=e.target.value;this.emitZones(t?[t]:[])}},a("option",{value:"",selected:!this.selected.length},i("layer.pick")),this.zones.map((e=>a("option",{value:e.code,selected:this.selected[0]===e.code},e.name)))),this.locked||this.layerFailed?null:a("span",{class:"fk-geo__hint"},i("layer.hint")))}render(){var e;const t="Point"===(null===(e=this.value)||void 0===e?void 0:e.type)?this.value.coordinates:void 0,o=i("point"===this.mode?"geo.hintPoint":"geo.hintArea");return a("div",{key:"3adf67d52e87de730d1f33c1f4aa5d56d93c9201",class:{"fk-geo":!0,"fk-geo--locked":this.locked}},a("div",{key:"f78144732a57ea5f25d1d15b1608823b2cab50e7",class:"fk-geo__map",style:{height:`${this.height}px`},ref:e=>{this.container=e}},this.failed?a("div",{class:"fk-geo__unavailable"},i("geo.unavailable")):null),"layer"===this.mode?this.renderLayerBar():a("div",{class:"fk-geo__bar"},"point"===this.mode&&this.manual?a("div",{class:"fk-geo__manual"},a("label",{class:"fk-geo__coord"},a("span",null,i("geo.latitude")),a("input",{class:"fk-field__input",type:"number",step:"any",min:"-90",max:"90",value:t?String(t[1]):"",disabled:this.disabled,readOnly:this.readOnly,onChange:e=>this.setManual("lat",e.target.value)})),a("label",{class:"fk-geo__coord"},a("span",null,i("geo.longitude")),a("input",{class:"fk-field__input",type:"number",step:"any",min:"-180",max:"180",value:t?String(t[0]):"",disabled:this.disabled,readOnly:this.readOnly,onChange:e=>this.setManual("lng",e.target.value)}))):a("span",{class:"fk-geo__summary"},this.vertexCount," ",i("geo.points")),this.locked?null:a("span",{class:"fk-geo__actions"},a("span",{class:"fk-geo__hint"},o),this.vertexCount>0?a("button",{type:"button",class:"fk-geo__clear",onClick:this.clear},i("geo.clear")):null)))}get el(){return this}static get watchers(){return{value:[{onValueChange:0}],disabled:[{onLockChange:0}],readOnly:[{onLockChange:0}],selected:[{onSelectedChange:0}],layerUrl:[{onLayerUrlChange:0}]}}static get style(){return'.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none !important;max-height:none !important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none !important;max-height:none !important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;transition:opacity 0.2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);-moz-transition:-moz-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078A8}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,0.5)}.leaflet-container{font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,0.65);border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:bold 18px \'Lucida Console\', Monaco, monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255, 255, 255, 0.8);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline !important;vertical-align:baseline !important;width:1em;height:0.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;-moz-box-sizing:border-box;box-sizing:border-box;background:rgba(255, 255, 255, 0.8);text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,0.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:17px 0;margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:white;color:#333;box-shadow:0 3px 14px rgba(0,0,0,0.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma, Verdana, sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,0.4)}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}fk-geo-map{display:block;width:100%}.fk-geo__map{width:100%;border:1px solid var(--fk-border, #d4d4d8);border-radius:var(--fk-radius, 0.375rem);overflow:hidden;background:var(--fk-bg-muted, #f4f4f5);position:relative}.fk-geo--locked .fk-geo__map{cursor:default}.fk-geo__unavailable{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:0.875rem;color:var(--fk-text-muted, #71717a)}.fk-geo__marker{width:14px;height:14px;border-radius:50%;background:var(--fk-primary, #16a34a);border:2px solid #fff;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25)}.fk-geo__shape{stroke:var(--fk-primary, #16a34a);fill:var(--fk-primary, #16a34a);fill-opacity:0.15}.fk-geo__bar{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:0.5rem 1rem;margin-top:0.5rem}.fk-geo__manual{display:flex;gap:0.75rem}.fk-geo__coord{display:flex;flex-direction:column;gap:0.25rem;font-size:0.75rem;color:var(--fk-text-muted, #71717a)}.fk-geo__coord input{width:9rem}.fk-geo__summary,.fk-geo__hint{font-size:0.75rem;color:var(--fk-text-muted, #71717a)}.fk-geo__actions{display:flex;align-items:center;gap:0.75rem}.fk-geo__clear{border:1px solid var(--fk-border, #d4d4d8);border-radius:var(--fk-radius, 0.375rem);background:transparent;color:inherit;font:inherit;font-size:0.75rem;padding:0.25rem 0.625rem;cursor:pointer}.fk-geo__clear:hover{background:var(--fk-bg-muted, rgba(127, 127, 127, 0.12))}.fk-geo__zone{stroke:var(--fk-primary, #16a34a);fill:var(--fk-primary, #16a34a);cursor:pointer}.fk-geo__select{min-width:14rem}.fk-geo__chips{display:flex;flex-wrap:wrap;gap:0.375rem}.fk-geo__chip{display:inline-flex;align-items:center;gap:0.25rem;padding:0.125rem 0.5rem;border-radius:999px;background:var(--fk-bg-muted, rgba(127, 127, 127, 0.12));font-size:0.75rem}.fk-geo__chip-remove{border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;line-height:1}'}},[0,"fk-geo-map",{value:[16],mode:[1],center:[16],zoom:[2],tileUrl:[1,"tile-url"],attribution:[1],height:[2],disabled:[4],readOnly:[4,"read-only"],manual:[4],layerUrl:[1,"layer-url"],layerCodeProperty:[1,"layer-code-property"],layerNameProperty:[1,"layer-name-property"],selected:[16],multiple:[4],failed:[32],vertexCount:[32],zones:[32],layerFailed:[32]},void 0,{value:[{onValueChange:0}],disabled:[{onLockChange:0}],readOnly:[{onLockChange:0}],selected:[{onSelectedChange:0}],layerUrl:[{onLayerUrlChange:0}]}]);function p(){"undefined"!=typeof customElements&&["fk-geo-map"].forEach((t=>{"fk-geo-map"===t&&(customElements.get(e(t))||customElements.define(e(t),f))}))}p();export{f as F,p as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as i,H as s,c as e,h as a}from"./p-8ICOcloT.js";import{g as n,r as o,a as h,w as r}from"./p-DdGjQ53Y.js";import{g as l}from"./p-BMtyMU2R.js";import{d as c}from"./p-D6W-SOWV.js";import{d}from"./p-CIgvEKbO.js";import{d as u}from"./p-CuWGcxtN.js";const p=i(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.brickDataChange=e(this,"brickDataChange"),this.brickConfigsChange=e(this,"brickConfigsChange"),this.brickStylesChange=e(this,"brickStylesChange"),this.brickValidationsChange=e(this,"brickValidationsChange"),this.brickRulesChange=e(this,"brickRulesChange"),this.brickRemove=e(this,"brickRemove"),this.brickDuplicate=e(this,"brickDuplicate"),this.brickReviewChange=e(this,"brickReviewChange"),this.path="0",this.editable=!1,this.readOnly=!1,this.disabled=!1,this.errors={},this.reviewable=!1}render(){var t,i,s,e,c,d,u,p;const k=this.brickSpec;if(!k)return null;const b=l(k.type,k.id);if(!b)return a("fk-brick-not-found",null,`${k.type}:${k.id}`);const f=this.editable&&(null===(t=k.editable)||void 0===t||t),v=n(k.rules,this.dataMap);if(!f&&!0===v.hidden)return null;const m="panel"===k.type||"collection"===k.type,g=(null!==(i=k.children)&&void 0!==i?i:[]).map(((t,i)=>{var s;return a("fk-brick-render",{brickSpec:t,rootSpec:null!==(s=this.rootSpec)&&void 0!==s?s:this.brickSpec,data:this.data,dataMap:this.dataMap,errors:this.errors,annotations:this.annotations,notes:this.notes,editableKeys:this.editableKeys,reviewable:this.reviewable,locale:this.locale,path:`${this.path}.${i}`,editable:this.editable,readOnly:this.readOnly,disabled:this.disabled,selectedPath:this.selectedPath,utils:this.utils})})),C=null===(s=k.configs)||void 0===s?void 0:s.key,y=!!C&&("input"===k.type||"collection"===k.type),S=y&&void 0!==this.editableKeys&&!this.editableKeys.includes(C)&&!this.editableKeys.some((t=>t.startsWith(`${C}[`))),j=y?null===(e=this.annotations)||void 0===e?void 0:e[C]:void 0,D=y?null===(c=this.notes)||void 0===c?void 0:c[C]:void 0,E=y&&this.reviewable&&!f?{value:null!=j?j:{},onChange:t=>this.brickReviewChange.emit({key:C,annotation:t})}:void 0;f&&m&&g.push(a("fk-drop-area",{path:this.path}));const w={brickSpec:k,configsForm:k.configsForm,configs:o(k.configs,this.locale),locale:this.locale,styles:null!==(d=k.styles)&&void 0!==d?d:{},data:h(k,this.data),dataMap:this.dataMap,rootSpec:null!==(u=this.rootSpec)&&void 0!==u?u:this.brickSpec,error:(null===(p=k.configs)||void 0===p?void 0:p.key)?this.errors[k.configs.key]:void 0,disabled:!f&&(this.disabled||!0===v.disabled),readOnly:!f&&(this.readOnly||S),annotation:j,note:D,review:E,annotations:this.annotations,notes:this.notes,reviewable:this.reviewable&&!f,editableKeys:this.editableKeys,path:this.path,editable:f,children:g,validations:k.validations,rules:k.rules,utils:this.utils,onDataChange:t=>{const i=r(k,t);void 0!==i&&this.brickDataChange.emit(i)},onDataPatch:t=>{t&&Object.keys(t).length&&this.brickDataChange.emit(t)},onConfigsChange:(t,i)=>this.brickConfigsChange.emit({configs:t,path:null!=i?i:this.path}),onStylesChange:(t,i)=>this.brickStylesChange.emit({styles:t,path:null!=i?i:this.path}),onValidationsChange:(t,i)=>this.brickValidationsChange.emit({validations:t,path:null!=i?i:this.path}),onRulesChange:(t,i)=>this.brickRulesChange.emit({rules:t,path:null!=i?i:this.path}),onDelete:t=>this.brickRemove.emit({path:t}),onDuplicate:t=>this.brickDuplicate.emit({path:t})},O=f?b.renderBuilder(w):b.render(w);return f&&"0"!==this.path?a("fk-brick-actions",{path:this.path,selected:this.path===this.selectedPath},O):O}},[0,"fk-brick-render",{brickSpec:[16],rootSpec:[16],data:[16],dataMap:[16],path:[1],editable:[4],readOnly:[4,"read-only"],disabled:[4],selectedPath:[1,"selected-path"],errors:[16],annotations:[16],notes:[16],editableKeys:[16],reviewable:[4],locale:[1],utils:[16]}]);function k(){"undefined"!=typeof customElements&&["fk-brick-render","fk-brick-actions","fk-brick-not-found","fk-brick-render","fk-drop-area"].forEach((i=>{switch(i){case"fk-brick-render":customElements.get(t(i))||customElements.define(t(i),p);break;case"fk-brick-actions":customElements.get(t(i))||c();break;case"fk-brick-not-found":customElements.get(t(i))||d();break;case"fk-brick-render":customElements.get(t(i))||k();break;case"fk-drop-area":customElements.get(t(i))||u()}}))}k();export{p as F,k as d}
|