@authing/react-ui-components 4.0.8 → 4.0.10-rc.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/react-ui-components",
3
- "version": "4.0.8",
3
+ "version": "4.0.10-rc.0",
4
4
  "private": false,
5
5
  "main": "lib/index.min.js",
6
6
  "typings": "types/index.d.ts",
@@ -234,6 +234,5 @@
234
234
  "webpack-dev-server": "3.11.0",
235
235
  "webpack-manifest-plugin": "2.2.0",
236
236
  "workbox-webpack-plugin": "5.1.4"
237
- },
238
- "gitHead": "44b6d3f22978d3e56895a8aeb580d2f5dcac89d8"
237
+ }
239
238
  }
@@ -248,7 +248,8 @@ declare class MultipleAccount {
248
248
  } | undefined) => void;
249
249
  setUserInfo: (user: Pick<User & {
250
250
  id: string;
251
- }, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
251
+ loginAccount?: string | undefined;
252
+ }, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode" | "loginAccount">) => void;
252
253
  setLoginWayByHttpData: (account: string, data: {
253
254
  username?: string | undefined;
254
255
  phone?: string | undefined;
@@ -290,7 +291,8 @@ declare const useMultipleAccounts: ({ appId, finallyConfig, }: {
290
291
  } | undefined) => void;
291
292
  setUserInfo: (user: Pick<User & {
292
293
  id: string;
293
- }, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
294
+ loginAccount?: string | undefined;
295
+ }, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode" | "loginAccount">) => void;
294
296
  setLoginWayByHttpData: (account: string, data: {
295
297
  username?: string | undefined;
296
298
  phone?: string | undefined;
@@ -19,7 +19,8 @@ export declare const guardEventsFilter: (props: any, multipleInstance?: {
19
19
  } | undefined) => void;
20
20
  setUserInfo: (user: Pick<import("./core/hooks/useMultipleAccounts").User & {
21
21
  id: string;
22
- }, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
22
+ loginAccount?: string | undefined;
23
+ }, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode" | "loginAccount">) => void;
23
24
  setLoginWayByHttpData: (account: string, data: {
24
25
  username?: string | undefined;
25
26
  phone?: string | undefined;
@@ -1,7 +1,6 @@
1
1
  import { FormItemProps } from 'antd/lib/form';
2
2
  import React from 'react';
3
- import { PasswordLoginMethods } from '../../../Type/application';
4
3
  export interface FormItemAccountProps extends FormItemProps {
5
- passwordLoginMethods: PasswordLoginMethods[];
4
+ validPasswordLoginMethods: string[];
6
5
  }
7
6
  export declare const FormItemAccount: React.FC<FormItemAccountProps>;
@@ -3,5 +3,6 @@ import React from 'react';
3
3
  import { PasswordLoginMethods } from '../../../Type/application';
4
4
  export interface InputAccountProps extends InputProps {
5
5
  passwordLoginMethods: PasswordLoginMethods[];
6
+ placeholder: string;
6
7
  }
7
8
  export declare const InputAccount: React.FC<InputAccountProps>;
@@ -14,6 +14,7 @@ declare function useLoginMultipleBackFill(options: {
14
14
  isOnlyInternationSms?: boolean;
15
15
  setAreaCode?: React.Dispatch<React.SetStateAction<string>>;
16
16
  cancelBackfill?: boolean;
17
+ changeCurrentMethod?: (account: string) => void;
17
18
  }): void;
18
19
  /**
19
20
  * 多账号统一状态管理
@@ -33,7 +34,8 @@ declare function useLoginMultiple(setLoginWay: React.Dispatch<any>): {
33
34
  } | undefined) => void;
34
35
  setUserInfo: (user: Pick<import("../../Guard/core/hooks/useMultipleAccounts").User & {
35
36
  id: string;
36
- }, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
37
+ loginAccount?: string | undefined;
38
+ }, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode" | "loginAccount">) => void;
37
39
  setLoginWayByHttpData: (account: string, data: {
38
40
  username?: string | undefined;
39
41
  phone?: string | undefined;
@@ -7,5 +7,7 @@ export interface RegisterWithEmailProps {
7
7
  publicConfig?: ApplicationConfig;
8
8
  agreements: Agreement[];
9
9
  registeContext?: any;
10
+ defaultLabel?: string;
11
+ defaultMethod?: string;
10
12
  }
11
13
  export declare const RegisterWithEmail: React.FC<RegisterWithEmailProps>;
@@ -3,8 +3,8 @@ import { IG2FCProps, IG2Config, IG2Events } from '../Type';
3
3
  import { Agreement, RegisterMethods } from '../Type/application';
4
4
  export interface RegisterConfig extends IG2Config {
5
5
  disableRegister?: boolean;
6
- registerMethods?: RegisterMethods[];
7
- defaultRegisterMethod?: RegisterMethods;
6
+ registerMethods?: string[];
7
+ defaultRegisterMethod?: string;
8
8
  publicKey?: string;
9
9
  agreementEnabled?: boolean;
10
10
  agreements?: Agreement[];
@@ -103,6 +103,11 @@ export declare const enum RegisterMethods {
103
103
  Phone = "phone",
104
104
  EmailCode = "emailCode"
105
105
  }
106
+ export declare const enum RegisterSortMethods {
107
+ Email = "email-password",
108
+ Phone = "phone-code",
109
+ EmailCode = "email-code"
110
+ }
106
111
  export declare type QrcodeTabsSettings = Record<LoginMethods, Array<{
107
112
  id: string;
108
113
  title: string;
@@ -145,9 +150,13 @@ export interface UserExtendsField {
145
150
  export declare type ExtendsField = InternalExtendsField | UserExtendsField;
146
151
  export interface ApplicationPasswordTabConfig {
147
152
  enabledLoginMethods?: PasswordLoginMethods[];
153
+ validRegisterMethods?: string[];
154
+ validLoginMethods?: string[];
148
155
  }
149
156
  export interface ApplicationVerifyCodeTabConfig {
150
157
  enabledLoginMethods: VerifyLoginMethods[];
158
+ validRegisterMethods?: string[];
159
+ validLoginMethods?: string[];
151
160
  }
152
161
  export interface Agreement {
153
162
  id: number;
@@ -159,6 +168,14 @@ export interface Agreement {
159
168
  export declare type PasswordLoginMethods = 'username-password' | 'email-password' | 'phone-password';
160
169
  export declare type VerifyLoginMethods = 'email-code' | 'phone-code';
161
170
  export declare type ComplateFiledsPlace = 'register' | 'login';
171
+ export interface TabFieldsI18nItem {
172
+ key: string;
173
+ label: string;
174
+ labelEn: string;
175
+ i18n: {
176
+ [propName in Lang]?: string;
177
+ };
178
+ }
162
179
  export interface ApplicationConfig {
163
180
  id: string;
164
181
  allowedOrigins: string[];
@@ -264,4 +281,11 @@ export interface ApplicationConfig {
264
281
  * 是否开启注册密码补全
265
282
  */
266
283
  enableCompletePassword: boolean;
284
+ /**
285
+ * 登录注册排序
286
+ */
287
+ tabMethodsSortConfig: {
288
+ loginMethodsSort: string[];
289
+ };
290
+ tabMethodsFields: TabFieldsI18nItem[];
267
291
  }
@@ -3,3 +3,4 @@ import { ValidatorFormItemProps } from '.';
3
3
  export declare const EmailFormItem: React.FC<ValidatorFormItemProps>;
4
4
  export declare const PhoneFormItem: React.FC<ValidatorFormItemProps>;
5
5
  export declare const UserNameFormItem: React.FC<ValidatorFormItemProps>;
6
+ export declare const CustomNameFormItem: React.FC<ValidatorFormItemProps>;
@@ -1,7 +1,7 @@
1
1
  import { FormInstance, FormItemProps } from 'antd/lib/form';
2
2
  import FormItem from 'antd/lib/form/FormItem';
3
3
  import { PasswordFormItem } from './PasswordFormItem';
4
- import { EmailFormItem, PhoneFormItem, UserNameFormItem } from './ValidatorFormItem';
4
+ import { EmailFormItem, PhoneFormItem, UserNameFormItem, CustomNameFormItem } from './ValidatorFormItem';
5
5
  export interface ValidatorFormItemProps extends FormItemProps {
6
6
  form?: FormInstance;
7
7
  checkRepeat?: boolean;
@@ -11,9 +11,10 @@ export interface ValidatorFormItemProps extends FormItemProps {
11
11
  * 控制内部FormItem组件关于pattern的校验规则
12
12
  */
13
13
  isCheckPattern?: boolean;
14
+ defaultMethod?: string;
14
15
  }
15
16
  export interface ValidatorFormItemMetaProps extends ValidatorFormItemProps {
16
- method: 'email' | 'phone' | 'username';
17
+ method: 'email' | 'phone' | 'username' | string;
17
18
  }
18
19
  export interface PasswordFormItemProps extends FormItemProps {
19
20
  }
@@ -26,6 +27,7 @@ interface FormItemInterface extends InternalFormItemType {
26
27
  Email: typeof EmailFormItem;
27
28
  Phone: typeof PhoneFormItem;
28
29
  UserName: typeof UserNameFormItem;
30
+ CustomName: typeof CustomNameFormItem;
29
31
  }
30
32
  declare const CustomFormItem: FormItemInterface;
31
33
  export default CustomFormItem;
@@ -2,7 +2,7 @@
2
2
  import { GuardLocalConfig } from '../../Guard/config';
3
3
  import { GuardHttp } from '../guardHttp';
4
4
  import { GuardPageConfig } from '../../Type';
5
- import { ApplicationConfig, LoginMethods, RegisterMethods } from '../../Type/application';
5
+ import { ApplicationConfig, LoginMethods } from '../../Type/application';
6
6
  export declare const getPublicConfig: (appId: string) => ApplicationConfig;
7
7
  export declare const setPublicConfig: (appId: string, config: ApplicationConfig) => ApplicationConfig;
8
8
  export declare const getPageConfig: (appId: string) => GuardPageConfig;
@@ -26,8 +26,8 @@ export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string
26
26
  loadingComponent?: import("react").ReactNode;
27
27
  openEventsMapping?: boolean | undefined;
28
28
  disableRegister?: boolean | undefined;
29
- registerMethods?: RegisterMethods[] | undefined;
30
- defaultRegisterMethod?: RegisterMethods | undefined;
29
+ registerMethods?: string[] | undefined;
30
+ defaultRegisterMethod?: string | undefined;
31
31
  publicKey?: string | undefined;
32
32
  agreementEnabled?: boolean | undefined;
33
33
  agreements?: import("../../Type").Agreement[] | undefined;
@@ -106,7 +106,8 @@ export declare const useGuardMultipleInstance: () => {
106
106
  } | undefined) => void;
107
107
  setUserInfo: (user: Pick<import("../Guard/core/hooks/useMultipleAccounts").User & {
108
108
  id: string;
109
- }, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
109
+ loginAccount?: string | undefined;
110
+ }, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode" | "loginAccount">) => void;
110
111
  setLoginWayByHttpData: (account: string, data: {
111
112
  username?: string | undefined;
112
113
  phone?: string | undefined;
@@ -2,7 +2,7 @@ import { Rule } from 'antd/lib/form';
2
2
  import qs from 'qs';
3
3
  import { User } from 'authing-js-sdk';
4
4
  import { GuardProps } from '../Guard';
5
- import { ApplicationConfig, ComplateFiledsPlace, LoginMethods, RegisterMethods } from '../Type/application';
5
+ import { ApplicationConfig, ComplateFiledsPlace, LoginMethods, RegisterMethods, RegisterSortMethods, TabFieldsI18nItem } from '../Type/application';
6
6
  import { Lang } from '../Type';
7
7
  export * from './popupCenter';
8
8
  export * from './clipboard';
@@ -75,7 +75,8 @@ export declare const getSymbolTypeLength: (pwd: string) => number;
75
75
  export declare const getPasswordValidate: (strength?: PasswordStrength, customPasswordStrength?: any, fieldRequiredRuleMessage?: string | undefined) => Rule[];
76
76
  export declare const sleep: (delay: number) => Promise<unknown>;
77
77
  export declare const shoudGoToComplete: (user: User, contextType: ComplateFiledsPlace, config: ApplicationConfig | undefined, autoRegister?: boolean | undefined) => boolean;
78
- export declare const tabSort: (defaultValue: any, tabList: RegisterMethods[]) => RegisterMethods[];
78
+ export declare const tabSort: (tabList: string[], defaultMethod?: string | undefined) => string[];
79
+ export declare const transformMethod: (method: RegisterMethods | string) => string;
79
80
  export declare const mailDesensitization: (mail: string) => string;
80
81
  export declare const phoneDesensitization: (phone: string) => string;
81
82
  export declare const getHundreds: (num: number) => number;
@@ -90,3 +91,5 @@ export declare const getLoginTypePipe: (publicConfig: ApplicationConfig, registe
90
91
  } | undefined;
91
92
  export declare const getPasswordIdentify: (identity: string) => string;
92
93
  export declare const getCurrentLng: () => Lang;
94
+ export declare const getSortLabels: (methods: string[], i18nConfig: Map<string, TabFieldsI18nItem>) => string;
95
+ export declare const getI18nLabel: (method: string | RegisterSortMethods, i18nFields: Map<string, TabFieldsI18nItem>) => string;
@@ -1,2 +1,2 @@
1
- declare const _default: "4.0.8";
1
+ declare const _default: "4.0.10-rc.0";
2
2
  export default _default;
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2019-present Authing
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.