@alfadocs/ui-kit 1.148.0 → 1.149.0
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/_chunks/{calendar-appointment-editor-dialog-Cz8F2H4M.js → calendar-appointment-editor-dialog-Dx9_KIWA.js} +5 -5
- package/dist/_chunks/{calendar-waiting-list-panel-C4T85b4q.js → calendar-waiting-list-panel-BKBHfBpn.js} +2 -2
- package/dist/_chunks/{calendar.sheets-DsgPdycU.js → calendar.sheets-lgAqJB34.js} +2 -2
- package/dist/_chunks/notes-panel-Cw06dLDm.js +1135 -0
- package/dist/_chunks/rich-text-editor-eGdYDPK2.js +4405 -0
- package/dist/_chunks/task-editor-4zFL10oM.js +1153 -0
- package/dist/_chunks/{tasks-panel-DufAoAxG.js → tasks-panel-BDPQPOP6.js} +475 -461
- package/dist/_chunks/{use-appointment-details-read-kYp-gfhb.js → use-appointment-details-read-Bl1DHXQ2.js} +568 -554
- package/dist/agent-catalog.json +9 -7
- package/dist/agent-i18n/en.json +4 -4
- package/dist/appointment-editor-panel/index.js +1 -1
- package/dist/aws-transcribe/index.js +287 -181
- package/dist/browser-support.js +1 -1
- package/dist/components/_shared/save-outcome.d.ts +23 -0
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/rich-text-editor/help-me-write-overlay.d.ts +12 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +5 -3
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/task-editor/use-task-editor-form.d.ts +7 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/find-free-slots-panel/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +1 -0
- package/dist/i18n/locales/ar.js +2 -1
- package/dist/i18n/locales/de.d.ts +1 -0
- package/dist/i18n/locales/de.js +2 -1
- package/dist/i18n/locales/el.d.ts +1 -0
- package/dist/i18n/locales/el.js +2 -1
- package/dist/i18n/locales/en.d.ts +1 -0
- package/dist/i18n/locales/en.js +2 -1
- package/dist/i18n/locales/es.d.ts +1 -0
- package/dist/i18n/locales/es.js +2 -1
- package/dist/i18n/locales/fr.d.ts +1 -0
- package/dist/i18n/locales/fr.js +2 -1
- package/dist/i18n/locales/hi.d.ts +1 -0
- package/dist/i18n/locales/hi.js +2 -1
- package/dist/i18n/locales/it.d.ts +1 -0
- package/dist/i18n/locales/it.js +2 -1
- package/dist/i18n/locales/ja.d.ts +1 -0
- package/dist/i18n/locales/ja.js +2 -1
- package/dist/i18n/locales/nl.d.ts +1 -0
- package/dist/i18n/locales/nl.js +2 -1
- package/dist/i18n/locales/pl.d.ts +1 -0
- package/dist/i18n/locales/pl.js +2 -1
- package/dist/i18n/locales/pt.d.ts +1 -0
- package/dist/i18n/locales/pt.js +2 -1
- package/dist/i18n/locales/ro.d.ts +1 -0
- package/dist/i18n/locales/ro.js +2 -1
- package/dist/i18n/locales/ru.d.ts +1 -0
- package/dist/i18n/locales/ru.js +2 -1
- package/dist/i18n/locales/sq.d.ts +1 -0
- package/dist/i18n/locales/sq.js +2 -1
- package/dist/i18n/locales/sv.d.ts +1 -0
- package/dist/i18n/locales/sv.js +2 -1
- package/dist/i18n/locales/tr.d.ts +1 -0
- package/dist/i18n/locales/tr.js +2 -1
- package/dist/i18n/locales/zh.d.ts +1 -0
- package/dist/i18n/locales/zh.js +2 -1
- package/dist/index.js +1407 -1403
- package/dist/locales/ar.json +2 -1
- package/dist/locales/de.json +2 -1
- package/dist/locales/el.json +2 -1
- package/dist/locales/en.json +2 -1
- package/dist/locales/es.json +2 -1
- package/dist/locales/fr.json +2 -1
- package/dist/locales/hi.json +2 -1
- package/dist/locales/it.json +2 -1
- package/dist/locales/ja.json +2 -1
- package/dist/locales/nl.json +2 -1
- package/dist/locales/pl.json +2 -1
- package/dist/locales/pt.json +2 -1
- package/dist/locales/ro.json +2 -1
- package/dist/locales/ru.json +2 -1
- package/dist/locales/sq.json +2 -1
- package/dist/locales/sv.json +2 -1
- package/dist/locales/tr.json +2 -1
- package/dist/locales/zh.json +2 -1
- package/dist/online-bookings-panel/index.js +1 -1
- package/dist/patterns/calendar/index.js +2 -2
- package/dist/save-outcome/index.js +20 -0
- package/dist/speech/aws-transcribe.d.ts +30 -6
- package/dist/tokens.css +1 -1
- package/dist/waiting-list-panel/index.js +2 -2
- package/package.json +5 -1
- package/dist/_chunks/notes-panel-BHMnLbEH.js +0 -1116
- package/dist/_chunks/rich-text-editor-BAcJq1PO.js +0 -4359
- package/dist/_chunks/task-editor-B9YpfwcW.js +0 -1095
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { B as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { S as
|
|
13
|
-
import { S as Vs } from "./
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
1
|
+
import { jsx as c, jsxs as w, Fragment as Te } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Is, useId as Dt, useMemo as z, useState as R, useCallback as Ie, useRef as m, useEffect as $, useImperativeHandle as Hs } from "react";
|
|
3
|
+
import { c as $s } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as qs } from "react-i18next";
|
|
5
|
+
import { isSaveOutcomeUnknownError as Bt } from "../save-outcome/index.js";
|
|
6
|
+
import { A as He } from "./alert-C4WKViaS.js";
|
|
7
|
+
import { B as Ws } from "./badge-BUk4RjTS.js";
|
|
8
|
+
import { B as Re } from "./button-Dp4j9ygh.js";
|
|
9
|
+
import { I as $e } from "./icon-button-u9VMQn3x.js";
|
|
10
|
+
import { B as Nt } from "./button-group-CHQD8GJ0.js";
|
|
11
|
+
import { P as Ks } from "./panel-header-CbtlTe85.js";
|
|
12
|
+
import { S as jt } from "./select-Bw5FvGJ7.js";
|
|
13
|
+
import { S as Vs } from "./switch-DO6uC4HJ.js";
|
|
14
|
+
import { S as Cs } from "./skeleton-tTWJpvAq.js";
|
|
15
|
+
import { E as qe } from "./empty-state-5REM7oDM.js";
|
|
16
|
+
import { T as Us } from "./task-card-BNbkwIYM.js";
|
|
16
17
|
import { V as Gs } from "./visually-hidden-BHxEUGyT.js";
|
|
17
|
-
import { u as
|
|
18
|
-
import { a as
|
|
19
|
-
import { u as
|
|
20
|
-
import { u as
|
|
21
|
-
import { u as
|
|
22
|
-
import { P as
|
|
23
|
-
import { C as
|
|
24
|
-
import { P as
|
|
25
|
-
import { X as
|
|
26
|
-
import { c as
|
|
27
|
-
import { M as
|
|
18
|
+
import { u as Ys } from "./use-check-animation--I3cS00X.js";
|
|
19
|
+
import { a as Fs, u as At, R as Lt } from "./use-list-reflow-C7O4Uqnl.js";
|
|
20
|
+
import { u as Qs } from "./use-resolved-theme-B0f1_oyq.js";
|
|
21
|
+
import { u as We } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
22
|
+
import { u as Xs } from "./registry-DvAUVLHh.js";
|
|
23
|
+
import { P as Js } from "./plus-DzMQ_c6b.js";
|
|
24
|
+
import { C as Zs } from "./clipboard-check-BeAGxDVT.js";
|
|
25
|
+
import { P as en } from "./pencil-B1sKKyuT.js";
|
|
26
|
+
import { X as tn } from "./x-B5YnXwCz.js";
|
|
27
|
+
import { c as Ve } from "./createLucideIcon-DhHxpK9K.js";
|
|
28
|
+
import { M as sn } from "./megaphone-CzeTT9B3.js";
|
|
28
29
|
/**
|
|
29
30
|
* @license lucide-react v1.22.0 - ISC
|
|
30
31
|
*
|
|
31
32
|
* This source code is licensed under the ISC license.
|
|
32
33
|
* See the LICENSE file in the root directory of this source tree.
|
|
33
34
|
*/
|
|
34
|
-
const
|
|
35
|
+
const nn = [
|
|
35
36
|
["path", { d: "M13.744 17.736a6 6 0 1 1-7.48-7.48", key: "bq4yh3" }],
|
|
36
37
|
["path", { d: "M15 6h1v4", key: "11y1tn" }],
|
|
37
38
|
["path", { d: "m6.134 14.768.866-.5 2 3.464", key: "17snzx" }],
|
|
38
39
|
["circle", { cx: "16", cy: "8", r: "6", key: "14bfc9" }]
|
|
39
|
-
],
|
|
40
|
+
], rn = Ve("coins", nn);
|
|
40
41
|
/**
|
|
41
42
|
* @license lucide-react v1.22.0 - ISC
|
|
42
43
|
*
|
|
43
44
|
* This source code is licensed under the ISC license.
|
|
44
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
45
46
|
*/
|
|
46
|
-
const
|
|
47
|
+
const on = [
|
|
47
48
|
["path", { d: "M10.5 3 8 9l4 13 4-13-2.5-6", key: "b3dvk1" }],
|
|
48
49
|
[
|
|
49
50
|
"path",
|
|
@@ -53,14 +54,14 @@ const rn = [
|
|
|
53
54
|
}
|
|
54
55
|
],
|
|
55
56
|
["path", { d: "M2 9h20", key: "16fsjt" }]
|
|
56
|
-
],
|
|
57
|
+
], an = Ve("gem", on);
|
|
57
58
|
/**
|
|
58
59
|
* @license lucide-react v1.22.0 - ISC
|
|
59
60
|
*
|
|
60
61
|
* This source code is licensed under the ISC license.
|
|
61
62
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
63
|
*/
|
|
63
|
-
const
|
|
64
|
+
const cn = [
|
|
64
65
|
[
|
|
65
66
|
"path",
|
|
66
67
|
{
|
|
@@ -69,7 +70,7 @@ const an = [
|
|
|
69
70
|
}
|
|
70
71
|
],
|
|
71
72
|
["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }]
|
|
72
|
-
],
|
|
73
|
+
], Mt = Ve("tag", cn), dn = {
|
|
73
74
|
id: "tasks-panel",
|
|
74
75
|
// 'pick' backs select_item (non-persisting activation, matching
|
|
75
76
|
// AppointmentTimeline); 'dismiss' backs dismiss; 'scroll' backs
|
|
@@ -209,39 +210,39 @@ const an = [
|
|
|
209
210
|
description: "Stable task id emitted on each rendered TaskCard inside the panel."
|
|
210
211
|
}
|
|
211
212
|
}
|
|
212
|
-
},
|
|
213
|
+
}, ln = 96, un = {
|
|
213
214
|
status: "todo",
|
|
214
215
|
type: null,
|
|
215
216
|
assignee: null,
|
|
216
217
|
overdueOnly: !1
|
|
217
|
-
},
|
|
218
|
-
function
|
|
218
|
+
}, _t = /* @__PURE__ */ new Map(), zt = /* @__PURE__ */ new Set();
|
|
219
|
+
function Ke(a) {
|
|
219
220
|
return a.map((o) => `${o.id}:${o.status ?? "open"}`).join("|");
|
|
220
221
|
}
|
|
221
|
-
function
|
|
222
|
+
function fn(a, o) {
|
|
222
223
|
return a.status === o.status && a.type === o.type && a.assignee === o.assignee && a.overdueOnly === o.overdueOnly;
|
|
223
224
|
}
|
|
224
|
-
function
|
|
225
|
+
function pn(a, o) {
|
|
225
226
|
return a.status === o.status && (a.type || null) === (o.type || null) && (a.assignee || null) === (o.assignee || null) && a.overdueOnly === o.overdueOnly;
|
|
226
227
|
}
|
|
227
|
-
function
|
|
228
|
+
function Ee(a) {
|
|
228
229
|
const o = Promise.reject(a);
|
|
229
230
|
return o.catch(() => {
|
|
230
231
|
}), o;
|
|
231
232
|
}
|
|
232
|
-
function
|
|
233
|
+
function mn(a) {
|
|
233
234
|
try {
|
|
234
235
|
return new Intl.NumberFormat(a);
|
|
235
236
|
} catch {
|
|
236
237
|
return new Intl.NumberFormat();
|
|
237
238
|
}
|
|
238
239
|
}
|
|
239
|
-
function
|
|
240
|
+
function vn(a) {
|
|
240
241
|
const o = Promise.resolve(a);
|
|
241
242
|
return o.catch(() => {
|
|
242
243
|
}), o;
|
|
243
244
|
}
|
|
244
|
-
const
|
|
245
|
+
const hn = $s(
|
|
245
246
|
[
|
|
246
247
|
"ds:flex ds:flex-col ds:h-full ds:min-h-0",
|
|
247
248
|
"ds:bg-[color:var(--card)] ds:text-[color:var(--card-foreground)]"
|
|
@@ -263,31 +264,39 @@ const vn = Hs(
|
|
|
263
264
|
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
264
265
|
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:[outline-offset:-2px]",
|
|
265
266
|
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
266
|
-
].join(" "),
|
|
267
|
+
].join(" "), kn = [
|
|
267
268
|
"ds:shadow-[var(--shadow-card)] ds:bg-[color:var(--card)]",
|
|
268
269
|
// Declared at rest, not only while leaving: a transition added at the
|
|
269
270
|
// same moment as the value it animates has nothing to move from.
|
|
270
271
|
"ds:transition-opacity ds:duration-[var(--animation-duration)]",
|
|
271
272
|
"ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none"
|
|
272
|
-
].join(" "),
|
|
273
|
-
function
|
|
273
|
+
].join(" "), It = "ds:opacity-0", yn = 12;
|
|
274
|
+
function bn({
|
|
274
275
|
item: a,
|
|
275
276
|
checked: o,
|
|
276
277
|
pending: g,
|
|
277
|
-
label:
|
|
278
|
-
reduceMotion:
|
|
279
|
-
|
|
278
|
+
label: k,
|
|
279
|
+
reduceMotion: y,
|
|
280
|
+
releaseKey: u,
|
|
281
|
+
onToggle: h
|
|
280
282
|
}) {
|
|
281
283
|
const {
|
|
282
|
-
checked:
|
|
283
|
-
drawing:
|
|
284
|
+
checked: v,
|
|
285
|
+
drawing: B,
|
|
284
286
|
toggle: E
|
|
285
|
-
} =
|
|
287
|
+
} = Ys({
|
|
286
288
|
checked: o,
|
|
287
|
-
reduceMotion:
|
|
288
|
-
}),
|
|
289
|
-
|
|
290
|
-
const
|
|
289
|
+
reduceMotion: y
|
|
290
|
+
}), q = m({ shown: v, checked: o, toggle: E });
|
|
291
|
+
q.current = { shown: v, checked: o, toggle: E };
|
|
292
|
+
const D = m(!1), Q = m(u);
|
|
293
|
+
$(() => {
|
|
294
|
+
if (Q.current === u || (Q.current = u, !D.current)) return;
|
|
295
|
+
D.current = !1;
|
|
296
|
+
const P = q.current;
|
|
297
|
+
P.shown !== P.checked && P.toggle();
|
|
298
|
+
}, [u]);
|
|
299
|
+
const N = v ? (
|
|
291
300
|
// `--accent` is magenta-700 in light, the step that clears AA there.
|
|
292
301
|
"ds:text-[color:var(--accent)]"
|
|
293
302
|
) : a.priority === "high" ? "ds:text-[color:var(--destructive)]" : "ds:text-[color:var(--muted-foreground)]";
|
|
@@ -296,17 +305,21 @@ function kn({
|
|
|
296
305
|
{
|
|
297
306
|
type: "button",
|
|
298
307
|
role: "checkbox",
|
|
299
|
-
"aria-checked":
|
|
300
|
-
"aria-label":
|
|
308
|
+
"aria-checked": v,
|
|
309
|
+
"aria-label": k,
|
|
301
310
|
"aria-disabled": g || void 0,
|
|
302
311
|
"data-action": "toggle-done",
|
|
303
|
-
"data-drawing":
|
|
312
|
+
"data-drawing": B ? "" : void 0,
|
|
304
313
|
onClick: () => {
|
|
305
314
|
if (g) return;
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
315
|
+
const P = !v, W = h(a, P);
|
|
316
|
+
W.started && (E(), W.result.catch((X) => {
|
|
317
|
+
if (Bt(X)) {
|
|
318
|
+
D.current = !0;
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
const J = q.current;
|
|
322
|
+
J.shown === P && J.checked !== P && J.toggle();
|
|
310
323
|
}));
|
|
311
324
|
},
|
|
312
325
|
className: [
|
|
@@ -317,9 +330,9 @@ function kn({
|
|
|
317
330
|
"ds:[min-block-size:var(--accessible-target-floor,auto)] ds:[min-inline-size:var(--accessible-target-floor,auto)]",
|
|
318
331
|
"ds:hover:bg-[color:var(--muted)]/40 ds:aria-disabled:cursor-progress",
|
|
319
332
|
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
320
|
-
|
|
333
|
+
N
|
|
321
334
|
].join(" "),
|
|
322
|
-
children: /* @__PURE__ */
|
|
335
|
+
children: /* @__PURE__ */ w(
|
|
323
336
|
"svg",
|
|
324
337
|
{
|
|
325
338
|
viewBox: "0 0 18 18",
|
|
@@ -341,7 +354,7 @@ function kn({
|
|
|
341
354
|
"path",
|
|
342
355
|
{
|
|
343
356
|
d: "M5 9.25 L7.75 12 L13 6.25",
|
|
344
|
-
strokeDashoffset:
|
|
357
|
+
strokeDashoffset: v ? 0 : yn,
|
|
345
358
|
className: "ds:fill-none ds:stroke-current ds:[stroke-width:2] ds:[stroke-linecap:round] ds:[stroke-linejoin:round] ds:[stroke-dasharray:12] ds:transition-[stroke-dashoffset] ds:duration-[var(--animation-duration)] ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none"
|
|
346
359
|
}
|
|
347
360
|
)
|
|
@@ -351,12 +364,12 @@ function kn({
|
|
|
351
364
|
}
|
|
352
365
|
);
|
|
353
366
|
}
|
|
354
|
-
const
|
|
355
|
-
recall: { variant: "info", Icon:
|
|
356
|
-
payment: { variant: "warning", Icon:
|
|
357
|
-
collection: { variant: "error", Icon:
|
|
358
|
-
other: { variant: "neutral", Icon:
|
|
359
|
-
},
|
|
367
|
+
const wn = {
|
|
368
|
+
recall: { variant: "info", Icon: sn },
|
|
369
|
+
payment: { variant: "warning", Icon: an },
|
|
370
|
+
collection: { variant: "error", Icon: rn },
|
|
371
|
+
other: { variant: "neutral", Icon: Mt }
|
|
372
|
+
}, Pn = [
|
|
360
373
|
"overdue",
|
|
361
374
|
"today",
|
|
362
375
|
"tomorrow",
|
|
@@ -364,328 +377,328 @@ const bn = {
|
|
|
364
377
|
"later",
|
|
365
378
|
"done"
|
|
366
379
|
];
|
|
367
|
-
function
|
|
380
|
+
function xn(a) {
|
|
368
381
|
return new Date(a.getFullYear(), a.getMonth(), a.getDate());
|
|
369
382
|
}
|
|
370
|
-
function
|
|
371
|
-
const o =
|
|
383
|
+
function Ht(a) {
|
|
384
|
+
const o = xn(a), g = new Date(o);
|
|
372
385
|
g.setDate(o.getDate() + 1);
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
const
|
|
376
|
-
return u.setDate(o.getDate() + (7 -
|
|
386
|
+
const k = new Date(o);
|
|
387
|
+
k.setDate(o.getDate() + 2);
|
|
388
|
+
const y = (o.getDay() + 6) % 7, u = new Date(o);
|
|
389
|
+
return u.setDate(o.getDate() + (7 - y)), {
|
|
377
390
|
startOfToday: +o,
|
|
378
391
|
startOfTomorrow: +g,
|
|
379
|
-
startOfDayAfter: +
|
|
392
|
+
startOfDayAfter: +k,
|
|
380
393
|
startOfNextWeek: +u
|
|
381
394
|
};
|
|
382
395
|
}
|
|
383
|
-
function
|
|
396
|
+
function Sn(a, o, g) {
|
|
384
397
|
if (o) return "done";
|
|
385
|
-
const { startOfToday:
|
|
386
|
-
return
|
|
398
|
+
const { startOfToday: k, startOfTomorrow: y, startOfDayAfter: u, startOfNextWeek: h } = Ht(g), v = +new Date(a.dueIso);
|
|
399
|
+
return v < k ? "overdue" : v < y ? "today" : v < u ? "tomorrow" : v < h ? "thisWeek" : "later";
|
|
387
400
|
}
|
|
388
|
-
function
|
|
389
|
-
return a.status === "done" ? !1 : +new Date(a.dueIso) <
|
|
401
|
+
function Tn(a, o) {
|
|
402
|
+
return a.status === "done" ? !1 : +new Date(a.dueIso) < Ht(o).startOfTomorrow;
|
|
390
403
|
}
|
|
391
|
-
function
|
|
392
|
-
const
|
|
404
|
+
function Rn(a, o, g) {
|
|
405
|
+
const k = /* @__PURE__ */ new Map();
|
|
393
406
|
for (const u of a) {
|
|
394
|
-
const
|
|
395
|
-
|
|
407
|
+
const h = Sn(u, g(u), o), v = k.get(h);
|
|
408
|
+
v ? v.push(u) : k.set(h, [u]);
|
|
396
409
|
}
|
|
397
|
-
const
|
|
398
|
-
for (const u of
|
|
399
|
-
const
|
|
400
|
-
!
|
|
410
|
+
const y = [];
|
|
411
|
+
for (const u of Pn) {
|
|
412
|
+
const h = k.get(u);
|
|
413
|
+
!h || h.length === 0 || (h.sort((v, B) => +new Date(v.dueIso) - +new Date(B.dueIso)), y.push({ key: u, items: h }));
|
|
401
414
|
}
|
|
402
|
-
return
|
|
415
|
+
return y;
|
|
403
416
|
}
|
|
404
|
-
const
|
|
417
|
+
const En = Is(
|
|
405
418
|
({
|
|
406
419
|
id: a,
|
|
407
420
|
items: o,
|
|
408
421
|
nowIso: g,
|
|
409
|
-
title:
|
|
410
|
-
icon:
|
|
422
|
+
title: k,
|
|
423
|
+
icon: y,
|
|
411
424
|
totalCount: u,
|
|
412
|
-
size:
|
|
413
|
-
filtering:
|
|
414
|
-
onOpenTask:
|
|
415
|
-
onToggleDone:
|
|
416
|
-
onEditTask:
|
|
417
|
-
onDismissTask:
|
|
418
|
-
onAddTask:
|
|
419
|
-
readOnly:
|
|
420
|
-
renderItemActions:
|
|
421
|
-
renderItemExtraActions:
|
|
422
|
-
scope:
|
|
423
|
-
defaultScope:
|
|
424
|
-
onScopeChange:
|
|
425
|
-
availableScopes:
|
|
426
|
-
onLoadMore:
|
|
427
|
-
hasMore:
|
|
428
|
-
loadingMore:
|
|
429
|
-
loading:
|
|
430
|
-
error:
|
|
431
|
-
onRetry:
|
|
432
|
-
showFilters:
|
|
433
|
-
defaultFilters:
|
|
434
|
-
onFiltersChange:
|
|
435
|
-
statusFilter:
|
|
436
|
-
defaultStatusFilter:
|
|
437
|
-
onStatusFilterChange:
|
|
438
|
-
typeOptions:
|
|
439
|
-
typeFilter:
|
|
440
|
-
onTypeFilterChange:
|
|
441
|
-
assigneeOptions:
|
|
442
|
-
assigneeFilter:
|
|
443
|
-
onAssigneeFilterChange:
|
|
444
|
-
overdueOnly:
|
|
445
|
-
defaultOverdueOnly:
|
|
446
|
-
onOverdueOnlyChange:
|
|
447
|
-
emptyTitle:
|
|
448
|
-
emptyDescription:
|
|
449
|
-
emptyAction:
|
|
450
|
-
className:
|
|
425
|
+
size: h = "sm",
|
|
426
|
+
filtering: v = "client",
|
|
427
|
+
onOpenTask: B,
|
|
428
|
+
onToggleDone: E,
|
|
429
|
+
onEditTask: q,
|
|
430
|
+
onDismissTask: D,
|
|
431
|
+
onAddTask: Q,
|
|
432
|
+
readOnly: N = !1,
|
|
433
|
+
renderItemActions: P,
|
|
434
|
+
renderItemExtraActions: W,
|
|
435
|
+
scope: X,
|
|
436
|
+
defaultScope: J,
|
|
437
|
+
onScopeChange: le,
|
|
438
|
+
availableScopes: L,
|
|
439
|
+
onLoadMore: K,
|
|
440
|
+
hasMore: Oe,
|
|
441
|
+
loadingMore: Z = !1,
|
|
442
|
+
loading: b = !1,
|
|
443
|
+
error: x = !1,
|
|
444
|
+
onRetry: ue,
|
|
445
|
+
showFilters: $t = !0,
|
|
446
|
+
defaultFilters: qt,
|
|
447
|
+
onFiltersChange: M,
|
|
448
|
+
statusFilter: Ce,
|
|
449
|
+
defaultStatusFilter: Wt,
|
|
450
|
+
onStatusFilterChange: fe,
|
|
451
|
+
typeOptions: pe,
|
|
452
|
+
typeFilter: De,
|
|
453
|
+
onTypeFilterChange: me,
|
|
454
|
+
assigneeOptions: ve,
|
|
455
|
+
assigneeFilter: Ne,
|
|
456
|
+
onAssigneeFilterChange: he,
|
|
457
|
+
overdueOnly: Ue,
|
|
458
|
+
defaultOverdueOnly: Kt,
|
|
459
|
+
onOverdueOnlyChange: ge,
|
|
460
|
+
emptyTitle: Vt,
|
|
461
|
+
emptyDescription: Ct,
|
|
462
|
+
emptyAction: Ut,
|
|
463
|
+
className: Gt,
|
|
451
464
|
"aria-label": Ge,
|
|
452
|
-
...
|
|
453
|
-
},
|
|
454
|
-
const { t: d, i18n:
|
|
455
|
-
status: !
|
|
456
|
-
type: !
|
|
457
|
-
assignee: !
|
|
458
|
-
overdueOnly: !
|
|
459
|
-
},
|
|
465
|
+
...Yt
|
|
466
|
+
}, Ft) => {
|
|
467
|
+
const { t: d, i18n: Ye } = qs("ui"), Fe = Dt(), Qt = Dt(), je = k ?? d("tasksPanel.title"), f = v === "server", V = {
|
|
468
|
+
status: !f || !!M || !!fe,
|
|
469
|
+
type: !f || !!M || !!me,
|
|
470
|
+
assignee: !f || !!M || !!he,
|
|
471
|
+
overdueOnly: !f || !!M || !!ge
|
|
472
|
+
}, Xt = {
|
|
460
473
|
todo: d("tasksPanel.status.todo"),
|
|
461
474
|
done: d("tasksPanel.status.done"),
|
|
462
475
|
all: d("tasksPanel.status.all")
|
|
463
|
-
},
|
|
476
|
+
}, Jt = {
|
|
464
477
|
patient: d("tasksPanel.scope.patient"),
|
|
465
478
|
mine: d("tasksPanel.scope.mine")
|
|
466
|
-
},
|
|
479
|
+
}, Zt = {
|
|
467
480
|
overdue: d("tasksPanel.buckets.overdue"),
|
|
468
481
|
today: d("tasksPanel.buckets.today"),
|
|
469
482
|
tomorrow: d("tasksPanel.buckets.tomorrow"),
|
|
470
483
|
thisWeek: d("tasksPanel.buckets.thisWeek"),
|
|
471
484
|
later: d("tasksPanel.buckets.later"),
|
|
472
485
|
done: d("tasksPanel.buckets.done")
|
|
473
|
-
},
|
|
486
|
+
}, es = {
|
|
474
487
|
recall: d("tasksPanel.types.recall"),
|
|
475
488
|
payment: d("tasksPanel.types.payment"),
|
|
476
489
|
collection: d("tasksPanel.types.collection"),
|
|
477
490
|
other: d("tasksPanel.types.other")
|
|
478
|
-
},
|
|
491
|
+
}, ke = z(
|
|
479
492
|
() => g ? new Date(g) : /* @__PURE__ */ new Date(),
|
|
480
493
|
[g]
|
|
481
|
-
),
|
|
482
|
-
() =>
|
|
483
|
-
[
|
|
484
|
-
),
|
|
485
|
-
|
|
486
|
-
),
|
|
494
|
+
), Qe = z(
|
|
495
|
+
() => mn(Ye.language),
|
|
496
|
+
[Ye.language]
|
|
497
|
+
), Xe = (e) => d("tasksPanel.bracketedCount", { value: Qe.format(e) }), [ts, ss] = R(
|
|
498
|
+
J ?? (L == null ? void 0 : L[0]) ?? "patient"
|
|
499
|
+
), ns = X ?? ts, Je = Ie(
|
|
487
500
|
(e) => {
|
|
488
|
-
|
|
501
|
+
X === void 0 && ss(e), le == null || le(e);
|
|
489
502
|
},
|
|
490
|
-
[
|
|
491
|
-
), j =
|
|
492
|
-
|
|
493
|
-
), [
|
|
503
|
+
[X, le]
|
|
504
|
+
), j = qt ?? un, [rs, os] = R(
|
|
505
|
+
Wt ?? j.status
|
|
506
|
+
), [as, is] = R(j.type), [cs, ds] = R(
|
|
494
507
|
j.assignee
|
|
495
|
-
), [
|
|
496
|
-
|
|
497
|
-
), O =
|
|
508
|
+
), [ls, us] = R(
|
|
509
|
+
Kt ?? j.overdueOnly
|
|
510
|
+
), O = Ce ?? rs, I = De !== void 0 ? De : as, H = Ne !== void 0 ? Ne : cs, C = Ue ?? ls, Ze = f ? C && O !== "done" : C, ye = m({
|
|
498
511
|
status: O,
|
|
499
|
-
type:
|
|
500
|
-
assignee:
|
|
501
|
-
overdueOnly:
|
|
512
|
+
type: I,
|
|
513
|
+
assignee: H,
|
|
514
|
+
overdueOnly: C
|
|
502
515
|
});
|
|
503
|
-
|
|
516
|
+
ye.current = {
|
|
504
517
|
status: O,
|
|
505
|
-
type:
|
|
506
|
-
assignee:
|
|
507
|
-
overdueOnly:
|
|
518
|
+
type: I,
|
|
519
|
+
assignee: H,
|
|
520
|
+
overdueOnly: C
|
|
508
521
|
};
|
|
509
|
-
const
|
|
522
|
+
const U = (e) => {
|
|
510
523
|
const t = Object.fromEntries(
|
|
511
524
|
Object.entries(e).filter(
|
|
512
|
-
([l]) =>
|
|
525
|
+
([l]) => V[l]
|
|
513
526
|
)
|
|
514
527
|
);
|
|
515
528
|
if (Object.keys(e).length > 0 && Object.keys(t).length === 0)
|
|
516
529
|
return;
|
|
517
|
-
const s =
|
|
518
|
-
r !== s && i.add("overdueOnly"),
|
|
519
|
-
},
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
const e =
|
|
530
|
+
const s = ye.current, r = f && s.status === "done" && s.overdueOnly ? { ...s, overdueOnly: !1 } : s, n = { ...r, ...t }, i = new Set(Object.keys(t));
|
|
531
|
+
r !== s && i.add("overdueOnly"), f && n.status === "done" && n.overdueOnly && (t.status !== void 0 ? (n.overdueOnly = !1, i.add("overdueOnly")) : (n.status = j.status === "done" ? "todo" : j.status, i.add("status"))), ye.current = n, Ce === void 0 && os(n.status), De === void 0 && is(n.type), Ne === void 0 && ds(n.assignee), Ue === void 0 && us(n.overdueOnly), i.has("status") && (fe == null || fe(n.status)), i.has("type") && (me == null || me(n.type)), i.has("assignee") && (he == null || he(n.assignee)), i.has("overdueOnly") && (ge == null || ge(n.overdueOnly)), fn(s, n) || M == null || M(n);
|
|
532
|
+
}, fs = () => U({ ...j }), [ee, ps] = R(_t), T = m(_t), [et, ms] = R(zt), te = m(zt), se = m(!0), Ae = m(/* @__PURE__ */ new Set());
|
|
533
|
+
$(() => {
|
|
534
|
+
se.current = !0;
|
|
535
|
+
const e = Ae.current;
|
|
523
536
|
return () => {
|
|
524
|
-
|
|
537
|
+
se.current = !1, e.forEach(
|
|
525
538
|
(t) => t(new Error("TasksPanel: closed before the host was told."))
|
|
526
539
|
), e.clear();
|
|
527
540
|
};
|
|
528
541
|
}, []);
|
|
529
542
|
const A = (e) => {
|
|
530
543
|
const t = new Map(T.current);
|
|
531
|
-
e(t), T.current = t,
|
|
532
|
-
},
|
|
533
|
-
const t = new Set(
|
|
534
|
-
e(t),
|
|
535
|
-
},
|
|
544
|
+
e(t), T.current = t, ps(t);
|
|
545
|
+
}, _e = (e) => {
|
|
546
|
+
const t = new Set(te.current);
|
|
547
|
+
e(t), te.current = t, ms(t);
|
|
548
|
+
}, G = z(() => f ? o.filter((e) => !et.has(e.id)) : o.filter((e) => {
|
|
536
549
|
const t = e.status === "done";
|
|
537
|
-
return !(O === "todo" && t || O === "done" && !t ||
|
|
550
|
+
return !(O === "todo" && t || O === "done" && !t || I && e.type !== I || H && (e.assignee ?? "") !== H || C && !Tn(e, ke));
|
|
538
551
|
}), [
|
|
539
|
-
|
|
540
|
-
|
|
552
|
+
f,
|
|
553
|
+
et,
|
|
541
554
|
o,
|
|
542
555
|
O,
|
|
543
|
-
M,
|
|
544
556
|
I,
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
557
|
+
H,
|
|
558
|
+
C,
|
|
559
|
+
ke
|
|
560
|
+
]), be = z(() => Rn(G, ke, (t) => {
|
|
561
|
+
if (f) {
|
|
562
|
+
const s = ee.get(t.id);
|
|
550
563
|
if ((s == null ? void 0 : s.kind) === "done" && s.next !== void 0 && !s.leaves)
|
|
551
564
|
return s.next;
|
|
552
565
|
}
|
|
553
566
|
return t.status === "done";
|
|
554
|
-
}), [
|
|
555
|
-
() =>
|
|
556
|
-
[
|
|
557
|
-
),
|
|
558
|
-
const e =
|
|
567
|
+
}), [G, ke, f, ee]), ze = z(
|
|
568
|
+
() => be.flatMap((e) => e.items.map((t) => t.id)),
|
|
569
|
+
[be]
|
|
570
|
+
), ne = m(null), tt = m(null), [vs, hs] = R(!1), [gs, ks] = R(!1), re = Ie(() => {
|
|
571
|
+
const e = ne.current;
|
|
559
572
|
if (!e) return;
|
|
560
573
|
const { scrollTop: t, scrollHeight: s, clientHeight: r } = e;
|
|
561
|
-
|
|
574
|
+
hs(t > 1), ks(t + r < s - 1);
|
|
562
575
|
}, []);
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
}, [
|
|
566
|
-
const e =
|
|
576
|
+
We(() => {
|
|
577
|
+
re();
|
|
578
|
+
}, [be, re]), We(() => {
|
|
579
|
+
const e = ne.current;
|
|
567
580
|
if (!e || typeof ResizeObserver > "u") return;
|
|
568
|
-
const t = new ResizeObserver(
|
|
581
|
+
const t = new ResizeObserver(re);
|
|
569
582
|
return t.observe(e), () => t.disconnect();
|
|
570
|
-
}, [
|
|
571
|
-
const
|
|
583
|
+
}, [re]);
|
|
584
|
+
const st = f ? Oe === !0 : Oe ?? !!K, _ = m(o);
|
|
572
585
|
_.current = o;
|
|
573
|
-
const
|
|
586
|
+
const nt = z(() => Ke(o), [o]), we = z(
|
|
574
587
|
() => o.map((e) => e.id).join("|"),
|
|
575
588
|
[o]
|
|
576
|
-
),
|
|
577
|
-
|
|
578
|
-
const
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
}, [
|
|
582
|
-
const
|
|
583
|
-
|
|
589
|
+
), rt = m(we);
|
|
590
|
+
rt.current = we;
|
|
591
|
+
const oe = m(0), ot = m(b);
|
|
592
|
+
$(() => {
|
|
593
|
+
ot.current && !b && !x && (oe.current += 1), ot.current = b;
|
|
594
|
+
}, [b, x]);
|
|
595
|
+
const Pe = m(!0), at = m(""), it = m(0), Be = () => {
|
|
596
|
+
Pe.current = !1, at.current = rt.current, it.current = oe.current, K == null || K();
|
|
584
597
|
};
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
}, [
|
|
588
|
-
const
|
|
589
|
-
|
|
590
|
-
const e =
|
|
598
|
+
$(() => {
|
|
599
|
+
Pe.current || (we !== at.current || oe.current > it.current) && (Pe.current = !0);
|
|
600
|
+
}, [we, b, x]);
|
|
601
|
+
const ys = () => {
|
|
602
|
+
re();
|
|
603
|
+
const e = ne.current;
|
|
591
604
|
if (!e) return;
|
|
592
605
|
const { scrollTop: t, scrollHeight: s, clientHeight: r } = e;
|
|
593
|
-
|
|
594
|
-
},
|
|
595
|
-
key:
|
|
596
|
-
reduceMotion:
|
|
597
|
-
}),
|
|
598
|
-
const { status: t, overdueOnly: s } =
|
|
599
|
-
return t === "todo" && e || t === "done" && !e || (
|
|
600
|
-
},
|
|
601
|
-
T.current.has(e) && A((t) => t.delete(e)),
|
|
602
|
-
},
|
|
603
|
-
const e = _.current, t =
|
|
606
|
+
K && st && !b && !Z && Pe.current && s - t - r <= ln && Be();
|
|
607
|
+
}, ae = m(null), { isAccessible: bs } = Qs(ae), xe = bs || void 0, { containerRef: ws } = Fs({
|
|
608
|
+
key: ze.join(),
|
|
609
|
+
reduceMotion: xe
|
|
610
|
+
}), ie = At({ delayMs: 200, reduceMotion: xe }), ce = At({ reduceMotion: xe }), Le = (e) => ie.isLeaving(e) || ce.isLeaving(e), Ps = (e) => {
|
|
611
|
+
const { status: t, overdueOnly: s } = ye.current;
|
|
612
|
+
return t === "todo" && e || t === "done" && !e || (f ? s && t !== "done" : s) && e;
|
|
613
|
+
}, ct = (e) => {
|
|
614
|
+
T.current.has(e) && A((t) => t.delete(e)), te.current.has(e) && _e((t) => t.delete(e)), ie.cancel(e), ce.cancel(e);
|
|
615
|
+
}, dt = () => {
|
|
616
|
+
const e = _.current, t = Ke(e), s = new Map(e.map((i) => [i.id, i])), r = [], n = [];
|
|
604
617
|
T.current.forEach((i, l) => {
|
|
605
|
-
const
|
|
606
|
-
if (!
|
|
618
|
+
const p = s.get(l);
|
|
619
|
+
if (!p) {
|
|
607
620
|
r.push(l);
|
|
608
621
|
return;
|
|
609
622
|
}
|
|
610
623
|
if (!i.settled) return;
|
|
611
|
-
const
|
|
612
|
-
(
|
|
613
|
-
}), r.length !== 0 && (A((i) => r.forEach((l) => i.delete(l))), r.some((i) =>
|
|
614
|
-
|
|
624
|
+
const Ls = i.kind === "done" && p.status === "done" === i.next, Ms = oe.current > i.edgeAtSettle || t !== i.sigAtSettle;
|
|
625
|
+
(Ls || Ms) && (r.push(l), n.push(l));
|
|
626
|
+
}), r.length !== 0 && (A((i) => r.forEach((l) => i.delete(l))), r.some((i) => te.current.has(i)) && _e((i) => r.forEach((l) => i.delete(l))), n.forEach((i) => {
|
|
627
|
+
ie.cancel(i), ce.cancel(i);
|
|
615
628
|
}));
|
|
616
|
-
},
|
|
629
|
+
}, lt = (e) => {
|
|
617
630
|
const t = T.current.get(e);
|
|
618
631
|
t && (A(
|
|
619
632
|
(s) => s.set(e, {
|
|
620
633
|
...t,
|
|
621
634
|
settled: !0,
|
|
622
|
-
edgeAtSettle:
|
|
623
|
-
sigAtSettle:
|
|
635
|
+
edgeAtSettle: oe.current,
|
|
636
|
+
sigAtSettle: Ke(_.current)
|
|
624
637
|
})
|
|
625
|
-
),
|
|
638
|
+
), dt());
|
|
626
639
|
};
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
}, [
|
|
630
|
-
const
|
|
640
|
+
$(() => {
|
|
641
|
+
f && dt();
|
|
642
|
+
}, [f, nt, b, x]);
|
|
643
|
+
const ut = (e, t, s, r) => {
|
|
631
644
|
const n = e.id;
|
|
632
|
-
A((
|
|
645
|
+
A((p) => p.set(n, t));
|
|
633
646
|
let i;
|
|
634
647
|
try {
|
|
635
648
|
i = s();
|
|
636
|
-
} catch (
|
|
637
|
-
return
|
|
649
|
+
} catch (p) {
|
|
650
|
+
return ct(n), { started: !1, result: Ee(p) };
|
|
638
651
|
}
|
|
639
652
|
t.leaves && r.leave(n, () => {
|
|
640
|
-
T.current.has(n) &&
|
|
653
|
+
T.current.has(n) && _e((p) => p.add(n));
|
|
641
654
|
});
|
|
642
655
|
const l = Promise.resolve(i);
|
|
643
656
|
return l.then(
|
|
644
657
|
() => {
|
|
645
|
-
|
|
658
|
+
se.current && lt(n);
|
|
646
659
|
},
|
|
647
|
-
() => {
|
|
648
|
-
|
|
660
|
+
(p) => {
|
|
661
|
+
se.current && (Bt(p) && t.kind === "done" && !t.leaves ? lt(n) : ct(n));
|
|
649
662
|
}
|
|
650
663
|
), { started: !0, result: l };
|
|
651
|
-
},
|
|
664
|
+
}, Y = (e) => ({
|
|
652
665
|
started: !1,
|
|
653
|
-
result:
|
|
654
|
-
}),
|
|
655
|
-
|
|
656
|
-
},
|
|
666
|
+
result: Ee(new Error(`TasksPanel: ${e}`))
|
|
667
|
+
}), de = (e) => {
|
|
668
|
+
se.current && T.current.has(e) && A((t) => t.delete(e));
|
|
669
|
+
}, ft = (e, t, s) => {
|
|
657
670
|
let r, n;
|
|
658
|
-
const i = new Promise((l,
|
|
659
|
-
r = l, n =
|
|
671
|
+
const i = new Promise((l, p) => {
|
|
672
|
+
r = l, n = p;
|
|
660
673
|
});
|
|
661
674
|
return i.catch(() => {
|
|
662
|
-
}),
|
|
663
|
-
|
|
675
|
+
}), Ae.current.add(n), t.leave(e, () => {
|
|
676
|
+
Ae.current.delete(n);
|
|
664
677
|
let l;
|
|
665
678
|
try {
|
|
666
679
|
l = s();
|
|
667
|
-
} catch (
|
|
668
|
-
|
|
680
|
+
} catch (p) {
|
|
681
|
+
de(e), n(p);
|
|
669
682
|
return;
|
|
670
683
|
}
|
|
671
684
|
Promise.resolve(l).then(
|
|
672
685
|
() => {
|
|
673
|
-
|
|
686
|
+
de(e), r();
|
|
674
687
|
},
|
|
675
|
-
(
|
|
676
|
-
|
|
688
|
+
(p) => {
|
|
689
|
+
de(e), n(p);
|
|
677
690
|
}
|
|
678
691
|
);
|
|
679
692
|
}), i;
|
|
680
|
-
},
|
|
681
|
-
if (
|
|
682
|
-
if (!
|
|
693
|
+
}, pt = (e, t) => {
|
|
694
|
+
if (N) return Y("the panel is read-only.");
|
|
695
|
+
if (!E) return Y("the host gave no onToggleDone.");
|
|
683
696
|
const s = e.id;
|
|
684
697
|
if (T.current.has(s))
|
|
685
|
-
return
|
|
686
|
-
const r = t ?? e.status !== "done", n =
|
|
687
|
-
if (
|
|
688
|
-
return
|
|
698
|
+
return Y("a change to this task is already pending.");
|
|
699
|
+
const r = t ?? e.status !== "done", n = Ps(r);
|
|
700
|
+
if (f)
|
|
701
|
+
return ut(
|
|
689
702
|
e,
|
|
690
703
|
{
|
|
691
704
|
kind: "done",
|
|
@@ -695,15 +708,15 @@ const Rn = Ms(
|
|
|
695
708
|
edgeAtSettle: 0,
|
|
696
709
|
sigAtSettle: ""
|
|
697
710
|
},
|
|
698
|
-
() =>
|
|
699
|
-
|
|
711
|
+
() => E(e, r),
|
|
712
|
+
ie
|
|
700
713
|
);
|
|
701
714
|
if (!n) {
|
|
702
715
|
let i;
|
|
703
716
|
try {
|
|
704
|
-
i =
|
|
717
|
+
i = E(e, r);
|
|
705
718
|
} catch (l) {
|
|
706
|
-
return { started: !1, result:
|
|
719
|
+
return { started: !1, result: Ee(l) };
|
|
707
720
|
}
|
|
708
721
|
return i instanceof Promise && (A(
|
|
709
722
|
(l) => l.set(s, {
|
|
@@ -714,9 +727,9 @@ const Rn = Ms(
|
|
|
714
727
|
sigAtSettle: ""
|
|
715
728
|
})
|
|
716
729
|
), i.then(
|
|
717
|
-
() =>
|
|
718
|
-
() =>
|
|
719
|
-
)), { started: !0, result:
|
|
730
|
+
() => de(s),
|
|
731
|
+
() => de(s)
|
|
732
|
+
)), { started: !0, result: vn(i) };
|
|
720
733
|
}
|
|
721
734
|
return A(
|
|
722
735
|
(i) => i.set(s, {
|
|
@@ -729,14 +742,14 @@ const Rn = Ms(
|
|
|
729
742
|
})
|
|
730
743
|
), {
|
|
731
744
|
started: !0,
|
|
732
|
-
result:
|
|
745
|
+
result: ft(s, ie, () => E(e, r))
|
|
733
746
|
};
|
|
734
|
-
},
|
|
735
|
-
if (
|
|
736
|
-
if (!
|
|
747
|
+
}, mt = (e) => {
|
|
748
|
+
if (N) return Y("the panel is read-only.");
|
|
749
|
+
if (!D) return Y("the host gave no onDismissTask.");
|
|
737
750
|
const t = e.id;
|
|
738
751
|
if (T.current.has(t))
|
|
739
|
-
return
|
|
752
|
+
return Y("a change to this task is already pending.");
|
|
740
753
|
const s = {
|
|
741
754
|
kind: "dismiss",
|
|
742
755
|
leaves: !0,
|
|
@@ -744,17 +757,17 @@ const Rn = Ms(
|
|
|
744
757
|
edgeAtSettle: 0,
|
|
745
758
|
sigAtSettle: ""
|
|
746
759
|
};
|
|
747
|
-
return
|
|
760
|
+
return f ? ut(
|
|
748
761
|
e,
|
|
749
762
|
s,
|
|
750
|
-
() =>
|
|
751
|
-
|
|
763
|
+
() => D(e),
|
|
764
|
+
ce
|
|
752
765
|
) : (A((r) => r.set(t, s)), {
|
|
753
766
|
started: !0,
|
|
754
|
-
result:
|
|
767
|
+
result: ft(t, ce, () => D(e))
|
|
755
768
|
});
|
|
756
|
-
},
|
|
757
|
-
const e =
|
|
769
|
+
}, vt = Ie(() => {
|
|
770
|
+
const e = ne.current, t = tt.current;
|
|
758
771
|
if (!e || !t) {
|
|
759
772
|
e == null || e.scrollTo({ top: 0 });
|
|
760
773
|
return;
|
|
@@ -762,68 +775,68 @@ const Rn = Ms(
|
|
|
762
775
|
const s = t.getBoundingClientRect().top - e.getBoundingClientRect().top;
|
|
763
776
|
e.scrollTo({ top: e.scrollTop + s });
|
|
764
777
|
}, []);
|
|
765
|
-
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
const e =
|
|
778
|
+
Hs(Ft, () => ae.current, []);
|
|
779
|
+
const F = m(null), Se = m(ze);
|
|
780
|
+
Se.current = ze, $(() => {
|
|
781
|
+
const e = ae.current;
|
|
769
782
|
if (!e) return;
|
|
770
783
|
const t = (r) => {
|
|
771
|
-
var l,
|
|
784
|
+
var l, p;
|
|
772
785
|
const n = r.target;
|
|
773
786
|
if (!(n instanceof HTMLElement)) return;
|
|
774
787
|
const i = ((l = n.closest("[data-task-id]")) == null ? void 0 : l.dataset.taskId) ?? null;
|
|
775
|
-
|
|
788
|
+
F.current = {
|
|
776
789
|
el: n,
|
|
777
790
|
rowId: i,
|
|
778
|
-
action: ((
|
|
779
|
-
index: i ?
|
|
791
|
+
action: ((p = n.closest("[data-action]")) == null ? void 0 : p.dataset.action) ?? null,
|
|
792
|
+
index: i ? Se.current.indexOf(i) : -1
|
|
780
793
|
};
|
|
781
794
|
}, s = (r) => {
|
|
782
795
|
const n = r.relatedTarget;
|
|
783
796
|
if (n instanceof Node) {
|
|
784
|
-
e.contains(n) || (
|
|
797
|
+
e.contains(n) || (F.current = null);
|
|
785
798
|
return;
|
|
786
799
|
}
|
|
787
800
|
const i = r.target;
|
|
788
801
|
queueMicrotask(() => {
|
|
789
|
-
const l =
|
|
790
|
-
l && l.el === i && l.el.isConnected && document.activeElement !== l.el && (
|
|
802
|
+
const l = F.current;
|
|
803
|
+
l && l.el === i && l.el.isConnected && document.activeElement !== l.el && (F.current = null);
|
|
791
804
|
});
|
|
792
805
|
};
|
|
793
806
|
return e.addEventListener("focusin", t), e.addEventListener("focusout", s), () => {
|
|
794
807
|
e.removeEventListener("focusin", t), e.removeEventListener("focusout", s);
|
|
795
808
|
};
|
|
796
|
-
}, []),
|
|
797
|
-
const e =
|
|
809
|
+
}, []), We(() => {
|
|
810
|
+
const e = F.current, t = ae.current;
|
|
798
811
|
if (!e || !t) return;
|
|
799
812
|
if (e.el.isConnected) {
|
|
800
|
-
e.rowId && (e.index =
|
|
813
|
+
e.rowId && (e.index = Se.current.indexOf(e.rowId));
|
|
801
814
|
return;
|
|
802
815
|
}
|
|
803
|
-
|
|
816
|
+
F.current = null;
|
|
804
817
|
const s = document.activeElement;
|
|
805
818
|
if (s && s !== document.body) return;
|
|
806
|
-
const r =
|
|
807
|
-
`[data-task-id="${CSS.escape(
|
|
819
|
+
const r = Se.current, n = (p) => p && e.action ? t.querySelector(
|
|
820
|
+
`[data-task-id="${CSS.escape(p)}"] [data-action="${CSS.escape(e.action)}"]`
|
|
808
821
|
) : null, l = (e.rowId ? n(e.rowId) : null) ?? (e.rowId && e.index >= 0 ? n(r[e.index]) ?? n(r[e.index - 1]) : null) ?? t.querySelector("[data-tasks-panel-region]") ?? t.querySelector(
|
|
809
822
|
'[data-status-filter][aria-pressed="true"]'
|
|
810
823
|
);
|
|
811
824
|
l == null || l.focus();
|
|
812
825
|
});
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
toggleDone: (e) =>
|
|
816
|
-
dismiss: (e) =>
|
|
817
|
-
onOpenTask:
|
|
818
|
-
loadMore:
|
|
819
|
-
changeScope:
|
|
820
|
-
commitFilters:
|
|
821
|
-
serverMode:
|
|
826
|
+
const ht = m(null);
|
|
827
|
+
ht.current = {
|
|
828
|
+
toggleDone: (e) => pt(e),
|
|
829
|
+
dismiss: (e) => mt(e),
|
|
830
|
+
onOpenTask: B,
|
|
831
|
+
loadMore: Be,
|
|
832
|
+
changeScope: Je,
|
|
833
|
+
commitFilters: U,
|
|
834
|
+
serverMode: f
|
|
822
835
|
};
|
|
823
|
-
const
|
|
824
|
-
const e = () =>
|
|
836
|
+
const xs = z(() => {
|
|
837
|
+
const e = () => ht.current, t = (s) => Ee(new Error(`TasksPanel: no task "${s}".`));
|
|
825
838
|
return {
|
|
826
|
-
getItems: () => e().serverMode ? _.current.filter((s) => !
|
|
839
|
+
getItems: () => e().serverMode ? _.current.filter((s) => !te.current.has(s.id)).map((s) => {
|
|
827
840
|
const r = T.current.get(s.id), n = (r == null ? void 0 : r.kind) === "done" && r.next !== void 0 ? r.next ? "done" : "open" : s.status ?? "open";
|
|
828
841
|
return { id: s.id, status: n };
|
|
829
842
|
}) : _.current.map((s) => ({
|
|
@@ -843,7 +856,7 @@ const Rn = Ms(
|
|
|
843
856
|
const r = _.current.find((n) => n.id === s);
|
|
844
857
|
return r ? e().dismiss(r).result : t(s);
|
|
845
858
|
},
|
|
846
|
-
jumpToOverdue:
|
|
859
|
+
jumpToOverdue: vt,
|
|
847
860
|
setFilter: (s) => {
|
|
848
861
|
const r = {};
|
|
849
862
|
s.status !== void 0 && (r.status = s.status), s.type !== void 0 && (r.type = s.type), s.assignee !== void 0 && (r.assignee = s.assignee), s.overdueOnly !== void 0 && (r.overdueOnly = s.overdueOnly), e().commitFilters(r);
|
|
@@ -851,13 +864,13 @@ const Rn = Ms(
|
|
|
851
864
|
changeScope: (s) => e().changeScope(s),
|
|
852
865
|
loadMore: () => e().loadMore()
|
|
853
866
|
};
|
|
854
|
-
}, [
|
|
855
|
-
|
|
856
|
-
const
|
|
867
|
+
}, [vt]);
|
|
868
|
+
Xs(dn, xs, a);
|
|
869
|
+
const Ss = (e) => {
|
|
857
870
|
if (!e.type) return null;
|
|
858
|
-
const t =
|
|
871
|
+
const t = wn[e.type], s = (t == null ? void 0 : t.variant) ?? "neutral", r = (t == null ? void 0 : t.Icon) ?? Mt, n = e.typeLabel || es[e.type] || d("tasksPanel.types.other");
|
|
859
872
|
return /* @__PURE__ */ c(
|
|
860
|
-
|
|
873
|
+
Ws,
|
|
861
874
|
{
|
|
862
875
|
variant: s,
|
|
863
876
|
size: "sm",
|
|
@@ -865,141 +878,142 @@ const Rn = Ms(
|
|
|
865
878
|
children: n
|
|
866
879
|
}
|
|
867
880
|
);
|
|
868
|
-
},
|
|
869
|
-
|
|
870
|
-
|
|
881
|
+
}, Ts = (e) => N ? null : /* @__PURE__ */ w(Te, { children: [
|
|
882
|
+
q ? /* @__PURE__ */ c(
|
|
883
|
+
$e,
|
|
871
884
|
{
|
|
872
|
-
icon: /* @__PURE__ */ c(
|
|
885
|
+
icon: /* @__PURE__ */ c(en, {}),
|
|
873
886
|
intent: "ghost",
|
|
874
887
|
size: "sm",
|
|
875
888
|
"aria-label": d("tasksPanel.edit"),
|
|
876
889
|
"data-action": "edit-task",
|
|
877
|
-
onClick: () =>
|
|
890
|
+
onClick: () => q(e)
|
|
878
891
|
}
|
|
879
892
|
) : null,
|
|
880
|
-
|
|
881
|
-
|
|
893
|
+
D ? /* @__PURE__ */ c(
|
|
894
|
+
$e,
|
|
882
895
|
{
|
|
883
|
-
icon: /* @__PURE__ */ c(
|
|
896
|
+
icon: /* @__PURE__ */ c(tn, {}),
|
|
884
897
|
intent: "ghost",
|
|
885
898
|
size: "sm",
|
|
886
899
|
"aria-label": d("tasksPanel.dismiss"),
|
|
887
900
|
"data-action": "dismiss-task",
|
|
888
901
|
onClick: () => {
|
|
889
|
-
|
|
902
|
+
mt(e);
|
|
890
903
|
}
|
|
891
904
|
}
|
|
892
905
|
) : null
|
|
893
|
-
] }),
|
|
894
|
-
const t = (
|
|
906
|
+
] }), Rs = (e) => {
|
|
907
|
+
const t = (W == null ? void 0 : W(e)) ?? null, r = (N ? null : P == null ? void 0 : P(e)) ?? Ts(e), n = Ss(e);
|
|
895
908
|
if (!(!n && !t && !r))
|
|
896
|
-
return /* @__PURE__ */
|
|
909
|
+
return /* @__PURE__ */ w(Te, { children: [
|
|
897
910
|
n,
|
|
898
911
|
t,
|
|
899
912
|
r
|
|
900
913
|
] });
|
|
901
|
-
},
|
|
914
|
+
}, Es = (e, t) => pt(e, t), gt = (e) => /* @__PURE__ */ c(
|
|
902
915
|
"div",
|
|
903
916
|
{
|
|
904
917
|
"aria-hidden": "true",
|
|
905
918
|
className: "ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]",
|
|
906
|
-
children: /* @__PURE__ */ c(
|
|
919
|
+
children: /* @__PURE__ */ c(Cs, { variant: "rectangular", height: "3.5rem" })
|
|
907
920
|
},
|
|
908
921
|
e
|
|
909
|
-
),
|
|
910
|
-
|
|
922
|
+
), kt = /* @__PURE__ */ c("div", { className: "ds:flex-1 ds:min-h-0 ds:p-[var(--spacing-md)]", children: typeof x == "boolean" ? /* @__PURE__ */ c(
|
|
923
|
+
qe,
|
|
911
924
|
{
|
|
912
925
|
variant: "error",
|
|
913
926
|
size: "sm",
|
|
914
927
|
title: d("tasksPanel.error.title"),
|
|
915
928
|
description: d("tasksPanel.error.description"),
|
|
916
|
-
primaryAction:
|
|
929
|
+
primaryAction: ue ? { label: d("emptyState.error.cta"), onClick: ue } : void 0
|
|
917
930
|
}
|
|
918
|
-
) :
|
|
919
|
-
|
|
931
|
+
) : x }), Me = /* @__PURE__ */ c("div", { className: "ds:flex-1 ds:min-h-0 ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [0, 1, 2, 3].map((e) => gt(`skeleton-${e}`)) }), yt = /* @__PURE__ */ c("div", { className: "ds:flex-1 ds:min-h-0 ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ c(
|
|
932
|
+
qe,
|
|
920
933
|
{
|
|
921
934
|
variant: "first-use",
|
|
922
935
|
size: "sm",
|
|
923
|
-
title:
|
|
924
|
-
description:
|
|
925
|
-
primaryAction:
|
|
936
|
+
title: Vt ?? d("tasksPanel.empty.title"),
|
|
937
|
+
description: Ct ?? d("tasksPanel.empty.description"),
|
|
938
|
+
primaryAction: Ut
|
|
926
939
|
}
|
|
927
|
-
) }),
|
|
928
|
-
|
|
940
|
+
) }), Os = Object.values(V).some(Boolean), bt = /* @__PURE__ */ c("div", { className: "ds:flex-1 ds:min-h-0 ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ c(
|
|
941
|
+
qe,
|
|
929
942
|
{
|
|
930
943
|
variant: "no-results",
|
|
931
944
|
size: "sm",
|
|
932
945
|
title: d("tasksPanel.filteredEmpty.title"),
|
|
933
946
|
description: d("tasksPanel.filteredEmpty.description"),
|
|
934
|
-
primaryAction:
|
|
947
|
+
primaryAction: Os ? {
|
|
935
948
|
label: d("tasksPanel.filteredEmpty.clear"),
|
|
936
|
-
onClick:
|
|
949
|
+
onClick: fs
|
|
937
950
|
} : void 0
|
|
938
951
|
}
|
|
939
|
-
) }),
|
|
940
|
-
/* @__PURE__ */ c(
|
|
941
|
-
|
|
942
|
-
] }) :
|
|
943
|
-
|
|
944
|
-
/* @__PURE__ */
|
|
952
|
+
) }), Ds = f && x ? /* @__PURE__ */ c("div", { className: "ds:shrink-0 ds:px-[var(--spacing-md)] ds:pt-[var(--spacing-xs)]", children: typeof x == "boolean" ? /* @__PURE__ */ w(He, { variant: "error", children: [
|
|
953
|
+
/* @__PURE__ */ c(He.Title, { as: "p", children: d("tasksPanel.error.title") }),
|
|
954
|
+
ue ? /* @__PURE__ */ c(He.Action, { children: /* @__PURE__ */ c(Re, { intent: "outline", size: "sm", onClick: ue, children: d("emptyState.error.cta") }) }) : null
|
|
955
|
+
] }) : x }) : null, wt = /* @__PURE__ */ w(Te, { children: [
|
|
956
|
+
Ds,
|
|
957
|
+
/* @__PURE__ */ w(
|
|
945
958
|
"div",
|
|
946
959
|
{
|
|
947
960
|
ref: (e) => {
|
|
948
|
-
|
|
961
|
+
ne.current = e, ws.current = e;
|
|
949
962
|
},
|
|
950
963
|
tabIndex: 0,
|
|
951
|
-
onScroll:
|
|
964
|
+
onScroll: ys,
|
|
952
965
|
"data-tasks-panel-region": "",
|
|
953
|
-
"data-fade-top":
|
|
954
|
-
"data-fade-bottom":
|
|
966
|
+
"data-fade-top": vs ? "true" : void 0,
|
|
967
|
+
"data-fade-bottom": gs ? "true" : void 0,
|
|
955
968
|
className: gn,
|
|
956
969
|
children: [
|
|
957
970
|
/* @__PURE__ */ c(
|
|
958
971
|
"ol",
|
|
959
972
|
{
|
|
960
|
-
"aria-busy":
|
|
973
|
+
"aria-busy": b || void 0,
|
|
961
974
|
className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-md)] ds:p-0",
|
|
962
|
-
children:
|
|
975
|
+
children: be.map((e) => /* @__PURE__ */ w(
|
|
963
976
|
"li",
|
|
964
977
|
{
|
|
965
978
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
966
979
|
children: [
|
|
967
980
|
/* @__PURE__ */ c(
|
|
968
|
-
|
|
981
|
+
On,
|
|
969
982
|
{
|
|
970
983
|
bucketKey: e.key,
|
|
971
|
-
countLabel:
|
|
972
|
-
showCount: !(
|
|
973
|
-
label:
|
|
974
|
-
headerRef: e.key === "overdue" ?
|
|
984
|
+
countLabel: Xe(e.items.length),
|
|
985
|
+
showCount: !(f && Oe === !0),
|
|
986
|
+
label: Zt[e.key],
|
|
987
|
+
headerRef: e.key === "overdue" ? tt : void 0,
|
|
975
988
|
reflowId: `bucket-${e.key}`,
|
|
976
|
-
leaving: e.items.every((t) =>
|
|
989
|
+
leaving: e.items.every((t) => Le(t.id))
|
|
977
990
|
}
|
|
978
991
|
),
|
|
979
992
|
/* @__PURE__ */ c("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: e.items.map((t) => {
|
|
980
993
|
var s;
|
|
981
994
|
return /* @__PURE__ */ c(
|
|
982
|
-
|
|
995
|
+
Us,
|
|
983
996
|
{
|
|
984
997
|
item: t,
|
|
985
|
-
size:
|
|
986
|
-
onActivate:
|
|
987
|
-
actions:
|
|
988
|
-
leading:
|
|
989
|
-
|
|
998
|
+
size: h,
|
|
999
|
+
onActivate: B ? () => B(t) : void 0,
|
|
1000
|
+
actions: Rs(t),
|
|
1001
|
+
leading: E && !N ? /* @__PURE__ */ c(
|
|
1002
|
+
bn,
|
|
990
1003
|
{
|
|
991
1004
|
item: t,
|
|
992
|
-
checked: ((s =
|
|
993
|
-
pending:
|
|
1005
|
+
checked: ((s = ee.get(t.id)) == null ? void 0 : s.next) ?? t.status === "done",
|
|
1006
|
+
pending: ee.has(t.id),
|
|
994
1007
|
label: d("tasksPanel.doneItem", {
|
|
995
1008
|
title: t.title
|
|
996
1009
|
}),
|
|
997
|
-
reduceMotion:
|
|
998
|
-
|
|
1010
|
+
reduceMotion: xe,
|
|
1011
|
+
releaseKey: `${nt}|${b ? 1 : 0}`,
|
|
1012
|
+
onToggle: Es
|
|
999
1013
|
}
|
|
1000
1014
|
) : void 0,
|
|
1001
|
-
className: `${
|
|
1002
|
-
"data-leaving":
|
|
1015
|
+
className: `${kn} ${Lt}${Le(t.id) ? ` ${It}` : ""}`,
|
|
1016
|
+
"data-leaving": Le(t.id) ? "" : void 0,
|
|
1003
1017
|
"data-reflow-id": t.id,
|
|
1004
1018
|
"data-task-id": t.id
|
|
1005
1019
|
},
|
|
@@ -1012,16 +1026,16 @@ const Rn = Ms(
|
|
|
1012
1026
|
))
|
|
1013
1027
|
}
|
|
1014
1028
|
),
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1029
|
+
Z ? gt("loading-more") : null,
|
|
1030
|
+
st && K && !b ? /* @__PURE__ */ c("div", { className: "ds:flex ds:justify-center ds:py-[var(--spacing-sm)]", children: /* @__PURE__ */ c(
|
|
1031
|
+
Re,
|
|
1018
1032
|
{
|
|
1019
1033
|
intent: "ghost",
|
|
1020
1034
|
size: "sm",
|
|
1021
|
-
"aria-busy":
|
|
1022
|
-
"aria-disabled":
|
|
1035
|
+
"aria-busy": Z || void 0,
|
|
1036
|
+
"aria-disabled": Z || void 0,
|
|
1023
1037
|
onClick: () => {
|
|
1024
|
-
|
|
1038
|
+
Z || Be();
|
|
1025
1039
|
},
|
|
1026
1040
|
children: d("tasksPanel.loadMore")
|
|
1027
1041
|
}
|
|
@@ -1030,172 +1044,172 @@ const Rn = Ms(
|
|
|
1030
1044
|
}
|
|
1031
1045
|
)
|
|
1032
1046
|
] });
|
|
1033
|
-
let
|
|
1034
|
-
if (
|
|
1035
|
-
const e = [...
|
|
1047
|
+
let S;
|
|
1048
|
+
if (f) {
|
|
1049
|
+
const e = [...ee.values()].some((s) => !s.settled), t = !pn(
|
|
1036
1050
|
{
|
|
1037
1051
|
status: O,
|
|
1038
|
-
type:
|
|
1039
|
-
assignee:
|
|
1040
|
-
overdueOnly:
|
|
1052
|
+
type: I,
|
|
1053
|
+
assignee: H,
|
|
1054
|
+
overdueOnly: Ze
|
|
1041
1055
|
},
|
|
1042
1056
|
j
|
|
1043
1057
|
);
|
|
1044
|
-
|
|
1045
|
-
} else
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
}, [
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1058
|
+
x && G.length === 0 ? S = kt : G.length === 0 && (b || e) ? S = Me : G.length === 0 ? S = t ? bt : yt : S = wt;
|
|
1059
|
+
} else x ? S = kt : b ? S = Me : o.length === 0 ? S = yt : G.length === 0 ? S = bt : S = wt;
|
|
1060
|
+
const Pt = S === Me, [Ns, js] = R(!1);
|
|
1061
|
+
$(() => {
|
|
1062
|
+
js(Pt);
|
|
1063
|
+
}, [Pt]);
|
|
1064
|
+
const As = u === void 0 ? je : /* @__PURE__ */ w(Te, { children: [
|
|
1065
|
+
je,
|
|
1052
1066
|
/* @__PURE__ */ c(
|
|
1053
1067
|
"span",
|
|
1054
1068
|
{
|
|
1055
1069
|
"aria-hidden": "true",
|
|
1056
1070
|
"data-total-count": "",
|
|
1057
1071
|
className: "ds:ms-[var(--spacing-2xs)] ds:text-[color:var(--muted-foreground)]",
|
|
1058
|
-
children:
|
|
1072
|
+
children: Xe(u)
|
|
1059
1073
|
}
|
|
1060
1074
|
),
|
|
1061
1075
|
/* @__PURE__ */ c(Gs, { children: ` ${d("tasksPanel.totalCount", { count: u })}` })
|
|
1062
|
-
] }),
|
|
1063
|
-
|
|
1076
|
+
] }), xt = ((L == null ? void 0 : L.length) ?? 0) > 1, _s = ["todo", "done", "all"], zs = Q && !N ? /* @__PURE__ */ c(
|
|
1077
|
+
$e,
|
|
1064
1078
|
{
|
|
1065
|
-
icon: /* @__PURE__ */ c(
|
|
1079
|
+
icon: /* @__PURE__ */ c(Js, {}),
|
|
1066
1080
|
intent: "outline",
|
|
1067
1081
|
size: "sm",
|
|
1068
1082
|
"aria-label": d("tasksPanel.add"),
|
|
1069
1083
|
"data-action": "add-task",
|
|
1070
|
-
onClick:
|
|
1084
|
+
onClick: Q
|
|
1071
1085
|
}
|
|
1072
|
-
) : void 0,
|
|
1073
|
-
|
|
1074
|
-
const t =
|
|
1086
|
+
) : void 0, St = V.status, Tt = !!(pe != null && pe.length) && V.type, Rt = !!(ve != null && ve.length) && V.assignee, Et = V.overdueOnly, Ot = $t && (St || Tt || Rt || Et), Bs = xt || Ot ? /* @__PURE__ */ w("div", { className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
1087
|
+
xt ? /* @__PURE__ */ c(Nt, { label: d("tasksPanel.scope.label"), children: L.map((e) => {
|
|
1088
|
+
const t = ns === e;
|
|
1075
1089
|
return /* @__PURE__ */ c(
|
|
1076
|
-
|
|
1090
|
+
Re,
|
|
1077
1091
|
{
|
|
1078
1092
|
intent: t ? "primary" : "outline",
|
|
1079
1093
|
size: "sm",
|
|
1080
1094
|
"aria-pressed": t,
|
|
1081
|
-
onClick: () =>
|
|
1082
|
-
children:
|
|
1095
|
+
onClick: () => Je(e),
|
|
1096
|
+
children: Jt[e]
|
|
1083
1097
|
},
|
|
1084
1098
|
e
|
|
1085
1099
|
);
|
|
1086
1100
|
}) }) : null,
|
|
1087
|
-
|
|
1088
|
-
|
|
1101
|
+
Ot ? /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
1102
|
+
St ? /* @__PURE__ */ c(Nt, { label: d("tasksPanel.status.label"), children: _s.map((e) => {
|
|
1089
1103
|
const t = O === e;
|
|
1090
1104
|
return /* @__PURE__ */ c(
|
|
1091
|
-
|
|
1105
|
+
Re,
|
|
1092
1106
|
{
|
|
1093
1107
|
intent: t ? "primary" : "outline",
|
|
1094
1108
|
size: "sm",
|
|
1095
1109
|
"aria-pressed": t,
|
|
1096
1110
|
"data-status-filter": e,
|
|
1097
|
-
onClick: () =>
|
|
1098
|
-
children:
|
|
1111
|
+
onClick: () => U({ status: e }),
|
|
1112
|
+
children: Xt[e]
|
|
1099
1113
|
},
|
|
1100
1114
|
e
|
|
1101
1115
|
);
|
|
1102
1116
|
}) }) : null,
|
|
1103
|
-
|
|
1104
|
-
|
|
1117
|
+
Tt ? /* @__PURE__ */ c(
|
|
1118
|
+
jt,
|
|
1105
1119
|
{
|
|
1106
1120
|
size: "sm",
|
|
1107
1121
|
clearable: !0,
|
|
1108
1122
|
"aria-label": d("tasksPanel.type.label"),
|
|
1109
1123
|
placeholder: d("tasksPanel.type.placeholder"),
|
|
1110
|
-
options:
|
|
1111
|
-
value:
|
|
1112
|
-
onValueChange: (e) =>
|
|
1124
|
+
options: pe,
|
|
1125
|
+
value: I ?? "",
|
|
1126
|
+
onValueChange: (e) => U({ type: e || null })
|
|
1113
1127
|
}
|
|
1114
1128
|
) : null,
|
|
1115
|
-
|
|
1116
|
-
|
|
1129
|
+
Rt ? /* @__PURE__ */ c(
|
|
1130
|
+
jt,
|
|
1117
1131
|
{
|
|
1118
1132
|
size: "sm",
|
|
1119
1133
|
clearable: !0,
|
|
1120
1134
|
"aria-label": d("tasksPanel.assignee.label"),
|
|
1121
1135
|
placeholder: d("tasksPanel.assignee.placeholder"),
|
|
1122
|
-
options:
|
|
1123
|
-
value:
|
|
1124
|
-
onValueChange: (e) =>
|
|
1136
|
+
options: ve,
|
|
1137
|
+
value: H ?? "",
|
|
1138
|
+
onValueChange: (e) => U({ assignee: e || null })
|
|
1125
1139
|
}
|
|
1126
1140
|
) : null,
|
|
1127
|
-
|
|
1128
|
-
|
|
1141
|
+
Et ? /* @__PURE__ */ c(
|
|
1142
|
+
Vs,
|
|
1129
1143
|
{
|
|
1130
|
-
id:
|
|
1144
|
+
id: Qt,
|
|
1131
1145
|
size: "sm",
|
|
1132
1146
|
label: d("tasksPanel.overdueOnly"),
|
|
1133
|
-
checked:
|
|
1134
|
-
disabled:
|
|
1135
|
-
onCheckedChange: (e) =>
|
|
1147
|
+
checked: Ze,
|
|
1148
|
+
disabled: f && O === "done",
|
|
1149
|
+
onCheckedChange: (e) => U({ overdueOnly: e })
|
|
1136
1150
|
}
|
|
1137
1151
|
) : null
|
|
1138
1152
|
] }) : null
|
|
1139
1153
|
] }) : void 0;
|
|
1140
|
-
return /* @__PURE__ */
|
|
1154
|
+
return /* @__PURE__ */ w(
|
|
1141
1155
|
"section",
|
|
1142
1156
|
{
|
|
1143
|
-
ref:
|
|
1157
|
+
ref: ae,
|
|
1144
1158
|
"data-component": "tasks-panel",
|
|
1145
1159
|
"data-component-id": a,
|
|
1146
|
-
"aria-labelledby": Ge ? void 0 :
|
|
1160
|
+
"aria-labelledby": Ge ? void 0 : Fe,
|
|
1147
1161
|
"aria-label": Ge,
|
|
1148
|
-
className:
|
|
1149
|
-
...
|
|
1162
|
+
className: hn({ size: h, className: Gt }),
|
|
1163
|
+
...Yt,
|
|
1150
1164
|
children: [
|
|
1151
1165
|
/* @__PURE__ */ c(
|
|
1152
|
-
|
|
1166
|
+
Ks,
|
|
1153
1167
|
{
|
|
1154
|
-
title:
|
|
1168
|
+
title: As,
|
|
1155
1169
|
titleTooltip: u === void 0 ? void 0 : d("tasksPanel.titleWithCount", {
|
|
1156
|
-
title:
|
|
1157
|
-
value:
|
|
1170
|
+
title: je,
|
|
1171
|
+
value: Qe.format(u)
|
|
1158
1172
|
}),
|
|
1159
|
-
icon:
|
|
1160
|
-
headingId:
|
|
1161
|
-
actions:
|
|
1162
|
-
filters:
|
|
1173
|
+
icon: y ?? /* @__PURE__ */ c(Zs, {}),
|
|
1174
|
+
headingId: Fe,
|
|
1175
|
+
actions: zs,
|
|
1176
|
+
filters: Bs
|
|
1163
1177
|
}
|
|
1164
1178
|
),
|
|
1165
|
-
/* @__PURE__ */ c("p", { role: "status", className: "ds:sr-only", children:
|
|
1166
|
-
|
|
1179
|
+
/* @__PURE__ */ c("p", { role: "status", className: "ds:sr-only", children: Ns ? d("common.loading") : null }),
|
|
1180
|
+
S
|
|
1167
1181
|
]
|
|
1168
1182
|
}
|
|
1169
1183
|
);
|
|
1170
1184
|
}
|
|
1171
1185
|
);
|
|
1172
|
-
|
|
1173
|
-
function
|
|
1186
|
+
En.displayName = "TasksPanel";
|
|
1187
|
+
function On({
|
|
1174
1188
|
bucketKey: a,
|
|
1175
1189
|
countLabel: o,
|
|
1176
1190
|
showCount: g = !0,
|
|
1177
|
-
label:
|
|
1178
|
-
headerRef:
|
|
1191
|
+
label: k,
|
|
1192
|
+
headerRef: y,
|
|
1179
1193
|
reflowId: u,
|
|
1180
|
-
leaving:
|
|
1194
|
+
leaving: h = !1
|
|
1181
1195
|
}) {
|
|
1182
|
-
return /* @__PURE__ */
|
|
1196
|
+
return /* @__PURE__ */ w(
|
|
1183
1197
|
"div",
|
|
1184
1198
|
{
|
|
1185
|
-
ref:
|
|
1199
|
+
ref: y,
|
|
1186
1200
|
"data-bucket": a,
|
|
1187
1201
|
"data-reflow-id": u,
|
|
1188
|
-
"data-leaving":
|
|
1202
|
+
"data-leaving": h ? "" : void 0,
|
|
1189
1203
|
className: [
|
|
1190
1204
|
"ds:sticky ds:top-0 ds:z-[2] ds:bg-[color:var(--card)] ds:py-[var(--spacing-2xs)]",
|
|
1191
1205
|
"ds:flex ds:items-center ds:gap-[var(--spacing-2xs)] type-eyebrow",
|
|
1192
1206
|
// A header travels with its bucket, and leaves with it: a heading
|
|
1193
1207
|
// left standing over nothing, or snapping while its rows glide,
|
|
1194
1208
|
// reads as two lists rather than one.
|
|
1195
|
-
|
|
1209
|
+
Lt,
|
|
1196
1210
|
"ds:transition-opacity ds:duration-[var(--animation-duration)]",
|
|
1197
1211
|
"ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none",
|
|
1198
|
-
|
|
1212
|
+
h ? It : "",
|
|
1199
1213
|
a === "overdue" ? "ds:text-[color:var(--destructive)] ds:font-semibold" : a === "today" ? "ds:text-[color:var(--primary)] ds:font-semibold" : "ds:text-[color:var(--muted-foreground)]"
|
|
1200
1214
|
].filter(Boolean).join(" "),
|
|
1201
1215
|
children: [
|
|
@@ -1206,7 +1220,7 @@ function En({
|
|
|
1206
1220
|
className: "ds:size-1.5 ds:shrink-0 ds:rounded-[var(--radius-full)] ds:bg-[color:var(--primary)]"
|
|
1207
1221
|
}
|
|
1208
1222
|
) : null,
|
|
1209
|
-
|
|
1223
|
+
k,
|
|
1210
1224
|
g ? /* @__PURE__ */ c(
|
|
1211
1225
|
"span",
|
|
1212
1226
|
{
|
|
@@ -1220,7 +1234,7 @@ function En({
|
|
|
1220
1234
|
);
|
|
1221
1235
|
}
|
|
1222
1236
|
export {
|
|
1223
|
-
|
|
1224
|
-
|
|
1237
|
+
En as T,
|
|
1238
|
+
dn as t
|
|
1225
1239
|
};
|
|
1226
|
-
//# sourceMappingURL=tasks-panel-
|
|
1240
|
+
//# sourceMappingURL=tasks-panel-BDPQPOP6.js.map
|