@tracktor/shared-module 0.7.2 → 0.8.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 +5 -3
- package/README.md +12 -4
- package/dist/components/Inputs/MaskTextField.d.ts +1 -1
- package/dist/components/Utils/GTMSendPageView.d.ts +1 -1
- package/dist/components/Utils/RequireAuth.d.ts +1 -1
- package/dist/context/InjectDependenciesProvider.d.ts +1 -1
- package/dist/context/QueryClientConfigProvider.d.ts +1 -1
- package/dist/hooks/useInfiniteDataGrid/index.d.ts +2 -0
- package/dist/hooks/useInfiniteDataGrid/useInfiniteDataGrid.d.ts +32 -0
- package/dist/hooks/useResponseError/useResponseError.test.d.ts +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +352 -336
- package/dist/main.umd.cjs +9 -9
- package/package.json +12 -13
package/dist/main.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(R,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(R=typeof globalThis<"u"?globalThis:R||self,E(R["@tracktor/shared-module"]={},R.React))})(this,function(R,E){"use strict";var Z={exports:{}},W={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ue;function
|
|
9
|
+
*/var ue;function Ie(){if(ue)return W;ue=1;var n=E,o=Symbol.for("react.element"),g=Symbol.for("react.fragment"),p=Object.prototype.hasOwnProperty,l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function u(y,f,T){var _,C={},S=null,O=null;T!==void 0&&(S=""+T),f.key!==void 0&&(S=""+f.key),f.ref!==void 0&&(O=f.ref);for(_ in f)p.call(f,_)&&!i.hasOwnProperty(_)&&(C[_]=f[_]);if(y&&y.defaultProps)for(_ in f=y.defaultProps,f)C[_]===void 0&&(C[_]=f[_]);return{$$typeof:o,type:y,key:S,ref:O,props:C,_owner:l.current}}return W.Fragment=g,W.jsx=u,W.jsxs=u,W}var Y={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var se;function
|
|
18
|
-
`+ee+e}}var re=!1,H;{var rr=typeof WeakMap=="function"?WeakMap:Map;H=new rr}function Re(e,r){if(!e||re)return"";{var t=H.get(e);if(t!==void 0)return t}var a;re=!0;var
|
|
19
|
-
`),
|
|
20
|
-
`),m=
|
|
21
|
-
`+
|
|
17
|
+
*/var se;function Le(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var n=E,o=Symbol.for("react.element"),g=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),y=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),D=Symbol.iterator,F="@@iterator";function B(e){if(e===null||typeof e!="object")return null;var r=D&&e[D]||e[F];return typeof r=="function"?r:null}var k=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function d(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];le("error",e,t)}}function le(e,r,t){{var a=k.ReactDebugCurrentFrame,v=a.getStackAddendum();v!==""&&(r+="%s",t=t.concat([v]));var h=t.map(function(c){return String(c)});h.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,h)}}var ce=!1,z=!1,Ke=!1,Xe=!1,Qe=!1,fe;fe=Symbol.for("react.module.reference");function Ze(e){return!!(typeof e=="string"||typeof e=="function"||e===p||e===i||Qe||e===l||e===T||e===_||Xe||e===O||ce||z||Ke||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===C||e.$$typeof===u||e.$$typeof===y||e.$$typeof===f||e.$$typeof===fe||e.getModuleId!==void 0))}function qe(e,r,t){var a=e.displayName;if(a)return a;var v=r.displayName||r.name||"";return v!==""?t+"("+v+")":t}function de(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case g:return"Portal";case i:return"Profiler";case l:return"StrictMode";case T:return"Suspense";case _:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case y:var r=e;return de(r)+".Consumer";case u:var t=e;return de(t._context)+".Provider";case f:return qe(e,e.render,"ForwardRef");case C:var a=e.displayName||null;return a!==null?a:x(e.type)||"Memo";case S:{var v=e,h=v._payload,c=v._init;try{return x(c(h))}catch{return null}}}return null}var I=Object.assign,N=0,ve,ge,pe,he,Ee,me,ye;function be(){}be.__reactDisabledLog=!0;function $e(){{if(N===0){ve=console.log,ge=console.info,pe=console.warn,he=console.error,Ee=console.group,me=console.groupCollapsed,ye=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}}function er(){{if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:ve}),info:I({},e,{value:ge}),warn:I({},e,{value:pe}),error:I({},e,{value:he}),group:I({},e,{value:Ee}),groupCollapsed:I({},e,{value:me}),groupEnd:I({},e,{value:ye})})}N<0&&d("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $=k.ReactCurrentDispatcher,ee;function J(e,r,t){{if(ee===void 0)try{throw Error()}catch(v){var a=v.stack.trim().match(/\n( *(at )?)/);ee=a&&a[1]||""}return`
|
|
18
|
+
`+ee+e}}var re=!1,H;{var rr=typeof WeakMap=="function"?WeakMap:Map;H=new rr}function Re(e,r){if(!e||re)return"";{var t=H.get(e);if(t!==void 0)return t}var a;re=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var h;h=$.current,$.current=null,$e();try{if(r){var c=function(){throw Error()};if(Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(A){a=A}Reflect.construct(e,[],c)}else{try{c.call()}catch(A){a=A}e.call(c.prototype)}}else{try{throw Error()}catch(A){a=A}e()}}catch(A){if(A&&a&&typeof A.stack=="string"){for(var s=A.stack.split(`
|
|
19
|
+
`),w=a.stack.split(`
|
|
20
|
+
`),m=s.length-1,b=w.length-1;m>=1&&b>=0&&s[m]!==w[b];)b--;for(;m>=1&&b>=0;m--,b--)if(s[m]!==w[b]){if(m!==1||b!==1)do if(m--,b--,b<0||s[m]!==w[b]){var j=`
|
|
21
|
+
`+s[m].replace(" at new "," at ");return e.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,j),j}while(m>=1&&b>=0);break}}}finally{re=!1,$.current=h,er(),Error.prepareStackTrace=v}var M=e?e.displayName||e.name:"",Fe=M?J(M):"";return typeof e=="function"&&H.set(e,Fe),Fe}function tr(e,r,t){return Re(e,!1)}function nr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,t){if(e==null)return"";if(typeof e=="function")return Re(e,nr(e));if(typeof e=="string")return J(e);switch(e){case T:return J("Suspense");case _:return J("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return tr(e.render);case C:return K(e.type,r,t);case S:{var a=e,v=a._payload,h=a._init;try{return K(h(v),r,t)}catch{}}}return""}var X=Object.prototype.hasOwnProperty,_e={},Te=k.ReactDebugCurrentFrame;function Q(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}function ar(e,r,t,a,v){{var h=Function.call.bind(X);for(var c in e)if(h(e,c)){var s=void 0;try{if(typeof e[c]!="function"){var w=Error((a||"React class")+": "+t+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}s=e[c](r,c,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(m){s=m}s&&!(s instanceof Error)&&(Q(v),d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",a||"React class",t,c,typeof s),Q(null)),s instanceof Error&&!(s.message in _e)&&(_e[s.message]=!0,Q(v),d("Failed %s type: %s",t,s.message),Q(null))}}}var or=Array.isArray;function te(e){return or(e)}function ir(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function ur(e){try{return we(e),!1}catch{return!0}}function we(e){return""+e}function Ce(e){if(ur(e))return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ir(e)),we(e)}var U=k.ReactCurrentOwner,sr={key:!0,ref:!0,__self:!0,__source:!0},Oe,Se,ne;ne={};function lr(e){if(X.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function cr(e){if(X.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function fr(e,r){if(typeof e.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var t=x(U.current.type);ne[t]||(d('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',x(U.current.type),e.ref),ne[t]=!0)}}function dr(e,r){{var t=function(){Oe||(Oe=!0,d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function vr(e,r){{var t=function(){Se||(Se=!0,d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var gr=function(e,r,t,a,v,h,c){var s={$$typeof:o,type:e,key:r,ref:t,props:c,_owner:h};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function pr(e,r,t,a,v){{var h,c={},s=null,w=null;t!==void 0&&(Ce(t),s=""+t),cr(r)&&(Ce(r.key),s=""+r.key),lr(r)&&(w=r.ref,fr(r,v));for(h in r)X.call(r,h)&&!sr.hasOwnProperty(h)&&(c[h]=r[h]);if(e&&e.defaultProps){var m=e.defaultProps;for(h in m)c[h]===void 0&&(c[h]=m[h])}if(s||w){var b=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&dr(c,b),w&&vr(c,b)}return gr(e,s,w,v,a,U.current,c)}}var ae=k.ReactCurrentOwner,je=k.ReactDebugCurrentFrame;function L(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);je.setExtraStackFrame(t)}else je.setExtraStackFrame(null)}var oe;oe=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function Pe(){{if(ae.current){var e=x(ae.current.type);if(e)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+e+"`."}return""}}function hr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+r+":"+t+"."}return""}}var ke={};function
|
|
25
|
+
Check your code at `+r+":"+t+"."}return""}}var ke={};function Er(e){{var r=Pe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+t+">.")}return r}}function
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Er(r);if(ke[t])return;ke[t]=!0;var a="";e&&e._owner&&e._owner!==ae.current&&(a=" It was passed a child from "+x(e._owner.type)+"."),L(e),d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),L(null)}}function Ae(e,r){{if(typeof e!="object")return;if(te(e))for(var t=0;t<e.length;t++){var a=e[t];ie(a)&&xe(a,r)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var v=B(e);if(typeof v=="function"&&v!==e.entries)for(var h=v.call(e),c;!(c=h.next()).done;)ie(c.value)&&xe(c.value,r)}}}function mr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===C))t=r.propTypes;else return;if(t){var a=x(r);ar(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!oe){oe=!0;var v=x(r);d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",v||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function yr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){L(e),d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),L(null);break}}e.ref!==null&&(L(e),d("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}function De(e,r,t,a,v,h){{var c=Ze(e);if(!c){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" 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=hr(v);w?s+=w:s+=Pe();var m;e===null?m="null":te(e)?m="array":e!==void 0&&e.$$typeof===o?(m="<"+(x(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):m=typeof e,d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m,s)}var b=pr(e,r,t,v,h);if(b==null)return b;if(c){var j=r.children;if(j!==void 0)if(a)if(te(j)){for(var M=0;M<j.length;M++)Ae(j[M],e);Object.freeze&&Object.freeze(j)}else d("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 Ae(j,e)}return e===p?yr(b):mr(b),b}}function br(e,r,t){return De(e,r,t,!0)}function Rr(e,r,t){return De(e,r,t,!1)}var _r=Rr,Tr=br;Y.Fragment=p,Y.jsx=_r,Y.jsxs=Tr}()),Y}process.env.NODE_ENV==="production"?Z.exports=Ie():Z.exports=Le();var P=Z.exports;const V=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:o,translate:g,useAuth:p,Outlet:l,Navigate:i,useLocation:u,useGoogleTagManager:y})=>{const f=E.useMemo(()=>({axios:n,Navigate:i,Outlet:l,translate:g,useAuth:p,useGoogleTagManager:y,useLocation:u}),[i,l,n,g,p,y,u]);return P.jsx(V.Provider,{value:f,children:o})},G=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:o="/login",localStorageKey:g="user",redirect401Path:p="/login",...l})=>{var D,F,B,k;const{axios:i=l.axios,useLocation:u=l.useLocation,useAuth:y=l.useAuth,Outlet:f=l.Outlet,Navigate:T=l.Navigate}=E.useContext(V);if(y===void 0)throw new Error(G("useAuth"));if(u===void 0)throw new Error(G("useLocation"));if(f===void 0)throw new Error(G("Outlet"));if(T===void 0)throw new Error(G("Navigate"));const[_,C]=E.useState(null),{isLogged:S}=y(),O=u();return E.useLayoutEffect(()=>{i==null||i.interceptors.response.use(d=>d,async d=>{var z;return typeof d=="object"&&d&&"response"in d&&d.response&&typeof d.response=="object"&&"status"in d.response&&d.response&&typeof d.response=="object"&&"status"in d.response&&((z=d==null?void 0:d.response)==null?void 0:z.status)===401&&(i.defaults.headers.common.Authorization=null,localStorage.removeItem(g),C(p)),Promise.reject(d)})},[i==null?void 0:i.defaults,i==null?void 0:i.interceptors.response,g,p]),S&&!_?P.jsx(E.Suspense,{fallback:n,children:(F=(D=O.state)==null?void 0:D.from)!=null&&F.state&&((k=(B=O.state)==null?void 0:B.from)==null?void 0:k.pathname)===o?P.jsx(T,{to:O.state.from.state.from.pathname+O.state.from.state.from.search,replace:!0}):P.jsx(f,{})}):P.jsx(T,{to:o,state:{from:O},replace:!0})},q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ye=({...n})=>{const{useLocation:o=n.useLocation,Outlet:g=n.Outlet,useGoogleTagManager:p=n.useGoogleTagManager}=E.useContext(V);if(o===void 0)throw new Error(q("useLocation"));if(g===void 0)throw new Error(q("Outlet"));if(p===void 0)throw new Error(q("useGoogleTagManager"));const{pathname:l}=o(),{sendEvent:i}=p();return E.useEffect(()=>{i({event:"pageView",pathname:l})},[l,i]),P.jsx(g,{})},Ve=({axios:n,baseURL:o,userLocalStorageKey:g="user",postContentType:p="application/json"})=>(E.useLayoutEffect(()=>{if(!n.defaults)return;const l=localStorage.getItem(g),i=l?JSON.parse(l):null,u=i&&typeof i=="object"&&"tokenType"in i&&i.tokenType?i.tokenType:null,y=i&&typeof i=="object"&&"accessToken"in i&&i.accessToken?i.accessToken:null,f=l?`${u} ${y}`:null;n.defaults.baseURL=o,n.defaults.headers.post["Content-Type"]=p,f&&(n.defaults.headers.common.Authorization=f)},[n.defaults,n.defaults.baseURL,n.defaults.headers.common,n.defaults.headers.post,o,p,g]),null),Ne=({i18n:n,initReactI18next:o,resources:g,LanguageDetector:p})=>(n.use(p).use(o).init({debug:!1,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{useSuspense:!0},resources:g,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",l=>{document.documentElement.setAttribute("lang",l)}),null),Ue=({dsn:n,sentry:o})=>(E.useLayoutEffect(()=>{o&&process.env.NODE_ENV!=="development"&&o.init({dsn:n,integrations:[new o.BrowserTracing],tracesSampleRate:1})},[n,o]),null),Ge=({IMaskMixin:n,...o})=>{const g=E.useMemo(()=>n(({TextField:p,...l})=>P.jsx(p,{...l})),[n]);return P.jsx(g,{...o})},Be=({mapbox:n,accessToken:o})=>(E.useLayoutEffect(()=>{n&&o&&(n.accessToken=o)},[o,n]),null),ze=({children:n,defaultOptions:o,QueryClient:g,QueryClientProvider:p})=>{const l=new g({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...o}}});return P.jsx(p,{client:l,children:n})},Je=n=>{const{unknownErrorTranslationKey:o="error.unknownError"}=n||{},{translate:g=n==null?void 0:n.translate}=E.useContext(V);return{printError:E.useCallback(l=>{var y,f,T,_,C,S,O,D,F;const i=g?g(o):"Unknown error",{response:u}=l||{};return l!=null&&l.reason?String(l.reason):(y=u==null?void 0:u.data)!=null&&y.reason?String(u.data.reason):(f=u==null?void 0:u.data)!=null&&f.message?String(u.data.message):(_=(T=u==null?void 0:u.data)==null?void 0:T.detail)!=null&&_.length&&Array.isArray((C=u==null?void 0:u.data)==null?void 0:C.detail)&&((O=(S=u==null?void 0:u.data)==null?void 0:S.detail[0])!=null&&O.msg)&&typeof((F=(D=u==null?void 0:u.data)==null?void 0:D.detail[0])==null?void 0:F.msg)=="string"?String(u.data.detail[0].msg):i},[g,o])}},He=({data:n,fetchNextPage:o,isFetchingNextPage:g,isInitialLoading:p,isLoading:l,enabled:i=!0})=>{const u=E.useCallback(async f=>{g||!i||await o({pageParam:(f==null?void 0:f.pageParam)||f.visibleRowsCount})},[i,o,g]),y=E.useMemo(()=>{if(n)return n.pages.reduce((f,T)=>[...f,...T],[])},[n]);return{fetchNextPageOnRowsScrollEnd:u,isLoading:g||l,loadingVariant:p?"skeleton":"linear",rows:y}};R.AxiosConfig=Ve,R.GTMSendPageView=Ye,R.I18nConfig=Ne,R.InjectDependenciesContext=V,R.InjectDependenciesProvider=Me,R.MapBoxConfig=Be,R.MaskTextField=Ge,R.QueryClientConfigProvider=ze,R.RequireAuth=We,R.SentryConfig=Ue,R.useInfiniteDataGrid=He,R.useResponseError=Je,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tracktor/shared-module",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"types": "./dist/main.d.ts",
|
|
7
|
-
"main": "./dist/main.cjs",
|
|
7
|
+
"main": "./dist/main.umd.cjs",
|
|
8
8
|
"module": "./dist/main.js",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
14
|
"import": "./dist/main.js",
|
|
15
|
-
"require": "./dist/main.cjs"
|
|
15
|
+
"require": "./dist/main.umd.cjs"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
@@ -36,20 +36,19 @@
|
|
|
36
36
|
"react-dom": "^18.2.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@testing-library/jest-dom": "^5.
|
|
39
|
+
"@testing-library/jest-dom": "^5.17.0",
|
|
40
40
|
"@testing-library/react": "^14.0.0",
|
|
41
|
-
"@testing-library/react-hooks": "^8.0.1",
|
|
42
41
|
"@testing-library/user-event": "^14.4.3",
|
|
43
|
-
"@types/react": "^18.
|
|
44
|
-
"@types/react-dom": "^18.
|
|
45
|
-
"@vitejs/plugin-react": "^
|
|
46
|
-
"eslint-config-react-tracktor": "^1.
|
|
42
|
+
"@types/react": "^18.2.18",
|
|
43
|
+
"@types/react-dom": "^18.2.7",
|
|
44
|
+
"@vitejs/plugin-react": "^4.0.4",
|
|
45
|
+
"eslint-config-react-tracktor": "^1.1.3",
|
|
47
46
|
"husky": "^8.0.3",
|
|
48
|
-
"jsdom": "^21.1.
|
|
47
|
+
"jsdom": "^21.1.2",
|
|
49
48
|
"typescript": "^4.9.5",
|
|
50
|
-
"vite": "^4.
|
|
51
|
-
"vite-plugin-dts": "^
|
|
52
|
-
"vitest": "^0.
|
|
49
|
+
"vite": "^4.4.8",
|
|
50
|
+
"vite-plugin-dts": "^3.5.0",
|
|
51
|
+
"vitest": "^0.34.1"
|
|
53
52
|
},
|
|
54
53
|
"peerDependencies": {
|
|
55
54
|
"react": ">=18.0.0",
|