@asaleh37/ui-base 1.2.1 → 1.2.3
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/.env +4 -0
- package/.env.development +1 -0
- package/.env.production +1 -0
- package/dist/index.d.ts +7 -37
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/index.html +13 -0
- package/package.json +1 -1
- package/public/__logo.png +0 -0
- package/public/logo.png +0 -0
- package/public/vite.svg +1 -0
- package/rollup.config-1748377725725.cjs +16 -16
- package/src/assets/logo.png +0 -0
- package/src/components/App.tsx +39 -9
- package/src/components/BaseApp.tsx +37 -25
- package/src/components/admin/RoleAuthoritiesForm.tsx +65 -0
- package/src/components/admin/RoleGrid.tsx +67 -13
- package/src/components/common/Login.tsx +10 -3
- package/src/components/templates/TransferList.tsx +4 -7
- package/src/hooks/useApiActions.ts +1 -2
- package/src/layout/Layout.tsx +36 -29
- package/src/main.tsx +25 -0
- package/src/redux/features/CounterSlice.tsx +13 -0
- package/src/redux/features/common/AppInfoSlice.ts +1 -1
- package/src/redux/features/common/CommonStoreSlice.ts +19 -5
- package/src/redux/store.ts +25 -24
- package/src/util/constants.ts +5 -1
- package/vite.config.ts +10 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
|
2
2
|
|
|
3
3
|
export interface CommonStoresInterface {
|
|
4
|
-
[key: string]: StoreMetaData;
|
|
4
|
+
stores: { [key: string]: StoreMetaData };
|
|
5
|
+
storeKeys: Array<String>;
|
|
6
|
+
isAutoLoadLoaded: boolean;
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
interface setStoreDataProps {
|
|
@@ -16,17 +18,29 @@ export interface StoreMetaData {
|
|
|
16
18
|
authority?: string;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
export const commonStoresInitialState: CommonStoresInterface = {
|
|
21
|
+
export const commonStoresInitialState: CommonStoresInterface = {
|
|
22
|
+
stores: {},
|
|
23
|
+
storeKeys: [],
|
|
24
|
+
isAutoLoadLoaded: false,
|
|
25
|
+
};
|
|
20
26
|
|
|
21
27
|
const commonStoreSlice = createSlice({
|
|
22
28
|
name: "loadingMask",
|
|
23
29
|
initialState: commonStoresInitialState,
|
|
24
30
|
reducers: {
|
|
25
|
-
|
|
26
|
-
state
|
|
31
|
+
setStoresMetaData: (state, action) => {
|
|
32
|
+
state.stores = action.payload;
|
|
33
|
+
state.storeKeys = Object.keys(action.payload);
|
|
34
|
+
},
|
|
35
|
+
setStoreData: (state, action: PayloadAction<setStoreDataProps>) => {
|
|
36
|
+
state.stores[action.payload.storeKey].data = action.payload.data;
|
|
37
|
+
},
|
|
38
|
+
setAutoLoadLoaded: () => {
|
|
39
|
+
state.isAutoLoadLoaded = true;
|
|
27
40
|
},
|
|
28
41
|
},
|
|
29
42
|
});
|
|
30
43
|
|
|
31
|
-
export const { setStoreData } =
|
|
44
|
+
export const { setStoreData, setStoresMetaData, setAutoLoadLoaded } =
|
|
45
|
+
commonStoreSlice.actions;
|
|
32
46
|
export default commonStoreSlice.reducer;
|
package/src/redux/store.ts
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { configureStore, Reducer } from "@reduxjs/toolkit";
|
|
2
|
-
import AppLayoutReducer from "./features/common/AppLayoutSlice";
|
|
3
|
-
import UserSessionReducer from "./features/common/UserSessionSlice";
|
|
4
|
-
import LoadingMaskReducer from "./features/common/LoadingMaskSlice";
|
|
5
|
-
import CommonStoreReducer from "./features/common/CommonStoreSlice";
|
|
6
|
-
import AppInfoReducer from "./features/common/AppInfoSlice";
|
|
1
|
+
// import { configureStore, Reducer } from "@reduxjs/toolkit";
|
|
2
|
+
// import AppLayoutReducer from "./features/common/AppLayoutSlice";
|
|
3
|
+
// import UserSessionReducer from "./features/common/UserSessionSlice";
|
|
4
|
+
// import LoadingMaskReducer from "./features/common/LoadingMaskSlice";
|
|
5
|
+
// import CommonStoreReducer from "./features/common/CommonStoreSlice";
|
|
6
|
+
// import AppInfoReducer from "./features/common/AppInfoSlice";
|
|
7
7
|
|
|
8
|
-
const reducers = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
8
|
+
// const reducers = {
|
|
9
|
+
// AppLayout: AppLayoutReducer,
|
|
10
|
+
// UserSession: UserSessionReducer,
|
|
11
|
+
// loadingMask: LoadingMaskReducer,
|
|
12
|
+
// commonStores: CommonStoreReducer,
|
|
13
|
+
// AppInfo: AppInfoReducer,
|
|
14
|
+
// };
|
|
15
15
|
|
|
16
|
-
export function addReducer(key: string, reducer: Reducer<any>) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
16
|
+
// export function addReducer(key: string, reducer: Reducer<any>) {
|
|
17
|
+
// debugger;
|
|
18
|
+
// // if (!reducers[key]) {
|
|
19
|
+
// reducers[key] = reducer;
|
|
20
|
+
// // }
|
|
21
|
+
// }
|
|
21
22
|
|
|
22
|
-
export const store = configureStore({
|
|
23
|
-
|
|
24
|
-
});
|
|
23
|
+
// export const store = configureStore({
|
|
24
|
+
// reducer: reducers,
|
|
25
|
+
// });
|
|
25
26
|
|
|
26
|
-
// Infer the `RootState` and `AppDispatch` types from the store itself
|
|
27
|
-
export type RootState = ReturnType<typeof store.getState>;
|
|
28
|
-
export type AppDispatch = typeof store.dispatch;
|
|
27
|
+
// // Infer the `RootState` and `AppDispatch` types from the store itself
|
|
28
|
+
// export type RootState = ReturnType<typeof store.getState>;
|
|
29
|
+
// export type AppDispatch = typeof store.dispatch;
|
package/src/util/constants.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export const DATE_FORMAT = "YYYY-MM-DD";
|
|
2
|
-
export const DATE_TIME_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
|
2
|
+
export const DATE_TIME_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
|
3
|
+
export const LIGHT_THEME_INITIAL_MAIN_COLOR = "#37505C";
|
|
4
|
+
export const LIGHT_THEME_INITIAL_SECANDARY_COLOR = "#ff6d00";
|
|
5
|
+
export const DARK_THEME_INITIAL_MAIN_COLOR = "#ea690e";
|
|
6
|
+
export const DARK_THEME_INITIAL_SECANDARY_COLOR = "#74776B";
|