@bagelink/vue 1.0.54 → 1.0.57

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.
Files changed (52) hide show
  1. package/dist/components/MapEmbed/Index.vue.d.ts +30 -0
  2. package/dist/components/MapEmbed/Index.vue.d.ts.map +1 -0
  3. package/dist/components/dashboard/Lineart.vue.d.ts.map +1 -1
  4. package/dist/components/dashboard/index.d.ts.map +1 -1
  5. package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
  6. package/dist/components/index.d.ts +3 -3
  7. package/dist/components/index.d.ts.map +1 -1
  8. package/dist/components/layout/BottomMenu.vue.d.ts.map +1 -1
  9. package/dist/components/layout/Layout.vue.d.ts.map +1 -1
  10. package/dist/components/layout/SidebarMenu.vue.d.ts.map +1 -1
  11. package/dist/components/layout/Skeleton.vue.d.ts.map +1 -1
  12. package/dist/components/layout/TabbedLayout.vue.d.ts.map +1 -1
  13. package/dist/components/layout/Tabs.vue.d.ts.map +1 -1
  14. package/dist/components/layout/TabsBody.vue.d.ts.map +1 -1
  15. package/dist/components/layout/TabsNav.vue.d.ts.map +1 -1
  16. package/dist/components/layout/index.d.ts.map +1 -1
  17. package/dist/components/layout/tabsManager.d.ts.map +1 -1
  18. package/dist/components/lightbox/Lightbox.vue.d.ts.map +1 -1
  19. package/dist/components/lightbox/index.d.ts.map +1 -1
  20. package/dist/components/lightbox/lightbox.types.d.ts.map +1 -1
  21. package/dist/index.cjs +63 -34
  22. package/dist/index.mjs +63 -34
  23. package/dist/plugins/bagel.d.ts.map +1 -1
  24. package/dist/style.css +93 -93
  25. package/dist/utils/BagelFormUtils.d.ts +6 -1
  26. package/dist/utils/BagelFormUtils.d.ts.map +1 -1
  27. package/dist/utils/timeAgo.d.ts.map +1 -1
  28. package/package.json +1 -1
  29. package/src/components/{MapEmbed.vue → MapEmbed/Index.vue} +1 -1
  30. package/src/components/form/inputs/DateInput.vue +47 -7
  31. package/src/components/form/inputs/NumberInput.vue +1 -1
  32. package/src/components/index.ts +3 -3
  33. package/src/plugins/bagel.ts +1 -2
  34. package/src/utils/BagelFormUtils.ts +10 -1
  35. package/src/utils/timeAgo.ts +9 -17
  36. package/tsconfig.json +2 -1
  37. /package/src/components/{dashboard → Dashboard}/Lineart.vue +0 -0
  38. /package/src/components/{dashboard → Dashboard}/index.ts +0 -0
  39. /package/src/components/{layout → Layout}/BottomMenu.vue +0 -0
  40. /package/src/components/{layout → Layout}/Layout.vue +0 -0
  41. /package/src/components/{layout → Layout}/SidebarMenu.vue +0 -0
  42. /package/src/components/{layout → Layout}/Skeleton.vue +0 -0
  43. /package/src/components/{layout → Layout}/TabbedLayout.vue +0 -0
  44. /package/src/components/{layout → Layout}/Tabs.vue +0 -0
  45. /package/src/components/{layout → Layout}/TabsBody.vue +0 -0
  46. /package/src/components/{layout → Layout}/TabsNav.vue +0 -0
  47. /package/src/components/{layout → Layout}/index.ts +0 -0
  48. /package/src/components/{layout → Layout}/tabsManager.ts +0 -0
  49. /package/src/components/{lightbox → Lightbox}/Lightbox.vue +0 -0
  50. /package/src/components/{lightbox → Lightbox}/index.ts +0 -0
  51. /package/src/components/{lightbox → Lightbox}/lightbox.types.ts +0 -0
  52. /package/src/components/{leaflet → MapEmbed}/leaflet.css +0 -0
