@g1cloud/open-bluesea-core 1.0.0-alpha.4 → 1.0.0-alpha.6

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,4 +1,4 @@
1
- import { inject, ref, markRaw, reactive, defineComponent, withDirectives, createBlock, openBlock, resolveDynamicComponent, normalizeClass, withCtx, createElementBlock, createCommentVNode, createElementVNode, toDisplayString, unref, computed, withModifiers, Fragment, renderList, onMounted, onBeforeUnmount, Teleport, createVNode, Transition, normalizeStyle, renderSlot, watch, nextTick, withKeys, provide, shallowRef, useTemplateRef, mergeProps, isRef, toHandlers, vModelDynamic, vModelText, useSlots, vShow, TransitionGroup, resolveComponent } from "vue";
1
+ import { inject, ref, markRaw, reactive, defineComponent, withDirectives, createBlock, openBlock, resolveDynamicComponent, normalizeClass, withCtx, createElementBlock, createCommentVNode, createElementVNode, toDisplayString, unref, computed, withModifiers, Fragment, renderList, onMounted, onBeforeUnmount, Teleport, createVNode, Transition, normalizeStyle, renderSlot, watch, nextTick, withKeys, provide, shallowRef, useTemplateRef, mergeProps, isRef, toHandlers, vModelDynamic, vModelText, useSlots, vShow, defineAsyncComponent, TransitionGroup, resolveComponent } from "vue";
2
2
  import dayjs from "dayjs";
3
3
  const ContextMenuPluginKey = Symbol("BlueseaContextMenuPlugin");
4
4
  class BSContextMenuPlugin {
@@ -24,17 +24,14 @@ class BSContextMenuPlugin {
24
24
  // }
25
25
  markComponentRaw(menus) {
26
26
  menus.forEach((menu) => {
27
- if (menu.component)
28
- menu.component = markRaw(menu.component);
29
- if (menu.children)
30
- this.markComponentRaw(menu.children);
27
+ if (menu.component) menu.component = markRaw(menu.component);
28
+ if (menu.children) this.markComponentRaw(menu.children);
31
29
  });
32
30
  }
33
31
  }
34
32
  const useContextMenu = () => {
35
33
  const contextMenu = inject(ContextMenuPluginKey);
36
- if (!contextMenu)
37
- throw new Error("BSContextMenuPlugin is not initialized.");
34
+ if (!contextMenu) throw new Error("BSContextMenuPlugin is not initialized.");
38
35
  return contextMenu;
39
36
  };
40
37
  const useContextMenuOptional = () => {
@@ -59,8 +56,7 @@ class BlueseaConfig {
59
56
  this.dateFormatSecond = config?.dateFormatSecond || this.dateFormatSecond;
60
57
  this.minDateValue = config?.minDateValue || this.minDateValue;
61
58
  this.maxDateValue = config?.maxDateValue || this.maxDateValue;
62
- if (config?.timeZone)
63
- this.timeZone = config.timeZone;
59
+ if (config?.timeZone) this.timeZone = config.timeZone;
64
60
  this.componentConfig = {
65
61
  popup: { hideOnScroll: false, ...config?.componentConfig?.popup },
66
62
  calendar: { startYear: "-20", endYear: "+20", ...config?.componentConfig?.calendar }
@@ -68,14 +64,10 @@ class BlueseaConfig {
68
64
  }
69
65
  resolveDisplayDateFormat(format) {
70
66
  const actualFormat = format || this.dateFormat;
71
- if (actualFormat === "DAY")
72
- return this.dateFormatDay;
73
- else if (actualFormat === "MINUTE")
74
- return this.dateFormatMinute;
75
- else if (actualFormat === "SECOND")
76
- return this.dateFormatSecond;
77
- else
78
- return actualFormat;
67
+ if (actualFormat === "DAY") return this.dateFormatDay;
68
+ else if (actualFormat === "MINUTE") return this.dateFormatMinute;
69
+ else if (actualFormat === "SECOND") return this.dateFormatSecond;
70
+ else return actualFormat;
79
71
  }
80
72
  }
81
73
  const BlueseaConfigKey = Symbol("BlueseaConfig");
@@ -91,7 +83,36 @@ const BlueseaPlugin = {
91
83
  }
92
84
  };
93
85
  const notificationEntries = reactive([]);
86
+ let nextEntryId = 0;
87
+ const showNotification = (message, style = "info", durationInMilliSeconds = 3e3) => {
88
+ const entryId = ++nextEntryId;
89
+ notificationEntries.unshift({
90
+ entryId,
91
+ message,
92
+ style,
93
+ duration: durationInMilliSeconds
94
+ });
95
+ setTimeout(() => {
96
+ const index = notificationEntries.findIndex((entry) => entry.entryId === entryId);
97
+ notificationEntries.splice(index, 1);
98
+ }, durationInMilliSeconds);
99
+ };
94
100
  const alarmEntries = reactive([]);
101
+ let nextAlarmEntryId = 0;
102
+ const showAlarm = (component, durationInMilliSeconds = 3e3) => {
103
+ const entryId = ++nextAlarmEntryId;
104
+ alarmEntries.push({
105
+ entryId,
106
+ component: markRaw(component),
107
+ duration: durationInMilliSeconds
108
+ });
109
+ };
110
+ const closeAlarm = (entryId) => {
111
+ const index = alarmEntries.findIndex((entry) => entry.entryId === entryId);
112
+ if (index >= 0) {
113
+ alarmEntries.splice(index, 1);
114
+ }
115
+ };
95
116
  const tooltipEntry = ref();
96
117
  const showTooltip = (content, target) => {
97
118
  tooltipEntry.value = {
@@ -109,17 +130,37 @@ const isTooltipDisplayed = () => {
109
130
  return !!tooltipEntry.value;
110
131
  };
111
132
  const showLoadingIcon = ref(false);
133
+ let showLoadingCount = 0;
134
+ const showLoading = () => {
135
+ showLoadingCount++;
136
+ showLoadingIcon.value = showLoadingCount > 0;
137
+ };
138
+ const hideLoading = () => {
139
+ showLoadingCount = Math.max(0, showLoadingCount - 1);
140
+ showLoadingIcon.value = showLoadingCount > 0;
141
+ };
142
+ const withLoading = async (func) => {
143
+ let shown = false;
144
+ const timeoutId = window.setTimeout(() => {
145
+ showLoading();
146
+ shown = true;
147
+ }, 300);
148
+ try {
149
+ return await func();
150
+ } finally {
151
+ if (shown) hideLoading();
152
+ if (timeoutId) window.clearTimeout(timeoutId);
153
+ }
154
+ };
112
155
  const DEFAULT_TOOLTIP_SHOW_DELAY = 800;
113
156
  const DEFAULT_TOOLTIP_HIDE_DELAY = 0;
114
157
  const setTooltipParam = (el, param) => {
115
158
  if (param && param.content) {
116
159
  el.setAttribute("data-bs-tooltip-data", JSON.stringify(param));
117
- if (isTooltipDisplayed())
118
- showTooltip(param.content, el);
160
+ if (isTooltipDisplayed()) showTooltip(param.content, el);
119
161
  } else {
120
162
  el.removeAttribute("data-bs-tooltip-data");
121
- if (isTooltipDisplayed())
122
- hideTooltip();
163
+ if (isTooltipDisplayed()) hideTooltip();
123
164
  }
124
165
  };
125
166
  const vTooltip = {
@@ -153,8 +194,8 @@ const vTooltip = {
153
194
  hideTooltip();
154
195
  }
155
196
  };
156
- const _hoisted_1$q = ["textContent"];
157
- const _sfc_main$r = /* @__PURE__ */ defineComponent({
197
+ const _hoisted_1$u = ["textContent"];
198
+ const _sfc_main$w = /* @__PURE__ */ defineComponent({
158
199
  __name: "BSButton",
159
200
  props: {
160
201
  caption: {},
@@ -183,7 +224,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
183
224
  }, toDisplayString(__props.leftIcon), 3)) : createCommentVNode("", true),
184
225
  createElementVNode("span", {
185
226
  textContent: toDisplayString(__props.caption)
186
- }, null, 8, _hoisted_1$q),
227
+ }, null, 8, _hoisted_1$u),
187
228
  __props.rightIcon ? (openBlock(), createElementBlock("span", {
188
229
  key: 1,
189
230
  class: normalizeClass([{ "ml-1": !!__props.caption }, "font-icon right"])
@@ -196,9 +237,9 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
196
237
  };
197
238
  }
198
239
  });
199
- const _hoisted_1$p = { class: "page-navigation" };
200
- const _hoisted_2$l = ["data-page", "onClick"];
201
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
240
+ const _hoisted_1$t = { class: "page-navigation" };
241
+ const _hoisted_2$o = ["data-page", "onClick"];
242
+ const _sfc_main$v = /* @__PURE__ */ defineComponent({
202
243
  __name: "BSPageNavigation",
203
244
  props: {
204
245
  totalCount: { default: 0 },
@@ -258,7 +299,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
258
299
  }
259
300
  };
260
301
  return (_ctx, _cache) => {
261
- return openBlock(), createElementBlock("div", _hoisted_1$p, [
302
+ return openBlock(), createElementBlock("div", _hoisted_1$t, [
262
303
  createElementVNode("span", {
263
304
  class: normalizeClass([{ "disabled": isFirstSet.value }, "font-icon first"]),
264
305
  onClick: _cache[0] || (_cache[0] = withModifiers(($event) => !isFirstSet.value && goToPage(1), ["prevent"]))
@@ -273,7 +314,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
273
314
  class: normalizeClass([{ on: page === currentPage.value }, "page"]),
274
315
  "data-page": page,
275
316
  onClick: withModifiers(($event) => goToPage(page), ["prevent"])
276
- }, toDisplayString(page), 11, _hoisted_2$l);
317
+ }, toDisplayString(page), 11, _hoisted_2$o);
277
318
  }), 128)),
278
319
  createElementVNode("span", {
279
320
  class: normalizeClass([{ "disabled": isLastSet.value }, "font-icon next"]),
@@ -294,14 +335,14 @@ const _export_sfc = (sfc, props) => {
294
335
  }
295
336
  return target;
296
337
  };
297
- const _sfc_main$p = {};
298
- const _hoisted_1$o = { class: "bs-loading-icon" };
338
+ const _sfc_main$u = {};
339
+ const _hoisted_1$s = { class: "bs-loading-icon" };
299
340
  function _sfc_render(_ctx, _cache) {
300
- return openBlock(), createElementBlock("div", _hoisted_1$o, [..._cache[0] || (_cache[0] = [
341
+ return openBlock(), createElementBlock("div", _hoisted_1$s, [..._cache[0] || (_cache[0] = [
301
342
  createElementVNode("span", { class: "font-icon" }, "progress_activity", -1)
302
343
  ])]);
303
344
  }
304
- const BSLoadingIcon = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render]]);
345
+ const BSLoadingIcon = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render]]);
305
346
  const waitUntil = async (condition, intervalMilliseconds = 200, maxTrial = 15) => {
306
347
  return await new Promise((resolve) => {
307
348
  let tried = 0;
@@ -324,9 +365,9 @@ const tryUntil = (until, tryCall, intervalMilliseconds = 200, maxTrial = 15) =>
324
365
  tried++;
325
366
  }, intervalMilliseconds);
326
367
  };
327
- const _hoisted_1$n = ["data-popup-id"];
368
+ const _hoisted_1$r = ["data-popup-id"];
328
369
  const ADJUST_OFFSET = 8;
329
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
370
+ const _sfc_main$t = /* @__PURE__ */ defineComponent({
330
371
  __name: "BSPopup",
331
372
  props: {
332
373
  popupId: {},
@@ -517,7 +558,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
517
558
  onKeydown: _cache[1] || (_cache[1] = ($event) => emit("keydown", $event))
518
559
  }, [
519
560
  renderSlot(_ctx.$slots, "default")
520
- ], 46, _hoisted_1$n)
561
+ ], 46, _hoisted_1$r)
521
562
  ]),
522
563
  _: 3
523
564
  })
@@ -525,8 +566,8 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
525
566
  };
526
567
  }
527
568
  });
528
- const _hoisted_1$m = ["textContent"];
529
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
569
+ const _hoisted_1$q = ["textContent"];
570
+ const _sfc_main$s = /* @__PURE__ */ defineComponent({
530
571
  __name: "BSTooltip",
531
572
  props: {
532
573
  align: { default: "center" },
@@ -553,7 +594,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
553
594
  }, [
554
595
  createElementVNode("div", {
555
596
  textContent: toDisplayString(__props.content)
556
- }, null, 8, _hoisted_1$m)
597
+ }, null, 8, _hoisted_1$q)
557
598
  ], 6);
558
599
  };
559
600
  }
@@ -595,14 +636,14 @@ const debounce = (func, wait) => {
595
636
  });
596
637
  };
597
638
  };
598
- const _hoisted_1$l = {
639
+ const _hoisted_1$p = {
599
640
  key: 0,
600
641
  class: "popup-search"
601
642
  };
602
- const _hoisted_2$k = ["data-value", "onMouseover", "onClick"];
603
- const _hoisted_3$g = ["textContent"];
604
- const _hoisted_4$a = ["textContent"];
605
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
643
+ const _hoisted_2$n = ["data-value", "onMouseover", "onClick"];
644
+ const _hoisted_3$h = ["textContent"];
645
+ const _hoisted_4$b = ["textContent"];
646
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
606
647
  __name: "BSSelectPopup",
607
648
  props: {
608
649
  items: {},
@@ -744,7 +785,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
744
785
  handleKeyboard
745
786
  });
