propro-common-components 0.1.44 → 0.1.45

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.
@@ -0,0 +1,7 @@
1
+ import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
2
+ interface FetchDataParams<TData> {
3
+ endpoint: string;
4
+ options?: Omit<UseQueryOptions<TData, Error>, 'queryKey' | 'queryFn'>;
5
+ }
6
+ export declare function useGet<TData = unknown>(key: string[], { endpoint, options }: FetchDataParams<TData>): UseQueryResult<TData, Error>;
7
+ export default useGet;
@@ -1,7 +1,7 @@
1
1
  import { QueryKey, UseMutationOptions, UseMutationResult } from "@tanstack/react-query";
2
2
  import { AxiosError, AxiosRequestConfig } from "axios";
3
3
  import { ToastOptions } from "react-toastify";
4
- declare const useMutate: ({ url, method, headers, invalidateAllQueries, successLog, errorLog, logURL, toastMessage, onSuccess, onError, }: {
4
+ declare const useMutate: <TData = unknown, TError = AxiosError<unknown, any>, TVariables = void, TContext = unknown>({ url, method, headers, invalidateAllQueries, successLog, errorLog, logURL, toastMessage, onSuccess, onError, }: {
5
5
  url: string;
6
6
  method: "POST" | "PUT" | "DELETE" | "PATCH";
7
7
  headers?: AxiosRequestConfig["headers"];
@@ -17,6 +17,6 @@ declare const useMutate: ({ url, method, headers, invalidateAllQueries, successL
17
17
  options?: ToastOptions<unknown> | undefined;
18
18
  } | undefined;
19
19
  onSuccess?: ((res: unknown) => void) | undefined;
20
- onError?: ((err: AxiosError) => void) | undefined;
21
- }, options?: UseMutationOptions<unknown, AxiosError, unknown, unknown>) => UseMutationResult<unknown, AxiosError, unknown, unknown>;
20
+ onError?: ((err: TError) => void) | undefined;
21
+ }, options?: UseMutationOptions<TData, TError, TVariables, TContext> | undefined) => UseMutationResult<TData, TError, TVariables, TContext>;
22
22
  export default useMutate;
@@ -29689,8 +29689,7 @@ const useMutate = ({
29689
29689
  className: "hidden",
29690
29690
  id: "avatar-input",
29691
29691
  onChange: async (g) => {
29692
- const b = new FormData();
29693
- b.append("file", g.target.files[0]), await m(b);
29692
+ new FormData().append("file", g.target.files[0]);
29694
29693
  }
29695
29694
  }
29696
29695
  ),
@@ -37189,7 +37188,7 @@ var parseStyle = function m(g) {
37189
37188
  function uniqueHash(m, g) {
37190
37189
  return murmur2$1("".concat(m.join("%")).concat(g));
37191
37190
  }
37192
- function Empty$1() {
37191
+ function Empty() {
37193
37192
  return null;
37194
37193
  }
37195
37194
  var STYLE_PREFIX = "style";
@@ -37249,7 +37248,7 @@ function useStyleRegister(m, g) {
37249
37248
  return function(be) {
37250
37249
  var ve;
37251
37250
  if (!Z || re || !B)
37252
- ve = /* @__PURE__ */ React.createElement(Empty$1, null);
37251
+ ve = /* @__PURE__ */ React.createElement(Empty, null);
37253
37252
  else {
37254
37253
  var Se;
37255
37254
  ve = /* @__PURE__ */ React.createElement("style", _extends$5({}, (Se = {}, _defineProperty$1(Se, ATTR_TOKEN, me), _defineProperty$1(Se, ATTR_MARK, ye), Se), {
@@ -56682,14 +56681,14 @@ var _propertyDesc = function(m, g) {
56682
56681
  writable: !(m & 4),
56683
56682
  value: g
56684
56683
  };
56685
- }, dP$2 = require_objectDp(), createDesc$2 = _propertyDesc, _hide = require_descriptors() ? function(m, g, b) {
56686
- return dP$2.f(m, g, createDesc$2(1, b));
56684
+ }, dP$1 = require_objectDp(), createDesc$2 = _propertyDesc, _hide = require_descriptors() ? function(m, g, b) {
56685
+ return dP$1.f(m, g, createDesc$2(1, b));
56687
56686
  } : function(m, g, b) {
56688
56687
  return m[g] = b, m;
56689
56688
  }, hasOwnProperty = {}.hasOwnProperty, _has = function(m, g) {
56690
56689
  return hasOwnProperty.call(m, g);
56691
- }, global$4 = _globalExports, core$2 = _coreExports, ctx = _ctx, hide$1 = _hide, has$6 = _has, PROTOTYPE$2 = "prototype", $export$5 = function(m, g, b) {
56692
- var _ = m & $export$5.F, x = m & $export$5.G, C = m & $export$5.S, $ = m & $export$5.P, I = m & $export$5.B, R = m & $export$5.W, P = x ? core$2 : core$2[g] || (core$2[g] = {}), N = P[PROTOTYPE$2], z = x ? global$4 : C ? global$4[g] : (global$4[g] || {})[PROTOTYPE$2], D, B, W;
56690
+ }, global$4 = _globalExports, core$2 = _coreExports, ctx = _ctx, hide$1 = _hide, has$6 = _has, PROTOTYPE$1 = "prototype", $export$5 = function(m, g, b) {
56691
+ var _ = m & $export$5.F, x = m & $export$5.G, C = m & $export$5.S, $ = m & $export$5.P, I = m & $export$5.B, R = m & $export$5.W, P = x ? core$2 : core$2[g] || (core$2[g] = {}), N = P[PROTOTYPE$1], z = x ? global$4 : C ? global$4[g] : (global$4[g] || {})[PROTOTYPE$1], D, B, W;
56693
56692
  x && (b = g);
56694
56693
  for (D in b)
56695
56694
  B = !_ && z && z[D] !== void 0, !(B && has$6(P, D)) && (W = B ? z[D] : b[D], P[D] = x && typeof z[D] != "function" ? b[D] : I && B ? ctx(W, global$4) : R && z[D] == W ? function(V) {
@@ -56707,7 +56706,7 @@ var _propertyDesc = function(m, g) {
56707
56706
  }
56708
56707
  return V.apply(this, arguments);
56709
56708
  };
56710
- return Z[PROTOTYPE$2] = V[PROTOTYPE$2], Z;
56709
+ return Z[PROTOTYPE$1] = V[PROTOTYPE$1], Z;
56711
56710
  }(W) : $ && typeof W == "function" ? ctx(Function.call, W) : W, $ && ((P.virtual || (P.virtual = {}))[D] = W, m & $export$5.R && N && !N[D] && hide$1(N, D, W)));
56712
56711
  };
56713
56712
  $export$5.F = 1;
@@ -56767,15 +56766,15 @@ var _sharedExports = _shared.exports, id$1 = 0, px = Math.random(), _uid = funct
56767
56766
  return "Symbol(".concat(m === void 0 ? "" : m, ")_", (++id$1 + px).toString(36));
56768
56767
  }, shared$1 = _sharedExports("keys"), uid$2 = _uid, _sharedKey = function(m) {
56769
56768
  return shared$1[m] || (shared$1[m] = uid$2(m));
56770
- }, has$5 = _has, toIObject$4 = _toIobject, arrayIndexOf = _arrayIncludes(!1), IE_PROTO$2 = _sharedKey("IE_PROTO"), _objectKeysInternal = function(m, g) {
56769
+ }, has$5 = _has, toIObject$4 = _toIobject, arrayIndexOf = _arrayIncludes(!1), IE_PROTO$1 = _sharedKey("IE_PROTO"), _objectKeysInternal = function(m, g) {
56771
56770
  var b = toIObject$4(m), _ = 0, x = [], C;
56772
56771
  for (C in b)
56773
- C != IE_PROTO$2 && has$5(b, C) && x.push(C);
56772
+ C != IE_PROTO$1 && has$5(b, C) && x.push(C);
56774
56773
  for (; g.length > _; )
56775
56774
  has$5(b, C = g[_++]) && (~arrayIndexOf(x, C) || x.push(C));
56776
56775
  return x;
56777
- }, _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), $keys$1 = _objectKeysInternal, enumBugKeys$1 = _enumBugKeys, _objectKeys = Object.keys || function(g) {
56778
- return $keys$1(g, enumBugKeys$1);
56776
+ }, _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), $keys$2 = _objectKeysInternal, enumBugKeys = _enumBugKeys, _objectKeys = Object.keys || function(g) {
56777
+ return $keys$2(g, enumBugKeys);
56779
56778
  }, _objectGops = {};
56780
56779
  _objectGops.f = Object.getOwnPropertySymbols;
56781
56780
  var _objectPie = {}, hasRequired_objectPie;
@@ -56818,8 +56817,8 @@ _extends.default = _assign2.default || function(m) {
56818
56817
  }
56819
56818
  return m;
56820
56819
  };
56821
- var has$4 = _has, toObject$2 = _toObject, IE_PROTO$1 = _sharedKey("IE_PROTO"), ObjectProto$1 = Object.prototype, _objectGpo = Object.getPrototypeOf || function(m) {
56822
- return m = toObject$2(m), has$4(m, IE_PROTO$1) ? m[IE_PROTO$1] : typeof m.constructor == "function" && m instanceof m.constructor ? m.constructor.prototype : m instanceof Object ? ObjectProto$1 : null;
56820
+ var has$4 = _has, toObject$2 = _toObject, IE_PROTO = _sharedKey("IE_PROTO"), ObjectProto$1 = Object.prototype, _objectGpo = Object.getPrototypeOf || function(m) {
56821
+ return m = toObject$2(m), has$4(m, IE_PROTO) ? m[IE_PROTO] : typeof m.constructor == "function" && m instanceof m.constructor ? m.constructor.prototype : m instanceof Object ? ObjectProto$1 : null;
56823
56822
  }, _objectSap, hasRequired_objectSap;
56824
56823
  function require_objectSap() {
56825
56824
  if (hasRequired_objectSap)
@@ -56871,12 +56870,20 @@ var possibleConstructorReturn = {}, _typeof$1 = {}, toInteger = _toInteger, defi
56871
56870
  var _ = String(defined(g)), x = toInteger(b), C = _.length, $, I;
56872
56871
  return x < 0 || x >= C ? m ? "" : void 0 : ($ = _.charCodeAt(x), $ < 55296 || $ > 56319 || x + 1 === C || (I = _.charCodeAt(x + 1)) < 56320 || I > 57343 ? m ? _.charAt(x) : $ : m ? _.slice(x, x + 2) : ($ - 55296 << 10) + (I - 56320) + 65536);
56873
56872
  };
56874
- }, _redefine = _hide, _iterators = {}, dP$1 = require_objectDp(), anObject$2 = _anObject, getKeys$1 = _objectKeys, _objectDps = require_descriptors() ? Object.defineProperties : function(g, b) {
56875
- anObject$2(g);
56876
- for (var _ = getKeys$1(b), x = _.length, C = 0, $; x > C; )
56877
- dP$1.f(g, $ = _[C++], b[$]);
56878
- return g;
56879
- }, _html, hasRequired_html;
56873
+ }, _redefine = _hide, _iterators = {}, _objectDps, hasRequired_objectDps;
56874
+ function require_objectDps() {
56875
+ if (hasRequired_objectDps)
56876
+ return _objectDps;
56877
+ hasRequired_objectDps = 1;
56878
+ var m = require_objectDp(), g = _anObject, b = _objectKeys;
56879
+ return _objectDps = require_descriptors() ? Object.defineProperties : function(x, C) {
56880
+ g(x);
56881
+ for (var $ = b(C), I = $.length, R = 0, P; I > R; )
56882
+ m.f(x, P = $[R++], C[P]);
56883
+ return x;
56884
+ }, _objectDps;
56885
+ }
56886
+ var _html, hasRequired_html;
56880
56887
  function require_html() {
56881
56888
  if (hasRequired_html)
56882
56889
  return _html;
@@ -56884,16 +56891,24 @@ function require_html() {
56884
56891
  var m = _globalExports.document;
56885
56892
  return _html = m && m.documentElement, _html;
56886
56893
  }
56887
- var anObject$1 = _anObject, dPs = _objectDps, enumBugKeys = _enumBugKeys, IE_PROTO = _sharedKey("IE_PROTO"), Empty = function() {
56888
- }, PROTOTYPE$1 = "prototype", createDict = function() {
56889
- var m = require_domCreate()("iframe"), g = enumBugKeys.length, b = "<", _ = ">", x;
56890
- for (m.style.display = "none", require_html().appendChild(m), m.src = "javascript:", x = m.contentWindow.document, x.open(), x.write(b + "script" + _ + "document.F=Object" + b + "/script" + _), x.close(), createDict = x.F; g--; )
56891
- delete createDict[PROTOTYPE$1][enumBugKeys[g]];
56892
- return createDict();
56893
- }, _objectCreate = Object.create || function(g, b) {
56894
- var _;
56895
- return g !== null ? (Empty[PROTOTYPE$1] = anObject$1(g), _ = new Empty(), Empty[PROTOTYPE$1] = null, _[IE_PROTO] = g) : _ = createDict(), b === void 0 ? _ : dPs(_, b);
56896
- }, _wks = { exports: {} }, store = _sharedExports("wks"), uid$1 = _uid, Symbol$1 = _globalExports.Symbol, USE_SYMBOL = typeof Symbol$1 == "function", $exports = _wks.exports = function(m) {
56894
+ var _objectCreate, hasRequired_objectCreate;
56895
+ function require_objectCreate() {
56896
+ if (hasRequired_objectCreate)
56897
+ return _objectCreate;
56898
+ hasRequired_objectCreate = 1;
56899
+ var m = _anObject, g = require_objectDps(), b = _enumBugKeys, _ = _sharedKey("IE_PROTO"), x = function() {
56900
+ }, C = "prototype", $ = function() {
56901
+ var I = require_domCreate()("iframe"), R = b.length, P = "<", N = ">", z;
56902
+ for (I.style.display = "none", require_html().appendChild(I), I.src = "javascript:", z = I.contentWindow.document, z.open(), z.write(P + "script" + N + "document.F=Object" + P + "/script" + N), z.close(), $ = z.F; R--; )
56903
+ delete $[C][b[R]];
56904
+ return $();
56905
+ };
56906
+ return _objectCreate = Object.create || function(R, P) {
56907
+ var N;
56908
+ return R !== null ? (x[C] = m(R), N = new x(), x[C] = null, N[_] = R) : N = $(), P === void 0 ? N : g(N, P);
56909
+ }, _objectCreate;
56910
+ }
56911
+ var _wks = { exports: {} }, store = _sharedExports("wks"), uid$1 = _uid, Symbol$1 = _globalExports.Symbol, USE_SYMBOL = typeof Symbol$1 == "function", $exports = _wks.exports = function(m) {
56897
56912
  return store[m] || (store[m] = USE_SYMBOL && Symbol$1[m] || (USE_SYMBOL ? Symbol$1 : uid$1)("Symbol." + m));
56898
56913
  };
56899
56914
  $exports.store = store;
@@ -56904,7 +56919,7 @@ function require_iterCreate() {
56904
56919
  if (hasRequired_iterCreate)
56905
56920
  return _iterCreate;
56906
56921
  hasRequired_iterCreate = 1;
56907
- var m = _objectCreate, g = _propertyDesc, b = _setToStringTag, _ = {};
56922
+ var m = require_objectCreate(), g = _propertyDesc, b = _setToStringTag, _ = {};
56908
56923
  return _hide(_, _wksExports("iterator"), function() {
56909
56924
  return this;
56910
56925
  }), _iterCreate = function(x, C, $) {
@@ -57027,17 +57042,11 @@ var iterator$1 = _wksExt.f("iterator"), iterator = { default: iterator$1, __esMo
57027
57042
  return g;
57028
57043
  }, cof = _cof, _isArray = Array.isArray || function(g) {
57029
57044
  return cof(g) == "Array";
57030
- }, _objectGopnExt = {}, _objectGopn = {}, hasRequired_objectGopn;
57031
- function require_objectGopn() {
57032
- if (hasRequired_objectGopn)
57033
- return _objectGopn;
57034
- hasRequired_objectGopn = 1;
57035
- var m = _objectKeysInternal, g = _enumBugKeys.concat("length", "prototype");
57036
- return _objectGopn.f = Object.getOwnPropertyNames || function(_) {
57037
- return m(_, g);
57038
- }, _objectGopn;
57039
- }
57040
- var toIObject$2 = _toIobject, gOPN$1 = require_objectGopn().f, toString = {}.toString, windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [], getWindowNames = function(m) {
57045
+ }, _objectGopnExt = {}, _objectGopn = {}, $keys$1 = _objectKeysInternal, hiddenKeys = _enumBugKeys.concat("length", "prototype");
57046
+ _objectGopn.f = Object.getOwnPropertyNames || function(g) {
57047
+ return $keys$1(g, hiddenKeys);
57048
+ };
57049
+ var toIObject$2 = _toIobject, gOPN$1 = _objectGopn.f, toString = {}.toString, windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [], getWindowNames = function(m) {
57041
57050
  try {
57042
57051
  return gOPN$1(m);
57043
57052
  } catch {
@@ -57057,7 +57066,7 @@ _objectGopd.f = require_descriptors() ? gOPD$1 : function(g, b) {
57057
57066
  if (has$1(g, b))
57058
57067
  return createDesc$1(!pIE.f.call(g, b), g[b]);
57059
57068
  };
57060
- var global$1 = _globalExports, has = _has, DESCRIPTORS = require_descriptors(), $export$2 = _export, redefine = _redefine, META = _metaExports.KEY, $fails = require_fails(), shared = _sharedExports, setToStringTag = _setToStringTag, uid = _uid, wks = _wksExports, wksExt = _wksExt, wksDefine = _wksDefine, enumKeys = _enumKeys, isArray = _isArray, anObject = _anObject, isObject = _isObject, toObject = _toObject, toIObject = _toIobject, toPrimitive = _toPrimitive, createDesc = _propertyDesc, _create$1 = _objectCreate, gOPNExt = _objectGopnExt, $GOPD = _objectGopd, $GOPS = _objectGops, $DP = require_objectDp(), $keys = _objectKeys, gOPD = $GOPD.f, dP = $DP.f, gOPN = gOPNExt.f, $Symbol = global$1.Symbol, $JSON = global$1.JSON, _stringify = $JSON && $JSON.stringify, PROTOTYPE = "prototype", HIDDEN = wks("_hidden"), TO_PRIMITIVE = wks("toPrimitive"), isEnum = {}.propertyIsEnumerable, SymbolRegistry = shared("symbol-registry"), AllSymbols = shared("symbols"), OPSymbols = shared("op-symbols"), ObjectProto = Object[PROTOTYPE], USE_NATIVE = typeof $Symbol == "function" && !!$GOPS.f, QObject = global$1.QObject, setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild, setSymbolDesc = DESCRIPTORS && $fails(function() {
57069
+ var global$1 = _globalExports, has = _has, DESCRIPTORS = require_descriptors(), $export$2 = _export, redefine = _redefine, META = _metaExports.KEY, $fails = require_fails(), shared = _sharedExports, setToStringTag = _setToStringTag, uid = _uid, wks = _wksExports, wksExt = _wksExt, wksDefine = _wksDefine, enumKeys = _enumKeys, isArray = _isArray, anObject = _anObject, isObject = _isObject, toObject = _toObject, toIObject = _toIobject, toPrimitive = _toPrimitive, createDesc = _propertyDesc, _create$1 = require_objectCreate(), gOPNExt = _objectGopnExt, $GOPD = _objectGopd, $GOPS = _objectGops, $DP = require_objectDp(), $keys = _objectKeys, gOPD = $GOPD.f, dP = $DP.f, gOPN = gOPNExt.f, $Symbol = global$1.Symbol, $JSON = global$1.JSON, _stringify = $JSON && $JSON.stringify, PROTOTYPE = "prototype", HIDDEN = wks("_hidden"), TO_PRIMITIVE = wks("toPrimitive"), isEnum = {}.propertyIsEnumerable, SymbolRegistry = shared("symbol-registry"), AllSymbols = shared("symbols"), OPSymbols = shared("op-symbols"), ObjectProto = Object[PROTOTYPE], USE_NATIVE = typeof $Symbol == "function" && !!$GOPS.f, QObject = global$1.QObject, setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild, setSymbolDesc = DESCRIPTORS && $fails(function() {
57061
57070
  return _create$1(dP({}, "a", {
57062
57071
  get: function() {
57063
57072
  return dP(this, "a", { value: 7 }).a;
@@ -57108,7 +57117,7 @@ USE_NATIVE || ($Symbol = function() {
57108
57117
  return DESCRIPTORS && setter && setSymbolDesc(ObjectProto, g, { configurable: !0, set: b }), wrap(g);
57109
57118
  }, redefine($Symbol[PROTOTYPE], "toString", function() {
57110
57119
  return this._k;
57111
- }), $GOPD.f = $getOwnPropertyDescriptor, $DP.f = $defineProperty, require_objectGopn().f = gOPNExt.f = $getOwnPropertyNames, require_objectPie().f = $propertyIsEnumerable, $GOPS.f = $getOwnPropertySymbols, DESCRIPTORS && !_library && redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable), wksExt.f = function(m) {
57120
+ }), $GOPD.f = $getOwnPropertyDescriptor, $DP.f = $defineProperty, _objectGopn.f = gOPNExt.f = $getOwnPropertyNames, require_objectPie().f = $propertyIsEnumerable, $GOPS.f = $getOwnPropertySymbols, DESCRIPTORS && !_library && redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable), wksExt.f = function(m) {
57112
57121
  return wrap(wks(m));
57113
57122
  });
57114
57123
  $export$2($export$2.G + $export$2.W + $export$2.F * !USE_NATIVE, { Symbol: $Symbol });
@@ -57235,7 +57244,7 @@ function require_setProto() {
57235
57244
  var $export$1 = _export;
57236
57245
  $export$1($export$1.S, "Object", { setPrototypeOf: require_setProto().set });
57237
57246
  var setPrototypeOf$1 = _coreExports.Object.setPrototypeOf, setPrototypeOf = { default: setPrototypeOf$1, __esModule: !0 }, $export = _export;
57238
- $export($export.S, "Object", { create: _objectCreate });
57247
+ $export($export.S, "Object", { create: require_objectCreate() });
57239
57248
  var $Object = _coreExports.Object, create$1 = function(g, b) {
57240
57249
  return $Object.create(g, b);
57241
57250
  }, create = { default: create$1, __esModule: !0 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propro-common-components",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "type": "module",
5
5
  "main": "dist/propro-common-components.js",
6
6
  "types": "dist/main.d.ts",
@@ -1,3 +0,0 @@
1
- import { DefaultError, DefinedUseQueryResult, UseQueryResult } from "@tanstack/react-query";
2
- declare const useGet: (key: string[], endpoint: string, options?: object) => UseQueryResult<unknown, DefaultError> | DefinedUseQueryResult<unknown, DefaultError>;
3
- export default useGet;