diff --git a/chargebee-js-vue/CHANGELOG.md b/chargebee-js-vue/CHANGELOG.md index a5b579c..692219a 100644 --- a/chargebee-js-vue/CHANGELOG.md +++ b/chargebee-js-vue/CHANGELOG.md @@ -1,3 +1,7 @@ +### v0.4.0 (2023-01-11) +* * * +* Added typescript support. + ### v0.3.1 (2023-01-11) * * * * Bugfixes - Fields & combined mode to work in Vue3. diff --git a/chargebee-js-vue/dist/chargebee-js-vue-wrapper.cjs.js b/chargebee-js-vue/dist/chargebee-js-vue-wrapper.cjs.js index 39680cd..943b3b2 100644 --- a/chargebee-js-vue/dist/chargebee-js-vue-wrapper.cjs.js +++ b/chargebee-js-vue/dist/chargebee-js-vue-wrapper.cjs.js @@ -1 +1,2 @@ -"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var s=require("vue");function c(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,n=e=="x"?t:t&3|8;return n.toString(16)})}function m(e){if(e){const t=e.site,n=e.publishableKey;return!(!(t&&typeof t=="string"&&t.length>0)||!(n&&typeof n=="string"&&n.length>0))}else return!1}const d={props:{fonts:{type:Array,default:()=>[]},classes:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})},placeholder:{type:Object,default:()=>({})},icon:{type:Boolean,default:!0},locale:{type:String,default:"en"},currency:{type:String,default:"USD"}},data(){return{cbInstance:null,cbComponent:null,moduleLoaded:!1,elementId:""}},computed:{componentOptions:function(){return{fonts:this.fonts,classes:this.classes,locale:this.locale,style:this.styles,placeholder:this.placeholder,icon:this.icon,currency:this.currency}}},provide(){return{cbComponent:s.computed(()=>this.cbComponent)}},methods:{tokenize(e){return this.cbComponent.tokenize(e)},authorizeWith3ds(e,t,n){return this.cbComponent.authorizeWith3ds(e,t,n)},focus(){this.cbComponent.focus()},blur(){this.cbComponent.blur()},clear(){this.cbComponent.clear()},setCbComponent(e){this.cbComponent=e}},mounted(){this.$nextTick(()=>{this.elementId=`card-component-${c()}`;let e=Chargebee.getInstance(),t=this.componentOptions;e.load("components").then(()=>{this.cbInstance=e;const n=this.cbInstance.createComponent("card",t);this.setCbComponent(n),this.moduleLoaded=!0,["ready","focus","blur","change"].map(o=>{this.cbComponent.on(o,i=>{this.$emit(o,i)})}),this.$nextTick(()=>{this.cbComponent.mount(`#${this.elementId}`)})})})},watch:{componentOptions(){this.cbComponent&&this.cbComponent.update(this.componentOptions)}},render(){let e=this.$slots.default?this.$slots.default():[];return s.h("div",{id:this.elementId,class:this.class},e)}},r={data(){return{field:null,initialized:!1}},props:{styles:{type:Object,default:()=>({})},placeholder:{type:String,default:()=>""}},computed:{fieldOptions:function(){return{style:this.styles||{},placeholder:this.placeholder}},elementId:function(){return`card-${this.id}-${c()}`}},methods:{getField(){return this.field},attachListener(e){this.field.on(e,t=>{this.$emit(e,t)})},initializeField(e){if(e){const t=this.fieldOptions;this.field=e.createField(this.id,t).at(`#${this.elementId}`),this.$parent.onMount&&this.$parent.onMount(),this.attachListener("ready"),this.attachListener("focus"),this.attachListener("blur"),this.attachListener("change"),this.initialized=!0}},focus(){this.field.focus()},blur(){this.field.blur()},clear(){this.field.clear()}},watch:{fieldOptions(){if(this.field){const e=this.fieldOptions;this.field.update(e)}},cbComponent(e,t){!t&&e&&(this.initialized||this.initializeField(e))}},inject:["cbComponent"],mounted(){this.initializeField()}};var a=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n};const b={name:"CardNumber",mixins:[r],props:{styles:{type:Object,default:()=>({})},placeholder:{type:String,default:()=>""}},data(){return{id:"number",loaded:!1,classname:this.class}}},y=["id"];function x(e,t,n,o,i,l){return s.openBlock(),s.createElementBlock("div",{id:e.elementId,class:s.normalizeClass(i.classname)},[s.renderSlot(e.$slots,"default")],10,y)}var p=a(b,[["render",x]]);const C={name:"CardExpiry",props:{styles:{type:Object,default:()=>({})},placeholder:{type:String,default:()=>""}},data(){return{id:"expiry",loaded:!1,classname:this.class}},mixins:[r]},$=["id"];function v(e,t,n,o,i,l){return s.openBlock(),s.createElementBlock("div",{id:e.elementId,class:s.normalizeClass(i.classname)},[s.renderSlot(e.$slots,"default")],10,$)}var u=a(C,[["render",v]]);const _={name:"CardCvv",props:{styles:{type:Object,default:()=>({})},placeholder:{type:String,default:()=>""}},data(){return{id:"cvv",loaded:!1,classname:this.class}},mixins:[r]},g=["id"];function O(e,t,n,o,i,l){return s.openBlock(),s.createElementBlock("div",{id:e.elementId,class:s.normalizeClass(i.classname)},[s.renderSlot(e.$slots,"default")],10,g)}var h=a(_,[["render",O]]);const f={name:"Provider",props:{cbInstance:{type:Object,default:null}},render(){return m(this.cbInstance)?this.$slots.default():null}};var I={install(e){e.component("card-component",d),e.component("card-number",p),e.component("card-expiry",u),e.component("card-cvv",h),e.component("provider",f)}};exports.CardComponent=d;exports.CardCvv=h;exports.CardExpiry=u;exports.CardNumber=p;exports.Provider=f;exports.default=I; +"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var s=require("vue");function c(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,n=e=="x"?t:t&3|8;return n.toString(16)})}function f(e){if(e){const t=e.site,n=e.publishableKey;return!(!(t&&typeof t=="string"&&t.length>0)||!(n&&typeof n=="string"&&n.length>0))}else return!1}const d={props:{class:{type:String,default:""},fonts:{type:Array,default:[]},classes:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})},placeholder:{type:Object,default:()=>({})},icon:{type:Boolean,default:!0},locale:{type:String,default:"en"},currency:{type:String,default:"USD"}},data(){return{cbInstance:null,cbComponent:null,moduleLoaded:!1,elementId:""}},computed:{componentOptions:function(){return{fonts:this.fonts,classes:this.classes,locale:this.locale,style:this.styles,placeholder:this.placeholder,icon:this.icon,currency:this.currency}}},provide(){return{cbComponent:s.computed(()=>this.cbComponent)}},methods:{tokenize(e){return this.cbComponent.tokenize(e)},authorizeWith3ds(e,t,n){return this.cbComponent.authorizeWith3ds(e,t,n)},focus(){this.cbComponent.focus()},blur(){this.cbComponent.blur()},clear(){this.cbComponent.clear()},setCbComponent(e){this.cbComponent=e}},mounted(){this.$nextTick(()=>{this.elementId=`card-component-${c()}`;let e=Chargebee.getInstance(),t=this.componentOptions;e.load("components").then(()=>{this.cbInstance=e;const n=this.cbInstance.createComponent("card",t);this.setCbComponent(n),this.moduleLoaded=!0,["ready","focus","blur","change"].map(o=>{this.cbComponent.on(o,i=>{this.$emit(o,i)})}),this.$nextTick(()=>{this.cbComponent.mount(`#${this.elementId}`)})})})},watch:{componentOptions(){this.cbComponent&&this.cbComponent.update(this.componentOptions)}},render(){let e=this.$slots.default?this.$slots.default():[];return s.h("div",{id:this.elementId,class:this.class},e)}},r={data(){return{field:null,initialized:!1}},props:{class:{type:String,default:""},styles:{type:Object,default:()=>({})},placeholder:{type:String,default:()=>""}},computed:{fieldOptions:function(){return{style:this.styles||{},placeholder:this.placeholder}},elementId:function(){return`card-${this.id}-${c()}`}},methods:{getField(){return this.field},attachListener(e){this.field.on(e,t=>{this.$emit(e,t)})},initializeField(e){if(e){const t=this.fieldOptions;this.field=e.createField(this.id,t).at(`#${this.elementId}`),this.$parent.onMount&&this.$parent.onMount(),this.attachListener("ready"),this.attachListener("focus"),this.attachListener("blur"),this.attachListener("change"),this.initialized=!0}},focus(){this.field.focus()},blur(){this.field.blur()},clear(){this.field.clear()}},watch:{fieldOptions(){if(this.field){const e=this.fieldOptions;this.field.update(e)}},cbComponent(e,t){!t&&e&&(this.initialized||this.initializeField(e))}},inject:["cbComponent"],mounted(){this.initializeField()}};var a=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n};const b={name:"CardNumber",mixins:[r],data(){return{id:"number",loaded:!1,classname:this.class}}},x=["id"];function C(e,t,n,o,i,l){return s.openBlock(),s.createElementBlock("div",{id:e.elementId,class:s.normalizeClass(i.classname)},[s.renderSlot(e.$slots,"default")],10,x)}var u=a(b,[["render",C]]);const y={name:"CardExpiry",data(){return{id:"expiry",loaded:!1,classname:this.class}},mixins:[r]},$=["id"];function v(e,t,n,o,i,l){return s.openBlock(),s.createElementBlock("div",{id:e.elementId,class:s.normalizeClass(i.classname)},[s.renderSlot(e.$slots,"default")],10,$)}var h=a(y,[["render",v]]);const _={name:"CardCvv",data(){return{id:"cvv",loaded:!1,classname:this.class}},mixins:[r]},g=["id"];function I(e,t,n,o,i,l){return s.openBlock(),s.createElementBlock("div",{id:e.elementId,class:s.normalizeClass(i.classname)},[s.renderSlot(e.$slots,"default")],10,g)}var p=a(_,[["render",I]]);const m={name:"Provider",props:{cbInstance:{type:Object,default:null}},render(){return f(this.cbInstance)?this.$slots.default():null}};var O={install(e){e.component("card-component",d),e.component("card-number",u),e.component("card-expiry",h),e.component("card-cvv",p),e.component("provider",m)}};exports.CardComponent=d;exports.CardCvv=p;exports.CardExpiry=h;exports.CardNumber=u;exports.Provider=m;exports.default=O; +//# sourceMappingURL=chargebee-js-vue-wrapper.cjs.js.map diff --git a/chargebee-js-vue/dist/chargebee-js-vue-wrapper.cjs.js.map b/chargebee-js-vue/dist/chargebee-js-vue-wrapper.cjs.js.map new file mode 100644 index 0000000..392b61c --- /dev/null +++ b/chargebee-js-vue/dist/chargebee-js-vue-wrapper.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"chargebee-js-vue-wrapper.cjs.js","sources":["../src/utils/index.ts","../plugin-vue:export-helper","../src/index.ts"],"sourcesContent":[null,"\nexport default (sfc, props) => {\n const target = sfc.__vccOpts || sfc;\n for (const [key, val] of props) {\n target[key] = val;\n }\n return target;\n}\n",null],"names":["CardComponent","Provider"],"mappings":"iIAEuB,YAAA,CACrB,MAAO,uCAAuC,QAAQ,QAAS,SAAS,EAAC,CACnE,GAAA,GAAI,KAAK,OAAS,EAAA,GAAG,EAAG,EAAI,GAAK,IAAM,EAAK,EAAE,EAAI,EAC/C,MAAA,GAAE,SAAS,EAAE,CAAA,CACrB,CACH,CAEM,WAA6B,EAA6B,CAC9D,GAAI,EAAY,CACZ,KAAM,GAAO,EAAW,KAClB,EAAM,EAAW,eAKvB,MAHI,GAAU,IAAA,MAAO,IAAQ,UAAY,EAAK,OAAS,IAGnD,CAAS,IAAA,MAAO,IAAO,UAAY,EAAI,OAAS,GAG7C,KAEF,OAAA,EAEX,4+ECvBA,GAAA,GAAe,CAAC,EAAK,IAAU,CAC7B,KAAM,GAAS,EAAI,WAAa,EAChC,SAAW,CAAC,EAAK,IAAQ,GACvB,EAAO,GAAO,EAEhB,MAAO,EACT,ogCCQA,GAAe,GAAA,CACb,QAAS,EAAQ,CACX,EAAA,UAAU,iBAAkBA,CAAa,EACzC,EAAA,UAAU,cAAe,CAAU,EACnC,EAAA,UAAU,cAAe,CAAU,EACnC,EAAA,UAAU,WAAY,CAAO,EAC7B,EAAA,UAAU,WAAYC,CAAQ,CACpC"} \ No newline at end of file diff --git a/chargebee-js-vue/dist/chargebee-js-vue-wrapper.es.js b/chargebee-js-vue/dist/chargebee-js-vue-wrapper.es.js index 024e122..d3d5f46 100644 --- a/chargebee-js-vue/dist/chargebee-js-vue-wrapper.es.js +++ b/chargebee-js-vue/dist/chargebee-js-vue-wrapper.es.js @@ -20,9 +20,13 @@ function validateCbInstance(cbInstance) { } const _sfc_main$5 = { props: { + class: { + type: String, + default: "" + }, fonts: { type: Array, - default: () => [] + default: [] }, classes: { type: Object, @@ -136,6 +140,10 @@ const _sfc_main$4 = { }; }, props: { + class: { + type: String, + default: "" + }, styles: { type: Object, default: () => ({}) @@ -218,16 +226,6 @@ var _export_sfc = (sfc, props) => { const _sfc_main$3 = { name: "CardNumber", mixins: [_sfc_main$4], - props: { - styles: { - type: Object, - default: () => ({}) - }, - placeholder: { - type: String, - default: () => "" - } - }, data() { return { id: "number", @@ -248,16 +246,6 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { var CardNumber = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2]]); const _sfc_main$2 = { name: "CardExpiry", - props: { - styles: { - type: Object, - default: () => ({}) - }, - placeholder: { - type: String, - default: () => "" - } - }, data() { return { id: "expiry", @@ -279,16 +267,6 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { var CardExpiry = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1]]); const _sfc_main$1 = { name: "CardCvv", - props: { - styles: { - type: Object, - default: () => ({}) - }, - placeholder: { - type: String, - default: () => "" - } - }, data() { return { id: "cvv", @@ -324,12 +302,13 @@ const _sfc_main = { } }; var index = { - install(Vue) { - Vue.component("card-component", _sfc_main$5); - Vue.component("card-number", CardNumber); - Vue.component("card-expiry", CardExpiry); - Vue.component("card-cvv", CardCvv); - Vue.component("provider", _sfc_main); + install(app) { + app.component("card-component", _sfc_main$5); + app.component("card-number", CardNumber); + app.component("card-expiry", CardExpiry); + app.component("card-cvv", CardCvv); + app.component("provider", _sfc_main); } }; export { _sfc_main$5 as CardComponent, CardCvv, CardExpiry, CardNumber, _sfc_main as Provider, index as default }; +//# sourceMappingURL=chargebee-js-vue-wrapper.es.js.map diff --git a/chargebee-js-vue/dist/chargebee-js-vue-wrapper.es.js.map b/chargebee-js-vue/dist/chargebee-js-vue-wrapper.es.js.map new file mode 100644 index 0000000..3505e82 --- /dev/null +++ b/chargebee-js-vue/dist/chargebee-js-vue-wrapper.es.js.map @@ -0,0 +1 @@ +{"version":3,"file":"chargebee-js-vue-wrapper.es.js","sources":["../src/utils/index.ts","../plugin-vue:export-helper","../src/index.ts"],"sourcesContent":[null,"\nexport default (sfc, props) => {\n const target = sfc.__vccOpts || sfc;\n for (const [key, val] of props) {\n target[key] = val;\n }\n return target;\n}\n",null],"names":["CardComponent","Provider"],"mappings":";AAEuB,mBAAA;AACrB,SAAO,uCAAuC,QAAQ,SAAS,SAAS,GAAC;AACnE,QAAA,IAAI,KAAK,OAAS,IAAA,KAAG,GAAG,IAAI,KAAK,MAAM,IAAK,IAAE,IAAI;AAC/C,WAAA,EAAE,SAAS,EAAE;AAAA,EAAA,CACrB;AACH;AAEM,4BAA6B,YAA6B;AAC9D,MAAI,YAAY;AACZ,UAAM,OAAO,WAAW;AACxB,UAAM,MAAM,WAAW;AAEvB,QAAI,CAAU,SAAA,OAAO,QAAQ,YAAY,KAAK,SAAS;AAC5C,aAAA;AAEX,QAAI,CAAS,QAAA,OAAO,OAAO,YAAY,IAAI,SAAS;AACzC,aAAA;AAEJ,WAAA;AAAA,EAAA,OACJ;AACE,WAAA;AAAA,EACR;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvBA,IAAA,cAAe,CAAC,KAAK,UAAU;AAC7B,QAAM,SAAS,IAAI,aAAa;AAChC,aAAW,CAAC,KAAK,QAAQ,OAAO;AAC9B,WAAO,OAAO;AAAA,EACf;AACD,SAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACQA,IAAe,QAAA;AAAA,EACb,QAAS,KAAQ;AACX,QAAA,UAAU,kBAAkBA,WAAa;AACzC,QAAA,UAAU,eAAe,UAAU;AACnC,QAAA,UAAU,eAAe,UAAU;AACnC,QAAA,UAAU,YAAY,OAAO;AAC7B,QAAA,UAAU,YAAYC,SAAQ;AAAA,EACpC;;;"} \ No newline at end of file diff --git a/chargebee-js-vue/dist/components/CardComponent.vue.d.ts b/chargebee-js-vue/dist/components/CardComponent.vue.d.ts new file mode 100644 index 0000000..abf47bd --- /dev/null +++ b/chargebee-js-vue/dist/components/CardComponent.vue.d.ts @@ -0,0 +1,101 @@ +import { Component, PropType } from "vue"; +import { AdditionalData, Callbacks, PaymentIntent, Fonts, Classes, Styles, Placeholder } from "@chargebee/chargebee-js-types"; +declare const _default: import("vue").DefineComponent<{ + class: { + type: StringConstructor; + default: string; + }; + fonts: { + type: PropType; + default: any[]; + }; + classes: { + type: PropType; + default: () => {}; + }; + styles: { + type: PropType; + default: () => {}; + }; + placeholder: { + type: PropType; + default: () => {}; + }; + icon: { + type: BooleanConstructor; + default: boolean; + }; + locale: { + type: StringConstructor; + default: string; + }; + currency: { + type: StringConstructor; + default: string; + }; +}, unknown, { + cbInstance: any; + cbComponent: any; + moduleLoaded: boolean; + elementId: string; +}, { + componentOptions: () => { + fonts: any; + classes: any; + locale: any; + style: any; + placeholder: any; + icon: any; + currency: any; + }; +}, { + tokenize(additionalData: AdditionalData): any; + authorizeWith3ds(paymentIntent: PaymentIntent, additionalData: AdditionalData, callbacks: Callbacks): any; + focus(): void; + blur(): void; + clear(): void; + setCbComponent(cbComponent: Component): void; +}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly; + default: any[]; + }; + classes: { + type: PropType; + default: () => {}; + }; + styles: { + type: PropType; + default: () => {}; + }; + placeholder: { + type: PropType; + default: () => {}; + }; + icon: { + type: BooleanConstructor; + default: boolean; + }; + locale: { + type: StringConstructor; + default: string; + }; + currency: { + type: StringConstructor; + default: string; + }; +}>>, { + icon: boolean; + class: string; + placeholder: {}; + fonts: Fonts; + classes: {}; + styles: Styles; + locale: string; + currency: string; +}>; +export default _default; diff --git a/chargebee-js-vue/dist/components/CardCvv.vue.d.ts b/chargebee-js-vue/dist/components/CardCvv.vue.d.ts new file mode 100644 index 0000000..f96b915 --- /dev/null +++ b/chargebee-js-vue/dist/components/CardCvv.vue.d.ts @@ -0,0 +1,54 @@ +import { PropType } from 'vue'; +import { Styles } from '@chargebee/chargebee-js-types'; +declare const _default: import("vue").DefineComponent<{}, {}, { + id: string; + loaded: boolean; + classname: string; +}, {}, {}, import("vue").DefineComponent<{ + class: { + type: StringConstructor; + default: string; + }; + styles: { + type: PropType; + default: () => {}; + }; + placeholder: { + type: StringConstructor; + default: () => string; + }; +}, unknown, { + field: any; + initialized: boolean; +}, { + fieldOptions: () => { + style: any; + placeholder: any; + }; + elementId: () => string; +}, { + getField(): any; + attachListener(listener: string): void; + initializeField(cbComponent: import("@chargebee/chargebee-js-types").Component): void; + focus(): void; + blur(): void; + clear(): void; +}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly; + default: () => {}; + }; + placeholder: { + type: StringConstructor; + default: () => string; + }; +}>>, { + class: string; + placeholder: string; + styles: Styles; +}>, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly>, {}>; +export default _default; diff --git a/chargebee-js-vue/dist/components/CardExpiry.vue.d.ts b/chargebee-js-vue/dist/components/CardExpiry.vue.d.ts new file mode 100644 index 0000000..f96b915 --- /dev/null +++ b/chargebee-js-vue/dist/components/CardExpiry.vue.d.ts @@ -0,0 +1,54 @@ +import { PropType } from 'vue'; +import { Styles } from '@chargebee/chargebee-js-types'; +declare const _default: import("vue").DefineComponent<{}, {}, { + id: string; + loaded: boolean; + classname: string; +}, {}, {}, import("vue").DefineComponent<{ + class: { + type: StringConstructor; + default: string; + }; + styles: { + type: PropType; + default: () => {}; + }; + placeholder: { + type: StringConstructor; + default: () => string; + }; +}, unknown, { + field: any; + initialized: boolean; +}, { + fieldOptions: () => { + style: any; + placeholder: any; + }; + elementId: () => string; +}, { + getField(): any; + attachListener(listener: string): void; + initializeField(cbComponent: import("@chargebee/chargebee-js-types").Component): void; + focus(): void; + blur(): void; + clear(): void; +}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly; + default: () => {}; + }; + placeholder: { + type: StringConstructor; + default: () => string; + }; +}>>, { + class: string; + placeholder: string; + styles: Styles; +}>, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly>, {}>; +export default _default; diff --git a/chargebee-js-vue/dist/components/CardNumber.vue.d.ts b/chargebee-js-vue/dist/components/CardNumber.vue.d.ts new file mode 100644 index 0000000..f96b915 --- /dev/null +++ b/chargebee-js-vue/dist/components/CardNumber.vue.d.ts @@ -0,0 +1,54 @@ +import { PropType } from 'vue'; +import { Styles } from '@chargebee/chargebee-js-types'; +declare const _default: import("vue").DefineComponent<{}, {}, { + id: string; + loaded: boolean; + classname: string; +}, {}, {}, import("vue").DefineComponent<{ + class: { + type: StringConstructor; + default: string; + }; + styles: { + type: PropType; + default: () => {}; + }; + placeholder: { + type: StringConstructor; + default: () => string; + }; +}, unknown, { + field: any; + initialized: boolean; +}, { + fieldOptions: () => { + style: any; + placeholder: any; + }; + elementId: () => string; +}, { + getField(): any; + attachListener(listener: string): void; + initializeField(cbComponent: import("@chargebee/chargebee-js-types").Component): void; + focus(): void; + blur(): void; + clear(): void; +}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly; + default: () => {}; + }; + placeholder: { + type: StringConstructor; + default: () => string; + }; +}>>, { + class: string; + placeholder: string; + styles: Styles; +}>, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly>, {}>; +export default _default; diff --git a/chargebee-js-vue/dist/components/Element.vue.d.ts b/chargebee-js-vue/dist/components/Element.vue.d.ts new file mode 100644 index 0000000..5c651a2 --- /dev/null +++ b/chargebee-js-vue/dist/components/Element.vue.d.ts @@ -0,0 +1,50 @@ +import { PropType } from 'vue'; +import { Component, Styles } from '@chargebee/chargebee-js-types'; +declare const _default: import("vue").DefineComponent<{ + class: { + type: StringConstructor; + default: string; + }; + styles: { + type: PropType; + default: () => {}; + }; + placeholder: { + type: StringConstructor; + default: () => string; + }; +}, unknown, { + field: any; + initialized: boolean; +}, { + fieldOptions: () => { + style: any; + placeholder: any; + }; + elementId: () => string; +}, { + getField(): any; + attachListener(listener: string): void; + initializeField(cbComponent: Component): void; + focus(): void; + blur(): void; + clear(): void; +}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly; + default: () => {}; + }; + placeholder: { + type: StringConstructor; + default: () => string; + }; +}>>, { + class: string; + placeholder: string; + styles: Styles; +}>; +export default _default; diff --git a/chargebee-js-vue/dist/components/Provider.vue.d.ts b/chargebee-js-vue/dist/components/Provider.vue.d.ts new file mode 100644 index 0000000..7d3f79c --- /dev/null +++ b/chargebee-js-vue/dist/components/Provider.vue.d.ts @@ -0,0 +1,16 @@ +import { PropType } from 'vue'; +import { ChargebeeInstance } from '@chargebee/chargebee-js-types'; +declare const _default: import("vue").DefineComponent<{ + cbInstance: { + type: PropType; + default: any; + }; +}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly; + default: any; + }; +}>>, { + cbInstance: ChargebeeInstance; +}>; +export default _default; diff --git a/chargebee-js-vue/dist/index.d.ts b/chargebee-js-vue/dist/index.d.ts new file mode 100644 index 0000000..bbf1df4 --- /dev/null +++ b/chargebee-js-vue/dist/index.d.ts @@ -0,0 +1,11 @@ +import CardComponent from './components/CardComponent.vue'; +import CardNumber from './components/CardNumber.vue'; +import CardExpiry from './components/CardExpiry.vue'; +import CardCvv from './components/CardCvv.vue'; +import Provider from './components/Provider.vue'; +import { App } from "vue"; +declare const _default: { + install(app: App): void; +}; +export default _default; +export { CardComponent, CardNumber, CardExpiry, CardCvv, Provider }; diff --git a/chargebee-js-vue/dist/utils/index.d.ts b/chargebee-js-vue/dist/utils/index.d.ts new file mode 100644 index 0000000..26a3878 --- /dev/null +++ b/chargebee-js-vue/dist/utils/index.d.ts @@ -0,0 +1,3 @@ +import { ChargebeeInstance } from '@chargebee/chargebee-js-types'; +export declare function genUUID(): string; +export declare function validateCbInstance(cbInstance: ChargebeeInstance): boolean; diff --git a/chargebee-js-vue/package-lock.json b/chargebee-js-vue/package-lock.json index c6c2ddd..6bb50c2 100644 --- a/chargebee-js-vue/package-lock.json +++ b/chargebee-js-vue/package-lock.json @@ -1,21 +1,211 @@ { "name": "@chargebee/chargebee-js-vue-wrapper", - "version": "0.3.1", + "version": "0.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/helper-string-parser": { + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", + "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "dev": true + }, + "@babel/helper-validator-identifier": { + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "dev": true + }, "@babel/parser": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.6.tgz", "integrity": "sha512-uQVSa9jJUe/G/304lXspfWVpKpK4euFLgGiMQFOCpM/bgcAdeoHwi/OQz23O9GK2osz26ZiXRRV9aV+Yl1O8tw==", "dev": true }, + "@babel/types": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz", + "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==", + "dev": true, + "requires": { + "@babel/helper-string-parser": "^7.19.4", + "@babel/helper-validator-identifier": "^7.19.1", + "to-fast-properties": "^2.0.0" + } + }, + "@chargebee/chargebee-js-types": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@chargebee/chargebee-js-types/-/chargebee-js-types-1.0.0.tgz", + "integrity": "sha512-sZYGuYqzEROfsN6uRzvboHltgYz8HTnIyqPQAUmRQXQDF1Wqhx3+a3M8Av7xlcQucYTHSrcbfuwQeOV4Rkzisw==", + "dev": true + }, + "@rollup/plugin-typescript": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.0.0.tgz", + "integrity": "sha512-goPyCWBiimk1iJgSTgsehFD5OOFHiAknrRJjqFCudcW8JtWiBlK284Xnn4flqMqg6YAjVG/EE+3aVzrL5qNSzQ==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^5.0.1", + "resolve": "^1.22.1" + } + }, + "@rollup/pluginutils": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", + "integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + } + }, + "@types/estree": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", + "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==", + "dev": true + }, "@vitejs/plugin-vue": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-2.3.3.tgz", "integrity": "sha512-SmQLDyhz+6lGJhPELsBdzXGc+AcaT8stgkbiTFGpXPe8Tl1tJaBw1A6pxDqDuRsVkD8uscrkx3hA7QDOoKYtyw==", "dev": true }, + "@volar/language-core": { + "version": "1.0.24", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.0.24.tgz", + "integrity": "sha512-vTN+alJiWwK0Pax6POqrmevbtFW2dXhjwWiW/MW4f48eDYPLdyURWcr8TixO7EN/nHsUBj2udT7igFKPtjyAKg==", + "dev": true, + "requires": { + "@volar/source-map": "1.0.24", + "muggle-string": "^0.1.0" + } + }, + "@volar/source-map": { + "version": "1.0.24", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.0.24.tgz", + "integrity": "sha512-Qsv/tkplx18pgBr8lKAbM1vcDqgkGKQzbChg6NW+v0CZc3G7FLmK+WrqEPzKlN7Cwdc6XVL559Nod8WKAfKr4A==", + "dev": true, + "requires": { + "muggle-string": "^0.1.0" + } + }, + "@volar/typescript": { + "version": "1.0.24", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.0.24.tgz", + "integrity": "sha512-f8hCSk+PfKR1/RQHxZ79V1NpDImHoivqoizK+mstphm25tn/YJ/JnKNjZHB+o21fuW0yKlI26NV3jkVb2Cc/7A==", + "dev": true, + "requires": { + "@volar/language-core": "1.0.24" + } + }, + "@volar/vue-language-core": { + "version": "1.0.24", + "resolved": "https://registry.npmjs.org/@volar/vue-language-core/-/vue-language-core-1.0.24.tgz", + "integrity": "sha512-2NTJzSgrwKu6uYwPqLiTMuAzi7fAY3yFy5PJ255bGJc82If0Xr+cW8pC80vpjG0D/aVLmlwAdO4+Ya2BI8GdDg==", + "dev": true, + "requires": { + "@volar/language-core": "1.0.24", + "@volar/source-map": "1.0.24", + "@vue/compiler-dom": "^3.2.45", + "@vue/compiler-sfc": "^3.2.45", + "@vue/reactivity": "^3.2.45", + "@vue/shared": "^3.2.45", + "minimatch": "^5.1.1", + "vue-template-compiler": "^2.7.14" + }, + "dependencies": { + "@vue/compiler-core": { + "version": "3.2.45", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.45.tgz", + "integrity": "sha512-rcMj7H+PYe5wBV3iYeUgbCglC+pbpN8hBLTJvRiK2eKQiWqu+fG9F+8sW99JdL4LQi7Re178UOxn09puSXvn4A==", + "dev": true, + "requires": { + "@babel/parser": "^7.16.4", + "@vue/shared": "3.2.45", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "@vue/compiler-dom": { + "version": "3.2.45", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.45.tgz", + "integrity": "sha512-tyYeUEuKqqZO137WrZkpwfPCdiiIeXYCcJ8L4gWz9vqaxzIQRccTSwSWZ/Axx5YR2z+LvpUbmPNXxuBU45lyRw==", + "dev": true, + "requires": { + "@vue/compiler-core": "3.2.45", + "@vue/shared": "3.2.45" + } + }, + "@vue/compiler-sfc": { + "version": "3.2.45", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.45.tgz", + "integrity": "sha512-1jXDuWah1ggsnSAOGsec8cFjT/K6TMZ0sPL3o3d84Ft2AYZi2jWJgRMjw4iaK0rBfA89L5gw427H4n1RZQBu6Q==", + "dev": true, + "requires": { + "@babel/parser": "^7.16.4", + "@vue/compiler-core": "3.2.45", + "@vue/compiler-dom": "3.2.45", + "@vue/compiler-ssr": "3.2.45", + "@vue/reactivity-transform": "3.2.45", + "@vue/shared": "3.2.45", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7", + "postcss": "^8.1.10", + "source-map": "^0.6.1" + } + }, + "@vue/compiler-ssr": { + "version": "3.2.45", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.45.tgz", + "integrity": "sha512-6BRaggEGqhWht3lt24CrIbQSRD5O07MTmd+LjAn5fJj568+R9eUD2F7wMQJjX859seSlrYog7sUtrZSd7feqrQ==", + "dev": true, + "requires": { + "@vue/compiler-dom": "3.2.45", + "@vue/shared": "3.2.45" + } + }, + "@vue/reactivity": { + "version": "3.2.45", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.45.tgz", + "integrity": "sha512-PRvhCcQcyEVohW0P8iQ7HDcIOXRjZfAsOds3N99X/Dzewy8TVhTCT4uXpAHfoKjVTJRA0O0K+6QNkDIZAxNi3A==", + "dev": true, + "requires": { + "@vue/shared": "3.2.45" + } + }, + "@vue/reactivity-transform": { + "version": "3.2.45", + "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.45.tgz", + "integrity": "sha512-BHVmzYAvM7vcU5WmuYqXpwaBHjsS8T63jlKGWVtHxAHIoMIlmaMyurUSEs1Zcg46M4AYT5MtB1U274/2aNzjJQ==", + "dev": true, + "requires": { + "@babel/parser": "^7.16.4", + "@vue/compiler-core": "3.2.45", + "@vue/shared": "3.2.45", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7" + } + }, + "@vue/shared": { + "version": "3.2.45", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.45.tgz", + "integrity": "sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg==", + "dev": true + } + } + }, + "@volar/vue-typescript": { + "version": "1.0.24", + "resolved": "https://registry.npmjs.org/@volar/vue-typescript/-/vue-typescript-1.0.24.tgz", + "integrity": "sha512-9a25oHDvGaNC0okRS47uqJI6FxY4hUQZUsxeOUFHcqVxZEv8s17LPuP/pMMXyz7jPygrZubB/qXqHY5jEu/akA==", + "dev": true, + "requires": { + "@volar/typescript": "1.0.24", + "@volar/vue-language-core": "1.0.24" + } + }, "@vue/compiler-core": { "version": "3.2.37", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.37.tgz", @@ -125,12 +315,33 @@ "integrity": "sha512-4rSJemR2NQIo9Klm1vabqWjD8rs/ZaJSzMxkMNeJS6lHiUjjUeYFbooN19NgFjztubEKh3WlZUeOLVdbbUWHsw==", "dev": true }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, "csstype": { "version": "2.6.20", "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.20.tgz", "integrity": "sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==", "dev": true }, + "de-indent": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", + "integrity": "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==", + "dev": true + }, "esbuild": { "version": "0.14.48", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.48.tgz", @@ -327,6 +538,12 @@ "function-bind": "^1.1.1" } }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, "is-core-module": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", @@ -345,6 +562,21 @@ "sourcemap-codec": "^1.4.8" } }, + "minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "muggle-string": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.1.0.tgz", + "integrity": "sha512-Tr1knR3d2mKvvWthlk7202rywKbiOm4rVFLsfAaSIhJ6dt9o47W4S+JMtWhd/PW9Wrdew2/S2fSvhz3E2gkfEg==", + "dev": true + }, "nanoid": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", @@ -363,6 +595,12 @@ "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, "postcss": { "version": "8.4.14", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", @@ -418,6 +656,24 @@ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true + }, + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "dev": true + }, + "typescript": { + "version": "4.9.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", + "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", + "dev": true + }, "vite": { "version": "2.9.13", "resolved": "https://registry.npmjs.org/vite/-/vite-2.9.13.tgz", @@ -443,6 +699,26 @@ "@vue/server-renderer": "3.2.37", "@vue/shared": "3.2.37" } + }, + "vue-template-compiler": { + "version": "2.7.14", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.14.tgz", + "integrity": "sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ==", + "dev": true, + "requires": { + "de-indent": "^1.0.2", + "he": "^1.2.0" + } + }, + "vue-tsc": { + "version": "1.0.24", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.0.24.tgz", + "integrity": "sha512-mmU1s5SAqE1nByQAiQnao9oU4vX+mSdsgI8H57SfKH6UVzq/jP9+Dbi2GaV+0b4Cn361d2ln8m6xeU60ApiEXg==", + "dev": true, + "requires": { + "@volar/vue-language-core": "1.0.24", + "@volar/vue-typescript": "1.0.24" + } } } } diff --git a/chargebee-js-vue/package.json b/chargebee-js-vue/package.json index 4da63ee..a9ef755 100644 --- a/chargebee-js-vue/package.json +++ b/chargebee-js-vue/package.json @@ -1,6 +1,6 @@ { "name": "@chargebee/chargebee-js-vue-wrapper", - "version": "0.3.1", + "version": "0.4.0", "description": "Vue wrapper for Chargebee.js Components", "homepage": "https://github.com/chargebee/chargebee-js-wrappers/tree/master/chargebee-js-vue#readme", "bugs": { @@ -13,22 +13,30 @@ }, "main": "dist/chargebee-js-vue-wrapper.cjs.js", "module": "dist/chargebee-js-vue-wrapper.es.js", + "types": "dist/index.d.ts", "files": [ "dist/*", "src/*" ], "scripts": { - "dev": "vite build --watch", - "build": "vite build" + "dev": "vue-tsc --noEmit && vite build --watch", + "build": "vue-tsc --noEmit && vite build && npm run generate:types", + "generate:types": "vue-tsc --declaration --emitDeclarationOnly" }, "peerDependencies": { "vue": "^3.2.0" }, "devDependencies": { + "@babel/types": "^7.20.7", + "@chargebee/chargebee-js-types": "^1.0.0", + "@rollup/plugin-typescript": "^11.0.0", "@vitejs/plugin-vue": "^2.3.3", "@vue/compiler-sfc": "^3.2.37", + "tslib": "^2.4.1", + "typescript": "^4.9.4", "vite": "^2.9.9", - "vue": "^3.2.37" + "vue": "^3.2.37", + "vue-tsc": "^1.0.24" }, "license": "MIT", "author": "Vivek ", diff --git a/chargebee-js-vue/src/components/CardComponent.vue b/chargebee-js-vue/src/components/CardComponent.vue index 1b39b3c..0ddf530 100644 --- a/chargebee-js-vue/src/components/CardComponent.vue +++ b/chargebee-js-vue/src/components/CardComponent.vue @@ -1,23 +1,28 @@ -