746
787
  return (_ctx, _cache) => {
747
- return openBlock(), createBlock(_sfc_main$o, {
788
+ return openBlock(), createBlock(_sfc_main$t, {
748
789
  "base-element": __props.baseElement,
749
790
  "max-height": __props.maxHeight,
750
791
  "offset-from-base-element": 4,
@@ -755,7 +796,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
755
796
  onKeydown: withKeys(withModifiers(handleKeyboard, ["stop", "prevent"]), ["enter", "down", "up"])
756
797
  }, {
757
798
  default: withCtx(() => [
758
- actualShowSearch.value ? (openBlock(), createElementBlock("div", _hoisted_1$l, [
799
+ actualShowSearch.value ? (openBlock(), createElementBlock("div", _hoisted_1$p, [
759
800
  withDirectives(createElementVNode("input", {
760
801
  type: "text",
761
802
  onInput: setSearchKeyword,
@@ -788,12 +829,12 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
788
829
  key: 0,
789
830
  textContent: toDisplayString(item?.label),
790
831
  class: "label"
791
- }, null, 8, _hoisted_3$g)) : (openBlock(), createElementBlock("label", {
832
+ }, null, 8, _hoisted_3$h)) : (openBlock(), createElementBlock("label", {
792
833
  key: 1,
793
834
  textContent: toDisplayString(__props.nullLabel),
794
835
  class: "label null-label"
795
- }, null, 8, _hoisted_4$a))
796
- ], 42, _hoisted_2$k);
836
+ }, null, 8, _hoisted_4$b))
837
+ ], 42, _hoisted_2$n);
797
838
  }), 128))
798
839
  ], 512)
799
840
  ]),
@@ -810,13 +851,10 @@ const updateContext = (el, value) => {
810
851
  };
811
852
  };
812
853
  const clickInsideElements = (target, elements) => {
813
- if (!elements)
814
- return false;
854
+ if (!elements) return false;
815
855
  return elements.some((el) => {
816
- if (el instanceof HTMLElement)
817
- return el.contains(target);
818
- else if (typeof el === "string")
819
- return document.querySelector(el)?.contains(target);
856
+ if (el instanceof HTMLElement) return el.contains(target);
857
+ else if (typeof el === "string") return document.querySelector(el)?.contains(target);
820
858
  });
821
859
  };
822
860
  const vClickOutside = {
@@ -841,8 +879,7 @@ const vClickOutside = {
841
879
  },
842
880
  unmounted: (el) => {
843
881
  const clickListener = el.vClickOutsideListener;
844
- if (clickListener)
845
- window.removeEventListener("click", clickListener);
882
+ if (clickListener) window.removeEventListener("click", clickListener);
846
883
  delete el.vClickOutsideContext;
847
884
  }
848
885
  };
@@ -937,10 +974,12 @@ const fieldValidator = (option) => {
937
974
  };
938
975
  stringValue.value = convertFromValue(value.value);
939
976
  if (option.field) {
940
- watch(option.field, (field) => {
941
- if (field)
942
- storeFieldValidator(field, validator);
943
- });
977
+ watch(
978
+ option.field,
979
+ (field) => {
980
+ if (field) storeFieldValidator(field, validator);
981
+ }
982
+ );
944
983
  }
945
984
  return validator;
946
985
  };
@@ -949,8 +988,7 @@ const executeFieldValidationRule = async (value, rules, errors, phase, fieldCont
949
988
  if (rules) {
950
989
  for (const rule of rules) {
951
990
  const result = await rule(value, phase, fieldContext);
952
- if (result)
953
- result.forEach((error) => errs.push(error));
991
+ if (result) result.forEach((error) => errs.push(error));
954
992
  }
955
993
  errs.forEach((error) => errors.push(error));
956
994
  }
@@ -1060,26 +1098,25 @@ class SavePointImpl {
1060
1098
  setCurrentValue: option.setCurrentValue,
1061
1099
  compare: option.compare
1062
1100
  });
1063
- watch(option.field, (field) => {
1064
- if (field)
1065
- this.fields.set(field, handler);
1066
- });
1101
+ watch(
1102
+ option.field,
1103
+ (field) => {
1104
+ if (field) this.fields.set(field, handler);
1105
+ }
1106
+ );
1067
1107
  return handler;
1068
1108
  }
1069
1109
  unregisterField(field) {
1070
- if (field.value)
1071
- this.fields.delete(field.value);
1110
+ if (field.value) this.fields.delete(field.value);
1072
1111
  }
1073
1112
  addChild(child) {
1074
- if (!this.children)
1075
- this.children = [];
1113
+ if (!this.children) this.children = [];
1076
1114
  this.children.push(child);
1077
1115
  }
1078
1116
  removeChild(child) {
1079
1117
  if (this.children) {
1080
1118
  const index = this.children.findIndex((ch) => ch === child);
1081
- if (index >= 0)
1082
- this.children.splice(index, 1);
1119
+ if (index >= 0) this.children.splice(index, 1);
1083
1120
  }
1084
1121
  }
1085
1122
  set() {
@@ -1132,8 +1169,7 @@ class SavePointHandlerImpl {
1132
1169
  return this.savedValue.value;
1133
1170
  }
1134
1171
  rollbackValue() {
1135
- if (this.saved)
1136
- this.valueProvider.setCurrentValue(this.savedValue.value);
1172
+ if (this.saved) this.valueProvider.setCurrentValue(this.savedValue.value);
1137
1173
  }
1138
1174
  isModified(currentValue) {
1139
1175
  return this.saved && (this.valueProvider.compare ? !this.valueProvider.compare(this.savedValue.value, currentValue) : this.savedValue?.value !== currentValue);
@@ -1142,9 +1178,9 @@ class SavePointHandlerImpl {
1142
1178
  return this.isModified(this.valueProvider.getCurrentValue());
1143
1179
  }
1144
1180
  }
1145
- const _hoisted_1$k = { key: 0 };
1146
- const _hoisted_2$j = ["textContent"];
1147
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
1181
+ const _hoisted_1$o = { key: 0 };
1182
+ const _hoisted_2$m = ["textContent"];
1183
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
1148
1184
  __name: "ValidationErrors",
1149
1185
  props: {
1150
1186
  errors: {},
@@ -1152,13 +1188,13 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1152
1188
  },
1153
1189
  setup(__props) {
1154
1190
  return (_ctx, _cache) => {
1155
- return !__props.hideErrorMessage && __props.errors && __props.errors.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$k, [
1191
+ return !__props.hideErrorMessage && __props.errors && __props.errors.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$o, [
1156
1192
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.errors, (error) => {
1157
1193
  return openBlock(), createElementBlock("div", {
1158
1194
  key: error.code,
1159
1195
  textContent: toDisplayString(error.message),
1160
1196
  class: "bs-field-error"
1161
- }, null, 8, _hoisted_2$j);
1197
+ }, null, 8, _hoisted_2$m);
1162
1198
  }), 128))
1163
1199
  ])) : createCommentVNode("", true);
1164
1200
  };
@@ -1174,39 +1210,43 @@ const useFieldContext = () => {
1174
1210
  return result === dummyFieldContext ? void 0 : result;
1175
1211
  };
1176
1212
  const defaultLabelProvider = (item) => {
1177
- if (!item)
1178
- return "";
1179
- else if (typeof item === "string")
1180
- return item;
1181
- else
1182
- return String(item);
1213
+ if (!item) return "";
1214
+ else if (typeof item === "string") return item;
1215
+ else return String(item);
1216
+ };
1217
+ const emptyLabelProvider = (_item) => {
1218
+ return void 0;
1183
1219
  };
1184
1220
  const executeLabelProviderOrDefault = (item, labelProvider, defaultLabel) => {
1185
1221
  if (labelProvider) {
1186
1222
  const label = labelProvider(item);
1187
- if (label !== void 0)
1188
- return label;
1223
+ if (label !== void 0) return label;
1189
1224
  }
1190
1225
  return defaultLabel(item);
1191
1226
  };
1227
+ const defaultKeyProvider = (item) => {
1228
+ return JSON.stringify(item);
1229
+ };
1230
+ const emptyKeyProvider = (_item) => {
1231
+ return void 0;
1232
+ };
1192
1233
  const executeKeyProviderOrDefault = (item, keyProvider, defaultKey) => {
1193
1234
  if (keyProvider) {
1194
1235
  const key = keyProvider(item);
1195
- if (key)
1196
- return key;
1236
+ if (key) return key;
1197
1237
  }
1198
1238
  return defaultKey(item);
1199
1239
  };
1200
- const _hoisted_1$j = ["tabindex", "onKeydown"];
1201
- const _hoisted_2$i = ["textContent"];
1202
- const _hoisted_3$f = ["data-field-name"];
1203
- const _hoisted_4$9 = ["textContent"];
1204
- const _hoisted_5$4 = ["textContent"];
1240
+ const _hoisted_1$n = ["tabindex", "onKeydown"];
1241
+ const _hoisted_2$l = ["textContent"];
1242
+ const _hoisted_3$g = ["data-field-name"];
1243
+ const _hoisted_4$a = ["textContent"];
1244
+ const _hoisted_5$5 = ["textContent"];
1205
1245
  const _hoisted_6$2 = {
1206
1246
  key: 2,
1207
1247
  class: "small-progress"
1208
1248
  };
1209
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
1249
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1210
1250
  __name: "BSSelect",
1211
1251
  props: {
1212
1252
  modelValue: {},
@@ -1341,7 +1381,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1341
1381
  __props.viewMode ? (openBlock(), createElementBlock("div", {
1342
1382
  key: 0,
1343
1383
  textContent: toDisplayString(selectedItemLabel.value)
1344
- }, null, 8, _hoisted_2$i)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1384
+ }, null, 8, _hoisted_2$l)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1345
1385
  createElementVNode("div", {
1346
1386
  ref_key: "field",
1347
1387
  ref: field,
@@ -1353,15 +1393,15 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1353
1393
  key: 0,
1354
1394
  textContent: toDisplayString(__props.placeholder),
1355
1395
  class: "placeholder grow"
1356
- }, null, 8, _hoisted_4$9)) : (openBlock(), createElementBlock("span", {
1396
+ }, null, 8, _hoisted_4$a)) : (openBlock(), createElementBlock("span", {
1357
1397
  key: 1,
1358
1398
  textContent: toDisplayString(selectedItemLabel.value),
1359
1399
  class: "label"
1360
- }, null, 8, _hoisted_5$4)),
1400
+ }, null, 8, _hoisted_5$5)),
1361
1401
  _cache[4] || (_cache[4] = createElementVNode("span", { class: "dropdown-btn" }, "expand_more", -1)),
1362
1402
  loadingItems.value ? (openBlock(), createElementBlock("span", _hoisted_6$2, "progress_activity")) : createCommentVNode("", true)
1363
- ], 8, _hoisted_3$f),
1364
- !__props.disabled && showPopup.value ? (openBlock(), createBlock(_sfc_main$m, {
1403
+ ], 8, _hoisted_3$g),
1404
+ !__props.disabled && showPopup.value ? (openBlock(), createBlock(_sfc_main$r, {
1365
1405
  key: 0,
1366
1406
  ref_key: "selectPopup",
1367
1407
  ref: selectPopup,
@@ -1383,26 +1423,26 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1383
1423
  focusToRoot();
1384
1424
  })
1385
1425
  }, null, 8, ["allow-null", "base-element", "initial-item", "items", "label-provider", "max-height", "null-label", "popup-align", "popup-direction", "selected-items", "show-search", "value-provider"])) : createCommentVNode("", true),
1386
- !__props.viewMode ? (openBlock(), createBlock(_sfc_main$l, {
1426
+ !__props.viewMode ? (openBlock(), createBlock(_sfc_main$q, {
1387
1427
  key: 1,
1388
1428
  errors: unref(errors),
1389
1429
  "hide-error-message": __props.hideErrorMessage || __props.disabled && !__props.showErrorMessageOnDisabled
1390
1430
  }, null, 8, ["errors", "hide-error-message"])) : createCommentVNode("", true)
1391
1431
  ], 64))
1392
- ], 42, _hoisted_1$j)), [
1432
+ ], 42, _hoisted_1$n)), [
1393
1433
  [unref(vClickOutside), () => togglePopup(false)]
1394
1434
  ]);
1395
1435
  };
1396
1436
  }
1397
1437
  });
