sprintify-ui 0.0.16 → 0.0.17

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,5 +1,5 @@
1
1
  import ol from "axios";
2
- import { defineComponent as Y, resolveComponent as he, openBlock as _, createElementBlock as O, normalizeClass as z, createBlock as ie, createCommentVNode as ne, createElementVNode as x, toDisplayString as X, renderSlot as Z, h as ot, unref as S, computed as U, ref as P, watch as Oe, Teleport as Mt, createVNode as K, Transition as Ve, withCtx as W, TransitionGroup as Hn, Fragment as be, renderList as Ie, normalizeStyle as Re, onMounted as $e, withDirectives as je, withModifiers as Pe, vShow as Ze, normalizeProps as Ue, guardReactiveProps as ze, mergeProps as lt, resolveDynamicComponent as Ot, onBeforeUnmount as cn, createTextVNode as He, cloneVNode as ll, inject as Ge, provide as De, watchEffect as Dt, nextTick as Fe, onUnmounted as dn, useSlots as rl, isRef as Jt, vModelText as sl, createStaticVNode as Gn, getCurrentInstance as al, pushScopeId as il, popScopeId as ul, createSlots as cl, vModelSelect as qt, withKeys as dl } from "vue";
2
+ import { defineComponent as Y, resolveComponent as he, openBlock as _, createElementBlock as O, normalizeClass as z, createBlock as ie, createCommentVNode as ne, createElementVNode as x, toDisplayString as X, renderSlot as Z, h as ot, unref as S, computed as U, ref as P, watch as Le, Teleport as Mt, createVNode as K, Transition as Ve, withCtx as W, TransitionGroup as Hn, Fragment as be, renderList as Ie, normalizeStyle as Re, onMounted as $e, withDirectives as je, withModifiers as Pe, vShow as Ze, normalizeProps as Ue, guardReactiveProps as ze, mergeProps as lt, resolveDynamicComponent as Ot, onBeforeUnmount as cn, createTextVNode as He, cloneVNode as ll, inject as Ge, provide as De, watchEffect as Dt, nextTick as Fe, onUnmounted as dn, useSlots as rl, isRef as Jt, vModelText as sl, createStaticVNode as Gn, getCurrentInstance as al, pushScopeId as il, popScopeId as ul, createSlots as cl, vModelSelect as qt, withKeys as dl } from "vue";
3
3
  import { useI18n as Xe, createI18n as fl } from "vue-i18n";
4
4
  import { defineStore as fn } from "pinia";
5
5
  import In from "qs";
