jclib-ui 1.0.51 → 1.0.54
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/jclib-ui.es.js +14 -9
- package/dist/jclib-ui.es.js.map +1 -1
- package/dist/jclib-ui.umd.js +2 -2
- package/dist/jclib-ui.umd.js.map +1 -1
- package/package.json +10 -10
package/dist/jclib-ui.es.js
CHANGED
|
@@ -4134,7 +4134,7 @@ const LibProvider = ({ apiConfig, children, versionApp, useTheme }) => {
|
|
|
4134
4134
|
};
|
|
4135
4135
|
function useLibContext() {
|
|
4136
4136
|
const context = useContext(LibContext);
|
|
4137
|
-
if (!(context == null ? void 0 : context.addModal)) {
|
|
4137
|
+
if (!(context == null ? void 0 : context.addModal) && true) {
|
|
4138
4138
|
throw new Error("'ModalProvider' não encontrado!");
|
|
4139
4139
|
}
|
|
4140
4140
|
return context;
|
|
@@ -7677,7 +7677,7 @@ const initialRequestInfo = {
|
|
|
7677
7677
|
report: false,
|
|
7678
7678
|
onBefore: null
|
|
7679
7679
|
};
|
|
7680
|
-
function useApi(initialConfig) {
|
|
7680
|
+
function useApi(initialConfig = {}) {
|
|
7681
7681
|
const history = useHistory();
|
|
7682
7682
|
const controller = new AbortController();
|
|
7683
7683
|
const { globalApiConfig } = useLibContext();
|
|
@@ -7697,7 +7697,7 @@ function useApi(initialConfig) {
|
|
|
7697
7697
|
username: globalApiConfig.auth.username,
|
|
7698
7698
|
password: globalApiConfig.auth.password
|
|
7699
7699
|
};
|
|
7700
|
-
initialConfig.headers = {};
|
|
7700
|
+
initialConfig.headers = { ...initialConfig.headers, ...localConfig == null ? void 0 : localConfig.headers };
|
|
7701
7701
|
if (globalApiConfig.getToken) {
|
|
7702
7702
|
let token = globalApiConfig.getToken();
|
|
7703
7703
|
if (token) {
|
|
@@ -7711,25 +7711,30 @@ function useApi(initialConfig) {
|
|
|
7711
7711
|
initialConfig.cache = Boolean(
|
|
7712
7712
|
globalApiConfig.isProductionMode && (!initialConfig.method || initialConfig.method == "get")
|
|
7713
7713
|
);
|
|
7714
|
-
if (initialConfig
|
|
7714
|
+
if (initialConfig.cache) {
|
|
7715
7715
|
await cache.init(initialConfig);
|
|
7716
|
+
}
|
|
7716
7717
|
let finalConfig = {
|
|
7717
7718
|
baseURL: globalApiConfig.baseURL,
|
|
7718
7719
|
timeout: globalApiConfig.timeout,
|
|
7719
7720
|
auth,
|
|
7720
7721
|
validateStatus: (status) => status >= 200 && status < 400,
|
|
7721
7722
|
...initialConfig,
|
|
7722
|
-
...localConfig
|
|
7723
|
+
...localConfig,
|
|
7724
|
+
headers: initialConfig.headers
|
|
7723
7725
|
};
|
|
7724
|
-
if (finalConfig.report)
|
|
7726
|
+
if (finalConfig.report) {
|
|
7725
7727
|
finalConfig = { ...finalConfig, responseType: "blob", timeout: 0 };
|
|
7728
|
+
}
|
|
7726
7729
|
setRequestInfo({ ...initialRequestInfo, loading: true });
|
|
7727
|
-
if (finalConfig.onBefore)
|
|
7730
|
+
if (finalConfig.onBefore) {
|
|
7728
7731
|
finalConfig.onBefore(finalConfig);
|
|
7732
|
+
}
|
|
7729
7733
|
try {
|
|
7730
7734
|
const res = await axios({ ...finalConfig, signal: controller.signal });
|
|
7731
|
-
if (globalApiConfig.afterRequest)
|
|
7735
|
+
if (globalApiConfig.afterRequest) {
|
|
7732
7736
|
globalApiConfig.afterRequest(res);
|
|
7737
|
+
}
|
|
7733
7738
|
response = {
|
|
7734
7739
|
...initialRequestInfo,
|
|
7735
7740
|
data: res.data,
|
|
@@ -20767,7 +20772,7 @@ const MenuOptionLink = styled(Link)`
|
|
|
20767
20772
|
grid-template-columns: 28px 1fr auto;
|
|
20768
20773
|
align-items: center;
|
|
20769
20774
|
|
|
20770
|
-
padding: 7px 10px;
|
|
20775
|
+
padding: 7px 10px 7px 18px;
|
|
20771
20776
|
border-radius: 99px;
|
|
20772
20777
|
|
|
20773
20778
|
font-family: var(--font-navbar);
|