@stsdti/approvable-vue 0.1.6 → 0.1.11
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/approvable-vue.mjs +815 -584
- package/dist/approvable-vue.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/approvable/Approvable.vue +177 -62
- package/src/components/approvable/ApprovableCompact.vue +130 -0
- package/src/components/approvable/ApprovableStep.vue +9 -95
- package/src/components/approvable/ApprovableStepActions.vue +135 -0
- package/src/index.js +6 -0
- package/src/themes/approvable.css +179 -0
package/dist/approvable-vue.mjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { mergeMessages as
|
|
3
|
-
import { ApprovableClient as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
return
|
|
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";
|
|
4
|
+
const ye = Symbol("approvable.messages");
|
|
5
|
+
function G() {
|
|
6
|
+
return Te(ee(ye, null));
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const Qe = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "approvable-timeline-header"
|
|
11
|
-
},
|
|
11
|
+
}, Ye = { class: "approvable-timeline-eyebrow" }, Je = { class: "approvable-timeline-title" }, Xe = ["disabled"], Ze = {
|
|
12
12
|
key: 1,
|
|
13
13
|
class: "approvable-timeline-state",
|
|
14
14
|
role: "status"
|
|
15
|
-
},
|
|
15
|
+
}, et = {
|
|
16
16
|
key: 2,
|
|
17
17
|
class: "approvable-timeline-error"
|
|
18
|
-
},
|
|
18
|
+
}, tt = {
|
|
19
19
|
key: 3,
|
|
20
20
|
class: "approvable-timeline-state"
|
|
21
|
-
},
|
|
21
|
+
}, at = { class: "approvable-timeline-list" }, st = ["stroke-width"], ot = ["d"], lt = { class: "approvable-timeline-content" }, nt = { class: "approvable-timeline-line" }, rt = { class: "approvable-timeline-actor" }, it = { class: "approvable-timeline-operation" }, pt = { class: "approvable-timeline-time" }, ut = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "approvable-timeline-comment"
|
|
24
|
-
},
|
|
24
|
+
}, vt = {
|
|
25
25
|
key: 1,
|
|
26
26
|
class: "approvable-timeline-change"
|
|
27
|
-
},
|
|
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 = {
|
|
28
28
|
__name: "ApprovableAuditTimeline",
|
|
29
29
|
props: {
|
|
30
30
|
approvableId: { type: [Number, String], required: !0 },
|
|
@@ -32,13 +32,13 @@ const Ue = {
|
|
|
32
32
|
showHeader: { type: Boolean, default: !0 }
|
|
33
33
|
},
|
|
34
34
|
emits: ["loaded"],
|
|
35
|
-
setup(
|
|
36
|
-
const f =
|
|
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 = {
|
|
37
37
|
approvable_status_name: "Status",
|
|
38
38
|
comment: "Comment",
|
|
39
39
|
responsible: "Assigned to",
|
|
40
40
|
is_active: "Active step"
|
|
41
|
-
},
|
|
41
|
+
}, m = {
|
|
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,177 +47,177 @@ const Ue = {
|
|
|
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
|
-
},
|
|
51
|
-
const
|
|
52
|
-
for (const
|
|
53
|
-
const
|
|
54
|
-
|
|
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);
|
|
55
55
|
}
|
|
56
|
-
return [...
|
|
57
|
-
const
|
|
56
|
+
return [...i.values()].map((p) => {
|
|
57
|
+
const c = p[0], x = $(c), W = p.flatMap(R);
|
|
58
58
|
return {
|
|
59
|
-
id:
|
|
60
|
-
entries:
|
|
61
|
-
audit:
|
|
62
|
-
kind:
|
|
59
|
+
id: c.request_id || `audit-${c.id}`,
|
|
60
|
+
entries: p,
|
|
61
|
+
audit: c,
|
|
62
|
+
kind: x,
|
|
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--${
|
|
67
|
-
icon: x
|
|
68
|
-
isQuiet:
|
|
69
|
-
isSingleLine:
|
|
66
|
+
kindClass: `approvable-timeline-marker--${x}`,
|
|
67
|
+
icon: m[x],
|
|
68
|
+
isQuiet: o.has(x),
|
|
69
|
+
isSingleLine: W.length === 0
|
|
70
70
|
};
|
|
71
|
-
}).sort((
|
|
71
|
+
}).sort((p, c) => new Date(c.audit.created_at) - new Date(p.audit.created_at));
|
|
72
72
|
});
|
|
73
|
-
function
|
|
74
|
-
var
|
|
75
|
-
const
|
|
76
|
-
return
|
|
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";
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
var
|
|
80
|
-
const
|
|
81
|
-
return
|
|
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;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
var
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
return
|
|
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;
|
|
89
89
|
}
|
|
90
|
-
if (((
|
|
91
|
-
if (((
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
return
|
|
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";
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
return
|
|
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";
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
const
|
|
101
|
-
return Object.keys(
|
|
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);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
return
|
|
103
|
+
function D(e) {
|
|
104
|
+
return e.oldValue !== void 0 && e.oldValue !== null && e.oldValue !== "";
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
if (
|
|
108
|
-
if (typeof
|
|
109
|
-
if (Array.isArray(
|
|
110
|
-
const
|
|
111
|
-
return
|
|
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;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
if (!
|
|
115
|
-
const
|
|
116
|
-
return Number.isNaN(
|
|
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, {
|
|
117
117
|
dateStyle: "medium",
|
|
118
118
|
timeStyle: "short"
|
|
119
|
-
}).format(
|
|
119
|
+
}).format(i);
|
|
120
120
|
}
|
|
121
|
-
async function
|
|
122
|
-
var
|
|
121
|
+
async function E() {
|
|
122
|
+
var e, i;
|
|
123
123
|
if (!f.approvableId) {
|
|
124
|
-
|
|
124
|
+
g.value = [], A.value = !1, C.value = "The approval history is unavailable because the approvable has no id.";
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
A.value = !0, C.value = "";
|
|
128
128
|
try {
|
|
129
|
-
const
|
|
130
|
-
if (!
|
|
131
|
-
throw new Error(((
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
} catch (
|
|
135
|
-
|
|
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.";
|
|
136
136
|
} finally {
|
|
137
|
-
|
|
137
|
+
A.value = !1;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
const
|
|
141
|
-
return
|
|
142
|
-
class:
|
|
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"])
|
|
143
143
|
}, [
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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", {
|
|
148
148
|
type: "button",
|
|
149
149
|
class: "approvable-timeline-refresh",
|
|
150
|
-
disabled:
|
|
151
|
-
onClick:
|
|
152
|
-
}, d(
|
|
153
|
-
])) :
|
|
154
|
-
|
|
155
|
-
|
|
150
|
+
disabled: A.value,
|
|
151
|
+
onClick: E
|
|
152
|
+
}, d(A.value ? "Loading…" : "Refresh"), 9, Xe)
|
|
153
|
+
])) : S("", !0),
|
|
154
|
+
A.value ? (a(), s("div", Ze, [...i[0] || (i[0] = [
|
|
155
|
+
t("span", {
|
|
156
156
|
class: "approvable-spinner",
|
|
157
157
|
"aria-hidden": "true"
|
|
158
158
|
}, null, -1),
|
|
159
|
-
|
|
160
|
-
])])) :
|
|
161
|
-
|
|
162
|
-
(
|
|
163
|
-
key:
|
|
164
|
-
class:
|
|
165
|
-
"approvable-timeline-item--single-line":
|
|
166
|
-
"approvable-timeline-item--quiet":
|
|
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
|
|
167
167
|
}])
|
|
168
168
|
}, [
|
|
169
|
-
|
|
170
|
-
class:
|
|
169
|
+
t("span", {
|
|
170
|
+
class: V(["approvable-timeline-marker", p.kindClass])
|
|
171
171
|
}, [
|
|
172
|
-
(
|
|
172
|
+
(a(), s("svg", {
|
|
173
173
|
fill: "none",
|
|
174
174
|
stroke: "currentColor",
|
|
175
|
-
"stroke-width":
|
|
175
|
+
"stroke-width": p.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
|
-
(
|
|
182
|
-
key:
|
|
183
|
-
d:
|
|
184
|
-
}, null, 8,
|
|
185
|
-
], 8,
|
|
181
|
+
(a(!0), s(L, null, N(p.icon.paths, (c, x) => (a(), s("path", {
|
|
182
|
+
key: x,
|
|
183
|
+
d: c
|
|
184
|
+
}, null, 8, ot))), 128))
|
|
185
|
+
], 8, st))
|
|
186
186
|
], 2),
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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)
|
|
192
192
|
]),
|
|
193
|
-
(
|
|
194
|
-
key:
|
|
193
|
+
(a(!0), s(L, null, N(p.entries, (c) => (a(), s(L, {
|
|
194
|
+
key: c.id
|
|
195
195
|
}, [
|
|
196
|
-
(
|
|
197
|
-
key: `${
|
|
196
|
+
(a(!0), s(L, null, N(R(c), (x) => (a(), s(L, {
|
|
197
|
+
key: `${c.id}-${x.key}`
|
|
198
198
|
}, [
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
], 64)) :
|
|
205
|
-
|
|
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))
|
|
204
|
+
], 64)) : S("", !0),
|
|
205
|
+
t("span", bt, d(P(x.newValue)), 1)
|
|
206
206
|
]))
|
|
207
207
|
], 64))), 128))
|
|
208
208
|
], 64))), 128))
|
|
209
209
|
])
|
|
210
210
|
], 2))), 128))
|
|
211
211
|
]),
|
|
212
|
-
|
|
213
|
-
], 64)) : (
|
|
212
|
+
t("p", mt, d(w(b).allEventsShown), 1)
|
|
213
|
+
], 64)) : (a(), s("p", tt, "No approval activity yet."))
|
|
214
214
|
], 2));
|
|
215
215
|
}
|
|
216
|
-
},
|
|
217
|
-
function
|
|
218
|
-
return
|
|
216
|
+
}, ge = Symbol("approvable.iconRegistry");
|
|
217
|
+
function ft() {
|
|
218
|
+
return ee(ge, {});
|
|
219
219
|
}
|
|
220
|
-
const
|
|
220
|
+
const ht = ["src"], Z = {
|
|
221
221
|
__name: "ApprovableIcon",
|
|
222
222
|
props: {
|
|
223
223
|
icon: {
|
|
@@ -225,31 +225,31 @@ const dt = ["src"], J = {
|
|
|
225
225
|
default: ""
|
|
226
226
|
}
|
|
227
227
|
},
|
|
228
|
-
setup(
|
|
229
|
-
const
|
|
230
|
-
return (
|
|
228
|
+
setup(l) {
|
|
229
|
+
const y = ft();
|
|
230
|
+
return (v, f) => w(je)(w(y), l.icon) ? (a(), B(J(w(y)[l.icon]), {
|
|
231
231
|
key: 0,
|
|
232
232
|
class: "approvable-btn-icon"
|
|
233
|
-
})) :
|
|
233
|
+
})) : w(Be)(l.icon) ? (a(), s("img", {
|
|
234
234
|
key: 1,
|
|
235
|
-
src:
|
|
235
|
+
src: l.icon,
|
|
236
236
|
alt: "",
|
|
237
237
|
class: "approvable-btn-icon"
|
|
238
|
-
}, null, 8,
|
|
238
|
+
}, null, 8, ht)) : w(Pe)(l.icon) ? (a(), s("i", {
|
|
239
239
|
key: 2,
|
|
240
|
-
class:
|
|
241
|
-
}, null, 2)) :
|
|
240
|
+
class: V(l.icon)
|
|
241
|
+
}, null, 2)) : S("", !0);
|
|
242
242
|
}
|
|
243
|
-
},
|
|
243
|
+
}, yt = ["title"], kt = {
|
|
244
244
|
key: 0,
|
|
245
245
|
class: "approvable-popover-panel"
|
|
246
|
-
},
|
|
246
|
+
}, gt = {
|
|
247
247
|
key: 0,
|
|
248
248
|
class: "approvable-loading"
|
|
249
|
-
},
|
|
249
|
+
}, _t = { class: "approvable-popover-title" }, St = {
|
|
250
250
|
key: 1,
|
|
251
251
|
class: "approvable-popover-meta"
|
|
252
|
-
},
|
|
252
|
+
}, $t = { class: "approvable-popover-author" }, At = { class: "approvable-popover-actions" }, _e = {
|
|
253
253
|
__name: "ApprovableStepComment",
|
|
254
254
|
props: {
|
|
255
255
|
approvableStep: {
|
|
@@ -261,56 +261,56 @@ const dt = ["src"], J = {
|
|
|
261
261
|
}
|
|
262
262
|
},
|
|
263
263
|
emits: ["isLoading", "refresh"],
|
|
264
|
-
setup(
|
|
265
|
-
const
|
|
266
|
-
function
|
|
267
|
-
|
|
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();
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
|
|
269
|
+
function m() {
|
|
270
|
+
A.value = T(v.approvableStep, "comment"), n.value = !0, xe(k);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
|
|
272
|
+
function o() {
|
|
273
|
+
n.value = !1;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
const
|
|
277
|
-
|
|
275
|
+
function k() {
|
|
276
|
+
const R = b.value;
|
|
277
|
+
R && (R.style.height = "auto", R.style.height = `${R.scrollHeight}px`);
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
|
|
279
|
+
function $(R) {
|
|
280
|
+
n.value && h.value && !h.value.contains(R.target) && o();
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
|
|
282
|
+
function I(R) {
|
|
283
|
+
R.key === "Escape" && o();
|
|
284
284
|
}
|
|
285
|
-
|
|
286
|
-
document.addEventListener("click",
|
|
287
|
-
}),
|
|
288
|
-
document.removeEventListener("click",
|
|
285
|
+
de(() => {
|
|
286
|
+
document.addEventListener("click", $), document.addEventListener("keydown", I);
|
|
287
|
+
}), we(() => {
|
|
288
|
+
document.removeEventListener("click", $), document.removeEventListener("keydown", I);
|
|
289
289
|
});
|
|
290
|
-
const
|
|
291
|
-
async function
|
|
292
|
-
if (!
|
|
293
|
-
|
|
290
|
+
const M = G();
|
|
291
|
+
async function j() {
|
|
292
|
+
if (!T(v.approvableStep, "comment") && !A.value) {
|
|
293
|
+
ve(M.commentRequired);
|
|
294
294
|
return;
|
|
295
295
|
}
|
|
296
|
-
|
|
297
|
-
const
|
|
298
|
-
comment:
|
|
299
|
-
},
|
|
300
|
-
|
|
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);
|
|
301
301
|
}
|
|
302
|
-
return (
|
|
302
|
+
return (R, D) => (a(), s("div", {
|
|
303
303
|
ref_key: "rootRef",
|
|
304
304
|
ref: h,
|
|
305
305
|
class: "approvable-popover"
|
|
306
306
|
}, [
|
|
307
|
-
|
|
307
|
+
t("button", {
|
|
308
308
|
class: "approvable-btn",
|
|
309
|
-
title:
|
|
309
|
+
title: w(M).comments,
|
|
310
310
|
type: "button",
|
|
311
|
-
onClick:
|
|
312
|
-
}, [...
|
|
313
|
-
|
|
311
|
+
onClick: u
|
|
312
|
+
}, [...D[1] || (D[1] = [
|
|
313
|
+
t("svg", {
|
|
314
314
|
xmlns: "http://www.w3.org/2000/svg",
|
|
315
315
|
width: "16",
|
|
316
316
|
height: "16",
|
|
@@ -322,54 +322,276 @@ const dt = ["src"], J = {
|
|
|
322
322
|
"stroke-linejoin": "round",
|
|
323
323
|
"aria-hidden": "true"
|
|
324
324
|
}, [
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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" })
|
|
328
328
|
], -1)
|
|
329
|
-
])], 8,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
])])) :
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
])) :
|
|
339
|
-
|
|
340
|
-
|
|
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)
|
|
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)
|
|
338
|
+
])) : S("", !0),
|
|
339
|
+
l.disabled ? S("", !0) : (a(), s(L, { key: 2 }, [
|
|
340
|
+
Ce(t("textarea", {
|
|
341
341
|
ref_key: "textareaRef",
|
|
342
|
-
ref:
|
|
343
|
-
"onUpdate:modelValue":
|
|
342
|
+
ref: b,
|
|
343
|
+
"onUpdate:modelValue": D[0] || (D[0] = (P) => A.value = P),
|
|
344
344
|
class: "approvable-textarea",
|
|
345
345
|
rows: "1",
|
|
346
|
-
onInput:
|
|
346
|
+
onInput: k
|
|
347
347
|
}, null, 544), [
|
|
348
|
-
[
|
|
348
|
+
[Re, A.value]
|
|
349
349
|
]),
|
|
350
|
-
|
|
351
|
-
|
|
350
|
+
t("div", At, [
|
|
351
|
+
t("button", {
|
|
352
352
|
class: "approvable-btn approvable-btn--primary",
|
|
353
353
|
type: "button",
|
|
354
|
-
onClick:
|
|
355
|
-
}, d(
|
|
354
|
+
onClick: j
|
|
355
|
+
}, d(w(M).save), 1)
|
|
356
356
|
])
|
|
357
357
|
], 64))
|
|
358
|
-
])) :
|
|
358
|
+
])) : S("", !0)
|
|
359
359
|
], 512));
|
|
360
360
|
}
|
|
361
361
|
};
|
|
362
|
-
function
|
|
363
|
-
return
|
|
362
|
+
function Oa(l, y) {
|
|
363
|
+
return qe(l, Le(y));
|
|
364
364
|
}
|
|
365
|
-
const
|
|
366
|
-
function
|
|
367
|
-
return
|
|
365
|
+
const Se = Symbol("approvable.linkComponent");
|
|
366
|
+
function wt() {
|
|
367
|
+
return ee(Se, "a");
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
return
|
|
369
|
+
function Ct(l, y) {
|
|
370
|
+
return l === "a" ? { href: y } : { to: y };
|
|
371
371
|
}
|
|
372
|
-
const
|
|
372
|
+
const Rt = {
|
|
373
|
+
key: 0,
|
|
374
|
+
class: "approvable-step-actions"
|
|
375
|
+
}, xt = { class: "approvable-btn-group" }, Lt = ["title", "onClick"], Et = ["title", "onClick"], Dt = {
|
|
376
|
+
key: 0,
|
|
377
|
+
class: "approvable-btn-group"
|
|
378
|
+
}, ae = {
|
|
379
|
+
__name: "ApprovableStepActions",
|
|
380
|
+
props: {
|
|
381
|
+
value: {
|
|
382
|
+
type: Object,
|
|
383
|
+
required: !0
|
|
384
|
+
},
|
|
385
|
+
approvable: {
|
|
386
|
+
type: Object,
|
|
387
|
+
required: !0
|
|
388
|
+
},
|
|
389
|
+
resource: {
|
|
390
|
+
type: Object,
|
|
391
|
+
required: !0
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
emits: ["isLoading", "refresh"],
|
|
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) => ({
|
|
397
|
+
"approvable-btn": !0,
|
|
398
|
+
// A button carrying only an icon collapses to a circle, so the row keeps its
|
|
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
|
|
408
|
+
});
|
|
409
|
+
v("isLoading", !1), m.skipped || v("refresh");
|
|
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
|
|
415
|
+
}, [
|
|
416
|
+
A(o) ? (a(), B(J(A(o)), {
|
|
417
|
+
key: 0,
|
|
418
|
+
"action-ui": o.action_ui,
|
|
419
|
+
approvable: l.approvable,
|
|
420
|
+
button: o,
|
|
421
|
+
buttons: [o],
|
|
422
|
+
complete: C,
|
|
423
|
+
resource: l.resource,
|
|
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({
|
|
428
|
+
key: 1,
|
|
429
|
+
ref_for: !0
|
|
430
|
+
}, w(Ct)(w(h), o.link)), {
|
|
431
|
+
default: X(() => [
|
|
432
|
+
t("button", {
|
|
433
|
+
title: o.tooltip,
|
|
434
|
+
class: V(g(o)),
|
|
435
|
+
type: "button",
|
|
436
|
+
onClick: ($) => C(o)
|
|
437
|
+
}, [
|
|
438
|
+
F(Z, {
|
|
439
|
+
icon: o.icon
|
|
440
|
+
}, null, 8, ["icon"])
|
|
441
|
+
], 10, Lt)
|
|
442
|
+
]),
|
|
443
|
+
_: 2
|
|
444
|
+
}, 1040)) : (a(), s("button", {
|
|
445
|
+
key: 2,
|
|
446
|
+
title: o.tooltip,
|
|
447
|
+
class: V(g(o)),
|
|
448
|
+
type: "button",
|
|
449
|
+
onClick: ($) => C(o)
|
|
450
|
+
}, [
|
|
451
|
+
F(Z, {
|
|
452
|
+
icon: o.icon
|
|
453
|
+
}, null, 8, ["icon"]),
|
|
454
|
+
z(" " + d(o.text), 1)
|
|
455
|
+
], 10, Et))
|
|
456
|
+
], 64))), 128))
|
|
457
|
+
]),
|
|
458
|
+
l.value.can_comment ? (a(), s("div", Dt, [
|
|
459
|
+
F(_e, {
|
|
460
|
+
"approvable-step": l.value,
|
|
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))
|
|
464
|
+
}, null, 8, ["approvable-step", "disabled"])
|
|
465
|
+
])) : S("", !0)
|
|
466
|
+
])) : S("", !0);
|
|
467
|
+
}
|
|
468
|
+
}, se = {
|
|
469
|
+
__name: "ApproveStatusInfo",
|
|
470
|
+
props: {
|
|
471
|
+
value: {
|
|
472
|
+
required: !0
|
|
473
|
+
},
|
|
474
|
+
label: {
|
|
475
|
+
default: null
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
setup(l) {
|
|
479
|
+
const y = l, v = _(() => {
|
|
480
|
+
const h = T(y.value, "code", " - ");
|
|
481
|
+
return {
|
|
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),
|
|
488
|
+
"approvable-badge--empty": h === " - "
|
|
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));
|
|
494
|
+
}
|
|
495
|
+
}, Ot = { class: "approvable-compact" }, Mt = { class: "approvable-compact-main" }, It = { class: "approvable-compact-line" }, Nt = ["aria-label"], Tt = ["title"], Vt = {
|
|
496
|
+
key: 0,
|
|
497
|
+
class: "approvable-compact-who"
|
|
498
|
+
}, jt = { class: "approvable-compact-name" }, Bt = { class: "approvable-compact-side" }, Pt = ["aria-label", "title"], $e = {
|
|
499
|
+
__name: "ApprovableCompact",
|
|
500
|
+
props: {
|
|
501
|
+
value: {
|
|
502
|
+
type: Object,
|
|
503
|
+
required: !0
|
|
504
|
+
},
|
|
505
|
+
showApprovableStatus: { type: Boolean, default: !0 }
|
|
506
|
+
},
|
|
507
|
+
emits: ["expand", "isLoading", "refresh"],
|
|
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, {
|
|
510
|
+
current: n.value.focusStepNumber ?? 0,
|
|
511
|
+
total: n.value.stepCount
|
|
512
|
+
})), C = (m) => ({
|
|
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
|
|
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, {
|
|
524
|
+
key: 0,
|
|
525
|
+
label: b.value.statusName,
|
|
526
|
+
value: b.value.status
|
|
527
|
+
}, null, 8, ["label", "value"])) : S("", !0),
|
|
528
|
+
n.value.dots.length ? (a(), s("span", {
|
|
529
|
+
key: 1,
|
|
530
|
+
class: "approvable-compact-dots",
|
|
531
|
+
role: "img",
|
|
532
|
+
"aria-label": A.value
|
|
533
|
+
}, [
|
|
534
|
+
(a(!0), s(L, null, N(n.value.dots, (k) => (a(), s("span", {
|
|
535
|
+
key: k.id,
|
|
536
|
+
class: V(C(k)),
|
|
537
|
+
title: u(k)
|
|
538
|
+
}, null, 10, Tt))), 128))
|
|
539
|
+
], 8, Nt)) : S("", !0)
|
|
540
|
+
]),
|
|
541
|
+
g.value ? (a(), s("p", Vt, [
|
|
542
|
+
U(m.$slots, "approvableStepInfo", {
|
|
543
|
+
step: n.value.focusStep
|
|
544
|
+
}, () => [
|
|
545
|
+
t("span", jt, d(g.value.approverName), 1)
|
|
546
|
+
]),
|
|
547
|
+
U(m.$slots, "approvableStepRole", {
|
|
548
|
+
role: g.value.approverRole,
|
|
549
|
+
step: n.value.focusStep
|
|
550
|
+
}, () => [
|
|
551
|
+
g.value.approverRole ? (a(), s(L, { key: 0 }, [
|
|
552
|
+
o[3] || (o[3] = t("span", {
|
|
553
|
+
"aria-hidden": "true",
|
|
554
|
+
class: "approvable-compact-sep"
|
|
555
|
+
}, "·", -1)),
|
|
556
|
+
z(d(g.value.approverRole), 1)
|
|
557
|
+
], 64)) : S("", !0)
|
|
558
|
+
])
|
|
559
|
+
])) : S("", !0)
|
|
560
|
+
]),
|
|
561
|
+
t("div", Bt, [
|
|
562
|
+
n.value.hasActiveStep && n.value.focusStep ? (a(), B(ae, {
|
|
563
|
+
key: 0,
|
|
564
|
+
approvable: b.value.approvable,
|
|
565
|
+
resource: l.value,
|
|
566
|
+
value: n.value.focusStep,
|
|
567
|
+
onIsLoading: o[0] || (o[0] = (k) => f("isLoading", k)),
|
|
568
|
+
onRefresh: o[1] || (o[1] = (k) => f("refresh"))
|
|
569
|
+
}, null, 8, ["approvable", "resource", "value"])) : S("", !0),
|
|
570
|
+
t("button", {
|
|
571
|
+
type: "button",
|
|
572
|
+
class: "approvable-compact-toggle",
|
|
573
|
+
"aria-expanded": !1,
|
|
574
|
+
"aria-label": w(h).compactExpand,
|
|
575
|
+
title: w(h).compactExpand,
|
|
576
|
+
onClick: o[2] || (o[2] = (k) => f("expand"))
|
|
577
|
+
}, [...o[4] || (o[4] = [
|
|
578
|
+
t("svg", {
|
|
579
|
+
"aria-hidden": "true",
|
|
580
|
+
class: "approvable-icon",
|
|
581
|
+
fill: "none",
|
|
582
|
+
stroke: "currentColor",
|
|
583
|
+
"stroke-linecap": "round",
|
|
584
|
+
"stroke-linejoin": "round",
|
|
585
|
+
"stroke-width": "2",
|
|
586
|
+
viewBox: "0 0 16 16"
|
|
587
|
+
}, [
|
|
588
|
+
t("path", { d: "M4.5 6.4 8 9.9l3.5-3.5" })
|
|
589
|
+
], -1)
|
|
590
|
+
])], 8, Pt)
|
|
591
|
+
])
|
|
592
|
+
]));
|
|
593
|
+
}
|
|
594
|
+
}, qt = {
|
|
373
595
|
key: 0,
|
|
374
596
|
"aria-hidden": "true",
|
|
375
597
|
fill: "none",
|
|
@@ -377,25 +599,19 @@ const gt = {
|
|
|
377
599
|
"stroke-linecap": "round",
|
|
378
600
|
"stroke-linejoin": "round",
|
|
379
601
|
viewBox: "0 0 16 16"
|
|
380
|
-
},
|
|
602
|
+
}, Kt = ["d", "stroke-width"], Ut = { class: "approvable-step-body" }, Ft = { class: "approvable-step-line" }, Gt = { class: "approvable-step-name" }, zt = ["title"], Ht = {
|
|
381
603
|
key: 1,
|
|
382
604
|
class: "approvable-step-spacer"
|
|
383
|
-
},
|
|
605
|
+
}, Wt = {
|
|
384
606
|
key: 0,
|
|
385
607
|
class: "approvable-step-status"
|
|
386
|
-
},
|
|
608
|
+
}, Qt = { key: 0 }, Yt = {
|
|
387
609
|
key: 1,
|
|
388
610
|
class: "approvable-step-date"
|
|
389
|
-
},
|
|
390
|
-
key: 1,
|
|
391
|
-
class: "approvable-step-actions"
|
|
392
|
-
}, Ot = { class: "approvable-btn-group" }, Mt = ["title", "onClick"], It = ["title", "onClick"], Tt = {
|
|
393
|
-
key: 0,
|
|
394
|
-
class: "approvable-btn-group"
|
|
395
|
-
}, Nt = {
|
|
611
|
+
}, Jt = {
|
|
396
612
|
key: 0,
|
|
397
613
|
class: "approvable-step-comment"
|
|
398
|
-
},
|
|
614
|
+
}, Xt = ["title"], Zt = ["aria-expanded"], Ae = {
|
|
399
615
|
__name: "ApprovableStep",
|
|
400
616
|
props: {
|
|
401
617
|
value: {
|
|
@@ -412,323 +628,334 @@ const gt = {
|
|
|
412
628
|
}
|
|
413
629
|
},
|
|
414
630
|
emits: ["isLoading", "refresh"],
|
|
415
|
-
setup(
|
|
416
|
-
const
|
|
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 = _(() => ({
|
|
417
633
|
"approvable-step": !0,
|
|
418
634
|
"approvable-step--active": n.value.isActive,
|
|
419
635
|
// A step nobody has reached yet is dimmed; one with an outcome is not.
|
|
420
|
-
"approvable-step--pending": !n.value.isActive && !
|
|
421
|
-
[`approvable-step--${
|
|
636
|
+
"approvable-step--pending": !n.value.isActive && !g.value,
|
|
637
|
+
[`approvable-step--${g.value}`]: !!g.value,
|
|
422
638
|
// Nothing wraps below the name, so the row can hold to a single line.
|
|
423
|
-
"approvable-step--single-line": !
|
|
424
|
-
})),
|
|
639
|
+
"approvable-step--single-line": !A.value && !n.value.comment.text
|
|
640
|
+
})), m = {
|
|
425
641
|
check: { d: "M4 8.4l2.8 2.8 5.4-6", width: 2.8 },
|
|
426
642
|
cross: { d: "M5.2 5.2l5.6 5.6M10.8 5.2l-5.6 5.6", width: 2.4 },
|
|
427
643
|
dash: { d: "M4.4 8h7.2", width: 2.2 }
|
|
428
|
-
},
|
|
644
|
+
}, o = {
|
|
429
645
|
check: "success",
|
|
430
646
|
cross: "danger",
|
|
431
647
|
dash: "muted",
|
|
432
648
|
ring: "ring",
|
|
433
649
|
pending: "pending"
|
|
434
|
-
},
|
|
650
|
+
}, k = _(() => ze(g.value, n.value.isActive)), $ = _(() => m[k.value] ?? null), I = _(() => ({
|
|
435
651
|
"approvable-step-disc": !0,
|
|
436
|
-
[`approvable-step-disc--${
|
|
437
|
-
})),
|
|
438
|
-
|
|
439
|
-
// A button carrying only an icon collapses to a circle, so the row keeps its
|
|
440
|
-
// rhythm instead of stretching around an empty label.
|
|
441
|
-
"approvable-btn--icon": !I.text,
|
|
442
|
-
"approvable-btn--primary": I.result === "approved"
|
|
443
|
-
}), E = (I) => n.value.isActive ? Be(I == null ? void 0 : I.action_ui) : null, j = async (I) => {
|
|
444
|
-
m("isLoading", !0);
|
|
445
|
-
const M = await Pe({
|
|
446
|
-
stepId: n.value.id,
|
|
447
|
-
button: I,
|
|
448
|
-
buttons: n.value.buttons
|
|
449
|
-
});
|
|
450
|
-
m("isLoading", !1), M.skipped || m("refresh");
|
|
451
|
-
};
|
|
452
|
-
return (I, M) => n.value.isVisible ? (t(), s("li", {
|
|
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", {
|
|
453
655
|
key: 0,
|
|
454
|
-
class:
|
|
656
|
+
class: V(u.value)
|
|
455
657
|
}, [
|
|
456
|
-
|
|
457
|
-
class:
|
|
658
|
+
t("span", {
|
|
659
|
+
class: V(I.value)
|
|
458
660
|
}, [
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
d:
|
|
462
|
-
"stroke-width":
|
|
463
|
-
}, null, 8,
|
|
464
|
-
])) :
|
|
661
|
+
$.value ? (a(), s("svg", qt, [
|
|
662
|
+
t("path", {
|
|
663
|
+
d: $.value.d,
|
|
664
|
+
"stroke-width": $.value.width
|
|
665
|
+
}, null, 8, Kt)
|
|
666
|
+
])) : S("", !0)
|
|
465
667
|
], 2),
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
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)
|
|
470
672
|
]),
|
|
471
|
-
|
|
472
|
-
step:
|
|
673
|
+
U(j.$slots, "approvableStepRole", {
|
|
674
|
+
step: l.value,
|
|
473
675
|
role: n.value.approverRole
|
|
474
676
|
}, () => [
|
|
475
|
-
n.value.approverRole ? (
|
|
677
|
+
n.value.approverRole ? (a(), s("span", {
|
|
476
678
|
key: 0,
|
|
477
679
|
title: n.value.approverRole,
|
|
478
680
|
class: "approvable-step-role"
|
|
479
|
-
}, d(n.value.approverRole), 9,
|
|
681
|
+
}, d(n.value.approverRole), 9, zt)) : (a(), s("span", Ht))
|
|
480
682
|
]),
|
|
481
|
-
|
|
482
|
-
n.value.statusName ? (
|
|
483
|
-
n.value.performedAt ? (
|
|
484
|
-
])) :
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
"action-ui": S.action_ui,
|
|
493
|
-
approvable: o.approvable,
|
|
494
|
-
button: S,
|
|
495
|
-
buttons: [S],
|
|
496
|
-
complete: j,
|
|
497
|
-
resource: o.resource,
|
|
498
|
-
step: o.value,
|
|
499
|
-
onIsLoading: M[0] || (M[0] = (r) => m("isLoading", r)),
|
|
500
|
-
onRefresh: M[1] || (M[1] = (r) => m("refresh"))
|
|
501
|
-
}, null, 40, ["action-ui", "approvable", "button", "buttons", "resource", "step"])) : S.link ? (t(), K(Y(C(h)), Z({
|
|
502
|
-
key: 1,
|
|
503
|
-
ref_for: !0
|
|
504
|
-
}, C(kt)(C(h), S.link)), {
|
|
505
|
-
default: pe(() => [
|
|
506
|
-
e("button", {
|
|
507
|
-
title: S.tooltip,
|
|
508
|
-
class: B(u(S)),
|
|
509
|
-
type: "button",
|
|
510
|
-
onClick: (r) => j(S)
|
|
511
|
-
}, [
|
|
512
|
-
U(J, {
|
|
513
|
-
icon: S.icon
|
|
514
|
-
}, null, 8, ["icon"])
|
|
515
|
-
], 10, Mt)
|
|
516
|
-
]),
|
|
517
|
-
_: 2
|
|
518
|
-
}, 1040)) : (t(), s("button", {
|
|
519
|
-
key: 2,
|
|
520
|
-
title: S.tooltip,
|
|
521
|
-
class: B(u(S)),
|
|
522
|
-
type: "button",
|
|
523
|
-
onClick: (r) => j(S)
|
|
524
|
-
}, [
|
|
525
|
-
U(J, {
|
|
526
|
-
icon: S.icon
|
|
527
|
-
}, null, 8, ["icon"]),
|
|
528
|
-
Q(" " + d(S.text), 1)
|
|
529
|
-
], 10, It))
|
|
530
|
-
], 64))), 128))
|
|
531
|
-
]),
|
|
532
|
-
o.value.can_comment ? (t(), s("div", Tt, [
|
|
533
|
-
U(fe, {
|
|
534
|
-
"approvable-step": o.value,
|
|
535
|
-
disabled: !o.value.can_comment,
|
|
536
|
-
onRefresh: M[2] || (M[2] = (S) => m("refresh")),
|
|
537
|
-
onIsLoading: M[3] || (M[3] = (S) => m("isLoading", S))
|
|
538
|
-
}, null, 8, ["approvable-step", "disabled"])
|
|
539
|
-
])) : k("", !0)
|
|
540
|
-
])) : k("", !0)
|
|
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)
|
|
686
|
+
])) : S("", !0),
|
|
687
|
+
F(ae, {
|
|
688
|
+
approvable: l.approvable,
|
|
689
|
+
resource: l.resource,
|
|
690
|
+
value: l.value,
|
|
691
|
+
onIsLoading: R[0] || (R[0] = (D) => v("isLoading", D)),
|
|
692
|
+
onRefresh: R[1] || (R[1] = (D) => v("refresh"))
|
|
693
|
+
}, null, 8, ["approvable", "resource", "value"])
|
|
541
694
|
]),
|
|
542
|
-
n.value.comment.text ? (
|
|
543
|
-
|
|
695
|
+
n.value.comment.text ? (a(), s("p", Jt, [
|
|
696
|
+
t("span", {
|
|
544
697
|
title: n.value.comment.title
|
|
545
|
-
}, d(
|
|
546
|
-
n.value.comment.isTrimmed ? (
|
|
698
|
+
}, d(M.value), 9, Xt),
|
|
699
|
+
n.value.comment.isTrimmed ? (a(), s("button", {
|
|
547
700
|
key: 0,
|
|
548
701
|
type: "button",
|
|
549
702
|
class: "approvable-step-comment-more",
|
|
550
|
-
"aria-expanded":
|
|
551
|
-
onClick:
|
|
552
|
-
}, d(
|
|
553
|
-
])) :
|
|
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)
|
|
706
|
+
])) : S("", !0)
|
|
554
707
|
])
|
|
555
|
-
], 2)) :
|
|
708
|
+
], 2)) : S("", !0);
|
|
556
709
|
}
|
|
557
|
-
},
|
|
558
|
-
__name: "ApproveStatusInfo",
|
|
559
|
-
props: {
|
|
560
|
-
value: {
|
|
561
|
-
required: !0
|
|
562
|
-
},
|
|
563
|
-
label: {
|
|
564
|
-
default: null
|
|
565
|
-
}
|
|
566
|
-
},
|
|
567
|
-
setup(o) {
|
|
568
|
-
const b = o, m = w(() => {
|
|
569
|
-
const h = N(b.value, "code", " - ");
|
|
570
|
-
return {
|
|
571
|
-
"approvable-badge": !0,
|
|
572
|
-
"approvable-badge--draft": [q.CODES.CODE_DRAFT].includes(h),
|
|
573
|
-
"approvable-badge--waiting": [q.CODES.CODE_WAITING].includes(h),
|
|
574
|
-
"approvable-badge--success": [q.CODES.CODE_APPROVED, q.CODES.CODE_VIEWED, q.CODES.CODE_NOTICED].includes(h),
|
|
575
|
-
"approvable-badge--danger": [q.CODES.CODE_REJECTED].includes(h),
|
|
576
|
-
"approvable-badge--muted": [q.CODES.CODE_EXPIRED, q.CODES.CODE_SOLVED].includes(h),
|
|
577
|
-
"approvable-badge--empty": h === " - "
|
|
578
|
-
};
|
|
579
|
-
}), f = w(() => b.label ? b.label : N(b.value, "name", " - "));
|
|
580
|
-
return (h, g) => (t(), s("span", {
|
|
581
|
-
class: B(m.value)
|
|
582
|
-
}, d(f.value), 3));
|
|
583
|
-
}
|
|
584
|
-
}, Bt = {
|
|
585
|
-
key: 0,
|
|
586
|
-
class: "approvable"
|
|
587
|
-
}, Pt = {
|
|
710
|
+
}, ea = {
|
|
588
711
|
key: 0,
|
|
589
712
|
class: "approvable-loading"
|
|
590
|
-
},
|
|
713
|
+
}, ta = { class: "approvable-sr-only" }, aa = {
|
|
714
|
+
key: 0,
|
|
715
|
+
class: "approvable-compact"
|
|
716
|
+
}, sa = {
|
|
717
|
+
class: "approvable-sr-only",
|
|
718
|
+
"aria-live": "polite"
|
|
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 = {
|
|
591
720
|
class: "approvable-sr-only",
|
|
592
721
|
"aria-live": "polite"
|
|
593
|
-
},
|
|
722
|
+
}, va = {
|
|
594
723
|
key: 1,
|
|
595
724
|
class: "approvable-footer"
|
|
596
|
-
},
|
|
725
|
+
}, da = { class: "approvable-dialog-header" }, ca = { class: "approvable-dialog-eyebrow" }, ba = {
|
|
597
726
|
id: "approvable-history-title",
|
|
598
727
|
class: "approvable-dialog-title"
|
|
599
|
-
},
|
|
728
|
+
}, ma = ["aria-label"], fa = { class: "approvable-dialog-body" }, ha = {
|
|
600
729
|
__name: "Approvable",
|
|
601
730
|
props: {
|
|
602
731
|
value: {},
|
|
603
732
|
showApprovableStatus: { type: Boolean, default: !0 },
|
|
604
733
|
title: { default: "Approval" },
|
|
605
|
-
isDirectionRow: { default: !1 }
|
|
734
|
+
isDirectionRow: { default: !1 },
|
|
735
|
+
/**
|
|
736
|
+
* How many steps stay on screen above and below the active one, with the
|
|
737
|
+
* rest folded behind a toggle. `null` shows the whole trail.
|
|
738
|
+
*/
|
|
739
|
+
visibleStepRange: { type: Number, default: null },
|
|
740
|
+
/**
|
|
741
|
+
* Start collapsed: the status, a dot per step, and the active step's controls
|
|
742
|
+
* on one line. Supports `v-model:compact`, and the panel's own chevron drives
|
|
743
|
+
* it either way.
|
|
744
|
+
*/
|
|
745
|
+
compact: { type: Boolean, default: !1 },
|
|
746
|
+
/**
|
|
747
|
+
* Whether the chevron that switches between the two forms is offered at all.
|
|
748
|
+
* `null` means "whenever the panel was asked for compact" — a caller that
|
|
749
|
+
* wants the control but the full trail first passes `true` explicitly.
|
|
750
|
+
*/
|
|
751
|
+
collapsible: { type: Boolean, default: null }
|
|
606
752
|
},
|
|
607
|
-
emits: ["refresh", "isLoading"],
|
|
608
|
-
setup(
|
|
609
|
-
const
|
|
753
|
+
emits: ["refresh", "isLoading", "update:compact"],
|
|
754
|
+
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 = [
|
|
610
756
|
{ name: "118px", meta: "56px", delay: "0s", metaDelay: "0.15s" },
|
|
611
757
|
{ name: "96px", meta: "72px", delay: "0.1s", metaDelay: "0.25s" },
|
|
612
758
|
{ name: "78px", meta: "48px", delay: "0.2s", metaDelay: "0.35s" }
|
|
613
|
-
]
|
|
759
|
+
];
|
|
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 = _(() => ({
|
|
767
|
+
approvable: !0,
|
|
768
|
+
"approvable--compact": C.value
|
|
769
|
+
})), D = _(() => ({
|
|
614
770
|
"approvable-steps": !0,
|
|
615
|
-
"approvable-steps--row":
|
|
616
|
-
})),
|
|
617
|
-
const { activeStepNumber:
|
|
618
|
-
if (!
|
|
771
|
+
"approvable-steps--row": v.isDirectionRow
|
|
772
|
+
})), P = _(() => {
|
|
773
|
+
const { activeStepNumber: E, visibleStepCount: r, activeApproverName: e } = $.value;
|
|
774
|
+
if (!E || !r)
|
|
619
775
|
return null;
|
|
620
|
-
const
|
|
621
|
-
current:
|
|
622
|
-
total:
|
|
776
|
+
const i = K(u.stepProgress, {
|
|
777
|
+
current: E,
|
|
778
|
+
total: r
|
|
623
779
|
});
|
|
624
|
-
return
|
|
625
|
-
}),
|
|
626
|
-
var
|
|
627
|
-
(
|
|
780
|
+
return e ? `${i} — ${K(u.awaitingApprover, { name: e })}` : i;
|
|
781
|
+
}), H = () => {
|
|
782
|
+
var E;
|
|
783
|
+
(E = b.value) == null || E.refresh(), f("refresh");
|
|
628
784
|
};
|
|
629
|
-
return (
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
785
|
+
return (E, r) => $.value.hasApprovable ? (a(), s("div", {
|
|
786
|
+
key: 0,
|
|
787
|
+
class: V(R.value)
|
|
788
|
+
}, [
|
|
789
|
+
h.value && $.value.steps.length ? (a(), s("div", ea, [...r[10] || (r[10] = [
|
|
790
|
+
t("span", { class: "approvable-spinner" }, null, -1)
|
|
791
|
+
])])) : 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", {
|
|
637
797
|
"aria-hidden": "true",
|
|
638
798
|
class: "approvable-skeleton-bar approvable-skeleton-bar--pill"
|
|
639
799
|
}, null, -1)),
|
|
640
|
-
|
|
641
|
-
p[9] || (p[9] = e("span", {
|
|
800
|
+
r[12] || (r[12] = t("span", {
|
|
642
801
|
"aria-hidden": "true",
|
|
643
802
|
class: "approvable-skeleton-bar approvable-skeleton-bar--soft",
|
|
644
|
-
style: { width: "
|
|
803
|
+
style: { width: "96px", "animation-delay": "0.15s" }
|
|
804
|
+
}, null, -1)),
|
|
805
|
+
r[13] || (r[13] = t("span", {
|
|
806
|
+
"aria-hidden": "true",
|
|
807
|
+
class: "approvable-skeleton-spacer"
|
|
808
|
+
}, null, -1)),
|
|
809
|
+
r[14] || (r[14] = t("span", {
|
|
810
|
+
"aria-hidden": "true",
|
|
811
|
+
class: "approvable-skeleton-disc",
|
|
812
|
+
style: { "animation-delay": "0.25s" }
|
|
645
813
|
}, null, -1))
|
|
646
|
-
]
|
|
647
|
-
|
|
814
|
+
])) : (a(), B($e, {
|
|
815
|
+
key: 1,
|
|
816
|
+
"show-approvable-status": l.showApprovableStatus,
|
|
817
|
+
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
|
|
821
|
+
}, pe({ _: 2 }, [
|
|
822
|
+
N(Object.keys(E.$slots), (e) => ({
|
|
823
|
+
name: e,
|
|
824
|
+
fn: X((i) => [
|
|
825
|
+
U(E.$slots, e, Ee(De(i ?? {})))
|
|
826
|
+
])
|
|
827
|
+
}))
|
|
828
|
+
]), 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", {
|
|
834
|
+
"aria-hidden": "true",
|
|
835
|
+
class: "approvable-skeleton-bar approvable-skeleton-bar--pill"
|
|
836
|
+
}, null, -1)),
|
|
837
|
+
r[16] || (r[16] = t("span", { class: "approvable-skeleton-spacer" }, null, -1)),
|
|
838
|
+
r[17] || (r[17] = t("span", {
|
|
839
|
+
"aria-hidden": "true",
|
|
840
|
+
class: "approvable-skeleton-bar approvable-skeleton-bar--soft",
|
|
841
|
+
style: { width: "104px", "animation-delay": "0.2s" }
|
|
842
|
+
}, null, -1))
|
|
843
|
+
], 64)) : (a(), s(L, { key: 1 }, [
|
|
844
|
+
l.showApprovableStatus ? (a(), B(se, {
|
|
845
|
+
key: 0,
|
|
846
|
+
label: $.value.statusName,
|
|
847
|
+
value: $.value.status
|
|
848
|
+
}, null, 8, ["label", "value"])) : S("", !0),
|
|
849
|
+
t("span", na, d($.value.updatedAt), 1),
|
|
850
|
+
I.value.isCollapsible ? (a(), s("button", {
|
|
851
|
+
key: 1,
|
|
852
|
+
type: "button",
|
|
853
|
+
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", {
|
|
858
|
+
key: 2,
|
|
859
|
+
type: "button",
|
|
860
|
+
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", {
|
|
866
|
+
key: 3,
|
|
867
|
+
type: "button",
|
|
868
|
+
class: "approvable-compact-toggle approvable-compact-toggle--expanded",
|
|
869
|
+
"aria-expanded": !0,
|
|
870
|
+
"aria-label": w(u).compactCollapse,
|
|
871
|
+
title: w(u).compactCollapse,
|
|
872
|
+
onClick: r[4] || (r[4] = (e) => o(!0))
|
|
873
|
+
}, [...r[18] || (r[18] = [
|
|
874
|
+
t("svg", {
|
|
875
|
+
"aria-hidden": "true",
|
|
876
|
+
class: "approvable-icon",
|
|
877
|
+
fill: "none",
|
|
878
|
+
stroke: "currentColor",
|
|
879
|
+
"stroke-linecap": "round",
|
|
880
|
+
"stroke-linejoin": "round",
|
|
881
|
+
"stroke-width": "2",
|
|
882
|
+
viewBox: "0 0 16 16"
|
|
883
|
+
}, [
|
|
884
|
+
t("path", { d: "M4.5 6.4 8 9.9l3.5-3.5" })
|
|
885
|
+
], -1)
|
|
886
|
+
])], 8, pa)) : S("", !0)
|
|
887
|
+
], 64))
|
|
888
|
+
]),
|
|
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,
|
|
893
|
+
"aria-hidden": "true",
|
|
894
|
+
class: "approvable-skeleton-row"
|
|
895
|
+
}, [
|
|
896
|
+
t("span", {
|
|
897
|
+
class: "approvable-skeleton-disc",
|
|
898
|
+
style: Q({ animationDelay: e.delay })
|
|
899
|
+
}, null, 4),
|
|
900
|
+
t("span", {
|
|
901
|
+
class: "approvable-skeleton-bar",
|
|
902
|
+
style: Q({ width: e.name, animationDelay: e.delay })
|
|
903
|
+
}, null, 4),
|
|
904
|
+
r[19] || (r[19] = t("span", { class: "approvable-skeleton-spacer" }, null, -1)),
|
|
905
|
+
t("span", {
|
|
906
|
+
class: "approvable-skeleton-bar approvable-skeleton-bar--soft",
|
|
907
|
+
style: Q({ width: e.meta, animationDelay: e.metaDelay })
|
|
908
|
+
}, 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", {
|
|
648
921
|
key: 0,
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
922
|
+
class: V(D.value)
|
|
923
|
+
}, [
|
|
924
|
+
(a(!0), s(L, null, N(I.value.steps, (e) => (a(), B(Ae, {
|
|
925
|
+
key: e.id,
|
|
926
|
+
approvable: $.value.approvable,
|
|
927
|
+
resource: l.value,
|
|
928
|
+
value: e,
|
|
929
|
+
onIsLoading: r[5] || (r[5] = (i) => h.value = i),
|
|
930
|
+
onRefresh: H
|
|
931
|
+
}, pe({ _: 2 }, [
|
|
932
|
+
N(Object.keys(E.$slots), (i) => ({
|
|
933
|
+
name: i,
|
|
934
|
+
fn: X((p) => [
|
|
935
|
+
U(E.$slots, i, te({ ref_for: !0 }, p ?? {}))
|
|
936
|
+
])
|
|
937
|
+
}))
|
|
938
|
+
]), 1032, ["approvable", "resource", "value"]))), 128))
|
|
939
|
+
], 2)) : S("", !0),
|
|
940
|
+
P.value ? (a(), s("p", va, d(P.value), 1)) : S("", !0)
|
|
661
941
|
], 64))
|
|
662
|
-
]),
|
|
663
|
-
c.value ? (t(), s(D, { key: 1 }, [
|
|
664
|
-
e("span", Gt, d(C(v).loadingStatus), 1),
|
|
665
|
-
(t(), s(D, null, P(L, (u) => e("div", {
|
|
666
|
-
key: u.delay,
|
|
667
|
-
"aria-hidden": "true",
|
|
668
|
-
class: "approvable-skeleton-row"
|
|
669
|
-
}, [
|
|
670
|
-
e("span", {
|
|
671
|
-
class: "approvable-skeleton-disc",
|
|
672
|
-
style: W({ animationDelay: u.delay })
|
|
673
|
-
}, null, 4),
|
|
674
|
-
e("span", {
|
|
675
|
-
class: "approvable-skeleton-bar",
|
|
676
|
-
style: W({ width: u.name, animationDelay: u.delay })
|
|
677
|
-
}, null, 4),
|
|
678
|
-
p[10] || (p[10] = e("span", { class: "approvable-skeleton-spacer" }, null, -1)),
|
|
679
|
-
e("span", {
|
|
680
|
-
class: "approvable-skeleton-bar approvable-skeleton-bar--soft",
|
|
681
|
-
style: W({ width: u.meta, animationDelay: u.metaDelay })
|
|
682
|
-
}, null, 4)
|
|
683
|
-
])), 64)),
|
|
684
|
-
p[11] || (p[11] = e("div", {
|
|
685
|
-
class: "approvable-footer",
|
|
686
|
-
"aria-hidden": "true"
|
|
687
|
-
}, [
|
|
688
|
-
e("span", {
|
|
689
|
-
class: "approvable-skeleton-bar approvable-skeleton-bar--soft",
|
|
690
|
-
style: { display: "block", width: "132px" }
|
|
691
|
-
})
|
|
692
|
-
], -1))
|
|
693
|
-
], 64)) : (t(), s(D, { key: 2 }, [
|
|
694
|
-
y.value.steps.length ? (t(), s("ol", {
|
|
695
|
-
key: 0,
|
|
696
|
-
class: B($.value)
|
|
697
|
-
}, [
|
|
698
|
-
(t(!0), s(D, null, P(y.value.steps, (u) => (t(), K(ye, {
|
|
699
|
-
key: u.id,
|
|
700
|
-
approvable: y.value.approvable,
|
|
701
|
-
resource: o.value,
|
|
702
|
-
value: u,
|
|
703
|
-
onIsLoading: p[1] || (p[1] = (E) => h.value = E),
|
|
704
|
-
onRefresh: V
|
|
705
|
-
}, $e({ _: 2 }, [
|
|
706
|
-
P(Object.keys(R.$slots), (E) => ({
|
|
707
|
-
name: E,
|
|
708
|
-
fn: pe((j) => [
|
|
709
|
-
z(R.$slots, E, Z({ ref_for: !0 }, j ?? {}))
|
|
710
|
-
])
|
|
711
|
-
}))
|
|
712
|
-
]), 1032, ["approvable", "resource", "value"]))), 128))
|
|
713
|
-
], 2)) : k("", !0),
|
|
714
|
-
O.value ? (t(), s("p", Ht, d(O.value), 1)) : k("", !0)
|
|
715
942
|
], 64)),
|
|
716
|
-
(
|
|
717
|
-
|
|
943
|
+
(a(), B(Oe, { to: "body" }, [
|
|
944
|
+
n.value ? (a(), s("div", {
|
|
718
945
|
key: 0,
|
|
719
946
|
class: "approvable-dialog-backdrop",
|
|
720
|
-
onClick:
|
|
947
|
+
onClick: r[9] || (r[9] = Me((e) => n.value = !1, ["self"]))
|
|
721
948
|
}, [
|
|
722
|
-
|
|
949
|
+
t("section", {
|
|
723
950
|
role: "dialog",
|
|
724
951
|
"aria-modal": "true",
|
|
725
952
|
"aria-labelledby": "approvable-history-title",
|
|
726
953
|
class: "approvable-dialog",
|
|
727
|
-
onKeydown:
|
|
954
|
+
onKeydown: r[8] || (r[8] = Ie((e) => n.value = !1, ["esc"]))
|
|
728
955
|
}, [
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
956
|
+
t("header", da, [
|
|
957
|
+
t("p", ca, [
|
|
958
|
+
r[21] || (r[21] = t("svg", {
|
|
732
959
|
"aria-hidden": "true",
|
|
733
960
|
fill: "none",
|
|
734
961
|
stroke: "currentColor",
|
|
@@ -737,18 +964,18 @@ const gt = {
|
|
|
737
964
|
"stroke-width": "2",
|
|
738
965
|
viewBox: "0 0 16 16"
|
|
739
966
|
}, [
|
|
740
|
-
|
|
967
|
+
t("path", { d: "M9.6 4.5 6 8l3.6 3.5" })
|
|
741
968
|
], -1)),
|
|
742
|
-
|
|
969
|
+
z(" " + d(w(u).history), 1)
|
|
743
970
|
]),
|
|
744
|
-
|
|
745
|
-
|
|
971
|
+
t("h2", ba, d(M.value), 1),
|
|
972
|
+
t("button", {
|
|
746
973
|
type: "button",
|
|
747
974
|
class: "approvable-dialog-close",
|
|
748
|
-
"aria-label":
|
|
749
|
-
onClick:
|
|
750
|
-
}, [...
|
|
751
|
-
|
|
975
|
+
"aria-label": w(u).historyClose,
|
|
976
|
+
onClick: r[6] || (r[6] = (e) => n.value = !1)
|
|
977
|
+
}, [...r[22] || (r[22] = [
|
|
978
|
+
t("svg", {
|
|
752
979
|
"aria-hidden": "true",
|
|
753
980
|
class: "approvable-icon",
|
|
754
981
|
fill: "none",
|
|
@@ -757,28 +984,28 @@ const gt = {
|
|
|
757
984
|
"stroke-width": "2",
|
|
758
985
|
viewBox: "0 0 16 16"
|
|
759
986
|
}, [
|
|
760
|
-
|
|
987
|
+
t("path", { d: "m5.2 5.2 5.6 5.6M10.8 5.2l-5.6 5.6" })
|
|
761
988
|
], -1)
|
|
762
|
-
])], 8,
|
|
989
|
+
])], 8, ma)
|
|
763
990
|
]),
|
|
764
|
-
|
|
765
|
-
|
|
991
|
+
t("div", fa, [
|
|
992
|
+
F(ke, {
|
|
766
993
|
ref_key: "auditTimeline",
|
|
767
|
-
ref:
|
|
768
|
-
"approvable-id":
|
|
994
|
+
ref: b,
|
|
995
|
+
"approvable-id": $.value.id,
|
|
769
996
|
"show-header": !1,
|
|
770
|
-
onLoaded:
|
|
997
|
+
onLoaded: r[7] || (r[7] = (e) => g.value = e)
|
|
771
998
|
}, null, 8, ["approvable-id"])
|
|
772
999
|
])
|
|
773
1000
|
], 32)
|
|
774
|
-
])) :
|
|
1001
|
+
])) : S("", !0)
|
|
775
1002
|
]))
|
|
776
|
-
])) :
|
|
1003
|
+
], 2)) : S("", !0);
|
|
777
1004
|
}
|
|
778
|
-
},
|
|
1005
|
+
}, ya = {
|
|
779
1006
|
key: 0,
|
|
780
1007
|
class: "approvable-actions"
|
|
781
|
-
},
|
|
1008
|
+
}, ka = { class: "approvable-actions-list" }, ga = ["title", "onClick"], _a = {
|
|
782
1009
|
__name: "ApprovableButtons",
|
|
783
1010
|
props: {
|
|
784
1011
|
value: {
|
|
@@ -786,43 +1013,43 @@ const gt = {
|
|
|
786
1013
|
}
|
|
787
1014
|
},
|
|
788
1015
|
emits: ["isLoading", "refresh"],
|
|
789
|
-
setup(
|
|
790
|
-
const
|
|
791
|
-
let
|
|
792
|
-
|
|
793
|
-
},
|
|
1016
|
+
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) => {
|
|
794
1021
|
f("isLoading", !0), h.value = !0;
|
|
795
|
-
const
|
|
796
|
-
|
|
1022
|
+
const o = await new ce().updateApproveStatus(u, m);
|
|
1023
|
+
be(o) && me(g.actionSucceeded), f("isLoading", !1), f("refresh");
|
|
797
1024
|
};
|
|
798
|
-
return (
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
(
|
|
802
|
-
key:
|
|
803
|
-
title:
|
|
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,
|
|
804
1031
|
class: "approvable-btn",
|
|
805
1032
|
type: "button",
|
|
806
|
-
onClick: (
|
|
1033
|
+
onClick: (k) => A(o)
|
|
807
1034
|
}, [
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
icon:
|
|
1035
|
+
U(u.$slots, "icon", { button: o }, () => [
|
|
1036
|
+
F(Z, {
|
|
1037
|
+
icon: o.icon
|
|
811
1038
|
}, null, 8, ["icon"])
|
|
812
1039
|
]),
|
|
813
|
-
|
|
814
|
-
], 8,
|
|
1040
|
+
z(" " + d(o.text), 1)
|
|
1041
|
+
], 8, ga))), 128))
|
|
815
1042
|
])
|
|
816
|
-
])) :
|
|
1043
|
+
])) : S("", !0);
|
|
817
1044
|
}
|
|
818
|
-
},
|
|
1045
|
+
}, Sa = { class: "approvable-select" }, $a = {
|
|
819
1046
|
key: 0,
|
|
820
1047
|
class: "approvable-select-label"
|
|
821
|
-
},
|
|
1048
|
+
}, Aa = ["value"], wa = ["value"], Ca = /* @__PURE__ */ Object.assign({
|
|
822
1049
|
inheritAttrs: !1
|
|
823
1050
|
}, {
|
|
824
1051
|
__name: "ApprovableStatusSelect",
|
|
825
|
-
props: /* @__PURE__ */
|
|
1052
|
+
props: /* @__PURE__ */ ue({
|
|
826
1053
|
getList: {},
|
|
827
1054
|
label: {
|
|
828
1055
|
default: "Status"
|
|
@@ -831,90 +1058,94 @@ const gt = {
|
|
|
831
1058
|
modelValue: {},
|
|
832
1059
|
modelModifiers: {}
|
|
833
1060
|
}),
|
|
834
|
-
emits: /* @__PURE__ */
|
|
835
|
-
setup(
|
|
836
|
-
const
|
|
837
|
-
let
|
|
838
|
-
return await new
|
|
839
|
-
},
|
|
840
|
-
const
|
|
841
|
-
f.value =
|
|
842
|
-
},
|
|
843
|
-
const
|
|
844
|
-
|
|
1061
|
+
emits: /* @__PURE__ */ ue(["mounted"], ["update:modelValue"]),
|
|
1062
|
+
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 }];
|
|
1065
|
+
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 : [];
|
|
845
1072
|
};
|
|
846
|
-
return
|
|
847
|
-
await
|
|
848
|
-
}), (
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
value:
|
|
1073
|
+
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({
|
|
1078
|
+
value: C.value,
|
|
852
1079
|
class: "approvable-select-input"
|
|
853
|
-
},
|
|
854
|
-
|
|
855
|
-
(
|
|
856
|
-
key:
|
|
857
|
-
value:
|
|
858
|
-
}, d(
|
|
859
|
-
], 16,
|
|
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)
|
|
860
1087
|
]));
|
|
861
1088
|
}
|
|
862
|
-
}),
|
|
1089
|
+
}), Ra = { class: "approvable-select-option" }, xa = {
|
|
863
1090
|
__name: "ApprovableStatusSelectOption",
|
|
864
1091
|
props: {
|
|
865
1092
|
value: {}
|
|
866
1093
|
},
|
|
867
|
-
setup(
|
|
868
|
-
const
|
|
869
|
-
return (f, h) => (
|
|
870
|
-
|
|
1094
|
+
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)
|
|
871
1098
|
]));
|
|
872
1099
|
}
|
|
873
|
-
},
|
|
874
|
-
Approvable:
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
1100
|
+
}, La = {
|
|
1101
|
+
Approvable: ha,
|
|
1102
|
+
ApprovableCompact: $e,
|
|
1103
|
+
ApprovableStep: Ae,
|
|
1104
|
+
ApprovableStepActions: ae,
|
|
1105
|
+
ApprovableButtons: _a,
|
|
1106
|
+
ApprovableStepComment: _e,
|
|
1107
|
+
ApprovableAuditTimeline: ke,
|
|
1108
|
+
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);
|
|
887
1116
|
}
|
|
888
1117
|
};
|
|
889
1118
|
export {
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
1119
|
+
ge as APPROVABLE_ICON_REGISTRY,
|
|
1120
|
+
Se as APPROVABLE_LINK_COMPONENT,
|
|
1121
|
+
ye as APPROVABLE_MESSAGES,
|
|
1122
|
+
ha as Approvable,
|
|
1123
|
+
ke as ApprovableAuditTimeline,
|
|
1124
|
+
_a as ApprovableButtons,
|
|
1125
|
+
Ta as ApprovableClient,
|
|
1126
|
+
$e as ApprovableCompact,
|
|
1127
|
+
Ca as ApprovableStatusSelect,
|
|
1128
|
+
xa as ApprovableStatusSelectOption,
|
|
1129
|
+
Ae as ApprovableStep,
|
|
1130
|
+
ae as ApprovableStepActions,
|
|
1131
|
+
_e as ApprovableStepComment,
|
|
1132
|
+
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,
|
|
1143
|
+
Ct as linkProps,
|
|
1144
|
+
Oa as registerApprovableActionRenderer,
|
|
1145
|
+
za as setApprovableClient,
|
|
1146
|
+
Ha as unregisterApprovableActionRenderer,
|
|
1147
|
+
ft as useIconRegistry,
|
|
1148
|
+
wt as useLinkComponent,
|
|
1149
|
+
G as useMessages
|
|
919
1150
|
};
|
|
920
1151
|
//# sourceMappingURL=approvable-vue.mjs.map
|