@deepinnet-components/pc 0.0.27 → 0.0.28

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.
@@ -110,12 +110,7 @@ var schema = {
110
110
  required: true,
111
111
  message: '请输入密码'
112
112
  }, {
113
- validator: function validator(val) {
114
- var regex = /^(?=(?:.*[a-z]))(?=(?:.*[A-Z]))(?=(?:.*\d)).{8,}$|^(?=(?:.*[a-z]))(?=(?:.*[A-Z]))(?=(?:.*[^A-Za-z0-9])).{8,}$|^(?=(?:.*[a-z]))(?=(?:.*\d))(?=(?:.*[^A-Za-z0-9])).{8,}$|^(?=(?:.*[A-Z]))(?=(?:.*\d))(?=(?:.*[^A-Za-z0-9])).{8,}$/;
115
- if (val && !regex.test(val)) {
116
- return '密码需至少包含大、小写字母、数字以及特殊符号3种,且不少于8位';
117
- }
118
- }
113
+ validator: "{{\n (val) => {\n if (!passwordConfig) return;\n const regex = passwordConfig.regex;\n if (val && !regex.test(val)) {\n return passwordConfig.message\n }\n }\n }}"
119
114
  }],
120
115
  'x-reactions': [{
121
116
  when: '{{addOrEdit === "add"}}',
@@ -163,6 +158,7 @@ var CreateAccount = function CreateAccount(props) {
163
158
  Components = contextValue.Components,
164
159
  userType = contextValue.userType,
165
160
  isMultiRole = contextValue.isMultiRole,
161
+ passwordConfig = contextValue.passwordConfig,
166
162
  passwordEncryption = contextValue.passwordEncryption,
167
163
  passwordEncryptionNeedSalt = contextValue.passwordEncryptionNeedSalt;
168
164
  var getAccountDetail = /*#__PURE__*/function () {
@@ -357,7 +353,8 @@ var CreateAccount = function CreateAccount(props) {
357
353
  schema: schema,
358
354
  scope: {
359
355
  addOrEdit: addOrEdit,
360
- isMultiRole: isMultiRole
356
+ isMultiRole: isMultiRole,
357
+ passwordConfig: passwordConfig
361
358
  }
362
359
  }), /*#__PURE__*/React.createElement(FormButtonGroup.FormItem, null, /*#__PURE__*/React.createElement(Button, {
363
360
  type: "primary",
@@ -9,6 +9,7 @@ export interface MainProps {
9
9
  userType?: string;
10
10
  showDataAuth?: boolean;
11
11
  isMultiRole?: boolean;
12
+ passwordConfig?: any;
12
13
  passwordEncryption?: string;
13
14
  passwordEncryptionNeedSalt?: boolean;
14
15
  hideDeleteAccountBtn?: boolean;
@@ -58,6 +58,8 @@ var Index = function Index(props) {
58
58
  showDataAuth = _props$showDataAuth === void 0 ? false : _props$showDataAuth,
59
59
  _props$isMultiRole = props.isMultiRole,
60
60
  isMultiRole = _props$isMultiRole === void 0 ? true : _props$isMultiRole,
61
+ _props$passwordConfig = props.passwordConfig,
62
+ passwordConfig = _props$passwordConfig === void 0 ? null : _props$passwordConfig,
61
63
  _props$passwordEncryp = props.passwordEncryption,
62
64
  passwordEncryption = _props$passwordEncryp === void 0 ? 'md5' : _props$passwordEncryp,
63
65
  _props$passwordEncryp2 = props.passwordEncryptionNeedSalt,
@@ -213,6 +215,7 @@ var Index = function Index(props) {
213
215
  userType: userType,
214
216
  showDataAuth: showDataAuth,
215
217
  isMultiRole: isMultiRole,
218
+ passwordConfig: passwordConfig,
216
219
  passwordEncryption: passwordEncryption,
217
220
  passwordEncryptionNeedSalt: passwordEncryptionNeedSalt,
218
221
  hideDeleteAccountBtn: hideDeleteAccountBtn,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepinnet-components/pc",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",