@assemblyvoting/ui-library 1.4.5 → 1.4.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/index.js CHANGED
@@ -279,8 +279,8 @@ function qa(c) {
279
279
  y: b
280
280
  };
281
281
  if (h = X.x, b = X.y, o) {
282
- var G;
283
- return Object.assign({}, j, (G = {}, G[A] = _ ? "0" : "", G[g] = B ? "0" : "", G.transform = (T.devicePixelRatio || 1) <= 1 ? "translate(" + h + "px, " + b + "px)" : "translate3d(" + h + "px, " + b + "px, 0)", G));
282
+ var W;
283
+ return Object.assign({}, j, (W = {}, W[A] = _ ? "0" : "", W[g] = B ? "0" : "", W.transform = (T.devicePixelRatio || 1) <= 1 ? "translate(" + h + "px, " + b + "px)" : "translate3d(" + h + "px, " + b + "px, 0)", W));
284
284
  }
285
285
  return Object.assign({}, j, (a = {}, a[A] = _ ? b + "px" : "", a[g] = B ? h + "px" : "", a.transform = "", a));
286
286
  }
@@ -495,9 +495,9 @@ function g1(c, a) {
495
495
  }, j = c.modifiersData.offset;
496
496
  if (v === d1 && j) {
497
497
  var X = j[t];
498
- Object.keys(y).forEach(function(G) {
499
- var F = [p2, v2].indexOf(G) >= 0 ? 1 : -1, W = [l2, v2].indexOf(G) >= 0 ? "y" : "x";
500
- y[G] += X[W] * F;
498
+ Object.keys(y).forEach(function(W) {
499
+ var F = [p2, v2].indexOf(W) >= 0 ? 1 : -1, G = [l2, v2].indexOf(W) >= 0 ? "y" : "x";
500
+ y[W] += X[G] * F;
501
501
  });
502
502
  }
503
503
  return y;
@@ -541,14 +541,14 @@ function X_(c) {
541
541
  allowedAutoPlacements: b
542
542
  }) : M2);
