@visitscotland/component-library 1.0.34 → 1.0.35
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/CHANGELOG.md +7 -0
- package/dist/client/manifest.json +4 -4
- package/dist/client/scripts/f215e30f3e863eab308e.js +1 -0
- package/dist/ssr/index.js +1 -1
- package/dist/ssr/manifest.json +1 -1
- package/package.json +1 -1
- package/dist/client/scripts/1229582d7c91b11a66a9.js +0 -1
- /package/dist/client/styles/{1229582d7c91b11a66a9.css → f215e30f3e863eab308e.css} +0 -0
- /package/dist/ssr/styles/{d4a551e5c061f8384406.css → 0e5d8f56a62e9cb2a614.css} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.0.35](https://github.com/visitscotland/vs-component-library/compare/v1.0.34...v1.0.35) (2023-09-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### 🐛 Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **psw:** check window defined before access ([d5ff23d](https://github.com/visitscotland/vs-component-library/commit/d5ff23d2c09b5f6046adacdabcbe959acc454a89))
|
|
11
|
+
|
|
5
12
|
### [1.0.34](https://github.com/visitscotland/vs-component-library/compare/v1.0.33...v1.0.34) (2023-09-20)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -5490,7 +5490,7 @@
|
|
|
5490
5490
|
"scripts/56f3990ec87cad1dd530.js",
|
|
5491
5491
|
"scripts/aa3efed6b1f6232ce3fe.js",
|
|
5492
5492
|
"scripts/96174af322a67416c0a9.js",
|
|
5493
|
-
"scripts/
|
|
5493
|
+
"scripts/f215e30f3e863eab308e.js",
|
|
5494
5494
|
"scripts/97cddd3583069debb72b.js"
|
|
5495
5495
|
],
|
|
5496
5496
|
"styles": [
|
|
@@ -5501,7 +5501,7 @@
|
|
|
5501
5501
|
"styles/5c1f5cf47b7383235645.css",
|
|
5502
5502
|
"styles/8468fdfd3cabfa7bffab.css",
|
|
5503
5503
|
"styles/56f3990ec87cad1dd530.css",
|
|
5504
|
-
"styles/
|
|
5504
|
+
"styles/f215e30f3e863eab308e.css"
|
|
5505
5505
|
]
|
|
5506
5506
|
},
|
|
5507
5507
|
"VsSelectInput": {
|
|
@@ -5618,7 +5618,7 @@
|
|
|
5618
5618
|
"scripts/56f3990ec87cad1dd530.js",
|
|
5619
5619
|
"scripts/aa3efed6b1f6232ce3fe.js",
|
|
5620
5620
|
"scripts/96174af322a67416c0a9.js",
|
|
5621
|
-
"scripts/
|
|
5621
|
+
"scripts/f215e30f3e863eab308e.js",
|
|
5622
5622
|
"scripts/39c81d98eb88fed09973.js"
|
|
5623
5623
|
],
|
|
5624
5624
|
"styles": [
|
|
@@ -5632,7 +5632,7 @@
|
|
|
5632
5632
|
"styles/5c1f5cf47b7383235645.css",
|
|
5633
5633
|
"styles/8468fdfd3cabfa7bffab.css",
|
|
5634
5634
|
"styles/56f3990ec87cad1dd530.css",
|
|
5635
|
-
"styles/
|
|
5635
|
+
"styles/f215e30f3e863eab308e.css",
|
|
5636
5636
|
"styles/39c81d98eb88fed09973.css"
|
|
5637
5637
|
]
|
|
5638
5638
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[7809],{27451:function(){},12650:function(e,t,n){"use strict";var a=n(93379),o=n.n(a),l=n(7795),r=n.n(l),u=n(90569),c=n.n(u),i=n(3565),s=n.n(i),d=n(19216),f=n.n(d),p=n(44589),v=n.n(p),m=n(27451),h=n.n(m),b={};b.styleTagTransform=v(),b.setAttributes=s(),b.insert=c().bind(null,"head"),b.domAPI=r(),b.insertStyleElement=f(),o()(h(),b),h()&&h().locals&&h().locals},43062:function(e,t,n){"use strict";var a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,a){return new(n||(n=Promise))((function(o,l){function r(e){try{c(a.next(e))}catch(e){l(e)}}function u(e){try{c(a.throw(e))}catch(e){l(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,u)}c((a=a.apply(e,t||[])).next())}))},l=this&&this.__generator||function(e,t){var n,a,o,l,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(r=0)),r;)try{if(n=1,a&&(o=2&u[0]?a.return:u[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,u[1])).done)return o;switch(a=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,a=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){r=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(6===u[0]&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(e){u=[6,e],a=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(76765),c=n(76765),i={class:"vs-product-search-embed"},s={key:0,class:"container"},d={class:"row"},f={class:"col-12"},p=["action","onSubmit"],v={"aria-live":"polite"},m=["disabled","value"],h=["disabled","value"],b=["value"],y={key:4,type:"hidden",name:"areaproxdist",value:"10"},k={key:5},g={key:3},w=[(0,c.createElementVNode)("input",{hidden:"true",name:"avail",value:"on"},null,-1)],_={key:0},N=["value"],T=n(76765),V=n(12147),x=n(61309),B=n(68504),E=n(83506),L=r(n(27175)),S=r(n(17710)),C=r(n(49335)),P=r(n(10501)),D=r(n(96971)),O=r(n(83918));t.default=(0,u.defineComponent)({__name:"ProductSearchEmbed",props:{defaultProd:{type:String,default:"acti,attr,reta"},defaultLocation:{type:String,default:""},defaultLocale:{type:String,default:""}},setup:function(e){var t=this,n=e,r=(0,T.ref)(!1),u=(0,T.ref)(),j=(0,T.ref)([]),M=((0,T.ref)(null),(0,T.ref)()),U=(0,T.ref)(!1),A=(0,T.computed)((function(){var e=void 0===u.value?"see-do":u.value;return"/info/".concat(x.paths[e])})),I=!1,F={en:{localeUrl:""},fr:{localeUrl:"fr-fr"},de:{localeUrl:"de-de"},es:{localeUrl:"es-es"},it:{localeUrl:"it-it"},nl:{localeUrl:"nl-nl"}},G=(0,T.computed)((function(){var e=n.defaultLocale.length>0?n.defaultLocale:(0,V.getLocale)();return"en"===e&&(e=""),e})),R=(0,T.computed)((function(){if("undefined"!=typeof window){var e=window.location.origin;return e.includes("localhost")?"https://www.visitscotland.com":e}return"https://www.visitscotland.com"})),J=(0,T.computed)((function(){return"".concat(R.value).concat(G.value?"/"+G.value:"").concat(A.value,"/search-results")})),Y="https://www.visitscotland.com/data/locations"+"?locale=".concat(G.value),K=(0,T.ref)([]),q=function(e){M.value=K.value.find((function(t){return t.name===e}))},z=(0,T.ref)([]),H=(0,T.ref)([]),Q=(0,T.ref)([]),W=function(){r.value=!0,(0,T.nextTick)((function(){r.value=!1}))},X=(0,T.computed)((function(){return r.value?[]:z.value.map((function(e){return a(a({},e),{displayName:(0,V.getProductName)(e.optionValue,e.displayName)})}))}));(0,T.onBeforeMount)((function(){return o(t,void 0,void 0,(function(){var e;return l(this,(function(t){return window.VS={},(e=document.createElement("script")).async=!1,e.onload=W,e.setAttribute("src","https://www.visitscotland.com/".concat((F[n.defaultLocale]||"").localeUrl,"/data/template/search.js")),document.head.appendChild(e),[2]}))}))})),(0,T.onMounted)((function(){return o(t,void 0,void 0,(function(){var e,t,a;return l(this,(function(o){switch(o.label){case 0:return[4,(0,E.getData)(Y)];case 1:return(e=o.sent())&&(K.value=e.data),""!==n.defaultLocation&&q(n.defaultLocation),I=!0,u.value=n.defaultProd,l=(0,B.getProductTypes)(),r=[],l.forEach((function(e){r.push(e)})),z.value=r,[4,(0,E.getData)("https://www.visitscotland.com/tms-api/v1/attractions")];case 2:return(t=o.sent())&&(H.value=t.data),[4,(0,E.getData)("https://www.visitscotland.com/tms-api/v1/origins?active=1")];case 3:return(a=o.sent())&&(Q.value=a.data),[2]}var l,r}))}))}));var Z=function(e){U.value=!0;var t=e.currentTarget;setTimeout((function(){t.submit()}),500)};return function(t,n){var a,o,l,T,B,E;return(0,c.openBlock)(),(0,c.createElementBlock)("div",i,[r.value?(0,c.createCommentVNode)("",!0):((0,c.openBlock)(),(0,c.createElementBlock)("div",s,[(0,c.createElementVNode)("div",d,[(0,c.createElementVNode)("div",f,[(0,c.createElementVNode)("form",{action:J.value,onSubmit:(0,c.withModifiers)(Z,["prevent"]),"accept-charset":"UTF-8"},[(0,c.createVNode)(C.default,{label:(0,c.unref)(V.getLabelText)("tour_keywords","I'm looking for"),id:"select-type",name:"prodtypes","default-selected":e.defaultProd,onChangeOption:n[0]||(n[0]=function(e){return u.value=e}),options:X.value},null,8,["label","default-selected","options"]),(0,c.createElementVNode)("div",v,["tour"!=u.value&&(0,c.unref)(I)?((0,c.openBlock)(),(0,c.createBlock)(L.default,{key:0,id:"search-location",label:(0,c.unref)(V.getLabelText)("location","Location"),"multiselect-label":"name",name:"loc",options:K.value,placeholder:(0,c.unref)(V.getLabelText)("location_placeholder","Enter a location"),"track-by":"name",onChangeValue:n[1]||(n[1]=function(e){return q(e)}),"default-val":(0,c.unref)(M)},null,8,["label","options","placeholder","default-val"])):(0,c.createCommentVNode)("",!0),"tour"!==u.value?((0,c.openBlock)(),(0,c.createElementBlock)("input",{key:1,type:"hidden",name:"locplace",disabled:"POLYGON"===(null===(a=(0,c.unref)(M))||void 0===a?void 0:a.type),value:(null===(o=(0,c.unref)(M))||void 0===o?void 0:o.key)||""},null,8,m)):(0,c.createCommentVNode)("",!0),"tour"!==u.value?((0,c.openBlock)(),(0,c.createElementBlock)("input",{key:2,type:"hidden",name:"locpoly",disabled:"POLYGON"!==(null===(l=(0,c.unref)(M))||void 0===l?void 0:l.type),value:(null===(T=(0,c.unref)(M))||void 0===T?void 0:T.key)||""},null,8,h)):(0,c.createCommentVNode)("",!0),"tour"!==u.value?((0,c.openBlock)(),(0,c.createElementBlock)("input",{key:3,type:"hidden",name:"locprox",value:"DISTRICT"===(null===(B=(0,c.unref)(M))||void 0===B?void 0:B.type)?1:0},null,8,b)):(0,c.createCommentVNode)("",!0),"tour"!==u.value&&"DISTRICT"===(null===(E=(0,c.unref)(M))||void 0===E?void 0:E.type)?((0,c.openBlock)(),(0,c.createElementBlock)("input",y)):(0,c.createCommentVNode)("",!0),"even"===u.value||"acco"===u.value?((0,c.openBlock)(),(0,c.createElementBlock)("div",k,["even"===u.value||"acco"===u.value?((0,c.openBlock)(),(0,c.createBlock)(D.default,{key:0,legend:(0,c.unref)(V.getLabelText)("date_label","Dates"),"start-label":(0,c.unref)(V.getLabelText)("startdate","Start Date","dates"),"end-label":(0,c.unref)(V.getLabelText)("enddate","End Date","dates"),"default-dates":U.value},null,8,["legend","start-label","end-label","default-dates"])):(0,c.createCommentVNode)("",!0),"even"===u.value?((0,c.openBlock)(),(0,c.createBlock)(P.default,{key:1,name:"name",label:(0,c.unref)(V.getLabelText)("keywords","Keywords"),id:"search-keywords"},null,8,["label"])):(0,c.createCommentVNode)("",!0),"acco"===u.value?((0,c.openBlock)(),(0,c.createBlock)(S.default,{key:2,availability:!0,label:(0,c.unref)(V.getLabelText)("guests","Guests"),id:"guest-selector"},null,8,["label"])):(0,c.createCommentVNode)("",!0),"acco"===u.value?((0,c.openBlock)(),(0,c.createElementBlock)("div",g,w)):(0,c.createCommentVNode)("",!0)])):(0,c.createCommentVNode)("",!0)]),"tour"===u.value?((0,c.openBlock)(),(0,c.createElementBlock)("div",_,[(0,c.createVNode)(L.default,{id:"tour-origin",label:(0,c.unref)(V.getLabelText)("tour_origin","Starting point"),"multiselect-label":"name",name:"origins[]",options:Q.value,placeholder:(0,c.unref)(V.getLabelText)("tour_origin_placeholder","Location"),"track-by":"name","is-tour-location":!0},null,8,["label","options","placeholder"]),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(j.value,(function(e){return(0,c.openBlock)(),(0,c.createElementBlock)("input",{type:"hidden",name:"attractions[]",value:e},null,8,N)})),256)),(0,c.createVNode)(L.default,{id:"tour-month",label:(0,c.unref)(V.getLabelText)("tour_month","I'm traveling in"),"multiselect-label":"label",name:"when",options:(0,c.unref)(V.getLabelText)("months",(0,c.unref)(x.monthsEnglish)),placeholder:(0,c.unref)(V.getLabelText)("tour_month_placeholder","Select month"),"track-by":"value"},null,8,["label","options","placeholder"])])):(0,c.createCommentVNode)("",!0),(0,c.createVNode)(O.default,{class:"mt-6",variant:"dark"},{default:(0,c.withCtx)((function(){return[(0,c.createTextVNode)((0,c.toDisplayString)((0,c.unref)(V.getLabelText)("search","Search")),1)]})),_:1})],40,p)])])]))])}}})},61309:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.monthsEnglish=t.paths=t.products=void 0,t.products=[{key:"accommodation",displayName:"Accommodation",optionValue:"acco"},{key:"eventsAndFestivals",displayName:"Events & Festivals",optionValue:"even"},{key:"foodAndDrink",displayName:"Food & Drink",optionValue:"cate"},{key:"thingsToDo",displayName:"Things to do",optionValue:"acti,attr,reta"},{key:"tours",displayName:"Tours",optionValue:"tour"}],t.paths={acco:"accommodation","acti,attr,reta":"see-do",cate:"food-drink",even:"events",tour:"tours"},t.monthsEnglish=[{label:"January",value:"january"},{label:"February",value:"february"},{label:"March",value:"march"},{label:"April",value:"april"},{label:"May",value:"may"},{label:"June",value:"june"},{label:"July",value:"july"},{label:"August",value:"august"},{label:"September",value:"september"},{label:"October",value:"october"},{label:"November",value:"november"},{label:"December",value:"december"}]},83506:function(e,t,n){"use strict";var a=n(25108),o=this&&this.__awaiter||function(e,t,n,a){return new(n||(n=Promise))((function(o,l){function r(e){try{c(a.next(e))}catch(e){l(e)}}function u(e){try{c(a.throw(e))}catch(e){l(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,u)}c((a=a.apply(e,t||[])).next())}))},l=this&&this.__generator||function(e,t){var n,a,o,l,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(r=0)),r;)try{if(n=1,a&&(o=2&u[0]?a.return:u[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,u[1])).done)return o;switch(a=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,a=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){r=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(6===u[0]&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(e){u=[6,e],a=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getData=void 0;var u=r(n(97218));t.getData=function(e){return o(this,void 0,void 0,(function(){var t;return l(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,u.default.get(e)];case 1:return[2,n.sent().data];case 2:return t=n.sent(),a.error("Axios error: ".concat(t)),[3,3];case 3:return[2]}}))}))}},68504:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getProductTypes=t.getURLParameters=void 0;var a,o=n(61309);a="undefined"!=typeof window&&"object"==typeof window.VS?window.VS:{},t.getURLParameters=function(){var e=new URLSearchParams(document.location.search),t=Object.fromEntries(e);return"object"==typeof t&&Object.keys(t).forEach((function(e){return null===t[e]&&delete t[e]})),t},t.getProductTypes=function(){if(Object.keys(a).length<=0)return o.products;var e=a.search_config.basic_config.productTypes,t=[];return Object.keys(e).forEach((function(n){t.push({key:e[n].value,displayName:e[n].text,optionValue:e[n].value})})),t}},97809:function(e,t,n){"use strict";n.r(t);var a=n(65531),o={};for(var l in a)"default"!==l&&(o[l]=function(e){return a[e]}.bind(0,l));n.d(t,o),n(94578);const r=a.default;t.default=r},94578:function(e,t,n){"use strict";n(12650)},65531:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return o.a}});var a=n(43062),o=n.n(a),l={};for(var r in a)"default"!==r&&(l[r]=function(e){return a[e]}.bind(0,r));n.d(t,l)}}]);
|