@eclipse-scout/core 22.0.12 → 22.0.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.
Files changed (40) hide show
  1. package/dist/eclipse-scout-core-c4cad26b336b02535421.min.js +2 -0
  2. package/dist/eclipse-scout-core-c4cad26b336b02535421.min.js.map +1 -0
  3. package/dist/eclipse-scout-core-theme-dark-fd0e080c10f65e67b68b.min.css +1 -0
  4. package/dist/eclipse-scout-core-theme-dark.css +20 -5
  5. package/dist/eclipse-scout-core-theme-dark.css.map +1 -1
  6. package/dist/eclipse-scout-core-theme-f3a61fbc12acf8e27fcc.min.css +1 -0
  7. package/dist/eclipse-scout-core-theme.css +20 -5
  8. package/dist/eclipse-scout-core-theme.css.map +1 -1
  9. package/dist/eclipse-scout-core.js +1120 -914
  10. package/dist/eclipse-scout-core.js.map +1 -1
  11. package/dist/file-list +4 -4
  12. package/dist/texts.json +8 -8
  13. package/package.json +2 -2
  14. package/src/App.js +1 -0
  15. package/src/desktop/DesktopDense.less +24 -6
  16. package/src/desktop/OpenUriHandler.js +5 -5
  17. package/src/desktop/outline/pages/Page.js +7 -2
  18. package/src/form/Form.js +15 -3
  19. package/src/form/fields/FormField.js +1 -1
  20. package/src/form/fields/datefield/DateField.js +2 -0
  21. package/src/form/fields/sequencebox/SequenceBox.js +20 -3
  22. package/src/form/fields/stringfield/StringField.js +9 -1
  23. package/src/form/js/JsFormAdapter.js +88 -0
  24. package/src/index.js +2 -1
  25. package/src/scrollbar/scrollbars.js +12 -1
  26. package/src/session/Session.js +21 -18
  27. package/src/table/Table.js +2 -3
  28. package/src/testing/JasmineScoutUtil.js +127 -0
  29. package/src/testing/index.js +7 -3
  30. package/src/tile/TileGrid.js +5 -15
  31. package/src/tile/TileGridLayout.js +21 -11
  32. package/src/tile/accordion/TileAccordion.js +4 -23
  33. package/src/tile/accordion/TileAccordionLayout.js +39 -2
  34. package/src/util/arrays.js +4 -0
  35. package/src/util/objects.js +4 -1
  36. package/src/widget/FilterSupport.js +19 -8
  37. package/dist/eclipse-scout-core-af5ff6abad5f1ff9fd18.min.js +0 -2
  38. package/dist/eclipse-scout-core-af5ff6abad5f1ff9fd18.min.js.map +0 -1
  39. package/dist/eclipse-scout-core-theme-74b63e0d57bed407a729.min.css +0 -1
  40. package/dist/eclipse-scout-core-theme-dark-b82aea152f416e38ce7f.min.css +0 -1
package/dist/file-list CHANGED
@@ -1,9 +1,9 @@
1
- eclipse-scout-core-af5ff6abad5f1ff9fd18.min.js
2
- eclipse-scout-core-af5ff6abad5f1ff9fd18.min.js.map
3
- eclipse-scout-core-theme-74b63e0d57bed407a729.min.css
4
- eclipse-scout-core-theme-dark-b82aea152f416e38ce7f.min.css
1
+ eclipse-scout-core-c4cad26b336b02535421.min.js
2
+ eclipse-scout-core-c4cad26b336b02535421.min.js.map
3
+ eclipse-scout-core-theme-dark-fd0e080c10f65e67b68b.min.css
5
4
  eclipse-scout-core-theme-dark.css
6
5
  eclipse-scout-core-theme-dark.css.map
6
+ eclipse-scout-core-theme-f3a61fbc12acf8e27fcc.min.css
7
7
  eclipse-scout-core-theme.css
8
8
  eclipse-scout-core-theme.css.map
9
9
  eclipse-scout-core.js
package/dist/texts.json CHANGED
@@ -188,19 +188,19 @@
188
188
  "ConfirmApplyChanges": "Voulez-vous appliquer les modifications?",
189
189
  "ErrorWhileLoadingData": "Erreur lors du chargement des données",