@@ -1205,7 +1205,7 @@ if (typeof document < "u" && typeof window < "u") {
1205
1205
  const wr = {
1206
1206
  ...Nt,
1207
1207
  body: ""
1208
- }, Le = Y({
1208
+ }, Me = Y({
1209
1209
  inheritAttrs: !1,
1210
1210
  data() {
1211
1211
  return {
@@ -1303,19 +1303,19 @@ const wr = {
1303
1303
  "bg-green-100": e.color == "success"
1304
1304
  }])
1305
1305
  }, [
1306
- e.color == "danger" ? (_(), ie(S(Le), {
1306
+ e.color == "danger" ? (_(), ie(S(Me), {
1307
1307
  key: 0,
1308
1308
  class: "h-6 w-6 text-red-600",
1309
1309
  icon: "heroicons:exclamation-triangle-20-solid"
1310
- })) : e.color == "warning" ? (_(), ie(S(Le), {
1310
+ })) : e.color == "warning" ? (_(), ie(S(Me), {
1311
1311
  key: 1,
1312
1312
  class: "h-6 w-6 text-yellow-600",
1313
1313
  icon: "heroicons:exclamation-triangle-20-solid"
1314
- })) : e.color == "success" ? (_(), ie(S(Le), {
1314
+ })) : e.color == "success" ? (_(), ie(S(Me), {
1315
1315
  key: 2,
1316
1316
  class: "h-6 w-6 text-green-600",
1317
1317
  icon: "heroicons:check-circle-20-solid"
1318
- })) : (_(), ie(S(Le), {
1318
+ })) : (_(), ie(S(Me), {
1319
1319
  key: 3,
1320
1320
  class: "h-6 w-6 text-primary-600",
1321
1321
  icon: "heroicons:information-circle-20-solid"
@@ -1882,11 +1882,11 @@ function mo() {
1882
1882
  }
1883
1883
  const Ar = {
1884
1884
  key: 0,
1885
- class: "z-dialogs fixed inset-0 h-full w-full bg-black bg-opacity-60"
1885
+ class: "fixed inset-0 z-dialogs h-full w-full bg-black bg-opacity-60"
1886
1886
  }, Er = { class: "flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0" }, Tr = ["onClick"], vo = /* @__PURE__ */ Y({
1887
1887
  __name: "BaseAppDialogs",
1888
1888
  setup(e, { expose: n }) {
1889
- const t = bn(), l = U(() => (console.log(t.dialogs), t.dialogs));
1889
+ const t = bn(), l = U(() => t.dialogs);
1890
1890
  function o(y) {
1891
1891
  y.onConfirm(), s(y);
1892
1892
  }
@@ -1902,7 +1902,7 @@ const Ar = {
1902
1902
  i.value[y.id] = "animate-shake";
1903
1903
  });
1904
1904
  }
1905
- return Oe(
1905
+ return Le(
1906
1906
  () => l.value.length,
1907
1907
  () => {
1908
1908
  l.value.length == 0 ? mo() : ho();
@@ -1940,7 +1940,7 @@ const Ar = {
1940
1940
  return _(), O("div", {
1941
1941
  key: b.id,
1942
1942
  "scroll-lock-target": "",
1943
- class: "z-dialogs fixed inset-0 transform overflow-y-auto"
1943
+ class: "fixed inset-0 z-dialogs transform overflow-y-auto"
1944
1944
  }, [
1945
1945
  x("div", Er, [
1946
1946
  x("div", {
@@ -2139,7 +2139,7 @@ const Ar = {
2139
2139
  value: t.modelValue[t.valueKey],
2140
2140
  option: t.modelValue
2141
2141
  } : null);
2142
- Oe(
2142
+ Le(
2143
2143
  () => C.value,
2144
2144
  () => {
2145
2145
  var v;
@@ -2573,7 +2573,13 @@ const Ar = {
2573
2573
  emits: ["update:modelValue"],
2574
2574
  setup(e, { emit: n }) {
2575
2575
  const t = e, l = me.http, o = P(t.currentModel);
2576
- Oe(
2576
+ Le(
2577
+ () => t.currentModel,
2578
+ (s, i) => {
2579
+ o.value = s;
2580
+ },
2581
+ { deep: !0 }
2582
+ ), Le(
2577
2583
  () => t.modelValue,
2578
2584
  (s, i) => {
2579
2585
  if (s != i && t.showRouteUrl != null) {
@@ -3950,7 +3956,7 @@ var Ce = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backs
3950
3956
  function Ks(e) {
3951
3957
  throw new Error("Unexpected object: " + e);
3952
3958
  }
3953
- var Me = ((e) => (e[e.First = 0] = "First", e[e.Previous = 1] = "Previous", e[e.Next = 2] = "Next", e[e.Last = 3] = "Last", e[e.Specific = 4] = "Specific", e[e.Nothing = 5] = "Nothing", e))(Me || {});
3959
+ var Oe = ((e) => (e[e.First = 0] = "First", e[e.Previous = 1] = "Previous", e[e.Next = 2] = "Next", e[e.Last = 3] = "Last", e[e.Specific = 4] = "Specific", e[e.Nothing = 5] = "Nothing", e))(Oe || {});
3954
3960
  function Hs(e, n) {
3955
3961
  let t = n.resolveItems();
3956
3962
  if (t.length <= 0)
@@ -4218,7 +4224,7 @@ let fa = Y({ name: "Menu", props: { as: { type: [Object, String], default: "temp
4218
4224
  let b = { menuState: l, buttonRef: o, itemsRef: r, items: s, searchQuery: i, activeItemIndex: p, activationTrigger: y, closeMenu: () => {
4219
4225
  l.value = 1, p.value = null;
4220
4226
  }, openMenu: () => l.value = 0, goToItem(I, $, w) {
4221
- let D = C(), h = Hs(I === Me.Specific ? { focus: Me.Specific, id: $ } : { focus: I }, { resolveItems: () => D.items, resolveActiveIndex: () => D.activeItemIndex, resolveId: (T) => T.id, resolveDisabled: (T) => T.dataRef.disabled });
4227
+ let D = C(), h = Hs(I === Oe.Specific ? { focus: Oe.Specific, id: $ } : { focus: I }, { resolveItems: () => D.items, resolveActiveIndex: () => D.activeItemIndex, resolveId: (T) => T.id, resolveDisabled: (T) => T.dataRef.disabled });
4222
4228
  i.value = "", p.value = h, y.value = w != null ? w : 1, s.value = D.items;
4223
4229
  }, search(I) {
4224
4230
  let $ = i.value !== "" ? 0 : 1;
@@ -4254,13 +4260,13 @@ let fa = Y({ name: "Menu", props: { as: { type: [Object, String], default: "temp
4254
4260
  case Ce.ArrowDown:
4255
4261
  C.preventDefault(), C.stopPropagation(), o.openMenu(), Fe(() => {
4256
4262
  var b;
4257
- (b = Se(o.itemsRef)) == null || b.focus({ preventScroll: !0 }), o.goToItem(Me.First);
4263
+ (b = Se(o.itemsRef)) == null || b.focus({ preventScroll: !0 }), o.goToItem(Oe.First);
4258
4264
  });
4259
4265
  break;
4260
4266
  case Ce.ArrowUp:
4261
4267
  C.preventDefault(), C.stopPropagation(), o.openMenu(), Fe(() => {
4262
4268
  var b;
4263
- (b = Se(o.itemsRef)) == null || b.focus({ preventScroll: !0 }), o.goToItem(Me.Last);
4269
+ (b = Se(o.itemsRef)) == null || b.focus({ preventScroll: !0 }), o.goToItem(Oe.Last);
4264
4270
  });
4265
4271
  break;
4266
4272
  }
@@ -4308,15 +4314,15 @@ let fa = Y({ name: "Menu", props: { as: { type: [Object, String], default: "temp
4308
4314
  o.closeMenu(), Io(Se(o.buttonRef));
4309
4315
  break;
4310
4316
  case Ce.ArrowDown:
4311
- return b.preventDefault(), b.stopPropagation(), o.goToItem(Me.Next);
4317
+ return b.preventDefault(), b.stopPropagation(), o.goToItem(Oe.Next);
4312
4318
  case Ce.ArrowUp:
4313
- return b.preventDefault(), b.stopPropagation(), o.goToItem(Me.Previous);
4319
+ return b.preventDefault(), b.stopPropagation(), o.goToItem(Oe.Previous);
4314
4320
  case Ce.Home:
4315
4321
  case Ce.PageUp:
4316
- return b.preventDefault(), b.stopPropagation(), o.goToItem(Me.First);
4322
+ return b.preventDefault(), b.stopPropagation(), o.goToItem(Oe.First);
4317
4323
  case Ce.End:
4318
4324
  case Ce.PageDown:
4319
- return b.preventDefault(), b.stopPropagation(), o.goToItem(Me.Last);
4325
+ return b.preventDefault(), b.stopPropagation(), o.goToItem(Oe.Last);
4320
4326
  case Ce.Escape:
4321
4327
  b.preventDefault(), b.stopPropagation(), o.closeMenu(), Fe(() => {
4322
4328
  var $;
@@ -4365,14 +4371,14 @@ let fa = Y({ name: "Menu", props: { as: { type: [Object, String], default: "temp
4365
4371
  }
4366
4372
  function C() {
4367
4373
  if (e.disabled)
4368
- return o.goToItem(Me.Nothing);
4369
- o.goToItem(Me.Specific, r);
4374
+ return o.goToItem(Oe.Nothing);
4375
+ o.goToItem(Oe.Specific, r);
4370
4376
  }
4371
4377
  function b() {
4372
- e.disabled || i.value || o.goToItem(Me.Specific, r, 0);
4378
+ e.disabled || i.value || o.goToItem(Oe.Specific, r, 0);
4373
4379
  }
4374
4380
  function I() {
4375
- e.disabled || !i.value || o.goToItem(Me.Nothing);
4381
+ e.disabled || !i.value || o.goToItem(Oe.Nothing);
4376
4382
  }
4377
4383
  return () => {
4378
4384
  let { disabled: $ } = e, w = { active: i.value, disabled: $, close: o.closeMenu };
@@ -4750,7 +4756,7 @@ function Bn(e) {
4750
4756
  }
4751
4757
  function jo(e, n, t) {
4752
4758
  const l = P(!1);
4753
- Oe(
4759
+ Le(
4754
4760
  () => e.value,
4755
4761
  () => {
4756
4762
  o();
@@ -4910,12 +4916,12 @@ const Da = { class: "flex min-h-full w-full pt-20 sm:pt-0" }, Va = { class: "min
4910
4916
  ]);
4911
4917
  };
4912
4918
  }
4913
- }), ja = { class: "flex mb-4 space-x-2 empty:mb-0" }, Fa = {
4919
+ }), ja = { class: "mb-4 flex space-x-2 empty:mb-0" }, Fa = {
4914
4920
  key: 0,
4915
4921
  class: "grow"
4916
- }, Na = { class: "relative h-11" }, Pa = { class: "flex pointer-events-none absolute top-0 left-0 h-full items-center justify-center pl-2.5" }, Ra = ["placeholder"], Ua = {
4922
+ }, Na = { class: "relative h-11" }, Pa = { class: "pointer-events-none absolute top-0 left-0 flex h-full items-center justify-center pl-2.5" }, Ra = ["placeholder"], Ua = {
4917
4923
  key: 0,
4918
- class: "flex absolute top-0 right-0 h-full items-center justify-center p-1"
4924
+ class: "absolute top-0 right-0 flex h-full items-center justify-center p-1"
4919
4925
  }, za = { class: "hidden xs:block" }, qa = { class: "mt-5" }, Ka = { class: "text-center text-xs text-slate-400 sm:text-right" }, Ha = { class: "mt-4" }, Ga = {
4920
4926
  key: 0,
4921
4927
  class: "mb-4"
@@ -4985,7 +4991,7 @@ const Da = { class: "flex min-h-full w-full pt-20 sm:pt-0" }, Va = { class: "min
4985
4991
  childList: !0
4986
4992
  }), $e(() => {
4987
4993
  L();
4988
- }), Oe(
4994
+ }), Le(
4989
4995
  () => j.value,
4990
4996
  () => {
4991
4997
  Fe(() => {
@@ -5037,7 +5043,7 @@ const Da = { class: "flex min-h-full w-full pt-20 sm:pt-0" }, Va = { class: "min
5037
5043
  const E = Te(T.value);
5038
5044
  E.page = 1, E.search = w.value, v(E);
5039
5045
  }, 350);
5040
- Oe(
5046
+ Le(
5041
5047
  () => s.query,
5042
5048
  () => {
5043
5049
  fe();
@@ -5152,7 +5158,7 @@ const Da = { class: "flex min-h-full w-full pt-20 sm:pt-0" }, Va = { class: "min
5152
5158
  ])) : ne("", !0),
5153
5159
  S(j) && S(F) ? (_(), O("button", {
5154
5160
  key: 1,
5155
- class: "flex btn h-11 items-center justify-center py-1 text-base shadow-sm",
5161
+ class: "btn flex h-11 items-center justify-center py-1 text-base shadow-sm",
5156
5162
  type: "button",
5157
5163
  onClick: E[3] || (E[3] = (oe) => $.value = !0)
5158
5164
  }, [
@@ -5333,7 +5339,7 @@ const ti = {
5333
5339
  function li(e, n, t, l, o, r) {
5334
5340
  return _(), O("svg", ti, oi);
5335
5341
  }
5336
- const Ro = /* @__PURE__ */ Ee(ei, [["render", li], ["__scopeId", "data-v-945515f9"]]), ri = (e) => (il("data-v-07e72f3e"), e = e(), ul(), e), si = { class: "relative w-full overflow-hidden" }, ai = { class: "flex flex-col" }, ii = { class: "inline-block min-w-full align-middle" }, ui = { class: "relative" }, ci = { class: "min-w-full border-separate border-spacing-0" }, di = {
5342
+ const Ro = /* @__PURE__ */ Ee(ei, [["render", li], ["__scopeId", "data-v-945515f9"]]), ri = (e) => (il("data-v-6e5812c9"), e = e(), ul(), e), si = { class: "relative w-full overflow-hidden" }, ai = { class: "flex flex-col" }, ii = { class: "inline-block min-w-full align-middle" }, ui = { class: "relative min-h-[300px]" }, ci = { class: "min-w-full border-separate border-spacing-0" }, di = {
5337
5343
  key: 0,
5338
5344
  class: "th"
5339
5345
  }, fi = {
@@ -5439,18 +5445,18 @@ const Ro = /* @__PURE__ */ Ee(ei, [["render", li], ["__scopeId", "data-v-945515f
5439
5445
  let M = V.value.length;
5440
5446
  return M += l.checkable ? 1 : 0, M += l.detailed ? 1 : 0, M;
5441
5447
  }), F = U(() => l.detailed);
5442
- Oe(
5448
+ Le(
5443
5449
  () => l.checkedRows,
5444
5450
  (M) => {
5445
5451
  s.value = [...M];
5446
5452
  },
5447
5453
  { deep: !0 }
5448
- ), Oe(
5454
+ ), Le(
5449
5455
  () => l.sortField,
5450
5456
  () => {
5451
5457
  we();
5452
5458
  }
5453
- ), Oe(
5459
+ ), Le(
5454
5460
  () => l.sortDirection,
5455
5461
  () => {
5456
5462
  we();
@@ -5810,7 +5816,7 @@ const Ro = /* @__PURE__ */ Ee(ei, [["render", li], ["__scopeId", "data-v-945515f
5810
5816
  };
5811
5817
  }
5812
5818
  });
5813
- const Uo = /* @__PURE__ */ Ee(Di, [["__scopeId", "data-v-07e72f3e"]]), zo = Y({
5819
+ const Uo = /* @__PURE__ */ Ee(Di, [["__scopeId", "data-v-6e5812c9"]]), zo = Y({
5814
5820
  name: "BaseTableColumn",
5815
5821
  props: {
5816
5822
  label: {
@@ -6079,12 +6085,19 @@ const qi = /* @__PURE__ */ Ee(Ni, [["render", zi]]), Ki = { class: "flex justify
6079
6085
  text: c.data.message,
6080
6086
  color: "success"
6081
6087
  }), t("delete", u), k();
6088
+ }).catch((c) => {
6089
+ var d, v;
6090
+ i.push({
6091
+ title: o.t("sui.error"),
6092
+ text: (v = (d = c.response.data) == null ? void 0 : d.message) != null ? v : "Unknown error",
6093
+ color: "danger"
6094
+ });
6082
6095
  });
6083
6096
  }, h = P([]), V = "sprintify.visible_columns." + window.location.pathname, j = JSON.parse(
6084
6097
  localStorage.getItem(V) + ""
6085
6098
  );
6086
6099
  j && it(j) && j.length > 0 && (h.value = j);
6087
- const F = Oe(
6100
+ const F = Le(
6088
6101
  () => p.value,
6089
6102
  () => {
6090
6103
  p.value && p.value.newColumns.length && h.value.length == 0 && (h.value = p.value.newColumns.filter((u) => !u.optional).map((u) => u.newKey), F());
@@ -6456,7 +6469,7 @@ const qi = /* @__PURE__ */ Ee(Ni, [["render", zi]]), Ki = { class: "flex justify
6456
6469
  month: null,
6457
6470
  day: null
6458
6471
  });
6459
- Oe(
6472
+ Le(
6460
6473
  () => t.modelValue,
6461
6474
  () => {
6462
6475
  if (t.modelValue) {
@@ -6742,7 +6755,7 @@ const ju = /* @__PURE__ */ Ee(Lu, [["render", Vu]]), Fu = {
6742
6755
  const n = e;
6743
6756
  let t = null;
6744
6757
  const l = P(!1);
6745
- return Oe(
6758
+ return Le(
6746
6759
  () => n.modelValue,
6747
6760
  (o) => {
6748
6761
  o ? t = setTimeout(() => {
@@ -7351,6 +7364,13 @@ const ju = /* @__PURE__ */ Ee(Lu, [["render", Vu]]), Fu = {
7351
7364
  emits: ["update:modelValue"],
7352
7365
  setup(e, { emit: n }) {
7353
7366
  const t = e, l = P(t.currentModels);
7367
+ Le(
7368
+ () => t.currentModels,
7369
+ (r, s) => {
7370
+ l.value = r;
7371
+ },
7372
+ { deep: !0 }
7373
+ );
7354
7374
  function o(r) {
7355
7375
  l.value = r, n(
7356
7376
  "update:modelValue",
@@ -7520,15 +7540,15 @@ const sc = /* @__PURE__ */ Ee(oc, [["render", rc]]), ac = ["src", "alt"], ic = [
7520
7540
  class: "h-full w-full bg-black object-contain object-center",
7521
7541
  alt: S(t)
7522
7542
  }, null, 8, ic)) : (_(), O("div", uc, [
7523
- S(o) == "pdf" ? (_(), ie(S(Le), {
7543
+ S(o) == "pdf" ? (_(), ie(S(Me), {
7524
7544
  key: 0,
7525
7545
  class: "max-w-8 h-1/2 max-h-8 w-1/2 text-slate-600",
7526
7546
  icon: "mdi:file-pdf-box"
7527
- })) : S(l) == "image" ? (_(), ie(S(Le), {
7547
+ })) : S(l) == "image" ? (_(), ie(S(Me), {
7528
7548
  key: 1,
7529
7549
  class: "max-w-8 h-1/2 max-h-8 w-1/2 text-slate-600",
7530
7550
  icon: "mdi:camera"
7531
- })) : S(l) == "audio" ? (_(), ie(S(Le), {
7551
+ })) : S(l) == "audio" ? (_(), ie(S(Me), {
7532
7552
  key: 2,
7533
7553
  class: "max-w-8 h-1/2 max-h-8 w-1/2 text-slate-600",
7534
7554
  icon: "mdi:music"
@@ -7553,7 +7573,7 @@ const sc = /* @__PURE__ */ Ee(oc, [["render", rc]]), ac = ["src", "alt"], ic = [
7553
7573
  type: Boolean
7554
7574
  }
7555
7575
  },
7556
- emits: ["delete"],
7576
+ emits: ["remove"],
7557
7577
  setup(e) {
7558
7578
  const n = e, t = U(() => n.media.file_name), l = U(() => Bn(n.media.size)), o = U(() => "url" in n.media ? n.media.url : null);
7559
7579
  return (r, s) => (_(), O("div", dc, [
@@ -7581,9 +7601,9 @@ const sc = /* @__PURE__ */ Ee(oc, [["render", rc]]), ac = ["src", "alt"], ic = [
7581
7601
  x("button", {
7582
7602
  type: "button",
7583
7603
  class: "rounded-full bg-slate-400 p-1 text-white hover:bg-slate-500",
7584
- onClick: s[0] || (s[0] = (i) => r.$emit("delete"))
7604
+ onClick: s[0] || (s[0] = (i) => r.$emit("remove"))
7585
7605
  }, [
7586
- K(S(Le), {
7606
+ K(S(Me), {
7587
7607
  icon: "heroicons:x-mark-20-solid",
7588
7608
  class: "h-4 w-4"
7589
7609
  })
@@ -7595,7 +7615,7 @@ const sc = /* @__PURE__ */ Ee(oc, [["render", rc]]), ac = ["src", "alt"], ic = [
7595
7615
  }), yc = { class: "text-center" }, bc = { class: "mb-0 text-sm font-medium leading-tight" }, wc = { class: "mt-1 text-xs leading-tight text-slate-500" }, xc = { key: 0 }, kc = {
7596
7616
  key: 1,
7597
7617
  class: "mt-5"
7598
- }, Sc = { class: "grid gap-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4" }, _c = /* @__PURE__ */ Y({
7618
+ }, Sc = { class: "-m-1 flex flex-wrap" }, _c = /* @__PURE__ */ Y({
7599
7619
  __name: "BaseMediaLibrary",
7600
7620
  props: {
7601
7621
  modelValue: {
@@ -7731,7 +7751,7 @@ const sc = /* @__PURE__ */ Ee(oc, [["render", rc]]), ac = ["src", "alt"], ic = [
7731
7751
  x("div", {
7732
7752
  class: z(["rounded border border-dashed p-6 duration-150", [
7733
7753
  R.dragging ? "bg-blue-100" : "bg-slate-100",
7734
- R.disabled ? "cursor-not-allowed border-slate-300" : "border-slate-400 hover:bg-slate-50"
7754
+ R.disabled ? "cursor-not-allowed border-slate-300" : "border-slate-300 hover:bg-slate-50"
7735
7755
  ]])
7736
7756
  }, [
7737
7757
  x("div", {
@@ -7739,7 +7759,7 @@ const sc = /* @__PURE__ */ Ee(oc, [["render", rc]]), ac = ["src", "alt"], ic = [
7739
7759
  }, [
7740
7760
  K(F, {
7741
7761
  icon: "heroicons:arrow-up-on-square",
7742
- class: "mx-auto mb-3 h-6 w-6 text-slate-500"
7762
+ class: "mx-auto mb-3 h-6 w-6 text-primary-500"
7743
7763
  }),
7744
7764
  x("div", yc, [
7745
7765
  x("p", bc, X(V.$t("sui.drop_or_click_to_upload")), 1),
@@ -7768,32 +7788,34 @@ const sc = /* @__PURE__ */ Ee(oc, [["render", rc]]), ac = ["src", "alt"], ic = [
7768
7788
  S(s).length + S(i).to_add.length ? (_(), O("div", kc, [
7769
7789
  x("div", Sc, [
7770
7790
  (_(!0), O(be, null, Ie(S(s), (R, k) => (_(), O("div", {
7771
- key: R.id
7791
+ key: R.id,
7792
+ class: "min-w-[220px] flex-1 p-1"
7772
7793
  }, [
7773
7794
  K(un, {
7774
7795
  media: R,
7775
7796
  "show-remove": !e.disabled,
7776
- onDelete: (L) => b(k)
7797
+ onRemove: (L) => b(k)
7777
7798
  }, {
7778
7799
  default: W(() => [
7779
7800
  He(X(R.file_name), 1)
7780
7801
  ]),
7781
7802
  _: 2
7782
- }, 1032, ["media", "show-remove", "onDelete"])
7803
+ }, 1032, ["media", "show-remove", "onRemove"])
7783
7804
  ]))), 128)),
7784
7805
  (_(!0), O(be, null, Ie(S(i).to_add, (R, k) => (_(), O("div", {
7785
- key: R.id
7806
+ key: R.id,
7807
+ class: "min-w-[220px] flex-1 p-1"
7786
7808
  }, [
7787
7809
  K(un, {
7788
7810
  media: R,
7789
7811
  "show-remove": !e.disabled,
7790
- onDelete: (L) => C(k)
7812
+ onRemove: (L) => C(k)
7791
7813
  }, {
7792
7814
  default: W(() => [
7793
7815
  He(X(R.file_name), 1)
7794
7816
  ]),
7795
7817
  _: 2
7796
- }, 1032, ["media", "show-remove", "onDelete"])
7818
+ }, 1032, ["media", "show-remove", "onRemove"])
7797
7819
  ]))), 128))
7798
7820
  ])
7799
7821
  ])) : ne("", !0)
@@ -7947,12 +7969,12 @@ const sc = /* @__PURE__ */ Ee(oc, [["render", rc]]), ac = ["src", "alt"], ic = [
7947
7969
  onClick: s[0] || (s[0] = (i) => t())
7948
7970
  }, [
7949
7971
  Tc,
7950
- S(n) ? (_(), ie(S(Le), {
7972
+ S(n) ? (_(), ie(S(Me), {
7951
7973
  key: 1,
7952
7974
  icon: "heroicons:x-mark",
7953
7975
  class: "block h-6 w-6",
7954
7976
  "aria-hidden": "true"
7955
- })) : (_(), ie(S(Le), {
7977
+ })) : (_(), ie(S(Me), {
7956
7978
  key: 0,
7957
7979
  icon: "heroicons:bars-3",
7958
7980
  class: "block h-6 w-6",
@@ -8008,7 +8030,7 @@ const sc = /* @__PURE__ */ Ee(oc, [["render", rc]]), ac = ["src", "alt"], ic = [
8008
8030
  class: z(S(r))
8009
8031
  }, [
8010
8032
  x("div", Oc, [
8011
- e.icon ? (_(), ie(S(Le), {
8033
+ e.icon ? (_(), ie(S(Me), {
8012
8034
  key: 0,
8013
8035
  icon: e.icon,
8014
8036
  class: z(S(s))
@@ -8127,7 +8149,7 @@ function qc(e, n, t, l, o, r) {
8127
8149
  ], 2);
8128
8150
  }
8129
8151
  const Kc = /* @__PURE__ */ Ee(Nc, [["render", qc]]), Hc = Y({
8130
- components: { BaseIcon: Le },
8152
+ components: { BaseIcon: Me },
8131
8153
  props: {
8132
8154
  modelValue: {
8133
8155
  default: "",
@@ -8338,7 +8360,7 @@ const nd = /* @__PURE__ */ Ee(Zc, [["render", td], ["__scopeId", "data-v-b63fac0
8338
8360
  var w, D;
8339
8361
  return t.modelValue === o ? !0 : [...(D = (w = s.value) == null ? void 0 : w.options) != null ? D : []].findIndex((h) => ml(h.value, t.modelValue)) != -1;
8340
8362
  }
8341
- Oe(
8363
+ Le(
8342
8364
  () => t.modelValue,
8343
8365
  () => b()
8344
8366
  ), $e(() => {
@@ -8423,14 +8445,14 @@ const pd = /* @__PURE__ */ Ee(ad, [["render", fd]]), hd = ["href", "disabled", "
8423
8445
  href: e.disabled ? void 0 : s,
8424
8446
  disabled: e.disabled,
8425
8447
  class: z(["group relative flex items-center px-3 py-1", [
8426
- (e.activeStrategy == "default" ? p : y) ? "font-semibold text-blue-600" : "text-slate-600 hover:text-slate-900",
8448
+ (e.activeStrategy == "default" ? p : y) ? "font-semibold text-primary-600" : "text-slate-600 hover:text-slate-900",
8427
8449
  e.disabled ? "cursor-not-allowed opacity-60" : ""
8428
8450
  ]]),
8429
8451
  onClick: Pe((C) => t(i), ["prevent"])
8430
8452
  }, [
8431
8453
  x("div", {
8432
8454
  class: z(["absolute left-0 top-0 h-full", [
8433
- (e.activeStrategy == "default" ? p : y) ? "w-[2px] bg-blue-600" : "group-hover:w-px group-hover:bg-slate-700"
8455
+ (e.activeStrategy == "default" ? p : y) ? "w-[2px] bg-primary-600" : "group-hover:w-px group-hover:bg-slate-700"
8434
8456
  ]])
8435
8457
  }, null, 2),
8436
8458
  Z(l.$slots, "default")
@@ -8639,14 +8661,14 @@ const Ed = /* @__PURE__ */ Ee(_d, [["render", Ad]]), Td = { role: "presentation"
8639
8661
  x("a", {
8640
8662
  href: o,
8641
8663
  class: z(["group relative inline-block rounded-t-lg px-2 py-3 font-medium", [
8642
- (e.activeStrategy == "default" ? s : i) ? "text-blue-600" : "text-slate-600 hover:text-slate-900",
8664
+ (e.activeStrategy == "default" ? s : i) ? "text-primary-600" : "text-slate-600 hover:text-slate-900",
8643
8665
  e.disabled ? "cursor-not-allowed opacity-60" : ""
8644
8666
  ]]),
8645
8667
  onClick: r
8646
8668
  }, [
8647
8669
  x("div", {
8648
8670
  class: z(["absolute left-0 bottom-0 w-full", [
8649
- (e.activeStrategy == "default" ? s : i) ? "h-[2px] bg-blue-600" : "group-hover:h-px group-hover:bg-slate-700"
8671
+ (e.activeStrategy == "default" ? s : i) ? "h-[2px] bg-primary-600" : "group-hover:h-px group-hover:bg-slate-700"
8650
8672
  ]])
8651
8673
  }, null, 2),
8652
8674
  x("div", Md, [
@@ -8823,7 +8845,7 @@ const Ed = /* @__PURE__ */ Ee(_d, [["render", Ad]]), Td = { role: "presentation"
8823
8845
  BaseFilePicker: qo,
8824
8846
  BaseFileUploader: Ho,
8825
8847
  BaseHasMany: ec,
8826
- BaseIcon: Le,
8848
+ BaseIcon: Me,
8827
8849
  BaseInput: nc,
8828
8850
  BaseInputLabel: sc,
8829
8851
  BaseLoadingCover: Ko,
@@ -8967,7 +8989,7 @@ Cette action est irr\xE9versible.`,
8967
8989
  whoops: "Oups",
8968
8990
  x_rows_selected: `1 item s\xE9lectionn\xE9 |
8969
8991
  {count} items s\xE9lectionn\xE9s`,
8970
- year: "An",
8992
+ year: "Ann\xE9e",
8971
8993
  yes_delete: "Oui, supprimer",
8972
8994
  you_can_upload_up_to_n_files: "Vous pouvez t\xE9l\xE9charger un fichier au maximum|Vous pouvez t\xE9l\xE9charger jusqu'\xE0 {count}\xA0fichiers",
8973
8995
  you_cannot_select_more_than_x_items: "Vous ne pouvez pas s\xE9lectionner plus de un \xE9l\xE9ment|Vous ne pouvez pas s\xE9lectionner plus de {count} \xE9l\xE9ments"
@@ -9057,7 +9079,7 @@ export {
9057
9079
  qo as BaseFilePicker,
9058
9080
  Ho as BaseFileUploader,
9059
9081
  ec as BaseHasMany,
9060
- Le as BaseIcon,
9082
+ Me as BaseIcon,
9061
9083
  nc as BaseInput,
9062
9084
  sc as BaseInputLabel,
9063
9085
  Ko as BaseLoadingCover,
package/dist/style.css CHANGED
@@ -1,4 +1,4 @@
1
- @charset "UTF-8";.spinner[data-v-945515f9]{animation:rotate-945515f9 1s linear infinite;-webkit-animation:rotate-945515f9 1s linear infinite;-moz-animation:rotate-945515f9 1s linear infinite}@keyframes rotate-945515f9{to{transform:rotate(360deg)}}.path[data-v-945515f9]{stroke-dasharray:170;stroke-dashoffset:20}.th[data-v-07e72f3e]{background-color:rgb(248 250 252 / var(--tw-bg-opacity));position:sticky;top:0px;z-index:1;border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity));--tw-bg-opacity: .75;--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}circle[data-v-b63fac0e]{transition:stroke-dashoffset .35s;transform:rotate(-90deg);transform-origin:50% 50%}/*!
1
+ @charset "UTF-8";.spinner[data-v-945515f9]{animation:rotate-945515f9 1s linear infinite;-webkit-animation:rotate-945515f9 1s linear infinite;-moz-animation:rotate-945515f9 1s linear infinite}@keyframes rotate-945515f9{to{transform:rotate(360deg)}}.path[data-v-945515f9]{stroke-dasharray:170;stroke-dashoffset:20}.th[data-v-6e5812c9]{background-color:rgb(248 250 252 / var(--tw-bg-opacity));position:sticky;top:0px;z-index:1;border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity));--tw-bg-opacity: .75;--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}circle[data-v-b63fac0e]{transition:stroke-dashoffset .35s;transform:rotate(-90deg);transform-origin:50% 50%}/*!
2
2
  * Pikaday
3
3
  * Copyright © 2014 David Bushell | BSD & MIT license | https://dbushell.com/
4
4
  */.pika-single{z-index:9999;display:block;position:relative;color:#333;background:#fff;border:1px solid #ccc;border-bottom-color:#bbb;font-family:Helvetica Neue,Helvetica,Arial,sans-serif}.pika-single:before,.pika-single:after{content:" ";display:table}.pika-single:after{clear:both}.pika-single.is-hidden{display:none}.pika-single.is-bound{position:absolute;box-shadow:0 5px 15px -5px #00000080}.pika-lendar{float:left;width:240px;margin:8px}.pika-title{position:relative;text-align:center}.pika-label{display:inline-block;position:relative;z-index:9999;overflow:hidden;margin:0;padding:5px 3px;font-size:14px;line-height:20px;font-weight:700;background-color:#fff}.pika-title select{cursor:pointer;position:absolute;z-index:9998;margin:0;left:0;top:5px;opacity:0}.pika-prev,.pika-next{display:block;cursor:pointer;position:relative;outline:none;border:0;padding:0;width:20px;height:30px;text-indent:20px;white-space:nowrap;overflow:hidden;background-color:transparent;background-position:center center;background-repeat:no-repeat;background-size:75% 75%;opacity:.5}.pika-prev:hover,.pika-next:hover{opacity:1}.pika-prev,.is-rtl .pika-next{float:left;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg==)}.pika-next,.is-rtl .pika-prev{float:right;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=)}.pika-select{display:inline-block}.pika-table{width:100%;border-collapse:collapse;border-spacing:0;border:0}.pika-table th,.pika-table td{width:14.285714285714286%;padding:0}.pika-table th{color:#999;font-size:12px;line-height:25px;font-weight:700;text-align:center}.pika-button{cursor:pointer;display:block;box-sizing:border-box;-moz-box-sizing:border-box;outline:none;border:0;margin:0;width:100%;padding:5px;color:#666;font-size:12px;line-height:15px;text-align:right;background:#f5f5f5;height:initial}.pika-week{font-size:11px;color:#999}.is-today .pika-button{color:#3af;font-weight:700}.is-selected .pika-button,.has-event .pika-button{color:#fff;font-weight:700;background:#33aaff;box-shadow:inset 0 1px 3px #178fe5;border-radius:3px}.has-event .pika-button{background:#005da9;box-shadow:inset 0 1px 3px #0076c9}.is-disabled .pika-button,.is-inrange .pika-button{background:#D5E9F7}.is-startrange .pika-button{color:#fff;background:#6CB31D;box-shadow:none;border-radius:3px}.is-endrange .pika-button{color:#fff;background:#33aaff;box-shadow:none;border-radius:3px}.is-disabled .pika-button{pointer-events:none;cursor:default;color:#999;opacity:.3}.is-outside-current-month .pika-button{color:#999;opacity:.3}.is-selection-disabled{pointer-events:none;cursor:default}.pika-button:hover,.pika-row.pick-whole-week:hover .pika-button{color:#fff;background:#ff8000;box-shadow:none;border-radius:3px}.pika-table abbr{border-bottom:none;cursor:help}.pikaday-white{--backgroundColor: #ffffff;--textColor: #718096;--currentDateTextColor: #3182ce;--selectedDateBackgroundColor: #3182ce;--selectedDateTextColor: #ffffff;--labelTextColor: #4a5568;--weekDaysTextColor: #a0aec0;font-family:inherit;background-color:var(--backgroundColor);padding:.5rem;z-index:2000;margin:6px 0 0;--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);border-radius:.5rem}.pikaday-white .pika-title{width:100%;text-align:center;display:flex;justify-content:flex-start;margin-bottom:5px}.pikaday-white .pika-prev,.pikaday-white .pika-next{position:absolute;outline:none;padding:0;width:26px;height:26px;top:-1px;display:inline-block;margin-top:0;cursor:pointer;text-indent:-9999px;white-space:nowrap;overflow:hidden;background-color:transparent;background-position:center center;background-repeat:no-repeat;opacity:.7}.pikaday-white .pika-prev:hover,.pikaday-white .pika-next:hover{opacity:1}.pikaday-white .pika-prev{right:30px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a0aec0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 19l-7-7 7-7'%3E%3C/path%3E%3C/svg%3E")}.pikaday-white .pika-next{right:2px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a0aec0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5l7 7-7 7'%3E%3C/path%3E%3C/svg%3E")}.pika-prev.is-disabled,.pika-next.is-disabled{cursor:default;opacity:.2}.pikaday-white .pika-label{margin-right:.375rem;border-radius:.25rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity));padding:.25rem .5rem;font-size:14px;font-weight:500;line-height:1}.pikaday-white .pika-label{position:relative}.pikaday-white .pika-select-month,.pikaday-white .pika-select-year{width:100%;cursor:pointer;position:absolute;z-index:9998;margin:0;left:0;top:0;opacity:0;padding:0}.pikaday-white table{width:100%;border-collapse:collapse}.pikaday-white table th{width:2em;height:2em;font-weight:400;color:var(--weekDaysTextColor);text-align:center}.pikaday-white table th abbr{text-decoration:none}.pikaday-white table td{padding:1px}.pikaday-white table td button{width:2em;height:2em;text-align:center;border-radius:9999px;background-color:var(--backgroundColor)}.pikaday-white table td button:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity))}.pikaday-white table td.is-today button{color:var(--currentDateTextColor)}.pikaday-white table td.is-selected button{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity));font-weight:400}.pikaday-white table td button{color:var(--textColor)}input::-moz-placeholder,textarea::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity))}input::placeholder,textarea::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity))}
@@ -10,7 +10,7 @@ declare const _default: import("vue").DefineComponent<{
10
10
  default: boolean;
11
11
  type: BooleanConstructor;
12
12
  };
13
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "delete"[], "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
13
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "remove"[], "remove", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
14
14
  media: {
15
15
  required: true;
16
16
  type: PropType<UploadedFile | Media>;
@@ -20,7 +20,7 @@ declare const _default: import("vue").DefineComponent<{
20
20
  type: BooleanConstructor;
21
21
  };
22
22
  }>> & {
23
- onDelete?: ((...args: any[]) => any) | undefined;
23
+ onRemove?: ((...args: any[]) => any) | undefined;
24
24
  }, {
25
25
  showRemove: boolean;
26
26
  }>;
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
+ "build-fast": "rimraf dist && vite build",
6
7
  "docs:dev": "vitepress dev docs",
7
8
  "docs:build": "vitepress build docs",
8
9
  "docs:serve": "vitepress serve docs",
@@ -11,7 +11,7 @@
11
11
  >
12
12
  <div
13
13
  v-if="dialogs.length"
14
- class="z-dialogs fixed inset-0 h-full w-full bg-black bg-opacity-60"
14
+ class="fixed inset-0 z-dialogs h-full w-full bg-black bg-opacity-60"
15
15
  />
16
16
  </Transition>
17
17
 
@@ -29,7 +29,7 @@
29
29
  v-for="dialog in dialogs"
30
30
  :key="dialog.id"
31
31
  scroll-lock-target
32
- class="z-dialogs fixed inset-0 transform overflow-y-auto"
32
+ class="fixed inset-0 z-dialogs transform overflow-y-auto"
33
33
  >
34
34
  <div
35
35
  class="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"
@@ -68,8 +68,6 @@ import { disableScroll, enableScroll } from '@/utils/scrollPreventer';
68
68
  const dialogStore = useDialogsStore();
69
69
 
70
70
  const dialogs = computed(() => {
71
- console.log(dialogStore.dialogs);
72
-
73
71
  return dialogStore.dialogs;
74
72
  });
75
73
 
@@ -86,6 +86,14 @@ const emit = defineEmits(['update:modelValue']);
86
86
 
87
87
  const model = ref(props.currentModel);
88
88
 
89
+ watch(
90
+ () => props.currentModel,
91
+ (newValue, oldValue) => {
92
+ model.value = newValue;
93
+ },
94
+ { deep: true }
95
+ );
96
+
89
97
  watch(
90
98
  () => props.modelValue,
91
99
  (newValue, oldValue) => {
@@ -11,12 +11,12 @@
11
11
  :class="{ 'col-span-1': !mobileLayout, 'col-span-2': mobileLayout }"
12
12
  >
13
13
  <!-- Header -->
14
- <div class="flex mb-4 space-x-2 empty:mb-0">
14
+ <div class="mb-4 flex space-x-2 empty:mb-0">
15
15
  <!-- Search bar -->
16
16
  <div v-if="searchable" class="grow">
17
17
  <div class="relative h-11">
18
18
  <div
19
- class="flex pointer-events-none absolute top-0 left-0 h-full items-center justify-center pl-2.5"
19
+ class="pointer-events-none absolute top-0 left-0 flex h-full items-center justify-center pl-2.5"
20
20
  >
21
21
  <BaseIcon
22
22
  class="h-6 w-6 text-slate-400"
@@ -33,7 +33,7 @@
33
33
  />
34
34
  <div
35
35
  v-if="searchQuery"
36
- class="flex absolute top-0 right-0 h-full items-center justify-center p-1"
36
+ class="absolute top-0 right-0 flex h-full items-center justify-center p-1"
37
37
  >
38
38
  <button
39
39
  type="button"
@@ -55,7 +55,7 @@
55
55
  <!-- Filters (mobile) -->
56
56
  <button
57
57
  v-if="mobileLayout && hasFilters"
58
- class="flex btn h-11 items-center justify-center py-1 text-base shadow-sm"
58
+ class="btn flex h-11 items-center justify-center py-1 text-base shadow-sm"
59
59
  type="button"
60
60
  @click="showFilters = true"
61
61
  >
@@ -405,19 +405,28 @@ const onDelete = (row: CollectionItem) => {
405
405
  return;
406
406
  }
407
407
 
408
- http.delete(props.deleteUrl(row)).then((response) => {
409
- if (response.data && response.data.message) {
408
+ http
409
+ .delete(props.deleteUrl(row))
410
+ .then((response) => {
411
+ if (response.data && response.data.message) {
412
+ notifications.push({
413
+ title: i18n.t('sui.success'),
414
+ text: response.data.message,
415
+ color: 'success',
416
+ });
417
+ }
418
+ emit('delete', row);
419
+
420
+ // Refetch even if URL is the same
421
+ fetch();
422
+ })
423
+ .catch((error) => {
410
424
  notifications.push({
411
- title: i18n.t('sui.success'),
412
- text: response.data.message,
413
- color: 'success',
425
+ title: i18n.t('sui.error'),
426
+ text: error.response.data?.message ?? 'Unknown error',
427
+ color: 'danger',
414
428
  });
415
- }
416
- emit('delete', row);
417
-
418
- // Refetch even if URL is the same
419
- fetch();
420
- });
429
+ });
421
430
  };
422
431
 
423
432
  /*
@@ -82,6 +82,14 @@ const emit = defineEmits(['update:modelValue']);
82
82
 
83
83
  const models = ref(props.currentModels);
84
84
 
85
+ watch(
86
+ () => props.currentModels,
87
+ (newValue, oldValue) => {
88
+ models.value = newValue;
89
+ },
90
+ { deep: true }
91
+ );
92
+
85
93
  function onUpdate(newModels: Option[]) {
86
94
  models.value = newModels;
87
95
  emit(
@@ -23,7 +23,7 @@
23
23
  <button
24
24
  type="button"
25
25
  class="rounded-full bg-slate-400 p-1 text-white hover:bg-slate-500"
26
- @click="$emit('delete')"
26
+ @click="$emit('remove')"
27
27
  >
28
28
  <BaseIcon icon="heroicons:x-mark-20-solid" class="h-4 w-4"></BaseIcon>
29
29
  </button>
@@ -40,7 +40,7 @@ import { fileSizeFormat } from '@/utils';
40
40
  import BaseMediaPreview from './BaseMediaPreview.vue';
41
41
  import { BaseIcon } from '.';
42
42
 
43
- defineEmits(['delete']);
43
+ defineEmits(['remove']);
44
44
 
45
45
  const props = defineProps({
46
46
  media: {
@@ -25,13 +25,13 @@
25
25
  baseFileUploaderProps.dragging ? 'bg-blue-100' : 'bg-slate-100',
26
26
  baseFileUploaderProps.disabled
27
27
  ? 'cursor-not-allowed border-slate-300'
28
- : 'border-slate-400 hover:bg-slate-50',
28
+ : 'border-slate-300 hover:bg-slate-50',
29
29
  ]"
30
30
  >
31
31
  <div :class="[baseFileUploaderProps.disabled ? 'opacity-30' : '']">
32
32
  <BaseIcon
33
33
  icon="heroicons:arrow-up-on-square"
34
- class="mx-auto mb-3 h-6 w-6 text-slate-500"
34
+ class="mx-auto mb-3 h-6 w-6 text-primary-500"
35
35
  />
36
36
  <div class="text-center">
37
37
  <p class="mb-0 text-sm font-medium leading-tight">
@@ -57,24 +57,30 @@
57
57
  v-if="currentMediaInternal.length + normalizedModelValue.to_add.length"
58
58
  class="mt-5"
59
59
  >
60
- <div class="grid gap-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4">
61
- <div v-for="(media, index) in currentMediaInternal" :key="media.id">
60
+ <div class="-m-1 flex flex-wrap">
61
+ <div
62
+ v-for="(media, index) in currentMediaInternal"
63
+ :key="media.id"
64
+ class="min-w-[220px] flex-1 p-1"
65
+ >
62
66
  <BaseMediaItem
63
67
  :media="media"
64
68
  :show-remove="!disabled"
65
- @delete="promptRemoveMedia(index)"
69
+ @remove="promptRemoveMedia(index)"
66
70
  >
67
71
  {{ media.file_name }}
68
72
  </BaseMediaItem>
69
73
  </div>
74
+
70
75
  <div
71
76
  v-for="(file, index) in normalizedModelValue.to_add"
72
77
  :key="file.id"
78
+ class="min-w-[220px] flex-1 p-1"
73
79
  >
74
80
  <BaseMediaItem
75
81
  :media="file"
76
82
  :show-remove="!disabled"
77
- @delete="promptRemoveUploadedFile(index)"
83
+ @remove="promptRemoveUploadedFile(index)"
78
84
  >
79
85
  {{ file.file_name }}
80
86
  </BaseMediaItem>
@@ -10,7 +10,7 @@
10
10
  class="group relative flex items-center px-3 py-1"
11
11
  :class="[
12
12
  (activeStrategy == 'default' ? isActive : isExactActive)
13
- ? 'font-semibold text-blue-600'
13
+ ? 'font-semibold text-primary-600'
14
14
  : 'text-slate-600 hover:text-slate-900',
15
15
  disabled ? 'cursor-not-allowed opacity-60' : '',
16
16
  ]"
@@ -20,7 +20,7 @@
20
20
  class="absolute left-0 top-0 h-full"
21
21
  :class="[
22
22
  (activeStrategy == 'default' ? isActive : isExactActive)
23
- ? 'w-[2px] bg-blue-600'
23
+ ? 'w-[2px] bg-primary-600'
24
24
  : 'group-hover:w-px group-hover:bg-slate-700',
25
25
  ]"
26
26
  ></div>
@@ -10,7 +10,7 @@
10
10
  class="group relative inline-block rounded-t-lg px-2 py-3 font-medium"
11
11
  :class="[
12
12
  (activeStrategy == 'default' ? isActive : isExactActive)
13
- ? 'text-blue-600'
13
+ ? 'text-primary-600'
14
14
  : 'text-slate-600 hover:text-slate-900',
15
15
  disabled ? 'cursor-not-allowed opacity-60' : '',
16
16
  ]"
@@ -20,7 +20,7 @@
20
20
  class="absolute left-0 bottom-0 w-full"
21
21
  :class="[
22
22
  (activeStrategy == 'default' ? isActive : isExactActive)
23
- ? 'h-[2px] bg-blue-600'
23
+ ? 'h-[2px] bg-primary-600'
24
24
  : 'group-hover:h-px group-hover:bg-slate-700',
25
25
  ]"
26
26
  ></div>
@@ -10,7 +10,7 @@
10
10
  :style="{ maxHeight: maxHeight ? maxHeight + 'px' : undefined }"
11
11
  >
12
12
  <div class="inline-block min-w-full align-middle">
13
- <div class="relative">
13
+ <div class="relative min-h-[300px]">
14
14
  <table class="min-w-full border-separate border-spacing-0">
15
15
  <thead v-if="newColumns.length" ref="thead">
16
16
  <tr>
package/src/lang/fr.json CHANGED
@@ -50,7 +50,7 @@
50
50
  "upload_failed": "Le téléchargement a échoué",
51
51
  "whoops": "Oups",
52
52
  "x_rows_selected": "1 item sélectionné | \n{count} items sélectionnés",
53
- "year": "An",
53
+ "year": "Année",
54
54
  "yes_delete": "Oui, supprimer",
55
55
  "you_can_upload_up_to_n_files": "Vous pouvez télécharger un fichier au maximum|Vous pouvez télécharger jusqu'à {count} fichiers",
56
56
  "you_cannot_select_more_than_x_items": "Vous ne pouvez pas sélectionner plus de un élément|Vous ne pouvez pas sélectionner plus de {count} éléments"