@bagelink/vue 0.0.346 → 0.0.350

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Btn.vue.d.ts","sourceRoot":"","sources":["../../src/components/Btn.vue"],"names":[],"mappings":"AAqBA;AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2U9D,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAA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AAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AACxD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkXA,wBAAwG;AACxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwYA,wBAAwG;AACxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/SelectInput.vue"],"names":[],"mappings":"AA2BA;AAIA,OAAO,wBAAwB,CAAC;AAOhC,KAAK,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgYhG,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SA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,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
@@ -11,4 +11,5 @@ export { default as RadioPillsInput } from './RadioPillsInput.vue';
11
11
  export { default as FileUpload } from './FileUpload.vue';
12
12
  export { default as ToggleInput } from './ToggleInput.vue';
13
13
  export { default as RichText } from './RichText.vue';
14
+ export { Dropdown } from 'floating-vue';
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.cjs CHANGED
@@ -5148,8 +5148,8 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
5148
5148
  },
5149
5149
  setup(__props) {
5150
5150
  vue.useCssVars((_ctx) => ({
5151
- "f1f27722": computedBackgroundColor.value,
5152
- "b7042aec": cumputedTextColor.value
5151
+ "1c54b131": computedBackgroundColor.value,
5152
+ "12e510cc": cumputedTextColor.value
5153
5153
  }));
5154
5154
  const slots = vue.useSlots();
5155
5155
  const props2 = __props;
@@ -5175,6 +5175,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
5175
5175
  }
5176
5176
  const themes = {
5177
5177
  red: getThemeColors({ backgroundColor: "var(--bgl-red)" }),
5178
+ white: getThemeColors({ backgroundColor: "var(--bgl-white)" }),
5178
5179
  black: getThemeColors({ backgroundColor: "var(--bgl-black)" }),
5179
5180
  green: getThemeColors({ backgroundColor: "var(--bgl-green)", color: "var(--bgl-white)" }),
5180
5181
  primary: getThemeColors({ backgroundColor: "var(--bgl-primary)", color: "var(--bgl-white)" }),
@@ -5232,7 +5233,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
5232
5233
  };
5233
5234
  }
5234
5235
  });
5235
- const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-0c8d9a95"]]);
5236
+ const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-d09a83c5"]]);
5236
5237
  const _hoisted_1$C = { class: "tool-bar" };
5237
5238
  const _hoisted_2$t = { class: "modal-footer mt-3" };
5238
5239
  const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
@@ -6052,13 +6053,17 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
6052
6053
  if (!bglSlider.value || index2 < 0 || index2 > bglSlider.value.children.length - 1)
6053
6054
  return;
6054
6055
  const slider = bglSlider.value;
6055
- const scrollX = slider.offsetWidth * index2;
6056
+ const isRTL = getComputedStyle(bglSlider.value).direction === "rtl";
6057
+ const scrollX = slider.offsetWidth * index2 * (isRTL ? -1 : 1);
6056
6058
  slider.scrollTo({ left: scrollX, behavior: "smooth" });
6057
6059
  activeSlideIndex.value = index2;
6058
6060
  evalHeight();
6059
6061
  };
6060
6062
  vue.watch(() => props2.index, goToSlide);
6061
- vue.watch(activeSlideIndex.value, (index2) => emit2("update:index", index2));
6063
+ vue.watch(
6064
+ () => activeSlideIndex.value,
6065
+ (index2) => emit2("update:index", index2)
6066
+ );
6062
6067
  const scrollEnd = () => {
6063
6068
  const slider = bglSlider.value;
6064
6069
  if (!slider || props2.items !== 1)
@@ -6142,7 +6147,12 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
6142
6147
  style: vue.normalizeStyle({ height: vue.unref(yHeight) })
6143
6148
  }, [
6144
6149
  vue.createElementVNode("div", {
6145
- class: vue.normalizeClass([{ dragging: vue.unref(isDragging), clicking: vue.unref(isPressed), [`slides-${__props.items}`]: true, allowScroll: __props.allowScroll }, "bgl-slider"]),
6150
+ class: vue.normalizeClass([{
6151
+ dragging: vue.unref(isDragging),
6152
+ clicking: vue.unref(isPressed),
6153
+ [`slides-${__props.items}`]: true,
6154
+ allowScroll: __props.allowScroll
6155
+ }, "bgl-slider"]),
6146
6156
  onScrollend: scrollEnd,
6147
6157
  onMousedown: startDragging,
6148
6158
  ref_key: "bglSlider",
@@ -6163,7 +6173,7 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
6163
6173
  };
6164
6174
  }
6165
6175
  });
