@bagelink/vue 0.0.423 → 0.0.431

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/components/AccordionItem.vue.d.ts +3 -2
  2. package/dist/components/AccordionItem.vue.d.ts.map +1 -1
  3. package/dist/components/Alert.vue.d.ts +4 -1
  4. package/dist/components/Alert.vue.d.ts.map +1 -1
  5. package/dist/components/Avatar.vue.d.ts.map +1 -1
  6. package/dist/components/Carousel.vue.d.ts +8 -2
  7. package/dist/components/Carousel.vue.d.ts.map +1 -1
  8. package/dist/components/Modal.vue.d.ts.map +1 -1
  9. package/dist/components/TableSchema.vue.d.ts +2 -5
  10. package/dist/components/TableSchema.vue.d.ts.map +1 -1
  11. package/dist/components/form/inputs/DatePicker.vue.d.ts +4 -0
  12. package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
  13. package/dist/components/form/inputs/FileUpload.vue.d.ts +6 -2
  14. package/dist/components/form/inputs/FileUpload.vue.d.ts.map +1 -1
  15. package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -1
  16. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
  17. package/dist/components/form/inputs/TextInput.vue.d.ts +0 -3
  18. package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
  19. package/dist/components/layout/Tabs.vue.d.ts +6 -2
  20. package/dist/components/layout/Tabs.vue.d.ts.map +1 -1
  21. package/dist/components/layout/TabsNav.vue.d.ts +6 -2
  22. package/dist/components/layout/TabsNav.vue.d.ts.map +1 -1
  23. package/dist/index.cjs +256 -155
  24. package/dist/index.mjs +257 -156
  25. package/dist/plugins/bagel.d.ts +3 -0
  26. package/dist/plugins/bagel.d.ts.map +1 -1
  27. package/dist/style.css +194 -172
  28. package/dist/utils/index.d.ts +1 -0
  29. package/dist/utils/index.d.ts.map +1 -1
  30. package/dist/utils/lang.d.ts +7 -0
  31. package/dist/utils/lang.d.ts.map +1 -0
  32. package/package.json +1 -1
  33. package/src/components/AccordionItem.vue +57 -43
  34. package/src/components/Alert.vue +4 -2
  35. package/src/components/Avatar.vue +1 -1
  36. package/src/components/Carousel.vue +2 -2
  37. package/src/components/Modal.vue +4 -2
  38. package/src/components/TableSchema.vue +19 -9
  39. package/src/components/form/inputs/DatePicker.vue +8 -2
  40. package/src/components/form/inputs/FileUpload.vue +54 -23
  41. package/src/components/form/inputs/RadioPillsInput.vue +5 -4
  42. package/src/components/form/inputs/SelectInput.vue +212 -204
  43. package/src/components/form/inputs/TextInput.vue +1 -1
  44. package/src/components/layout/Tabs.vue +14 -5
  45. package/src/components/layout/TabsNav.vue +40 -15
  46. package/src/plugins/bagel.ts +13 -4
  47. package/src/utils/index.ts +2 -0
  48. package/src/utils/lang.ts +39 -0
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ var __publicField2 = (obj, key, value) => {
4
4
  __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { pushScopeId, popScopeId, defineComponent, nextTick, openBlock, createBlock, createElementBlock, normalizeClass, renderSlot, normalizeProps, guardReactiveProps, withScopeId, resolveComponent, normalizeStyle, withKeys, createElementVNode, Fragment as Fragment$1, createCommentVNode, mergeProps, withCtx, createVNode, ref, createApp, h as h$2, toDisplayString, inject, unref, renderList, resolveDynamicComponent, useCssVars, useSlots, computed, withModifiers, createTextVNode, watch, onMounted, onUnmounted, mergeModels, useModel, createSlots, Transition, reactive, provide, isRef, withDirectives, vModelCheckbox, toRef, Teleport, render as render$f, onBeforeUpdate, vShow, getCurrentScope, onScopeDispose, TransitionGroup, vModelDynamic, vModelText, vModelRadio, onBeforeUnmount, getCurrentInstance, watchEffect, markRaw, customRef, resolveDirective } from "vue";
7
+ import { pushScopeId, popScopeId, defineComponent, nextTick, openBlock, createBlock, createElementBlock, normalizeClass, renderSlot, normalizeProps, guardReactiveProps, withScopeId, resolveComponent, normalizeStyle, withKeys, createElementVNode, Fragment as Fragment$1, createCommentVNode, mergeProps, withCtx, createVNode, ref, createApp, h as h$2, toDisplayString, reactive, computed, inject, unref, renderList, resolveDynamicComponent, useCssVars, useSlots, withModifiers, createTextVNode, watch, onMounted, onUnmounted, mergeModels, useModel, createSlots, Transition, provide, isRef, withDirectives, vModelCheckbox, toRef, Teleport, render as render$f, onBeforeUpdate, vShow, getCurrentScope, onScopeDispose, TransitionGroup, vModelDynamic, vModelText, vModelRadio, onBeforeUnmount, getCurrentInstance, watchEffect, markRaw, customRef, resolveDirective } from "vue";
8
8
  const sides = ["top", "right", "bottom", "left"];
9
9
  const alignments = ["start", "end"];
10
10
  const placements$1 = /* @__PURE__ */ sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
@@ -4811,94 +4811,6 @@ const clickOutside = {
4811
4811
  document.removeEventListener("click", el.clickOutsideEvent);
4812
4812
  }
4813
4813
  };
