@panneau/core 1.0.0-alpha.170 → 1.0.0-alpha.193

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/es/index.js CHANGED
@@ -16,6 +16,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
16
16
  import 'lodash/isString';
17
17
  import isArray from 'lodash/isArray';
18
18
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
19
+ import 'lodash/capitalize';
19
20
  import 'slugify';
20
21
  import uniqBy from 'lodash/uniqBy';
21
22
  import uniq from 'lodash/uniq';
package/es/utils.js CHANGED
@@ -11,6 +11,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
11
11
  import isString from 'lodash/isString';
12
12
  import isArray from 'lodash/isArray';
13
13
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
14
+ import capitalize from 'lodash/capitalize';
14
15
  import slugify from 'slugify';
15
16
 
16
17
  var convertStyleToString = function convertStyleToString(style) {
@@ -238,9 +239,27 @@ var getFileName = function getFileName() {
238
239
 
239
240
  var getSelectOptions = function getSelectOptions(options) {
240
241
  return options.map(function (it) {
241
- return isObject(it) ? it : {
242
+ if (isObject(it)) {
243
+ var _it$label = it.label,
244
+ label = _it$label === void 0 ? null : _it$label,
245
+ value = it.value;
246
+
247
+ if (label === null) {
248
+ return {
249
+ value: value,
250
+ label: capitalize("".concat(value))
251
+ };
252
+ }
253
+
254
+ return {
255
+ value: value,
256
+ label: "".concat(label)
257
+ };
258
+ }
259
+
260
+ return {
242
261
  value: it,
243
- label: it
262
+ label: capitalize("".concat(it))
244
263
  };
245
264
  });
246
265
  };
package/lib/index.js CHANGED
@@ -20,6 +20,7 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
20
20
  require('lodash/isString');
21
21
  var isArray = require('lodash/isArray');
22
22
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
23
+ require('lodash/capitalize');
23
24
  require('slugify');
24
25
  var uniqBy = require('lodash/uniqBy');
25
26
  var uniq = require('lodash/uniq');
package/lib/utils.js CHANGED
@@ -14,6 +14,7 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
14
14
  var isString = require('lodash/isString');
15
15
  var isArray = require('lodash/isArray');
16
16
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
17
+ var capitalize = require('lodash/capitalize');
17
18
  var slugify = require('slugify');
18
19
 
19
20
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -27,6 +28,7 @@ var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_obje
27
28
  var isString__default = /*#__PURE__*/_interopDefaultLegacy(isString);
28
29
  var isArray__default = /*#__PURE__*/_interopDefaultLegacy(isArray);
29
30
  var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
31
+ var capitalize__default = /*#__PURE__*/_interopDefaultLegacy(capitalize);
30
32
  var slugify__default = /*#__PURE__*/_interopDefaultLegacy(slugify);
31
33
 
32
34
  var convertStyleToString = function convertStyleToString(style) {
@@ -254,9 +256,27 @@ var getFileName = function getFileName() {
254
256
 
255
257
  var getSelectOptions = function getSelectOptions(options) {
256
258
  return options.map(function (it) {
257
- return isObject__default['default'](it) ? it : {
259
+ if (isObject__default['default'](it)) {
260
+ var _it$label = it.label,
261
+ label = _it$label === void 0 ? null : _it$label,
262
+ value = it.value;
263
+
264
+ if (label === null) {
265
+ return {
266
+ value: value,
267
+ label: capitalize__default['default']("".concat(value))
268
+ };
269
+ }
270
+
271
+ return {
272
+ value: value,
273
+ label: "".concat(label)
274
+ };
275
+ }
276
+
277
+ return {
258
278
  value: it,
259
- label: it
279
+ label: capitalize__default['default']("".concat(it))
260
280
  };
261
281
  });
262
282
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/core",
3
- "version": "1.0.0-alpha.170",
3
+ "version": "1.0.0-alpha.193",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -114,5 +114,5 @@
114
114
  "publishConfig": {
115
115
  "access": "public"
116
116
  },
117
- "gitHead": "bba760fc2b560b9a0467b6e22d9bd8ca8618abb2"
117
+ "gitHead": "d2ca466ff6c7d5a8cacf0fe7a5c01a10590661cd"
118
118
  }