react-toolkits 0.0.4 → 0.0.5

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > react-toolkits@0.0.4 build /home/runner/work/everythingflow/everythingflow/packages/react-toolkits
2
+ > react-toolkits@0.0.5 build /home/runner/work/everythingflow/everythingflow/packages/react-toolkits
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -13,8 +13,8 @@
13
13
  ESM dist/512_orange_nobackground-L6MFCL6M.png 9.49 KB
14
14
  ESM dist/index.css 4.51 KB
15
15
  ESM dist/index.css.map 7.65 KB
16
- ESM dist/index.esm.js 115.88 KB
17
- ESM dist/index.esm.js.map 160.69 KB
18
- ESM ⚡️ Build success in 1388ms
19
- DTS ⚡️ Build success in 7304ms
20
- DTS dist/index.d.mts 7.40 KB
16
+ ESM dist/index.esm.js 116.47 KB
17
+ ESM dist/index.esm.js.map 161.28 KB
18
+ ESM ⚡️ Build success in 1983ms
19
+ DTS ⚡️ Build success in 8777ms
20
+ DTS dist/index.d.mts 8.28 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # react-toolkits
2
2
 
3
+ ## 0.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 3c0ff88: release react-toolkits
8
+
3
9
  ## 0.0.4
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- import * as react from 'react';
1
+ import * as React from 'react';
2
2
  import { FC, PropsWithChildren, ForwardedRef, ReactElement, ReactNode } from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { FormProps, FormInstance, ModalProps, ButtonProps } from 'antd';
5
5
  import { Merge } from 'ts-essentials';
6
6
  import { TableProps } from 'antd/es/table';
7
- import { AxiosRequestConfig } from 'axios';
7
+ import { AxiosRequestConfig, AxiosInstance } from 'axios';
8
8
  import * as zustand_middleware from 'zustand/middleware';
9
9
  import * as zustand from 'zustand';
10
10
  import { RouteObject } from 'react-router-dom';
@@ -53,7 +53,7 @@ type UseFormModalProps<T> = Merge<Omit<FormModalProps<T>, 'open' | 'onCancel' |
53
53
  content: FormModalProps<T>['children'];
54
54
  }>;
