@onehat/ui 0.3.111 → 0.3.112

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.111",
3
+ "version": "0.3.112",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -143,13 +143,13 @@ function TagComponent(props) {
143
143
  key={ix}
144
144
  text={val.text}
145
145
  onView={() => onView(val)}
146
- onDelete={isEditor ? () => onDelete(val) : null}
146
+ onDelete={() => onDelete(val)}
147
147
  />;
148
148
  });
149
149
 
150
- let WhichCombo = ComboEditor;
151
- if (!_.isNil(_combo.isEditor) && !_combo.isEditor) {
152
- WhichCombo = Combo;
150
+ let WhichCombo = Combo;
151
+ if (_combo.isEditor) {
152
+ WhichCombo = ComboEditor;
153
153
  }
154
154
 
155
155
  const sizeProps = {};
@@ -164,7 +164,7 @@ function TagComponent(props) {
164
164
  }
165
165
  }
166
166
 
167
- if (isEditor && propsToPass.selectorId) {
167
+ if (propsToPass.selectorId) {
168
168
  _combo.selectorId = propsToPass.selectorId;
169
169
  _combo.selectorSelected = propsToPass.selectorSelected;
170
170
  }
@@ -187,15 +187,14 @@ function TagComponent(props) {
187
187
  minHeight={10}
188
188
  flexWrap="wrap"
189
189
  >{valueBoxes}</Row>
190
- {isEditor &&
191
- <WhichCombo
192
- Repository={props.Repository}
193
- Editor={props.Editor}
194
- onChangeValue={onChangeComboValue}
195
- parent={self}
196
- reference="combo"
197
- {..._combo}
198
- />}
190
+ <WhichCombo
191
+ Repository={props.Repository}
192
+ Editor={props.Editor}
193
+ onChangeValue={onChangeComboValue}
194
+ parent={self}
195
+ reference="combo"
196
+ {..._combo}
197
+ />
199
198
  </Column>
200
199
  {isViewerShown &&
201
200
  <Modal
@@ -245,24 +244,12 @@ export const Tag = withAdditionalProps(
245
244
  function withAdditionalEditorProps(WrappedComponent) {
246
245
  return (props) => {
247
246
  return <WrappedComponent
248
- isEditor={true}
249
- isValueAlwaysArray={true}
250
- isValueAsStringifiedJson={true}
247
+ _combo={{ isEditor: true }}
251
248
  {...props}
252
249
  />;
253
250
  };
254
251
  }
255
252
 
256
- export const TagEditor = withAdditionalEditorProps(
257
- withComponent(
258
- withAlert(
259
- withData(
260
- withValue(
261
- TagComponent
262
- )
263
- )
264
- )
265
- )
266
- );
253
+ export const TagEditor = withAdditionalEditorProps(Tag);
267
254
 
268
255
  export default Tag;