gd-sprest-bs 10.7.6 → 10.7.8

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.
@@ -253,8 +253,8 @@ var Field = function (props) {
253
253
  controlProps.items = items;
254
254
  // Set the base validation
255
255
  baseValidation = function (ctrl, result) {
256
- // See if a value exists
257
- if (result.value) {
256
+ // See if a selected item exists and the field is required
257
+ if (result.value && ctrl.props.required) {
258
258
  // See if this is a dropdown
259
259
  if (ctrl.props.type == core_1.Components.FormControlTypes.Dropdown) {
260
260
  var ddlItem = result.value;
@@ -95,8 +95,8 @@ var RichTextBox = function (props) {
95
95
  el: elRichTextBox,
96
96
  elContents: quillObj.root,
97
97
  quillObj: quillObj,
98
- getHtml: function () { return quillObj.root.innerHTML; },
99
- getText: function () { return quillObj.getText(); },
98
+ getHtml: function () { return obj.getText() ? quillObj.root.innerHTML : ""; },
99
+ getText: function () { return quillObj.getText().trim(); },
100
100
  setHtml: function (value) { quillObj.root.innerHTML = value || ""; }
101
101
  };
102
102
  // Set the value
@@ -122,6 +122,66 @@ var SPFxListWebPart = function (wpProps) {
122
122
  cfg = wpProps.onConfigSaving ? wpProps.onConfigSaving(cfg) : cfg;
123
123
  // Return the configuration
124
124
  return cfg;
125
+ },
126
+ // The render items event
127
+ renderItems: function (el, cfg) {
128
+ // See if a render event exists
129
+ if (wpProps.renderItems == null) {
130
+ return;
131
+ }
132
+ // Set the list
133
+ var list = (0, gd_sprest_1.Web)(cfg.WebUrl).Lists().getById(cfg.ListId);
134
+ // Ensure the list exists
135
+ if (cfg.ListId) {
136
+ // See if we are doing a caml query
137
+ if (wpProps.onListItemCAMLQuery) {
138
+ // Set the CAML query
139
+ var camlQuery = wpProps.onListItemCAMLQuery(cfg, "");
140
+ // Get the list items
141
+ list.getItemsByQuery(camlQuery).execute(
142
+ // Success
143
+ function (items) {
144
+ // Call the event
145
+ wpProps.renderItems(el, cfg, items.results);
146
+ }, function (err) {
147
+ // Call the event
148
+ wpProps.renderItems(el, cfg, []);
149
+ });
150
+ }
151
+ else {
152
+ // Set the ODATA query
153
+ var odata = wpProps.onListItemODataQuery ? wpProps.onListItemODataQuery(cfg, {}) : null;
154
+ // See if we are making an ODATA query
155
+ if (odata) {
156
+ // Get the list items
157
+ list.Items().query(odata).execute(
158
+ // Success
159
+ function (items) {
160
+ // Call the event
161
+ wpProps.renderItems(el, cfg, items.results);
162
+ },
163
+ // Error
164
+ function (err) {
165
+ // Call the event
166
+ wpProps.renderItems(el, cfg, []);
167
+ });
168
+ }
169
+ else {
170
+ // Get the list items
171
+ list.Items().execute(
172
+ // Success
173
+ function (items) {
174
+ // Call the event
175
+ wpProps.renderItems(el, cfg, items.results);
176
+ },
177
+ // Error
178
+ function (err) {
179
+ // Call the event
180
+ wpProps.renderItems(el, cfg, []);
181
+ });
182
+ }
183
+ }
184
+ }
125
185
  }
126
186
  };
127
187
  // Return the webpart