gd-sprest-bs 10.3.3 → 10.3.6
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/build/components/field/index.js +9 -10
- package/build/webparts/base/wpSPFx.js +19 -0
- package/dist/gd-sprest-bs-icons.js +1 -1
- package/dist/gd-sprest-bs-icons.js.LICENSE.txt +148 -140
- package/dist/gd-sprest-bs-icons.min.js +1 -1
- package/dist/gd-sprest-bs.d.ts +14 -0
- package/dist/gd-sprest-bs.js +1 -1
- package/dist/gd-sprest-bs.js.LICENSE.txt +148 -140
- package/dist/gd-sprest-bs.min.js +1 -1
- package/package.json +2 -2
- package/pnpm-lock.yaml +14 -14
- package/src/components/field/index.ts +10 -12
- package/src/webparts/base/types.d.ts +14 -0
- package/src/webparts/base/wpSPFx.ts +18 -0
|
@@ -932,9 +932,9 @@ var Field = function (props) {
|
|
|
932
932
|
value: control ? control.getValue() : null
|
|
933
933
|
};
|
|
934
934
|
// See if there is a custom value
|
|
935
|
-
if (
|
|
935
|
+
if (controlProps && controlProps.onGetValue) {
|
|
936
936
|
// Update the value
|
|
937
|
-
fieldValue.value =
|
|
937
|
+
fieldValue.value = controlProps.onGetValue(controlProps);
|
|
938
938
|
}
|
|
939
939
|
// Update the field name/value, based on the type
|
|
940
940
|
switch (props.field.FieldTypeKind) {
|
|
@@ -949,7 +949,7 @@ var Field = function (props) {
|
|
|
949
949
|
if (controlProps.type == core_1.Components.FormControlTypes.Dropdown) {
|
|
950
950
|
// See if there is a value
|
|
951
951
|
var ddlValue = fieldValue.value;
|
|
952
|
-
if (ddlValue) {
|
|
952
|
+
if (ddlValue && (ddlValue.value || ddlValue.text)) {
|
|
953
953
|
// Update the field value
|
|
954
954
|
fieldValue.value = ddlValue.value || ddlValue.text;
|
|
955
955
|
}
|
|
@@ -957,7 +957,7 @@ var Field = function (props) {
|
|
|
957
957
|
else {
|
|
958
958
|
// See if there is a value
|
|
959
959
|
var cbValue = fieldValue.value;
|
|
960
|
-
if (cbValue) {
|
|
960
|
+
if (cbValue && cbValue.label) {
|
|
961
961
|
// Update the field value
|
|
962
962
|
fieldValue.value = cbValue.label;
|
|
963
963
|
}
|
|
@@ -981,6 +981,8 @@ var Field = function (props) {
|
|
|
981
981
|
break;
|
|
982
982
|
// Image
|
|
983
983
|
case gd_sprest_1.SPTypes.FieldType.Image:
|
|
984
|
+
// Do nothing, there is a custom method in the list form component
|
|
985
|
+
// to set this value
|
|
984
986
|
break;
|
|
985
987
|
// Lookup
|
|
986
988
|
case gd_sprest_1.SPTypes.FieldType.Lookup:
|
|
@@ -1075,6 +1077,8 @@ var Field = function (props) {
|
|
|
1075
1077
|
// See if this is a multi-value field
|
|
1076
1078
|
if (props.field.AllowMultipleValues) {
|
|
1077
1079
|
var values_2 = fieldValue.value || [];
|
|
1080
|
+
// Default the value
|
|
1081
|
+
fieldValue.value = { results: [] };
|
|
1078
1082
|
// Parse the options
|
|
1079
1083
|
for (var j = 0; j < values_2.length; j++) {
|
|
1080
1084
|
var userValue = values_2[j];
|
|
@@ -1127,12 +1131,7 @@ var Field = function (props) {
|
|
|
1127
1131
|
// Validate the field
|
|
1128
1132
|
var baseResult = baseValidation(control, { isValid: control.isValid, value: control.getValue() });
|
|
1129
1133
|
// Validate the current control
|
|
1130
|
-
var result = controlProps.onValidate ? controlProps.onValidate(controlProps, baseResult) : baseResult;
|
|
1131
|
-
// See if a custom validation method exists
|
|
1132
|
-
if (controlProps.onValidate) {
|
|
1133
|
-
// Call the custom validation method
|
|
1134
|
-
result = controlProps.onValidate(controlProps, baseResult);
|
|
1135
|
-
}
|
|
1134
|
+
var result = controlProps && controlProps.onValidate ? controlProps.onValidate(controlProps, baseResult) : baseResult;
|
|
1136
1135
|
// Return the flag
|
|
1137
1136
|
if (typeof (result) === "boolean") {
|
|
1138
1137
|
// Update the validation
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SPFxWebPart = void 0;
|
|
4
|
+
var gd_sprest_1 = require("gd-sprest");
|
|
5
|
+
/**
|
|
6
|
+
* SPFx WebPart Base Class
|
|
7
|
+
*/
|
|
8
|
+
var SPFxWebPart = /** @class */ (function () {
|
|
9
|
+
// Constructor
|
|
10
|
+
function SPFxWebPart(props) {
|
|
11
|
+
this._props = null;
|
|
12
|
+
// Save the properties
|
|
13
|
+
this._props = props;
|
|
14
|
+
// Set the context
|
|
15
|
+
this._props.context ? gd_sprest_1.ContextInfo.setPageContext(this._props.context) : null;
|
|
16
|
+
}
|
|
17
|
+
return SPFxWebPart;
|
|
18
|
+
}());
|
|
19
|
+
exports.SPFxWebPart = SPFxWebPart;
|