bt-core-app 1.4.9 → 1.4.11

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.
@@ -543,7 +543,10 @@ function Ce(e, t) {
543
543
  while (l.startsWith("/"));
544
544
  return `${a}/${l}`;
545
545
  }
546
- function eu(e = "blitzItExtensionExists") {
546
+ function eu(e) {
547
+ return e == null || !Array.isArray(e) ? e : e.filter((t, a, l) => l.indexOf(t === a));
548
+ }
549
+ function ru(e = "blitzItExtensionExists") {
547
550
  try {
548
551
  var t = document.getElementById(e);
549
552
  return t != null;
@@ -551,7 +554,7 @@ function eu(e = "blitzItExtensionExists") {
551
554
  return console.log(va(a)), !1;
552
555
  }
553
556
  }
554
- function ru(e, t) {
557
+ function tu(e, t) {
555
558
  return [
556
559
  { lat: e.lat - t, lng: e.lng + t },
557
560
  { lat: e.lat - t, lng: e.lng - t },
@@ -559,7 +562,7 @@ function ru(e, t) {
559
562
  { lat: e.lat + t, lng: e.lng + t }
560
563
  ];
561
564
  }
562
- function tu(e, t) {
565
+ function nu(e, t) {
563
566
  return [
564
567
  { lat: e.lat - t * 2, lng: e.lng + t },
565
568
  { lat: e.lat - t * 2, lng: e.lng - t },
@@ -567,7 +570,7 @@ function tu(e, t) {
567
570
  { lat: e.lat, lng: e.lng + t }
568
571
  ];
569
572
  }
570
- function nu(e, t) {
573
+ function au(e, t) {
571
574
  return [
572
575
  { lat: e.lat, lng: e.lng + t },
573
576
  { lat: e.lat, lng: e.lng - t },
@@ -575,7 +578,7 @@ function nu(e, t) {
575
578
  { lat: e.lat + t * 2, lng: e.lng + t }
576
579
  ];
577
580
  }
578
- function au(e) {
581
+ function uu(e) {
579
582
  var t = Rt(e, !0);
580
583
  return t = t.toLowerCase(), t = t.replace(" victoria ", "vic"), t = t.replace(" queensland ", "qld"), t = t.replace(" new south wales ", "nsw"), t = t.replace(" northern territory ", "nt"), t = t.replace(" western australia ", "wa"), t = t.replace(" tasmania ", "tas"), t = t.replace(" south australia ", "sa"), t = t.replace(" australian captial territory ", "act"), t = t.replace(" & ", " and "), t = t.replace(" road", " rd"), t = t.replace(" street", " st"), t = t.replace(" lane", " ln"), t = t.replace(" alley", " aly"), t = t.replace(" arcade", " arc"), t = t.replace(" boulevard", " blvd"), t = t.replace(" court", " ct"), t = t.replace(" cove", " cv"), t = t.replace(" highway", " hwy"), t.replaceAll(" ", "");
581
584
  }
@@ -587,13 +590,13 @@ function Rt(e, t = !1) {
587
590
  var a = "";
588
591
  return e.addressLineOne != null && !t && (a = e.addressLineOne + " "), e.streetNumber != null && (a = a + e.streetNumber + " "), e.streetName != null && (a = a + e.streetName + ", "), e.suburb != null && (a = a + e.suburb + " "), e.state != null && (a = a + e.state + " "), e.postcode != null && (a = a + e.postcode), a;
589
592
  }
590
- function uu(e, t, a) {
593
+ function lu(e, t, a) {
591
594
  if (e) {
592
595
  var l = new Image();
593
596
  l.onload = t, l.onerror = a, l.src = e;
594
597
  }
595
598
  }
596
- async function lu(e, t = !0) {
599
+ async function cu(e, t = !0) {
597
600
  return new Promise((a, l) => {
598
601
  e == null && l("no url given");
599
602
  var s = new Image();
@@ -610,7 +613,7 @@ async function lu(e, t = !0) {
610
613
  function ia(e) {
611
614
  return e && e.replace(/([A-Z])/g, " $1").replace(/^./, (t) => t.toUpperCase());
612
615
  }
613
- function cu(e) {
616
+ function iu(e) {
614
617
  if (e != null && typeof e == "object")
615
618
  for (var t in e)
616
619
  /^[A-Z]/.test(t) && Object.hasOwnProperty.call(e, t) && (e[t.charAt(0).toLowerCase() + t.substring(1)] = e[t], delete e[t]);
@@ -629,25 +632,25 @@ const Ye = [
629
632
  { value: 7, short: "sat", values: ["sat", "saturday"] },
630
633
  { value: 0, short: "always", values: ["always", null, void 0] }
631
634
  ];
632
- function iu(e) {
635
+ function fu(e) {
633
636
  if (e == null)
634
637
  return 0;
635
638
  const t = e.replaceAll(" ", "").split(",").map((l) => l.toLowerCase()), a = Ye.filter((l) => l.values.some((s) => t.some((o) => s == o))).map((l) => l.value);
636
639
  return a.length == 0 ? 8 : Math.min(...a);
637
640
  }
638
- function fu(e) {
641
+ function su(e) {
639
642
  return e == null ? e : e.toLowerCase().replaceAll(" ", "").split(",").map((t) => {
640
643
  let a = Ye.find((l) => l.values.some((s) => s == t));
641
644
  return a != null ? a.short : "";
642
645
  }).filter((t) => t != null && t.length > 0).toString();
643
646
  }
644
- function su(e, t) {
647
+ function ou(e, t) {
645
648
  if (e == null || t == null)
646
649
  return !0;
647
650
  const a = e.replaceAll(" ", "").split(",").map((o) => o.toLowerCase()), l = t.replaceAll(" ", "").toLowerCase(), s = Ye.find((o) => o.values.some((A) => A == l));
648
651
  return s != null && a.some((o) => o == s.short || s.values.some((A) => A == o));
649
652
  }
650
- function ou(e, t) {
653
+ function hu(e, t) {
651
654
  if (t == null)
652
655
  return e;
653
656
  let a = e ?? "";
@@ -655,13 +658,13 @@ function ou(e, t) {
655
658
  let l = [...new Set(a.replaceAll(" ", "").toLowerCase().split(",").map((s) => Ye.find((o) => o.values.some((A) => A == s))).filter((s) => s != null).sort(Ze.firstBy((s) => (s == null ? void 0 : s.value) ?? 0)).map((s) => s == null ? void 0 : s.short))].toString();
656
659
  return l.length > 0 ? l : void 0;
657
660
  }
658
- function hu(e, t) {
661
+ function du(e, t) {
659
662
  if (t == null || e == null)
660
663
  return e;
661
664
  let a = e ?? "", l = t.replaceAll(" ", "").toLowerCase(), s = [...new Set(a.replaceAll(" ", "").toLowerCase().split(",").map((o) => Ye.find((A) => A.values.some((S) => S == o && S != l))).filter((o) => o != null).sort(Ze.firstBy((o) => (o == null ? void 0 : o.value) ?? 0)).map((o) => o == null ? void 0 : o.short))].toString();
662
665
  return s.length > 0 ? s : void 0;
663
666
  }
664
- function du(e, t) {
667
+ function mu(e, t) {
665
668
  return e != null && Array.isArray(e) && e.length == t;
666
669
  }
667
670
  function Fe(e, t = 0) {
@@ -670,13 +673,13 @@ function Fe(e, t = 0) {
670
673
  function sa(e) {
671
674
  return e == "0001-01-01T00:00:00Z";
672
675
  }
673
- function mu() {
676
+ function vu() {
674
677
  return (/* @__PURE__ */ new Date("0001-01-01T00:00:00Z")).getTime();
675
678
  }
676
679
  function oa() {
677
680
  return "0001-01-01T00:00:00Z";
678
681
  }
679
- function vu(e, t) {
682
+ function gu(e, t) {
680
683
  let a = "1", l = 0;
681
684
  if (l < t)
682
685
  do
@@ -685,7 +688,7 @@ function vu(e, t) {
685
688
  let s = Number.parseInt(a);
686
689
  return Math.round(e * s) / s;
687
690
  }
688
- function gu(e, t) {
691
+ function yu(e, t) {
689
692
  let a = e ?? "";
690
693
  return t != null && (ha(a, t) ? a = a.split(",").filter((l) => l != t).toString() : a != null ? a = `${a},${t}` : a = t), a != null && a.length > 0 ? a : null;
691
694
  }
@@ -724,7 +727,7 @@ function Ut(e, t = (a) => a) {
724
727
  return Fe(o) && l.push(...o), l;
725
728
  }, [])] : [];
726
729
  }
727
- function yu(e) {
730
+ function wu(e) {
728
731
  const t = e.split(","), a = t[0].indexOf("base64") >= 0 ? atob(t[1]) : decodeURI(t[1]), l = t[0].split(":")[1].split(";")[0], s = new Uint8Array(a.length);
729
732
  for (let o = 0; o < a.length; o++)
730
733
  s[o] = a.charCodeAt(o);
@@ -760,10 +763,10 @@ function ya(e, t, a) {
760
763
  }
761
764
  return !1;
762
765
  }
763
- function wu(e) {
766
+ function bu(e) {
764
767
  return e != null ? e.replaceAll(" ", "").toLowerCase() : null;
765
768
  }
766
- function bu(e = 2e3) {
769
+ function Eu(e = 2e3) {
767
770
  return new Promise((t) => {
768
771
  setTimeout(() => t(), e);
769
772
  });
@@ -973,14 +976,14 @@ function Da(e) {
973
976
  const a = ye[t] ?? ye.development;
974
977
  return e == null ? a.data ?? "" : a.other[e] ?? a.data ?? "";
975
978
  }
976
- function Eu() {
979
+ function Su() {
977
980
  return ye;
978
981
  }
979
982
  function Ia(e) {
980
983
  return ye = e, ye;
981
984
  }
982
985
  let pe = "Australia/Melbourne", Br;
983
- function Su() {
986
+ function _u() {
984
987
  return Br;
985
988
  }
986
989
  function xa(e) {
@@ -1197,7 +1200,7 @@ const $r = {
1197
1200
  warning: "#FB8C00"
1198
1201
  };
1199
1202
  let Ge = {}, ie;
1200
- function _u() {
1203
+ function Au() {
1201
1204
  const e = Ca();
1202
1205
  function t() {
1203
1206
  e.global.name.value = ie.value.theme;
@@ -1266,7 +1269,7 @@ function Pa(e) {
1266
1269
  drawerStick: e.defaultDrawerStick ?? !1
1267
1270
  }), Ge = e;
1268
1271
  }
1269
- const Au = {
1272
+ const Du = {
1270
1273
  canExportCSV: !1
1271
1274
  };
1272
1275
  function La() {
@@ -1316,7 +1319,7 @@ function La() {
1316
1319
  };
1317
1320
  }
1318
1321
  let kr;
1319
- function Du() {
1322
+ function Iu() {
1320
1323
  return kr;
1321
1324
  }
1322
1325
  function Ma(e) {
@@ -1362,7 +1365,7 @@ function Ma(e) {
1362
1365
  }, kr;
1363
1366
  }
1364
1367
  let Vr;
1365
- function Iu() {
1368
+ function xu() {
1366
1369
  return Vr;
1367
1370
  }
1368
1371
  function Ra() {
@@ -1378,7 +1381,7 @@ function Ra() {
1378
1381
  }, Vr;
1379
1382
  }
1380
1383
  var Ua = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
1381
- function xu(e) {
1384
+ function Nu(e) {
1382
1385
  function t(a) {
1383
1386
  var s;
1384
1387
  const l = a.matched.slice().reverse().find((o) => o.meta && o.meta.title);
@@ -1394,7 +1397,7 @@ function xu(e) {
1394
1397
  updateMeta: t
1395
1398
  };
1396
1399
  }
1397
- function Nu(e, t, a = {}) {
1400
+ function Tu(e, t, a = {}) {
1398
1401
  const {
1399
1402
  preventDefault: l = !1,
1400
1403
  stopPropagation: s = !1,
@@ -1466,7 +1469,7 @@ function Nu(e, t, a = {}) {
1466
1469
  };
1467
1470
  }
1468
1471
  let Wr;
1469
- function Tu() {
1472
+ function Cu() {
1470
1473
  return Wr;
1471
1474
  }
1472
1475
  function Ba(e) {
@@ -3056,7 +3059,7 @@ function de() {
3056
3059
  const e = $t();
3057
3060
  return (rr == null || rr.config.name != e) && (rr = kt.createInstance({ name: e })), rr;
3058
3061
  }
3059
- function Cu() {
3062
+ function Pu() {
3060
3063
  async function e(s) {
3061
3064
  const o = de();
3062
3065
  (await o.keys()).filter((N) => N.startsWith(s)).forEach((N) => {
@@ -3397,7 +3400,7 @@ This will fail in production.`);
3397
3400
  return A.$id = l, A;
3398
3401
  }
3399
3402
  let cr;
3400
- function Pu(e) {
3403
+ function Lu(e) {
3401
3404
  return cr(e)();
3402
3405
  }
3403
3406
  function Ga(e) {
@@ -3781,7 +3784,7 @@ function bt(e) {
3781
3784
  };
3782
3785
  });
3783
3786
  }
3784
- function Lu(e, t, a) {
3787
+ function Mu(e, t, a) {
3785
3788
  var Re;
3786
3789
  const l = e.storeMode ?? (a == null ? void 0 : a.storeMode) ?? "session", s = e.storageMode ?? (a == null ? void 0 : a.storageMode) ?? "local-cache", o = e.nav ?? e.nav ?? "basic", A = La(), S = Bt(), N = Aa(), L = Y(1), R = K(e.customFilters) ?? [], b = Y([]);
3787
3790
  let c = Y(new Array());
@@ -3989,7 +3992,7 @@ function Lu(e, t, a) {
3989
3992
  }
3990
3993
  const Et = Y(!0), St = Y(!1), _t = Y(), xr = Y(!1);
3991
3994
  let Nr = null, qr;
3992
- function Mu() {
3995
+ function Ru() {
3993
3996
  return qr;
3994
3997
  }
3995
3998
  function Ya(e) {
@@ -4071,7 +4074,7 @@ function Ya(e) {
4071
4074
  }, qr;
4072
4075
  }
4073
4076
  let Hr;
4074
- function Ru(e) {
4077
+ function Uu(e) {
4075
4078
  return Hr.usePresets(e);
4076
4079
  }
4077
4080
  function Ja(e) {
@@ -4088,7 +4091,7 @@ function Ja(e) {
4088
4091
  let At, Dt, It, xt = !1;
4089
4092
  const Tr = Y(!1), Cr = Y(!1), Nt = Y(), nr = Y();
4090
4093
  let zr;
4091
- function Uu() {
4094
+ function Bu() {
4092
4095
  return zr;
4093
4096
  }
4094
4097
  function Ka() {
@@ -4122,7 +4125,7 @@ function Ka() {
4122
4125
  }, zr;
4123
4126
  }
4124
4127
  const Qa = ["t", "r", "b", "l", "tr", "br", "bl", "tl"];
4125
- function Bu(e, t = {}) {
4128
+ function $u(e, t = {}) {
4126
4129
  let a, l = t.handleWidth ?? 12, s = t.handleZIndex ?? 100, o = t.minWidth ?? 0, A = t.maxWidth ?? Number.MAX_SAFE_INTEGER, S = t.minHeight ?? 0, N = t.maxHeight ?? Number.MAX_SAFE_INTEGER, L = t.preventDefault ?? !1, R = t.stopPropagation ?? !1, b, c = [];
4127
4130
  const h = Y(!1);
4128
4131
  let r = [], x = [];
@@ -4272,11 +4275,11 @@ function Bu(e, t = {}) {
4272
4275
  turnResizingOff: we
4273
4276
  };
4274
4277
  }
4275
- function $u(e) {
4278
+ function Fu(e) {
4276
4279
  const t = [];
4277
4280
  return (e == null ? void 0 : e.required) == !0 && t.push((a) => !!a || "Field is required"), (e == null ? void 0 : e.otherRules) != null && (Array.isArray(e == null ? void 0 : e.otherRules) ? t.push(...e.otherRules) : t.push(e.otherRules)), (e == null ? void 0 : e.forPassword) == !0 && (t.push((a) => !!a || "Password is required"), t.push((a) => a != null && a.length > 9 || "Password must be 10 or more characters"), t.push((a) => /^(.*[a-z].*)$/.test(a) || "Password must contain a lowercase letter"), t.push((a) => /^(.*[A-Z].*)$/.test(a) || "Password must contain an uppercase letter"), t.push((a) => /^(.*\d.*)$/.test(a) || "Password must contain a number")), (e == null ? void 0 : e.forEmail) == !0 && (t.push((a) => !!a || "Email is required"), t.push((a) => wa(a) || "Email must be valid")), t;
4278
4281
  }
4279
- function Fu(e, t) {
4282
+ function ku(e, t) {
4280
4283
  const a = Y(!1), l = ar(e);
4281
4284
  let s = o(K(e));
4282
4285
  (t == null ? void 0 : t.useTracker) !== !1 && Ae(l, (S) => {
@@ -4299,7 +4302,7 @@ function Fu(e, t) {
4299
4302
  restartTracker: A
4300
4303
  };
4301
4304
  }
4302
- function ku(e) {
4305
+ function Vu(e) {
4303
4306
  return {
4304
4307
  install() {
4305
4308
  var A;
@@ -4323,18 +4326,18 @@ function ku(e) {
4323
4326
  };
4324
4327
  }
4325
4328
  export {
4326
- yu as DataURIToBlob,
4327
- ou as addWeekday,
4329
+ wu as DataURIToBlob,
4330
+ hu as addWeekday,
4328
4331
  Ce as appendUrl,
4329
4332
  fa as capitalizeWords,
4330
- uu as checkImage,
4333
+ lu as checkImage,
4331
4334
  ma as containsSearch,
4332
- su as containsWeekday,
4335
+ ou as containsWeekday,
4333
4336
  Qr as copyDeep,
4334
4337
  da as copyItemByAlphabet,
4335
4338
  Ea as createApi,
4336
4339
  xa as createAuth,
4337
- ku as createCore,
4340
+ Vu as createCore,
4338
4341
  Pa as createCosmetics,
4339
4342
  Ma as createDates,
4340
4343
  Ra as createDemo,
@@ -4348,60 +4351,61 @@ export {
4348
4351
  Ia as createUrl,
4349
4352
  bt as createWholeLastUpdateStoreDefinition,
4350
4353
  ha as csvContains,
4351
- Au as csvDefaults,
4354
+ Du as csvDefaults,
4352
4355
  Ut as deepSelect,
4353
- eu as extensionExists,
4356
+ eu as distinct,
4357
+ ru as extensionExists,
4354
4358
  va as extractErrorDescription,
4355
4359
  ia as fromCamelCase,
4356
- ru as getAreaAround,
4357
- tu as getAreaToLeft,
4358
- nu as getAreaToRight,
4359
- au as getGoogleMapsLocationLine,
4360
- lu as getImageData,
4360
+ tu as getAreaAround,
4361
+ nu as getAreaToLeft,
4362
+ au as getAreaToRight,
4363
+ uu as getGoogleMapsLocationLine,
4364
+ cu as getImageData,
4361
4365
  Rt as getLocationLine,
4362
- mu as getMinDate,
4366
+ vu as getMinDate,
4363
4367
  oa as getMinDateString,
4364
4368
  ga as getRandomColor,
4365
4369
  ya as hasSearch,
4366
- du as isArrayOfLength,
4370
+ mu as isArrayOfLength,
4367
4371
  Fe as isLengthyArray,
4368
4372
  sa as isMinDate,
4369
4373
  Rr as nestedValue,
4370
- hu as removeWeekday,
4371
- vu as roundTo,
4372
- cu as toCamelCase,
4373
- wu as toCompareString,
4374
- gu as toggleCSV,
4375
- bu as twiddleThumbs,
4374
+ du as removeWeekday,
4375
+ gu as roundTo,
4376
+ iu as toCamelCase,
4377
+ bu as toCompareString,
4378
+ yu as toggleCSV,
4379
+ Eu as twiddleThumbs,
4376
4380
  la as useActions,
4377
4381
  ua as useActionsTracker,
4378
4382
  ba as useApi,
4379
- Su as useAuth,
4383
+ _u as useAuth,
4380
4384
  vt as useAuthUrl,
4381
4385
  La as useCSV,
4382
- _u as useCosmetics,
4386
+ Au as useCosmetics,
4383
4387
  Da as useDataUrl,
4384
- Du as useDates,
4388
+ Iu as useDates,
4385
4389
  $t as useDbName,
4386
- Iu as useDemo,
4387
- xu as useDocumentMeta,
4388
- Nu as useDraggable,
4389
- Tu as useFilters,
4390
+ xu as useDemo,
4391
+ Nu as useDocumentMeta,
4392
+ Tu as useDraggable,
4393
+ Cu as useFilters,
4390
4394
  na as useId,
4391
- Lu as useList,
4392
- Cu as useLocalCache,
4395
+ Mu as useList,
4396
+ Pu as useLocalCache,
4393
4397
  de as useLocalDb,
4394
- Mu as useNavigation,
4395
- Uu as usePWA,
4396
- Ru as usePresets,
4397
- Bu as useResizable,
4398
- $u as useRules,
4399
- Pu as useStore,
4398
+ Ru as useNavigation,
4399
+ Bu as usePWA,
4400
+ Uu as usePresets,
4401
+ $u as useResizable,
4402
+ Fu as useRules,
4403
+ Lu as useStore,
4400
4404
  Ga as useStoreDefinition,
4401
- Fu as useTracker,
4402
- Eu as useUrls,
4405
+ ku as useTracker,
4406
+ Su as useUrls,
4403
4407
  wa as validEmail,
4404
4408
  Ye as weekdayPairs,
4405
- fu as weekdayShortName,
4406
- iu as weekdayValue
4409
+ su as weekdayShortName,
4410
+ fu as weekdayValue
4407
4411
  };
package/dist/index.d.ts CHANGED
@@ -160,14 +160,14 @@ export declare interface BTNavigation {
160
160
  backgroundName: Ref<string | undefined>;
161
161
  hesitate: Ref<boolean>;
162
162
  navigationItems: NavigationItem[];
163
- findArchiveName: (navName?: string) => string | undefined;
164
- findCacheHours: (navName?: string) => number;
165
- findDisplay: (navName?: string) => string | undefined;
166
- findIcon: (navName?: string) => string | undefined;
163
+ findArchiveName: (navName?: string | NavigationItem) => string | undefined;
164
+ findCacheHours: (navName?: string | NavigationItem) => number;
165
+ findDisplay: (navName?: string | NavigationItem) => string | undefined;
166
+ findIcon: (navName?: string | NavigationItem) => string | undefined;
167
167
  findItem: (navName?: string | NavigationItem) => NavigationItem | null;
168
- findStoreName: (navName?: string) => string;
169
- findPath: (navName?: string) => string | undefined;
170
- findSingleDisplay: (navName?: string) => string | undefined;
168
+ findStoreName: (navName?: string | NavigationItem) => string;
169
+ findPath: (navName?: string | NavigationItem) => string | undefined;
170
+ findSingleDisplay: (navName?: string | NavigationItem) => string | undefined;
171
171
  updateNavigationProperties: (navName?: string | NavigationItem) => void;
172
172
  }
173
173
 
@@ -367,6 +367,8 @@ export declare interface DeleteOptions extends PathOptions, DoActionOptions {
367
367
  store?: BTStoreDefinition;
368
368
  }
369
369
 
370
+ export declare function distinct(list: any): any;
371
+
370
372
  declare interface DoActionOptions {
371
373
  completionMsg?: string;
372
374
  confirmationMsg?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bt-core-app",
3
- "version": "1.4.9",
3
+ "version": "1.4.11",
4
4
  "description": "Core app tools for some basic features like navigation, authentication, server apis, and cosmetics",
5
5
  "homepage": "https://github.com/BlitzItTech/bt-core",
6
6
  "bugs": {