6166
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-7e8d16cb"]]);
6176
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-068aa914"]]);
6167
6177
  const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
6168
6178
  __name: "BglForm",
6169
6179
  props: {
@@ -15144,13 +15154,17 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
15144
15154
  open.value = visible;
15145
15155
  if (!open.value)
15146
15156
  search.value = "";
15147
- else
15148
- setTimeout(() => {
15149
- var _a2, _b, _c;
15150
- return (_c = (_b = (_a2 = searchInput.value) == null ? void 0 : _a2.$el) == null ? void 0 : _b.querySelector("input")) == null ? void 0 : _c.focus();
15151
- }, 100);
15157
+ else {
15158
+ setTimeout(
15159
+ () => {
15160
+ var _a2, _b, _c;
15161
+ return (_c = (_b = (_a2 = searchInput.value) == null ? void 0 : _a2.$el) == null ? void 0 : _b.querySelector("input")) == null ? void 0 : _c.focus();
15162
+ },
15163
+ 100
15164
+ );
15165
+ }
15152
15166
  }
15153
- const selecteLabel = vue.computed(() => {
15167
+ const selectedLabel = vue.computed(() => {
15154
15168
  if (selectedItems.value.length === 0)
15155
15169
  return props2.placeholder || "Select";
15156
15170
  if (selectedItems.value.length > 4) {
@@ -15174,38 +15188,32 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
15174
15188
  return option2;
15175
15189
  return option2.value;
15176
15190
  };
15177
- const isSelected = (option2) => selectedItems.value.includes(getValue(option2));
15191
+ const isSelected = (option2) => !!selectedItems.value.find((item) => getValue(option2) === getValue(item));
15178
15192
  const filteredOptions = vue.computed(() => props2.options.filter((option2) => {
15179
15193
  const searchTerm = new RegExp(search.value, "gi");
15180
- if (typeof option2 === "string")
15181
- return option2.match(searchTerm);
15182
- if (typeof option2 === "number")
15183
- return `${option2}`.match(searchTerm);
15184
- return option2.label.match(searchTerm);
15194
+ return Boolean(option2) && (getLabel(option2).match(searchTerm) || getValue(option2).match(searchTerm));
15185
15195
  }));
15186
15196
  const select2 = (option2) => {
15187
15197
  var _a2;
15188
- const existingIndex = selectedItems.value.findIndex((item) => {
15189
- if (typeof item === "string" || typeof item === "number")
15190
- return item === option2;
15191
- return item.value === option2;
15192
- });
15198
+ const existingIndex = selectedItems.value.findIndex((item) => getValue(item) === getValue(option2));
15193
15199
  if (existingIndex > -1)
15194
15200
  selectedItems.value.splice(existingIndex, 1);
15195
15201
  else if (props2.multiselect) {
15196
- selectedItems.value.push(getValue(option2));
15202
+ selectedItems.value.push(option2);
15197
15203
  } else {
15198
- selectedItems.value.splice(0, selectedItems.value.length, getValue(option2));
15199
- (_a2 = dropdown.value) == null ? void 0 : _a2.hide();
15204
+ selectedItems.value.splice(0, selectedItems.value.length, option2);
15200
15205
  }
15206
+ if (!props2.multiselect)
15207
+ (_a2 = dropdown.value) == null ? void 0 : _a2.hide();
15201
15208
  emitUpdate();
15202
15209
  };
15203
15210
  function emitUpdate() {
15204
15211
  if (props2.multiselect) {
15205
- emit2("update:modelValue", selectedItems.value);
15212
+ emit2("update:modelValue", selectedItems.value.map(getValue));
15206
15213
  } else {
15207
- selectedItems.value.splice(1, selectedItems.value.length);
15208
- emit2("update:modelValue", selectedItems.value[0]);
15214
+ selectedItems.value.splice(1, selectedItems.value.length - 1);
15215
+ const [item] = selectedItems.value;
15216
+ emit2("update:modelValue", item ? getValue(item) : null);
15209
15217
  }
15210
15218
  }
15211
15219
  function compareArrays(arr1, arr2) {
@@ -15228,6 +15236,19 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
15228
15236
  },
15229
15237
  { immediate: true }
15230
15238
  );
15239
+ vue.watch(() => props2.options, () => {
15240
+ const original = JSON.stringify(selectedItems.value);
15241
+ [...selectedItems.value].forEach((option2, i2) => {
15242
+ const exists = props2.options.find((o2) => getValue(o2) === getValue(option2));
15243
+ if (!exists)
15244
+ selectedItems.value.splice(i2, 1);
15245
+ else
15246
+ selectedItems.value.splice(i2, 1, exists);
15247
+ });
15248
+ const newSelection = JSON.stringify(selectedItems.value);
15249
+ if (original !== newSelection)
15250
+ emitUpdate();
15251
+ });
15231
15252
  return (_ctx, _cache) => {
15232
15253
  return vue.openBlock(), vue.createBlock(vue.unref(kt$1), {
15233
15254
  onHide: _cache[3] || (_cache[3] = ($event) => updateOpen(false)),
@@ -15282,11 +15303,11 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
15282
15303
  onClick: _cache[0] || (_cache[0] = ($event) => updateOpen(true)),
15283
15304
  disabled: _ctx.disabled,
15284
15305
  type: "button",
15285
- class: "selectinput-btn"
15306
+ class: vue.normalizeClass(["selectinput-btn", { isEmpty: selectedItems.value.length === 0 }])
15286
15307
  }, [
15287
- vue.createTextVNode(vue.toDisplayString(selecteLabel.value) + " ", 1),
15288
- vue.createVNode(vue.unref(_sfc_main$H), vue.normalizeProps(vue.guardReactiveProps({ "icon": vue.unref(open) ? "unfold_less" : "unfold_more" })), null, 16)
15289
- ], 8, _hoisted_1$m),
15308
+ vue.createElementVNode("p", null, vue.toDisplayString(selectedLabel.value), 1),
15309
+ vue.createVNode(vue.unref(_sfc_main$H), vue.normalizeProps(vue.guardReactiveProps({ icon: vue.unref(open) ? "unfold_less" : "unfold_more" })), null, 16)
15310
+ ], 10, _hoisted_1$m),
15290
15311
  _ctx.required ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
15291
15312
  key: 0,
15292
15313
  style: { "width": "0", "height": "0", "position": "absolute", "opacity": "0", "z-index": "-1" },
@@ -15302,7 +15323,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
15302
15323
  };
15303
15324
  }
