@rokkit/core 1.0.0-next.128 → 1.0.0-next.129

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.
@@ -6,9 +6,6 @@ export class FieldMapper {
6
6
  hasImage: ((obj: unknown) => obj is {
7
7
  [x: string]: unknown;
8
8
  }) | undefined;
9
- hasText: ((obj: unknown) => obj is {
10
- [x: string]: unknown;
11
- }) | undefined;
12
9
  hasValue: ((obj: unknown) => obj is {
13
10
  [x: string]: unknown;
14
11
  }) | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rokkit/core",
3
- "version": "1.0.0-next.128",
3
+ "version": "1.0.0-next.129",
4
4
  "description": "Contains core utility functions and classes that can be used in various components.",
5
5
  "author": "Jerry Thomas <me@jerrythomas.name>",
6
6
  "license": "MIT",
@@ -39,6 +39,6 @@
39
39
  "ramda": "^0.32.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@rokkit/icons": "1.0.0-next.128"
42
+ "@rokkit/icons": "1.0.0-next.129"
43
43
  }
44
44
  }
package/src/constants.js CHANGED
@@ -48,7 +48,7 @@ export const BASE_FIELDS = {
48
48
  id: 'id',
49
49
  value: 'value',
50
50
  // Display
51
- label: 'text',
51
+ label: 'label',
52
52
  icon: 'icon',
53
53
  avatar: 'image',
54
54
  subtext: 'description',
@@ -67,7 +67,7 @@ export const BASE_FIELDS = {
67
67
  selected: 'selected',
68
68
  }
69
69
 
70
- const LEGACY_KEY_MAP = { text: 'label', description: 'subtext', title: 'tooltip', image: 'avatar', target: 'hrefTarget' }
70
+ const LEGACY_KEY_MAP = { description: 'subtext', title: 'tooltip', image: 'avatar', target: 'hrefTarget' }
71
71
 
72
72
  /**
73
73
  * Remap legacy field-override keys to their BASE_FIELDS semantic equivalents.
@@ -16,7 +16,6 @@ export class FieldMapper {
16
16
  })
17
17
  this.hasIcon = has(this.#fields.icon)
18
18
  this.hasImage = has(this.#fields.image)
19
- this.hasText = has(this.#fields.text)
20
19
  this.hasValue = has(this.#fields.value)
21
20
  this.hasLabel = has(this.#fields.label)
22
21
  this.hasComponent = has(this.#fields.component)
@@ -47,7 +46,7 @@ export class FieldMapper {
47
46
  return value[this.fields[fieldName]]
48
47
  }
49
48
 
50
- return fieldName === 'text' ? value : null
49
+ return fieldName === 'label' ? value : null
51
50
  }
52
51
 
53
52
  /**
@@ -83,7 +82,7 @@ export class FieldMapper {
83
82
  }
84
83
 
85
84
  getFormattedText(value, formatter) {
86
- const text = this.get('text', value)
85
+ const text = this.get('label', value)
87
86
 
88
87
  if (isNil(text)) return ''
89
88