@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.
- package/dist/components/Alert.vue.d.ts +4 -1
- package/dist/components/Alert.vue.d.ts.map +1 -1
- package/dist/components/TableSchema.vue.d.ts +2 -5
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts +4 -0
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/FileUpload.vue.d.ts +6 -2
- package/dist/components/form/inputs/FileUpload.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TextInput.vue.d.ts +0 -3
- package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
- package/dist/components/layout/Tabs.vue.d.ts +6 -2
- package/dist/components/layout/Tabs.vue.d.ts.map +1 -1
- package/dist/components/layout/TabsNav.vue.d.ts.map +1 -1
- package/dist/index.cjs +193 -113
- package/dist/index.mjs +194 -114
- package/dist/plugins/bagel.d.ts +3 -0
- package/dist/plugins/bagel.d.ts.map +1 -1
- package/dist/style.css +145 -127
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/lang.d.ts +7 -0
- package/dist/utils/lang.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/Alert.vue +4 -2
- package/src/components/TableSchema.vue +19 -9
- package/src/components/form/inputs/DatePicker.vue +8 -2
- package/src/components/form/inputs/FileUpload.vue +54 -23
- package/src/components/form/inputs/RadioPillsInput.vue +5 -4
- package/src/components/form/inputs/SelectInput.vue +212 -204
- package/src/components/form/inputs/TextInput.vue +1 -1
- package/src/components/layout/Tabs.vue +14 -5
- package/src/components/layout/TabsNav.vue +34 -14
- package/src/plugins/bagel.ts +13 -4
- package/src/utils/index.ts +2 -0
- package/src/utils/lang.ts +39 -0
package/dist/index.cjs
CHANGED
|
@@ -4813,94 +4813,6 @@ const clickOutside = {
|
|
|
4813
4813
|
document.removeEventListener("click", el.clickOutsideEvent);
|
|
4814
4814
|
}
|
|
4815
4815
|
};
|
|
4816
|
-
const bagelInjectionKey = Symbol("bagel");
|
|
4817
|
-
const i18nTInjectionKey = Symbol("bagel");
|
|
4818
|
-
function useBagel() {
|
|
4819
|
-
const bagel = vue.inject(bagelInjectionKey);
|
|
4820
|
-
if (!bagel)
|
|
4821
|
-
throw new Error("No bagel provided");
|
|
4822
|
-
return bagel;
|
|
4823
|
-
}
|
|
4824
|
-
function useI18nT() {
|
|
4825
|
-
const i18nT = vue.inject(i18nTInjectionKey);
|
|
4826
|
-
if (!i18nT)
|
|
4827
|
-
throw new Error("No i18nT provided");
|
|
4828
|
-
return i18nT;
|
|
4829
|
-
}
|
|
4830
|
-
const BagelVue = {
|
|
4831
|
-
install: (app, options) => {
|
|
4832
|
-
const bagel = new Bagel({ host: options.host, onError: options.onError });
|
|
4833
|
-
app.directive("click-outside", clickOutside);
|
|
4834
|
-
app.use(Gt$1, {
|
|
4835
|
-
themes: {
|
|
4836
|
-
"bgl-theme": {
|
|
4837
|
-
triggers: ["click"],
|
|
4838
|
-
autoHide: true,
|
|
4839
|
-
placement: "bottom"
|
|
4840
|
-
}
|
|
4841
|
-
}
|
|
4842
|
-
});
|
|
4843
|
-
app.config.globalProperties.$bagel = bagel;
|
|
4844
|
-
app.provide(bagelInjectionKey, bagel);
|
|
4845
|
-
app.config.globalProperties.$i18T = (options == null ? void 0 : options.i18nT) || ((key) => key);
|
|
4846
|
-
app.provide(i18nTInjectionKey, (options == null ? void 0 : options.i18nT) || ((key) => key));
|
|
4847
|
-
}
|
|
4848
|
-
};
|
|
4849
|
-
const ModalSymbol = Symbol("modal");
|
|
4850
|
-
const useModal = () => {
|
|
4851
|
-
const modalApi = vue.inject(ModalSymbol);
|
|
4852
|
-
if (!modalApi)
|
|
4853
|
-
throw new Error("Modal API not provided");
|
|
4854
|
-
return modalApi;
|
|
4855
|
-
};
|
|
4856
|
-
const ModalPlugin = {
|
|
4857
|
-
install: (app) => {
|
|
4858
|
-
const modalStack = vue.ref([]);
|
|
4859
|
-
const hideModal = (index2) => {
|
|
4860
|
-
modalStack.value.splice(index2, 1);
|
|
4861
|
-
};
|
|
4862
|
-
const modalConfirm = (options) => new Promise((resolve) => {
|
|
4863
|
-
if (typeof options === "string")
|
|
4864
|
-
options = { title: options, message: "" };
|
|
4865
|
-
modalStack.value.push({
|
|
4866
|
-
modalOptions: { ...options, resolve },
|
|
4867
|
-
modalType: "confirm",
|
|
4868
|
-
componentSlots: {}
|
|
4869
|
-
});
|
|
4870
|
-
});
|
|
4871
|
-
const showModal = (modalType, options, slots = {}) => {
|
|
4872
|
-
modalStack.value.push({
|
|
4873
|
-
modalOptions: options,
|
|
4874
|
-
modalType,
|
|
4875
|
-
componentSlots: slots
|
|
4876
|
-
});
|
|
4877
|
-
if (modalType === "modalForm")
|
|
4878
|
-
return modalStack.value.at(-1);
|
|
4879
|
-
return modalStack.value.at(-1);
|
|
4880
|
-
};
|
|
4881
|
-
app.provide(ModalSymbol, {
|
|
4882
|
-
showModal: (options, slots) => showModal("modal", options, slots),
|
|
4883
|
-
showModalForm: (options, slots) => showModal("modalForm", options, slots),
|
|
4884
|
-
confirm: (userOptions) => modalConfirm(userOptions),
|
|
4885
|
-
hideModal: (index2 = modalStack.value.length - 1) => hideModal(index2)
|
|
4886
|
-
// modalOptions,
|
|
4887
|
-
});
|
|
4888
|
-
const ModalComponent = vue.defineComponent({
|
|
4889
|
-
data: () => ({ modalStack: modalStack.value }),
|
|
4890
|
-
render() {
|
|
4891
|
-
return modalStack.value.map((modal, index2) => {
|
|
4892
|
-
const props2 = { ...modal.modalOptions, visible: true, "onUpdate:visible": () => hideModal(index2) };
|
|
4893
|
-
if (modal.modalType === "modalForm")
|
|
4894
|
-
return vue.h(ModalForm, props2, modal.componentSlots);
|
|
4895
|
-
if (modal.modalType === "confirm")
|
|
4896
|
-
return vue.h(_sfc_main$n, props2, {});
|
|
4897
|
-
return vue.h(_sfc_main$F, props2, modal.componentSlots);
|
|
4898
|
-
});
|
|
4899
|
-
}
|
|
4900
|
-
});
|
|
4901
|
-
app.component("ModalContainer", ModalComponent);
|
|
4902
|
-
}
|
|
4903
|
-
};
|
|
4904
4816
|
function formatString(str, format2) {
|
|
4905
4817
|
if (format2 === "titleCase") {
|
|
4906
4818
|
return str.split("_").map((word) => word[0].toUpperCase() + word.slice(1).toLocaleLowerCase()).join(" ");
|
|
@@ -4992,6 +4904,32 @@ const bagelFormUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defi
|
|
|
4992
4904
|
slctField,
|
|
4993
4905
|
txtField
|
|
4994
4906
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4907
|
+
const state$1 = vue.reactive({
|
|
4908
|
+
defaultLang: "",
|
|
4909
|
+
availableLangs: [],
|
|
4910
|
+
lang: "en"
|
|
4911
|
+
});
|
|
4912
|
+
function useLang() {
|
|
4913
|
+
const lang = vue.computed({
|
|
4914
|
+
get: () => state$1.lang,
|
|
4915
|
+
set: (val) => state$1.lang = val
|
|
4916
|
+
});
|
|
4917
|
+
const $tdb = (langEl) => langEl[state$1.lang] || langEl[state$1.defaultLang] || "";
|
|
4918
|
+
const availableLangs = vue.computed({
|
|
4919
|
+
get: () => state$1.availableLangs,
|
|
4920
|
+
set: (val) => state$1.availableLangs = val
|
|
4921
|
+
});
|
|
4922
|
+
const defaultLang = vue.computed({
|
|
4923
|
+
get: () => state$1.defaultLang,
|
|
4924
|
+
set: (val) => state$1.defaultLang = val
|
|
4925
|
+
});
|
|
4926
|
+
return {
|
|
4927
|
+
lang,
|
|
4928
|
+
$tdb,
|
|
4929
|
+
availableLangs,
|
|
4930
|
+
defaultLang
|
|
4931
|
+
};
|
|
4932
|
+
}
|
|
4995
4933
|
let timeout;
|
|
4996
4934
|
const debounce$2 = (fn2, delay = 500) => {
|
|
4997
4935
|
clearTimeout(timeout);
|
|
@@ -5043,6 +4981,101 @@ const iffer = (field, itemData) => {
|
|
|
5043
4981
|
return true;
|
|
5044
4982
|
};
|
|
5045
4983
|
const denullify = (itemData, fieldID) => fieldID && itemData ? itemData[fieldID] : null;
|
|
4984
|
+
const bagelInjectionKey = Symbol("bagel");
|
|
4985
|
+
const i18nTInjectionKey = Symbol("bagel");
|
|
4986
|
+
function useBagel() {
|
|
4987
|
+
const bagel = vue.inject(bagelInjectionKey);
|
|
4988
|
+
if (!bagel)
|
|
4989
|
+
throw new Error("No bagel provided");
|
|
4990
|
+
return bagel;
|
|
4991
|
+
}
|
|
4992
|
+
function useI18nT() {
|
|
4993
|
+
const i18nT = vue.inject(i18nTInjectionKey);
|
|
4994
|
+
if (!i18nT)
|
|
4995
|
+
throw new Error("No i18nT provided");
|
|
4996
|
+
return i18nT;
|
|
4997
|
+
}
|
|
4998
|
+
const BagelVue = {
|
|
4999
|
+
install: (app, options) => {
|
|
5000
|
+
const bagel = new Bagel({ host: options.host, onError: options.onError });
|
|
5001
|
+
app.directive("click-outside", clickOutside);
|
|
5002
|
+
app.use(Gt$1, {
|
|
5003
|
+
themes: {
|
|
5004
|
+
"bgl-theme": {
|
|
5005
|
+
triggers: ["click"],
|
|
5006
|
+
autoHide: true,
|
|
5007
|
+
placement: "bottom"
|
|
5008
|
+
}
|
|
5009
|
+
}
|
|
5010
|
+
});
|
|
5011
|
+
const { availableLangs, defaultLang, lang } = useLang();
|
|
5012
|
+
if (options.availableLangs)
|
|
5013
|
+
availableLangs.value = options.availableLangs;
|
|
5014
|
+
if (options.defaultLang)
|
|
5015
|
+
defaultLang.value = options.defaultLang;
|
|
5016
|
+
if (options.language)
|
|
5017
|
+
lang.value = options.language;
|
|
5018
|
+
app.config.globalProperties.$bagel = bagel;
|
|
5019
|
+
app.provide(bagelInjectionKey, bagel);
|
|
5020
|
+
app.config.globalProperties.$i18T = (options == null ? void 0 : options.i18nT) || ((key) => key);
|
|
5021
|
+
app.provide(i18nTInjectionKey, (options == null ? void 0 : options.i18nT) || ((key) => key));
|
|
5022
|
+
}
|
|
5023
|
+
};
|
|
5024
|
+
const ModalSymbol = Symbol("modal");
|
|
5025
|
+
const useModal = () => {
|
|
5026
|
+
const modalApi = vue.inject(ModalSymbol);
|
|
5027
|
+
if (!modalApi)
|
|
5028
|
+
throw new Error("Modal API not provided");
|
|
5029
|
+
return modalApi;
|
|
5030
|
+
};
|
|
5031
|
+
const ModalPlugin = {
|
|
5032
|
+
install: (app) => {
|
|
5033
|
+
const modalStack = vue.ref([]);
|
|
5034
|
+
const hideModal = (index2) => {
|
|
5035
|
+
modalStack.value.splice(index2, 1);
|
|
5036
|
+
};
|
|
5037
|
+
const modalConfirm = (options) => new Promise((resolve) => {
|
|
5038
|
+
if (typeof options === "string")
|
|
5039
|
+
options = { title: options, message: "" };
|
|
5040
|
+
modalStack.value.push({
|
|
5041
|
+
modalOptions: { ...options, resolve },
|
|
5042
|
+
modalType: "confirm",
|
|
5043
|
+
componentSlots: {}
|
|
5044
|
+
});
|
|
5045
|
+
});
|
|
5046
|
+
const showModal = (modalType, options, slots = {}) => {
|
|
5047
|
+
modalStack.value.push({
|
|
5048
|
+
modalOptions: options,
|
|
5049
|
+
modalType,
|
|
5050
|
+
componentSlots: slots
|
|
5051
|
+
});
|
|
5052
|
+
if (modalType === "modalForm")
|
|
5053
|
+
return modalStack.value.at(-1);
|
|
5054
|
+
return modalStack.value.at(-1);
|
|
5055
|
+
};
|
|
5056
|
+
app.provide(ModalSymbol, {
|
|
5057
|
+
showModal: (options, slots) => showModal("modal", options, slots),
|
|
5058
|
+
showModalForm: (options, slots) => showModal("modalForm", options, slots),
|
|
5059
|
+
confirm: (userOptions) => modalConfirm(userOptions),
|
|
5060
|
+
hideModal: (index2 = modalStack.value.length - 1) => hideModal(index2)
|
|
5061
|
+
// modalOptions,
|
|
5062
|
+
});
|
|
5063
|
+
const ModalComponent = vue.defineComponent({
|
|
5064
|
+
data: () => ({ modalStack: modalStack.value }),
|
|
5065
|
+
render() {
|
|
5066
|
+
return modalStack.value.map((modal, index2) => {
|
|
5067
|
+
const props2 = { ...modal.modalOptions, visible: true, "onUpdate:visible": () => hideModal(index2) };
|
|
5068
|
+
if (modal.modalType === "modalForm")
|
|
5069
|
+
return vue.h(ModalForm, props2, modal.componentSlots);
|
|
5070
|
+
if (modal.modalType === "confirm")
|
|
5071
|
+
return vue.h(_sfc_main$n, props2, {});
|
|
5072
|
+
return vue.h(_sfc_main$F, props2, modal.componentSlots);
|
|
5073
|
+
});
|
|
5074
|
+
}
|
|
5075
|
+
});
|
|
5076
|
+
app.component("ModalContainer", ModalComponent);
|
|
5077
|
+
}
|
|
5078
|
+
};
|
|
5046
5079
|
const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
5047
5080
|
__name: "MaterialIcon",
|
|
5048
5081
|
props: {
|
|
@@ -5652,7 +5685,11 @@ const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
|
5652
5685
|
if (typeof props2.schema === "function") {
|
|
5653
5686
|
return props2.schema();
|
|
5654
5687
|
}
|
|
5655
|
-
|
|
5688
|
+
if (props2.schema)
|
|
5689
|
+
return props2.schema;
|
|
5690
|
+
const keys4 = [...new Set((props2.data || []).map(Object.keys).flat())];
|
|
5691
|
+
const schema = keys4.map((id) => ({ id, label: keyToLabel(id) }));
|
|
5692
|
+
return schema;
|
|
5656
5693
|
});
|
|
5657
5694
|
const emit2 = __emit;
|
|
5658
5695
|
const selectElement = (item) => emit2("select", item);
|
|
@@ -5761,7 +5798,7 @@ const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
|
5761
5798
|
};
|
|
5762
5799
|
}
|
|
5763
5800
|
});
|
|
5764
|
-
const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-
|
|
5801
|
+
const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-1d169811"]]);
|
|
5765
5802
|
const _sfc_main$y = {};
|
|
5766
5803
|
const _hoisted_1$w = { class: "flex space-between" };
|
|
5767
5804
|
function _sfc_render$1(_ctx, _cache) {
|
|
@@ -5965,7 +6002,8 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
|
5965
6002
|
props: {
|
|
5966
6003
|
message: {},
|
|
5967
6004
|
dismissable: { type: Boolean },
|
|
5968
|
-
type: { default: "info" }
|
|
6005
|
+
type: { default: "info" },
|
|
6006
|
+
icon: {}
|
|
5969
6007
|
},
|
|
5970
6008
|
setup(__props) {
|
|
5971
6009
|
const isDismissed = vue.ref(false);
|
|
@@ -5980,12 +6018,13 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
|
5980
6018
|
class: vue.normalizeClass(["alert", [_ctx.type]]),
|
|
5981
6019
|
dismissable: _ctx.dismissable
|
|
5982
6020
|
}, [
|
|
5983
|
-
vue.
|
|
6021
|
+
_ctx.icon !== "none" ? (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$I), {
|
|
6022
|
+
key: 0,
|
|
5984
6023
|
class: "alert_icon",
|
|
5985
|
-
icon: _ctx.type,
|
|
6024
|
+
icon: _ctx.icon || _ctx.type,
|
|
5986
6025
|
size: 2,
|
|
5987
6026
|
color: color2[_ctx.type]
|
|
5988
|
-
}, null, 8, ["icon", "color"]),
|
|
6027
|
+
}, null, 8, ["icon", "color"])) : vue.createCommentVNode("", true),
|
|
5989
6028
|
vue.createElementVNode("p", _hoisted_2$o, vue.toDisplayString(_ctx.message), 1),
|
|
5990
6029
|
vue.createVNode(Btn, {
|
|
5991
6030
|
onClick: _cache[0] || (_cache[0] = ($event) => isDismissed.value = true),
|
|
@@ -5998,7 +6037,7 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
|
5998
6037
|
};
|
|
5999
6038
|
}
|
|
6000
6039
|
});
|
|
6001
|
-
const Alert = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-
|
|
6040
|
+
const Alert = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-0ec1391d"]]);
|
|
6002
6041
|
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
6003
6042
|
__name: "Badge",
|
|
6004
6043
|
props: {
|
|
@@ -15514,7 +15553,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
15514
15553
|
};
|
|
15515
15554
|
}
|
|
15516
15555
|
});
|
|
15517
|
-
const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-
|
|
15556
|
+
const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-9b751fe0"]]);
|
|
15518
15557
|
/*!
|
|
15519
15558
|
* vue-draggable-next v2.2.0
|
|
15520
15559
|
* (c) 2023 Anish George
|
|
@@ -18216,7 +18255,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
18216
18255
|
autoheight: { type: Boolean },
|
|
18217
18256
|
code: { type: Boolean },
|
|
18218
18257
|
lines: {},
|
|
18219
|
-
autocomplete: {
|
|
18258
|
+
autocomplete: {},
|
|
18220
18259
|
autofocus: { type: Boolean }
|
|
18221
18260
|
},
|
|
18222
18261
|
emits: ["update:modelValue", "debounce"],
|
|
@@ -18348,7 +18387,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
18348
18387
|
};
|
|
18349
18388
|
}
|
|
18350
18389
|
});
|
|
18351
|
-
const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-
|
|
18390
|
+
const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-534ec341"]]);
|
|
18352
18391
|
const _hoisted_1$j = { class: "primary-checkbox" };
|
|
18353
18392
|
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
18354
18393
|
__name: "Checkbox",
|
|
@@ -18439,7 +18478,9 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
18439
18478
|
id: {},
|
|
18440
18479
|
options: {},
|
|
18441
18480
|
showTimeWrap: { type: Boolean },
|
|
18442
|
-
modelValue: {}
|
|
18481
|
+
modelValue: {},
|
|
18482
|
+
allowedDates: {},
|
|
18483
|
+
disabledDates: {}
|
|
18443
18484
|
},
|
|
18444
18485
|
emits: ["update:modelValue"],
|
|
18445
18486
|
setup(__props, { emit: __emit }) {
|
|
@@ -18466,6 +18507,8 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
18466
18507
|
"week-start": "0",
|
|
18467
18508
|
modelValue: selectedDate.value,
|
|
18468
18509
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedDate.value = $event),
|
|
18510
|
+
"allowed-dates": _ctx.allowedDates,
|
|
18511
|
+
"disabled-dates": _ctx.disabledDates,
|
|
18469
18512
|
"auto-apply": true,
|
|
18470
18513
|
"highlight-week-days": [6],
|
|
18471
18514
|
"enable-time-picker": false,
|
|
@@ -18474,7 +18517,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
18474
18517
|
"action-buttons": vue.withCtx(() => []),
|
|
18475
18518
|
"action-preview": vue.withCtx(() => []),
|
|
18476
18519
|
_: 1
|
|
18477
|
-
}, 16, ["modelValue"])
|
|
18520
|
+
}, 16, ["modelValue", "allowed-dates", "disabled-dates"])
|
|
18478
18521
|
]),
|
|
18479
18522
|
_ctx.showTimeWrap ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$b, [
|
|
18480
18523
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(hours), (hr2) => {
|
|
@@ -18508,7 +18551,7 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
|
18508
18551
|
props: {
|
|
18509
18552
|
options: {},
|
|
18510
18553
|
modelValue: { default: "" },
|
|
18511
|
-
id: { default: () => `radio-pill-${Math.random().toString(36).
|
|
18554
|
+
id: { default: () => `radio-pill-${Math.random().toString(36).substring(2, 9)}` },
|
|
18512
18555
|
label: { default: "" }
|
|
18513
18556
|
},
|
|
18514
18557
|
emits: ["update:modelValue"],
|
|
@@ -18576,7 +18619,7 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
|
18576
18619
|
};
|
|
18577
18620
|
}
|
|
18578
18621
|
});
|
|
18579
|
-
const RadioPillsInput = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-
|
|
18622
|
+
const RadioPillsInput = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-ad2e40f3"]]);
|
|
18580
18623
|
const _hoisted_1$f = { class: "bagel-input" };
|
|
18581
18624
|
const _hoisted_2$c = {
|
|
18582
18625
|
key: 0,
|
|
@@ -18592,7 +18635,7 @@ const _hoisted_7$1 = {
|
|
|
18592
18635
|
};
|
|
18593
18636
|
const _hoisted_8 = ["src"];
|
|
18594
18637
|
const _hoisted_9 = { class: "previewName" };
|
|
18595
|
-
const _hoisted_10 = ["src"];
|
|
18638
|
+
const _hoisted_10 = ["width", "src"];
|
|
18596
18639
|
const _hoisted_11 = { class: "no-margin" };
|
|
18597
18640
|
const _hoisted_12 = {
|
|
18598
18641
|
key: 0,
|
|
@@ -18605,7 +18648,8 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
18605
18648
|
multiple: { type: Boolean },
|
|
18606
18649
|
files: {},
|
|
18607
18650
|
deleteEndpoint: {},
|
|
18608
|
-
bindkey: {}
|
|
18651
|
+
bindkey: {},
|
|
18652
|
+
width: {}
|
|
18609
18653
|
}, {
|
|
18610
18654
|
"modelValue": {},
|
|
18611
18655
|
"modelModifiers": {}
|
|
@@ -18618,11 +18662,31 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
18618
18662
|
const file_bindkeys = vue.useModel(__props, "modelValue");
|
|
18619
18663
|
const storageFiles = vue.ref([]);
|
|
18620
18664
|
const compareIds = (v1, v2) => [v1].flat().join(",") === [v2].flat().join(",");
|
|
18665
|
+
vue.onMounted(() => {
|
|
18666
|
+
if (!props2.files && [file_bindkeys.value].flat().length) {
|
|
18667
|
+
const ids = [file_bindkeys.value].flat();
|
|
18668
|
+
if (props2.multiple) {
|
|
18669
|
+
ids.forEach((id) => {
|
|
18670
|
+
void bagel.get(`/files/${id}`).then((file) => {
|
|
18671
|
+
storageFiles.value.push(file);
|
|
18672
|
+
});
|
|
18673
|
+
});
|
|
18674
|
+
} else {
|
|
18675
|
+
void bagel.get(`/files/${ids[0]}`).then((file) => {
|
|
18676
|
+
storageFiles.value.push(file);
|
|
18677
|
+
});
|
|
18678
|
+
}
|
|
18679
|
+
}
|
|
18680
|
+
});
|
|
18621
18681
|
vue.watch(
|
|
18622
18682
|
() => props2.files,
|
|
18623
18683
|
(newFiles) => {
|
|
18624
|
-
if (newFiles)
|
|
18625
|
-
storageFiles.value.
|
|
18684
|
+
if (newFiles) {
|
|
18685
|
+
const filesToAdd = [newFiles].flat().filter((f2) => !storageFiles.value.find((sf) => sf[bindKey2] === f2[bindKey2]));
|
|
18686
|
+
for (const file of filesToAdd) {
|
|
18687
|
+
storageFiles.value.push(file);
|
|
18688
|
+
}
|
|
18689
|
+
}
|
|
18626
18690
|
},
|
|
18627
18691
|
{ immediate: true }
|
|
18628
18692
|
);
|
|
@@ -18733,7 +18797,6 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
18733
18797
|
vue.createElementVNode("div", _hoisted_4$5, [
|
|
18734
18798
|
_ctx.multiple ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
18735
18799
|
key: 0,
|
|
18736
|
-
height: "60",
|
|
18737
18800
|
class: "preview",
|
|
18738
18801
|
src: file.url,
|
|
18739
18802
|
alt: ""
|
|
@@ -18763,7 +18826,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
18763
18826
|
vue.createElementVNode("div", _hoisted_9, [
|
|
18764
18827
|
_ctx.multiple ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
18765
18828
|
key: 0,
|
|
18766
|
-
|
|
18829
|
+
width: _ctx.width || "220",
|
|
18767
18830
|
class: "preview",
|
|
18768
18831
|
src: fileToUrl(fileQ.file),
|
|
18769
18832
|
alt: ""
|
|
@@ -18787,7 +18850,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
18787
18850
|
};
|
|
18788
18851
|
}
|
|
18789
18852
|
});
|
|
18790
|
-
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-
|
|
18853
|
+
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-4f0a6b20"]]);
|
|
18791
18854
|
const _withScopeId$1 = (n2) => (vue.pushScopeId("data-v-b87221d6"), n2 = n2(), vue.popScopeId(), n2);
|
|
18792
18855
|
const _hoisted_1$e = ["title"];
|
|
18793
18856
|
const _hoisted_2$b = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "slider round" }, null, -1));
|
|
@@ -51019,12 +51082,18 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
51019
51082
|
tabs: {},
|
|
51020
51083
|
modelValue: {}
|
|
51021
51084
|
},
|
|
51022
|
-
|
|
51085
|
+
emits: ["update:modelValue"],
|
|
51086
|
+
setup(__props, { emit: __emit }) {
|
|
51023
51087
|
const props2 = __props;
|
|
51024
51088
|
const slots = vue.useSlots();
|
|
51025
51089
|
const group = Math.random().toString(36).substring(7);
|
|
51026
51090
|
const { currentTab } = useTabs(group);
|
|
51027
51091
|
const tabValue = (tab) => typeof tab === "string" ? tab : tab.id;
|
|
51092
|
+
const emit2 = __emit;
|
|
51093
|
+
const slctTab = vue.computed({
|
|
51094
|
+
get: () => props2.modelValue || tabValue(props2.tabs[0]),
|
|
51095
|
+
set: (value) => emit2("update:modelValue", value)
|
|
51096
|
+
});
|
|
51028
51097
|
const tabComponent = vue.defineComponent({
|
|
51029
51098
|
render() {
|
|
51030
51099
|
var _a2, _b, _c;
|
|
@@ -51032,16 +51101,18 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
51032
51101
|
(tab) => tabValue(tab) === currentTab.value
|
|
51033
51102
|
);
|
|
51034
51103
|
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;
|
|
51035
|
-
return vue.h("div", slotChildren
|
|
51104
|
+
return vue.h("div", slotChildren[currentTabIndex]);
|
|
51036
51105
|
}
|
|
51037
51106
|
});
|
|
51038
51107
|
return (_ctx, _cache) => {
|
|
51039
51108
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
51040
51109
|
vue.createVNode(vue.unref(TabsNav), {
|
|
51110
|
+
modelValue: slctTab.value,
|
|
51111
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => slctTab.value = $event),
|
|
51041
51112
|
tabs: _ctx.tabs,
|
|
51042
51113
|
group: vue.unref(group),
|
|
51043
51114
|
class: "mb-05"
|
|
51044
|
-
}, null, 8, ["tabs", "group"]),
|
|
51115
|
+
}, null, 8, ["modelValue", "tabs", "group"]),
|
|
51045
51116
|
vue.unref(currentTab) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
|
|
51046
51117
|
vue.unref(slots)[vue.unref(currentTab)] ? vue.renderSlot(_ctx.$slots, vue.unref(currentTab), { key: 0 }) : vue.unref(currentTab) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabComponent)), { key: 1 })) : vue.createCommentVNode("", true)
|
|
51047
51118
|
])) : vue.createCommentVNode("", true)
|
|
@@ -51080,6 +51151,14 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
51080
51151
|
return tab;
|
|
51081
51152
|
return tab.label;
|
|
51082
51153
|
};
|
|
51154
|
+
vue.watch(
|
|
51155
|
+
() => props2.modelValue,
|
|
51156
|
+
(value) => {
|
|
51157
|
+
if (value && !isActive2(value))
|
|
51158
|
+
currentTab.value = value;
|
|
51159
|
+
},
|
|
51160
|
+
{ immediate: true }
|
|
51161
|
+
);
|
|
51083
51162
|
return (_ctx, _cache) => {
|
|
51084
51163
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
|
|
51085
51164
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.tabs, (tab, i2) => {
|
|
@@ -51100,7 +51179,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
51100
51179
|
};
|
|
51101
51180
|
}
|
|
51102
51181
|
});
|
|
51103
|
-
const TabsNav = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
51182
|
+
const TabsNav = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-05be4d6e"]]);
|
|
51104
51183
|
const _hoisted_1$1 = { key: 0 };
|
|
51105
51184
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
51106
51185
|
__name: "TabsBody",
|
|
@@ -51248,4 +51327,5 @@ exports.keyToLabel = keyToLabel;
|
|
|
51248
51327
|
exports.useBagel = useBagel;
|
|
51249
51328
|
exports.useEscape = useEscape;
|
|
51250
51329
|
exports.useI18nT = useI18nT;
|
|
51330
|
+
exports.useLang = useLang;
|
|
51251
51331
|
exports.useModal = useModal;
|