@stsdti/funky-ui-kit 1.4.1 → 1.4.3

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.
@@ -8064,7 +8064,7 @@ function toPathString(pathArray) {
8064
8064
  }
8065
8065
  }, "");
8066
8066
  }
8067
- function bindOneWay(source, destination, { sourcePath = null, destinationPath = null, immutable = true, immediate = true, deep = true } = {}) {
8067
+ function bindOneWay(source, destination, { sourcePath = null, destinationPath = null, immutable = true, immediate = true, deep = true, transform = null } = {}) {
8068
8068
  if (isReactive(source) || isReactive(destination)) {
8069
8069
  immutable = false;
8070
8070
  }
@@ -8075,17 +8075,18 @@ function bindOneWay(source, destination, { sourcePath = null, destinationPath =
8075
8075
  return immutable ? lodashExports.cloneDeep(val) : val;
8076
8076
  },
8077
8077
  (newValue) => {
8078
+ let result = transform ? transform(newValue) : newValue;
8078
8079
  const rawDestination = unref(destination);
8079
8080
  if (!destinationPath) {
8080
- destination.value = immutable ? lodashExports.cloneDeep(newValue) : newValue;
8081
+ destination.value = immutable ? lodashExports.cloneDeep(result) : result;
8081
8082
  return;
8082
8083
  }
8083
8084
  if (immutable) {
8084
8085
  const cloned = lodashExports.cloneDeep(rawDestination);
8085
- lodashExports.set(cloned, destinationPath, lodashExports.cloneDeep(newValue));
8086
+ lodashExports.set(cloned, destinationPath, lodashExports.cloneDeep(result));
8086
8087
  destination.value = cloned;
8087
8088
  } else {
8088
- lodashExports.set(rawDestination, destinationPath, newValue);
8089
+ lodashExports.set(rawDestination, destinationPath, result);
8089
8090
  }
8090
8091
  },
8091
8092
  { immediate, deep }
@@ -23302,6 +23303,7 @@ function useFileUpload(modelValue, props2, emit) {
23302
23303
  }
23303
23304
  };
23304
23305
  const submitFiles = async (filesList = null) => {
23306
+ var _a3;
23305
23307
  const list = filesList ?? modelValue.value;
23306
23308
  const files = list.filter((f) => appFileNewUtils.isFileInstance(f));
23307
23309
  let shouldReplaceMedia = appFileNewUtils.isMediaInstance(lodashExports.head(localModelValue)) && !props2.isMultiple && files.length === 1;
@@ -23313,7 +23315,8 @@ function useFileUpload(modelValue, props2, emit) {
23313
23315
  response = shouldReplaceMedia ? await appFileNewRepository.updateMedia(lodashExports.head(files), lodashExports.head(localModelValue)) : await appFileNewRepository.uploadMedia(files);
23314
23316
  }
23315
23317
  if (!ResponseUtils.isSuccess(response)) {
23316
- UIUtils.showToastError(shouldReplaceMedia ? "Fișierul nu a putut fi înlocuit." : "Fișierul nu a putut fi încărcat.");
23318
+ const errorMessage = ((_a3 = response == null ? void 0 : response.data) == null ? void 0 : _a3.message) || (shouldReplaceMedia ? "Fișierul nu a putut fi înlocuit." : "Fișierul nu a putut fi încărcat.");
23319
+ UIUtils.showToastError(errorMessage);
23317
23320
  modelValue.value = localModelValue;
23318
23321
  isLoading.value = false;
23319
23322
  return;
@@ -29323,10 +29326,13 @@ function useTableFilters(tableFilters, emits) {
29323
29326
  fromUrl ? filters.value[bagKey] = fromUrl : null;
29324
29327
  }
29325
29328
  }
29326
- const setFilterWithLock = (field, value) => {
29327
- filters.value[field] = value;
29328
- blockedFilters.value = [...blockedFilters.value, field];
29329
- setPayloadIsDisabled(field);
29329
+ const setFilterWithLock = (dictionary) => {
29330
+ const fields = Object.keys(dictionary);
29331
+ Object.assign(filters.value, dictionary);
29332
+ blockedFilters.value = [.../* @__PURE__ */ new Set([...blockedFilters.value, ...fields])];
29333
+ for (const field of fields) {
29334
+ setPayloadIsDisabled(field);
29335
+ }
29330
29336
  };
29331
29337
  const externalContext = {
29332
29338
  // Refs
@@ -81492,7 +81498,13 @@ const _sfc_main$7 = {
81492
81498
  class: "status-icon"
81493
81499
  }, null, 8, ["value"]),
81494
81500
  createTextVNode(" " + toDisplayString(getFileStatusLabel(file)), 1)
81495
- ], 2)
81501
+ ], 2),
81502
+ (openBlock(true), createElementBlock(Fragment, null, renderList(Object.keys(_ctx.$slots), (slotName) => {
81503
+ return renderSlot(_ctx.$slots, slotName, {
81504
+ key: slotName,
81505
+ file
81506
+ });
81507
+ }), 128))
81496
81508
  ])
