@onehat/ui 0.3.112 → 0.3.113

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/ui",
3
- "version": "0.3.112",
3
+ "version": "0.3.113",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -20,7 +20,7 @@ import _ from 'lodash';
20
20
  function TagComponent(props) {
21
21
 
22
22
  const {
23
- isEditor = false,
23
+ isViewOnly = false,
24
24
  isValueAlwaysArray,
25
25
  isValueAsStringifiedJson,
26
26
  Editor,
@@ -143,7 +143,7 @@ function TagComponent(props) {
143
143
  key={ix}
144
144
  text={val.text}
145
145
  onView={() => onView(val)}
146
- onDelete={() => onDelete(val)}
146
+ onDelete={!isViewOnly ? () => onDelete(val) : null}
147
147
  />;
148
148
  });
149
149
 
@@ -187,14 +187,14 @@ function TagComponent(props) {
187
187
  minHeight={10}
188
188
  flexWrap="wrap"
189
189
  >{valueBoxes}</Row>
190
- <WhichCombo
191
- Repository={props.Repository}
192
- Editor={props.Editor}
193
- onChangeValue={onChangeComboValue}
194
- parent={self}
195
- reference="combo"
196
- {..._combo}
197
- />
190
+ {!isViewOnly && <WhichCombo
191
+ Repository={props.Repository}
192
+ Editor={props.Editor}
193
+ onChangeValue={onChangeComboValue}
194
+ parent={self}
195
+ reference="combo"
196
+ {..._combo}
197
+ />}
198
198
  </Column>
199
199
  {isViewerShown &&
200
200
  <Modal
@@ -103,13 +103,17 @@ export default function GridRow(props) {
103
103
  if (item?.properties && item.properties[config.fieldName]) {
104
104
  const property = item.properties[config.fieldName];
105
105
  value = property.displayValue;
106
+ const type = property?.viewerType?.type;
106
107
 
107
- if (property?.viewerType?.type) {
108
- const Element = getComponentFromType(property?.viewerType?.type);
108
+ if (type) {
109
+ const Element = getComponentFromType(type);
109
110
  const elementProps = {};
110
111
  if (UiGlobals.mode === UI_MODE_WEB) {
111
112
  elementProps.textOverflow = 'ellipsis';
112
113
  }
114
+ if (type.match(/(Tag|TagEditor)$/)) {
115
+ elementProps.isViewOnly = true; // TODO: this won't work for InlineGridEditor, bc that Grid can't use isViewOnly when actually editing
116
+ }
113
117
  return <Element
114
118
  value={value}
115
119
  key={key}