@iobroker/gui-components 10.2.0 → 10.2.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.
Files changed (41) hide show
  1. package/README.md +7 -1
  2. package/build/Components/ColorPicker.d.ts +94 -12
  3. package/build/Components/ColorPicker.js +567 -111
  4. package/build/Components/ColorPicker.js.map +1 -1
  5. package/build/Components/ObjectBrowser/dialogs.js +7 -3
  6. package/build/Components/ObjectBrowser/dialogs.js.map +1 -1
  7. package/build/Components/ObjectBrowser/renderLeaf.js +29 -10
  8. package/build/Components/ObjectBrowser/renderLeaf.js.map +1 -1
  9. package/build/Components/Schedule.js +176 -78
  10. package/build/Components/Schedule.js.map +1 -1
  11. package/build/Components/TreeTable.d.ts +6 -2
  12. package/build/Components/TreeTable.js +183 -103
  13. package/build/Components/TreeTable.js.map +1 -1
  14. package/build/Dialogs/Error.js +26 -5
  15. package/build/Dialogs/Error.js.map +1 -1
  16. package/build/i18n/de.json +20 -0
  17. package/build/i18n/en.json +20 -0
  18. package/build/i18n/es.json +20 -0
  19. package/build/i18n/fr.json +20 -0
  20. package/build/i18n/it.json +20 -0
  21. package/build/i18n/nl.json +20 -0
  22. package/build/i18n/pl.json +20 -0
  23. package/build/i18n/pt.json +20 -0
  24. package/build/i18n/ru.json +20 -0
  25. package/build/i18n/uk.json +20 -0
  26. package/build/i18n/zh-cn.json +20 -0
  27. package/build/index.d.ts +2 -1
  28. package/build/index.js +1 -1
  29. package/build/index.js.map +1 -1
  30. package/i18n/de.json +20 -0
  31. package/i18n/en.json +20 -0
  32. package/i18n/es.json +20 -0
  33. package/i18n/fr.json +20 -0
  34. package/i18n/it.json +20 -0
  35. package/i18n/nl.json +20 -0
  36. package/i18n/pl.json +20 -0
  37. package/i18n/pt.json +20 -0
  38. package/i18n/ru.json +20 -0
  39. package/i18n/uk.json +20 -0
  40. package/i18n/zh-cn.json +20 -0
  41. package/package.json +1 -3
@@ -823,9 +823,29 @@ export function renderLeaf(that, item, isExpanded, counter) {
823
823
  // In the narrow layout that used to remove the whole cell - and with it the only way to tap
824
824
  // the value and open the editor. Keep the (empty) cell for editable states.
825
825
  const showValueCell = that.columnsVisibility.val || (narrowStyleWithDetails && (!!columnValue || valueEditable));
826
+ /** Open the value editor - used by the value cell and by the edit button of the narrow details view */
827
+ const editValue = () => {
828
+ if (!obj || !that.states) {
829
+ return;
830
+ }
831
+ if (common?.type === 'file') {
832
+ that.setState({ viewFileDialog: id });
833
+ return;
834
+ }
835
+ that.edit = {
836
+ val: that.states[id] ? that.states[id].val : '',
837
+ q: that.states[id] ? that.states[id].q || 0 : 0,
838
+ ack: false,
839
+ id,
840
+ };
841
+ that.setState({ updateOpened: true });
842
+ };
826
843
  let colValue = showValueCell ? (React.createElement("div", { style: {
827
844
  ...styles.cellValue,
828
845
  width: that.width !== 'xs' ? colWidth('val') : 'calc(100% - 100px)',
846
+ // An empty inline-block has no height, so a state without a value would offer nothing
847
+ // to tap on in the narrow details view.
848
+ minHeight: narrowStyleWithDetails ? 20 : undefined,
829
849
  cursor: valueEditable
830
850
  ? common?.type === 'file'
831
851
  ? 'zoom-in'
@@ -839,7 +859,7 @@ export function renderLeaf(that, item, isExpanded, counter) {
839
859
  // return;
840
860
  }
841
861
  else if (common?.type === 'file') {
842
- that.setState({ viewFileDialog: id });
862
+ editValue();
843
863
  }
844
864
  else if (item.data.url && e.ctrlKey) {
845
865
  if (that.states[id]?.val && typeof that.states[id].val === 'string') {
@@ -865,13 +885,7 @@ export function renderLeaf(that, item, isExpanded, counter) {
865
885
  .catch(e => window.alert(`Cannot write state "${id}": ${e}`));
866
886
  }
867
887
  else {
868
- that.edit = {
869
- val: that.states[id] ? that.states[id].val : '',
870
- q: that.states[id] ? that.states[id].q || 0 : 0,
871
- ack: false,
872
- id,
873
- };
874
- that.setState({ updateOpened: true });
888
+ editValue();
875
889
  }
876
890
  }
877
891
  else if (common?.role === 'url' || (common?.role === 'url.blank' && e.ctrlKey)) {
@@ -917,7 +931,11 @@ export function renderLeaf(that, item, isExpanded, counter) {
917
931
  if (!colCustom.length) {
918
932
  colCustom = null;
919
933
  }
920
- colDetails = (React.createElement(Paper, { style: {
934
+ colDetails = (React.createElement(Paper
935
+ // `renderItem` pushes this panel into the array of rows, so it needs its own key
936
+ , {
937
+ // `renderItem` pushes this panel into the array of rows, so it needs its own key
938
+ key: `details_${id}`, style: {
921
939
  width: '100%',
922
940
  // the padding must be inside of the width, else the row is wider than the table
923
941
  boxSizing: 'border-box',
@@ -957,7 +975,8 @@ export function renderLeaf(that, item, isExpanded, counter) {
957
975
  : that.props.isFloatComma,
958
976
  });
959
977
  that.onCopy(e, valText.c !== undefined ? valText.c : valText.v.toString());
960
- }, key: "cc" }))),
978
+ }, key: "cc" }),
979
+ valueEditable ? (React.createElement(IconEdit, { style: styles.cellCopyButtonInDetails, onClick: editValue, key: "ce" })) : null)),
961
980
  colButtons && React.createElement("div", { style: { ...styles.cellDetailsLine, justifyContent: 'right' } }, colButtons)));
962
981
  colName = null;
963
982
  colMiddle = null;