@bagelink/vue 0.0.427 → 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 (37) hide show
  1. package/dist/components/Alert.vue.d.ts +4 -1
  2. package/dist/components/Alert.vue.d.ts.map +1 -1
  3. package/dist/components/TableSchema.vue.d.ts +2 -5
  4. package/dist/components/TableSchema.vue.d.ts.map +1 -1
  5. package/dist/components/form/inputs/DatePicker.vue.d.ts +4 -0
  6. package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
  7. package/dist/components/form/inputs/FileUpload.vue.d.ts +6 -2
  8. package/dist/components/form/inputs/FileUpload.vue.d.ts.map +1 -1
  9. package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -1
  10. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
  11. package/dist/components/form/inputs/TextInput.vue.d.ts +0 -3
  12. package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
  13. package/dist/components/layout/Tabs.vue.d.ts +6 -2
  14. package/dist/components/layout/Tabs.vue.d.ts.map +1 -1
  15. package/dist/components/layout/TabsNav.vue.d.ts.map +1 -1
  16. package/dist/index.cjs +193 -113
  17. package/dist/index.mjs +194 -114
  18. package/dist/plugins/bagel.d.ts +3 -0
  19. package/dist/plugins/bagel.d.ts.map +1 -1
  20. package/dist/style.css +145 -127
  21. package/dist/utils/index.d.ts +1 -0
  22. package/dist/utils/index.d.ts.map +1 -1
  23. package/dist/utils/lang.d.ts +7 -0
  24. package/dist/utils/lang.d.ts.map +1 -0
  25. package/package.json +1 -1
  26. package/src/components/Alert.vue +4 -2
  27. package/src/components/TableSchema.vue +19 -9
  28. package/src/components/form/inputs/DatePicker.vue +8 -2
  29. package/src/components/form/inputs/FileUpload.vue +54 -23
  30. package/src/components/form/inputs/RadioPillsInput.vue +5 -4
  31. package/src/components/form/inputs/SelectInput.vue +212 -204
  32. package/src/components/form/inputs/TextInput.vue +1 -1
  33. package/src/components/layout/Tabs.vue +14 -5
  34. package/src/components/layout/TabsNav.vue +34 -14
  35. package/src/plugins/bagel.ts +13 -4
  36. package/src/utils/index.ts +2 -0
  37. 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: {
@@ -5650,7 +5683,11 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5650
5683
  if (typeof props2.schema === "function") {
5651
5684
  return props2.schema();
5652
5685
  }
5653
- 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;
5654
5691
  });
5655
5692
  const emit2 = __emit;
5656
5693
  const selectElement = (item) => emit2("select", item);
@@ -5759,7 +5796,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5759
5796
  };
5760
5797
  }
5761
5798
  });
5762
- 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"]]);
5763
5800
  const _sfc_main$y = {};
5764
5801
  const _hoisted_1$w = { class: "flex space-between" };
5765
5802
  function _sfc_render$1(_ctx, _cache) {
@@ -5963,7 +6000,8 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
5963
6000
  props: {
5964
6001
  message: {},
5965
6002
  dismissable: { type: Boolean },
5966
- type: { default: "info" }
6003
+ type: { default: "info" },
6004
+ icon: {}
5967
6005
  },
5968
6006
  setup(__props) {
5969
6007
  const isDismissed = ref(false);
@@ -5978,12 +6016,13 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
5978
6016
  class: normalizeClass(["alert", [_ctx.type]]),
5979
6017
  dismissable: _ctx.dismissable
5980
6018
  }, [
5981
- createVNode(unref(_sfc_main$I), {
6019
+ _ctx.icon !== "none" ? (openBlock(), createBlock(unref(_sfc_main$I), {
6020
+ key: 0,
5982
6021
  class: "alert_icon",
5983
- icon: _ctx.type,
6022
+ icon: _ctx.icon || _ctx.type,
5984
6023
  size: 2,
5985
6024
  color: color2[_ctx.type]
5986
- }, null, 8, ["icon", "color"]),
6025
+ }, null, 8, ["icon", "color"])) : createCommentVNode("", true),
5987
6026
  createElementVNode("p", _hoisted_2$o, toDisplayString(_ctx.message), 1),
5988
6027
  createVNode(Btn, {
5989
6028
  onClick: _cache[0] || (_cache[0] = ($event) => isDismissed.value = true),
@@ -5996,7 +6035,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
5996
6035
  };
5997
6036
  }
5998
6037
  });
5999
- 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"]]);
6000
6039
  const _sfc_main$q = /* @__PURE__ */ defineComponent({
6001
6040
  __name: "Badge",
6002
6041
  props: {
@@ -15512,7 +15551,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
15512
15551
  };
15513
15552
  }
15514
15553
  });
