@epam/ai-dial-scheduled-tasks 1.1.0-dev.101
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/components/ScheduledTaskCard/ScheduledTaskCard.d.ts +14 -0
- package/components/ScheduledTaskCard/ScheduledTaskCard.d.ts.map +1 -0
- package/components/ScheduledTaskCardGrid/ScheduledTaskCardGrid.d.ts +5 -0
- package/components/ScheduledTaskCardGrid/ScheduledTaskCardGrid.d.ts.map +1 -0
- package/components/ScheduledTaskCardSkeleton/ScheduledTaskCardSkeleton.d.ts +7 -0
- package/components/ScheduledTaskCardSkeleton/ScheduledTaskCardSkeleton.d.ts.map +1 -0
- package/components/ScheduledTaskCreateForm/ScheduledTaskCreateForm.d.ts +13 -0
- package/components/ScheduledTaskCreateForm/ScheduledTaskCreateForm.d.ts.map +1 -0
- package/components/ScheduledTaskSection/ScheduledTaskSection.d.ts +5 -0
- package/components/ScheduledTaskSection/ScheduledTaskSection.d.ts.map +1 -0
- package/components/ScheduledTasks/ScheduledTasks.d.ts +10 -0
- package/components/ScheduledTasks/ScheduledTasks.d.ts.map +1 -0
- package/constants/scheduled-task-create-form.d.ts +3 -0
- package/constants/scheduled-task-create-form.d.ts.map +1 -0
- package/index.css +2 -0
- package/index.d.ts +18 -0
- package/index.d.ts.map +1 -0
- package/index.js +596 -0
- package/models/scheduled-task-card-grid-props.d.ts +38 -0
- package/models/scheduled-task-card-grid-props.d.ts.map +1 -0
- package/models/scheduled-task-card-props.d.ts +82 -0
- package/models/scheduled-task-card-props.d.ts.map +1 -0
- package/models/scheduled-task-card-skeleton-props.d.ts +22 -0
- package/models/scheduled-task-card-skeleton-props.d.ts.map +1 -0
- package/models/scheduled-task-create-form-props.d.ts +170 -0
- package/models/scheduled-task-create-form-props.d.ts.map +1 -0
- package/models/scheduled-task-item.d.ts +34 -0
- package/models/scheduled-task-item.d.ts.map +1 -0
- package/models/scheduled-task-section-props.d.ts +37 -0
- package/models/scheduled-task-section-props.d.ts.map +1 -0
- package/models/scheduled-tasks-props.d.ts +113 -0
- package/models/scheduled-tasks-props.d.ts.map +1 -0
- package/package.json +31 -0
- package/test-setup.d.ts +1 -0
- package/test-setup.d.ts.map +1 -0
- package/types/scheduled-task-schedule.d.ts +17 -0
- package/types/scheduled-task-schedule.d.ts.map +1 -0
- package/types/scheduled-tasks-sort-key.d.ts +12 -0
- package/types/scheduled-tasks-sort-key.d.ts.map +1 -0
- package/utils/calendar-value.d.ts +10 -0
- package/utils/calendar-value.d.ts.map +1 -0
package/index.js
ADDED
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
import { PanelEmptyState as e, buildCssVars as t, mergeClasses as n } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { Input as r, SearchBar as i, Textarea as a } from "@epam/ai-dial-kit";
|
|
3
|
+
import { Calendar as o, CalendarMode as s, CardShell as c, DIAL_ICON_SIZE as l, DialDropdown as u, DialSelectField as d, DialSkeleton as f, DialSkeletonVariant as p, DialSpinner as m, FolderPath as h, GhostButton as g, GhostIconButton as _, Highlight as v, IconButton as y, LazyDialMarkdownEditor as b, NeutralButton as x, PrimaryButton as S } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { IconArrowLeft as C, IconArrowsSort as w, IconCalendarTime as T, IconCheck as E, IconChevronUp as D, IconDotsVertical as O, IconEdit as k, IconPlayerPlay as A, IconPlus as j, IconTrash as M } from "@tabler/icons-react";
|
|
5
|
+
import { Suspense as N, lazy as P, useEffect as ee, useMemo as te, useRef as ne } from "react";
|
|
6
|
+
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
7
|
+
//#region src/models/scheduled-task-item.ts
|
|
8
|
+
var R = /* @__PURE__ */ function(e) {
|
|
9
|
+
return e.Shared = "shared", e.MyTasks = "myTasks", e;
|
|
10
|
+
}({}), z = {
|
|
11
|
+
title: "_title_14goq_1",
|
|
12
|
+
description: "_description_14goq_5",
|
|
13
|
+
schedulePill: "_schedulePill_14goq_9",
|
|
14
|
+
scheduleLabel: "_scheduleLabel_14goq_14",
|
|
15
|
+
locationLabel: "_locationLabel_14goq_18",
|
|
16
|
+
locationLeaf: "_locationLeaf_14goq_22",
|
|
17
|
+
newBadge: "_newBadge_14goq_26",
|
|
18
|
+
locationDivider: "_locationDivider_14goq_31"
|
|
19
|
+
}, B = ({ item: e, searchQuery: r = "", onEdit: i, onRunNow: a, onDelete: o, labels: s, styles: d, className: f }) => {
|
|
20
|
+
let p = s?.newBadgeLabel ?? "NEW", m = s?.actionsLabel ?? "More actions", g = s?.editActionLabel ?? "Edit", _ = s?.runNowActionLabel ?? "Run now", b = s?.deleteActionLabel ?? "Delete", { colors: x, typography: S } = d ?? {}, C = S?.titleClassName ?? "dial-body-semi-text", w = S?.descriptionClassName ?? "dial-small-text", T = S?.scheduleLabelClassName ?? "dial-tiny-text", E = S?.locationLabelClassName ?? "dial-tiny-text", D = S?.locationLeafClassName ?? "dial-tiny-semi-text", j = S?.newBadgeClassName ?? "dial-tiny-semi-text", N = t({
|
|
21
|
+
"--stc-title-text": x?.titleText,
|
|
22
|
+
"--stc-desc-text": x?.descriptionText,
|
|
23
|
+
"--stc-pill-bg": x?.schedulePillBackground,
|
|
24
|
+
"--stc-pill-border": x?.schedulePillBorder,
|
|
25
|
+
"--stc-schedule-label-text": x?.scheduleLabelText,
|
|
26
|
+
"--stc-location-label-text": x?.locationLabelText,
|
|
27
|
+
"--stc-location-leaf-text": x?.locationLeafText,
|
|
28
|
+
"--stc-new-badge-bg": x?.newBadgeBackground,
|
|
29
|
+
"--stc-new-badge-text": x?.newBadgeText,
|
|
30
|
+
"--stc-location-divider-border": x?.locationDividerBorder
|
|
31
|
+
}), P = [];
|
|
32
|
+
return i && P.push({
|
|
33
|
+
key: "edit",
|
|
34
|
+
label: g,
|
|
35
|
+
icon: /* @__PURE__ */ I(k, {
|
|
36
|
+
size: l.SM,
|
|
37
|
+
"aria-hidden": !0
|
|
38
|
+
}),
|
|
39
|
+
onClick: () => i(e.id)
|
|
40
|
+
}), a && P.push({
|
|
41
|
+
key: "runNow",
|
|
42
|
+
label: _,
|
|
43
|
+
icon: /* @__PURE__ */ I(A, {
|
|
44
|
+
size: l.SM,
|
|
45
|
+
"aria-hidden": !0
|
|
46
|
+
}),
|
|
47
|
+
onClick: () => a(e.id)
|
|
48
|
+
}), o && P.push({
|
|
49
|
+
key: "delete",
|
|
50
|
+
label: b,
|
|
51
|
+
icon: /* @__PURE__ */ I(M, {
|
|
52
|
+
size: l.SM,
|
|
53
|
+
"aria-hidden": !0
|
|
54
|
+
}),
|
|
55
|
+
danger: !0,
|
|
56
|
+
onClick: () => o(e.id)
|
|
57
|
+
}), /* @__PURE__ */ L(c, {
|
|
58
|
+
role: "group",
|
|
59
|
+
"aria-label": e.displayName,
|
|
60
|
+
style: N,
|
|
61
|
+
className: n("h-[232px]", f),
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ L("div", {
|
|
64
|
+
className: "flex shrink-0 items-start justify-between gap-2",
|
|
65
|
+
children: [/* @__PURE__ */ L("div", {
|
|
66
|
+
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
67
|
+
children: [/* @__PURE__ */ I(v, {
|
|
68
|
+
text: e.displayName,
|
|
69
|
+
query: r,
|
|
70
|
+
maxLines: 1,
|
|
71
|
+
className: n(C, z.title)
|
|
72
|
+
}), e.isNew && /* @__PURE__ */ I("span", {
|
|
73
|
+
className: n("shrink-0 rounded-full px-2 py-0.5", j, z.newBadge),
|
|
74
|
+
children: p
|
|
75
|
+
})]
|
|
76
|
+
}), P.length > 0 && /* @__PURE__ */ I(u, {
|
|
77
|
+
items: P,
|
|
78
|
+
matchReferenceWidth: !1,
|
|
79
|
+
placement: "bottom-end",
|
|
80
|
+
children: /* @__PURE__ */ I(y, {
|
|
81
|
+
icon: /* @__PURE__ */ I(O, {
|
|
82
|
+
size: l.SM,
|
|
83
|
+
"aria-hidden": !0
|
|
84
|
+
}),
|
|
85
|
+
"aria-label": m,
|
|
86
|
+
className: "shrink-0"
|
|
87
|
+
})
|
|
88
|
+
})]
|
|
89
|
+
}),
|
|
90
|
+
e.descriptionPreview && /* @__PURE__ */ I("p", {
|
|
91
|
+
className: n("line-clamp-4 min-h-0 flex-1 overflow-hidden !leading-[22px]", w, z.description),
|
|
92
|
+
children: e.descriptionPreview
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ L("div", {
|
|
95
|
+
className: "mt-auto flex shrink-0 flex-col gap-3",
|
|
96
|
+
children: [/* @__PURE__ */ I("div", {
|
|
97
|
+
className: "flex min-h-[28px] items-center",
|
|
98
|
+
children: /* @__PURE__ */ I("span", {
|
|
99
|
+
className: n("inline-block rounded-lg border px-2 py-1", z.schedulePill, T, z.scheduleLabel),
|
|
100
|
+
children: e.scheduleLabel
|
|
101
|
+
})
|
|
102
|
+
}), e.locationSegments && e.locationSegments.length > 0 && /* @__PURE__ */ I(h, {
|
|
103
|
+
segments: e.locationSegments,
|
|
104
|
+
labelClassName: n(E, z.locationLabel),
|
|
105
|
+
leafClassName: n(D, z.locationLeaf),
|
|
106
|
+
className: n("pt-3", z.locationDivider)
|
|
107
|
+
})]
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
});
|
|
111
|
+
}, V = [
|
|
112
|
+
"100%",
|
|
113
|
+
"100%",
|
|
114
|
+
"61%"
|
|
115
|
+
], H = ({ styles: e }) => {
|
|
116
|
+
let t = e?.colors?.skeletonColor ?? "var(--bg-layer-4)";
|
|
117
|
+
return /* @__PURE__ */ L(c, {
|
|
118
|
+
"aria-hidden": !0,
|
|
119
|
+
className: "h-[232px]",
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ I(f, {
|
|
122
|
+
variant: p.Rectangular,
|
|
123
|
+
width: "60%",
|
|
124
|
+
height: "20px",
|
|
125
|
+
color: t,
|
|
126
|
+
className: "shrink-0"
|
|
127
|
+
}),
|
|
128
|
+
/* @__PURE__ */ I("div", {
|
|
129
|
+
className: "flex min-h-0 flex-1 flex-col gap-3 overflow-hidden",
|
|
130
|
+
children: V.map((e, n) => /* @__PURE__ */ I(f, {
|
|
131
|
+
variant: p.Rectangular,
|
|
132
|
+
width: e,
|
|
133
|
+
height: "16px",
|
|
134
|
+
color: t
|
|
135
|
+
}, n))
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ I(f, {
|
|
138
|
+
variant: p.Rectangular,
|
|
139
|
+
width: "110px",
|
|
140
|
+
height: "28px",
|
|
141
|
+
color: t,
|
|
142
|
+
className: "shrink-0 rounded-lg"
|
|
143
|
+
})
|
|
144
|
+
]
|
|
145
|
+
});
|
|
146
|
+
}, U = ({ items: e, searchQuery: t, onEdit: n, onRunNow: r, onDelete: i, labels: a, cardStyles: o, trailingSkeletonCount: s = 0, skeletonStyles: c }) => /* @__PURE__ */ L("div", {
|
|
147
|
+
className: "grid grid-cols-1 gap-5 desktop:grid-cols-3",
|
|
148
|
+
children: [e.map((e) => /* @__PURE__ */ I(B, {
|
|
149
|
+
item: e,
|
|
150
|
+
searchQuery: t,
|
|
151
|
+
onEdit: n,
|
|
152
|
+
onRunNow: r,
|
|
153
|
+
onDelete: i,
|
|
154
|
+
labels: a,
|
|
155
|
+
styles: o
|
|
156
|
+
}, e.id)), Array.from({ length: s }, (e, t) => /* @__PURE__ */ I(H, { styles: c }, `skeleton-${t}`))]
|
|
157
|
+
}), W = { countBadge: "_countBadge_5ysac_1" }, G = ({ title: e, count: r, children: i, styles: a }) => {
|
|
158
|
+
let o = a?.typography?.titleClassName ?? "dial-small-semi-text", s = a?.typography?.countBadgeClassName ?? "dial-tiny-text", c = t({
|
|
159
|
+
"--sts-badge-bg": a?.colors?.countBadgeBackground,
|
|
160
|
+
"--sts-badge-text": a?.colors?.countBadgeText
|
|
161
|
+
});
|
|
162
|
+
return /* @__PURE__ */ L("section", {
|
|
163
|
+
...e ? { "aria-label": e } : {},
|
|
164
|
+
style: c,
|
|
165
|
+
className: "flex flex-col gap-3",
|
|
166
|
+
children: [e && /* @__PURE__ */ L("div", {
|
|
167
|
+
className: "flex items-center gap-2 rtl:flex-row-reverse",
|
|
168
|
+
children: [/* @__PURE__ */ I("h2", {
|
|
169
|
+
className: o,
|
|
170
|
+
children: e
|
|
171
|
+
}), /* @__PURE__ */ I("span", {
|
|
172
|
+
className: n("rounded-full px-2 py-0.5", s, W.countBadge),
|
|
173
|
+
children: r
|
|
174
|
+
})]
|
|
175
|
+
}), i]
|
|
176
|
+
});
|
|
177
|
+
}, K = {
|
|
178
|
+
container: "_container_sac6a_1",
|
|
179
|
+
subtitle: "_subtitle_sac6a_5",
|
|
180
|
+
sortButton: "_sortButton_sac6a_9"
|
|
181
|
+
}, re = [R.Shared, R.MyTasks], ie = (e, t, n, r, i, a) => {
|
|
182
|
+
if (!e) return t ? a.loadingMoreLabel : n ? a.errorLabel : r > 0 ? `${r}` : i ? a.noResultsLabel : a.emptyStateLabel;
|
|
183
|
+
}, q = (e) => {
|
|
184
|
+
if (!e || e === document.body) return null;
|
|
185
|
+
let { overflow: t, overflowY: n } = getComputedStyle(e);
|
|
186
|
+
return t === "auto" || t === "scroll" || n === "auto" || n === "scroll" ? e : q(e.parentElement);
|
|
187
|
+
}, J = ({ labels: r, onCreateClick: a, searchQuery: o, onSearchQueryChange: s, sortKey: c, onSortChange: d, items: f, isLoading: p = !1, error: h, onRetry: _, hasMore: v = !1, isLoadingMore: y = !1, skeletonCount: b = 6, onLoadMore: x, onEdit: C, onRunNow: O, onDelete: k, styles: A }) => {
|
|
188
|
+
let { colors: M, typography: N, emptyStateIconSize: P = 48 } = A ?? {}, F = N?.titleClassName ?? "dial-h1-text", z = N?.subtitleClassName ?? "dial-body-text", B = t({
|
|
189
|
+
"--st-bg": M?.background,
|
|
190
|
+
"--st-subtitle-text": M?.subtitleText,
|
|
191
|
+
"--st-sort-text": M?.sortButtonText
|
|
192
|
+
}), V = r.sortOptions.find((e) => e.key === c)?.label ?? "", H = te(() => {
|
|
193
|
+
let e = { [R.Shared]: r.sharedSectionTitle };
|
|
194
|
+
return re.map((t) => ({
|
|
195
|
+
key: t,
|
|
196
|
+
title: e[t],
|
|
197
|
+
items: f.filter((e) => e.sectionKey === t)
|
|
198
|
+
})).filter((e) => e.items.length > 0);
|
|
199
|
+
}, [f, r.sharedSectionTitle]), W = ie(p, y, !!h, f.length, o.trim().length > 0, r), J = ne(null);
|
|
200
|
+
ee(() => {
|
|
201
|
+
let e = J.current;
|
|
202
|
+
if (!e || !x) return;
|
|
203
|
+
let t = q(e.parentElement);
|
|
204
|
+
if (!t) return;
|
|
205
|
+
let n = () => {
|
|
206
|
+
if (y || p || !v) return;
|
|
207
|
+
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
208
|
+
r.top < n.bottom && r.bottom > n.top && x();
|
|
209
|
+
};
|
|
210
|
+
return t.addEventListener("scroll", n, { passive: !0 }), n(), () => t.removeEventListener("scroll", n);
|
|
211
|
+
}, [
|
|
212
|
+
v,
|
|
213
|
+
y,
|
|
214
|
+
p,
|
|
215
|
+
x
|
|
216
|
+
]);
|
|
217
|
+
let ae = () => {
|
|
218
|
+
if (p) return /* @__PURE__ */ I(m, {});
|
|
219
|
+
if (h) return /* @__PURE__ */ L("div", {
|
|
220
|
+
className: "flex flex-col items-center gap-3",
|
|
221
|
+
children: [/* @__PURE__ */ I("p", {
|
|
222
|
+
className: n(z, K.subtitle),
|
|
223
|
+
children: r.errorLabel
|
|
224
|
+
}), /* @__PURE__ */ I(g, {
|
|
225
|
+
label: r.retryLabel,
|
|
226
|
+
onClick: _
|
|
227
|
+
})]
|
|
228
|
+
});
|
|
229
|
+
if (f.length === 0) return o.trim() ? /* @__PURE__ */ I("p", {
|
|
230
|
+
className: n(z, K.subtitle),
|
|
231
|
+
children: r.noResultsLabel
|
|
232
|
+
}) : /* @__PURE__ */ I(e, {
|
|
233
|
+
icon: /* @__PURE__ */ I(T, {
|
|
234
|
+
"aria-hidden": !0,
|
|
235
|
+
size: P,
|
|
236
|
+
stroke: 1
|
|
237
|
+
}),
|
|
238
|
+
label: r.emptyStateLabel
|
|
239
|
+
});
|
|
240
|
+
let t = H.length - 1;
|
|
241
|
+
return /* @__PURE__ */ L("div", {
|
|
242
|
+
className: "flex w-full flex-col gap-6",
|
|
243
|
+
children: [H.map((e, n) => /* @__PURE__ */ I(G, {
|
|
244
|
+
title: e.title,
|
|
245
|
+
count: e.items.length,
|
|
246
|
+
children: /* @__PURE__ */ I(U, {
|
|
247
|
+
items: e.items,
|
|
248
|
+
searchQuery: o,
|
|
249
|
+
onEdit: C,
|
|
250
|
+
onRunNow: O,
|
|
251
|
+
onDelete: k,
|
|
252
|
+
labels: r.cardLabels,
|
|
253
|
+
trailingSkeletonCount: y && n === t ? b : 0,
|
|
254
|
+
skeletonStyles: { colors: { skeletonColor: M?.skeletonColor } }
|
|
255
|
+
})
|
|
256
|
+
}, e.key)), /* @__PURE__ */ I("div", {
|
|
257
|
+
ref: J,
|
|
258
|
+
"aria-hidden": !0,
|
|
259
|
+
className: "h-px w-full"
|
|
260
|
+
})]
|
|
261
|
+
});
|
|
262
|
+
}, oe = p || !!h || f.length === 0;
|
|
263
|
+
return /* @__PURE__ */ L("div", {
|
|
264
|
+
style: B,
|
|
265
|
+
className: n("flex h-full w-full flex-col gap-6 overflow-y-auto px-8 py-4", K.container),
|
|
266
|
+
children: [
|
|
267
|
+
/* @__PURE__ */ L("div", {
|
|
268
|
+
className: "flex items-start justify-between gap-4",
|
|
269
|
+
children: [/* @__PURE__ */ L("div", {
|
|
270
|
+
className: "min-w-0 gap-2",
|
|
271
|
+
children: [/* @__PURE__ */ I("h1", {
|
|
272
|
+
className: n("truncate", F),
|
|
273
|
+
children: r.title
|
|
274
|
+
}), /* @__PURE__ */ I("p", {
|
|
275
|
+
className: n("mt-1", z, K.subtitle),
|
|
276
|
+
children: r.subtitle
|
|
277
|
+
})]
|
|
278
|
+
}), /* @__PURE__ */ I(S, {
|
|
279
|
+
label: r.createButtonLabel,
|
|
280
|
+
iconBefore: /* @__PURE__ */ I(j, {
|
|
281
|
+
size: l.SM,
|
|
282
|
+
"aria-hidden": !0
|
|
283
|
+
}),
|
|
284
|
+
onClick: a,
|
|
285
|
+
className: "shrink-0"
|
|
286
|
+
})]
|
|
287
|
+
}),
|
|
288
|
+
/* @__PURE__ */ L("div", {
|
|
289
|
+
className: "flex flex-wrap items-center gap-3",
|
|
290
|
+
children: [/* @__PURE__ */ I("div", {
|
|
291
|
+
className: "flex-1",
|
|
292
|
+
children: /* @__PURE__ */ I(i, {
|
|
293
|
+
value: o,
|
|
294
|
+
onChange: s,
|
|
295
|
+
labels: {
|
|
296
|
+
placeholder: r.searchPlaceholder,
|
|
297
|
+
ariaLabel: r.searchAriaLabel,
|
|
298
|
+
clearLabel: r.clearSearchLabel
|
|
299
|
+
},
|
|
300
|
+
iconSize: 18,
|
|
301
|
+
iconStrokeWidth: 1.8,
|
|
302
|
+
styles: {
|
|
303
|
+
containerClassName: "h-[50px] w-full rounded-xl px-[18px]",
|
|
304
|
+
inputClassName: "text-[15px]",
|
|
305
|
+
clearButtonClassName: "size-11 desktop:size-auto"
|
|
306
|
+
}
|
|
307
|
+
})
|
|
308
|
+
}), r.sortOptions.length > 0 && /* @__PURE__ */ I(u, {
|
|
309
|
+
matchReferenceWidth: !1,
|
|
310
|
+
placement: "bottom-end",
|
|
311
|
+
listClassName: "cp-dropdown-overlay",
|
|
312
|
+
items: r.sortOptions.map((e) => ({
|
|
313
|
+
key: e.key,
|
|
314
|
+
label: /* @__PURE__ */ L("span", {
|
|
315
|
+
className: "flex w-full items-center justify-between gap-2",
|
|
316
|
+
children: [e.label, e.key === c && /* @__PURE__ */ I(E, {
|
|
317
|
+
size: l.SM,
|
|
318
|
+
"aria-hidden": !0
|
|
319
|
+
})]
|
|
320
|
+
}),
|
|
321
|
+
onClick: () => d(e.key)
|
|
322
|
+
})),
|
|
323
|
+
children: /* @__PURE__ */ I(g, {
|
|
324
|
+
label: V,
|
|
325
|
+
"aria-label": r.sortLabel,
|
|
326
|
+
className: n("rounded-[4px]", K.sortButton),
|
|
327
|
+
iconBefore: /* @__PURE__ */ I(w, {
|
|
328
|
+
size: 20,
|
|
329
|
+
"aria-hidden": !0
|
|
330
|
+
}),
|
|
331
|
+
iconAfter: /* @__PURE__ */ I(D, {
|
|
332
|
+
size: 20,
|
|
333
|
+
"aria-hidden": !0
|
|
334
|
+
})
|
|
335
|
+
})
|
|
336
|
+
})]
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ I("span", {
|
|
339
|
+
role: "status",
|
|
340
|
+
"aria-live": "polite",
|
|
341
|
+
className: "sr-only",
|
|
342
|
+
children: W
|
|
343
|
+
}),
|
|
344
|
+
/* @__PURE__ */ I("div", {
|
|
345
|
+
className: n("mx-auto flex size-full w-full max-w-[1180px] flex-col", oe && "items-center justify-center"),
|
|
346
|
+
children: ae()
|
|
347
|
+
})
|
|
348
|
+
]
|
|
349
|
+
});
|
|
350
|
+
}, ae = /* @__PURE__ */ function(e) {
|
|
351
|
+
return e.FirstToRun = "firstToRun", e.LastToRun = "lastToRun", e.Newest = "newest", e.NameAZ = "nameAZ", e;
|
|
352
|
+
}({}), oe = 500, Y = /* @__PURE__ */ function(e) {
|
|
353
|
+
return e.Once = "once", e.Recurring = "recurring", e;
|
|
354
|
+
}({}), X = /* @__PURE__ */ function(e) {
|
|
355
|
+
return e.Daily = "daily", e.Weekly = "weekly", e.Monthly = "monthly", e;
|
|
356
|
+
}({}), Z = (e) => String(e).padStart(2, "0"), se = (e) => e ? new Date(e) : null, ce = (e) => {
|
|
357
|
+
if (e == null) return "";
|
|
358
|
+
let t = e instanceof Date ? e : new Date(e);
|
|
359
|
+
return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${Z(t.getMonth() + 1)}-${Z(t.getDate())}T${Z(t.getHours())}:${Z(t.getMinutes())}`;
|
|
360
|
+
}, le = (e) => {
|
|
361
|
+
let t = Number(e);
|
|
362
|
+
return e && Number.isFinite(t) ? String(t + 1) : null;
|
|
363
|
+
}, ue = (e) => {
|
|
364
|
+
let t = typeof e == "string" ? Number(e) : NaN;
|
|
365
|
+
return Number.isFinite(t) ? String(t - 1) : "";
|
|
366
|
+
}, Q = {
|
|
367
|
+
container: "_container_1wply_1",
|
|
368
|
+
header: "_header_1wply_5",
|
|
369
|
+
detailsColumn: "_detailsColumn_1wply_9",
|
|
370
|
+
sectionSubtitle: "_sectionSubtitle_1wply_13",
|
|
371
|
+
instructionsError: "_instructionsError_1wply_17"
|
|
372
|
+
}, $ = (e) => `${e} *`, de = P(async () => ({ default: (await b()).DialMarkdownEditor })), fe = ({ labels: e, values: i, errors: c, modelOptions: u, onFieldChange: f, onBack: p, onCancel: h, onSubmit: g, isSubmitting: v = !1, markdownEditorTheme: y, styles: b }) => {
|
|
373
|
+
let { colors: w, typography: T } = b ?? {}, E = T?.titleClassName ?? "dial-h1-text", D = T?.sectionTitleClassName ?? "dial-body-semi-text", O = T?.sectionSubtitleClassName ?? "dial-tiny-text", k = T?.scheduleSectionLabelClassName ?? "dial-body-semi-text mb-1", A = T?.instructionsErrorClassName ?? "dial-small-text", j = t({
|
|
374
|
+
"--stcf-bg": w?.background,
|
|
375
|
+
"--stcf-header-border": w?.headerBorder,
|
|
376
|
+
"--stcf-details-border": w?.detailsColumnBorder,
|
|
377
|
+
"--stcf-subtitle-text": w?.sectionSubtitleText,
|
|
378
|
+
"--stcf-error-text": w?.instructionsErrorText
|
|
379
|
+
}), M = v || !i.displayName.trim() || !i.modelId || !i.prompt.trim();
|
|
380
|
+
return /* @__PURE__ */ L("div", {
|
|
381
|
+
style: j,
|
|
382
|
+
className: n("flex h-full w-full flex-col overflow-y-auto", Q.container),
|
|
383
|
+
children: [/* @__PURE__ */ L("div", {
|
|
384
|
+
className: n("flex h-16 items-center justify-between gap-6 border-b px-8", Q.header),
|
|
385
|
+
children: [/* @__PURE__ */ L("div", {
|
|
386
|
+
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
387
|
+
children: [/* @__PURE__ */ I(_, {
|
|
388
|
+
icon: /* @__PURE__ */ I(C, {
|
|
389
|
+
size: l.LG,
|
|
390
|
+
className: "rtl:scale-x-[-1]",
|
|
391
|
+
"aria-hidden": !0
|
|
392
|
+
}),
|
|
393
|
+
"aria-label": e.backButtonLabel,
|
|
394
|
+
onClick: p
|
|
395
|
+
}), /* @__PURE__ */ I("h1", {
|
|
396
|
+
className: n("truncate", E),
|
|
397
|
+
children: e.pageTitle
|
|
398
|
+
})]
|
|
399
|
+
}), /* @__PURE__ */ L("div", {
|
|
400
|
+
className: "flex items-center gap-2",
|
|
401
|
+
children: [/* @__PURE__ */ I(x, {
|
|
402
|
+
label: e.cancelButtonLabel,
|
|
403
|
+
onClick: h,
|
|
404
|
+
disabled: v
|
|
405
|
+
}), /* @__PURE__ */ I(S, {
|
|
406
|
+
label: e.createButtonLabel,
|
|
407
|
+
onClick: g,
|
|
408
|
+
disabled: M
|
|
409
|
+
})]
|
|
410
|
+
})]
|
|
411
|
+
}), /* @__PURE__ */ L("div", {
|
|
412
|
+
className: "flex flex-1 flex-col desktop:flex-row",
|
|
413
|
+
children: [
|
|
414
|
+
/* @__PURE__ */ L("div", {
|
|
415
|
+
role: "group",
|
|
416
|
+
"aria-label": e.detailsSectionTitle,
|
|
417
|
+
className: n("flex w-full flex-col gap-5 border-e px-8 py-6 desktop:w-[360px] desktop:shrink-0", Q.detailsColumn),
|
|
418
|
+
children: [
|
|
419
|
+
/* @__PURE__ */ L("div", {
|
|
420
|
+
className: "flex flex-col gap-1",
|
|
421
|
+
children: [/* @__PURE__ */ I("h2", {
|
|
422
|
+
className: D,
|
|
423
|
+
children: e.detailsSectionTitle
|
|
424
|
+
}), /* @__PURE__ */ I("p", {
|
|
425
|
+
className: n(O, Q.sectionSubtitle),
|
|
426
|
+
children: e.detailsSectionSubtitle
|
|
427
|
+
})]
|
|
428
|
+
}),
|
|
429
|
+
/* @__PURE__ */ I(r, {
|
|
430
|
+
id: "scheduled-task-display-name",
|
|
431
|
+
value: i.displayName,
|
|
432
|
+
onChange: (e) => f("displayName", e ?? ""),
|
|
433
|
+
labelProps: {
|
|
434
|
+
label: e.displayNameLabel,
|
|
435
|
+
required: !0
|
|
436
|
+
},
|
|
437
|
+
invalid: !!c.displayName,
|
|
438
|
+
error: c.displayName
|
|
439
|
+
}),
|
|
440
|
+
/* @__PURE__ */ I(a, {
|
|
441
|
+
id: "scheduled-task-description",
|
|
442
|
+
value: i.description ?? "",
|
|
443
|
+
onChange: (e) => f("description", e),
|
|
444
|
+
labelProps: { label: e.descriptionLabel },
|
|
445
|
+
maxLength: 500,
|
|
446
|
+
invalid: !!c.description,
|
|
447
|
+
error: c.description,
|
|
448
|
+
caption: i.description ? `${i.description.length}/500` : void 0
|
|
449
|
+
}),
|
|
450
|
+
/* @__PURE__ */ I(d, {
|
|
451
|
+
label: e.modelOrAgentLabel,
|
|
452
|
+
required: !0,
|
|
453
|
+
value: i.modelId,
|
|
454
|
+
placeholder: e.modelPlaceholder,
|
|
455
|
+
onChange: (e) => f("modelId", e),
|
|
456
|
+
error: c.modelId,
|
|
457
|
+
options: u.map((e) => ({
|
|
458
|
+
value: e.id,
|
|
459
|
+
label: e.label
|
|
460
|
+
}))
|
|
461
|
+
}),
|
|
462
|
+
/* @__PURE__ */ L("fieldset", {
|
|
463
|
+
className: "flex flex-col gap-3",
|
|
464
|
+
children: [
|
|
465
|
+
/* @__PURE__ */ I("legend", {
|
|
466
|
+
className: k,
|
|
467
|
+
children: e.scheduleSectionLabel
|
|
468
|
+
}),
|
|
469
|
+
/* @__PURE__ */ I(d, {
|
|
470
|
+
label: e.scheduleTypeAriaLabel,
|
|
471
|
+
value: i.scheduleType,
|
|
472
|
+
onChange: (e) => f("scheduleType", e),
|
|
473
|
+
options: [{
|
|
474
|
+
value: Y.Once,
|
|
475
|
+
label: e.scheduleTypeOnceLabel
|
|
476
|
+
}, {
|
|
477
|
+
value: Y.Recurring,
|
|
478
|
+
label: e.scheduleTypeRecurringLabel
|
|
479
|
+
}]
|
|
480
|
+
}),
|
|
481
|
+
i.scheduleType === Y.Once && /* @__PURE__ */ L("div", {
|
|
482
|
+
className: "flex flex-col gap-1",
|
|
483
|
+
children: [/* @__PURE__ */ I(o, {
|
|
484
|
+
id: "scheduled-task-run-at",
|
|
485
|
+
mode: s.DateTime,
|
|
486
|
+
value: se(i.runAt),
|
|
487
|
+
onChange: (e) => f("runAt", ce(e)),
|
|
488
|
+
label: $(e.runAtLabel),
|
|
489
|
+
invalid: !!c.runAt
|
|
490
|
+
}), c.runAt && /* @__PURE__ */ I("p", {
|
|
491
|
+
className: n(A, Q.instructionsError),
|
|
492
|
+
children: c.runAt
|
|
493
|
+
})]
|
|
494
|
+
}),
|
|
495
|
+
i.scheduleType === Y.Recurring && /* @__PURE__ */ L(F, { children: [
|
|
496
|
+
/* @__PURE__ */ I(d, {
|
|
497
|
+
label: e.frequencyLabel,
|
|
498
|
+
value: i.frequency,
|
|
499
|
+
onChange: (e) => f("frequency", e),
|
|
500
|
+
options: e.frequencyOptions.map((e) => ({
|
|
501
|
+
value: e.key,
|
|
502
|
+
label: e.label
|
|
503
|
+
}))
|
|
504
|
+
}),
|
|
505
|
+
/* @__PURE__ */ L("div", {
|
|
506
|
+
className: "flex flex-col gap-1",
|
|
507
|
+
children: [/* @__PURE__ */ I(o, {
|
|
508
|
+
id: "scheduled-task-time",
|
|
509
|
+
mode: s.Time,
|
|
510
|
+
value: i.time,
|
|
511
|
+
onChange: (e) => f("time", typeof e == "string" ? e : ""),
|
|
512
|
+
label: $(e.timeLabel),
|
|
513
|
+
invalid: !!c.time
|
|
514
|
+
}), c.time && /* @__PURE__ */ I("p", {
|
|
515
|
+
className: n(A, Q.instructionsError),
|
|
516
|
+
children: c.time
|
|
517
|
+
})]
|
|
518
|
+
}),
|
|
519
|
+
i.frequency === X.Weekly && /* @__PURE__ */ L("div", {
|
|
520
|
+
className: "flex flex-col gap-1",
|
|
521
|
+
children: [/* @__PURE__ */ I(o, {
|
|
522
|
+
id: "scheduled-task-day-of-week",
|
|
523
|
+
mode: s.Weekday,
|
|
524
|
+
value: le(i.dayOfWeek),
|
|
525
|
+
onChange: (e) => f("dayOfWeek", ue(e)),
|
|
526
|
+
label: $(e.dayOfWeekLabel),
|
|
527
|
+
invalid: !!c.dayOfWeek
|
|
528
|
+
}), c.dayOfWeek && /* @__PURE__ */ I("p", {
|
|
529
|
+
className: n(A, Q.instructionsError),
|
|
530
|
+
children: c.dayOfWeek
|
|
531
|
+
})]
|
|
532
|
+
}),
|
|
533
|
+
i.frequency === X.Monthly && /* @__PURE__ */ I(r, {
|
|
534
|
+
id: "scheduled-task-day-of-month",
|
|
535
|
+
value: i.dayOfMonth ?? "",
|
|
536
|
+
onChange: (e) => f("dayOfMonth", e ?? ""),
|
|
537
|
+
labelProps: {
|
|
538
|
+
label: e.dayOfMonthLabel,
|
|
539
|
+
required: !0
|
|
540
|
+
},
|
|
541
|
+
invalid: !!c.dayOfMonth,
|
|
542
|
+
error: c.dayOfMonth
|
|
543
|
+
})
|
|
544
|
+
] })
|
|
545
|
+
]
|
|
546
|
+
})
|
|
547
|
+
]
|
|
548
|
+
}),
|
|
549
|
+
/* @__PURE__ */ L("div", {
|
|
550
|
+
role: "group",
|
|
551
|
+
"aria-label": e.configurationSectionTitle,
|
|
552
|
+
className: "flex w-full min-w-0 flex-1 flex-col gap-5 px-8 py-6",
|
|
553
|
+
children: [/* @__PURE__ */ L("div", {
|
|
554
|
+
className: "flex flex-col gap-1",
|
|
555
|
+
children: [/* @__PURE__ */ I("h2", {
|
|
556
|
+
className: D,
|
|
557
|
+
children: e.configurationSectionTitle
|
|
558
|
+
}), /* @__PURE__ */ I("p", {
|
|
559
|
+
className: n(O, Q.sectionSubtitle),
|
|
560
|
+
children: e.configurationSectionSubtitle
|
|
561
|
+
})]
|
|
562
|
+
}), /* @__PURE__ */ L("div", {
|
|
563
|
+
role: "group",
|
|
564
|
+
"aria-label": e.instructionsLabel,
|
|
565
|
+
className: "flex flex-1 flex-col gap-1",
|
|
566
|
+
children: [
|
|
567
|
+
/* @__PURE__ */ I("span", {
|
|
568
|
+
className: k,
|
|
569
|
+
children: e.instructionsLabel
|
|
570
|
+
}),
|
|
571
|
+
/* @__PURE__ */ I(N, {
|
|
572
|
+
fallback: /* @__PURE__ */ I(m, {}),
|
|
573
|
+
children: /* @__PURE__ */ I(de, {
|
|
574
|
+
value: i.prompt,
|
|
575
|
+
onChange: (e) => f("prompt", e),
|
|
576
|
+
height: 480,
|
|
577
|
+
theme: y
|
|
578
|
+
})
|
|
579
|
+
}),
|
|
580
|
+
c.prompt && /* @__PURE__ */ I("p", {
|
|
581
|
+
className: n(A, Q.instructionsError),
|
|
582
|
+
children: c.prompt
|
|
583
|
+
})
|
|
584
|
+
]
|
|
585
|
+
})]
|
|
586
|
+
}),
|
|
587
|
+
/* @__PURE__ */ I("div", {
|
|
588
|
+
"aria-hidden": !0,
|
|
589
|
+
className: "hidden desktop:block desktop:w-[360px] desktop:shrink-0"
|
|
590
|
+
})
|
|
591
|
+
]
|
|
592
|
+
})]
|
|
593
|
+
});
|
|
594
|
+
};
|
|
595
|
+
//#endregion
|
|
596
|
+
export { oe as DESCRIPTION_MAX_LENGTH, B as ScheduledTaskCard, U as ScheduledTaskCardGrid, H as ScheduledTaskCardSkeleton, fe as ScheduledTaskCreateForm, X as ScheduledTaskFrequency, Y as ScheduledTaskScheduleType, G as ScheduledTaskSection, R as ScheduledTaskSectionKey, J as ScheduledTasks, ae as ScheduledTasksSortKey };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ScheduledTaskCardStyles } from './scheduled-task-card-props';
|
|
2
|
+
import { ScheduledTaskCardSkeletonStyles } from './scheduled-task-card-skeleton-props';
|
|
3
|
+
import { ScheduledTaskItem } from './scheduled-task-item';
|
|
4
|
+
/** Localized labels for the {@link ScheduledTaskCardGrid} component's cards. All have English defaults. */
|
|
5
|
+
export interface ScheduledTaskCardGridLabels {
|
|
6
|
+
/** Label shown in a card's "new" badge. Defaults to `'NEW'`. */
|
|
7
|
+
newBadgeLabel?: string;
|
|
8
|
+
/** Accessible label for a card's overflow-menu trigger. Defaults to `'More actions'`. */
|
|
9
|
+
actionsLabel?: string;
|
|
10
|
+
/** Label for the "Edit" card menu action. Defaults to `'Edit'`. */
|
|
11
|
+
editActionLabel?: string;
|
|
12
|
+
/** Label for the "Run now" card menu action. Defaults to `'Run now'`. */
|
|
13
|
+
runNowActionLabel?: string;
|
|
14
|
+
/** Label for the "Delete" card menu action. Defaults to `'Delete'`. */
|
|
15
|
+
deleteActionLabel?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Props for the {@link ScheduledTaskCardGrid} component. */
|
|
18
|
+
export interface ScheduledTaskCardGridProps {
|
|
19
|
+
/** Items to render as cards, in display order. */
|
|
20
|
+
items: ScheduledTaskItem[];
|
|
21
|
+
/** Current search query — forwarded to each card to highlight the matching title substring. */
|
|
22
|
+
searchQuery?: string;
|
|
23
|
+
/** Called with a task id when the user activates "Edit" on a card. Omit to hide the action on every card. */
|
|
24
|
+
onEdit?: (id: string) => void;
|
|
25
|
+
/** Called with a task id when the user activates "Run now" on a card. Omit to hide the action on every card. */
|
|
26
|
+
onRunNow?: (id: string) => void;
|
|
27
|
+
/** Called with a task id when the user activates "Delete" on a card. Omit to hide the action on every card. */
|
|
28
|
+
onDelete?: (id: string) => void;
|
|
29
|
+
/** Localized labels forwarded to each card. */
|
|
30
|
+
labels?: ScheduledTaskCardGridLabels;
|
|
31
|
+
/** Style overrides forwarded to each card. */
|
|
32
|
+
cardStyles?: ScheduledTaskCardStyles;
|
|
33
|
+
/** Number of placeholder cards rendered after `items`, inside the same grid, so they continue filling the current row instead of starting a new one. */
|
|
34
|
+
trailingSkeletonCount?: number;
|
|
35
|
+
/** Style overrides forwarded to each trailing skeleton card. */
|
|
36
|
+
skeletonStyles?: ScheduledTaskCardSkeletonStyles;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=scheduled-task-card-grid-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduled-task-card-grid-props.d.ts","sourceRoot":"","sources":["../../src/models/scheduled-task-card-grid-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,2GAA2G;AAC3G,MAAM,WAAW,2BAA2B;IAC1C,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,6DAA6D;AAC7D,MAAM,WAAW,0BAA0B;IACzC,kDAAkD;IAClD,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,+FAA+F;IAC/F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6GAA6G;IAC7G,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,gHAAgH;IAChH,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,+GAA+G;IAC/G,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,+CAA+C;IAC/C,MAAM,CAAC,EAAE,2BAA2B,CAAC;IACrC,8CAA8C;IAC9C,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,wJAAwJ;IACxJ,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gEAAgE;IAChE,cAAc,CAAC,EAAE,+BAA+B,CAAC;CAClD"}
|