package/dist/index.mjs CHANGED
@@ -15070,7 +15070,11 @@ function dateField(id, label, options) {
15070
15070
  vIf: options == null ? void 0 : options.vIf,
15071
15071
  attrs: {
15072
15072
  disabled: options == null ? void 0 : options.disabled,
15073
- autocomplete: options == null ? void 0 : options.autocomplete
15073
+ autocomplete: options == null ? void 0 : options.autocomplete,
15074
+ enableTime: options == null ? void 0 : options.enableTime,
15075
+ mode: options == null ? void 0 : options.mode,
15076
+ locale: options == null ? void 0 : options.locale,
15077
+ timezone: options == null ? void 0 : options.timezone
15074
15078
  }
15075
15079
  };
15076
15080
  }
@@ -16073,7 +16077,7 @@ const _hoisted_12$4 = {
16073
16077
  const _hoisted_13$3 = ["disabled", "onClick"];
16074
16078
  const _hoisted_14$3 = {
16075
16079
  key: 0,
16076
- class: "time-picker border-start flex column gap-1 w-120px"
16080
+ class: "time-picker border-start flex column gap-1 w-120px px-025"
16077
16081
  };
16078
16082
  const _hoisted_15$3 = { class: "flex gap-025" };
16079
16083
  const _hoisted_16$3 = { class: "txt-center opacity-6 txt14" };
@@ -16088,7 +16092,13 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
16088
16092
  modelValue: {},
16089
16093
  min: {},
16090
16094
  max: {},
16091
- timezone: { default: "UTC" },
16095
+ timezone: { default: () => {
16096
+ try {
16097
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
16098
+ } catch {
16099
+ return "UTC";
16100
+ }
16101
+ } },
16092
16102
  mode: { default: "day" },
16093
16103
  defaultValue: {},
16094
16104
  firstDayOfWeek: { default: WEEK_START_DAY.SUNDAY },
@@ -16311,6 +16321,16 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
16311
16321
  const date2 = parseUserInput(input.value);
16312
16322
  if (date2) {
16313
16323
  if (props2.enableTime) {
16324
+ try {
16325
+ const targetDate = new Date(date2.toLocaleString("en-US", { timeZone: props2.timezone }));
16326
+ const tzOffset = targetDate.getTime() - date2.getTime();
16327
+ date2.setTime(date2.getTime() - tzOffset);
16328
+ } catch {
16329
+ if (props2.timezone === "UTC") {
16330
+ const tzOffset = (/* @__PURE__ */ new Date()).getTimezoneOffset();
16331
+ date2.setMinutes(date2.getMinutes() + tzOffset);
16332
+ }
16333
+ }
16314
16334
  emit2("update:modelValue", date2.toISOString());
16315
16335
  } else {
16316
16336
  const utcDate = new Date(Date.UTC(date2.getFullYear(), date2.getMonth(), date2.getDate()));
@@ -16334,6 +16354,16 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
16334
16354
  const date2 = parseUserInput(inputValue.value);
16335
16355
  if (date2) {
16336
16356
  if (props2.enableTime) {
16357
+ try {
16358
+ const targetDate = new Date(date2.toLocaleString("en-US", { timeZone: props2.timezone }));
16359
+ const tzOffset = targetDate.getTime() - date2.getTime();
16360
+ date2.setTime(date2.getTime() - tzOffset);
16361
+ } catch {
16362
+ if (props2.timezone === "UTC") {
16363
+ const tzOffset = (/* @__PURE__ */ new Date()).getTimezoneOffset();
16364
+ date2.setMinutes(date2.getMinutes() + tzOffset);
16365
+ }
16366
+ }
16337
16367
  emit2("update:modelValue", date2.toISOString());
16338
16368
  } else {
16339
16369
  const utcDate = new Date(Date.UTC(date2.getFullYear(), date2.getMonth(), date2.getDate()));
@@ -16370,9 +16400,15 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
16370
16400
  const currentMinutes = ((_b = selectedDate.value) == null ? void 0 : _b.getMinutes()) ?? (/* @__PURE__ */ new Date()).getMinutes();
16371
16401
  newDate.setHours(currentHours);
16372
16402
  newDate.setMinutes(currentMinutes);
16373
- if (props2.timezone === "UTC") {
16374
- const tzOffset = (/* @__PURE__ */ new Date()).getTimezoneOffset();
16375
- newDate.setMinutes(newDate.getMinutes() + tzOffset);
16403
+ try {
16404
+ const targetDate = new Date(newDate.toLocaleString("en-US", { timeZone: props2.timezone }));
16405
+ const tzOffset = targetDate.getTime() - newDate.getTime();
16406
+ newDate.setTime(newDate.getTime() - tzOffset);
16407
+ } catch {
16408
+ if (props2.timezone === "UTC") {
16409
+ const tzOffset = (/* @__PURE__ */ new Date()).getTimezoneOffset();
16410
+ newDate.setMinutes(newDate.getMinutes() + tzOffset);
16411
+ }
16376
16412
  }
16377
16413
  emit2("update:modelValue", newDate.toISOString());
16378
16414
  } else {
@@ -16589,7 +16625,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
16589
16625
  };
16590
16626
  }
16591
16627
  });
16592
- const DateInput = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-ca4c1d9b"]]);
16628
+ const DateInput = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-80df1413"]]);
16593
16629
  const _hoisted_1$F = ["title"];
16594
16630
  const _hoisted_2$t = { key: 0 };
16595
16631
  const _hoisted_3$o = {
@@ -17590,7 +17626,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
17590
17626
  const precision = ((_a = __props.step.toString().split(".")[1]) == null ? void 0 : _a.length) || 0;
17591
17627
  return Number.parseFloat(numArr.reduce((acc, curr) => acc - curr, firstNum).toFixed(precision));
17592
17628
  }
17593
- const canAdd = computed(() => !(__props.max !== void 0 && add(numberValue.value, __props.step) <= __props.max));
17629
+ const canAdd = computed(() => __props.max === void 0 || add(numberValue.value, __props.step) <= __props.max);
17594
17630
  const canDecrement = computed(() => __props.min === void 0 || subtract(numberValue.value, __props.step) >= __props.min);
17595
17631
  function increment() {
17596
17632
  if (!canAdd.value) return;
@@ -17743,7 +17779,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
17743
17779
  };
17744
17780
  }
17745
17781
  });
