@getspot/spot-widget-vue 1.1.1 → 1.2.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @getspot/spot-widget-vue@1.1.1 build /builds/getspot/spot-widget/packages/vue
2
+ > @getspot/spot-widget-vue@1.2.0 build /builds/getspot/spot-widget/packages/vue
3
3
  > vite build
4
4
 
5
5
  The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
@@ -9,6 +9,6 @@ transforming...
9
9
  No name was provided for external module "@getspot/spot-widget" in "output.globals" – guessing "SpotWidget".
10
10
  rendering chunks...
11
11
  computing gzip size...
12
- dist/index.umd.js 3.65 kB │ gzip: 1.18 kB
13
- dist/index.es.js 4.98 kB │ gzip: 1.29 kB
14
- ✓ built in 170ms
12
+ dist/index.umd.js 3.65 kB │ gzip: 1.19 kB
13
+ dist/index.es.js 4.99 kB │ gzip: 1.30 kB
14
+ ✓ built in 336ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @getspot/spot-widget-vue
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cb310ad: Add batch endpoint support for multiple quotes in the widget
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [cb310ad]
12
+ - @getspot/spot-widget@1.2.0
13
+
3
14
  ## 1.1.1
4
15
 
5
16
  ### Patch Changes
package/dist/index.es.js CHANGED
@@ -13,7 +13,7 @@ const a = (t, e) => {
13
13
  default: void 0
14
14
  },
15
15
  quoteRequestData: {
16
- type: Object,
16
+ type: [Object, Array],
17
17
  default: void 0
18
18
  },
