gd-sprest-bs 10.7.1 → 10.7.3
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 +24 -10
- package/build/webparts/list/wpSPFxForm.js +8 -16
- package/dist/gd-sprest-bs-icons.js +1 -1
- package/dist/gd-sprest-bs-icons.min.js +1 -1
- package/dist/gd-sprest-bs.js +1 -1
- package/dist/gd-sprest-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/field/index.ts +25 -10
- package/src/webparts/list/wpSPFxForm.ts +8 -16
|
@@ -208,11 +208,13 @@ var Field = function (props) {
|
|
|
208
208
|
}
|
|
209
209
|
// Get the items
|
|
210
210
|
var items = getChoiceItems(displayRadioButtons, props.field, props.value);
|
|
211
|
-
// Add a blank entry
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
211
|
+
// Add a blank entry if this is a dropdown
|
|
212
|
+
if (!displayRadioButtons) {
|
|
213
|
+
items = [{
|
|
214
|
+
text: "",
|
|
215
|
+
value: null
|
|
216
|
+
}].concat(items);
|
|
217
|
+
}
|
|
216
218
|
// See if we are allowing custom values
|
|
217
219
|
if (allowFillIn) {
|
|
218
220
|
// Set the base validation
|
|
@@ -253,11 +255,23 @@ var Field = function (props) {
|
|
|
253
255
|
baseValidation = function (ctrl, result) {
|
|
254
256
|
// See if a value exists
|
|
255
257
|
if (result.value) {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
//
|
|
260
|
-
|
|
258
|
+
// See if this is a dropdown
|
|
259
|
+
if (ctrl.props.type == core_1.Components.FormControlTypes.Dropdown) {
|
|
260
|
+
var ddlItem = result.value;
|
|
261
|
+
// See if the text and value don't exist
|
|
262
|
+
if (ddlItem.value || ddlItem.text ? false : true) {
|
|
263
|
+
// Set the flag
|
|
264
|
+
result.isValid = false;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
// Else, it's a switch
|
|
268
|
+
else {
|
|
269
|
+
var cbItem = result.value;
|
|
270
|
+
// See if a value doesn't exist
|
|
271
|
+
if (cbItem.label ? false : true) {
|
|
272
|
+
// Set the flag
|
|
273
|
+
result.isValid = false;
|
|
274
|
+
}
|
|
261
275
|
}
|
|
262
276
|
}
|
|
263
277
|
// Return the result
|
|
@@ -39,11 +39,7 @@ var SPFxListFormWebPart = function (wpProps) {
|
|
|
39
39
|
var dispProps = {
|
|
40
40
|
el: wpProps.spfx.domElement,
|
|
41
41
|
info: info,
|
|
42
|
-
rowClassName: "mb-3"
|
|
43
|
-
onFormRendered: function (form) {
|
|
44
|
-
// Remove the last class
|
|
45
|
-
form.el.lastChild.classList.remove("mb-3");
|
|
46
|
-
}
|
|
42
|
+
rowClassName: "mb-3"
|
|
47
43
|
};
|
|
48
44
|
// Call the rendering event
|
|
49
45
|
dispProps = wpProps.onDisplayFormRendering ? wpProps.onDisplayFormRendering(dispProps) : dispProps;
|
|
@@ -57,12 +53,8 @@ var SPFxListFormWebPart = function (wpProps) {
|
|
|
57
53
|
var editProps = {
|
|
58
54
|
el: wpProps.spfx.domElement,
|
|
59
55
|
info: info,
|
|
60
|
-
rowClassName: "mb-3",
|
|
61
56
|
controlMode: info.item ? gd_sprest_1.SPTypes.ControlMode.Edit : gd_sprest_1.SPTypes.ControlMode.New,
|
|
62
|
-
|
|
63
|
-
// Remove the last class
|
|
64
|
-
form.el.lastChild.classList.remove("mb-3");
|
|
65
|
-
}
|
|
57
|
+
rowClassName: "mb-3"
|
|
66
58
|
};
|
|
67
59
|
// Call the rendering event
|
|
68
60
|
editProps = wpProps.onEditFormRendering ? wpProps.onEditFormRendering(editProps) : editProps;
|
|
@@ -239,12 +231,12 @@ var SPFxListFormWebPart = function (wpProps) {
|
|
|
239
231
|
var item = values["ContentType"];
|
|
240
232
|
// Clear the form component properties
|
|
241
233
|
(0, gd_sprest_1.Web)(wp.Configuration.WebUrl).Lists().getById(wp.Configuration.ListId).ContentTypes(item.value).update({
|
|
242
|
-
DisplayFormClientSideComponentId:
|
|
243
|
-
DisplayFormClientSideComponentProperties:
|
|
244
|
-
EditFormClientSideComponentId:
|
|
245
|
-
EditFormClientSideComponentProperties:
|
|
246
|
-
NewFormClientSideComponentId:
|
|
247
|
-
NewFormClientSideComponentProperties:
|
|
234
|
+
DisplayFormClientSideComponentId: "",
|
|
235
|
+
DisplayFormClientSideComponentProperties: "",
|
|
236
|
+
EditFormClientSideComponentId: "",
|
|
237
|
+
EditFormClientSideComponentProperties: "",
|
|
238
|
+
NewFormClientSideComponentId: "",
|
|
239
|
+
NewFormClientSideComponentProperties: ""
|
|
248
240
|
}).execute(function () {
|
|
249
241
|
// Close the modal
|
|
250
242
|
modal.hide();
|