@prismatic-io/spectral 5.3.0 → 5.3.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/dist/index.js CHANGED
@@ -36,8 +36,11 @@ exports.testing = exports.util = exports.oauth2Connection = exports.connection =
36
36
  */
37
37
  const types_1 = require("./types");
38
38
  const convertInput = (key, _a) => {
39
- var { default: defaultValue, type } = _a, rest = __rest(_a, ["default", "type"]);
40
- return (Object.assign(Object.assign({}, rest), { type, default: defaultValue !== null && defaultValue !== void 0 ? defaultValue : types_1.InputFieldDefaultMap[type], key }));
39
+ var { default: defaultValue, type, label, collection } = _a, rest = __rest(_a, ["default", "type", "label", "collection"]);
40
+ return (Object.assign(Object.assign({}, rest), { key,
41
+ type, default: defaultValue !== null && defaultValue !== void 0 ? defaultValue : types_1.InputFieldDefaultMap[type], collection, label: typeof label === "string" ? label : label.value, keyLabel: collection === "keyvaluelist" && typeof label === "object"
42
+ ? label.key
43
+ : undefined }));
41
44
  };
42
45
  /**
43
46
  * This is a helper function for component() to convert an
@@ -8,7 +8,10 @@ interface BaseInputFieldDefinition {
8
8
  /** Data type the InputField will collect. */
9
9
  type: InputFieldType;
10
10
  /** Interface label of the InputField. */
11
- label: string;
11
+ label: {
12
+ key: string;
13
+ value: string;
14
+ } | string;
12
15
  /** Collection type of the InputField */
13
16
  collection?: InputFieldCollection;
14
17
  /** Text to show as the InputField placeholder. */
@@ -139,6 +139,8 @@ interface DefaultInputField {
139
139
  key: string;
140
140
  /** Interface label of the InputField. */
141
141
  label: string;
142
+ /** Interface label of the Key if the InputField is a 'keyvaluelist'. */
143
+ keyLabel?: string;
142
144
  /** Data type the InputField will collect. */
143
145
  type: InputFieldType;
144
146
  /** Collection type of the InputField */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "5.3.0",
3
+ "version": "5.3.1",
4
4
  "description": "Utility library for building Prismatic components",
5
5
  "keywords": [
6
6
  "prismatic"