@tracktor/shared-module 0.13.1 → 0.14.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.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
1
  # [Versions](https://github.com/Tracktor/shared-module/releases)
2
2
 
3
- ## v0.13.1
4
- - **[fix]** : return type of`useInfiniteDataGrid`
3
+ ## v0.14.0
4
+ - **[feat]** : disable header auto generation from orval config
@@ -43,6 +43,7 @@ export declare const getOrvalConfig: (config?: CustomOrvalConfig) => {
43
43
  readonly useQuery: true;
44
44
  };
45
45
  readonly operations?: Record<string, {}> | undefined;
46
+ readonly header: false;
46
47
  readonly mutator: {
47
48
  readonly name: "axiosCustomInstance";
48
49
  readonly path: `${string}/config/orval/mutator/axiosCustomInstance.ts`;
package/dist/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import Le, { createContext as pr, useMemo as ue, useContext as se, useState as gr, useLayoutEffect as X, Suspense as mr, useEffect as hr, useCallback as J } from "react";
1
+ import Le, { createContext as pr, useMemo as ue, useContext as se, useState as gr, useLayoutEffect as X, Suspense as hr, useEffect as mr, useCallback as J } from "react";
2
2
  var ie = { exports: {} }, W = {};
3
3
  /**
4
4
  * @license React
@@ -15,15 +15,15 @@ function Er() {
15
15
  return W;
16
16
  $e = 1;
17
17
  var n = Le, a = Symbol.for("react.element"), u = Symbol.for("react.fragment"), f = Object.prototype.hasOwnProperty, i = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function s(m, c, R) {
18
+ function s(h, c, R) {
19
19
  var E, w = {}, T = null, C = null;
20
20
  R !== void 0 && (T = "" + R), c.key !== void 0 && (T = "" + c.key), c.ref !== void 0 && (C = c.ref);
21
21
  for (E in c)
22
22
  f.call(c, E) && !g.hasOwnProperty(E) && (w[E] = c[E]);
23
- if (m && m.defaultProps)
24
- for (E in c = m.defaultProps, c)
23
+ if (h && h.defaultProps)
24
+ for (E in c = h.defaultProps, c)
25
25
  w[E] === void 0 && (w[E] = c[E]);
26
- return { $$typeof: a, type: m, key: T, ref: C, props: w, _owner: i.current };
26
+ return { $$typeof: a, type: h, key: T, ref: C, props: w, _owner: i.current };
27
27
  }
28
28
  return W.Fragment = u, W.jsx = s, W.jsxs = s, W;
29
29
  }
@@ -40,7 +40,7 @@ var M = {};
40
40
  var Ie;
41
41
  function br() {
42
42
  return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
43
- var n = Le, a = Symbol.for("react.element"), u = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), m = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), A = Symbol.iterator, k = "@@iterator";
43
+ var n = Le, a = Symbol.for("react.element"), u = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), h = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), A = Symbol.iterator, k = "@@iterator";
44
44
  function N(e) {
45
45
  if (e === null || typeof e != "object")
46
46
  return null;
@@ -59,16 +59,16 @@ function br() {
59
59
  {
60
60
  var o = S.ReactDebugCurrentFrame, p = o.getStackAddendum();
61
61
  p !== "" && (r += "%s", t = t.concat([p]));
62
- var h = t.map(function(d) {
62
+ var m = t.map(function(d) {
63
63
  return String(d);
64
64
  });
65
- h.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, h);
65
+ m.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, m);
66
66
  }
67
67
  }
68
68
  var ce = !1, Y = !1, We = !1, Me = !1, Ne = !1, fe;
69
69
  fe = Symbol.for("react.module.reference");
70
70
  function Ye(e) {
71
- return !!(typeof e == "string" || typeof e == "function" || e === f || e === g || Ne || e === i || e === R || e === E || Me || e === C || ce || Y || We || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === w || e.$$typeof === s || e.$$typeof === m || e.$$typeof === c || // This needs to include all possible module reference object
71
+ return !!(typeof e == "string" || typeof e == "function" || e === f || e === g || Ne || e === i || e === R || e === E || Me || e === C || ce || Y || We || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === w || e.$$typeof === s || e.$$typeof === h || e.$$typeof === c || // This needs to include all possible module reference object
72
72
  // types supported by any Flight configuration anywhere since
73
73
  // we don't know which Flight build this will end up being used
74
74
  // with.
@@ -107,7 +107,7 @@ function br() {
107
107
  }
108
108
  if (typeof e == "object")
109
109
  switch (e.$$typeof) {
110
- case m:
110
+ case h:
111
111
  var r = e;
112
112
  return de(r) + ".Consumer";
113
113
  case s:
@@ -119,9 +119,9 @@ function br() {
119
119
  var o = e.displayName || null;
120
120
  return o !== null ? o : j(e.type) || "Memo";
121
121
  case T: {
122
- var p = e, h = p._payload, d = p._init;
122
+ var p = e, m = p._payload, d = p._init;
123
123
  try {
124
- return j(d(h));
124
+ return j(d(m));
125
125
  } catch {
126
126
  return null;
127
127
  }
@@ -129,14 +129,14 @@ function br() {
129
129
  }
130
130
  return null;
131
131
  }
132
- var D = Object.assign, I = 0, ve, pe, ge, me, he, Ee, be;
132
+ var D = Object.assign, I = 0, ve, pe, ge, he, me, Ee, be;
133
133
  function ye() {
134
134
  }
135
135
  ye.__reactDisabledLog = !0;
136
136
  function qe() {
137
137
  {
138
138
  if (I === 0) {
139
- ve = console.log, pe = console.info, ge = console.warn, me = console.error, he = console.group, Ee = console.groupCollapsed, be = console.groupEnd;
139
+ ve = console.log, pe = console.info, ge = console.warn, he = console.error, me = console.group, Ee = console.groupCollapsed, be = console.groupEnd;
140
140
  var e = {
141
141
  configurable: !0,
142
142
  enumerable: !0,
@@ -175,10 +175,10 @@ function br() {
175
175
  value: ge
176
176
  }),
177
177
  error: D({}, e, {
178
- value: me
178
+ value: he
179
179
  }),
180
180
  group: D({}, e, {
181
- value: he
181
+ value: me
182
182
  }),
183
183
  groupCollapsed: D({}, e, {
184
184
  value: Ee
@@ -222,8 +222,8 @@ function br() {
222
222
  Q = !0;
223
223
  var p = Error.prepareStackTrace;
224
224
  Error.prepareStackTrace = void 0;
225
- var h;
226
- h = Z.current, Z.current = null, qe();
225
+ var m;
226
+ m = Z.current, Z.current = null, qe();
227
227
  try {
228
228
  if (r) {
229
229
  var d = function() {
@@ -276,7 +276,7 @@ function br() {
276
276
  }
277
277
  }
278
278
  } finally {
279
- Q = !1, Z.current = h, ze(), Error.prepareStackTrace = p;
279
+ Q = !1, Z.current = m, ze(), Error.prepareStackTrace = p;
280
280
  }
281
281
  var $ = e ? e.displayName || e.name : "", Fe = $ ? V($) : "";
282
282
  return typeof e == "function" && q.set(e, Fe), Fe;
@@ -308,9 +308,9 @@ function br() {
308
308
  case w:
309
309
  return z(e.type, r, t);
310
310
  case T: {
311
- var o = e, p = o._payload, h = o._init;
311
+ var o = e, p = o._payload, m = o._init;
312
312
  try {
313
- return z(h(p), r, t);
313
+ return z(m(p), r, t);
314
314
  } catch {
315
315
  }
316
316
  }
@@ -327,9 +327,9 @@ function br() {
327
327
  }
328
328
  function Je(e, r, t, o, p) {
329
329
  {
330
- var h = Function.call.bind(U);
330
+ var m = Function.call.bind(U);
331
331
  for (var d in e)
332
- if (h(e, d)) {
332
+ if (m(e, d)) {
333
333
  var l = void 0;
334
334
  try {
335
335
  if (typeof e[d] != "function") {
@@ -419,7 +419,7 @@ function br() {
419
419
  });
420
420
  }
421
421
  }
422
- var ar = function(e, r, t, o, p, h, d) {
422
+ var ar = function(e, r, t, o, p, m, d) {
423
423
  var l = {
424
424
  // This tag allows us to uniquely identify this as a React Element
425
425
  $$typeof: a,
@@ -429,7 +429,7 @@ function br() {
429
429
  ref: t,
430
430
  props: d,
431
431
  // Record the component responsible for creating this element.
432
- _owner: h
432
+ _owner: m
433
433
  };
434
434
  return l._store = {}, Object.defineProperty(l._store, "validated", {
435
435
  configurable: !1,
@@ -450,14 +450,14 @@ function br() {
450
450
  };
451
451
  function or(e, r, t, o, p) {
452
452
  {
453
- var h, d = {}, l = null, _ = null;
453
+ var m, d = {}, l = null, _ = null;
454
454
  t !== void 0 && (Te(t), l = "" + t), er(r) && (Te(r.key), l = "" + r.key), Qe(r) && (_ = r.ref, rr(r, p));
455
- for (h in r)
456
- U.call(r, h) && !Ke.hasOwnProperty(h) && (d[h] = r[h]);
455
+ for (m in r)
456
+ U.call(r, m) && !Ke.hasOwnProperty(m) && (d[m] = r[m]);
457
457
  if (e && e.defaultProps) {
458
458
  var b = e.defaultProps;
459
- for (h in b)
460
- d[h] === void 0 && (d[h] = b[h]);
459
+ for (m in b)
460
+ d[m] === void 0 && (d[m] = b[m]);
461
461
  }
462
462
  if (l || _) {
463
463
  var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
@@ -542,7 +542,7 @@ Check the top-level render call using <` + t + ">.");
542
542
  else if (e) {
543
543
  var p = N(e);
544
544
  if (typeof p == "function" && p !== e.entries)
545
- for (var h = p.call(e), d; !(d = h.next()).done; )
545
+ for (var m = p.call(e), d; !(d = m.next()).done; )
546
546
  ae(d.value) && Ae(d.value, r);
547
547
  }
548
548
  }
@@ -584,7 +584,7 @@ Check the top-level render call using <` + t + ">.");
584
584
  e.ref !== null && (F(e), v("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
585
585
  }
586
586
  }
587
- function De(e, r, t, o, p, h) {
587
+ function De(e, r, t, o, p, m) {
588
588
  {
589
589
  var d = Ye(e);
590
590
  if (!d) {
@@ -595,7 +595,7 @@ Check the top-level render call using <` + t + ">.");
595
595
  var b;
596
596
  e === null ? b = "null" : ee(e) ? b = "array" : e !== void 0 && e.$$typeof === a ? (b = "<" + (j(e.type) || "Unknown") + " />", l = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, l);
597
597
  }
598
- var y = or(e, r, t, p, h);
598
+ var y = or(e, r, t, p, m);
599
599
  if (y == null)
600
600
  return y;
601
601
  if (d) {
@@ -642,7 +642,7 @@ const H = pr({
642
642
  Outlet: i,
643
643
  Navigate: g,
644
644
  useLocation: s,
645
- useGoogleTagManager: m
645
+ useGoogleTagManager: h
646
646
  }) => {
647
647
  const c = ue(
648
648
  () => ({
@@ -651,10 +651,10 @@ const H = pr({
651
651
  Outlet: i,
652
652
  translate: u,
653
653
  useAuth: f,
654
- useGoogleTagManager: m,
654
+ useGoogleTagManager: h,
655
655
  useLocation: s
656
656
  }),
657
- [g, i, n, u, f, m, s]
657
+ [g, i, n, u, f, h, s]
658
658
  );
659
659
  return /* @__PURE__ */ x.jsx(H.Provider, { value: c, children: a });
660
660
  }, G = (n) => `RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Or = ({
@@ -668,11 +668,11 @@ const H = pr({
668
668
  const {
669
669
  axios: g = i.axios,
670
670
  useLocation: s = i.useLocation,
671
- useAuth: m = i.useAuth,
671
+ useAuth: h = i.useAuth,
672
672
  Outlet: c = i.Outlet,
673
673
  Navigate: R = i.Navigate
674
674
  } = se(H);
675
- if (m === void 0)
675
+ if (h === void 0)
676
676
  throw new Error(G("useAuth"));
677
677
  if (s === void 0)
678
678
  throw new Error(G("useLocation"));
@@ -680,7 +680,7 @@ const H = pr({
680
680
  throw new Error(G("Outlet"));
681
681
  if (R === void 0)
682
682
  throw new Error(G("Navigate"));
683
- const [E, w] = gr(null), { isLogged: T } = m(), C = s();
683
+ const [E, w] = gr(null), { isLogged: T } = h(), C = s();
684
684
  return X(() => {
685
685
  g == null || g.interceptors.response.use(
686
686
  (v) => v,
@@ -689,7 +689,7 @@ const H = pr({
689
689
  return typeof v == "object" && v && "response" in v && v.response && typeof v.response == "object" && "status" in v.response && v.response && typeof v.response == "object" && "status" in v.response && ((Y = v == null ? void 0 : v.response) == null ? void 0 : Y.status) === 401 && (g.defaults.headers.common.Authorization = null, localStorage.removeItem(u), w(f)), Promise.reject(v);
690
690
  }
691
691
  );
692
- }, [g == null ? void 0 : g.defaults, g == null ? void 0 : g.interceptors.response, u, f]), T && !E ? /* @__PURE__ */ x.jsx(mr, { fallback: n, children: (k = (A = C.state) == null ? void 0 : A.from) != null && k.state && ((S = (N = C.state) == null ? void 0 : N.from) == null ? void 0 : S.pathname) === a ? /* @__PURE__ */ x.jsx(R, { to: C.state.from.state.from.pathname + C.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ x.jsx(c, {}) }) : /* @__PURE__ */ x.jsx(R, { to: a, state: { from: C }, replace: !0 });
692
+ }, [g == null ? void 0 : g.defaults, g == null ? void 0 : g.interceptors.response, u, f]), T && !E ? /* @__PURE__ */ x.jsx(hr, { fallback: n, children: (k = (A = C.state) == null ? void 0 : A.from) != null && k.state && ((S = (N = C.state) == null ? void 0 : N.from) == null ? void 0 : S.pathname) === a ? /* @__PURE__ */ x.jsx(R, { to: C.state.from.state.from.pathname + C.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ x.jsx(c, {}) }) : /* @__PURE__ */ x.jsx(R, { to: a, state: { from: C }, replace: !0 });
693
693
  }, oe = (n) => `GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Sr = ({ ...n }) => {
694
694
  const {
695
695
  useLocation: a = n.useLocation,
@@ -703,7 +703,7 @@ const H = pr({
703
703
  if (f === void 0)
704
704
  throw new Error(oe("useGoogleTagManager"));
705
705
  const { pathname: i } = a(), { sendEvent: g } = f();
706
- return hr(() => {
706
+ return mr(() => {
707
707
  g({ event: "pageView", pathname: i });
708
708
  }, [i, g]), /* @__PURE__ */ x.jsx(u, {});
709
709
  }, jr = ({
@@ -716,7 +716,7 @@ const H = pr({
716
716
  }) => (X(() => {
717
717
  if (!n.defaults)
718
718
  return;
719
- const s = localStorage.getItem(f), m = s ? JSON.parse(s) : null, c = m != null && m[u] ? m[u] : null, R = m != null && m[i] ? m[i] : null, E = s ? `${c} ${R}` : null;
719
+ const s = localStorage.getItem(f), h = s ? JSON.parse(s) : null, c = h != null && h[u] ? h[u] : null, R = h != null && h[i] ? h[i] : null, E = s ? `${c} ${R}` : null;
720
720
  n.defaults.baseURL = a, n.defaults.headers.post["Content-Type"] = g, E && (n.defaults.headers.common.Authorization = E);
721
721
  }, [n.defaults, a, g, i, u, f]), null), Pr = ({
722
722
  i18n: n,
@@ -774,9 +774,9 @@ const H = pr({
774
774
  const { unknownErrorTranslationKey: a = "error.unknownError" } = n || {}, { translate: u = n == null ? void 0 : n.translate } = se(H);
775
775
  return { printError: J(
776
776
  (i) => {
777
- var m, c, R, E, w, T, C, A, k;
777
+ var h, c, R, E, w, T, C, A, k;
778
778
  const g = u ? u(a) : "Unknown error", { response: s } = i || {};
779
- return i != null && i.reason ? String(i.reason) : (m = s == null ? void 0 : s.data) != null && m.reason ? String(s.data.reason) : (c = s == null ? void 0 : s.data) != null && c.message ? String(s.data.message) : (E = (R = s == null ? void 0 : s.data) == null ? void 0 : R.detail) != null && E.length && Array.isArray((w = s == null ? void 0 : s.data) == null ? void 0 : w.detail) && ((C = (T = s == null ? void 0 : s.data) == null ? void 0 : T.detail[0]) != null && C.msg) && typeof ((k = (A = s == null ? void 0 : s.data) == null ? void 0 : A.detail[0]) == null ? void 0 : k.msg) == "string" ? String(s.data.detail[0].msg) : g;
779
+ return i != null && i.reason ? String(i.reason) : (h = s == null ? void 0 : s.data) != null && h.reason ? String(s.data.reason) : (c = s == null ? void 0 : s.data) != null && c.message ? String(s.data.message) : (E = (R = s == null ? void 0 : s.data) == null ? void 0 : R.detail) != null && E.length && Array.isArray((w = s == null ? void 0 : s.data) == null ? void 0 : w.detail) && ((C = (T = s == null ? void 0 : s.data) == null ? void 0 : T.detail[0]) != null && C.msg) && typeof ((k = (A = s == null ? void 0 : s.data) == null ? void 0 : A.detail[0]) == null ? void 0 : k.msg) == "string" ? String(s.data.detail[0].msg) : g;
780
780
  },
781
781
  [u, a]
782
782
  ) };
@@ -793,7 +793,7 @@ const H = pr({
793
793
  u || !g || await a({ pageParam: (c == null ? void 0 : c.pageParam) || c.visibleRowsCount });
794
794
  },
795
795
  [g, a, u]
796
- ), m = ue(() => {
796
+ ), h = ue(() => {
797
797
  if (n)
798
798
  return n.pages.reduce((c, R) => [...c, ...R], []);
799
799
  }, [n]);
@@ -801,7 +801,7 @@ const H = pr({
801
801
  fetchNextPageOnRowsScrollEnd: s,
802
802
  isLoading: u || i,
803
803
  loadingVariant: f ? "skeleton" : "linear",
804
- rows: m
804
+ rows: h
805
805
  };
806
806
  }, Ir = (n) => {
807
807
  const a = J(
@@ -842,6 +842,7 @@ const H = pr({
842
842
  client: "react-query",
843
843
  mode: "tags-split",
844
844
  override: {
845
+ header: !1,
845
846
  mutator: {
846
847
  name: "axiosCustomInstance",
847
848
  path: `${__dirname}/config/orval/mutator/axiosCustomInstance.ts`
package/dist/main.umd.cjs CHANGED
@@ -24,4 +24,4 @@ Check the render method of \``+e+"`."}return""}}function _t(e){{if(e!==void 0){v
24
24
 
25
25
  Check your code at `+t+":"+r+"."}return""}}var ke={};function Ct(e){{var t=Pe();if(!t){var r=typeof e=="string"?e:e.displayName||e.name;r&&(t=`
26
26
 
27
- Check the top-level render call using <`+r+">.")}return t}}function Ae(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=Ct(t);if(ke[r])return;ke[r]=!0;var o="";e&&e._owner&&e._owner!==ae.current&&(o=" It was passed a child from "+A(e._owner.type)+"."),L(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,o),L(null)}}function xe(e,t){{if(typeof e!="object")return;if(re(e))for(var r=0;r<e.length;r++){var o=e[r];ie(o)&&Ae(o,t)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var p=U(e);if(typeof p=="function"&&p!==e.entries)for(var m=p.call(e),d;!(d=m.next()).done;)ie(d.value)&&Ae(d.value,t)}}}function wt(e){{var t=e.type;if(t==null||typeof t=="string")return;var r;if(typeof t=="function")r=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===l||t.$$typeof===T))r=t.propTypes;else return;if(r){var o=A(t);lt(r,e.props,"prop",o,e)}else if(t.PropTypes!==void 0&&!oe){oe=!0;var p=A(t);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tt(e){{for(var t=Object.keys(e.props),r=0;r<t.length;r++){var o=t[r];if(o!=="children"&&o!=="key"){L(e),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),L(null);break}}e.ref!==null&&(L(e),v("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}function De(e,t,r,o,p,m){{var d=nt(e);if(!d){var c="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(c+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var w=_t(p);w?c+=w:c+=Pe();var b;e===null?b="null":re(e)?b="array":e!==void 0&&e.$$typeof===a?(b="<"+(A(e.type)||"Unknown")+" />",c=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,c)}var _=Rt(e,t,r,p,m);if(_==null)return _;if(d){var j=t.children;if(j!==void 0)if(o)if(re(j)){for(var M=0;M<j.length;M++)xe(j[M],e);Object.freeze&&Object.freeze(j)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else xe(j,e)}return e===f?Tt(_):wt(_),_}}function Ot(e,t,r){return De(e,t,r,!0)}function St(e,t,r){return De(e,t,r,!1)}var jt=St,Pt=Ot;N.Fragment=f,N.jsx=jt,N.jsxs=Pt}()),N}process.env.NODE_ENV==="production"?K.exports=Ie():K.exports=Le();var P=K.exports;const Y=E.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Me=({axios:n,children:a,translate:u,useAuth:f,Outlet:i,Navigate:g,useLocation:s,useGoogleTagManager:h})=>{const l=E.useMemo(()=>({axios:n,Navigate:g,Outlet:i,translate:u,useAuth:f,useGoogleTagManager:h,useLocation:s}),[g,i,n,u,f,h,s]);return P.jsx(Y.Provider,{value:l,children:a})},B=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:a="/login",localStorageKey:u="user",redirect401Path:f="/login",...i})=>{var D,F,U,k;const{axios:g=i.axios,useLocation:s=i.useLocation,useAuth:h=i.useAuth,Outlet:l=i.Outlet,Navigate:C=i.Navigate}=E.useContext(Y);if(h===void 0)throw new Error(B("useAuth"));if(s===void 0)throw new Error(B("useLocation"));if(l===void 0)throw new Error(B("Outlet"));if(C===void 0)throw new Error(B("Navigate"));const[y,T]=E.useState(null),{isLogged:S}=h(),O=s();return E.useLayoutEffect(()=>{g==null||g.interceptors.response.use(v=>v,async v=>{var G;return typeof v=="object"&&v&&"response"in v&&v.response&&typeof v.response=="object"&&"status"in v.response&&v.response&&typeof v.response=="object"&&"status"in v.response&&((G=v==null?void 0:v.response)==null?void 0:G.status)===401&&(g.defaults.headers.common.Authorization=null,localStorage.removeItem(u),T(f)),Promise.reject(v)})},[g==null?void 0:g.defaults,g==null?void 0:g.interceptors.response,u,f]),S&&!y?P.jsx(E.Suspense,{fallback:n,children:(F=(D=O.state)==null?void 0:D.from)!=null&&F.state&&((k=(U=O.state)==null?void 0:U.from)==null?void 0:k.pathname)===a?P.jsx(C,{to:O.state.from.state.from.pathname+O.state.from.state.from.search,replace:!0}):P.jsx(l,{})}):P.jsx(C,{to:a,state:{from:O},replace:!0})},Q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ne=({...n})=>{const{useLocation:a=n.useLocation,Outlet:u=n.Outlet,useGoogleTagManager:f=n.useGoogleTagManager}=E.useContext(Y);if(a===void 0)throw new Error(Q("useLocation"));if(u===void 0)throw new Error(Q("Outlet"));if(f===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:i}=a(),{sendEvent:g}=f();return E.useEffect(()=>{g({event:"pageView",pathname:i})},[i,g]),P.jsx(u,{})},Ye=({axios:n,baseURL:a,tokenTypeKey:u="tokenType",userLocalStorageKey:f="user",tokenKey:i="accessToken",postContentType:g="application/json"})=>(E.useLayoutEffect(()=>{if(!n.defaults)return;const s=localStorage.getItem(f),h=s?JSON.parse(s):null,l=h!=null&&h[u]?h[u]:null,C=h!=null&&h[i]?h[i]:null,y=s?`${l} ${C}`:null;n.defaults.baseURL=a,n.defaults.headers.post["Content-Type"]=g,y&&(n.defaults.headers.common.Authorization=y)},[n.defaults,a,g,i,u,f]),null),Ve=({i18n:n,initReactI18next:a,resources:u,LanguageDetector:f})=>(n.use(f).use(a).init({debug:!1,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{useSuspense:!0},resources:u,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",i=>{document.documentElement.setAttribute("lang",i)}),null),ze=({dsn:n,sentry:a})=>(E.useLayoutEffect(()=>{process.env.NODE_ENV==="production"&&a.init({dsn:n,integrations:[new a.BrowserTracing],tracesSampleRate:1})},[n,a]),null),Be=({IMaskMixin:n,...a})=>{const u=E.useMemo(()=>n(({TextField:f,...i})=>P.jsx(f,{...i})),[n]);return P.jsx(u,{...a})},Ue=({mapbox:n,accessToken:a})=>(E.useLayoutEffect(()=>{n&&a&&(n.accessToken=a)},[a,n]),null),Ge=({children:n,defaultOptions:a,QueryClient:u,QueryClientProvider:f})=>{const i=new u({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...a}}});return P.jsx(f,{client:i,children:n})},Je=n=>{const{unknownErrorTranslationKey:a="error.unknownError"}=n||{},{translate:u=n==null?void 0:n.translate}=E.useContext(Y);return{printError:E.useCallback(i=>{var h,l,C,y,T,S,O,D,F;const g=u?u(a):"Unknown error",{response:s}=i||{};return i!=null&&i.reason?String(i.reason):(h=s==null?void 0:s.data)!=null&&h.reason?String(s.data.reason):(l=s==null?void 0:s.data)!=null&&l.message?String(s.data.message):(y=(C=s==null?void 0:s.data)==null?void 0:C.detail)!=null&&y.length&&Array.isArray((T=s==null?void 0:s.data)==null?void 0:T.detail)&&((O=(S=s==null?void 0:s.data)==null?void 0:S.detail[0])!=null&&O.msg)&&typeof((F=(D=s==null?void 0:s.data)==null?void 0:D.detail[0])==null?void 0:F.msg)=="string"?String(s.data.detail[0].msg):g},[u,a])}},Xe=({data:n,fetchNextPage:a,isFetchingNextPage:u,isInitialLoading:f,isLoading:i,enabled:g=!0})=>{const s=E.useCallback(async l=>{u||!g||await a({pageParam:(l==null?void 0:l.pageParam)||l.visibleRowsCount})},[g,a,u]),h=E.useMemo(()=>{if(n)return n.pages.reduce((l,C)=>[...l,...C],[])},[n]);return{fetchNextPageOnRowsScrollEnd:s,isLoading:u||i,loadingVariant:f?"skeleton":"linear",rows:h}},He=n=>{const a=E.useCallback(({tokenType:f,accessToken:i})=>{n.defaults.headers.common.Authorization=`${f} ${i}`},[n.defaults.headers.common]);return{clearAuthenticationToken:E.useCallback(()=>{n.defaults.headers.common.Authorization=null},[n.defaults.headers.common]),setAuthenticationToken:a}},Ze=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),qe=n=>{const f=n.split("/").filter(i=>i.length>0).map(i=>i.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")).join("");return f.charAt(0).toLowerCase()+f.slice(1)},Ke=(n,a,u)=>{const f=qe(a),i=Ze(u);return`${f}${i}`},Qe=n=>{if(n)return(n==null?void 0:n.reduce((a,u)=>(a[u]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},a),{}))||{}},$e=n=>{const{input:a="./openapi.json",operationsToGenerateInfiniteQueryHook:u=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:a,output:{client:"react-query",mode:"tags-split",override:{mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:Ke,...(u==null?void 0:u.length)&&{operations:Qe(u)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};R.AxiosConfig=Ye,R.GTMSendPageView=Ne,R.I18nConfig=Ve,R.InjectDependenciesContext=Y,R.InjectDependenciesProvider=Me,R.MapBoxConfig=Ue,R.MaskTextField=Be,R.QueryClientConfigProvider=Ge,R.RequireAuth=We,R.SentryConfig=ze,R.getOrvalConfig=$e,R.useAuth=He,R.useInfiniteDataGrid=Xe,R.useResponseError=Je,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
27
+ Check the top-level render call using <`+r+">.")}return t}}function Ae(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=Ct(t);if(ke[r])return;ke[r]=!0;var o="";e&&e._owner&&e._owner!==ae.current&&(o=" It was passed a child from "+A(e._owner.type)+"."),L(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,o),L(null)}}function xe(e,t){{if(typeof e!="object")return;if(re(e))for(var r=0;r<e.length;r++){var o=e[r];ie(o)&&Ae(o,t)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var p=U(e);if(typeof p=="function"&&p!==e.entries)for(var m=p.call(e),d;!(d=m.next()).done;)ie(d.value)&&Ae(d.value,t)}}}function wt(e){{var t=e.type;if(t==null||typeof t=="string")return;var r;if(typeof t=="function")r=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===l||t.$$typeof===T))r=t.propTypes;else return;if(r){var o=A(t);lt(r,e.props,"prop",o,e)}else if(t.PropTypes!==void 0&&!oe){oe=!0;var p=A(t);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tt(e){{for(var t=Object.keys(e.props),r=0;r<t.length;r++){var o=t[r];if(o!=="children"&&o!=="key"){L(e),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),L(null);break}}e.ref!==null&&(L(e),v("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}function De(e,t,r,o,p,m){{var d=nt(e);if(!d){var c="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(c+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var w=_t(p);w?c+=w:c+=Pe();var b;e===null?b="null":re(e)?b="array":e!==void 0&&e.$$typeof===a?(b="<"+(A(e.type)||"Unknown")+" />",c=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,c)}var _=Rt(e,t,r,p,m);if(_==null)return _;if(d){var j=t.children;if(j!==void 0)if(o)if(re(j)){for(var M=0;M<j.length;M++)xe(j[M],e);Object.freeze&&Object.freeze(j)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else xe(j,e)}return e===f?Tt(_):wt(_),_}}function Ot(e,t,r){return De(e,t,r,!0)}function St(e,t,r){return De(e,t,r,!1)}var jt=St,Pt=Ot;N.Fragment=f,N.jsx=jt,N.jsxs=Pt}()),N}process.env.NODE_ENV==="production"?K.exports=Ie():K.exports=Le();var P=K.exports;const Y=E.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Me=({axios:n,children:a,translate:u,useAuth:f,Outlet:i,Navigate:g,useLocation:s,useGoogleTagManager:h})=>{const l=E.useMemo(()=>({axios:n,Navigate:g,Outlet:i,translate:u,useAuth:f,useGoogleTagManager:h,useLocation:s}),[g,i,n,u,f,h,s]);return P.jsx(Y.Provider,{value:l,children:a})},B=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:a="/login",localStorageKey:u="user",redirect401Path:f="/login",...i})=>{var D,F,U,k;const{axios:g=i.axios,useLocation:s=i.useLocation,useAuth:h=i.useAuth,Outlet:l=i.Outlet,Navigate:C=i.Navigate}=E.useContext(Y);if(h===void 0)throw new Error(B("useAuth"));if(s===void 0)throw new Error(B("useLocation"));if(l===void 0)throw new Error(B("Outlet"));if(C===void 0)throw new Error(B("Navigate"));const[y,T]=E.useState(null),{isLogged:S}=h(),O=s();return E.useLayoutEffect(()=>{g==null||g.interceptors.response.use(v=>v,async v=>{var G;return typeof v=="object"&&v&&"response"in v&&v.response&&typeof v.response=="object"&&"status"in v.response&&v.response&&typeof v.response=="object"&&"status"in v.response&&((G=v==null?void 0:v.response)==null?void 0:G.status)===401&&(g.defaults.headers.common.Authorization=null,localStorage.removeItem(u),T(f)),Promise.reject(v)})},[g==null?void 0:g.defaults,g==null?void 0:g.interceptors.response,u,f]),S&&!y?P.jsx(E.Suspense,{fallback:n,children:(F=(D=O.state)==null?void 0:D.from)!=null&&F.state&&((k=(U=O.state)==null?void 0:U.from)==null?void 0:k.pathname)===a?P.jsx(C,{to:O.state.from.state.from.pathname+O.state.from.state.from.search,replace:!0}):P.jsx(l,{})}):P.jsx(C,{to:a,state:{from:O},replace:!0})},Q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ne=({...n})=>{const{useLocation:a=n.useLocation,Outlet:u=n.Outlet,useGoogleTagManager:f=n.useGoogleTagManager}=E.useContext(Y);if(a===void 0)throw new Error(Q("useLocation"));if(u===void 0)throw new Error(Q("Outlet"));if(f===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:i}=a(),{sendEvent:g}=f();return E.useEffect(()=>{g({event:"pageView",pathname:i})},[i,g]),P.jsx(u,{})},Ye=({axios:n,baseURL:a,tokenTypeKey:u="tokenType",userLocalStorageKey:f="user",tokenKey:i="accessToken",postContentType:g="application/json"})=>(E.useLayoutEffect(()=>{if(!n.defaults)return;const s=localStorage.getItem(f),h=s?JSON.parse(s):null,l=h!=null&&h[u]?h[u]:null,C=h!=null&&h[i]?h[i]:null,y=s?`${l} ${C}`:null;n.defaults.baseURL=a,n.defaults.headers.post["Content-Type"]=g,y&&(n.defaults.headers.common.Authorization=y)},[n.defaults,a,g,i,u,f]),null),Ve=({i18n:n,initReactI18next:a,resources:u,LanguageDetector:f})=>(n.use(f).use(a).init({debug:!1,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{useSuspense:!0},resources:u,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",i=>{document.documentElement.setAttribute("lang",i)}),null),ze=({dsn:n,sentry:a})=>(E.useLayoutEffect(()=>{process.env.NODE_ENV==="production"&&a.init({dsn:n,integrations:[new a.BrowserTracing],tracesSampleRate:1})},[n,a]),null),Be=({IMaskMixin:n,...a})=>{const u=E.useMemo(()=>n(({TextField:f,...i})=>P.jsx(f,{...i})),[n]);return P.jsx(u,{...a})},Ue=({mapbox:n,accessToken:a})=>(E.useLayoutEffect(()=>{n&&a&&(n.accessToken=a)},[a,n]),null),Ge=({children:n,defaultOptions:a,QueryClient:u,QueryClientProvider:f})=>{const i=new u({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...a}}});return P.jsx(f,{client:i,children:n})},Je=n=>{const{unknownErrorTranslationKey:a="error.unknownError"}=n||{},{translate:u=n==null?void 0:n.translate}=E.useContext(Y);return{printError:E.useCallback(i=>{var h,l,C,y,T,S,O,D,F;const g=u?u(a):"Unknown error",{response:s}=i||{};return i!=null&&i.reason?String(i.reason):(h=s==null?void 0:s.data)!=null&&h.reason?String(s.data.reason):(l=s==null?void 0:s.data)!=null&&l.message?String(s.data.message):(y=(C=s==null?void 0:s.data)==null?void 0:C.detail)!=null&&y.length&&Array.isArray((T=s==null?void 0:s.data)==null?void 0:T.detail)&&((O=(S=s==null?void 0:s.data)==null?void 0:S.detail[0])!=null&&O.msg)&&typeof((F=(D=s==null?void 0:s.data)==null?void 0:D.detail[0])==null?void 0:F.msg)=="string"?String(s.data.detail[0].msg):g},[u,a])}},Xe=({data:n,fetchNextPage:a,isFetchingNextPage:u,isInitialLoading:f,isLoading:i,enabled:g=!0})=>{const s=E.useCallback(async l=>{u||!g||await a({pageParam:(l==null?void 0:l.pageParam)||l.visibleRowsCount})},[g,a,u]),h=E.useMemo(()=>{if(n)return n.pages.reduce((l,C)=>[...l,...C],[])},[n]);return{fetchNextPageOnRowsScrollEnd:s,isLoading:u||i,loadingVariant:f?"skeleton":"linear",rows:h}},He=n=>{const a=E.useCallback(({tokenType:f,accessToken:i})=>{n.defaults.headers.common.Authorization=`${f} ${i}`},[n.defaults.headers.common]);return{clearAuthenticationToken:E.useCallback(()=>{n.defaults.headers.common.Authorization=null},[n.defaults.headers.common]),setAuthenticationToken:a}},Ze=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),qe=n=>{const f=n.split("/").filter(i=>i.length>0).map(i=>i.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")).join("");return f.charAt(0).toLowerCase()+f.slice(1)},Ke=(n,a,u)=>{const f=qe(a),i=Ze(u);return`${f}${i}`},Qe=n=>{if(n)return(n==null?void 0:n.reduce((a,u)=>(a[u]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},a),{}))||{}},$e=n=>{const{input:a="./openapi.json",operationsToGenerateInfiniteQueryHook:u=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:a,output:{client:"react-query",mode:"tags-split",override:{header:!1,mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:Ke,...(u==null?void 0:u.length)&&{operations:Qe(u)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};R.AxiosConfig=Ye,R.GTMSendPageView=Ne,R.I18nConfig=Ve,R.InjectDependenciesContext=Y,R.InjectDependenciesProvider=Me,R.MapBoxConfig=Ue,R.MaskTextField=Be,R.QueryClientConfigProvider=Ge,R.RequireAuth=We,R.SentryConfig=ze,R.getOrvalConfig=$e,R.useAuth=He,R.useInfiniteDataGrid=Xe,R.useResponseError=Je,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",