@stsdti/approvable-vue 0.1.11 → 0.1.12

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,8 +1,8 @@
1
- import { inject as ee, ref as O, computed as _, watch as Y, openBlock as a, createElementBlock as s, normalizeClass as V, createElementVNode as t, toDisplayString as d, unref as w, createCommentVNode as S, createTextVNode as z, Fragment as L, renderList as N, createBlock as B, resolveDynamicComponent as J, useTemplateRef as ie, onMounted as de, onBeforeUnmount as we, withDirectives as Ce, vModelText as Re, nextTick as xe, markRaw as Le, mergeProps as te, withCtx as X, createVNode as F, renderSlot as U, createSlots as pe, normalizeProps as Ee, guardReactiveProps as De, normalizeStyle as Q, Teleport as Oe, withModifiers as Me, withKeys as Ie, useModel as Ne, mergeModels as ue } from "vue";
2
- import { mergeMessages as Te, ApprovableAuditRepository as Ve, formatMessage as K, isRegisteredIcon as je, isUrlIcon as Be, isClassIcon as Pe, get as T, notifyError as ve, ApprovableStepRepository as ce, isSuccessResponse as be, notifySuccess as me, registerActionRenderer as qe, createStepViewModel as fe, actionRenderer as Ke, performStepAction as Ue, ApprovableStatus as q, createApprovableViewModel as he, createCompactViewModel as Fe, approvableStatusTone as Ge, approvableStepGlyph as ze, createStepWindow as He, ApprovableStatusRepository as We } from "@stsdti/approvable-core";
3
- import { ApprovableClient as Ta, actionRenderer as Va, actionSlotName as ja, axiosAdapter as Ba, configureApprovableClient as Pa, fetchAdapter as qa, getApprovableClient as Ka, isClassIcon as Ua, isRegisteredIcon as Fa, isUrlIcon as Ga, setApprovableClient as za, unregisterActionRenderer as Ha } from "@stsdti/approvable-core";
1
+ import { inject as ee, ref as O, computed as _, watch as Y, openBlock as t, createElementBlock as a, normalizeClass as j, createElementVNode as e, toDisplayString as c, unref as w, createCommentVNode as S, createTextVNode as z, Fragment as L, renderList as T, createBlock as P, resolveDynamicComponent as J, useTemplateRef as ie, onMounted as de, onBeforeUnmount as we, withDirectives as Ce, vModelText as Re, nextTick as xe, markRaw as Ee, mergeProps as te, withCtx as X, createVNode as U, renderSlot as H, createSlots as pe, normalizeProps as Le, guardReactiveProps as De, normalizeStyle as Q, Teleport as Oe, withModifiers as Me, withKeys as Ie, useModel as Ne, mergeModels as ue } from "vue";
2
+ import { mergeMessages as Te, ApprovableAuditRepository as Ve, formatMessage as G, isRegisteredIcon as je, isUrlIcon as Be, isClassIcon as Pe, get as V, notifyError as ve, ApprovableStepRepository as ce, isSuccessResponse as me, notifySuccess as be, registerActionRenderer as qe, createStepViewModel as fe, actionRenderer as Ke, performStepAction as He, ApprovableStatus as K, createApprovableViewModel as he, createCompactViewModel as Ue, approvableStatusTone as Fe, approvableStepGlyph as Ge, createStepWindow as ze, ApprovableStatusRepository as We } from "@stsdti/approvable-core";
3
+ import { ApprovableClient as Na, actionRenderer as Ta, actionSlotName as Va, axiosAdapter as ja, configureApprovableClient as Ba, fetchAdapter as Pa, getApprovableClient as qa, isClassIcon as Ka, isRegisteredIcon as Ha, isUrlIcon as Ua, setApprovableClient as Fa, unregisterActionRenderer as Ga } from "@stsdti/approvable-core";
4
4
  const ye = Symbol("approvable.messages");
