@bagelink/vue 1.2.25 → 1.2.39
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/components/calendar/Index.vue.d.ts +2 -1
- package/dist/components/calendar/Index.vue.d.ts.map +1 -1
- package/dist/components/calendar/views/DayView.vue.d.ts.map +1 -1
- package/dist/components/calendar/views/MonthView.vue.d.ts +162 -2
- package/dist/components/calendar/views/MonthView.vue.d.ts.map +1 -1
- package/dist/components/calendar/views/WeekView.vue.d.ts +162 -2
- package/dist/components/calendar/views/WeekView.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
- package/dist/index.cjs +39 -50
- package/dist/index.mjs +39 -50
- package/dist/style.css +91 -82
- package/dist/utils/calendar/dateUtils.d.ts +18 -12
- package/dist/utils/calendar/dateUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/calendar/Index.vue +6 -5
- package/src/components/calendar/views/AgendaView.vue +1 -1
- package/src/components/calendar/views/DayView.vue +2 -1
- package/src/components/calendar/views/MonthView.vue +23 -22
- package/src/components/calendar/views/WeekView.vue +10 -9
- package/src/components/form/inputs/DateInput.vue +14 -5
- package/src/utils/calendar/dateUtils.ts +39 -48
package/dist/index.cjs
CHANGED
|
@@ -590,7 +590,7 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
|
|
|
590
590
|
onClick: vue.withModifiers(($event) => emit2("eventClick", event), ["stop"])
|
|
591
591
|
}, [
|
|
592
592
|
vue.createElementVNode("div", _hoisted_3$C, [
|
|
593
|
-
vue.createElementVNode("div", _hoisted_4$p, vue.toDisplayString(vue.unref(formatDate)(event.start_time, "HH:mm")), 1),
|
|
593
|
+
vue.createElementVNode("div", _hoisted_4$p, vue.toDisplayString(vue.unref(formatDate)(event.start_time, { fmt: "HH:mm" })), 1),
|
|
594
594
|
vue.createElementVNode("div", _hoisted_5$o, [
|
|
595
595
|
vue.createElementVNode("div", _hoisted_6$l, vue.toDisplayString(event.title), 1),
|
|
596
596
|
vue.createElementVNode("div", {
|
|
@@ -605,7 +605,7 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
|
|
|
605
605
|
};
|
|
606
606
|
}
|
|
607
607
|
});
|
|
608
|
-
const AgendaView = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-
|
|
608
|
+
const AgendaView = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-520aee85"]]);
|
|
609
609
|
function calculatePopoverPosition(target, popoverWidth = 300, popoverHeight = 150) {
|
|
610
610
|
const rect = target.getBoundingClientRect();
|
|
611
611
|
const { scrollY, scrollX, innerHeight, innerWidth } = window;
|
|
@@ -857,7 +857,7 @@ const _sfc_main$14 = /* @__PURE__ */ vue.defineComponent({
|
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
859
|
});
|
|
860
|
-
const DayView = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-
|
|
860
|
+
const DayView = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-bc647d79"]]);
|
|
861
861
|
const _hoisted_1$V = { class: "month-view" };
|
|
862
862
|
const _hoisted_2$G = { class: "month-header" };
|
|
863
863
|
const _hoisted_3$A = { class: "month-grid" };
|
|
@@ -971,7 +971,7 @@ const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
|
|
|
971
971
|
"other-month": !day.isCurrentMonth
|
|
972
972
|
}])
|
|
973
973
|
}, [
|
|
974
|
-
vue.createElementVNode("div", _hoisted_4$n, vue.toDisplayString(vue.unref(
|
|
974
|
+
vue.createElementVNode("div", _hoisted_4$n, vue.toDisplayString(vue.unref(fmtDate)(day.date, { fmt: "DD" })), 1),
|
|
975
975
|
vue.createElementVNode("div", _hoisted_5$m, [
|
|
976
976
|
isMobile.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
977
977
|
day.events.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$j)) : vue.createCommentVNode("", true)
|
|
@@ -983,7 +983,7 @@ const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
|
|
|
983
983
|
onClick: vue.withModifiers(($event) => vue.unref(slots).eventContent ? openPopover$1(event, $event) : emit2("eventClick", event), ["stop"])
|
|
984
984
|
}, [
|
|
985
985
|
vue.createElementVNode("div", _hoisted_8$7, vue.toDisplayString(event.title), 1),
|
|
986
|
-
vue.createElementVNode("div", _hoisted_9$6, vue.toDisplayString(vue.unref(
|
|
986
|
+
vue.createElementVNode("div", _hoisted_9$6, vue.toDisplayString(vue.unref(fmtDate)(event.start_time, { fmt: "HH:mm" })), 1)
|
|
987
987
|
], 12, _hoisted_7$f);
|
|
988
988
|
}), 128))
|
|
989
989
|
])
|
|
@@ -1013,12 +1013,12 @@ const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1013
1013
|
};
|
|
1014
1014
|
}
|
|
1015
1015
|
});
|
|
1016
|
-
const MonthView = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-
|
|
1016
|
+
const MonthView = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-eeb8abde"]]);
|
|
1017
1017
|
const _hoisted_1$U = { class: "w-100p overflow-hidden m_overflow h-100p grid" };
|
|
1018
1018
|
const _hoisted_2$F = { class: "weekGrid border-bottom me-1" };
|
|
1019
1019
|
const _hoisted_3$z = { class: "overflow h-100p pe-05" };
|
|
1020
1020
|
const _hoisted_4$m = ["onClick"];
|
|
1021
|
-
const _hoisted_5$l = { class: "overflow-hidden color-
|
|
1021
|
+
const _hoisted_5$l = { class: "overflow-hidden color-white p-025 txt12 h-100p" };
|
|
1022
1022
|
const _hoisted_6$i = { class: "white-space ellipsis-1" };
|
|
1023
1023
|
const _hoisted_7$e = { class: "txt10 opacity-8" };
|
|
1024
1024
|
const slotHeight = 60;
|
|
@@ -1100,7 +1100,7 @@ const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1100
1100
|
top: top2,
|
|
1101
1101
|
height,
|
|
1102
1102
|
left: 0,
|
|
1103
|
-
width:
|
|
1103
|
+
width: 100,
|
|
1104
1104
|
overlappingEvents: 0,
|
|
1105
1105
|
position: 0
|
|
1106
1106
|
};
|
|
@@ -1210,13 +1210,13 @@ const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1210
1210
|
key: day.toISOString(),
|
|
1211
1211
|
class: "day-header p-05 txt-center"
|
|
1212
1212
|
}, [
|
|
1213
|
-
vue.createTextVNode(vue.toDisplayString(vue.unref(
|
|
1213
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(fmtDate)(day, { fmt: "DDD" })) + " ", 1),
|
|
1214
1214
|
vue.createElementVNode("span", {
|
|
1215
1215
|
class: vue.normalizeClass(["txt-12 round p-025", {
|
|
1216
1216
|
"color-gray": day.toDateString() !== (/* @__PURE__ */ new Date()).toDateString(),
|
|
1217
1217
|
"bg-primary color-white": day.toDateString() === (/* @__PURE__ */ new Date()).toDateString()
|
|
1218
1218
|
}])
|
|
1219
|
-
}, vue.toDisplayString(vue.unref(
|
|
1219
|
+
}, vue.toDisplayString(vue.unref(fmtDate)(day, { fmt: "DD" })), 3)
|
|
1220
1220
|
]);
|
|
1221
1221
|
}), 128))
|
|
1222
1222
|
]),
|
|
@@ -1262,7 +1262,7 @@ const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1262
1262
|
}, [
|
|
1263
1263
|
vue.createElementVNode("div", _hoisted_5$l, [
|
|
1264
1264
|
vue.createElementVNode("div", _hoisted_6$i, vue.toDisplayString(event.title), 1),
|
|
1265
|
-
vue.createElementVNode("div", _hoisted_7$e, vue.toDisplayString(vue.unref(
|
|
1265
|
+
vue.createElementVNode("div", _hoisted_7$e, vue.toDisplayString(vue.unref(fmtDate)(event.start_time, { fmt: "HH:mm" })), 1)
|
|
1266
1266
|
])
|
|
1267
1267
|
], 12, _hoisted_4$m);
|
|
1268
1268
|
}), 128))
|
|
@@ -1285,11 +1285,10 @@ const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1285
1285
|
ref_key: "popoverRef",
|
|
1286
1286
|
ref: popoverRef,
|
|
1287
1287
|
thin: "",
|
|
1288
|
-
class: "custom-popover fixed z-999 radius-
|
|
1288
|
+
class: "custom-popover fixed z-999 radius-1 bg-white",
|
|
1289
1289
|
style: vue.normalizeStyle({
|
|
1290
1290
|
top: `${popoverPosition.value.top}px`,
|
|
1291
|
-
left: `${popoverPosition.value.left}px
|
|
1292
|
-
maxWidth: `${popoverPosition.value.width}px`
|
|
1291
|
+
left: `${popoverPosition.value.left}px`
|
|
1293
1292
|
})
|
|
1294
1293
|
}, {
|
|
1295
1294
|
default: vue.withCtx(() => [
|
|
@@ -1304,7 +1303,7 @@ const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1304
1303
|
};
|
|
1305
1304
|
}
|
|
1306
1305
|
});
|
|
1307
|
-
const WeekView = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-
|
|
1306
|
+
const WeekView = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-b897fbe8"]]);
|
|
1308
1307
|
const _hoisted_1$T = { class: "calendar" };
|
|
1309
1308
|
const _hoisted_2$E = { class: "flex m_block m_pb-1" };
|
|
1310
1309
|
const _hoisted_3$y = { class: "txt-light my-0" };
|
|
@@ -1312,7 +1311,7 @@ const _hoisted_4$l = { class: "ms-auto flex gap-025" };
|
|
|
1312
1311
|
const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
|
|
1313
1312
|
__name: "Index",
|
|
1314
1313
|
props: {
|
|
1315
|
-
events: {},
|
|
1314
|
+
events: { default: () => [] },
|
|
1316
1315
|
startDate: { default: () => /* @__PURE__ */ new Date() },
|
|
1317
1316
|
view: { default: "Week" },
|
|
1318
1317
|
weekStart: { default: "Sunday" }
|
|
@@ -1372,8 +1371,8 @@ const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1372
1371
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$T, [
|
|
1373
1372
|
vue.createElementVNode("div", _hoisted_2$E, [
|
|
1374
1373
|
vue.createElementVNode("h3", _hoisted_3$y, [
|
|
1375
|
-
vue.createElementVNode("b", null, vue.toDisplayString(vue.unref(
|
|
1376
|
-
vue.createTextVNode(" " + vue.toDisplayString(vue.unref(
|
|
1374
|
+
vue.createElementVNode("b", null, vue.toDisplayString(vue.unref(fmtDate)(currentDate.value, { fmt: "MMMM" })), 1),
|
|
1375
|
+
vue.createTextVNode(" " + vue.toDisplayString(vue.unref(fmtDate)(currentDate.value, { fmt: "YYYY" })), 1)
|
|
1377
1376
|
]),
|
|
1378
1377
|
vue.createElementVNode("div", _hoisted_4$l, [
|
|
1379
1378
|
vue.createVNode(vue.unref(_sfc_main$W), {
|
|
@@ -1433,7 +1432,7 @@ const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1433
1432
|
};
|
|
1434
1433
|
}
|
|
1435
1434
|
});
|
|
1436
|
-
const Index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-
|
|
1435
|
+
const Index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-36ea5622"]]);
|
|
1437
1436
|
const _hoisted_1$S = {
|
|
1438
1437
|
key: 0,
|
|
1439
1438
|
class: "card_label"
|
|
@@ -8086,7 +8085,7 @@ ${indent}}`;
|
|
|
8086
8085
|
richtext: RichText,
|
|
8087
8086
|
upload: UploadInput,
|
|
8088
8087
|
file: UploadInput,
|
|
8089
|
-
date:
|
|
8088
|
+
date: _sfc_main$L,
|
|
8090
8089
|
tabs: TabsNav,
|
|
8091
8090
|
form: _sfc_main$T,
|
|
8092
8091
|
range: RangeInput
|
|
@@ -15127,7 +15126,7 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
|
15127
15126
|
function useFormatting() {
|
|
15128
15127
|
const formatDisplayDate2 = (date2) => {
|
|
15129
15128
|
if (!date2) return "";
|
|
15130
|
-
return
|
|
15129
|
+
return fmtDate(date2, { fmt: props2.enableTime ? "DD.MM.YY HH:mm" : "DD.MM.YY" });
|
|
15131
15130
|
};
|
|
15132
15131
|
const parseUserInput2 = (input) => {
|
|
15133
15132
|
const date2 = new Date(input);
|
|
@@ -15213,7 +15212,6 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
|
15213
15212
|
(...args) => vue.unref(handleFocus) && vue.unref(handleFocus)(...args))
|
|
15214
15213
|
}, [
|
|
15215
15214
|
_ctx.label ? (vue.openBlock(), vue.createElementBlock("label", _hoisted_2$s, [
|
|
15216
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.label) + " ", 1),
|
|
15217
15215
|
_ctx.required ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$o, "*")) : vue.createCommentVNode("", true)
|
|
15218
15216
|
])) : vue.createCommentVNode("", true),
|
|
15219
15217
|
vue.createVNode(vue.unref(_sfc_main$W), {
|
|
@@ -15234,7 +15232,7 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
|
15234
15232
|
}, [
|
|
15235
15233
|
vue.createVNode(vue.unref(TextInput), {
|
|
15236
15234
|
modelValue: vue.unref(formatDisplayDate)(selectedDate.value),
|
|
15237
|
-
|
|
15235
|
+
iconStart: "calendar",
|
|
15238
15236
|
min: vue.unref(formatDisplayDate)(_ctx.min),
|
|
15239
15237
|
max: vue.unref(formatDisplayDate)(_ctx.max),
|
|
15240
15238
|
required: _ctx.required,
|
|
@@ -15275,7 +15273,6 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
|
15275
15273
|
};
|
|
15276
15274
|
}
|
|
15277
15275
|
});
|
|
15278
|
-
const DateInput = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-6202aa21"]]);
|
|
15279
15276
|
const _hoisted_1$D = { class: "bagel-input" };
|
|
15280
15277
|
const _hoisted_2$r = {
|
|
15281
15278
|
key: 0,
|
|
@@ -36354,23 +36351,14 @@ function getBrowserNavigatorLocale() {
|
|
|
36354
36351
|
if (typeof navigator !== "object") return "en-US";
|
|
36355
36352
|
return navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language;
|
|
36356
36353
|
}
|
|
36357
|
-
function handleTimezone(date2,
|
|
36358
|
-
if (timeZone === "UTC") {
|
|
36354
|
+
function handleTimezone(date2, locale2, intFmtOpt) {
|
|
36355
|
+
if (intFmtOpt.timeZone === "UTC") {
|
|
36359
36356
|
const utcDate = new Date(date2.getTime());
|
|
36360
36357
|
utcDate.setMinutes(utcDate.getMinutes() + date2.getTimezoneOffset());
|
|
36361
36358
|
return utcDate;
|
|
36362
36359
|
}
|
|
36363
36360
|
try {
|
|
36364
|
-
const formatter = new Intl.DateTimeFormat(
|
|
36365
|
-
timeZone,
|
|
36366
|
-
timeZoneName: "short",
|
|
36367
|
-
year: "numeric",
|
|
36368
|
-
month: "numeric",
|
|
36369
|
-
day: "numeric",
|
|
36370
|
-
hour: "numeric",
|
|
36371
|
-
minute: "numeric",
|
|
36372
|
-
second: "numeric"
|
|
36373
|
-
});
|
|
36361
|
+
const formatter = new Intl.DateTimeFormat(locale2, intFmtOpt);
|
|
36374
36362
|
const formattedParts = formatter.formatToParts(date2);
|
|
36375
36363
|
const parts = {};
|
|
36376
36364
|
formattedParts.forEach((part) => {
|
|
@@ -36389,12 +36377,12 @@ function handleTimezone(date2, timeZone) {
|
|
|
36389
36377
|
);
|
|
36390
36378
|
return adjustedDate;
|
|
36391
36379
|
} catch (error) {
|
|
36392
|
-
console.warn(`Error handling timezone ${timeZone}:`, error);
|
|
36380
|
+
console.warn(`Error handling timezone ${intFmtOpt.timeZone}:`, error);
|
|
36393
36381
|
return date2;
|
|
36394
36382
|
}
|
|
36395
36383
|
}
|
|
36396
|
-
function getDatePartsMap(date2, locale2,
|
|
36397
|
-
const d2 = timeZone ? handleTimezone(date2,
|
|
36384
|
+
function getDatePartsMap(date2, locale2, intFmtOpt) {
|
|
36385
|
+
const d2 = (intFmtOpt == null ? void 0 : intFmtOpt.timeZone) ? handleTimezone(date2, locale2, intFmtOpt) : date2;
|
|
36398
36386
|
return {
|
|
36399
36387
|
AmPm: d2.toLocaleString(locale2, { hour: "numeric", hour12: true, minute: "numeric" }).split(" ")[1],
|
|
36400
36388
|
DD: String(d2.getDate()).padStart(2, "0"),
|
|
@@ -36414,21 +36402,23 @@ function getDatePartsMap(date2, locale2, timeZone) {
|
|
|
36414
36402
|
const _datePartsMapNow = getDatePartsMap(/* @__PURE__ */ new Date(), getBrowserNavigatorLocale());
|
|
36415
36403
|
const _orderedDateTokens = Object.keys(_datePartsMapNow).sort((a2, b2) => b2.length - a2.length);
|
|
36416
36404
|
const _tokenRegExPattern = new RegExp(_orderedDateTokens.map((token) => token).join("|"), "g");
|
|
36417
|
-
|
|
36405
|
+
function formatDate(date2, opts = {}) {
|
|
36406
|
+
let { fmt: format2, locale: locale2, tz: timeZone, ...rest } = opts;
|
|
36418
36407
|
if (!date2) return "";
|
|
36419
36408
|
format2 = format2 || "DD.MM.YY";
|
|
36420
36409
|
locale2 = locale2 || getBrowserNavigatorLocale();
|
|
36421
36410
|
try {
|
|
36422
|
-
const d2 = typeof date2 === "string" ? new Date(date2) : date2;
|
|
36411
|
+
const d2 = typeof date2 === "string" || typeof date2 === "number" ? new Date(date2) : date2;
|
|
36423
36412
|
if (Number.isNaN(d2.getTime())) {
|
|
36424
36413
|
console.warn("Invalid date provided to formatDate:", date2);
|
|
36425
36414
|
return "";
|
|
36426
36415
|
}
|
|
36427
|
-
const
|
|
36428
|
-
const formatter = new Intl.DateTimeFormat(locale2, {
|
|
36416
|
+
const intFmtOpt = {
|
|
36429
36417
|
day: "numeric",
|
|
36430
36418
|
hour: "2-digit",
|
|
36431
|
-
hour12
|
|
36419
|
+
// Set default hour12 to true if not explicitly set
|
|
36420
|
+
// hour12: true,
|
|
36421
|
+
hour12: rest.hour12 === void 0 ? true : rest.hour12,
|
|
36432
36422
|
minute: "2-digit",
|
|
36433
36423
|
month: "long",
|
|
36434
36424
|
second: "2-digit",
|
|
@@ -36436,7 +36426,9 @@ const formatDate = (date2, format2, locale2, timeZone) => {
|
|
|
36436
36426
|
// Add timeZone if provided
|
|
36437
36427
|
weekday: "long",
|
|
36438
36428
|
year: "numeric"
|
|
36439
|
-
}
|
|
36429
|
+
};
|
|
36430
|
+
const datePartsMap = getDatePartsMap(d2, locale2, intFmtOpt);
|
|
36431
|
+
const formatter = new Intl.DateTimeFormat(locale2, intFmtOpt);
|
|
36440
36432
|
const formattedParts = formatter.formatToParts(d2);
|
|
36441
36433
|
const partsMap = {};
|
|
36442
36434
|
formattedParts.forEach((part) => {
|
|
@@ -36463,11 +36455,8 @@ const formatDate = (date2, format2, locale2, timeZone) => {
|
|
|
36463
36455
|
console.warn(`Error formatting date: ${date2} with format: ${format2}`, error);
|
|
36464
36456
|
return "";
|
|
36465
36457
|
}
|
|
36466
|
-
};
|
|
36467
|
-
function fmtDate(opts) {
|
|
36468
|
-
const { date: date2, format: format2, locale: locale2, timeZone } = opts;
|
|
36469
|
-
return formatDate(date2, format2, locale2, timeZone);
|
|
36470
36458
|
}
|
|
36459
|
+
const fmtDate = formatDate;
|
|
36471
36460
|
const IMAGE_FORMATS = ["jpeg", "png", "webp", "avif", "apng", "gif", "avifs", "svg", "bmp", "jpg", "heic", "heif", "ico", "cur", "tif", "tiff"];
|
|
36472
36461
|
const IMAGE_FORMATS_REGEXP = new RegExp(`(${IMAGE_FORMATS.join("|")})$`, "i");
|
|
36473
36462
|
const VIDEO_FORMATS = ["mp4", "webm", "ogg", "mov", "avi", "flv", "wmv", "mkv", "ts", "m3u8"];
|
|
@@ -36494,7 +36483,7 @@ exports.CodeEditor = CodeEditor;
|
|
|
36494
36483
|
exports.ColorInput = _sfc_main$N;
|
|
36495
36484
|
exports.DataPreview = DataPreview;
|
|
36496
36485
|
exports.DataTable = DataTable;
|
|
36497
|
-
exports.DateInput =
|
|
36486
|
+
exports.DateInput = _sfc_main$L;
|
|
36498
36487
|
exports.DatePicker = DatePicker;
|
|
36499
36488
|
exports.Draggable = _sfc_main$X;
|
|
36500
36489
|
exports.Dropdown = _sfc_main$W;
|
package/dist/index.mjs
CHANGED
|
@@ -588,7 +588,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
588
588
|
onClick: withModifiers(($event) => emit2("eventClick", event), ["stop"])
|
|
589
589
|
}, [
|
|
590
590
|
createElementVNode("div", _hoisted_3$C, [
|
|
591
|
-
createElementVNode("div", _hoisted_4$p, toDisplayString(unref(formatDate)(event.start_time, "HH:mm")), 1),
|
|
591
|
+
createElementVNode("div", _hoisted_4$p, toDisplayString(unref(formatDate)(event.start_time, { fmt: "HH:mm" })), 1),
|
|
592
592
|
createElementVNode("div", _hoisted_5$o, [
|
|
593
593
|
createElementVNode("div", _hoisted_6$l, toDisplayString(event.title), 1),
|
|
594
594
|
createElementVNode("div", {
|
|
@@ -603,7 +603,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
603
603
|
};
|
|
604
604
|
}
|
|
605
605
|
});
|
|
606
|
-
const AgendaView = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-
|
|
606
|
+
const AgendaView = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-520aee85"]]);
|
|
607
607
|
function calculatePopoverPosition(target, popoverWidth = 300, popoverHeight = 150) {
|
|
608
608
|
const rect = target.getBoundingClientRect();
|
|
609
609
|
const { scrollY, scrollX, innerHeight, innerWidth } = window;
|
|
@@ -855,7 +855,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
855
855
|
};
|
|
856
856
|
}
|
|
857
857
|
});
|
|
858
|
-
const DayView = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-
|
|
858
|
+
const DayView = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-bc647d79"]]);
|
|
859
859
|
const _hoisted_1$V = { class: "month-view" };
|
|
860
860
|
const _hoisted_2$G = { class: "month-header" };
|
|
861
861
|
const _hoisted_3$A = { class: "month-grid" };
|
|
@@ -969,7 +969,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
969
969
|
"other-month": !day.isCurrentMonth
|
|
970
970
|
}])
|
|
971
971
|
}, [
|
|
972
|
-
createElementVNode("div", _hoisted_4$n, toDisplayString(unref(
|
|
972
|
+
createElementVNode("div", _hoisted_4$n, toDisplayString(unref(fmtDate)(day.date, { fmt: "DD" })), 1),
|
|
973
973
|
createElementVNode("div", _hoisted_5$m, [
|
|
974
974
|
isMobile.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
975
975
|
day.events.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_6$j)) : createCommentVNode("", true)
|
|
@@ -981,7 +981,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
981
981
|
onClick: withModifiers(($event) => unref(slots).eventContent ? openPopover$1(event, $event) : emit2("eventClick", event), ["stop"])
|
|
982
982
|
}, [
|
|
983
983
|
createElementVNode("div", _hoisted_8$7, toDisplayString(event.title), 1),
|
|
984
|
-
createElementVNode("div", _hoisted_9$6, toDisplayString(unref(
|
|
984
|
+
createElementVNode("div", _hoisted_9$6, toDisplayString(unref(fmtDate)(event.start_time, { fmt: "HH:mm" })), 1)
|
|
985
985
|
], 12, _hoisted_7$f);
|
|
986
986
|
}), 128))
|
|
987
987
|
])
|
|
@@ -1011,12 +1011,12 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
1011
1011
|
};
|
|
1012
1012
|
}
|
|
1013
1013
|
});
|
|
1014
|
-
const MonthView = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-
|
|
1014
|
+
const MonthView = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-eeb8abde"]]);
|
|
1015
1015
|
const _hoisted_1$U = { class: "w-100p overflow-hidden m_overflow h-100p grid" };
|
|
1016
1016
|
const _hoisted_2$F = { class: "weekGrid border-bottom me-1" };
|
|
1017
1017
|
const _hoisted_3$z = { class: "overflow h-100p pe-05" };
|
|
1018
1018
|
const _hoisted_4$m = ["onClick"];
|
|
1019
|
-
const _hoisted_5$l = { class: "overflow-hidden color-
|
|
1019
|
+
const _hoisted_5$l = { class: "overflow-hidden color-white p-025 txt12 h-100p" };
|
|
1020
1020
|
const _hoisted_6$i = { class: "white-space ellipsis-1" };
|
|
1021
1021
|
const _hoisted_7$e = { class: "txt10 opacity-8" };
|
|
1022
1022
|
const slotHeight = 60;
|
|
@@ -1098,7 +1098,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
|
1098
1098
|
top: top2,
|
|
1099
1099
|
height,
|
|
1100
1100
|
left: 0,
|
|
1101
|
-
width:
|
|
1101
|
+
width: 100,
|
|
1102
1102
|
overlappingEvents: 0,
|
|
1103
1103
|
position: 0
|
|
1104
1104
|
};
|
|
@@ -1208,13 +1208,13 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
|
1208
1208
|
key: day.toISOString(),
|
|
1209
1209
|
class: "day-header p-05 txt-center"
|
|
1210
1210
|
}, [
|
|
1211
|
-
createTextVNode(toDisplayString(unref(
|
|
1211
|
+
createTextVNode(toDisplayString(unref(fmtDate)(day, { fmt: "DDD" })) + " ", 1),
|
|
1212
1212
|
createElementVNode("span", {
|
|
1213
1213
|
class: normalizeClass(["txt-12 round p-025", {
|
|
1214
1214
|
"color-gray": day.toDateString() !== (/* @__PURE__ */ new Date()).toDateString(),
|
|
1215
1215
|
"bg-primary color-white": day.toDateString() === (/* @__PURE__ */ new Date()).toDateString()
|
|
1216
1216
|
}])
|
|
1217
|
-
}, toDisplayString(unref(
|
|
1217
|
+
}, toDisplayString(unref(fmtDate)(day, { fmt: "DD" })), 3)
|
|
1218
1218
|
]);
|
|
1219
1219
|
}), 128))
|
|
1220
1220
|
]),
|
|
@@ -1260,7 +1260,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
|
1260
1260
|
}, [
|
|
1261
1261
|
createElementVNode("div", _hoisted_5$l, [
|
|
1262
1262
|
createElementVNode("div", _hoisted_6$i, toDisplayString(event.title), 1),
|
|
1263
|
-
createElementVNode("div", _hoisted_7$e, toDisplayString(unref(
|
|
1263
|
+
createElementVNode("div", _hoisted_7$e, toDisplayString(unref(fmtDate)(event.start_time, { fmt: "HH:mm" })), 1)
|
|
1264
1264
|
])
|
|
1265
1265
|
], 12, _hoisted_4$m);
|
|
1266
1266
|
}), 128))
|
|
@@ -1283,11 +1283,10 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
|
1283
1283
|
ref_key: "popoverRef",
|
|
1284
1284
|
ref: popoverRef,
|
|
1285
1285
|
thin: "",
|
|
1286
|
-
class: "custom-popover fixed z-999 radius-
|
|
1286
|
+
class: "custom-popover fixed z-999 radius-1 bg-white",
|
|
1287
1287
|
style: normalizeStyle({
|
|
1288
1288
|
top: `${popoverPosition.value.top}px`,
|
|
1289
|
-
left: `${popoverPosition.value.left}px
|
|
1290
|
-
maxWidth: `${popoverPosition.value.width}px`
|
|
1289
|
+
left: `${popoverPosition.value.left}px`
|
|
1291
1290
|
})
|
|
1292
1291
|
}, {
|
|
1293
1292
|
default: withCtx(() => [
|
|
@@ -1302,7 +1301,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
|
1302
1301
|
};
|
|
1303
1302
|
}
|
|
1304
1303
|
});
|
|
1305
|
-
const WeekView = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-
|
|
1304
|
+
const WeekView = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-b897fbe8"]]);
|
|
1306
1305
|
const _hoisted_1$T = { class: "calendar" };
|
|
1307
1306
|
const _hoisted_2$E = { class: "flex m_block m_pb-1" };
|
|
1308
1307
|
const _hoisted_3$y = { class: "txt-light my-0" };
|
|
@@ -1310,7 +1309,7 @@ const _hoisted_4$l = { class: "ms-auto flex gap-025" };
|
|
|
1310
1309
|
const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
1311
1310
|
__name: "Index",
|
|
1312
1311
|
props: {
|
|
1313
|
-
events: {},
|
|
1312
|
+
events: { default: () => [] },
|
|
1314
1313
|
startDate: { default: () => /* @__PURE__ */ new Date() },
|
|
1315
1314
|
view: { default: "Week" },
|
|
1316
1315
|
weekStart: { default: "Sunday" }
|
|
@@ -1370,8 +1369,8 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
1370
1369
|
return openBlock(), createElementBlock("div", _hoisted_1$T, [
|
|
1371
1370
|
createElementVNode("div", _hoisted_2$E, [
|
|
1372
1371
|
createElementVNode("h3", _hoisted_3$y, [
|
|
1373
|
-
createElementVNode("b", null, toDisplayString(unref(
|
|
1374
|
-
createTextVNode(" " + toDisplayString(unref(
|
|
1372
|
+
createElementVNode("b", null, toDisplayString(unref(fmtDate)(currentDate.value, { fmt: "MMMM" })), 1),
|
|
1373
|
+
createTextVNode(" " + toDisplayString(unref(fmtDate)(currentDate.value, { fmt: "YYYY" })), 1)
|
|
1375
1374
|
]),
|
|
1376
1375
|
createElementVNode("div", _hoisted_4$l, [
|
|
1377
1376
|
createVNode(unref(_sfc_main$W), {
|
|
@@ -1431,7 +1430,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
1431
1430
|
};
|
|
1432
1431
|
}
|
|
1433
1432
|
});
|
|
1434
|
-
const Index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-
|
|
1433
|
+
const Index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-36ea5622"]]);
|
|
1435
1434
|
const _hoisted_1$S = {
|
|
1436
1435
|
key: 0,
|
|
1437
1436
|
class: "card_label"
|
|
@@ -8084,7 +8083,7 @@ ${indent}}`;
|
|
|
8084
8083
|
richtext: RichText,
|
|
8085
8084
|
upload: UploadInput,
|
|
8086
8085
|
file: UploadInput,
|
|
8087
|
-
date:
|
|
8086
|
+
date: _sfc_main$L,
|
|
8088
8087
|
tabs: TabsNav,
|
|
8089
8088
|
form: _sfc_main$T,
|
|
8090
8089
|
range: RangeInput
|
|
@@ -15125,7 +15124,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
15125
15124
|
function useFormatting() {
|
|
15126
15125
|
const formatDisplayDate2 = (date2) => {
|
|
15127
15126
|
if (!date2) return "";
|
|
15128
|
-
return
|
|
15127
|
+
return fmtDate(date2, { fmt: props2.enableTime ? "DD.MM.YY HH:mm" : "DD.MM.YY" });
|
|
15129
15128
|
};
|
|
15130
15129
|
const parseUserInput2 = (input) => {
|
|
15131
15130
|
const date2 = new Date(input);
|
|
@@ -15211,7 +15210,6 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
15211
15210
|
(...args) => unref(handleFocus) && unref(handleFocus)(...args))
|
|
15212
15211
|
}, [
|
|
15213
15212
|
_ctx.label ? (openBlock(), createElementBlock("label", _hoisted_2$s, [
|
|
15214
|
-
createTextVNode(toDisplayString(_ctx.label) + " ", 1),
|
|
15215
15213
|
_ctx.required ? (openBlock(), createElementBlock("span", _hoisted_3$o, "*")) : createCommentVNode("", true)
|
|
15216
15214
|
])) : createCommentVNode("", true),
|
|
15217
15215
|
createVNode(unref(_sfc_main$W), {
|
|
@@ -15232,7 +15230,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
15232
15230
|
}, [
|
|
15233
15231
|
createVNode(unref(TextInput), {
|
|
15234
15232
|
modelValue: unref(formatDisplayDate)(selectedDate.value),
|
|
15235
|
-
|
|
15233
|
+
iconStart: "calendar",
|
|
15236
15234
|
min: unref(formatDisplayDate)(_ctx.min),
|
|
15237
15235
|
max: unref(formatDisplayDate)(_ctx.max),
|
|
15238
15236
|
required: _ctx.required,
|
|
@@ -15273,7 +15271,6 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
15273
15271
|
};
|
|
15274
15272
|
}
|
|
15275
15273
|
});
|
|
15276
|
-
const DateInput = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-6202aa21"]]);
|
|
15277
15274
|
const _hoisted_1$D = { class: "bagel-input" };
|
|
15278
15275
|
const _hoisted_2$r = {
|
|
15279
15276
|
key: 0,
|
|
@@ -36352,23 +36349,14 @@ function getBrowserNavigatorLocale() {
|
|
|
36352
36349
|
if (typeof navigator !== "object") return "en-US";
|
|
36353
36350
|
return navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language;
|
|
36354
36351
|
}
|
|
36355
|
-
function handleTimezone(date2,
|
|
36356
|
-
if (timeZone === "UTC") {
|
|
36352
|
+
function handleTimezone(date2, locale2, intFmtOpt) {
|
|
36353
|
+
if (intFmtOpt.timeZone === "UTC") {
|
|
36357
36354
|
const utcDate = new Date(date2.getTime());
|
|
36358
36355
|
utcDate.setMinutes(utcDate.getMinutes() + date2.getTimezoneOffset());
|
|
36359
36356
|
return utcDate;
|
|
36360
36357
|
}
|
|
36361
36358
|
try {
|
|
36362
|
-
const formatter = new Intl.DateTimeFormat(
|
|
36363
|
-
timeZone,
|
|
36364
|
-
timeZoneName: "short",
|
|
36365
|
-
year: "numeric",
|
|
36366
|
-
month: "numeric",
|
|
36367
|
-
day: "numeric",
|
|
36368
|
-
hour: "numeric",
|
|
36369
|
-
minute: "numeric",
|
|
36370
|
-
second: "numeric"
|
|
36371
|
-
});
|
|
36359
|
+
const formatter = new Intl.DateTimeFormat(locale2, intFmtOpt);
|
|
36372
36360
|
const formattedParts = formatter.formatToParts(date2);
|
|
36373
36361
|
const parts = {};
|
|
36374
36362
|
formattedParts.forEach((part) => {
|
|
@@ -36387,12 +36375,12 @@ function handleTimezone(date2, timeZone) {
|
|
|
36387
36375
|
);
|
|
36388
36376
|
return adjustedDate;
|
|
36389
36377
|
} catch (error) {
|
|
36390
|
-
console.warn(`Error handling timezone ${timeZone}:`, error);
|
|
36378
|
+
console.warn(`Error handling timezone ${intFmtOpt.timeZone}:`, error);
|
|
36391
36379
|
return date2;
|
|
36392
36380
|
}
|
|
36393
36381
|
}
|
|
36394
|
-
function getDatePartsMap(date2, locale2,
|
|
36395
|
-
const d2 = timeZone ? handleTimezone(date2,
|
|
36382
|
+
function getDatePartsMap(date2, locale2, intFmtOpt) {
|
|
36383
|
+
const d2 = (intFmtOpt == null ? void 0 : intFmtOpt.timeZone) ? handleTimezone(date2, locale2, intFmtOpt) : date2;
|
|
36396
36384
|
return {
|
|
36397
36385
|
AmPm: d2.toLocaleString(locale2, { hour: "numeric", hour12: true, minute: "numeric" }).split(" ")[1],
|
|
36398
36386
|
DD: String(d2.getDate()).padStart(2, "0"),
|
|
@@ -36412,21 +36400,23 @@ function getDatePartsMap(date2, locale2, timeZone) {
|
|
|
36412
36400
|
const _datePartsMapNow = getDatePartsMap(/* @__PURE__ */ new Date(), getBrowserNavigatorLocale());
|
|
36413
36401
|
const _orderedDateTokens = Object.keys(_datePartsMapNow).sort((a2, b2) => b2.length - a2.length);
|
|
36414
36402
|
const _tokenRegExPattern = new RegExp(_orderedDateTokens.map((token) => token).join("|"), "g");
|
|
36415
|
-
|
|
36403
|
+
function formatDate(date2, opts = {}) {
|
|
36404
|
+
let { fmt: format2, locale: locale2, tz: timeZone, ...rest } = opts;
|
|
36416
36405
|
if (!date2) return "";
|
|
36417
36406
|
format2 = format2 || "DD.MM.YY";
|
|
36418
36407
|
locale2 = locale2 || getBrowserNavigatorLocale();
|
|
36419
36408
|
try {
|
|
36420
|
-
const d2 = typeof date2 === "string" ? new Date(date2) : date2;
|
|
36409
|
+
const d2 = typeof date2 === "string" || typeof date2 === "number" ? new Date(date2) : date2;
|
|
36421
36410
|
if (Number.isNaN(d2.getTime())) {
|
|
36422
36411
|
console.warn("Invalid date provided to formatDate:", date2);
|
|
36423
36412
|
return "";
|
|
36424
36413
|
}
|
|
36425
|
-
const
|
|
36426
|
-
const formatter = new Intl.DateTimeFormat(locale2, {
|
|
36414
|
+
const intFmtOpt = {
|
|
36427
36415
|
day: "numeric",
|
|
36428
36416
|
hour: "2-digit",
|
|
36429
|
-
hour12
|
|
36417
|
+
// Set default hour12 to true if not explicitly set
|
|
36418
|
+
// hour12: true,
|
|
36419
|
+
hour12: rest.hour12 === void 0 ? true : rest.hour12,
|
|
36430
36420
|
minute: "2-digit",
|
|
36431
36421
|
month: "long",
|
|
36432
36422
|
second: "2-digit",
|
|
@@ -36434,7 +36424,9 @@ const formatDate = (date2, format2, locale2, timeZone) => {
|
|
|
36434
36424
|
// Add timeZone if provided
|
|
36435
36425
|
weekday: "long",
|
|
36436
36426
|
year: "numeric"
|
|
36437
|
-
}
|
|
36427
|
+
};
|
|
36428
|
+
const datePartsMap = getDatePartsMap(d2, locale2, intFmtOpt);
|
|
36429
|
+
const formatter = new Intl.DateTimeFormat(locale2, intFmtOpt);
|
|
36438
36430
|
const formattedParts = formatter.formatToParts(d2);
|
|
36439
36431
|
const partsMap = {};
|
|
36440
36432
|
formattedParts.forEach((part) => {
|
|
@@ -36461,11 +36453,8 @@ const formatDate = (date2, format2, locale2, timeZone) => {
|
|
|
36461
36453
|
console.warn(`Error formatting date: ${date2} with format: ${format2}`, error);
|
|
36462
36454
|
return "";
|
|
36463
36455
|
}
|
|
36464
|
-
};
|
|
36465
|
-
function fmtDate(opts) {
|
|
36466
|
-
const { date: date2, format: format2, locale: locale2, timeZone } = opts;
|
|
36467
|
-
return formatDate(date2, format2, locale2, timeZone);
|
|
36468
36456
|
}
|
|
36457
|
+
const fmtDate = formatDate;
|
|
36469
36458
|
const IMAGE_FORMATS = ["jpeg", "png", "webp", "avif", "apng", "gif", "avifs", "svg", "bmp", "jpg", "heic", "heif", "ico", "cur", "tif", "tiff"];
|
|
36470
36459
|
const IMAGE_FORMATS_REGEXP = new RegExp(`(${IMAGE_FORMATS.join("|")})$`, "i");
|
|
36471
36460
|
const VIDEO_FORMATS = ["mp4", "webm", "ogg", "mov", "avi", "flv", "wmv", "mkv", "ts", "m3u8"];
|
|
@@ -36493,7 +36482,7 @@ export {
|
|
|
36493
36482
|
_sfc_main$N as ColorInput,
|
|
36494
36483
|
DataPreview,
|
|
36495
36484
|
DataTable,
|
|
36496
|
-
DateInput,
|
|
36485
|
+
_sfc_main$L as DateInput,
|
|
36497
36486
|
DatePicker,
|
|
36498
36487
|
_sfc_main$X as Draggable,
|
|
36499
36488
|
_sfc_main$W as Dropdown,
|