@authing/react-ui-components 3.0.2-alpha → 3.0.2-beta.11

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.
Files changed (253) hide show
  1. package/lib/index.d.ts +658 -108
  2. package/lib/index.min.css +2 -2
  3. package/lib/index.min.js +1 -1
  4. package/package.json +27 -9
  5. package/.eslintignore +0 -6
  6. package/.eslintrc.js +0 -7
  7. package/.prettierrc +0 -5
  8. package/.vscode/settings.json +0 -31
  9. package/build/asset-manifest.json +0 -26
  10. package/build/favicon.ico +0 -0
  11. package/build/index.html +0 -1
  12. package/build/logo192.png +0 -0
  13. package/build/logo512.png +0 -0
  14. package/build/manifest.json +0 -25
  15. package/build/robots.txt +0 -3
  16. package/build/static/css/2.31ae8f4c.chunk.css +0 -3
  17. package/build/static/css/2.31ae8f4c.chunk.css.map +0 -1
  18. package/build/static/css/main.0ff9e24a.chunk.css +0 -2
  19. package/build/static/css/main.0ff9e24a.chunk.css.map +0 -1
  20. package/build/static/js/2.1105ecfb.chunk.js +0 -3
  21. package/build/static/js/2.1105ecfb.chunk.js.LICENSE.txt +0 -102
  22. package/build/static/js/2.1105ecfb.chunk.js.map +0 -1
  23. package/build/static/js/3.fd17f196.chunk.js +0 -2
  24. package/build/static/js/3.fd17f196.chunk.js.map +0 -1
  25. package/build/static/js/main.ef2f91aa.chunk.js +0 -2
  26. package/build/static/js/main.ef2f91aa.chunk.js.map +0 -1
  27. package/build/static/js/runtime-main.ef138021.js +0 -2
  28. package/build/static/js/runtime-main.ef138021.js.map +0 -1
  29. package/build/static/media/loading.4a67a5f3.svg +0 -29
  30. package/components/AuthingDropdown/index.tsx +0 -52
  31. package/components/AuthingDropdown/style.less +0 -43
  32. package/components/AuthingGuard/AppMFALayout/index.tsx +0 -74
  33. package/components/AuthingGuard/AppMFALayout/style.less +0 -12
  34. package/components/AuthingGuard/CompleteUserInfoLayout/index.tsx +0 -29
  35. package/components/AuthingGuard/CompleteUserInfoLayout/style.less +0 -8
  36. package/components/AuthingGuard/Forms/ADLoginForm/index.tsx +0 -117
  37. package/components/AuthingGuard/Forms/Agreements/index.tsx +0 -81
  38. package/components/AuthingGuard/Forms/Agreements/style.less +0 -44
  39. package/components/AuthingGuard/Forms/CompleteUserInfoForm/index.tsx +0 -139
  40. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/CheckEmailForm.tsx +0 -84
  41. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/VerifyCodeForm.tsx +0 -116
  42. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/index.tsx +0 -40
  43. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/style.less +0 -0
  44. package/components/AuthingGuard/Forms/EmailRegisterForm/index.tsx +0 -181
  45. package/components/AuthingGuard/Forms/EmailRegisterForm/style.less +0 -0
  46. package/components/AuthingGuard/Forms/LdapLoginForm/index.tsx +0 -166
  47. package/components/AuthingGuard/Forms/LdapLoginForm/style.less +0 -0
  48. package/components/AuthingGuard/Forms/LoginFormFooter/index.tsx +0 -76
  49. package/components/AuthingGuard/Forms/LoginFormFooter/style.less +0 -6
  50. package/components/AuthingGuard/Forms/MfaResetCodeForm/Step1.tsx +0 -86
  51. package/components/AuthingGuard/Forms/MfaResetCodeForm/Step2.tsx +0 -53
  52. package/components/AuthingGuard/Forms/MfaResetCodeForm/index.tsx +0 -65
  53. package/components/AuthingGuard/Forms/MfaResetCodeForm/style.less +0 -20
  54. package/components/AuthingGuard/Forms/MfaVerifyForm/index.tsx +0 -105
  55. package/components/AuthingGuard/Forms/MfaVerifyForm/style.less +0 -12
  56. package/components/AuthingGuard/Forms/PasswordLoginForm/index.tsx +0 -261
  57. package/components/AuthingGuard/Forms/PhoneCodeLoginForm/index.tsx +0 -133
  58. package/components/AuthingGuard/Forms/PhoneRegisterForm/index.tsx +0 -202
  59. package/components/AuthingGuard/Forms/QrCodeLoginForm/index.tsx +0 -59
  60. package/components/AuthingGuard/Forms/QrCodeLoginForm/style.less +0 -14
  61. package/components/AuthingGuard/Forms/RegisterFormFooter/index.tsx +0 -56
  62. package/components/AuthingGuard/Forms/RegisterFormFooter/style.less +0 -0
  63. package/components/AuthingGuard/Forms/ResetPwdForm/Footer.tsx +0 -21
  64. package/components/AuthingGuard/Forms/ResetPwdForm/Step1.tsx +0 -86
  65. package/components/AuthingGuard/Forms/ResetPwdForm/Step2.tsx +0 -127
  66. package/components/AuthingGuard/Forms/ResetPwdForm/Step3.tsx +0 -141
  67. package/components/AuthingGuard/Forms/ResetPwdForm/Step4.tsx +0 -51
  68. package/components/AuthingGuard/Forms/ResetPwdForm/index.tsx +0 -96
  69. package/components/AuthingGuard/Forms/ResetPwdForm/style.less +0 -3
  70. package/components/AuthingGuard/Forms/SendPhoneCode/SendCodeBtn.tsx +0 -88
  71. package/components/AuthingGuard/Forms/SendPhoneCode/index.tsx +0 -50
  72. package/components/AuthingGuard/Forms/SendPhoneCode/style.less +0 -26
  73. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/CheckPhoneForm.tsx +0 -86
  74. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/VerifyCodeForm.tsx +0 -113
  75. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/index.tsx +0 -40
  76. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/style.less +0 -3
  77. package/components/AuthingGuard/Forms/SocialAndIdpLogin/index.tsx +0 -325
  78. package/components/AuthingGuard/Forms/SocialAndIdpLogin/style.less +0 -75
  79. package/components/AuthingGuard/Forms/UploadImage/index.tsx +0 -70
  80. package/components/AuthingGuard/Forms/index.ts +0 -13
  81. package/components/AuthingGuard/GuardLayout/index.tsx +0 -474
  82. package/components/AuthingGuard/GuardLayout/style.less +0 -111
  83. package/components/AuthingGuard/Header/index.tsx +0 -25
  84. package/components/AuthingGuard/Header/style.less +0 -52
  85. package/components/AuthingGuard/IconFont/iconfont.js +0 -74
  86. package/components/AuthingGuard/IconFont/index.tsx +0 -19
  87. package/components/AuthingGuard/IconFont/style.less +0 -6
  88. package/components/AuthingGuard/IconFont/svg.js +0 -2
  89. package/components/AuthingGuard/LoginLayout/index.tsx +0 -161
  90. package/components/AuthingGuard/LoginLayout/style.less +0 -0
  91. package/components/AuthingGuard/MfaLayout/Steps.ts +0 -4
  92. package/components/AuthingGuard/MfaLayout/index.tsx +0 -49
  93. package/components/AuthingGuard/MfaLayout/style.less +0 -3
  94. package/components/AuthingGuard/RegisterLayout/index.tsx +0 -89
  95. package/components/AuthingGuard/RegisterLayout/style.less +0 -0
  96. package/components/AuthingGuard/ResetPwdLayout/index.tsx +0 -20
  97. package/components/AuthingGuard/ToggleLang/index.tsx +0 -51
  98. package/components/AuthingGuard/api/appConfig.ts +0 -146
  99. package/components/AuthingGuard/api/index.ts +0 -3
  100. package/components/AuthingGuard/api/sso.ts +0 -29
  101. package/components/AuthingGuard/api/userPoolConfig.ts +0 -111
  102. package/components/AuthingGuard/constants.ts +0 -105
  103. package/components/AuthingGuard/hooks/index.tsx +0 -70
  104. package/components/AuthingGuard/hooks/useScreenSize.tsx +0 -68
  105. package/components/AuthingGuard/index.tsx +0 -126
  106. package/components/AuthingGuard/style.less +0 -103
  107. package/components/AuthingGuard/types/Forms.ts +0 -94
  108. package/components/AuthingGuard/types/GuardConfig.ts +0 -420
  109. package/components/AuthingGuard/types/GuardState.ts +0 -7
  110. package/components/AuthingGuard/types/Locales.ts +0 -12
  111. package/components/AuthingGuard/types/index.ts +0 -4
  112. package/components/AuthingTabs/index.tsx +0 -98
  113. package/components/AuthingTabs/style.less +0 -135
  114. package/components/BindTotp/core/bindSuccess.tsx +0 -61
  115. package/components/BindTotp/core/securityCode.tsx +0 -119
  116. package/components/BindTotp/index.tsx +0 -134
  117. package/components/BindTotp/interface.ts +0 -30
  118. package/components/BindTotp/styles.less +0 -57
  119. package/components/ChangeLanguage/index.tsx +0 -35
  120. package/components/ChangePassword/core/firstLoginReset.tsx +0 -104
  121. package/components/ChangePassword/core/rotateReset.tsx +0 -114
  122. package/components/ChangePassword/index.tsx +0 -59
  123. package/components/CompleteInfo/core/completeInfo.tsx +0 -155
  124. package/components/CompleteInfo/index.tsx +0 -45
  125. package/components/CompleteInfo/interface.ts +0 -40
  126. package/components/CompleteInfo/styles.less +0 -7
  127. package/components/CopyAbleText/index.tsx +0 -54
  128. package/components/CopyAbleText/style.less +0 -13
  129. package/components/DownloadAuthenticator/index.tsx +0 -97
  130. package/components/DownloadAuthenticator/interface.ts +0 -22
  131. package/components/DownloadAuthenticator/styles.less +0 -52
  132. package/components/Error/index.tsx +0 -21
  133. package/components/Error/interface.ts +0 -9
  134. package/components/Error/styles.less +0 -12
  135. package/components/ForgetPassword/core/resetPassword.tsx +0 -162
  136. package/components/ForgetPassword/index.tsx +0 -75
  137. package/components/ForgetPassword/interface.ts +0 -32
  138. package/components/Guard/Guard.tsx +0 -242
  139. package/components/Guard/authClient.ts +0 -55
  140. package/components/Guard/config.ts +0 -19
  141. package/components/Guard/event.ts +0 -52
  142. package/components/Guard/index.tsx +0 -4
  143. package/components/Guard/module.ts +0 -19
  144. package/components/Guard/stateMachine.ts +0 -133
  145. package/components/Guard/styles.less +0 -444
  146. package/components/IconFont/iconfont.js +0 -74
  147. package/components/IconFont/index.tsx +0 -16
  148. package/components/IconFont/style.less +0 -6
  149. package/components/IconFont/svg.js +0 -2
  150. package/components/ImagePro/index.tsx +0 -52
  151. package/components/ImagePro/styles.less +0 -40
  152. package/components/InputNumber/index.tsx +0 -33
  153. package/components/Login/codemap.ts +0 -39
  154. package/components/Login/core/withAD.tsx +0 -9
  155. package/components/Login/core/withAppQrcode.tsx +0 -49
  156. package/components/Login/core/withLDAP.tsx +0 -146
  157. package/components/Login/core/withPassword.tsx +0 -176
  158. package/components/Login/core/withPhonecode.tsx +0 -121
  159. package/components/Login/core/withWechatMiniQrcode.tsx +0 -60
  160. package/components/Login/core/withWechatmpQrcode.tsx +0 -53
  161. package/components/Login/index.tsx +0 -368
  162. package/components/Login/props.ts +0 -74
  163. package/components/Login/socialLogin/index.tsx +0 -413
  164. package/components/Login/socialLogin/style.less +0 -61
  165. package/components/Login/styles.less +0 -53
  166. package/components/MFA/codemap.ts +0 -21
  167. package/components/MFA/core/email.tsx +0 -225
  168. package/components/MFA/core/face.tsx +0 -297
  169. package/components/MFA/core/face_deps.tsx +0 -37
  170. package/components/MFA/core/sms.tsx +0 -229
  171. package/components/MFA/core/totp.tsx +0 -137
  172. package/components/MFA/index.tsx +0 -137
  173. package/components/MFA/mfaMethods/index.tsx +0 -81
  174. package/components/MFA/mfaMethods/style.less +0 -39
  175. package/components/MFA/props.ts +0 -51
  176. package/components/MFA/styles.less +0 -93
  177. package/components/NeedHelpView/core/describeQuestions.tsx +0 -223
  178. package/components/NeedHelpView/index.tsx +0 -99
  179. package/components/RecoveryCode/core/useCode.tsx +0 -71
  180. package/components/RecoveryCode/index.tsx +0 -27
  181. package/components/RecoveryCode/interface.ts +0 -31
  182. package/components/RecoveryCode/style.less +0 -13
  183. package/components/Register/codemap.ts +0 -16
  184. package/components/Register/components/Agreements/index.tsx +0 -81
  185. package/components/Register/components/Agreements/style.less +0 -44
  186. package/components/Register/core/WithEmail.tsx +0 -236
  187. package/components/Register/core/WithPhone.tsx +0 -184
  188. package/components/Register/index.tsx +0 -123
  189. package/components/Register/props.ts +0 -50
  190. package/components/SendCode/SendCodeBtn.tsx +0 -96
  191. package/components/SendCode/index.tsx +0 -94
  192. package/components/SendCode/style.less +0 -31
  193. package/components/ShieldSpin/index.tsx +0 -27
  194. package/components/ShieldSpin/loading.svg +0 -29
  195. package/components/SubmitButton/index.tsx +0 -50
  196. package/components/Type/index.ts +0 -52
  197. package/components/ValidatorRules/EmailFormItem.tsx +0 -81
  198. package/components/ValidatorRules/PhoneFormItem.tsx +0 -90
  199. package/components/ValidatorRules/index.ts +0 -14
  200. package/components/VerifyCodeInput/index.tsx +0 -76
  201. package/components/VerifyCodeInput/style.less +0 -24
  202. package/components/_utils/GuardErrorCode.ts +0 -8
  203. package/components/_utils/clipboard.ts +0 -27
  204. package/components/_utils/config.ts +0 -121
  205. package/components/_utils/guradHttp.ts +0 -93
  206. package/components/_utils/hooks/index.ts +0 -64
  207. package/components/_utils/http.ts +0 -85
  208. package/components/_utils/index.ts +0 -319
  209. package/components/_utils/locales/en/common.json +0 -223
  210. package/components/_utils/locales/en/index.ts +0 -6
  211. package/components/_utils/locales/en/login.json +0 -96
  212. package/components/_utils/locales/en/map.json +0 -4
  213. package/components/_utils/locales/en/user.json +0 -82
  214. package/components/_utils/locales/index.ts +0 -45
  215. package/components/_utils/locales/zh/common.json +0 -223
  216. package/components/_utils/locales/zh/index.ts +0 -6
  217. package/components/_utils/locales/zh/login.json +0 -96
  218. package/components/_utils/locales/zh/map.json +0 -4
  219. package/components/_utils/locales/zh/user.json +0 -82
  220. package/components/_utils/popupCenter.ts +0 -48
  221. package/components/assets/images/error.png +0 -0
  222. package/components/context/base.tsx +0 -28
  223. package/components/context/global/context.tsx +0 -39
  224. package/components/context/global/reducer.tsx +0 -56
  225. package/components/context/module/context.tsx +0 -23
  226. package/components/index.ts +0 -12
  227. package/config/antdReplacer.js +0 -51
  228. package/config/env.js +0 -104
  229. package/config/getHttpsConfig.js +0 -66
  230. package/config/jest/cssTransform.js +0 -14
  231. package/config/jest/fileTransform.js +0 -40
  232. package/config/modules.js +0 -134
  233. package/config/paths.js +0 -71
  234. package/config/pnpTs.js +0 -35
  235. package/config/webpack.config.js +0 -835
  236. package/config/webpackDevServer.config.js +0 -130
  237. package/examples.tsx +0 -107
  238. package/index.js +0 -1
  239. package/logo.svg +0 -7
  240. package/public/favicon.ico +0 -0
  241. package/public/index.html +0 -43
  242. package/public/logo192.png +0 -0
  243. package/public/logo512.png +0 -0
  244. package/public/manifest.json +0 -25
  245. package/public/robots.txt +0 -3
  246. package/react-app-env.d.ts +0 -71
  247. package/reportWebVitals.ts +0 -15
  248. package/scripts/build.js +0 -208
  249. package/scripts/lib.js +0 -200
  250. package/scripts/start.js +0 -162
  251. package/scripts/test.js +0 -49
  252. package/setupTests.ts +0 -5
  253. package/tsconfig.json +0 -30