190
190
  "FormEmptyMandatoryFieldsMessage": "Les champs suivants doivent être remplis:",
191
- "FormInvalidFieldsMessage": "Les champs suivants ont une valeur non valide:",
192
- "FormSaveChangesQuestion": "Voulez-vous enregistrer les modifications?",
191
+ "FormInvalidFieldsMessage": "Les champs suivants ont une valeur invalide:",
192
+ "FormSaveChangesQuestion": "Est-ce que vous voulez enregistrer les modifications ?",
193
193
  "FormValidationFailedTitle": "Veuillez vérifier les données.",
194
- "FormsCannotBeSaved": "Les masques suivants ne peuvent pas être enregistrés, car ils se trouvent dans un statut non valide:",
194
+ "FormsCannotBeSaved": "Les formulaires suivants ne peuvent pas être enregistrés car ils se trouvent dans un statut non valide:",
195
195
  "GroupBy": "Grouper par",
196
- "InactiveState": "inactif",
196
+ "InactiveState": "Inactif",
197
197
  "InvalidNumberMessageX": "\"{0}\" est un chiffre non valide,",
198
198
  "InvalidValueMessageX": "\"{0}\" est une valeur non valide.",
199
199
  "NavigationBackward": "Retour",
200
200
  "No": "Non",
201
201
  "NoButton": "Non",
202
202
  "NoGrouping": "Aucun groupement",
203
- "NotAllCheckedFormsCanBeSaved": "Tous les formulaires sélectionnés ne peuvent pas être enregistrés",
203
+ "NotAllCheckedFormsCanBeSaved": "Tous les formulaires sélectionnés n'ont pas pu être enregistrés",
204
204
  "NumberTooLargeMessageX": "La valeur est trop grande; doit être inférieure ou égale à {0}.",
205
205
  "NumberTooLargeMessageXY": "La valeur est trop grande; doit être comprise entre {0} et {1}.",
206
206
  "NumberTooSmallMessageX": "La valeur est trop petite; doit être supérieure ou égale à {0}.",
@@ -246,7 +246,7 @@
246
246
  "ui.CloseAllTabs": "Fermer tous les onglets",
247
247
  "ui.CloseOtherTabs": "Fermer les autres onglets",
248
248
  "ui.CodeUndefined": "[Inconnu]",
249
- "ui.CollapseAll": "fermer tous",
249
+ "ui.CollapseAll": "tout fermer",
250
250
  "ui.Coloring": "Coloration",
251
251
  "ui.Column": "Colonne",
252
252
  "ui.ConnectionInterrupted": "Connexion interrompue",
@@ -261,7 +261,7 @@
261
261
  "ui.Done": "OK",
262
262
  "ui.EmptyCell": "-vide-",
263
263
  "ui.ErrorCodeX": "Code {0}",
264
- "ui.ExpandAll": "déplier tous",
264
+ "ui.ExpandAll": "tout déplier",
265
265
  "ui.FileChooserHint": "Veuillez faire glisser les fichiers souhaités dans cette zone ou les sélectionner avec Parcourir.",
266
266
  "ui.FileSizeLimit": "La taille maximale autorisée du fichier a été dépassée ({0} MB}.",
267
267
  "ui.FileSizeLimitTitle": "Limitation de la taille des fichier",
@@ -315,7 +315,7 @@
315
315
  "ui.ReloadData": "Recharger les données",
316
316
  "ui.RemoveFilter": "Supprimer le filtre",
317
317
  "ui.SearchFor_": "Rechercher par…",
318
- "ui.SelectAll": "Sélectionner tous",
318
+ "ui.SelectAll": "Tout sélectionner",
319
319
  "ui.SelectAllFilter": "Tous",
320
320
  "ui.SelectNone": "Sélectionner aucun",
321
321
  "ui.SelectNoneFilter": "Aucun",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-scout/core",
3
- "version": "22.0.12",
3
+ "version": "22.0.22",
4
4
  "description": "Eclipse Scout runtime",
5
5
  "author": "BSI Business Systems Integration AG",
6
6
  "homepage": "https://www.eclipse.org/scout",
@@ -26,7 +26,7 @@
26
26
  "src"
27
27
  ],
