@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.
- package/esm2020/lib/smart-form/api/model/smartWidgetDefinition.mjs +1 -1
- package/esm2020/lib/smart-form/services/smartform.layout-definition.service.mjs +2 -1
- package/esm2020/lib/smart-form/services/smartform.service.mjs +42 -37
- package/esm2020/lib/smart-form/widgets/smartformwidget/smartformwidget.component.mjs +1 -5
- package/fesm2015/smartbit4all-ng-client.mjs +42 -40
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +42 -40
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-form/api/model/smartWidgetDefinition.d.ts +1 -0
- package/lib/smart-form/widgets/smartformwidget/smartformwidget.component.d.ts +0 -1
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.2.21.tgz +0 -0
- package/smartbit4all-ng-client-3.2.19.tgz +0 -0
|
@@ -3794,46 +3794,52 @@ class SmartFormService {
|
|
|
3794
3794
|
widget.type === SmartFormWidgetType.CHECK_BOX_2 ||
|
|
3795
3795
|
widget.type === SmartFormWidgetType.TEXT_FIELD) {
|
|
3796
3796
|
if (widget.selection && valueSets) {
|
|
3797
|
-
let
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3797
|
+
let valueSet = valueSets[widget.selection.valueSetName];
|
|
3798
|
+
if (!valueSet) {
|
|
3799
|
+
console.warn('valueSet not found', widget.selection.valueSetName);
|
|
3800
|
+
}
|
|
3801
|
+
else {
|
|
3802
|
+
let valueSetData = valueSet.valueSetData;
|
|
3803
|
+
let values = valueSetData.values;
|
|
3804
|
+
let displayProperty = (_b = (_a = widget.selection) === null || _a === void 0 ? void 0 : _a.displayProperty) !== null && _b !== void 0 ? _b : 'displayValue';
|
|
3805
|
+
// check is displayProperty exists, fallback for common display properties
|
|
3803
3806
|
if (!this.checkProperty(values, displayProperty)) {
|
|
3804
|
-
displayProperty = '
|
|
3807
|
+
displayProperty = 'name'; // GenericValue.name
|
|
3808
|
+
if (!this.checkProperty(values, displayProperty)) {
|
|
3809
|
+
displayProperty = 'displayValue'; // Value.displayValue
|
|
3810
|
+
}
|
|
3805
3811
|
}
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
let keyProperty = (_c = valueSetData.keyProperty) !== null && _c !== void 0 ? _c : 'objectUri';
|
|
3810
|
-
if (!this.checkProperty(values, keyProperty)) {
|
|
3811
|
-
keyProperty = 'uri'; // GenericValue.uri
|
|
3812
|
+
if (widget.selection.type === SelectionDefinition.TypeEnum.Property &&
|
|
3813
|
+
!widget.selection.mapping.length) {
|
|
3814
|
+
let keyProperty = (_c = valueSetData.keyProperty) !== null && _c !== void 0 ? _c : 'objectUri';
|
|
3812
3815
|
if (!this.checkProperty(values, keyProperty)) {
|
|
3813
|
-
keyProperty = '
|
|
3816
|
+
keyProperty = 'uri'; // GenericValue.uri
|
|
3817
|
+
if (!this.checkProperty(values, keyProperty)) {
|
|
3818
|
+
keyProperty = 'objectUri'; // Value.objectUri
|
|
3819
|
+
}
|
|
3814
3820
|
}
|
|
3821
|
+
widget.valueList = values.map((value) => {
|
|
3822
|
+
return {
|
|
3823
|
+
key: value[keyProperty],
|
|
3824
|
+
label: value[displayProperty],
|
|
3825
|
+
type: SmartFormWidgetType.ITEM,
|
|
3826
|
+
value: value[keyProperty],
|
|
3827
|
+
};
|
|
3828
|
+
});
|
|
3829
|
+
this.addEmptyItemToValueList(widget, widget.selection.emptyLabel);
|
|
3830
|
+
}
|
|
3831
|
+
else if (widget.selection.type === SelectionDefinition.TypeEnum.Object &&
|
|
3832
|
+
!widget.selection.mapping.length) {
|
|
3833
|
+
widget.valueList = values.map((value, index) => {
|
|
3834
|
+
return {
|
|
3835
|
+
key: `${index}`,
|
|
3836
|
+
label: value[displayProperty],
|
|
3837
|
+
type: SmartFormWidgetType.ITEM,
|
|
3838
|
+
value: value,
|
|
3839
|
+
};
|
|
3840
|
+
});
|
|
3841
|
+
this.addEmptyItemToValueList(widget);
|
|
3815
3842
|
}
|
|
3816
|
-
widget.valueList = values.map((value) => {
|
|
3817
|
-
return {
|
|
3818
|
-
key: value[keyProperty],
|
|
3819
|
-
label: value[displayProperty],
|
|
3820
|
-
type: SmartFormWidgetType.ITEM,
|
|
3821
|
-
value: value[keyProperty],
|
|
3822
|
-
};
|
|
3823
|
-
});
|
|
3824
|
-
this.addEmptyItemToValueList(widget, widget.selection.emptyLabel);
|
|
3825
|
-
}
|
|
3826
|
-
else if (widget.selection.type === SelectionDefinition.TypeEnum.Object &&
|
|
3827
|
-
!widget.selection.mapping.length) {
|
|
3828
|
-
widget.valueList = values.map((value, index) => {
|
|
3829
|
-
return {
|
|
3830
|
-
key: `${index}`,
|
|
3831
|
-
label: value[displayProperty],
|
|
3832
|
-
type: SmartFormWidgetType.ITEM,
|
|
3833
|
-
value: value,
|
|
3834
|
-
};
|
|
3835
|
-
});
|
|
3836
|
-
this.addEmptyItemToValueList(widget);
|
|
3837
3843
|
}
|
|
3838
3844
|
}
|
|
3839
3845
|
}
|
|
@@ -4093,7 +4099,6 @@ class SmartFormService {
|
|
|
4093
4099
|
regexPattern = regexPattern.replace(this.regexDoubleAsterisk, '.*'); // **
|
|
4094
4100
|
// replace ? with a single character matcher
|
|
4095
4101
|
regexPattern = regexPattern.replace(this.regexQuestionMark, '.');
|
|
4096
|
-
console.log(pattern, regexPattern);
|
|
4097
4102
|
// create a RegExp object
|
|
4098
4103
|
regex = new RegExp('^' + regexPattern + '$');
|
|
4099
4104
|
this.regexByPattern.set(pattern, regex);
|
|
@@ -5152,10 +5157,6 @@ class SmartformwidgetComponent {
|
|
|
5152
5157
|
dateFilter(d) {
|
|
5153
5158
|
return true;
|
|
5154
5159
|
}
|
|
5155
|
-
asd(opt) {
|
|
5156
|
-
console.log(opt);
|
|
5157
|
-
return opt;
|
|
5158
|
-
}
|
|
5159
5160
|
getMatrixDisplayValue(question, key) {
|
|
5160
5161
|
this.widgetInstance.value[key].find((value) => {
|
|
5161
5162
|
if (value.code == question.code)
|
|
@@ -6461,6 +6462,7 @@ class SmartformLayoutDefinitionService {
|
|
|
6461
6462
|
let widget = {
|
|
6462
6463
|
type: SmartFormWidgetType.LABEL,
|
|
6463
6464
|
label: layoutDefinition.label,
|
|
6465
|
+
widgetDescription: layoutDefinition.widgetDescription,
|
|
6464
6466
|
};
|
|
6465
6467
|
return widget;
|
|
6466
6468
|
}
|