@expofp/floorplan
Version:
Interactive floor plan library for expos and events
2 lines (1 loc) • 3.61 kB
JavaScript
import{jsx as e,jsxs as i,Fragment as R}from"react/jsx-runtime";import"./WayfindingTemplate.scss";import M from"classnames";import Z from"../ui/ToggleSwitch";import{t as l}from"../utils/i18n";import s from"./Autocomplete";import B from"./RouteQR";import E from"./WayfindingFloorSelectorContainer";import j from"./WayInformation";const D=({options:n=[],fromValue:d,toValue:r,showForm:o=!0,showAccessible:c=!1,showInfo:f=!1,routeFound:m=!1,infoItems:h=[],infoAccessible:a,floors:t=[],currentFloor:p,routeUrl:C,isKiosk:g,onChangeFrom:w,onChangeTo:v,onSwitch:y,onClickInfo:_,onClickFloor:u,onAccessibleCheck:F,showDetailsIcon:N,onDetailsIconClick:x})=>i("div",{className:M("efp-wayfinding",{isCollapsed:!o}),children:[o&&i("div",{className:"efp-wayfinding__top",children:[i("div",{className:"efp-wayfindingForm",children:[i("div",{className:"efp-wayfindingForm__icons",children:[e("div",{className:"efp-wayfindingForm__from",children:i("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{d:"M18 9C18 13.9706 13.9706 18 9 18C4.02944 18 0 13.9706 0 9C0 4.02944 4.02944 0 9 0C13.9706 0 18 4.02944 18 9Z",fill:"white"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 13.375C11.4162 13.375 13.375 11.4162 13.375 9C13.375 6.58375 11.4162 4.625 9 4.625C6.58375 4.625 4.625 6.58375 4.625 9C4.625 11.4162 6.58375 13.375 9 13.375ZM9 16C12.866 16 16 12.866 16 9C16 5.13401 12.866 2 9 2C5.13401 2 2 5.13401 2 9C2 12.866 5.13401 16 9 16Z",fill:"#30AFEB"})]})}),e("div",{className:"efp-wayfindingForm__to",children:i("svg",{width:"18",height:"25",viewBox:"0 0 18 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 24.1571L10.5475 22.267C11.0023 21.7114 11.4571 21.1656 11.9041 20.6291C13.2939 18.9611 14.6088 17.3829 15.6182 15.8814C16.988 13.8436 18 11.668 18 9.125C18 4.09562 14.0267 0 9 0C3.97332 0 0 4.09562 0 9.125C0 11.668 1.01202 13.8436 2.38182 15.8814C3.39116 17.3829 4.70613 18.9611 6.09588 20.6291C6.54291 21.1656 6.99767 21.7114 7.45249 22.267L9 24.1571Z",fill:"white"}),e("path",{d:"M9 2C5.11111 2 2 5.16667 2 9.125C2 13.0833 5.11111 16.25 9 21C12.8889 16.25 16 13.0833 16 9.125C16 5.16667 12.8889 2 9 2ZM9 6.75C10.2911 6.75 11.3333 7.81083 11.3333 9.125C11.3333 10.4392 10.2911 11.5 9 11.5C7.70889 11.5 6.66667 10.4392 6.66667 9.125C6.66667 7.81083 7.70889 6.75 9 6.75Z",fill:"#FF9E2C"})]})}),e("div",{className:"efp-wayfindingForm__dots",children:i("svg",{width:"4",height:"18",viewBox:"0 0 4 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("circle",{cx:"2",cy:"2",r:"2",fill:"#DCDFE9"}),e("circle",{cx:"2",cy:"16",r:"2",fill:"#DCDFE9"})]})})]}),i("div",{className:"efp-wayfindingForm__controls",children:[e("div",{style:{marginBottom:10},children:e(s,{placeholder:l("Choose starting point"),options:n,value:d,onChange:w})}),e("div",{children:e(s,{placeholder:l("Choose destination point"),options:n,value:r,onChange:v})})]}),i("div",{className:"efp-wayfindingForm__actions",children:[e("button",{type:"button",className:"efp-wayfindingForm__switch",onClick:y}),N&&e("button",{type:"button",className:"efp-wayfindingForm__details",onClick:x})]})]}),c&&e("div",{className:"efp-wayfindingForm__accessible",children:e(Z,{name:"onlyAccessible",label:l("Accessible"),value:a,onChange:b=>F(b)})})]}),t.length>1&&e(E,{floors:t,value:p,onSelect:u}),f&&e("div",{className:"efp-wayfindingInfo",children:m?i(R,{children:[e(j,{items:h,accessible:a,onClick:_}),g&&e(B,{url:C})]}):e("div",{className:"efp-wayfindingError",children:l("Route not found")})})]});export default D;