17746
- const NumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-01b5487f"]]);
17782
+ const NumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-b3711c9e"]]);
17747
17783
  const _hoisted_1$A = ["value", "autofocus", "onKeydown", "onPaste"];
17748
17784
  const _sfc_main$H = /* @__PURE__ */ defineComponent({
17749
17785
  __name: "OTP",
@@ -33694,7 +33730,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
33694
33730
  };
33695
33731
  }
33696
33732
  });
33697
- const BottomMenu = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-2227f9cc"]]);
33733
+ const BottomMenu = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-864b768d"]]);
33698
33734
  const _sfc_main$o = /* @__PURE__ */ defineComponent({
33699
33735
  __name: "Layout",
33700
33736
  props: {
@@ -33707,11 +33743,11 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
33707
33743
  },
33708
33744
  setup(__props) {
33709
33745
  useCssVars((_ctx) => ({
33710
- "16111f2e": gapSize.value,
33711
- "2c189afc": gridTemplateRows.value,
33712
- "243c3a94": gridTemplateColumns.value,
33713
- "84a9b646": mGridTemplateRows.value,
33714
- "55be334e": mGridTemplateColumns.value
33746
+ "39f67c85": gapSize.value,
33747
+ "0abc670b": gridTemplateRows.value,
33748
+ "40854d6b": gridTemplateColumns.value,
33749
+ "940dfd18": mGridTemplateRows.value,
33750
+ "41fa2e62": mGridTemplateColumns.value
33715
33751
  }));
33716
33752
  const props2 = __props;
33717
33753
  const gridTemplateRows = computed(() => props2.rows.length > 0 ? props2.rows.join(" ") : "auto");
@@ -33736,7 +33772,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
33736
33772
  };
33737
33773
  }
33738
33774
  });
