tycho-components 0.14.21 → 0.14.22

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.
@@ -4,7 +4,10 @@ import { formatSwitchFieldValue } from './AppFormField';
4
4
  import './style.scss';
5
5
  import { Icon } from 'tycho-storybook';
6
6
  import { UsabilityUtils } from '..';
7
- function truncateValue(value, truncate) {
7
+ function truncateValue(value, truncate, t) {
8
+ if (!value) {
9
+ return t('label.notavailable');
10
+ }
8
11
  if (value.length <= truncate) {
9
12
  return value;
10
13
  }
@@ -12,7 +15,7 @@ function truncateValue(value, truncate) {
12
15
  }
13
16
  function getFieldDisplayContent(field, raw, t) {
14
17
  if (field.truncate) {
15
- return truncateValue(raw, field.truncate);
18
+ return truncateValue(raw, field.truncate, t);
16
19
  }
17
20
  if (field.display) {
18
21
  return field.display(raw);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.14.21",
4
+ "version": "0.14.22",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {