bhl-forms 0.0.4 → 0.0.7
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/dist/bhl-forms.es.js
CHANGED
|
@@ -10639,7 +10639,7 @@ function chooseVariant(exp) {
|
|
|
10639
10639
|
async function schemaFromUrl(url3) {
|
|
10640
10640
|
console.debug("Fetching:", url3);
|
|
10641
10641
|
const res = await fetch(url3);
|
|
10642
|
-
schemaObj = await res.json();
|
|
10642
|
+
const schemaObj = await res.json();
|
|
10643
10643
|
console.debug("Got schema:", schemaObj);
|
|
10644
10644
|
return schemaObj;
|
|
10645
10645
|
}
|
|
@@ -10745,7 +10745,7 @@ var theme = {
|
|
|
10745
10745
|
};
|
|
10746
10746
|
var index = "";
|
|
10747
10747
|
const classes = generateClasses(theme);
|
|
10748
|
-
const forms = window.
|
|
10748
|
+
const forms = window.bhlFormDefs || [];
|
|
10749
10749
|
const apps = {};
|
|
10750
10750
|
forms.forEach(async function(form2) {
|
|
10751
10751
|
console.debug("Mounting form:", form2);
|
|
@@ -10762,13 +10762,13 @@ forms.forEach(async function(form2) {
|
|
|
10762
10762
|
experimentCallback(form2, res.variant, res.fromCache);
|
|
10763
10763
|
}
|
|
10764
10764
|
}
|
|
10765
|
-
let
|
|
10765
|
+
let schemaObj = schema;
|
|
10766
10766
|
if (typeof schema === "string") {
|
|
10767
|
-
|
|
10767
|
+
schemaObj = await schemaFromUrl(schema);
|
|
10768
10768
|
}
|
|
10769
10769
|
const data = form2.data || {};
|
|
10770
10770
|
data.prepData = data.prepData || prepData;
|
|
10771
|
-
const app = createApp(_sfc_main, { schema:
|
|
10771
|
+
const app = createApp(_sfc_main, { schema: schemaObj, data }).use(plugin$1, defaultConfig({
|
|
10772
10772
|
config: {
|
|
10773
10773
|
classes
|
|
10774
10774
|
}
|