15304
15325
  });
15305
- const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-b6223039"]]);
15326
+ const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-8235eff6"]]);
15306
15327
  /*!
15307
15328
  * vue-draggable-next v2.2.0
15308
15329
  * (c) 2023 Anish George
@@ -45903,6 +45924,7 @@ exports.ColorPicker = _sfc_main$d;
45903
45924
  exports.DataPreview = DataPreview;
45904
45925
  exports.DateInput = _sfc_main$j;
45905
45926
  exports.DatePicker = _sfc_main$c;
45927
+ exports.Dropdown = kt$1;
45906
45928
  exports.FileUpload = FileUpload;
45907
45929
  exports.Icon = _sfc_main$H;
45908
45930
  exports.JSONInput = JSONInput;
package/dist/index.mjs CHANGED
@@ -5146,8 +5146,8 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
5146
5146
  },
5147
5147
  setup(__props) {
5148
5148
  useCssVars((_ctx) => ({
5149
- "f1f27722": computedBackgroundColor.value,
5150
- "b7042aec": cumputedTextColor.value
5149
+ "1c54b131": computedBackgroundColor.value,
5150
+ "12e510cc": cumputedTextColor.value
5151
5151
  }));
5152
5152
  const slots = useSlots();
5153
5153
  const props2 = __props;
@@ -5173,6 +5173,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
5173
5173
  }
5174
5174
  const themes = {
5175
5175
  red: getThemeColors({ backgroundColor: "var(--bgl-red)" }),
5176
+ white: getThemeColors({ backgroundColor: "var(--bgl-white)" }),
5176
5177
  black: getThemeColors({ backgroundColor: "var(--bgl-black)" }),
5177
5178
  green: getThemeColors({ backgroundColor: "var(--bgl-green)", color: "var(--bgl-white)" }),
5178
5179
  primary: getThemeColors({ backgroundColor: "var(--bgl-primary)", color: "var(--bgl-white)" }),
@@ -5230,7 +5231,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
5230
5231
  };
5231
5232
  }
5232
5233
  });
5233
- const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-0c8d9a95"]]);
5234
+ const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-d09a83c5"]]);
5234
5235
  const _hoisted_1$C = { class: "tool-bar" };
5235
5236
  const _hoisted_2$t = { class: "modal-footer mt-3" };
5236
5237
  const _sfc_main$E = /* @__PURE__ */ defineComponent({
@@ -6050,13 +6051,17 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
6050
6051
  if (!bglSlider.value || index2 < 0 || index2 > bglSlider.value.children.length - 1)
6051
6052
  return;
6052
6053
  const slider = bglSlider.value;
6053
- const scrollX = slider.offsetWidth * index2;
6054
+ const isRTL = getComputedStyle(bglSlider.value).direction === "rtl";
6055
+ const scrollX = slider.offsetWidth * index2 * (isRTL ? -1 : 1);
6054
6056
  slider.scrollTo({ left: scrollX, behavior: "smooth" });
6055
6057
  activeSlideIndex.value = index2;
6056
6058
  evalHeight();
6057
6059
  };
6058
6060
  watch(() => props2.index, goToSlide);
6059
- watch(activeSlideIndex.value, (index2) => emit2("update:index", index2));
6061
+ watch(
6062
+ () => activeSlideIndex.value,
6063
+ (index2) => emit2("update:index", index2)
6064
+ );
6060
6065
  const scrollEnd = () => {
6061
6066
  const slider = bglSlider.value;
6062
6067
  if (!slider || props2.items !== 1)
@@ -6140,7 +6145,12 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
6140
6145
  style: normalizeStyle({ height: unref(yHeight) })
6141
6146
  }, [
6142
6147
  createElementVNode("div", {
6143
- class: normalizeClass([{ dragging: unref(isDragging), clicking: unref(isPressed), [`slides-${__props.items}`]: true, allowScroll: __props.allowScroll }, "bgl-slider"]),
6148
+ class: normalizeClass([{
6149
+ dragging: unref(isDragging),
6150
+ clicking: unref(isPressed),
6151
+ [`slides-${__props.items}`]: true,
6152
+ allowScroll: __props.allowScroll
6153
+ }, "bgl-slider"]),
6144
6154
  onScrollend: scrollEnd,
6145
6155
  onMousedown: startDragging,
6146
6156
  ref_key: "bglSlider",
@@ -6161,7 +6171,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
6161
6171
  };
6162
6172
  }
6163
6173
  });
