gd-sprest-bs 10.7.7 → 10.7.9
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/webparts/list/wpSPFx.js +60 -0
- package/dist/gd-sprest-bs-icons.js +1 -1
- package/dist/gd-sprest-bs-icons.js.LICENSE.txt +82 -82
- 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 +1 -1
- package/dist/gd-sprest-bs.min.js +1 -1
- package/package.json +2 -2
- package/pnpm-lock.yaml +4 -4
- package/src/webparts/base/wpSPFx.ts +1 -1
- package/src/webparts/list/types.d.ts +14 -0
- package/src/webparts/list/wpSPFx.ts +70 -3
|
@@ -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
|