@selectwin/kit 0.1.260 → 0.1.262
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/README.md +20 -0
- package/dist/SelectAttachMenu.js +63 -64
- package/dist/SelectAvatar.d.ts +16 -2
- package/dist/SelectAvatar.js +25 -14
- package/dist/SelectChatSendButton.d.ts +5 -0
- package/dist/SelectChatSendButton.js +16 -15
- package/dist/SelectLinkButton.d.ts +7 -2
- package/dist/SelectLinkButton.js +4 -4
- package/dist/SelectListCard.d.ts +7 -2
- package/dist/SelectListCard.js +11 -2
- package/dist/SelectLocale.d.ts +2 -0
- package/dist/SelectLocale.js +16 -2
- package/dist/SelectMail.d.ts +20 -2
- package/dist/SelectMail.js +314 -290
- package/dist/SelectPopover.js +1 -0
- package/dist/icons.d.ts +7 -0
- package/dist/icons.js +37 -27
- package/dist/index.d.ts +3 -2
- package/dist/index.js +247 -247
- package/dist/internal/useMatchMedia.d.ts +6 -0
- package/dist/internal/useMatchMedia.js +3 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/SelectMail.js
CHANGED
|
@@ -1,55 +1,56 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { ArrowLeftIcon as e, ArrowUpRightIcon as t, ChevronDownIcon as n, ChevronUpIcon as r, CloseIcon as i, ExternalLinkIcon as a, FileDownloadIcon as o, InfoIcon as s,
|
|
3
|
-
import { useSelectMessages as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
import { ArrowLeftIcon as e, ArrowUpRightIcon as t, ChevronDownIcon as n, ChevronUpIcon as r, CloseIcon as i, ExternalLinkIcon as a, FileDownloadIcon as o, InfoIcon as s, InstagramIcon as c, MailIcon as l, MessengerIcon as u, PaperclipIcon as d, PlusIcon as f, RefreshIcon as p, ShieldTickIcon as m, SmsIcon as h, StarIcon as g, TargetIcon as _, WarningIcon as v, WhatsAppIcon as y } from "./icons.js";
|
|
3
|
+
import { useSelectMessages as b } from "./SelectLocale.js";
|
|
4
|
+
import { SELECT_PHONE_QUERY as x, useMatchMedia as ee } from "./internal/useMatchMedia.js";
|
|
5
|
+
import { SelectPopover as S } from "./SelectPopover.js";
|
|
6
|
+
import { SelectIconButton as C } from "./SelectIconButton.js";
|
|
7
|
+
import { SelectAvatar as w } from "./SelectAvatar.js";
|
|
8
|
+
import { attachmentExt as T, attachmentTone as E } from "./internal/fileKind.js";
|
|
9
|
+
import { useCallback as D, useLayoutEffect as O, useRef as k, useState as A } from "react";
|
|
10
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
10
11
|
//#region src/SelectMail.tsx
|
|
11
|
-
function
|
|
12
|
+
function P(e) {
|
|
12
13
|
var t;
|
|
13
14
|
return e ? ((t = e.name) == null ? void 0 : t.trim()) || e.address : "Remetente desconhecido";
|
|
14
15
|
}
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
let
|
|
16
|
+
var F = (...e) => e.filter(Boolean).join(" ");
|
|
17
|
+
function I({ toolbar: e, listHeader: t, listWidth: n, asideWidth: r, banner: i, list: a, reader: o, readerOpen: s = !1, children: c, fullBody: l, aside: u, asideLabel: d, listLabel: f, readerLabel: p, framed: m = !1, "aria-label": h }) {
|
|
18
|
+
let g = b().inbox, _ = n || r ? {
|
|
18
19
|
...n ? { "--select-inbox-list-w": n } : {},
|
|
19
20
|
...r ? { "--select-inbox-aside-w": r } : {}
|
|
20
21
|
} : void 0;
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
className:
|
|
23
|
-
"aria-label":
|
|
24
|
-
style:
|
|
22
|
+
return /* @__PURE__ */ N("div", {
|
|
23
|
+
className: F("select-inbox", m && "select-inbox--framed", s && "is-reading"),
|
|
24
|
+
"aria-label": h,
|
|
25
|
+
style: _,
|
|
25
26
|
children: [
|
|
26
|
-
e != null && e !== !1 ? /* @__PURE__ */
|
|
27
|
+
e != null && e !== !1 ? /* @__PURE__ */ M("div", {
|
|
27
28
|
className: "select-inbox__toolbar",
|
|
28
29
|
children: e
|
|
29
30
|
}) : null,
|
|
30
31
|
i,
|
|
31
|
-
l ? /* @__PURE__ */
|
|
32
|
+
l ? /* @__PURE__ */ M("div", {
|
|
32
33
|
className: "select-inbox__body select-inbox__body--full",
|
|
33
34
|
children: l
|
|
34
|
-
}) : /* @__PURE__ */
|
|
35
|
+
}) : /* @__PURE__ */ N("div", {
|
|
35
36
|
className: "select-inbox__body",
|
|
36
37
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ N("section", {
|
|
38
39
|
className: "select-inbox__list",
|
|
39
|
-
"aria-label": f ??
|
|
40
|
-
children: [t != null && t !== !1 ? /* @__PURE__ */
|
|
40
|
+
"aria-label": f ?? g.list,
|
|
41
|
+
children: [t != null && t !== !1 ? /* @__PURE__ */ M("div", {
|
|
41
42
|
className: "select-inbox__listhead",
|
|
42
43
|
children: t
|
|
43
44
|
}) : null, a]
|
|
44
45
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ M("section", {
|
|
46
47
|
className: "select-inbox__reader",
|
|
47
|
-
"aria-label": p ??
|
|
48
|
+
"aria-label": p ?? g.reader,
|
|
48
49
|
children: o
|
|
49
50
|
}),
|
|
50
|
-
u ? /* @__PURE__ */
|
|
51
|
+
u ? /* @__PURE__ */ M("aside", {
|
|
51
52
|
className: "select-inbox__aside",
|
|
52
|
-
"aria-label": d ??
|
|
53
|
+
"aria-label": d ?? g.aside,
|
|
53
54
|
children: u
|
|
54
55
|
}) : null
|
|
55
56
|
]
|
|
@@ -58,194 +59,217 @@ function A({ toolbar: e, listHeader: t, listWidth: n, asideWidth: r, banner: i,
|
|
|
58
59
|
]
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
-
return /* @__PURE__ */
|
|
62
|
+
function L({ tone: e = "warning", children: t, action: n }) {
|
|
63
|
+
return /* @__PURE__ */ N("div", {
|
|
63
64
|
className: `select-inbox-banner select-inbox-banner--${e}`,
|
|
64
65
|
role: e === "info" ? "status" : "alert",
|
|
65
66
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ M("span", {
|
|
67
68
|
className: "select-inbox-banner__icon",
|
|
68
69
|
"aria-hidden": "true",
|
|
69
|
-
children:
|
|
70
|
+
children: M(e === "info" ? s : v, {})
|
|
70
71
|
}),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ M("span", {
|
|
72
73
|
className: "select-inbox-banner__text",
|
|
73
74
|
children: t
|
|
74
75
|
}),
|
|
75
|
-
n ? /* @__PURE__ */
|
|
76
|
+
n ? /* @__PURE__ */ M("span", {
|
|
76
77
|
className: "select-inbox-banner__action",
|
|
77
78
|
children: n
|
|
78
79
|
}) : null
|
|
79
80
|
]
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
-
return /* @__PURE__ */
|
|
83
|
+
function R({ title: e, status: t, children: n, actions: r }) {
|
|
84
|
+
return /* @__PURE__ */ N("div", {
|
|
84
85
|
className: "select-inboxbar",
|
|
85
86
|
children: [
|
|
86
|
-
e != null || t != null ? /* @__PURE__ */
|
|
87
|
+
e != null || t != null ? /* @__PURE__ */ N("div", {
|
|
87
88
|
className: "select-inboxbar__title",
|
|
88
|
-
children: [e == null ? null : /* @__PURE__ */
|
|
89
|
+
children: [e == null ? null : /* @__PURE__ */ M("h1", {
|
|
89
90
|
className: "select-inboxbar__heading",
|
|
90
91
|
children: e
|
|
91
92
|
}), t]
|
|
92
93
|
}) : null,
|
|
93
|
-
n ? /* @__PURE__ */
|
|
94
|
+
n ? /* @__PURE__ */ M("div", {
|
|
94
95
|
className: "select-inboxbar__controls",
|
|
95
96
|
children: n
|
|
96
97
|
}) : null,
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
r ? /* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ M("span", { className: "select-inboxbar__spacer" }),
|
|
99
|
+
r ? /* @__PURE__ */ M("div", {
|
|
99
100
|
className: "select-inboxbar__actions",
|
|
100
101
|
children: r
|
|
101
102
|
}) : null
|
|
102
103
|
]
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
|
-
function
|
|
106
|
-
return /* @__PURE__ */
|
|
106
|
+
function z({ tone: e, children: t }) {
|
|
107
|
+
return /* @__PURE__ */ N("span", {
|
|
107
108
|
className: `select-mailbox-status select-mailbox-status--${e}`,
|
|
108
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ M("span", {
|
|
109
110
|
className: "select-mailbox-status__dot",
|
|
110
111
|
"aria-hidden": "true"
|
|
111
|
-
}), /* @__PURE__ */
|
|
112
|
+
}), /* @__PURE__ */ M("span", {
|
|
112
113
|
className: "select-mailbox-status__text",
|
|
113
114
|
children: t
|
|
114
115
|
})]
|
|
115
116
|
});
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
-
return /* @__PURE__ */
|
|
118
|
+
function B({ icon: e, title: t, children: n, details: r, action: i, tone: a = "neutral" }) {
|
|
119
|
+
return /* @__PURE__ */ N("div", {
|
|
119
120
|
className: `select-inbox-empty select-inbox-empty--${a}`,
|
|
120
121
|
children: [
|
|
121
|
-
e ? /* @__PURE__ */
|
|
122
|
+
e ? /* @__PURE__ */ M("span", {
|
|
122
123
|
className: "select-inbox-empty__icon",
|
|
123
124
|
"aria-hidden": "true",
|
|
124
125
|
children: e
|
|
125
126
|
}) : null,
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ M("div", {
|
|
127
128
|
className: "select-inbox-empty__title",
|
|
128
129
|
children: t
|
|
129
130
|
}),
|
|
130
|
-
n ? /* @__PURE__ */
|
|
131
|
+
n ? /* @__PURE__ */ M("div", {
|
|
131
132
|
className: "select-inbox-empty__text",
|
|
132
133
|
children: n
|
|
133
134
|
}) : null,
|
|
134
|
-
r ? /* @__PURE__ */
|
|
135
|
+
r ? /* @__PURE__ */ M("div", {
|
|
135
136
|
className: "select-inbox-empty__details",
|
|
136
137
|
children: r
|
|
137
138
|
}) : null,
|
|
138
|
-
i ? /* @__PURE__ */
|
|
139
|
+
i ? /* @__PURE__ */ M("div", {
|
|
139
140
|
className: "select-inbox-empty__action",
|
|
140
141
|
children: i
|
|
141
142
|
}) : null
|
|
142
143
|
]
|
|
143
144
|
});
|
|
144
145
|
}
|
|
145
|
-
function
|
|
146
|
-
return /* @__PURE__ */
|
|
146
|
+
function V({ children: e, "aria-label": t }) {
|
|
147
|
+
return /* @__PURE__ */ M("div", {
|
|
147
148
|
className: "select-maillist",
|
|
148
149
|
"aria-label": t,
|
|
149
150
|
children: e
|
|
150
151
|
});
|
|
151
152
|
}
|
|
152
|
-
function
|
|
153
|
-
return /* @__PURE__ */
|
|
153
|
+
function te({ label: e, children: t }) {
|
|
154
|
+
return /* @__PURE__ */ N("div", {
|
|
154
155
|
className: "select-maillist__group",
|
|
155
156
|
role: "group",
|
|
156
157
|
"aria-label": e,
|
|
157
|
-
children: [/* @__PURE__ */
|
|
158
|
+
children: [/* @__PURE__ */ M("div", {
|
|
158
159
|
className: "select-maillist__grouplabel",
|
|
159
160
|
"aria-hidden": "true",
|
|
160
161
|
children: e
|
|
161
|
-
}), /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ M("div", {
|
|
162
163
|
className: "select-maillist__items",
|
|
163
164
|
children: t
|
|
164
165
|
})]
|
|
165
166
|
});
|
|
166
167
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
var ne = {
|
|
169
|
+
whatsapp: y,
|
|
170
|
+
email: l,
|
|
171
|
+
instagram: c,
|
|
172
|
+
messenger: u,
|
|
173
|
+
sms: h
|
|
174
|
+
};
|
|
175
|
+
function re({ from: e, avatar: t, subject: n, snippet: r, date: i, count: a, attachments: o, active: s = !1, unread: c = !1, flagged: l = !1, unreadCount: u, channel: f, avatarTone: p = "neutral", avatarRound: m = !1, onClick: h }) {
|
|
176
|
+
let _ = b().inbox, v = u != null && u > 0, y = c || v, x = t === !1 ? null : /* @__PURE__ */ M(w, {
|
|
177
|
+
name: t === !1 ? void 0 : t ?? (typeof e == "string" ? e : void 0),
|
|
178
|
+
initials: 2,
|
|
179
|
+
tone: p === "auto" ? "auto" : "neutral",
|
|
180
|
+
className: F("select-maillist__avatar", m && "select-maillist__avatar--round")
|
|
181
|
+
});
|
|
182
|
+
return /* @__PURE__ */ N("button", {
|
|
170
183
|
type: "button",
|
|
171
|
-
className:
|
|
184
|
+
className: F("select-maillist__row", s && "is-active", y && "is-unread"),
|
|
172
185
|
"aria-current": s || void 0,
|
|
173
|
-
onClick:
|
|
174
|
-
children: [
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
186
|
+
onClick: h,
|
|
187
|
+
children: [f && x ? /* @__PURE__ */ N("span", {
|
|
188
|
+
className: "select-maillist__face",
|
|
189
|
+
children: [x, /* @__PURE__ */ M(ie, {
|
|
190
|
+
channel: f,
|
|
191
|
+
label: _.channel[f]
|
|
192
|
+
})]
|
|
193
|
+
}) : x, /* @__PURE__ */ N("span", {
|
|
179
194
|
className: "select-maillist__main",
|
|
180
195
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ N("span", {
|
|
182
197
|
className: "select-maillist__line",
|
|
183
198
|
children: [
|
|
184
|
-
|
|
199
|
+
y && !v ? /* @__PURE__ */ N("span", {
|
|
185
200
|
className: "select-maillist__sr",
|
|
186
|
-
children: [
|
|
201
|
+
children: [_.unread, ": "]
|
|
187
202
|
}) : null,
|
|
188
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ M("span", {
|
|
189
204
|
className: "select-maillist__from",
|
|
190
205
|
children: e
|
|
191
206
|
}),
|
|
192
|
-
a && a > 1 ? /* @__PURE__ */
|
|
207
|
+
a && a > 1 ? /* @__PURE__ */ M("span", {
|
|
193
208
|
className: "select-maillist__count",
|
|
194
|
-
"aria-label":
|
|
209
|
+
"aria-label": _.messages(a),
|
|
195
210
|
children: a
|
|
196
211
|
}) : null,
|
|
197
|
-
|
|
212
|
+
v ? /* @__PURE__ */ M("span", {
|
|
198
213
|
className: "select-maillist__unread",
|
|
199
|
-
"aria-label":
|
|
200
|
-
children:
|
|
201
|
-
}) :
|
|
214
|
+
"aria-label": _.unreadCount(u),
|
|
215
|
+
children: u
|
|
216
|
+
}) : y ? /* @__PURE__ */ M("span", {
|
|
202
217
|
className: "select-maillist__dot",
|
|
203
218
|
"aria-hidden": "true"
|
|
204
219
|
}) : null,
|
|
205
|
-
|
|
220
|
+
l ? /* @__PURE__ */ M("span", {
|
|
206
221
|
className: "select-maillist__star",
|
|
207
222
|
role: "img",
|
|
208
|
-
"aria-label":
|
|
209
|
-
children: /* @__PURE__ */
|
|
223
|
+
"aria-label": _.flagged,
|
|
224
|
+
children: /* @__PURE__ */ M(g, { filled: !0 })
|
|
210
225
|
}) : null,
|
|
211
|
-
i ? /* @__PURE__ */
|
|
226
|
+
i ? /* @__PURE__ */ M("span", {
|
|
212
227
|
className: "select-maillist__date",
|
|
213
228
|
children: i
|
|
214
229
|
}) : null
|
|
215
230
|
]
|
|
216
231
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ M("span", {
|
|
218
233
|
className: "select-maillist__subject",
|
|
219
234
|
children: n
|
|
220
235
|
}),
|
|
221
|
-
r || o ? /* @__PURE__ */
|
|
236
|
+
r || o ? /* @__PURE__ */ N("span", {
|
|
222
237
|
className: "select-maillist__line",
|
|
223
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ M("span", {
|
|
224
239
|
className: "select-maillist__snippet",
|
|
225
240
|
children: r
|
|
226
|
-
}), o ? /* @__PURE__ */
|
|
241
|
+
}), o ? /* @__PURE__ */ M("span", {
|
|
227
242
|
className: "select-maillist__clip",
|
|
228
243
|
role: "img",
|
|
229
|
-
"aria-label":
|
|
230
|
-
children: /* @__PURE__ */
|
|
244
|
+
"aria-label": _.attachments(o),
|
|
245
|
+
children: /* @__PURE__ */ M(d, {})
|
|
231
246
|
}) : null]
|
|
232
247
|
}) : null
|
|
233
248
|
]
|
|
234
249
|
})]
|
|
235
250
|
});
|
|
236
251
|
}
|
|
237
|
-
function
|
|
238
|
-
|
|
252
|
+
function ie({ channel: e, label: t }) {
|
|
253
|
+
let n = ne[e];
|
|
254
|
+
return /* @__PURE__ */ M("span", {
|
|
255
|
+
className: `select-maillist__channel select-maillist__channel--${e}`,
|
|
256
|
+
role: "img",
|
|
257
|
+
"aria-label": t,
|
|
258
|
+
children: /* @__PURE__ */ M(n, {})
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
function H({ rows: e = 6 }) {
|
|
262
|
+
return /* @__PURE__ */ M("div", {
|
|
239
263
|
className: "select-maillist__skeleton",
|
|
240
264
|
"aria-hidden": "true",
|
|
241
|
-
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */
|
|
265
|
+
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ N("div", {
|
|
242
266
|
className: "select-maillist__skelrow",
|
|
243
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ M("span", { className: "select-maillist__skel select-maillist__skel--avatar" }), /* @__PURE__ */ N("span", {
|
|
244
268
|
className: "select-maillist__skelcol",
|
|
245
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ M("span", {
|
|
246
270
|
className: "select-maillist__skel",
|
|
247
271
|
style: { width: `${38 + t * 7 % 18}%` }
|
|
248
|
-
}), /* @__PURE__ */
|
|
272
|
+
}), /* @__PURE__ */ M("span", {
|
|
249
273
|
className: "select-maillist__skel",
|
|
250
274
|
style: { width: `${62 + t * 11 % 22}%` }
|
|
251
275
|
})]
|
|
@@ -253,53 +277,53 @@ function R({ rows: e = 6 }) {
|
|
|
253
277
|
}, t))
|
|
254
278
|
});
|
|
255
279
|
}
|
|
256
|
-
function
|
|
257
|
-
return /* @__PURE__ */
|
|
280
|
+
function U({ children: e, tone: t = "muted" }) {
|
|
281
|
+
return /* @__PURE__ */ M("div", {
|
|
258
282
|
className: `select-maillist__note select-maillist__note--${t}`,
|
|
259
283
|
children: e
|
|
260
284
|
});
|
|
261
285
|
}
|
|
262
|
-
function
|
|
263
|
-
let u =
|
|
264
|
-
return /* @__PURE__ */
|
|
265
|
-
className:
|
|
286
|
+
function W({ title: t, meta: n, actions: r, tools: i, onBack: a, children: o, footer: s, variant: c = "mail", avatar: l }) {
|
|
287
|
+
let u = b().inbox;
|
|
288
|
+
return /* @__PURE__ */ N("div", {
|
|
289
|
+
className: F("select-mailreader", c === "chat" && "select-mailreader--chat"),
|
|
266
290
|
children: [
|
|
267
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ N("header", {
|
|
268
292
|
className: "select-mailreader__head",
|
|
269
293
|
children: [
|
|
270
|
-
a ? /* @__PURE__ */
|
|
294
|
+
a ? /* @__PURE__ */ M("span", {
|
|
271
295
|
className: "select-mailreader__back",
|
|
272
|
-
children: /* @__PURE__ */
|
|
273
|
-
icon: /* @__PURE__ */
|
|
296
|
+
children: /* @__PURE__ */ M(C, {
|
|
297
|
+
icon: /* @__PURE__ */ M(e, {}),
|
|
274
298
|
label: u.back,
|
|
275
299
|
size: "sm",
|
|
276
300
|
onClick: a
|
|
277
301
|
})
|
|
278
302
|
}) : null,
|
|
279
|
-
l != null && l !== !1 ? /* @__PURE__ */
|
|
303
|
+
l != null && l !== !1 ? /* @__PURE__ */ M("span", {
|
|
280
304
|
className: "select-mailreader__avatar",
|
|
281
305
|
"aria-hidden": "true",
|
|
282
306
|
children: l
|
|
283
307
|
}) : null,
|
|
284
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ N("div", {
|
|
285
309
|
className: "select-mailreader__titles",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
310
|
+
children: [/* @__PURE__ */ M("h2", {
|
|
287
311
|
className: "select-mailreader__title",
|
|
288
312
|
children: t
|
|
289
|
-
}), n ? /* @__PURE__ */
|
|
313
|
+
}), n ? /* @__PURE__ */ M("div", {
|
|
290
314
|
className: "select-mailreader__meta",
|
|
291
315
|
children: n
|
|
292
316
|
}) : null]
|
|
293
317
|
}),
|
|
294
|
-
r || i ? /* @__PURE__ */
|
|
318
|
+
r || i ? /* @__PURE__ */ N("div", {
|
|
295
319
|
className: "select-mailreader__actions",
|
|
296
320
|
children: [
|
|
297
321
|
r,
|
|
298
|
-
r && i ? /* @__PURE__ */
|
|
322
|
+
r && i ? /* @__PURE__ */ M("span", {
|
|
299
323
|
className: "select-mailreader__sep",
|
|
300
324
|
"aria-hidden": "true"
|
|
301
325
|
}) : null,
|
|
302
|
-
i ? /* @__PURE__ */
|
|
326
|
+
i ? /* @__PURE__ */ M("span", {
|
|
303
327
|
className: "select-mailreader__tools",
|
|
304
328
|
role: "group",
|
|
305
329
|
"aria-label": u.tools,
|
|
@@ -309,318 +333,318 @@ function B({ title: t, meta: n, actions: r, tools: i, onBack: a, children: o, fo
|
|
|
309
333
|
}) : null
|
|
310
334
|
]
|
|
311
335
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ M("div", {
|
|
313
337
|
className: "select-mailreader__thread",
|
|
314
338
|
children: o
|
|
315
339
|
}),
|
|
316
|
-
s ? /* @__PURE__ */
|
|
340
|
+
s ? /* @__PURE__ */ M("div", {
|
|
317
341
|
className: "select-mailreader__footer",
|
|
318
342
|
children: s
|
|
319
343
|
}) : null
|
|
320
344
|
]
|
|
321
345
|
});
|
|
322
346
|
}
|
|
323
|
-
function
|
|
324
|
-
let
|
|
325
|
-
if (m) return /* @__PURE__ */
|
|
347
|
+
function G({ from: e, to: t, cc: n, bcc: i, selfAddress: a, date: o, dateTitle: s, actions: c, notice: l, text: u, children: f, attachments: p, collapsed: m = !1, snippet: h, hasAttachments: g = !1, onToggle: _ }) {
|
|
348
|
+
let v = (e) => !!e && !!a && e.address.toLowerCase() === a.toLowerCase(), y = (e) => (e ?? []).map((e) => v(e) ? "você" : P(e)).join(", "), b = P(e);
|
|
349
|
+
if (m) return /* @__PURE__ */ N("button", {
|
|
326
350
|
type: "button",
|
|
327
351
|
className: "select-mailmsg select-mailmsg--collapsed",
|
|
328
352
|
"aria-expanded": !1,
|
|
329
|
-
onClick:
|
|
353
|
+
onClick: _,
|
|
330
354
|
children: [
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
name:
|
|
355
|
+
/* @__PURE__ */ M(w, {
|
|
356
|
+
name: b,
|
|
333
357
|
initials: 2,
|
|
334
358
|
className: "select-mailmsg__avatar select-mailmsg__avatar--sm"
|
|
335
359
|
}),
|
|
336
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ M("span", {
|
|
337
361
|
className: "select-mailmsg__from",
|
|
338
|
-
children:
|
|
362
|
+
children: v(e) ? "Você" : b
|
|
339
363
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ M("span", {
|
|
341
365
|
className: "select-mailmsg__snippet",
|
|
342
366
|
children: h
|
|
343
367
|
}),
|
|
344
|
-
g ? /* @__PURE__ */
|
|
368
|
+
g ? /* @__PURE__ */ M("span", {
|
|
345
369
|
className: "select-mailmsg__clip",
|
|
346
370
|
role: "img",
|
|
347
371
|
"aria-label": "Com anexo",
|
|
348
|
-
children: /* @__PURE__ */
|
|
372
|
+
children: /* @__PURE__ */ M(d, {})
|
|
349
373
|
}) : null,
|
|
350
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ M("span", {
|
|
351
375
|
className: "select-mailmsg__date",
|
|
352
376
|
title: s,
|
|
353
377
|
children: o
|
|
354
378
|
})
|
|
355
379
|
]
|
|
356
380
|
});
|
|
357
|
-
let
|
|
358
|
-
t != null && t.length ? `para ${
|
|
359
|
-
n != null && n.length ? `cc ${
|
|
360
|
-
i != null && i.length ? `cco ${
|
|
381
|
+
let x = [
|
|
382
|
+
t != null && t.length ? `para ${y(t)}` : "",
|
|
383
|
+
n != null && n.length ? `cc ${y(n)}` : "",
|
|
384
|
+
i != null && i.length ? `cco ${y(i)}` : ""
|
|
361
385
|
].filter(Boolean).join(" · ");
|
|
362
|
-
return /* @__PURE__ */
|
|
386
|
+
return /* @__PURE__ */ N("article", {
|
|
363
387
|
className: "select-mailmsg",
|
|
364
388
|
children: [
|
|
365
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ N("header", {
|
|
366
390
|
className: "select-mailmsg__head",
|
|
367
391
|
children: [
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
name:
|
|
392
|
+
/* @__PURE__ */ M(w, {
|
|
393
|
+
name: b,
|
|
370
394
|
initials: 2,
|
|
371
395
|
className: "select-mailmsg__avatar"
|
|
372
396
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ N("div", {
|
|
374
398
|
className: "select-mailmsg__who",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
399
|
+
children: [/* @__PURE__ */ N("span", {
|
|
376
400
|
className: "select-mailmsg__line",
|
|
377
|
-
children: [/* @__PURE__ */
|
|
401
|
+
children: [/* @__PURE__ */ M("span", {
|
|
378
402
|
className: "select-mailmsg__from",
|
|
379
|
-
children:
|
|
380
|
-
}), e != null && e.name ? /* @__PURE__ */
|
|
403
|
+
children: b
|
|
404
|
+
}), e != null && e.name ? /* @__PURE__ */ M("span", {
|
|
381
405
|
className: "select-mailmsg__address",
|
|
382
406
|
children: e.address
|
|
383
407
|
}) : null]
|
|
384
|
-
}),
|
|
408
|
+
}), x ? /* @__PURE__ */ M("span", {
|
|
385
409
|
className: "select-mailmsg__to",
|
|
386
|
-
children:
|
|
410
|
+
children: x
|
|
387
411
|
}) : null]
|
|
388
412
|
}),
|
|
389
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ N("div", {
|
|
390
414
|
className: "select-mailmsg__side",
|
|
391
415
|
children: [
|
|
392
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ M("span", {
|
|
393
417
|
className: "select-mailmsg__date",
|
|
394
418
|
title: s,
|
|
395
419
|
children: o
|
|
396
420
|
}),
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
icon: /* @__PURE__ */
|
|
421
|
+
c,
|
|
422
|
+
_ ? /* @__PURE__ */ M(C, {
|
|
423
|
+
icon: /* @__PURE__ */ M(r, {}),
|
|
400
424
|
label: "Recolher a mensagem",
|
|
401
425
|
size: "sm",
|
|
402
|
-
onClick:
|
|
426
|
+
onClick: _,
|
|
403
427
|
"aria-expanded": !0
|
|
404
428
|
}) : null
|
|
405
429
|
]
|
|
406
430
|
})
|
|
407
431
|
]
|
|
408
432
|
}),
|
|
409
|
-
|
|
433
|
+
l ? /* @__PURE__ */ M("div", {
|
|
410
434
|
className: "select-mailmsg__notices",
|
|
411
|
-
children:
|
|
435
|
+
children: l
|
|
412
436
|
}) : null,
|
|
413
|
-
f ? /* @__PURE__ */
|
|
437
|
+
f ? /* @__PURE__ */ M("div", {
|
|
414
438
|
className: "select-mailmsg__body",
|
|
415
439
|
children: f
|
|
416
|
-
}) :
|
|
440
|
+
}) : u ? /* @__PURE__ */ M("div", {
|
|
417
441
|
className: "select-mailmsg__text",
|
|
418
|
-
children:
|
|
442
|
+
children: u
|
|
419
443
|
}) : null,
|
|
420
|
-
p ? /* @__PURE__ */
|
|
444
|
+
p ? /* @__PURE__ */ M("div", {
|
|
421
445
|
className: "select-mailmsg__attachments",
|
|
422
446
|
children: p
|
|
423
447
|
}) : null
|
|
424
448
|
]
|
|
425
449
|
});
|
|
426
450
|
}
|
|
427
|
-
function
|
|
428
|
-
return /* @__PURE__ */
|
|
451
|
+
function K({ tone: e = "info", icon: t, children: n }) {
|
|
452
|
+
return /* @__PURE__ */ N("div", {
|
|
429
453
|
className: `select-mailnotice select-mailnotice--${e}`,
|
|
430
|
-
children: [/* @__PURE__ */
|
|
454
|
+
children: [/* @__PURE__ */ M("span", {
|
|
431
455
|
className: "select-mailnotice__icon",
|
|
432
456
|
"aria-hidden": "true",
|
|
433
|
-
children: t ??
|
|
434
|
-
}), /* @__PURE__ */
|
|
457
|
+
children: t ?? M(e === "warning" ? s : m, {})
|
|
458
|
+
}), /* @__PURE__ */ M("span", { children: n })]
|
|
435
459
|
});
|
|
436
460
|
}
|
|
437
|
-
function
|
|
438
|
-
let l =
|
|
439
|
-
return /* @__PURE__ */
|
|
461
|
+
function q({ name: e, size: t, state: n = "idle", onClick: r, loadingLabel: i, readyLabel: s, failedLabel: c }) {
|
|
462
|
+
let l = b().inbox, u = T(e), d = n === "loading" ? i ?? l.attachmentLoading : n === "ready" ? s ?? l.attachmentReady : n === "failed" ? c ?? l.attachmentFailed : t, f = n === "ready" ? l.attachmentOpen(e) : n === "loading" ? l.attachmentBusy(e) : l.attachmentGet(e);
|
|
463
|
+
return /* @__PURE__ */ N("button", {
|
|
440
464
|
type: "button",
|
|
441
465
|
className: `select-mailatt select-mailatt--${n}`,
|
|
442
466
|
onClick: r,
|
|
443
467
|
"aria-label": f,
|
|
444
468
|
"aria-busy": n === "loading" || void 0,
|
|
445
469
|
children: [
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
className: `select-mailatt__ext select-mailatt__ext--${
|
|
470
|
+
/* @__PURE__ */ M("span", {
|
|
471
|
+
className: `select-mailatt__ext select-mailatt__ext--${E(u)}`,
|
|
448
472
|
"aria-hidden": "true",
|
|
449
473
|
children: u
|
|
450
474
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ N("span", {
|
|
452
476
|
className: "select-mailatt__text",
|
|
453
|
-
children: [/* @__PURE__ */
|
|
477
|
+
children: [/* @__PURE__ */ M("span", {
|
|
454
478
|
className: "select-mailatt__name",
|
|
455
479
|
children: e
|
|
456
|
-
}), d ? /* @__PURE__ */
|
|
480
|
+
}), d ? /* @__PURE__ */ M("span", {
|
|
457
481
|
className: "select-mailatt__sub",
|
|
458
482
|
children: d
|
|
459
483
|
}) : null]
|
|
460
484
|
}),
|
|
461
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ M("span", {
|
|
462
486
|
className: "select-mailatt__icon",
|
|
463
487
|
"aria-hidden": "true",
|
|
464
|
-
children:
|
|
488
|
+
children: M(n === "ready" ? a : n === "failed" ? v : o, {})
|
|
465
489
|
})
|
|
466
490
|
]
|
|
467
491
|
});
|
|
468
492
|
}
|
|
469
|
-
function
|
|
470
|
-
return /* @__PURE__ */
|
|
493
|
+
function J({ children: e, onClick: n, variant: r = "link", title: i }) {
|
|
494
|
+
return /* @__PURE__ */ N("button", {
|
|
471
495
|
type: "button",
|
|
472
496
|
className: `select-leadchip select-leadchip--${r}`,
|
|
473
497
|
onClick: n,
|
|
474
498
|
title: i,
|
|
475
499
|
children: [
|
|
476
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ M("span", {
|
|
477
501
|
className: "select-leadchip__icon",
|
|
478
502
|
"aria-hidden": "true",
|
|
479
|
-
children:
|
|
503
|
+
children: M(r === "create" ? f : _, {})
|
|
480
504
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ M("span", {
|
|
482
506
|
className: "select-leadchip__label",
|
|
483
507
|
children: e
|
|
484
508
|
}),
|
|
485
|
-
r === "link" ? /* @__PURE__ */
|
|
509
|
+
r === "link" ? /* @__PURE__ */ M("span", {
|
|
486
510
|
className: "select-leadchip__go",
|
|
487
511
|
"aria-hidden": "true",
|
|
488
|
-
children: /* @__PURE__ */
|
|
512
|
+
children: /* @__PURE__ */ M(t, {})
|
|
489
513
|
}) : null
|
|
490
514
|
]
|
|
491
515
|
});
|
|
492
516
|
}
|
|
493
|
-
var
|
|
517
|
+
var Y = (e) => {
|
|
494
518
|
var t;
|
|
495
519
|
return Array.from(((t = e.dataTransfer) == null ? void 0 : t.types) ?? []).includes("Files");
|
|
496
520
|
};
|
|
497
|
-
function
|
|
498
|
-
let
|
|
521
|
+
function ae({ variant: e = "inline", title: t, minimized: a = !1, onToggleMinimize: o, onClose: c, closeLabel: l, error: u, attachments: f, onFiles: p, dropLabel: m, footer: h, start: g, end: _, hint: v, hintEnd: y, shape: S = "box", children: w, "aria-label": T }) {
|
|
522
|
+
let E = b().inbox, D = e === "dock", O = e === "chat", P = ee(O && S === "auto" ? x : void 0), I = O && (S === "pill" || S === "auto" && P), [L, R] = A(!1), z = k(0), B = p ? {
|
|
499
523
|
onDragEnter: (e) => {
|
|
500
|
-
|
|
524
|
+
Y(e) && (e.preventDefault(), z.current += 1, R(!0));
|
|
501
525
|
},
|
|
502
526
|
onDragOver: (e) => {
|
|
503
|
-
|
|
527
|
+
Y(e) && e.preventDefault();
|
|
504
528
|
},
|
|
505
529
|
onDragLeave: (e) => {
|
|
506
|
-
|
|
530
|
+
Y(e) && (z.current = Math.max(0, z.current - 1), z.current === 0 && R(!1));
|
|
507
531
|
},
|
|
508
532
|
onDrop: (e) => {
|
|
509
|
-
if (!
|
|
510
|
-
e.preventDefault(),
|
|
533
|
+
if (!Y(e)) return;
|
|
534
|
+
e.preventDefault(), z.current = 0, R(!1);
|
|
511
535
|
let t = Array.from(e.dataTransfer.files);
|
|
512
536
|
t.length && p(t);
|
|
513
537
|
}
|
|
514
|
-
} : {},
|
|
515
|
-
className:
|
|
516
|
-
role:
|
|
517
|
-
"aria-label":
|
|
518
|
-
...
|
|
538
|
+
} : {}, V = /* @__PURE__ */ N("div", {
|
|
539
|
+
className: F("select-mailcomposer", `select-mailcomposer--${e}`, I && "select-mailcomposer--pill", a && "is-minimized", L && "is-dragging"),
|
|
540
|
+
role: D ? "dialog" : "group",
|
|
541
|
+
"aria-label": T,
|
|
542
|
+
...B,
|
|
519
543
|
children: [
|
|
520
|
-
|
|
544
|
+
D ? /* @__PURE__ */ N("div", {
|
|
521
545
|
className: "select-mailcomposer__bar",
|
|
522
546
|
children: [
|
|
523
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ M("span", {
|
|
524
548
|
className: "select-mailcomposer__title",
|
|
525
549
|
children: t
|
|
526
550
|
}),
|
|
527
|
-
o ? /* @__PURE__ */
|
|
528
|
-
icon:
|
|
529
|
-
label: a ?
|
|
551
|
+
o ? /* @__PURE__ */ M(C, {
|
|
552
|
+
icon: M(a ? r : n, {}),
|
|
553
|
+
label: a ? E.open : E.minimize,
|
|
530
554
|
size: "sm",
|
|
531
555
|
onClick: o
|
|
532
556
|
}) : null,
|
|
533
|
-
|
|
534
|
-
icon: /* @__PURE__ */
|
|
535
|
-
label:
|
|
557
|
+
c ? /* @__PURE__ */ M(C, {
|
|
558
|
+
icon: /* @__PURE__ */ M(i, {}),
|
|
559
|
+
label: l ?? E.close,
|
|
536
560
|
size: "sm",
|
|
537
|
-
onClick:
|
|
561
|
+
onClick: c
|
|
538
562
|
}) : null
|
|
539
563
|
]
|
|
540
564
|
}) : null,
|
|
541
|
-
|
|
565
|
+
L && !a ? /* @__PURE__ */ N("div", {
|
|
542
566
|
className: "select-mailcomposer__drop",
|
|
543
567
|
"aria-hidden": "true",
|
|
544
|
-
children: [/* @__PURE__ */
|
|
568
|
+
children: [/* @__PURE__ */ M(d, {}), /* @__PURE__ */ M("span", { children: m ?? E.drop })]
|
|
545
569
|
}) : null,
|
|
546
|
-
a ? null :
|
|
570
|
+
a ? null : O ? /* @__PURE__ */ N(j, { children: [
|
|
547
571
|
f,
|
|
548
|
-
|
|
572
|
+
u ? /* @__PURE__ */ N("div", {
|
|
549
573
|
className: "select-mailcomposer__error",
|
|
550
574
|
role: "alert",
|
|
551
|
-
children: [/* @__PURE__ */
|
|
575
|
+
children: [/* @__PURE__ */ M("span", {
|
|
552
576
|
"aria-hidden": "true",
|
|
553
|
-
children: /* @__PURE__ */
|
|
554
|
-
}), /* @__PURE__ */
|
|
577
|
+
children: /* @__PURE__ */ M(s, {})
|
|
578
|
+
}), /* @__PURE__ */ M("span", { children: u })]
|
|
555
579
|
}) : null,
|
|
556
|
-
/* @__PURE__ */
|
|
580
|
+
/* @__PURE__ */ N("div", {
|
|
557
581
|
className: "select-mailcomposer__line",
|
|
558
582
|
children: [
|
|
559
|
-
|
|
583
|
+
g != null && g !== !1 ? /* @__PURE__ */ M("div", {
|
|
560
584
|
className: "select-mailcomposer__start",
|
|
561
|
-
children:
|
|
585
|
+
children: g
|
|
562
586
|
}) : null,
|
|
563
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ M("div", {
|
|
564
588
|
className: "select-mailcomposer__fields",
|
|
565
|
-
children:
|
|
589
|
+
children: w
|
|
566
590
|
}),
|
|
567
|
-
|
|
591
|
+
_ != null && _ !== !1 ? /* @__PURE__ */ M("div", {
|
|
568
592
|
className: "select-mailcomposer__end",
|
|
569
|
-
children:
|
|
593
|
+
children: _
|
|
570
594
|
}) : null
|
|
571
595
|
]
|
|
572
596
|
}),
|
|
573
|
-
|
|
597
|
+
h != null && h !== !1 ? /* @__PURE__ */ M("div", {
|
|
574
598
|
className: "select-mailcomposer__footer",
|
|
575
|
-
children:
|
|
599
|
+
children: h
|
|
576
600
|
}) : null
|
|
577
|
-
] }) : /* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */
|
|
601
|
+
] }) : /* @__PURE__ */ N(j, { children: [
|
|
602
|
+
/* @__PURE__ */ M("div", {
|
|
579
603
|
className: "select-mailcomposer__fields",
|
|
580
|
-
children:
|
|
604
|
+
children: w
|
|
581
605
|
}),
|
|
582
606
|
f,
|
|
583
|
-
|
|
607
|
+
u ? /* @__PURE__ */ N("div", {
|
|
584
608
|
className: "select-mailcomposer__error",
|
|
585
609
|
role: "alert",
|
|
586
|
-
children: [/* @__PURE__ */
|
|
610
|
+
children: [/* @__PURE__ */ M("span", {
|
|
587
611
|
"aria-hidden": "true",
|
|
588
|
-
children: /* @__PURE__ */
|
|
589
|
-
}), /* @__PURE__ */
|
|
612
|
+
children: /* @__PURE__ */ M(s, {})
|
|
613
|
+
}), /* @__PURE__ */ M("span", { children: u })]
|
|
590
614
|
}) : null,
|
|
591
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ M("div", {
|
|
592
616
|
className: "select-mailcomposer__footer",
|
|
593
|
-
children:
|
|
617
|
+
children: h
|
|
594
618
|
})
|
|
595
619
|
] })
|
|
596
620
|
]
|
|
597
621
|
});
|
|
598
|
-
return !
|
|
622
|
+
return !O || (v == null || v === !1) && (y == null || y === !1) ? V : /* @__PURE__ */ N(j, { children: [V, /* @__PURE__ */ N("div", {
|
|
599
623
|
className: "select-mailcomposer__hint",
|
|
600
|
-
children: [/* @__PURE__ */
|
|
624
|
+
children: [/* @__PURE__ */ M("span", { children: v }), y != null && y !== !1 ? /* @__PURE__ */ M("span", { children: y }) : null]
|
|
601
625
|
})] });
|
|
602
626
|
}
|
|
603
|
-
function
|
|
604
|
-
return /* @__PURE__ */
|
|
627
|
+
function oe({ label: e, children: t, action: n }) {
|
|
628
|
+
return /* @__PURE__ */ N("div", {
|
|
605
629
|
className: "select-mailcomposer__row",
|
|
606
630
|
children: [
|
|
607
|
-
e ? /* @__PURE__ */
|
|
631
|
+
e ? /* @__PURE__ */ M("span", {
|
|
608
632
|
className: "select-mailcomposer__label",
|
|
609
633
|
children: e
|
|
610
634
|
}) : null,
|
|
611
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ M("div", {
|
|
612
636
|
className: "select-mailcomposer__control",
|
|
613
637
|
children: t
|
|
614
638
|
}),
|
|
615
|
-
n ? /* @__PURE__ */
|
|
639
|
+
n ? /* @__PURE__ */ M("div", {
|
|
616
640
|
className: "select-mailcomposer__rowaction",
|
|
617
641
|
children: n
|
|
618
642
|
}) : null
|
|
619
643
|
]
|
|
620
644
|
});
|
|
621
645
|
}
|
|
622
|
-
function
|
|
623
|
-
return /* @__PURE__ */
|
|
646
|
+
function se({ value: e, onChange: t, placeholder: n, "aria-label": r, maxLength: i }) {
|
|
647
|
+
return /* @__PURE__ */ M("input", {
|
|
624
648
|
className: "select-mailcomposer__input",
|
|
625
649
|
value: e,
|
|
626
650
|
onChange: (e) => t(e.target.value),
|
|
@@ -629,38 +653,38 @@ function J({ value: e, onChange: t, placeholder: n, "aria-label": r, maxLength:
|
|
|
629
653
|
maxLength: i
|
|
630
654
|
});
|
|
631
655
|
}
|
|
632
|
-
function
|
|
656
|
+
function X(e, t, n) {
|
|
633
657
|
let r = getComputedStyle(e), i = parseFloat(r.lineHeight) || 22, a = (parseFloat(r.paddingTop) || 0) + (parseFloat(r.paddingBottom) || 0) + (parseFloat(r.borderTopWidth) || 0) + (parseFloat(r.borderBottomWidth) || 0), o = i * t + a, s = i * n + a;
|
|
634
658
|
e.style.height = "auto";
|
|
635
659
|
let c = e.scrollHeight + (parseFloat(r.borderTopWidth) || 0) + (parseFloat(r.borderBottomWidth) || 0);
|
|
636
660
|
e.style.height = `${Math.round(Math.min(s, Math.max(o, c)))}px`, e.style.overflowY = c > s ? "auto" : "hidden";
|
|
637
661
|
}
|
|
638
|
-
function
|
|
639
|
-
let
|
|
640
|
-
|
|
662
|
+
function ce({ value: e, onChange: t, placeholder: n, rows: r = 6, autoGrow: i = !1, minRows: a = 3, maxRows: o = 12, "aria-label": s, maxLength: c, onEnter: l, id: u, textareaRef: d, onKeyDown: f, onSelect: p, fieldProps: m }) {
|
|
663
|
+
let h = b().inbox, g = k(null), _ = D((e) => {
|
|
664
|
+
g.current = e, typeof d == "function" ? d(e) : d && (d.current = e);
|
|
641
665
|
}, [d]);
|
|
642
|
-
return
|
|
643
|
-
let e =
|
|
644
|
-
i && e &&
|
|
666
|
+
return O(() => {
|
|
667
|
+
let e = g.current;
|
|
668
|
+
i && e && X(e, a, o);
|
|
645
669
|
}, [
|
|
646
670
|
i,
|
|
647
671
|
e,
|
|
648
672
|
a,
|
|
649
673
|
o
|
|
650
|
-
]),
|
|
651
|
-
let e =
|
|
674
|
+
]), O(() => {
|
|
675
|
+
let e = g.current;
|
|
652
676
|
if (!i || !e || typeof ResizeObserver > "u") return;
|
|
653
677
|
let t = e.clientWidth, n = new ResizeObserver(() => {
|
|
654
|
-
e.clientWidth !== t && (t = e.clientWidth,
|
|
678
|
+
e.clientWidth !== t && (t = e.clientWidth, X(e, a, o));
|
|
655
679
|
});
|
|
656
680
|
return n.observe(e), () => n.disconnect();
|
|
657
681
|
}, [
|
|
658
682
|
i,
|
|
659
683
|
a,
|
|
660
684
|
o
|
|
661
|
-
]), /* @__PURE__ */
|
|
685
|
+
]), /* @__PURE__ */ M("textarea", {
|
|
662
686
|
...m,
|
|
663
|
-
ref:
|
|
687
|
+
ref: _,
|
|
664
688
|
id: u,
|
|
665
689
|
className: `select-mailcomposer__body${i ? " select-mailcomposer__body--grow" : ""}`,
|
|
666
690
|
value: e,
|
|
@@ -671,14 +695,14 @@ function X({ value: e, onChange: t, placeholder: n, rows: r = 6, autoGrow: i = !
|
|
|
671
695
|
onSelect: p,
|
|
672
696
|
placeholder: n,
|
|
673
697
|
rows: i ? a : r,
|
|
674
|
-
"aria-label": s ??
|
|
698
|
+
"aria-label": s ?? h.message,
|
|
675
699
|
maxLength: c
|
|
676
700
|
});
|
|
677
701
|
}
|
|
678
|
-
function
|
|
679
|
-
let a =
|
|
680
|
-
return /* @__PURE__ */
|
|
681
|
-
icon: /* @__PURE__ */
|
|
702
|
+
function le({ onFiles: e, accept: t, multiple: n = !0, disabled: r = !1, label: i = "Anexar arquivo" }) {
|
|
703
|
+
let a = k(null);
|
|
704
|
+
return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(C, {
|
|
705
|
+
icon: /* @__PURE__ */ M(d, {}),
|
|
682
706
|
label: i,
|
|
683
707
|
size: "sm",
|
|
684
708
|
disabled: r,
|
|
@@ -686,7 +710,7 @@ function Z({ onFiles: e, accept: t, multiple: n = !0, disabled: r = !1, label: i
|
|
|
686
710
|
var e;
|
|
687
711
|
return (e = a.current) == null ? void 0 : e.click();
|
|
688
712
|
}
|
|
689
|
-
}), /* @__PURE__ */
|
|
713
|
+
}), /* @__PURE__ */ M("input", {
|
|
690
714
|
ref: a,
|
|
691
715
|
type: "file",
|
|
692
716
|
className: "select-mailcomposer__file",
|
|
@@ -700,60 +724,60 @@ function Z({ onFiles: e, accept: t, multiple: n = !0, disabled: r = !1, label: i
|
|
|
700
724
|
}
|
|
701
725
|
})] });
|
|
702
726
|
}
|
|
703
|
-
function
|
|
704
|
-
return /* @__PURE__ */
|
|
727
|
+
function ue({ children: e, note: t }) {
|
|
728
|
+
return /* @__PURE__ */ N("div", {
|
|
705
729
|
className: "select-mailcomposer__attachments",
|
|
706
730
|
role: "list",
|
|
707
731
|
"aria-label": "Anexos",
|
|
708
|
-
children: [e, t ? /* @__PURE__ */
|
|
732
|
+
children: [e, t ? /* @__PURE__ */ M("span", {
|
|
709
733
|
className: "select-mailcomposer__attnote",
|
|
710
734
|
children: t
|
|
711
735
|
}) : null]
|
|
712
736
|
});
|
|
713
737
|
}
|
|
714
|
-
function
|
|
715
|
-
let c =
|
|
716
|
-
return /* @__PURE__ */
|
|
738
|
+
function de({ name: e, size: t, state: n = "done", progress: r, error: a, onRemove: o, onRetry: s }) {
|
|
739
|
+
let c = T(e), l = r == null ? null : Math.round(Math.min(1, Math.max(0, r)) * 100), u = n === "uploading" ? l == null ? "Subindo…" : `Subindo… ${l}%` : n === "failed" ? a ?? "Não subiu" : t;
|
|
740
|
+
return /* @__PURE__ */ N("span", {
|
|
717
741
|
className: `select-mailupload select-mailupload--${n}`,
|
|
718
742
|
role: "listitem",
|
|
719
743
|
"aria-busy": n === "uploading" || void 0,
|
|
720
744
|
children: [
|
|
721
|
-
/* @__PURE__ */
|
|
722
|
-
className: `select-mailatt__ext select-mailatt__ext--${
|
|
745
|
+
/* @__PURE__ */ M("span", {
|
|
746
|
+
className: `select-mailatt__ext select-mailatt__ext--${E(c)} select-mailupload__ext`,
|
|
723
747
|
"aria-hidden": "true",
|
|
724
748
|
children: c
|
|
725
749
|
}),
|
|
726
|
-
/* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ N("span", {
|
|
727
751
|
className: "select-mailupload__text",
|
|
728
|
-
children: [/* @__PURE__ */
|
|
752
|
+
children: [/* @__PURE__ */ M("span", {
|
|
729
753
|
className: "select-mailupload__name",
|
|
730
754
|
title: e,
|
|
731
755
|
children: e
|
|
732
|
-
}),
|
|
756
|
+
}), u ? /* @__PURE__ */ M("span", {
|
|
733
757
|
className: "select-mailupload__sub",
|
|
734
|
-
children:
|
|
758
|
+
children: u
|
|
735
759
|
}) : null]
|
|
736
760
|
}),
|
|
737
|
-
n === "failed" && s ? /* @__PURE__ */
|
|
761
|
+
n === "failed" && s ? /* @__PURE__ */ M("button", {
|
|
738
762
|
type: "button",
|
|
739
763
|
className: "select-mailupload__btn",
|
|
740
764
|
onClick: s,
|
|
741
765
|
"aria-label": `Subir ${e} de novo`,
|
|
742
766
|
title: "Tentar de novo",
|
|
743
|
-
children: /* @__PURE__ */
|
|
767
|
+
children: /* @__PURE__ */ M(p, {})
|
|
744
768
|
}) : null,
|
|
745
|
-
/* @__PURE__ */
|
|
769
|
+
/* @__PURE__ */ M("button", {
|
|
746
770
|
type: "button",
|
|
747
771
|
className: "select-mailupload__btn",
|
|
748
772
|
onClick: o,
|
|
749
773
|
"aria-label": `Tirar o anexo ${e}`,
|
|
750
774
|
title: "Tirar",
|
|
751
|
-
children: /* @__PURE__ */
|
|
775
|
+
children: /* @__PURE__ */ M(i, {})
|
|
752
776
|
}),
|
|
753
|
-
n === "uploading" ? /* @__PURE__ */
|
|
777
|
+
n === "uploading" ? /* @__PURE__ */ M("span", {
|
|
754
778
|
className: "select-mailupload__bar",
|
|
755
779
|
"aria-hidden": "true",
|
|
756
|
-
children: /* @__PURE__ */
|
|
780
|
+
children: /* @__PURE__ */ M("span", {
|
|
757
781
|
className: l == null ? "is-indeterminate" : void 0,
|
|
758
782
|
style: l == null ? void 0 : { width: `${l}%` }
|
|
759
783
|
})
|
|
@@ -761,35 +785,35 @@ function te({ name: e, size: t, state: n = "done", progress: r, error: a, onRemo
|
|
|
761
785
|
]
|
|
762
786
|
});
|
|
763
787
|
}
|
|
764
|
-
function
|
|
765
|
-
return /* @__PURE__ */
|
|
766
|
-
e ? /* @__PURE__ */
|
|
788
|
+
function fe({ start: e, note: t, end: n }) {
|
|
789
|
+
return /* @__PURE__ */ N(j, { children: [
|
|
790
|
+
e ? /* @__PURE__ */ M("div", {
|
|
767
791
|
className: "select-mailcomposer__start",
|
|
768
792
|
children: e
|
|
769
793
|
}) : null,
|
|
770
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ M("span", {
|
|
771
795
|
className: "select-mailcomposer__note",
|
|
772
796
|
children: t
|
|
773
797
|
}),
|
|
774
|
-
n ? /* @__PURE__ */
|
|
798
|
+
n ? /* @__PURE__ */ M("div", {
|
|
775
799
|
className: "select-mailcomposer__end",
|
|
776
800
|
children: n
|
|
777
801
|
}) : null
|
|
778
802
|
] });
|
|
779
803
|
}
|
|
780
|
-
var
|
|
804
|
+
var Z = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Q = /[\s,;]+/;
|
|
781
805
|
function $(e) {
|
|
782
|
-
return
|
|
806
|
+
return Z.test(e);
|
|
783
807
|
}
|
|
784
|
-
function
|
|
785
|
-
let [s, c] =
|
|
808
|
+
function pe({ value: e, onChange: t, labels: n, validate: r = $, placeholder: a, "aria-label": o }) {
|
|
809
|
+
let [s, c] = A(""), l = k(null), u = (n) => {
|
|
786
810
|
let r = n.split(Q).map((e) => e.trim()).filter(Boolean);
|
|
787
811
|
if (c(""), !r.length) return;
|
|
788
812
|
let i = [...e];
|
|
789
813
|
for (let e of r) i.some((t) => t.toLowerCase() === e.toLowerCase()) || i.push(e);
|
|
790
814
|
i.length !== e.length && t(i);
|
|
791
815
|
};
|
|
792
|
-
return /* @__PURE__ */
|
|
816
|
+
return /* @__PURE__ */ N("div", {
|
|
793
817
|
className: "select-recipients",
|
|
794
818
|
onClick: () => {
|
|
795
819
|
var e;
|
|
@@ -797,23 +821,23 @@ function ie({ value: e, onChange: t, labels: n, validate: r = $, placeholder: a,
|
|
|
797
821
|
},
|
|
798
822
|
children: [e.map((a) => {
|
|
799
823
|
let o = !r(a), s = (n == null ? void 0 : n[a]) ?? a;
|
|
800
|
-
return /* @__PURE__ */
|
|
801
|
-
className:
|
|
824
|
+
return /* @__PURE__ */ N("span", {
|
|
825
|
+
className: F("select-recipients__chip", o && "is-invalid"),
|
|
802
826
|
title: s === a ? o ? "Endereço inválido" : void 0 : a,
|
|
803
|
-
children: [/* @__PURE__ */
|
|
827
|
+
children: [/* @__PURE__ */ M("span", {
|
|
804
828
|
className: "select-recipients__label",
|
|
805
829
|
children: s
|
|
806
|
-
}), /* @__PURE__ */
|
|
830
|
+
}), /* @__PURE__ */ M("button", {
|
|
807
831
|
type: "button",
|
|
808
832
|
className: "select-recipients__remove",
|
|
809
833
|
"aria-label": `Tirar ${s}`,
|
|
810
834
|
onClick: (n) => {
|
|
811
835
|
n.stopPropagation(), t(e.filter((e) => e !== a));
|
|
812
836
|
},
|
|
813
|
-
children: /* @__PURE__ */
|
|
837
|
+
children: /* @__PURE__ */ M(i, {})
|
|
814
838
|
})]
|
|
815
839
|
}, a);
|
|
816
|
-
}), /* @__PURE__ */
|
|
840
|
+
}), /* @__PURE__ */ M("input", {
|
|
817
841
|
ref: l,
|
|
818
842
|
className: "select-recipients__input",
|
|
819
843
|
value: s,
|
|
@@ -833,39 +857,39 @@ function ie({ value: e, onChange: t, labels: n, validate: r = $, placeholder: a,
|
|
|
833
857
|
})]
|
|
834
858
|
});
|
|
835
859
|
}
|
|
836
|
-
function
|
|
837
|
-
return /* @__PURE__ */
|
|
860
|
+
function me({ open: e, onClose: t, activator: n, templates: r, onPick: i, hint: a, footer: o, empty: s = "Nenhum modelo ainda." }) {
|
|
861
|
+
return /* @__PURE__ */ M(S, {
|
|
838
862
|
active: e,
|
|
839
863
|
onClose: t,
|
|
840
864
|
activator: n,
|
|
841
865
|
placement: "top-start",
|
|
842
866
|
role: "menu",
|
|
843
|
-
children: /* @__PURE__ */
|
|
867
|
+
children: /* @__PURE__ */ N("div", {
|
|
844
868
|
className: "select-tplmenu",
|
|
845
869
|
children: [
|
|
846
|
-
a ? /* @__PURE__ */
|
|
870
|
+
a ? /* @__PURE__ */ M("div", {
|
|
847
871
|
className: "select-tplmenu__hint",
|
|
848
872
|
children: a
|
|
849
873
|
}) : null,
|
|
850
|
-
r.length ? r.map((e) => /* @__PURE__ */
|
|
874
|
+
r.length ? r.map((e) => /* @__PURE__ */ N("button", {
|
|
851
875
|
type: "button",
|
|
852
876
|
role: "menuitem",
|
|
853
877
|
className: "select-tplmenu__item",
|
|
854
878
|
onClick: () => {
|
|
855
879
|
i(e.id), t();
|
|
856
880
|
},
|
|
857
|
-
children: [/* @__PURE__ */
|
|
881
|
+
children: [/* @__PURE__ */ M("span", {
|
|
858
882
|
className: "select-tplmenu__name",
|
|
859
883
|
children: e.name
|
|
860
|
-
}), /* @__PURE__ */
|
|
884
|
+
}), /* @__PURE__ */ M("span", {
|
|
861
885
|
className: "select-tplmenu__subject",
|
|
862
886
|
children: e.subject
|
|
863
887
|
})]
|
|
864
|
-
}, e.id)) : /* @__PURE__ */
|
|
888
|
+
}, e.id)) : /* @__PURE__ */ M("div", {
|
|
865
889
|
className: "select-tplmenu__empty",
|
|
866
890
|
children: s
|
|
867
891
|
}),
|
|
868
|
-
o ? /* @__PURE__ */
|
|
892
|
+
o ? /* @__PURE__ */ M("div", {
|
|
869
893
|
className: "select-tplmenu__footer",
|
|
870
894
|
children: o
|
|
871
895
|
}) : null
|
|
@@ -874,6 +898,6 @@ function ae({ open: e, onClose: t, activator: n, templates: r, onPick: i, hint:
|
|
|
874
898
|
});
|
|
875
899
|
}
|
|
876
900
|
//#endregion
|
|
877
|
-
export {
|
|
901
|
+
export { I as SelectInbox, L as SelectInboxBanner, B as SelectInboxEmpty, R as SelectInboxToolbar, J as SelectLeadChip, le as SelectMailAttachButton, q as SelectMailAttachment, ae as SelectMailComposer, ue as SelectMailComposerAttachments, ce as SelectMailComposerBody, fe as SelectMailComposerFooter, se as SelectMailComposerInput, oe as SelectMailComposerRow, V as SelectMailList, te as SelectMailListGroup, re as SelectMailListItem, U as SelectMailListNote, H as SelectMailListSkeleton, G as SelectMailMessage, K as SelectMailNotice, W as SelectMailReader, de as SelectMailUpload, z as SelectMailboxStatus, pe as SelectRecipientInput, me as SelectTemplateMenu, T as attachmentExt, $ as isMailAddress, P as mailName };
|
|
878
902
|
|
|
879
903
|
//# sourceMappingURL=SelectMail.js.map
|