@nice2dev/erp-adapter 1.0.27 → 1.0.29

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.
package/dist/index.mjs CHANGED
@@ -120,7 +120,7 @@ function he(c) {
120
120
  flashChanges: w = !0,
121
121
  flashDuration: V = 500,
122
122
  optimisticUpdates: O = !0
123
- } = c, [Q, D] = E(a), [X, q] = E(e.status), [Z, N] = E(/* @__PURE__ */ new Set()), [K, x] = E(/* @__PURE__ */ new Set()), [Y, ae] = E(null), z = oe(/* @__PURE__ */ new Map()), j = oe(/* @__PURE__ */ new Map()), _ = h(
123
+ } = c, [Q, D] = E(a), [_, q] = E(e.status), [Z, N] = E(/* @__PURE__ */ new Set()), [K, x] = E(/* @__PURE__ */ new Set()), [Y, ae] = E(null), z = oe(/* @__PURE__ */ new Map()), j = oe(/* @__PURE__ */ new Map()), X = h(
124
124
  (y, P) => {
125
125
  const { operation: S, key: C, data: k, changes: I } = P;
126
126
  switch (S) {
@@ -166,11 +166,11 @@ function he(c) {
166
166
  ), B = h(
167
167
  async (y) => {
168
168
  y.entityName === t && (o && !await o(y) || (D((P) => {
169
- const S = _(P, y);
169
+ const S = X(P, y);
170
170
  return r == null || r(y, S), S;
171
171
  }), U(y.key)));
172
172
  },
173
- [t, o, _, r, U]
173
+ [t, o, X, r, U]
174
174
  ), p = h(
175
175
  (y) => {
176
176
  B(y);
@@ -227,7 +227,7 @@ function he(c) {
227
227
  D(a);
228
228
  }, [a]), {
229
229
  data: Q,
230
- status: X,
230
+ status: _,
231
231
  flashedKeys: Z,
232
232
  pendingKeys: K,
233
233
  error: Y,
@@ -307,8 +307,8 @@ function pe(c) {
307
307
  joinedEventName: O = "EntityUserJoined",
308
308
  leftEventName: Q = "EntityUserLeft",
309
309
  onPresenceChange: D,
310
- onEditConflict: X
311
- } = c, [q, Z] = E([]), [N, K] = E(o), [x, Y] = E(), [ae, z] = E(e.status), j = oe(Date.now()), _ = oe(null), U = oe(null), B = oe(null), p = de(() => Array.isArray(n) ? n : [n], [n]), le = de(
310
+ onEditConflict: _
311
+ } = c, [q, Z] = E([]), [N, K] = E(o), [x, Y] = E(), [ae, z] = E(e.status), j = oe(Date.now()), X = oe(null), U = oe(null), B = oe(null), p = de(() => Array.isArray(n) ? n : [n], [n]), le = de(
312
312
  () => `${t}:${[...p].sort().join(",")}`,
313
313
  [t, p]
314
314
  ), J = h(
@@ -338,9 +338,9 @@ function pe(c) {
338
338
  const T = q.find(
339
339
  (s) => s.user.id !== a.id && s.status === "editing" && s.editingField === m
340
340
  );
341
- T && (X == null || X(T.user, m)), F("editing", m);
341
+ T && (_ == null || _(T.user, m)), F("editing", m);
342
342
  },
343
- [q, a.id, X, F]
343
+ [q, a.id, _, F]
344
344
  ), re = h(() => {
345
345
  F("viewing", void 0);
346
346
  }, [F]), y = h(
@@ -437,10 +437,10 @@ function pe(c) {
437
437
  N,
438
438
  t,
439
439
  p
440
- ]), te(() => (_.current = setInterval(() => {
440
+ ]), te(() => (X.current = setInterval(() => {
441
441
  J(N, x);
442
442
  }, r), () => {
443
- _.current && clearInterval(_.current);
443
+ X.current && clearInterval(X.current);
444
444
  }), [r, J, N, x]), te(() => {
445
445
  const m = ["mousemove", "keydown", "mousedown", "touchstart", "scroll"];
446
446
  return m.forEach((T) => window.addEventListener(T, k, { passive: !0 })), U.current = setTimeout(() => {
@@ -568,10 +568,10 @@ function Le(c) {
568
568
  enableCursorSharing: O = !0,
569
569
  cursorDebounce: Q = 50,
570
570
  optimisticUpdates: D = !0,
571
- flashChanges: X = !0,
571
+ flashChanges: _ = !0,
572
572
  flashDuration: q = 500,
573
573
  liveDataOptions: Z = {}
574
- } = c, [N, K] = E(/* @__PURE__ */ new Map()), [x, Y] = E(/* @__PURE__ */ new Map()), [ae, z] = E([]), [j, _] = E(null), [U, B] = E([]), [p, le] = E([]), [J, F] = E(null), [ne, re] = E([]), y = oe(null), P = oe(/* @__PURE__ */ new Map()), S = h((l) => (P.current.has(l) || P.current.set(l, me(l)), P.current.get(l)), []), C = h(
574
+ } = c, [N, K] = E(/* @__PURE__ */ new Map()), [x, Y] = E(/* @__PURE__ */ new Map()), [ae, z] = E([]), [j, X] = E(null), [U, B] = E([]), [p, le] = E([]), [J, F] = E(null), [ne, re] = E([]), y = oe(null), P = oe(/* @__PURE__ */ new Map()), S = h((l) => (P.current.has(l) || P.current.set(l, me(l)), P.current.get(l)), []), C = h(
575
575
  (l, f, d) => {
576
576
  if (!d.changes)
577
577
  return f;
@@ -612,7 +612,7 @@ function Le(c) {
612
612
  entityName: t,
613
613
  keyField: n,
614
614
  initialData: o,
615
- flashChanges: X,
615
+ flashChanges: _,
616
616
  flashDuration: q,
617
617
  optimisticUpdates: D,
618
618
  onConflict: C,
@@ -855,7 +855,7 @@ function Le(c) {
855
855
  connectionStatus: k.status,
856
856
  myPresenceStatus: I.myStatus,
857
857
  // Selection methods
858
- setFocusedCell: _,
858
+ setFocusedCell: X,
859
859
  setSelectedCells: B,
860
860
  setSelectedRows: le,
861
861
  // Edit methods
@@ -1640,10 +1640,22 @@ const ye = [
1640
1640
  defaultProps: { dataSource: [], maxRows: 10 },
1641
1641
  propDescriptors: [
1642
1642
  { name: "dataSource", type: "json", label: "Data source (JSON)" },
1643
- { name: "maxRows", type: "number", label: "Max visible rows", min: 3, max: 100, defaultValue: 10 },
1643
+ {
1644
+ name: "maxRows",
1645
+ type: "number",
1646
+ label: "Max visible rows",
1647
+ min: 3,
1648
+ max: 100,
1649
+ defaultValue: 10
1650
+ },
1644
1651
  { name: "showRank", type: "boolean", label: "Show rank column", defaultValue: !0 },
1645
1652
  { name: "showAvatar", type: "boolean", label: "Show avatar", defaultValue: !0 },
1646
- { name: "highlightCurrentUser", type: "boolean", label: "Highlight current user", defaultValue: !0 },
1653
+ {
1654
+ name: "highlightCurrentUser",
1655
+ type: "boolean",
1656
+ label: "Highlight current user",
1657
+ defaultValue: !0
1658
+ },
1647
1659
  { name: "scoreField", type: "string", label: "Score field name", defaultValue: "score" },
1648
1660
  { name: "nameField", type: "string", label: "Name field name", defaultValue: "name" },
1649
1661
  { name: "variant", type: "variant", label: "Visual style", defaultValue: "default" }
@@ -1660,13 +1672,26 @@ const ye = [
1660
1672
  { name: "description", type: "string", label: "Description" },
1661
1673
  { name: "icon", type: "string", label: "Icon URL" },
1662
1674
  { name: "unlocked", type: "boolean", label: "Unlocked", defaultValue: !1 },
1663
- { name: "progress", type: "number", label: "Progress (0-100)", min: 0, max: 100, defaultValue: 0 },
1664
- { name: "rarity", type: "select", label: "Rarity", options: [
1665
- { label: "Common", value: "common" },
1666
- { label: "Rare", value: "rare" },
1667
- { label: "Epic", value: "epic" },
1668
- { label: "Legendary", value: "legendary" }
1669
- ], defaultValue: "common" },
1675
+ {
1676
+ name: "progress",
1677
+ type: "number",
1678
+ label: "Progress (0-100)",
1679
+ min: 0,
1680
+ max: 100,
1681
+ defaultValue: 0
1682
+ },
1683
+ {
1684
+ name: "rarity",
1685
+ type: "select",
1686
+ label: "Rarity",
1687
+ options: [
1688
+ { label: "Common", value: "common" },
1689
+ { label: "Rare", value: "rare" },
1690
+ { label: "Epic", value: "epic" },
1691
+ { label: "Legendary", value: "legendary" }
1692
+ ],
1693
+ defaultValue: "common"
1694
+ },
1670
1695
  { name: "size", type: "size", label: "Badge size", group: "Layout" }
1671
1696
  ]
1672
1697
  },
@@ -1687,20 +1712,21 @@ const ye = [
1687
1712
  ]
1688
1713
  },
1689
1714
  {
1690
- type: "NiceXPBar",
1691
- label: "XP Progress Bar",
1715
+ // XP / level bars are now powered by NiceProgress (NiceXPBar removed in 1.1.0).
1716
+ type: "NiceProgress",
1717
+ label: "XP / Level Bar",
1692
1718
  category: "Gamification",
1693
1719
  icon: "zap",
1694
- defaultProps: { currentXP: 0, maxXP: 1e3, level: 1 },
1720
+ defaultProps: { value: 350, max: 1e3, label: "Level 5", variant: "success", showValue: !0 },
1695
1721
  propDescriptors: [
1696
- { name: "currentXP", type: "number", label: "Current XP", min: 0, defaultValue: 0 },
1697
- { name: "maxXP", type: "number", label: "Max XP (next level)", min: 1, defaultValue: 1e3 },
1698
- { name: "level", type: "number", label: "Current level", min: 1, defaultValue: 1 },
1699
- { name: "showLabel", type: "boolean", label: "Show XP label", defaultValue: !0 },
1700
- { name: "showLevel", type: "boolean", label: "Show level badge", defaultValue: !0 },
1701
- { name: "color", type: "color", label: "Bar color", defaultValue: "#4caf50" },
1722
+ { name: "value", type: "number", label: "Current XP", min: 0, defaultValue: 350 },
1723
+ { name: "max", type: "number", label: "Max XP (next level)", min: 1, defaultValue: 1e3 },
1724
+ { name: "label", type: "string", label: "Label (e.g. level)", defaultValue: "Level 5" },
1725
+ { name: "showValue", type: "boolean", label: "Show value", defaultValue: !0 },
1726
+ { name: "variant", type: "variant", label: "Visual style", defaultValue: "success" },
1727
+ { name: "striped", type: "boolean", label: "Striped", defaultValue: !1 },
1702
1728
  { name: "animated", type: "boolean", label: "Animate changes", defaultValue: !0 },
1703
- { name: "height", type: "size", label: "Bar height", group: "Layout" }
1729
+ { name: "size", type: "size", label: "Bar height", group: "Layout" }
1704
1730
  ]
1705
1731
  }
1706
1732
  ], ve = [
@@ -1902,7 +1928,7 @@ function Je(c) {
1902
1928
  fetcher: a = Te,
1903
1929
  getAuthToken: o,
1904
1930
  onError: r
1905
- } = c, [i, u] = E([]), [g, v] = E(null), [w, V] = E(null), [O, Q] = E(null), [D, X] = E(null), [q, Z] = E(null), [N, K] = E([]), [x, Y] = E([]), [ae, z] = E(null), [j, _] = E({
1931
+ } = c, [i, u] = E([]), [g, v] = E(null), [w, V] = E(null), [O, Q] = E(null), [D, _] = E(null), [q, Z] = E(null), [N, K] = E([]), [x, Y] = E([]), [ae, z] = E(null), [j, X] = E({
1906
1932
  offers: !1,
1907
1933
  calculate: !1,
1908
1934
  compare: !1,
@@ -1923,7 +1949,7 @@ function Je(c) {
1923
1949
  const l = new AbortController();
1924
1950
  U.current.set(s, l);
1925
1951
  const f = setTimeout(() => l.abort(), n);
1926
- _((d) => ({ ...d, [$]: !0 })), z(null);
1952
+ X((d) => ({ ...d, [$]: !0 })), z(null);
1927
1953
  try {
1928
1954
  const d = `${e}${s}`;
1929
1955
  return await a(d, {
@@ -1944,7 +1970,7 @@ function Je(c) {
1944
1970
  };
1945
1971
  throw d.name !== "AbortError" && (z(A), r == null || r(A)), A;
1946
1972
  } finally {
1947
- clearTimeout(f), U.current.delete(s), _((d) => ({ ...d, [$]: !1 }));
1973
+ clearTimeout(f), U.current.delete(s), X((d) => ({ ...d, [$]: !1 }));
1948
1974
  }
1949
1975
  },
1950
1976
  [e, n, a, B, r]
@@ -2019,7 +2045,7 @@ function Je(c) {
2019
2045
  },
2020
2046
  "apply"
2021
2047
  );
2022
- return X(b), b;
2048
+ return _(b), b;
2023
2049
  },
2024
2050
  [p]
2025
2051
  ), S = h(
@@ -2029,12 +2055,12 @@ function Je(c) {
2029
2055
  { method: "GET" },
2030
2056
  "apply"
2031
2057
  );
2032
- return X(b), b;
2058
+ return _(b), b;
2033
2059
  },
2034
2060
  [p]
2035
2061
  ), C = h(
2036
2062
  async (s) => {
2037
- await p(`/applications/${s}/cancel`, { method: "POST" }, "apply"), X(null);
2063
+ await p(`/applications/${s}/cancel`, { method: "POST" }, "apply"), _(null);
2038
2064
  },
2039
2065
  [p]
2040
2066
  ), k = h(
@@ -2095,7 +2121,7 @@ function Je(c) {
2095
2121
  }, [p]), m = h(() => {
2096
2122
  z(null);
2097
2123
  }, []), T = h(() => {
2098
- u([]), v(null), V(null), Q(null), X(null), Z(null), K([]), Y([]), z(null), _({
2124
+ u([]), v(null), V(null), Q(null), _(null), Z(null), K([]), Y([]), z(null), X({
2099
2125
  offers: !1,
2100
2126
  calculate: !1,
2101
2127
  compare: !1,