@bagelink/vue 0.0.1031 → 0.0.1033

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,7 +1,7 @@
1
1
  import { MaterialIcons } from '../../..';
2
2
  type NumberLayout = 'default' | 'vertical' | 'horizontal';
3
3
  interface NumberInputProps {
4
- modelValue: number;
4
+ modelValue?: number;
5
5
  min?: number;
6
6
  max?: number;
7
7
  step?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/NumberInput.vue"],"names":[],"mappings":"AA4KA,OAAO,EAAQ,KAAK,aAAa,EAAO,MAAM,eAAe,CAAA;AAK7D,KAAK,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,CAAA;AAEzD,UAAU,gBAAgB;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,aAAa,CAAA;IACzB,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;CAChB;;;;;;AAuRD,wBAQG"}
1
+ {"version":3,"file":"NumberInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/NumberInput.vue"],"names":[],"mappings":"AA4KA,OAAO,EAAQ,KAAK,aAAa,EAAO,MAAM,eAAe,C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O,CAAC,EAAE,MAAM,CAAA;CAChB,CAAC;AAmEF,iBAAS,MAAM,SAYd;AA8CD,iBAAS,cAAc;WAyYT,OAAO,IAA6B;;;;;;;;;;;;;;;;;;;;;;YATtB,GAAG;;;;;;;;;;;;;;;;;;;;;;YACI,GAAG;;;;EAarC;AAwBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;YA7iBX,MAAM,GAAG,MAAM;WAIhB,UAAU,GAAG,OAAO;YACnB,MAAM;wFAijBd,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAgBpG,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
@@ -20729,7 +20729,7 @@ const JSONInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_rend
20729
20729
  const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
20730
20730
  __name: "NumberInput",
20731
20731
  props: {
20732
- modelValue: { type: Number, required: true },
20732
+ modelValue: { type: Number, required: false },
20733
20733
  min: { type: Number, required: false },
20734
20734
  max: { type: Number, required: false },
20735
20735
  step: { type: Number, required: false, default: 1 },
@@ -20749,7 +20749,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
20749
20749
  setup(__props, { expose: __expose, emit: __emit }) {
20750
20750
  __expose();
20751
20751
  const emit2 = __emit;
20752
- let numberValue = vue.ref(0);
20752
+ let numberValue = vue.ref(__props.modelValue || 0);
20753
20753
  const btnLayouts = ["horizontal", "vertical"];
20754
20754
  function increment() {
20755
20755
  if (!__props.max || numberValue.value + __props.step <= __props.max) {
@@ -20779,7 +20779,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
20779
20779
  }, { immediate: true });
20780
20780
  vue.watch(() => __props.modelValue, (newVal) => {
20781
20781
  if (newVal !== numberValue.value) {
20782
- numberValue.value = newVal;
20782
+ numberValue.value = newVal || 0;
20783
20783
  }
20784
20784
  }, { immediate: true });
20785
20785
  const __returned__ = { emit: emit2, get numberValue() {
@@ -31860,7 +31860,7 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
31860
31860
  const props2 = __props;
31861
31861
  const emit2 = __emit;
31862
31862
  const bagel = useBagel();
31863
- const fileBaseUrl = vue.computed(() => (props2.baseURL || bagel.fileBaseUrl || "https://files.bagel.design/").replace(/\/$/, ""));
31863
+ const fileBaseUrl = vue.computed(() => (props2.baseURL || bagel.fileBaseUrl || "https://files.bagel.design").replace(/\/$/, ""));
31864
31864
  files.setBaseUrl(bagel.host);
31865
31865
  const fileQueue = vue.ref([]);
31866
31866
  let storageFiles = vue.ref([]);
@@ -31901,7 +31901,7 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
31901
31901
  });
31902
31902
  pk.value.push(data2.path_key);
31903
31903
  } catch (error) {
31904
- console.error(error);
31904
+ console.error("error flushing queue", error);
31905
31905
  }
31906
31906
  }
31907
31907
  fileQueue.value.splice(0, fileQueue.value.length);
@@ -31983,26 +31983,27 @@ const _hoisted_7$3 = {
31983
31983
  key: 0,
31984
31984
  class: "bgl-multi-preview"
31985
31985
  };
31986
- const _hoisted_8$3 = { class: "m-0" };
31987
- const _hoisted_9$2 = { class: "no-margin multi-preview-txt" };
31988
- const _hoisted_10$2 = {
31986
+ const _hoisted_8$3 = ["src"];
31987
+ const _hoisted_9$2 = { class: "m-0" };
31988
+ const _hoisted_10$2 = { class: "no-margin multi-preview-txt" };
31989
+ const _hoisted_11$2 = {
31989
31990
  key: 0,
31990
31991
  class: "progress"
31991
31992
  };
31992
- const _hoisted_11$2 = {
31993
+ const _hoisted_12$1 = {
31993
31994
  key: 1,
31994
31995
  class: "bgl-single-preview"
31995
31996
  };
31996
- const _hoisted_12$1 = { class: "position-start m-05 flex opacity-7 z-99 gap-025" };
31997
- const _hoisted_13$1 = {
31997
+ const _hoisted_13$1 = { class: "position-start m-05 flex opacity-7 z-99 gap-025" };
31998
+ const _hoisted_14 = {
31998
31999
  key: 0,
31999
32000
  class: "h-100"
32000
32001
  };
32001
- const _hoisted_14 = {
32002
+ const _hoisted_15 = {
32002
32003
  key: 0,
32003
32004
  class: "progress"
32004
32005
  };
32005
- const _hoisted_15 = { class: "p-1 flex column hover fileUploadPlaceHolder justify-content-center mb-05" };
32006
+ const _hoisted_16 = { class: "p-1 flex column hover fileUploadPlaceHolder justify-content-center mb-05" };
32006
32007
  function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32007
32008
  const _directive_tooltip = vue.resolveDirective("tooltip");
32008
32009
  const _directive_lightbox = vue.resolveDirective("lightbox");
@@ -32119,19 +32120,19 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32119
32120
  class: vue.normalizeClass(["multi-image-item-preview", { "bgl_fill-image": $props.fill }])
32120
32121
  },
32121
32122
  [
32122
- $setup.isImage(path_key) ? (vue.openBlock(), vue.createBlock($setup["Image"], {
32123
+ $setup.isImage(path_key) ? (vue.openBlock(), vue.createElementBlock("img", {
32123
32124
  key: 0,
32124
32125
  class: "multi-preview",
32125
32126
  src: $setup.pathToUrl(path_key),
32126
32127
  alt: ""
32127
- }, null, 8, ["src"])) : (vue.openBlock(), vue.createBlock($setup["Icon"], {
32128
+ }, null, 8, _hoisted_8$3)) : (vue.openBlock(), vue.createBlock($setup["Icon"], {
32128
32129
  key: 1,
32129
32130
  icon: "description",
32130
32131
  class: "multi-preview"
32131
32132
  })),
32132
32133
  vue.createElementVNode(
32133
32134
  "p",
32134
- _hoisted_8$3,
32135
+ _hoisted_9$2,
32135
32136
  vue.toDisplayString(path_key.split("/").pop()),
32136
32137
  1
32137
32138
  /* TEXT */
@@ -32176,7 +32177,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32176
32177
  })),
32177
32178
  vue.createElementVNode(
32178
32179
  "p",
32179
- _hoisted_9$2,
32180
+ _hoisted_10$2,
32180
32181
  vue.toDisplayString(file.name),
32181
32182
  1
32182
32183
  /* TEXT */
@@ -32190,7 +32191,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32190
32191
  [
32191
32192
  file.progress < 100 ? (vue.openBlock(), vue.createElementBlock(
32192
32193
  "span",
32193
- _hoisted_10$2,
32194
+ _hoisted_11$2,
32194
32195
  vue.toDisplayString(file.progress.toFixed(0)),
32195
32196
  1
32196
32197
  /* TEXT */
@@ -32211,7 +32212,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32211
32212
  128
32212
32213
  /* KEYED_FRAGMENT */
32213
32214
  ))
32214
- ])) : $setup.pathKeys.length > 0 || $setup.fileQueue.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$2, [
32215
+ ])) : $setup.pathKeys.length > 0 || $setup.fileQueue.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$1, [
32215
32216
  (vue.openBlock(true), vue.createElementBlock(
32216
32217
  vue.Fragment,
32217
32218
  null,
@@ -32223,39 +32224,45 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32223
32224
  class: vue.normalizeClass(["single-image-item-preview", { "bgl_fill-image": $props.fill }])
32224
32225
  },
32225
32226
  [
32226
- vue.createElementVNode("div", _hoisted_12$1, [
32227
- (vue.openBlock(true), vue.createElementBlock(
32228
- vue.Fragment,
32227
+ vue.createElementVNode("div", _hoisted_13$1, [
32228
+ vue.withDirectives(vue.createVNode($setup["Btn"], {
32229
+ color: "gray",
32230
+ thin: "",
32231
+ icon: "delete",
32232
+ onClick: ($event) => $setup.removeFile(path_key)
32233
+ }, null, 8, ["onClick"]), [
32234
+ [_directive_tooltip, "Delete"]
32235
+ ]),
32236
+ vue.withDirectives(vue.createVNode(
32237
+ $setup["Btn"],
32238
+ {
32239
+ color: "gray",
32240
+ thin: "",
32241
+ icon: "autorenew",
32242
+ onClick: $setup.browse
32243
+ },
32229
32244
  null,
32230
- vue.renderList([
32231
- { tooltip: "Delete", icon: "delete", onClick: () => $setup.removeFile(path_key) },
32232
- { tooltip: "Replace", icon: "autorenew", onClick: $setup.browse },
32233
- { tooltip: "Download", icon: "download", href: $setup.pathToUrl(path_key), download: path_key.split("/").pop() }
32234
- ], (action) => {
32235
- return vue.withDirectives((vue.openBlock(), vue.createBlock($setup["Btn"], vue.mergeProps({
32236
- key: action.tooltip,
32237
- color: "gray",
32238
- thin: "",
32239
- icon: action.icon,
32240
- ref_for: true
32241
- }, action.href ? { href: action.href, download: action.download, target: "_blank" } : {}, {
32242
- onClick: vue.withModifiers(action.onClick, ["stop"])
32243
- }), null, 16, ["icon", "onClick"])), [
32244
- [_directive_tooltip, action.tooltip]
32245
- ]);
32246
- }),
32247
- 128
32248
- /* KEYED_FRAGMENT */
32249
- ))
32245
+ 512
32246
+ /* NEED_PATCH */
32247
+ ), [
32248
+ [_directive_tooltip, "Replace"]
32249
+ ]),
32250
+ vue.withDirectives(vue.createVNode($setup["Btn"], {
32251
+ color: "gray",
32252
+ thin: "",
32253
+ icon: "download",
32254
+ href: $setup.pathToUrl(path_key),
32255
+ download: path_key.split("/").pop()
32256
+ }, null, 8, ["href", "download"]), [
32257
+ [_directive_tooltip, "Download"]
32258
+ ])
32250
32259
  ]),
32251
- $setup.isImage(path_key) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$1, [
32252
- vue.withDirectives(vue.createVNode($setup["Image"], {
32260
+ $setup.isImage(path_key) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [
32261
+ vue.createVNode($setup["Image"], {
32253
32262
  class: "single-preview",
32254
32263
  src: $setup.pathToUrl(path_key),
32255
32264
  alt: ""
32256
- }, null, 8, ["src"]), [
32257
- [_directive_lightbox, { src: $setup.pathToUrl(path_key), download: true }]
32258
- ])
32265
+ }, null, 8, ["src"])
32259
32266
  ])) : vue.withDirectives((vue.openBlock(), vue.createBlock(
32260
32267
  $setup["Icon"],
32261
32268
  {
@@ -32299,7 +32306,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32299
32306
  [
32300
32307
  file.progress < 100 ? (vue.openBlock(), vue.createElementBlock(
32301
32308
  "span",
32302
- _hoisted_14,
32309
+ _hoisted_15,
32303
32310
  vue.toDisplayString(file.progress.toFixed(0)),
32304
32311
  1
32305
32312
  /* TEXT */
@@ -32334,7 +32341,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32334
32341
  fileQueue: $setup.fileQueue,
32335
32342
  browse: $setup.browse
32336
32343
  }, () => [
32337
- vue.createElementVNode("p", _hoisted_15, [
32344
+ vue.createElementVNode("p", _hoisted_16, [
32338
32345
  vue.createVNode($setup["Icon"], { icon: "upload_2" }),
32339
32346
  _cache[4] || (_cache[4] = vue.createTextVNode(" Drop files here or click to upload "))
32340
32347
  ])
package/dist/index.mjs CHANGED
@@ -20727,7 +20727,7 @@ const JSONInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_rend
20727
20727
  const _sfc_main$F = /* @__PURE__ */ defineComponent({
20728
20728
  __name: "NumberInput",
20729
20729
  props: {
20730
- modelValue: { type: Number, required: true },
20730
+ modelValue: { type: Number, required: false },
20731
20731
  min: { type: Number, required: false },
20732
20732
  max: { type: Number, required: false },
20733
20733
  step: { type: Number, required: false, default: 1 },
@@ -20747,7 +20747,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
20747
20747
  setup(__props, { expose: __expose, emit: __emit }) {
20748
20748
  __expose();
20749
20749
  const emit2 = __emit;
20750
- let numberValue = ref(0);
20750
+ let numberValue = ref(__props.modelValue || 0);
20751
20751
  const btnLayouts = ["horizontal", "vertical"];
20752
20752
  function increment() {
20753
20753
  if (!__props.max || numberValue.value + __props.step <= __props.max) {
@@ -20777,7 +20777,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
20777
20777
  }, { immediate: true });
20778
20778
  watch(() => __props.modelValue, (newVal) => {
20779
20779
  if (newVal !== numberValue.value) {
20780
- numberValue.value = newVal;
20780
+ numberValue.value = newVal || 0;
20781
20781
  }
20782
20782
  }, { immediate: true });
20783
20783
  const __returned__ = { emit: emit2, get numberValue() {
@@ -31858,7 +31858,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
31858
31858
  const props2 = __props;
31859
31859
  const emit2 = __emit;
31860
31860
  const bagel = useBagel();
31861
- const fileBaseUrl = computed(() => (props2.baseURL || bagel.fileBaseUrl || "https://files.bagel.design/").replace(/\/$/, ""));
31861
+ const fileBaseUrl = computed(() => (props2.baseURL || bagel.fileBaseUrl || "https://files.bagel.design").replace(/\/$/, ""));
31862
31862
  files.setBaseUrl(bagel.host);
31863
31863
  const fileQueue = ref([]);
31864
31864
  let storageFiles = ref([]);
@@ -31899,7 +31899,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
31899
31899
  });
31900
31900
  pk.value.push(data2.path_key);
31901
31901
  } catch (error) {
31902
- console.error(error);
31902
+ console.error("error flushing queue", error);
31903
31903
  }
31904
31904
  }
31905
31905
  fileQueue.value.splice(0, fileQueue.value.length);
@@ -31981,26 +31981,27 @@ const _hoisted_7$3 = {
31981
31981
  key: 0,
31982
31982
  class: "bgl-multi-preview"
31983
31983
  };
31984
- const _hoisted_8$3 = { class: "m-0" };
31985
- const _hoisted_9$2 = { class: "no-margin multi-preview-txt" };
31986
- const _hoisted_10$2 = {
31984
+ const _hoisted_8$3 = ["src"];
31985
+ const _hoisted_9$2 = { class: "m-0" };
31986
+ const _hoisted_10$2 = { class: "no-margin multi-preview-txt" };
31987
+ const _hoisted_11$2 = {
31987
31988
  key: 0,
31988
31989
  class: "progress"
31989
31990
  };
31990
- const _hoisted_11$2 = {
31991
+ const _hoisted_12$1 = {
31991
31992
  key: 1,
31992
31993
  class: "bgl-single-preview"
31993
31994
  };
31994
- const _hoisted_12$1 = { class: "position-start m-05 flex opacity-7 z-99 gap-025" };
31995
- const _hoisted_13$1 = {
31995
+ const _hoisted_13$1 = { class: "position-start m-05 flex opacity-7 z-99 gap-025" };
31996
+ const _hoisted_14 = {
31996
31997
  key: 0,
31997
31998
  class: "h-100"
31998
31999
  };
31999
- const _hoisted_14 = {
32000
+ const _hoisted_15 = {
32000
32001
  key: 0,
32001
32002
  class: "progress"
32002
32003
  };
32003
- const _hoisted_15 = { class: "p-1 flex column hover fileUploadPlaceHolder justify-content-center mb-05" };
32004
+ const _hoisted_16 = { class: "p-1 flex column hover fileUploadPlaceHolder justify-content-center mb-05" };
32004
32005
  function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32005
32006
  const _directive_tooltip = resolveDirective("tooltip");
32006
32007
  const _directive_lightbox = resolveDirective("lightbox");
@@ -32117,19 +32118,19 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32117
32118
  class: normalizeClass(["multi-image-item-preview", { "bgl_fill-image": $props.fill }])
32118
32119
  },
32119
32120
  [
32120
- $setup.isImage(path_key) ? (openBlock(), createBlock($setup["Image"], {
32121
+ $setup.isImage(path_key) ? (openBlock(), createElementBlock("img", {
32121
32122
  key: 0,
32122
32123
  class: "multi-preview",
32123
32124
  src: $setup.pathToUrl(path_key),
32124
32125
  alt: ""
32125
- }, null, 8, ["src"])) : (openBlock(), createBlock($setup["Icon"], {
32126
+ }, null, 8, _hoisted_8$3)) : (openBlock(), createBlock($setup["Icon"], {
32126
32127
  key: 1,
32127
32128
  icon: "description",
32128
32129
  class: "multi-preview"
32129
32130
  })),
32130
32131
  createElementVNode(
32131
32132
  "p",
32132
- _hoisted_8$3,
32133
+ _hoisted_9$2,
32133
32134
  toDisplayString(path_key.split("/").pop()),
32134
32135
  1
32135
32136
  /* TEXT */
@@ -32174,7 +32175,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32174
32175
  })),
32175
32176
  createElementVNode(
32176
32177
  "p",
32177
- _hoisted_9$2,
32178
+ _hoisted_10$2,
32178
32179
  toDisplayString(file.name),
32179
32180
  1
32180
32181
  /* TEXT */
@@ -32188,7 +32189,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32188
32189
  [
32189
32190
  file.progress < 100 ? (openBlock(), createElementBlock(
32190
32191
  "span",
32191
- _hoisted_10$2,
32192
+ _hoisted_11$2,
32192
32193
  toDisplayString(file.progress.toFixed(0)),
32193
32194
  1
32194
32195
  /* TEXT */
@@ -32209,7 +32210,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32209
32210
  128
32210
32211
  /* KEYED_FRAGMENT */
32211
32212
  ))
32212
- ])) : $setup.pathKeys.length > 0 || $setup.fileQueue.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_11$2, [
32213
+ ])) : $setup.pathKeys.length > 0 || $setup.fileQueue.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_12$1, [
32213
32214
  (openBlock(true), createElementBlock(
32214
32215
  Fragment,
32215
32216
  null,
@@ -32221,39 +32222,45 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32221
32222
  class: normalizeClass(["single-image-item-preview", { "bgl_fill-image": $props.fill }])
32222
32223
  },
32223
32224
  [
32224
- createElementVNode("div", _hoisted_12$1, [
32225
- (openBlock(true), createElementBlock(
32226
- Fragment,
32225
+ createElementVNode("div", _hoisted_13$1, [
32226
+ withDirectives(createVNode($setup["Btn"], {
32227
+ color: "gray",
32228
+ thin: "",
32229
+ icon: "delete",
32230
+ onClick: ($event) => $setup.removeFile(path_key)
32231
+ }, null, 8, ["onClick"]), [
32232
+ [_directive_tooltip, "Delete"]
32233
+ ]),
32234
+ withDirectives(createVNode(
32235
+ $setup["Btn"],
32236
+ {
32237
+ color: "gray",
32238
+ thin: "",
32239
+ icon: "autorenew",
32240
+ onClick: $setup.browse
32241
+ },
32227
32242
  null,
32228
- renderList([
32229
- { tooltip: "Delete", icon: "delete", onClick: () => $setup.removeFile(path_key) },
32230
- { tooltip: "Replace", icon: "autorenew", onClick: $setup.browse },
32231
- { tooltip: "Download", icon: "download", href: $setup.pathToUrl(path_key), download: path_key.split("/").pop() }
32232
- ], (action) => {
32233
- return withDirectives((openBlock(), createBlock($setup["Btn"], mergeProps({
32234
- key: action.tooltip,
32235
- color: "gray",
32236
- thin: "",
32237
- icon: action.icon,
32238
- ref_for: true
32239
- }, action.href ? { href: action.href, download: action.download, target: "_blank" } : {}, {
32240
- onClick: withModifiers(action.onClick, ["stop"])
32241
- }), null, 16, ["icon", "onClick"])), [
32242
- [_directive_tooltip, action.tooltip]
32243
- ]);
32244
- }),
32245
- 128
32246
- /* KEYED_FRAGMENT */
32247
- ))
32243
+ 512
32244
+ /* NEED_PATCH */
32245
+ ), [
32246
+ [_directive_tooltip, "Replace"]
32247
+ ]),
32248
+ withDirectives(createVNode($setup["Btn"], {
32249
+ color: "gray",
32250
+ thin: "",
32251
+ icon: "download",
32252
+ href: $setup.pathToUrl(path_key),
32253
+ download: path_key.split("/").pop()
32254
+ }, null, 8, ["href", "download"]), [
32255
+ [_directive_tooltip, "Download"]
32256
+ ])
32248
32257
  ]),
32249
- $setup.isImage(path_key) ? (openBlock(), createElementBlock("div", _hoisted_13$1, [
32250
- withDirectives(createVNode($setup["Image"], {
32258
+ $setup.isImage(path_key) ? (openBlock(), createElementBlock("div", _hoisted_14, [
32259
+ createVNode($setup["Image"], {
32251
32260
  class: "single-preview",
32252
32261
  src: $setup.pathToUrl(path_key),
32253
32262
  alt: ""
32254
- }, null, 8, ["src"]), [
32255
- [_directive_lightbox, { src: $setup.pathToUrl(path_key), download: true }]
32256
- ])
32263
+ }, null, 8, ["src"])
32257
32264
  ])) : withDirectives((openBlock(), createBlock(
32258
32265
  $setup["Icon"],
32259
32266
  {
@@ -32297,7 +32304,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32297
32304
  [
32298
32305
  file.progress < 100 ? (openBlock(), createElementBlock(
32299
32306
  "span",
32300
- _hoisted_14,
32307
+ _hoisted_15,
32301
32308
  toDisplayString(file.progress.toFixed(0)),
32302
32309
  1
32303
32310
  /* TEXT */
@@ -32332,7 +32339,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
32332
32339
  fileQueue: $setup.fileQueue,
32333
32340
  browse: $setup.browse
32334
32341
  }, () => [
32335
- createElementVNode("p", _hoisted_15, [
32342
+ createElementVNode("p", _hoisted_16, [
32336
32343
  createVNode($setup["Icon"], { icon: "upload_2" }),
32337
32344
  _cache[4] || (_cache[4] = createTextVNode(" Drop files here or click to upload "))
32338
32345
  ])
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.1031",
4
+ "version": "0.0.1033",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -5,7 +5,7 @@ import { watch } from 'vue'
5
5
  type NumberLayout = 'default' | 'vertical' | 'horizontal'
6
6
 
7
7
  interface NumberInputProps {
8
- modelValue: number
8
+ modelValue?: number
9
9
  min?: number
10
10
  max?: number
11
11
  step?: number
@@ -41,7 +41,7 @@ const {
41
41
 
42
42
  const emit = defineEmits(['update:modelValue'])
43
43
 
44
- let numberValue = $ref(0)
44
+ let numberValue = $ref(modelValue || 0)
45
45
 
46
46
  const btnLayouts: NumberLayout[] = ['horizontal', 'vertical']
47
47
 
@@ -81,7 +81,7 @@ watch(() => numberValue, () => {
81
81
 
82
82
  watch(() => modelValue, (newVal) => {
83
83
  if (newVal !== numberValue) {
84
- numberValue = newVal
84
+ numberValue = newVal || 0
85
85
  }
86
86
  }, { immediate: true })
87
87
  </script>
@@ -26,9 +26,8 @@ const props = withDefaults(defineProps<{
26
26
  })
27
27
 
28
28
  const emit = defineEmits(['update:modelValue', 'addFileStart'])
29
-
30
29
  const bagel = useBagel()
31
- const fileBaseUrl = $computed(() => (props.baseURL || bagel.fileBaseUrl || 'https://files.bagel.design/').replace(/\/$/, ''))
30
+ const fileBaseUrl = $computed(() => (props.baseURL || bagel.fileBaseUrl || 'https://files.bagel.design').replace(/\/$/, ''))
32
31
 
33
32
  files.setBaseUrl(bagel.host)
34
33
 
@@ -79,7 +78,7 @@ async function flushQueue() {
79
78
  })
80
79
  pk.push(data.path_key)
81
80
  } catch (error) {
82
- console.error(error)
81
+ console.error('error flushing queue', error)
83
82
  }
84
83
  }
85
84
  fileQueue.splice(0, fileQueue.length)
@@ -220,12 +219,12 @@ watch(() => props.dirPath, () => {
220
219
  class="multi-image-item-preview"
221
220
  :class="{ 'bgl_fill-image': fill }"
222
221
  >
223
- <Image
222
+ <img
224
223
  v-if="isImage(path_key)"
225
224
  class="multi-preview"
226
225
  :src="pathToUrl(path_key)"
227
226
  alt=""
228
- />
227
+ >
229
228
  <Icon v-else icon="description" class="multi-preview" />
230
229
  <p class="m-0">
231
230
  {{ path_key.split('/').pop() }}
@@ -280,23 +279,30 @@ watch(() => props.dirPath, () => {
280
279
  >
281
280
  <div class="position-start m-05 flex opacity-7 z-99 gap-025">
282
281
  <Btn
283
- v-for="action in [
284
- { tooltip: 'Delete', icon: 'delete' as MaterialIcons, onClick: () => removeFile(path_key) },
285
- { tooltip: 'Replace', icon: 'autorenew' as MaterialIcons, onClick: browse },
286
- { tooltip: 'Download', icon: 'download' as MaterialIcons, href: pathToUrl(path_key), download: path_key.split('/').pop() },
287
- ]"
288
- :key="action.tooltip"
289
- v-tooltip="action.tooltip"
282
+ v-tooltip="'Delete'"
283
+ color="gray"
284
+ thin
285
+ icon="delete"
286
+ @click="removeFile(path_key)"
287
+ />
288
+ <Btn
289
+ v-tooltip="'Replace'"
290
+ color="gray"
291
+ thin
292
+ icon="autorenew"
293
+ @click="browse"
294
+ />
295
+ <Btn
296
+ v-tooltip="'Download'"
290
297
  color="gray"
291
298
  thin
292
- :icon="action.icon"
293
- v-bind="action.href ? { href: action.href, download: action.download, target: '_blank' } : {}"
294
- @click.stop="action.onClick"
299
+ icon="download"
300
+ :href="pathToUrl(path_key)"
301
+ :download="path_key.split('/').pop()"
295
302
  />
296
303
  </div>
297
304
  <div v-if="isImage(path_key)" class="h-100">
298
305
  <Image
299
- v-lightbox="{ src: pathToUrl(path_key), download: true }"
300
306
  class="single-preview"
301
307
  :src="pathToUrl(path_key)"
302
308
  alt=""