@admin-layout/gluestack-ui-mobile 12.2.4-alpha.0 → 12.2.4-alpha.103
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 +104 -8
- package/lib/components/ErrorBounday.js.map +1 -1
- package/lib/components/Fallback.js +11 -11
- package/lib/components/Fallback.js.map +1 -1
- package/lib/components/InputToolBar/InputToolBar.d.ts +8 -0
- package/lib/components/InputToolBar/InputToolBar.js +219 -0
- package/lib/components/InputToolBar/InputToolBar.js.map +1 -0
- package/lib/components/InputToolBar/defaults.d.ts +14 -0
- package/lib/components/InputToolBar/defaults.js +60 -0
- package/lib/components/InputToolBar/defaults.js.map +1 -0
- package/lib/components/InputToolBar/index.d.ts +4 -0
- package/lib/components/InputToolBar/index.js +3 -0
- package/lib/components/InputToolBar/index.js.map +1 -0
- package/lib/components/InputToolBar/types.d.ts +153 -0
- package/lib/components/InputToolBar/types.js +2 -0
- package/lib/components/InputToolBar/types.js.map +1 -0
- package/lib/components/Layout/components/BasicLayout.js +1 -5
- package/lib/components/Layout/components/BasicLayout.js.map +1 -1
- package/lib/components/Layout/components/BottomTabBar.js +2 -2
- package/lib/components/Layout/components/BottomTabBar.js.map +1 -1
- package/lib/components/Layout/components/Sample.js.map +1 -1
- package/lib/components/Layout/components/SideBar.js +5 -6
- package/lib/components/Layout/components/SideBar.js.map +1 -1
- package/lib/components/NavigationComponent.js +1 -1
- package/lib/components/NavigationComponent.js.map +1 -1
- package/lib/components/ToastAlert.d.ts +1 -1
- package/lib/components/ToastAlert.js +2 -2
- package/lib/components/ToastAlert.js.map +1 -1
- package/lib/components/UnAuthenticatedComponent.js +1 -1
- package/lib/components/UnAuthenticatedComponent.js.map +1 -1
- package/lib/components/WithConfiguration.d.ts +1 -6
- package/lib/components/WithConfiguration.js +1 -4
- package/lib/components/WithConfiguration.js.map +1 -1
- package/lib/components/WithPermission.d.ts +1 -11
- package/lib/components/WithPermission.js +0 -8
- package/lib/components/WithPermission.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/usePermissionAutoFetch.d.ts +4 -56
- package/lib/components/usePermissionAutoFetch.js +7 -20
- package/lib/components/usePermissionAutoFetch.js.map +1 -1
- package/lib/components/useSetting.d.ts +11 -6
- package/lib/components/useSetting.js +10 -75
- package/lib/components/useSetting.js.map +1 -1
- package/lib/containers/layout/BasicLayout.js +3 -3
- package/lib/containers/layout/BasicLayout.js.map +1 -1
- package/lib/containers/layout/DrawerBottomNavigationConfig.d.ts +63 -303
- package/lib/containers/layout/DrawerConfig.d.ts +42 -206
- package/lib/containers/layout/ProLayout.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/tailwind-base-config.d.ts +2 -1
- package/lib/utils/generateMobileNavigations.js +36 -30
- package/lib/utils/generateMobileNavigations.js.map +1 -1
- package/package.json +5 -5
- package/src/components/ErrorBounday.tsx +19 -19
- package/src/components/Fallback.tsx +54 -58
- package/src/components/InputToolBar/InputToolBar.tsx +666 -0
- package/src/components/InputToolBar/README.md +239 -0
- package/src/components/InputToolBar/defaults.ts +72 -0
- package/src/components/InputToolBar/index.ts +18 -0
- package/src/components/InputToolBar/types.ts +166 -0
- package/src/components/Layout/components/BasicLayout.tsx +2 -6
- package/src/components/Layout/components/BottomTabBar.tsx +98 -99
- package/src/components/Layout/components/Sample.tsx +1 -1
- package/src/components/Layout/components/SideBar.tsx +10 -14
- package/src/components/NavigationComponent.tsx +3 -1
- package/src/components/ToastAlert.tsx +11 -11
- package/src/components/UnAuthenticatedComponent.tsx +16 -26
- package/src/components/WithConfiguration.tsx +1 -5
- package/src/components/WithPermission.tsx +0 -9
- package/src/components/index.ts +1 -0
- package/src/components/usePermissionAutoFetch.tsx +7 -22
- package/src/components/useSetting.tsx +22 -100
- package/src/containers/layout/BasicLayout.tsx +3 -3
- package/src/containers/layout/ProLayout.tsx +1 -1
- package/src/index.ts +1 -2
- package/src/utils/generateMobileNavigations.ts +43 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePermissionAutoFetch.js","sourceRoot":"","sources":["../../src/components/usePermissionAutoFetch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"usePermissionAutoFetch.js","sourceRoot":"","sources":["../../src/components/usePermissionAutoFetch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,IAAI,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AAK3G,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAsC,EAAE,EAAE;IAC7E,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,8BAA8B,CAAC,OAAO,CAAC,CAAC;IAEzE,OAAO;QACH,WAAW;QACX,IAAI,EAAE,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,oBAAoB,EAAE,WAAW,EAAE;QACnF,OAAO;KACV,CAAC;AACN,CAAC,CAAC;AAEF,6BAA6B;AAC7B,gFAAgF;AAChF,4EAA4E;AAC5E,mFAAmF;AACnF,6CAA6C;AAC7C,8DAA8D;AAC9D,6CAA6C;AAE7C,2CAA2C;AAC3C,0BAA0B;AAC1B,IAAI;AACJ,sFAAsF;AACtF,+DAA+D;AAC/D,6DAA6D;AAC7D,6EAA6E;AAC7E,mGAAmG;AACnG,0DAA0D;AAC1D,0EAA0E;AAC1E,8BAA8B;AAC9B,yEAAyE;AACzE,mFAAmF;AACnF,qCAAqC;AACrC,mCAAmC;AACnC,gBAAgB;AAChB,YAAY;AACZ,yBAAyB;AACzB,mFAAmF;AACnF,iCAAiC;AACjC,YAAY;AACZ,kDAAkD;AAElD,qEAAqE;AACrE,+CAA+C;AAC/C,uBAAuB;AACvB,qDAAqD;AACrD,aAAa;AACb,qBAAqB;AACrB,iCAAiC;AACjC,+DAA+D;AAC/D,kDAAkD;AAClD,aAAa;AACb,UAAU;AACV,mEAAmE;AACnE,KAAK"}
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IConfigurationsFlattenedKeys, IPreferencesInput, IPreferencesOpenOptionsInput, IConfigurationOverridesInput } from 'common';
|
|
2
2
|
import { ConfigurationTarget } from 'common';
|
|
3
|
-
import { QueryResult } from '@apollo/client/react';
|
|
4
|
-
import { ExecutionResult } from 'graphql';
|
|
5
3
|
export interface ISettingsVariable {
|
|
6
4
|
overrides?: IConfigurationOverridesInput;
|
|
7
|
-
configKey:
|
|
5
|
+
configKey: IConfigurationsFlattenedKeys;
|
|
8
6
|
options?: IPreferencesOpenOptionsInput;
|
|
9
7
|
skip?: boolean;
|
|
10
8
|
}
|
|
11
|
-
interface IResponse
|
|
9
|
+
interface IResponse {
|
|
10
|
+
data?: {
|
|
11
|
+
resolveConfiguration?: unknown;
|
|
12
|
+
};
|
|
13
|
+
loading: boolean;
|
|
14
|
+
error?: unknown;
|
|
12
15
|
preferencesInput?: IPreferencesInput;
|
|
13
16
|
updateConfiguration?: ({ updateKey, value, updateOverrides, target, }: {
|
|
14
17
|
updateKey?: string;
|
|
15
18
|
value: string | boolean | number;
|
|
16
19
|
updateOverrides?: IConfigurationOverridesInput;
|
|
17
20
|
target?: ConfigurationTarget;
|
|
18
|
-
}) => Promise<
|
|
21
|
+
}) => Promise<unknown>;
|
|
22
|
+
refetch?: Function;
|
|
23
|
+
[key: string]: unknown;
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
26
|
* Provides configuration for Organization and OrganizationResources. By default, it provides Organization configuration.
|
|
@@ -1,87 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { omitBy, isNil } from 'lodash-es';
|
|
3
|
-
import { useResolveConfigurationQuery, useOpenPreferencesSettingsQuery, useUpdateConfigurationMutation, } from 'common/lib/generated/generated.js';
|
|
1
|
+
import { useSetting as usePlatformSetting } from '@adminide-stack/platform-client';
|
|
4
2
|
/**
|
|
5
3
|
* Provides configuration for Organization and OrganizationResources. By default, it provides Organization configuration.
|
|
6
4
|
* If you need `resource` level configuration then, you need to provide resource URI in `overrides`.
|
|
7
5
|
* @param baseOptions
|
|
8
6
|
*/
|
|
9
7
|
export const useSetting = (settingsVariable) => {
|
|
10
|
-
const {
|
|
11
|
-
const targetResource = overrides?.resource ?? null;
|
|
12
|
-
let prefLoaded = false;
|
|
13
|
-
const { data: prefData, error: prefError, loading: perfLoading, refetch: refetchPrefData, } = useOpenPreferencesSettingsQuery({
|
|
14
|
-
variables: { resource: targetResource, options },
|
|
15
|
-
fetchPolicy: 'cache-first', // to make `{always: true}` to work
|
|
16
|
-
skip: prefLoaded,
|
|
17
|
-
});
|
|
18
|
-
React.useEffect(() => {
|
|
19
|
-
refetchPrefData({ resource: targetResource, options });
|
|
20
|
-
}, [targetResource]);
|
|
21
|
-
prefLoaded = perfLoading || skip;
|
|
22
|
-
const [updateConfigurationMutation] = useUpdateConfigurationMutation();
|
|
23
|
-
const modifiedOverrides = {
|
|
24
|
-
...overrides,
|
|
25
|
-
resource: targetResource ? prefData?.openPreferencesSettings?.editableSettingsInput ?? null : null,
|
|
26
|
-
};
|
|
27
|
-
const defaultOverrides = omitBy(modifiedOverrides, isNil);
|
|
28
|
-
let { data: settingsData, error: settingError, loading: settingLoading, ...remaining } = useResolveConfigurationQuery({
|
|
29
|
-
variables: {
|
|
30
|
-
input: prefData?.openPreferencesSettings ?? null,
|
|
31
|
-
key: configKey,
|
|
32
|
-
overrides: defaultOverrides,
|
|
33
|
-
},
|
|
34
|
-
fetchPolicy: 'cache-and-network', // to make `{always: true}` to work
|
|
35
|
-
skip: prefLoaded || !!prefError || !prefData?.openPreferencesSettings?.editableSettingsInput,
|
|
36
|
-
});
|
|
37
|
-
React.useEffect(() => {
|
|
38
|
-
remaining?.refetch({
|
|
39
|
-
input: prefData?.openPreferencesSettings ?? null,
|
|
40
|
-
key: configKey,
|
|
41
|
-
overrides: defaultOverrides,
|
|
42
|
-
});
|
|
43
|
-
}, [prefData]);
|
|
44
|
-
let loading = true;
|
|
45
|
-
if (!settingLoading && !prefLoaded) {
|
|
46
|
-
loading = false;
|
|
47
|
-
}
|
|
48
|
-
const error = settingError || prefError;
|
|
49
|
-
if (error) {
|
|
50
|
-
return {
|
|
51
|
-
error,
|
|
52
|
-
data: undefined,
|
|
53
|
-
loading: false,
|
|
54
|
-
...remaining,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
if (loading) {
|
|
58
|
-
return {
|
|
59
|
-
error,
|
|
60
|
-
data: undefined,
|
|
61
|
-
loading,
|
|
62
|
-
...remaining,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
const updateConfiguration = ({ value, updateKey, updateOverrides, target }) => {
|
|
66
|
-
return updateConfigurationMutation({
|
|
67
|
-
variables: {
|
|
68
|
-
key: updateKey || configKey,
|
|
69
|
-
value,
|
|
70
|
-
target,
|
|
71
|
-
overrides: updateOverrides || defaultOverrides,
|
|
72
|
-
input: prefData?.openPreferencesSettings,
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
};
|
|
8
|
+
const { data, updateConfiguration, ...remaining } = usePlatformSetting(settingsVariable);
|
|
76
9
|
return {
|
|
77
|
-
data:
|
|
78
|
-
loading,
|
|
79
|
-
error,
|
|
10
|
+
data: data === undefined ? undefined : { resolveConfiguration: data },
|
|
80
11
|
...remaining,
|
|
81
|
-
|
|
82
|
-
|
|
12
|
+
updateConfiguration: ({ value, updateKey, updateOverrides, target }) => {
|
|
13
|
+
return updateConfiguration?.({
|
|
14
|
+
value,
|
|
15
|
+
updateKey,
|
|
16
|
+
updateOverrides,
|
|
17
|
+
target,
|
|
18
|
+
});
|
|
83
19
|
},
|
|
84
|
-
updateConfiguration,
|
|
85
20
|
};
|
|
86
21
|
};
|
|
87
22
|
//# sourceMappingURL=useSetting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSetting.js","sourceRoot":"","sources":["../../src/components/useSetting.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSetting.js","sourceRoot":"","sources":["../../src/components/useSetting.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AA+BnF;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,gBAAmC,EAAa,EAAE;IACzE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,GAAG,SAAS,EAAE,GAAG,kBAAkB,CAAC,gBAAuB,CAAC,CAAC;IAEhG,OAAO;QACH,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,oBAAoB,EAAE,IAAI,EAAE;QACrE,GAAG,SAAS;QACZ,mBAAmB,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,EAAE;YACnE,OAAO,mBAAmB,EAAE,CAAC;gBACzB,KAAK;gBACL,SAAS;gBACT,eAAe;gBACf,MAAM;aACT,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -2,15 +2,15 @@ import * as React from 'react';
|
|
|
2
2
|
import { connect } from 'react-redux';
|
|
3
3
|
import { Ionicons } from '@expo/vector-icons';
|
|
4
4
|
import { BasicLayout } from '../../components';
|
|
5
|
-
import {
|
|
5
|
+
import { useNavigate } from 'react-router-native';
|
|
6
6
|
import { useSelector } from 'react-redux';
|
|
7
7
|
import { CHANGE_SETTINGS_ACTION } from '@admin-layout/client';
|
|
8
8
|
const Layout = (props) => {
|
|
9
9
|
const user = useSelector((state) => state?.user);
|
|
10
10
|
const { settings } = props;
|
|
11
|
-
const
|
|
11
|
+
const navigate = useNavigate();
|
|
12
12
|
const logout = () => {
|
|
13
|
-
|
|
13
|
+
navigate('/logout');
|
|
14
14
|
};
|
|
15
15
|
return (React.createElement(BasicLayout, { ...props, ...settings, showSettings: true, currentRoute: props.route.routes.find((route) => {
|
|
16
16
|
if (route.path.split('/').pop() === props.location.pathname.split('/').pop()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasicLayout.js","sourceRoot":"","sources":["../../../src/containers/layout/BasicLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAY,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BasicLayout.js","sourceRoot":"","sources":["../../../src/containers/layout/BasicLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAY,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAM9D,MAAM,MAAM,GAAsD,CAAC,KAAK,EAAE,EAAE;IACxE,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtD,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,MAAM,GAAG,GAAG,EAAE;QAChB,QAAQ,CAAC,SAAS,CAAC,CAAC;IACxB,CAAC,CAAC;IACF,OAAO,CACH,oBAAC,WAAW,OACJ,KAAK,KACL,QAAQ,EACZ,YAAY,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