1398
- const _hoisted_1$i = { class: "bs-calendar" };
1399
- const _hoisted_2$h = { class: "bs-calendar-head" };
1400
- const _hoisted_3$e = { class: "year-month" };
1401
- const _hoisted_4$8 = {
1438
+ const _hoisted_1$m = { class: "bs-calendar" };
1439
+ const _hoisted_2$k = { class: "bs-calendar-head" };
1440
+ const _hoisted_3$f = { class: "year-month" };
1441
+ const _hoisted_4$9 = {
1402
1442
  key: 0,
1403
1443
  class: "timezone"
1404
1444
  };
1405
- const _hoisted_5$3 = { class: "weekdays" };
1445
+ const _hoisted_5$4 = { class: "weekdays" };
1406
1446
  const _hoisted_6$1 = ["textContent"];
1407
1447
  const _hoisted_7$1 = ["onClick"];
1408
1448
  const _hoisted_8$1 = {
@@ -1410,7 +1450,7 @@ const _hoisted_8$1 = {
1410
1450
  class: "bs-calendar-time"
1411
1451
  };
1412
1452
  const _hoisted_9$1 = { class: "select-wrap" };
1413
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
1453
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
1414
1454
  __name: "BSCalendar",
1415
1455
  props: {
1416
1456
  modelValue: {},
@@ -1599,39 +1639,39 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
1599
1639
  }
1600
1640
  };
1601
1641
  return (_ctx, _cache) => {
1602
- return openBlock(), createElementBlock("div", _hoisted_1$i, [
1603
- createElementVNode("div", _hoisted_2$h, [
1604
- createElementVNode("div", _hoisted_3$e, [
1605
- createVNode(_sfc_main$r, {
1642
+ return openBlock(), createElementBlock("div", _hoisted_1$m, [
1643
+ createElementVNode("div", _hoisted_2$k, [
1644
+ createElementVNode("div", _hoisted_3$f, [
1645
+ createVNode(_sfc_main$w, {
1606
1646
  class: "",
1607
1647
  "left-icon": "chevron_left",
1608
1648
  onClick: prevMonth
1609
1649
  }),
1610
- createVNode(_sfc_main$k, {
1650
+ createVNode(_sfc_main$p, {
1611
1651
  modelValue: year.value,
1612
1652
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => year.value = $event),
1613
1653
  disabled: __props.disabled,
1614
1654
  items: years.value
1615
1655
  }, null, 8, ["modelValue", "disabled", "items"]),
1616
- createVNode(_sfc_main$k, {
1656
+ createVNode(_sfc_main$p, {
1617
1657
  modelValue: month.value,
1618
1658
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => month.value = $event),
1619
1659
  disabled: __props.disabled,
1620
1660
  items: unref(months)
1621
1661
  }, null, 8, ["modelValue", "disabled", "items"]),
1622
- createVNode(_sfc_main$r, {
1662
+ createVNode(_sfc_main$w, {
1623
1663
  class: "",
1624
1664
  "left-icon": "chevron_right",
1625
1665
  onClick: nextMonth
1626
1666
  })
1627
1667
  ]),
1628
- __props.showTimeZone ? (openBlock(), createElementBlock("div", _hoisted_4$8, "(" + toDisplayString(actualTimeZone.value) + ")", 1)) : createCommentVNode("", true)
1668
+ __props.showTimeZone ? (openBlock(), createElementBlock("div", _hoisted_4$9, "(" + toDisplayString(actualTimeZone.value) + ")", 1)) : createCommentVNode("", true)
1629
1669
  ]),
1630
1670
  createElementVNode("table", {
1631
1671
  class: normalizeClass([{ disabled: __props.disabled }, "align-self-center"])
1632
1672
  }, [
1633
1673
  createElementVNode("tbody", null, [
1634
- createElementVNode("tr", _hoisted_5$3, [
1674
+ createElementVNode("tr", _hoisted_5$4, [
1635
1675
  (openBlock(true), createElementBlock(Fragment, null, renderList(weekdays.value, (day) => {
1636
1676
  return openBlock(), createElementBlock("th", {
1637
1677
  key: day,
@@ -1661,7 +1701,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
1661
1701
  __props.resolution
1662
1702
  ) ? (openBlock(), createElementBlock("div", _hoisted_8$1, [
1663
1703
  createElementVNode("div", _hoisted_9$1, [
1664
- createVNode(_sfc_main$k, {
1704
+ createVNode(_sfc_main$p, {
1665
1705
  disabled: __props.disabled,
1666
1706
  items: hours,
1667
1707
  "label-provider": (item) => item < 10 ? "0" + item : item.toString(),
@@ -1670,7 +1710,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
1670
1710
  "onUpdate:modelValue": updateHour
1671
1711
  }, null, 8, ["disabled", "label-provider", "model-value"]),
1672
1712
  _cache[2] || (_cache[2] = createElementVNode("span", { class: "" }, ":", -1)),
1673
- createVNode(_sfc_main$k, {
1713
+ createVNode(_sfc_main$p, {
1674
1714
  disabled: __props.disabled || __props.resolution === "HOUR",
1675
1715
  items: minutes.value,
1676
1716
  "label-provider": (item) => item < 10 ? "0" + item : item.toString(),
@@ -1684,10 +1724,10 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
1684
1724
  };
1685
1725
  }
1686
1726
  });
1687
- const _hoisted_1$h = { class: "bs-calendar-range flex flex-row" };
1688
- const _hoisted_2$g = { class: "flex flex-col" };
1689
- const _hoisted_3$d = { class: "flex flex-row items-center" };
1690
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
1727
+ const _hoisted_1$l = { class: "bs-calendar-range flex flex-row" };
1728
+ const _hoisted_2$j = { class: "flex flex-col" };
1729
+ const _hoisted_3$e = { class: "flex flex-row items-center" };
1730
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
1691
1731
  __name: "BSCalendarRange",
1692
1732
  props: {
1693
1733
  from: {},
@@ -1725,10 +1765,10 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
1725
1765
  emit("update:to", value);
1726
1766
  };
1727
1767
  return (_ctx, _cache) => {
1728
- return openBlock(), createElementBlock("div", _hoisted_1$h, [
1729
- createElementVNode("div", _hoisted_2$g, [
1730
- createElementVNode("div", _hoisted_3$d, [
1731
- createVNode(_sfc_main$j, {
1768
+ return openBlock(), createElementBlock("div", _hoisted_1$l, [
1769
+ createElementVNode("div", _hoisted_2$j, [
1770
+ createElementVNode("div", _hoisted_3$e, [
1771
+ createVNode(_sfc_main$o, {
1732
1772
  modelValue: fromValue.value,
1733
1773
  "onUpdate:modelValue": [
1734
1774
  _cache[0] || (_cache[0] = ($event) => fromValue.value = $event),
@@ -1746,7 +1786,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
1746
1786
  "range-type": "from"
1747
1787
  }, null, 8, ["modelValue", "disabled", "display-format", "end-year", "first-day", "range-value", "resolution", "start-year", "time-zone"]),
1748
1788
  _cache[2] || (_cache[2] = createElementVNode("span", { class: "tilde" }, "~", -1)),
1749
- createVNode(_sfc_main$j, {
1789
+ createVNode(_sfc_main$o, {
1750
1790
  modelValue: toValue.value,
1751
1791
  "onUpdate:modelValue": [
1752
1792
  _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
@@ -1807,13 +1847,11 @@ const componentUtil = {
1807
1847
  return trim ? value?.trim() : value;
1808
1848
  },
1809
1849
  getPrefixSuffixList(param) {
1810
- if (!param)
1811
- return [];
1850
+ if (!param) return [];
1812
1851
  const params = Array.isArray(param) ? param : [param];
1813
1852
  const list = [];
1814
1853
  for (let item of params) {
1815
- if (!item)
1816
- continue;
1854
+ if (!item) continue;
1817
1855
  if (typeof item === "object" && item.hasOwnProperty("type") && item.hasOwnProperty("value")) {
1818
1856
  list.push(item);
1819
1857
  } else {
@@ -1821,12 +1859,16 @@ const componentUtil = {
1821
1859
  }
1822
1860
  }
1823
1861
  return list;
1862
+ },
1863
+ isCursorInElement(event, element) {
1864
+ const rect = element.getBoundingClientRect();
1865
+ return event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;
1824
1866
  }
1825
1867
  };
1826
- const _hoisted_1$g = ["textContent"];
1827
- const _hoisted_2$f = { class: "font-icon" };
1828
- const _hoisted_3$c = ["src", "alt"];
1829
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
1868
+ const _hoisted_1$k = ["textContent"];
1869
+ const _hoisted_2$i = { class: "font-icon" };
1870
+ const _hoisted_3$d = ["src", "alt"];
1871
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1830
1872
  __name: "BSPrefixSuffix",
1831
1873
  props: {
1832
1874
  value: {},
@@ -1842,11 +1884,11 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
1842
1884
  textContent: toDisplayString(item.value),
1843
1885
  key: JSON.stringify(item.value),
1844
1886
  class: normalizeClass(__props.type)
1845
- }, null, 10, _hoisted_1$g)) : item.type === "font-icon" ? (openBlock(), createElementBlock("span", {
1887
+ }, null, 10, _hoisted_1$k)) : item.type === "font-icon" ? (openBlock(), createElementBlock("span", {
1846
1888
  key: 1,
1847
1889
  class: normalizeClass(__props.type)
1848
1890
  }, [
1849
- createElementVNode("span", _hoisted_2$f, toDisplayString(item.value), 1)
1891
+ createElementVNode("span", _hoisted_2$i, toDisplayString(item.value), 1)
1850
1892
  ], 2)) : item.type === "image-url" ? (openBlock(), createElementBlock("span", {
1851
1893
  key: 2,
1852
1894
  class: normalizeClass(__props.type)
@@ -1854,24 +1896,24 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
1854
1896
  createElementVNode("img", {
1855
1897
  src: item.value,
1856
1898
  alt: __props.type
1857
- }, null, 8, _hoisted_3$c)
1899
+ }, null, 8, _hoisted_3$d)
1858
1900
  ], 2)) : createCommentVNode("", true)
1859
1901
  ], 64);
1860
1902
  }), 256);
1861
1903
  };
1862
1904
  }
1863
1905
  });
1864
- const _hoisted_1$f = {
1906
+ const _hoisted_1$j = {
1865
1907
  key: 0,
1866
1908
  class: "view-mode"
1867
1909
  };
1868
- const _hoisted_2$e = ["textContent"];
1869
- const _hoisted_3$b = {
1910
+ const _hoisted_2$h = ["textContent"];
1911
+ const _hoisted_3$c = {
1870
1912
  key: 1,
1871
1913
  class: "input-area"
1872
1914
  };
1873
- const _hoisted_4$7 = ["id", "placeholder", "autocomplete", "disabled", "maxlength", "name", "tabindex", "type"];
1874
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
1915
+ const _hoisted_4$8 = ["id", "placeholder", "autocomplete", "disabled", "maxlength", "name", "tabindex", "type"];
1916
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1875
1917
  __name: "BSTextInput",
1876
1918
  props: {
1877
1919
  id: {},
@@ -1995,20 +2037,20 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1995
2037
  class: normalizeClass([{ required: __props.required, disabled: __props.disabled, modified: modified.value, error: unref(errors).length > 0 }, "bs-text-input bs-input-wrap"]),
1996
2038
  style: normalizeStyle({ width: __props.width })
1997
2039
  }, [
1998
- __props.viewMode ? (openBlock(), createElementBlock("div", _hoisted_1$f, [
1999
- createVNode(_sfc_main$h, {
2040
+ __props.viewMode ? (openBlock(), createElementBlock("div", _hoisted_1$j, [
2041
+ createVNode(_sfc_main$m, {
2000
2042
  value: __props.prefix,
2001
2043
  type: "prefix"
2002
2044
  }, null, 8, ["value"]),
2003
2045
  createElementVNode("span", {
2004
2046
  textContent: toDisplayString(unref(stringValue))
2005
- }, null, 8, _hoisted_2$e),
2006
- createVNode(_sfc_main$h, {
2047
+ }, null, 8, _hoisted_2$h),
2048
+ createVNode(_sfc_main$m, {
2007
2049
  value: __props.suffix,
2008
2050
  type: "suffix"
2009
2051
  }, null, 8, ["value"])
2010
- ])) : (openBlock(), createElementBlock("div", _hoisted_3$b, [
2011
- createVNode(_sfc_main$h, {
2052
+ ])) : (openBlock(), createElementBlock("div", _hoisted_3$c, [
2053
+ createVNode(_sfc_main$m, {
2012
2054
  value: __props.prefix,
2013
2055
  type: "prefix"
2014
2056
  }, null, 8, ["value"]),
@@ -2024,15 +2066,15 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
2024
2066
  name: __props.name,
2025
2067
  tabindex: __props.tabindex,
2026
2068
  type: __props.inputType
2027
- }, toHandlers(handlers, true)), null, 16, _hoisted_4$7), [
2069
+ }, toHandlers(handlers, true)), null, 16, _hoisted_4$8), [
2028
2070
  [vModelDynamic, unref(stringValue)]
2029
2071
  ]),
2030
- createVNode(_sfc_main$h, {
2072
+ createVNode(_sfc_main$m, {
2031
2073
  value: __props.suffix,
2032
2074
  type: "suffix"
2033
2075
  }, null, 8, ["value"])
2034
2076
  ])),
2035
- !__props.viewMode ? (openBlock(), createBlock(_sfc_main$l, {
2077
+ !__props.viewMode ? (openBlock(), createBlock(_sfc_main$q, {
2036
2078
  key: 2,
2037
2079
  errors: unref(errors),
2038
2080
  "hide-error-message": __props.hideErrorMessage || __props.disabled && !__props.showErrorMessageOnDisabled
@@ -2235,8 +2277,7 @@ const formatUtil = {
2235
2277
  formatDateString(utcDate, format, displayTimeZone) {
2236
2278
  if (utcDate) {
2237
2279
  let date = dayjs(utcDate);
2238
- if (displayTimeZone)
2239
- date = date.tz(displayTimeZone);
2280
+ if (displayTimeZone) date = date.tz(displayTimeZone);
2240
2281
  return date.format(format || "YYYY-MM-DD HH:mm Z");
2241
2282
  }
2242
2283
  return "";
@@ -2315,17 +2356,17 @@ const formatUtil = {
2315
2356
  return tmp.textContent || tmp.innerText;
2316
2357
  }
2317
2358
  };
2318
- const _hoisted_1$e = {
2359
+ const _hoisted_1$i = {
2319
2360
  key: 0,
2320
2361
  class: "view-mode"
2321
2362
  };
2322
- const _hoisted_2$d = ["textContent"];
2323
- const _hoisted_3$a = {
2363
+ const _hoisted_2$g = ["textContent"];
2364
+ const _hoisted_3$b = {
2324
2365
  key: 1,
2325
2366
  class: "input-area"
2326
2367
  };
2327
- const _hoisted_4$6 = ["id", "placeholder", "autocomplete", "disabled", "maxlength", "name", "tabindex", "value"];
2328
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
2368
+ const _hoisted_4$7 = ["id", "placeholder", "autocomplete", "disabled", "maxlength", "name", "tabindex", "value"];
2369
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
2329
2370
  __name: "BSNumberInput",
2330
2371
  props: {
2331
2372
  id: {},
@@ -2457,20 +2498,20 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2457
2498
  class: normalizeClass([{ required: __props.required, disabled: __props.disabled, modified: modified.value, error: unref(errors).length > 0 }, "bs-number-input bs-input-wrap"]),
2458
2499
  style: normalizeStyle({ width: __props.width })
2459
2500
  }, [
2460
- __props.viewMode ? (openBlock(), createElementBlock("div", _hoisted_1$e, [
2461
- createVNode(_sfc_main$h, {
2501
+ __props.viewMode ? (openBlock(), createElementBlock("div", _hoisted_1$i, [
2502
+ createVNode(_sfc_main$m, {
2462
2503
  value: __props.prefix,
2463
2504
  type: "prefix"
2464
2505
  }, null, 8, ["value"]),
2465
2506
  createElementVNode("span", {
2466
2507
  textContent: toDisplayString(__props.formatInViewMode ? formattedStringValue.value : unref(stringValue))
2467
- }, null, 8, _hoisted_2$d),
2468
- createVNode(_sfc_main$h, {
2508
+ }, null, 8, _hoisted_2$g),
2509
+ createVNode(_sfc_main$m, {
2469
2510
  value: __props.suffix,
2470
2511
  type: "suffix"
2471
2512
  }, null, 8, ["value"])
2472
- ])) : (openBlock(), createElementBlock("div", _hoisted_3$a, [
2473
- createVNode(_sfc_main$h, {
2513
+ ])) : (openBlock(), createElementBlock("div", _hoisted_3$b, [
2514
+ createVNode(_sfc_main$m, {
2474
2515
  value: __props.prefix,
2475
2516
  type: "prefix"
2476
2517
  }, null, 8, ["value"]),
@@ -2486,13 +2527,13 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2486
2527
  tabindex: __props.tabindex,
2487
2528
  value: focused.value || !__props.formatOnBlur ? unref(stringValue) : formattedStringValue.value,
2488
2529
  type: "text"
2489
- }, toHandlers(handlers, true)), null, 16, _hoisted_4$6),
2490
- createVNode(_sfc_main$h, {
2530
+ }, toHandlers(handlers, true)), null, 16, _hoisted_4$7),
2531
+ createVNode(_sfc_main$m, {
2491
2532
  value: __props.suffix,
2492
2533
  type: "suffix"
2493
2534
  }, null, 8, ["value"])
2494
2535
  ])),
2495
- !__props.viewMode ? (openBlock(), createBlock(_sfc_main$l, {
2536
+ !__props.viewMode ? (openBlock(), createBlock(_sfc_main$q, {
2496
2537
  key: 2,
2497
2538
  errors: unref(errors),
2498
2539
  "hide-error-message": __props.hideErrorMessage || __props.disabled && !__props.showErrorMessageOnDisabled
@@ -2501,17 +2542,17 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2501
2542
  };
2502
2543
  }
2503
2544
  });
2504
- const _hoisted_1$d = {
2545
+ const _hoisted_1$h = {
2505
2546
  key: 0,
2506
2547
  class: "view-mode flex flex-row gap-2 items-start"
2507
2548
  };
2508
- const _hoisted_2$c = ["textContent"];
2509
- const _hoisted_3$9 = {
2549
+ const _hoisted_2$f = ["textContent"];
2550
+ const _hoisted_3$a = {
2510
2551
  key: 1,
2511
2552
  class: "input-area flex flex-row items-start"
2512
2553
  };
2513
- const _hoisted_4$5 = ["placeholder", "disabled", "maxlength", "name", "tabindex"];
2514
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
2554
+ const _hoisted_4$6 = ["placeholder", "disabled", "maxlength", "name", "tabindex"];
2555
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
2515
2556
  __name: "BSTextArea",
2516
2557
  props: {
2517
2558
  id: {},
@@ -2626,20 +2667,20 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
2626
2667
  class: normalizeClass([{ disabled: __props.disabled, modified: modified.value, error: unref(errors).length > 0 }, "bs-text-area bs-input-wrap"]),
2627
2668
  style: normalizeStyle({ width: outerWidth.value, height: outerHeight.value })
2628
2669
  }, [
2629
- __props.viewMode ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
2630
- createVNode(_sfc_main$h, {
2670
+ __props.viewMode ? (openBlock(), createElementBlock("div", _hoisted_1$h, [
2671
+ createVNode(_sfc_main$m, {
2631
2672
  value: __props.prefix,
2632
2673
  type: "prefix"
2633
2674
  }, null, 8, ["value"]),
2634
2675
  createElementVNode("div", {
2635
2676
  textContent: toDisplayString(unref(stringValue))
2636
- }, null, 8, _hoisted_2$c),
2637
- createVNode(_sfc_main$h, {
2677
+ }, null, 8, _hoisted_2$f),
2678
+ createVNode(_sfc_main$m, {
2638
2679
  value: __props.suffix,
2639
2680
  type: "suffix"
2640
2681
  }, null, 8, ["value"])
2641
- ])) : (openBlock(), createElementBlock("div", _hoisted_3$9, [
2642
- createVNode(_sfc_main$h, {
2682
+ ])) : (openBlock(), createElementBlock("div", _hoisted_3$a, [
2683
+ createVNode(_sfc_main$m, {
2643
2684
  value: __props.prefix,
2644
2685
  type: "prefix"
2645
2686
  }, null, 8, ["value"]),
@@ -2656,15 +2697,15 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
2656
2697
  class: "grow",
2657
2698
  onPointerdown: capturePointer,
2658
2699
  onPointerup: preserveResizedHeight
2659
- }, toHandlers(handlers, true)), null, 16, _hoisted_4$5), [
2700
+ }, toHandlers(handlers, true)), null, 16, _hoisted_4$6), [
2660
2701
  [vModelText, unref(stringValue)]
2661
2702
  ]),
2662
- createVNode(_sfc_main$h, {
2703
+ createVNode(_sfc_main$m, {
2663
2704
  value: __props.suffix,
2664
2705
  type: "suffix"
2665
2706
  }, null, 8, ["value"])
2666
2707
  ])),
2667
- !__props.viewMode ? (openBlock(), createBlock(_sfc_main$l, {
2708
+ !__props.viewMode ? (openBlock(), createBlock(_sfc_main$q, {
2668
2709
  key: 2,
2669
2710
  errors: unref(errors),
2670
2711
  "hide-error-message": __props.hideErrorMessage || __props.disabled && !__props.showErrorMessageOnDisabled
@@ -2673,10 +2714,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
2673
2714
  };
2674
2715
  }
2675
2716
  });
2676
- const _hoisted_1$c = ["id", "checked", "disabled", "name", "tabindex"];
2677
- const _hoisted_2$b = ["textContent", "for"];
2678
- const _hoisted_3$8 = ["for"];
2679
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
2717
+ const _hoisted_1$g = ["id", "checked", "disabled", "name", "tabindex"];
2718
+ const _hoisted_2$e = ["textContent", "for"];
2719
+ const _hoisted_3$9 = ["for"];
2720
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2680
2721
  __name: "BSCheckbox",
2681
2722
  props: {
2682
2723
  id: { default: () => componentUtil.generateNextId("checkbox") },
@@ -2732,28 +2773,28 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
2732
2773
  tabindex: __props.tabindex,
2733
2774
  class: "",
2734
2775
  type: "checkbox"
2735
- }, toHandlers(handlers, true)), null, 16, _hoisted_1$c),
2776
+ }, toHandlers(handlers, true)), null, 16, _hoisted_1$g),
2736
2777
  __props.label ? (openBlock(), createElementBlock("label", {
2737
2778
  key: 0,
2738
2779
  textContent: toDisplayString(__props.label),
2739
2780
  for: __props.id,
2740
2781
  class: "text-label"
2741
- }, null, 8, _hoisted_2$b)) : createCommentVNode("", true),
2782
+ }, null, 8, _hoisted_2$e)) : createCommentVNode("", true),
2742
2783
  hasLabelSlot.value ? (openBlock(), createElementBlock("label", {
2743
2784
  key: 1,
2744
2785
  for: __props.id,
2745
2786
  class: "slot-label cursor-pointer"
2746
2787
  }, [
2747
2788
  renderSlot(_ctx.$slots, "default", { disabled: __props.disabled })
2748
- ], 8, _hoisted_3$8)) : createCommentVNode("", true)
2789
+ ], 8, _hoisted_3$9)) : createCommentVNode("", true)
2749
2790
  ], 2);
2750
2791
  };
2751
2792
  }
2752
2793
  });
2753
- const _hoisted_1$b = ["data-field-name"];
2754
- const _hoisted_2$a = { class: "items" };
2755
- const _hoisted_3$7 = ["textContent"];
2756
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
2794
+ const _hoisted_1$f = ["data-field-name"];
2795
+ const _hoisted_2$d = { class: "items" };
2796
+ const _hoisted_3$8 = ["textContent"];
2797
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
2757
2798
  __name: "BSCheckboxGroup",
2758
2799
  props: {
2759
2800
  name: {},
@@ -2859,13 +2900,13 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2859
2900
  "data-field-name": __props.name,
2860
2901
  role: "group"
2861
2902
  }, [
2862
- createElementVNode("div", _hoisted_2$a, [
2903
+ createElementVNode("div", _hoisted_2$d, [
2863
2904
  __props.viewMode ? (openBlock(), createElementBlock("div", {
2864
2905
  key: 0,
2865
2906
  class: "view-mode",
2866
2907
  textContent: toDisplayString(modelValueLabels.value)
2867
- }, null, 8, _hoisted_3$7)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.items, (item) => {
2868
- return openBlock(), createBlock(_sfc_main$d, {
2908
+ }, null, 8, _hoisted_3$8)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.items, (item) => {
2909
+ return openBlock(), createBlock(_sfc_main$i, {
2869
2910
  key: itemKey(item),
2870
2911
  disabled: __props.disabled || isDisabledItem(item),
2871
2912
  label: itemLabel(item),
@@ -2877,24 +2918,24 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2877
2918
  }, null, 8, ["disabled", "label", "model-value", "name", "tabindex", "onUpdate:modelValue"]);
2878
2919
  }), 128))
2879
2920
  ]),
2880
- !__props.viewMode ? (openBlock(), createBlock(_sfc_main$l, {
2921
+ !__props.viewMode ? (openBlock(), createBlock(_sfc_main$q, {
2881
2922
  key: 0,
2882
2923
  errors: unref(errors),
2883
2924
  "hide-error-message": __props.hideErrorMessage || __props.disabled && !__props.showErrorMessageOnDisabled
2884
2925
  }, null, 8, ["errors", "hide-error-message"])) : createCommentVNode("", true)
2885
- ], 10, _hoisted_1$b);
2926
+ ], 10, _hoisted_1$f);
2886
2927
  };
2887
2928
  }
2888
2929
  });
2889
- const _hoisted_1$a = ["id", "checked", "disabled", "name", "tabindex"];
2890
- const _hoisted_2$9 = ["for"];
2891
- const _hoisted_3$6 = {
2930
+ const _hoisted_1$e = ["id", "checked", "disabled", "name", "tabindex"];
2931
+ const _hoisted_2$c = ["for"];
2932
+ const _hoisted_3$7 = {
2892
2933
  key: 0,
2893
2934
  class: "font-icon"
2894
2935
  };
2895
- const _hoisted_4$4 = ["textContent"];
2896
- const _hoisted_5$2 = ["for"];
2897
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
2936
+ const _hoisted_4$5 = ["textContent"];
2937
+ const _hoisted_5$3 = ["for"];
2938
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
2898
2939
  __name: "BSRadioButton",
2899
2940
  props: {
2900
2941
  id: { default: () => componentUtil.generateNextId("radio") },
@@ -2937,34 +2978,34 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2937
2978
  class: "",
2938
2979
  role: "radio",
2939
2980
  type: "radio"
2940
- }, toHandlers(handlers, true)), null, 16, _hoisted_1$a),
2981
+ }, toHandlers(handlers, true)), null, 16, _hoisted_1$e),
2941
2982
  createElementVNode("label", { for: __props.id }, [
2942
- __props.icon ? (openBlock(), createElementBlock("span", _hoisted_3$6, toDisplayString(__props.icon), 1)) : createCommentVNode("", true),
2983
+ __props.icon ? (openBlock(), createElementBlock("span", _hoisted_3$7, toDisplayString(__props.icon), 1)) : createCommentVNode("", true),
2943
2984
  __props.label ? (openBlock(), createElementBlock("span", {
2944
2985
  key: 1,
2945
2986
  textContent: toDisplayString(__props.label),
2946
2987
  class: "text-label"
2947
- }, null, 8, _hoisted_4$4)) : createCommentVNode("", true)
2948
- ], 8, _hoisted_2$9),
2988
+ }, null, 8, _hoisted_4$5)) : createCommentVNode("", true)
2989
+ ], 8, _hoisted_2$c),
2949
2990
  hasLabelSlot.value ? (openBlock(), createElementBlock("label", {
2950
2991
  key: 0,
2951
2992
  for: __props.id,
2952
2993
  class: "slot-label cursor-pointer"
2953
2994
  }, [
2954
2995
  renderSlot(_ctx.$slots, "default", { disabled: __props.disabled })
2955
- ], 8, _hoisted_5$2)) : createCommentVNode("", true)
2996
+ ], 8, _hoisted_5$3)) : createCommentVNode("", true)
2956
2997
  ], 2);
2957
2998
  };
2958
2999
  }
2959
3000
  });
2960
- const _hoisted_1$9 = ["data-field-name"];
2961
- const _hoisted_2$8 = ["textContent"];
2962
- const _hoisted_3$5 = {
3001
+ const _hoisted_1$d = ["data-field-name"];
3002
+ const _hoisted_2$b = ["textContent"];
3003
+ const _hoisted_3$6 = {
2963
3004
  key: 1,
2964
3005
  class: "radio-button-group",
2965
3006
  role: "radiogroup"
2966
3007
  };
2967
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
3008
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2968
3009
  __name: "BSRadioButtonGroup",
2969
3010
  props: {
2970
3011
  name: { default: () => componentUtil.generateNextName("radioGroup") },
@@ -3047,9 +3088,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
3047
3088
  __props.viewMode ? (openBlock(), createElementBlock("div", {
3048
3089
  key: 0,
3049
3090
  textContent: toDisplayString(modelValueLabel.value)
3050
- }, null, 8, _hoisted_2$8)) : (openBlock(), createElementBlock("div", _hoisted_3$5, [
3091
+ }, null, 8, _hoisted_2$b)) : (openBlock(), createElementBlock("div", _hoisted_3$6, [
3051
3092
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
3052
- return withDirectives((openBlock(), createBlock(_sfc_main$b, {
3093
+ return withDirectives((openBlock(), createBlock(_sfc_main$g, {
3053
3094
  key: itemKey(item),
3054
3095
  disabled: __props.disabled || isDisabledItem(item),
3055
3096
  icon: __props.iconProvider?.(item),
@@ -3064,20 +3105,20 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
3064
3105
  ]);
3065
3106
  }), 128))
3066
3107
  ])),
3067
- !__props.viewMode ? (openBlock(), createBlock(_sfc_main$l, {
3108
+ !__props.viewMode ? (openBlock(), createBlock(_sfc_main$q, {
3068
3109
  key: 2,
3069
3110
  errors: unref(errors),
3070
3111
  "hide-error-message": __props.hideErrorMessage || __props.disabled && !__props.showErrorMessageOnDisabled
3071
3112
  }, null, 8, ["errors", "hide-error-message"])) : createCommentVNode("", true)
3072
- ], 10, _hoisted_1$9);
3113
+ ], 10, _hoisted_1$d);
3073
3114
  };
3074
3115
  }
3075
3116
  });
3076
- const _hoisted_1$8 = ["tabindex", "onKeydown"];
3077
- const _hoisted_2$7 = { key: 0 };
3078
- const _hoisted_3$4 = ["textContent"];
3079
- const _hoisted_4$3 = ["textContent"];
3080
- const _hoisted_5$1 = ["data-field-name"];
3117
+ const _hoisted_1$c = ["tabindex", "onKeydown"];
3118
+ const _hoisted_2$a = { key: 0 };
3119
+ const _hoisted_3$5 = ["textContent"];
3120
+ const _hoisted_4$4 = ["textContent"];
3121
+ const _hoisted_5$2 = ["data-field-name"];
3081
3122
  const _hoisted_6 = ["textContent"];
3082
3123
  const _hoisted_7 = {
3083
3124
  key: 1,
@@ -3089,7 +3130,7 @@ const _hoisted_10 = {
3089
3130
  key: 2,
3090
3131
  class: "small-progress"
3091
3132
  };
3092
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3133
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3093
3134
  __name: "BSMultiSelect",
3094
3135
  props: {
3095
3136
  modelValue: { default: () => [] },
@@ -3212,17 +3253,17 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3212
3253
  _cache[4] || (_cache[4] = withKeys(($event) => togglePopup(false), ["tab"]))
3213
3254
  ]
3214
3255
  }, [
3215
- __props.viewMode ? (openBlock(), createElementBlock("div", _hoisted_2$7, [
3256
+ __props.viewMode ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
3216
3257
  __props.selectedLabelProvider ? (openBlock(), createElementBlock("span", {
3217
3258
  key: 0,
3218
3259
  textContent: toDisplayString(__props.selectedLabelProvider(selectedItems.value)),
3219
3260
  class: "label"
3220
- }, null, 8, _hoisted_3$4)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(selectedItems.value, (item) => {
3261
+ }, null, 8, _hoisted_3$5)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(selectedItems.value, (item) => {
3221
3262
  return openBlock(), createElementBlock("span", {
3222
3263
  key: itemKey(item),
3223
3264
  textContent: toDisplayString(itemLabel(item)),
3224
3265
  class: "label"
3225
- }, null, 8, _hoisted_4$3);
3266
+ }, null, 8, _hoisted_4$4);
3226
3267
  }), 128))
3227
3268
  ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3228
3269
  createElementVNode("div", {
@@ -3251,8 +3292,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3251
3292
  ])),
3252
3293
  _cache[5] || (_cache[5] = createElementVNode("span", { class: "dropdown-btn" }, "expand_more", -1)),
3253
3294
  loadingItems.value ? (openBlock(), createElementBlock("span", _hoisted_10, "progress_activity")) : createCommentVNode("", true)
3254
- ], 8, _hoisted_5$1),
3255
- !__props.disabled && showPopup.value ? (openBlock(), createBlock(_sfc_main$m, {
3295
+ ], 8, _hoisted_5$2),
3296
+ !__props.disabled && showPopup.value ? (openBlock(), createBlock(_sfc_main$r, {
3256
3297
  key: 0,
3257
3298
  ref_key: "selectPopup",
3258
3299
  ref: selectPopup,
@@ -3270,12 +3311,12 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3270
3311
  onRequestClose: _cache[0] || (_cache[0] = ($event) => togglePopup(false))
3271
3312
  }, null, 8, ["base-element", "initial-item", "items", "label-provider", "max-height", "popup-align", "popup-direction", "selected-items", "show-search", "value-provider"])) : createCommentVNode("", true)
3272
3313
  ], 64)),
3273
- !__props.viewMode ? (openBlock(), createBlock(_sfc_main$l, {
3314
+ !__props.viewMode ? (openBlock(), createBlock(_sfc_main$q, {
3274
3315
  key: 2,
3275
3316
  errors: unref(errors),
3276
3317
  "hide-error-message": __props.hideErrorMessage || __props.disabled && !__props.showErrorMessageOnDisabled
3277
3318
  }, null, 8, ["errors", "hide-error-message"])) : createCommentVNode("", true)
3278
- ], 42, _hoisted_1$8)), [
3319
+ ], 42, _hoisted_1$c)), [
3279
3320
  [unref(vClickOutside), () => togglePopup(false)]
3280
3321
  ]);
3281
3322
  };
@@ -3284,14 +3325,10 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3284
3325
  dayjs.extend(utc);
3285
3326
  dayjs.extend(timezone);
3286
3327
  const dateInputFormatByResolution = (resolution) => {
3287
- if (resolution === "DAY")
3288
- return "YYYYMMDD";
3289
- else if (resolution === "HOUR")
3290
- return "YYYYMMDDHH";
3291
- else if (resolution === "SECOND")
3292
- return "YYYYMMDDHHmmss";
3293
- else
3294
- return "YYYYMMDDHHmm";
3328
+ if (resolution === "DAY") return "YYYYMMDD";
3329
+ else if (resolution === "HOUR") return "YYYYMMDDHH";
3330
+ else if (resolution === "SECOND") return "YYYYMMDDHHmmss";
3331
+ else return "YYYYMMDDHHmm";
3295
3332
  };
3296
3333
  const convertInputToDateString = (str, inputFormat, endTime, resolution, inputTimeZone, minDateValue, maxDateValue) => {
3297
3334
  if (str) {
@@ -3304,19 +3341,16 @@ const convertInputToDateString = (str, inputFormat, endTime, resolution, inputTi
3304
3341
  }
3305
3342
  }
3306
3343
  let value = dayjs.tz(str, inputFormat, inputTimeZone);
3307
- if (endTime)
3308
- value = value.endOf(resolution.toLowerCase());
3344
+ if (endTime) value = value.endOf(resolution.toLowerCase());
3309
3345
  const minValue = minDateValue;
3310
3346
  if (minValue) {
3311
3347
  let minDate = dayjs(minValue).tz(inputTimeZone);
3312
- if (value.isBefore(minDate))
3313
- value = minDate;
3348
+ if (value.isBefore(minDate)) value = minDate;
3314
3349
  }
3315
3350
  const maxValue = maxDateValue;
3316
3351
  if (maxValue) {
3317
3352
  let maxDate = dayjs(maxValue).tz(inputTimeZone);
3318
- if (maxDate.isBefore(value))
3319
- value = maxDate;
3353
+ if (maxDate.isBefore(value)) value = maxDate;
3320
3354
  }
3321
3355
  if (resolution === "MINUTE_10" || resolution === "MINUTE_30") {
3322
3356
  const truncateUnit = resolution === "MINUTE_10" ? 10 : 30;
@@ -3346,9 +3380,9 @@ const checkDateMinMaxValue = (value, inputFormat, endTime, resolution, inputTime
3346
3380
  const normalizeDateInput = (value) => {
3347
3381
  return value.replace(/[^\d-]/g, "");
3348
3382
  };
3349
- const _hoisted_1$7 = { class: "bs-date-input-popup" };
3350
- const _hoisted_2$6 = { class: "buttons" };
3351
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
3383
+ const _hoisted_1$b = { class: "bs-date-input-popup" };
3384
+ const _hoisted_2$9 = { class: "buttons" };
3385
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3352
3386
  __name: "BSDateInputPopup",
3353
3387
  props: {
3354
3388
  modelValue: {},
@@ -3376,7 +3410,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
3376
3410
  emit("close");
3377
3411
  };
3378
3412
  return (_ctx, _cache) => {
3379
- return openBlock(), createBlock(_sfc_main$o, {
3413
+ return openBlock(), createBlock(_sfc_main$t, {
3380
3414
  "base-element": __props.baseElement,
3381
3415
  "popup-align": __props.popupAlign,
3382
3416
  "offset-from-base-element": 4,
@@ -3387,8 +3421,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
3387
3421
  }, ["stop"]))
3388
3422
  }, {
3389
3423
  default: withCtx(() => [
3390
- createElementVNode("div", _hoisted_1$7, [
3391
- createVNode(_sfc_main$j, {
3424
+ createElementVNode("div", _hoisted_1$b, [
3425
+ createVNode(_sfc_main$o, {
3392
3426
  modelValue: date.value,
3393
3427
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => date.value = $event),
3394
3428
  "display-format": __props.displayFormat,
@@ -3397,14 +3431,14 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
3397
3431
  "start-year": __props.selectStartYear,
3398
3432
  "time-zone": __props.timeZone
3399
3433
  }, null, 8, ["modelValue", "display-format", "end-year", "resolution", "start-year", "time-zone"]),
3400
- createElementVNode("div", _hoisted_2$6, [
3401
- createVNode(_sfc_main$r, {
3434
+ createElementVNode("div", _hoisted_2$9, [
3435
+ createVNode(_sfc_main$w, {
3402
3436
  caption: __props.okButtonCaption,
3403
3437
  "button-color": "blue",
3404
3438
  class: "min-w-80",
3405
3439
  onClick: emitValue
3406
3440
  }, null, 8, ["caption"]),
3407
- createVNode(_sfc_main$r, {
3441
+ createVNode(_sfc_main$w, {
3408
3442
  caption: __props.cancelButtonCaption,
3409
3443
  class: "min-w-80",
3410
3444
  onClick: close
@@ -3417,16 +3451,16 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
3417
3451
  };
3418
3452
  }
3419
3453
  });
3420
- const _hoisted_1$6 = {
3454
+ const _hoisted_1$a = {
3421
3455
  key: 0,
3422
3456
  class: "view-mode"
3423
3457
  };
3424
- const _hoisted_2$5 = {
3458
+ const _hoisted_2$8 = {
3425
3459
  key: 1,
3426
3460
  class: "input-area"
3427
3461
  };
3428
- const _hoisted_3$3 = ["id", "placeholder", "disabled", "maxlength", "name", "tabindex", "value"];
3429
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3462
+ const _hoisted_3$4 = ["id", "placeholder", "disabled", "maxlength", "name", "tabindex", "value"];
3463
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3430
3464
  __name: "BSDateInput",
3431
3465
  props: {
3432
3466
  id: {},
@@ -3633,9 +3667,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3633
3667
  style: normalizeStyle({ width: __props.width }),
3634
3668
  onKeydown: _cache[2] || (_cache[2] = withKeys(withModifiers(() => togglePopup(false), ["stop", "prevent"]), ["esc"]))
3635
3669
  }, [
3636
- __props.viewMode ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
3670
+ __props.viewMode ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
3637
3671
  createElementVNode("span", null, toDisplayString(viewModeValue.value), 1)
3638
- ])) : (openBlock(), createElementBlock("div", _hoisted_2$5, [
3672
+ ])) : (openBlock(), createElementBlock("div", _hoisted_2$8, [
3639
3673
  createElementVNode("span", {
3640
3674
  class: normalizeClass([{ "bs-clickable": !__props.disabled }, "font-icon"]),
3641
3675
  onClick: _cache[0] || (_cache[0] = ($event) => togglePopup())
@@ -3651,14 +3685,14 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3651
3685
  tabindex: __props.tabindex,
3652
3686
  value: focused.value ? unref(stringValue) : formattedValue.value,
3653
3687
  type: "text"
3654
- }, toHandlers(handlers, true)), null, 16, _hoisted_3$3)
3688
+ }, toHandlers(handlers, true)), null, 16, _hoisted_3$4)
3655
3689
  ])),
3656
- !__props.viewMode ? (openBlock(), createBlock(_sfc_main$l, {
3690
+ !__props.viewMode ? (openBlock(), createBlock(_sfc_main$q, {
3657
3691
  key: 2,
3658
3692
  errors: unref(errors),
3659
3693
  "hide-error-message": __props.hideErrorMessage || __props.disabled && !__props.showErrorMessageOnDisabled
3660
3694
  }, null, 8, ["errors", "hide-error-message"])) : createCommentVNode("", true),
3661
- showPopup.value ? (openBlock(), createBlock(_sfc_main$8, {
3695
+ showPopup.value ? (openBlock(), createBlock(_sfc_main$d, {
3662
3696
  key: 3,
3663
3697
  "base-element": rootRef.value,
3664
3698
  "display-format": actualDisplayFormat.value,
@@ -3679,9 +3713,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3679
3713
  };
3680
3714
  }
3681
3715
  });
3682
- const _hoisted_1$5 = { class: "bs-date-range-popup flex flex-col px-16 py-8" };
3683
- const _hoisted_2$4 = { class: "buttons" };
3684
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3716
+ const _hoisted_1$9 = { class: "bs-date-range-popup flex flex-col px-16 py-8" };
3717
+ const _hoisted_2$7 = { class: "buttons" };
3718
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3685
3719
  __name: "BSDateRangeInputPopup",
3686
3720
  props: {
3687
3721
  from: {},
@@ -3712,7 +3746,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3712
3746
  emit("close");
3713
3747
  };
3714
3748
  return (_ctx, _cache) => {
3715
- return openBlock(), createBlock(_sfc_main$o, {
3749
+ return openBlock(), createBlock(_sfc_main$t, {
3716
3750
  "base-element": __props.baseElement,
3717
3751
  "offset-from-base-element": 4,
3718
3752
  "max-height": "auto",
@@ -3721,8 +3755,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3721
3755
  }, ["stop"]))
3722
3756
  }, {
3723
3757
  default: withCtx(() => [
3724
- createElementVNode("div", _hoisted_1$5, [
3725
- createVNode(_sfc_main$i, {
3758
+ createElementVNode("div", _hoisted_1$9, [
3759
+ createVNode(_sfc_main$n, {
3726
3760
  from: fromValue.value,
3727
3761
  "onUpdate:from": _cache[0] || (_cache[0] = ($event) => fromValue.value = $event),
3728
3762
  to: toValue.value,
@@ -3735,14 +3769,14 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3735
3769
  "start-year": __props.selectStartYear,
3736
3770
  "time-zone": __props.timeZone
3737
3771
  }, null, 8, ["from", "to", "disabled-from", "disabled-to", "display-format", "end-year", "resolution", "start-year", "time-zone"]),
3738
- createElementVNode("div", _hoisted_2$4, [
3739
- createVNode(_sfc_main$r, {
3772
+ createElementVNode("div", _hoisted_2$7, [
3773
+ createVNode(_sfc_main$w, {
3740
3774
  caption: __props.okButtonCaption,
3741
3775
  "button-color": "blue",
3742
3776
  class: "min-w-80",
3743
3777
  onClick: emitValue
3744
3778
  }, null, 8, ["caption"]),
3745
- createVNode(_sfc_main$r, {
3779
+ createVNode(_sfc_main$w, {
3746
3780
  caption: __props.cancelButtonCaption,
3747
3781
  class: "min-w-80",
3748
3782
  onClick: close
@@ -3755,17 +3789,17 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3755
3789
  };
3756
3790
  }
3757
3791
  });
3758
- const _hoisted_1$4 = {
3792
+ const _hoisted_1$8 = {
3759
3793
  key: 0,
3760
3794
  class: "view-mode"
3761
3795
  };
3762
- const _hoisted_2$3 = {
3796
+ const _hoisted_2$6 = {
3763
3797
  key: 1,
3764
3798
  class: "input-area"
3765
3799
  };
3766
- const _hoisted_3$2 = ["id", "placeholder", "disabled", "maxlength", "name", "tabindex", "value"];
3767
- const _hoisted_4$2 = ["id", "placeholder", "disabled", "maxlength", "name", "tabindex", "value"];
3768
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3800
+ const _hoisted_3$3 = ["id", "placeholder", "disabled", "maxlength", "name", "tabindex", "value"];
3801
+ const _hoisted_4$3 = ["id", "placeholder", "disabled", "maxlength", "name", "tabindex", "value"];
3802
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
3769
3803
  __name: "BSDateRange",
3770
3804
  props: {
3771
3805
  idFrom: {},
@@ -4143,9 +4177,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4143
4177
  style: normalizeStyle({ width: __props.width }),
4144
4178
  onKeydown: _cache[2] || (_cache[2] = withKeys(withModifiers(() => togglePopup(false), ["stop", "prevent"]), ["esc"]))
4145
4179
  }, [
4146
- __props.viewMode ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
4180
+ __props.viewMode ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
4147
4181
  createElementVNode("span", null, toDisplayString(formattedDateRange.value), 1)
4148
- ])) : (openBlock(), createElementBlock("div", _hoisted_2$3, [
4182
+ ])) : (openBlock(), createElementBlock("div", _hoisted_2$6, [
4149
4183
  createElementVNode("span", {
4150
4184
  class: normalizeClass([{ "bs-clickable": !disabled.value }, "font-icon"]),
4151
4185
  onClick: _cache[0] || (_cache[0] = () => togglePopup())
@@ -4161,7 +4195,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4161
4195
  tabindex: __props.tabindex,
4162
4196
  value: focusedFrom.value ? unref(stringValueFrom) : formattedFrom.value,
4163
4197
  type: "text"
4164
- }, toHandlers(handlersFrom, true)), null, 16, _hoisted_3$2),
4198
+ }, toHandlers(handlersFrom, true)), null, 16, _hoisted_3$3),
4165
4199
  _cache[3] || (_cache[3] = createElementVNode("span", { class: "px-4" }, "~", -1)),
4166
4200
  createElementVNode("input", mergeProps({
4167
4201
  id: __props.idTo,
@@ -4174,14 +4208,14 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4174
4208
  tabindex: __props.tabindex,
4175
4209
  value: focusedTo.value ? unref(stringValueTo) : formattedTo.value,
4176
4210
  type: "text"
4177
- }, toHandlers(handlersTo, true)), null, 16, _hoisted_4$2)
4211
+ }, toHandlers(handlersTo, true)), null, 16, _hoisted_4$3)
4178
4212
  ])),
4179
- !__props.viewMode ? (openBlock(), createBlock(_sfc_main$l, {
4213
+ !__props.viewMode ? (openBlock(), createBlock(_sfc_main$q, {
4180
4214
  key: 2,
4181
4215
  errors: errors.value,
4182
4216
  "hide-error-message": __props.hideErrorMessage || disabled.value && !__props.showErrorMessageOnDisabled
4183
4217
  }, null, 8, ["errors", "hide-error-message"])) : createCommentVNode("", true),
4184
- showPopup.value ? (openBlock(), createBlock(_sfc_main$6, {
4218
+ showPopup.value ? (openBlock(), createBlock(_sfc_main$b, {
4185
4219
  key: 3,
4186
4220
  "base-element": rootRef.value,
4187
4221
  "disabled-from": __props.disabledFrom,
@@ -4206,7 +4240,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4206
4240
  };
4207
4241
  }
4208
4242
  });
4209
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4243
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
4210
4244
  __name: "SlideDownTransition",
4211
4245
  setup(__props) {
4212
4246
  const beforeEnter = (el) => {
@@ -4269,12 +4303,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4269
4303
  };
4270
4304
  }
4271
4305
  });
4272
- const _hoisted_1$3 = {
4306
+ const _hoisted_1$7 = {
4273
4307
  key: 0,
4274
4308
  class: "card-layout-header flex flex-row items-center"
4275
4309
  };
4276
- const _hoisted_2$2 = ["textContent"];
4277
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4310
+ const _hoisted_2$5 = ["textContent"];
4311
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
4278
4312
  __name: "BSCardLayout",
4279
4313
  props: {
4280
4314
  title: {},
@@ -4288,7 +4322,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4288
4322
  return openBlock(), createElementBlock("div", {
4289
4323
  class: normalizeClass([{ expanded: expanded.value }, "bs-card-layout"])
4290
4324
  }, [
4291
- !__props.hideTitle ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
4325
+ !__props.hideTitle ? (openBlock(), createElementBlock("div", _hoisted_1$7, [
4292
4326
  createElementVNode("span", {
4293
4327
  class: "expand-btn font-icon bs-clickable",
4294
4328
  onClick: toggleExpand
@@ -4296,13 +4330,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4296
4330
  createElementVNode("div", {
4297
4331
  textContent: toDisplayString(__props.title),
4298
4332
  class: "card-layout-title"
4299
- }, null, 8, _hoisted_2$2),
4333
+ }, null, 8, _hoisted_2$5),
4300
4334
  _cache[0] || (_cache[0] = createElementVNode("div", { class: "grow" }, null, -1)),
4301
4335
  createElementVNode("div", null, [
4302
4336
  renderSlot(_ctx.$slots, "title-right")
4303
4337
  ])
4304
4338
  ])) : createCommentVNode("", true),
4305
- createVNode(_sfc_main$4, null, {
4339
+ createVNode(_sfc_main$9, null, {
4306
4340
  default: withCtx(() => [
4307
4341
  withDirectives(createElementVNode("div", {
4308
4342
  class: normalizeClass(__props.cardBodyClass)
@@ -4318,6 +4352,734 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4318
4352
  };
4319
4353
  }
4320
4354
  });
4355
+ const modalPluginKey = "BlueseaModalPlugin";
4356
+ const modalHandleKey = "BlueseaModalHandle";
4357
+ class ModalHandleImpl {
4358
+ constructor(modal, modalId) {
4359
+ this.modal = modal;
4360
+ this.modalId = modalId;
4361
+ }
4362
+ maximized = false;
4363
+ defaultStyleListener;
4364
+ defaultPositionListener;
4365
+ close() {
4366
+ this.modal.closeModal(this.modalId);
4367
+ }
4368
+ setDefaultStyle(modalStyle) {
4369
+ this.defaultStyleListener?.(modalStyle);
4370
+ }
4371
+ setDefaultPosition(modalPosition) {
4372
+ this.defaultPositionListener?.(modalPosition);
4373
+ }
4374
+ setDefaultStyleListener(listener) {
4375
+ this.defaultStyleListener = listener;
4376
+ }
4377
+ setDefaultPositionListener(listener) {
4378
+ this.defaultPositionListener = listener;
4379
+ }
4380
+ }
4381
+ class BSModal {
4382
+ modalItems = reactive([]);
4383
+ openModal(modalItem) {
4384
+ const modalId = Math.random().toString(36);
4385
+ const handle = new ModalHandleImpl(this, modalId);
4386
+ const registered = {
4387
+ modalId,
4388
+ pageId: modalItem.pageId,
4389
+ component: markRaw(modalItem.component),
4390
+ style: modalItem.style,
4391
+ position: modalItem.position,
4392
+ bind: modalItem.bind,
4393
+ on: modalItem.on,
4394
+ slots: modalItem.slots,
4395
+ modalHandle: handle
4396
+ };
4397
+ this.modalItems.push(registered);
4398
+ return registered;
4399
+ }
4400
+ closeModal(modalItem) {
4401
+ let index = -1;
4402
+ if (typeof modalItem === "string") {
4403
+ index = this.modalItems.findIndex((item) => item.modalId === modalItem);
4404
+ } else {
4405
+ index = this.modalItems.findIndex((item) => item === modalItem);
4406
+ }
4407
+ if (index >= 0) this.modalItems.splice(index, 1);
4408
+ }
4409
+ closeAllModals() {
4410
+ this.modalItems.splice(0, this.modalItems.length);
4411
+ }
4412
+ openAlert(title, message, clickHandler) {
4413
+ const option = {
4414
+ component: defineAsyncComponent(() => import("./BSAlertModal-ZEIUM0ut.js")),
4415
+ bind: {
4416
+ title,
4417
+ message
4418
+ },
4419
+ on: {
4420
+ click: async () => await clickHandler?.()
4421
+ }
4422
+ };
4423
+ return this.openModal(option);
4424
+ }
4425
+ openYesNo(title, message, yesHandler, noHandler) {
4426
+ const option = {
4427
+ component: defineAsyncComponent(() => import("./BSYesNoModal-Cs6mgXcP.js")),
4428
+ bind: {
4429
+ title,
4430
+ message
4431
+ },
4432
+ on: {
4433
+ clickYes: async () => await yesHandler?.(),
4434
+ clickNo: async () => await noHandler?.()
4435
+ }
4436
+ };
4437
+ return this.openModal(option);
4438
+ }
4439
+ install(app) {
4440
+ app.provide(modalPluginKey, this);
4441
+ }
4442
+ }
4443
+ const useModal = () => {
4444
+ const modal = inject(modalPluginKey);
4445
+ if (!modal) throw new Error("BSModal is not initialized.");
4446
+ return modal;
4447
+ };
4448
+ const provideModalHandle = (modalHandle) => {
4449
+ provide(modalHandleKey, modalHandle);
4450
+ };
4451
+ const useModalHandle = () => {
4452
+ const modalHandle = inject(modalHandleKey);
4453
+ if (!modalHandle) throw new Error("ModalHandle not found. Maybe not inside modal component.");
4454
+ return modalHandle;
4455
+ };
4456
+ const createModalPlugin = () => {
4457
+ return new BSModal();
4458
+ };
4459
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4460
+ __name: "BSModalWrapper",
4461
+ props: {
4462
+ modalItem: {}
4463
+ },
4464
+ setup(__props) {
4465
+ const props = __props;
4466
+ const defaultModalPosition = ref();
4467
+ props.modalItem.modalHandle.setDefaultPositionListener(
4468
+ (position) => {
4469
+ defaultModalPosition.value = position;
4470
+ initializeOffset(position);
4471
+ }
4472
+ );
4473
+ const modalPositionStyle = computed(() => {
4474
+ const pos = {
4475
+ ...defaultModalPosition.value,
4476
+ ...props.modalItem.position
4477
+ };
4478
+ const result = [];
4479
+ if (pos.horizontal === "left") result.push("items-start");
4480
+ else if (pos.horizontal === "right") result.push("items-end");
4481
+ else result.push("items-center");
4482
+ if (pos.vertical === "top") result.push("justify-start");
4483
+ else if (pos.vertical === "bottom") result.push("justify-end");
4484
+ else result.push("justify-center");
4485
+ return result;
4486
+ });
4487
+ const defaultModalStyle = ref();
4488
+ props.modalItem.modalHandle.setDefaultStyleListener((style) => {
4489
+ defaultModalStyle.value = style;
4490
+ props.modalItem.escToClose = style.escToClose;
4491
+ });
4492
+ const mergedStyle = computed(() => {
4493
+ const result = {
4494
+ ...defaultModalStyle.value,
4495
+ ...props.modalItem.style,
4496
+ transform: ""
4497
+ };
4498
+ if (props.modalItem.modalHandle.maximized) {
4499
+ delete result.maxWidth;
4500
+ delete result.maxHeight;
4501
+ } else {
4502
+ result.transform = `translate(${offset.value.x}px, ${offset.value.y}px)`;
4503
+ }
4504
+ return result;
4505
+ });
4506
+ provideModalHandle(props.modalItem.modalHandle);
4507
+ const modalComponent = ref();
4508
+ const modalPanel = ref();
4509
+ const offset = ref({ x: 0, y: 0 });
4510
+ const initializeOffset = (defaultPosition) => {
4511
+ if (offset.value.x === 0) {
4512
+ offset.value.x = props.modalItem.position?.offsetX ?? defaultPosition?.offsetX ?? 0;
4513
+ }
4514
+ if (offset.value.y === 0) {
4515
+ offset.value.y = props.modalItem.position?.offsetY ?? defaultPosition?.offsetY ?? 0;
4516
+ }
4517
+ };
4518
+ initializeOffset();
4519
+ let initialPosition = void 0;
4520
+ const startMoveModal = (event) => {
4521
+ if (!props.modalItem.modalHandle.maximized && modalPanel.value === event.target && event.button === 0) {
4522
+ initialPosition = {
4523
+ x: event.clientX - offset.value.x,
4524
+ y: event.clientY - offset.value.y
4525
+ };
4526
+ modalPanel.value.setPointerCapture(event.pointerId);
4527
+ }
4528
+ };
4529
+ const moveModal = (event) => {
4530
+ if (!props.modalItem.modalHandle.maximized && initialPosition) {
4531
+ offset.value.x = event.clientX - initialPosition.x;
4532
+ offset.value.y = event.clientY - initialPosition.y;
4533
+ event.preventDefault();
4534
+ event.stopPropagation();
4535
+ }
4536
+ };
4537
+ const endMoveModal = (event) => {
4538
+ if (!props.modalItem.modalHandle.maximized && initialPosition) {
4539
+ modalPanel.value?.releasePointerCapture(event.pointerId);
4540
+ initialPosition = void 0;
4541
+ }
4542
+ };
4543
+ return (_ctx, _cache) => {
4544
+ return withDirectives((openBlock(), createElementBlock("div", {
4545
+ class: normalizeClass([modalPositionStyle.value, "modal-wrapper flex flex-col"])
4546
+ }, [
4547
+ createElementVNode("div", {
4548
+ ref_key: "modalPanel",
4549
+ ref: modalPanel,
4550
+ class: normalizeClass([[
4551
+ __props.modalItem.style?.styleClass,
4552
+ __props.modalItem.modalHandle.maximized ? "maximized" : void 0
4553
+ ], "modal-panel"]),
4554
+ style: normalizeStyle(mergedStyle.value),
4555
+ onPointerdown: startMoveModal,
4556
+ onPointermove: moveModal,
4557
+ onPointerup: endMoveModal
4558
+ }, [
4559
+ (openBlock(), createBlock(resolveDynamicComponent(__props.modalItem.component), mergeProps({
4560
+ ref_key: "modalComponent",
4561
+ ref: modalComponent
4562
+ }, __props.modalItem.bind || {}, toHandlers(__props.modalItem.on || {})), null, 16))
4563
+ ], 38)
4564
+ ], 2)), [
4565
+ [vShow, modalComponent.value]
4566
+ ]);
4567
+ };
4568
+ }
4569
+ });
4570
+ const _hoisted_1$6 = {
4571
+ key: 0,
4572
+ class: "modal-curtain"
4573
+ };
4574
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
4575
+ __name: "BSModalContainer",
4576
+ setup(__props) {
4577
+ const modal = useModal();
4578
+ const modalExists = computed(() => modal.modalItems.length > 0);
4579
+ const disableBodyScroll = (disable) => {
4580
+ document.body.style.overflow = disable ? "hidden" : "auto";
4581
+ };
4582
+ watch(
4583
+ modalExists,
4584
+ () => disableBodyScroll(modalExists.value)
4585
+ );
4586
+ const modalContainer = ref();
4587
+ const getLastModal = () => {
4588
+ return modal.modalItems[modal.modalItems.length - 1];
4589
+ };
4590
+ const escapeLastModal = () => {
4591
+ const lastModal = getLastModal();
4592
+ if (lastModal) {
4593
+ if (lastModal.modalHandle.maximized) {
4594
+ lastModal.modalHandle.maximized = false;
4595
+ } else {
4596
+ lastModal.modalHandle.close();
4597
+ }
4598
+ }
4599
+ };
4600
+ const handleKeyDown = (event) => {
4601
+ if (modalExists.value && event.key === "Escape") {
4602
+ if (event.shiftKey) {
4603
+ escapeLastModal();
4604
+ } else if (modalContainer.value) {
4605
+ const lastModal = getLastModal();
4606
+ if (lastModal?.escToClose) {
4607
+ escapeLastModal();
4608
+ }
4609
+ }
4610
+ }
4611
+ };
4612
+ onMounted(() => {
4613
+ window.addEventListener("keydown", handleKeyDown);
4614
+ });
4615
+ onBeforeUnmount(() => {
4616
+ window.removeEventListener("keydown", handleKeyDown);
4617
+ });
4618
+ return (_ctx, _cache) => {
4619
+ return openBlock(), createElementBlock("div", {
4620
+ ref_key: "modalContainer",
4621
+ ref: modalContainer,
4622
+ class: "bs-modal-container"
4623
+ }, [
4624
+ modalExists.value ? (openBlock(), createElementBlock("div", _hoisted_1$6)) : createCommentVNode("", true),
4625
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(modal).modalItems, (item) => {
4626
+ return openBlock(), createBlock(_sfc_main$7, {
4627
+ key: item.modalId,
4628
+ "data-page-id": item.pageId,
4629
+ "modal-item": item
4630
+ }, null, 8, ["data-page-id", "modal-item"]);
4631
+ }), 128))
4632
+ ], 512);
4633
+ };
4634
+ }
4635
+ });
4636
+ const findElement = (maybeElement) => {
4637
+ const val = maybeElement?.value;
4638
+ if (val) {
4639
+ if ("querySelectorAll" in val) return val;
4640
+ if ("$el" in val && "querySelectorAll" in val.$el) return val.$el;
4641
+ }
4642
+ };
4643
+ const findInputComponents = (maybeElement) => {
4644
+ const element = findElement(maybeElement);
4645
+ if (element) {
4646
+ const selector = `input,textarea,select,[role=listbox],[role=radiogroup],[role=group],[role=textbox],[role=img]`;
4647
+ return Array.from(element.querySelectorAll(selector)).map((el) => el);
4648
+ }
4649
+ return [];
4650
+ };
4651
+ const getComponentRootElement = (component) => {
4652
+ return "$el" in component ? component.$el : void 0;
4653
+ };
4654
+ const focusFirstElement = (element) => {
4655
+ const focusable = findFirstFocusableElement(element);
4656
+ if (focusable) {
4657
+ focusable.focus();
4658
+ return true;
4659
+ } else {
4660
+ return false;
4661
+ }
4662
+ };
4663
+ const focusLastElement = (element) => {
4664
+ const focusable = findLastFocusableElement(element);
4665
+ if (focusable) {
4666
+ focusable.focus();
4667
+ return true;
4668
+ } else {
4669
+ return false;
4670
+ }
4671
+ };
4672
+ const findFirstFocusableElement = (element) => {
4673
+ const focusableElementsSelector = 'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), [tabindex]:not([disabled])';
4674
+ return element.querySelector(focusableElementsSelector) || void 0;
4675
+ };
4676
+ const findLastFocusableElement = (element) => {
4677
+ const focusableElementsSelector = 'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), [tabindex]:not([disabled])';
4678
+ const all = element.querySelectorAll(focusableElementsSelector);
4679
+ return all.item(all.length - 1) || void 0;
4680
+ };
4681
+ const getSelfIndex = (element) => {
4682
+ if (element.parentElement) {
4683
+ return Array.from(element.parentElement.children).indexOf(element);
4684
+ } else {
4685
+ return -1;
4686
+ }
4687
+ };
4688
+ const NAMED_COLORS = {
4689
+ aliceblue: "#F0F8FF",
4690
+ antiquewhite: "#FAEBD7",
4691
+ aqua: "#00FFFF",
4692
+ aquamarine: "#7FFFD4",
4693
+ azure: "#F0FFFF",
4694
+ beige: "#F5F5DC",
4695
+ bisque: "#FFE4C4",
4696
+ black: "#000000",
4697
+ blanchedalmond: "#FFEBCD",
4698
+ blue: "#0000FF",
4699
+ blueviolet: "#8A2BE2",
4700
+ brown: "#A52A2A",
4701
+ burlywood: "#DEB887",
4702
+ cadetblue: "#5F9EA0",
4703
+ chartreuse: "#7FFF00",
4704
+ chocolate: "#D2691E",
4705
+ coral: "#FF7F50",
4706
+ cornflowerblue: "#6495ED",
4707
+ cornsilk: "#FFF8DC",
4708
+ crimson: "#DC143C",
4709
+ cyan: "#00FFFF",
4710
+ darkblue: "#00008B",
4711
+ darkcyan: "#008B8B",
4712
+ darkgoldenrod: "#B8860B",
4713
+ darkgray: "#A9A9A9",
4714
+ darkgrey: "#A9A9A9",
4715
+ darkgreen: "#006400",
4716
+ darkkhaki: "#BDB76B",
4717
+ darkmagenta: "#8B008B",
4718
+ darkolivegreen: "#556B2F",
4719
+ darkorange: "#FF8C00",
4720
+ darkorchid: "#9932CC",
4721
+ darkred: "#8B0000",
4722
+ darksalmon: "#E9967A",
4723
+ darkseagreen: "#8FBC8F",
4724
+ darkslateblue: "#483D8B",
4725
+ darkslategray: "#2F4F4F",
4726
+ darkslategrey: "#2F4F4F",
4727
+ darkturquoise: "#00CED1",
4728
+ darkviolet: "#9400D3",
4729
+ deeppink: "#FF1493",
4730
+ deepskyblue: "#00BFFF",
4731
+ dimgray: "#696969",
4732
+ dimgrey: "#696969",
4733
+ dodgerblue: "#1E90FF",
4734
+ firebrick: "#B22222",
4735
+ floralwhite: "#FFFAF0",
4736
+ forestgreen: "#228B22",
4737
+ fuchsia: "#FF00FF",
4738
+ gainsboro: "#DCDCDC",
4739
+ ghostwhite: "#F8F8FF",
4740
+ gold: "#FFD700",
4741
+ goldenrod: "#DAA520",
4742
+ gray: "#808080",
4743
+ grey: "#808080",
4744
+ green: "#008000",
4745
+ greenyellow: "#ADFF2F",
4746
+ honeydew: "#F0FFF0",
4747
+ hotpink: "#FF69B4",
4748
+ indianred: "#CD5C5C",
4749
+ indigo: "#4B0082",
4750
+ ivory: "#FFFFF0",
4751
+ khaki: "#F0E68C",
4752
+ lavender: "#E6E6FA",
4753
+ lavenderblush: "#FFF0F5",
4754
+ lawngreen: "#7CFC00",
4755
+ lemonchiffon: "#FFFACD",
4756
+ lightblue: "#ADD8E6",
4757
+ lightcoral: "#F08080",
4758
+ lightcyan: "#E0FFFF",
4759
+ lightgoldenrodyellow: "#FAFAD2",
4760
+ lightgray: "#D3D3D3",
4761
+ lightgrey: "#D3D3D3",
4762
+ lightgreen: "#90EE90",
4763
+ lightpink: "#FFB6C1",
4764
+ lightsalmon: "#FFA07A",
4765
+ lightseagreen: "#20B2AA",
4766
+ lightskyblue: "#87CEFA",
4767
+ lightslategray: "#778899",
4768
+ lightslategrey: "#778899",
4769
+ lightsteelblue: "#B0C4DE",
4770
+ lightyellow: "#FFFFE0",
4771
+ lime: "#00FF00",
4772
+ limegreen: "#32CD32",
4773
+ linen: "#FAF0E6",
4774
+ magenta: "#FF00FF",
4775
+ maroon: "#800000",
4776
+ mediumaquamarine: "#66CDAA",
4777
+ mediumblue: "#0000CD",
4778
+ mediumorchid: "#BA55D3",
4779
+ mediumpurple: "#9370DB",
4780
+ mediumseagreen: "#3CB371",
4781
+ mediumslateblue: "#7B68EE",
4782
+ mediumspringgreen: "#00FA9A",
4783
+ mediumturquoise: "#48D1CC",
4784
+ mediumvioletred: "#C71585",
4785
+ midnightblue: "#191970",
4786
+ mintcream: "#F5FFFA",
4787
+ mistyrose: "#FFE4E1",
4788
+ moccasin: "#FFE4B5",
4789
+ navajowhite: "#FFDEAD",
4790
+ navy: "#000080",
4791
+ oldlace: "#FDF5E6",
4792
+ olive: "#808000",
4793
+ olivedrab: "#6B8E23",
4794
+ orange: "#FFA500",
4795
+ orangered: "#FF4500",
4796
+ orchid: "#DA70D6",
4797
+ palegoldenrod: "#EEE8AA",
4798
+ palegreen: "#98FB98",
4799
+ paleturquoise: "#AFEEEE",
4800
+ palevioletred: "#DB7093",
4801
+ papayawhip: "#FFEFD5",
4802
+ peachpuff: "#FFDAB9",
4803
+ peru: "#CD853F",
4804
+ pink: "#FFC0CB",
4805
+ plum: "#DDA0DD",
4806
+ powderblue: "#B0E0E6",
4807
+ purple: "#800080",
4808
+ rebeccapurple: "#663399",
4809
+ red: "#FF0000",
4810
+ rosybrown: "#BC8F8F",
4811
+ royalblue: "#4169E1",
4812
+ saddlebrown: "#8B4513",
4813
+ salmon: "#FA8072",
4814
+ sandybrown: "#F4A460",
4815
+ seagreen: "#2E8B57",
4816
+ seashell: "#FFF5EE",
4817
+ sienna: "#A0522D",
4818
+ silver: "#C0C0C0",
4819
+ skyblue: "#87CEEB",
4820
+ slateblue: "#6A5ACD",
4821
+ slategray: "#708090",
4822
+ slategrey: "#708090",
4823
+ snow: "#FFFAFA",
4824
+ springgreen: "#00FF7F",
4825
+ steelblue: "#4682B4",
4826
+ tan: "#D2B48C",
4827
+ teal: "#008080",
4828
+ thistle: "#D8BFD8",
4829
+ tomato: "#FF6347",
4830
+ turquoise: "#40E0D0",
4831
+ violet: "#EE82EE",
4832
+ wheat: "#F5DEB3",
4833
+ white: "#FFFFFF",
4834
+ whitesmoke: "#F5F5F5",
4835
+ yellow: "#FFFF00",
4836
+ yellowgreen: "#9ACD32"
4837
+ };
4838
+ class FocusLoopContext {
4839
+ constructor(el) {
4840
+ this.el = el;
4841
+ }
4842
+ firstEl;
4843
+ lastEl;
4844
+ update() {
4845
+ const first = findFirstFocusableElement(this.el);
4846
+ if (this.firstEl !== first) {
4847
+ this.firstEl?.removeEventListener("keydown", this.onShiftTabKeyDown.bind(this));
4848
+ this.firstEl = first;
4849
+ this.firstEl?.addEventListener("keydown", this.onShiftTabKeyDown.bind(this));
4850
+ }
4851
+ const last = findLastFocusableElement(this.el);
4852
+ if (this.lastEl !== last) {
4853
+ this.lastEl?.removeEventListener("keydown", this.onTabKeyDown.bind(this));
4854
+ this.lastEl = last;
4855
+ this.lastEl?.addEventListener("keydown", this.onTabKeyDown.bind(this));
4856
+ }
4857
+ }
4858
+ onTabKeyDown(event) {
4859
+ if (event.key == "Tab" && !event.shiftKey) {
4860
+ this.firstEl?.focus();
4861
+ event.preventDefault();
4862
+ event.stopPropagation();
4863
+ }
4864
+ }
4865
+ onShiftTabKeyDown(event) {
4866
+ if (event.key == "Tab" && event.shiftKey) {
4867
+ this.lastEl?.focus();
4868
+ event.preventDefault();
4869
+ event.stopPropagation();
4870
+ }
4871
+ }
4872
+ }
4873
+ const VFocusLoop = {
4874
+ mounted: async (el, _binding) => {
4875
+ if (el instanceof HTMLElement) {
4876
+ el.vFocusLoopContext = new FocusLoopContext(el);
4877
+ await nextTick();
4878
+ el.vFocusLoopContext.update();
4879
+ }
4880
+ }
4881
+ };
4882
+ const _hoisted_1$5 = { class: "bs-modal-frame flex flex-col" };
4883
+ const _hoisted_2$4 = {
4884
+ key: 0,
4885
+ class: "title-bar flex flex-row items-center"
4886
+ };
4887
+ const _hoisted_3$2 = { class: "title grow" };
4888
+ const _hoisted_4$2 = ["textContent"];
4889
+ const _hoisted_5$1 = { class: "title-buttons" };
4890
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4891
+ __name: "BSModalFrame",
4892
+ props: {
4893
+ title: {},
4894
+ hideMaximizeButton: { type: Boolean },
4895
+ hideCloseButton: { type: Boolean },
4896
+ closeCaption: { default: "Close" },
4897
+ autoFocus: { type: Boolean }
4898
+ },
4899
+ emits: ["closeModal"],
4900
+ setup(__props, { emit: __emit }) {
4901
+ const props = __props;
4902
+ const emit = __emit;
4903
+ const slots = useSlots();
4904
+ const hasTitleBar = computed(
4905
+ () => props.title || slots["title"] || slots["title-buttons"] || !props.hideCloseButton
4906
+ );
4907
+ const hasButtons = computed(() => slots["buttons"]);
4908
+ const modalHandle = useModalHandle();
4909
+ const toggleMaximize = () => {
4910
+ modalHandle.maximized = !modalHandle.maximized;
4911
+ };
4912
+ const closeModal = () => {
4913
+ modalHandle.close();
4914
+ emit("closeModal");
4915
+ };
4916
+ const modalBody = ref();
4917
+ const modalButtons = ref();
4918
+ onMounted(async () => {
4919
+ await nextTick();
4920
+ if (props.autoFocus) {
4921
+ modalBody.value && focusFirstElement(modalBody.value) || modalButtons.value && focusFirstElement(modalButtons.value);
4922
+ } else if (modalBody.value) {
4923
+ modalBody.value.tabIndex = 0;
4924
+ modalBody.value.focus();
4925
+ modalBody.value.tabIndex = -1;
4926
+ }
4927
+ });
4928
+ return (_ctx, _cache) => {
4929
+ return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$5, [
4930
+ hasTitleBar.value ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
4931
+ createElementVNode("div", _hoisted_3$2, [
4932
+ renderSlot(_ctx.$slots, "title", {}, () => [
4933
+ createElementVNode("span", {
4934
+ textContent: toDisplayString(__props.title)
4935
+ }, null, 8, _hoisted_4$2)
4936
+ ])
4937
+ ]),
4938
+ createElementVNode("div", _hoisted_5$1, [
4939
+ renderSlot(_ctx.$slots, "title-buttons")
4940
+ ]),
4941
+ createElementVNode("div", null, [
4942
+ !__props.hideMaximizeButton ? (openBlock(), createBlock(_sfc_main$w, {
4943
+ key: 0,
4944
+ "left-icon": unref(modalHandle).maximized ? "minimize" : "maximize",
4945
+ title: unref(modalHandle).maximized ? "Restore" : "Maximize",
4946
+ class: "border-0 maximize-btn",
4947
+ onClick: toggleMaximize
4948
+ }, null, 8, ["left-icon", "title"])) : createCommentVNode("", true),
4949
+ !__props.hideCloseButton ? (openBlock(), createBlock(_sfc_main$w, {
4950
+ key: 1,
4951
+ title: __props.closeCaption,
4952
+ class: "border-0 close-btn",
4953
+ "left-icon": "close",
4954
+ onClick: closeModal
4955
+ }, null, 8, ["title"])) : createCommentVNode("", true)
4956
+ ])
4957
+ ])) : createCommentVNode("", true),
4958
+ createElementVNode("div", {
4959
+ ref_key: "modalBody",
4960
+ ref: modalBody,
4961
+ class: "grow overflow-auto outline-none"
4962
+ }, [
4963
+ renderSlot(_ctx.$slots, "default")
4964
+ ], 512),
4965
+ hasButtons.value ? (openBlock(), createElementBlock("div", {
4966
+ key: 1,
4967
+ ref_key: "modalButtons",
4968
+ ref: modalButtons,
4969
+ class: "buttons"
4970
+ }, [
4971
+ renderSlot(_ctx.$slots, "buttons")
4972
+ ], 512)) : createCommentVNode("", true)
4973
+ ])), [
4974
+ [unref(VFocusLoop)]
4975
+ ]);
4976
+ };
4977
+ }
4978
+ });
4979
+ const _hoisted_1$4 = ["textContent"];
4980
+ const _hoisted_2$3 = { class: "text-right" };
4981
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4982
+ __name: "BSAlertModal",
4983
+ props: {
4984
+ title: {},
4985
+ message: {},
4986
+ okCaption: { default: "OK" }
4987
+ },
4988
+ emits: ["click"],
4989
+ setup(__props, { emit: __emit }) {
4990
+ const emit = __emit;
4991
+ const modalHandle = useModalHandle();
4992
+ modalHandle.setDefaultStyle({
4993
+ minWidth: "300px",
4994
+ escToClose: true
4995
+ });
4996
+ const clickOk = () => {
4997
+ emit("click");
4998
+ modalHandle.close();
4999
+ };
5000
+ return (_ctx, _cache) => {
5001
+ return openBlock(), createBlock(_sfc_main$5, {
5002
+ title: __props.title,
5003
+ "auto-focus": ""
5004
+ }, {
5005
+ buttons: withCtx(() => [
5006
+ createElementVNode("div", _hoisted_2$3, [
5007
+ withDirectives(createVNode(_sfc_main$w, {
5008
+ caption: __props.okCaption,
5009
+ "button-color": "blue",
5010
+ class: "min-w-80",
5011
+ "data-id": "okBtn",
5012
+ onClick: clickOk
5013
+ }, null, 8, ["caption"]), [
5014
+ [unref(vFocusOnLoad)]
5015
+ ])
5016
+ ])
5017
+ ]),
5018
+ default: withCtx(() => [
5019
+ createElementVNode("div", {
5020
+ textContent: toDisplayString(__props.message)
5021
+ }, null, 8, _hoisted_1$4)
5022
+ ]),
5023
+ _: 1
5024
+ }, 8, ["title"]);
5025
+ };
5026
+ }
5027
+ });
5028
+ const _hoisted_1$3 = ["textContent"];
5029
+ const _hoisted_2$2 = { class: "text-right" };
5030
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5031
+ __name: "BSYesNoModal",
5032
+ props: {
5033
+ title: {},
5034
+ message: {},
5035
+ yesCaption: { default: "Yes" },
5036
+ noCaption: { default: "No" }
5037
+ },
5038
+ emits: ["clickNo", "clickYes"],
5039
+ setup(__props, { emit: __emit }) {
5040
+ const emit = __emit;
5041
+ const modalHandle = useModalHandle();
5042
+ modalHandle.setDefaultStyle({
5043
+ minWidth: "300px",
5044
+ escToClose: true
5045
+ });
5046
+ const clickNo = () => {
5047
+ emit("clickNo");
5048
+ modalHandle.close();
5049
+ };
5050
+ const clickYes = () => {
5051
+ emit("clickYes");
5052
+ modalHandle.close();
5053
+ };
5054
+ return (_ctx, _cache) => {
5055
+ return openBlock(), createBlock(_sfc_main$5, { title: __props.title }, {
5056
+ buttons: withCtx(() => [
5057
+ createElementVNode("div", _hoisted_2$2, [
5058
+ createVNode(_sfc_main$w, {
5059
+ caption: __props.noCaption,
5060
+ class: "min-w-80",
5061
+ "data-id": "noBtn",
5062
+ onClick: clickNo
5063
+ }, null, 8, ["caption"]),
5064
+ createVNode(_sfc_main$w, {
5065
+ caption: __props.yesCaption,
5066
+ "button-color": "blue",
5067
+ class: "ml-8 min-w-80",
5068
+ "data-id": "yesBtn",
5069
+ onClick: clickYes
5070
+ }, null, 8, ["caption"])
5071
+ ])
5072
+ ]),
5073
+ default: withCtx(() => [
5074
+ createElementVNode("div", {
5075
+ textContent: toDisplayString(__props.message)
5076
+ }, null, 8, _hoisted_1$3)
5077
+ ]),
5078
+ _: 1
5079
+ }, 8, ["title"]);
5080
+ };
5081
+ }
5082
+ });
4321
5083
  const _hoisted_1$2 = { class: "bs-notification-container" };
4322
5084
  const _hoisted_2$1 = { class: "top-notification inline-flex flex-col items-center gap-1" };
4323
5085
  const _hoisted_3$1 = ["textContent"];
@@ -4364,7 +5126,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
4364
5126
  })
4365
5127
  ]),
4366
5128
  createElementVNode("div", _hoisted_5, [
4367
- unref(tooltipEntry) ? (openBlock(), createBlock(_sfc_main$n, {
5129
+ unref(tooltipEntry) ? (openBlock(), createBlock(_sfc_main$s, {
4368
5130
  key: 0,
4369
5131
  ref_key: "tooltip",
4370
5132
  ref: tooltip,
@@ -4431,7 +5193,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4431
5193
  return (_ctx, _cache) => {
4432
5194
  const _component_router_link = resolveComponent("router-link");
4433
5195
  const _component_BSContextMenu = resolveComponent("BSContextMenu", true);
4434
- return openBlock(), createBlock(_sfc_main$o, {
5196
+ return openBlock(), createBlock(_sfc_main$t, {
4435
5197
  ref: "root",
4436
5198
  "base-element": __props.baseElement || { left: __props.left || 0, top: __props.top || 0 },
4437
5199
  "popup-direction": __props.direction,
@@ -4530,49 +5292,95 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4530
5292
  };
4531
5293
  }
4532
5294
  });
5295
+ class IllegalAccessError {
5296
+ }
4533
5297
  export {
4534
- _sfc_main$r as BSButton,
4535
- _sfc_main$j as BSCalendar,
4536
- _sfc_main$i as BSCalendarRange,
4537
- _sfc_main$3 as BSCardLayout,
4538
- _sfc_main$d as BSCheckbox,
4539
- _sfc_main$c as BSCheckboxGroup,
5298
+ _sfc_main$4 as BSAlertModal,
5299
+ _sfc_main$w as BSButton,
5300
+ _sfc_main$o as BSCalendar,
5301
+ _sfc_main$n as BSCalendarRange,
5302
+ _sfc_main$8 as BSCardLayout,
5303
+ _sfc_main$i as BSCheckbox,
5304
+ _sfc_main$h as BSCheckboxGroup,
4540
5305
  _sfc_main$1 as BSContextMenu,
4541
5306
  _sfc_main as BSContextMenuContainer,
4542
5307
  BSContextMenuPlugin,
4543
- _sfc_main$7 as BSDateInput,
4544
- _sfc_main$8 as BSDateInputPopup,
4545
- _sfc_main$5 as BSDateRange,
4546
- _sfc_main$6 as BSDateRangeInputPopup,
5308
+ _sfc_main$c as BSDateInput,
5309
+ _sfc_main$d as BSDateInputPopup,
5310
+ _sfc_main$a as BSDateRange,
5311
+ _sfc_main$b as BSDateRangeInputPopup,
4547
5312
  BSLoadingIcon,
4548
- _sfc_main$9 as BSMultiSelect,
5313
+ BSModal,
5314
+ _sfc_main$6 as BSModalContainer,
5315
+ _sfc_main$5 as BSModalFrame,
5316
+ _sfc_main$e as BSMultiSelect,
4549
5317
  _sfc_main$2 as BSNotificationContainer,
4550
- _sfc_main$f as BSNumberInput,
4551
- _sfc_main$q as BSPageNavigation,
4552
- _sfc_main$o as BSPopup,
4553
- _sfc_main$b as BSRadioButton,
4554
- _sfc_main$a as BSRadioButtonGroup,
4555
- _sfc_main$k as BSSelect,
4556
- _sfc_main$e as BSTextArea,
4557
- _sfc_main$g as BSTextInput,
4558
- _sfc_main$n as BSTooltip,
5318
+ _sfc_main$k as BSNumberInput,
5319
+ _sfc_main$v as BSPageNavigation,
5320
+ _sfc_main$t as BSPopup,
5321
+ _sfc_main$g as BSRadioButton,
5322
+ _sfc_main$f as BSRadioButtonGroup,
5323
+ _sfc_main$p as BSSelect,
5324
+ _sfc_main$j as BSTextArea,
5325
+ _sfc_main$l as BSTextInput,
5326
+ _sfc_main$s as BSTooltip,
5327
+ _sfc_main$3 as BSYesNoModal,
4559
5328
  BlueseaPlugin,
4560
5329
  ContextMenuPluginKey,
5330
+ IllegalAccessError,
5331
+ NAMED_COLORS,
4561
5332
  SavePointImpl,
5333
+ alarmEntries,
4562
5334
  cancelProvidedSavePoint,
5335
+ closeAlarm,
5336
+ componentUtil,
4563
5337
  createContextMenuPlugin,
5338
+ createModalPlugin,
4564
5339
  debounce,
5340
+ defaultKeyProvider,
5341
+ defaultLabelProvider,
5342
+ emptyKeyProvider,
5343
+ emptyLabelProvider,
5344
+ executeKeyProviderOrDefault,
5345
+ executeLabelProviderOrDefault,
5346
+ findElement,
5347
+ findFirstFocusableElement,
5348
+ findInputComponents,
5349
+ findLastFocusableElement,
5350
+ focusFirstElement,
5351
+ focusLastElement,
5352
+ formatUtil,
5353
+ getComponentRootElement,
5354
+ getSelfIndex,
5355
+ hideLoading,
5356
+ hideTooltip,
5357
+ isTooltipDisplayed,
5358
+ modalHandleKey,
5359
+ modalPluginKey,
4565
5360
  notNull,
5361
+ notificationEntries,
4566
5362
  provideFieldContext,
5363
+ provideModalHandle,
4567
5364
  provideSavePoint,
5365
+ showAlarm,
5366
+ showLoading,
5367
+ showLoadingIcon,
5368
+ showNotification,
5369
+ showTooltip,
5370
+ tooltipEntry,
4568
5371
  tryUntil,
5372
+ useBlueseaConfig,
4569
5373
  useContextMenu,
4570
5374
  useContextMenuOptional,
4571
5375
  useFieldContext,
5376
+ useModal,
5377
+ useModalHandle,
4572
5378
  useSavePoint,
4573
5379
  vClickOutside,
5380
+ VFocusLoop as vFocusLoop,
4574
5381
  vFocusOnLoad,
4575
5382
  vTooltip,
4576
5383
  waitDuring,
4577
- waitUntil
5384
+ waitUntil,
5385
+ withLoading
4578
5386
  };