@bagelink/vue 0.0.805 → 0.0.807
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/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/layout/BottomMenu.vue.d.ts.map +1 -1
- package/dist/index.cjs +45 -36
- package/dist/index.mjs +45 -36
- package/dist/style.css +49 -47
- package/package.json +2 -2
- package/src/components/form/inputs/FileUpload.vue +6 -6
- package/src/components/form/inputs/SelectInput.vue +47 -36
- package/src/components/layout/BottomMenu.vue +2 -2
- package/src/styles/transitions.css +5 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/FileUpload.vue"],"names":[],"mappings":"AAkgBA,OAAO,EAAmC,KAAK,WAAW,EAAY,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"FileUpload.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/FileUpload.vue"],"names":[],"mappings":"AAkgBA,OAAO,EAAmC,KAAK,WAAW,EAAY,MAAM,eAAe,CAAA;AAK3F,KAAK,MAAM,GAAG,MAAM,WAAW,CAAA;AAE/B,KAAK,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,CAAA;AA6IzC,iBAAS,MAAM,SAgBd;AA6BD,iBAAS,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAlKZ,MAAM;4BACJ,OAAO;uBACZ,MAAM;2BACF,OAAO;;YAmZQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;0BAtZnB,MAAM;4BACJ,OAAO;uBACZ,MAAM;2BACF,OAAO;;;YAoZe,GAAG;;;WASvB,OAAO,IAA6B;EAEjD;AAqBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;YA7cZ,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;;;;kFA2cb,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/SelectInput.vue"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"SelectInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/SelectInput.vue"],"names":[],"mappings":"AAAA,OA4XO,EAKN,KAAK,aAAa,EAClB,KAAK,MAAM,EAEX,MAAM,eAAe,CAAA;AAEtB,OAAO,wBAAwB,CAAA;AA0L/B,iBAAS,cAAc;;sBAwNI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA8BO,GAAG,8CACD,GAAE,yBAC7B,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WArBvC,OAAO,IAA6B;EAEjD;AA8BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;aAzbX,MAAM,EAAE;kBACH,MAAM;eACT,OAAO;iBACL,MAAM;iBACN,OAAO;eACT,OAAO;YACV,MAAM;gBACF,OAAO;kBACL,OAAO;WACd,aAAa;gBACR,OAAO;mBACJ,MAAM;gBACT,OAAO;wBACC,MAAM;;;;aAbjB,MAAM,EAAE;kBACH,MAAM;eACT,OAAO;iBACL,MAAM;iBACN,OAAO;eACT,OAAO;YACV,MAAM;gBACF,OAAO;kBACL,OAAO;WACd,aAAa;gBACR,OAAO;mBACJ,MAAM;gBACT,OAAO;wBACC,MAAM;;;kFAmbzB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/components/layout/BottomMenu.vue"],"names":[],"mappings":"AAsEA,OAAO,EAIN,KAAK,OAAO,EACZ,MAAM,eAAe,CAAA;AAatB,iBAAS,cAAc;;
|
|
1
|
+
{"version":3,"file":"BottomMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/components/layout/BottomMenu.vue"],"names":[],"mappings":"AAsEA,OAAO,EAIN,KAAK,OAAO,EACZ,MAAM,eAAe,CAAA;AAatB,iBAAS,cAAc;;uBA0FI,GAAG;;;WAShB,OAAO,IAA6B;EAEjD;AAWD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;cAzHV,OAAO,EAAE;;cAAT,OAAO,EAAE;iGA+HlB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -18643,8 +18643,8 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
|
18643
18643
|
setup(__props, { emit: __emit }) {
|
|
18644
18644
|
const props2 = __props;
|
|
18645
18645
|
const emit2 = __emit;
|
|
18646
|
-
const bagel = useBagel();
|
|
18647
18646
|
const bindKey2 = props2.bindkey || "id";
|
|
18647
|
+
const bagel = useBagel();
|
|
18648
18648
|
const isImage = (str) => IMAGE_FORMATS_REGEXP.test(str);
|
|
18649
18649
|
let file_bindkeys = vue.ref(props2.modelValue || []);
|
|
18650
18650
|
const storageFiles = vue.ref([]);
|
|
@@ -18915,7 +18915,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
|
18915
18915
|
};
|
|
18916
18916
|
}
|
|
18917
18917
|
});
|
|
18918
|
-
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-
|
|
18918
|
+
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-3d733095"]]);
|
|
18919
18919
|
const _hoisted_1$v = ["title"];
|
|
18920
18920
|
const _hoisted_2$k = { key: 0 };
|
|
18921
18921
|
const _hoisted_3$g = ["value", "placeholder"];
|
|
@@ -43571,33 +43571,44 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
|
43571
43571
|
const selectedItemCount = vue.computed(() => selectedItems.value.length ?? 0);
|
|
43572
43572
|
let search = vue.ref("");
|
|
43573
43573
|
const dropdown = vue.ref(null);
|
|
43574
|
+
let selected = vue.ref(false);
|
|
43574
43575
|
let open = vue.ref(false);
|
|
43575
43576
|
function openOptions() {
|
|
43576
43577
|
var _a2;
|
|
43577
43578
|
(_a2 = dropdown.value) == null ? void 0 : _a2.show();
|
|
43578
43579
|
}
|
|
43580
|
+
const selectedLabel = vue.computed(() => {
|
|
43581
|
+
if (selectedItemCount.value === 0) return props2.placeholder || "Select";
|
|
43582
|
+
if (selectedItemCount.value > 4) {
|
|
43583
|
+
const str = selectedItems.value.slice(0, 4).map((item) => getLabel(item)).join(", ");
|
|
43584
|
+
return `${str}... +${selectedItemCount.value - 4}`;
|
|
43585
|
+
}
|
|
43586
|
+
return selectedItems.value.map((item) => getLabel(item)).join(", ");
|
|
43587
|
+
});
|
|
43588
|
+
const filteredOptions = vue.computed(() => props2.options.filter((option2) => {
|
|
43589
|
+
const searchTerm = search.value.split(/\s+/).filter(Boolean).map((t) => new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gi"));
|
|
43590
|
+
return Boolean(option2) && searchTerm.every((s2) => getLabel(option2).match(s2));
|
|
43591
|
+
}));
|
|
43592
|
+
const isSelected = (option2) => selectedItems.value.find((item) => getValue(option2) === getValue(item)) !== void 0;
|
|
43579
43593
|
function updateOpen(visible) {
|
|
43580
43594
|
open.value = visible;
|
|
43581
43595
|
if (!open.value) {
|
|
43596
|
+
if (props2.searchable && !props2.multiselect && !search.value && !selected.value) selectedItems.value = [];
|
|
43597
|
+
if (props2.searchable && !props2.multiselect && search.value && filteredOptions.value.length === 1 && !isSelected(filteredOptions.value[0])) {
|
|
43598
|
+
select2(filteredOptions.value[0]);
|
|
43599
|
+
}
|
|
43582
43600
|
search.value = "";
|
|
43583
43601
|
} else {
|
|
43602
|
+
if (props2.searchable && !props2.multiselect && selectedItemCount.value) search.value = selectedLabel.value;
|
|
43584
43603
|
setTimeout(
|
|
43585
43604
|
() => {
|
|
43586
43605
|
var _a2, _b, _c;
|
|
43587
43606
|
return (_c = (_b = (_a2 = searchInput.value) == null ? void 0 : _a2.$el) == null ? void 0 : _b.querySelector("input")) == null ? void 0 : _c.focus();
|
|
43588
43607
|
},
|
|
43589
|
-
|
|
43608
|
+
150
|
|
43590
43609
|
);
|
|
43591
43610
|
}
|
|
43592
43611
|
}
|
|
43593
|
-
const selectedLabel = vue.computed(() => {
|
|
43594
|
-
if (selectedItemCount.value === 0) return props2.placeholder || "Select";
|
|
43595
|
-
if (selectedItemCount.value > 4) {
|
|
43596
|
-
const str = selectedItems.value.slice(0, 4).map((item) => getLabel(item)).join(", ");
|
|
43597
|
-
return `${str}... +${selectedItemCount.value - 4}`;
|
|
43598
|
-
}
|
|
43599
|
-
return selectedItems.value.map((item) => getLabel(item)).join(", ");
|
|
43600
|
-
});
|
|
43601
43612
|
function getLabel(option2) {
|
|
43602
43613
|
if (!option2) return "";
|
|
43603
43614
|
if (typeof option2 === "string") return option2;
|
|
@@ -43610,13 +43621,9 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
|
43610
43621
|
if (typeof option2 === "number") return option2;
|
|
43611
43622
|
return option2.value;
|
|
43612
43623
|
}
|
|
43613
|
-
const isSelected = (option2) => selectedItems.value.find((item) => getValue(option2) === getValue(item)) !== void 0;
|
|
43614
|
-
const filteredOptions = vue.computed(() => props2.options.filter((option2) => {
|
|
43615
|
-
const searchTerm = search.value.split(/\s+/).filter(Boolean).map((t) => new RegExp(t, "gi"));
|
|
43616
|
-
return Boolean(option2) && searchTerm.every((s2) => getLabel(option2).match(s2));
|
|
43617
|
-
}));
|
|
43618
43624
|
function select2(option2) {
|
|
43619
43625
|
var _a2;
|
|
43626
|
+
selected.value = true;
|
|
43620
43627
|
const existingIndex = selectedItems.value.findIndex(
|
|
43621
43628
|
(item) => getValue(item) === getValue(option2)
|
|
43622
43629
|
);
|
|
@@ -43689,18 +43696,30 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
|
43689
43696
|
ref: dropdown,
|
|
43690
43697
|
placement: "bottom-start",
|
|
43691
43698
|
class: "bagel-input selectinput",
|
|
43692
|
-
onHide: _cache[
|
|
43699
|
+
onHide: _cache[5] || (_cache[5] = ($event) => updateOpen(false))
|
|
43693
43700
|
}, {
|
|
43694
43701
|
trigger: vue.withCtx(() => [
|
|
43695
43702
|
vue.createElementVNode("label", null, [
|
|
43696
43703
|
vue.createTextVNode(vue.toDisplayString(_ctx.label) + " ", 1),
|
|
43697
43704
|
vue.createElementVNode("div", _hoisted_1$o, [
|
|
43698
|
-
vue.
|
|
43705
|
+
_ctx.searchable && vue.unref(open) ? (vue.openBlock(), vue.createBlock(vue.unref(TextInput), {
|
|
43706
|
+
key: 0,
|
|
43707
|
+
ref_key: "searchInput",
|
|
43708
|
+
ref: searchInput,
|
|
43709
|
+
modelValue: vue.unref(search),
|
|
43710
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(search) ? search.value = $event : search = $event),
|
|
43711
|
+
class: "mb-0",
|
|
43712
|
+
dense: "",
|
|
43713
|
+
placeholder: searchPlaceholder.value,
|
|
43714
|
+
icon: "search",
|
|
43715
|
+
onInput: _cache[1] || (_cache[1] = ($event) => vue.isRef(selected) ? selected.value = false : selected = false)
|
|
43716
|
+
}, null, 8, ["modelValue", "placeholder"])) : (vue.openBlock(), vue.createElementBlock("button", {
|
|
43717
|
+
key: 1,
|
|
43699
43718
|
disabled: _ctx.disabled,
|
|
43700
43719
|
type: "button",
|
|
43701
43720
|
class: vue.normalizeClass(["selectinput-btn", { isEmpty: selectedItemCount.value === 0 }]),
|
|
43702
43721
|
onKeydown: openOptions,
|
|
43703
|
-
onClick: _cache[
|
|
43722
|
+
onClick: _cache[3] || (_cache[3] = ($event) => updateOpen(true))
|
|
43704
43723
|
}, [
|
|
43705
43724
|
_ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$c), {
|
|
43706
43725
|
key: 0,
|
|
@@ -43713,7 +43732,7 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
|
43713
43732
|
thin: "",
|
|
43714
43733
|
icon: "clear",
|
|
43715
43734
|
class: "color-gray",
|
|
43716
|
-
onClick: _cache[
|
|
43735
|
+
onClick: _cache[2] || (_cache[2] = ($event) => {
|
|
43717
43736
|
vue.isRef(selectedItems) ? selectedItems.value = [] : selectedItems = [];
|
|
43718
43737
|
emitUpdate();
|
|
43719
43738
|
})
|
|
@@ -43723,14 +43742,14 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
|
43723
43742
|
key: 3,
|
|
43724
43743
|
thin: ""
|
|
43725
43744
|
}, { icon: vue.unref(open) ? "unfold_less" : "unfold_more" }), null, 16)) : vue.createCommentVNode("", true)
|
|
43726
|
-
], 42, _hoisted_2$f),
|
|
43745
|
+
], 42, _hoisted_2$f)),
|
|
43727
43746
|
_ctx.required ? (vue.openBlock(), vue.createElementBlock("input", {
|
|
43728
|
-
key:
|
|
43747
|
+
key: 2,
|
|
43729
43748
|
tabindex: "-1",
|
|
43730
43749
|
style: { "width": "0", "height": "0", "position": "absolute", "opacity": "0", "z-index": "-1" },
|
|
43731
43750
|
value: vue.unref(selectedItems),
|
|
43732
43751
|
required: "",
|
|
43733
|
-
onInput: _cache[
|
|
43752
|
+
onInput: _cache[4] || (_cache[4] = ($event) => updateOpen(true))
|
|
43734
43753
|
}, null, 40, _hoisted_5$7)) : vue.createCommentVNode("", true)
|
|
43735
43754
|
])
|
|
43736
43755
|
])
|
|
@@ -43741,16 +43760,6 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
|
43741
43760
|
style: vue.normalizeStyle({ width: _ctx.fullWidth ? "100%" : "auto" })
|
|
43742
43761
|
}, {
|
|
43743
43762
|
default: vue.withCtx(() => [
|
|
43744
|
-
_ctx.searchable ? (vue.openBlock(), vue.createBlock(vue.unref(TextInput), {
|
|
43745
|
-
key: 0,
|
|
43746
|
-
ref_key: "searchInput",
|
|
43747
|
-
ref: searchInput,
|
|
43748
|
-
modelValue: vue.unref(search),
|
|
43749
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => vue.isRef(search) ? search.value = $event : search = $event),
|
|
43750
|
-
dense: "",
|
|
43751
|
-
placeholder: searchPlaceholder.value,
|
|
43752
|
-
icon: "search"
|
|
43753
|
-
}, null, 8, ["modelValue", "placeholder"])) : vue.createCommentVNode("", true),
|
|
43754
43763
|
vue.createElementVNode("div", {
|
|
43755
43764
|
class: vue.normalizeClass(["selectinput-options", { multiselect: _ctx.multiselect }])
|
|
43756
43765
|
}, [
|
|
@@ -43791,7 +43800,7 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
|
43791
43800
|
};
|
|
43792
43801
|
}
|
|
43793
43802
|
});
|
|
43794
|
-
const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-
|
|
43803
|
+
const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-949f4227"]]);
|
|
43795
43804
|
const _hoisted_1$n = {
|
|
43796
43805
|
class: "toolbar flex gap-025 pb-05 flex-wrap",
|
|
43797
43806
|
role: "toolbar"
|
|
@@ -52443,7 +52452,7 @@ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
|
52443
52452
|
vue.createVNode(vue.unref(_sfc_main$c), {
|
|
52444
52453
|
icon: nav2.icon,
|
|
52445
52454
|
size: 1.4,
|
|
52446
|
-
class: "m-0"
|
|
52455
|
+
class: "m-0 line-height-14"
|
|
52447
52456
|
}, null, 8, ["icon"]),
|
|
52448
52457
|
vue.createElementVNode("p", _hoisted_1$g, vue.toDisplayString(nav2.label), 1)
|
|
52449
52458
|
]),
|
|
@@ -52456,7 +52465,7 @@ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
|
52456
52465
|
};
|
|
52457
52466
|
}
|
|
52458
52467
|
});
|
|
52459
|
-
const BottomMenu = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-
|
|
52468
|
+
const BottomMenu = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-557bcad0"]]);
|
|
52460
52469
|
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
52461
52470
|
__name: "Layout",
|
|
52462
52471
|
props: {
|
package/dist/index.mjs
CHANGED
|
@@ -18641,8 +18641,8 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
18641
18641
|
setup(__props, { emit: __emit }) {
|
|
18642
18642
|
const props2 = __props;
|
|
18643
18643
|
const emit2 = __emit;
|
|
18644
|
-
const bagel = useBagel();
|
|
18645
18644
|
const bindKey2 = props2.bindkey || "id";
|
|
18645
|
+
const bagel = useBagel();
|
|
18646
18646
|
const isImage = (str) => IMAGE_FORMATS_REGEXP.test(str);
|
|
18647
18647
|
let file_bindkeys = ref(props2.modelValue || []);
|
|
18648
18648
|
const storageFiles = ref([]);
|
|
@@ -18913,7 +18913,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
18913
18913
|
};
|
|
18914
18914
|
}
|
|
18915
18915
|
});
|
|
18916
|
-
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-
|
|
18916
|
+
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-3d733095"]]);
|
|
18917
18917
|
const _hoisted_1$v = ["title"];
|
|
18918
18918
|
const _hoisted_2$k = { key: 0 };
|
|
18919
18919
|
const _hoisted_3$g = ["value", "placeholder"];
|
|
@@ -43569,33 +43569,44 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
43569
43569
|
const selectedItemCount = computed(() => selectedItems.value.length ?? 0);
|
|
43570
43570
|
let search = ref("");
|
|
43571
43571
|
const dropdown = ref(null);
|
|
43572
|
+
let selected = ref(false);
|
|
43572
43573
|
let open = ref(false);
|
|
43573
43574
|
function openOptions() {
|
|
43574
43575
|
var _a2;
|
|
43575
43576
|
(_a2 = dropdown.value) == null ? void 0 : _a2.show();
|
|
43576
43577
|
}
|
|
43578
|
+
const selectedLabel = computed(() => {
|
|
43579
|
+
if (selectedItemCount.value === 0) return props2.placeholder || "Select";
|
|
43580
|
+
if (selectedItemCount.value > 4) {
|
|
43581
|
+
const str = selectedItems.value.slice(0, 4).map((item) => getLabel(item)).join(", ");
|
|
43582
|
+
return `${str}... +${selectedItemCount.value - 4}`;
|
|
43583
|
+
}
|
|
43584
|
+
return selectedItems.value.map((item) => getLabel(item)).join(", ");
|
|
43585
|
+
});
|
|
43586
|
+
const filteredOptions = computed(() => props2.options.filter((option2) => {
|
|
43587
|
+
const searchTerm = search.value.split(/\s+/).filter(Boolean).map((t) => new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gi"));
|
|
43588
|
+
return Boolean(option2) && searchTerm.every((s2) => getLabel(option2).match(s2));
|
|
43589
|
+
}));
|
|
43590
|
+
const isSelected = (option2) => selectedItems.value.find((item) => getValue(option2) === getValue(item)) !== void 0;
|
|
43577
43591
|
function updateOpen(visible) {
|
|
43578
43592
|
open.value = visible;
|
|
43579
43593
|
if (!open.value) {
|
|
43594
|
+
if (props2.searchable && !props2.multiselect && !search.value && !selected.value) selectedItems.value = [];
|
|
43595
|
+
if (props2.searchable && !props2.multiselect && search.value && filteredOptions.value.length === 1 && !isSelected(filteredOptions.value[0])) {
|
|
43596
|
+
select2(filteredOptions.value[0]);
|
|
43597
|
+
}
|
|
43580
43598
|
search.value = "";
|
|
43581
43599
|
} else {
|
|
43600
|
+
if (props2.searchable && !props2.multiselect && selectedItemCount.value) search.value = selectedLabel.value;
|
|
43582
43601
|
setTimeout(
|
|
43583
43602
|
() => {
|
|
43584
43603
|
var _a2, _b, _c;
|
|
43585
43604
|
return (_c = (_b = (_a2 = searchInput.value) == null ? void 0 : _a2.$el) == null ? void 0 : _b.querySelector("input")) == null ? void 0 : _c.focus();
|
|
43586
43605
|
},
|
|
43587
|
-
|
|
43606
|
+
150
|
|
43588
43607
|
);
|
|
43589
43608
|
}
|
|
43590
43609
|
}
|
|
43591
|
-
const selectedLabel = computed(() => {
|
|
43592
|
-
if (selectedItemCount.value === 0) return props2.placeholder || "Select";
|
|
43593
|
-
if (selectedItemCount.value > 4) {
|
|
43594
|
-
const str = selectedItems.value.slice(0, 4).map((item) => getLabel(item)).join(", ");
|
|
43595
|
-
return `${str}... +${selectedItemCount.value - 4}`;
|
|
43596
|
-
}
|
|
43597
|
-
return selectedItems.value.map((item) => getLabel(item)).join(", ");
|
|
43598
|
-
});
|
|
43599
43610
|
function getLabel(option2) {
|
|
43600
43611
|
if (!option2) return "";
|
|
43601
43612
|
if (typeof option2 === "string") return option2;
|
|
@@ -43608,13 +43619,9 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
43608
43619
|
if (typeof option2 === "number") return option2;
|
|
43609
43620
|
return option2.value;
|
|
43610
43621
|
}
|
|
43611
|
-
const isSelected = (option2) => selectedItems.value.find((item) => getValue(option2) === getValue(item)) !== void 0;
|
|
43612
|
-
const filteredOptions = computed(() => props2.options.filter((option2) => {
|
|
43613
|
-
const searchTerm = search.value.split(/\s+/).filter(Boolean).map((t) => new RegExp(t, "gi"));
|
|
43614
|
-
return Boolean(option2) && searchTerm.every((s2) => getLabel(option2).match(s2));
|
|
43615
|
-
}));
|
|
43616
43622
|
function select2(option2) {
|
|
43617
43623
|
var _a2;
|
|
43624
|
+
selected.value = true;
|
|
43618
43625
|
const existingIndex = selectedItems.value.findIndex(
|
|
43619
43626
|
(item) => getValue(item) === getValue(option2)
|
|
43620
43627
|
);
|
|
@@ -43687,18 +43694,30 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
43687
43694
|
ref: dropdown,
|
|
43688
43695
|
placement: "bottom-start",
|
|
43689
43696
|
class: "bagel-input selectinput",
|
|
43690
|
-
onHide: _cache[
|
|
43697
|
+
onHide: _cache[5] || (_cache[5] = ($event) => updateOpen(false))
|
|
43691
43698
|
}, {
|
|
43692
43699
|
trigger: withCtx(() => [
|
|
43693
43700
|
createElementVNode("label", null, [
|
|
43694
43701
|
createTextVNode(toDisplayString(_ctx.label) + " ", 1),
|
|
43695
43702
|
createElementVNode("div", _hoisted_1$o, [
|
|
43696
|
-
|
|
43703
|
+
_ctx.searchable && unref(open) ? (openBlock(), createBlock(unref(TextInput), {
|
|
43704
|
+
key: 0,
|
|
43705
|
+
ref_key: "searchInput",
|
|
43706
|
+
ref: searchInput,
|
|
43707
|
+
modelValue: unref(search),
|
|
43708
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(search) ? search.value = $event : search = $event),
|
|
43709
|
+
class: "mb-0",
|
|
43710
|
+
dense: "",
|
|
43711
|
+
placeholder: searchPlaceholder.value,
|
|
43712
|
+
icon: "search",
|
|
43713
|
+
onInput: _cache[1] || (_cache[1] = ($event) => isRef(selected) ? selected.value = false : selected = false)
|
|
43714
|
+
}, null, 8, ["modelValue", "placeholder"])) : (openBlock(), createElementBlock("button", {
|
|
43715
|
+
key: 1,
|
|
43697
43716
|
disabled: _ctx.disabled,
|
|
43698
43717
|
type: "button",
|
|
43699
43718
|
class: normalizeClass(["selectinput-btn", { isEmpty: selectedItemCount.value === 0 }]),
|
|
43700
43719
|
onKeydown: openOptions,
|
|
43701
|
-
onClick: _cache[
|
|
43720
|
+
onClick: _cache[3] || (_cache[3] = ($event) => updateOpen(true))
|
|
43702
43721
|
}, [
|
|
43703
43722
|
_ctx.icon ? (openBlock(), createBlock(unref(_sfc_main$c), {
|
|
43704
43723
|
key: 0,
|
|
@@ -43711,7 +43730,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
43711
43730
|
thin: "",
|
|
43712
43731
|
icon: "clear",
|
|
43713
43732
|
class: "color-gray",
|
|
43714
|
-
onClick: _cache[
|
|
43733
|
+
onClick: _cache[2] || (_cache[2] = ($event) => {
|
|
43715
43734
|
isRef(selectedItems) ? selectedItems.value = [] : selectedItems = [];
|
|
43716
43735
|
emitUpdate();
|
|
43717
43736
|
})
|
|
@@ -43721,14 +43740,14 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
43721
43740
|
key: 3,
|
|
43722
43741
|
thin: ""
|
|
43723
43742
|
}, { icon: unref(open) ? "unfold_less" : "unfold_more" }), null, 16)) : createCommentVNode("", true)
|
|
43724
|
-
], 42, _hoisted_2$f),
|
|
43743
|
+
], 42, _hoisted_2$f)),
|
|
43725
43744
|
_ctx.required ? (openBlock(), createElementBlock("input", {
|
|
43726
|
-
key:
|
|
43745
|
+
key: 2,
|
|
43727
43746
|
tabindex: "-1",
|
|
43728
43747
|
style: { "width": "0", "height": "0", "position": "absolute", "opacity": "0", "z-index": "-1" },
|
|
43729
43748
|
value: unref(selectedItems),
|
|
43730
43749
|
required: "",
|
|
43731
|
-
onInput: _cache[
|
|
43750
|
+
onInput: _cache[4] || (_cache[4] = ($event) => updateOpen(true))
|
|
43732
43751
|
}, null, 40, _hoisted_5$7)) : createCommentVNode("", true)
|
|
43733
43752
|
])
|
|
43734
43753
|
])
|
|
@@ -43739,16 +43758,6 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
43739
43758
|
style: normalizeStyle({ width: _ctx.fullWidth ? "100%" : "auto" })
|
|
43740
43759
|
}, {
|
|
43741
43760
|
default: withCtx(() => [
|
|
43742
|
-
_ctx.searchable ? (openBlock(), createBlock(unref(TextInput), {
|
|
43743
|
-
key: 0,
|
|
43744
|
-
ref_key: "searchInput",
|
|
43745
|
-
ref: searchInput,
|
|
43746
|
-
modelValue: unref(search),
|
|
43747
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(search) ? search.value = $event : search = $event),
|
|
43748
|
-
dense: "",
|
|
43749
|
-
placeholder: searchPlaceholder.value,
|
|
43750
|
-
icon: "search"
|
|
43751
|
-
}, null, 8, ["modelValue", "placeholder"])) : createCommentVNode("", true),
|
|
43752
43761
|
createElementVNode("div", {
|
|
43753
43762
|
class: normalizeClass(["selectinput-options", { multiselect: _ctx.multiselect }])
|
|
43754
43763
|
}, [
|
|
@@ -43789,7 +43798,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
43789
43798
|
};
|
|
43790
43799
|
}
|
|
43791
43800
|
});
|
|
43792
|
-
const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-
|
|
43801
|
+
const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-949f4227"]]);
|
|
43793
43802
|
const _hoisted_1$n = {
|
|
43794
43803
|
class: "toolbar flex gap-025 pb-05 flex-wrap",
|
|
43795
43804
|
role: "toolbar"
|
|
@@ -52441,7 +52450,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
52441
52450
|
createVNode(unref(_sfc_main$c), {
|
|
52442
52451
|
icon: nav2.icon,
|
|
52443
52452
|
size: 1.4,
|
|
52444
|
-
class: "m-0"
|
|
52453
|
+
class: "m-0 line-height-14"
|
|
52445
52454
|
}, null, 8, ["icon"]),
|
|
52446
52455
|
createElementVNode("p", _hoisted_1$g, toDisplayString(nav2.label), 1)
|
|
52447
52456
|
]),
|
|
@@ -52454,7 +52463,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
52454
52463
|
};
|
|
52455
52464
|
}
|
|
52456
52465
|
});
|
|
52457
|
-
const BottomMenu = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-
|
|
52466
|
+
const BottomMenu = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-557bcad0"]]);
|
|
52458
52467
|
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
52459
52468
|
__name: "Layout",
|
|
52460
52469
|
props: {
|
package/dist/style.css
CHANGED
|
@@ -720,7 +720,7 @@ data[data-v-5f91f598] {
|
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
722
|
|
|
723
|
-
.fileUploadWrap[data-v-
|
|
723
|
+
.fileUploadWrap[data-v-3d733095] {
|
|
724
724
|
outline: 1px solid var(--border-color);
|
|
725
725
|
border-radius: var(--input-border-radius);
|
|
726
726
|
text-align: center;
|
|
@@ -732,7 +732,7 @@ data[data-v-5f91f598] {
|
|
|
732
732
|
background: var(--input-bg);
|
|
733
733
|
height: 215px;
|
|
734
734
|
}
|
|
735
|
-
.bagel-input .fileUploadWrap.fileDropZone[data-v-
|
|
735
|
+
.bagel-input .fileUploadWrap.fileDropZone[data-v-3d733095] {
|
|
736
736
|
background: var(--input-bg);
|
|
737
737
|
display: flex;
|
|
738
738
|
align-items: center;
|
|
@@ -740,14 +740,14 @@ data[data-v-5f91f598] {
|
|
|
740
740
|
color: var(--bgl-gray);
|
|
741
741
|
flex-direction: column;
|
|
742
742
|
}
|
|
743
|
-
.fileUploadWrap.dragover[data-v-
|
|
744
|
-
.fileUploadWrap[data-v-
|
|
743
|
+
.fileUploadWrap.dragover[data-v-3d733095],
|
|
744
|
+
.fileUploadWrap[data-v-3d733095]:hover {
|
|
745
745
|
box-shadow: inset 0 0 10px #00000012;
|
|
746
746
|
}
|
|
747
|
-
.fileUploadWrap[style*="height: auto;"][data-v-
|
|
747
|
+
.fileUploadWrap[style*="height: auto;"][data-v-3d733095] {
|
|
748
748
|
min-height: 215px;
|
|
749
749
|
}
|
|
750
|
-
.multi-image-item-preview[data-v-
|
|
750
|
+
.multi-image-item-preview[data-v-3d733095] {
|
|
751
751
|
border: 1px solid var(--border-color) !important;
|
|
752
752
|
border-radius: var(--input-border-radius);
|
|
753
753
|
margin: 0.5rem !important;
|
|
@@ -761,12 +761,12 @@ data[data-v-5f91f598] {
|
|
|
761
761
|
gap: 1rem;
|
|
762
762
|
align-items: center;
|
|
763
763
|
}
|
|
764
|
-
.multi-image-item-preview p[data-v-
|
|
764
|
+
.multi-image-item-preview p[data-v-3d733095] {
|
|
765
765
|
overflow: hidden;
|
|
766
766
|
text-overflow: ellipsis;
|
|
767
767
|
white-space: nowrap;
|
|
768
768
|
}
|
|
769
|
-
.multi-preview[data-v-
|
|
769
|
+
.multi-preview[data-v-3d733095]{
|
|
770
770
|
width: 40px;
|
|
771
771
|
height: 40px;
|
|
772
772
|
border-radius: var(--input-border-radius);
|
|
@@ -777,17 +777,17 @@ data[data-v-5f91f598] {
|
|
|
777
777
|
align-items: center;
|
|
778
778
|
display: flex;
|
|
779
779
|
}
|
|
780
|
-
.bgl-single-preview[data-v-
|
|
780
|
+
.bgl-single-preview[data-v-3d733095]{
|
|
781
781
|
height: 100%;
|
|
782
782
|
position: relative;
|
|
783
783
|
}
|
|
784
|
-
.bgl-single-preview + .fileUploadPlaceHolder[data-v-
|
|
784
|
+
.bgl-single-preview + .fileUploadPlaceHolder[data-v-3d733095]{
|
|
785
785
|
position: absolute;
|
|
786
786
|
inset: 0;
|
|
787
787
|
margin: auto;
|
|
788
788
|
top: calc(50% - 2rem);
|
|
789
789
|
}
|
|
790
|
-
.single-image-item-preview[data-v-
|
|
790
|
+
.single-image-item-preview[data-v-3d733095] {
|
|
791
791
|
height: 100%;
|
|
792
792
|
min-height: 100%;
|
|
793
793
|
position: relative;
|
|
@@ -795,13 +795,13 @@ data[data-v-5f91f598] {
|
|
|
795
795
|
align-items: center;
|
|
796
796
|
justify-content: center;
|
|
797
797
|
}
|
|
798
|
-
.fileUploadWrap[style*="height: auto"] .single-image-item-preview[data-v-
|
|
798
|
+
.fileUploadWrap[style*="height: auto"] .single-image-item-preview[data-v-3d733095] {
|
|
799
799
|
min-height: 215px;
|
|
800
800
|
}
|
|
801
|
-
.fileUploadWrap[style*="height: auto"] .single-preview[data-v-
|
|
801
|
+
.fileUploadWrap[style*="height: auto"] .single-preview[data-v-3d733095] {
|
|
802
802
|
margin: 0rem !important;
|
|
803
803
|
}
|
|
804
|
-
.single-preview[data-v-
|
|
804
|
+
.single-preview[data-v-3d733095]{
|
|
805
805
|
border-radius: var(--input-border-radius);
|
|
806
806
|
margin: 1rem;
|
|
807
807
|
padding: 0px;
|
|
@@ -811,17 +811,17 @@ data[data-v-5f91f598] {
|
|
|
811
811
|
background: var(--bgl-gray-light);
|
|
812
812
|
box-shadow: 0 0 10px #00000012;
|
|
813
813
|
}
|
|
814
|
-
.bgl_fill-image.single-image-item-preview[data-v-
|
|
814
|
+
.bgl_fill-image.single-image-item-preview[data-v-3d733095] {
|
|
815
815
|
height: 100%;
|
|
816
816
|
}
|
|
817
|
-
.bgl_fill-image.single-image-item-preview .single-preview[data-v-
|
|
817
|
+
.bgl_fill-image.single-image-item-preview .single-preview[data-v-3d733095]{
|
|
818
818
|
border-radius: unset;
|
|
819
819
|
object-fit: cover;
|
|
820
820
|
box-shadow: unset;
|
|
821
821
|
width: 100%;
|
|
822
822
|
height: auto;
|
|
823
823
|
}
|
|
824
|
-
.single-image-item-preview .pie[data-v-
|
|
824
|
+
.single-image-item-preview .pie[data-v-3d733095] {
|
|
825
825
|
transform-origin: top;
|
|
826
826
|
transform: scale(1.4);
|
|
827
827
|
position: absolute;
|
|
@@ -835,31 +835,31 @@ data[data-v-5f91f598] {
|
|
|
835
835
|
border: none !important;
|
|
836
836
|
padding: 0 !important;
|
|
837
837
|
}
|
|
838
|
-
.bgl_oval-upload[data-v-
|
|
838
|
+
.bgl_oval-upload[data-v-3d733095] {
|
|
839
839
|
border-radius: 100% !important;
|
|
840
840
|
overflow: hidden;
|
|
841
841
|
}
|
|
842
|
-
.bgl_oval-upload p[data-v-
|
|
842
|
+
.bgl_oval-upload p[data-v-3d733095] {
|
|
843
843
|
padding: 0.75rem !important;
|
|
844
844
|
font-size: 12px
|
|
845
845
|
}
|
|
846
|
-
.bgl_oval-upload .fileUploadPlaceHolder[data-v-
|
|
846
|
+
.bgl_oval-upload .fileUploadPlaceHolder[data-v-3d733095]{
|
|
847
847
|
top: 0;
|
|
848
848
|
}
|
|
849
|
-
.bgl_oval-upload .pie[data-v-
|
|
849
|
+
.bgl_oval-upload .pie[data-v-3d733095] {
|
|
850
850
|
transform: scale(1);
|
|
851
851
|
}
|
|
852
|
-
.bgl_oval-upload span.bgl_icon-font.color-primary[data-v-
|
|
852
|
+
.bgl_oval-upload span.bgl_icon-font.color-primary[data-v-3d733095] {
|
|
853
853
|
transform: scale(0.4) !important;
|
|
854
854
|
}
|
|
855
|
-
.bgl_oval-upload .single-image-item-preview[data-v-
|
|
855
|
+
.bgl_oval-upload .single-image-item-preview[data-v-3d733095]{
|
|
856
856
|
height: 100%;
|
|
857
857
|
}
|
|
858
|
-
.bgl_oval-upload .single-preview[data-v-
|
|
858
|
+
.bgl_oval-upload .single-preview[data-v-3d733095] {
|
|
859
859
|
margin: 0;
|
|
860
860
|
height: 100% !important;
|
|
861
861
|
}
|
|
862
|
-
.pie[data-v-
|
|
862
|
+
.pie[data-v-3d733095] {
|
|
863
863
|
width: 30px;
|
|
864
864
|
height: 30px;
|
|
865
865
|
position: relative;
|
|
@@ -867,7 +867,7 @@ data[data-v-5f91f598] {
|
|
|
867
867
|
align-items: center;
|
|
868
868
|
justify-content: center;
|
|
869
869
|
}
|
|
870
|
-
.pie[data-v-
|
|
870
|
+
.pie[data-v-3d733095]:before {
|
|
871
871
|
content: '';
|
|
872
872
|
position: absolute;
|
|
873
873
|
border-radius: 50%;
|
|
@@ -885,26 +885,26 @@ data[data-v-5f91f598] {
|
|
|
885
885
|
#000 calc(100% - var(--b))
|
|
886
886
|
);
|
|
887
887
|
}
|
|
888
|
-
.pie .success[data-v-
|
|
888
|
+
.pie .success[data-v-3d733095] {
|
|
889
889
|
transform: scale(0);
|
|
890
890
|
opacity: 0;
|
|
891
891
|
transition: all 0.3s ease-in-out;
|
|
892
892
|
}
|
|
893
|
-
.pie .progress[data-v-
|
|
893
|
+
.pie .progress[data-v-3d733095] {
|
|
894
894
|
position: absolute;
|
|
895
895
|
font-size: 10px;
|
|
896
896
|
}
|
|
897
|
-
.pie.complete .progress[data-v-
|
|
897
|
+
.pie.complete .progress[data-v-3d733095] {
|
|
898
898
|
display: none;
|
|
899
899
|
}
|
|
900
|
-
.pie.complete .success[data-v-
|
|
900
|
+
.pie.complete .success[data-v-3d733095] {
|
|
901
901
|
transform: scale(1.3);
|
|
902
902
|
opacity: 1;
|
|
903
903
|
}
|
|
904
|
-
.pie.complete[data-v-
|
|
904
|
+
.pie.complete[data-v-3d733095]:before {
|
|
905
905
|
background: conic-gradient(var(--bgl-green) calc(var(--p) * 1%), #0000 0);
|
|
906
906
|
}
|
|
907
|
-
.pie.complete[data-v-
|
|
907
|
+
.pie.complete[data-v-3d733095] {
|
|
908
908
|
color: var(--bgl-green);
|
|
909
909
|
}
|
|
910
910
|
|
|
@@ -1190,10 +1190,10 @@ p {
|
|
|
1190
1190
|
}
|
|
1191
1191
|
.resize-observer[data-v-b329ee4c]{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;border:none;background-color:transparent;pointer-events:none;display:block;overflow:hidden;opacity:0}.resize-observer[data-v-b329ee4c] object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}.v-popper__popper{z-index:10000;top:0;left:0;outline:none}.v-popper__popper.v-popper__popper--hidden{visibility:hidden;opacity:0;transition:opacity .15s,visibility .15s;pointer-events:none}.v-popper__popper.v-popper__popper--shown{visibility:visible;opacity:1;transition:opacity .15s}.v-popper__popper.v-popper__popper--skip-transition,.v-popper__popper.v-popper__popper--skip-transition>.v-popper__wrapper{transition:none!important}.v-popper__backdrop{position:absolute;top:0;left:0;width:100%;height:100%;display:none}.v-popper__inner{position:relative;box-sizing:border-box;overflow-y:auto}.v-popper__inner>div{position:relative;z-index:1;max-width:inherit;max-height:inherit}.v-popper__arrow-container{position:absolute;width:10px;height:10px}.v-popper__popper--arrow-overflow .v-popper__arrow-container,.v-popper__popper--no-positioning .v-popper__arrow-container{display:none}.v-popper__arrow-inner,.v-popper__arrow-outer{border-style:solid;position:absolute;top:0;left:0;width:0;height:0}.v-popper__arrow-inner{visibility:hidden;border-width:7px}.v-popper__arrow-outer{border-width:6px}.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-inner{left:-2px}.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-outer,.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-outer{left:-1px}.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-outer{border-bottom-width:0;border-left-color:transparent!important;border-right-color:transparent!important;border-bottom-color:transparent!important}.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-inner{top:-2px}.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-container{top:0}.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-outer{border-top-width:0;border-left-color:transparent!important;border-right-color:transparent!important;border-top-color:transparent!important}.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-inner{top:-4px}.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-outer{top:-6px}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-inner{top:-2px}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-outer,.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-outer{top:-1px}.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-outer{border-left-width:0;border-left-color:transparent!important;border-top-color:transparent!important;border-bottom-color:transparent!important}.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-inner{left:-4px}.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-outer{left:-6px}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-container{right:-10px}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-outer{border-right-width:0;border-top-color:transparent!important;border-right-color:transparent!important;border-bottom-color:transparent!important}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-inner{left:-2px}.v-popper--theme-tooltip .v-popper__inner{background:rgba(0,0,0,.8);color:#fff;border-radius:6px;padding:7px 12px 6px}.v-popper--theme-tooltip .v-popper__arrow-outer{border-color:#000c}.v-popper--theme-dropdown .v-popper__inner{background:#fff;color:#000;border-radius:6px;border:1px solid #ddd;box-shadow:0 6px 30px #0000001a}.v-popper--theme-dropdown .v-popper__arrow-inner{visibility:visible;border-color:#fff}.v-popper--theme-dropdown .v-popper__arrow-outer{border-color:#ddd}
|
|
1192
1192
|
|
|
1193
|
-
.selectinput[data-v-
|
|
1193
|
+
.selectinput[data-v-949f4227] {
|
|
1194
1194
|
width: 100%;
|
|
1195
1195
|
}
|
|
1196
|
-
.selectinput-option[data-v-
|
|
1196
|
+
.selectinput-option[data-v-949f4227] {
|
|
1197
1197
|
padding: 6px 12px;
|
|
1198
1198
|
cursor: pointer;
|
|
1199
1199
|
border-radius: 5px;
|
|
@@ -1205,23 +1205,23 @@ p {
|
|
|
1205
1205
|
font-size: var(--input-font-size);
|
|
1206
1206
|
margin-block: 0.15rem;
|
|
1207
1207
|
}
|
|
1208
|
-
.selectinput-option .bgl_icon-font[data-v-
|
|
1208
|
+
.selectinput-option .bgl_icon-font[data-v-949f4227]{
|
|
1209
1209
|
line-height: normal;
|
|
1210
1210
|
}
|
|
1211
|
-
.selectinput-options.multiselect .selectinput-option[data-v-
|
|
1211
|
+
.selectinput-options.multiselect .selectinput-option[data-v-949f4227] {
|
|
1212
1212
|
grid-template-columns: 10px 1fr;
|
|
1213
1213
|
}
|
|
1214
|
-
.selectinput-options[data-v-
|
|
1214
|
+
.selectinput-options[data-v-949f4227] {
|
|
1215
1215
|
max-height: 300px;
|
|
1216
1216
|
overflow-y: auto;
|
|
1217
1217
|
}
|
|
1218
|
-
.selectinput-option[data-v-
|
|
1218
|
+
.selectinput-option[data-v-949f4227]:hover {
|
|
1219
1219
|
background: var(--bgl-gray-20);
|
|
1220
1220
|
}
|
|
1221
|
-
.isEmpty p[data-v-
|
|
1221
|
+
.isEmpty p[data-v-949f4227] {
|
|
1222
1222
|
opacity: 0.3;
|
|
1223
1223
|
}
|
|
1224
|
-
.selected[data-v-
|
|
1224
|
+
.selected[data-v-949f4227]{
|
|
1225
1225
|
/* background: var(--bgl-primary-tint); */
|
|
1226
1226
|
background: var(--bgl-selected);
|
|
1227
1227
|
}
|
|
@@ -1733,7 +1733,7 @@ p {
|
|
|
1733
1733
|
gap: 0;
|
|
1734
1734
|
}
|
|
1735
1735
|
|
|
1736
|
-
.bgl_bottombar[data-v-
|
|
1736
|
+
.bgl_bottombar[data-v-557bcad0] {
|
|
1737
1737
|
background-color: var(--bgl-primary);
|
|
1738
1738
|
color: var(--bgl-light-text);
|
|
1739
1739
|
grid-template-columns: repeat(auto-fill, var(--bgl_bottombar-btn-width));
|
|
@@ -1742,16 +1742,16 @@ p {
|
|
|
1742
1742
|
padding: 0;
|
|
1743
1743
|
--bgl_bottombar-btn-width: 62px;
|
|
1744
1744
|
}
|
|
1745
|
-
.bgl_bottombar[data-v-
|
|
1745
|
+
.bgl_bottombar[data-v-557bcad0]>* {
|
|
1746
1746
|
width: var(--bgl_bottombar-btn-width);
|
|
1747
1747
|
}
|
|
1748
|
-
.bgl_bottombar[data-v-
|
|
1748
|
+
.bgl_bottombar[data-v-557bcad0]::-webkit-scrollbar {
|
|
1749
1749
|
display: none;
|
|
1750
1750
|
}
|
|
1751
|
-
.bgl_bottombar .nav-button[data-v-
|
|
1751
|
+
.bgl_bottombar .nav-button[data-v-557bcad0] {
|
|
1752
1752
|
border-radius: var(--card-border-radius);
|
|
1753
1753
|
}
|
|
1754
|
-
.bgl_bottombar .router-link-active[data-v-
|
|
1754
|
+
.bgl_bottombar .router-link-active[data-v-557bcad0] {
|
|
1755
1755
|
background: var(--bgl-popup-bg);
|
|
1756
1756
|
color: var(--bgl-primary) !important;
|
|
1757
1757
|
}
|
|
@@ -8693,15 +8693,17 @@ select {
|
|
|
8693
8693
|
.list-leave-active {
|
|
8694
8694
|
position: absolute;
|
|
8695
8695
|
}
|
|
8696
|
+
body:has([class*="slide-fade"])::-webkit-scrollbar {
|
|
8697
|
+
width: 0em !important;
|
|
8698
|
+
height: 0em !important;
|
|
8699
|
+
}
|
|
8696
8700
|
.slide-fade-enter-active {
|
|
8697
8701
|
transition: all 0.15s ease-out;
|
|
8698
8702
|
overflow: hidden;
|
|
8699
|
-
|
|
8700
8703
|
}
|
|
8701
8704
|
.slide-fade-leave-active {
|
|
8702
8705
|
transition: all 0.15s ease-in;
|
|
8703
8706
|
overflow: hidden;
|
|
8704
|
-
|
|
8705
8707
|
}
|
|
8706
8708
|
.slide-fade-enter-from {
|
|
8707
8709
|
transform: translateX(20px);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bagelink/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.807",
|
|
5
5
|
"description": "Bagel core sdk packages",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Neveh Allon",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@types/leaflet": "^1.9.12",
|
|
55
55
|
"@types/signature_pad": "^2.3.6",
|
|
56
56
|
"@vue-macros/reactivity-transform": "^1.1.1",
|
|
57
|
-
"vue": "^3.5.
|
|
57
|
+
"vue": "^3.5.12"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@bagelink/sdk": "*",
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import { Btn, IMAGE_FORMATS_REGEXP, Icon, type StorageFile, useBagel } from '@bagelink/vue'
|
|
3
3
|
import { onMounted, watch } from 'vue'
|
|
4
4
|
|
|
5
|
+
type StrKey = keyof StorageFile
|
|
6
|
+
|
|
7
|
+
type FSValue = string[] | string | number
|
|
8
|
+
|
|
5
9
|
const props = defineProps<{
|
|
6
10
|
label?: string
|
|
7
11
|
multiple?: boolean
|
|
@@ -17,6 +21,8 @@ const props = defineProps<{
|
|
|
17
21
|
|
|
18
22
|
const emit = defineEmits(['update:modelValue', 'addFileStart'])
|
|
19
23
|
|
|
24
|
+
const bindKey: StrKey = props.bindkey || 'id'
|
|
25
|
+
|
|
20
26
|
const bagel = useBagel()
|
|
21
27
|
|
|
22
28
|
interface QueueFile {
|
|
@@ -27,12 +33,6 @@ interface QueueFile {
|
|
|
27
33
|
uploaded?: boolean
|
|
28
34
|
}
|
|
29
35
|
|
|
30
|
-
type StrKey = keyof StorageFile
|
|
31
|
-
|
|
32
|
-
type FSValue = string[] | string | number
|
|
33
|
-
|
|
34
|
-
const bindKey: StrKey = props.bindkey || 'id'
|
|
35
|
-
|
|
36
36
|
const isImage = (str: string) => IMAGE_FORMATS_REGEXP.test(str)
|
|
37
37
|
|
|
38
38
|
let file_bindkeys = $ref<FSValue>(props.modelValue || [])
|
|
@@ -37,10 +37,10 @@ const searchInput = $ref<HTMLInputElement | null>(null)
|
|
|
37
37
|
let selectedItems = $ref<Option[]>([])
|
|
38
38
|
|
|
39
39
|
const selectedItemCount = $computed(() => selectedItems.length ?? 0)
|
|
40
|
-
let search = $ref('')
|
|
40
|
+
let search = $ref<string>('')
|
|
41
41
|
|
|
42
42
|
const dropdown = $ref<InstanceType<typeof Dropdown> | null>(null)
|
|
43
|
-
|
|
43
|
+
let selected = $ref(false)
|
|
44
44
|
let open = $ref(false)
|
|
45
45
|
|
|
46
46
|
function openOptions() {
|
|
@@ -48,18 +48,7 @@ function openOptions() {
|
|
|
48
48
|
// updateOpen(true);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
open = visible
|
|
53
|
-
if (!open) { search = '' }
|
|
54
|
-
else {
|
|
55
|
-
setTimeout(
|
|
56
|
-
() => (searchInput as any)?.$el?.querySelector('input')?.focus(),
|
|
57
|
-
100,
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const selectedLabel = $computed(() => {
|
|
51
|
+
const selectedLabel = $computed((): string => {
|
|
63
52
|
if (selectedItemCount === 0) return props.placeholder || 'Select'
|
|
64
53
|
if (selectedItemCount > 4) {
|
|
65
54
|
const str = selectedItems
|
|
@@ -71,6 +60,38 @@ const selectedLabel = $computed(() => {
|
|
|
71
60
|
return selectedItems.map(item => getLabel(item)).join(', ')
|
|
72
61
|
})
|
|
73
62
|
|
|
63
|
+
const filteredOptions = $computed(() => props.options.filter((option) => {
|
|
64
|
+
const searchTerm = search
|
|
65
|
+
.split(/\s+/)
|
|
66
|
+
.filter(Boolean)
|
|
67
|
+
.map(t => new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'gi'))
|
|
68
|
+
return (
|
|
69
|
+
Boolean(option)
|
|
70
|
+
&& (searchTerm.every(s => getLabel(option).match(s))
|
|
71
|
+
)
|
|
72
|
+
)
|
|
73
|
+
}))
|
|
74
|
+
|
|
75
|
+
const isSelected = (option: Option) => selectedItems.find(item => getValue(option) === getValue(item)) !== undefined
|
|
76
|
+
|
|
77
|
+
function updateOpen(visible: boolean) {
|
|
78
|
+
open = visible
|
|
79
|
+
if (!open) {
|
|
80
|
+
if (props.searchable && !props.multiselect && !search && !selected) selectedItems = []
|
|
81
|
+
if (props.searchable && !props.multiselect && search && filteredOptions.length === 1 && !isSelected(filteredOptions[0])) {
|
|
82
|
+
select(filteredOptions[0])
|
|
83
|
+
}
|
|
84
|
+
search = ''
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
if (props.searchable && !props.multiselect && selectedItemCount) search = selectedLabel as string
|
|
88
|
+
setTimeout(
|
|
89
|
+
() => (searchInput as any)?.$el?.querySelector('input')?.focus(),
|
|
90
|
+
150,
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
74
95
|
function getLabel(option: Option) {
|
|
75
96
|
if (!option) return ''
|
|
76
97
|
if (typeof option === 'string') return option
|
|
@@ -85,21 +106,8 @@ function getValue(option?: Option) {
|
|
|
85
106
|
return option.value
|
|
86
107
|
}
|
|
87
108
|
|
|
88
|
-
const isSelected = (option: Option) => selectedItems.find(item => getValue(option) === getValue(item)) !== undefined
|
|
89
|
-
|
|
90
|
-
const filteredOptions = $computed(() => props.options.filter((option) => {
|
|
91
|
-
const searchTerm = search
|
|
92
|
-
.split(/\s+/)
|
|
93
|
-
.filter(Boolean)
|
|
94
|
-
.map(t => new RegExp(t, 'gi'))
|
|
95
|
-
return (
|
|
96
|
-
Boolean(option)
|
|
97
|
-
&& (searchTerm.every(s => getLabel(option).match(s))
|
|
98
|
-
)
|
|
99
|
-
)
|
|
100
|
-
}))
|
|
101
|
-
|
|
102
109
|
function select(option: Option) {
|
|
110
|
+
selected = true
|
|
103
111
|
const existingIndex = selectedItems.findIndex(
|
|
104
112
|
item => getValue(item) === getValue(option),
|
|
105
113
|
)
|
|
@@ -191,7 +199,18 @@ onMounted(() => {
|
|
|
191
199
|
<label>
|
|
192
200
|
{{ label }}
|
|
193
201
|
<div class="flex gap-05">
|
|
202
|
+
<TextInput
|
|
203
|
+
v-if="searchable && open"
|
|
204
|
+
ref="searchInput"
|
|
205
|
+
v-model="search"
|
|
206
|
+
class="mb-0"
|
|
207
|
+
dense
|
|
208
|
+
:placeholder="searchPlaceholder"
|
|
209
|
+
icon="search"
|
|
210
|
+
@input="selected = false"
|
|
211
|
+
/>
|
|
194
212
|
<button
|
|
213
|
+
v-else
|
|
195
214
|
:disabled="disabled"
|
|
196
215
|
type="button"
|
|
197
216
|
class="selectinput-btn"
|
|
@@ -234,14 +253,6 @@ onMounted(() => {
|
|
|
234
253
|
class="p-05"
|
|
235
254
|
:style="{ width: fullWidth ? '100%' : 'auto' }"
|
|
236
255
|
>
|
|
237
|
-
<TextInput
|
|
238
|
-
v-if="searchable"
|
|
239
|
-
ref="searchInput"
|
|
240
|
-
v-model="search"
|
|
241
|
-
dense
|
|
242
|
-
:placeholder="searchPlaceholder"
|
|
243
|
-
icon="search"
|
|
244
|
-
/>
|
|
245
256
|
<div class="selectinput-options" :class="{ multiselect }">
|
|
246
257
|
<div
|
|
247
258
|
v-for="(option, i) in filteredOptions"
|
|
@@ -21,8 +21,8 @@ defineProps<{
|
|
|
21
21
|
v-for="(nav, i) in navLinks" :key="i" :to="nav.to" class="m_h-auto"
|
|
22
22
|
@click="nav.onClick"
|
|
23
23
|
>
|
|
24
|
-
<Icon :icon="nav.icon" :size="1.4" class="m-0" />
|
|
25
|
-
<p class="m-0 pb-025
|
|
24
|
+
<Icon :icon="nav.icon" :size="1.4" class="m-0 line-height-14" />
|
|
25
|
+
<p class="m-0 pb-025 txt14 line-height-1">
|
|
26
26
|
{{ nav.label }}
|
|
27
27
|
</p>
|
|
28
28
|
</Btn>
|
|
@@ -56,16 +56,19 @@
|
|
|
56
56
|
position: absolute;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
body:has([class*="slide-fade"])::-webkit-scrollbar {
|
|
60
|
+
width: 0em !important;
|
|
61
|
+
height: 0em !important;
|
|
62
|
+
}
|
|
63
|
+
|
|
59
64
|
.slide-fade-enter-active {
|
|
60
65
|
transition: all 0.15s ease-out;
|
|
61
66
|
overflow: hidden;
|
|
62
|
-
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
.slide-fade-leave-active {
|
|
66
70
|
transition: all 0.15s ease-in;
|
|
67
71
|
overflow: hidden;
|
|
68
|
-
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
.slide-fade-enter-from {
|