19
19
  showTable: {
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(n,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("@getspot/spot-widget"),require("vue")):typeof define=="function"&&define.amd?define(["@getspot/spot-widget","vue"],o):(n=typeof globalThis<"u"?globalThis:n||self,n.VueSpotWidget=o(n.SpotWidget,n.Vue))})(this,function(n,o){"use strict";const r=(t,e)=>{const i=t.__vccOpts||t;for(const[s,d]of e)i[s]=d;return i},u={name:"VueSpotWidget",props:{apiConfig:{type:Object,default:void 0},quoteRequestData:{type:Object,default:void 0},showTable:{type:Boolean,default:!0},optInSelected:{type:Boolean,default:!1},theme:{type:Object,default:void 0},callbacks:{type:Object,default:()=>({})},onQuoteRetrieved:{type:Function,default:void 0},onOptIn:{type:Function,default:void 0},onOptOut:{type:Function,default:void 0},onError:{type:Function,default:void 0},onNoMatchingQuote:{type:Function,default:void 0},onSelectionChange:{type:Function,default:void 0},options:{type:Object,default:()=>({})}},data(){return{widget:null,reinitTimeout:null}},computed:{mergedCallbacks(){return{...this.callbacks,...this.onQuoteRetrieved&&{onQuoteRetrieved:this.onQuoteRetrieved},...this.onOptIn&&{onOptIn:t=>{var e,i;(e=this.onOptIn)==null||e.call(this,t),(i=this.onSelectionChange)==null||i.call(this,t)}},...this.onOptOut&&{onOptOut:t=>{var e,i;(e=this.onOptOut)==null||e.call(this,t),(i=this.onSelectionChange)==null||i.call(this,t)}},...this.onError&&{onError:this.onError},...this.onNoMatchingQuote&&{onNoMatchingQuote:this.onNoMatchingQuote}}},widgetOptions(){return{apiConfig:this.apiConfig,quoteRequestData:this.quoteRequestData,showTable:this.showTable,optInSelected:this.optInSelected,theme:this.theme,callbacks:this.mergedCallbacks,...this.options}}},mounted(){this.initializeWidget()},watch:{quoteRequestData:{handler(t,e){this.widget&&t&&JSON.stringify(t)!==JSON.stringify(e)&&(this.reinitTimeout&&clearTimeout(this.reinitTimeout),this.reinitTimeout=setTimeout(()=>{this.reinitializeWidget(),this.reinitTimeout=null},100))},deep:!0},apiConfig:{handler(){this.reinitializeWidget()},deep:!0},showTable(t,e){t!==e&&this.reinitializeWidget()},optInSelected(t,e){t!==e&&this.reinitializeWidget()},theme:{handler(t,e){this.widget&&JSON.stringify(t)!==JSON.stringify(e)&&this.updateTheme(t)},deep:!0},mergedCallbacks:{handler(t,e){this.widget&&JSON.stringify(t)!==JSON.stringify(e)&&this.updateCallbacks(t)},deep:!0}},methods:{initializeWidget(){this.widget&&(this.widget.destroy(),this.widget=null),this.$refs.container&&(this.$refs.container.innerHTML=""),this.$nextTick(()=>{var t;try{this.widget=new n({...this.widgetOptions,location:this.$refs.container})}catch(e){this.$emit("error",e),(t=this.onError)==null||t.call(this,e)}})},reinitializeWidget(){this.widget&&(this.widget.destroy(),this.widget=null),this.initializeWidget()},async updateQuote(t){var e;return(e=this.widget)==null?void 0:e.updateQuote(t)},getSelection(){var t;return(t=this.widget)==null?void 0:t.getSelection()},validateSelection(){var t;return(t=this.widget)==null?void 0:t.validateSelection()},updateTheme(t){!this.widget||!this.widget.container||Object.entries(t||{}).forEach(([e,i])=>{const s=`--${e}`;this.widget.container.style.setProperty(s,i)})},updateCallbacks(t){this.widget&&(this.widget.options.callbacks=t)},destroy(){this.widget&&typeof this.widget.destroy=="function"&&(this.widget.destroy(),this.widget=null)}},beforeUnmount(){this.reinitTimeout&&clearTimeout(this.reinitTimeout),this.widget&&typeof this.widget.destroy=="function"&&this.widget.destroy()}},h={ref:"container"};function a(t,e,i,s,d,c){return o.openBlock(),o.createElementBlock("div",h,null,512)}return r(u,[["render",a]])});
1
+ (function(n,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("@getspot/spot-widget"),require("vue")):typeof define=="function"&&define.amd?define(["@getspot/spot-widget","vue"],o):(n=typeof globalThis<"u"?globalThis:n||self,n.VueSpotWidget=o(n.SpotWidget,n.Vue))})(this,function(n,o){"use strict";const r=(t,e)=>{const i=t.__vccOpts||t;for(const[s,d]of e)i[s]=d;return i},u={name:"VueSpotWidget",props:{apiConfig:{type:Object,default:void 0},quoteRequestData:{type:[Object,Array],default:void 0},showTable:{type:Boolean,default:!0},optInSelected:{type:Boolean,default:!1},theme:{type:Object,default:void 0},callbacks:{type:Object,default:()=>({})},onQuoteRetrieved:{type:Function,default:void 0},onOptIn:{type:Function,default:void 0},onOptOut:{type:Function,default:void 0},onError:{type:Function,default:void 0},onNoMatchingQuote:{type:Function,default:void 0},onSelectionChange:{type:Function,default:void 0},options:{type:Object,default:()=>({})}},data(){return{widget:null,reinitTimeout:null}},computed:{mergedCallbacks(){return{...this.callbacks,...this.onQuoteRetrieved&&{onQuoteRetrieved:this.onQuoteRetrieved},...this.onOptIn&&{onOptIn:t=>{var e,i;(e=this.onOptIn)==null||e.call(this,t),(i=this.onSelectionChange)==null||i.call(this,t)}},...this.onOptOut&&{onOptOut:t=>{var e,i;(e=this.onOptOut)==null||e.call(this,t),(i=this.onSelectionChange)==null||i.call(this,t)}},...this.onError&&{onError:this.onError},...this.onNoMatchingQuote&&{onNoMatchingQuote:this.onNoMatchingQuote}}},widgetOptions(){return{apiConfig:this.apiConfig,quoteRequestData:this.quoteRequestData,showTable:this.showTable,optInSelected:this.optInSelected,theme:this.theme,callbacks:this.mergedCallbacks,...this.options}}},mounted(){this.initializeWidget()},watch:{quoteRequestData:{handler(t,e){this.widget&&t&&JSON.stringify(t)!==JSON.stringify(e)&&(this.reinitTimeout&&clearTimeout(this.reinitTimeout),this.reinitTimeout=setTimeout(()=>{this.reinitializeWidget(),this.reinitTimeout=null},100))},deep:!0},apiConfig:{handler(){this.reinitializeWidget()},deep:!0},showTable(t,e){t!==e&&this.reinitializeWidget()},optInSelected(t,e){t!==e&&this.reinitializeWidget()},theme:{handler(t,e){this.widget&&JSON.stringify(t)!==JSON.stringify(e)&&this.updateTheme(t)},deep:!0},mergedCallbacks:{handler(t,e){this.widget&&JSON.stringify(t)!==JSON.stringify(e)&&this.updateCallbacks(t)},deep:!0}},methods:{initializeWidget(){this.widget&&(this.widget.destroy(),this.widget=null),this.$refs.container&&(this.$refs.container.innerHTML=""),this.$nextTick(()=>{var t;try{this.widget=new n({...this.widgetOptions,location:this.$refs.container})}catch(e){this.$emit("error",e),(t=this.onError)==null||t.call(this,e)}})},reinitializeWidget(){this.widget&&(this.widget.destroy(),this.widget=null),this.initializeWidget()},async updateQuote(t){var e;return(e=this.widget)==null?void 0:e.updateQuote(t)},getSelection(){var t;return(t=this.widget)==null?void 0:t.getSelection()},validateSelection(){var t;return(t=this.widget)==null?void 0:t.validateSelection()},updateTheme(t){!this.widget||!this.widget.container||Object.entries(t||{}).forEach(([e,i])=>{const s=`--${e}`;this.widget.container.style.setProperty(s,i)})},updateCallbacks(t){this.widget&&(this.widget.options.callbacks=t)},destroy(){this.widget&&typeof this.widget.destroy=="function"&&(this.widget.destroy(),this.widget=null)}},beforeUnmount(){this.reinitTimeout&&clearTimeout(this.reinitTimeout),this.widget&&typeof this.widget.destroy=="function"&&this.widget.destroy()}},h={ref:"container"};function a(t,e,i,s,d,c){return o.openBlock(),o.createElementBlock("div",h,null,512)}return r(u,[["render",a]])});
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@getspot/spot-widget-vue",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "main": "dist/index.umd.js",
8
8
  "module": "dist/index.es.js",
9
9
  "dependencies": {
10
- "@getspot/spot-widget": "1.1.1"
10
+ "@getspot/spot-widget": "1.2.0"
11
11
  },
12
12
  "peerDependencies": {
13
13
  "vue": "^3.0.0"
@@ -13,7 +13,7 @@ export default {
13
13
  default: undefined,
14
14
  },
15
15
  quoteRequestData: {
16
- type: Object,
16
+ type: [Object, Array],
17
17
  default: undefined,
18
18
  },
19
19
  showTable: {