15515
- 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"]]);
15516
15555
  /*!
15517
15556
  * vue-draggable-next v2.2.0
15518
15557
  * (c) 2023 Anish George
@@ -18214,7 +18253,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
18214
18253
  autoheight: { type: Boolean },
18215
18254
  code: { type: Boolean },
18216
18255
  lines: {},
18217
- autocomplete: { default: "off" },
18256
+ autocomplete: {},
18218
18257
  autofocus: { type: Boolean }
18219
18258
  },
18220
18259
  emits: ["update:modelValue", "debounce"],
@@ -18346,7 +18385,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
18346
18385
  };
18347
18386
  }
18348
18387
  });
18349
- 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"]]);
18350
18389
  const _hoisted_1$j = { class: "primary-checkbox" };
18351
18390
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
18352
18391
  __name: "Checkbox",
@@ -18437,7 +18476,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
18437
18476
  id: {},
18438
18477
  options: {},
18439
18478
  showTimeWrap: { type: Boolean },
18440
- modelValue: {}
18479
+ modelValue: {},
18480
+ allowedDates: {},
18481
+ disabledDates: {}
18441
18482
  },
18442
18483
  emits: ["update:modelValue"],
18443
18484
  setup(__props, { emit: __emit }) {
@@ -18464,6 +18505,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
18464
18505
  "week-start": "0",
18465
18506
  modelValue: selectedDate.value,
18466
18507
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedDate.value = $event),
18508
+ "allowed-dates": _ctx.allowedDates,
18509
+ "disabled-dates": _ctx.disabledDates,
18467
18510
  "auto-apply": true,
18468
18511
  "highlight-week-days": [6],
18469
18512
  "enable-time-picker": false,
@@ -18472,7 +18515,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
18472
18515
  "action-buttons": withCtx(() => []),
18473
18516
  "action-preview": withCtx(() => []),
18474
18517
  _: 1
18475
- }, 16, ["modelValue"])
18518
+ }, 16, ["modelValue", "allowed-dates", "disabled-dates"])
18476
18519
  ]),
18477
18520
  _ctx.showTimeWrap ? (openBlock(), createElementBlock("div", _hoisted_3$b, [
18478
18521
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(hours), (hr2) => {
@@ -18506,7 +18549,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
18506
18549
  props: {
18507
18550
  options: {},
18508
18551
  modelValue: { default: "" },
18509
- id: { default: () => `radio-pill-${Math.random().toString(36).substr(2, 9)}` },
18552
+ id: { default: () => `radio-pill-${Math.random().toString(36).substring(2, 9)}` },
18510
18553
  label: { default: "" }
18511
18554
  },
18512
18555
  emits: ["update:modelValue"],
@@ -18574,7 +18617,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
18574
18617
  };
18575
18618
  }
18576
18619
  });
18577
- 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"]]);
18578
18621
  const _hoisted_1$f = { class: "bagel-input" };
18579
18622
  const _hoisted_2$c = {
18580
18623
  key: 0,
@@ -18590,7 +18633,7 @@ const _hoisted_7$1 = {
18590
18633
  };
18591
18634
  const _hoisted_8 = ["src"];
18592
18635
  const _hoisted_9 = { class: "previewName" };
18593
- const _hoisted_10 = ["src"];
18636
+ const _hoisted_10 = ["width", "src"];
18594
18637
  const _hoisted_11 = { class: "no-margin" };
18595
18638
  const _hoisted_12 = {
18596
18639
  key: 0,
@@ -18603,7 +18646,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18603
18646
  multiple: { type: Boolean },
18604
18647
  files: {},
18605
18648
  deleteEndpoint: {},
18606
- bindkey: {}
18649
+ bindkey: {},
18650
+ width: {}
18607
18651
  }, {
18608
18652
  "modelValue": {},
18609
18653
  "modelModifiers": {}
@@ -18616,11 +18660,31 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18616
18660
  const file_bindkeys = useModel(__props, "modelValue");
18617
18661
  const storageFiles = ref([]);
18618
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
+ });
18619
18679
  watch(
18620
18680
  () => props2.files,
18621
18681
  (newFiles) => {
18622
- if (newFiles)
18623
- 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
+ }
18624
18688
  },
18625
18689
  { immediate: true }
18626
18690
  );
@@ -18731,7 +18795,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18731
18795
  createElementVNode("div", _hoisted_4$5, [
18732
18796
  _ctx.multiple ? (openBlock(), createElementBlock("img", {
18733
18797
  key: 0,
18734
- height: "60",
18735
18798
  class: "preview",
18736
18799
  src: file.url,
18737
18800
  alt: ""
@@ -18761,7 +18824,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18761
18824
  createElementVNode("div", _hoisted_9, [
18762
18825
  _ctx.multiple ? (openBlock(), createElementBlock("img", {
18763
18826
  key: 0,
18764
- height: "60",
18827
+ width: _ctx.width || "220",
18765
18828
  class: "preview",
18766
18829
  src: fileToUrl(fileQ.file),
18767
18830
  alt: ""
@@ -18785,7 +18848,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18785
18848
  };
18786
18849
  }
18787
18850
  });
18788
- 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"]]);
18789
18852
  const _withScopeId$1 = (n2) => (pushScopeId("data-v-b87221d6"), n2 = n2(), popScopeId(), n2);
18790
18853
  const _hoisted_1$e = ["title"];
18791
18854
  const _hoisted_2$b = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("span", { class: "slider round" }, null, -1));
@@ -51017,12 +51080,18 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
51017
51080
  tabs: {},
51018
51081
  modelValue: {}
51019
51082
  },
51020
- setup(__props) {
51083
+ emits: ["update:modelValue"],
51084
+ setup(__props, { emit: __emit }) {
51021
51085
  const props2 = __props;
51022
51086
  const slots = useSlots();
51023
51087
  const group = Math.random().toString(36).substring(7);
51024
51088
  const { currentTab } = useTabs(group);
51025
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
+ });
51026
51095
  const tabComponent = defineComponent({
51027
51096
  render() {
51028
51097
  var _a2, _b, _c;
@@ -51030,16 +51099,18 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
51030
51099
  (tab) => tabValue(tab) === currentTab.value
51031
51100
  );
51032
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;
51033
- return h$2("div", slotChildren == null ? void 0 : slotChildren[currentTabIndex]);
51102
+ return h$2("div", slotChildren[currentTabIndex]);
51034
51103
  }
51035
51104
  });
51036
51105
  return (_ctx, _cache) => {
51037
51106
  return openBlock(), createElementBlock(Fragment$1, null, [
51038
51107
  createVNode(unref(TabsNav), {
51108
+ modelValue: slctTab.value,
51109
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => slctTab.value = $event),
51039
51110
  tabs: _ctx.tabs,
51040
51111
  group: unref(group),
51041
51112
  class: "mb-05"
51042
- }, null, 8, ["tabs", "group"]),
51113
+ }, null, 8, ["modelValue", "tabs", "group"]),
51043
51114
  unref(currentTab) ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
51044
51115
  unref(slots)[unref(currentTab)] ? renderSlot(_ctx.$slots, unref(currentTab), { key: 0 }) : unref(currentTab) ? (openBlock(), createBlock(resolveDynamicComponent(unref(tabComponent)), { key: 1 })) : createCommentVNode("", true)
51045
51116
  ])) : createCommentVNode("", true)
@@ -51078,6 +51149,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
51078
51149
  return tab;
51079
51150
  return tab.label;
51080
51151
  };
51152
+ watch(
51153
+ () => props2.modelValue,
51154
+ (value) => {
51155
+ if (value && !isActive2(value))
51156
+ currentTab.value = value;
51157
+ },
51158
+ { immediate: true }
51159
+ );
51081
51160
  return (_ctx, _cache) => {
51082
51161
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
51083
51162
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(_ctx.tabs, (tab, i2) => {
@@ -51098,7 +51177,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
51098
51177
  };
51099
51178
  }
51100
51179
  });
51101
- const TabsNav = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-ca10eb5f"]]);
51180
+ const TabsNav = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-05be4d6e"]]);
51102
51181
  const _hoisted_1$1 = { key: 0 };
51103
51182
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
51104
51183
  __name: "TabsBody",
@@ -51247,5 +51326,6 @@ export {
51247
51326
  useBagel,
51248
51327
  useEscape,
51249
51328
  useI18nT,
51329
+ useLang,
51250
51330
  useModal
51251
51331
  };
@@ -6,6 +6,9 @@ export declare const i18nTInjectionKey: InjectionKey<(key: string) => string>;
6
6
  export declare function useBagel(): Bagel;
7
7
  export declare function useI18nT(): (key: string) => string;
8
8
  export interface BagelOptions {
9
+ availableLangs?: string[];
10
+ defaultLang?: string;
11
+ language?: string;
9
12
  host: string;
10
13
  onError?: (err: Error) => void;
11
14
  i18nT?: (key: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"bagel.d.ts","sourceRoot":"","sources":["../../src/plugins/bagel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,eAAO,MAAM,iBAAiB,qBAAyC,CAAC;AACxE,eAAO,MAAM,iBAAiB,qBAEvB,MAAM,KAAK,MAAM,CACvB,CAAC;AAEF,wBAAgB,QAAQ,UAKvB;AAED,wBAAgB,QAAQ,4BAKvB;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAA;IAEZ,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;IAE/B,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;CAC/B;AACD,eAAO,MAAM,QAAQ,EAAE,MAmBtB,CAAC"}
1
+ {"version":3,"file":"bagel.d.ts","sourceRoot":"","sources":["../../src/plugins/bagel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAItC,eAAO,MAAM,iBAAiB,qBAAyC,CAAC;AACxE,eAAO,MAAM,iBAAiB,qBAEvB,MAAM,KAAK,MAAM,CACvB,CAAC;AAEF,wBAAgB,QAAQ,UAKvB;AAED,wBAAgB,QAAQ,4BAKvB;AAED,MAAM,WAAW,YAAY;IAC5B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;IAE/B,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CAChC;AACD,eAAO,MAAM,QAAQ,EAAE,MAwBtB,CAAC"}