5
- function G() {
5
+ function F() {
6
6
  return Te(ee(ye, null));
7
7
  }
8
8
  const Qe = {
@@ -24,7 +24,7 @@ const Qe = {
24
24
  }, vt = {
25
25
  key: 1,
26
26
  class: "approvable-timeline-change"
27
- }, dt = { class: "approvable-timeline-change-label" }, ct = { class: "approvable-timeline-value approvable-timeline-value--old" }, bt = { class: "approvable-timeline-value approvable-timeline-value--new" }, mt = { class: "approvable-timeline-footer" }, ke = {
27
+ }, dt = { class: "approvable-timeline-change-label" }, ct = { class: "approvable-timeline-value approvable-timeline-value--old" }, mt = { class: "approvable-timeline-value approvable-timeline-value--new" }, bt = { class: "approvable-timeline-footer" }, ke = {
28
28
  __name: "ApprovableAuditTimeline",
29
29
  props: {
30
30
  approvableId: { type: [Number, String], required: !0 },
@@ -32,13 +32,13 @@ const Qe = {
32
32
  showHeader: { type: Boolean, default: !0 }
33
33
  },
34
34
  emits: ["loaded"],
35
- setup(l, { expose: y, emit: v }) {
36
- const f = l, h = v, b = G(), n = new Ve(), g = O([]), A = O(!1), C = O(""), u = {
35
+ setup(l, { expose: y, emit: u }) {
36
+ const f = l, h = u, m = F(), n = new Ve(), g = O([]), $ = O(!1), C = O(""), v = {
37
37
  approvable_status_name: "Status",
38
38
  comment: "Comment",
39
39
  responsible: "Assigned to",
40
40
  is_active: "Active step"
41
- }, m = {
41
+ }, b = {
42
42
  approve: { paths: ["M4 8.4l2.8 2.8 5.4-6"], width: 2.8 },
43
43
  reject: { paths: ["M5.2 5.2l5.6 5.6M10.8 5.2l-5.6 5.6"], width: 2.4 },
44
44
  comment: { paths: ["M8 4.6v3.6l2.6 1.6"], width: 2.2 },
@@ -47,170 +47,170 @@ const Qe = {
47
47
  signal: { paths: ["M8 3.4v3.2M5.2 5.2l2.2 2.2M8 11.6a1.4 1.4 0 1 0 0-2.8 1.4 1.4 0 0 0 0 2.8"], width: 1.8 },
48
48
  created: { paths: ["M4.4 8h7.2"], width: 2.2 },
49
49
  update: { paths: ["M4.4 8h7.2"], width: 2.2 }
50
- }, o = /* @__PURE__ */ new Set(["created", "update"]), k = _(() => {
51
- const e = g.value.filter((p) => p.approvable_step_id), i = /* @__PURE__ */ new Map();
52
- for (const p of e) {
53
- const c = p.request_id || `audit-${p.id}`;
54
- i.has(c) || i.set(c, []), i.get(c).push(p);
50
+ }, s = /* @__PURE__ */ new Set(["created", "update"]), k = _(() => {
51
+ const o = g.value.filter((i) => i.approvable_step_id), p = /* @__PURE__ */ new Map();
52
+ for (const i of o) {
53
+ const d = i.request_id || `audit-${i.id}`;
54
+ p.has(d) || p.set(d, []), p.get(d).push(i);
55
55
  }
56
- return [...i.values()].map((p) => {
57
- const c = p[0], x = $(c), W = p.flatMap(R);
56
+ return [...p.values()].map((i) => {
57
+ const d = i[0], E = A(d), W = i.flatMap(x);
58
58
  return {
59
- id: c.request_id || `audit-${c.id}`,
60
- entries: p,
61
- audit: c,
62
- kind: x,
59
+ id: d.request_id || `audit-${d.id}`,
60
+ entries: i,
61
+ audit: d,
62
+ kind: E,
63
63
  // A modifier class rather than utilities: the accent for each kind of
64
64
  // event is a theme decision, so it belongs in the stylesheets alongside
65
65
  // every other colour, not baked into the component.
66
- kindClass: `approvable-timeline-marker--${x}`,
67
- icon: m[x],
68
- isQuiet: o.has(x),
66
+ kindClass: `approvable-timeline-marker--${E}`,
67
+ icon: b[E],
68
+ isQuiet: s.has(E),
69
69
  isSingleLine: W.length === 0
70
70
  };
71
- }).sort((p, c) => new Date(c.audit.created_at) - new Date(p.audit.created_at));
71
+ }).sort((i, d) => new Date(d.audit.created_at) - new Date(i.audit.created_at));
72
72
  });
73
- function $(e) {
74
- var p, c, x;
75
- const i = (p = e.metadata) == null ? void 0 : p.button;
76
- return i != null && i.is_undo ? "undo" : (i == null ? void 0 : i.result) === "rejected" ? "reject" : (i == null ? void 0 : i.result) === "approved" ? "approve" : ((c = e.metadata) == null ? void 0 : c.operation) === "comment" ? "comment" : ((x = e.metadata) == null ? void 0 : x.operation) === "signal" ? "signal" : e.event === "created" ? "created" : I(e) ? "status" : "update";
73
+ function A(o) {
74
+ var i, d, E;
75
+ const p = (i = o.metadata) == null ? void 0 : i.button;
76
+ return p != null && p.is_undo ? "undo" : (p == null ? void 0 : p.result) === "rejected" ? "reject" : (p == null ? void 0 : p.result) === "approved" ? "approve" : ((d = o.metadata) == null ? void 0 : d.operation) === "comment" ? "comment" : ((E = o.metadata) == null ? void 0 : E.operation) === "signal" ? "signal" : o.event === "created" ? "created" : N(o) ? "status" : "update";
77
77
  }
78
- function I(e) {
79
- var c, x;
80
- const i = (c = e.old_values) == null ? void 0 : c.approvable_status_name, p = (x = e.new_values) == null ? void 0 : x.approvable_status_name;
81
- return p !== void 0 && i !== p;
78
+ function N(o) {
79
+ var d, E;
80
+ const p = (d = o.old_values) == null ? void 0 : d.approvable_status_name, i = (E = o.new_values) == null ? void 0 : E.approvable_status_name;
81
+ return i !== void 0 && p !== i;
82
82
  }
83
- function M(e) {
84
- var c, x, W, oe, le, ne;
85
- const i = (c = e.metadata) == null ? void 0 : c.button;
86
- if (i) {
87
- const re = i.text || i.label || i.id || "action";
88
- return i.is_undo ? "Reverted the decision" : i.is_revision ? `Changed decision to ${re}` : re;
83
+ function I(o) {
84
+ var d, E, W, oe, le, ne;
85
+ const p = (d = o.metadata) == null ? void 0 : d.button;
86
+ if (p) {
87
+ const re = p.text || p.label || p.id || "action";
88
+ return p.is_undo ? "Reverted the decision" : p.is_revision ? `Changed decision to ${re}` : re;
89
89
  }
90
- if (((x = e.metadata) == null ? void 0 : x.operation) === "comment") return "Comment added";
91
- if (((W = e.metadata) == null ? void 0 : W.operation) === "signal") return `Signal received: ${((le = (oe = e.metadata) == null ? void 0 : oe.signal) == null ? void 0 : le.name) || ""}`.trim();
92
- if (e.event === "created") return "Step started";
93
- const p = (ne = e.new_values) == null ? void 0 : ne.approvable_status_name;
94
- return I(e) && p ? `Status set to ${p}` : "Step updated";
90
+ if (((E = o.metadata) == null ? void 0 : E.operation) === "comment") return "Comment added";
91
+ if (((W = o.metadata) == null ? void 0 : W.operation) === "signal") return `Signal received: ${((le = (oe = o.metadata) == null ? void 0 : oe.signal) == null ? void 0 : le.name) || ""}`.trim();
92
+ if (o.event === "created") return "Step started";
93
+ const i = (ne = o.new_values) == null ? void 0 : ne.approvable_status_name;
94
+ return N(o) && i ? `Status set to ${i}` : "Step updated";
95
95
  }
96
- function j(e = {}) {
97
- return e.type === "system" ? "System" : e.name ? e.name : e.email ? e.email : e.id ? e.type === "fake" ? `Test user ${e.id}` : `User ${e.id}` : e.type === "fake" ? "Test identity" : "Automated";
96
+ function B(o = {}) {
97
+ return o.type === "system" ? "System" : o.name ? o.name : o.email ? o.email : o.id ? o.type === "fake" ? `Test user ${o.id}` : `User ${o.id}` : o.type === "fake" ? "Test identity" : "Automated";
98
98
  }
99
- function R(e) {
100
- const i = e.old_values || {}, p = e.new_values || {};
101
- return Object.keys(u).filter((c) => c in i || c in p).map((c) => ({ key: c, label: u[c], oldValue: i[c], newValue: p[c] })).filter((c) => c.oldValue !== c.newValue);
99
+ function x(o) {
100
+ const p = o.old_values || {}, i = o.new_values || {};
101
+ return Object.keys(v).filter((d) => d in p || d in i).map((d) => ({ key: d, label: v[d], oldValue: p[d], newValue: i[d] })).filter((d) => d.oldValue !== d.newValue);
102
102
  }
103
- function D(e) {
104
- return e.oldValue !== void 0 && e.oldValue !== null && e.oldValue !== "";
103
+ function D(o) {
104
+ return o.oldValue !== void 0 && o.oldValue !== null && o.oldValue !== "";
105
105
  }
106
- function P(e) {
107
- if (e == null || e === "") return "—";
108
- if (typeof e == "boolean") return e ? "Yes" : "No";
109
- if (Array.isArray(e)) return e.length ? e.join(", ") : "—";
110
- const i = typeof e == "object" ? JSON.stringify(e) : String(e);
111
- return i.length > 180 ? `${i.slice(0, 177)}…` : i;
106
+ function q(o) {
107
+ if (o == null || o === "") return "—";
108
+ if (typeof o == "boolean") return o ? "Yes" : "No";
109
+ if (Array.isArray(o)) return o.length ? o.join(", ") : "—";
110
+ const p = typeof o == "object" ? JSON.stringify(o) : String(o);
111
+ return p.length > 180 ? `${p.slice(0, 177)}…` : p;
112
112
  }
113
- function H(e) {
114
- if (!e) return "";
115
- const i = new Date(e);
116
- return Number.isNaN(i.getTime()) ? e : new Intl.DateTimeFormat(void 0, {
113
+ function M(o) {
114
+ if (!o) return "";
115
+ const p = new Date(o);
116
+ return Number.isNaN(p.getTime()) ? o : new Intl.DateTimeFormat(void 0, {
117
117
  dateStyle: "medium",
118
118
  timeStyle: "short"
119
- }).format(i);
119
+ }).format(p);
120
120
  }
121
- async function E() {
122
- var e, i;
121
+ async function r() {
122
+ var o, p;
123
123
  if (!f.approvableId) {
124
- g.value = [], A.value = !1, C.value = "The approval history is unavailable because the approvable has no id.";
124
+ g.value = [], $.value = !1, C.value = "The approval history is unavailable because the approvable has no id.";
125
125
  return;
126
126
  }
127
- A.value = !0, C.value = "";
127
+ $.value = !0, C.value = "";
128
128
  try {
129
- const p = await n.fetchTimeline(f.approvableId, f.limit);
130
- if (!p || p.status < 200 || p.status >= 300)
131
- throw new Error(((e = p == null ? void 0 : p.data) == null ? void 0 : e.message) || "The audit timeline could not be loaded.");
132
- const c = Array.isArray(p.data) ? p.data : (i = p.data) == null ? void 0 : i.data;
133
- g.value = Array.isArray(c) ? c : [];
134
- } catch (p) {
135
- C.value = (p == null ? void 0 : p.message) || "The audit timeline could not be loaded.";
129
+ const i = await n.fetchTimeline(f.approvableId, f.limit);
130
+ if (!i || i.status < 200 || i.status >= 300)
131
+ throw new Error(((o = i == null ? void 0 : i.data) == null ? void 0 : o.message) || "The audit timeline could not be loaded.");
132
+ const d = Array.isArray(i.data) ? i.data : (p = i.data) == null ? void 0 : p.data;
133
+ g.value = Array.isArray(d) ? d : [];
134
+ } catch (i) {
135
+ C.value = (i == null ? void 0 : i.message) || "The audit timeline could not be loaded.";
136
136
  } finally {
137
- A.value = !1;
137
+ $.value = !1;
138
138
  }
139
139
  }
140
- const r = _(() => K(b.eventCount, { count: k.value.length }));
141
- return Y(k, (e) => h("loaded", e.length)), Y(() => f.approvableId, E, { immediate: !0 }), y({ refresh: E }), (e, i) => (a(), s("section", {
142
- class: V(["approvable-timeline", l.showHeader && "approvable-timeline--panel"])
140
+ const R = _(() => G(m.eventCount, { count: k.value.length }));
141
+ return Y(k, (o) => h("loaded", o.length)), Y(() => f.approvableId, r, { immediate: !0 }), y({ refresh: r }), (o, p) => (t(), a("section", {
142
+ class: j(["approvable-timeline", l.showHeader && "approvable-timeline--panel"])
143
143
  }, [
144
- l.showHeader ? (a(), s("div", Qe, [
145
- t("p", Ye, d(w(b).history), 1),
146
- t("h3", Je, d(r.value), 1),
147
- t("button", {
144
+ l.showHeader ? (t(), a("div", Qe, [
145
+ e("p", Ye, c(w(m).history), 1),
146
+ e("h3", Je, c(R.value), 1),
147
+ e("button", {
148
148
  type: "button",
149
149
  class: "approvable-timeline-refresh",
150
- disabled: A.value,
151
- onClick: E
152
- }, d(A.value ? "Loading…" : "Refresh"), 9, Xe)
150
+ disabled: $.value,
151
+ onClick: r
152
+ }, c($.value ? "Loading…" : "Refresh"), 9, Xe)
153
153
  ])) : S("", !0),
154
- A.value ? (a(), s("div", Ze, [...i[0] || (i[0] = [
155
- t("span", {
154
+ $.value ? (t(), a("div", Ze, [...p[0] || (p[0] = [
155
+ e("span", {
156
156
  class: "approvable-spinner",
157
157
  "aria-hidden": "true"
158
158
  }, null, -1),
159
159
  z(" Loading approval history… ", -1)
160
- ])])) : C.value ? (a(), s("p", et, d(C.value), 1)) : k.value.length ? (a(), s(L, { key: 4 }, [
161
- t("ol", at, [
162
- (a(!0), s(L, null, N(k.value, (p) => (a(), s("li", {
163
- key: p.id,
164
- class: V(["approvable-timeline-item", {
165
- "approvable-timeline-item--single-line": p.isSingleLine,
166
- "approvable-timeline-item--quiet": p.isQuiet
160
+ ])])) : C.value ? (t(), a("p", et, c(C.value), 1)) : k.value.length ? (t(), a(L, { key: 4 }, [
161
+ e("ol", at, [
162
+ (t(!0), a(L, null, T(k.value, (i) => (t(), a("li", {
163
+ key: i.id,
164
+ class: j(["approvable-timeline-item", {
165
+ "approvable-timeline-item--single-line": i.isSingleLine,
166
+ "approvable-timeline-item--quiet": i.isQuiet
167
167
  }])
168
168
  }, [
169
- t("span", {
170
- class: V(["approvable-timeline-marker", p.kindClass])
169
+ e("span", {
170
+ class: j(["approvable-timeline-marker", i.kindClass])
171
171
  }, [
172
- (a(), s("svg", {
172
+ (t(), a("svg", {
173
173
  fill: "none",
174
174
  stroke: "currentColor",
175
- "stroke-width": p.icon.width,
175
+ "stroke-width": i.icon.width,
176
176
  "stroke-linecap": "round",
177
177
  "stroke-linejoin": "round",
178
178
  viewBox: "0 0 16 16",
179
179
  "aria-hidden": "true"
180
180
  }, [
181
- (a(!0), s(L, null, N(p.icon.paths, (c, x) => (a(), s("path", {
182
- key: x,
183
- d: c
181
+ (t(!0), a(L, null, T(i.icon.paths, (d, E) => (t(), a("path", {
182
+ key: E,
183
+ d
184
184
  }, null, 8, ot))), 128))
185
185
  ], 8, st))
186
186
  ], 2),
187
- t("div", lt, [
188
- t("div", nt, [
189
- t("p", rt, d(j(p.audit.actor)), 1),
190
- t("p", it, d(M(p.audit)), 1),
191
- t("time", pt, d(H(p.audit.created_at)), 1)
187
+ e("div", lt, [
188
+ e("div", nt, [
189
+ e("p", rt, c(B(i.audit.actor)), 1),
190
+ e("p", it, c(I(i.audit)), 1),
191
+ e("time", pt, c(M(i.audit.created_at)), 1)
192
192
  ]),
193
- (a(!0), s(L, null, N(p.entries, (c) => (a(), s(L, {
194
- key: c.id
193
+ (t(!0), a(L, null, T(i.entries, (d) => (t(), a(L, {
194
+ key: d.id
195
195
  }, [
196
- (a(!0), s(L, null, N(R(c), (x) => (a(), s(L, {
197
- key: `${c.id}-${x.key}`
196
+ (t(!0), a(L, null, T(x(d), (E) => (t(), a(L, {
197
+ key: `${d.id}-${E.key}`
198
198
  }, [
199
- x.key === "comment" ? (a(), s("p", ut, d(P(x.newValue)), 1)) : (a(), s("p", vt, [
200
- t("span", dt, d(x.label), 1),
201
- D(x) ? (a(), s(L, { key: 0 }, [
202
- t("span", ct, d(P(x.oldValue)), 1),
203
- i[1] || (i[1] = t("span", { class: "approvable-timeline-arrow" }, "→", -1))
199
+ E.key === "comment" ? (t(), a("p", ut, c(q(E.newValue)), 1)) : (t(), a("p", vt, [
200
+ e("span", dt, c(E.label), 1),
201
+ D(E) ? (t(), a(L, { key: 0 }, [
202
+ e("span", ct, c(q(E.oldValue)), 1),
203
+ p[1] || (p[1] = e("span", { class: "approvable-timeline-arrow" }, "→", -1))
204
204
  ], 64)) : S("", !0),
205
- t("span", bt, d(P(x.newValue)), 1)
205
+ e("span", mt, c(q(E.newValue)), 1)
206
206
  ]))
207
207
  ], 64))), 128))
208
208
  ], 64))), 128))
209
209
  ])
210
210
  ], 2))), 128))
211
211
  ]),
212
- t("p", mt, d(w(b).allEventsShown), 1)
213
- ], 64)) : (a(), s("p", tt, "No approval activity yet."))
212
+ e("p", bt, c(w(m).allEventsShown), 1)
213
+ ], 64)) : (t(), a("p", tt, "No approval activity yet."))
214
214
  ], 2));
215
215
  }
216
216
  }, ge = Symbol("approvable.iconRegistry");
@@ -227,17 +227,17 @@ const ht = ["src"], Z = {
227
227
  },
228
228
  setup(l) {
229
229
  const y = ft();
230
- return (v, f) => w(je)(w(y), l.icon) ? (a(), B(J(w(y)[l.icon]), {
230
+ return (u, f) => w(je)(w(y), l.icon) ? (t(), P(J(w(y)[l.icon]), {
231
231
  key: 0,
232
232
  class: "approvable-btn-icon"
233
- })) : w(Be)(l.icon) ? (a(), s("img", {
233
+ })) : w(Be)(l.icon) ? (t(), a("img", {
234
234
  key: 1,
235
235
  src: l.icon,
236
236
  alt: "",
237
237
  class: "approvable-btn-icon"
238
- }, null, 8, ht)) : w(Pe)(l.icon) ? (a(), s("i", {
238
+ }, null, 8, ht)) : w(Pe)(l.icon) ? (t(), a("i", {
239
239
  key: 2,
240
- class: V(l.icon)
240
+ class: j(l.icon)
241
241
  }, null, 2)) : S("", !0);
242
242
  }
243
243
  }, yt = ["title"], kt = {
@@ -262,55 +262,55 @@ const ht = ["src"], Z = {
262
262
  },
263
263
  emits: ["isLoading", "refresh"],
264
264
  setup(l, { emit: y }) {
265
- const v = l, f = y, h = ie("rootRef"), b = ie("textareaRef"), n = O(!1), g = O(!1), A = O(null), C = _(() => T(v.approvableStep, "commented_by"));
266
- function u() {
267
- n.value ? o() : m();
265
+ const u = l, f = y, h = ie("rootRef"), m = ie("textareaRef"), n = O(!1), g = O(!1), $ = O(null), C = _(() => V(u.approvableStep, "commented_by"));
266
+ function v() {
267
+ n.value ? s() : b();
268
268
  }
269
- function m() {
270
- A.value = T(v.approvableStep, "comment"), n.value = !0, xe(k);
269
+ function b() {
270
+ $.value = V(u.approvableStep, "comment"), n.value = !0, xe(k);
271
271
  }
272
- function o() {
272
+ function s() {
273
273
  n.value = !1;
274
274
  }
275
275
  function k() {
276
- const R = b.value;
277
- R && (R.style.height = "auto", R.style.height = `${R.scrollHeight}px`);
276
+ const x = m.value;
277
+ x && (x.style.height = "auto", x.style.height = `${x.scrollHeight}px`);
278
278
  }
279
- function $(R) {
280
- n.value && h.value && !h.value.contains(R.target) && o();
279
+ function A(x) {
280
+ n.value && h.value && !h.value.contains(x.target) && s();
281
281
  }
282
- function I(R) {
283
- R.key === "Escape" && o();
282
+ function N(x) {
283
+ x.key === "Escape" && s();
284
284
  }
285
285
  de(() => {
286
- document.addEventListener("click", $), document.addEventListener("keydown", I);
286
+ document.addEventListener("click", A), document.addEventListener("keydown", N);
287
287
  }), we(() => {
288
- document.removeEventListener("click", $), document.removeEventListener("keydown", I);
288
+ document.removeEventListener("click", A), document.removeEventListener("keydown", N);
289
289
  });
290
- const M = G();
291
- async function j() {
292
- if (!T(v.approvableStep, "comment") && !A.value) {
293
- ve(M.commentRequired);
290
+ const I = F();
291
+ async function B() {
292
+ if (!V(u.approvableStep, "comment") && !$.value) {
293
+ ve(I.commentRequired);
294
294
  return;
295
295
  }
296
296
  g.value = !0, f("isLoading", !0);
297
- const R = {
298
- comment: A.value
299
- }, D = await new ce().comment(v.approvableStep.id, R);
300
- be(D) ? (me(M.commentSaved), o(), f("refresh")) : ve(M.commentFailed), g.value = !1, f("isLoading", !1);
297
+ const x = {
298
+ comment: $.value
299
+ }, D = await new ce().comment(u.approvableStep.id, x);
300
+ me(D) ? (be(I.commentSaved), s(), f("refresh")) : ve(I.commentFailed), g.value = !1, f("isLoading", !1);
301
301
  }
302
- return (R, D) => (a(), s("div", {
302
+ return (x, D) => (t(), a("div", {
303
303
  ref_key: "rootRef",
304
304
  ref: h,
305
305
  class: "approvable-popover"
306
306
  }, [
307
- t("button", {
307
+ e("button", {
308
308
  class: "approvable-btn",
309
- title: w(M).comments,
309
+ title: w(I).comments,
310
310
  type: "button",
311
- onClick: u
311
+ onClick: v
312
312
  }, [...D[1] || (D[1] = [
313
- t("svg", {
313
+ e("svg", {
314
314
  xmlns: "http://www.w3.org/2000/svg",
315
315
  width: "16",
316
316
  height: "16",
@@ -322,45 +322,45 @@ const ht = ["src"], Z = {
322
322
  "stroke-linejoin": "round",
323
323
  "aria-hidden": "true"
324
324
  }, [
325
- t("path", { d: "M8 9h8" }),
326
- t("path", { d: "M8 13h6" }),
327
- t("path", { d: "M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z" })
325
+ e("path", { d: "M8 9h8" }),
326
+ e("path", { d: "M8 13h6" }),
327
+ e("path", { d: "M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z" })
328
328
  ], -1)
329
329
  ])], 8, yt),
330
- n.value ? (a(), s("div", kt, [
331
- g.value ? (a(), s("div", gt, [...D[2] || (D[2] = [
332
- t("span", { class: "approvable-spinner" }, null, -1)
330
+ n.value ? (t(), a("div", kt, [
331
+ g.value ? (t(), a("div", gt, [...D[2] || (D[2] = [
332
+ e("span", { class: "approvable-spinner" }, null, -1)
333
333
  ])])) : S("", !0),
334
- t("div", _t, d(w(M).comments), 1),
335
- C.value ? (a(), s("div", St, [
336
- t("div", null, d(w(M).commentAuthor) + ":", 1),
337
- t("div", $t, d(C.value), 1)
334
+ e("div", _t, c(w(I).comments), 1),
335
+ C.value ? (t(), a("div", St, [
336
+ e("div", null, c(w(I).commentAuthor) + ":", 1),
337
+ e("div", $t, c(C.value), 1)
338
338
  ])) : S("", !0),
339
- l.disabled ? S("", !0) : (a(), s(L, { key: 2 }, [
340
- Ce(t("textarea", {
339
+ l.disabled ? S("", !0) : (t(), a(L, { key: 2 }, [
340
+ Ce(e("textarea", {
341
341
  ref_key: "textareaRef",
342
- ref: b,
343
- "onUpdate:modelValue": D[0] || (D[0] = (P) => A.value = P),
342
+ ref: m,
343
+ "onUpdate:modelValue": D[0] || (D[0] = (q) => $.value = q),
344
344
  class: "approvable-textarea",
345
345
  rows: "1",
346
346
  onInput: k
347
347
  }, null, 544), [
348
- [Re, A.value]
348
+ [Re, $.value]
349
349
  ]),
350
- t("div", At, [
351
- t("button", {
350
+ e("div", At, [
351
+ e("button", {
352
352
  class: "approvable-btn approvable-btn--primary",
353
353
  type: "button",
354
- onClick: j
355
- }, d(w(M).save), 1)
354
+ onClick: B
355
+ }, c(w(I).save), 1)
356
356
  ])
357
357
  ], 64))
358
358
  ])) : S("", !0)
359
359
  ], 512));
360
360
  }
361
361
  };
362
- function Oa(l, y) {
363
- return qe(l, Le(y));
362
+ function Da(l, y) {
363
+ return qe(l, Ee(y));
364
364
  }
365
365
  const Se = Symbol("approvable.linkComponent");
366
366
  function wt() {
@@ -372,7 +372,7 @@ function Ct(l, y) {
372
372
  const Rt = {
373
373
  key: 0,
374
374
  class: "approvable-step-actions"
375
- }, xt = { class: "approvable-btn-group" }, Lt = ["title", "onClick"], Et = ["title", "onClick"], Dt = {
375
+ }, xt = { class: "approvable-btn-group" }, Et = ["title", "onClick"], Lt = ["title", "onClick"], Dt = {
376
376
  key: 0,
377
377
  class: "approvable-btn-group"
378
378
  }, ae = {
@@ -393,74 +393,74 @@ const Rt = {
393
393
  },
394
394
  emits: ["isLoading", "refresh"],
395
395
  setup(l, { emit: y }) {
396
- const v = y, f = l, h = wt(), b = _(() => fe(f.value)), n = _(() => b.value.buttons.length > 0 || !!f.value.can_comment), g = (u) => ({
396
+ const u = y, f = l, h = wt(), m = _(() => fe(f.value)), n = _(() => m.value.buttons.length > 0 || !!f.value.can_comment), g = (v) => ({
397
397
  "approvable-btn": !0,
398
398
  // A button carrying only an icon collapses to a circle, so the row keeps its
399
399
  // rhythm instead of stretching around an empty label.
400
- "approvable-btn--icon": !u.text,
401
- "approvable-btn--primary": u.result === "approved"
402
- }), A = (u) => b.value.isActive ? Ke(u == null ? void 0 : u.action_ui) : null, C = async (u) => {
403
- v("isLoading", !0);
404
- const m = await Ue({
405
- stepId: b.value.id,
406
- button: u,
407
- buttons: b.value.buttons
400
+ "approvable-btn--icon": !v.text,
401
+ "approvable-btn--primary": v.result === "approved"
402
+ }), $ = (v) => m.value.isActive ? Ke(v == null ? void 0 : v.action_ui) : null, C = async (v) => {
403
+ u("isLoading", !0);
404
+ const b = await He({
405
+ stepId: m.value.id,
406
+ button: v,
407
+ buttons: m.value.buttons
408
408
  });
409
- v("isLoading", !1), m.skipped || v("refresh");
409
+ u("isLoading", !1), b.skipped || u("refresh");
410
410
  };
411
- return (u, m) => n.value ? (a(), s("div", Rt, [
412
- t("div", xt, [
413
- (a(!0), s(L, null, N(b.value.buttons, (o, k) => (a(), s(L, {
414
- key: o.id ?? k
411
+ return (v, b) => n.value ? (t(), a("div", Rt, [
412
+ e("div", xt, [
413
+ (t(!0), a(L, null, T(m.value.buttons, (s, k) => (t(), a(L, {
414
+ key: s.id ?? k
415
415
  }, [
416
- A(o) ? (a(), B(J(A(o)), {
416
+ $(s) ? (t(), P(J($(s)), {
417
417
  key: 0,
418
- "action-ui": o.action_ui,
418
+ "action-ui": s.action_ui,
419
419
  approvable: l.approvable,
420
- button: o,
421
- buttons: [o],
420
+ button: s,
421
+ buttons: [s],
422
422
  complete: C,
423
423
  resource: l.resource,
424
424
  step: l.value,
425
- onIsLoading: m[0] || (m[0] = ($) => v("isLoading", $)),
426
- onRefresh: m[1] || (m[1] = ($) => v("refresh"))
427
- }, null, 40, ["action-ui", "approvable", "button", "buttons", "resource", "step"])) : o.link ? (a(), B(J(w(h)), te({
425
+ onIsLoading: b[0] || (b[0] = (A) => u("isLoading", A)),
426
+ onRefresh: b[1] || (b[1] = (A) => u("refresh"))
427
+ }, null, 40, ["action-ui", "approvable", "button", "buttons", "resource", "step"])) : s.link ? (t(), P(J(w(h)), te({
428
428
  key: 1,
429
429
  ref_for: !0
430
- }, w(Ct)(w(h), o.link)), {
430
+ }, w(Ct)(w(h), s.link)), {
431
431
  default: X(() => [
432
- t("button", {
433
- title: o.tooltip,
434
- class: V(g(o)),
432
+ e("button", {
433
+ title: s.tooltip,
434
+ class: j(g(s)),
435
435
  type: "button",
436
- onClick: ($) => C(o)
436
+ onClick: (A) => C(s)
437
437
  }, [
438
- F(Z, {
439
- icon: o.icon
438
+ U(Z, {
439
+ icon: s.icon
440
440
  }, null, 8, ["icon"])
441
- ], 10, Lt)
441
+ ], 10, Et)
442
442
  ]),
443
443
  _: 2
444
- }, 1040)) : (a(), s("button", {
444
+ }, 1040)) : (t(), a("button", {
445
445
  key: 2,
446
- title: o.tooltip,
447
- class: V(g(o)),
446
+ title: s.tooltip,
447
+ class: j(g(s)),
448
448
  type: "button",
449
- onClick: ($) => C(o)
449
+ onClick: (A) => C(s)
450
450
  }, [
451
- F(Z, {
452
- icon: o.icon
451
+ U(Z, {
452
+ icon: s.icon
453
453
  }, null, 8, ["icon"]),
454
- z(" " + d(o.text), 1)
455
- ], 10, Et))
454
+ z(" " + c(s.text), 1)
455
+ ], 10, Lt))
456
456
  ], 64))), 128))
457
457
  ]),
458
- l.value.can_comment ? (a(), s("div", Dt, [
459
- F(_e, {
458
+ l.value.can_comment ? (t(), a("div", Dt, [
459
+ U(_e, {
460
460
  "approvable-step": l.value,
461
461
  disabled: !l.value.can_comment,
462
- onRefresh: m[2] || (m[2] = (o) => v("refresh")),
463
- onIsLoading: m[3] || (m[3] = (o) => v("isLoading", o))
462
+ onRefresh: b[2] || (b[2] = (s) => u("refresh")),
463
+ onIsLoading: b[3] || (b[3] = (s) => u("isLoading", s))
464
464
  }, null, 8, ["approvable-step", "disabled"])
465
465
  ])) : S("", !0)
466
466
  ])) : S("", !0);
@@ -476,21 +476,21 @@ const Rt = {
476
476
  }
477
477
  },
478
478
  setup(l) {
479
- const y = l, v = _(() => {
480
- const h = T(y.value, "code", " - ");
479
+ const y = l, u = _(() => {
480
+ const h = V(y.value, "code", " - ");
481
481
  return {
482
482
  "approvable-badge": !0,
483
- "approvable-badge--draft": [q.CODES.CODE_DRAFT].includes(h),
484
- "approvable-badge--waiting": [q.CODES.CODE_WAITING].includes(h),
485
- "approvable-badge--success": [q.CODES.CODE_APPROVED, q.CODES.CODE_VIEWED, q.CODES.CODE_NOTICED].includes(h),
486
- "approvable-badge--danger": [q.CODES.CODE_REJECTED].includes(h),
487
- "approvable-badge--muted": [q.CODES.CODE_EXPIRED, q.CODES.CODE_SOLVED].includes(h),
483
+ "approvable-badge--draft": [K.CODES.CODE_DRAFT].includes(h),
484
+ "approvable-badge--waiting": [K.CODES.CODE_WAITING].includes(h),
485
+ "approvable-badge--success": [K.CODES.CODE_APPROVED, K.CODES.CODE_VIEWED, K.CODES.CODE_NOTICED].includes(h),
486
+ "approvable-badge--danger": [K.CODES.CODE_REJECTED].includes(h),
487
+ "approvable-badge--muted": [K.CODES.CODE_EXPIRED, K.CODES.CODE_SOLVED].includes(h),
488
488
  "approvable-badge--empty": h === " - "
489
489
  };
490
- }), f = _(() => y.label ? y.label : T(y.value, "name", " - "));
491
- return (h, b) => (a(), s("span", {
492
- class: V(v.value)
493
- }, d(f.value), 3));
490
+ }), f = _(() => y.label ? y.label : V(y.value, "name", " - "));
491
+ return (h, m) => (t(), a("span", {
492
+ class: j(u.value)
493
+ }, c(f.value), 3));
494
494
  }
495
495
  }, Ot = { class: "approvable-compact" }, Mt = { class: "approvable-compact-main" }, It = { class: "approvable-compact-line" }, Nt = ["aria-label"], Tt = ["title"], Vt = {
496
496
  key: 0,
@@ -506,76 +506,76 @@ const Rt = {
506
506
  },
507
507
  emits: ["expand", "isLoading", "refresh"],
508
508
  setup(l, { emit: y }) {
509
- const v = l, f = y, h = G(), b = _(() => he(v.value)), n = _(() => Fe(b.value.steps)), g = _(() => n.value.focus), A = _(() => K(h.stepProgress, {
509
+ const u = l, f = y, h = F(), m = _(() => he(u.value)), n = _(() => Ue(m.value.steps)), g = _(() => n.value.focus), $ = _(() => G(h.stepProgress, {
510
510
  current: n.value.focusStepNumber ?? 0,
511
511
  total: n.value.stepCount
512
- })), C = (m) => ({
512
+ })), C = (b) => ({
513
513
  "approvable-compact-dot": !0,
514
- [`approvable-compact-dot--${m.tone}`]: !0
515
- }), u = (m) => [
516
- K(h.stepProgress, { current: m.number, total: n.value.stepCount }),
517
- m.approverName,
518
- m.statusName
514
+ [`approvable-compact-dot--${b.tone}`]: !0
515
+ }), v = (b) => [
516
+ G(h.stepProgress, { current: b.number, total: n.value.stepCount }),
517
+ b.approverName,
518
+ b.statusName
519
519
  ].filter(Boolean).join(" — ");
520
- return (m, o) => (a(), s("div", Ot, [
521
- t("div", Mt, [
522
- t("div", It, [
523
- l.showApprovableStatus ? (a(), B(se, {
520
+ return (b, s) => (t(), a("div", Ot, [
521
+ e("div", Mt, [
522
+ e("div", It, [
523
+ l.showApprovableStatus ? (t(), P(se, {
524
524
  key: 0,
525
- label: b.value.statusName,
526
- value: b.value.status
525
+ label: m.value.statusName,
526
+ value: m.value.status
527
527
  }, null, 8, ["label", "value"])) : S("", !0),
528
- n.value.dots.length ? (a(), s("span", {
528
+ n.value.dots.length ? (t(), a("span", {
529
529
  key: 1,
530
530
  class: "approvable-compact-dots",
531
531
  role: "img",
532
- "aria-label": A.value
532
+ "aria-label": $.value
533
533
  }, [
534
- (a(!0), s(L, null, N(n.value.dots, (k) => (a(), s("span", {
534
+ (t(!0), a(L, null, T(n.value.dots, (k) => (t(), a("span", {
535
535
  key: k.id,
536
- class: V(C(k)),
537
- title: u(k)
536
+ class: j(C(k)),
537
+ title: v(k)
538
538
  }, null, 10, Tt))), 128))
539
539
  ], 8, Nt)) : S("", !0)
540
540
  ]),
541
- g.value ? (a(), s("p", Vt, [
542
- U(m.$slots, "approvableStepInfo", {
541
+ g.value ? (t(), a("p", Vt, [
542
+ H(b.$slots, "approvableStepInfo", {
543
543
  step: n.value.focusStep
544
544
  }, () => [
545
- t("span", jt, d(g.value.approverName), 1)
545
+ e("span", jt, c(g.value.approverName), 1)
546
546
  ]),
547
- U(m.$slots, "approvableStepRole", {
547
+ H(b.$slots, "approvableStepRole", {
548
548
  role: g.value.approverRole,
549
549
  step: n.value.focusStep
550
550
  }, () => [
551
- g.value.approverRole ? (a(), s(L, { key: 0 }, [
552
- o[3] || (o[3] = t("span", {
551
+ g.value.approverRole ? (t(), a(L, { key: 0 }, [
552
+ s[3] || (s[3] = e("span", {
553
553
  "aria-hidden": "true",
554
554
  class: "approvable-compact-sep"
555
555
  }, "·", -1)),
556
- z(d(g.value.approverRole), 1)
556
+ z(c(g.value.approverRole), 1)
557
557
  ], 64)) : S("", !0)
558
558
  ])
559
559
  ])) : S("", !0)
560
560
  ]),
561
- t("div", Bt, [
562
- n.value.hasActiveStep && n.value.focusStep ? (a(), B(ae, {
561
+ e("div", Bt, [
562
+ n.value.hasActiveStep && n.value.focusStep ? (t(), P(ae, {
563
563
  key: 0,
564
- approvable: b.value.approvable,
564
+ approvable: m.value.approvable,
565
565
  resource: l.value,
566
566
  value: n.value.focusStep,
567
- onIsLoading: o[0] || (o[0] = (k) => f("isLoading", k)),
568
- onRefresh: o[1] || (o[1] = (k) => f("refresh"))
567
+ onIsLoading: s[0] || (s[0] = (k) => f("isLoading", k)),
568
+ onRefresh: s[1] || (s[1] = (k) => f("refresh"))
569
569
  }, null, 8, ["approvable", "resource", "value"])) : S("", !0),
570
- t("button", {
570
+ e("button", {
571
571
  type: "button",
572
572
  class: "approvable-compact-toggle",
573
573
  "aria-expanded": !1,
574
574
  "aria-label": w(h).compactExpand,
575
575
  title: w(h).compactExpand,
576
- onClick: o[2] || (o[2] = (k) => f("expand"))
577
- }, [...o[4] || (o[4] = [
578
- t("svg", {
576
+ onClick: s[2] || (s[2] = (k) => f("expand"))
577
+ }, [...s[4] || (s[4] = [
578
+ e("svg", {
579
579
  "aria-hidden": "true",
580
580
  class: "approvable-icon",
581
581
  fill: "none",
@@ -585,7 +585,7 @@ const Rt = {
585
585
  "stroke-width": "2",
586
586
  viewBox: "0 0 16 16"
587
587
  }, [
588
- t("path", { d: "M4.5 6.4 8 9.9l3.5-3.5" })
588
+ e("path", { d: "M4.5 6.4 8 9.9l3.5-3.5" })
589
589
  ], -1)
590
590
  ])], 8, Pt)
591
591
  ])
@@ -599,7 +599,7 @@ const Rt = {
599
599
  "stroke-linecap": "round",
600
600
  "stroke-linejoin": "round",
601
601
  viewBox: "0 0 16 16"
602
- }, Kt = ["d", "stroke-width"], Ut = { class: "approvable-step-body" }, Ft = { class: "approvable-step-line" }, Gt = { class: "approvable-step-name" }, zt = ["title"], Ht = {
602
+ }, Kt = ["d", "stroke-width"], Ht = { class: "approvable-step-body" }, Ut = { class: "approvable-step-line" }, Ft = { class: "approvable-step-name" }, Gt = ["title"], zt = {
603
603
  key: 1,
604
604
  class: "approvable-step-spacer"
605
605
  }, Wt = {
@@ -629,80 +629,80 @@ const Rt = {
629
629
  },
630
630
  emits: ["isLoading", "refresh"],
631
631
  setup(l, { emit: y }) {
632
- const v = y, f = l, h = G(), b = O(!1), n = _(() => fe(f.value)), g = _(() => Ge(n.value.status)), A = _(() => n.value.buttons.length > 0 || !!f.value.can_comment), C = _(() => (!n.value.isActive || !A.value) && !!(n.value.statusName || n.value.performedAt)), u = _(() => ({
632
+ const u = y, f = l, h = F(), m = O(!1), n = _(() => fe(f.value)), g = _(() => Fe(n.value.status)), $ = _(() => n.value.buttons.length > 0 || !!f.value.can_comment), C = _(() => (!n.value.isActive || !$.value) && !!(n.value.statusName || n.value.performedAt)), v = _(() => ({
633
633
  "approvable-step": !0,
634
634
  "approvable-step--active": n.value.isActive,
635
635
  // A step nobody has reached yet is dimmed; one with an outcome is not.
636
636
  "approvable-step--pending": !n.value.isActive && !g.value,
637
637
  [`approvable-step--${g.value}`]: !!g.value,
638
638
  // Nothing wraps below the name, so the row can hold to a single line.
639
- "approvable-step--single-line": !A.value && !n.value.comment.text
640
- })), m = {
639
+ "approvable-step--single-line": !$.value && !n.value.comment.text
640
+ })), b = {
641
641
  check: { d: "M4 8.4l2.8 2.8 5.4-6", width: 2.8 },
642
642
  cross: { d: "M5.2 5.2l5.6 5.6M10.8 5.2l-5.6 5.6", width: 2.4 },
643
643
  dash: { d: "M4.4 8h7.2", width: 2.2 }
644
- }, o = {
644
+ }, s = {
645
645
  check: "success",
646
646
  cross: "danger",
647
647
  dash: "muted",
648
648
  ring: "ring",
649
649
  pending: "pending"
650
- }, k = _(() => ze(g.value, n.value.isActive)), $ = _(() => m[k.value] ?? null), I = _(() => ({
650
+ }, k = _(() => Ge(g.value, n.value.isActive)), A = _(() => b[k.value] ?? null), N = _(() => ({
651
651
  "approvable-step-disc": !0,
652
- [`approvable-step-disc--${o[k.value]}`]: !0
653
- })), M = _(() => b.value ? n.value.comment.text : n.value.comment.preview);
654
- return (j, R) => n.value.isVisible ? (a(), s("li", {
652
+ [`approvable-step-disc--${s[k.value]}`]: !0
653
+ })), I = _(() => m.value ? n.value.comment.text : n.value.comment.preview);
654
+ return (B, x) => n.value.isVisible ? (t(), a("li", {
655
655
  key: 0,
656
- class: V(u.value)
656
+ class: j(v.value)
657
657
  }, [
658
- t("span", {
659
- class: V(I.value)
658
+ e("span", {
659
+ class: j(N.value)
660
660
  }, [
661
- $.value ? (a(), s("svg", qt, [
662
- t("path", {
663
- d: $.value.d,
664
- "stroke-width": $.value.width
661
+ A.value ? (t(), a("svg", qt, [
662
+ e("path", {
663
+ d: A.value.d,
664
+ "stroke-width": A.value.width
665
665
  }, null, 8, Kt)
666
666
  ])) : S("", !0)
667
667
  ], 2),
668
- t("div", Ut, [
669
- t("div", Ft, [
670
- U(j.$slots, "approvableStepInfo", { step: l.value }, () => [
671
- t("span", Gt, d(n.value.approverName), 1)
668
+ e("div", Ht, [
669
+ e("div", Ut, [
670
+ H(B.$slots, "approvableStepInfo", { step: l.value }, () => [
671
+ e("span", Ft, c(n.value.approverName), 1)
672
672
  ]),
673
- U(j.$slots, "approvableStepRole", {
673
+ H(B.$slots, "approvableStepRole", {
674
674
  step: l.value,
675
675
  role: n.value.approverRole
676
676
  }, () => [
677
- n.value.approverRole ? (a(), s("span", {
677
+ n.value.approverRole ? (t(), a("span", {
678
678
  key: 0,
679
679
  title: n.value.approverRole,
680
680
  class: "approvable-step-role"
681
- }, d(n.value.approverRole), 9, zt)) : (a(), s("span", Ht))
681
+ }, c(n.value.approverRole), 9, Gt)) : (t(), a("span", zt))
682
682
  ]),
683
- C.value ? (a(), s("span", Wt, [
684
- n.value.statusName ? (a(), s("span", Qt, d(n.value.statusName), 1)) : S("", !0),
685
- n.value.performedAt ? (a(), s("time", Yt, d(n.value.performedAt), 1)) : S("", !0)
683
+ C.value ? (t(), a("span", Wt, [
684
+ n.value.statusName ? (t(), a("span", Qt, c(n.value.statusName), 1)) : S("", !0),
685
+ n.value.performedAt ? (t(), a("time", Yt, c(n.value.performedAt), 1)) : S("", !0)
686
686
  ])) : S("", !0),
687
- F(ae, {
687
+ U(ae, {
688
688
  approvable: l.approvable,
689
689
  resource: l.resource,
690
690
  value: l.value,
691
- onIsLoading: R[0] || (R[0] = (D) => v("isLoading", D)),
692
- onRefresh: R[1] || (R[1] = (D) => v("refresh"))
691
+ onIsLoading: x[0] || (x[0] = (D) => u("isLoading", D)),
692
+ onRefresh: x[1] || (x[1] = (D) => u("refresh"))
693
693
  }, null, 8, ["approvable", "resource", "value"])
694
694
  ]),
695
- n.value.comment.text ? (a(), s("p", Jt, [
696
- t("span", {
695
+ n.value.comment.text ? (t(), a("p", Jt, [
696
+ e("span", {
697
697
  title: n.value.comment.title
698
- }, d(M.value), 9, Xt),
699
- n.value.comment.isTrimmed ? (a(), s("button", {
698
+ }, c(I.value), 9, Xt),
699
+ n.value.comment.isTrimmed ? (t(), a("button", {
700
700
  key: 0,
701
701
  type: "button",
702
702
  class: "approvable-step-comment-more",
703
- "aria-expanded": b.value,
704
- onClick: R[2] || (R[2] = (D) => b.value = !b.value)
705
- }, d(b.value ? w(h).showLess : w(h).showMore), 9, Zt)) : S("", !0)
703
+ "aria-expanded": m.value,
704
+ onClick: x[2] || (x[2] = (D) => m.value = !m.value)
705
+ }, c(m.value ? w(h).showLess : w(h).showMore), 9, Zt)) : S("", !0)
706
706
  ])) : S("", !0)
707
707
  ])
708
708
  ], 2)) : S("", !0);
@@ -719,17 +719,16 @@ const Rt = {
719
719
  }, oa = { class: "approvable-header" }, la = { class: "approvable-sr-only" }, na = { class: "approvable-updated-at" }, ra = ["aria-expanded"], ia = ["title", "aria-label"], pa = ["aria-label", "title"], ua = {
720
720
  class: "approvable-sr-only",
721
721
  "aria-live": "polite"
722
- }, va = {
723
- key: 1,
724
- class: "approvable-footer"
725
- }, da = { class: "approvable-dialog-header" }, ca = { class: "approvable-dialog-eyebrow" }, ba = {
722
+ }, va = { class: "approvable-dialog-header" }, da = { class: "approvable-dialog-eyebrow" }, ca = {
726
723
  id: "approvable-history-title",
727
724
  class: "approvable-dialog-title"
728
- }, ma = ["aria-label"], fa = { class: "approvable-dialog-body" }, ha = {
725
+ }, ma = ["aria-label"], ba = { class: "approvable-dialog-body" }, fa = {
729
726
  __name: "Approvable",
730
727
  props: {
731
728
  value: {},
732
729
  showApprovableStatus: { type: Boolean, default: !0 },
730
+ /** Whether the History button — and so the audit dialog — is offered. */
731
+ isHistoryVisible: { type: Boolean, default: !0 },
733
732
  title: { default: "Approval" },
734
733
  isDirectionRow: { default: !1 },
735
734
  /**
@@ -752,126 +751,117 @@ const Rt = {
752
751
  },
753
752
  emits: ["refresh", "isLoading", "update:compact"],
754
753
  setup(l, { emit: y }) {
755
- const v = l, f = y, h = O(!1), b = O(null), n = O(!1), g = O(null), A = O(!1), C = O(v.compact), u = G(), m = [
754
+ const u = l, f = y, h = O(!1), m = O(null), n = O(!1), g = O(null), $ = O(!1), C = O(u.compact), v = F(), b = [
756
755
  { name: "118px", meta: "56px", delay: "0s", metaDelay: "0.15s" },
757
756
  { name: "96px", meta: "72px", delay: "0.1s", metaDelay: "0.25s" },
758
757
  { name: "78px", meta: "48px", delay: "0.2s", metaDelay: "0.35s" }
759
758
  ];
760
- Y(() => v.compact, (E) => C.value = E);
761
- const o = (E) => {
762
- C.value = E, f("update:compact", E);
763
- }, k = _(() => v.collapsible ?? v.compact), $ = _(() => he(v.value)), I = _(() => He($.value.steps, {
764
- range: v.visibleStepRange,
765
- isExpanded: A.value
766
- })), M = _(() => g.value === null ? u.historyTitle : K(u.eventCount, { count: g.value })), j = _(() => h.value && !$.value.steps.length), R = _(() => ({
759
+ Y(() => u.compact, (M) => C.value = M);
760
+ const s = (M) => {
761
+ C.value = M, f("update:compact", M);
762
+ }, k = _(() => u.collapsible ?? u.compact), A = _(() => he(u.value)), N = _(() => ze(A.value.steps, {
763
+ range: u.visibleStepRange,
764
+ isExpanded: $.value
765
+ })), I = _(() => g.value === null ? v.historyTitle : G(v.eventCount, { count: g.value })), B = _(() => h.value && !A.value.steps.length), x = _(() => ({
767
766
  approvable: !0,
768
767
  "approvable--compact": C.value
769
768
  })), D = _(() => ({
770
769
  "approvable-steps": !0,
771
- "approvable-steps--row": v.isDirectionRow
772
- })), P = _(() => {
773
- const { activeStepNumber: E, visibleStepCount: r, activeApproverName: e } = $.value;
774
- if (!E || !r)
775
- return null;
776
- const i = K(u.stepProgress, {
777
- current: E,
778
- total: r
779
- });
780
- return e ? `${i} — ${K(u.awaitingApprover, { name: e })}` : i;
781
- }), H = () => {
782
- var E;
783
- (E = b.value) == null || E.refresh(), f("refresh");
770
+ "approvable-steps--row": u.isDirectionRow
771
+ })), q = () => {
772
+ var M;
773
+ (M = m.value) == null || M.refresh(), f("refresh");
784
774
  };
785
- return (E, r) => $.value.hasApprovable ? (a(), s("div", {
775
+ return (M, r) => A.value.hasApprovable ? (t(), a("div", {
786
776
  key: 0,
787
- class: V(R.value)
777
+ class: j(x.value)
788
778
  }, [
789
- h.value && $.value.steps.length ? (a(), s("div", ea, [...r[10] || (r[10] = [
790
- t("span", { class: "approvable-spinner" }, null, -1)
779
+ h.value && A.value.steps.length ? (t(), a("div", ea, [...r[10] || (r[10] = [
780
+ e("span", { class: "approvable-spinner" }, null, -1)
791
781
  ])])) : S("", !0),
792
- C.value ? (a(), s(L, { key: 1 }, [
793
- t("h2", ta, d(l.title), 1),
794
- j.value ? (a(), s("div", aa, [
795
- t("span", sa, d(w(u).loadingStatus), 1),
796
- r[11] || (r[11] = t("span", {
782
+ C.value ? (t(), a(L, { key: 1 }, [
783
+ e("h2", ta, c(l.title), 1),
784
+ B.value ? (t(), a("div", aa, [
785
+ e("span", sa, c(w(v).loadingStatus), 1),
786
+ r[11] || (r[11] = e("span", {
797
787
  "aria-hidden": "true",
798
788
  class: "approvable-skeleton-bar approvable-skeleton-bar--pill"
799
789
  }, null, -1)),
800
- r[12] || (r[12] = t("span", {
790
+ r[12] || (r[12] = e("span", {
801
791
  "aria-hidden": "true",
802
792
  class: "approvable-skeleton-bar approvable-skeleton-bar--soft",
803
793
  style: { width: "96px", "animation-delay": "0.15s" }
804
794
  }, null, -1)),
805
- r[13] || (r[13] = t("span", {
795
+ r[13] || (r[13] = e("span", {
806
796
  "aria-hidden": "true",
807
797
  class: "approvable-skeleton-spacer"
808
798
  }, null, -1)),
809
- r[14] || (r[14] = t("span", {
799
+ r[14] || (r[14] = e("span", {
810
800
  "aria-hidden": "true",
811
801
  class: "approvable-skeleton-disc",
812
802
  style: { "animation-delay": "0.25s" }
813
803
  }, null, -1))
814
- ])) : (a(), B($e, {
804
+ ])) : (t(), P($e, {
815
805
  key: 1,
816
806
  "show-approvable-status": l.showApprovableStatus,
817
807
  value: l.value,
818
- onExpand: r[0] || (r[0] = (e) => o(!1)),
819
- onIsLoading: r[1] || (r[1] = (e) => h.value = e),
820
- onRefresh: H
808
+ onExpand: r[0] || (r[0] = (R) => s(!1)),
809
+ onIsLoading: r[1] || (r[1] = (R) => h.value = R),
810
+ onRefresh: q
821
811
  }, pe({ _: 2 }, [
822
- N(Object.keys(E.$slots), (e) => ({
823
- name: e,
824
- fn: X((i) => [
825
- U(E.$slots, e, Ee(De(i ?? {})))
812
+ T(Object.keys(M.$slots), (R) => ({
813
+ name: R,
814
+ fn: X((o) => [
815
+ H(M.$slots, R, Le(De(o ?? {})))
826
816
  ])
827
817
  }))
828
818
  ]), 1032, ["show-approvable-status", "value"]))
829
- ], 64)) : (a(), s(L, { key: 2 }, [
830
- t("div", oa, [
831
- t("h2", la, d(l.title), 1),
832
- j.value ? (a(), s(L, { key: 0 }, [
833
- r[15] || (r[15] = t("span", {
819
+ ], 64)) : (t(), a(L, { key: 2 }, [
820
+ e("div", oa, [
821
+ e("h2", la, c(l.title), 1),
822
+ B.value ? (t(), a(L, { key: 0 }, [
823
+ r[15] || (r[15] = e("span", {
834
824
  "aria-hidden": "true",
835
825
  class: "approvable-skeleton-bar approvable-skeleton-bar--pill"
836
826
  }, null, -1)),
837
- r[16] || (r[16] = t("span", { class: "approvable-skeleton-spacer" }, null, -1)),
838
- r[17] || (r[17] = t("span", {
827
+ r[16] || (r[16] = e("span", { class: "approvable-skeleton-spacer" }, null, -1)),
828
+ r[17] || (r[17] = e("span", {
839
829
  "aria-hidden": "true",
840
830
  class: "approvable-skeleton-bar approvable-skeleton-bar--soft",
841
831
  style: { width: "104px", "animation-delay": "0.2s" }
842
832
  }, null, -1))
843
- ], 64)) : (a(), s(L, { key: 1 }, [
844
- l.showApprovableStatus ? (a(), B(se, {
833
+ ], 64)) : (t(), a(L, { key: 1 }, [
834
+ l.showApprovableStatus ? (t(), P(se, {
845
835
  key: 0,
846
- label: $.value.statusName,
847
- value: $.value.status
836
+ label: A.value.statusName,
837
+ value: A.value.status
848
838
  }, null, 8, ["label", "value"])) : S("", !0),
849
- t("span", na, d($.value.updatedAt), 1),
850
- I.value.isCollapsible ? (a(), s("button", {
839
+ e("span", na, c(A.value.updatedAt), 1),
840
+ N.value.isCollapsible ? (t(), a("button", {
851
841
  key: 1,
852
842
  type: "button",
853
843
  class: "approvable-steps-toggle-btn",
854
- "aria-expanded": A.value,
855
- onClick: r[2] || (r[2] = (e) => A.value = !A.value)
856
- }, d(A.value ? w(u).stepsShowLess : w(K)(w(u).stepsShowMore, { count: I.value.totalCount })), 9, ra)) : S("", !0),
857
- $.value.id ? (a(), s("button", {
844
+ "aria-expanded": $.value,
845
+ onClick: r[2] || (r[2] = (R) => $.value = !$.value)
846
+ }, c($.value ? w(v).stepsShowLess : w(G)(w(v).stepsShowMore, { count: N.value.totalCount })), 9, ra)) : S("", !0),
847
+ l.isHistoryVisible && A.value.id ? (t(), a("button", {
858
848
  key: 2,
859
849
  type: "button",
860
850
  class: "approvable-history-btn",
861
- title: w(u).historyTitle,
862
- "aria-label": w(u).historyTitle,
863
- onClick: r[3] || (r[3] = (e) => n.value = !0)
864
- }, d(w(u).history), 9, ia)) : S("", !0),
865
- k.value ? (a(), s("button", {
851
+ title: w(v).historyTitle,
852
+ "aria-label": w(v).historyTitle,
853
+ onClick: r[3] || (r[3] = (R) => n.value = !0)
854
+ }, c(w(v).history), 9, ia)) : S("", !0),
855
+ k.value ? (t(), a("button", {
866
856
  key: 3,
867
857
  type: "button",
868
858
  class: "approvable-compact-toggle approvable-compact-toggle--expanded",
869
859
  "aria-expanded": !0,
870
- "aria-label": w(u).compactCollapse,
871
- title: w(u).compactCollapse,
872
- onClick: r[4] || (r[4] = (e) => o(!0))
860
+ "aria-label": w(v).compactCollapse,
861
+ title: w(v).compactCollapse,
862
+ onClick: r[4] || (r[4] = (R) => s(!0))
873
863
  }, [...r[18] || (r[18] = [
874
- t("svg", {
864
+ e("svg", {
875
865
  "aria-hidden": "true",
876
866
  class: "approvable-icon",
877
867
  fill: "none",
@@ -881,81 +871,71 @@ const Rt = {
881
871
  "stroke-width": "2",
882
872
  viewBox: "0 0 16 16"
883
873
  }, [
884
- t("path", { d: "M4.5 6.4 8 9.9l3.5-3.5" })
874
+ e("path", { d: "M4.5 6.4 8 9.9l3.5-3.5" })
885
875
  ], -1)
886
876
  ])], 8, pa)) : S("", !0)
887
877
  ], 64))
888
878
  ]),
889
- j.value ? (a(), s(L, { key: 0 }, [
890
- t("span", ua, d(w(u).loadingStatus), 1),
891
- (a(), s(L, null, N(m, (e) => t("div", {
892
- key: e.delay,
879
+ B.value ? (t(), a(L, { key: 0 }, [
880
+ e("span", ua, c(w(v).loadingStatus), 1),
881
+ (t(), a(L, null, T(b, (R) => e("div", {
882
+ key: R.delay,
893
883
  "aria-hidden": "true",
894
884
  class: "approvable-skeleton-row"
895
885
  }, [
896
- t("span", {
886
+ e("span", {
897
887
  class: "approvable-skeleton-disc",
898
- style: Q({ animationDelay: e.delay })
888
+ style: Q({ animationDelay: R.delay })
899
889
  }, null, 4),
900
- t("span", {
890
+ e("span", {
901
891
  class: "approvable-skeleton-bar",
902
- style: Q({ width: e.name, animationDelay: e.delay })
892
+ style: Q({ width: R.name, animationDelay: R.delay })
903
893
  }, null, 4),
904
- r[19] || (r[19] = t("span", { class: "approvable-skeleton-spacer" }, null, -1)),
905
- t("span", {
894
+ r[19] || (r[19] = e("span", { class: "approvable-skeleton-spacer" }, null, -1)),
895
+ e("span", {
906
896
  class: "approvable-skeleton-bar approvable-skeleton-bar--soft",
907
- style: Q({ width: e.meta, animationDelay: e.metaDelay })
897
+ style: Q({ width: R.meta, animationDelay: R.metaDelay })
908
898
  }, null, 4)
909
- ])), 64)),
910
- r[20] || (r[20] = t("div", {
911
- class: "approvable-footer",
912
- "aria-hidden": "true"
913
- }, [
914
- t("span", {
915
- class: "approvable-skeleton-bar approvable-skeleton-bar--soft",
916
- style: { display: "block", width: "132px" }
917
- })
918
- ], -1))
919
- ], 64)) : (a(), s(L, { key: 1 }, [
920
- I.value.steps.length ? (a(), s("ol", {
899
+ ])), 64))
900
+ ], 64)) : (t(), a(L, { key: 1 }, [
901
+ N.value.steps.length ? (t(), a("ol", {
921
902
  key: 0,
922
- class: V(D.value)
903
+ class: j(D.value)
923
904
  }, [
924
- (a(!0), s(L, null, N(I.value.steps, (e) => (a(), B(Ae, {
925
- key: e.id,
926
- approvable: $.value.approvable,
905
+ (t(!0), a(L, null, T(N.value.steps, (R) => (t(), P(Ae, {
906
+ key: R.id,
907
+ approvable: A.value.approvable,
927
908
  resource: l.value,
928
- value: e,
929
- onIsLoading: r[5] || (r[5] = (i) => h.value = i),
930
- onRefresh: H
909
+ value: R,
910
+ onIsLoading: r[5] || (r[5] = (o) => h.value = o),
911
+ onRefresh: q
931
912
  }, pe({ _: 2 }, [
932
- N(Object.keys(E.$slots), (i) => ({
933
- name: i,
913
+ T(Object.keys(M.$slots), (o) => ({
914
+ name: o,
934
915
  fn: X((p) => [
935
- U(E.$slots, i, te({ ref_for: !0 }, p ?? {}))
916
+ H(M.$slots, o, te({ ref_for: !0 }, p ?? {}))
936
917
  ])
937
918
  }))
938
919
  ]), 1032, ["approvable", "resource", "value"]))), 128))
939
- ], 2)) : S("", !0),
940
- P.value ? (a(), s("p", va, d(P.value), 1)) : S("", !0)
920
+ ], 2)) : S("", !0)
941
921
  ], 64))
942
922
  ], 64)),
943
- (a(), B(Oe, { to: "body" }, [
944
- n.value ? (a(), s("div", {
923
+ (t(), P(Oe, { to: "body" }, [
924
+ n.value ? (t(), a("div", {
945
925
  key: 0,
946
926
  class: "approvable-dialog-backdrop",
947
- onClick: r[9] || (r[9] = Me((e) => n.value = !1, ["self"]))
927
+ onClick: r[9] || (r[9] = Me((R) => n.value = !1, ["self"]))
948
928
  }, [
949
- t("section", {
929
+ e("section", {
950
930
  role: "dialog",
951
931
  "aria-modal": "true",
952
932
  "aria-labelledby": "approvable-history-title",
953
933
  class: "approvable-dialog",
954
- onKeydown: r[8] || (r[8] = Ie((e) => n.value = !1, ["esc"]))
934
+ onKeydown: r[8] || (r[8] = Ie((R) => n.value = !1, ["esc"]))
955
935
  }, [
956
- t("header", da, [
957
- t("p", ca, [
958
- r[21] || (r[21] = t("svg", {
936
+ e("header", va, [
937
+ e("p", da, [
938
+ r[20] || (r[20] = e("svg", {
959
939
  "aria-hidden": "true",
960
940
  fill: "none",
961
941
  stroke: "currentColor",
@@ -964,18 +944,18 @@ const Rt = {
964
944
  "stroke-width": "2",
965
945
  viewBox: "0 0 16 16"
966
946
  }, [
967
- t("path", { d: "M9.6 4.5 6 8l3.6 3.5" })
947
+ e("path", { d: "M9.6 4.5 6 8l3.6 3.5" })
968
948
  ], -1)),
969
- z(" " + d(w(u).history), 1)
949
+ z(" " + c(w(v).history), 1)
970
950
  ]),
971
- t("h2", ba, d(M.value), 1),
972
- t("button", {
951
+ e("h2", ca, c(I.value), 1),
952
+ e("button", {
973
953
  type: "button",
974
954
  class: "approvable-dialog-close",
975
- "aria-label": w(u).historyClose,
976
- onClick: r[6] || (r[6] = (e) => n.value = !1)
977
- }, [...r[22] || (r[22] = [
978
- t("svg", {
955
+ "aria-label": w(v).historyClose,
956
+ onClick: r[6] || (r[6] = (R) => n.value = !1)
957
+ }, [...r[21] || (r[21] = [
958
+ e("svg", {
979
959
  "aria-hidden": "true",
980
960
  class: "approvable-icon",
981
961
  fill: "none",
@@ -984,17 +964,17 @@ const Rt = {
984
964
  "stroke-width": "2",
985
965
  viewBox: "0 0 16 16"
986
966
  }, [
987
- t("path", { d: "m5.2 5.2 5.6 5.6M10.8 5.2l-5.6 5.6" })
967
+ e("path", { d: "m5.2 5.2 5.6 5.6M10.8 5.2l-5.6 5.6" })
988
968
  ], -1)
989
969
  ])], 8, ma)
990
970
  ]),
991
- t("div", fa, [
992
- F(ke, {
971
+ e("div", ba, [
972
+ U(ke, {
993
973
  ref_key: "auditTimeline",
994
- ref: b,
995
- "approvable-id": $.value.id,
974
+ ref: m,
975
+ "approvable-id": A.value.id,
996
976
  "show-header": !1,
997
- onLoaded: r[7] || (r[7] = (e) => g.value = e)
977
+ onLoaded: r[7] || (r[7] = (R) => g.value = R)
998
978
  }, null, 8, ["approvable-id"])
999
979
  ])
1000
980
  ], 32)
@@ -1002,10 +982,10 @@ const Rt = {
1002
982
  ]))
1003
983
  ], 2)) : S("", !0);
1004
984
  }
1005
- }, ya = {
985
+ }, ha = {
1006
986
  key: 0,
1007
987
  class: "approvable-actions"
1008
- }, ka = { class: "approvable-actions-list" }, ga = ["title", "onClick"], _a = {
988
+ }, ya = { class: "approvable-actions-list" }, ka = ["title", "onClick"], ga = {
1009
989
  __name: "ApprovableButtons",
1010
990
  props: {
1011
991
  value: {
@@ -1014,38 +994,38 @@ const Rt = {
1014
994
  },
1015
995
  emits: ["isLoading", "refresh"],
1016
996
  setup(l, { emit: y }) {
1017
- const v = l, f = y, h = O(!1), b = _(() => T(v.value, "buttons", [])), n = _(() => b.value ? b.value.length > 0 : !1), g = G(), A = (u) => {
1018
- let m = T(v.value, "id");
1019
- m && C(m, u);
1020
- }, C = async (u, m) => {
997
+ const u = l, f = y, h = O(!1), m = _(() => V(u.value, "buttons", [])), n = _(() => m.value ? m.value.length > 0 : !1), g = F(), $ = (v) => {
998
+ let b = V(u.value, "id");
999
+ b && C(b, v);
1000
+ }, C = async (v, b) => {
1021
1001
  f("isLoading", !0), h.value = !0;
1022
- const o = await new ce().updateApproveStatus(u, m);
1023
- be(o) && me(g.actionSucceeded), f("isLoading", !1), f("refresh");
1002
+ const s = await new ce().updateApproveStatus(v, b);
1003
+ me(s) && be(g.actionSucceeded), f("isLoading", !1), f("refresh");
1024
1004
  };
1025
- return (u, m) => n.value ? (a(), s("div", ya, [
1026
- m[0] || (m[0] = t("hr", { class: "approvable-divider" }, null, -1)),
1027
- t("div", ka, [
1028
- (a(!0), s(L, null, N(b.value, (o) => (a(), s("button", {
1029
- key: o.code,
1030
- title: o.tooltip,
1005
+ return (v, b) => n.value ? (t(), a("div", ha, [
1006
+ b[0] || (b[0] = e("hr", { class: "approvable-divider" }, null, -1)),
1007
+ e("div", ya, [
1008
+ (t(!0), a(L, null, T(m.value, (s) => (t(), a("button", {
1009
+ key: s.code,
1010
+ title: s.tooltip,
1031
1011
  class: "approvable-btn",
1032
1012
  type: "button",
1033
- onClick: (k) => A(o)
1013
+ onClick: (k) => $(s)
1034
1014
  }, [
1035
- U(u.$slots, "icon", { button: o }, () => [
1036
- F(Z, {
1037
- icon: o.icon
1015
+ H(v.$slots, "icon", { button: s }, () => [
1016
+ U(Z, {
1017
+ icon: s.icon
1038
1018
  }, null, 8, ["icon"])
1039
1019
  ]),
1040
- z(" " + d(o.text), 1)
1041
- ], 8, ga))), 128))
1020
+ z(" " + c(s.text), 1)
1021
+ ], 8, ka))), 128))
1042
1022
  ])
1043
1023
  ])) : S("", !0);
1044
1024
  }
1045
- }, Sa = { class: "approvable-select" }, $a = {
1025
+ }, _a = { class: "approvable-select" }, Sa = {
1046
1026
  key: 0,
1047
1027
  class: "approvable-select-label"
1048
- }, Aa = ["value"], wa = ["value"], Ca = /* @__PURE__ */ Object.assign({
1028
+ }, $a = ["value"], Aa = ["value"], wa = /* @__PURE__ */ Object.assign({
1049
1029
  inheritAttrs: !1
1050
1030
  }, {
1051
1031
  __name: "ApprovableStatusSelect",
@@ -1060,92 +1040,92 @@ const Rt = {
1060
1040
  }),
1061
1041
  emits: /* @__PURE__ */ ue(["mounted"], ["update:modelValue"]),
1062
1042
  setup(l, { emit: y }) {
1063
- const v = y, f = Ne(l, "modelValue"), h = l, b = O([]), n = async (o) => {
1064
- let k = [{ field: "search", value: o }];
1043
+ const u = y, f = Ne(l, "modelValue"), h = l, m = O([]), n = async (s) => {
1044
+ let k = [{ field: "search", value: s }];
1065
1045
  return await new We().fetchAll({ filters: k });
1066
- }, g = (o) => String(T(o, "id") ?? T(o, "code", "")), A = (o) => T(o, "name") ?? T(o, "text", ""), C = _(() => f.value ? g(f.value) : ""), u = (o) => {
1067
- const k = o.target.value;
1068
- f.value = b.value.find(($) => g($) === k) ?? null;
1069
- }, m = async (o = null) => {
1070
- const k = await (h.getList ?? n)(o);
1071
- b.value = Array.isArray(k) ? k : [];
1046
+ }, g = (s) => String(V(s, "id") ?? V(s, "code", "")), $ = (s) => V(s, "name") ?? V(s, "text", ""), C = _(() => f.value ? g(f.value) : ""), v = (s) => {
1047
+ const k = s.target.value;
1048
+ f.value = m.value.find((A) => g(A) === k) ?? null;
1049
+ }, b = async (s = null) => {
1050
+ const k = await (h.getList ?? n)(s);
1051
+ m.value = Array.isArray(k) ? k : [];
1072
1052
  };
1073
1053
  return de(async () => {
1074
- await m(), v("mounted", { refresh: m, options: b });
1075
- }), (o, k) => (a(), s("label", Sa, [
1076
- l.label ? (a(), s("span", $a, d(l.label), 1)) : S("", !0),
1077
- t("select", te({
1054
+ await b(), u("mounted", { refresh: b, options: m });
1055
+ }), (s, k) => (t(), a("label", _a, [
1056
+ l.label ? (t(), a("span", Sa, c(l.label), 1)) : S("", !0),
1057
+ e("select", te({
1078
1058
  value: C.value,
1079
1059
  class: "approvable-select-input"
1080
- }, o.$attrs, { onChange: u }), [
1081
- k[0] || (k[0] = t("option", { value: "" }, "-", -1)),
1082
- (a(!0), s(L, null, N(b.value, ($) => (a(), s("option", {
1083
- key: g($),
1084
- value: g($)
1085
- }, d(A($)), 9, wa))), 128))
1086
- ], 16, Aa)
1060
+ }, s.$attrs, { onChange: v }), [
1061
+ k[0] || (k[0] = e("option", { value: "" }, "-", -1)),
1062
+ (t(!0), a(L, null, T(m.value, (A) => (t(), a("option", {
1063
+ key: g(A),
1064
+ value: g(A)
1065
+ }, c($(A)), 9, Aa))), 128))
1066
+ ], 16, $a)
1087
1067
  ]));
1088
1068
  }
1089
- }), Ra = { class: "approvable-select-option" }, xa = {
1069
+ }), Ca = { class: "approvable-select-option" }, Ra = {
1090
1070
  __name: "ApprovableStatusSelectOption",
1091
1071
  props: {
1092
1072
  value: {}
1093
1073
  },
1094
1074
  setup(l) {
1095
- const y = l, v = _(() => T(y.value, "name"));
1096
- return (f, h) => (a(), s("div", Ra, [
1097
- t("span", null, d(v.value), 1)
1075
+ const y = l, u = _(() => V(y.value, "name"));
1076
+ return (f, h) => (t(), a("div", Ca, [
1077
+ e("span", null, c(u.value), 1)
1098
1078
  ]));
1099
1079
  }
1100
- }, La = {
1101
- Approvable: ha,
1080
+ }, xa = {
1081
+ Approvable: fa,
1102
1082
  ApprovableCompact: $e,
1103
1083
  ApprovableStep: Ae,
1104
1084
  ApprovableStepActions: ae,
1105
- ApprovableButtons: _a,
1085
+ ApprovableButtons: ga,
1106
1086
  ApprovableStepComment: _e,
1107
1087
  ApprovableAuditTimeline: ke,
1108
1088
  ApproveStatusInfo: se,
1109
- ApprovableStatusSelect: Ca,
1110
- ApprovableStatusSelectOption: xa
1111
- }, Ma = {
1112
- install(l, { linkComponent: y = null, icons: v = null, messages: f = null, register: h = !0 } = {}) {
1113
- if (y && l.provide(Se, y), v && l.provide(ge, v), f && l.provide(ye, f), h)
1114
- for (const [b, n] of Object.entries(La))
1115
- l.component(b, n);
1089
+ ApprovableStatusSelect: wa,
1090
+ ApprovableStatusSelectOption: Ra
1091
+ }, Oa = {
1092
+ install(l, { linkComponent: y = null, icons: u = null, messages: f = null, register: h = !0 } = {}) {
1093
+ if (y && l.provide(Se, y), u && l.provide(ge, u), f && l.provide(ye, f), h)
1094
+ for (const [m, n] of Object.entries(xa))
1095
+ l.component(m, n);
1116
1096
  }
1117
1097
  };
1118
1098
  export {
1119
1099
  ge as APPROVABLE_ICON_REGISTRY,
1120
1100
  Se as APPROVABLE_LINK_COMPONENT,
1121
1101
  ye as APPROVABLE_MESSAGES,
1122
- ha as Approvable,
1102
+ fa as Approvable,
1123
1103
  ke as ApprovableAuditTimeline,
1124
- _a as ApprovableButtons,
1125
- Ta as ApprovableClient,
1104
+ ga as ApprovableButtons,
1105
+ Na as ApprovableClient,
1126
1106
  $e as ApprovableCompact,
1127
- Ca as ApprovableStatusSelect,
1128
- xa as ApprovableStatusSelectOption,
1107
+ wa as ApprovableStatusSelect,
1108
+ Ra as ApprovableStatusSelectOption,
1129
1109
  Ae as ApprovableStep,
1130
1110
  ae as ApprovableStepActions,
1131
1111
  _e as ApprovableStepComment,
1132
1112
  se as ApproveStatusInfo,
1133
- Va as approvableActionRenderer,
1134
- ja as approvableActionSlotName,
1135
- Ba as axiosAdapter,
1136
- Pa as configureApprovableClient,
1137
- Ma as default,
1138
- qa as fetchAdapter,
1139
- Ka as getApprovableClient,
1140
- Ua as isClassIcon,
1141
- Fa as isRegisteredIcon,
1142
- Ga as isUrlIcon,
1113
+ Ta as approvableActionRenderer,
1114
+ Va as approvableActionSlotName,
1115
+ ja as axiosAdapter,
1116
+ Ba as configureApprovableClient,
1117
+ Oa as default,
1118
+ Pa as fetchAdapter,
1119
+ qa as getApprovableClient,
1120
+ Ka as isClassIcon,
1121
+ Ha as isRegisteredIcon,
1122
+ Ua as isUrlIcon,
1143
1123
  Ct as linkProps,
1144
- Oa as registerApprovableActionRenderer,
1145
- za as setApprovableClient,
1146
- Ha as unregisterApprovableActionRenderer,
1124
+ Da as registerApprovableActionRenderer,
1125
+ Fa as setApprovableClient,
1126
+ Ga as unregisterApprovableActionRenderer,
1147
1127
  ft as useIconRegistry,
1148
1128
  wt as useLinkComponent,
1149
- G as useMessages
1129
+ F as useMessages
1150
1130
  };
1151
1131
  //# sourceMappingURL=approvable-vue.mjs.map