@edifice.io/collect-frontend 1.0.12 → 1.0.13
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/lib/AppHeaderCollection-Bvug8wqR.js +203 -0
- package/lib/CXEL7IU7-KQqTZW3I.js +42 -0
- package/lib/Collection-CMoQA79H.js +506 -0
- package/lib/CollectionsLayout-wmt1jR8l.js +100 -0
- package/lib/CollectionsList-Avkiw1Aj.js +324 -0
- package/lib/DeleteCollectionModal-CE4XaECV.js +71 -0
- package/lib/DropdownActionTable-CcA3rys3.js +84 -0
- package/lib/FormEdit-BK8fEwW4.js +111 -0
- package/lib/HASRA6WW-BbBPIcpK.js +9093 -0
- package/lib/I3HPI4QX-C5m1qr_y.js +33 -0
- package/lib/MembersEdit-79qps5R2.js +81 -0
- package/lib/MineSubmission-m_qn8e0j.js +27 -0
- package/lib/Root-DzV0pyeC.js +20 -0
- package/lib/SearchBarCollect-DBKaVVDV.js +23 -0
- package/lib/Submission-BnaHLVUo.js +337 -0
- package/lib/SubmissionList-DI5paav0.js +204 -0
- package/lib/emptyscreen-list-collection-CWGxO4Ss.js +4 -0
- package/lib/index-CIhvqYOt.js +3856 -0
- package/lib/index.js +19 -15071
- package/lib/routes/index.d.ts +13 -0
- package/lib/store/createSelectors.d.ts +1 -2
- package/lib/store/submissionActionStore.d.ts +26 -0
- package/lib/submission.queries-D13BY7hC.js +147 -0
- package/lib/useGetStatusSubmission-DxHmLPxr.js +57 -0
- package/package.json +5 -5
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useEdificeClient as p, Flex as m, Button as u, IconButton as f, useBreakpoint as g, useDate as O, Badge as y } from "@edifice.io/react";
|
|
3
|
+
import { IconPinOn as D, IconOptions as T, IconSave as L, IconSend as N, IconArrowLeft as v, IconCalendarLight as M } from "@edifice.io/react/icons";
|
|
4
|
+
import { useTranslation as h } from "react-i18next";
|
|
5
|
+
import { u as A, D as H } from "./DropdownActionTable-CcA3rys3.js";
|
|
6
|
+
import { ContribSubmissionStatus as w } from "@edifice.io/collect-client-rest";
|
|
7
|
+
import { create as x } from "zustand";
|
|
8
|
+
import { c as P, m as U } from "./index-CIhvqYOt.js";
|
|
9
|
+
const B = ({
|
|
10
|
+
collection: s
|
|
11
|
+
}) => {
|
|
12
|
+
const { appCode: t } = p(), { t: e } = h(t), i = A.use.onOpenInstructionModal();
|
|
13
|
+
return /* @__PURE__ */ d(m, { gap: "16", justify: "end", children: [
|
|
14
|
+
/* @__PURE__ */ n(
|
|
15
|
+
u,
|
|
16
|
+
{
|
|
17
|
+
"data-testid": "collect-collection-actions-button-instruction",
|
|
18
|
+
variant: "outline",
|
|
19
|
+
color: "primary",
|
|
20
|
+
leftIcon: /* @__PURE__ */ n(D, {}),
|
|
21
|
+
onClick: i,
|
|
22
|
+
children: e("collection.appHeaderCollection.collection.button.instruction")
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ n(H, { collectionId: s.id, isCollection: !0, children: (o) => /* @__PURE__ */ n(
|
|
26
|
+
f,
|
|
27
|
+
{
|
|
28
|
+
...o,
|
|
29
|
+
className: "icon-button-hover-no-transition bg-white",
|
|
30
|
+
type: "button",
|
|
31
|
+
"aria-label": "label",
|
|
32
|
+
"data-testid": "collect-collection-actions-button-options",
|
|
33
|
+
color: "primary",
|
|
34
|
+
variant: "outline",
|
|
35
|
+
icon: /* @__PURE__ */ n(T, {})
|
|
36
|
+
}
|
|
37
|
+
) })
|
|
38
|
+
] });
|
|
39
|
+
}, k = x((s) => ({
|
|
40
|
+
submissionId: null,
|
|
41
|
+
submissionUpdatedAt: null,
|
|
42
|
+
submissionContent: "",
|
|
43
|
+
isUpdateSubmissionModalOpen: !1,
|
|
44
|
+
submissionHasContent: !1,
|
|
45
|
+
submissionAttachments: [],
|
|
46
|
+
submissionPersistedAttachmentIds: [],
|
|
47
|
+
submissionAttachmentIdsToDelete: [],
|
|
48
|
+
submissionIsLoading: !1,
|
|
49
|
+
onOpenUpdateSubmissionModal: () => s({ isUpdateSubmissionModalOpen: !0 }),
|
|
50
|
+
onCloseUpdateSubmissionModal: () => s({ isUpdateSubmissionModalOpen: !1 }),
|
|
51
|
+
setSubmissionContent: (t, e) => s({
|
|
52
|
+
submissionContent: t,
|
|
53
|
+
submissionHasContent: e
|
|
54
|
+
}),
|
|
55
|
+
setSubmissionAttachments: (t) => s({ submissionAttachments: t }),
|
|
56
|
+
resetSubmissionAttachments: () => s({ submissionAttachments: [] }),
|
|
57
|
+
setSubmissionPersistedAttachmentIds: (t) => s({ submissionPersistedAttachmentIds: t }),
|
|
58
|
+
addSubmissionAttachmentIdToDelete: (t) => s((e) => ({
|
|
59
|
+
submissionAttachmentIdsToDelete: e.submissionAttachmentIdsToDelete.includes(t) ? e.submissionAttachmentIdsToDelete : [...e.submissionAttachmentIdsToDelete, t]
|
|
60
|
+
})),
|
|
61
|
+
resetSubmissionAttachmentIdsToDelete: () => s({ submissionAttachmentIdsToDelete: [] }),
|
|
62
|
+
setSubmissionIsLoading: (t) => s({ submissionIsLoading: t }),
|
|
63
|
+
hydrateSubmissionContent: (t) => s((e) => {
|
|
64
|
+
if (e.submissionId === t.id && e.submissionUpdatedAt === t.updatedAt)
|
|
65
|
+
return e;
|
|
66
|
+
const i = t.content || "";
|
|
67
|
+
return {
|
|
68
|
+
submissionId: t.id,
|
|
69
|
+
submissionUpdatedAt: t.updatedAt,
|
|
70
|
+
submissionContent: i,
|
|
71
|
+
submissionHasContent: !!i.trim(),
|
|
72
|
+
submissionAttachments: U(t == null ? void 0 : t.attachments) ?? [],
|
|
73
|
+
submissionPersistedAttachmentIds: (t.attachments ?? []).map(
|
|
74
|
+
(o) => o.id
|
|
75
|
+
),
|
|
76
|
+
submissionAttachmentIdsToDelete: []
|
|
77
|
+
};
|
|
78
|
+
})
|
|
79
|
+
})), $ = P(k), j = ({
|
|
80
|
+
handleUpdateSubmission: s
|
|
81
|
+
}) => {
|
|
82
|
+
const { appCode: t } = p(), { t: e } = h(t), i = A.use.isPastDeadline(), {
|
|
83
|
+
submissionHasContent: o,
|
|
84
|
+
submissionAttachments: r,
|
|
85
|
+
submissionPersistedAttachmentIds: c,
|
|
86
|
+
submissionIsLoading: l,
|
|
87
|
+
onOpenUpdateSubmissionModal: b
|
|
88
|
+
} = $((a) => ({
|
|
89
|
+
onOpenUpdateSubmissionModal: a.onOpenUpdateSubmissionModal,
|
|
90
|
+
submissionHasContent: a.submissionHasContent,
|
|
91
|
+
submissionAttachments: a.submissionAttachments,
|
|
92
|
+
submissionPersistedAttachmentIds: a.submissionPersistedAttachmentIds,
|
|
93
|
+
submissionIsLoading: a.submissionIsLoading
|
|
94
|
+
})), S = r.some((a) => {
|
|
95
|
+
const I = Number(a.id);
|
|
96
|
+
return !Number.isSafeInteger(I) || !c.includes(I);
|
|
97
|
+
});
|
|
98
|
+
return /* @__PURE__ */ d(m, { gap: "16", justify: "end", children: [
|
|
99
|
+
/* @__PURE__ */ n(
|
|
100
|
+
u,
|
|
101
|
+
{
|
|
102
|
+
"data-testid": "collect-submission-app-header-actions-draft-button",
|
|
103
|
+
variant: "outline",
|
|
104
|
+
color: "primary",
|
|
105
|
+
leftIcon: /* @__PURE__ */ n(L, {}),
|
|
106
|
+
disabled: i,
|
|
107
|
+
isLoading: l,
|
|
108
|
+
onClick: () => s == null ? void 0 : s({
|
|
109
|
+
status: w.DRAFT
|
|
110
|
+
}),
|
|
111
|
+
children: e("collection.appHeaderSubmission.submission.button.draft")
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
/* @__PURE__ */ n(
|
|
115
|
+
u,
|
|
116
|
+
{
|
|
117
|
+
"data-testid": "collect-submission-app-header-actions-send-button",
|
|
118
|
+
variant: "filled",
|
|
119
|
+
color: "primary",
|
|
120
|
+
leftIcon: /* @__PURE__ */ n(N, {}),
|
|
121
|
+
disabled: i || !(o || S),
|
|
122
|
+
onClick: () => b(),
|
|
123
|
+
children: e("collection.appHeaderSubmission.submission.button.send")
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
] });
|
|
127
|
+
};
|
|
128
|
+
var C = /* @__PURE__ */ ((s) => (s.COLLECTION = "COLLECTION", s.SUBMISSION = "SUBMISSION", s))(C || {});
|
|
129
|
+
const K = ({
|
|
130
|
+
collection: s,
|
|
131
|
+
onClickBack: t,
|
|
132
|
+
context: e,
|
|
133
|
+
handleUpdateSubmission: i
|
|
134
|
+
}) => {
|
|
135
|
+
const { appCode: o } = p(), { t: r } = h(o), { lg: c, md: l } = g(), { formatDate: b } = O();
|
|
136
|
+
return /* @__PURE__ */ d("div", { className: `py-16 border-bottom bg-white ${l ? "px-48" : "px-16"}`, children: [
|
|
137
|
+
/* @__PURE__ */ n(m, { align: "center", gap: "8", children: /* @__PURE__ */ n(
|
|
138
|
+
u,
|
|
139
|
+
{
|
|
140
|
+
"data-testid": "collect-submission-app-header-button-back",
|
|
141
|
+
className: "text-gray-700",
|
|
142
|
+
color: "tertiary",
|
|
143
|
+
leftIcon: /* @__PURE__ */ n(v, { width: 20, height: 20 }),
|
|
144
|
+
type: "button",
|
|
145
|
+
variant: "ghost",
|
|
146
|
+
size: "sm",
|
|
147
|
+
onClick: t,
|
|
148
|
+
children: r("collection.back")
|
|
149
|
+
}
|
|
150
|
+
) }),
|
|
151
|
+
/* @__PURE__ */ d(
|
|
152
|
+
m,
|
|
153
|
+
{
|
|
154
|
+
className: "w-100 mt-24",
|
|
155
|
+
justify: "between",
|
|
156
|
+
align: c ? "center" : "end",
|
|
157
|
+
gap: "12",
|
|
158
|
+
direction: c ? "row" : "column",
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ d(
|
|
161
|
+
"div",
|
|
162
|
+
{
|
|
163
|
+
className: `${l && "d-flex"} ${!c && "w-100"}`,
|
|
164
|
+
style: { maxWidth: c ? "70%" : "100%" },
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ n(
|
|
167
|
+
"h2",
|
|
168
|
+
{
|
|
169
|
+
"data-testid": "collect-submission-app-header-title",
|
|
170
|
+
className: `text-truncate ${l ? "me-12" : "mb-12 text-truncate-2"}`,
|
|
171
|
+
children: s.name
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
/* @__PURE__ */ n(
|
|
175
|
+
y,
|
|
176
|
+
{
|
|
177
|
+
"data-testid": "collect-submission-app-header-badge-deadline",
|
|
178
|
+
className: "lh-base",
|
|
179
|
+
style: { height: "3rem" },
|
|
180
|
+
variant: {
|
|
181
|
+
level: "info",
|
|
182
|
+
type: "notification"
|
|
183
|
+
},
|
|
184
|
+
children: /* @__PURE__ */ d(m, { align: "center", gap: "8", children: [
|
|
185
|
+
/* @__PURE__ */ n(M, { height: 20, width: 20 }),
|
|
186
|
+
`${r("collection.appHeaderCollection.deadline")} ${b(s.deadline)}`
|
|
187
|
+
] })
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
e === C.COLLECTION ? /* @__PURE__ */ n(B, { collection: s }) : /* @__PURE__ */ n(j, { handleUpdateSubmission: i })
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
)
|
|
197
|
+
] });
|
|
198
|
+
};
|
|
199
|
+
export {
|
|
200
|
+
K as A,
|
|
201
|
+
C,
|
|
202
|
+
$ as u
|
|
203
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./HASRA6WW-BbBPIcpK.js";
|
|
2
|
+
import { z as v, B as C, D as e } from "./index-CIhvqYOt.js";
|
|
3
|
+
var h = (t) => {
|
|
4
|
+
const [r, o] = s({
|
|
5
|
+
prefix: "TanstackQueryDevtools"
|
|
6
|
+
}), a = v(), l = C(() => {
|
|
7
|
+
const n = r.theme_preference || c;
|
|
8
|
+
return n !== "system" ? n : a();
|
|
9
|
+
});
|
|
10
|
+
return e(d.Provider, {
|
|
11
|
+
value: t,
|
|
12
|
+
get children() {
|
|
13
|
+
return e(u, {
|
|
14
|
+
disabled: !0,
|
|
15
|
+
localStore: r,
|
|
16
|
+
setLocalStore: o,
|
|
17
|
+
get children() {
|
|
18
|
+
return e(i.Provider, {
|
|
19
|
+
value: l,
|
|
20
|
+
get children() {
|
|
21
|
+
return e(m, {
|
|
22
|
+
get children() {
|
|
23
|
+
return e(P, {
|
|
24
|
+
localStore: r,
|
|
25
|
+
setLocalStore: o,
|
|
26
|
+
get onClose() {
|
|
27
|
+
return t.onClose;
|
|
28
|
+
},
|
|
29
|
+
showPanelViewOnly: !0
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}, p = h;
|
|
40
|
+
export {
|
|
41
|
+
p as default
|
|
42
|
+
};
|