bt-core-app 2.2.27 → 2.2.29
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/composables/cron.d.ts +3 -1
- package/dist/composables/cron.mjs +119 -114
- package/dist/composables/menu.d.ts +1 -1
- package/dist/composables/menu.mjs +0 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useAuth as G } from "./auth.mjs";
|
|
2
|
-
import { appendUrl as
|
|
3
|
-
import { ref as
|
|
2
|
+
import { appendUrl as o, isNullOrEmpty as K, isLengthyArray as L } from "./helpers.mjs";
|
|
3
|
+
import { ref as p, computed as I } from "vue";
|
|
4
4
|
import "../bt-core/core/node_modules/@datasert/cronjs-matcher/dist/index.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { useDates as Q } from "./dates.mjs";
|
|
6
|
+
import { __exports as V } from "../_virtual/index.mjs";
|
|
6
7
|
const w = [
|
|
7
8
|
{ text: "12:00 AM", value: "0.0" },
|
|
8
9
|
{ text: "12:15 AM", value: "0.15" },
|
|
@@ -119,7 +120,7 @@ const w = [
|
|
|
119
120
|
{ text: "3rd", value: "15-21" },
|
|
120
121
|
{ text: "4th", value: "22-28" },
|
|
121
122
|
{ text: "5th", value: "29-31" }
|
|
122
|
-
],
|
|
123
|
+
], S = [
|
|
123
124
|
{ text: "Sun", value: "0" },
|
|
124
125
|
{ text: "Mon", value: "1" },
|
|
125
126
|
{ text: "Tue", value: "2" },
|
|
@@ -159,70 +160,74 @@ const w = [
|
|
|
159
160
|
{ text: "29th", value: "29" },
|
|
160
161
|
{ text: "30th", value: "30" },
|
|
161
162
|
{ text: "31th", value: "31" }
|
|
162
|
-
],
|
|
163
|
+
], ve = [
|
|
163
164
|
{ text: "Daily", value: "Daily" },
|
|
164
165
|
{ text: "Weekly", value: "Weekly" },
|
|
165
166
|
{ text: "Monthly", value: "Monthly" },
|
|
166
167
|
{ text: "Yearly", value: "Yearly" },
|
|
167
168
|
{ text: "Custom", value: "Custom" }
|
|
168
169
|
];
|
|
169
|
-
function
|
|
170
|
-
const { timeZone: v } = G();
|
|
171
|
-
function
|
|
172
|
-
if (
|
|
170
|
+
function re() {
|
|
171
|
+
const { timeZone: v } = G(), { utcString: C } = Q();
|
|
172
|
+
function M(d) {
|
|
173
|
+
if (d.cron == null)
|
|
173
174
|
return [];
|
|
174
|
-
const
|
|
175
|
-
|
|
175
|
+
const T = d.cron.split(/\s+/).slice(0, 5).join(" ");
|
|
176
|
+
var c = {
|
|
177
|
+
formatInTimezone: !1,
|
|
178
|
+
timezone: v.value
|
|
179
|
+
};
|
|
180
|
+
return d.futureCount != null && (c.matchCount = d.futureCount), d.toDate != null && (c.endAt = d.toDate, c.startAt = d.fromDate ?? C()), V.getFutureMatches(T, c);
|
|
176
181
|
}
|
|
177
182
|
return {
|
|
178
|
-
predictFuture:
|
|
183
|
+
predictFuture: M
|
|
179
184
|
};
|
|
180
185
|
}
|
|
181
|
-
function
|
|
186
|
+
function se(v) {
|
|
182
187
|
if (v == null)
|
|
183
188
|
return 0;
|
|
184
|
-
const
|
|
185
|
-
return
|
|
189
|
+
const C = v.split(/\s+/);
|
|
190
|
+
return C.length > 5 ? Number.parseInt(C[5].split("-")[0]) : 0;
|
|
186
191
|
}
|
|
187
|
-
function
|
|
188
|
-
function
|
|
192
|
+
function xe(v) {
|
|
193
|
+
function C() {
|
|
189
194
|
let e = "0 0 * * 1";
|
|
190
|
-
return v.useLeadTimeLeft && (v.useLeadTimeRight ? e =
|
|
195
|
+
return v.useLeadTimeLeft && (v.useLeadTimeRight ? e = o(e, `${E.value.toString()}-${Y.value.toString()}`, " ") : e = o(e, E.value.toString(), " ")), e;
|
|
191
196
|
}
|
|
192
|
-
const
|
|
193
|
-
let
|
|
194
|
-
const
|
|
197
|
+
const M = p();
|
|
198
|
+
let d = "";
|
|
199
|
+
const T = I({
|
|
195
200
|
get() {
|
|
196
|
-
return
|
|
201
|
+
return M.value;
|
|
197
202
|
},
|
|
198
203
|
set(e) {
|
|
199
|
-
|
|
204
|
+
d = e;
|
|
200
205
|
}
|
|
201
|
-
}),
|
|
206
|
+
}), c = p(0), $ = p(0), P = p("Custom"), y = I({
|
|
202
207
|
get() {
|
|
203
|
-
return
|
|
208
|
+
return P.value;
|
|
204
209
|
},
|
|
205
210
|
set(e) {
|
|
206
|
-
|
|
211
|
+
P.value !== e && (P.value = e, O(e));
|
|
207
212
|
}
|
|
208
|
-
}), F =
|
|
213
|
+
}), F = I(() => v.useLeadTimeInHours ? c.value : c.value / 60), E = I(() => v.useLeadTimeInHours ? c.value * 60 : c.value), Y = I(() => v.useLeadTimeInHours ? $.value * 60 : $.value), A = p(), h = p(), g = p(), m = p(), k = p();
|
|
209
214
|
function J() {
|
|
210
|
-
|
|
215
|
+
N(d ?? T.value);
|
|
211
216
|
}
|
|
212
217
|
function O(e) {
|
|
213
|
-
e == "Daily" ? (
|
|
218
|
+
e == "Daily" ? (h.value = ["*"], g.value = ["*"], m.value = ["*"]) : e == "Weekly" ? (h.value = ["*"], g.value = ["*"], m.value = ["0"]) : e == "Monthly" ? (h.value = ["*"], g.value = [U[0].value], m.value = [S[0].value]) : e == "Yearly" && (h.value = ["1"], k.value = [Z[0].value], m.value = ["*"]);
|
|
214
219
|
}
|
|
215
220
|
function q(e, l) {
|
|
216
|
-
var
|
|
221
|
+
var x, r;
|
|
217
222
|
e ?? (e = "0");
|
|
218
|
-
const u =
|
|
223
|
+
const u = S.findIndex((n) => n.value == e || n.text == e);
|
|
219
224
|
l ?? (l = 0);
|
|
220
|
-
const a = (u + l) % 7,
|
|
221
|
-
return
|
|
225
|
+
const a = (u + l) % 7, s = Math.ceil(l / 7);
|
|
226
|
+
return s > 1 ? `${s} ${(x = S[a]) == null ? void 0 : x.text} Later` : (r = S[a]) == null ? void 0 : r.text;
|
|
222
227
|
}
|
|
223
228
|
function z(e) {
|
|
224
|
-
if (
|
|
225
|
-
var l = w.find((
|
|
229
|
+
if (A.value != null) {
|
|
230
|
+
var l = w.find((s) => s.value == A.value);
|
|
226
231
|
if (l != null) {
|
|
227
232
|
var u = Number.parseFloat(l.value) + F.value, a = Math.floor(u / 24);
|
|
228
233
|
return a == 0 ? "Same Day" : e == null ? `${a} Day${a == 1 ? "" : "s"} Later` : q(e, a);
|
|
@@ -230,142 +235,142 @@ function se(v) {
|
|
|
230
235
|
}
|
|
231
236
|
}
|
|
232
237
|
function B() {
|
|
233
|
-
var
|
|
238
|
+
var s, x;
|
|
234
239
|
var e = {
|
|
235
|
-
regularity:
|
|
240
|
+
regularity: y.value,
|
|
236
241
|
orderDays: [],
|
|
237
242
|
deliveryDays: []
|
|
238
243
|
};
|
|
239
|
-
if (
|
|
240
|
-
if (
|
|
241
|
-
var l = w.find((
|
|
244
|
+
if (y.value == "Daily") {
|
|
245
|
+
if (A.value != null) {
|
|
246
|
+
var l = w.find((r) => r.value == A.value);
|
|
242
247
|
if (l != null) {
|
|
243
|
-
|
|
248
|
+
y.value == "Daily" && e.orderDays.push(l.text);
|
|
244
249
|
var u = Number.parseFloat(l.value) + F.value, a = Math.floor(u / 24);
|
|
245
250
|
a == 0 ? e.deliveryDays.push("Same Day") : e.deliveryDays.push(`${a} Day${a == 1 ? "" : "s"} Later`);
|
|
246
251
|
}
|
|
247
252
|
}
|
|
248
253
|
} else
|
|
249
|
-
|
|
250
|
-
var n =
|
|
251
|
-
n != null && (e.orderDays.push(n.text), e.deliveryDays.push(z(
|
|
252
|
-
}) :
|
|
253
|
-
var n = j.find((
|
|
254
|
+
y.value == "Weekly" ? (s = m.value) == null || s.forEach((r) => {
|
|
255
|
+
var n = S.find((i) => i.value == r);
|
|
256
|
+
n != null && (e.orderDays.push(n.text), e.deliveryDays.push(z(r) ?? ""));
|
|
257
|
+
}) : y.value == "Monthly" && ((x = h.value) == null || x.forEach((r) => {
|
|
258
|
+
var n = j.find((i) => i.value == r);
|
|
254
259
|
n != null && (e.orderDays.push(n.text), e.deliveryDays.push(z(void 0) ?? ""));
|
|
255
260
|
}));
|
|
256
261
|
return e;
|
|
257
262
|
}
|
|
258
263
|
function H() {
|
|
259
264
|
var e;
|
|
260
|
-
return (e =
|
|
265
|
+
return (e = M.value) == null ? void 0 : e.split(/\s+/);
|
|
261
266
|
}
|
|
262
|
-
function
|
|
263
|
-
if (
|
|
264
|
-
|
|
265
|
-
let u = !1, a = !1,
|
|
266
|
-
if (K(
|
|
267
|
+
function N(e) {
|
|
268
|
+
if (M.value != e) {
|
|
269
|
+
M.value = e;
|
|
270
|
+
let u = !1, a = !1, s = !1, x = !1, r = !1, n = !1;
|
|
271
|
+
if (K(M.value) || !L(H(), 4))
|
|
267
272
|
u = !0;
|
|
268
273
|
else {
|
|
269
|
-
const
|
|
270
|
-
var l = `${
|
|
271
|
-
l.includes(",") || l.includes("-") || l.includes("/") ? u = !0 : w.some((t) => t.value == l) ?
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
274
|
+
const i = H();
|
|
275
|
+
var l = `${i[1]}.${i[0]}`;
|
|
276
|
+
l.includes(",") || l.includes("-") || l.includes("/") ? u = !0 : w.some((t) => t.value == l) ? A.value = l : u = !0;
|
|
277
|
+
const R = i[2];
|
|
278
|
+
if (R.includes("/"))
|
|
274
279
|
u = !0;
|
|
275
|
-
else if (
|
|
280
|
+
else if (R == "*")
|
|
276
281
|
a = !0;
|
|
277
282
|
else {
|
|
278
283
|
a = !1;
|
|
279
|
-
const t = N.split(",");
|
|
280
|
-
t.some((f) => !U.some((g) => g.value == f)) ? n = !0 : p.value = t;
|
|
281
|
-
}
|
|
282
|
-
const R = o[3];
|
|
283
|
-
if (R.includes("-") || R.includes("/"))
|
|
284
|
-
u = !0;
|
|
285
|
-
else if (R == "*")
|
|
286
|
-
i = !0;
|
|
287
|
-
else {
|
|
288
|
-
i = !1, s = !0;
|
|
289
284
|
const t = R.split(",");
|
|
290
|
-
t.some((f) => !
|
|
291
|
-
}
|
|
292
|
-
if (s && n) {
|
|
293
|
-
const t = N.split(",");
|
|
294
|
-
t.some((f) => !Z.some((g) => g.value == f)) ? u = !0 : C.value = t;
|
|
285
|
+
t.some((f) => !U.some((D) => D.value == f)) ? n = !0 : g.value = t;
|
|
295
286
|
}
|
|
296
|
-
const W =
|
|
287
|
+
const W = i[3];
|
|
297
288
|
if (W.includes("-") || W.includes("/"))
|
|
298
289
|
u = !0;
|
|
299
290
|
else if (W == "*")
|
|
300
|
-
x = !0
|
|
291
|
+
x = !0;
|
|
301
292
|
else {
|
|
302
|
-
x = !1;
|
|
293
|
+
x = !1, r = !0;
|
|
303
294
|
const t = W.split(",");
|
|
304
|
-
t.some((f) => !
|
|
295
|
+
t.some((f) => !j.some((D) => D.value == f)) ? u = !0 : h.value = t;
|
|
296
|
+
}
|
|
297
|
+
if (r && n) {
|
|
298
|
+
const t = R.split(",");
|
|
299
|
+
t.some((f) => !Z.some((D) => D.value == f)) ? u = !0 : k.value = t;
|
|
300
|
+
}
|
|
301
|
+
const b = i[4];
|
|
302
|
+
if (b.includes("-") || b.includes("/"))
|
|
303
|
+
u = !0;
|
|
304
|
+
else if (b == "*")
|
|
305
|
+
s = !0, m.value = S.map((t) => t.value);
|
|
306
|
+
else {
|
|
307
|
+
s = !1;
|
|
308
|
+
const t = b.split(",");
|
|
309
|
+
t.some((f) => !S.some((D) => D.value == f)) ? u = !0 : m.value = t;
|
|
305
310
|
}
|
|
306
|
-
if (L(
|
|
307
|
-
const t =
|
|
311
|
+
if (L(i, 5) && v.useLeadTimeLeft) {
|
|
312
|
+
const t = i[5].split("-");
|
|
308
313
|
if (v.useLeadTimeRight && t.length > 1) {
|
|
309
314
|
const f = Number.parseInt(t[1]);
|
|
310
|
-
|
|
315
|
+
$.value = v.useLeadTimeInHours ? Math.round(f / 60) : f;
|
|
311
316
|
}
|
|
312
317
|
if (t.length > 0) {
|
|
313
318
|
const f = Number.parseInt(t[0]);
|
|
314
|
-
|
|
319
|
+
c.value = v.useLeadTimeInHours ? Math.round(f / 60) : f;
|
|
315
320
|
}
|
|
316
321
|
}
|
|
317
322
|
}
|
|
318
|
-
u ?
|
|
323
|
+
u ? y.value = "Custom" : r ? P.value = "Yearly" : x && a && s ? P.value = "Daily" : x && a ? P.value = "Weekly" : x ? P.value = "Monthly" : P.value = "Custom";
|
|
319
324
|
}
|
|
320
325
|
return {
|
|
321
326
|
applyRawExpression: J,
|
|
322
327
|
applyRegularity: O,
|
|
323
|
-
cronExpression:
|
|
324
|
-
hour:
|
|
325
|
-
leadTimeLeft:
|
|
326
|
-
leadTimeRight:
|
|
327
|
-
months:
|
|
328
|
+
cronExpression: M,
|
|
329
|
+
hour: A,
|
|
330
|
+
leadTimeLeft: c,
|
|
331
|
+
leadTimeRight: $,
|
|
332
|
+
months: h,
|
|
328
333
|
pack: _,
|
|
329
|
-
rawExpression:
|
|
330
|
-
regularity:
|
|
331
|
-
unpack:
|
|
332
|
-
weekdays:
|
|
333
|
-
weeks:
|
|
334
|
+
rawExpression: T,
|
|
335
|
+
regularity: y,
|
|
336
|
+
unpack: N,
|
|
337
|
+
weekdays: m,
|
|
338
|
+
weeks: g
|
|
334
339
|
};
|
|
335
340
|
}
|
|
336
341
|
function _() {
|
|
337
|
-
var l, u, a,
|
|
338
|
-
if (
|
|
339
|
-
return
|
|
340
|
-
let e = `${(l =
|
|
341
|
-
return
|
|
342
|
+
var l, u, a, s, x, r, n, i;
|
|
343
|
+
if (y.value == "Custom")
|
|
344
|
+
return M.value;
|
|
345
|
+
let e = `${(l = A.value) == null ? void 0 : l.split(".")[1]} ${(u = A.value) == null ? void 0 : u.split(".")[0]}`;
|
|
346
|
+
return y.value == "Yearly" ? (L(k.value) ? e = o(e, (a = k.value) == null ? void 0 : a.toString(), " ") : e = o(e, "*", " "), L(h.value) ? e = o(e, (s = h.value) == null ? void 0 : s.toString(), " ") : e = o(e, "*", " "), e = o(e, "*", " ")) : (L(g.value) ? e = o(e, (x = g.value) == null ? void 0 : x.toString(), " ") : e = o(e, "*", " "), L(h.value) ? e = o(e, (r = h.value) == null ? void 0 : r.toString(), " ") : e = o(e, "*", " "), ((n = m.value) == null ? void 0 : n.length) == 7 ? e = o(e, "*", " ") : e = o(e, (i = m.value) == null ? void 0 : i.toString(), " ")), e = o(e, `${E.value}-${Y.value}`, " "), M.value = e, M.value;
|
|
342
347
|
}
|
|
343
|
-
return
|
|
348
|
+
return N(v.value ?? v.defaultExpression ?? C()), {
|
|
344
349
|
applyRawExpression: J,
|
|
345
350
|
applyRegularity: O,
|
|
346
|
-
cronExpression:
|
|
351
|
+
cronExpression: M,
|
|
347
352
|
getRegularityAndOrderAndDeliveryDays: B,
|
|
348
|
-
hour:
|
|
349
|
-
leadTimeLeft:
|
|
350
|
-
leadTimeRight:
|
|
351
|
-
months:
|
|
352
|
-
monthdays:
|
|
353
|
+
hour: A,
|
|
354
|
+
leadTimeLeft: c,
|
|
355
|
+
leadTimeRight: $,
|
|
356
|
+
months: h,
|
|
357
|
+
monthdays: k,
|
|
353
358
|
pack: _,
|
|
354
|
-
rawExpression:
|
|
355
|
-
regularity:
|
|
356
|
-
unpack:
|
|
357
|
-
weekdays:
|
|
358
|
-
weeks:
|
|
359
|
+
rawExpression: T,
|
|
360
|
+
regularity: y,
|
|
361
|
+
unpack: N,
|
|
362
|
+
weekdays: m,
|
|
363
|
+
weeks: g
|
|
359
364
|
};
|
|
360
365
|
}
|
|
361
366
|
export {
|
|
362
|
-
|
|
367
|
+
se as getLeadTime,
|
|
363
368
|
w as hourOptions,
|
|
364
369
|
j as monthOptions,
|
|
365
370
|
Z as monthdayOptions,
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
371
|
+
ve as regularityOptions,
|
|
372
|
+
xe as useCron,
|
|
373
|
+
re as useCronPredictor,
|
|
369
374
|
U as weekOptions,
|
|
370
|
-
|
|
375
|
+
S as weekdayOptions
|
|
371
376
|
};
|