28
28
  "devDependencies": {
29
- "@eclipse-scout/cli": "22.0.12",
29
+ "@eclipse-scout/cli": "22.0.22",
30
30
  "@eclipse-scout/releng": "^22.0.0",
31
31
  "jasmine-core": "3.10.1",
32
32
  "jasmine-ajax": "4.0.0",
package/src/App.js CHANGED
@@ -62,6 +62,7 @@ export default class App {
62
62
  * @param {string|string[]} [options.bootstrap.textsUrl] URL or multiple URLs pointing to a json resource containing texts that will be available through texts.js.
63
63
  * @param {string} [options.bootstrap.localesUrl] URL pointing to a json resource containing locale information processed by locales.js
64
64
  * @param {string} [options.bootstrap.codesUrl] URL pointing to a json resources containing codes that will be available through codes.js
65
+ * @param {object} [options.session] Object to configure the session, see {@link Session.init} for the available options.
65
66
  */
66
67
  init(options) {
67
68
  options = options || {};
@@ -1,9 +1,9 @@
1
1
  /*
2
- * Copyright (c) 2010-2021 BSI Business Systems Integration AG.
2
+ * Copyright (c) 2010-2022 BSI Business Systems Integration AG.
3
3
  * All rights reserved. This program and the accompanying materials
4
4
  * are made available under the terms of the Eclipse Public License v1.0
5
5
  * which accompanies this distribution, and is available at
6
- * http://www.eclipse.org/legal/epl-v10.html
6
+ * https://www.eclipse.org/legal/epl-v10.html
7
7
  *
8
8
  * Contributors:
9
9
  * BSI Business Systems Integration AG - initial API and implementation
@@ -50,7 +50,8 @@
50
50
 
51
51
  .menubar:not(.main-menubar) {
52
52
  & > .menubar-box {
53
- & > .menu-item {
53
+ & > .menu-item,
54
+ & > .combo-menu > .menu-item {
54
55
  padding-top: 3px; /* @menubar-item-padding-y; */
55
56
  padding-bottom: 3px; /* @menubar-item-padding-y; */
56
57
 
@@ -58,10 +59,22 @@
58
59
  min-height: @logical-grid-row-height-dense; /* @logical-grid-row-height; */
59
60
  }
60
61
 
61
- & > .menu-button {
62
+ & > .menu-button,
63
+ & > .combo-menu > .menu-button {
62
64
  padding-top: 2px;
63
65
  padding-bottom: 2px;
64
66
  }
67
+
68
+ & > .combo-menu {
69
+ padding: 0;
70
+ }
71
+
72
+ & > .form-field-menu {
73
+ padding-top: 0;
74
+ padding-bottom: 0;
75
+ margin-top: 0;
76
+ margin-bottom: 0;
77
+ }
65
78
  }
66
79
  }
67
80
 
@@ -155,14 +168,18 @@
155
168
  }
156
169
  }
157
170
 
158
-
159
171
  /* ContextMenuPopup.less */
160
172
 
161
173
  .context-menu {
162
- & > .menu-item {
174
+ & > .menu-item,
175
+ & > .combo-menu > .menu-item {
163
176
  padding-top: 6px; /* padding: 11px 15px; */
164
177
  padding-bottom: 6px;
165
178
  }
179
+
180
+ & > .combo-menu {
181
+ padding: 0;
182
+ }
166
183
  }
167
184
 
168
185
  /* CheckBoxField.less */
@@ -279,6 +296,7 @@
279
296
  }
280
297
 
281
298
  /* BreadcrumbItem.less */
299
+
282
300
  .breadcrumb-item {
283
301
  font-size: @font-size-normal;
284
302
  }
