@pisell/materials 1.0.557 → 1.0.558

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.
@@ -182,6 +182,11 @@ export var withFormItem = function withFormItem(WrappedComponent, overlayProps)
182
182
  }
183
183
  });
184
184
  }
185
+ if (typeobj.type === 'pattern' && typeobj.enabled) {
186
+ rules.push(_objectSpread(_objectSpread({}, typeobj), {}, {
187
+ message: typeobj.message
188
+ }));
189
+ }
185
190
  }
186
191
  if (maxLengthobj && maxLengthobj.enabled) {
187
192
  rules.push({
@@ -196,6 +196,12 @@ var withFormItem = (WrappedComponent, overlayProps) => {
196
196
  }
197
197
  });
198
198
  }
199
+ if (typeobj.type === "pattern" && typeobj.enabled) {
200
+ rules.push({
201
+ ...typeobj,
202
+ message: typeobj.message
203
+ });
204
+ }
199
205
  }
200
206
  if (maxLengthobj && maxLengthobj.enabled) {
201
207
  rules.push({
@@ -461,10 +461,23 @@ export const generalItemMap = {
461
461
  { title: '邮箱', value: 'email' },
462
462
  { title: '网址', value: 'url' },
463
463
  { title: '域名', value: 'domain' },
464
+ { title: '正则', value: 'pattern' },
464
465
  ],
465
466
  },
466
467
  },
467
468
  },
469
+ {
470
+ name: 'pattern',
471
+ title: {
472
+ type: 'i18n',
473
+ 'en-US': 'Pattern',
474
+ 'zh-CN': '正则',
475
+ },
476
+ setter: 'StringSetter',
477
+ condition: (target: any) => {
478
+ return target.parent.getPropValue('type') === 'pattern';
479
+ },
480
+ },
468
481
  {
469
482
  name: 'message',
470
483
  title: {
@@ -1305,10 +1318,23 @@ export const formItemGeneralProps = [
1305
1318
  { title: '邮箱', value: 'email' },
1306
1319
  { title: '网址', value: 'url' },
1307
1320
  { title: '域名', value: 'domain' },
1321
+ { title: '正则', value: 'pattern' },
1308
1322
  ],
1309
1323
  },
1310
1324
  },
1311
1325
  },
1326
+ {
1327
+ name: 'pattern',
1328
+ title: {
1329
+ type: 'i18n',
1330
+ 'en-US': 'Pattern',
1331
+ 'zh-CN': '正则',
1332
+ },
1333
+ setter: 'StringSetter',
1334
+ condition: (target: any) => {
1335
+ return target.parent.getPropValue('type') === 'pattern';
1336
+ },
1337
+ },
1312
1338
  {
1313
1339
  name: 'message',
1314
1340
  title: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.557",
3
+ "version": "1.0.558",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -70,8 +70,8 @@
70
70
  "swiper": "^8.4.7",
71
71
  "react-barcode": "^1.5.3",
72
72
  "@pisell/date-picker": "1.0.115",
73
- "@pisell/utils": "1.0.43",
74
- "@pisell/icon": "0.0.10"
73
+ "@pisell/icon": "0.0.10",
74
+ "@pisell/utils": "1.0.43"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "react": "^18.0.0",