@hulkapps/app-manager-vue 2.0.1 → 2.0.4

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/README.md CHANGED
@@ -25,6 +25,20 @@ Vue.use(AppManager);
25
25
  ```vue
26
26
  <Banners type="header" />
27
27
  <Banners type="footer" />
28
+ <AppManagerPlan @handlePlanSelect="handlePlanSelectListener" :shop_domain="shop_domain" />
29
+ ```
30
+ The AppManagerPlan component requires a Shop Domain
31
+
32
+ A `handlePlanSelect` event is emitted when the user continues without selecting a plan.
33
+
34
+ ```javascript
35
+ handlePlanSelectListener(payload) {
36
+
37
+ if (payload.chose_later && payload.chose_later === true) {
38
+ //handle chose_later
39
+ }
40
+
41
+ }
28
42
  ```
29
43
 
30
44
  ## License
@@ -23043,7 +23043,8 @@ var __vue_render__$K = function () {
23043
23043
  key: key,
23044
23044
  attrs: {
23045
23045
  "id": "static-content-header-" + key,
23046
- "status": header.status
23046
+ "status": header.status,
23047
+ "title": header.title
23047
23048
  },
23048
23049
  on: {
23049
23050
  "dismiss": function () {
@@ -23064,7 +23065,7 @@ var __vue_staticRenderFns__$K = [];
23064
23065
  const __vue_inject_styles__$M = undefined;
23065
23066
  /* scoped */
23066
23067
 
23067
- const __vue_scope_id__$M = "data-v-bad609aa";
23068
+ const __vue_scope_id__$M = "data-v-567642a6";
23068
23069
  /* module identifier */
23069
23070
 
23070
23071
  const __vue_module_identifier__$M = undefined;
@@ -23232,7 +23233,16 @@ var __vue_render__$I = function () {
23232
23233
  "innerHTML": _vm._s(staticContent.content)
23233
23234
  }
23234
23235
  })]);
23235
- }), 0) : _vm._e();
23236
+ }), 0) : _c('span', [_c('p', {
23237
+ staticStyle: {
23238
+ "font-size": "17px",
23239
+ "font-weight": "500"
23240
+ },
23241
+ attrs: {
23242
+ "slot": "default"
23243
+ },
23244
+ slot: "default"
23245
+ }, [_vm._v(_vm._s('Annually'))])]);
23236
23246
  };
23237
23247
 
23238
23248
  var __vue_staticRenderFns__$I = [];
@@ -23241,7 +23251,7 @@ var __vue_staticRenderFns__$I = [];
23241
23251
  const __vue_inject_styles__$K = undefined;
23242
23252
  /* scoped */
23243
23253
 
23244
- const __vue_scope_id__$K = "data-v-75ff815f";
23254
+ const __vue_scope_id__$K = "data-v-b2c54672";
23245
23255
  /* module identifier */
23246
23256
 
23247
23257
  const __vue_module_identifier__$K = undefined;
@@ -41336,6 +41346,14 @@ var script = {
41336
41346
  }
41337
41347
  },
41338
41348
 
