gd-sprest-bs 9.2.2 → 9.2.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/dist/gd-sprest-bs-icons.js +21213 -0
- package/dist/gd-sprest-bs-icons.min.js +2 -0
- package/dist/gd-sprest-bs-icons.min.js.LICENSE.txt +1 -0
- package/dist/gd-sprest-bs.d.ts +1136 -0
- package/dist/gd-sprest-bs.js +1744 -155
- package/dist/gd-sprest-bs.min.js +2 -0
- package/dist/gd-sprest-bs.min.js.LICENSE.txt +1 -0
- package/package.json +2 -3
- package/pnpm-lock.yaml +5 -4
|
@@ -0,0 +1,1136 @@
|
|
|
1
|
+
// Generated by dts-bundle v0.7.3
|
|
2
|
+
// Dependencies for this module:
|
|
3
|
+
// ../gd-bs
|
|
4
|
+
// ../gd-sprest
|
|
5
|
+
// ../gd-bs/src/components/form/controlTypes
|
|
6
|
+
// ../gd-bs/src/components/components
|
|
7
|
+
// ../gd-bs/src/components/form/formTypes
|
|
8
|
+
// ../gd-bs/src/components/button/types
|
|
9
|
+
// ../gd-bs/src/components/nav/types
|
|
10
|
+
// ../gd-bs/src/components/modal/types
|
|
11
|
+
// ../gd-bs/src/components/toolbar/types
|
|
12
|
+
|
|
13
|
+
declare module 'gd-sprest-bs' {
|
|
14
|
+
export * from "gd-bs";
|
|
15
|
+
export * from "gd-sprest";
|
|
16
|
+
|
|
17
|
+
import * as Components from "gd-sprest-bs/components/types";
|
|
18
|
+
import * as WebParts from "gd-sprest-bs/webparts/types";
|
|
19
|
+
export {
|
|
20
|
+
Components,
|
|
21
|
+
WebParts
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
import { IRESTBS } from "gd-sprest-bs/rest";
|
|
25
|
+
export const $REST: IRESTBS;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare module 'gd-sprest-bs/components/types' {
|
|
29
|
+
export * from "gd-sprest-bs/components/components";
|
|
30
|
+
|
|
31
|
+
import { IFormControlTypes as Parent } from "gd-bs/src/components/form/controlTypes";
|
|
32
|
+
export interface IFormControlTypes extends Parent {
|
|
33
|
+
DateTime: number;
|
|
34
|
+
PeoplePicker: number;
|
|
35
|
+
}
|
|
36
|
+
export const FormControlTypes: IFormControlTypes;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module 'gd-sprest-bs/webparts/types' {
|
|
40
|
+
export * from "gd-sprest-bs/webparts/base/helperTypes";
|
|
41
|
+
export * from "gd-sprest-bs/webparts/base/types";
|
|
42
|
+
export * from "gd-sprest-bs/webparts/list/types";
|
|
43
|
+
export * from "gd-sprest-bs/webparts/listFields/types";
|
|
44
|
+
export * from "gd-sprest-bs/webparts/search/types";
|
|
45
|
+
export * from "gd-sprest-bs/webparts/tabs/types";
|
|
46
|
+
export * from "gd-sprest-bs/webparts/taxonomy/types";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare module 'gd-sprest-bs/rest' {
|
|
50
|
+
import { IconTypes, Icons } from "gd-bs";
|
|
51
|
+
import { IREST } from "gd-sprest";
|
|
52
|
+
import { Components } from "gd-sprest-bs/components/types";
|
|
53
|
+
import * as WebParts from "gd-sprest-bs/webparts/types";
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* $REST Bootstrap Library
|
|
57
|
+
*/
|
|
58
|
+
export interface IRESTBS extends IREST {
|
|
59
|
+
Components,
|
|
60
|
+
Icons, IconTypes,
|
|
61
|
+
WebParts
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
declare module 'gd-sprest-bs/components/components' {
|
|
66
|
+
export * from "gd-bs/src/components/components";
|
|
67
|
+
export * from "gd-sprest-bs/components/datetime/types";
|
|
68
|
+
export * from "gd-sprest-bs/components/field/types";
|
|
69
|
+
export * from "gd-sprest-bs/components/listForm/types";
|
|
70
|
+
export * from "gd-sprest-bs/components/listFormDialog/types";
|
|
71
|
+
export * from "gd-sprest-bs/components/peoplePicker/types";
|
|
72
|
+
|
|
73
|
+
import { IFormControlTypes as Parent } from "gd-bs/src/components/form/controlTypes";
|
|
74
|
+
export interface IFormControlTypes extends Parent {
|
|
75
|
+
DateTime: number;
|
|
76
|
+
PeoplePicker: number;
|
|
77
|
+
}
|
|
78
|
+
export const FormControlTypes: IFormControlTypes;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare module 'gd-sprest-bs/webparts/base/helperTypes' {
|
|
82
|
+
import { IFormControlProps } from "gd-bs/src/components/form/controlTypes";
|
|
83
|
+
import { IForm } from "gd-bs/src/components/form/formTypes";
|
|
84
|
+
import { IWebPartInfo } from "gd-sprest-bs/webparts/base/types";
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Helper Methods
|
|
88
|
+
*/
|
|
89
|
+
export const Helper: IHelper;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Helper Methods
|
|
93
|
+
*/
|
|
94
|
+
export interface IHelper {
|
|
95
|
+
/**
|
|
96
|
+
* Method to get the webpart
|
|
97
|
+
* @param wpId - The webpart id.
|
|
98
|
+
*/
|
|
99
|
+
getWebPart(wpId: string): PromiseLike<IWPInstance>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Method to get the webpart id for a specified element
|
|
103
|
+
* @param el - The target element.
|
|
104
|
+
*/
|
|
105
|
+
getWebPartId(el: HTMLElement): string;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Method to render the edit form.
|
|
109
|
+
* @param el - The element to render the form to.
|
|
110
|
+
* @param wpCfg - The webpart configuration information.
|
|
111
|
+
* @param formControls - The form controls to render.
|
|
112
|
+
*/
|
|
113
|
+
renderEditForm: (el: HTMLElement, wpCfg: IWebPartCfg, formControls: Array<IFormControlProps>) => IForm;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Method to save the webpart configuration.
|
|
117
|
+
* This method may execute a postback, based on the page type.
|
|
118
|
+
* @param wpId - The webpart id.
|
|
119
|
+
* @param cfgId: The configuration element id.
|
|
120
|
+
* @param wpCfg - The webpart configuration.
|
|
121
|
+
*/
|
|
122
|
+
saveConfiguration(wpId: string, cfgId?: string, wpCfg?: any): PromiseLike<void>;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Method to update the configuration element
|
|
126
|
+
* @param cfgId: The configuration element id.
|
|
127
|
+
* @param elTarget - The target element.
|
|
128
|
+
* @param wpCfg - The webpart configuration.
|
|
129
|
+
*/
|
|
130
|
+
updateConfigurationInElement(cfgId: string, elTarget: HTMLInputElement, wpCfg);
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Method to update the webpart content elements
|
|
134
|
+
* @param wpId - The webpart id.
|
|
135
|
+
* @param cfgId: The configuration element id.
|
|
136
|
+
* @param wpCfg - The webpart configuration.
|
|
137
|
+
*/
|
|
138
|
+
updateWebPartContentElements(wpId: string, cfgId?: string, wpCfg?: any): boolean;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* WebPart Information
|
|
143
|
+
*/
|
|
144
|
+
export interface IWPInstance {
|
|
145
|
+
Context: any;
|
|
146
|
+
Properties: any;
|
|
147
|
+
WebPart: any;
|
|
148
|
+
WebPartDefinition: any;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare module 'gd-sprest-bs/webparts/base/types' {
|
|
153
|
+
import { IButtonProps } from "gd-bs/src/components/button/types";
|
|
154
|
+
import { IFormControl, IFormControlProps } from "gd-bs/src/components/form/controlTypes";
|
|
155
|
+
import { IForm } from "gd-bs/src/components/form/formTypes";
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* ### Web Part
|
|
159
|
+
*
|
|
160
|
+
* The client-side webpart component can be used to control what is displayed when a page is being edited and displayed. An optional hidden configuration element can be utilized to store a custom configuration.
|
|
161
|
+
*
|
|
162
|
+
* ```ts
|
|
163
|
+
* import { WebParts } from "gd-sprest-bs";
|
|
164
|
+
*
|
|
165
|
+
* // Create the webpart
|
|
166
|
+
* WebParts.WebPart({
|
|
167
|
+
* elementId: "my-wp",
|
|
168
|
+
* cfgElementId: "my-wp-cfg",
|
|
169
|
+
* onRenderDisplay: (wpInfo) => {
|
|
170
|
+
* // Render the display element
|
|
171
|
+
* wpInfo.el.innerHTML = '<h1>Hello Display Mode</h1>';
|
|
172
|
+
* },
|
|
173
|
+
* onRenderEdit: (wpInfo) => {
|
|
174
|
+
* // Render the edit element
|
|
175
|
+
* wpInfo.el.innerHTML = '<h1>Hello Edit Mode</h1>';
|
|
176
|
+
* }
|
|
177
|
+
* });
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
export const WebPart: (props: IWebPartProps) => IWebPart;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* WebPart
|
|
184
|
+
*/
|
|
185
|
+
export interface IWebPart<IWPCfg = IWebPartCfg, IWPInfo = IWebPartInfo> {
|
|
186
|
+
/** The webpart configuration. */
|
|
187
|
+
cfg: IWPCfg;
|
|
188
|
+
|
|
189
|
+
/** The webpart information. */
|
|
190
|
+
info: IWPInfo;
|
|
191
|
+
|
|
192
|
+
/** Method to update the edit form. */
|
|
193
|
+
updateEditForm?: (formControls: Array<IFormControl>) => void;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* WebPart Information
|
|
198
|
+
*/
|
|
199
|
+
export interface IWebPartInfo<IWPCfg = IWebPartCfg> {
|
|
200
|
+
/** The configuration */
|
|
201
|
+
cfg: IWPCfg;
|
|
202
|
+
|
|
203
|
+
/** The element to render the webpart to */
|
|
204
|
+
el: HTMLElement;
|
|
205
|
+
|
|
206
|
+
/** The webpart id */
|
|
207
|
+
wpId: string;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* WebPart Object
|
|
212
|
+
*/
|
|
213
|
+
export interface IWebPartObject {
|
|
214
|
+
/** The JSOM context object */
|
|
215
|
+
Context: any;
|
|
216
|
+
|
|
217
|
+
/** The webpart properties object */
|
|
218
|
+
Properties: any;
|
|
219
|
+
|
|
220
|
+
/** The webpart id */
|
|
221
|
+
WebPartId: string;
|
|
222
|
+
|
|
223
|
+
/** The webpart html element */
|
|
224
|
+
WebPart: HTMLElement;
|
|
225
|
+
|
|
226
|
+
/** The webpart definition object */
|
|
227
|
+
WebPartDefinition: any;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* WebPart Properties
|
|
232
|
+
*/
|
|
233
|
+
export interface IWebPartProps<IWPInfo = IWebPartInfo, IWPEditForm = IWebPartEditForm> {
|
|
234
|
+
/** The optional configuration element */
|
|
235
|
+
cfgElementId?: string;
|
|
236
|
+
|
|
237
|
+
/** The class name. */
|
|
238
|
+
className?: string;
|
|
239
|
+
|
|
240
|
+
/** The target element id to render the webpart to */
|
|
241
|
+
elementId?: string;
|
|
242
|
+
|
|
243
|
+
/** The edit form */
|
|
244
|
+
editForm?: IWPEditForm;
|
|
245
|
+
|
|
246
|
+
/** The optional help link properties */
|
|
247
|
+
helpProps?: {
|
|
248
|
+
/** The link title */
|
|
249
|
+
title?: string;
|
|
250
|
+
|
|
251
|
+
/** The link url */
|
|
252
|
+
url: string;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
/** The post render event */
|
|
256
|
+
onPostRender?: (wp: IWPInfo, ...args) => void;
|
|
257
|
+
|
|
258
|
+
/** The render event triggered when the page is in 'Display' mode */
|
|
259
|
+
onRenderDisplay?: (wp: IWPInfo) => any;
|
|
260
|
+
|
|
261
|
+
/** The render event triggered when the page is in 'Edit' mode */
|
|
262
|
+
onRenderEdit?: (wp: IWPInfo) => any;
|
|
263
|
+
|
|
264
|
+
/** The render form event triggered when the form is created */
|
|
265
|
+
onRenderForm?: (form: IForm, wp?: IWPInfo) => any;
|
|
266
|
+
|
|
267
|
+
/** The webpart class name */
|
|
268
|
+
wpClassName?: string;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* WebPart Configuration
|
|
273
|
+
*/
|
|
274
|
+
export const WPCfg: (cfg: IWebPartCfg, props: IWebPartProps) => {
|
|
275
|
+
/** Method to render the edit form. */
|
|
276
|
+
renderForm?: (formControls: Array<IFormControl>) => void;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* WebPart Configuration
|
|
281
|
+
*/
|
|
282
|
+
export interface IWebPartCfg {
|
|
283
|
+
/** The webpart id */
|
|
284
|
+
WebPartId?: string;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* WebPart Edit Form
|
|
289
|
+
*/
|
|
290
|
+
export interface IWebPartEditForm<IWPCfg = IWebPartCfg, IWPInfo = IWebPartInfo> {
|
|
291
|
+
/** The form action buttons displayed in the footer of the modal. */
|
|
292
|
+
actions?: Array<IButtonProps>;
|
|
293
|
+
|
|
294
|
+
/** The render form event. */
|
|
295
|
+
onRenderForm?: (wpInfo?: IWPInfo) => Array<IFormControlProps> | PromiseLike<Array<IFormControlProps>> | void;
|
|
296
|
+
|
|
297
|
+
/** The save event. */
|
|
298
|
+
onSave?: (wpCfg?: IWPCfg, form?: IForm) => IWPCfg;
|
|
299
|
+
|
|
300
|
+
/** True to hide the save button. */
|
|
301
|
+
showSaveButton?: boolean;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
declare module 'gd-sprest-bs/webparts/list/types' {
|
|
306
|
+
import { IFormControlProps } from "gd-bs/src/components/form/controlTypes";
|
|
307
|
+
import { Types } from "gd-sprest";
|
|
308
|
+
import { IWebPart, IWebPartInfo, IWebPartProps, IWebPartCfg, IWebPartEditForm } from "gd-sprest-bs/webparts/base/types";
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* ### List WebPart
|
|
312
|
+
*
|
|
313
|
+
* The list webpart should be used when targeting a list as a datasource.
|
|
314
|
+
*
|
|
315
|
+
* ```ts
|
|
316
|
+
* import { WebParts } from "gd-sprest-bs";
|
|
317
|
+
*
|
|
318
|
+
* // Create the webpart
|
|
319
|
+
* WebParts.WebPart({
|
|
320
|
+
* elementId: "my-wpList",
|
|
321
|
+
* cfgElementId: "my-wpList-cfg",
|
|
322
|
+
* onRenderItems: (wpInfo, items) => {
|
|
323
|
+
* // Render the display element
|
|
324
|
+
* wpInfo.el.innerHTML = [
|
|
325
|
+
* '<h1>List: ' + wpInfo.ListName + '</h1>',
|
|
326
|
+
* '<h5>List Items: ' + items.length + '</h5>'
|
|
327
|
+
* ].join('\n');
|
|
328
|
+
* }
|
|
329
|
+
* });
|
|
330
|
+
* ```
|
|
331
|
+
*/
|
|
332
|
+
export const WPList: (props: IWPListProps) => IWPList;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* List WebPart Edit Form
|
|
336
|
+
*/
|
|
337
|
+
export const WPListEditForm: (props: IWPListEditForm) => IWPListEditForm;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* List WebPart
|
|
341
|
+
*/
|
|
342
|
+
export interface IWPList<IListCfg = IWPListCfg, IListInfo = IWPListInfo> extends IWebPart<IListCfg, IListInfo> { }
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* List WebPart Information
|
|
346
|
+
*/
|
|
347
|
+
export interface IWPListInfo<IListCfg = IWPListCfg> extends IWebPartInfo<IListCfg> { }
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* List WebPart Properties
|
|
351
|
+
*/
|
|
352
|
+
export interface IWPListProps<IListInfo=IWPListInfo, IListEditForm=IWPListEditForm> extends IWebPartProps<IListInfo, IListEditForm> {
|
|
353
|
+
/** The caml query. */
|
|
354
|
+
camlQuery?: string;
|
|
355
|
+
|
|
356
|
+
/** The odata query. */
|
|
357
|
+
odataQuery?: Types.IODataQuery;
|
|
358
|
+
|
|
359
|
+
/** The executing caml query event. */
|
|
360
|
+
onExecutingCAMLQuery?: (wpInfo: IListInfo, caml: string) => string;
|
|
361
|
+
|
|
362
|
+
/** The executing odata query event. */
|
|
363
|
+
onExecutingODATAQuery?: (wpInfo: IListInfo, odata: Types.IODataQuery) => Types.IODataQuery;
|
|
364
|
+
|
|
365
|
+
/** The on render items event. */
|
|
366
|
+
onRenderItems?: (wpInfo: IListInfo, items: Array<Types.SP.IListItemQuery | Types.SP.ListItem>) => void;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* List WebPart Configuration
|
|
371
|
+
*/
|
|
372
|
+
export interface IWPListCfg extends IWebPartCfg {
|
|
373
|
+
/** The list name */
|
|
374
|
+
ListName?: string;
|
|
375
|
+
|
|
376
|
+
/** The relative web url */
|
|
377
|
+
WebUrl?: string;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* List WebPart Edit Form
|
|
382
|
+
*/
|
|
383
|
+
export interface IWPListEditForm<IListCfg = IWPListCfg, IListInfo = IWPListInfo> extends IWebPartEditForm<IListCfg, IListInfo> {
|
|
384
|
+
/** The odata list query. */
|
|
385
|
+
listQuery?: Types.IODataQuery;
|
|
386
|
+
|
|
387
|
+
/** The list changed event. */
|
|
388
|
+
onListChanged?: (wpInfo: IListInfo, list?: Types.SP.IListQuery | Types.SP.List) => Array<IFormControlProps> | PromiseLike<Array<IFormControlProps>> | void;
|
|
389
|
+
|
|
390
|
+
/** The lists loaded event. */
|
|
391
|
+
onListsLoaded?: (wpInfo: IListInfo, lists?: Array<Types.SP.IListQuery | Types.SP.List>) => Array<Types.SP.IListQuery | Types.SP.List>;
|
|
392
|
+
|
|
393
|
+
/** The render form event. */
|
|
394
|
+
onRenderForm?: (wpInfo: IListInfo, list?: Types.SP.IListQuery | Types.SP.List) => Array<IFormControlProps> | PromiseLike<Array<IFormControlProps>> | void;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
declare module 'gd-sprest-bs/webparts/listFields/types' {
|
|
399
|
+
import { IWPList, IWPListCfg, IWPListEditForm, IWPListInfo, IWPListProps } from "gd-sprest-bs/webparts/list/types";
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* ### List Fields WebPart
|
|
403
|
+
*
|
|
404
|
+
* The list fields webpart should be used when targeting a list and fields as a datasource.
|
|
405
|
+
*
|
|
406
|
+
* ```ts
|
|
407
|
+
* import { WebParts } from "gd-sprest-bs";
|
|
408
|
+
*
|
|
409
|
+
* // Create the webpart
|
|
410
|
+
* WebParts.WebPart({
|
|
411
|
+
* elementId: "my-wpList",
|
|
412
|
+
* cfgElementId: "my-wpList-cfg",
|
|
413
|
+
* onRenderItems: (wpInfo, items) => {
|
|
414
|
+
* // Render the display element
|
|
415
|
+
* wpInfo.el.innerHTML = [
|
|
416
|
+
* '<h1>List: ' + wpInfo.ListName + '</h1>',
|
|
417
|
+
* '<h5>List Items: ' + items.length + '</h5>'
|
|
418
|
+
* ].join('\n');
|
|
419
|
+
* }
|
|
420
|
+
* });
|
|
421
|
+
* ```
|
|
422
|
+
*/
|
|
423
|
+
export const WPListFields: (props: IWPListFieldsProps) => IWPListFields;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* List Fields WebPart Edit Form
|
|
427
|
+
*/
|
|
428
|
+
export const WPListFieldsEditForm: (props: IWPListFieldsEditForm) => IWPListFieldsEditForm;
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* List Fields WebPart
|
|
432
|
+
*/
|
|
433
|
+
export interface IWPListFields<IListFieldsCfg = IWPListFieldsCfg, IListFieldsInfo = IWPListFieldsInfo> extends IWPList<IListFieldsCfg, IListFieldsInfo> { }
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* List Fields WebPart Information
|
|
437
|
+
*/
|
|
438
|
+
export interface IWPListFieldsInfo<IListFieldsCfg = IWPListFieldsCfg> extends IWPListInfo<IListFieldsCfg> { }
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* List Fields WebPart Properties
|
|
442
|
+
*/
|
|
443
|
+
export interface IWPListFieldsProps<IListFieldsInfo = IWPListFieldsInfo, IListFieldsEditForm = IWPListFieldsEditForm> extends IWPListProps<IListFieldsInfo, IListFieldsEditForm> { }
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* WebPart Configuration List Field
|
|
447
|
+
*/
|
|
448
|
+
export interface IWPListField {
|
|
449
|
+
// The internal field name
|
|
450
|
+
Name: string;
|
|
451
|
+
|
|
452
|
+
// The display name of the field
|
|
453
|
+
Title: string
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* List Fields WebPart Configuration
|
|
458
|
+
*/
|
|
459
|
+
export interface IWPListFieldsCfg extends IWPListCfg {
|
|
460
|
+
/** The selected fields */
|
|
461
|
+
Fields: Array<IWPListField>;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* List Fields WebPart Edit Form
|
|
466
|
+
*/
|
|
467
|
+
export interface IWPListFieldsEditForm<IListFieldsCfg = IWPListFieldsCfg, IListFieldsInfo = IWPListFieldsInfo> extends IWPListEditForm<IListFieldsCfg, IListFieldsInfo> { }
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
declare module 'gd-sprest-bs/webparts/search/types' {
|
|
471
|
+
import { Types } from "gd-sprest";
|
|
472
|
+
import { IWPList, IWPListInfo, IWPListProps, IWPListCfg, IWPListEditForm } from "gd-sprest-bs/webparts/list/types";
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* ### Search WebPart
|
|
476
|
+
*
|
|
477
|
+
* The search webpart extends the list webpart, and includes a filterItems method to return items based on the inputed filter text.
|
|
478
|
+
*
|
|
479
|
+
* ```ts
|
|
480
|
+
* import { WebParts } from "gd-sprest-bs";
|
|
481
|
+
*
|
|
482
|
+
* // Create the webpart
|
|
483
|
+
* let wp = WebParts.WebPart({
|
|
484
|
+
* elementId: "my-wpSearch",
|
|
485
|
+
* cfgElementId: "my-wpSearch-cfg",
|
|
486
|
+
* onRenderItems: (wpInfo, items) => {
|
|
487
|
+
* // Render the display element
|
|
488
|
+
* wpInfo.el.innerHTML = [
|
|
489
|
+
* '<h1>List: ' + wpInfo.ListName + '</h1>',
|
|
490
|
+
* '<h5>List Items: ' + items.length + '</h5>'
|
|
491
|
+
* ].join('\n');
|
|
492
|
+
* }
|
|
493
|
+
* });
|
|
494
|
+
* ```
|
|
495
|
+
*/
|
|
496
|
+
export const WPSearch: (props: IWPListProps) => IWPSearch;
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Search WebPart Edit Form
|
|
500
|
+
*/
|
|
501
|
+
export const WPSearchEditForm: (props: IWPSearchEditForm) => IWPSearchEditForm;
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Search WebPart
|
|
505
|
+
*/
|
|
506
|
+
export interface IWPSearch extends IWPList<IWPSearchCfg, IWPSearchInfo> {
|
|
507
|
+
/** The filter items method. */
|
|
508
|
+
filterItems: (filterText: string) => Array<Types.SP.IListItemQuery | Types.SP.ListItem>;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Search WebPart Information
|
|
513
|
+
*/
|
|
514
|
+
export interface IWPSearchInfo extends IWPListInfo<IWPSearchCfg> { }
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Search WebPart Properties
|
|
518
|
+
*/
|
|
519
|
+
export interface IWPSearchProps extends IWPListProps<IWPSearchInfo, IWPSearchEditForm> {
|
|
520
|
+
/** The internal field names to be used for search. These will be appended to the configuration fields. */
|
|
521
|
+
searchFields?: Array<{ name: string, type: string }>;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Search WebPart Configuration
|
|
526
|
+
*/
|
|
527
|
+
export interface IWPSearchCfg extends IWPListCfg {
|
|
528
|
+
/** The searchable fields. */
|
|
529
|
+
Fields: Array<{ name: string, type: string }>;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Search WebPart Edit Form
|
|
534
|
+
*/
|
|
535
|
+
export interface IWPSearchEditForm extends IWPListEditForm<IWPSearchCfg, IWPSearchInfo> { }
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
declare module 'gd-sprest-bs/webparts/tabs/types' {
|
|
539
|
+
import { INav } from "gd-bs/src/components/nav/types";
|
|
540
|
+
import { IWebPart, IWebPartProps } from "gd-sprest-bs/webparts/base/types";
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* ### WebPart Tabs
|
|
544
|
+
*
|
|
545
|
+
* The webpart tabs will generate tabs for each visible webpart in its zone.
|
|
546
|
+
*
|
|
547
|
+
* ```ts
|
|
548
|
+
* import { WebParts } from "gd-sprest-bs";
|
|
549
|
+
*
|
|
550
|
+
* // Create the webpart
|
|
551
|
+
* WebParts.WPTabs({ elementId: "my-tabs" });
|
|
552
|
+
* ```
|
|
553
|
+
*/
|
|
554
|
+
export const WPTabs: (props: IWPTabsProps) => IWPTabs;
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* WebPart Tab Types
|
|
558
|
+
*/
|
|
559
|
+
export const WPTabTypes: IWPTabTypes;
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* WebPart Tabs
|
|
563
|
+
*/
|
|
564
|
+
export interface IWPTabs extends IWebPart {
|
|
565
|
+
getNav(): INav;
|
|
566
|
+
getTabs(): Array<HTMLElement>;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* WebPart Tabs Properties
|
|
571
|
+
*/
|
|
572
|
+
export interface IWPTabsProps extends IWebPartProps {
|
|
573
|
+
onClick?: (el?: HTMLElement) => void;
|
|
574
|
+
type?: number;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* WebPart Tab Types
|
|
579
|
+
*/
|
|
580
|
+
export type IWPTabTypes = {
|
|
581
|
+
Pillars: number;
|
|
582
|
+
Tabs: number;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
declare module 'gd-sprest-bs/webparts/taxonomy/types' {
|
|
587
|
+
import { IDropdownItem } from "gd-bs/src/components/dropdown/types"
|
|
588
|
+
import { Helper } from "gd-sprest";
|
|
589
|
+
import { IWebPart, IWebPartInfo, IWebPartProps, IWebPartCfg, IWebPartEditForm } from "gd-sprest-bs/webparts/base/types";
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* ### Taxonomy WebPart
|
|
593
|
+
*
|
|
594
|
+
* The taxonomy webpart should be used when targeting the term store as a datasource.
|
|
595
|
+
*
|
|
596
|
+
* ```ts
|
|
597
|
+
* import { WebParts } from "gd-sprest-bs";
|
|
598
|
+
*
|
|
599
|
+
* // Create the webpart
|
|
600
|
+
* WebParts.WPTaxonomy({
|
|
601
|
+
* elementId: "my-wpTaxonomy",
|
|
602
|
+
* cfgElementId: "my-wpTaxonomy-cfg",
|
|
603
|
+
* onRenderTermSetTerms: (wpInfo, terms) => {
|
|
604
|
+
* // Render the display element
|
|
605
|
+
* wpInfo.el.innerHTML = [
|
|
606
|
+
* '<h1>Term Set: ' + wpInfo.TermSetName + '</h1>',
|
|
607
|
+
* '<h5>Terms: ' + terms.length + '</h5>'
|
|
608
|
+
* ].join('\n');
|
|
609
|
+
* }
|
|
610
|
+
* });
|
|
611
|
+
* ```
|
|
612
|
+
*/
|
|
613
|
+
export const WPTaxonomy: (props: IWPTaxonomyProps) => IWPTaxonomy;
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* Taxonomy WebPart Edit Form
|
|
617
|
+
*/
|
|
618
|
+
export const WPTaxonomyEditForm: (props: IWPTaxonomyEditForm) => IWPTaxonomyEditForm;
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Taxonomy WebPart
|
|
622
|
+
*/
|
|
623
|
+
export interface IWPTaxonomy extends IWebPart<IWPTaxonomyCfg, IWPTaxonomyInfo> { }
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Taxonomy WebPart Information
|
|
627
|
+
*/
|
|
628
|
+
export interface IWPTaxonomyInfo extends IWebPartInfo<IWPTaxonomyCfg> { }
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Taxonomy WebPart Properties
|
|
632
|
+
*/
|
|
633
|
+
export interface IWPTaxonomyProps extends IWebPartProps<IWPTaxonomyInfo, IWPTaxonomyEditForm> {
|
|
634
|
+
/** The on render term set event. */
|
|
635
|
+
onRenderTermSet?: (wpInfo: IWPTaxonomyInfo, termSet: Helper.ITerm) => void;
|
|
636
|
+
|
|
637
|
+
/** The on render term sets event. */
|
|
638
|
+
onRenderTermSets?: (wpInfo: IWPTaxonomyInfo, termSets: Array<Helper.ITermSetInfo>) => void;
|
|
639
|
+
|
|
640
|
+
/** The on render term set terms event. */
|
|
641
|
+
onRenderTermSetTerms?: (wpInfo: IWPTaxonomyInfo, terms: Array<Helper.ITermInfo>) => void;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* Taxonomy WebPart Configuration
|
|
646
|
+
*/
|
|
647
|
+
export interface IWPTaxonomyCfg extends IWebPartCfg {
|
|
648
|
+
/** The term group id. */
|
|
649
|
+
TermGroupId?: string;
|
|
650
|
+
|
|
651
|
+
/** The term group name. */
|
|
652
|
+
TermGroupName?: string;
|
|
653
|
+
|
|
654
|
+
/** The term set id. */
|
|
655
|
+
TermSetId?: string;
|
|
656
|
+
|
|
657
|
+
/** The term set name */
|
|
658
|
+
TermSetName?: string;
|
|
659
|
+
|
|
660
|
+
/** The term set term id. */
|
|
661
|
+
TermSetTermId?: string;
|
|
662
|
+
|
|
663
|
+
/** The term set term name */
|
|
664
|
+
TermSetTermName?: string;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Taxonomy WebPart Edit Form
|
|
669
|
+
*/
|
|
670
|
+
export interface IWPTaxonomyEditForm extends IWebPartEditForm<IWPTaxonomyCfg, IWPTaxonomyInfo> {
|
|
671
|
+
/** The term group changed event. */
|
|
672
|
+
onTermGroupChanged?: (wpInfo: IWPTaxonomyInfo, termGroupInfo?: ITermGroupInfo) => void;
|
|
673
|
+
|
|
674
|
+
/** The term group loaded event. */
|
|
675
|
+
onTermGroupsLoaded?: (wpInfo: IWPTaxonomyInfo, termGroups: Array<IDropdownItem>) => Array<IDropdownItem>;
|
|
676
|
+
|
|
677
|
+
/** The term set changed event. */
|
|
678
|
+
onTermSetChanged?: (wpInfo: IWPTaxonomyInfo, termSetInfo?: ITermInfo) => void;
|
|
679
|
+
|
|
680
|
+
/** The term set loaded event. */
|
|
681
|
+
onTermSetsLoaded?: (wpInfo: IWPTaxonomyInfo, termSets?: Array<IDropdownItem>) => Array<IDropdownItem>;
|
|
682
|
+
|
|
683
|
+
/** The term set term changed event. */
|
|
684
|
+
onTermSetTermChanged?: (wpInfo: IWPTaxonomyInfo, termInfo?: ITermInfo) => void;
|
|
685
|
+
|
|
686
|
+
/** The term set terms loaded event. */
|
|
687
|
+
onTermSetTermsLoaded?: (wpInfo: IWPTaxonomyInfo, terms?: Array<IDropdownItem>) => Array<IDropdownItem>;
|
|
688
|
+
|
|
689
|
+
/** Flag to display the term set terms. */
|
|
690
|
+
showTermSetTerms?: boolean;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Term Group Info
|
|
695
|
+
*/
|
|
696
|
+
interface ITermGroupInfo {
|
|
697
|
+
id: string;
|
|
698
|
+
name: string;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* Term Info
|
|
703
|
+
*/
|
|
704
|
+
interface ITermInfo {
|
|
705
|
+
id: string;
|
|
706
|
+
name: string;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
declare module 'gd-sprest-bs/components/datetime/types' {
|
|
711
|
+
import { IFormControlProps } from "gd-bs/src/components/form/controlTypes";
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Date/Time
|
|
715
|
+
*/
|
|
716
|
+
export const DateTime: (props: IDateTimeProps) => IDateTime
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Date/Time
|
|
720
|
+
*/
|
|
721
|
+
export interface IDateTime {
|
|
722
|
+
/** The date/time picker element. */
|
|
723
|
+
el: HTMLDivElement;
|
|
724
|
+
|
|
725
|
+
/** The flatpickr object. */
|
|
726
|
+
flatpickrObj: any;
|
|
727
|
+
|
|
728
|
+
/** Returns the date as a Date/Time object. */
|
|
729
|
+
getDate: () => Date;
|
|
730
|
+
|
|
731
|
+
/** Method to get the value. */
|
|
732
|
+
getValue: () => string;
|
|
733
|
+
|
|
734
|
+
/** Method to set the value. */
|
|
735
|
+
setValue: (dt: string | Date, dtFormat?: string) => void;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Date/Time Props
|
|
740
|
+
*/
|
|
741
|
+
export interface IDateTimeProps {
|
|
742
|
+
/** Assigns the object to the input parameter. */
|
|
743
|
+
assignTo?: (obj: IDateTime) => void;
|
|
744
|
+
|
|
745
|
+
/** The class name to apply to the element. */
|
|
746
|
+
className?: string;
|
|
747
|
+
|
|
748
|
+
/** The element to render the form to. */
|
|
749
|
+
el?: Element;
|
|
750
|
+
|
|
751
|
+
/** True to disable the date/time plugin */
|
|
752
|
+
disabled?: boolean;
|
|
753
|
+
|
|
754
|
+
/** The date/time label. */
|
|
755
|
+
label?: string;
|
|
756
|
+
|
|
757
|
+
/** The flatpickr options. */
|
|
758
|
+
options?: any;
|
|
759
|
+
|
|
760
|
+
/** Flag to display the time. */
|
|
761
|
+
showTime?: boolean;
|
|
762
|
+
|
|
763
|
+
/** The date/time value. */
|
|
764
|
+
value?: string;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Form Control Properties - DateTime
|
|
769
|
+
*/
|
|
770
|
+
export interface IFormControlPropsDateTime extends IFormControlProps {
|
|
771
|
+
/** The flatpickr options. */
|
|
772
|
+
options?: any;
|
|
773
|
+
|
|
774
|
+
/** Flag to display the time. */
|
|
775
|
+
showTime?: boolean;
|
|
776
|
+
|
|
777
|
+
/** The date/time value. */
|
|
778
|
+
value?: string;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
declare module 'gd-sprest-bs/components/field/types' {
|
|
783
|
+
import { Helper, Types } from "gd-sprest";
|
|
784
|
+
import { IFormControl, IFormControlProps, IFormControlValidationResult } from "gd-bs/src/components/form/controlTypes";
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* Field
|
|
788
|
+
*/
|
|
789
|
+
export const Field: (props: IFieldProps) => IField;
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Field
|
|
793
|
+
*/
|
|
794
|
+
export interface IField {
|
|
795
|
+
control: IFormControl;
|
|
796
|
+
controlProps: IFormControlProps;
|
|
797
|
+
getValue: () => IFieldValue;
|
|
798
|
+
isValid: () => boolean;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* Field Properties
|
|
803
|
+
*/
|
|
804
|
+
export interface IFieldProps {
|
|
805
|
+
assignTo?: (obj: IField) => void;
|
|
806
|
+
controlMode?: number;
|
|
807
|
+
errorMessage?: string;
|
|
808
|
+
field: Types.SP.Field;
|
|
809
|
+
listInfo: Helper.IListFormResult;
|
|
810
|
+
onError?: (msg: string) => void;
|
|
811
|
+
onControlRendered?: (control: IFormControl, field: Types.SP.Field) => void | Promise<IFormControl>;
|
|
812
|
+
onControlRendering?: (control: IFormControlProps, field: Types.SP.Field) => void | Promise<IFormControlProps>;
|
|
813
|
+
onValidate?: (field: Types.SP.Field, control: IFormControl, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
|
|
814
|
+
value?: any;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* Field Value
|
|
819
|
+
*/
|
|
820
|
+
export interface IFieldValue {
|
|
821
|
+
name: string;
|
|
822
|
+
value: any;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Form Control Lookup Properties
|
|
827
|
+
*/
|
|
828
|
+
export interface IFormControlLookupProps extends IFormControlProps {
|
|
829
|
+
lookupFilter?: string;
|
|
830
|
+
onControlRendering?: (control: IFieldLookupProps, field: Types.SP.Field) => void | Promise<IFieldLookupProps>;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Form Control Url Properties
|
|
835
|
+
*/
|
|
836
|
+
export interface IFormControlUrlProps extends IFormControlProps {
|
|
837
|
+
showDescription?: boolean;
|
|
838
|
+
onControlRendering?: (control: IFieldUrlProps, field: Types.SP.Field) => void | Promise<IFieldUrlProps>;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
declare module 'gd-sprest-bs/components/listForm/types' {
|
|
843
|
+
import { IFormControl, IFormControlProps } from "gd-bs/src/components/form/controlTypes";
|
|
844
|
+
import { IForm, IFormRow } from "gd-bs/src/components/form/formTypes";
|
|
845
|
+
import { Helper, Types } from "gd-sprest";
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* List Form
|
|
849
|
+
*/
|
|
850
|
+
export const ListForm: IListForm;
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* List Form
|
|
854
|
+
*/
|
|
855
|
+
export interface IListForm extends Helper.IListForm {
|
|
856
|
+
/**
|
|
857
|
+
* Method to render the display form template.
|
|
858
|
+
* @param props - The display form properties.
|
|
859
|
+
*/
|
|
860
|
+
renderDisplayForm(props: IListFormDisplayProps): IListFormDisplay;
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* Method to render the edit/new form.
|
|
864
|
+
* @param props - The edit/new form properties.
|
|
865
|
+
*/
|
|
866
|
+
renderEditForm(props: IListFormEditProps): IListFormEdit;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* List Form Attachments Properties
|
|
871
|
+
*/
|
|
872
|
+
export interface IListFormAttachmentsProps {
|
|
873
|
+
/** The element to render the form to. */
|
|
874
|
+
el: Element;
|
|
875
|
+
|
|
876
|
+
/** The list form information. */
|
|
877
|
+
info: Helper.IListFormResult;
|
|
878
|
+
|
|
879
|
+
/** The item attachment saved event. */
|
|
880
|
+
onSave?: (info: Helper.IListFormResult) => void;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
/**
|
|
884
|
+
* List Form Display
|
|
885
|
+
*/
|
|
886
|
+
export interface IListFormDisplay {
|
|
887
|
+
/** The form element. */
|
|
888
|
+
el: HTMLFormElement;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* List Form Display Properties
|
|
893
|
+
*/
|
|
894
|
+
export interface IListFormDisplayProps extends Helper.IListFormDisplayProps {
|
|
895
|
+
/** Assigns the object to the input parameter. */
|
|
896
|
+
assignTo?: (obj: IListFormDisplay) => void;
|
|
897
|
+
|
|
898
|
+
/** The form component class name. */
|
|
899
|
+
className?: string;
|
|
900
|
+
|
|
901
|
+
/** The form component group class name. */
|
|
902
|
+
groupClassName?: string;
|
|
903
|
+
|
|
904
|
+
/** The form component row class name. */
|
|
905
|
+
rowClassName?: string;
|
|
906
|
+
|
|
907
|
+
/** The control rendered event. */
|
|
908
|
+
onControlRendered?: (control: IFormControl, field: Types.SP.Field) => void | Promise<IFormControl>;
|
|
909
|
+
|
|
910
|
+
/** The control rendering event. */
|
|
911
|
+
onControlRendering?: (control: IFormControlProps, field: Types.SP.Field) => void | Promise<IFormControlProps>;
|
|
912
|
+
|
|
913
|
+
/** The form rendered event. */
|
|
914
|
+
onFormRendered?: (form: IForm) => void;
|
|
915
|
+
|
|
916
|
+
/** The error event. */
|
|
917
|
+
onError?: (msg?: string) => void;
|
|
918
|
+
|
|
919
|
+
/** The list form rows. */
|
|
920
|
+
template?: Array<IFormRow>;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* List Form Edit
|
|
925
|
+
*/
|
|
926
|
+
export interface IListFormEdit {
|
|
927
|
+
/** Appends controls to the form */
|
|
928
|
+
appendControls(controls: Array<IFormControlProps>);
|
|
929
|
+
|
|
930
|
+
/** Appends rows to the form */
|
|
931
|
+
appendRows(rows: Array<IFormRow>);
|
|
932
|
+
|
|
933
|
+
/** The form element. */
|
|
934
|
+
el: HTMLFormElement;
|
|
935
|
+
|
|
936
|
+
/** Method to get a control by field name */
|
|
937
|
+
getControl(fieldName: string): IFormControl;
|
|
938
|
+
|
|
939
|
+
/** Method to get the list item associated with the item */
|
|
940
|
+
getItem(): any;
|
|
941
|
+
|
|
942
|
+
/** Method to get the form values */
|
|
943
|
+
getValues(): { [key: string]: any }
|
|
944
|
+
|
|
945
|
+
/** Method to determine if the field is valid */
|
|
946
|
+
isValid(): boolean;
|
|
947
|
+
|
|
948
|
+
/** Method to save the form. */
|
|
949
|
+
save(): PromiseLike<Types.SP.ListItem>;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
/**
|
|
953
|
+
* List Form Edit Properties
|
|
954
|
+
*/
|
|
955
|
+
export interface IListFormEditProps extends IListFormDisplayProps, Helper.IListFormEditProps {
|
|
956
|
+
/** Assigns the object to the input parameter. */
|
|
957
|
+
assignTo?: (obj: IListFormEdit) => void;
|
|
958
|
+
|
|
959
|
+
/** Use this event to filter a lookup field by OData query. */
|
|
960
|
+
onFilterLookupField?: (field: Types.SP.Field) => string | Types.IODataQuery;
|
|
961
|
+
|
|
962
|
+
/** The form saving event. */
|
|
963
|
+
onSaving?: (item: any) => void | PromiseLike<any>;
|
|
964
|
+
|
|
965
|
+
/** The form validating event. */
|
|
966
|
+
onValidate?: (field: Types.SP.Field, control: IFormControl) => boolean;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
declare module 'gd-sprest-bs/components/listFormDialog/types' {
|
|
971
|
+
import { IFormControl, IFormControlProps } from "gd-bs/src/components/form/controlTypes";
|
|
972
|
+
import { IFormRow } from "gd-bs/src/components/form/formTypes";
|
|
973
|
+
import { IModal, IModalProps } from "gd-bs/src/components/modal/types";
|
|
974
|
+
import { IToolbarProps } from "gd-bs/src/components/toolbar/types";
|
|
975
|
+
import { Helper, Types } from "gd-sprest";
|
|
976
|
+
|
|
977
|
+
/**
|
|
978
|
+
* List Form Dialog
|
|
979
|
+
*/
|
|
980
|
+
export const ListFormDialog: (props: IListFormDialogProps) => IListFormDialog;
|
|
981
|
+
|
|
982
|
+
/**
|
|
983
|
+
* List Form Dialog
|
|
984
|
+
*/
|
|
985
|
+
export interface IListFormDialog extends IModal {
|
|
986
|
+
/** Method to save the form. */
|
|
987
|
+
saveForm: () => PromiseLike<Types.SP.ListItem>;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
/**
|
|
991
|
+
* List Form Dialog Properties
|
|
992
|
+
*/
|
|
993
|
+
export interface IListFormDialogProps extends Helper.IListFormProps {
|
|
994
|
+
/** The form actions. */
|
|
995
|
+
actions?: IToolbarProps;
|
|
996
|
+
|
|
997
|
+
/** Assigns the object to the input parameter. */
|
|
998
|
+
assignTo?: (obj: IListFormDialog) => void;
|
|
999
|
+
|
|
1000
|
+
/** The form control mode. */
|
|
1001
|
+
controlMode?: number;
|
|
1002
|
+
|
|
1003
|
+
/** The element to render the field to. */
|
|
1004
|
+
el: Element | HTMLElement;
|
|
1005
|
+
|
|
1006
|
+
/** The item. */
|
|
1007
|
+
item?: any;
|
|
1008
|
+
|
|
1009
|
+
/** The modal dialog properties. */
|
|
1010
|
+
modalProps?: IModalProps;
|
|
1011
|
+
|
|
1012
|
+
/** The control rendered event. */
|
|
1013
|
+
onControlRendered?: (control: IFormControl) => void | Promise<IFormControl>;
|
|
1014
|
+
|
|
1015
|
+
/** The control rendering event. */
|
|
1016
|
+
onControlRendering?: (control: IFormControlProps) => void | Promise<IFormControlProps>;
|
|
1017
|
+
|
|
1018
|
+
/** The form saving event. */
|
|
1019
|
+
onSaving?: (item: any) => void | PromiseLike<any>;
|
|
1020
|
+
|
|
1021
|
+
/** The form saved event. */
|
|
1022
|
+
onSaved?: (item?: Types.SP.ListItem) => void;
|
|
1023
|
+
|
|
1024
|
+
/** The list form rows. */
|
|
1025
|
+
template?: Array<IFormRow>;
|
|
1026
|
+
|
|
1027
|
+
/** True to display the modal by default. */
|
|
1028
|
+
visible?: boolean;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
declare module 'gd-sprest-bs/components/peoplePicker/types' {
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* ### People Picker
|
|
1036
|
+
*
|
|
1037
|
+
* ```ts
|
|
1038
|
+
* import { ContextInfo, Components } from "gd-sprest-bs";
|
|
1039
|
+
*
|
|
1040
|
+
* // Create the panel
|
|
1041
|
+
* let el = document.querySelector("#people-picker");
|
|
1042
|
+
* let form = Components.Form({
|
|
1043
|
+
* el: el,
|
|
1044
|
+
* rows: [
|
|
1045
|
+
* // Other controls go here
|
|
1046
|
+
* {
|
|
1047
|
+
* control: {
|
|
1048
|
+
* allowGroups: false,
|
|
1049
|
+
* label: "Select User:",
|
|
1050
|
+
* multi: true,
|
|
1051
|
+
* name: "User",
|
|
1052
|
+
* type: Components.FormControlTypes.PeoplePicker
|
|
1053
|
+
* value: ContextInfo.userId // Default to the current user
|
|
1054
|
+
* } as Components.IFormControlPropsPeoplePicker
|
|
1055
|
+
* }
|
|
1056
|
+
* ]
|
|
1057
|
+
* });
|
|
1058
|
+
* ```
|
|
1059
|
+
*/
|
|
1060
|
+
export const PeoplePicker: (props: IPeoplePickerProps) => IPeoplePicker;
|
|
1061
|
+
|
|
1062
|
+
import { IFormControlProps } from "gd-bs/src/components/form/controlTypes";
|
|
1063
|
+
import { Types } from "gd-sprest";
|
|
1064
|
+
|
|
1065
|
+
/**
|
|
1066
|
+
* People Picker
|
|
1067
|
+
*/
|
|
1068
|
+
export interface IPeoplePicker {
|
|
1069
|
+
/** The people picker element. */
|
|
1070
|
+
el: HTMLElement;
|
|
1071
|
+
|
|
1072
|
+
/** Returns the selected users. */
|
|
1073
|
+
getValue: () => Array<Types.SP.User | Types.SP.Group>;
|
|
1074
|
+
|
|
1075
|
+
/** Sets the selected users by id or people picker user object. */
|
|
1076
|
+
setValue: (selectedUsers: Array<string | number | Types.IPeoplePickerUser>) => void;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* People Picker Properties
|
|
1081
|
+
*/
|
|
1082
|
+
export interface IPeoplePickerProps {
|
|
1083
|
+
/** True, to include groups in the results. */
|
|
1084
|
+
allowGroups?: boolean;
|
|
1085
|
+
|
|
1086
|
+
/** Assigns the object to the input parameter. */
|
|
1087
|
+
assignTo?: (obj: IPeoplePicker) => void;
|
|
1088
|
+
|
|
1089
|
+
/** The class name to apply to the element. */
|
|
1090
|
+
className?: string;
|
|
1091
|
+
|
|
1092
|
+
/** The element to render the form to. */
|
|
1093
|
+
el?: Element;
|
|
1094
|
+
|
|
1095
|
+
/** The specific SharePoint group id to search within. */
|
|
1096
|
+
groupId?: number;
|
|
1097
|
+
|
|
1098
|
+
/** The label. */
|
|
1099
|
+
label?: string;
|
|
1100
|
+
|
|
1101
|
+
/** Limits the results to a maximum number. */
|
|
1102
|
+
maxResults?: number;
|
|
1103
|
+
|
|
1104
|
+
/** True to allow multiple users to be selected. */
|
|
1105
|
+
multi?: boolean;
|
|
1106
|
+
|
|
1107
|
+
/** The change event. */
|
|
1108
|
+
onChange?: (obj: Types.IPeoplePickerUser | Array<Types.IPeoplePickerUser>) => void;
|
|
1109
|
+
|
|
1110
|
+
/** The placeholder text. (Default value is "Search") */
|
|
1111
|
+
placeholder?: string;
|
|
1112
|
+
|
|
1113
|
+
/** True to allow multiple users to be selected. */
|
|
1114
|
+
readOnly?: boolean;
|
|
1115
|
+
|
|
1116
|
+
/** True to search the local users first. */
|
|
1117
|
+
searchLocal?: boolean;
|
|
1118
|
+
|
|
1119
|
+
/** The selected users. */
|
|
1120
|
+
value?: string | number | Types.IPeoplePickerUser | Array<string | number | Types.IPeoplePickerUser>;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
/**
|
|
1124
|
+
* Form Control Properties - People Picker
|
|
1125
|
+
*/
|
|
1126
|
+
export interface IFormControlPropsPeoplePicker extends IFormControlProps {
|
|
1127
|
+
allowGroups?: boolean;
|
|
1128
|
+
groupId?: number;
|
|
1129
|
+
maxResults?: number;
|
|
1130
|
+
multi?: boolean;
|
|
1131
|
+
placeholder?: string;
|
|
1132
|
+
searchLocal?: boolean;
|
|
1133
|
+
value?: string | number | Types.IPeoplePickerUser | Array<string | number | Types.IPeoplePickerUser>;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
|