@@ -1,9 +1,9 @@
1
1
  /*
2
- * Copyright (c) 2014-2018 BSI Business Systems Integration AG.
2
+ * Copyright (c) 2010-2022 BSI Business Systems Integration AG.
3
3
  * All rights reserved. This program and the accompanying materials
4
4
  * are made available under the terms of the Eclipse Public License v1.0
5
5
  * which accompanies this distribution, and is available at
6
- * http://www.eclipse.org/legal/epl-v10.html
6
+ * https://www.eclipse.org/legal/epl-v10.html
7
7
  *
8
8
  * Contributors:
9
9
  * BSI Business Systems Integration AG - initial API and implementation
@@ -50,7 +50,7 @@ export default class OpenUriHandler {
50
50
  } else {
51
51
  this.openUriAsNewWindow(uri);
52
52
  }
53
- } else if (Device.get().browser === Device.Browser.CHROME) {
53
+ } else if (Device.get().browser === Device.Browser.CHROME && this.isUriWithExternallyHandledProtocol(uri)) {
54
54
  // "Hidden iframe"-solution is not working in Chromium (https://bugs.chromium.org/p/chromium/issues/detail?id=663325)
55
55
  this.openUriInSameWindow(uri);
56
56
  } else {
@@ -59,7 +59,7 @@ export default class OpenUriHandler {
59
59
  }
60
60
 
61
61
  isUriWithExternallyHandledProtocol(uri) {
62
- return /^(callto|facetime|fax|geo|mailto|maps|notes|sip|skype|tel|google.navigation):/.test(uri);
62
+ return /^(callto|facetime|fax|geo|mailto|maps|notes|sip|skype|tel|google.navigation|sms|msteams):/.test(uri);
63
63
  }
64
64
 
65
65
  handleUriActionOpen(uri) {
@@ -69,7 +69,7 @@ export default class OpenUriHandler {
69
69
  // Additionally, some url types require to be opened in the same window like tel or mailto, at least on mobile devices
70
70
  this.openUriInSameWindow(uri);
71
71
  } else if (this.isUriWithExternallyHandledProtocol(uri)) {
72
- if (Device.get().browser === Device.Browser.CHROME) {
72
+ if (Device.get().browser === Device.Browser.CHROME || Device.get().isAndroid()) {
73
73
  // "Hidden iframe"-solution is not working in Chromium (https://bugs.chromium.org/p/chromium/issues/detail?id=663325)
74
74
  this.openUriInSameWindow(uri);
75
75
  } else {
@@ -1,9 +1,9 @@
1
1
  /*
2
- * Copyright (c) 2010-2021 BSI Business Systems Integration AG.
2
+ * Copyright (c) 2010-2022 BSI Business Systems Integration AG.
3
3
  * All rights reserved. This program and the accompanying materials
4
4
  * are made available under the terms of the Eclipse Public License v1.0
5
5
  * which accompanies this distribution, and is available at
6
- * http://www.eclipse.org/legal/epl-v10.html
6
+ * https://www.eclipse.org/legal/epl-v10.html
7
7
  *
8
8
  * Contributors:
9
9
  * BSI Business Systems Integration AG - initial API and implementation
@@ -198,6 +198,11 @@ export default class Page extends TreeNode {
198
198
  if (form instanceof Form) {
199
199
  form.setModal(false);
200
200
  form.setClosable(false);
201
+
202
+ form.setDisplayHint(Form.DisplayHint.VIEW);
203
+ form.setDisplayViewId('C');
204
+
205
+ form.setShowOnOpen(false);
201
206
  }
202
207
  if (form instanceof TileOverviewForm) {
203
208
  form.setPage(this);
package/src/form/Form.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /*
2
- * Copyright (c) 2010-2021 BSI Business Systems Integration AG.
2
+ * Copyright (c) 2010-2022 BSI Business Systems Integration AG.
3
3
  * All rights reserved. This program and the accompanying materials
4
4
  * are made available under the terms of the Eclipse Public License v1.0
5
5
  * which accompanies this distribution, and is available at
6
- * http://www.eclipse.org/legal/epl-v10.html
6
+ * https://www.eclipse.org/legal/epl-v10.html
7
7
  *
8
8
  * Contributors:
9
9
  * BSI Business Systems Integration AG - initial API and implementation
@@ -21,6 +21,7 @@ export default class Form extends Widget {
21
21
  this.askIfNeedSave = true;
22
22
  this.askIfNeedSaveText = null; // if not set, a default text is used (see Lifecycle.js)
23
23
  this.data = {};
24
+ this.displayViewId = null;
24
25
  this.displayHint = Form.DisplayHint.DIALOG;
25
26
  this.displayParent = null; // only relevant if form is opened, not relevant if form is just rendered into another widget (not managed by a form controller)
26
27
  this.maximized = false;
@@ -44,6 +45,7 @@ export default class Form extends Widget {
44
45
  this.messageBoxController = null;
45
46
  this.fileChooserController = null;
46
47
  this.closeKeyStroke = null;
48
+ this.showOnOpen = true;
47
49
  this._glassPaneRenderer = null;
48
50
  this._preMaximizedBounds = null;
49
51
  this._resizeHandler = this._onResize.bind(this);
@@ -239,7 +241,9 @@ export default class Form extends Widget {
239
241
  // If form has been closed right after it was opened don't try to show it
240
242
  return;
241
243
  }
242
- this.show();
244
+ if (this.showOnOpen) {
245
+ this.show();
246
+ }
243
247
  });
244
248
  }
245
249
 
@@ -754,6 +758,10 @@ export default class Form extends Widget {
754
758
  }
755
759
  }
756
760
 
761
+ setDisplayViewId(displayViewId) {
762
+ this.setProperty('displayViewId', displayViewId);
763
+ }
764
+
757
765
  setDisplayHint(displayHint) {
758
766
  this.setProperty('displayHint', displayHint);
759
767
  }
@@ -820,6 +828,10 @@ export default class Form extends Widget {
820
828
  return $prevIcon;
821
829
  }
822
830
 
831
+ setShowOnOpen(showOnOpen) {
832
+ this.setProperty('showOnOpen', showOnOpen);
833
+ }
834
+
823
835
  _updateTitleForWindow() {
824
836
  let formTitle = strings.join(' - ', this.title, this.subTitle),
825
837
  applicationTitle = this.session.desktop.title;
@@ -1134,7 +1134,7 @@ export default class FormField extends Widget {
1134
1134
  if (!this.fieldStatus) {
1135
1135
  return;
1136
1136
  }
1137
- this.fieldStatus.remove();
1137
+ this.fieldStatus.destroy();
1138
1138
  this.$status = null;
1139
1139
  this.fieldStatus = null;
1140
1140
  }
@@ -205,6 +205,7 @@ export default class DateField extends ValueField {
205
205
  this.htmlDateTimeComposite.invalidateLayoutTree();
206
206
  }
207
207
  this._renderDateClearable();
208
+ this.$container.toggleClass('has-date', this.hasDate);
208
209
  }
209
210
 
210
211
  setHasTime(hasTime) {
@@ -257,6 +258,7 @@ export default class DateField extends ValueField {
257
258
  this.htmlDateTimeComposite.invalidateLayoutTree();
258
259
  }
259
260
  this._renderTimeClearable();
261
+ this.$container.toggleClass('has-time', this.hasTime);
260
262
  }
261
263
 
262
264
  setTimePickerResolution(timePickerResolution) {
@@ -1,9 +1,9 @@
1
1
  /*
2
- * Copyright (c) 2010-2021 BSI Business Systems Integration AG.
2
+ * Copyright (c) 2010-2022 BSI Business Systems Integration AG.
3
3
  * All rights reserved. This program and the accompanying materials
4
4
  * are made available under the terms of the Eclipse Public License v1.0
5
5
  * which accompanies this distribution, and is available at
6
- * http://www.eclipse.org/legal/epl-v10.html
6
+ * https://www.eclipse.org/legal/epl-v10.html
7
7
  *
8
8
  * Contributors:
9
9
  * BSI Business Systems Integration AG - initial API and implementation
@@ -19,6 +19,8 @@ export default class SequenceBox extends CompositeField {
19
19
  this.logicalGrid = scout.create('scout.HorizontalGrid');
20
20
  this.layoutConfig = null;
21
21
  this.fields = [];
22
+ this._fieldPropertyChangeHandler = this._onFieldPropertyChange.bind(this);
23
+ this._lastVisibleFieldSuppressStatusHandler = this._onLastVisibleFieldSuppressStatusChange.bind(this);
22
24
  }
23
25
 
24
26
  _init(model) {
@@ -65,7 +67,7 @@ export default class SequenceBox extends CompositeField {
65
67
  for (i = 0; i < this.fields.length; i++) {
66
68
  field = this.fields[i];
67
69
  field.labelUseUiWidth = true;
68
- field.on('propertyChange', this._onFieldPropertyChange.bind(this));
70
+ field.on('propertyChange', this._fieldPropertyChangeHandler);
69
71
  field.render(this.$field);
70
72
  this._modifyLabel(field);
71
73
 
@@ -83,6 +85,14 @@ export default class SequenceBox extends CompositeField {
83
85
  return new SequenceBoxLayout(this, this.layoutConfig);
84
86
  }
85
87
 
88
+ _remove() {
89
+ this.fields.forEach(f => f.off('propertyChange', this._fieldPropertyChangeHandler));
90
+ if (this._lastVisibleField) {
91
+ this._lastVisibleField.off('propertyChange:suppressStatus', this._lastVisibleFieldSuppressStatusHandler);
92
+ }
93
+ super._remove();
94
+ }
95
+
86
96
  /**
87
97
  * @override
88
98
  */