33739
- const Layout = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-1814129a"]]);
33775
+ const Layout = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-d3589d43"]]);
33740
33776
  const _hoisted_1$i = { key: 0 };
33741
33777
  const _sfc_main$n = /* @__PURE__ */ defineComponent({
33742
33778
  __name: "SidebarMenu",
@@ -33812,7 +33848,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
33812
33848
  };
33813
33849
  }
33814
33850
  });
33815
- const SidebarMenu = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-951fdacc"]]);
33851
+ const SidebarMenu = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-4b730e73"]]);
33816
33852
  const _sfc_main$m = /* @__PURE__ */ defineComponent({
33817
33853
  __name: "Skeleton",
33818
33854
  props: {
@@ -33844,7 +33880,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
33844
33880
  };
33845
33881
  }
33846
33882
  });
33847
- const Skeleton = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-8788ed73"]]);
33883
+ const Skeleton = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-7bce7e33"]]);
33848
33884
  const _hoisted_1$h = { class: "bgl_card tabs-top" };
33849
33885
  const _hoisted_2$a = { class: "tabs grid auto-flow-columns fit-content" };
33850
33886
  const _hoisted_3$7 = ["onClick"];
@@ -33908,7 +33944,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
33908
33944
  };
33909
33945
  }
33910
33946
  });
33911
- const TabbedLayout = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-915732c1"]]);
33947
+ const TabbedLayout = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-138a7441"]]);
33912
33948
  const state = reactive(/* @__PURE__ */ new Map());
33913
33949
  function useTabs(group) {
33914
33950
  if (!state.has(group)) {
@@ -34085,7 +34121,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
34085
34121
  };
34086
34122
  }
34087
34123
  });
34088
- const TabsNav = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-6ece2018"]]);
34124
+ const TabsNav = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-2e964f00"]]);
34089
34125
  const _hoisted_1$e = { class: "no-margin ellipsis line-height-14 pb-025" };
34090
34126
  const _hoisted_2$9 = { class: "txt12 no-margin txt-gray ellipsis" };
34091
34127
  const _sfc_main$h = /* @__PURE__ */ defineComponent({
@@ -34222,7 +34258,7 @@ const _hoisted_1$b = ["id"];
34222
34258
  const defaultMarkerSVG = '<svg width="28" height="38" viewBox="0 0 28 38" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.2263 37.7955C17.0897 37.7955 19.4109 37.0138 19.4109 36.0496C19.4109 35.0854 17.0897 34.3037 14.2263 34.3037C11.363 34.3037 9.04175 35.0854 9.04175 36.0496C9.04175 37.0138 11.363 37.7955 14.2263 37.7955Z" fill="black" fill-opacity="0.1"/><path d="M14.2265 0.549591C21.2842 0.549591 27.0131 6.23786 27.0787 13.28V13.4024C27.0787 19.3328 24.4759 24.4306 21.5627 28.2764C18.6511 32.12 15.4577 34.6754 14.3457 35.5097C14.2748 35.5629 14.1778 35.5629 14.1068 35.5097C12.9947 34.675 9.80135 32.1197 6.88984 28.2762C3.97665 24.4304 1.37378 19.3328 1.37378 13.4024C1.37378 6.30387 7.12806 0.549591 14.2265 0.549591Z" fill="#ED1b3E" stroke="#ED6C6F"/><path d="M14.2263 21.6185C18.7639 21.6185 22.4424 17.94 22.4424 13.4024C22.4424 8.86477 18.7639 5.18631 14.2263 5.18631C9.68872 5.18631 6.01025 8.86477 6.01025 13.4024C6.01025 17.94 9.68872 21.6185 14.2263 21.6185Z" fill="white"/></svg>';
34223
34259
  const leafletScriptUrl = "https://unpkg.com/leaflet@1.9.4/dist/leaflet.js";
34224
34260
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
34225
- __name: "MapEmbed",
34261
+ __name: "Index",
34226
34262
  props: {
34227
34263
  center: { default: () => [31.7683, 35.2137] },
34228
34264
  zoom: { default: 15 },
@@ -36780,7 +36816,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36780
36816
  };
36781
36817
  }
36782
36818
  });
