@dartcom/ui-kit 3.8.2 → 3.8.4
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/index.cjs +7 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/lib/hooks/useLogout.d.ts.map +1 -1
- package/dist/lib/hooks/useSignIn.d.ts.map +1 -1
- package/dist/pages/auth/auth.d.ts +2 -2
- package/dist/pages/auth/auth.d.ts.map +1 -1
- package/dist/pages/auth/auth.stories.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -47002,7 +47002,7 @@ const AuthProvider = ({ onUnauthorized, children, }) => {
|
|
|
47002
47002
|
}, [authStore.isUnauthorized]);
|
|
47003
47003
|
return jsxRuntime.jsx(React__namespace.Fragment, { children: children });
|
|
47004
47004
|
};
|
|
47005
|
-
var auth
|
|
47005
|
+
var auth = observer(AuthProvider);
|
|
47006
47006
|
|
|
47007
47007
|
class RootStore {
|
|
47008
47008
|
authStore = new AuthStore();
|
|
@@ -61547,13 +61547,13 @@ const encodeString = (string) => {
|
|
|
61547
61547
|
const useSignIn = () => {
|
|
61548
61548
|
return useMutation({
|
|
61549
61549
|
mutationKey: ['sign-in'],
|
|
61550
|
-
mutationFn: ({ body: { username, password } }) => {
|
|
61550
|
+
mutationFn: async ({ body: { username, password } }) => {
|
|
61551
61551
|
const values = {
|
|
61552
61552
|
username,
|
|
61553
61553
|
password: encodeString(password),
|
|
61554
61554
|
};
|
|
61555
61555
|
const body = Object.keys(values).reduce((request, key, index) => `${request}${index === 0 ? '' : '&'}${key}=${values[key]}`, '');
|
|
61556
|
-
|
|
61556
|
+
const response = await GlobalConfig.instance.apiService.post({
|
|
61557
61557
|
url: 'token',
|
|
61558
61558
|
body,
|
|
61559
61559
|
config: {
|
|
@@ -61562,6 +61562,7 @@ const useSignIn = () => {
|
|
|
61562
61562
|
},
|
|
61563
61563
|
},
|
|
61564
61564
|
});
|
|
61565
|
+
return response;
|
|
61565
61566
|
},
|
|
61566
61567
|
});
|
|
61567
61568
|
};
|
|
@@ -61576,11 +61577,7 @@ const useLogout = () => {
|
|
|
61576
61577
|
return response;
|
|
61577
61578
|
},
|
|
61578
61579
|
onError: showErrorSnackbar,
|
|
61579
|
-
onSuccess: () => {
|
|
61580
|
-
queryClient.invalidateQueries({
|
|
61581
|
-
queryKey: ['user'],
|
|
61582
|
-
});
|
|
61583
|
-
},
|
|
61580
|
+
onSuccess: () => { },
|
|
61584
61581
|
});
|
|
61585
61582
|
};
|
|
61586
61583
|
|
|
@@ -63933,7 +63930,6 @@ const AuthPage = ({ onSuccessSignIn }) => {
|
|
|
63933
63930
|
alignItems: 'center',
|
|
63934
63931
|
}, children: [jsxRuntime.jsx(Typography, { variant: "h4", children: "Authorization" }), jsxRuntime.jsx(CustomInput, { ...register('username'), label: "Login", placeholder: "Enter your login" }), jsxRuntime.jsx(CustomInput, { ...register('password'), label: "Password", placeholder: "Enter your password", type: "password" }), jsxRuntime.jsx(Button$1, { type: "submit", variant: "contained", disabled: !isValid, children: "Sign in" })] }) }));
|
|
63935
63932
|
};
|
|
63936
|
-
var auth = observer(AuthPage);
|
|
63937
63933
|
|
|
63938
63934
|
// define() gets called for each chunk generated by the first Rollup pass.
|
|
63939
63935
|
// The order the chunks are called in is controlled by the imports in bundle.js:
|
|
@@ -63990,12 +63986,12 @@ var tangram_min = /*#__PURE__*/Object.freeze({
|
|
|
63990
63986
|
});
|
|
63991
63987
|
|
|
63992
63988
|
exports.ApiService = ApiService;
|
|
63993
|
-
exports.AuthPage =
|
|
63989
|
+
exports.AuthPage = AuthPage;
|
|
63994
63990
|
exports.AuthStore = AuthStore;
|
|
63995
63991
|
exports.Button = Button$1;
|
|
63996
63992
|
exports.Card = CustomCard;
|
|
63997
63993
|
exports.Checkbox = CustomCheckbox;
|
|
63998
|
-
exports.DartcomAuthProvider = auth
|
|
63994
|
+
exports.DartcomAuthProvider = auth;
|
|
63999
63995
|
exports.DartcomMobxProvider = DartcomMobxProvider;
|
|
64000
63996
|
exports.DartcomProviders = DartcomProviders;
|
|
64001
63997
|
exports.DeleteButton = DeleteButton;
|