@@ -1,19 +0,0 @@
1
- import { getDefaultLoginConfig, LoginConfig } from '../Login/props'
2
- import { getDefaultRegisterConfig, RegisterConfig } from '../Register/props'
3
-
4
- export interface GuardComponentConifg extends Partial<GuardLocalConfig> {}
5
-
6
- export interface GuardLocalConfig extends RegisterConfig, LoginConfig {}
7
-
8
- let defaultConfig: GuardLocalConfig
9
-
10
- export const getDefaultGuardLocalConfig = (): GuardLocalConfig => {
11
- if (!defaultConfig) {
12
- defaultConfig = {
13
- ...getDefaultLoginConfig(),
14
- ...getDefaultRegisterConfig(),
15
- }
16
- }
17
-
18
- return defaultConfig
19
- }
@@ -1,52 +0,0 @@
1
- import { message } from 'antd'
2
- import { CompleteInfoEvents } from '../CompleteInfo/interface'
3
- import { ForgetPasswordEvents } from '../ForgetPassword/interface'
4
- import { LoginEvents } from '../Login/props'
5
- import { RegisterEvents } from '../Register/props'
6
- import { i18n } from '../_utils/locales'
7
-
8
- export interface GuardEvents
9
- extends LoginEvents,
10
- RegisterEvents,
11
- CompleteInfoEvents,
12
- ForgetPasswordEvents {}
13
-
14
- export const guardEventsFilter = (props: any) => {
15
- const events: GuardEvents = {}
16
- const eventsName = Object.keys(props).filter((name) => name.startsWith('on'))
17
- eventsName.forEach((eventName) => {
18
- events[eventName as keyof GuardEvents] = props[eventName]
19
- })
20
-
21
- return guardEventsHijacking(events)
22
- }
23
-
24
- const eventsMapping: Partial<GuardEvents> = {
25
- onLogin: (...props) => {
26
- message.success(i18n.t('common.LoginSuccess'))
27
- return props
28
- },
29
-
30
- onRegister: (...props) => {
31
- message.success(i18n.t('common.registrationSuccess'))
32
- return props
33
- },
34
- }
35
-
36
- export const guardEventsHijacking = (events: GuardEvents): GuardEvents => {
37
- const newEvents: GuardEvents = {}
38
- Object.keys(eventsMapping).forEach((eventsKey) => {
39
- // @ts-ignore
40
- newEvents[eventsKey] = (...props) => {
41
- // @ts-ignore
42
- const newProps = eventsMapping[eventsKey](...props)
43
- // @ts-ignore
44
- events[eventsKey]?.(newProps)
45
- }
46
- })
47
-
48
- return {
49
- ...events,
50
- ...newEvents,
51
- }
52
- }
@@ -1,4 +0,0 @@
1
- export * from './Guard'
2
- export * from './module'
3
- export * from './event'
4
- export * from './config'
@@ -1,19 +0,0 @@
1
- export enum GuardModuleType {
2
- ERROR = 'error',
3
- LOGIN = 'login',
4
- REGISTER = 'register',
5
- MFA = 'mfa',
6
- FORGET_PWD = 'forgetPassword',
7
- CHANGE_PWD = 'changePassword',
8
- DOWNLOAD_AT = 'downloadAT',
9
- BIND_TOTP = 'bindTotp',
10
- ANY_QUESTIONS = 'anyQuestions',
11
- COMPLETE_INFO = 'completeInfo',
12
- RECOVERY_CODE = 'recoveryCode',
13
- }
14
- export interface GuardModuleAction {
15
- action: string
16
- module?: GuardModuleType
17
- message?: string
18
- initData?: any
19
- }
@@ -1,133 +0,0 @@
1
- import { useEffect } from 'react'
2
- import { GuardComponentConifg, GuardLocalConfig } from './config'
3
- import { GuardModuleType } from './module'
4
- const window: Window = require('global/window')
5
-
6
- export interface ModuleState {
7
- moduleName: GuardModuleType
8
- initData?: any
9
- }
10
-
11
- export enum ActionType {
12
- ChangeModule = 'ChangeModule',
13
- Back = 'Back',
14
- Init = 'Init',
15
- }
16
-
17
- export interface StateMachineLog {
18
- action: ActionType
19
- date: number
20
- dataSource: ModuleState
21
- }
22
-
23
- export type ChangeModuleEvent = (
24
- nextModelu: GuardModuleType,
25
- initData?: any
26
- ) => void
27
- export class GuardStateMachine {
28
- // 计数器
29
- private order: number = 0
30
-
31
- // 总体的配置信息
32
- private config: GuardComponentConifg = {}
33
-
34
- // 历史记录
35
- private moduleStateHistory: ModuleState[] = []
36
-
37
- private changeMouleEvent: ChangeModuleEvent
38
-
39
- // Log
40
- private stateMachineLog: Record<number, StateMachineLog> = {}
41
-
42
- constructor(changeMouleEvent: ChangeModuleEvent, initData: ModuleState) {
43
- this.changeMouleEvent = changeMouleEvent
44
-
45
- this.historyPush(initData, ActionType.Init)
46
- }
47
- globalWindow = (): Window | undefined =>
48
- typeof window !== undefined ? window : undefined
49
-
50
- next = (nextModelu: GuardModuleType, initData: any) => {
51
- const moduleData: ModuleState = {
52
- moduleName: nextModelu,
53
- initData,
54
- }
55
- this.changeMouleEvent(nextModelu, initData)
56
-
57
- this.historyPush(moduleData)
58
- console.log('next Log', this.stateMachineLog)
59
- console.log('next History', this.moduleStateHistory)
60
- }
61
-
62
- back = (initData: any = {}) => {
63
- if (this.moduleStateHistory.length <= 1) return
64
-
65
- const backModule = this.moduleStateHistory[1]
66
- this.changeMouleEvent(backModule.moduleName, {
67
- ...initData,
68
- ...backModule.initData,
69
- })
70
-
71
- this.moduleStateHistory.splice(0, 1)
72
- console.log('back Log', this.stateMachineLog)
73
- }
74
-
75
- // 业务终点 Log 发送
76
- end = () => {
77
- console.log('业务终点 Log', this.stateMachineLog)
78
-
79
- // TODO 请求
80
- }
81
-
82
- historyPush = (
83
- data: ModuleState,
84
- actionType: ActionType = ActionType.ChangeModule
85
- ) => {
86
- this.moduleStateHistory.unshift(data)
87
-
88
- this.stateMachineLog[this.order++] = {
89
- action: actionType,
90
- date: new Date().getTime(),
91
- dataSource: data,
92
- }
93
-
94
- if (this.moduleStateHistory.length > 10)
95
- this.moduleStateHistory.splice(10, this.moduleStateHistory.length - 10)
96
- }
97
-
98
- historyBack = (data: ModuleState) => {
99
- if (this.moduleStateHistory.length <= 1) return
100
-
101
- this.moduleStateHistory.splice(0, 1)
102
-
103
- this.stateMachineLog[this.order++] = {
104
- action: ActionType.Back,
105
- date: new Date().getTime(),
106
- dataSource: data,
107
- }
108
- }
109
-
110
- setConfig = (config: GuardLocalConfig) => {
111
- this.config = config
112
- }
113
- }
114
-
115
- export const useHistoryHijack = (back?: () => void) => {
116
- const next = (state: any = {}) => {
117
- window?.history.pushState(state, '', window?.location.href)
118
- }
119
-
120
- useEffect(() => {
121
- const onPopstate = () => {
122
- back?.()
123
- }
124
-
125
- back && window?.addEventListener('popstate', onPopstate)
126
-
127
- return () => {
128
- back && window.removeEventListener('popstate', onPopstate)
129
- }
130
- }, [back])
131
-
132
- return [next]
133
- }
@@ -1,444 +0,0 @@
1
- @import '~antd/lib/style/mixins/index.less';
2
-
3
- *[class*='authing-'] {
4
- @import '~antd/lib/style/core/global.less';
5
- }
6
-
7
- .authing-g2-render-module {
8
- --sidePadding: 38px;
9
- --containerWidth: 456px;
10
- }
11
- .authing-g2-render-module-modal {
12
- --containerWidth: 456px;
13
- }
14
-
15
- @media only screen and (max-width: 450px) {
16
- .authing-g2-render-module {
17
- --sidePadding: 8px;
18
- --containerWidth: 100%;
19
- }
20
- .authing-g2-render-module-modal {
21
- --containerWidth: 100%;
22
- }
23
- }
24
-
25
- // 侵入 core 的样式代码,guard view 皮肤
26
- .g2-view-container {
27
- font-family: sans-serif;
28
- box-shadow: 0px 0px 60px rgba(84, 89, 104, 0.05);
29
- background: #ffffff;
30
- display: flex;
31
- flex-direction: column;
32
- width: var(--containerWidth);
33
- min-height: 610px;
34
- box-sizing: border-box;
35
- padding: 16px;
36
- padding-bottom: 32px;
37
- border-radius: 8px;
38
- position: relative;
39
- .none {
40
- display: none;
41
- }
42
- .g2-view-back {
43
- margin-top: 26px;
44
- padding-left: 38px;
45
- cursor: pointer;
46
- font-size: 14px;
47
- color: #878a95;
48
- .g2-icon {
49
- margin-right: 8px;
50
- }
51
- }
52
- .g2-view-header {
53
- user-select: none;
54
- padding: 44px var(--sidePadding) 0;
55
- .icon {
56
- width: 48px;
57
- height: 48px;
58
- border-radius: 4px;
59
- margin-bottom: 8px;
60
- }
61
- .title {
62
- font-weight: 600;
63
- font-size: 24px;
64
- white-space: nowrap;
65
- overflow: hidden;
66
- text-overflow: ellipsis;
67
- }
68
- .title-explain {
69
- font-weight: 300;
70
- font-size: 14px;
71
- color: #545968;
72
- }
73
- margin-bottom: 24px;
74
- }
75
-
76
- .g2-view-tabs {
77
- padding: 0 var(--sidePadding);
78
-
79
- .authing-ant-tabs-tab {
80
- color: #878a95;
81
- &:hover {
82
- color: #282d3c;
83
- }
84
- }
85
- }
86
-
87
- .authing-g2-submit-button {
88
- width: calc(100% - 4px);
89
- border-radius: 4px;
90
- height: 42px;
91
- margin: 0 2px;
92
- &.shaking {
93
- animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
94
- }
95
- @keyframes shake {
96
- 10%,
97
- 90% {
98
- transform: translate3d(-1px, 0, 0);
99
- }
100
-
101
- 20%,
102
- 80% {
103
- transform: translate3d(2px, 0, 0);
104
- }
105
-
106
- 30%,
107
- 50%,
108
- 70% {
109
- transform: translate3d(-4px, 0, 0);
110
- }
111
-
112
- 40%,
113
- 60% {
114
- transform: translate3d(4px, 0, 0);
115
- }
116
- }
117
- }
118
- }
119
-
120
- .authing-g2-button-group {
121
- background: #eff2f6;
122
- border-radius: 8px;
123
- padding: 4px 2px;
124
- margin-bottom: 16px;
125
- width: fit-content;
126
-
127
- .authing-ant-radio-button-wrapper {
128
- margin: 0 2px;
129
- border-radius: 8px;
130
- color: #545968;
131
- cursor: pointer;
132
- border: none;
133
- background: none;
134
- height: auto;
135
- &.authing-ant-radio-button-wrapper-checked {
136
- color: #396aff;
137
- background: #ffffff;
138
- }
139
- &:not(:first-child)::before {
140
- display: none;
141
- }
142
- }
143
- }
144
-
145
- .authing-g2-input-form {
146
- padding: 0 2px;
147
- margin-bottom: 16px;
148
- &.submit-form {
149
- margin-top: 32px;
150
- }
151
- .label-title {
152
- padding: 0 0 8px;
153
- }
154
- // .authing-ant-form-item-explain {
155
- // // display: none;
156
- // transition: 0.2s all;
157
- // position: absolute;
158
- // user-select: none;
159
- // background: white;
160
- // left: 10px;
161
- // top: -15px;
162
- // z-index: 100;
163
- // padding: 4px 8px;
164
- // border-radius: 4px;
165
- // box-shadow: #eeeff1;
166
- // }
167
- }
168
- .authing-g2-input-form {
169
- .authing-g2-select {
170
- border: 1px solid #f5f6f7;
171
- border-color: #f5f6f7;
172
- height: 46px;
173
- border-radius: 4px;
174
- .authing-ant-select-selector {
175
- height: 100% !important;
176
- border-color: #f5f6f7 !important;
177
- background-color: #f5f6f7 !important;
178
- .authing-ant-select-selection-item {
179
- line-height: 42px;
180
- }
181
- &:hover {
182
- border-color: #eeeff1 !important;
183
- background-color: #eeeff1 !important;
184
- }
185
- }
186
- }
187
- }
188
-
189
- .authing-g2-input {
190
- border: 1px solid #f5f6f7;
191
- height: 46px;
192
- border-radius: 4px;
193
- background: #f5f6f7;
194
- &:hover {
195
- background: #eeeff1;
196
- }
197
- &:focus {
198
- background: #ffffff !important;
199
- border-color: #618eff;
200
- }
201
-
202
- input {
203
- // 通过这个方式 hack 浏览器自动填充:
204
- // 自动填充的浏览器可以说罪恶滔天,钉死在 mdn 的耻辱柱上:https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill
205
- // 下方的 focused 同样需要这样处理
206
- height: 0;
207
- padding: 1em 0.5em !important;
208
- background-clip: content-box !important;
209
- &::placeholder,
210
- &::-webkit-input-placeholder {
211
- color: #a7a7a7;
212
- }
213
- }
214
-
215
- // affix-wrapper 特殊处理 hover
216
- &.authing-ant-input-affix-wrapper:hover {
217
- border-color: #eeeff1;
218
- background: #eeeff1;
219
- border-color: #618eff;
220
-
221
- .authing-ant-input {
222
- background: #eeeff1;
223
- }
224
- }
225
-
226
- // focus
227
- &.authing-ant-input-affix-wrapper-focused {
228
- background: #ffffff !important;
229
- border-color: #618eff;
230
- input {
231
- height: 0;
232
- padding: 1em 0.5em !important;
233
- background-clip: content-box !important;
234
- &::placeholder,
235
- &::-webkit-input-placeholder {
236
- color: #a7a7a7;
237
- }
238
- }
239
- }
240
-
241
- // 适配图形验证码
242
- &.add-after {
243
- border: none;
244
- .authing-ant-input-group {
245
- .authing-ant-input,
246
- .authing-ant-input-group-addon {
247
- border-radius: 4px;
248
- height: 46px;
249
- }
250
- }
251
- }
252
-
253
- // 适配数字输入框
254
- &.authing-ant-input-number {
255
- width: 100%;
256
- input {
257
- padding: 1.4em 0.5em !important;
258
- }
259
- .authing-ant-input-number-handler-wrap {
260
- display: none;
261
- }
262
- }
263
- .g2-captcha-code-image {
264
- min-width: 100px;
265
- }
266
- }
267
-
268
- // input error 的情况
269
- .authing-ant-form-item-has-error {
270
- .authing-ant-input-affix-wrapper:hover {
271
- border-color: #ff4d4f !important;
272
- }
273
-
274
- // focus
275
- .authing-ant-input-affix-wrapper-focused {
276
- border-color: #ff4d4f !important;
277
- }
278
- }
279
-
280
- .authing-g2-send-code {
281
- color: #396aff;
282
- cursor: pointer;
283
- &.sending {
284
- cursor: not-allowed;
285
- filter: opacity(0.5);
286
- }
287
- }
288
-
289
- .g2-tips-line {
290
- display: flex;
291
- font-size: 14px;
292
- padding: 0 var(--sidePadding);
293
- height: 22px;
294
- .link-like {
295
- color: #396aff;
296
- cursor: pointer;
297
- transition: all 0.3s;
298
- &:hover {
299
- color: #557fff;
300
- }
301
- &:active {
302
- color: #254cd9;
303
- }
304
- }
305
- .gray {
306
- color: #999;
307
- }
308
- .go-to-register {
309
- margin-left: auto;
310
- }
311
- .back-to-login {
312
- margin-left: auto;
313
- }
314
- .touch-tip {
315
- color: #d4d6dc;
316
- cursor: pointer;
317
- &:hover {
318
- color: #878a95;
319
- }
320
- }
321
- }
322
- .g2-init-setting-loading {
323
- width: var(--containerWidth);
324
- min-height: 610px;
325
- display: flex;
326
- justify-content: center;
327
- align-items: center;
328
- box-shadow: 0px 0px 60px rgba(84, 89, 104, 0.05);
329
- }
330
-
331
- .g2-questions {
332
- .authing-ant-upload-list-picture-card-container {
333
- height: 56px;
334
- width: 56px;
335
-
336
- .authing-ant-upload-list-item-list-type-picture-card {
337
- padding: 4px;
338
- }
339
- }
340
- // authing-ant-upload authing-ant-upload-select
341
- .authing-ant-upload-select-picture-card {
342
- height: 56px;
343
- width: 56px;
344
- border: none;
345
- background: #f5f6f7;
346
- transition: 0.2s all;
347
- &:hover {
348
- background: #eeeff1;
349
- }
350
- }
351
- }
352
-
353
- .g2-questions-send-success-page {
354
- display: flex;
355
- flex-direction: column;
356
- justify-content: center;
357
- align-items: center;
358
- min-height: 610px;
359
- .plate {
360
- margin-bottom: 14px;
361
- }
362
- .title {
363
- color: #282d3c;
364
- font-weight: 500;
365
- font-size: 16px;
366
- margin-bottom: 10px;
367
- }
368
- .message {
369
- font-size: 14px;
370
- color: #545968;
371
- margin-bottom: 32px;
372
- text-align: center;
373
- }
374
- .timer-tip {
375
- font-size: 14px;
376
- color: #545968;
377
- margin-top: 12px;
378
- }
379
- }
380
-
381
- .g2-change-language-container {
382
- margin: auto 0 20px;
383
- padding-top: 10px;
384
- text-align: center;
385
- .g2-change-language-button {
386
- user-select: none;
387
- font-size: 14px;
388
- color: #878a95;
389
- cursor: pointer;
390
- margin: auto;
391
- transition: 0.2s all;
392
- &:hover {
393
- color: #282d3c;
394
- }
395
- .g2-change-language-text {
396
- margin-left: 5px;
397
- }
398
- }
399
- }
400
- .authing-g2-render-module-modal {
401
- width: var(--containerWidth);
402
- .authing-ant-modal-content {
403
- width: var(--containerWidth);
404
- border-radius: 8px;
405
- }
406
- .authing-ant-modal-body {
407
- padding: 0;
408
- }
409
- .authing-ant-modal-close {
410
- left: 0;
411
- border-radius: 4px;
412
- transform: scale(0.5);
413
- color: #d4d6dc;
414
- transition: 0.2s all;
415
- width: 56px;
416
- height: 56px;
417
- &:hover {
418
- background: #eeeff1;
419
- color: #878a95;
420
- }
421
-
422
- .g2-modal-close {
423
- font-size: 36px;
424
- margin-top: 10px;
425
- }
426
- }
427
- .authing-ant-modal-footer {
428
- display: none;
429
- }
430
- }
431
-
432
- .g2-send-code-input-col {
433
- /* Chrome, Safari, Edge, Opera */
434
- input::-webkit-outer-spin-button,
435
- input::-webkit-inner-spin-button {
436
- -webkit-appearance: none;
437
- margin: 0;
438
- }
439
-
440
- /* Firefox */
441
- input[type='number'] {
442
- -moz-appearance: textfield;
443
- }
444
- }