36783
- const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-977a5319"]]);
36819
+ const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c7371018"]]);
36784
36820
  const groups = {};
36785
36821
  let clickHandler = (_e2) => void 0;
36786
36822
  const lightboxDirective = {
@@ -37577,7 +37613,6 @@ function getBrowserNavigatorLocale() {
37577
37613
  return navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language;
37578
37614
  }
37579
37615
  function formatDate(date2, format2 = "dd.mm.yy", locale2) {
37580
- var _a;
37581
37616
  if (!date2) return "";
37582
37617
  locale2 = locale2 || getBrowserNavigatorLocale();
37583
37618
  try {
@@ -37586,8 +37621,6 @@ function formatDate(date2, format2 = "dd.mm.yy", locale2) {
37586
37621
  console.warn("Invalid date provided to formatDate:", date2);
37587
37622
  return "";
37588
37623
  }
37589
- const separator = ((_a = format2.match(/[^\w\s]/)) == null ? void 0 : _a[0]) || ".";
37590
- const formatParts = format2.split(/[^\w\s]/);
37591
37624
  const datePartsMap = {
37592
37625
  dd: String(d2.getDate()).padStart(2, "0"),
37593
37626
  ddd: d2.toLocaleString(locale2, { weekday: "short" }),
@@ -37629,15 +37662,11 @@ function formatDate(date2, format2 = "dd.mm.yy", locale2) {
37629
37662
  if (partsMap.dayPeriod) {
37630
37663
  datePartsMap.ampm = partsMap.dayPeriod;
37631
37664
  }
37632
- let formattedDate = "";
37633
- for (let i2 = 0; i2 < formatParts.length; i2++) {
37634
- const part = formatParts[i2];
37635
- if (datePartsMap[part]) {
37636
- formattedDate += datePartsMap[part];
37637
- }
37638
- if (i2 < formatParts.length - 1) {
37639
- formattedDate += separator;
37640
- }
37665
+ let formattedDate = format2;
37666
+ const tokens = Object.keys(datePartsMap).sort((a2, b2) => b2.length - a2.length);
37667
+ for (const token of tokens) {
37668
+ const regex2 = new RegExp(token, "g");
37669
+ formattedDate = formattedDate.replace(regex2, datePartsMap[token]);
37641
37670
  }
37642
37671
  return formattedDate;
37643
37672
  } catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"bagel.d.ts","sourceRoot":"","sources":["../../src/plugins/bagel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAQrC,eAAO,MAAM,iBAAiB,EAAsB,YAAY,CAAC,KAAK,CAAC,CAAA;AACvE,eAAO,MAAM,iBAAiB,EAAsB,YAAY,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,CAAA;AAEzF,wBAAgB,QAAQ,UAKvB;AAED,wBAAgB,QAAQ,UAT+C,MAAM,KAAK,MAAM,CAcvF;AAED,MAAM,WAAW,YAAY;IAC5B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAA;IAE9B,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;CAC/B;AACD,eAAO,MAAM,QAAQ,EAAE,MA0BtB,CAAA"}
1
+ {"version":3,"file":"bagel.d.ts","sourceRoot":"","sources":["../../src/plugins/bagel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAQrC,eAAO,MAAM,iBAAiB,EAAsB,YAAY,CAAC,KAAK,CAAC,CAAA;AACvE,eAAO,MAAM,iBAAiB,EAAsB,YAAY,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,CAAA;AAEzF,wBAAgB,QAAQ,UAIvB;AAED,wBAAgB,QAAQ,UAR+C,MAAM,KAAK,MAAM,CAavF;AAED,MAAM,WAAW,YAAY;IAC5B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAA;IAE9B,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;CAC/B;AACD,eAAO,MAAM,QAAQ,EAAE,MA0BtB,CAAA"}