@zealsolutions/zeal-ui 1.0.0-alpha.376 → 1.0.0-alpha.377

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,4 +1,4 @@
1
- import { n as D, c as F } from "../../legacyLinks-B6y5jFPf.js";
1
+ import { n as D, c as F } from "../../legacyLinks-D66HB1LX.js";
2
2
  import { computed as B, openBlock as f, createElementBlock as b, createElementVNode as v, toDisplayString as x, createCommentVNode as S, Fragment as V, renderList as T, normalizeClass as U, createStaticVNode as j } from "vue";
3
3
  import { _ as H } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  const W = (e) => e === ">", A = (e) => e === "<", P = (e) => /^\s+$/.test(e), E = (e) => /^\s*<[^>]+>\s*$/.test(e), $ = (e) => !E(e);
@@ -8,7 +8,7 @@ import { a as _r, _ as jr } from "../../SecondaryButton-At_I-S4K.js";
8
8
  import { _ as Ed } from "../../BaseModal-BriJhnSM.js";
9
9
  import { _ as wi } from "../../FormField-CrpT1GTF.js";
10
10
  import { _ as hs } from "../../InputField-D6bS7qJm.js";
11
- import { b as Lp, c as Pp } from "../../legacyLinks-B6y5jFPf.js";
11
+ import { b as Lp, c as Pp } from "../../legacyLinks-D66HB1LX.js";
12
12
  import qs from "../../ImageIcon-jkYGKPiB.js";
13
13
  import Ca from "../../ListTreeIcon-DMhYL_id.js";
14
14
  import Ks from "../../ListRadioIcon-gmE_fzgA.js";
@@ -1,13 +1,13 @@
1
- const l = {
1
+ const p = {
2
2
  black: [0, 0, 0],
3
3
  white: [255, 255, 255]
4
4
  };
5
- function b(t) {
5
+ function E(t) {
6
6
  if (!t)
7
7
  return null;
8
8
  const r = String(t).trim().toLowerCase();
9
- if (l[r])
10
- return l[r];
9
+ if (p[r])
10
+ return p[r];
11
11
  let e = r.match(/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)(?:\s*[,/]\s*([\d.]+)(%?))?\s*\)$/);
12
12
  if (e)
13
13
  return e[4] !== void 0 && parseFloat(e[4]) === 0 ? null : [Number(e[1]), Number(e[2]), Number(e[3])];
@@ -17,48 +17,48 @@ function b(t) {
17
17
  }
18
18
  return null;
19
19
  }
