@litianxiang/portal-core 0.1.17 → 0.1.18

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.d.ts CHANGED
@@ -302,4 +302,20 @@ interface FetchUserMenuForStoreOptions {
302
302
  */
303
303
  declare function fetchUserMenuForStore(store: CoreUserStoreLike, options: FetchUserMenuForStoreOptions): Promise<boolean>;
304
304
 
305
- export { type AppRouterOptions, type BreadcrumbItem, type CoreMenuItem, type CoreUserStoreLike, type CreateAuthHttpClientOptions, DEFAULT_HOME_PATH, type FetchUserMenuForStoreOptions, type FontSize, type InactivityConfig, type InactivityResult, type LogoutToAuthOptions, type MenuHelper, type MenuHelperOptions, type PermissionHelper, type PermissionHelperOptions, type PresetRangeKey, type SidebarMenuFilterOptions, type SyncFromAuthStoreOptions, type TabItem, type ThemeConfig, type ThemeMode, type TimeInput, type TimeRange, type TransformMenuOptions, addTab, applyTheme, buildAllMenuTree, buildPageMenuList, calcInactivityAction, closeAll, closeLeft, closeOthers, closeRight, createAppRouter, createAuthHttpClient, createLogoutToAuth, createMenuHelper, createPermissionHelper, createRange, fetchUserMenuForStore, filterSidebarMenu, findFirstPagePath, formatRange, formatTime, formatToMonthDay, formatToWanShou, formatToYi, formatWanYuanToYi, getPresetRange, humanizeTime, initTheme, isInRange, removeTab, syncFromAuthStoreToStore, timeDiff, transformMenuTree, useThemeWatcher, useTime };
305
+ interface LoadingState {
306
+ loadingCount: number;
307
+ isLoading: boolean;
308
+ }
309
+ /**
310
+ * 为 Pinia 创建通用的 Loading Store 配置
311
+ */
312
+ declare function createLoadingStoreOptions(): {
313
+ state: () => LoadingState;
314
+ actions: {
315
+ startLoading(this: LoadingState & Record<string, any>): void;
316
+ stopLoading(this: LoadingState & Record<string, any>): void;
317
+ resetLoading(this: LoadingState & Record<string, any>): void;
318
+ };
319
+ };
320
+
321
+ export { type AppRouterOptions, type BreadcrumbItem, type CoreMenuItem, type CoreUserStoreLike, type CreateAuthHttpClientOptions, DEFAULT_HOME_PATH, type FetchUserMenuForStoreOptions, type FontSize, type InactivityConfig, type InactivityResult, type LoadingState, type LogoutToAuthOptions, type MenuHelper, type MenuHelperOptions, type PermissionHelper, type PermissionHelperOptions, type PresetRangeKey, type SidebarMenuFilterOptions, type SyncFromAuthStoreOptions, type TabItem, type ThemeConfig, type ThemeMode, type TimeInput, type TimeRange, type TransformMenuOptions, addTab, applyTheme, buildAllMenuTree, buildPageMenuList, calcInactivityAction, closeAll, closeLeft, closeOthers, closeRight, createAppRouter, createAuthHttpClient, createLoadingStoreOptions, createLogoutToAuth, createMenuHelper, createPermissionHelper, createRange, fetchUserMenuForStore, filterSidebarMenu, findFirstPagePath, formatRange, formatTime, formatToMonthDay, formatToWanShou, formatToYi, formatWanYuanToYi, getPresetRange, humanizeTime, initTheme, isInRange, removeTab, syncFromAuthStoreToStore, timeDiff, transformMenuTree, useThemeWatcher, useTime };
package/dist/index.js CHANGED
@@ -818,6 +818,30 @@ async function fetchUserMenuForStore(store, options) {
818
818
  return false;
819
819
  }
820
820
  }
821
+
822
+ // src/loading/loading.ts
823
+ function createLoadingStoreOptions() {
824
+ return {
825
+ state: () => ({
826
+ loadingCount: 0,
827
+ isLoading: false
828
+ }),
829
+ actions: {
830
+ startLoading() {
831
+ this.loadingCount++;
832
+ this.isLoading = this.loadingCount > 0;
833
+ },
834
+ stopLoading() {
835
+ this.loadingCount = Math.max(0, this.loadingCount - 1);
836
+ this.isLoading = this.loadingCount > 0;
837
+ },
838
+ resetLoading() {
839
+ this.loadingCount = 0;
840
+ this.isLoading = false;
841
+ }
842
+ }
843
+ };
844
+ }
821
845
  export {
822
846
  DEFAULT_HOME_PATH,
823
847
  addTab,
@@ -831,6 +855,7 @@ export {
831
855
  closeRight,
832
856
  createAppRouter,
833
857
  createAuthHttpClient,
858
+ createLoadingStoreOptions,
834
859
  createLogoutToAuth,
835
860
  createMenuHelper,
836
861
  createPermissionHelper,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@litianxiang/portal-core",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",