55
55
  declare function useFormModal<T extends object>(props: UseFormModalProps<T>): {
56
- Modal: react.ReactPortal;
56
+ Modal: React.ReactPortal;
57
57
  showModal: (options?: {
58
58
  initialValues?: RecursivePartial<T> | undefined;
59
59
  title?: FormModalProps<T>['title'];
@@ -72,21 +72,6 @@ interface PermissionButtonProps extends Omit<ButtonProps, 'disabled'> {
72
72
  }
73
73
  declare const PermissionButton: FC<PropsWithChildren<PermissionButtonProps>>;
74
74
 
75
- type MenuItemType2 = Merge<MenuItemType, {
76
- code /** 权限编号 **/?: string;
77
- route /** 前端路由地址 **/?: string;
78
- }>;
79
- type SubMenuType2 = Merge<SubMenuType, {
80
- children?: ItemType2[];
81
- }>;
82
- type MenuItemGroupType2 = Merge<MenuItemGroupType, {
83
- children?: ItemType2[];
84
- }>;
85
- type ItemType2 = MenuItemType2 | SubMenuType2 | MenuItemGroupType2 | MenuDividerType | null;
86
- interface NavBarProps {
87
- items: ItemType2[];
88
- }
89
-
90
75
  type PaginationParams = {
91
76
  page: number;
92
77
  perPage: number;
@@ -102,21 +87,30 @@ interface QueryListProps<Item, Values> extends Pick<TableProps<Item>, 'columns'
102
87
  }
103
88
  declare const QueryList: <Item extends object, Values = {}>(props: QueryListProps<Item, Values>) => react_jsx_runtime.JSX.Element;
104
89
 
105
- declare class FetcherError extends Error {
106
- code: number;
90
+ type ShimmedAxiosInstance = Merge<AxiosInstance, {
91
+ request<T = unknown, D = unknown>(config: AxiosRequestConfig<D>): Promise<T>;
92
+ get<T = unknown, D = unknown>(url: string, config?: AxiosRequestConfig<D>): Promise<T>;
93
+ delete<T = unknown, D = unknown>(url: string, config?: AxiosRequestConfig<D>): Promise<T>;
94
+ head<T = unknown, D = unknown>(url: string, config?: AxiosRequestConfig<D>): Promise<T>;
95
+ post<T = unknown, D = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig<D>): Promise<T>;
96
+ put<T = unknown, D = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig<D>): Promise<T>;
97
+ patch<T = unknown, D = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig<D>): Promise<T>;
98
+ }>;
99
+ declare class HttpClientError extends Error {
100
+ code?: number;
107
101
  skip: boolean;
108
- constructor(message: string, code: number, skip?: boolean);
102
+ constructor(message: string, code?: number, skip?: boolean);
109
103
  }
110
- declare function useFetcher(): <T = unknown>(config: AxiosRequestConfig) => Promise<T>;
104
+ declare function useHttpClient(): ShimmedAxiosInstance;
111
105
 
112
106
  interface PermissionCheckResult {
113
107
  [k: string]: boolean;
114
108
  }
115
109
  declare function usePermissions(codes: string[]): {
116
- data: Record<string, boolean> | undefined;
117
- isLoading: boolean;
110
+ data: Record<string, boolean>;
111
+ isLoading: false;
118
112
  };
119
- declare function usePermission(code?: string): {
113
+ declare function usePermission(code: string): {
120
114
  accessible: boolean;
121
115
  isValidating: boolean;
122
116
  };
@@ -176,8 +170,25 @@ declare const useQueryTriggerStore: zustand.UseBoundStore<zustand.StoreApi<Query
176
170
 
177
171
  declare const Login: FC<PropsWithChildren>;
178
172
 
173
+ declare const NoMatch: () => react_jsx_runtime.JSX.Element;
174
+
179
175
  declare const routes: RouteObject;
180
176
 
177
+ type MenuItemType2 = Merge<MenuItemType, {
178
+ code /** 权限编号 **/?: string;
179
+ route /** 前端路由地址 **/?: string;
180
+ }>;
181
+ type SubMenuType2 = Merge<SubMenuType, {
182
+ children?: ItemType2[];
183
+ }>;
184
+ type MenuItemGroupType2 = Merge<MenuItemGroupType, {
185
+ children?: ItemType2[];
186
+ }>;
187
+ type ItemType2 = MenuItemType2 | SubMenuType2 | MenuItemGroupType2 | MenuDividerType | null;
188
+ interface NavBarProps {
189
+ items: ItemType2[];
190
+ }
191
+
181
192
  interface LayoutProps {
182
193
  title?: ReactNode;
183
194
  items: ItemType2[];
@@ -185,4 +196,6 @@ interface LayoutProps {
185
196
  }
186
197
  declare const Layout: FC<PropsWithChildren<LayoutProps>>;
187
198
 
188
- export { DynamicTags, DynamicTagsProps, FetcherError, FilterForm, FilterFormProps, FormModal, FormModalProps, FormModalRef, Highlight, HighlightTextsProps, ItemType2, Layout, LayoutProps, Login, MenuState, NavBarProps, PermissionButton, PermissionButtonProps, PermissionCheckResult, QueryList, QueryListKey, QueryListProps, QueryTriggerState, TokenState, UseFormModalProps, routes as permission, useFetcher, useFormModal, useMenuStore, usePermission, usePermissions, useQueryTriggerStore, useTokenStore };
199
+ declare const SSO_URL = "https://idaas.ifunplus.cn/enduser/api/application/plugin_FunPlus/sso/v1";
200
+
201
+ export { DynamicTags, DynamicTagsProps, FilterForm, FilterFormProps, FormModal, FormModalProps, FormModalRef, Highlight, HighlightTextsProps, HttpClientError, ItemType2, Layout, LayoutProps, Login, MenuState, NavBarProps, NoMatch, PermissionButton, PermissionButtonProps, PermissionCheckResult, QueryList, QueryListKey, QueryListProps, QueryTriggerState, SSO_URL, TokenState, UseFormModalProps, routes as permission, useFormModal, useHttpClient, useMenuStore, usePermission, usePermissions, useQueryTriggerStore, useTokenStore };