@getodk/web-forms 1.0.1 → 1.0.2

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.
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as m, openBlock as s, createBlock as f, unref as p, withCtx as n, createElementVNode as t, createElementBlock as l, Fragment as u, renderList as _, normalizeClass as v, createVNode as b, toDisplayString as a } from "vue";
2
- import { s as g, I, _ as k } from "./index-B6FCqSEU.js";
2
+ import { s as g, I, _ as k } from "./index-DWj9XRAV.js";
3
3
  const x = { class: "odk-form-list" }, B = { class: "action-description" }, C = /* @__PURE__ */ m({
4
4
  __name: "ActionsInfoDialog",
5
5
  props: {
@@ -1,6 +1,6 @@
1
1
  import { resolveComponent as T, openBlock as d, createElementBlock as m, mergeProps as P, createCommentVNode as k, createVNode as C, withCtx as U, Transition as Ue, createElementVNode as L, shallowRef as j, computed as w, onUnmounted as ge, defineComponent as be, inject as ke, ref as S, watch as ye, onBeforeUnmount as Ae, Fragment as Se, normalizeClass as $, unref as a, normalizeStyle as Ve, createBlock as B, useModel as $e, onMounted as Fe, createTextVNode as Ze, toDisplayString as G, renderList as Xe, mergeModels as re } from "vue";
2
- import { A as _e } from "./ActionsInfoDialog-DChkpdtP.js";
3
- import { B as Ne, k as je, l as Ge, O as Ye, m as Ke, C as We, n as ae, r as qe, o as Je, q as Qe, Z as Y, T as Ce, I as x, _ as we, u as en, v as se, j as nn } from "./index-B6FCqSEU.js";
2
+ import { A as _e } from "./ActionsInfoDialog-DtAY32vv.js";
3
+ import { B as Ne, k as je, l as Ge, O as Ye, m as Ke, C as We, n as ae, r as qe, o as Je, q as Qe, Z as Y, T as Ce, I as x, _ as we, u as en, v as se, j as nn } from "./index-DWj9XRAV.js";
4
4
  var tn = ({ dt: e }) => `
5
5
  .p-colorpicker {
6
6
  display: inline-block;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as Yn, inject as cn, ref as Se, computed as it, watch as Rt, openBlock as ee, createBlock as rt, Transition as ed, withCtx as We, createElementBlock as me, createElementVNode as N, normalizeClass as Qt, toDisplayString as ne, unref as O, withDirectives as js, vModelText as Ys, createVNode as he, createCommentVNode as Ce, Fragment as Ca, shallowRef as ht, renderList as td, onMounted as nd, onUnmounted as id, nextTick as sd, createTextVNode as rd } from "vue";
2
- import { T as wn, i as od, a as Ul, b as ad, I as Oe, t as Ta, _ as Oi, s as ah, c as Bt, S as Te, g as ld, M as cd, d as hd, e as ud, f as dd, h as fd, p as gd, Q as _d, j as md } from "./index-B6FCqSEU.js";
3
- import { A as pd } from "./ActionsInfoDialog-DChkpdtP.js";
2
+ import { T as wn, i as od, a as Ul, b as ad, I as Oe, t as Ta, _ as Oi, s as ah, c as Bt, S as Te, g as ld, M as cd, d as hd, e as ud, f as dd, h as fd, p as gd, Q as _d, j as md } from "./index-DWj9XRAV.js";
3
+ import { A as pd } from "./ActionsInfoDialog-DtAY32vv.js";
4
4
  function lh(...i) {
5
5
  console.warn(...i);
6
6
  }
@@ -32996,7 +32996,7 @@ class SelectControl extends ValueNode {
32996
32996
  }
32997
32997
  // SelectNode
32998
32998
  getValueOption(nr) {
32999
- return this.currentState.valueOptions.find((or) => or.value === nr) ?? null;
32999
+ return this.mapOptionsByValue().get(nr) ?? null;
33000
33000
  }
33001
33001
  isSelected(nr) {
33002
33002
  return this.currentState.value.includes(nr);
@@ -39503,7 +39503,7 @@ const _hoisted_1$B = { class: "geo-dialog-header" }, _hoisted_2$j = { class: "ge
39503
39503
  console.warn("Invalid GeoJSON", er);
39504
39504
  return;
39505
39505
  }
39506
- }, cache$1 = { promise: null }, loadMapBlock = () => (cache$1.promise ??= (async () => (await import("./MapBlock-DtECrk0U.js")).default)(), cache$1.promise), _hoisted_1$z = { class: "async-loader-container" }, _hoisted_2$h = {
39506
+ }, cache$1 = { promise: null }, loadMapBlock = () => (cache$1.promise ??= (async () => (await import("./MapBlock-DSTG_Q0I.js")).default)(), cache$1.promise), _hoisted_1$z = { class: "async-loader-container" }, _hoisted_2$h = {
39507
39507
  key: 0,
39508
39508
  class: "async-loader-error"
39509
39509
  }, _hoisted_3$c = { class: "async-loader-error-message" }, _sfc_main$I = /* @__PURE__ */ defineComponent({
@@ -50562,7 +50562,7 @@ const ft = [
50562
50562
  }), LikertWidget = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-bf056959"]]), _hoisted_1$f = {
50563
50563
  key: 0,
50564
50564
  class: "dropdown-placeholder"
50565
- }, _sfc_main$m = /* @__PURE__ */ defineComponent({
50565
+ }, DEFAULT_PRIMEVUE_ITEM_HEIGHT$1 = 38, _sfc_main$m = /* @__PURE__ */ defineComponent({
50566
50566
  __name: "SearchableDropdown",
50567
50567
  props: {
50568
50568
  question: {},
@@ -50570,17 +50570,13 @@ const ft = [
50570
50570
  },
50571
50571
  emits: ["update:modelValue", "change"],
50572
50572
  setup(er) {
50573
- const nr = inject(TRANSLATE), rr = er, or = computed(() => rr.question.currentState.valueOptions.map((sr) => {
50574
- if (rr.question.getValueOption(sr.value) == null)
50575
- throw new Error(`Failed to find option for value: ${sr.value}`);
50576
- return {
50577
- value: sr.value,
50578
- label: sr.label.formatted,
50579
- search: sr.label.asString
50580
- };
50581
- })), Ar = computed(() => {
50573
+ const nr = inject(TRANSLATE), rr = er, or = computed(() => rr.question.currentState.valueOptions.map((sr) => ({
50574
+ value: sr.value,
50575
+ label: sr.label.formatted,
50576
+ search: sr.label.asString
50577
+ }))), Ar = computed(() => {
50582
50578
  const sr = rr.question.currentState?.value?.[0];
50583
- return sr ? rr.question.currentState.valueOptions.find((cr) => cr.value === sr)?.label.formatted : [];
50579
+ return sr ? rr.question.getValueOption(sr)?.label.formatted : [];
50584
50580
  }), ir = (sr) => {
50585
50581
  rr.question.selectValue(sr);
50586
50582
  };
@@ -50595,6 +50591,7 @@ const ft = [
50595
50591
  options: or.value,
50596
50592
  "option-label": "search",
50597
50593
  "option-value": "value",
50594
+ "virtual-scroller-options": { itemSize: DEFAULT_PRIMEVUE_ITEM_HEIGHT$1 },
50598
50595
  "onUpdate:modelValue": ir,
50599
50596
  onChange: lr[0] || (lr[0] = (dr) => sr.$emit("change"))
50600
50597
  }, {
@@ -50612,9 +50609,9 @@ const ft = [
50612
50609
  }, null, 8, ["elem"]))), 128))
50613
50610
  ]),
50614
50611
  _: 1
50615
- }, 8, ["id", "filter", "model-value", "disabled", "options"]));
50612
+ }, 8, ["id", "filter", "model-value", "disabled", "options", "virtual-scroller-options"]));
50616
50613
  }
50617
- }), SearchableDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-c0e9d24b"]]), _hoisted_1$e = { class: "default-appearance" }, _sfc_main$l = /* @__PURE__ */ defineComponent({
50614
+ }), SearchableDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-7d227287"]]), _hoisted_1$e = { class: "default-appearance" }, _sfc_main$l = /* @__PURE__ */ defineComponent({
50618
50615
  __name: "Select1Control",
50619
50616
  props: {
50620
50617
  question: {}
@@ -50724,7 +50721,7 @@ const ft = [
50724
50721
  }), CheckboxWidget = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-6a2e8816"]]), _hoisted_1$c = {
50725
50722
  key: 0,
50726
50723
  class: "dropdown-placeholder"
50727
- }, _sfc_main$j = /* @__PURE__ */ defineComponent({
50724
+ }, DEFAULT_PRIMEVUE_ITEM_HEIGHT = 38, _sfc_main$j = /* @__PURE__ */ defineComponent({
50728
50725
  __name: "MultiselectDropdown",
50729
50726
  props: {
50730
50727
  question: {},
@@ -50732,23 +50729,16 @@ const ft = [
50732
50729
  },
50733
50730
  emits: ["update:modelValue", "change"],
50734
50731
  setup(er) {
50735
- const nr = inject(TRANSLATE), rr = er, or = computed(() => rr.question.currentState.valueOptions.map((lr) => {
50736
- if (rr.question.getValueOption(lr.value) == null)
50737
- throw new Error(`Failed to find option for value: ${lr.value}`);
50738
- return {
50739
- value: lr.value,
50740
- label: lr.label.formatted,
50741
- search: lr.label.asString
50742
- };
50743
- })), Ar = (lr) => {
50732
+ const nr = inject(TRANSLATE), rr = er, or = computed(() => rr.question.currentState.valueOptions.map((lr) => ({
50733
+ value: lr.value,
50734
+ label: lr.label.formatted,
50735
+ search: lr.label.asString
50736
+ }))), Ar = (lr) => {
50744
50737
  rr.question.selectValues(lr);
50745
50738
  };
50746
50739
  let ir = "multi-select-dropdown-panel";
50747
50740
  rr.question.appearances["no-buttons"] && (ir += " no-buttons");
50748
- const sr = computed(() => {
50749
- const lr = rr.question.currentState;
50750
- return lr.value.map((dr) => lr.valueOptions.find((gr) => gr.value === dr)?.label.formatted);
50751
- });
50741
+ const sr = computed(() => rr.question.currentState.value.map((dr) => rr.question.getValueOption(dr)?.label.formatted));
50752
50742
  return (lr, dr) => (openBlock(), createBlock(unref(script$9), {
50753
50743
  id: `${er.question.nodeId}-control`,
50754
50744
  class: "multi-select-dropdown",
@@ -50763,6 +50753,7 @@ const ft = [
50763
50753
  "option-label": "search",
50764
50754
  "panel-class": unref(ir),
50765
50755
  "model-value": er.question.currentState.value,
50756
+ "virtual-scroller-options": { itemSize: DEFAULT_PRIMEVUE_ITEM_HEIGHT },
50766
50757
  "onUpdate:modelValue": Ar,
50767
50758
  onChange: dr[0] || (dr[0] = (cr) => lr.$emit("change"))
50768
50759
  }, {
@@ -50785,9 +50776,9 @@ const ft = [
50785
50776
  ], 64))), 128))
50786
50777
  ]),
50787
50778
  _: 1
50788
- }, 8, ["id", "input-id", "filter", "auto-filter-focus", "disabled", "options", "panel-class", "model-value"]));
50779
+ }, 8, ["id", "input-id", "filter", "auto-filter-focus", "disabled", "options", "panel-class", "model-value", "virtual-scroller-options"]));
50789
50780
  }
50790
- }), MultiselectDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-8c3a47ab"]]), _hoisted_1$b = { class: "default-appearance" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
50781
+ }), MultiselectDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-47431c3d"]]), _hoisted_1$b = { class: "default-appearance" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
50791
50782
  __name: "SelectNControl",
50792
50783
  props: {
50793
50784
  question: {}
@@ -52672,7 +52663,7 @@ const IMAGE_QUALITY = 0.8, resize = async (er, nr) => {
52672
52663
  }
52673
52664
  }), UploadImageHeader = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-4dbe652c"]]), cache = { promise: null }, loadCanvas = (er) => er ? (cache.promise ??= (async () => {
52674
52665
  const { default: nr } = await import("./vue-konva-D0sZ6RWk.js");
52675
- return er.use(nr), (await import("./CanvasBlock-DCxff1En.js")).default;
52666
+ return er.use(nr), (await import("./CanvasBlock-DTqaGXHf.js")).default;
52676
52667
  })(), cache.promise) : Promise.reject(new Error("No Vue app instance available")), _hoisted_1$5 = {
52677
52668
  key: 0,
52678
52669
  class: "canvas-disabled-overlay"
@@ -68355,7 +68346,7 @@ const ar = {
68355
68346
  },
68356
68347
  emits: ["loaded", "submit", "submitChunked"],
68357
68348
  setup(er, { emit: nr }) {
68358
- const rr = "v1.0.1", or = er, Ar = (Dr) => {
68349
+ const rr = "v1.0.2", or = er, Ar = (Dr) => {
68359
68350
  const kr = async (Lr) => {
68360
68351
  const $r = await Lr, Vr = {
68361
68352
  form: Ir,