@bagelink/vue 0.0.728 → 0.0.734
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/form/inputs/FileUpload.vue.d.ts.map +1 -1
- package/dist/components/lightbox/index.d.ts.map +1 -1
- package/dist/components/lightbox/lightbox.types.d.ts +1 -0
- package/dist/components/lightbox/lightbox.types.d.ts.map +1 -1
- package/dist/index.cjs +63 -21
- package/dist/index.mjs +63 -21
- package/dist/style.css +45 -45
- package/package.json +1 -1
- package/src/components/form/inputs/FileUpload.vue +15 -1
- package/src/components/lightbox/Lightbox.vue +1 -1
- package/src/components/lightbox/index.ts +44 -21
- package/src/components/lightbox/lightbox.types.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/FileUpload.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileUpload.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/FileUpload.vue"],"names":[],"mappings":"AAmgBA,OAAO,EAAmC,KAAK,WAAW,EAAY,MAAM,eAAe,CAAA;AA8B3F,KAAK,MAAM,GAAG,MAAM,WAAW,CAAA;AAE/B,KAAK,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,CAAA;AAmHzC,iBAAS,MAAM,SAgBd;AA8BD,iBAAS,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;sBAzKZ,MAAM;wBACJ,OAAO;mBACZ,MAAM;uBACF,OAAO;;QA8cQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;sBAjdnB,MAAM;wBACJ,OAAO;mBACZ,MAAM;uBACF,OAAO;;;QA+ce,GAAG;EA2BpC;AACD,QAAA,MAAM,eAAe;YAjgBZ,MAAM;eACH,OAAO;YACV,WAAW,GAAG,WAAW,EAAE;cACzB,MAAM;iBACH,OAAO;YACZ,MAAM;aACL,MAAM,GAAG,MAAM;YAChB,MAAM;WACP,OAAO;WACP,OAAO;;;;;YATN,MAAM;eACH,OAAO;YACV,WAAW,GAAG,WAAW,EAAE;cACzB,MAAM;iBACH,OAAO;YACZ,MAAM;aACL,MAAM,GAAG,MAAM;YAChB,MAAM;WACP,OAAO;WACP,OAAO;;;;UA+fb,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAA+B,MAAM,KAAK,CAAA;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAA+B,MAAM,KAAK,CAAA;;iBA2E7C,GAAG;;AADjB,wBAIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/lightbox.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"lightbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/lightbox.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd"}
|
package/dist/index.cjs
CHANGED
|
@@ -5270,7 +5270,7 @@ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
|
|
|
5270
5270
|
}, "Open file", 8, _hoisted_5$g)
|
|
5271
5271
|
]))
|
|
5272
5272
|
]),
|
|
5273
|
-
vue.unref(group).length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$b, [
|
|
5273
|
+
vue.unref(group) && vue.unref(group).length > 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$b, [
|
|
5274
5274
|
vue.createVNode(vue.unref(Btn), {
|
|
5275
5275
|
class: "navigation-btn oval user-select-none",
|
|
5276
5276
|
icon: "arrow_back",
|
|
@@ -5316,30 +5316,55 @@ const _export_sfc = (sfc, props2) => {
|
|
|
5316
5316
|
}
|
|
5317
5317
|
return target;
|
|
5318
5318
|
};
|
|
5319
|
-
const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-
|
|
5319
|
+
const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-c3c26420"]]);
|
|
5320
5320
|
const groups = {};
|
|
5321
5321
|
const lightboxDirective = {
|
|
5322
5322
|
mounted(el, binding) {
|
|
5323
5323
|
el.classList.add("hover");
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
type3 = type3 || determineFileType(src);
|
|
5327
|
-
const item = { src, type: type3, name, thumbnail };
|
|
5328
|
-
if (group) {
|
|
5329
|
-
if (!groups[group]) groups[group] = [];
|
|
5330
|
-
groups[group].push(item);
|
|
5331
|
-
}
|
|
5324
|
+
const item = bindingToItem(binding, el);
|
|
5325
|
+
groupHandler(item);
|
|
5332
5326
|
el.addEventListener("click", (e) => {
|
|
5333
|
-
e
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5327
|
+
openClickHandler(e, el, binding);
|
|
5328
|
+
});
|
|
5329
|
+
},
|
|
5330
|
+
updated(el, binding) {
|
|
5331
|
+
const item = bindingToItem(binding, el);
|
|
5332
|
+
groupHandler(item);
|
|
5333
|
+
el.removeEventListener("click", (e) => {
|
|
5334
|
+
openClickHandler(e, el, binding);
|
|
5335
|
+
});
|
|
5336
|
+
el.addEventListener("click", (e) => {
|
|
5337
|
+
openClickHandler(e, el, binding);
|
|
5338
5338
|
});
|
|
5339
5339
|
},
|
|
5340
5340
|
unmounted(el, binding) {
|
|
5341
|
+
el.removeEventListener("click", (e) => {
|
|
5342
|
+
openClickHandler(e, el, binding);
|
|
5343
|
+
});
|
|
5341
5344
|
}
|
|
5342
5345
|
};
|
|
5346
|
+
function groupHandler(item) {
|
|
5347
|
+
if (item.group) {
|
|
5348
|
+
if (!groups[item.group]) groups[item.group] = [];
|
|
5349
|
+
const currentIndex = groups[item.group].findIndex((i2) => i2.src === item.src);
|
|
5350
|
+
if (currentIndex === -1) groups[item.group].push(item);
|
|
5351
|
+
}
|
|
5352
|
+
}
|
|
5353
|
+
function openClickHandler(e, el, binding) {
|
|
5354
|
+
e.stopPropagation();
|
|
5355
|
+
const item = bindingToItem(binding, el);
|
|
5356
|
+
const lightboxInstance2 = getLightboxInstance();
|
|
5357
|
+
if (!lightboxInstance2 || !lightboxInstance2.open) return;
|
|
5358
|
+
const open = lightboxInstance2.open;
|
|
5359
|
+
const group = item && item.group ? groups[item.group] : void 0;
|
|
5360
|
+
open(item, group);
|
|
5361
|
+
}
|
|
5362
|
+
function bindingToItem(binding, el) {
|
|
5363
|
+
let { group, src, type: type3, name, thumbnail } = binding.value || {};
|
|
5364
|
+
src = src || binding.value || el.getAttribute("src") || "";
|
|
5365
|
+
type3 = type3 || determineFileType(src);
|
|
5366
|
+
return { src, type: type3, name, thumbnail, group };
|
|
5367
|
+
}
|
|
5343
5368
|
const youtubeRegex = /youtube\.com|youtu\.be/;
|
|
5344
5369
|
const vimeoRegex = /vimeo\.com/;
|
|
5345
5370
|
function determineFileType(url) {
|
|
@@ -5350,11 +5375,15 @@ function determineFileType(url) {
|
|
|
5350
5375
|
if (["pdf"].includes(extension)) return "pdf";
|
|
5351
5376
|
return "unknown";
|
|
5352
5377
|
}
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5378
|
+
let lightboxInstance = null;
|
|
5379
|
+
function getLightboxInstance() {
|
|
5380
|
+
if (!lightboxInstance) {
|
|
5381
|
+
const lightboxEl = document.createElement("div");
|
|
5382
|
+
document.body.prepend(lightboxEl);
|
|
5383
|
+
const app = vue.createApp(Lightbox$1);
|
|
5384
|
+
lightboxInstance = app.mount(lightboxEl);
|
|
5385
|
+
}
|
|
5386
|
+
return lightboxInstance;
|
|
5358
5387
|
}
|
|
5359
5388
|
const Lightbox = {
|
|
5360
5389
|
install(app) {
|
|
@@ -19848,6 +19877,19 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
19848
19877
|
},
|
|
19849
19878
|
{ immediate: true }
|
|
19850
19879
|
);
|
|
19880
|
+
vue.watch(() => props2.modelValue, () => {
|
|
19881
|
+
const newModelValue = props2.modelValue || [];
|
|
19882
|
+
const currentValue = [file_bindkeys.value].flat();
|
|
19883
|
+
const newValue = [newModelValue].flat();
|
|
19884
|
+
const isSame = currentValue.every((id) => newValue.includes(id)) && newValue.every((id) => currentValue.includes(id)) && currentValue.length === newValue.length;
|
|
19885
|
+
if (!isSame) {
|
|
19886
|
+
file_bindkeys.value = newModelValue;
|
|
19887
|
+
for (const fle of storageFiles.value) {
|
|
19888
|
+
const index2 = [file_bindkeys.value].flat().findIndex((key) => fle[bindKey2] === key);
|
|
19889
|
+
if (index2 === -1) storageFiles.value.splice(index2, 1);
|
|
19890
|
+
}
|
|
19891
|
+
}
|
|
19892
|
+
});
|
|
19851
19893
|
function updateModelValue() {
|
|
19852
19894
|
let idValue;
|
|
19853
19895
|
if (props2.multiple) {
|
|
@@ -20068,7 +20110,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
20068
20110
|
};
|
|
20069
20111
|
}
|
|
20070
20112
|
});
|
|
20071
|
-
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-
|
|
20113
|
+
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-a0ae528d"]]);
|
|
20072
20114
|
const _withScopeId$1 = (n2) => (vue.pushScopeId("data-v-06b95183"), n2 = n2(), vue.popScopeId(), n2);
|
|
20073
20115
|
const _hoisted_1$j = ["title"];
|
|
20074
20116
|
const _hoisted_2$e = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "slider round" }, null, -1));
|
package/dist/index.mjs
CHANGED
|
@@ -5268,7 +5268,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
5268
5268
|
}, "Open file", 8, _hoisted_5$g)
|
|
5269
5269
|
]))
|
|
5270
5270
|
]),
|
|
5271
|
-
unref(group).length ? (openBlock(), createElementBlock("div", _hoisted_6$b, [
|
|
5271
|
+
unref(group) && unref(group).length > 1 ? (openBlock(), createElementBlock("div", _hoisted_6$b, [
|
|
5272
5272
|
createVNode(unref(Btn), {
|
|
5273
5273
|
class: "navigation-btn oval user-select-none",
|
|
5274
5274
|
icon: "arrow_back",
|
|
@@ -5314,30 +5314,55 @@ const _export_sfc = (sfc, props2) => {
|
|
|
5314
5314
|
}
|
|
5315
5315
|
return target;
|
|
5316
5316
|
};
|
|
5317
|
-
const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-
|
|
5317
|
+
const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-c3c26420"]]);
|
|
5318
5318
|
const groups = {};
|
|
5319
5319
|
const lightboxDirective = {
|
|
5320
5320
|
mounted(el, binding) {
|
|
5321
5321
|
el.classList.add("hover");
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
type3 = type3 || determineFileType(src);
|
|
5325
|
-
const item = { src, type: type3, name, thumbnail };
|
|
5326
|
-
if (group) {
|
|
5327
|
-
if (!groups[group]) groups[group] = [];
|
|
5328
|
-
groups[group].push(item);
|
|
5329
|
-
}
|
|
5322
|
+
const item = bindingToItem(binding, el);
|
|
5323
|
+
groupHandler(item);
|
|
5330
5324
|
el.addEventListener("click", (e) => {
|
|
5331
|
-
e
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5325
|
+
openClickHandler(e, el, binding);
|
|
5326
|
+
});
|
|
5327
|
+
},
|
|
5328
|
+
updated(el, binding) {
|
|
5329
|
+
const item = bindingToItem(binding, el);
|
|
5330
|
+
groupHandler(item);
|
|
5331
|
+
el.removeEventListener("click", (e) => {
|
|
5332
|
+
openClickHandler(e, el, binding);
|
|
5333
|
+
});
|
|
5334
|
+
el.addEventListener("click", (e) => {
|
|
5335
|
+
openClickHandler(e, el, binding);
|
|
5336
5336
|
});
|
|
5337
5337
|
},
|
|
5338
5338
|
unmounted(el, binding) {
|
|
5339
|
+
el.removeEventListener("click", (e) => {
|
|
5340
|
+
openClickHandler(e, el, binding);
|
|
5341
|
+
});
|
|
5339
5342
|
}
|
|
5340
5343
|
};
|
|
5344
|
+
function groupHandler(item) {
|
|
5345
|
+
if (item.group) {
|
|
5346
|
+
if (!groups[item.group]) groups[item.group] = [];
|
|
5347
|
+
const currentIndex = groups[item.group].findIndex((i2) => i2.src === item.src);
|
|
5348
|
+
if (currentIndex === -1) groups[item.group].push(item);
|
|
5349
|
+
}
|
|
5350
|
+
}
|
|
5351
|
+
function openClickHandler(e, el, binding) {
|
|
5352
|
+
e.stopPropagation();
|
|
5353
|
+
const item = bindingToItem(binding, el);
|
|
5354
|
+
const lightboxInstance2 = getLightboxInstance();
|
|
5355
|
+
if (!lightboxInstance2 || !lightboxInstance2.open) return;
|
|
5356
|
+
const open = lightboxInstance2.open;
|
|
5357
|
+
const group = item && item.group ? groups[item.group] : void 0;
|
|
5358
|
+
open(item, group);
|
|
5359
|
+
}
|
|
5360
|
+
function bindingToItem(binding, el) {
|
|
5361
|
+
let { group, src, type: type3, name, thumbnail } = binding.value || {};
|
|
5362
|
+
src = src || binding.value || el.getAttribute("src") || "";
|
|
5363
|
+
type3 = type3 || determineFileType(src);
|
|
5364
|
+
return { src, type: type3, name, thumbnail, group };
|
|
5365
|
+
}
|
|
5341
5366
|
const youtubeRegex = /youtube\.com|youtu\.be/;
|
|
5342
5367
|
const vimeoRegex = /vimeo\.com/;
|
|
5343
5368
|
function determineFileType(url) {
|
|
@@ -5348,11 +5373,15 @@ function determineFileType(url) {
|
|
|
5348
5373
|
if (["pdf"].includes(extension)) return "pdf";
|
|
5349
5374
|
return "unknown";
|
|
5350
5375
|
}
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5376
|
+
let lightboxInstance = null;
|
|
5377
|
+
function getLightboxInstance() {
|
|
5378
|
+
if (!lightboxInstance) {
|
|
5379
|
+
const lightboxEl = document.createElement("div");
|
|
5380
|
+
document.body.prepend(lightboxEl);
|
|
5381
|
+
const app = createApp(Lightbox$1);
|
|
5382
|
+
lightboxInstance = app.mount(lightboxEl);
|
|
5383
|
+
}
|
|
5384
|
+
return lightboxInstance;
|
|
5356
5385
|
}
|
|
5357
5386
|
const Lightbox = {
|
|
5358
5387
|
install(app) {
|
|
@@ -19846,6 +19875,19 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
19846
19875
|
},
|
|
19847
19876
|
{ immediate: true }
|
|
19848
19877
|
);
|
|
19878
|
+
watch(() => props2.modelValue, () => {
|
|
19879
|
+
const newModelValue = props2.modelValue || [];
|
|
19880
|
+
const currentValue = [file_bindkeys.value].flat();
|
|
19881
|
+
const newValue = [newModelValue].flat();
|
|
19882
|
+
const isSame = currentValue.every((id) => newValue.includes(id)) && newValue.every((id) => currentValue.includes(id)) && currentValue.length === newValue.length;
|
|
19883
|
+
if (!isSame) {
|
|
19884
|
+
file_bindkeys.value = newModelValue;
|
|
19885
|
+
for (const fle of storageFiles.value) {
|
|
19886
|
+
const index2 = [file_bindkeys.value].flat().findIndex((key) => fle[bindKey2] === key);
|
|
19887
|
+
if (index2 === -1) storageFiles.value.splice(index2, 1);
|
|
19888
|
+
}
|
|
19889
|
+
}
|
|
19890
|
+
});
|
|
19849
19891
|
function updateModelValue() {
|
|
19850
19892
|
let idValue;
|
|
19851
19893
|
if (props2.multiple) {
|
|
@@ -20066,7 +20108,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
20066
20108
|
};
|
|
20067
20109
|
}
|
|
20068
20110
|
});
|
|
20069
|
-
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-
|
|
20111
|
+
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-a0ae528d"]]);
|
|
20070
20112
|
const _withScopeId$1 = (n2) => (pushScopeId("data-v-06b95183"), n2 = n2(), popScopeId(), n2);
|
|
20071
20113
|
const _hoisted_1$j = ["title"];
|
|
20072
20114
|
const _hoisted_2$e = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("span", { class: "slider round" }, null, -1));
|
package/dist/style.css
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200");@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@100;200;300;400;500;600;700;800;900&display=swap");
|
|
2
|
-
.bgl-lightbox-overlay[data-v-
|
|
2
|
+
.bgl-lightbox-overlay[data-v-c3c26420] {
|
|
3
3
|
background: rgba(0, 0, 0, 0.8);
|
|
4
4
|
}
|
|
5
|
-
.bgl-lightbox[data-v-
|
|
5
|
+
.bgl-lightbox[data-v-c3c26420] {
|
|
6
6
|
max-height: 90%;
|
|
7
7
|
}
|
|
8
|
-
.bgl-lightbox-item[data-v-
|
|
9
|
-
animation: 500ms ease bgl-lightbox-load-
|
|
8
|
+
.bgl-lightbox-item[data-v-c3c26420]{
|
|
9
|
+
animation: 500ms ease bgl-lightbox-load-c3c26420;
|
|
10
10
|
}
|
|
11
|
-
@keyframes bgl-lightbox-load-
|
|
11
|
+
@keyframes bgl-lightbox-load-c3c26420 {
|
|
12
12
|
from {
|
|
13
13
|
scale:0.7;
|
|
14
14
|
}
|
|
@@ -16,32 +16,32 @@ to {
|
|
|
16
16
|
scale:1;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
.bgl-lightbox-item[data-v-
|
|
19
|
+
.bgl-lightbox-item[data-v-c3c26420] * {
|
|
20
20
|
max-width: 90%;
|
|
21
21
|
max-height: calc(80vh - 90px);
|
|
22
22
|
border-radius: 3px;
|
|
23
23
|
margin: auto;
|
|
24
|
-
animation: 200ms ease bgl-lightbox-load-
|
|
24
|
+
animation: 200ms ease bgl-lightbox-load-c3c26420;
|
|
25
25
|
}
|
|
26
|
-
.navigation[data-v-
|
|
26
|
+
.navigation[data-v-c3c26420] {
|
|
27
27
|
top: 50%;
|
|
28
28
|
transform: translateY(-50%);
|
|
29
29
|
}
|
|
30
|
-
.navigation-btn[data-v-
|
|
30
|
+
.navigation-btn[data-v-c3c26420] {
|
|
31
31
|
width: var(--input-height);
|
|
32
32
|
height: var(--input-height);
|
|
33
33
|
}
|
|
34
|
-
.thumbnail[data-v-
|
|
34
|
+
.thumbnail[data-v-c3c26420] {
|
|
35
35
|
height: 50px;
|
|
36
36
|
width: 50px;
|
|
37
37
|
}
|
|
38
|
-
.thumbnail[data-v-
|
|
38
|
+
.thumbnail[data-v-c3c26420]:hover {
|
|
39
39
|
opacity: 1;
|
|
40
40
|
}
|
|
41
|
-
.thumbnail[data-v-
|
|
41
|
+
.thumbnail[data-v-c3c26420]:active {
|
|
42
42
|
opacity: 0.8;
|
|
43
43
|
}
|
|
44
|
-
.thumbnail.active[data-v-
|
|
44
|
+
.thumbnail.active[data-v-c3c26420] {
|
|
45
45
|
opacity: 1;
|
|
46
46
|
outline: 2px solid white;
|
|
47
47
|
}
|
|
@@ -1801,7 +1801,7 @@ display: block;
|
|
|
1801
1801
|
color: var(--bgl-white);
|
|
1802
1802
|
}
|
|
1803
1803
|
|
|
1804
|
-
.fileUploadWrap[data-v-
|
|
1804
|
+
.fileUploadWrap[data-v-a0ae528d] {
|
|
1805
1805
|
outline: 1px solid var(--border-color);
|
|
1806
1806
|
border-radius: var(--input-border-radius);
|
|
1807
1807
|
text-align: center;
|
|
@@ -1813,7 +1813,7 @@ display: block;
|
|
|
1813
1813
|
background: var(--input-bg);
|
|
1814
1814
|
height: 215px;
|
|
1815
1815
|
}
|
|
1816
|
-
.bagel-input .fileUploadWrap.fileDropZone[data-v-
|
|
1816
|
+
.bagel-input .fileUploadWrap.fileDropZone[data-v-a0ae528d] {
|
|
1817
1817
|
background: var(--input-bg);
|
|
1818
1818
|
display: flex;
|
|
1819
1819
|
align-items: center;
|
|
@@ -1821,14 +1821,14 @@ display: block;
|
|
|
1821
1821
|
color: var(--bgl-gray);
|
|
1822
1822
|
flex-direction: column;
|
|
1823
1823
|
}
|
|
1824
|
-
.fileUploadWrap.dragover[data-v-
|
|
1825
|
-
.fileUploadWrap[data-v-
|
|
1824
|
+
.fileUploadWrap.dragover[data-v-a0ae528d],
|
|
1825
|
+
.fileUploadWrap[data-v-a0ae528d]:hover {
|
|
1826
1826
|
box-shadow: inset 0 0 10px #00000012;
|
|
1827
1827
|
}
|
|
1828
|
-
.fileUploadWrap[style*="height: auto;"][data-v-
|
|
1828
|
+
.fileUploadWrap[style*="height: auto;"][data-v-a0ae528d] {
|
|
1829
1829
|
min-height: 215px;
|
|
1830
1830
|
}
|
|
1831
|
-
.multi-image-item-preview[data-v-
|
|
1831
|
+
.multi-image-item-preview[data-v-a0ae528d] {
|
|
1832
1832
|
border: 1px solid var(--border-color) !important;
|
|
1833
1833
|
border-radius: var(--input-border-radius);
|
|
1834
1834
|
margin: 0.5rem !important;
|
|
@@ -1842,12 +1842,12 @@ display: block;
|
|
|
1842
1842
|
gap: 1rem;
|
|
1843
1843
|
align-items: center;
|
|
1844
1844
|
}
|
|
1845
|
-
.multi-image-item-preview p[data-v-
|
|
1845
|
+
.multi-image-item-preview p[data-v-a0ae528d] {
|
|
1846
1846
|
overflow: hidden;
|
|
1847
1847
|
text-overflow: ellipsis;
|
|
1848
1848
|
white-space: nowrap;
|
|
1849
1849
|
}
|
|
1850
|
-
.multi-preview[data-v-
|
|
1850
|
+
.multi-preview[data-v-a0ae528d]{
|
|
1851
1851
|
width: 40px;
|
|
1852
1852
|
height: 40px;
|
|
1853
1853
|
border-radius: var(--input-border-radius);
|
|
@@ -1858,17 +1858,17 @@ display: block;
|
|
|
1858
1858
|
align-items: center;
|
|
1859
1859
|
display: flex;
|
|
1860
1860
|
}
|
|
1861
|
-
.bgl-single-preview[data-v-
|
|
1861
|
+
.bgl-single-preview[data-v-a0ae528d]{
|
|
1862
1862
|
height: 100%;
|
|
1863
1863
|
position: relative;
|
|
1864
1864
|
}
|
|
1865
|
-
.bgl-single-preview + .fileUploadPlaceHolder[data-v-
|
|
1865
|
+
.bgl-single-preview + .fileUploadPlaceHolder[data-v-a0ae528d]{
|
|
1866
1866
|
position: absolute;
|
|
1867
1867
|
inset: 0;
|
|
1868
1868
|
margin: auto;
|
|
1869
1869
|
top: calc(50% - 2rem);
|
|
1870
1870
|
}
|
|
1871
|
-
.single-image-item-preview[data-v-
|
|
1871
|
+
.single-image-item-preview[data-v-a0ae528d] {
|
|
1872
1872
|
height: 100%;
|
|
1873
1873
|
min-height: 100%;
|
|
1874
1874
|
position: relative;
|
|
@@ -1876,13 +1876,13 @@ display: block;
|
|
|
1876
1876
|
align-items: center;
|
|
1877
1877
|
justify-content: center;
|
|
1878
1878
|
}
|
|
1879
|
-
.fileUploadWrap[style*="height: auto"] .single-image-item-preview[data-v-
|
|
1879
|
+
.fileUploadWrap[style*="height: auto"] .single-image-item-preview[data-v-a0ae528d] {
|
|
1880
1880
|
min-height: 215px;
|
|
1881
1881
|
}
|
|
1882
|
-
.fileUploadWrap[style*="height: auto"] .single-preview[data-v-
|
|
1882
|
+
.fileUploadWrap[style*="height: auto"] .single-preview[data-v-a0ae528d] {
|
|
1883
1883
|
margin: 0rem !important;
|
|
1884
1884
|
}
|
|
1885
|
-
.single-preview[data-v-
|
|
1885
|
+
.single-preview[data-v-a0ae528d]{
|
|
1886
1886
|
border-radius: var(--input-border-radius);
|
|
1887
1887
|
margin: 1rem;
|
|
1888
1888
|
padding: 0px;
|
|
@@ -1892,17 +1892,17 @@ display: block;
|
|
|
1892
1892
|
background: var(--bgl-gray-light);
|
|
1893
1893
|
box-shadow: 0 0 10px #00000012;
|
|
1894
1894
|
}
|
|
1895
|
-
.bgl_fill-image.single-image-item-preview[data-v-
|
|
1895
|
+
.bgl_fill-image.single-image-item-preview[data-v-a0ae528d] {
|
|
1896
1896
|
height: 100%;
|
|
1897
1897
|
}
|
|
1898
|
-
.bgl_fill-image.single-image-item-preview .single-preview[data-v-
|
|
1898
|
+
.bgl_fill-image.single-image-item-preview .single-preview[data-v-a0ae528d]{
|
|
1899
1899
|
border-radius: unset;
|
|
1900
1900
|
object-fit: cover;
|
|
1901
1901
|
box-shadow: unset;
|
|
1902
1902
|
width: 100%;
|
|
1903
1903
|
height: auto;
|
|
1904
1904
|
}
|
|
1905
|
-
.single-image-item-preview .pie[data-v-
|
|
1905
|
+
.single-image-item-preview .pie[data-v-a0ae528d] {
|
|
1906
1906
|
transform-origin: top;
|
|
1907
1907
|
transform: scale(1.4);
|
|
1908
1908
|
position: absolute;
|
|
@@ -1916,31 +1916,31 @@ display: block;
|
|
|
1916
1916
|
border: none !important;
|
|
1917
1917
|
padding: 0 !important;
|
|
1918
1918
|
}
|
|
1919
|
-
.bgl_oval-upload[data-v-
|
|
1919
|
+
.bgl_oval-upload[data-v-a0ae528d] {
|
|
1920
1920
|
border-radius: 100% !important;
|
|
1921
1921
|
overflow: hidden;
|
|
1922
1922
|
}
|
|
1923
|
-
.bgl_oval-upload p[data-v-
|
|
1923
|
+
.bgl_oval-upload p[data-v-a0ae528d] {
|
|
1924
1924
|
padding: 0.75rem !important;
|
|
1925
1925
|
font-size: 12px
|
|
1926
1926
|
}
|
|
1927
|
-
.bgl_oval-upload .fileUploadPlaceHolder[data-v-
|
|
1927
|
+
.bgl_oval-upload .fileUploadPlaceHolder[data-v-a0ae528d]{
|
|
1928
1928
|
top: 0;
|
|
1929
1929
|
}
|
|
1930
|
-
.bgl_oval-upload .pie[data-v-
|
|
1930
|
+
.bgl_oval-upload .pie[data-v-a0ae528d] {
|
|
1931
1931
|
transform: scale(1);
|
|
1932
1932
|
}
|
|
1933
|
-
.bgl_oval-upload span.bgl_icon-font.color-primary[data-v-
|
|
1933
|
+
.bgl_oval-upload span.bgl_icon-font.color-primary[data-v-a0ae528d] {
|
|
1934
1934
|
transform: scale(0.4) !important;
|
|
1935
1935
|
}
|
|
1936
|
-
.bgl_oval-upload .single-image-item-preview[data-v-
|
|
1936
|
+
.bgl_oval-upload .single-image-item-preview[data-v-a0ae528d]{
|
|
1937
1937
|
height: 100%;
|
|
1938
1938
|
}
|
|
1939
|
-
.bgl_oval-upload .single-preview[data-v-
|
|
1939
|
+
.bgl_oval-upload .single-preview[data-v-a0ae528d] {
|
|
1940
1940
|
margin: 0;
|
|
1941
1941
|
height: 100% !important;
|
|
1942
1942
|
}
|
|
1943
|
-
.pie[data-v-
|
|
1943
|
+
.pie[data-v-a0ae528d] {
|
|
1944
1944
|
width: 30px;
|
|
1945
1945
|
height: 30px;
|
|
1946
1946
|
position: relative;
|
|
@@ -1948,7 +1948,7 @@ display: block;
|
|
|
1948
1948
|
align-items: center;
|
|
1949
1949
|
justify-content: center;
|
|
1950
1950
|
}
|
|
1951
|
-
.pie[data-v-
|
|
1951
|
+
.pie[data-v-a0ae528d]:before {
|
|
1952
1952
|
content: '';
|
|
1953
1953
|
position: absolute;
|
|
1954
1954
|
border-radius: 50%;
|
|
@@ -1966,26 +1966,26 @@ display: block;
|
|
|
1966
1966
|
#000 calc(100% - var(--b))
|
|
1967
1967
|
);
|
|
1968
1968
|
}
|
|
1969
|
-
.pie .success[data-v-
|
|
1969
|
+
.pie .success[data-v-a0ae528d] {
|
|
1970
1970
|
transform: scale(0);
|
|
1971
1971
|
opacity: 0;
|
|
1972
1972
|
transition: all 0.3s ease-in-out;
|
|
1973
1973
|
}
|
|
1974
|
-
.pie .progress[data-v-
|
|
1974
|
+
.pie .progress[data-v-a0ae528d] {
|
|
1975
1975
|
position: absolute;
|
|
1976
1976
|
font-size: 10px;
|
|
1977
1977
|
}
|
|
1978
|
-
.pie.complete .progress[data-v-
|
|
1978
|
+
.pie.complete .progress[data-v-a0ae528d] {
|
|
1979
1979
|
display: none;
|
|
1980
1980
|
}
|
|
1981
|
-
.pie.complete .success[data-v-
|
|
1981
|
+
.pie.complete .success[data-v-a0ae528d] {
|
|
1982
1982
|
transform: scale(1.3);
|
|
1983
1983
|
opacity: 1;
|
|
1984
1984
|
}
|
|
1985
|
-
.pie.complete[data-v-
|
|
1985
|
+
.pie.complete[data-v-a0ae528d]:before {
|
|
1986
1986
|
background: conic-gradient(var(--bgl-green) calc(var(--p) * 1%), #0000 0);
|
|
1987
1987
|
}
|
|
1988
|
-
.pie.complete[data-v-
|
|
1988
|
+
.pie.complete[data-v-a0ae528d] {
|
|
1989
1989
|
color: var(--bgl-green);
|
|
1990
1990
|
}
|
|
1991
1991
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { onMounted, watch } from 'vue'
|
|
3
|
-
import { Btn,
|
|
3
|
+
import { Btn, IMAGE_FORMATS_REGEXP, Icon, type StorageFile, useBagel } from '@bagelink/vue'
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
6
6
|
label?: string
|
|
@@ -83,6 +83,20 @@ watch(
|
|
|
83
83
|
{ immediate: true }
|
|
84
84
|
)
|
|
85
85
|
|
|
86
|
+
watch(() => props.modelValue, () => {
|
|
87
|
+
const newModelValue: FSValue = props.modelValue || []
|
|
88
|
+
const currentValue = [file_bindkeys].flat()
|
|
89
|
+
const newValue = [newModelValue].flat()
|
|
90
|
+
const isSame = currentValue.every(id => newValue.includes(id)) && newValue.every(id => currentValue.includes(id)) && currentValue.length === newValue.length
|
|
91
|
+
if (!isSame) {
|
|
92
|
+
file_bindkeys = newModelValue
|
|
93
|
+
for (const fle of storageFiles) {
|
|
94
|
+
const index = [file_bindkeys].flat().findIndex(key => fle[bindKey] === key)
|
|
95
|
+
if (index === -1) storageFiles.splice(index, 1)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
|
|
86
100
|
function updateModelValue() {
|
|
87
101
|
let idValue: FSValue
|
|
88
102
|
if (props.multiple) {
|
|
@@ -105,7 +105,7 @@ defineExpose({ open, close })
|
|
|
105
105
|
</div>
|
|
106
106
|
</template>
|
|
107
107
|
</div>
|
|
108
|
-
<div v-if="group.length" class="navigation flex space-between w-100 absolute">
|
|
108
|
+
<div v-if="group && group.length > 1" class="navigation flex space-between w-100 absolute">
|
|
109
109
|
<Btn
|
|
110
110
|
class="navigation-btn oval user-select-none"
|
|
111
111
|
icon="arrow_back"
|
|
@@ -9,27 +9,46 @@ const groups: Record<string, LightboxItem[]> = {}
|
|
|
9
9
|
const lightboxDirective: Directive = {
|
|
10
10
|
mounted(el: HTMLElement, binding) {
|
|
11
11
|
el.classList.add('hover')
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
el.addEventListener('click', (e) => {
|
|
21
|
-
e.stopPropagation()
|
|
22
|
-
const lightboxInstance = createLightboxInstance()
|
|
23
|
-
if (!lightboxInstance || !lightboxInstance.open) return
|
|
24
|
-
const open = lightboxInstance.open as OpenFunction
|
|
25
|
-
open(item, groups[group])
|
|
26
|
-
})
|
|
12
|
+
const item = bindingToItem(binding, el)
|
|
13
|
+
groupHandler(item)
|
|
14
|
+
el.addEventListener('click', (e) => { openClickHandler(e, el, binding) })
|
|
15
|
+
},
|
|
16
|
+
updated(el: HTMLElement, binding) {
|
|
17
|
+
const item = bindingToItem(binding, el)
|
|
18
|
+
groupHandler(item)
|
|
19
|
+
el.removeEventListener('click', (e) => { openClickHandler(e, el, binding) })
|
|
20
|
+
el.addEventListener('click', (e) => { openClickHandler(e, el, binding) })
|
|
27
21
|
},
|
|
28
22
|
unmounted(el: HTMLElement, binding) {
|
|
29
|
-
|
|
23
|
+
el.removeEventListener('click', (e) => { openClickHandler(e, el, binding) })
|
|
30
24
|
}
|
|
31
25
|
}
|
|
32
26
|
|
|
27
|
+
function groupHandler(item: LightboxItem) {
|
|
28
|
+
if (item.group) {
|
|
29
|
+
if (!groups[item.group]) groups[item.group] = []
|
|
30
|
+
const currentIndex = groups[item.group].findIndex(i => i.src === item.src)
|
|
31
|
+
if (currentIndex === -1) groups[item.group].push(item)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function openClickHandler(e: MouseEvent, el: HTMLElement, binding: DirectiveBinding) {
|
|
36
|
+
e.stopPropagation()
|
|
37
|
+
const item = bindingToItem(binding, el)
|
|
38
|
+
const lightboxInstance = getLightboxInstance()
|
|
39
|
+
if (!lightboxInstance || !lightboxInstance.open) return
|
|
40
|
+
const open = lightboxInstance.open as OpenFunction
|
|
41
|
+
const group = item && item.group ? groups[item.group] : undefined
|
|
42
|
+
open(item, group)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function bindingToItem(binding: DirectiveBinding, el: HTMLElement): LightboxItem {
|
|
46
|
+
let { group, src, type, name, thumbnail } = binding.value || {}
|
|
47
|
+
src = src || binding.value || el.getAttribute('src') || ''
|
|
48
|
+
type = type || determineFileType(src)
|
|
49
|
+
return { src, type, name, thumbnail, group }
|
|
50
|
+
}
|
|
51
|
+
|
|
33
52
|
const youtubeRegex = /youtube\.com|youtu\.be/
|
|
34
53
|
const vimeoRegex = /vimeo\.com/
|
|
35
54
|
|
|
@@ -41,12 +60,16 @@ function determineFileType(url: string): string {
|
|
|
41
60
|
return 'unknown'
|
|
42
61
|
}
|
|
43
62
|
|
|
44
|
-
|
|
45
|
-
const lightboxEl = document.createElement('div')
|
|
46
|
-
document.body.prepend(lightboxEl)
|
|
63
|
+
let lightboxInstance: InstanceType<typeof Lightbox> | null = null
|
|
47
64
|
|
|
48
|
-
|
|
49
|
-
|
|
65
|
+
function getLightboxInstance(): InstanceType<typeof Lightbox> {
|
|
66
|
+
if (!lightboxInstance) {
|
|
67
|
+
const lightboxEl = document.createElement('div')
|
|
68
|
+
document.body.prepend(lightboxEl)
|
|
69
|
+
const app = createApp(Lightbox)
|
|
70
|
+
lightboxInstance = app.mount(lightboxEl) as InstanceType<typeof Lightbox>
|
|
71
|
+
}
|
|
72
|
+
return lightboxInstance
|
|
50
73
|
}
|
|
51
74
|
|
|
52
75
|
export default {
|