4814
- const bagelInjectionKey = Symbol("bagel");
4815
- const i18nTInjectionKey = Symbol("bagel");
4816
- function useBagel() {
4817
- const bagel = inject(bagelInjectionKey);
4818
- if (!bagel)
4819
- throw new Error("No bagel provided");
4820
- return bagel;
4821
- }
4822
- function useI18nT() {
4823
- const i18nT = inject(i18nTInjectionKey);
4824
- if (!i18nT)
4825
- throw new Error("No i18nT provided");
4826
- return i18nT;
4827
- }
4828
- const BagelVue = {
4829
- install: (app, options) => {
4830
- const bagel = new Bagel({ host: options.host, onError: options.onError });
4831
- app.directive("click-outside", clickOutside);
4832
- app.use(Gt$1, {
4833
- themes: {
4834
- "bgl-theme": {
4835
- triggers: ["click"],
4836
- autoHide: true,
4837
- placement: "bottom"
4838
- }
4839
- }
4840
- });
4841
- app.config.globalProperties.$bagel = bagel;
4842
- app.provide(bagelInjectionKey, bagel);
4843
- app.config.globalProperties.$i18T = (options == null ? void 0 : options.i18nT) || ((key) => key);
4844
- app.provide(i18nTInjectionKey, (options == null ? void 0 : options.i18nT) || ((key) => key));
4845
- }
4846
- };
4847
- const ModalSymbol = Symbol("modal");
4848
- const useModal = () => {
4849
- const modalApi = inject(ModalSymbol);
4850
- if (!modalApi)
4851
- throw new Error("Modal API not provided");
4852
- return modalApi;
4853
- };
4854
- const ModalPlugin = {
4855
- install: (app) => {
4856
- const modalStack = ref([]);
4857
- const hideModal = (index2) => {
4858
- modalStack.value.splice(index2, 1);
4859
- };
4860
- const modalConfirm = (options) => new Promise((resolve) => {
4861
- if (typeof options === "string")
4862
- options = { title: options, message: "" };
4863
- modalStack.value.push({
4864
- modalOptions: { ...options, resolve },
4865
- modalType: "confirm",
4866
- componentSlots: {}
4867
- });
4868
- });
4869
- const showModal = (modalType, options, slots = {}) => {
4870
- modalStack.value.push({
4871
- modalOptions: options,
4872
- modalType,
4873
- componentSlots: slots
4874
- });
4875
- if (modalType === "modalForm")
4876
- return modalStack.value.at(-1);
4877
- return modalStack.value.at(-1);
4878
- };
4879
- app.provide(ModalSymbol, {
4880
- showModal: (options, slots) => showModal("modal", options, slots),
4881
- showModalForm: (options, slots) => showModal("modalForm", options, slots),
4882
- confirm: (userOptions) => modalConfirm(userOptions),
4883
- hideModal: (index2 = modalStack.value.length - 1) => hideModal(index2)
4884
- // modalOptions,
4885
- });
4886
- const ModalComponent = defineComponent({
4887
- data: () => ({ modalStack: modalStack.value }),
4888
- render() {
4889
- return modalStack.value.map((modal, index2) => {
4890
- const props2 = { ...modal.modalOptions, visible: true, "onUpdate:visible": () => hideModal(index2) };
4891
- if (modal.modalType === "modalForm")
4892
- return h$2(ModalForm, props2, modal.componentSlots);
4893
- if (modal.modalType === "confirm")
4894
- return h$2(_sfc_main$n, props2, {});
4895
- return h$2(_sfc_main$F, props2, modal.componentSlots);
4896
- });
4897
- }
4898
- });
4899
- app.component("ModalContainer", ModalComponent);
4900
- }
4901
- };
4902
4814
  function formatString(str, format2) {
4903
4815
  if (format2 === "titleCase") {
4904
4816
  return str.split("_").map((word) => word[0].toUpperCase() + word.slice(1).toLocaleLowerCase()).join(" ");
@@ -4990,6 +4902,32 @@ const bagelFormUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defi
4990
4902
  slctField,
4991
4903
  txtField
4992
4904
  }, Symbol.toStringTag, { value: "Module" }));
