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