shineout 3.8.1 → 3.8.2-beta.1

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/cjs/index.js CHANGED
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
522
522
  // 此文件由脚本自动生成,请勿直接修改。
523
523
  // This file was generated automatically by a script. Please do not modify it directly.
524
524
  var _default = exports.default = {
525
- version: '3.8.1'
525
+ version: '3.8.2-beta.1'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12386,7 +12386,7 @@ var handleStyle = function handleStyle(style) {
12386
12386
  };
12387
12387
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12388
12388
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12389
- /* harmony default export */ var version = ('3.8.1');
12389
+ /* harmony default export */ var version = ('3.8.2-beta.1');
12390
12390
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12391
12391
 
12392
12392
 
@@ -51118,6 +51118,19 @@ var SchemaBuilder = /*#__PURE__*/function () {
51118
51118
  };
51119
51119
  }
51120
51120
  createClass_default()(SchemaBuilder, [{
51121
+ key: "mapEnumData",
51122
+ value: function mapEnumData(data, format) {
51123
+ return data.map(function (item) {
51124
+ if (typeof format === 'string') {
51125
+ return item ? item[format] : item;
51126
+ } else if (typeof format === 'function' && item) {
51127
+ return format(item);
51128
+ } else {
51129
+ return item;
51130
+ }
51131
+ });
51132
+ }
51133
+ }, {
51121
51134
  key: "updateSchema",
51122
51135
  value: function updateSchema(_ref) {
51123
51136
  var path = _ref.path,
@@ -51194,11 +51207,9 @@ var SchemaBuilder = /*#__PURE__*/function () {
51194
51207
  }
51195
51208
  if (componentElement.props.multiple) {
51196
51209
  fieldSchemaInfo.type = 'array';
51197
- if (itemType !== 'undefined') {
51198
- fieldSchemaInfo.items = {
51199
- type: itemType
51200
- };
51201
- }
51210
+ fieldSchemaInfo.items = {
51211
+ type: itemType !== 'undefined' ? itemType : 'string'
51212
+ };
51202
51213
  } else {
51203
51214
  if (itemType !== 'undefined') {
51204
51215
  fieldSchemaInfo.type = itemType;
@@ -51222,9 +51233,10 @@ var SchemaBuilder = /*#__PURE__*/function () {
51222
51233
  });
51223
51234
  }
51224
51235
  } else {
51225
- fieldSchemaInfo.enum = componentElement.props.data.map(function (item) {
51226
- return (item === null || item === void 0 ? void 0 : item[format]) || item;
51227
- });
51236
+ var enumData = this.mapEnumData(componentElement.props.data, format);
51237
+ if (enumData.length > 0) {
51238
+ fieldSchemaInfo.enum = enumData;
51239
+ }
51228
51240
  }
51229
51241
  break;
51230
51242
  }
@@ -51275,9 +51287,7 @@ var SchemaBuilder = /*#__PURE__*/function () {
51275
51287
  };
51276
51288
  });
51277
51289
  } else {
51278
- fieldSchemaInfo.items.enum = componentElement.props.data.map(function (item) {
51279
- return (item === null || item === void 0 ? void 0 : item[format]) || item;
51280
- });
51290
+ fieldSchemaInfo.items.enum = this.mapEnumData(componentElement.props.data, format);
51281
51291
  }
51282
51292
  break;
51283
51293
  }
@@ -51309,9 +51319,7 @@ var SchemaBuilder = /*#__PURE__*/function () {
51309
51319
  };
51310
51320
  });
51311
51321
  } else {
51312
- fieldSchemaInfo.enum = componentElement.props.data.map(function (item) {
51313
- return (item === null || item === void 0 ? void 0 : item[format]) || item;
51314
- });
51322
+ fieldSchemaInfo.enum = this.mapEnumData(componentElement.props.data, format);
51315
51323
  }
51316
51324
  break;
51317
51325
  }
@@ -73067,7 +73075,7 @@ var upload_interface = __webpack_require__(8821);
73067
73075
 
73068
73076
 
73069
73077
  /* harmony default export */ var src_0 = ({
73070
- version: '3.8.1'
73078
+ version: '3.8.2-beta.1'
73071
73079
  });
73072
73080
  }();
73073
73081
  /******/ return __webpack_exports__;