4905
+ const state$1 = reactive({
4906
+ defaultLang: "",
4907
+ availableLangs: [],
4908
+ lang: "en"
4909
+ });
4910
+ function useLang() {
4911
+ const lang = computed({
4912
+ get: () => state$1.lang,
4913
+ set: (val) => state$1.lang = val
4914
+ });
4915
+ const $tdb = (langEl) => langEl[state$1.lang] || langEl[state$1.defaultLang] || "";
4916
+ const availableLangs = computed({
4917
+ get: () => state$1.availableLangs,
4918
+ set: (val) => state$1.availableLangs = val
4919
+ });
4920
+ const defaultLang = computed({
4921
+ get: () => state$1.defaultLang,
4922
+ set: (val) => state$1.defaultLang = val
4923
+ });
4924
+ return {
4925
+ lang,
4926
+ $tdb,
4927
+ availableLangs,
4928
+ defaultLang
4929
+ };
4930
+ }
4993
4931
  let timeout;
4994
4932
  const debounce$2 = (fn2, delay = 500) => {
4995
4933
  clearTimeout(timeout);
@@ -5041,6 +4979,101 @@ const iffer = (field, itemData) => {
5041
4979
  return true;
5042
4980
  };
5043
4981
  const denullify = (itemData, fieldID) => fieldID && itemData ? itemData[fieldID] : null;
4982
+ const bagelInjectionKey = Symbol("bagel");
4983
+ const i18nTInjectionKey = Symbol("bagel");
4984
+ function useBagel() {
4985
+ const bagel = inject(bagelInjectionKey);
4986
+ if (!bagel)
4987
+ throw new Error("No bagel provided");
4988
+ return bagel;
4989
+ }
4990
+ function useI18nT() {
4991
+ const i18nT = inject(i18nTInjectionKey);
4992
+ if (!i18nT)
4993
+ throw new Error("No i18nT provided");
4994
+ return i18nT;
4995
+ }
4996
+ const BagelVue = {
4997
+ install: (app, options) => {
4998
+ const bagel = new Bagel({ host: options.host, onError: options.onError });
4999
+ app.directive("click-outside", clickOutside);
5000
+ app.use(Gt$1, {
5001
+ themes: {
5002
+ "bgl-theme": {
5003
+ triggers: ["click"],
5004
+ autoHide: true,
5005
+ placement: "bottom"
5006
+ }
5007
+ }
5008
+ });
5009
+ const { availableLangs, defaultLang, lang } = useLang();
5010
+ if (options.availableLangs)
5011
+ availableLangs.value = options.availableLangs;
5012
+ if (options.defaultLang)
5013
+ defaultLang.value = options.defaultLang;
5014
+ if (options.language)
5015
+ lang.value = options.language;
5016
+ app.config.globalProperties.$bagel = bagel;
5017
+ app.provide(bagelInjectionKey, bagel);
5018
+ app.config.globalProperties.$i18T = (options == null ? void 0 : options.i18nT) || ((key) => key);
5019
+ app.provide(i18nTInjectionKey, (options == null ? void 0 : options.i18nT) || ((key) => key));
5020
+ }
5021
+ };
5022
+ const ModalSymbol = Symbol("modal");
5023
+ const useModal = () => {
5024
+ const modalApi = inject(ModalSymbol);
5025
+ if (!modalApi)
5026
+ throw new Error("Modal API not provided");
5027
+ return modalApi;
5028
+ };
5029
+ const ModalPlugin = {
5030
+ install: (app) => {
5031
+ const modalStack = ref([]);
5032
+ const hideModal = (index2) => {
5033
+ modalStack.value.splice(index2, 1);
5034
+ };
5035
+ const modalConfirm = (options) => new Promise((resolve) => {
5036
+ if (typeof options === "string")
5037
+ options = { title: options, message: "" };
5038
+ modalStack.value.push({
5039
+ modalOptions: { ...options, resolve },
5040
+ modalType: "confirm",
5041
+ componentSlots: {}
5042
+ });
5043
+ });
5044
+ const showModal = (modalType, options, slots = {}) => {
5045
+ modalStack.value.push({
5046
+ modalOptions: options,
5047
+ modalType,
5048
+ componentSlots: slots
5049
+ });
5050
+ if (modalType === "modalForm")
5051
+ return modalStack.value.at(-1);
5052
+ return modalStack.value.at(-1);
5053
+ };
5054
+ app.provide(ModalSymbol, {
5055
+ showModal: (options, slots) => showModal("modal", options, slots),
5056
+ showModalForm: (options, slots) => showModal("modalForm", options, slots),
5057
+ confirm: (userOptions) => modalConfirm(userOptions),
5058
+ hideModal: (index2 = modalStack.value.length - 1) => hideModal(index2)
5059
+ // modalOptions,
5060
+ });
5061
+ const ModalComponent = defineComponent({
5062
+ data: () => ({ modalStack: modalStack.value }),
5063
+ render() {
5064
+ return modalStack.value.map((modal, index2) => {
5065
+ const props2 = { ...modal.modalOptions, visible: true, "onUpdate:visible": () => hideModal(index2) };
5066
+ if (modal.modalType === "modalForm")
5067
+ return h$2(ModalForm, props2, modal.componentSlots);
5068
+ if (modal.modalType === "confirm")
5069
+ return h$2(_sfc_main$n, props2, {});
5070
+ return h$2(_sfc_main$F, props2, modal.componentSlots);
5071
+ });
5072
+ }
5073
+ });
5074
+ app.component("ModalContainer", ModalComponent);
5075
+ }
5076
+ };
5044
5077
  const _sfc_main$I = /* @__PURE__ */ defineComponent({
5045
5078
  __name: "MaterialIcon",
5046
5079
  props: {
@@ -5269,7 +5302,10 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5269
5302
  });
5270
5303
  const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-d09a83c5"]]);
5271
5304
  const _hoisted_1$C = { class: "tool-bar" };
5272
- const _hoisted_2$v = { class: "modal-footer mt-3" };
5305
+ const _hoisted_2$v = {
5306
+ key: 0,
5307
+ class: "modal-footer mt-3"
5308
+ };
5273
5309
  const _sfc_main$F = /* @__PURE__ */ defineComponent({
5274
5310
  __name: "Modal",
5275
5311
  props: {
@@ -5283,6 +5319,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
5283
5319
  emits: ["update:visible"],
5284
5320
  setup(__props, { expose: __expose, emit: __emit }) {
5285
5321
  const props2 = __props;
5322
+ const slots = useSlots();
5286
5323
  let isVisible = ref(false);
5287
5324
  watch(
5288
5325
  () => props2.visible,
@@ -5330,34 +5367,37 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
5330
5367
  }, ["stop"])),
5331
5368
  style: normalizeStyle({ ...maxWidth.value })
5332
5369
  }, {
5333
- default: withCtx(() => [
5334
- createElementVNode("header", _hoisted_1$C, [
5335
- renderSlot(_ctx.$slots, "toolbar"),
5336
- createVNode(unref(Btn), {
5337
- style: normalizeStyle({ float: _ctx.side ? "left" : "right" }),
5338
- flat: "",
5339
- icon: "close",
5340
- onClick: closeModal
5341
- }, null, 8, ["style"]),
5342
- _ctx.title ? (openBlock(), createBlock(unref(_sfc_main$t), {
5343
- key: 0,
5344
- class: "modal-title",
5345
- tag: "h3",
5346
- label: _ctx.title
5347
- }, null, 8, ["label"])) : createCommentVNode("", true)
5348
- ]),
5349
- renderSlot(_ctx.$slots, "default"),
5350
- createElementVNode("footer", _hoisted_2$v, [
5351
- (openBlock(true), createElementBlock(Fragment$1, null, renderList(_ctx.actions, (action, i2) => {
5352
- return openBlock(), createBlock(unref(Btn), mergeProps({
5353
- key: i2,
5354
- onClick: closeModal,
5355
- color: "gray"
5356
- }, action), null, 16);
5357
- }), 128)),
5358
- renderSlot(_ctx.$slots, "footer")
5359
- ])
5360
- ]),
5370
+ default: withCtx(() => {
5371
+ var _a2;
5372
+ return [
5373
+ createElementVNode("header", _hoisted_1$C, [
5374
+ renderSlot(_ctx.$slots, "toolbar"),
5375
+ createVNode(unref(Btn), {
5376
+ style: normalizeStyle({ float: _ctx.side ? "left" : "right" }),
5377
+ flat: "",
5378
+ icon: "close",
5379
+ onClick: closeModal
5380
+ }, null, 8, ["style"]),
5381
+ _ctx.title ? (openBlock(), createBlock(unref(_sfc_main$t), {
5382
+ key: 0,
5383
+ class: "modal-title",
5384
+ tag: "h3",
5385
+ label: _ctx.title
5386
+ }, null, 8, ["label"])) : createCommentVNode("", true)
5387
+ ]),
5388
+ renderSlot(_ctx.$slots, "default"),
5389
+ unref(slots)["footer"] || ((_a2 = _ctx.actions) == null ? void 0 : _a2.length) ? (openBlock(), createElementBlock("footer", _hoisted_2$v, [
5390
+ (openBlock(true), createElementBlock(Fragment$1, null, renderList(_ctx.actions, (action, i2) => {
5391
+ return openBlock(), createBlock(unref(Btn), mergeProps({
5392
+ key: i2,
5393
+ onClick: closeModal,
5394
+ color: "gray"
5395
+ }, action), null, 16);
5396
+ }), 128)),
5397
+ renderSlot(_ctx.$slots, "footer")
5398
+ ])) : createCommentVNode("", true)
5399
+ ];
5400
+ }),
5361
5401
  _: 3
5362
5402
  }, 8, ["style"])
5363
5403
  ], 34);
