@smartbit4all/ng-client 3.0.18 → 3.0.20

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.
@@ -4325,21 +4325,20 @@ class SmartformwidgetComponent {
4325
4325
  this.setDateFormControl(this.form.controls[this.widgetInstance.key], yearMonthValue, '00:00');
4326
4326
  }
4327
4327
  compareItems(o1, o2) {
4328
- const widget = this.widgetInstance;
4329
- if (widget.type === SmartFormWidgetType.SELECT ||
4330
- widget.type === SmartFormWidgetType.SELECT_MULTIPLE) {
4331
- if (widget.selection?.type === 'PROPERTY') {
4332
- let v1 = this.truncateUri(o1);
4333
- let v2 = this.truncateUri(o2);
4334
- return v1 === v2;
4335
- }
4328
+ // calling this.truncateUri didn't work
4329
+ let v1 = o1;
4330
+ if (o1 && typeof o1 === 'string') {
4331
+ v1 = o1.replace(/\.v[0-9]+$/, '');
4332
+ }
4333
+ let v2 = o2;
4334
+ if (o2 && typeof o2 === 'string') {
4335
+ v2 = o2.replace(/\.v[0-9]+$/, '');
4336
4336
  }
4337
- // default for object identity
4338
- return o1 === o2;
4337
+ return v1 === v2;
4339
4338
  }
4340
4339
  truncateUri(uri) {
4341
4340
  if (uri && typeof uri === 'string') {
4342
- return uri.replace('.v[0-9]+', '');
4341
+ return uri.replace(/\.v[0-9]+$/, '');
4343
4342
  }
4344
4343
  return uri;
4345
4344
  }