@signalplus/params-about 1.0.4-alpha → 1.0.5-alpha

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/index.d.ts CHANGED
@@ -39,7 +39,7 @@ declare class ParamRenderer extends PureComponent<ParamRendererProps> {
39
39
  key?: string | undefined;
40
40
  defaultValue?: any;
41
41
  Comp: React.ComponentType<BaseInputProps>;
42
- validator?(value: any): string;
42
+ validator?(value: any, enableEmpty?: boolean | undefined): string;
43
43
  required?: boolean | undefined;
44
44
  };
45
45
  get value(): any;
@@ -303,12 +303,12 @@ declare const ParamTypeConfig: Record<ParamType, {
303
303
  key?: string;
304
304
  defaultValue?: any;
305
305
  Comp: React.ComponentType<BaseInputProps>;
306
- validator?(value: any): string;
306
+ validator?(value: any, enableEmpty?: boolean): string;
307
307
  required?: boolean;
308
308
  }>;
309
309
  declare function paramValidator(val: any, values: {
310
310
  valueType: ParamType;
311
- }): string;
311
+ }, enableEmpty?: boolean): string;
312
312
  declare const ParamTypeOptions: {
313
313
  value: number;
314
314
  label: string;
@@ -316,7 +316,7 @@ declare const ParamTypeOptions: {
316
316
  key?: string | undefined;
317
317
  defaultValue?: any;
318
318
  Comp: React.ComponentType<BaseInputProps>;
319
- validator?(value: any): string;
319
+ validator?(value: any, enableEmpty?: boolean | undefined): string;
320
320
  required?: boolean | undefined;
321
321
  }[];
322
322
 
package/lib/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Bundle of @signalplus/params-about
3
- * Generated: 2023-05-06
4
- * Version: 1.0.4-alpha
3
+ * Generated: 2023-05-08
4
+ * Version: 1.0.5-alpha
5
5
  * License: MIT
6
6
  * Author: 2631541504@qq.com
7
7
  */
@@ -1220,13 +1220,13 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
1220
1220
  Comp: Text,
1221
1221
  validator: emptyValidator
1222
1222
  }), _ParamTypeConfig);
1223
- function paramValidator(val, values) {
1223
+ function paramValidator(val, values, enableEmpty) {
1224
1224
  var _config$validator;
1225
1225
 
1226
1226
  var config = ParamTypeConfig[values.valueType];
1227
1227
  if (!config) return '';
1228
1228
  var value = config.key ? val === null || val === void 0 ? void 0 : val[config.key] : val;
1229
- return ((_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, value)) || '';
1229
+ return ((_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, value, enableEmpty)) || '';
1230
1230
  }
1231
1231
  var ParamTypeOptions = Object.entries(ParamTypeConfig).map(function (_ref) {
1232
1232
  var _ref2 = _slicedToArray(_ref, 2),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalplus/params-about",
3
- "version": "1.0.4-alpha",
3
+ "version": "1.0.5-alpha",
4
4
  "description": "A description for the module",
5
5
  "main": "./lib/umd/index.js",
6
6
  "module": "./lib/es/index.js",