543
543
  }, []), T = a.rects.reference, N = a.rects.popper, E = /* @__PURE__ */ new Map(), x = !0, S = A[0], y = 0; y < A.length; y++) {
544
- var j = A[y], X = C2(j), G = t1(j) === e1, F = [l2, v2].indexOf(X) >= 0, W = F ? "width" : "height", J = g1(a, {
544
+ var j = A[y], X = C2(j), W = t1(j) === e1, F = [l2, v2].indexOf(X) >= 0, G = F ? "width" : "height", J = g1(a, {
545
545
  placement: j,
546
546
  boundary: f,
547
547
  rootBoundary: p,
548
548
  altBoundary: v,
549
549
  padding: m
550
- }), e2 = F ? G ? p2 : o2 : G ? v2 : l2;
551
- T[W] > N[W] && (e2 = n3(e2));
550
+ }), e2 = F ? W ? p2 : o2 : W ? v2 : l2;
551
+ T[G] > N[G] && (e2 = n3(e2));
552
552
  var n2 = n3(e2), r2 = [];
553
553
  if (s && r2.push(J[X] <= 0), l && r2.push(J[e2] <= 0, J[n2] <= 0), r2.every(function(V2) {
554
554
  return V2;
@@ -690,10 +690,10 @@ function rk(c) {
690
690
  };
691
691
  if (N) {
692
692
  if (s) {
693
- var G, F = A === "y" ? l2 : o2, W = A === "y" ? v2 : p2, J = A === "y" ? "height" : "width", e2 = N[A], n2 = e2 + k[F], r2 = e2 - k[W], H2 = h ? -x[J] / 2 : 0, Z2 = _ === e1 ? E[J] : x[J], w2 = _ === e1 ? -x[J] : -E[J], f2 = a.elements.arrow, V2 = h && f2 ? O4(f2) : {
693
+ var W, F = A === "y" ? l2 : o2, G = A === "y" ? v2 : p2, J = A === "y" ? "height" : "width", e2 = N[A], n2 = e2 + k[F], r2 = e2 - k[G], H2 = h ? -x[J] / 2 : 0, Z2 = _ === e1 ? E[J] : x[J], w2 = _ === e1 ? -x[J] : -E[J], f2 = a.elements.arrow, V2 = h && f2 ? O4(f2) : {
694
694
  width: 0,
695
695
  height: 0
696
- }, M2 = a.modifiersData["arrow#persistent"] ? a.modifiersData["arrow#persistent"].padding : F9(), m1 = M2[F], Y1 = M2[W], q2 = h1(0, E[J], V2[J]), v4 = g ? E[J] / 2 - H2 - q2 - m1 - y.mainAxis : Z2 - q2 - m1 - y.mainAxis, c_ = g ? -E[J] / 2 + H2 + q2 + Y1 + y.mainAxis : w2 + q2 + Y1 + y.mainAxis, p4 = a.elements.arrow && N1(a.elements.arrow), e_ = p4 ? A === "y" ? p4.clientTop || 0 : p4.clientLeft || 0 : 0, Sa = (G = j == null ? void 0 : j[A]) != null ? G : 0, a_ = e2 + v4 - Sa - e_, i_ = e2 + c_ - Sa, wa = h1(h ? o3(n2, a_) : n2, e2, h ? W2(r2, i_) : r2);
696
+ }, M2 = a.modifiersData["arrow#persistent"] ? a.modifiersData["arrow#persistent"].padding : F9(), m1 = M2[F], Y1 = M2[G], q2 = h1(0, E[J], V2[J]), v4 = g ? E[J] / 2 - H2 - q2 - m1 - y.mainAxis : Z2 - q2 - m1 - y.mainAxis, c_ = g ? -E[J] / 2 + H2 + q2 + Y1 + y.mainAxis : w2 + q2 + Y1 + y.mainAxis, p4 = a.elements.arrow && N1(a.elements.arrow), e_ = p4 ? A === "y" ? p4.clientTop || 0 : p4.clientLeft || 0 : 0, Sa = (W = j == null ? void 0 : j[A]) != null ? W : 0, a_ = e2 + v4 - Sa - e_, i_ = e2 + c_ - Sa, wa = h1(h ? o3(n2, a_) : n2, e2, h ? W2(r2, i_) : r2);
697
697
  N[A] = wa, X[A] = wa - e2;
698
698
  }
699
699
  if (l) {
@@ -16743,8 +16743,8 @@ const OO = {
16743
16743
  ), g = M(() => e.option.selectable !== void 0 && !e.option.selectable ? 0 : T.value ? 1 : e.option.voteLimit || e.contest.markingType.votesAllowedPerOption || 1), A = M(() => e.selections.length > 0 ? x(e.option.children) : 0), T = M(() => e.option.exclusive), N = M(() => {
16744
16744
  const y = Array.from(Array(g.value).keys());
16745
16745
  y.forEach((F) => y[F] = F + 1);
16746
- const j = y.indexOf(Math.ceil(g.value / 2)) + 1, X = y.slice(0, j), G = y.slice(j);
16747
- return G.length ? [X, G] : [X];
16746
+ const j = y.indexOf(Math.ceil(g.value / 2)) + 1, X = y.slice(0, j), W = y.slice(j);
16747
+ return W.length ? [X, W] : [X];
16748
16748
  }), E = (y, j = 1) => {
16749
16749
  a("checked", {
16750
16750
  reference: y,
@@ -16754,9 +16754,9 @@ const OO = {
16754
16754
  if (!y)
16755
16755
  return 0;
16756
16756
  let j = y.filter(
16757
- (X) => e.selections.map((G) => G.reference).includes(X.reference)
16757
+ (X) => e.selections.map((W) => W.reference).includes(X.reference)
16758
16758
  ).length;
16759
- return y.reduce((X, G) => X + x(G.children), j);
16759
+ return y.reduce((X, W) => X + x(W.children), j);
16760
16760
  }, S = (y) => {
16761
16761
  t.value = !1, y === e.option.code && (l("accordion-open"), m_(() => {
16762
16762
  t.value = !0, n.value.scrollIntoView({ behavior: "smooth", block: "center" });
@@ -16769,7 +16769,7 @@ const OO = {
16769
16769
  S(j);
16770
16770
  }
16771
16771
  ), (y, j) => {
16772
- const X = H("AVIcon"), G = H("AVOptionCheckbox"), F = H("AVOption", !0), W = H("AVCollapser");
16772
+ const X = H("AVIcon"), W = H("AVOptionCheckbox"), F = H("AVOption", !0), G = H("AVCollapser");
16773
16773
  return u(), d("div", {
16774
16774
  ref_key: "root",
16775
16775
  ref: n,
@@ -16781,7 +16781,7 @@ const OO = {
16781
16781
  href: `option_${c.option.code}_checkbox`,
16782
16782
  "aria-labelledby": `option_${c.option.code}_title`
16783
16783
  }, null, 8, jO),
16784
- z(W, {
16784
+ z(G, {
16785
16785
  collapsable: c.contest.collapsable && _.value,
16786
16786
  "start-collapsed": c.contest.collapseDefault,
16787
16787
  onAccordionOpen: j[1] || (j[1] = (J) => y.$emit("accordion-open"))
@@ -16863,7 +16863,7 @@ const OO = {
16863
16863
  key: n2.toString(),
16864
16864
  class: "AVOption--group"
16865
16865
  }, [
16866
- (u(!0), d(U, null, Z(n2, (r2) => (u(), q(G, {
16866
+ (u(!0), d(U, null, Z(n2, (r2) => (u(), q(W, {
16867
16867
  key: r2,
16868
16868
  checked: p.value >= r2,
16869
16869
  rank: f.value ? c.selections.map((H2) => H2.reference).indexOf(c.option.reference) + 1 : null,
@@ -19044,7 +19044,7 @@ const oq = {
19044
19044
  "setContestSelection"
19045
19045
  ],
19046
19046
  setup(c, { emit: a }) {
19047
- var G;
19047
+ var W;
19048
19048
  const e = c, i = $(null), {
19049
19049
  contest: t,
19050
19050
  contestSelection: s,
@@ -19052,36 +19052,36 @@ const oq = {
19052
19052
  ballotActiveState: l,
19053
19053
  splitableContests: o
19054
19054
  } = d_(e), m = $(
19055
- ((G = s.value.piles) == null ? void 0 : G[0]) || {
19055
+ ((W = s.value.piles) == null ? void 0 : W[0]) || {
19056
19056
  multiplier: n.value,
19057
19057
  optionSelections: [],
19058
19058
  explicitBlank: !1
19059
19059
  }
19060
- ), f = M(() => oq[e.locale]), p = M(() => l.value), v = M(() => s.value.piles), h = M(
19061
- () => v.value.reduce((F, W) => F - W.multiplier, n.value)
19060
+ ), f = M(() => oq[e.locale]), p = M(() => l.value), v = M(() => (console.log(s.value), s.value.piles)), h = M(
19061
+ () => v.value.reduce((F, G) => F - G.multiplier, n.value)
19062
19062
  ), C = M(() => {
19063
- var F, W;
19064
- return console.log("PILES", v.value), console.log("INDEX", i.value), console.log(
19065
- h.value + ((F = v.value[i.value]) == null ? void 0 : F.multiplier) || 0
19066
- ), console.log("ACTIVE", m.value), h.value + ((W = v.value[i.value]) == null ? void 0 : W.multiplier) || 0;
19063
+ var F;
19064
+ return h.value + ((F = v.value[i.value]) == null ? void 0 : F.multiplier) || 0;
19067
19065
  }), b = M(
19068
19066
  () => new Jw(t.value)
19069
- ), k = () => new lq({
19070
- contest: t.value,
19071
- voterWeight: n.value
19072
- }), B = M(
19067
+ ), k = M(
19068
+ () => new lq({
19069
+ contest: t.value,
19070
+ voterWeight: n.value
19071
+ })
19072
+ ), B = M(
19073
19073
  () => h.value === 0 && v.value.every(
19074
19074
  (F) => b.value.isComplete(F)
19075
19075
  )
19076
19076
  ), _ = M(
19077
- () => v.value.reduce((F, W) => F + W.multiplier, 0)
19077
+ () => v.value.reduce((F, G) => F + G.multiplier, 0)
19078
19078
  ), g = M(() => {
19079
19079
  var F;
19080
19080
  return (F = m.value) == null ? void 0 : F.multiplier;
19081
19081
  }), A = M(
19082
19082
  () => o.value[t.value.reference]
19083
19083
  ), T = M(() => i.value !== null), N = (F) => b.value.isComplete(F), E = (F) => b.value.validate(F).length > 0, x = (F) => {
19084
- m.value = F, A.value || S();
19084
+ console.log(F), m.value = F, A.value || S();
19085
19085
  }, S = () => {
19086
19086
  if (A.value) {
19087
19087
  const F = [...v.value];
@@ -19112,7 +19112,7 @@ const oq = {
19112
19112
  ));
19113
19113
  }), h2(() => {
19114
19114
  A.value || S();
19115
- }), (F, W) => {
19115
+ }), (F, G) => {
19116
19116
  var Z2;
19117
19117
  const J = H("AVSplitWizardHeader"), e2 = H("AVBallot"), n2 = H("AVPileSummary"), r2 = H("AVSplitWeightHelper"), H2 = H("AVIcon");
19118
19118
  return u(), d(U, null, [
@@ -19151,7 +19151,7 @@ const oq = {
19151
19151
  v.value.length > 0 ? (u(), d("button", {
19152
19152
  key: "back",
19153
19153
  class: "AVSplitHelper--btn-secondary",
19154
- onClick: W[0] || (W[0] = (f2) => a("setBallotActiveState", "overview"))
19154
+ onClick: G[0] || (G[0] = (f2) => a("setBallotActiveState", "overview"))
19155
19155
  }, V(f.value.ballot.back_button), 1)) : L("", !0)
19156
19156
  ]),
19157
19157
  r("div", pq, [
@@ -19159,7 +19159,7 @@ const oq = {
19159
19159
  key: "assign",
19160
19160
  class: "AVSplitHelper--btn-primary",
19161
19161
  disabled: !N(m.value) || E(m.value),
19162
- onClick: W[1] || (W[1] = (f2) => a("setBallotActiveState", "assign"))
19162
+ onClick: G[1] || (G[1] = (f2) => a("setBallotActiveState", "assign"))
19163
19163
  }, V(f.value.ballot.confirm_button), 9, hq)
19164
19164
  ])
19165
19165
  ])
@@ -19176,7 +19176,7 @@ const oq = {
19176
19176
  "total-piles": a2(s).piles.length,
19177
19177
  "splitable-contests": a2(o),
19178
19178
  locale: e.locale,
19179
- onEditCurrentSelection: W[2] || (W[2] = (f2) => a("setBallotActiveState", "ballot"))
19179
+ onEditCurrentSelection: G[2] || (G[2] = (f2) => a("setBallotActiveState", "ballot"))
19180
19180
  }, null, 8, ["selection-pile", "contest", "pile-index", "active-state", "is-editing", "total-piles", "splitable-contests", "locale"]),
19181
19181
  r("label", {
19182
19182
  for: `${a2(t).reference}-ballot-selector`,
@@ -19184,7 +19184,7 @@ const oq = {
19184
19184
  }, V(T.value ? f.value.assign.ballots_to_assign_edit_mode : f.value.assign.ballots_to_assign), 9, Mq),
19185
19185
  D2(r("input", {
19186
19186
  id: `${a2(t).reference}-ballot-selector`,
19187
- "onUpdate:modelValue": W[3] || (W[3] = (f2) => m.value.multiplier = f2),
19187
+ "onUpdate:modelValue": G[3] || (G[3] = (f2) => m.value.multiplier = f2),
19188
19188
  class: "AVSplitHelper--assign-input",
19189
19189
  type: "number",
19190
19190
  max: C.value
@@ -19203,7 +19203,7 @@ const oq = {
19203
19203
  r("button", {
19204
19204
  key: "ballot",
19205
19205
  class: "AVSplitHelper--btn-secondary",
19206
- onClick: W[4] || (W[4] = (f2) => a("setBallotActiveState", "ballot"))
19206
+ onClick: G[4] || (G[4] = (f2) => a("setBallotActiveState", "ballot"))
19207
19207
  }, V(f.value.assign.back_button), 1)
19208
19208
  ]),
19209
19209
  r("div", bq, [
@@ -19211,12 +19211,12 @@ const oq = {
19211
19211
  key: "confirm",
19212
19212
  class: "AVSplitHelper--btn-primary",
19213
19213
  disabled: m.value.multiplier < 1 || m.value.multiplier > C.value,
19214
- onClick: W[5] || (W[5] = (f2) => S())
19214
+ onClick: G[5] || (G[5] = (f2) => S())
19215
19215
  }, V(f.value.assign.confirm_button), 9, xq)
19216
19216
  ])
19217
19217
  ])
19218
19218
  ])) : p.value === "overview" ? (u(), d("div", yq, [
19219
- h.value === 0 && k.isComplete(a2(s)) ? (u(), d("div", Aq, [
19219
+ h.value === 0 && k.value.isComplete(a2(s)) ? (u(), d("div", Aq, [
19220
19220
  z(H2, {
19221
19221
  icon: "circle-check",
19222
19222
  class: "AVSplitHelper--overview-success-icon"
@@ -19271,7 +19271,7 @@ const oq = {
19271
19271
  };
19272
19272
  }
19273
19273
  });
19274
- const Dq = /* @__PURE__ */ I(Tq, [["__scopeId", "data-v-d7c0ce56"]]);
19274
+ const Dq = /* @__PURE__ */ I(Tq, [["__scopeId", "data-v-90dab04f"]]);
19275
19275
  var Iq = {}, Bq = /* @__PURE__ */ r("a", { href: "#" }, "LOGO", -1), Pq = { class: "flex items-center" }, Oq = { class: "flex flex-col items-center justify-center p-3 w-full" }, jq = /* @__PURE__ */ r("h2", { class: "mb-4" }, "Election Name", -1), Eq = /* @__PURE__ */ r("div", null, [
19276
19276
  /* @__PURE__ */ r("p", null, " Curabitur et augue in nibh mollis faucibus. Mauris semper cursus felis, vitae porta dui faucibus eu. Suspendisse potenti. Ut sit amet arcu non quam eleifend interdum. Sed vitae sagittis nunc. Nullam faucibus mattis mauris sed tincidunt. Nulla convallis lobortis semper. Curabitur varius neque vel sapien mattis mattis. Integer mollis fringilla nibh, facilisis rutrum risus. In volutpat sem in lacus vestibulum, sollicitudin efficitur dui luctus. Donec fringilla diam tortor, posuere lacinia erat consequat ut. Mauris nec nibh tortor. "),
19277
19277
  /* @__PURE__ */ r("br"),