fina-react-ds 1.0.23 → 1.0.25
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/lib/arrays.d.ts +2 -2
- package/dist/lib/arrays.js +3 -3
- package/dist/lib/http.d.ts +2 -2
- package/dist/lib/http.js +5 -6
- package/package.json +1 -2
package/dist/lib/arrays.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const orderByText: (array: Array<object>, propName: keyof object) => object[];
|
|
2
|
-
declare const orderBy: (array: Array<object>, propName: keyof object) => object[];
|
|
1
|
+
declare const orderByText: (array: Array<object>, propName: keyof object, order?: "asc" | "desc") => object[];
|
|
2
|
+
declare const orderBy: (array: Array<object>, propName: keyof object, order?: "asc" | "desc") => object[];
|
|
3
3
|
export { orderByText, orderBy };
|
package/dist/lib/arrays.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
const f = /* @__PURE__ */
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var c = (r, t) => u(r, "name", { value: t, configurable: !0 });
|
|
3
|
+
const f = /* @__PURE__ */ c((r, t, s = "asc") => r.sort((e, n) => e[t].toLowerCase() < n[t].toLowerCase() ? s === "asc" ? -1 : 1 : e[t].toLowerCase() > n[t].toLowerCase() ? s === "asc" ? 1 : -1 : 0), "orderByText"), i = /* @__PURE__ */ c((r, t, s = "asc") => r.sort((e, n) => e[t] < n[t] ? s === "asc" ? -1 : 1 : e[t] > n[t] ? s === "asc" ? 1 : -1 : 0), "orderBy");
|
|
4
4
|
export {
|
|
5
5
|
i as orderBy,
|
|
6
6
|
f as orderByText
|
package/dist/lib/http.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Makes a HTTP request to the API.
|
|
3
3
|
* @param {"GET" | "POST" | "PUT" | "PATCH" | "DELETE"} method - The HTTP method
|
|
4
|
-
* @param {string}
|
|
4
|
+
* @param {string} url - The url to call
|
|
5
5
|
* @param {Object} queryParams - The query params to add to the URL
|
|
6
6
|
* @param {(FormData | Object)} body - The request's body
|
|
7
7
|
* @param {Object} headers - Additional headers to include in the request
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* @returns {Promise<Object>} The response from the API.
|
|
10
10
|
* @throws {ApiClientError} If the request fails, an error object with the status code, raw response, and a message is returned.
|
|
11
11
|
*/
|
|
12
|
-
declare const requestApi: (method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE",
|
|
12
|
+
declare const requestApi: (method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, queryParams?: object | null, body?: FormData | object | null, headers?: object | null, isMultipart?: boolean) => Promise<any>;
|
|
13
13
|
export { requestApi };
|
package/dist/lib/http.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
var p = Object.defineProperty;
|
|
2
2
|
var s = (t, r) => p(t, "name", { value: r, configurable: !0 });
|
|
3
3
|
import m from "qs";
|
|
4
|
-
|
|
5
|
-
const h = /* @__PURE__ */ s((t) => t != null, "valueExists"), d = /* @__PURE__ */ s((t, r) => {
|
|
4
|
+
const h = /* @__PURE__ */ s((t) => t != null, "valueExists"), j = /* @__PURE__ */ s((t, r) => {
|
|
6
5
|
if (t) {
|
|
7
6
|
if (t instanceof FormData)
|
|
8
7
|
return t;
|
|
@@ -21,9 +20,9 @@ const h = /* @__PURE__ */ s((t) => t != null, "valueExists"), d = /* @__PURE__ *
|
|
|
21
20
|
return JSON.stringify(t);
|
|
22
21
|
}
|
|
23
22
|
}, "formatBodyForRequest"), g = /* @__PURE__ */ s((t, r = null) => {
|
|
24
|
-
let e =
|
|
23
|
+
let e = t;
|
|
25
24
|
return r && (e += `?${m.stringify(r, { encode: !1 })}`), e;
|
|
26
|
-
}, "formatUrlForRequest"),
|
|
25
|
+
}, "formatUrlForRequest"), v = /* @__PURE__ */ s(async (t, r, e = null, a = null, n = null, o = !1) => {
|
|
27
26
|
const u = new Headers({
|
|
28
27
|
Accept: "application/json",
|
|
29
28
|
...n
|
|
@@ -32,7 +31,7 @@ const h = /* @__PURE__ */ s((t) => t != null, "valueExists"), d = /* @__PURE__ *
|
|
|
32
31
|
const c = {
|
|
33
32
|
method: t,
|
|
34
33
|
headers: u,
|
|
35
|
-
body:
|
|
34
|
+
body: j(a, o)
|
|
36
35
|
};
|
|
37
36
|
let i = null;
|
|
38
37
|
const l = await fetch(
|
|
@@ -55,5 +54,5 @@ const h = /* @__PURE__ */ s((t) => t != null, "valueExists"), d = /* @__PURE__ *
|
|
|
55
54
|
});
|
|
56
55
|
}, "handleResponse");
|
|
57
56
|
export {
|
|
58
|
-
|
|
57
|
+
v as requestApi
|
|
59
58
|
};
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "https://github.com/F1na/fina-react-ds"
|
|
6
6
|
},
|
|
7
7
|
"private": false,
|
|
8
|
-
"version": "1.0.
|
|
8
|
+
"version": "1.0.25",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"sonner": "^2.0.5",
|
|
38
38
|
"tailwind-merge": "^3.3.1",
|
|
39
39
|
"tw-animate-css": "^1.3.5",
|
|
40
|
-
"ufo": "^1.6.1",
|
|
41
40
|
"yup": "^1.6.1"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|