gd-sprest-bs 10.5.8 → 10.6.0

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.
@@ -21,6 +21,7 @@ var _SPFxWebPart = /** @class */ (function () {
21
21
  /** The configuration modal. */
22
22
  // Constructor
23
23
  function _SPFxWebPart(props) {
24
+ var _this = this;
24
25
  this._props = null;
25
26
  /** The webpart configuration */
26
27
  this._cfg = null;
@@ -63,16 +64,19 @@ var _SPFxWebPart = /** @class */ (function () {
63
64
  // Set the flag
64
65
  this._isDisplay = !this._isEdit;
65
66
  }
66
- // See if we are in edit mode
67
- if (this._isEdit) {
68
- // Render the configuration button
69
- this.renderEdit();
70
- }
71
- // See if we are in display mode
72
- if (this.IsDisplay) {
73
- // Render the webpart
74
- this.render();
75
- }
67
+ // Run the render method in another thread
68
+ setTimeout(function () {
69
+ // See if we are in edit mode
70
+ if (_this._isEdit) {
71
+ // Render the configuration button
72
+ _this.renderEdit();
73
+ }
74
+ // See if we are in display mode
75
+ if (_this.IsDisplay) {
76
+ // Render the webpart
77
+ _this.render();
78
+ }
79
+ }, 10);
76
80
  }
77
81
  Object.defineProperty(_SPFxWebPart.prototype, "Configuration", {
78
82
  get: function () { return this._cfg; },
@@ -22,7 +22,7 @@ var SPFxListWebPart = function (wpProps) {
22
22
  var _ddl = null;
23
23
  var _loadFl = false;
24
24
  // Load the lists
25
- var loadLists = function () {
25
+ var loadLists = function (listId) {
26
26
  // Disable the dropdown
27
27
  _ddl.disable();
28
28
  // Get the web url
@@ -42,7 +42,7 @@ var SPFxListWebPart = function (wpProps) {
42
42
  data: list,
43
43
  text: list.Title,
44
44
  value: list.Id,
45
- isSelected: wp.Configuration ? wp.Configuration.ListId == list.Id : false
45
+ isSelected: listId == list.Id
46
46
  });
47
47
  }
48
48
  // Set the dropdown
@@ -76,6 +76,8 @@ var SPFxListWebPart = function (wpProps) {
76
76
  }
77
77
  }
78
78
  ];
79
+ // Call the base event
80
+ props = wpProps.onEditFormRendering ? wpProps.onEditFormRendering(props) : props;
79
81
  // Return the properties
80
82
  return props;
81
83
  },
@@ -87,9 +89,11 @@ var SPFxListWebPart = function (wpProps) {
87
89
  btnProps: {
88
90
  text: "Load Lists",
89
91
  type: gd_bs_1.Components.ButtonTypes.OutlinePrimary,
90
- onClick: loadLists
92
+ onClick: function () { loadLists(); }
91
93
  }
92
94
  });
95
+ // Call the base event
96
+ props = wpProps.onEditFormFooterRendering ? wpProps.onEditFormFooterRendering(props) : props;
93
97
  // Return the properties
94
98
  return props;
95
99
  },
@@ -98,8 +102,10 @@ var SPFxListWebPart = function (wpProps) {
98
102
  // See if the lists haven't been loaded
99
103
  if (_loadFl == false) {
100
104
  // Load the lists
101
- loadLists();
105
+ loadLists(wp.Configuration ? wp.Configuration.ListId : null);
102
106
  }
107
+ // Call the base event
108
+ wpProps.onEditFormDisplaying ? wpProps.onEditFormDisplaying() : null;
103
109
  },
104
110
  // The configuration saving event
105
111
  onConfigSaving: function (cfg) {
@@ -107,9 +113,13 @@ var SPFxListWebPart = function (wpProps) {
107
113
  var values = wp.Form.getValues();
108
114
  // Set the configuration
109
115
  var listItem = values["List"];
110
- cfg.ListId = listItem ? listItem.value : null;
111
- cfg.ListName = listItem ? listItem.text : null;
112
- cfg.WebUrl = values["WebUrl"];
116
+ cfg = {
117
+ ListId: listItem ? listItem.value : null,
118
+ ListName: listItem ? listItem.text : null,
119
+ WebUrl: values["WebUrl"]
120
+ };
121
+ // Call the base event
122
+ cfg = wpProps.onConfigSaving ? wpProps.onConfigSaving(cfg) : cfg;
113
123
  // Return the configuration
114
124
  return cfg;
115
125
  }