6164
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-7e8d16cb"]]);
6174
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-068aa914"]]);
6165
6175
  const _sfc_main$m = /* @__PURE__ */ defineComponent({
6166
6176
  __name: "BglForm",
6167
6177
  props: {
@@ -15142,13 +15152,17 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
15142
15152
  open.value = visible;
15143
15153
  if (!open.value)
15144
15154
  search.value = "";
15145
- else
15146
- setTimeout(() => {
15147
- var _a2, _b, _c;
15148
- return (_c = (_b = (_a2 = searchInput.value) == null ? void 0 : _a2.$el) == null ? void 0 : _b.querySelector("input")) == null ? void 0 : _c.focus();
15149
- }, 100);
15155
+ else {
15156
+ setTimeout(
15157
+ () => {
15158
+ var _a2, _b, _c;
15159
+ return (_c = (_b = (_a2 = searchInput.value) == null ? void 0 : _a2.$el) == null ? void 0 : _b.querySelector("input")) == null ? void 0 : _c.focus();
15160
+ },
15161
+ 100
15162
+ );
15163
+ }
15150
15164
  }
15151
- const selecteLabel = computed(() => {
15165
+ const selectedLabel = computed(() => {
15152
15166
  if (selectedItems.value.length === 0)
15153
15167
  return props2.placeholder || "Select";
15154
15168
  if (selectedItems.value.length > 4) {
@@ -15172,38 +15186,32 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
15172
15186
  return option2;
15173
15187
  return option2.value;
15174
15188
  };
15175
- const isSelected = (option2) => selectedItems.value.includes(getValue(option2));
15189
+ const isSelected = (option2) => !!selectedItems.value.find((item) => getValue(option2) === getValue(item));
15176
15190
  const filteredOptions = computed(() => props2.options.filter((option2) => {
15177
15191
  const searchTerm = new RegExp(search.value, "gi");
15178
- if (typeof option2 === "string")
15179
- return option2.match(searchTerm);
15180
- if (typeof option2 === "number")
15181
- return `${option2}`.match(searchTerm);
15182
- return option2.label.match(searchTerm);
15192
+ return Boolean(option2) && (getLabel(option2).match(searchTerm) || getValue(option2).match(searchTerm));
15183
15193
  }));
15184
15194
  const select2 = (option2) => {
15185
15195
  var _a2;
15186
- const existingIndex = selectedItems.value.findIndex((item) => {
15187
- if (typeof item === "string" || typeof item === "number")
15188
- return item === option2;
15189
- return item.value === option2;
15190
- });
15196
+ const existingIndex = selectedItems.value.findIndex((item) => getValue(item) === getValue(option2));
15191
15197
  if (existingIndex > -1)
15192
15198
  selectedItems.value.splice(existingIndex, 1);
15193
15199
  else if (props2.multiselect) {
15194
- selectedItems.value.push(getValue(option2));
15200
+ selectedItems.value.push(option2);
15195
15201
  } else {
15196
- selectedItems.value.splice(0, selectedItems.value.length, getValue(option2));
15197
- (_a2 = dropdown.value) == null ? void 0 : _a2.hide();
15202
+ selectedItems.value.splice(0, selectedItems.value.length, option2);
15198
15203
  }
15204
+ if (!props2.multiselect)
15205
+ (_a2 = dropdown.value) == null ? void 0 : _a2.hide();
15199
15206
  emitUpdate();
15200
15207
  };
15201
15208
  function emitUpdate() {
15202
15209
  if (props2.multiselect) {
15203
- emit2("update:modelValue", selectedItems.value);
15210
+ emit2("update:modelValue", selectedItems.value.map(getValue));
15204
15211
  } else {
15205
- selectedItems.value.splice(1, selectedItems.value.length);
15206
- emit2("update:modelValue", selectedItems.value[0]);
15212
+ selectedItems.value.splice(1, selectedItems.value.length - 1);
15213
+ const [item] = selectedItems.value;
15214
+ emit2("update:modelValue", item ? getValue(item) : null);
15207
15215
  }
15208
15216
  }
15209
15217
  function compareArrays(arr1, arr2) {
@@ -15226,6 +15234,19 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
15226
15234
  },
15227
15235
  { immediate: true }
15228
15236
  );
15237
+ watch(() => props2.options, () => {
15238
+ const original = JSON.stringify(selectedItems.value);
15239
+ [...selectedItems.value].forEach((option2, i2) => {
15240
+ const exists = props2.options.find((o2) => getValue(o2) === getValue(option2));
15241
+ if (!exists)
15242
+ selectedItems.value.splice(i2, 1);
15243
+ else
15244
+ selectedItems.value.splice(i2, 1, exists);
15245
+ });
15246
+ const newSelection = JSON.stringify(selectedItems.value);
15247
+ if (original !== newSelection)
15248
+ emitUpdate();
15249
+ });
15229
15250
  return (_ctx, _cache) => {
15230
15251
  return openBlock(), createBlock(unref(kt$1), {
15231
15252
  onHide: _cache[3] || (_cache[3] = ($event) => updateOpen(false)),
@@ -15280,11 +15301,11 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
15280
15301
  onClick: _cache[0] || (_cache[0] = ($event) => updateOpen(true)),
15281
15302
  disabled: _ctx.disabled,
15282
15303
  type: "button",
15283
- class: "selectinput-btn"
15304
+ class: normalizeClass(["selectinput-btn", { isEmpty: selectedItems.value.length === 0 }])
15284
15305
  }, [
15285
- createTextVNode(toDisplayString(selecteLabel.value) + " ", 1),
15286
- createVNode(unref(_sfc_main$H), normalizeProps(guardReactiveProps({ "icon": unref(open) ? "unfold_less" : "unfold_more" })), null, 16)
15287
- ], 8, _hoisted_1$m),
15306
+ createElementVNode("p", null, toDisplayString(selectedLabel.value), 1),
15307
+ createVNode(unref(_sfc_main$H), normalizeProps(guardReactiveProps({ icon: unref(open) ? "unfold_less" : "unfold_more" })), null, 16)
15308
+ ], 10, _hoisted_1$m),
15288
15309
  _ctx.required ? withDirectives((openBlock(), createElementBlock("input", {
15289
15310
  key: 0,
15290
15311
  style: { "width": "0", "height": "0", "position": "absolute", "opacity": "0", "z-index": "-1" },
@@ -15300,7 +15321,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
15300
15321
  };
15301
15322
  }
15302
15323
  });
15303
- const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-b6223039"]]);
15324
+ const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-8235eff6"]]);
15304
15325
  /*!
15305
15326
  * vue-draggable-next v2.2.0
15306
15327
  * (c) 2023 Anish George
@@ -45902,6 +45923,7 @@ export {
45902
45923
  DataPreview,
45903
45924
  _sfc_main$j as DateInput,
45904
45925
  _sfc_main$c as DatePicker,
45926
+ kt$1 as Dropdown,
45905
45927
  FileUpload,
45906
45928
  _sfc_main$H as Icon,
45907
45929
  JSONInput,