@manifoldco/web-components
Advanced tools
Comparing version 0.0.52 to 0.0.53
@@ -50,45 +50,48 @@ import { Component, Element, Event, Host, State, Prop, h, Watch, Listen, } from '@stencil/core'; | ||
updateProduct(newProduct) { | ||
this.featureSelections = {}; | ||
if (newProduct.plans) { | ||
newProduct.plans.plans.forEach((plan) => { | ||
const defaultSelections = []; | ||
if (plan.features) { | ||
plan.features.features.forEach((feature) => { | ||
var _a, _b; | ||
if (feature.class === FeatureClass.Configured) { | ||
if (feature.__typename === 'BooleanFeature') { | ||
const defaultValue = feature.booleanValues.find((v) => v.default); | ||
const defaultSelection = { | ||
slug: feature.featureSlug.slug, | ||
booleanSelection: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value, | ||
}; | ||
const stripePaymentSettings = (_a = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.paymentSettings) === null || _a === void 0 ? void 0 : _a.find((ps) => (ps === null || ps === void 0 ? void 0 : ps.type) === PaymentSettingsType.Stripe); | ||
if (stripePaymentSettings) { | ||
defaultSelection.stripePaymentSettings = { | ||
billingPeriod: stripePaymentSettings.billingPeriod, | ||
stripePriceID: stripePaymentSettings.stripePriceID, | ||
var _a; | ||
if (newProduct.slug !== ((_a = this.product) === null || _a === void 0 ? void 0 : _a.slug)) { | ||
this.featureSelections = {}; | ||
if (newProduct.plans) { | ||
newProduct.plans.plans.forEach((plan) => { | ||
const defaultSelections = []; | ||
if (plan.features) { | ||
plan.features.features.forEach((feature) => { | ||
var _a, _b; | ||
if (feature.class === FeatureClass.Configured) { | ||
if (feature.__typename === 'BooleanFeature') { | ||
const defaultValue = feature.booleanValues.find((v) => v.default); | ||
const defaultSelection = { | ||
slug: feature.featureSlug.slug, | ||
booleanSelection: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value, | ||
}; | ||
const stripePaymentSettings = (_a = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.paymentSettings) === null || _a === void 0 ? void 0 : _a.find((ps) => (ps === null || ps === void 0 ? void 0 : ps.type) === PaymentSettingsType.Stripe); | ||
if (stripePaymentSettings) { | ||
defaultSelection.stripePaymentSettings = { | ||
billingPeriod: stripePaymentSettings.billingPeriod, | ||
stripePriceID: stripePaymentSettings.stripePriceID, | ||
}; | ||
} | ||
defaultSelections.push(defaultSelection); | ||
} | ||
defaultSelections.push(defaultSelection); | ||
} | ||
if (feature.__typename === 'IntFeature') { | ||
const defaultValue = feature.intValues.find((v) => v.default); | ||
const defaultSelection = { | ||
slug: feature.featureSlug.slug, | ||
intSelection: feature.intValues[0].value || 0, | ||
}; | ||
const stripePaymentSettings = (_b = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.paymentSettings) === null || _b === void 0 ? void 0 : _b.find((ps) => (ps === null || ps === void 0 ? void 0 : ps.type) === PaymentSettingsType.Stripe); | ||
if (stripePaymentSettings) { | ||
defaultSelection.stripePaymentSettings = { | ||
billingPeriod: stripePaymentSettings.billingPeriod, | ||
stripePriceID: stripePaymentSettings.stripePriceID, | ||
if (feature.__typename === 'IntFeature') { | ||
const defaultValue = feature.intValues.find((v) => v.default); | ||
const defaultSelection = { | ||
slug: feature.featureSlug.slug, | ||
intSelection: feature.intValues[0].value || 0, | ||
}; | ||
const stripePaymentSettings = (_b = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.paymentSettings) === null || _b === void 0 ? void 0 : _b.find((ps) => (ps === null || ps === void 0 ? void 0 : ps.type) === PaymentSettingsType.Stripe); | ||
if (stripePaymentSettings) { | ||
defaultSelection.stripePaymentSettings = { | ||
billingPeriod: stripePaymentSettings.billingPeriod, | ||
stripePriceID: stripePaymentSettings.stripePriceID, | ||
}; | ||
} | ||
defaultSelections.push(defaultSelection); | ||
} | ||
defaultSelections.push(defaultSelection); | ||
} | ||
} | ||
}); | ||
} | ||
this.featureSelections[plan.slug] = defaultSelections; | ||
}); | ||
}); | ||
} | ||
this.featureSelections[plan.slug] = defaultSelections; | ||
}); | ||
} | ||
} | ||
@@ -95,0 +98,0 @@ } |
@@ -59,45 +59,48 @@ import { Component, Element, Event, Host, State, Prop, h, Watch, Listen, } from '@stencil/core'; | ||
updateProduct(newProduct) { | ||
this.featureSelections = {}; | ||
if (newProduct.plans) { | ||
newProduct.plans.plans.forEach((plan) => { | ||
const defaultSelections = []; | ||
if (plan.features) { | ||
plan.features.features.forEach((feature) => { | ||
var _a, _b; | ||
if (feature.class === FeatureClass.Configured) { | ||
if (feature.__typename === 'BooleanFeature') { | ||
const defaultValue = feature.booleanValues.find((v) => v.default); | ||
const defaultSelection = { | ||
slug: feature.featureSlug.slug, | ||
booleanSelection: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value, | ||
}; | ||
const stripePaymentSettings = (_a = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.paymentSettings) === null || _a === void 0 ? void 0 : _a.find((ps) => (ps === null || ps === void 0 ? void 0 : ps.type) === PaymentSettingsType.Stripe); | ||
if (stripePaymentSettings) { | ||
defaultSelection.stripePaymentSettings = { | ||
billingPeriod: stripePaymentSettings.billingPeriod, | ||
stripePriceID: stripePaymentSettings.stripePriceID, | ||
var _a; | ||
if (newProduct.slug !== ((_a = this.product) === null || _a === void 0 ? void 0 : _a.slug)) { | ||
this.featureSelections = {}; | ||
if (newProduct.plans) { | ||
newProduct.plans.plans.forEach((plan) => { | ||
const defaultSelections = []; | ||
if (plan.features) { | ||
plan.features.features.forEach((feature) => { | ||
var _a, _b; | ||
if (feature.class === FeatureClass.Configured) { | ||
if (feature.__typename === 'BooleanFeature') { | ||
const defaultValue = feature.booleanValues.find((v) => v.default); | ||
const defaultSelection = { | ||
slug: feature.featureSlug.slug, | ||
booleanSelection: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value, | ||
}; | ||
const stripePaymentSettings = (_a = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.paymentSettings) === null || _a === void 0 ? void 0 : _a.find((ps) => (ps === null || ps === void 0 ? void 0 : ps.type) === PaymentSettingsType.Stripe); | ||
if (stripePaymentSettings) { | ||
defaultSelection.stripePaymentSettings = { | ||
billingPeriod: stripePaymentSettings.billingPeriod, | ||
stripePriceID: stripePaymentSettings.stripePriceID, | ||
}; | ||
} | ||
defaultSelections.push(defaultSelection); | ||
} | ||
defaultSelections.push(defaultSelection); | ||
} | ||
if (feature.__typename === 'IntFeature') { | ||
const defaultValue = feature.intValues.find((v) => v.default); | ||
const defaultSelection = { | ||
slug: feature.featureSlug.slug, | ||
intSelection: feature.intValues[0].value || 0, | ||
}; | ||
const stripePaymentSettings = (_b = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.paymentSettings) === null || _b === void 0 ? void 0 : _b.find((ps) => (ps === null || ps === void 0 ? void 0 : ps.type) === PaymentSettingsType.Stripe); | ||
if (stripePaymentSettings) { | ||
defaultSelection.stripePaymentSettings = { | ||
billingPeriod: stripePaymentSettings.billingPeriod, | ||
stripePriceID: stripePaymentSettings.stripePriceID, | ||
if (feature.__typename === 'IntFeature') { | ||
const defaultValue = feature.intValues.find((v) => v.default); | ||
const defaultSelection = { | ||
slug: feature.featureSlug.slug, | ||
intSelection: feature.intValues[0].value || 0, | ||
}; | ||
const stripePaymentSettings = (_b = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.paymentSettings) === null || _b === void 0 ? void 0 : _b.find((ps) => (ps === null || ps === void 0 ? void 0 : ps.type) === PaymentSettingsType.Stripe); | ||
if (stripePaymentSettings) { | ||
defaultSelection.stripePaymentSettings = { | ||
billingPeriod: stripePaymentSettings.billingPeriod, | ||
stripePriceID: stripePaymentSettings.stripePriceID, | ||
}; | ||
} | ||
defaultSelections.push(defaultSelection); | ||
} | ||
defaultSelections.push(defaultSelection); | ||
} | ||
} | ||
}); | ||
} | ||
this.featureSelections[plan.slug] = defaultSelections; | ||
}); | ||
}); | ||
} | ||
this.featureSelections[plan.slug] = defaultSelections; | ||
}); | ||
} | ||
} | ||
@@ -104,0 +107,0 @@ } |
@@ -1,1 +0,1 @@ | ||
import{p as e,b as r}from"./p-fdbb6cfd.js";e().then(e=>r([["p-0ed73ffa",[[1,"manifold-plan-table",{embed:[1],ctaText:[1,"cta-text"],planOptions:[16],baseUrl:[1,"base-url"],productData:[16],env:[1],featureSelections:[32],featureErrors:[32],product:[32],client:[32],breakpoint:[32],scrolled:[32],maxRowHeights:[32],currentSlide:[32]},[[1,"scroll","scrollHandler"]]]]],["p-23b784cf",[[1,"plangraph-plan-table",{embed:[1],ctaText:[1,"cta-text"],planOptions:[16],baseUrl:[1,"base-url"],productData:[16],env:[1],featureSelections:[32],featureErrors:[32],product:[32],client:[32],breakpoint:[32],scrolled:[32],maxRowHeights:[32],currentSlide:[32]},[[1,"scroll","scrollHandler"]]]]]],e)); | ||
import{p as e,b as r}from"./p-fdbb6cfd.js";e().then(e=>r([["p-07f41681",[[1,"manifold-plan-table",{embed:[1],ctaText:[1,"cta-text"],planOptions:[16],baseUrl:[1,"base-url"],productData:[16],env:[1],featureSelections:[32],featureErrors:[32],product:[32],client:[32],breakpoint:[32],scrolled:[32],maxRowHeights:[32],currentSlide:[32]},[[1,"scroll","scrollHandler"]]]]],["p-a9c666c6",[[1,"plangraph-plan-table",{embed:[1],ctaText:[1,"cta-text"],planOptions:[16],baseUrl:[1,"base-url"],productData:[16],env:[1],featureSelections:[32],featureErrors:[32],product:[32],client:[32],breakpoint:[32],scrolled:[32],maxRowHeights:[32],currentSlide:[32]},[[1,"scroll","scrollHandler"]]]]]],e)); |
@@ -1,1 +0,1 @@ | ||
System.register(["./p-7408ba89.system.js"],(function(){"use strict";var e,t;return{setters:[function(r){e=r.p;t=r.b}],execute:function(){e().then((function(e){return t([["p-c801d7d0.system",[[1,"manifold-plan-table",{embed:[1],ctaText:[1,"cta-text"],planOptions:[16],baseUrl:[1,"base-url"],productData:[16],env:[1],featureSelections:[32],featureErrors:[32],product:[32],client:[32],breakpoint:[32],scrolled:[32],maxRowHeights:[32],currentSlide:[32]},[[1,"scroll","scrollHandler"]]]]],["p-1c6b0d50.system",[[1,"plangraph-plan-table",{embed:[1],ctaText:[1,"cta-text"],planOptions:[16],baseUrl:[1,"base-url"],productData:[16],env:[1],featureSelections:[32],featureErrors:[32],product:[32],client:[32],breakpoint:[32],scrolled:[32],maxRowHeights:[32],currentSlide:[32]},[[1,"scroll","scrollHandler"]]]]]],e)}))}}})); | ||
System.register(["./p-7408ba89.system.js"],(function(){"use strict";var e,t;return{setters:[function(r){e=r.p;t=r.b}],execute:function(){e().then((function(e){return t([["p-b59b610b.system",[[1,"manifold-plan-table",{embed:[1],ctaText:[1,"cta-text"],planOptions:[16],baseUrl:[1,"base-url"],productData:[16],env:[1],featureSelections:[32],featureErrors:[32],product:[32],client:[32],breakpoint:[32],scrolled:[32],maxRowHeights:[32],currentSlide:[32]},[[1,"scroll","scrollHandler"]]]]],["p-06701ebd.system",[[1,"plangraph-plan-table",{embed:[1],ctaText:[1,"cta-text"],planOptions:[16],baseUrl:[1,"base-url"],productData:[16],env:[1],featureSelections:[32],featureErrors:[32],product:[32],client:[32],breakpoint:[32],scrolled:[32],maxRowHeights:[32],currentSlide:[32]},[[1,"scroll","scrollHandler"]]]]]],e)}))}}})); |
{ | ||
"name": "@manifoldco/web-components", | ||
"version": "0.0.52", | ||
"version": "0.0.53", | ||
"description": "Manifold's Web Components", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2384677
37343