41349
+ calculateDiscountedPrice(plan) {
41350
+ if (plan.discount_type === 'percentage') {
41351
+ return plan.price - plan.price * plan.discount / 100;
41352
+ } else if (plan.discount_type === 'amount') {
41353
+ return plan.price - plan.discount;
41354
+ }
41355
+ },
41356
+
41339
41357
  async getPlanUrl(plan) {
41340
41358
  let shopName = this.shop.name;
41341
41359
  const response = await axios.get(`${this.app_manager_config.baseUrl}/api/app-manager/plan/process/${plan.id}?shop=${shopName}`).catch(error => {
@@ -41385,6 +41403,8 @@ var script = {
41385
41403
  },
41386
41404
 
41387
41405
  async mounted() {
41406
+ var _this$plan;
41407
+
41388
41408
  const featuresData = await axios.get(`${this.app_manager_config.baseUrl}/api/app-manager/plan-features`).catch(error => {
41389
41409
  console.error(error);
41390
41410
  });
@@ -41406,6 +41426,11 @@ var script = {
41406
41426
 
41407
41427
  this.shopify_plan = plansData.data.shopify_plan;
41408
41428
  this.plan = plansData.data.plan;
41429
+
41430
+ if (((_this$plan = this.plan) === null || _this$plan === void 0 ? void 0 : _this$plan.interval) === 'ANNUAL') {
41431
+ this.selectedPlan = 'annually';
41432
+ }
41433
+
41409
41434
  this.default_plan_id = plansData.data.default_plan_id;
41410
41435
  this.onboard = !this.plan;
41411
41436
  }
@@ -41443,7 +41468,7 @@ var __vue_render__ = function () {
41443
41468
  attrs: {
41444
41469
  "segmented": ""
41445
41470
  }
41446
- }, [_vm.monthlyPlan.length ? _c('PButton', {
41471
+ }, [_vm.monthlyPlan.length && _vm.yearlyPlan.length ? _c('PButton', {
41447
41472
  style: _vm.selectedPlan === 'monthly' ? _vm.monthlySelectedStyle : _vm.monthlyStyle,
41448
41473
  on: {
41449
41474
  "click": function ($event) {
@@ -41459,7 +41484,7 @@ var __vue_render__ = function () {
41459
41484
  "slot": "default"
41460
41485
  },
41461
41486
  slot: "default"
41462
- }, [_vm._v(_vm._s('Monthly'))])]) : _vm._e(), _vm._v(" "), _vm.yearlyPlan.length ? _c('PButton', {
41487
+ }, [_vm._v(_vm._s('Monthly'))])]) : _vm._e(), _vm._v(" "), _vm.yearlyPlan.length && _vm.monthlyPlan.length ? _c('PButton', {
41463
41488
  style: _vm.selectedPlan === 'annually' ? _vm.yearlySelectedStyle : _vm.yearlyStyle,
41464
41489
  attrs: {
41465
41490
  "primary": _vm.selectedPlan === 'annually'
@@ -41505,7 +41530,38 @@ var __vue_render__ = function () {
41505
41530
  staticStyle: {
41506
41531
  "font-size": "16px"
41507
41532
  }
41508
- }, [_vm._v(_vm._s(plan.name))]), _vm._v(" "), _c('p', {
41533
+ }, [_vm._v(_vm._s(plan.name))]), _vm._v(" "), plan.discount && plan.discount > 0 ? _c('div', [_c('p', {
41534
+ staticStyle: {
41535
+ "display": "flex",
41536
+ "margin-top": "10px"
41537
+ }
41538
+ }, [_c('PHeading', {
41539
+ staticStyle: {
41540
+ "font-size": "25px",
41541
+ "font-weight": "700"
41542
+ }
41543
+ }, [_vm._v("$" + _vm._s(parseFloat(_vm.calculateDiscountedPrice(plan)).toFixed(2)))]), _vm._v(" "), _c('b', {
41544
+ staticStyle: {
41545
+ "margin-top": "5px",
41546
+ "font-size": "17px"
41547
+ }
41548
+ }, [_vm._v("/" + _vm._s("mo"))])], 1), _vm._v(" "), _c('p', {
41549
+ staticStyle: {
41550
+ "display": "flex",
41551
+ "margin-top": "7px"
41552
+ }
41553
+ }, [_c('PHeading', {
41554
+ staticStyle: {
41555
+ "font-size": "18px",
41556
+ "font-weight": "500",
41557
+ "text-decoration": "line-through"
41558
+ }
41559
+ }, [_vm._v("$" + _vm._s(parseFloat(plan.price).toFixed(2)))]), _vm._v(" "), _c('b', {
41560
+ staticStyle: {
41561
+ "margin-top": "3px",
41562
+ "font-size": "14px"
41563
+ }
41564
+ }, [_vm._v("/" + _vm._s("mo"))])], 1)]) : _c('div', [_c('p', {
41509
41565
  staticStyle: {
41510
41566
  "display": "flex",
41511
41567
  "margin-top": "10px"
@@ -41520,7 +41576,7 @@ var __vue_render__ = function () {
41520
41576
  "margin-top": "5px",
41521
41577
  "font-size": "17px"
41522
41578
  }
41523
- }, [_vm._v("/" + _vm._s("mo"))])], 1)])];
41579
+ }, [_vm._v("/" + _vm._s("mo"))])], 1)])])];
41524
41580
  })], 2) : _c('PDataTableRow', [_c('PDataTableCol', {
41525
41581
  staticClass: "plan-heading",
41526
41582
  staticStyle: {
@@ -41540,7 +41596,38 @@ var __vue_render__ = function () {
41540
41596
  staticStyle: {
41541
41597
  "font-size": "16px"
41542
41598
  }
41543
- }, [_vm._v(_vm._s(plan.name))]), _vm._v(" "), _c('p', {
41599
+ }, [_vm._v(_vm._s(plan.name))]), _vm._v(" "), plan.discount && plan.discount > 0 ? _c('div', [_c('p', {
41600
+ staticStyle: {
41601
+ "display": "flex",
41602
+ "margin-top": "10px"
41603
+ }
41604
+ }, [_c('PHeading', {
41605
+ staticStyle: {
41606
+ "font-size": "25px",
41607
+ "font-weight": "700"
41608
+ }
41609
+ }, [_vm._v("$" + _vm._s(parseFloat(_vm.calculateDiscountedPrice(plan)).toFixed(2)))]), _vm._v(" "), _c('b', {
41610
+ staticStyle: {
41611
+ "margin-top": "5px",
41612
+ "font-size": "17px"
41613
+ }
41614
+ }, [_vm._v("/" + _vm._s("year"))])], 1), _vm._v(" "), _c('p', {
41615
+ staticStyle: {
41616
+ "display": "flex",
41617
+ "margin-top": "7px"
41618
+ }
41619
+ }, [_c('PHeading', {
41620
+ staticStyle: {
41621
+ "font-size": "18px",
41622
+ "font-weight": "500",
41623
+ "text-decoration": "line-through"
41624
+ }
41625
+ }, [_vm._v("$" + _vm._s(parseFloat(plan.price).toFixed(2)))]), _vm._v(" "), _c('b', {
41626
+ staticStyle: {
41627
+ "margin-top": "3px",
41628
+ "font-size": "14px"
41629
+ }
41630
+ }, [_vm._v("/" + _vm._s("year"))])], 1)]) : _c('div', [_c('p', {
41544
41631
  staticStyle: {
41545
41632
  "display": "flex",
41546
41633
  "margin-top": "10px"
@@ -41555,7 +41642,7 @@ var __vue_render__ = function () {
41555
41642
  "margin-top": "5px",
41556
41643
  "font-size": "17px"
41557
41644
  }
41558
- }, [_vm._v("/" + _vm._s("year"))])], 1)])];
41645
+ }, [_vm._v("/" + _vm._s("year"))])], 1)])])];
41559
41646
  })], 2)], 1), _vm._v(" "), _c('template', {
41560
41647
  slot: "body"
41561
41648
  }, [_vm._l(_vm.features, function (feature, rIndex) {
@@ -41648,7 +41735,7 @@ var __vue_staticRenderFns__ = [];
41648
41735
 
41649
41736
  const __vue_inject_styles__ = function (inject) {
41650
41737
  if (!inject) return;
41651
- inject("data-v-aaf53caa_0", {
41738
+ inject("data-v-56b8f605_0", {
41652
41739
  source: "@import url(https://fonts.googleapis.com/css2?family=Satisfy&display=swap);.app-manager-plan-page .plan-table td:last-child>[data-v-5a078dbb],.app-manager-plan-page .plan-table td:last-child>[data-v-7d902277]{float:none}.app-manager-plan-page .active{background:#f0f8f5}.app-manager-plan-page .plan-table td:last-child>[data-v-0d1b0d63]{float:none}.app-manager-plan-page .plan-table td{border:.01px solid #ececee!important;border-collapse:collapse!important}.app-manager-plan-page .plan-table .Polaris-DataTable__ScrollContainer{border-radius:12px;overflow:visible}.app-manager-plan-page .plan-table table{border-collapse:collapse!important}.app-manager-plan-page .custom-plan table{border-collapse:collapse!important}.app-manager-plan-page .custom-plan table thead .first-column{border-radius:12px 0 0 0;border-top:0!important;border-left:0!important}.app-manager-plan-page .custom-plan table thead .plan-heading.last-column{text-align:left!important;border-radius:0 12px 0 0;border-top:0!important}.app-manager-plan-page .custom-plan table thead .plan-heading{background-color:#fff;box-shadow:rgba(23,24,24,.05) 1px 0 8px,rgba(0,0,0,.15) 0 0 2px}.app-manager-plan-page .custom-plan table tbody tr:first-child{background-color:#fff;box-shadow:0 0 5px rgba(23,24,24,.05),0 1px 2px rgba(0,0,0,.15);border-radius:12px 0 0 0;overflow:hidden}.app-manager-plan-page .custom-plan table tbody tr:not(:first-child:last-child){background-color:#fff;overflow:hidden}.app-manager-plan-page .custom-plan table tbody tr:not(:first-child:last-child){background-color:#fff;box-shadow:0 0 5px rgba(23,24,24,.05),0 1px 2px rgba(0,0,0,.15);overflow:hidden}.app-manager-plan-page .custom-plan table tbody tr:not(:nth-last-child(2)){background-color:#fff;overflow:hidden}.app-manager-plan-page .custom-plan table tbody tr:not(:nth-last-child(2)){border-bottom:0}.app-manager-plan-page .custom-plan table tbody tr:last-child{border-bottom:0;background-color:transparent!important;box-shadow:none!important}.app-manager-plan-page .custom-plan table tbody tr:not(:last-child){pointer-events:none}.app-manager-plan-page .custom-plan table thead tr td{pointer-events:none}.app-manager-plan-page .custom-plan table tbody tr:first-child td:first-child{overflow:hidden;border-radius:12px 0 0 0}.app-manager-plan-page .custom-plan table tbody tr:nth-last-child(2){overflow:hidden;border-bottom-right-radius:12px;border-bottom-left-radius:12px}.app-manager-plan-page .custom-plan table tbody tr:nth-last-child(2) td:first-child{overflow:hidden;border-bottom:0!important;border-radius:0 0 0 12px}.app-manager-plan-page .custom-plan table tbody tr:nth-last-child(2) td:last-child{overflow:hidden;border-radius:0 0 12px}.app-manager-plan-page .custom-plan table tbody tr td:first-child{border-left:0!important;border-top:0!important;padding-left:20px}.app-manager-plan-page .custom-plan table tbody tr td:last-child{border-right:0!important;border-bottom:0!important;text-align:center!important}.app-manager-plan-page .custom-plan table thead tr td:last-child{border-right:0!important;border-bottom:0!important;text-align:center!important}.app-manager-plan-page .custom-plan table tbody td:not(:first-child){text-align:center!important}.app-manager-plan-page .custom-plan table tbody tr:last-child td:last-child{background:0 0;border-radius:0 0 12px 0}.app-manager-plan-page .custom-plan table tbody tr:last-child td{border:0!important;background:0 0}.app-manager-plan-page .custom-plan table tbody tr:last-child td:hover{border:0!important;background:0 0}.app-manager-plan-page .custom-plan tbody tr:last-child td.Polaris-DataTable__Cell--verticalAlignTop{background:0 0!important}.app-manager-plan-page .custom-plan table tbody tr:last-child{background:0 0;opacity:1}.app-manager-plan-page .custom-plan table tbody tr:last-child td:first-child{visibility:hidden}.app-manager-plan-page .plan-heading{padding-top:30px}.app-manager-plan-page .custom-plan .Polaris-Layout__Section{max-width:calc(100% - 2rem)!important}.app-manager-plan-page .later-link{text-align:center;clear:both;padding-top:15px}.app-manager-plan-page .plan-badge ul{text-align:center;padding-top:2rem;border-top:.1rem solid #e1e3e5}.app-manager-plan-page .plan-badge ul li{list-style:none;display:inline-block;padding-right:25px}.app-manager-plan-page .plan-badge ul li img{max-width:133px}.app-manager-plan-page .btn-group .Polaris-ButtonGroup__Item{margin-left:0!important;z-index:unset!important}.app-manager-plan-page.custom-title .Polaris-HorizontalDivider{background-color:#e2e3e4}.app-manager-plan-page .Polaris-Page__Content hr{border:1px solid #e2e3e4}",
41653
41740
  map: undefined,
41654
41741
  media: undefined