81497
81509
  ]),
81498
81510
  unref(getStatus2)(file) === unref(fileStatus).uploaded ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
@@ -81503,11 +81515,9 @@ const _sfc_main$7 = {
81503
81515
  index
81504
81516
  }, () => [
81505
81517
  createVNode(_component_app_button, {
81506
- class: "btn-transparent",
81507
- onClick: ($event) => _ctx.$emit(
81508
- action.emit,
81509
- action.name === "removed" ? index : { file, index }
81510
- )
81518
+ disabled: action.name === "removed" && __props.disabled,
81519
+ onClick: ($event) => _ctx.$emit(action.emit, action.name === "removed" ? index : { file, index }),
81520
+ class: "btn-transparent"
81511
81521
  }, {
81512
81522
  icon: withCtx(() => [
81513
81523
  createVNode(_component_app_icon, {
@@ -81515,7 +81525,7 @@ const _sfc_main$7 = {
81515
81525
  }, null, 8, ["value"])
81516
81526
  ]),
81517
81527
  _: 2
81518
- }, 1032, ["onClick"])
81528
+ }, 1032, ["disabled", "onClick"])
81519
81529
  ]);
81520
81530
  }), 64))
81521
81531
  ])) : createCommentVNode("", true)
@@ -81713,7 +81723,7 @@ const _sfc_main$5 = {
81713
81723
  size: 20,
81714
81724
  "stroke-width": 2
81715
81725
  }),
81716
- _cache2[2] || (_cache2[2] = createElementVNode("p", { class: "dropzone__title" }, "Drag & drop sau alege fișiere", -1))
81726
+ _cache2[2] || (_cache2[2] = createElementVNode("p", { class: "dropzone__title" }, "Trage aici sau alege fișiere", -1))
81717
81727
  ]),
81718
81728
  createElementVNode("div", _hoisted_5, [
81719
81729
  createVNode(_component_app_button, {
@@ -81761,29 +81771,29 @@ const _sfc_main$5 = {
81761
81771
  _: 3
81762
81772
  }, 8, ["disabled", "onClick"])) : createCommentVNode("", true)
81763
81773
  ])
81764
- ])
81774
+ ]),
81775
+ unref(fileUpload).hasFiles.value ? (openBlock(), createElementBlock("div", _hoisted_6, [
81776
+ createVNode(_sfc_main$7, {
81777
+ files: modelValue.value,
81778
+ disabled: _ctx.disabled,
81779
+ onRemoved: unref(fileUpload).removeFile,
81780
+ onPreview,
81781
+ onDownload
81782
+ }, createSlots({ _: 2 }, [
81783
+ renderList(Object.keys(_ctx.$slots), (slot) => {
81784
+ return {
81785
+ name: slot,
81786
+ fn: withCtx((scope) => [
81787
+ renderSlot(_ctx.$slots, slot, normalizeProps(guardReactiveProps(scope)))
81788
+ ])
81789
+ };
81790
+ })
81791
+ ]), 1032, ["files", "disabled", "onRemoved"])
81792
+ ], 512)) : createCommentVNode("", true)
81765
81793
  ], 2)
81766
81794
  ]),
81767
81795
  _: 3
81768
- }, 8, ["disabled", "onFilesDropped"]),
81769
- unref(fileUpload).hasFiles.value ? (openBlock(), createElementBlock("div", _hoisted_6, [
81770
- createVNode(_sfc_main$7, {
81771
- files: modelValue.value,
81772
- disabled: _ctx.disabled,
81773
- onRemoved: unref(fileUpload).removeFile,
81774
- onPreview,
81775
- onDownload
81776
- }, createSlots({ _: 2 }, [
81777
- renderList(Object.keys(_ctx.$slots), (slot) => {
81778
- return {
81779
- name: slot,
81780
- fn: withCtx((scope) => [
81781
- renderSlot(_ctx.$slots, slot, normalizeProps(guardReactiveProps(scope)))
81782
- ])
81783
- };
81784
- })
81785
- ]), 1032, ["files", "disabled", "onRemoved"])
81786
- ], 512)) : createCommentVNode("", true)
81796
+ }, 8, ["disabled", "onFilesDropped"])
81787
81797
  ])
81788
81798
  ]),
81789
81799
  _: 3