bhl-forms 0.0.44 → 0.0.47

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.
@@ -11184,16 +11184,26 @@ function prepData(formData) {
11184
11184
  };
11185
11185
  return data;
11186
11186
  }
11187
- const isMobile = window.matchMedia("only screen and (max-width: 480px)").matches;
11187
+ window.matchMedia("only screen and (max-width: 480px)").matches;
11188
+ function getCoords(elem) {
11189
+ let box2 = elem.getBoundingClientRect();
11190
+ return {
11191
+ top: box2.top + window.pageYOffset,
11192
+ right: box2.right + window.pageXOffset,
11193
+ bottom: box2.bottom + window.pageYOffset,
11194
+ left: box2.left + window.pageXOffset
11195
+ };
11196
+ }
11188
11197
  const fireStepEvent = (formNode) => (stepResult, stepHistory2, stepQueue2) => {
11189
11198
  if (!stepResult) {
11190
11199
  return;
11191
11200
  }
11192
11201
  const anchorId = formNode.attrs.anchorElement || formNode.id;
11193
- if (anchorId && isMobile) {
11202
+ if (anchorId) {
11194
11203
  const anchor = document.getElementById(anchorId);
11195
11204
  if (anchor) {
11196
- anchor.scrollIntoView(true);
11205
+ const pos = getCoords(anchor);
11206
+ window.scrollTo(pos.right, pos.top);
11197
11207
  }
11198
11208
  }
11199
11209
  var step_values = null;
@@ -11304,6 +11314,21 @@ var theme = {
11304
11314
  week: textClassification
11305
11315
  };
11306
11316
  var index = "";
11317
+ if (!Object.fromEntries) {
11318
+ Object.defineProperty(Object, "fromEntries", {
11319
+ value(entries) {
11320
+ if (!entries || !entries[Symbol.iterator]) {
11321
+ throw new Error("Object.fromEntries() requires a single iterable argument");
11322
+ }
11323
+ const o2 = {};
11324
+ Object.keys(entries).forEach((key) => {
11325
+ const [k2, v] = entries[key];
11326
+ o2[k2] = v;
11327
+ });
11328
+ return o2;
11329
+ }
11330
+ });
11331
+ }
11307
11332
  function toInteger(dirtyNumber) {
11308
11333
  if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
11309
11334
  return NaN;
@@ -15593,6 +15618,11 @@ const init = () => {
15593
15618
  data.submitUrl = data.submitUrl || defaultSubmitUrl;
15594
15619
  data.prepData = data.prepData || prepData;
15595
15620
  data.fireStepEvent = data.fireStepEvent || fireStepEvent;
15621
+ data.onEnter = (callback) => (e2) => {
15622
+ if (e2.key === "Enter" || e2.keyCode === 13) {
15623
+ callback();
15624
+ }
15625
+ };
15596
15626
  const app = createApp(_sfc_main$1, { schema: schemaObj, data }).use(plugin$1, defaultConfig({
15597
15627
  inputs: {
15598
15628
  DatePicker: createInput(_sfc_main)