@@ -5494,11 +5534,15 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
5494
5534
  let open = ref(false);
5495
5535
  const accordionState = inject("accordionState");
5496
5536
  const id = props2.id || Math.random().toString(36).substring(7);
5497
- watch(() => accordionState == null ? void 0 : accordionState.openItem, (currentOpenId) => {
5498
- if (currentOpenId !== id) {
5499
- open.value = false;
5500
- }
5501
- }, { immediate: true });
5537
+ watch(
5538
+ () => accordionState == null ? void 0 : accordionState.openItem,
5539
+ (currentOpenId) => {
5540
+ if (currentOpenId !== id) {
5541
+ open.value = false;
5542
+ }
5543
+ },
5544
+ { immediate: true }
5545
+ );
5502
5546
  function toggle() {
5503
5547
  open.value = !open.value;
5504
5548
  if (open.value && (accordionState == null ? void 0 : accordionState.openItem))
@@ -5515,6 +5559,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
5515
5559
  "aria-controls": `accordion-body-${unref(id)}`
5516
5560
  }, [
5517
5561
  createElementVNode("span", _hoisted_3$k, toDisplayString(_ctx.label), 1),
5562
+ renderSlot(_ctx.$slots, "head", {}, void 0, true),
5518
5563
  createElementVNode("div", {
5519
5564
  class: normalizeClass(["accordion-icon", { open: unref(open) }])
5520
5565
  }, [
@@ -5538,7 +5583,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
5538
5583
  };
5539
5584
  }
5540
5585
  });
