@flexem/fc-gui 3.0.0-alpha.42 → 3.0.0-alpha.43

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.
@@ -23,6 +23,7 @@ export declare class NumericalDisplayElement extends ReadableElement {
23
23
  private enableDataParsed;
24
24
  private writeValueMmodalRef;
25
25
  private writeValue;
26
+ private originalValue;
26
27
  get writeVariableName(): string;
27
28
  constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, graphStore: GraphStore, operationRecordService: OperationRecordService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization, signalRAppId: string);
28
29
  dispose(): void;
@@ -179,11 +179,13 @@ export class NumericalDisplayElement extends ReadableElement {
179
179
  });
180
180
  this.writeValueMmodalRef.content.onClosed = (result) => {
181
181
  if (result) {
182
- this.writeValue = this.dataTypeService.formatToDecimal(this.model.version, result.value, this.model.dataType);
183
- if (this.displayText.toString() !== this.writeValue) {
184
- this.variableCommunicator.write(this.writeVariableName, this.writeValue).subscribe();
182
+ const writeValue = this.dataTypeService.formatToDecimal(this.model.version, result.value, this.model.dataType);
183
+ this.writeValue = writeValue;
184
+ this.originalValue = result.originalValue;
185
+ if (this.displayText.toString() !== this.originalValue) {
186
+ this.variableCommunicator.write(this.writeVariableName, writeValue).subscribe();
185
187
  setTimeout(() => {
186
- if (this.displayText.toString() !== this.writeValue) {
188
+ if (this.displayText.toString() !== this.originalValue) {
187
189
  this.writeValueMmodalRef.content.isSubmitting = false;
188
190
  this.writeValueMmodalRef.content.showValidationErrorInfo(this.localization.writeValueTimeout);
189
191
  }
@@ -222,7 +224,7 @@ export class NumericalDisplayElement extends ReadableElement {
222
224
  var _a;
223
225
  this.displayText = this.formatNumericalDisplayText(this.model.dataType, this.model.fractionDigits, value);
224
226
  this.updateDisplayText(this.formatDisplayTextUnit(this.displayText));
225
- if (((_a = this.writeValueMmodalRef) === null || _a === void 0 ? void 0 : _a.content) && this.displayText.toString() === this.writeValue) {
227
+ if (((_a = this.writeValueMmodalRef) === null || _a === void 0 ? void 0 : _a.content) && this.displayText.toString() === this.originalValue) {
226
228
  this.writeValueMmodalRef.hide();
227
229
  this.writeValueMmodalRef.content.hideValidationErrorInfo();
228
230
  this.recordOperation(this.writeValue);
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"NumericalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":22,"character":45},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":41,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":42,"character":18},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":43,"character":39},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":44,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":45,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":46,"character":37},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":47,"character":49},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":48,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":49,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":50,"character":22},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"initElement":[{"__symbolic":"method"}],"checkElementPassword":[{"__symbolic":"method"}],"initVariableText":[{"__symbolic":"method"}],"initGraphAndText":[{"__symbolic":"method"}],"doWriteValue":[{"__symbolic":"method"}],"recordOperation":[{"__symbolic":"method"}],"changeStates":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"updateDisplayText":[{"__symbolic":"method"}],"rebuildTextElement":[{"__symbolic":"method"}],"formatNumericalDisplayText":[{"__symbolic":"method"}],"formatFloatDisplayText":[{"__symbolic":"method"}],"isNumeric":[{"__symbolic":"method"}],"formatDisplayTextUnit":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"NumericalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":22,"character":45},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":42,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":43,"character":18},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":44,"character":39},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":45,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":46,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":47,"character":37},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":48,"character":49},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":49,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":50,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":51,"character":22},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"initElement":[{"__symbolic":"method"}],"checkElementPassword":[{"__symbolic":"method"}],"initVariableText":[{"__symbolic":"method"}],"initGraphAndText":[{"__symbolic":"method"}],"doWriteValue":[{"__symbolic":"method"}],"recordOperation":[{"__symbolic":"method"}],"changeStates":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"updateDisplayText":[{"__symbolic":"method"}],"rebuildTextElement":[{"__symbolic":"method"}],"formatNumericalDisplayText":[{"__symbolic":"method"}],"formatFloatDisplayText":[{"__symbolic":"method"}],"isNumeric":[{"__symbolic":"method"}],"formatDisplayTextUnit":[{"__symbolic":"method"}]}}}}]
@@ -100,6 +100,7 @@ let WriteValueModalComponent = class WriteValueModalComponent {
100
100
  }
101
101
  save() {
102
102
  this.isSubmitting = true;
103
+ const originalValue = this.value;
103
104
  if (this.args.enableDataParsed) {
104
105
  if (this.enableNumericalOperation) {
105
106
  this.value = this.numericalOperationService.getWriteValue(this.args.version, this.value, this.numericalOperation, this.dataType, this.fractionDigits);
@@ -108,7 +109,7 @@ let WriteValueModalComponent = class WriteValueModalComponent {
108
109
  this.value = this.formatWriteValue();
109
110
  }
110
111
  }
111
- this.onClosed({ value: this.value });
112
+ this.onClosed({ value: this.value, originalValue });
112
113
  }
113
114
  close() {
114
115
  this.bsModalRef.hide();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "main": "bundles/fc-gui.umd.js",
3
- "version": "3.0.0-alpha.42",
3
+ "version": "3.0.0-alpha.43",
4
4
  "module": "public_api.js",
5
5
  "typings": "public_api.d.ts",
6
6
  "license": "UNLICENSED",