@epam/ai-dial-scheduled-tasks 1.1.0-dev.60 → 1.1.0-dev.62

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ScheduledTaskCreateForm.d.ts","sourceRoot":"","sources":["../../../src/components/ScheduledTaskCreateForm/ScheduledTaskCreateForm.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAuC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAgB7F;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,4BAA4B,CAqSpE,CAAC"}
1
+ {"version":3,"file":"ScheduledTaskCreateForm.d.ts","sourceRoot":"","sources":["../../../src/components/ScheduledTaskCreateForm/ScheduledTaskCreateForm.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAuC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AA2B7F;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,4BAA4B,CA8UpE,CAAC"}
package/index.js CHANGED
@@ -1,27 +1,27 @@
1
1
  import { PanelEmptyState as e, buildCssVars as t, mergeClasses as n } from "@epam/ai-dial-chat-shared";
2
2
  import { GhostButton as r, GhostIconButton as i, Input as a, NeutralButton as o, PrimaryButton as s, SearchBar as c, Textarea as l } from "@epam/ai-dial-kit";
3
- import { CardShell as u, DIAL_ICON_SIZE as d, DialDropdown as f, DialIconButton as p, DialSelectField as m, DialSpinner as h, FolderPath as g, Highlight as _, LazyDialMarkdownEditor as v } from "@epam/ai-dial-ui-kit";
4
- import { IconArrowLeft as y, IconArrowsSort as b, IconCalendarTime as x, IconCheck as S, IconChevronUp as C, IconDotsVertical as w, IconEdit as T, IconPlayerPlay as E, IconPlus as D, IconTrash as O } from "@tabler/icons-react";
5
- import { Suspense as k, lazy as A, useMemo as j } from "react";
6
- import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
3
+ import { Calendar as u, CalendarMode as d, CardShell as f, DIAL_ICON_SIZE as p, DialDropdown as m, DialIconButton as h, DialSelectField as g, DialSpinner as _, FolderPath as v, Highlight as y, LazyDialMarkdownEditor as b } from "@epam/ai-dial-ui-kit";
4
+ import { IconArrowLeft as x, IconArrowsSort as S, IconCalendarTime as C, IconCheck as w, IconChevronUp as T, IconDotsVertical as E, IconEdit as D, IconPlayerPlay as O, IconPlus as k, IconTrash as A } from "@tabler/icons-react";
5
+ import { Suspense as j, lazy as M, useMemo as N } from "react";
6
+ import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
7
7
  //#region src/models/scheduled-task-item.ts
8
- var F = /* @__PURE__ */ function(e) {
8
+ var L = /* @__PURE__ */ function(e) {
9
9
  return e.Shared = "shared", e.MyTasks = "myTasks", e;
10
- }({}), I = /* @__PURE__ */ function(e) {
10
+ }({}), R = /* @__PURE__ */ function(e) {
11
11
  return e.FirstToRun = "firstToRun", e.LastToRun = "lastToRun", e.Newest = "newest", e.NameAZ = "nameAZ", e;
12
- }({}), L = (e, t) => {
12
+ }({}), z = (e, t) => {
13
13
  let n = t.trim().toLowerCase();
14
14
  return n ? e.filter((e) => e.displayName.toLowerCase().includes(n) || e.descriptionPreview?.toLowerCase().includes(n)) : e;
15
- }, R = (e, t, n) => e == null && t == null ? 0 : e == null ? 1 : t == null ? -1 : n * (new Date(e).getTime() - new Date(t).getTime()), z = (e, t) => {
15
+ }, B = (e, t, n) => e == null && t == null ? 0 : e == null ? 1 : t == null ? -1 : n * (new Date(e).getTime() - new Date(t).getTime()), V = (e, t) => {
16
16
  let n = [...e];
17
17
  switch (t) {
18
- case I.FirstToRun: return n.sort((e, t) => R(e.sortValues.nextRunAt, t.sortValues.nextRunAt, 1));
19
- case I.LastToRun: return n.sort((e, t) => R(e.sortValues.nextRunAt, t.sortValues.nextRunAt, -1));
20
- case I.Newest: return n.sort((e, t) => R(e.sortValues.createdAt, t.sortValues.createdAt, -1));
21
- case I.NameAZ: return n.sort((e, t) => e.displayName.localeCompare(t.displayName));
18
+ case R.FirstToRun: return n.sort((e, t) => B(e.sortValues.nextRunAt, t.sortValues.nextRunAt, 1));
19
+ case R.LastToRun: return n.sort((e, t) => B(e.sortValues.nextRunAt, t.sortValues.nextRunAt, -1));
20
+ case R.Newest: return n.sort((e, t) => B(e.sortValues.createdAt, t.sortValues.createdAt, -1));
21
+ case R.NameAZ: return n.sort((e, t) => e.displayName.localeCompare(t.displayName));
22
22
  default: return n;
23
23
  }
24
- }, B = {
24
+ }, H = {
25
25
  title: "_title_11p38_1",
26
26
  description: "_description_11p38_5",
27
27
  schedulePill: "_schedulePill_11p38_9",
@@ -29,8 +29,8 @@ var F = /* @__PURE__ */ function(e) {
29
29
  locationLabel: "_locationLabel_11p38_18",
30
30
  locationLeaf: "_locationLeaf_11p38_22",
31
31
  newBadge: "_newBadge_11p38_26"
32
- }, V = ({ item: e, searchQuery: r = "", onEdit: i, onRunNow: a, onDelete: o, labels: s, styles: c, className: l }) => {
33
- let m = s?.newBadgeLabel ?? "NEW", h = s?.actionsLabel ?? "More actions", v = s?.editActionLabel ?? "Edit", y = s?.runNowActionLabel ?? "Run now", b = s?.deleteActionLabel ?? "Delete", { colors: x, typography: S } = c ?? {}, C = S?.titleClassName ?? "dial-body-semi-text", D = S?.descriptionClassName ?? "dial-small-text", k = S?.scheduleLabelClassName ?? "dial-tiny-text", A = S?.locationLabelClassName ?? "dial-tiny-text", j = S?.locationLeafClassName ?? "dial-tiny-semi-text", M = S?.newBadgeClassName ?? "dial-tiny-semi-text", F = t({
32
+ }, U = ({ item: e, searchQuery: r = "", onEdit: i, onRunNow: a, onDelete: o, labels: s, styles: c, className: l }) => {
33
+ let u = s?.newBadgeLabel ?? "NEW", d = s?.actionsLabel ?? "More actions", g = s?.editActionLabel ?? "Edit", _ = s?.runNowActionLabel ?? "Run now", b = s?.deleteActionLabel ?? "Delete", { colors: x, typography: S } = c ?? {}, C = S?.titleClassName ?? "dial-body-semi-text", w = S?.descriptionClassName ?? "dial-small-text", T = S?.scheduleLabelClassName ?? "dial-tiny-text", k = S?.locationLabelClassName ?? "dial-tiny-text", j = S?.locationLeafClassName ?? "dial-tiny-semi-text", M = S?.newBadgeClassName ?? "dial-tiny-semi-text", N = t({
34
34
  "--stc-title-text": x?.titleText,
35
35
  "--stc-desc-text": x?.descriptionText,
36
36
  "--stc-pill-bg": x?.schedulePillBackground,
@@ -40,89 +40,89 @@ var F = /* @__PURE__ */ function(e) {
40
40
  "--stc-location-leaf-text": x?.locationLeafText,
41
41
  "--stc-new-badge-bg": x?.newBadgeBackground,
42
42
  "--stc-new-badge-text": x?.newBadgeText
43
- }), I = [];
44
- return i && I.push({
43
+ }), P = [];
44
+ return i && P.push({
45
45
  key: "edit",
46
- label: v,
47
- icon: /* @__PURE__ */ N(T, {
48
- size: d.SM,
46
+ label: g,
47
+ icon: /* @__PURE__ */ F(D, {
48
+ size: p.SM,
49
49
  "aria-hidden": !0
50
50
  }),
51
51
  onClick: () => i(e.id)
52
- }), a && I.push({
52
+ }), a && P.push({
53
53
  key: "runNow",
54
- label: y,
55
- icon: /* @__PURE__ */ N(E, {
56
- size: d.SM,
54
+ label: _,
55
+ icon: /* @__PURE__ */ F(O, {
56
+ size: p.SM,
57
57
  "aria-hidden": !0
58
58
  }),
59
59
  onClick: () => a(e.id)
60
- }), o && I.push({
60
+ }), o && P.push({
61
61
  key: "delete",
62
62
  label: b,
63
- icon: /* @__PURE__ */ N(O, {
64
- size: d.SM,
63
+ icon: /* @__PURE__ */ F(A, {
64
+ size: p.SM,
65
65
  "aria-hidden": !0
66
66
  }),
67
67
  danger: !0,
68
68
  onClick: () => o(e.id)
69
- }), /* @__PURE__ */ P(u, {
69
+ }), /* @__PURE__ */ I(f, {
70
70
  role: "group",
71
71
  "aria-label": e.displayName,
72
- style: F,
72
+ style: N,
73
73
  className: n("h-[232px]", l),
74
74
  children: [
75
- /* @__PURE__ */ P("div", {
75
+ /* @__PURE__ */ I("div", {
76
76
  className: "flex shrink-0 items-start justify-between gap-2",
77
- children: [/* @__PURE__ */ P("div", {
77
+ children: [/* @__PURE__ */ I("div", {
78
78
  className: "flex min-w-0 flex-1 items-center gap-2",
79
- children: [/* @__PURE__ */ N(_, {
79
+ children: [/* @__PURE__ */ F(y, {
80
80
  text: e.displayName,
81
81
  query: r,
82
82
  maxLines: 1,
83
- className: n(C, B.title)
84
- }), e.isNew && /* @__PURE__ */ N("span", {
85
- className: n("shrink-0 rounded-full px-2 py-0.5", M, B.newBadge),
86
- children: m
83
+ className: n(C, H.title)
84
+ }), e.isNew && /* @__PURE__ */ F("span", {
85
+ className: n("shrink-0 rounded-full px-2 py-0.5", M, H.newBadge),
86
+ children: u
87
87
  })]
88
- }), I.length > 0 && /* @__PURE__ */ N(f, {
89
- items: I,
88
+ }), P.length > 0 && /* @__PURE__ */ F(m, {
89
+ items: P,
90
90
  matchReferenceWidth: !1,
91
91
  placement: "bottom-end",
92
- children: /* @__PURE__ */ N(p, {
93
- icon: /* @__PURE__ */ N(w, {
94
- size: d.SM,
92
+ children: /* @__PURE__ */ F(h, {
93
+ icon: /* @__PURE__ */ F(E, {
94
+ size: p.SM,
95
95
  "aria-hidden": !0
96
96
  }),
97
- "aria-label": h,
97
+ "aria-label": d,
98
98
  className: "shrink-0"
99
99
  })
100
100
  })]
101
101
  }),
102
- e.descriptionPreview && /* @__PURE__ */ N("p", {
103
- className: n("line-clamp-4 min-h-0 flex-1 overflow-hidden !leading-[22px]", D, B.description),
102
+ e.descriptionPreview && /* @__PURE__ */ F("p", {
103
+ className: n("line-clamp-4 min-h-0 flex-1 overflow-hidden !leading-[22px]", w, H.description),
104
104
  children: e.descriptionPreview
105
105
  }),
106
- /* @__PURE__ */ P("div", {
106
+ /* @__PURE__ */ I("div", {
107
107
  className: "mt-auto flex shrink-0 flex-col gap-3",
108
- children: [/* @__PURE__ */ N("div", {
108
+ children: [/* @__PURE__ */ F("div", {
109
109
  className: "flex min-h-[28px] items-center",
110
- children: /* @__PURE__ */ N("span", {
111
- className: n("inline-block rounded-lg border px-2 py-1", B.schedulePill, k, B.scheduleLabel),
110
+ children: /* @__PURE__ */ F("span", {
111
+ className: n("inline-block rounded-lg border px-2 py-1", H.schedulePill, T, H.scheduleLabel),
112
112
  children: e.scheduleLabel
113
113
  })
114
- }), e.locationSegments && e.locationSegments.length > 0 && /* @__PURE__ */ N(g, {
114
+ }), e.locationSegments && e.locationSegments.length > 0 && /* @__PURE__ */ F(v, {
115
115
  segments: e.locationSegments,
116
- labelClassName: n(A, B.locationLabel),
117
- leafClassName: n(j, B.locationLeaf),
116
+ labelClassName: n(k, H.locationLabel),
117
+ leafClassName: n(j, H.locationLeaf),
118
118
  className: "border-t border-tertiary pt-3"
119
119
  })]
120
120
  })
121
121
  ]
122
122
  });
123
- }, H = ({ items: e, searchQuery: t, onEdit: n, onRunNow: r, onDelete: i, labels: a, cardStyles: o }) => /* @__PURE__ */ N("div", {
123
+ }, W = ({ items: e, searchQuery: t, onEdit: n, onRunNow: r, onDelete: i, labels: a, cardStyles: o }) => /* @__PURE__ */ F("div", {
124
124
  className: "grid grid-cols-1 gap-5 desktop:grid-cols-3",
125
- children: e.map((e) => /* @__PURE__ */ N(V, {
125
+ children: e.map((e) => /* @__PURE__ */ F(U, {
126
126
  item: e,
127
127
  searchQuery: t,
128
128
  onEdit: n,
@@ -131,112 +131,112 @@ var F = /* @__PURE__ */ function(e) {
131
131
  labels: a,
132
132
  styles: o
133
133
  }, e.id))
134
- }), U = { countBadge: "_countBadge_2z537_1" }, W = ({ title: e, count: r, children: i, styles: a }) => {
134
+ }), G = { countBadge: "_countBadge_2z537_1" }, K = ({ title: e, count: r, children: i, styles: a }) => {
135
135
  let o = a?.typography?.titleClassName ?? "dial-small-semi-text", s = a?.typography?.countBadgeClassName ?? "dial-tiny-text", c = t({
136
136
  "--sts-badge-bg": a?.colors?.countBadgeBackground,
137
137
  "--sts-badge-text": a?.colors?.countBadgeText
138
138
  });
139
- return /* @__PURE__ */ P("section", {
139
+ return /* @__PURE__ */ I("section", {
140
140
  ...e ? { "aria-label": e } : {},
141
141
  style: c,
142
142
  className: "flex flex-col gap-3",
143
- children: [e && /* @__PURE__ */ P("div", {
143
+ children: [e && /* @__PURE__ */ I("div", {
144
144
  className: "flex items-center gap-2 rtl:flex-row-reverse",
145
- children: [/* @__PURE__ */ N("h2", {
145
+ children: [/* @__PURE__ */ F("h2", {
146
146
  className: o,
147
147
  children: e
148
- }), /* @__PURE__ */ N("span", {
149
- className: n("rounded-full px-2 py-0.5", s, U.countBadge),
148
+ }), /* @__PURE__ */ F("span", {
149
+ className: n("rounded-full px-2 py-0.5", s, G.countBadge),
150
150
  children: r
151
151
  })]
152
152
  }), i]
153
153
  });
154
- }, G = {
154
+ }, q = {
155
155
  container: "_container_7rg40_1",
156
156
  subtitle: "_subtitle_7rg40_5",
157
157
  sortButton: "_sortButton_7rg40_9"
158
- }, K = [F.Shared, F.MyTasks], q = (e, t, n, r, i) => {
158
+ }, ee = [L.Shared, L.MyTasks], te = (e, t, n, r, i) => {
159
159
  if (!e) return t ? i.errorLabel : n === 0 ? i.emptyStateLabel : r === 0 ? i.noResultsLabel : `${r}`;
160
- }, J = ({ labels: i, onCreateClick: a, searchQuery: o, onSearchQueryChange: l, sortKey: u, onSortChange: p, items: m, isLoading: g = !1, error: _, onRetry: v, onEdit: y, onRunNow: w, onDelete: T, styles: E }) => {
161
- let { colors: O, typography: k, emptyStateIconSize: A = 48 } = E ?? {}, M = k?.titleClassName ?? "dial-h1-text", I = k?.subtitleClassName ?? "dial-body-text", R = t({
162
- "--st-bg": O?.background,
163
- "--st-subtitle-text": O?.subtitleText,
164
- "--st-sort-text": O?.sortButtonText
165
- }), B = i.sortOptions.find((e) => e.key === u)?.label ?? "", V = j(() => z(L(m, o), u), [
166
- m,
160
+ }, J = ({ labels: i, onCreateClick: a, searchQuery: o, onSearchQueryChange: l, sortKey: u, onSortChange: d, items: f, isLoading: h = !1, error: g, onRetry: v, onEdit: y, onRunNow: b, onDelete: x, styles: E }) => {
161
+ let { colors: D, typography: O, emptyStateIconSize: A = 48 } = E ?? {}, j = O?.titleClassName ?? "dial-h1-text", M = O?.subtitleClassName ?? "dial-body-text", P = t({
162
+ "--st-bg": D?.background,
163
+ "--st-subtitle-text": D?.subtitleText,
164
+ "--st-sort-text": D?.sortButtonText
165
+ }), R = i.sortOptions.find((e) => e.key === u)?.label ?? "", B = N(() => V(z(f, o), u), [
166
+ f,
167
167
  o,
168
168
  u
169
- ]), U = j(() => {
170
- let e = { [F.Shared]: i.sharedSectionTitle };
171
- return K.map((t) => ({
169
+ ]), H = N(() => {
170
+ let e = { [L.Shared]: i.sharedSectionTitle };
171
+ return ee.map((t) => ({
172
172
  key: t,
173
173
  title: e[t],
174
- items: V.filter((e) => e.sectionKey === t)
174
+ items: B.filter((e) => e.sectionKey === t)
175
175
  })).filter((e) => e.items.length > 0);
176
- }, [V, i.sharedSectionTitle]), J = q(g, !!_, m.length, V.length, i), Y = () => g ? /* @__PURE__ */ N(h, {}) : _ ? /* @__PURE__ */ P("div", {
176
+ }, [B, i.sharedSectionTitle]), U = te(h, !!g, f.length, B.length, i), G = () => h ? /* @__PURE__ */ F(_, {}) : g ? /* @__PURE__ */ I("div", {
177
177
  className: "flex flex-col items-center gap-3",
178
- children: [/* @__PURE__ */ N("p", {
179
- className: n(I, G.subtitle),
178
+ children: [/* @__PURE__ */ F("p", {
179
+ className: n(M, q.subtitle),
180
180
  children: i.errorLabel
181
- }), /* @__PURE__ */ N(r, {
181
+ }), /* @__PURE__ */ F(r, {
182
182
  label: i.retryLabel,
183
183
  onClick: v
184
184
  })]
185
- }) : m.length === 0 ? /* @__PURE__ */ N(e, {
186
- icon: /* @__PURE__ */ N(x, {
185
+ }) : f.length === 0 ? /* @__PURE__ */ F(e, {
186
+ icon: /* @__PURE__ */ F(C, {
187
187
  "aria-hidden": !0,
188
188
  size: A,
189
189
  stroke: 1
190
190
  }),
191
191
  label: i.emptyStateLabel
192
- }) : V.length === 0 ? /* @__PURE__ */ N("p", {
193
- className: n(I, G.subtitle),
192
+ }) : B.length === 0 ? /* @__PURE__ */ F("p", {
193
+ className: n(M, q.subtitle),
194
194
  children: i.noResultsLabel
195
- }) : /* @__PURE__ */ N("div", {
195
+ }) : /* @__PURE__ */ F("div", {
196
196
  className: "flex w-full flex-col gap-6",
197
- children: U.map((e) => /* @__PURE__ */ N(W, {
197
+ children: H.map((e) => /* @__PURE__ */ F(K, {
198
198
  title: e.title,
199
199
  count: e.items.length,
200
- children: /* @__PURE__ */ N(H, {
200
+ children: /* @__PURE__ */ F(W, {
201
201
  items: e.items,
202
202
  searchQuery: o,
203
203
  onEdit: y,
204
- onRunNow: w,
205
- onDelete: T,
204
+ onRunNow: b,
205
+ onDelete: x,
206
206
  labels: i.cardLabels
207
207
  })
208
208
  }, e.key))
209
- }), X = g || !!_ || m.length === 0 || V.length === 0;
210
- return /* @__PURE__ */ P("div", {
211
- style: R,
212
- className: n("flex h-full w-full flex-col gap-6 overflow-y-auto px-8 py-4", G.container),
209
+ }), J = h || !!g || f.length === 0 || B.length === 0;
210
+ return /* @__PURE__ */ I("div", {
211
+ style: P,
212
+ className: n("flex h-full w-full flex-col gap-6 overflow-y-auto px-8 py-4", q.container),
213
213
  children: [
214
- /* @__PURE__ */ P("div", {
214
+ /* @__PURE__ */ I("div", {
215
215
  className: "flex items-start justify-between gap-4",
216
- children: [/* @__PURE__ */ P("div", {
216
+ children: [/* @__PURE__ */ I("div", {
217
217
  className: "min-w-0 gap-2",
218
- children: [/* @__PURE__ */ N("h1", {
219
- className: n("truncate", M),
218
+ children: [/* @__PURE__ */ F("h1", {
219
+ className: n("truncate", j),
220
220
  children: i.title
221
- }), /* @__PURE__ */ N("p", {
222
- className: n("mt-1", I, G.subtitle),
221
+ }), /* @__PURE__ */ F("p", {
222
+ className: n("mt-1", M, q.subtitle),
223
223
  children: i.subtitle
224
224
  })]
225
- }), /* @__PURE__ */ N(s, {
225
+ }), /* @__PURE__ */ F(s, {
226
226
  label: i.createButtonLabel,
227
- iconBefore: /* @__PURE__ */ N(D, {
228
- size: d.SM,
227
+ iconBefore: /* @__PURE__ */ F(k, {
228
+ size: p.SM,
229
229
  "aria-hidden": !0
230
230
  }),
231
231
  onClick: a,
232
232
  className: "shrink-0"
233
233
  })]
234
234
  }),
235
- /* @__PURE__ */ P("div", {
235
+ /* @__PURE__ */ I("div", {
236
236
  className: "flex flex-wrap items-center gap-3",
237
- children: [/* @__PURE__ */ N("div", {
237
+ children: [/* @__PURE__ */ F("div", {
238
238
  className: "flex-1",
239
- children: /* @__PURE__ */ N(c, {
239
+ children: /* @__PURE__ */ F(c, {
240
240
  value: o,
241
241
  onChange: l,
242
242
  labels: {
@@ -252,121 +252,131 @@ var F = /* @__PURE__ */ function(e) {
252
252
  clearButtonClassName: "size-11 desktop:size-auto"
253
253
  }
254
254
  })
255
- }), i.sortOptions.length > 0 && /* @__PURE__ */ N(f, {
255
+ }), i.sortOptions.length > 0 && /* @__PURE__ */ F(m, {
256
256
  matchReferenceWidth: !1,
257
257
  placement: "bottom-end",
258
258
  listClassName: "cp-dropdown-overlay",
259
259
  items: i.sortOptions.map((e) => ({
260
260
  key: e.key,
261
- label: /* @__PURE__ */ P("span", {
261
+ label: /* @__PURE__ */ I("span", {
262
262
  className: "flex w-full items-center justify-between gap-2",
263
- children: [e.label, e.key === u && /* @__PURE__ */ N(S, {
264
- size: d.SM,
263
+ children: [e.label, e.key === u && /* @__PURE__ */ F(w, {
264
+ size: p.SM,
265
265
  "aria-hidden": !0
266
266
  })]
267
267
  }),
268
- onClick: () => p(e.key)
268
+ onClick: () => d(e.key)
269
269
  })),
270
- children: /* @__PURE__ */ N(r, {
271
- label: B,
270
+ children: /* @__PURE__ */ F(r, {
271
+ label: R,
272
272
  "aria-label": i.sortLabel,
273
- className: n("rounded-[4px]", G.sortButton),
274
- iconBefore: /* @__PURE__ */ N(b, {
273
+ className: n("rounded-[4px]", q.sortButton),
274
+ iconBefore: /* @__PURE__ */ F(S, {
275
275
  size: 20,
276
276
  "aria-hidden": !0
277
277
  }),
278
- iconAfter: /* @__PURE__ */ N(C, {
278
+ iconAfter: /* @__PURE__ */ F(T, {
279
279
  size: 20,
280
280
  "aria-hidden": !0
281
281
  })
282
282
  })
283
283
  })]
284
284
  }),
285
- /* @__PURE__ */ N("span", {
285
+ /* @__PURE__ */ F("span", {
286
286
  role: "status",
287
287
  "aria-live": "polite",
288
288
  className: "sr-only",
289
- children: J
289
+ children: U
290
290
  }),
291
- /* @__PURE__ */ N("div", {
292
- className: n("mx-auto flex size-full w-full max-w-[1180px] flex-col", X && "items-center justify-center"),
293
- children: Y()
291
+ /* @__PURE__ */ F("div", {
292
+ className: n("mx-auto flex size-full w-full max-w-[1180px] flex-col", J && "items-center justify-center"),
293
+ children: G()
294
294
  })
295
295
  ]
296
296
  });
297
- }, Y = 500, X = /* @__PURE__ */ function(e) {
297
+ }, ne = 500, Y = /* @__PURE__ */ function(e) {
298
298
  return e.Once = "once", e.Recurring = "recurring", e;
299
- }({}), Z = /* @__PURE__ */ function(e) {
299
+ }({}), X = /* @__PURE__ */ function(e) {
300
300
  return e.Daily = "daily", e.Weekly = "weekly", e.Monthly = "monthly", e;
301
- }({}), Q = {
301
+ }({}), Z = (e) => String(e).padStart(2, "0"), re = (e) => e ? new Date(e) : null, ie = (e) => {
302
+ if (e == null) return "";
303
+ let t = e instanceof Date ? e : new Date(e);
304
+ return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${Z(t.getMonth() + 1)}-${Z(t.getDate())}T${Z(t.getHours())}:${Z(t.getMinutes())}`;
305
+ }, ae = (e) => {
306
+ let t = Number(e);
307
+ return e && Number.isFinite(t) ? String(t + 1) : null;
308
+ }, oe = (e) => {
309
+ let t = typeof e == "string" ? Number(e) : NaN;
310
+ return Number.isFinite(t) ? String(t - 1) : "";
311
+ }, Q = {
302
312
  container: "_container_gdwv3_1",
303
313
  header: "_header_gdwv3_5",
304
314
  detailsColumn: "_detailsColumn_gdwv3_9",
305
315
  sectionSubtitle: "_sectionSubtitle_gdwv3_13",
306
316
  instructionsError: "_instructionsError_gdwv3_17"
307
- }, $ = A(async () => ({ default: (await v()).DialMarkdownEditor })), ee = ({ labels: e, values: r, errors: c, modelOptions: u, onFieldChange: f, onBack: p, onCancel: g, onSubmit: _, isSubmitting: v = !1, markdownEditorTheme: b, styles: x }) => {
308
- let { colors: S, typography: C } = x ?? {}, w = C?.titleClassName ?? "dial-h1-text", T = C?.sectionTitleClassName ?? "dial-body-semi-text", E = C?.sectionSubtitleClassName ?? "dial-tiny-text", D = C?.scheduleSectionLabelClassName ?? "dial-body-semi-text mb-1", O = C?.instructionsErrorClassName ?? "dial-small-text", A = t({
309
- "--stcf-bg": S?.background,
310
- "--stcf-header-border": S?.headerBorder,
311
- "--stcf-details-border": S?.detailsColumnBorder,
312
- "--stcf-subtitle-text": S?.sectionSubtitleText,
313
- "--stcf-error-text": S?.instructionsErrorText
314
- }), j = v || !r.displayName.trim() || !r.modelId || !r.prompt.trim();
315
- return /* @__PURE__ */ P("div", {
316
- style: A,
317
+ }, $ = (e) => `${e} *`, se = M(async () => ({ default: (await b()).DialMarkdownEditor })), ce = ({ labels: e, values: r, errors: c, modelOptions: f, onFieldChange: m, onBack: h, onCancel: v, onSubmit: y, isSubmitting: b = !1, markdownEditorTheme: S, styles: C }) => {
318
+ let { colors: w, typography: T } = C ?? {}, 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", M = t({
319
+ "--stcf-bg": w?.background,
320
+ "--stcf-header-border": w?.headerBorder,
321
+ "--stcf-details-border": w?.detailsColumnBorder,
322
+ "--stcf-subtitle-text": w?.sectionSubtitleText,
323
+ "--stcf-error-text": w?.instructionsErrorText
324
+ }), N = b || !r.displayName.trim() || !r.modelId || !r.prompt.trim();
325
+ return /* @__PURE__ */ I("div", {
326
+ style: M,
317
327
  className: n("flex h-full w-full flex-col overflow-y-auto", Q.container),
318
- children: [/* @__PURE__ */ P("div", {
328
+ children: [/* @__PURE__ */ I("div", {
319
329
  className: n("flex h-16 items-center justify-between gap-6 border-b px-8", Q.header),
320
- children: [/* @__PURE__ */ P("div", {
330
+ children: [/* @__PURE__ */ I("div", {
321
331
  className: "flex min-w-0 flex-1 items-center gap-2",
322
- children: [/* @__PURE__ */ N(i, {
323
- icon: /* @__PURE__ */ N(y, {
324
- size: d.LG,
332
+ children: [/* @__PURE__ */ F(i, {
333
+ icon: /* @__PURE__ */ F(x, {
334
+ size: p.LG,
325
335
  className: "rtl:scale-x-[-1]",
326
336
  "aria-hidden": !0
327
337
  }),
328
338
  "aria-label": e.backButtonLabel,
329
- onClick: p
330
- }), /* @__PURE__ */ N("h1", {
331
- className: n("truncate", w),
339
+ onClick: h
340
+ }), /* @__PURE__ */ F("h1", {
341
+ className: n("truncate", E),
332
342
  children: e.pageTitle
333
343
  })]
334
- }), /* @__PURE__ */ P("div", {
344
+ }), /* @__PURE__ */ I("div", {
335
345
  className: "flex items-center gap-2",
336
- children: [/* @__PURE__ */ N(o, {
346
+ children: [/* @__PURE__ */ F(o, {
337
347
  type: "button",
338
348
  label: e.cancelButtonLabel,
339
- onClick: g,
340
- disabled: v
341
- }), /* @__PURE__ */ N(s, {
349
+ onClick: v,
350
+ disabled: b
351
+ }), /* @__PURE__ */ F(s, {
342
352
  type: "button",
343
353
  label: e.createButtonLabel,
344
- onClick: _,
345
- disabled: j
354
+ onClick: y,
355
+ disabled: N
346
356
  })]
347
357
  })]
348
- }), /* @__PURE__ */ P("div", {
358
+ }), /* @__PURE__ */ I("div", {
349
359
  className: "flex flex-1 flex-col desktop:flex-row",
350
360
  children: [
351
- /* @__PURE__ */ P("div", {
361
+ /* @__PURE__ */ I("div", {
352
362
  role: "group",
353
363
  "aria-label": e.detailsSectionTitle,
354
364
  className: n("flex w-full flex-col gap-5 border-e px-8 py-6 desktop:w-[360px] desktop:shrink-0", Q.detailsColumn),
355
365
  children: [
356
- /* @__PURE__ */ P("div", {
366
+ /* @__PURE__ */ I("div", {
357
367
  className: "flex flex-col gap-1",
358
- children: [/* @__PURE__ */ N("h2", {
359
- className: T,
368
+ children: [/* @__PURE__ */ F("h2", {
369
+ className: D,
360
370
  children: e.detailsSectionTitle
361
- }), /* @__PURE__ */ N("p", {
362
- className: n(E, Q.sectionSubtitle),
371
+ }), /* @__PURE__ */ F("p", {
372
+ className: n(O, Q.sectionSubtitle),
363
373
  children: e.detailsSectionSubtitle
364
374
  })]
365
375
  }),
366
- /* @__PURE__ */ N(a, {
376
+ /* @__PURE__ */ F(a, {
367
377
  id: "scheduled-task-display-name",
368
378
  value: r.displayName,
369
- onChange: (e) => f("displayName", e ?? ""),
379
+ onChange: (e) => m("displayName", e ?? ""),
370
380
  labelProps: {
371
381
  label: e.displayNameLabel,
372
382
  required: !0
@@ -374,96 +384,103 @@ var F = /* @__PURE__ */ function(e) {
374
384
  invalid: !!c.displayName,
375
385
  error: c.displayName
376
386
  }),
377
- /* @__PURE__ */ N(l, {
387
+ /* @__PURE__ */ F(l, {
378
388
  id: "scheduled-task-description",
379
389
  value: r.description ?? "",
380
- onChange: (e) => f("description", e),
390
+ onChange: (e) => m("description", e),
381
391
  labelProps: { label: e.descriptionLabel },
382
392
  maxLength: 500,
383
393
  invalid: !!c.description,
384
394
  error: c.description,
385
395
  caption: r.description ? `${r.description.length}/500` : void 0
386
396
  }),
387
- /* @__PURE__ */ N(m, {
397
+ /* @__PURE__ */ F(g, {
388
398
  label: e.modelOrAgentLabel,
389
399
  required: !0,
390
400
  value: r.modelId,
391
401
  placeholder: e.modelPlaceholder,
392
- onChange: (e) => f("modelId", e),
402
+ onChange: (e) => m("modelId", e),
393
403
  error: c.modelId,
394
- options: u.map((e) => ({
404
+ options: f.map((e) => ({
395
405
  value: e.id,
396
406
  label: e.label
397
407
  }))
398
408
  }),
399
- /* @__PURE__ */ P("fieldset", {
409
+ /* @__PURE__ */ I("fieldset", {
400
410
  className: "flex flex-col gap-3",
401
411
  children: [
402
- /* @__PURE__ */ N("legend", {
403
- className: D,
412
+ /* @__PURE__ */ F("legend", {
413
+ className: k,
404
414
  children: e.scheduleSectionLabel
405
415
  }),
406
- /* @__PURE__ */ N(m, {
416
+ /* @__PURE__ */ F(g, {
407
417
  label: e.scheduleTypeAriaLabel,
408
418
  value: r.scheduleType,
409
- onChange: (e) => f("scheduleType", e),
419
+ onChange: (e) => m("scheduleType", e),
410
420
  options: [{
411
- value: X.Once,
421
+ value: Y.Once,
412
422
  label: e.scheduleTypeOnceLabel
413
423
  }, {
414
- value: X.Recurring,
424
+ value: Y.Recurring,
415
425
  label: e.scheduleTypeRecurringLabel
416
426
  }]
417
427
  }),
418
- r.scheduleType === X.Once && /* @__PURE__ */ N(a, {
419
- id: "scheduled-task-run-at",
420
- type: "datetime-local",
421
- value: r.runAt ?? "",
422
- onChange: (e) => f("runAt", e ?? ""),
423
- labelProps: {
424
- label: e.runAtLabel,
425
- required: !0
426
- },
427
- invalid: !!c.runAt,
428
- error: c.runAt
428
+ r.scheduleType === Y.Once && /* @__PURE__ */ I("div", {
429
+ className: "flex flex-col gap-1",
430
+ children: [/* @__PURE__ */ F(u, {
431
+ id: "scheduled-task-run-at",
432
+ mode: d.DateTime,
433
+ value: re(r.runAt),
434
+ onChange: (e) => m("runAt", ie(e)),
435
+ label: $(e.runAtLabel),
436
+ invalid: !!c.runAt
437
+ }), c.runAt && /* @__PURE__ */ F("p", {
438
+ className: n(A, Q.instructionsError),
439
+ children: c.runAt
440
+ })]
429
441
  }),
430
- r.scheduleType === X.Recurring && /* @__PURE__ */ P(M, { children: [
431
- /* @__PURE__ */ N(m, {
442
+ r.scheduleType === Y.Recurring && /* @__PURE__ */ I(P, { children: [
443
+ /* @__PURE__ */ F(g, {
432
444
  label: e.frequencyLabel,
433
445
  value: r.frequency,
434
- onChange: (e) => f("frequency", e),
446
+ onChange: (e) => m("frequency", e),
435
447
  options: e.frequencyOptions.map((e) => ({
436
448
  value: e.key,
437
449
  label: e.label
438
450
  }))
439
451
  }),
440
- /* @__PURE__ */ N(a, {
441
- id: "scheduled-task-time",
442
- type: "time",
443
- value: r.time,
444
- onChange: (e) => f("time", e ?? ""),
445
- labelProps: {
446
- label: e.timeLabel,
447
- required: !0
448
- },
449
- invalid: !!c.time,
450
- error: c.time
452
+ /* @__PURE__ */ I("div", {
453
+ className: "flex flex-col gap-1",
454
+ children: [/* @__PURE__ */ F(u, {
455
+ id: "scheduled-task-time",
456
+ mode: d.Time,
457
+ value: r.time,
458
+ onChange: (e) => m("time", typeof e == "string" ? e : ""),
459
+ label: $(e.timeLabel),
460
+ invalid: !!c.time
461
+ }), c.time && /* @__PURE__ */ F("p", {
462
+ className: n(A, Q.instructionsError),
463
+ children: c.time
464
+ })]
451
465
  }),
452
- r.frequency === Z.Weekly && /* @__PURE__ */ N(a, {
453
- id: "scheduled-task-day-of-week",
454
- value: r.dayOfWeek ?? "",
455
- onChange: (e) => f("dayOfWeek", e ?? ""),
456
- labelProps: {
457
- label: e.dayOfWeekLabel,
458
- required: !0
459
- },
460
- invalid: !!c.dayOfWeek,
461
- error: c.dayOfWeek
466
+ r.frequency === X.Weekly && /* @__PURE__ */ I("div", {
467
+ className: "flex flex-col gap-1",
468
+ children: [/* @__PURE__ */ F(u, {
469
+ id: "scheduled-task-day-of-week",
470
+ mode: d.Weekday,
471
+ value: ae(r.dayOfWeek),
472
+ onChange: (e) => m("dayOfWeek", oe(e)),
473
+ label: $(e.dayOfWeekLabel),
474
+ invalid: !!c.dayOfWeek
475
+ }), c.dayOfWeek && /* @__PURE__ */ F("p", {
476
+ className: n(A, Q.instructionsError),
477
+ children: c.dayOfWeek
478
+ })]
462
479
  }),
463
- r.frequency === Z.Monthly && /* @__PURE__ */ N(a, {
480
+ r.frequency === X.Monthly && /* @__PURE__ */ F(a, {
464
481
  id: "scheduled-task-day-of-month",
465
482
  value: r.dayOfMonth ?? "",
466
- onChange: (e) => f("dayOfMonth", e ?? ""),
483
+ onChange: (e) => m("dayOfMonth", e ?? ""),
467
484
  labelProps: {
468
485
  label: e.dayOfMonthLabel,
469
486
  required: !0
@@ -476,45 +493,45 @@ var F = /* @__PURE__ */ function(e) {
476
493
  })
477
494
  ]
478
495
  }),
479
- /* @__PURE__ */ P("div", {
496
+ /* @__PURE__ */ I("div", {
480
497
  role: "group",
481
498
  "aria-label": e.configurationSectionTitle,
482
499
  className: "flex w-full min-w-0 flex-1 flex-col gap-5 px-8 py-6",
483
- children: [/* @__PURE__ */ P("div", {
500
+ children: [/* @__PURE__ */ I("div", {
484
501
  className: "flex flex-col gap-1",
485
- children: [/* @__PURE__ */ N("h2", {
486
- className: T,
502
+ children: [/* @__PURE__ */ F("h2", {
503
+ className: D,
487
504
  children: e.configurationSectionTitle
488
- }), /* @__PURE__ */ N("p", {
489
- className: n(E, Q.sectionSubtitle),
505
+ }), /* @__PURE__ */ F("p", {
506
+ className: n(O, Q.sectionSubtitle),
490
507
  children: e.configurationSectionSubtitle
491
508
  })]
492
- }), /* @__PURE__ */ P("div", {
509
+ }), /* @__PURE__ */ I("div", {
493
510
  role: "group",
494
511
  "aria-label": e.instructionsLabel,
495
512
  className: "flex flex-1 flex-col gap-1",
496
513
  children: [
497
- /* @__PURE__ */ N("span", {
498
- className: D,
514
+ /* @__PURE__ */ F("span", {
515
+ className: k,
499
516
  children: e.instructionsLabel
500
517
  }),
501
- /* @__PURE__ */ N(k, {
502
- fallback: /* @__PURE__ */ N(h, {}),
503
- children: /* @__PURE__ */ N($, {
518
+ /* @__PURE__ */ F(j, {
519
+ fallback: /* @__PURE__ */ F(_, {}),
520
+ children: /* @__PURE__ */ F(se, {
504
521
  value: r.prompt,
505
- onChange: (e) => f("prompt", e),
522
+ onChange: (e) => m("prompt", e),
506
523
  height: 480,
507
- theme: b
524
+ theme: S
508
525
  })
509
526
  }),
510
- c.prompt && /* @__PURE__ */ N("p", {
511
- className: n(O, Q.instructionsError),
527
+ c.prompt && /* @__PURE__ */ F("p", {
528
+ className: n(A, Q.instructionsError),
512
529
  children: c.prompt
513
530
  })
514
531
  ]
515
532
  })]
516
533
  }),
517
- /* @__PURE__ */ N("div", {
534
+ /* @__PURE__ */ F("div", {
518
535
  "aria-hidden": !0,
519
536
  className: "hidden desktop:block desktop:w-[360px] desktop:shrink-0"
520
537
  })
@@ -523,4 +540,4 @@ var F = /* @__PURE__ */ function(e) {
523
540
  });
524
541
  };
525
542
  //#endregion
526
- export { Y as DESCRIPTION_MAX_LENGTH, V as ScheduledTaskCard, H as ScheduledTaskCardGrid, ee as ScheduledTaskCreateForm, Z as ScheduledTaskFrequency, X as ScheduledTaskScheduleType, W as ScheduledTaskSection, F as ScheduledTaskSectionKey, J as ScheduledTasks, I as ScheduledTasksSortKey, L as filterScheduledTaskItems, z as sortScheduledTaskItems };
543
+ export { ne as DESCRIPTION_MAX_LENGTH, U as ScheduledTaskCard, W as ScheduledTaskCardGrid, ce as ScheduledTaskCreateForm, X as ScheduledTaskFrequency, Y as ScheduledTaskScheduleType, K as ScheduledTaskSection, L as ScheduledTaskSectionKey, J as ScheduledTasks, R as ScheduledTasksSortKey, z as filterScheduledTaskItems, V as sortScheduledTaskItems };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-scheduled-tasks",
3
3
  "description": "Presentational Scheduled Tasks page shell — header, toolbar, and empty state",
4
- "version": "1.1.0-dev.60",
4
+ "version": "1.1.0-dev.62",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -17,8 +17,8 @@
17
17
  }
18
18
  },
19
19
  "peerDependencies": {
20
- "@epam/ai-dial-chat-shared": "1.1.0-dev.60",
21
- "@epam/ai-dial-kit": "1.1.0-dev.60",
20
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.62",
21
+ "@epam/ai-dial-kit": "1.1.0-dev.62",
22
22
  "@epam/ai-dial-ui-kit": "0.13.0-dev.17",
23
23
  "@tabler/icons-react": "^3.44.0",
24
24
  "react": "^19.0.0"
@@ -0,0 +1,10 @@
1
+ import { CalendarValue } from '@epam/ai-dial-ui-kit';
2
+ /** Converts the `datetime-local`-style `values.runAt` string to a `Date` for `Calendar`'s controlled value, or `null` when empty. */
3
+ export declare const runAtToCalendarValue: (runAt: string | undefined) => Date | null;
4
+ /** Converts `Calendar`'s `CalendarValue` back to the `datetime-local`-style string `values.runAt` expects. */
5
+ export declare const calendarValueToRunAt: (value: CalendarValue) => string;
6
+ /** Converts `values.dayOfWeek` (`'0'`=Monday..`'6'`=Sunday) to `Calendar`'s `weekday` mode value (ISO `'1'`=Monday..`'7'`=Sunday), or `null` when unset. */
7
+ export declare const dayOfWeekToCalendarValue: (dayOfWeek: string | undefined) => string | null;
8
+ /** Converts `Calendar`'s `weekday` mode `CalendarValue` (ISO `'1'`=Monday..`'7'`=Sunday) back to `values.dayOfWeek` (`'0'`=Monday..`'6'`=Sunday). */
9
+ export declare const calendarValueToDayOfWeek: (value: CalendarValue) => string;
10
+ //# sourceMappingURL=calendar-value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-value.d.ts","sourceRoot":"","sources":["../../src/utils/calendar-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,qIAAqI;AACrI,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,IAAI,GAAG,IACxC,CAAC;AAEjC,8GAA8G;AAC9G,eAAO,MAAM,oBAAoB,GAAI,OAAO,aAAa,KAAG,MAS3D,CAAC;AAEF,4JAA4J;AAC5J,eAAO,MAAM,wBAAwB,GACnC,WAAW,MAAM,GAAG,SAAS,KAC5B,MAAM,GAAG,IAGX,CAAC;AAEF,qJAAqJ;AACrJ,eAAO,MAAM,wBAAwB,GAAI,OAAO,aAAa,KAAG,MAG/D,CAAC"}