5541
- const AccordionItem = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-bf74738b"]]);
5586
+ const AccordionItem = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-0fb593ee"]]);
5542
5587
  const _sfc_main$C = {};
5543
5588
  const _hoisted_1$A = { class: "list-wrap bgl_card thin grid overflow-hidden h-100 p-0" };
5544
5589
  const _hoisted_2$t = { class: "p-1" };
@@ -5638,7 +5683,11 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5638
5683
  if (typeof props2.schema === "function") {
5639
5684
  return props2.schema();
5640
5685
  }
5641
- return props2.schema;
5686
+ if (props2.schema)
5687
+ return props2.schema;
5688
+ const keys4 = [...new Set((props2.data || []).map(Object.keys).flat())];
5689
+ const schema = keys4.map((id) => ({ id, label: keyToLabel(id) }));
5690
+ return schema;
5642
5691
  });
5643
5692
  const emit2 = __emit;
5644
5693
  const selectElement = (item) => emit2("select", item);
@@ -5747,7 +5796,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5747
5796
  };
5748
5797
  }
5749
5798
  });
5750
- const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-54d69b8f"]]);
5799
+ const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-1d169811"]]);
5751
5800
  const _sfc_main$y = {};
5752
5801
  const _hoisted_1$w = { class: "flex space-between" };