@@ -137,6 +147,7 @@ export default class SequenceBox extends CompositeField {
137
147
  _handleStatus(visibilityChanged) {
138
148
  if (visibilityChanged && this._lastVisibleField) {
139
149
  // if there is a new last visible field, make sure the status is shown on the previously last one
150
+ this._lastVisibleField.off('propertyChange:suppressStatus', this._lastVisibleFieldSuppressStatusHandler);
140
151
  this._lastVisibleField.setSuppressStatus(null);
141
152
  if (this._lastVisibleField.rendered) {
142
153
  this._lastVisibleField._renderErrorStatus();
@@ -184,6 +195,7 @@ export default class SequenceBox extends CompositeField {
184
195
 
185
196
  // Make sure the last field won't display a status (but shows status CSS class)
186
197
  this._lastVisibleField.setSuppressStatus(FormField.SuppressStatus.ICON);
198
+ this._lastVisibleField.on('propertyChange:suppressStatus', this._lastVisibleFieldSuppressStatusHandler);
187
199
  if (visibilityChanged) {
188
200
  // If the last field got invisible, make sure the new last field does not display a status anymore (now done by the seq box)
189
201
  if (this._lastVisibleField.rendered) {
@@ -194,6 +206,11 @@ export default class SequenceBox extends CompositeField {
194
206
  }
195
207
  }
196
208
 
209
+ _onLastVisibleFieldSuppressStatusChange(e) {
210
+ // do not change suppressStatus
211
+ e.preventDefault();
212
+ }
213
+
197
214
  setErrorStatus(errorStatus) {
198
215
  if (this._isOverwritingStatusFromField && !this._isErrorStatusOverwritten) {
199
216
  // was not overwritten, will be overwritten now -> backup old value
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2014-2018 BSI Business Systems Integration AG.
2
+ * Copyright (c) 2010-2022 BSI Business Systems Integration AG.
3
3
  * All rights reserved. This program and the accompanying materials
4
4
  * are made available under the terms of the Eclipse Public License v1.0
5
5
  * which accompanies this distribution, and is available at
@@ -255,6 +255,14 @@ export default class StringField extends BasicField {
255
255
  this.revalidateLayout();
256
256
  }
257
257
 
258
+ /**
259
+ * @override
260
+ */
261
+ _renderEnabled() {
262
+ super._renderEnabled();
263
+ this.revalidateLayout();
264
+ }
265
+
258
266
  setFormatUpper(formatUpper) {
259
267
  if (formatUpper) {
260
268
  this.setFormat(StringField.Format.UPPER);
@@ -0,0 +1,88 @@
1
+ /*
2
+ * Copyright (c) 2010-2022 BSI Business Systems Integration AG.
3
+ * All rights reserved. This program and the accompanying materials
4
+ * are made available under the terms of the Eclipse Public License v1.0
5
+ * which accompanies this distribution, and is available at
6
+ * https://www.eclipse.org/legal/epl-v10.html
7
+ *
8
+ * Contributors:
9
+ * BSI Business Systems Integration AG - initial API and implementation
10
+ */
11
+ import {FormAdapter} from '../../index';
12
+
13
+ /**
14
+ * @typedef JsFormModel
15
+ * @property {object} parent
16
+ * @property {object} owner
17
+ * @property {object} displayParent
18
+ * @property {object} inputData
19
+ * @property {string} jsFormObjectType
20
+ * @property {object} jsFormModel
21
+ */
22
+
23
+ export default class JsFormAdapter extends FormAdapter {
24
+
25
+ constructor() {
26
+ super();
27
+ }
28
+
29
+ /**
30
+ * @param {JsFormModel} model
31
+ */
32
+ _initModel(model, parent) {
33
+ model = super._initModel(model, parent);
34
+
35
+ if (!model.jsFormObjectType || !model.jsFormObjectType.length) {
36
+ throw new Error('jsFormObjectType not set');
37
+ }
38
+
39
+ let jsFormModel = {
40
+ parent: model.parent,
41
+ owner: model.owner,
42
+ objectType: model.jsFormObjectType,
43
+ displayParent: model.displayParent,
44
+ data: model.inputData
45
+ };
46
+
47
+ if (model.jsFormModel) {
48
+ jsFormModel = $.extend(true, {}, model.jsFormModel, jsFormModel);
49
+ }
50
+
51
+ return jsFormModel;
52
+ }
53
+
54
+ _createWidget(model) {
55
+ let widget = super._createWidget(model);
56
+
57
+ widget.showOnOpen = false;
58
+ widget.open();
59
+
60
+ return widget;
61
+ }
62
+
63
+ _onWidgetEvent(event) {
64
+ if (event.type === 'save') {
65
+ this._onWidgetSave(event);
66
+ } else {
67
+ super._onWidgetEvent(event);
68
+ }
69
+ }
70
+
71
+ _onWidgetSave(event) {
72
+ this._send('save', {
73
+ outputData: this.widget.data
74
+ });
75
+ }
76
+
77
+ _onWidgetClose(event) {
78
+ // marks the end of the js lifecycle
79
+ // prevent remove/destroy of the widget as it will be done by the UI server
80
+ event.preventDefault();
81
+ // fromClosing will trigger a 'formHide' event on the desktop which then removes the widget
82
+ this._send('formClosing');
83
+ }
84
+
85
+ _onWidgetAbort(event) {
86
+ // completely handled by the js lifecycle -> no need to notify the UI server
87
+ }
88
+ }
package/src/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * All rights reserved. This program and the accompanying materials
4
4
  * are made available under the terms of the Eclipse Public License v1.0
5
5
  * which accompanies this distribution, and is available at
6
- * http://www.eclipse.org/legal/epl-v10.html
6
+ * https://www.eclipse.org/legal/epl-v10.html
7
7
  *
8
8
  * Contributors:
9
9
  * BSI Business Systems Integration AG - initial API and implementation
@@ -294,6 +294,7 @@ export {default as GroupBoxResponsiveHandler} from './form/GroupBoxResponsiveHan
294
294
  export {default as DesktopResponsiveHandler} from './form/DesktopResponsiveHandler';
295
295
  export {default as TileOverviewForm} from './form/TileOverviewForm';
296
296
  export {default as TileOverviewFormAdapter} from './form/TileOverviewFormAdapter';
297
+ export {default as JsFormAdapter} from './form/js/JsFormAdapter';
297
298
  export {default as Table} from './table/Table';
298
299
  export {default as TableAdapter} from './table/TableAdapter';
299
300
  export {default as TableCompactHandler} from './table/TableCompactHandler';
@@ -152,7 +152,7 @@ export function installScrollShadow($container, session, options) {
152
152
  $container.data('scroll-shadow', $shadow);
153
153
  $container.data('scroll-shadow-style', scrollShadowStyle);
154
154
  $container.data('scroll-shadow-customizer', options.scrollShadowCustomizer);
155
- let handler = () => updateScrollShadow($container);
155
+ let handler = () => updateScrollShadowWhileScrolling($container);
156
156
  $container.data('scroll-shadow-handler', handler);
157
157
  $container.on('scroll', handler);
158
158
  updateScrollShadow($container);
@@ -236,6 +236,17 @@ function _computeScrollShadowStyle(options) {
236
236
  return scrollShadow;
237
237
  }
238
238
 
239
+ export function updateScrollShadowWhileScrolling($container) {
240
+ let $animatingParent = $container.findUp($elem => $elem.hasAnimationClass());
241
+ if ($animatingParent.length > 0) {
242
+ // If the container is scrolled while being animated, the shadow will likely get the wrong size and/or position if the animation changes the bounds.
243
+ // The scroll event is mostly probably not triggered by the user directly but by the scrollable container itself, e.g. to reveal a focused / selected / checked element.
244
+ $animatingParent.oneAnimationEnd(() => updateScrollShadow($container));
245
+ return;
246
+ }
247
+ updateScrollShadow($container);
248
+ }
249
+
239
250
  export function updateScrollShadow($container) {
240
251
  let $shadow = $container.data('scroll-shadow');
241
252
  if (!$shadow) {
@@ -100,36 +100,39 @@ export default class Session {
100
100
  static EMPTY_UPLOAD_FILENAME = '*empty*';
101
101
 
102
102
  /**
103
- * $entryPoint is required to create a new session.
104
- *
105
- * @param model The 'model' argument holds all optional values that may be used during
106
- * initialization (it is the same object passed to the scout.init() function).
107
- * @param [model.portletPartId]
108
- * Optional, default is 0. Necessary when multiple UI sessions are managed
109
- * by the same window (portlet support). Each session's partId must be unique.
110
- * @param model.clientSessionId
103
+ * @param {$} model.$entryPoint
104
+ * The HTML element that is used by the {@link Desktop} to render its content.
105
+ * @param {string} [model.portletPartId]
106
+ * Necessary when multiple UI sessions are managed by the same window (portlet support).
107
+ * Each session's partId must be unique. Default is 0.
108
+ * @param {string} [model.clientSessionId]
111
109
  * Identifies the 'client instance' on the UI server. If the property is not set
112
110
  * (which is the default case), the clientSessionId is taken from the browser's
113
111
  * session storage (per browser window, survives F5 refresh of page). If no
114
112
  * clientSessionId can be found, a new one is generated on the server.
115
- * @param [model.userAgent]
116
- * Default: DESKTOP
117
- * @param [model.backgroundJobPollingEnabled]
113
+ * @param {boolean} [model.forceNewClientSession]
114
+ * If set to true, the stored or passed clientSessionId will be ignored
115
+ * and a new one generated by the server.
116
+ * @param {UserAgent} [model.userAgent]
117
+ * By default the user agent for the running platform is used. Use this option if you want to set a custom one.
118
+ * @param {Locale|object} [model.locale]
119
+ * If not specified, {@link Locale.DEFAULT} is used.
120
+ * @param {boolean} [model.backgroundJobPollingEnabled]
118
121
  * Unless websockets is used, this property turns on (default) or off background
119
122
  * polling using an async ajax call together with setTimeout()
120
- * @param [model.suppressErrors]
123
+ * @param {boolean} [model.suppressErrors]
121
124
  * Basically added because of Jasmine-tests. When working with async tests that
122
125
  * use setTimeout(), sometimes the Jasmine-Maven plug-in fails and aborts the
123
126
  * build because there were console errors. These errors always happen in this
124
127
  * class. That's why we can skip suppress error handling with this flag.
125
- * @param [model.focusManagerActive]
128
+ * @param {boolean} [model.focusManagerActive]
126
129
  * Forces the focus manager to be active or not. If undefined, the value is
127
130
  * auto detected by Device.js.
128
- * @param [model.reconnectorOptions]
129
- * Optional, properties of this object are copied to the Session's reconnector
130
- * instance (see Reconnector.js).
131
- * @param [model.ajaxCallOptions]
132
- * Optional, properties of this object are copied to all instances of AjaxCall.js.
131
+ * @param {object} [model.reconnectorOptions]
132
+ * Properties of this object are copied to the Session's reconnector
133
+ * instance (see {@link Reconnector}).
134
+ * @param {object} [model.ajaxCallOptions]
135
+ * Properties of this object are copied to all instances of {@link AjaxCall}.
133
136
  */
134
137
  init(model) {
135
138
  let options = model || {};
@@ -5271,15 +5271,14 @@ export default class Table extends Widget {
5271
5271
 
5272
5272
  for (i = 0; i < columns.length; i++) {
5273
5273
  column = columns[i];
5274
- currentPosition = this.columns.indexOf(column);
5274
+ currentPosition = arrays.findIndex(this.columns, element => element.id === column.id);
5275
5275
  if (currentPosition < 0) {
5276
5276
  throw new Error('Column with id ' + column.id + 'not found.');
5277
5277
  }
5278
5278
 
5279
5279
  if (currentPosition !== i) {
5280
5280
  // Update model
5281
- arrays.remove(this.columns, column);
5282
- arrays.insert(this.columns, column, i);
5281
+ arrays.move(this.columns, currentPosition, i);
5283
5282
  }
5284
5283
  }
5285
5284