@smartbit4all/ng-client 3.2.19 → 3.2.21

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.
@@ -3856,46 +3856,52 @@ class SmartFormService {
3856
3856
  widget.type === SmartFormWidgetType.CHECK_BOX_2 ||
3857
3857
  widget.type === SmartFormWidgetType.TEXT_FIELD) {
3858
3858
  if (widget.selection && valueSets) {
3859
- let valueSetData = valueSets[widget.selection.valueSetName].valueSetData;
3860
- let values = valueSetData.values;
3861
- let displayProperty = widget.selection?.displayProperty ?? 'displayValue';
3862
- // check is displayProperty exists, fallback for common display properties
3863
- if (!this.checkProperty(values, displayProperty)) {
3864
- displayProperty = 'name'; // GenericValue.name
3859
+ let valueSet = valueSets[widget.selection.valueSetName];
3860
+ if (!valueSet) {
3861
+ console.warn('valueSet not found', widget.selection.valueSetName);
3862
+ }
3863
+ else {
3864
+ let valueSetData = valueSet.valueSetData;
3865
+ let values = valueSetData.values;
3866
+ let displayProperty = widget.selection?.displayProperty ?? 'displayValue';
3867
+ // check is displayProperty exists, fallback for common display properties
3865
3868
  if (!this.checkProperty(values, displayProperty)) {
3866
- displayProperty = 'displayValue'; // Value.displayValue
3869
+ displayProperty = 'name'; // GenericValue.name
3870
+ if (!this.checkProperty(values, displayProperty)) {
3871
+ displayProperty = 'displayValue'; // Value.displayValue
3872
+ }
3867
3873
  }
3868
- }
3869
- if (widget.selection.type === SelectionDefinition.TypeEnum.Property &&
3870
- !widget.selection.mapping.length) {
3871
- let keyProperty = valueSetData.keyProperty ?? 'objectUri';
3872
- if (!this.checkProperty(values, keyProperty)) {
3873
- keyProperty = 'uri'; // GenericValue.uri
3874
+ if (widget.selection.type === SelectionDefinition.TypeEnum.Property &&
3875
+ !widget.selection.mapping.length) {
3876
+ let keyProperty = valueSetData.keyProperty ?? 'objectUri';
3874
3877
  if (!this.checkProperty(values, keyProperty)) {
3875
- keyProperty = 'objectUri'; // Value.objectUri
3878
+ keyProperty = 'uri'; // GenericValue.uri
3879
+ if (!this.checkProperty(values, keyProperty)) {
3880
+ keyProperty = 'objectUri'; // Value.objectUri
3881
+ }
3876
3882
  }
3883
+ widget.valueList = values.map((value) => {
3884
+ return {
3885
+ key: value[keyProperty],
3886
+ label: value[displayProperty],
3887
+ type: SmartFormWidgetType.ITEM,
3888
+ value: value[keyProperty],
3889
+ };
3890
+ });
3891
+ this.addEmptyItemToValueList(widget, widget.selection.emptyLabel);
3892
+ }
3893
+ else if (widget.selection.type === SelectionDefinition.TypeEnum.Object &&
3894
+ !widget.selection.mapping.length) {
3895
+ widget.valueList = values.map((value, index) => {
3896
+ return {
3897
+ key: `${index}`,
3898
+ label: value[displayProperty],
3899
+ type: SmartFormWidgetType.ITEM,
3900
+ value: value,
3901
+ };
3902
+ });
3903
+ this.addEmptyItemToValueList(widget);
3877
3904
  }
3878
- widget.valueList = values.map((value) => {
3879
- return {
3880
- key: value[keyProperty],
3881
- label: value[displayProperty],
3882
- type: SmartFormWidgetType.ITEM,
3883
- value: value[keyProperty],
3884
- };
3885
- });
3886
- this.addEmptyItemToValueList(widget, widget.selection.emptyLabel);
3887
- }
3888
- else if (widget.selection.type === SelectionDefinition.TypeEnum.Object &&
3889
- !widget.selection.mapping.length) {
3890
- widget.valueList = values.map((value, index) => {
3891
- return {
3892
- key: `${index}`,
3893
- label: value[displayProperty],
3894
- type: SmartFormWidgetType.ITEM,
3895
- value: value,
3896
- };
3897
- });
3898
- this.addEmptyItemToValueList(widget);
3899
3905
  }
3900
3906
  }
3901
3907
  }
@@ -4150,7 +4156,6 @@ class SmartFormService {
4150
4156
  regexPattern = regexPattern.replace(this.regexDoubleAsterisk, '.*'); // **
4151
4157
  // replace ? with a single character matcher
4152
4158
  regexPattern = regexPattern.replace(this.regexQuestionMark, '.');
4153
- console.log(pattern, regexPattern);
4154
4159
  // create a RegExp object
4155
4160
  regex = new RegExp('^' + regexPattern + '$');
4156
4161
  this.regexByPattern.set(pattern, regex);
@@ -5187,10 +5192,6 @@ class SmartformwidgetComponent {
5187
5192
  dateFilter(d) {
5188
5193
  return true;
5189
5194
  }
5190
- asd(opt) {
5191
- console.log(opt);
5192
- return opt;
5193
- }
5194
5195
  getMatrixDisplayValue(question, key) {
5195
5196
  this.widgetInstance.value[key].find((value) => {
5196
5197
  if (value.code == question.code)
@@ -6478,6 +6479,7 @@ class SmartformLayoutDefinitionService {
6478
6479
  let widget = {
6479
6480
  type: SmartFormWidgetType.LABEL,
6480
6481
  label: layoutDefinition.label,
6482
+ widgetDescription: layoutDefinition.widgetDescription,
6481
6483
  };
6482
6484
  return widget;
6483
6485
  }