5753
5802
  function _sfc_render$1(_ctx, _cache) {
@@ -5886,7 +5935,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
5886
5935
  setup(__props) {
5887
5936
  return (_ctx, _cache) => {
5888
5937
  return openBlock(), createElementBlock("div", {
5889
- class: "avatar flex",
5938
+ class: "avatar flex justify-content-center",
5890
5939
  style: normalizeStyle({ width: `${_ctx.size}px`, height: `${_ctx.size}px` })
5891
5940
  }, [
5892
5941
  _ctx.src ? (openBlock(), createElementBlock("img", {
@@ -5901,7 +5950,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
5901
5950
  };
5902
5951
  }
5903
5952
  });
5904
- const Avatar = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-21ffa9bb"]]);
5953
+ const Avatar = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-371a733d"]]);
5905
5954
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
5906
5955
  __name: "Title",
5907
5956
  props: {
@@ -5951,7 +6000,8 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
5951
6000
  props: {
5952
6001
  message: {},
5953
6002
  dismissable: { type: Boolean },
5954
- type: { default: "info" }
6003
+ type: { default: "info" },
6004
+ icon: {}
5955
6005
  },
5956
6006
  setup(__props) {
5957
6007
  const isDismissed = ref(false);
@@ -5966,12 +6016,13 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
5966
6016
  class: normalizeClass(["alert", [_ctx.type]]),
5967
6017
  dismissable: _ctx.dismissable
5968
6018
  }, [
5969
- createVNode(unref(_sfc_main$I), {
6019
+ _ctx.icon !== "none" ? (openBlock(), createBlock(unref(_sfc_main$I), {
6020
+ key: 0,
5970
6021
  class: "alert_icon",
5971
- icon: _ctx.type,
6022
+ icon: _ctx.icon || _ctx.type,
5972
6023
  size: 2,
5973
6024
  color: color2[_ctx.type]
5974
- }, null, 8, ["icon", "color"]),
6025
+ }, null, 8, ["icon", "color"])) : createCommentVNode("", true),
5975
6026
  createElementVNode("p", _hoisted_2$o, toDisplayString(_ctx.message), 1),
5976
6027
  createVNode(Btn, {
5977
6028
  onClick: _cache[0] || (_cache[0] = ($event) => isDismissed.value = true),
@@ -5984,7 +6035,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
5984
6035
  };
5985
6036
  }
5986
6037
  });
5987
- const Alert = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-4017e821"]]);
6038
+ const Alert = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-0ec1391d"]]);
5988
6039
  const _sfc_main$q = /* @__PURE__ */ defineComponent({
5989
6040
  __name: "Badge",
5990
6041
  props: {
@@ -6256,17 +6307,23 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
6256
6307
  ], 34),
6257
6308
  createElementVNode("div", _hoisted_2$m, [
6258
6309
  createElementVNode("span", { onClick: prev }, [
6259
- renderSlot(_ctx.$slots, "prev", {}, void 0, true)
6310
+ renderSlot(_ctx.$slots, "prev", {
6311
+ prev,
6312
+ index: unref(activeSlideIndex)
6313
+ }, void 0, true)
6260
6314
  ]),
6261
6315
  createElementVNode("span", { onClick: next }, [
6262
- renderSlot(_ctx.$slots, "next", {}, void 0, true)
6316
+ renderSlot(_ctx.$slots, "next", {
6317
+ next,
6318
+ index: unref(activeSlideIndex)
6319
+ }, void 0, true)
6263
6320
  ])
6264
6321
  ])
6265
6322
  ], 6);
6266
6323
  };
6267
6324
  }
6268
6325
  });
6269
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-068aa914"]]);
6326
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-e1cc4e21"]]);
6270
6327
  const _sfc_main$n = /* @__PURE__ */ defineComponent({
6271
6328
  __name: "ModalConfirm",
6272
6329
  props: {
@@ -15494,7 +15551,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
15494
15551
  };
15495
15552
  }
15496
15553
  });