20
- function A([t, r, e]) {
20
+ function x([t, r, e]) {
21
21
  const o = (n) => {
22
22
  const s = n / 255;
23
23
  return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
24
24
  };
25
25
  return 0.2126 * o(t) + 0.7152 * o(r) + 0.0722 * o(e);
26
26
  }
27
- const E = (t) => Math.max(...t) - Math.min(...t);
28
- function p(t) {
29
- const r = b(t);
30
- return r ? E(r) <= 24 && A(r) < 0.06 || Math.max(...r) <= 40 : !1;
31
- }
27
+ const L = (t) => Math.max(...t) - Math.min(...t);
32
28
  function d(t) {
33
- const r = b(t);
34
- return r ? E(r) <= 24 && A(r) > 0.85 : !1;
29
+ const r = E(t);
30
+ return r ? L(r) <= 24 && x(r) < 0.06 || Math.max(...r) <= 40 : !1;
31
+ }
32
+ function g(t) {
33
+ const r = E(t);
34
+ return r ? L(r) <= 24 && x(r) > 0.85 : !1;
35
35
  }
36
- function C(t) {
36
+ function I(t) {
37
37
  const r = t.style && t.style.backgroundColor;
38
38
  return r && r !== "transparent" && r !== "initial" && r !== "inherit" ? !0 : t.hasAttribute && t.hasAttribute("bgcolor");
39
39
  }
40
- function g(t) {
40
+ function y(t) {
41
41
  t.getAttribute("style") !== null && !t.getAttribute("style").trim() && t.removeAttribute("style");
42
42
  }
43
- function L(t, { backgroundsRendered: r }) {
43
+ function w(t, { backgroundsRendered: r }) {
44
44
  t.querySelectorAll("[style], [bgcolor]").forEach((e) => {
45
- e.style && d(e.style.backgroundColor) && (e.style.removeProperty("background-color"), g(e)), e.hasAttribute("bgcolor") && d(e.getAttribute("bgcolor")) && e.removeAttribute("bgcolor");
45
+ e.style && g(e.style.backgroundColor) && (e.style.removeProperty("background-color"), y(e)), e.hasAttribute("bgcolor") && g(e.getAttribute("bgcolor")) && e.removeAttribute("bgcolor");
46
46
  }), t.querySelectorAll("[style], font[color]").forEach((e) => {
47
47
  if (r) {
48
48
  for (let o = e; o && o !== t; o = o.parentElement)
49
- if (C(o))
49
+ if (I(o))
50
50
  return;
51
51
  }
52
- e.style && p(e.style.color) && (e.style.removeProperty("color"), g(e)), e.tagName === "FONT" && p(e.getAttribute("color")) && e.removeAttribute("color");
52
+ e.style && d(e.style.color) && (e.style.removeProperty("color"), y(e)), e.tagName === "FONT" && d(e.getAttribute("color")) && e.removeAttribute("color");
53
53
  });
54
54
  }
55
- const y = (t) => !t.querySelector("img") && !t.textContent.replace(/[\s ]/g, ""), w = "p, h1, h2, h3, h4, h5, h6";
55
+ const h = (t) => !t.querySelector("img") && !t.textContent.replace(/[\s ]/g, ""), N = "p, h1, h2, h3, h4, h5, h6";
56
56
  function k(t) {
57
57
  const r = t.ownerDocument;
58
- N(t), Array.from(t.querySelectorAll("img")).forEach((e) => {
58
+ O(t), Array.from(t.querySelectorAll("img")).forEach((e) => {
59
59
  const o = e.closest("a[href]");
60
60
  o && t.contains(o) && !e.hasAttribute("image-link") && e.setAttribute("image-link", o.getAttribute("href"));
61
- const n = e.parentElement && e.parentElement.closest(w);
61
+ const n = e.parentElement && e.parentElement.closest(N);
62
62
  if (!n || !t.contains(n))
63
63
  return;
64
64
  const s = (n.style && n.style.textAlign || "").toLowerCase();
@@ -69,24 +69,24 @@ function k(t) {
69
69
  a.appendChild(i.extractContents()), i.setStartAfter(e), i.setEnd(n, n.childNodes.length);
70
70
  const c = n.cloneNode(!1);
71
71
  c.appendChild(i.extractContents());
72
- const f = n.parentNode, x = f.tagName === "LI" && f.firstElementChild === n;
73
- (!y(a) || x) && f.insertBefore(a, n), f.insertBefore(e, n), y(c) || f.insertBefore(c, n), n.remove();
72
+ const f = n.parentNode, C = f.tagName === "LI" && f.firstElementChild === n;
73
+ (!h(a) || C) && f.insertBefore(a, n), f.insertBefore(e, n), h(c) || f.insertBefore(c, n), n.remove();
74
74
  });
75
75
  }
76
- const h = /* @__PURE__ */ new Set(["P", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "DIV", "TABLE", "FIGURE", "BLOCKQUOTE", "PRE", "HR"]);
77
- function N(t) {
76
+ const m = /* @__PURE__ */ new Set(["P", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "DIV", "TABLE", "FIGURE", "BLOCKQUOTE", "PRE", "HR"]);
77
+ function O(t) {
78
78
  const r = t.ownerDocument;
79
79
  t.querySelectorAll("li").forEach((e) => {
80
80
  if (!Array.from(e.querySelectorAll("img")).some((s) => {
81
81
  for (let i = s.parentElement; i && i !== e; i = i.parentElement)
82
- if (h.has(i.tagName) || i.tagName === "LI")
82
+ if (m.has(i.tagName) || i.tagName === "LI")
83
83
  return !1;
84
84
  return !0;
85
85
  }))
86
86
  return;
87
87
  let n = null;
88
88
  Array.from(e.childNodes).forEach((s) => {
89
- if (s.nodeType === 1 && h.has(s.tagName)) {
89
+ if (s.nodeType === 1 && m.has(s.tagName)) {
90
90
  n = null;
91
91
  return;
92
92
  }
@@ -94,7 +94,7 @@ function N(t) {
94
94
  });
95
95
  });
96
96
  }
97
- function I(t) {
97
+ function H(t) {
98
98
  const r = t.ownerDocument;
99
99
  t.querySelectorAll("h3, h4, h5, h6").forEach((e) => {
100
100
  const o = r.createElement("p");
@@ -112,39 +112,43 @@ function S(t, r) {
112
112
  const e = new DOMParser().parseFromString(`<body>${t}</body>`, "text/html").body;
113
113
  return r(e), e.innerHTML;
114
114
  }
115
- function B(t) {
116
- return typeof t != "string" || !/color/i.test(t) ? t : S(t, (r) => L(r, { backgroundsRendered: !0 }));
115
+ function q(t) {
116
+ return typeof t != "string" || !/color/i.test(t) ? t : S(t, (r) => w(r, { backgroundsRendered: !0 }));
117
117
  }
118
- function P(t) {
118
+ function F(t) {
119
119
  return typeof t != "string" || !/<(img|h[3-6])\b|color/i.test(t) ? t : S(t, (r) => {
120
- k(r), I(r), L(r, { backgroundsRendered: !1 });
120
+ k(r), H(r), w(r, { backgroundsRendered: !1 });
121
121
  });
122
122
  }
123
- const u = "/sop-front/Vue/dist/sop/by-id/", m = "/EDS/Vue/dist/eds/", O = {
124
- "/eds/eds-item.aspx": ["id", (t) => m + t],
125
- "/sop/eds-item.aspx": ["id", (t) => m + t],
126
- "/sop/overview.aspx": ["sopid", (t) => u + t],
127
- // The activity / category the old page focused on has no SPA deep link yet.
128
- "/sop/overview-full.aspx": ["sopid", (t) => u + t],
129
- "/sop/overview-category.aspx": ["sopid", (t) => u + t],
130
- // The SPA's appendix route is keyed by category/SOP slugs, not ids: open the SOP's list.
131
- "/sop/appendix.aspx": ["sopid", (t) => u + t + "/list"],
132
- "/sop/grp.aspx": ["sopid", (t) => u + t + "/grp"],
133
- "/sop/grp-check.aspx": ["sopid", (t) => u + t + "/grp"]
134
- }, H = /(^|\.)pro-clus\.co\.uk$/i;
135
- function M(t) {
123
+ const b = "/sop-front/Vue/dist/sop/by-id/", M = "/EDS/Vue/dist/eds/", l = (t) => t != null && /^\d+$/.test(t), u = (t, r, e) => (o) => {
124
+ const n = o("sopid");
125
+ if (!l(n))
126
+ return null;
127
+ const s = r && o(r);
128
+ return l(s) ? `${b}${n}/${t}/${s}` : b + n + (e ? "/" + e : "");
129
+ }, A = (t) => l(t("id")) ? M + t("id") : null, T = {
130
+ "/eds/eds-item.aspx": A,
131
+ "/sop/eds-item.aspx": A,
132
+ "/sop/overview.aspx": u(),
133
+ "/sop/overview-full.aspx": u("overview", "sopactivityid"),
134
+ "/sop/overview-category.aspx": u("overview", "sopactivityid"),
135
+ "/sop/appendix.aspx": u("appendix", "sopappendixid", "list"),
136
+ "/sop/grp.aspx": u("grp", "sopgrpid", "grp"),
137
+ "/sop/grp-check.aspx": u("grp", "sopgrpid", "grp")
138
+ }, D = /(^|\.)pro-clus\.co\.uk$/i;
139
+ function P(t) {
136
140
  const r = (t || []).map((e) => e.toLowerCase());
137
141
  return typeof location < "u" && location.host && r.push(location.host.toLowerCase()), r;
138
142
  }
139
- function T(t, r) {
143
+ function R(t, r) {
140
144
  const e = t.match(/^(?:https?:)?\/\/([^/?#]+)(.*)$/i);
141
145
  if (e) {
142
146
  const o = e[1].toLowerCase();
143
- return !H.test(o) && !r.includes(o) ? null : e[2].startsWith("/") ? e[2] : "/" + e[2];
147
+ return !D.test(o) && !r.includes(o) ? null : e[2].startsWith("/") ? e[2] : "/" + e[2];
144
148
  }
145
149
  return /^(\.\.\/)+/.test(t) ? "/" + t.replace(/^(\.\.\/)+/, "") : t.startsWith("/") ? t : null;
146
150
  }
147
- function D(t, r) {
151
+ function v(t, r) {
148
152
  for (const e of t.split(/&(?:amp;)?/)) {
149
153
  const o = e.indexOf("=");
150
154
  if (o > 0 && e.slice(0, o).toLowerCase() === r)
@@ -152,39 +156,39 @@ function D(t, r) {
152
156
  }
153
157
  return null;
154
158
  }
155
- function R(t, { hosts: r } = {}) {
159
+ function B(t, { hosts: r } = {}) {
156
160
  if (typeof t != "string" || !t)
157
161
  return t;
158
- const e = T(t.trim(), M(r));
162
+ const e = R(t.trim(), P(r));
159
163
  if (e === null)
160
164
  return t;
161
- const o = e.search(/[?#]/), n = o < 0 ? e : e.slice(0, o), s = O[n.toLowerCase()];
165
+ const o = e.search(/[?#]/), n = o < 0 ? e : e.slice(0, o), s = T[n.toLowerCase()];
162
166
  if (s) {
163
- const i = e.includes("?") ? e.slice(e.indexOf("?") + 1).split("#")[0] : "", a = D(i, s[0]);
164
- if (a && /^\d+$/.test(a))
165
- return s[1](a);
167
+ const i = e.includes("?") ? e.slice(e.indexOf("?") + 1).split("#")[0] : "", a = s((c) => v(i, c));
168
+ if (a)
169
+ return a;
166
170
  }
167
171
  return e;
168
172
  }
169
- const q = [["a[href]", "href"], ["img[src]", "src"], ["img[image-link]", "image-link"]];
170
- function F(t, r) {
173
+ const $ = [["a[href]", "href"], ["img[src]", "src"], ["img[image-link]", "image-link"]];
174
+ function _(t, r) {
171
175
  if (typeof t != "string" || !t || typeof DOMParser > "u" || !/\.\.\/|\.aspx|\/\//i.test(t))
172
176
  return t;
173
177
  const e = new DOMParser().parseFromString(`<body>${t}</body>`, "text/html").body;
174
178
  let o = !1;
175
- for (const [n, s] of q)
179
+ for (const [n, s] of $)
176
180
  e.querySelectorAll(n).forEach((i) => {
177
- const a = i.getAttribute(s), c = R(a, r);
181
+ const a = i.getAttribute(s), c = B(a, r);
178
182
  c !== a && (i.setAttribute(s, c), o = !0);
179
183
  });
180
184
  return o ? e.innerHTML : t;
181
185
  }
182
186
  export {
183
- d as a,
184
- P as b,
185
- F as c,
186
- p as i,
187
- B as n,
188
- b as p,
189
- R as r
187
+ g as a,
188
+ F as b,
189
+ _ as c,
190
+ d as i,
191
+ q as n,
192
+ E as p,
193
+ B as r
190
194
  };
@@ -1,5 +1,5 @@
1
1
  import { g as C, a as D, i as L } from "../axiosHelpers-BGXP7XLq.js";
2
- import { i as k, a as x, b as I, n as M, p as T, c as _, r as b } from "../legacyLinks-B6y5jFPf.js";
2
+ import { i as k, a as x, b as I, n as M, p as T, c as _, r as b } from "../legacyLinks-D66HB1LX.js";
3
3
  const l = 16, p = 12, u = 344, m = 180;
4
4
  function f(o, t, e = {}) {
5
5
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zealsolutions/zeal-ui",
3
- "version": "1.0.0-alpha.376",
3
+ "version": "1.0.0-alpha.377",
4
4
  "description": "UI library for Zeal Solutions",
5
5
  "author": "Zeal Solutions",
6
6
  "license": "ISC",