@club-employes/utopia 4.372.0 → 4.374.0

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.
@@ -7,8 +7,11 @@ declare const _default: DefineComponent<MyUserGroupsProps, {}, {}, {}, {}, Compo
7
7
  onDelete?: (() => any) | undefined;
8
8
  onEdit?: (() => any) | undefined;
9
9
  }>, {
10
+ showMoreLabel: string;
10
11
  peopleLabel: string;
11
12
  criteria: UserGroupCriterion[];
12
13
  criteriaLabel: string;
14
+ maxVisibleCriteria: number;
15
+ showLessLabel: string;
13
16
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
14
17
  export default _default;
@@ -13,4 +13,7 @@ export interface MyUserGroupsProps {
13
13
  peopleLabel?: string;
14
14
  criteria?: UserGroupCriterion[];
15
15
  criteriaLabel?: string;
16
+ maxVisibleCriteria?: number;
17
+ showMoreLabel?: string;
18
+ showLessLabel?: string;
16
19
  }
package/dist/index.js CHANGED
@@ -20745,7 +20745,7 @@ const Rz = {
20745
20745
  }
20746
20746
  function Qe(Q) {
20747
20747
  const V = r.value, oe = V.state.apply(Q);
20748
- V.updateState(oe), Ot(oe), fo(oe), l("update:modelValue", Ct(oe.doc)), Q.docChanged && n.state === "error" && (l("update:state", "default"), l("update:message", ""));
20748
+ V.updateState(oe), Ot(oe), fo(oe), Q.docChanged && l("update:modelValue", Ct(oe.doc)), Q.docChanged && n.state === "error" && (l("update:state", "default"), l("update:message", ""));
20749
20749
  }
20750
20750
  function et(Q) {
20751
20751
  return () => {
@@ -21892,7 +21892,7 @@ const Rz = {
21892
21892
  ], 2)) : P("", !0)
21893
21893
  ], 2));
21894
21894
  }
