@entryscape/rdforms 10.9.5 → 10.10.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/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "application profile",
9
9
  "linked data"
10
10
  ],
11
- "version": "10.9.5",
11
+ "version": "10.10.1",
12
12
  "main": "dist/rdforms.node.js",
13
13
  "browser": "dist/rdforms.react.js",
14
14
  "module": "main.js",
@@ -40,8 +40,8 @@
40
40
  "nls-loader": "https://bitbucket.org/metasolutions/nls-loader#master",
41
41
  "node-fetch": "^2.6.0",
42
42
  "popper.js": "^1.12.9",
43
- "react": "^17.0.2",
44
- "react-dom": "^17.0.2",
43
+ "react": "^18.2.0",
44
+ "react-dom": "^18.2.0",
45
45
  "react-hooks-lib": "^0.1.5",
46
46
  "regenerator-runtime": "^0.13.2",
47
47
  "select2": "4.0.8",
@@ -70,7 +70,10 @@ export default class Item {
70
70
  'deprecated',
71
71
  'inline',
72
72
  'truncate',
73
- 'noTruncate'
73
+ 'noTruncate',
74
+ 'card',
75
+ 'cardInPresent',
76
+ 'cardInEdit'
74
77
  ];
75
78
  this._getLocalizedValue = utils.getLocalizedValue;
76
79
  }
@@ -174,7 +174,7 @@ export default class Editor extends Presenter {
174
174
  } else {
175
175
  target = 1;
176
176
  }
177
- if (item.hasStyle('nonEditable') && !item.hasStyle('autoInitDate') && !item.hasStyle('autoUpdateDate') && !item.hasStyle('autoUUID') && !item.hasStyle('autoValue')) {
177
+ if (item.hasStyle('nonEditable') && !item.hasStyle('autoInitDate') && !item.hasStyle('autoUpdateDate') && !item.hasStyle('autoUUID') && !item.hasStyle('autoValue') && !item.getValue()) {
178
178
  return _bindings;
179
179
  }
180
180
  if (target > _bindings.length) {
package/src/view/View.js CHANGED
@@ -353,7 +353,11 @@ export default class View {
353
353
  renderingContext.domClassToggle(rowNode, 'hiddenProperty', true);
354
354
  }
355
355
 
356
- if (item.hasStyle('card')) {
356
+ const isEditor = this._subEditors !== undefined;
357
+ if (item.hasStyle('card') ||
358
+ (item.hasStyle('cardInEdit') && isEditor) ||
359
+ (item.hasStyle('cardInPresent') && !isEditor)
360
+ ) {
357
361
  renderingContext.domClassToggle(rowNode, 'rdformsCard', true);
358
362
  }
359
363
  return rowNode;
@@ -1,5 +1,5 @@
1
1
  import React, { Component } from 'react';
2
- import ReactDOM from 'react-dom';
2
+ import { createRoot } from 'react-dom/client';
3
3
  import Presenter from '../Presenter';
4
4
  import Editor from '../Editor';
5
5
  import ValidationPresenter from '../ValidationPresenter';
@@ -12,7 +12,8 @@ const fixIt = (Cls) => {
12
12
  if (!this.initiatedAlready && this.domNode.parent instanceof Node) {
13
13
  // eslint-disable-next-line no-unused-vars
14
14
  const Cmp = this.domNode.component;
15
- ReactDOM.render(<Cmp></Cmp>, this.domNode.parent);
15
+ const root = createRoot(this.domNode.parent);
16
+ root.render(<Cmp></Cmp>);
16
17
  }
17
18
  this.initiatedAlready = true;
18
19
  }
@@ -33,4 +34,8 @@ const ReactEditor = fixIt(Editor);
33
34
  const ReactPresenter = fixIt(Presenter);
34
35
  const ReactValidationPresenter = fixIt(ValidationPresenter);
35
36
 
36
- export { ReactEditor as Editor, ReactPresenter as Presenter, ReactValidationPresenter as ValidationPresenter };
37
+ export {
38
+ ReactEditor as Editor,
39
+ ReactPresenter as Presenter,
40
+ ReactValidationPresenter as ValidationPresenter,
41
+ };