15497
- const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-6b40f812"]]);
15554
+ const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-9b751fe0"]]);
15498
15555
  /*!
15499
15556
  * vue-draggable-next v2.2.0
15500
15557
  * (c) 2023 Anish George
@@ -18196,7 +18253,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
18196
18253
  autoheight: { type: Boolean },
18197
18254
  code: { type: Boolean },
18198
18255
  lines: {},
18199
- autocomplete: { default: "off" },
18256
+ autocomplete: {},
18200
18257
  autofocus: { type: Boolean }
18201
18258
  },
18202
18259
  emits: ["update:modelValue", "debounce"],
@@ -18328,7 +18385,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
18328
18385
  };
18329
18386
  }
18330
18387
  });
18331
- const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-df718b64"]]);
18388
+ const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-534ec341"]]);
18332
18389
  const _hoisted_1$j = { class: "primary-checkbox" };
18333
18390
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
18334
18391
  __name: "Checkbox",
@@ -18419,7 +18476,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
18419
18476
  id: {},
18420
18477
  options: {},
18421
18478
  showTimeWrap: { type: Boolean },
18422
- modelValue: {}
18479
+ modelValue: {},
18480
+ allowedDates: {},
18481
+ disabledDates: {}
18423
18482
  },
18424
18483
  emits: ["update:modelValue"],
18425
18484
  setup(__props, { emit: __emit }) {
@@ -18446,6 +18505,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
18446
18505
  "week-start": "0",
18447
18506
  modelValue: selectedDate.value,
18448
18507
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedDate.value = $event),
18508
+ "allowed-dates": _ctx.allowedDates,
18509
+ "disabled-dates": _ctx.disabledDates,
18449
18510
  "auto-apply": true,
18450
18511
  "highlight-week-days": [6],
18451
18512
  "enable-time-picker": false,
@@ -18454,7 +18515,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
18454
18515
  "action-buttons": withCtx(() => []),
18455
18516
  "action-preview": withCtx(() => []),
18456
18517
  _: 1
18457
- }, 16, ["modelValue"])
18518
+ }, 16, ["modelValue", "allowed-dates", "disabled-dates"])
18458
18519
  ]),
18459
18520
  _ctx.showTimeWrap ? (openBlock(), createElementBlock("div", _hoisted_3$b, [
18460
18521
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(hours), (hr2) => {
@@ -18488,7 +18549,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
18488
18549
  props: {
18489
18550
  options: {},
18490
18551
  modelValue: { default: "" },
18491
- id: { default: () => `radio-pill-${Math.random().toString(36).substr(2, 9)}` },
18552
+ id: { default: () => `radio-pill-${Math.random().toString(36).substring(2, 9)}` },
18492
18553
  label: { default: "" }
18493
18554
  },
18494
18555
  emits: ["update:modelValue"],
@@ -18556,7 +18617,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
18556
18617
  };
18557
18618
  }
18558
18619
  });
18559
- const RadioPillsInput = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-41859ed6"]]);
18620
+ const RadioPillsInput = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-ad2e40f3"]]);
18560
18621
  const _hoisted_1$f = { class: "bagel-input" };
18561
18622
  const _hoisted_2$c = {
18562
18623
  key: 0,
@@ -18572,7 +18633,7 @@ const _hoisted_7$1 = {
18572
18633
  };
18573
18634
  const _hoisted_8 = ["src"];
18574
18635
  const _hoisted_9 = { class: "previewName" };
18575
- const _hoisted_10 = ["src"];
18636
+ const _hoisted_10 = ["width", "src"];
18576
18637
  const _hoisted_11 = { class: "no-margin" };
18577
18638
  const _hoisted_12 = {
18578
18639
  key: 0,
@@ -18585,7 +18646,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18585
18646
  multiple: { type: Boolean },
18586
18647
  files: {},
18587
18648
  deleteEndpoint: {},
18588
- bindkey: {}
18649
+ bindkey: {},
18650
+ width: {}
18589
18651
  }, {
18590
18652
  "modelValue": {},
18591
18653
  "modelModifiers": {}
@@ -18598,11 +18660,31 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18598
18660
  const file_bindkeys = useModel(__props, "modelValue");
18599
18661
  const storageFiles = ref([]);
18600
18662
  const compareIds = (v1, v2) => [v1].flat().join(",") === [v2].flat().join(",");
18663
+ onMounted(() => {
18664
+ if (!props2.files && [file_bindkeys.value].flat().length) {
18665
+ const ids = [file_bindkeys.value].flat();
18666
+ if (props2.multiple) {
18667
+ ids.forEach((id) => {
18668
+ void bagel.get(`/files/${id}`).then((file) => {
18669
+ storageFiles.value.push(file);
18670
+ });
18671
+ });
18672
+ } else {
18673
+ void bagel.get(`/files/${ids[0]}`).then((file) => {
18674
+ storageFiles.value.push(file);
18675
+ });
18676
+ }
18677
+ }
18678
+ });
18601
18679
  watch(
18602
18680
  () => props2.files,
18603
18681
  (newFiles) => {
18604
- if (newFiles)
18605
- storageFiles.value.push(...[newFiles].flat());
18682
+ if (newFiles) {
18683
+ const filesToAdd = [newFiles].flat().filter((f2) => !storageFiles.value.find((sf) => sf[bindKey2] === f2[bindKey2]));
18684
+ for (const file of filesToAdd) {
18685
+ storageFiles.value.push(file);
18686
+ }
18687
+ }
18606
18688
  },
18607
18689
  { immediate: true }
18608
18690
  );
@@ -18713,7 +18795,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18713
18795
  createElementVNode("div", _hoisted_4$5, [
18714
18796
  _ctx.multiple ? (openBlock(), createElementBlock("img", {
18715
18797
  key: 0,
18716
- height: "60",
18717
18798
  class: "preview",
18718
18799
  src: file.url,
18719
18800
  alt: ""
@@ -18743,7 +18824,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18743
18824
  createElementVNode("div", _hoisted_9, [
18744
18825
  _ctx.multiple ? (openBlock(), createElementBlock("img", {
18745
18826
  key: 0,
18746
- height: "60",
18827
+ width: _ctx.width || "220",
18747
18828
  class: "preview",
18748
18829
  src: fileToUrl(fileQ.file),
18749
18830
  alt: ""
@@ -18767,7 +18848,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18767
18848
  };
18768
18849
  }
18769
18850
  });
18770
- const $el = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-0dbacaa0"]]);
18851
+ const $el = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-4f0a6b20"]]);
18771
18852
  const _withScopeId$1 = (n2) => (pushScopeId("data-v-b87221d6"), n2 = n2(), popScopeId(), n2);
18772
18853
  const _hoisted_1$e = ["title"];
18773
18854
  const _hoisted_2$b = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("span", { class: "slider round" }, null, -1));
@@ -50999,12 +51080,18 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
50999
51080
  tabs: {},
51000
51081
  modelValue: {}
51001
51082
  },
51002
- setup(__props) {
51083
+ emits: ["update:modelValue"],
51084
+ setup(__props, { emit: __emit }) {
51003
51085
  const props2 = __props;
51004
51086
  const slots = useSlots();
51005
51087
  const group = Math.random().toString(36).substring(7);
51006
51088
  const { currentTab } = useTabs(group);
51007
51089
  const tabValue = (tab) => typeof tab === "string" ? tab : tab.id;
51090
+ const emit2 = __emit;
51091
+ const slctTab = computed({
51092
+ get: () => props2.modelValue || tabValue(props2.tabs[0]),
51093
+ set: (value) => emit2("update:modelValue", value)
51094
+ });
51008
51095
  const tabComponent = defineComponent({
51009
51096
  render() {
51010
51097
  var _a2, _b, _c;
@@ -51012,16 +51099,18 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
51012
51099
  (tab) => tabValue(tab) === currentTab.value
51013
51100
  );
51014
51101
  const slotChildren = (_c = (_b = (_a2 = slots == null ? void 0 : slots.default) == null ? void 0 : _a2.call(slots)) == null ? void 0 : _b[1]) == null ? void 0 : _c.children;
51015
- return h$2("div", slotChildren == null ? void 0 : slotChildren[currentTabIndex]);
51102
+ return h$2("div", slotChildren[currentTabIndex]);
51016
51103
  }
51017
51104
  });
51018
51105
  return (_ctx, _cache) => {
51019
51106
  return openBlock(), createElementBlock(Fragment$1, null, [
51020
51107
  createVNode(unref(TabsNav), {
51108
+ modelValue: slctTab.value,
51109
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => slctTab.value = $event),
51021
51110
  tabs: _ctx.tabs,
51022
51111
  group: unref(group),
51023
51112
  class: "mb-05"
51024
- }, null, 8, ["tabs", "group"]),
51113
+ }, null, 8, ["modelValue", "tabs", "group"]),
51025
51114
  unref(currentTab) ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
51026
51115
  unref(slots)[unref(currentTab)] ? renderSlot(_ctx.$slots, unref(currentTab), { key: 0 }) : unref(currentTab) ? (openBlock(), createBlock(resolveDynamicComponent(unref(tabComponent)), { key: 1 })) : createCommentVNode("", true)
51027
51116
  ])) : createCommentVNode("", true)
@@ -51029,7 +51118,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
51029
51118
  };
51030
51119
  }
51031
51120
  });
51032
- const _hoisted_1$2 = { class: "grid auto-flow-columns fit-content" };
51121
+ const _hoisted_1$2 = { class: "grid auto-flow-columns fit-content bgl_tabs_wrap" };
51033
51122
  const _hoisted_2$1 = ["onClick"];
51034
51123
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
51035
51124
  __name: "TabsNav",
@@ -51040,12 +51129,15 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
51040
51129
  sideTabs: { type: Boolean },
51041
51130
  group: {}
51042
51131
  },
51043
- setup(__props) {
51132
+ emits: ["update:modelValue"],
51133
+ setup(__props, { emit: __emit }) {
51044
51134
  const props2 = __props;
51045
51135
  const { currentTab } = useTabs(props2.group);
51046
51136
  currentTab.value = props2.modelValue || typeof props2.tabs[0] === "string" ? props2.tabs[0] : props2.tabs[0].id;
51137
+ const emit2 = __emit;
51047
51138
  const selectTab = (tab) => {
51048
51139
  currentTab.value = typeof tab === "string" ? tab : tab.id;
51140
+ emit2("update:modelValue", currentTab.value);
51049
51141
  };
51050
51142
  const isActive2 = (tab) => {
51051
51143
  if (typeof tab === "string")
@@ -51057,6 +51149,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
51057
51149
  return tab;
51058
51150
  return tab.label;
51059
51151
  };
51152
+ watch(
51153
+ () => props2.modelValue,
51154
+ (value) => {
51155
+ if (value && !isActive2(value))
51156
+ currentTab.value = value;
51157
+ },
51158
+ { immediate: true }
51159
+ );
51060
51160
  return (_ctx, _cache) => {
51061
51161
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
51062
51162
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(_ctx.tabs, (tab, i2) => {
@@ -51077,7 +51177,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
51077
51177
  };
51078
51178
  }
51079
51179
  });
51080
- const TabsNav = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-0774360e"]]);
51180
+ const TabsNav = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-05be4d6e"]]);
51081
51181
  const _hoisted_1$1 = { key: 0 };
51082
51182
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
51083
51183
  __name: "TabsBody",
@@ -51226,5 +51326,6 @@ export {
51226
51326
  useBagel,
51227
51327
  useEscape,
51228
51328
  useI18nT,
51329
+ useLang,
51229
51330
  useModal
51230
51331
  };