21895
- }, Uz = /* @__PURE__ */ re(Kz, [["__scopeId", "data-v-60a77087"]]), Gs = {
21895
+ }, Uz = /* @__PURE__ */ re(Kz, [["__scopeId", "data-v-0590d869"]]), Gs = {
21896
21896
  showToolbar: !0,
21897
21897
  headings: !0,
21898
21898
  formatting: {
@@ -22039,58 +22039,61 @@ const tx = /* @__PURE__ */ se({
22039
22039
  ...sf,
22040
22040
  ...n.labels
22041
22041
  })), a = { type: "doc", content: [{ type: "paragraph" }] }, s = H(a);
22042
- function c(u) {
22043
- if (typeof u == "string") {
22044
- if (!u.trim()) return a;
22042
+ let c = null;
22043
+ function r(A) {
22044
+ if (typeof A == "string") {
22045
+ if (!A.trim()) return a;
22045
22046
  try {
22046
- return ex(u);
22047
+ return ex(A);
22047
22048
  } catch {
22048
22049
  return a;
22049
22050
  }
22050
22051
  }
22051
- return u && typeof u == "object" ? u : a;
22052
+ return A && typeof A == "object" ? A : a;
22052
22053
  }
22053
- s.value = c(n.modelValue), ke(() => n.modelValue, (u) => {
22054
- const A = c(u);
22054
+ s.value = r(n.modelValue), ke(() => n.modelValue, (A) => {
22055
+ if (n.output !== "json" && typeof A == "string" && A === c)
22056
+ return;
22057
+ const p = r(A);
22055
22058
  try {
22056
- JSON.stringify(A) !== JSON.stringify(s.value) && (s.value = A);
22059
+ JSON.stringify(p) !== JSON.stringify(s.value) && (s.value = p);
22057
22060
  } catch {
22058
- s.value = A;
22061
+ s.value = p;
22059
22062
  }
22060
22063
  }, { immediate: !0 });
22061
- const r = M(() => {
22062
- const u = n.toolbarConfig;
22063
- if (!(u && Object.keys(u).length > 0) || u === Gs)
22064
+ const u = M(() => {
22065
+ const A = n.toolbarConfig;
22066
+ if (!(A && Object.keys(A).length > 0) || A === Gs)
22064
22067
  return Gs;
22065
- const m = { bold: !1, italic: !1, link: !1 }, f = { ordered: !1, bullet: !1 }, b = { codeBlock: !1, blockquote: !1, expandable: !1 }, z = { image: !1, video: !1, table: !1, columns: !1 };
22068
+ const f = { bold: !1, italic: !1, link: !1 }, b = { ordered: !1, bullet: !1 }, z = { codeBlock: !1, blockquote: !1, expandable: !1 }, k = { image: !1, video: !1, table: !1, columns: !1 };
22066
22069
  return {
22067
- showToolbar: u.showToolbar !== !1,
22068
- headings: u.headings === !0,
22069
- colors: u.colors === !0,
22070
- alignment: u.alignment === !0,
22071
- separators: u.separators === !0,
22072
- divider: u.divider !== !1,
22073
- formatting: u.formatting ? { ...m, ...u.formatting } : m,
22074
- lists: u.lists ? { ...f, ...u.lists } : f,
22075
- blocks: u.blocks ? { ...b, ...u.blocks } : b,
22076
- media: u.media ? { ...z, ...u.media } : z
22070
+ showToolbar: A.showToolbar !== !1,
22071
+ headings: A.headings === !0,
22072
+ colors: A.colors === !0,
22073
+ alignment: A.alignment === !0,
22074
+ separators: A.separators === !0,
22075
+ divider: A.divider !== !1,
22076
+ formatting: A.formatting ? { ...f, ...A.formatting } : f,
22077
+ lists: A.lists ? { ...b, ...A.lists } : b,
22078
+ blocks: A.blocks ? { ...z, ...A.blocks } : z,
22079
+ media: A.media ? { ...k, ...A.media } : k
22077
22080
  };
22078
22081
  });
22079
- return ke(s, (u) => {
22082
+ return ke(s, (A) => {
22080
22083
  try {
22081
22084
  if (n.output === "json")
22082
- o("update:modelValue", u);
22085
+ c = null, o("update:modelValue", A);
22083
22086
  else {
22084
- const A = fr(u);
22085
- o("update:modelValue", A);
22087
+ const p = fr(A);
22088
+ c = p, o("update:modelValue", p);
22086
22089
  }
22087
- } catch (A) {
22088
- console.error("Failed to render ProseMirror content", A);
22090
+ } catch (p) {
22091
+ console.error("Failed to render ProseMirror content", p);
22089
22092
  }
22090
- }, { deep: !0 }), (u, A) => (i(), B(Uz, {
22093
+ }, { deep: !0 }), (A, p) => (i(), B(Uz, {
22091
22094
  modelValue: s.value,
22092
- "onUpdate:modelValue": A[0] || (A[0] = (p) => s.value = p),
22093
- "toolbar-config": r.value,
22095
+ "onUpdate:modelValue": p[0] || (p[0] = (m) => s.value = m),
22096
+ "toolbar-config": u.value,
22094
22097
  labels: l.value,
22095
22098
  label: e.label,
22096
22099
  required: e.required,
@@ -22098,8 +22101,8 @@ const tx = /* @__PURE__ */ se({
22098
22101
  message: e.message,
22099
22102
  "max-image-size": e.maxImageSize,
22100
22103
  "max-video-size": e.maxVideoSize,
22101
- "onUpdate:state": A[1] || (A[1] = (p) => u.$emit("update:state", p)),
22102
- "onUpdate:message": A[2] || (A[2] = (p) => u.$emit("update:message", p))
22104
+ "onUpdate:state": p[1] || (p[1] = (m) => A.$emit("update:state", m)),
22105
+ "onUpdate:message": p[2] || (p[2] = (m) => A.$emit("update:message", m))
22103
22106
  }, null, 8, ["modelValue", "toolbar-config", "labels", "label", "required", "state", "message", "max-image-size", "max-video-size"]));
22104
22107
  }
22105
22108
  }), tA = {};
@@ -48867,12 +48870,20 @@ const IN = /* @__PURE__ */ re(L3, [["__scopeId", "data-v-4d16284f"]]), SF = "dat
48867
48870
  peopleCount: {},
48868
48871
  peopleLabel: { default: "personne(s)" },
48869
48872
  criteria: { default: () => [] },
48870
- criteriaLabel: { default: "CRITÈRES DE CIBLAGE" }
48873
+ criteriaLabel: { default: "CRITÈRES DE CIBLAGE" },
48874
+ maxVisibleCriteria: { default: 4 },
48875
+ showMoreLabel: { default: "Voir plus ({count})" },
48876
+ showLessLabel: { default: "Voir moins" }
48871
48877
  },
48872
48878
  emits: ["edit", "delete"],
48873
48879
  setup(e, { emit: t }) {
48874
- const n = t;
48875
- return (o, l) => (i(), B(h(il), {
48880
+ const n = e, o = t, l = H(!1), a = M(() => (n.criteria?.length ?? 0) > n.maxVisibleCriteria), s = M(
48881
+ () => l.value || !a.value ? n.criteria ?? [] : (n.criteria ?? []).slice(0, n.maxVisibleCriteria)
48882
+ ), c = M(() => {
48883
+ const r = (n.criteria?.length ?? 0) - n.maxVisibleCriteria;
48884
+ return n.showMoreLabel.replace("{count}", String(r));
48885
+ });
48886
+ return (r, u) => (i(), B(h(il), {
48876
48887
  variant: "elevated",
48877
48888
  interactive: !1,
48878
48889
  class: "utopia-my-user-groups"
@@ -48919,7 +48930,7 @@ const IN = /* @__PURE__ */ re(L3, [["__scopeId", "data-v-4d16284f"]]), SF = "dat
48919
48930
  type: "button",
48920
48931
  class: "utopia-my-user-groups__edit-btn",
48921
48932
  "aria-label": `Modifier le groupe ${e.title}`,
48922
- onClick: l[0] || (l[0] = (a) => n("edit"))
48933
+ onClick: u[0] || (u[0] = (A) => o("edit"))
48923
48934
  }, [
48924
48935
  w(h(W), {
48925
48936
  name: "Pencil",
@@ -48931,7 +48942,7 @@ const IN = /* @__PURE__ */ re(L3, [["__scopeId", "data-v-4d16284f"]]), SF = "dat
48931
48942
  type: "button",
48932
48943
  class: "utopia-my-user-groups__delete-btn",
48933
48944
  "aria-label": `Supprimer le groupe ${e.title}`,
48934
- onClick: l[1] || (l[1] = (a) => n("delete"))
48945
+ onClick: u[1] || (u[1] = (A) => o("delete"))
48935
48946
  }, [
48936
48947
  w(h(W), {
48937
48948
  name: "Trash-2",
@@ -48956,19 +48967,19 @@ const IN = /* @__PURE__ */ re(L3, [["__scopeId", "data-v-4d16284f"]]), SF = "dat
48956
48967
  _: 1
48957
48968
  }),
48958
48969
  e.criteria && e.criteria.length ? (i(), d("div", LI, [
48959
- (i(!0), d(X, null, de(e.criteria, (a) => (i(), B(h(Gt), {
48960
- key: a.label,
48961
- variant: a.variant ?? "secondary",
48970
+ (i(!0), d(X, null, de(s.value, (A) => (i(), B(h(Gt), {
48971
+ key: A.label,
48972
+ variant: A.variant ?? "secondary",
48962
48973
  size: "small",
48963
- ghost: a.ghost !== !1,
48964
- "left-icon": a.icon
48974
+ ghost: A.ghost !== !1,
48975
+ "left-icon": A.icon
48965
48976
  }, {
48966
48977
  default: O(() => [
48967
- a.label.includes(": ") ? (i(), d(X, { key: 0 }, [
48968
- S(C(a.label.split(": ")[0]) + ": ", 1),
48969
- v("strong", null, C(a.label.split(": ").slice(1).join(": ")), 1)
48978
+ A.label.includes(": ") ? (i(), d(X, { key: 0 }, [
48979
+ S(C(A.label.split(": ")[0]) + ": ", 1),
48980
+ v("strong", null, C(A.label.split(": ").slice(1).join(": ")), 1)
48970
48981
  ], 64)) : (i(), d(X, { key: 1 }, [
48971
- S(C(a.label), 1)
48982
+ S(C(A.label), 1)
48972
48983
  ], 64))
48973
48984
  ]),
48974
48985
  _: 2
@@ -48979,11 +48990,23 @@ const IN = /* @__PURE__ */ re(L3, [["__scopeId", "data-v-4d16284f"]]), SF = "dat
48979
48990
  size: "xs",
48980
48991
  color: "brand-secondary-200"
48981
48992
  }, {
48982
- default: O(() => [...l[2] || (l[2] = [
48993
+ default: O(() => [...u[3] || (u[3] = [
48983
48994
  S("Aucun critère", -1)
48984
48995
  ])]),
48985
48996
  _: 1
48986
- }))
48997
+ })),
48998
+ a.value ? (i(), d("button", {
48999
+ key: 2,
49000
+ type: "button",
49001
+ class: "utopia-my-user-groups__show-more-btn",
49002
+ onClick: u[2] || (u[2] = (A) => l.value = !l.value)
49003
+ }, [
49004
+ v("span", null, C(l.value ? e.showLessLabel : c.value), 1),
49005
+ w(h(W), {
49006
+ name: l.value ? "Chevron-up" : "Chevron-down",
49007
+ size: "small"
49008
+ }, null, 8, ["name"])
49009
+ ])) : P("", !0)
48987
49010
  ])
48988
49011
  ]),
48989
49012
  _: 1
@@ -48991,7 +49014,7 @@ const IN = /* @__PURE__ */ re(L3, [["__scopeId", "data-v-4d16284f"]]), SF = "dat
48991
49014
  }
48992
49015
  }), zd = {};
48993
49016
  typeof zd == "function" && zd(S3);
48994
- const JN = /* @__PURE__ */ re(S3, [["__scopeId", "data-v-d424cf27"]]), j3 = /* @__PURE__ */ Symbol("utopia-tree-context"), SI = {
49017
+ const JN = /* @__PURE__ */ re(S3, [["__scopeId", "data-v-5a29b7af"]]), j3 = /* @__PURE__ */ Symbol("utopia-tree-context"), SI = {
48995
49018
  key: 1,
48996
49019
  class: "utopia-tree-node__toggle-placeholder"
48997
49020
  }, jI = {