@visitscotland/component-library
Version:
VisitScotland Component Library
1 lines • 4.28 kB
JavaScript
(self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[6216],{26216:function(e,n,t){"use strict";t.r(n);var o=t(74864),u={};for(var a in o)"default"!==a&&(u[a]=function(e){return o[e]}.bind(0,a));t.d(n,u),t(46240);const l=o.default;n.default=l},46240:function(e,n,t){"use strict";t(58164)},58164:function(e,n,t){"use strict";var o=t(85072),u=t.n(o),a=t(97825),l=t.n(a),c=t(77659),i=t.n(c),r=t(55056),s=t.n(r),d=t(10540),m=t.n(d),v=t(41113),p=t.n(v),f=t(96646),k=t.n(f),_={};_.styleTagTransform=p(),_.setAttributes=s(),_.insert=i().bind(null,"head"),_.domAPI=l(),_.insertStyleElement=m(),u()(k(),_),k()&&k().locals&&k().locals},69694:function(e,n,t){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0});var u=t(17527),a=t(17527),l={class:"vs-guest-selector-row","data-test":"vs-guest-selector-row"},c={class:"vs-guest-selector-row__title"},i={key:1,class:"c-search__rooms-guests-picker__row"},r=["name"],s=["name"],d=["name"],m=t(17527),v=t(378),p=o(t(98896)),f=o(t(48836));n.default=(0,u.defineComponent)({__name:"GuestSelectorRow",props:{name:{},showRemoveBtn:{type:Boolean},unitLabel:{},unitOptions:{},unitRemoved:{type:Boolean}},emits:["numberChange","onRemove"],setup:function(e,n){var t=n.emit,o=e,u=t,k=(0,m.ref)(o.unitOptions.numberGroups.adults.count),_=(0,m.ref)(o.unitOptions.numberGroups.children.count),b=(0,m.ref)(o.unitOptions.numberGroups.infants.count),h=(0,v.getLabelText)("remove","Remove","guests_rooms"),B=(0,m.computed)((function(){return _.value+b.value})),y=function(e,n,t,o){var a="";e.includes("children")&&(_.value=n,a="children"),e.includes("infants")&&(b.value=n,a="infants"),(e.includes("r1a")||e.includes("r2a")||e.includes("r3a")||e.includes("r4a")||e.includes("r5a"))&&(k.value=n,a="adults"),u("numberChange",t,a,o)},g=function(){u("onRemove",b.value+_.value+k.value,b.value+_.value,o.unitOptions.id)};return function(e,n){return(0,a.openBlock)(),(0,a.createElementBlock)("div",l,[(0,a.createElementVNode)("div",c,(0,a.toDisplayString)(e.unitLabel),1),"r1"!==e.name?((0,a.openBlock)(),(0,a.createBlock)(f.default,{key:0,class:"vs-guest-selector-row__remove",onClick:(0,a.withModifiers)(g,["prevent"]),variant:"subtle",icon:"vs-icon-control-dismiss","icon-size":"sm","icon-position":"left","icon-only":"",size:"sm"},{default:(0,a.withCtx)((function(){return[(0,a.createTextVNode)((0,a.toDisplayString)((0,a.unref)(h)),1)]})),_:1})):(0,a.createCommentVNode)("",!0),e.unitOptions?((0,a.openBlock)(),(0,a.createElementBlock)("div",i,[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(e.unitOptions.numberGroups,(function(n,t){return(0,a.openBlock)(),(0,a.createBlock)(p.default,{"adult-count":k.value,"children-count":_.value,count:n.count,disabled:!1,id:e.unitOptions.id,"infant-count":b.value,"input-type":n,key:"".concat(e.name,"_").concat(t),"max-value":n.maxCount,"min-value":n.minCount,name:n.name,"row-label":n.unitLabel,"row-name":e.name,"unit-removed":e.unitRemoved,onChangeHandler:y},null,8,["adult-count","children-count","count","id","infant-count","input-type","max-value","min-value","name","row-label","row-name","unit-removed"])})),128)),(0,a.withDirectives)((0,a.createElementVNode)("input",{type:"hidden",name:"".concat(e.name,"c"),"onUpdate:modelValue":n[0]||(n[0]=function(e){return B.value=e})},null,8,r),[[a.vModelText,B.value]])])):(0,a.createCommentVNode)("",!0),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(_.value,(function(n,t){return(0,a.openBlock)(),(0,a.createElementBlock)("input",{type:"hidden",key:"".concat(e.name,"c").concat(t),name:"".concat(e.name,"c").concat(t),value:"10"},null,8,s)})),128)),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(b.value,(function(n,t){return(0,a.openBlock)(),(0,a.createElementBlock)("input",{type:"hidden",key:"".concat(e.name,"c").concat(t),name:"".concat(e.name,"c").concat(t+_.value),value:"1"},null,8,d)})),128))])}}})},74864:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return u.a}});var o=t(69694),u=t.n(o),a={};for(var l in o)"default"!==l&&(a[l]=function(e){return o[e]}.bind(0,l));t.d(n,a)},96646:function(){}}]);