@microsoft/sp-listview-extensibility 1.22.0-beta.2 → 1.22.0-beta.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 (44) hide show
  1. package/lib/commandSet/BaseListViewCommandSet.d.ts +82 -0
  2. package/lib/commandSet/BaseListViewCommandSet.d.ts.map +1 -0
  3. package/lib/commandSet/BaseListViewCommandSet.js +68 -0
  4. package/lib/commandSet/Command.d.ts +51 -0
  5. package/lib/commandSet/Command.d.ts.map +1 -0
  6. package/lib/commandSet/Command.js +18 -0
  7. package/lib/commandSet/ListViewCommandSetContext.d.ts +43 -0
  8. package/lib/commandSet/ListViewCommandSetContext.d.ts.map +1 -0
  9. package/lib/commandSet/ListViewCommandSetContext.js +84 -0
  10. package/lib/common/IListItem.d.ts +9 -0
  11. package/lib/common/IListItem.d.ts.map +1 -0
  12. package/lib/common/IListItem.js +2 -0
  13. package/lib/common/ListItemAccessor.d.ts +42 -0
  14. package/lib/common/ListItemAccessor.d.ts.map +1 -0
  15. package/lib/common/ListItemAccessor.js +25 -0
  16. package/lib/common/ListViewAccessor.d.ts +168 -0
  17. package/lib/common/ListViewAccessor.d.ts.map +1 -0
  18. package/lib/common/ListViewAccessor.js +146 -0
  19. package/lib/common/ListViewAccessorState.d.ts +207 -0
  20. package/lib/common/ListViewAccessorState.d.ts.map +1 -0
  21. package/lib/common/ListViewAccessorState.js +18 -0
  22. package/lib/fieldCustomizer/BaseFieldCustomizer.d.ts +51 -0
  23. package/lib/fieldCustomizer/BaseFieldCustomizer.d.ts.map +1 -0
  24. package/lib/fieldCustomizer/BaseFieldCustomizer.js +33 -0
  25. package/lib/fieldCustomizer/FieldCustomizerContext.d.ts +41 -0
  26. package/lib/fieldCustomizer/FieldCustomizerContext.d.ts.map +1 -0
  27. package/lib/fieldCustomizer/FieldCustomizerContext.js +45 -0
  28. package/lib/formCustomizer/BaseFormCustomizer.d.ts +102 -0
  29. package/lib/formCustomizer/BaseFormCustomizer.d.ts.map +1 -0
  30. package/lib/formCustomizer/BaseFormCustomizer.js +134 -0
  31. package/lib/formCustomizer/FormActionEventArgs.d.ts +23 -0
  32. package/lib/formCustomizer/FormActionEventArgs.d.ts.map +1 -0
  33. package/lib/formCustomizer/FormActionEventArgs.js +28 -0
  34. package/lib/formCustomizer/FormCustomizerContext.d.ts +95 -0
  35. package/lib/formCustomizer/FormCustomizerContext.d.ts.map +1 -0
  36. package/lib/formCustomizer/FormCustomizerContext.js +96 -0
  37. package/lib/formCustomizer/FormCustomizerHost.d.ts +42 -0
  38. package/lib/formCustomizer/FormCustomizerHost.d.ts.map +1 -0
  39. package/lib/formCustomizer/FormCustomizerHost.js +49 -0
  40. package/lib/index.d.ts +19 -0
  41. package/lib/index.d.ts.map +1 -0
  42. package/lib/index.js +18 -0
  43. package/lib/sp-listview-extensibility.manifest.json +9 -0
  44. package/package.json +6 -6
@@ -0,0 +1,146 @@
1
+ import { __extends } from "tslib";
2
+ import { SPEvent, SPEventArgs, _SPEventManager } from '@microsoft/sp-core-library';
3
+ import ListItemAccessor from './ListItemAccessor';
4
+ /**
5
+ * Provides access to a ListView column, which is the visual presentation
6
+ * of a field.
7
+ *
8
+ * @remarks
9
+ *
10
+ * A SharePoint "field" (SPField) defines the data storage for a property of a list item.
11
+ * (If the list item represents a document, then the field is sometimes called a "property".)
12
+ *
13
+ * A "column" is the visual presentation of a field, when displayed by the ListView.
14
+ *
15
+ * @public
16
+ */
17
+ var ColumnAccessor = /** @class */ (function () {
18
+ /** @internal */
19
+ function ColumnAccessor() {
20
+ // (mark constructor as internal)
21
+ }
22
+ return ColumnAccessor;
23
+ }());
24
+ export { ColumnAccessor };
25
+ /**
26
+ * Provides access to a ListView row, which is the visual presentation
27
+ * of a SharePoint list item.
28
+ *
29
+ * @remarks
30
+ *
31
+ * A SharePoint "list item" (SPListItem) is a data storage record in the content
32
+ * management system; it stores an array of values for the associated fields.
33
+ *
34
+ * A "row" is the visual presentation of a list item, when displayed by the ListView;
35
+ * it stores an array of cell values for the associated columns.
36
+ *
37
+ * @public
38
+ */
39
+ var RowAccessor = /** @class */ (function (_super) {
40
+ __extends(RowAccessor, _super);
41
+ /**
42
+ * @internal
43
+ */
44
+ function RowAccessor() {
45
+ return _super.call(this) || this;
46
+ }
47
+ return RowAccessor;
48
+ }(ListItemAccessor));
49
+ export { RowAccessor };
50
+ /**
51
+ * Arguments for the selected rows changed event.
52
+ *
53
+ * @public
54
+ */
55
+ var SelectedRowsChangedEventArgs = /** @class */ (function (_super) {
56
+ __extends(SelectedRowsChangedEventArgs, _super);
57
+ function SelectedRowsChangedEventArgs() {
58
+ return _super !== null && _super.apply(this, arguments) || this;
59
+ }
60
+ return SelectedRowsChangedEventArgs;
61
+ }(SPEventArgs));
62
+ export { SelectedRowsChangedEventArgs };
63
+ /**
64
+ * Arguments for the list view state changed event.
65
+ *
66
+ * @public
67
+ */
68
+ var ListViewStateChangedEventArgs = /** @class */ (function (_super) {
69
+ __extends(ListViewStateChangedEventArgs, _super);
70
+ function ListViewStateChangedEventArgs() {
71
+ return _super !== null && _super.apply(this, arguments) || this;
72
+ }
73
+ return ListViewStateChangedEventArgs;
74
+ }(SPEventArgs));
75
+ export { ListViewStateChangedEventArgs };
76
+ /**
77
+ * Provides access to a SharePoint ListView control.
78
+ *
79
+ * @public
80
+ */
81
+ var ListViewAccessor = /** @class */ (function () {
82
+ /**
83
+ * @internal
84
+ */
85
+ function ListViewAccessor(eventPrefix) {
86
+ this._isDisposed = false;
87
+ this._selectedRowsChangedEvent = new SPEvent(ListViewAccessor._selectedRowsChangedEventName);
88
+ this._listViewStateChangedEventName = "".concat(ListViewAccessor._listViewStateChangedEventName).concat(eventPrefix || '');
89
+ this._listViewStateChangedEvent = new SPEvent(this._listViewStateChangedEventName);
90
+ }
91
+ Object.defineProperty(ListViewAccessor.prototype, "selectedRowsChangedEvent", {
92
+ /**
93
+ * Event that gets raised every time the selected items in the list view change.
94
+ * @eventproperty
95
+ */
96
+ get: function () {
97
+ return this._selectedRowsChangedEvent;
98
+ },
99
+ enumerable: false,
100
+ configurable: true
101
+ });
102
+ Object.defineProperty(ListViewAccessor.prototype, "listViewStateChangedEvent", {
103
+ /**
104
+ * Event that gets raised every time the list view state changes.
105
+ *
106
+ * @eventproperty
107
+ */
108
+ get: function () {
109
+ return this._listViewStateChangedEvent;
110
+ },
111
+ enumerable: false,
112
+ configurable: true
113
+ });
114
+ /**
115
+ * @internal
116
+ */
117
+ ListViewAccessor.prototype.dispose = function () {
118
+ _SPEventManager.instance.removeEvent(this._listViewStateChangedEventName);
119
+ this._isDisposed = true;
120
+ };
121
+ Object.defineProperty(ListViewAccessor.prototype, "isDisposed", {
122
+ /**
123
+ * @internal
124
+ */
125
+ get: function () {
126
+ return this._isDisposed;
127
+ },
128
+ enumerable: false,
129
+ configurable: true
130
+ });
131
+ /**
132
+ * SPEvent name when the selected rows in a list have changed.
133
+ *
134
+ * @internal
135
+ */
136
+ ListViewAccessor._selectedRowsChangedEventName = 'listView.selectedRowsChanged';
137
+ /**
138
+ * SPEvent name when the list view state has changed.
139
+ *
140
+ * @internal
141
+ */
142
+ ListViewAccessor._listViewStateChangedEventName = 'listView.stateChanged';
143
+ return ListViewAccessor;
144
+ }());
145
+ export default ListViewAccessor;
146
+ //# sourceMappingURL=ListViewAccessor.js.map
@@ -0,0 +1,207 @@
1
+ import type { Guid } from '@microsoft/sp-core-library';
2
+ /**
3
+ * Describes the type of list view state changes.
4
+ *
5
+ * @public
6
+ */
7
+ export declare enum ListViewAccessorStateChanges {
8
+ None = 0,
9
+ List = 1,
10
+ View = 2,
11
+ Columns = 4,
12
+ SelectedRows = 8,
13
+ Rows = 16,
14
+ AppliedFilters = 32,
15
+ Sort = 64,
16
+ FolderInfo = 128
17
+ }
18
+ /**
19
+ * Provides information about the state of a column in the list view
20
+ *
21
+ * @public
22
+ */
23
+ export interface IColumn {
24
+ /**
25
+ * The GUID identifier for this field.
26
+ */
27
+ readonly id: Guid;
28
+ /**
29
+ * The internal name of the field. This name is usually used to find the field.
30
+ */
31
+ readonly internalName: string;
32
+ /**
33
+ * The type of the field represented as a string
34
+ */
35
+ readonly fieldType: string;
36
+ /**
37
+ * Whether the field is required for each list item in the list
38
+ */
39
+ readonly isRequired: boolean;
40
+ /**
41
+ * Whether the column is visible in the view
42
+ */
43
+ readonly isVisible: boolean;
44
+ /**
45
+ * The display name of the field. This name is shown as column name in UI.
46
+ */
47
+ readonly displayName: string;
48
+ /**
49
+ * The unique identifier of the client-side component associated with the field.
50
+ */
51
+ readonly clientSideComponentId: Guid | undefined;
52
+ /**
53
+ * This property is only used when a `ClientSideComponentId` is specified. It is optional.
54
+ *
55
+ * @remarks
56
+ * If non-empty, the string must contain a JSON object with custom initialization properties
57
+ * whose format and meaning are defined by the client-side component.
58
+ */
59
+ readonly clientSideComponentProperties: string;
60
+ }
61
+ /**
62
+ * Provides information about the list item's state rendered by the ListView.
63
+ *
64
+ * @public
65
+ */
66
+ export interface IRow {
67
+ /**
68
+ * A map of column values for the row. They key is the column internal name and the value
69
+ * is its corresponding value in the row.
70
+ */
71
+ readonly values: {
72
+ [columnInternalName: string]: Readonly<any>;
73
+ };
74
+ }
75
+ /**
76
+ * Provides information about the state of the filters applied to the ListView.
77
+ *
78
+ * @public
79
+ */
80
+ export interface IFilter {
81
+ /**
82
+ * Field name to filter on.
83
+ */
84
+ readonly fieldName: string;
85
+ /**
86
+ * Values to filter on.
87
+ */
88
+ values: ReadonlyArray<string>;
89
+ }
90
+ /**
91
+ * Provides information about the state of the folder in the ListView.
92
+ *
93
+ * @public
94
+ */
95
+ export interface IFolderInfo {
96
+ /**
97
+ * Folder path.
98
+ */
99
+ readonly folderPath: string;
100
+ }
101
+ /**
102
+ * Provides information about the list rendered by the ListView.
103
+ *
104
+ * @public
105
+ */
106
+ export interface IList {
107
+ /**
108
+ * List id.
109
+ */
110
+ readonly guid: Guid;
111
+ /**
112
+ * List title.
113
+ */
114
+ readonly title: string;
115
+ /**
116
+ * List server relative url.
117
+ */
118
+ readonly serverRelativeUrl: string;
119
+ }
120
+ /**
121
+ * Provides information about the view rendered by the ListView.
122
+ *
123
+ * @public
124
+ */
125
+ export interface IView {
126
+ /**
127
+ * View id.
128
+ */
129
+ readonly id: Guid;
130
+ /**
131
+ * View title.
132
+ */
133
+ readonly title: string;
134
+ /**
135
+ * View server relative url.
136
+ */
137
+ readonly url: string;
138
+ }
139
+ /**
140
+ * Provides information about the state of the ListView.
141
+ *
142
+ * @public
143
+ */
144
+ export interface IListViewAccessorState {
145
+ /**
146
+ * List information.
147
+ */
148
+ readonly list?: IList;
149
+ /**
150
+ * View information.
151
+ */
152
+ readonly view?: IView;
153
+ /**
154
+ * Current folder information.
155
+ */
156
+ readonly folderInfo?: IFolderInfo;
157
+ /**
158
+ * Columns information.
159
+ */
160
+ readonly columns: ReadonlyArray<IColumn>;
161
+ /**
162
+ * Selected rows information.
163
+ */
164
+ readonly selectedRows?: ReadonlyArray<IRow>;
165
+ /**
166
+ * Rows information.
167
+ */
168
+ readonly rows: ReadonlyArray<IRow>;
169
+ /**
170
+ * Applied filters information.
171
+ */
172
+ readonly appliedFilters?: {
173
+ [fieldName: string]: IFilter;
174
+ };
175
+ /**
176
+ * Sort field name.
177
+ */
178
+ readonly sortField?: string;
179
+ /**
180
+ * Sort direction.
181
+ */
182
+ readonly sortAscending?: boolean;
183
+ }
184
+ /**
185
+ * Provides information about the content type
186
+ *
187
+ * @public
188
+ */
189
+ export interface IContentType {
190
+ /**
191
+ * Content type string id
192
+ */
193
+ readonly id: string;
194
+ /**
195
+ * Content type name
196
+ */
197
+ readonly name: string;
198
+ /**
199
+ * Custom formatter JSON for the form
200
+ */
201
+ readonly ClientFormCustomFormatter: string | undefined;
202
+ /**
203
+ * Content type schema XML
204
+ */
205
+ readonly schemaXml: string | undefined;
206
+ }
207
+ //# sourceMappingURL=ListViewAccessorState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListViewAccessorState.d.ts","sourceRoot":"","s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IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,yBAAyB,EAAE,MAAM,GAAG,SAAS,CAAC;IACvD;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Describes the type of list view state changes.
3
+ *
4
+ * @public
5
+ */
6
+ export var ListViewAccessorStateChanges;
7
+ (function (ListViewAccessorStateChanges) {
8
+ ListViewAccessorStateChanges[ListViewAccessorStateChanges["None"] = 0] = "None";
9
+ ListViewAccessorStateChanges[ListViewAccessorStateChanges["List"] = 1] = "List";
10
+ ListViewAccessorStateChanges[ListViewAccessorStateChanges["View"] = 2] = "View";
11
+ ListViewAccessorStateChanges[ListViewAccessorStateChanges["Columns"] = 4] = "Columns";
12
+ ListViewAccessorStateChanges[ListViewAccessorStateChanges["SelectedRows"] = 8] = "SelectedRows";
13
+ ListViewAccessorStateChanges[ListViewAccessorStateChanges["Rows"] = 16] = "Rows";
14
+ ListViewAccessorStateChanges[ListViewAccessorStateChanges["AppliedFilters"] = 32] = "AppliedFilters";
15
+ ListViewAccessorStateChanges[ListViewAccessorStateChanges["Sort"] = 64] = "Sort";
16
+ ListViewAccessorStateChanges[ListViewAccessorStateChanges["FolderInfo"] = 128] = "FolderInfo";
17
+ })(ListViewAccessorStateChanges || (ListViewAccessorStateChanges = {}));
18
+ //# sourceMappingURL=ListViewAccessorState.js.map
@@ -0,0 +1,51 @@
1
+ import { BaseExtension } from '@microsoft/sp-extension-base';
2
+ import type FieldCustomizerContext from './FieldCustomizerContext';
3
+ import type ListItemAccessor from '../common/ListItemAccessor';
4
+ /**
5
+ * Event parameters for BaseFieldCustomizer.onRenderCell()
6
+ * @public
7
+ */
8
+ export interface IFieldCustomizerCellEventParameters {
9
+ /**
10
+ * The HTML "div" element that the extension will take ownership of.
11
+ * This ownership will end when onDisposeCell() is called.
12
+ */
13
+ readonly domElement: HTMLDivElement;
14
+ /**
15
+ * The list item being edited.
16
+ */
17
+ readonly listItem: ListItemAccessor;
18
+ /**
19
+ * The value of the field being rendered.
20
+ */
21
+ readonly fieldValue: any;
22
+ /**
23
+ * An implementation defined storage property.
24
+ *
25
+ * @remarks
26
+ * For example, suppose that resources need to be allocated during rendering
27
+ * (e.g. a renderer object, an HTTP request to be canceled, a cache slot, etc).
28
+ * The onRenderCell() implementation could store a key or handle in this property,
29
+ * and then onDisposeCell() can use this key to find the resource to be freed.
30
+ */
31
+ userData: any;
32
+ }
33
+ /**
34
+ * This is the base class that third parties should extend when implementing
35
+ * a client-side extension that customizes the appearance of fields in
36
+ * a SharePoint ListView.
37
+ *
38
+ * In the component manifest, the "extensionType" should be set to "FieldCustomizer".
39
+ *
40
+ * @public
41
+ */
42
+ declare abstract class BaseFieldCustomizer<TProperties> extends BaseExtension<TProperties> {
43
+ /**
44
+ * {@inheritDoc @microsoft/sp-component-base#BaseComponent.context}
45
+ */
46
+ protected readonly context: FieldCustomizerContext;
47
+ onRenderCell(event: IFieldCustomizerCellEventParameters): void;
48
+ onDisposeCell(event: IFieldCustomizerCellEventParameters): void;
49
+ }
50
+ export default BaseFieldCustomizer;
51
+ //# sourceMappingURL=BaseFieldCustomizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseFieldCustomizer.d.ts","sourceRoot":"","sources":["../../src/fieldCustomizer/BaseFieldCustomizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,sBAAsB,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,gBAAgB,MAAM,4BAA4B,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,mCAAmC;IAClD;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IAEpC;;OAEG;IAEH,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC;IAEzB;;;;;;;;OAQG;IAEH,QAAQ,EAAE,GAAG,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,uBAAe,mBAAmB,CAAC,WAAW,CAAE,SAAQ,aAAa,CAAC,WAAW,CAAC;IAChF;;OAEG;IAEH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAG,sBAAsB,CAAC;IAK7C,YAAY,CAAC,KAAK,EAAE,mCAAmC,GAAG,IAAI;IAQ9D,aAAa,CAAC,KAAK,EAAE,mCAAmC,GAAG,IAAI;CAGvE;AAED,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { __extends } from "tslib";
2
+ import { BaseExtension } from '@microsoft/sp-extension-base';
3
+ /**
4
+ * This is the base class that third parties should extend when implementing
5
+ * a client-side extension that customizes the appearance of fields in
6
+ * a SharePoint ListView.
7
+ *
8
+ * In the component manifest, the "extensionType" should be set to "FieldCustomizer".
9
+ *
10
+ * @public
11
+ */
12
+ var BaseFieldCustomizer = /** @class */ (function (_super) {
13
+ __extends(BaseFieldCustomizer, _super);
14
+ function BaseFieldCustomizer() {
15
+ return _super !== null && _super.apply(this, arguments) || this;
16
+ }
17
+ /*
18
+ * virtual
19
+ */
20
+ BaseFieldCustomizer.prototype.onRenderCell = function (event) {
21
+ var text = "".concat(event.fieldValue);
22
+ event.fieldValue.innerText = text;
23
+ };
24
+ /*
25
+ * virtual
26
+ */
27
+ BaseFieldCustomizer.prototype.onDisposeCell = function (event) {
28
+ // (implemented by child class)
29
+ };
30
+ return BaseFieldCustomizer;
31
+ }(BaseExtension));
32
+ export default BaseFieldCustomizer;
33
+ //# sourceMappingURL=BaseFieldCustomizer.js.map
@@ -0,0 +1,41 @@
1
+ import type { SPField } from '@microsoft/sp-page-context';
2
+ import { ExtensionContext, type _IExtensionContextParameters } from '@microsoft/sp-extension-base';
3
+ import type ListViewAccessor from '../common/ListViewAccessor';
4
+ /**
5
+ * Constructor parameters for FieldCustomizerContext.
6
+ *
7
+ * @internal
8
+ */
9
+ export interface IFieldCustomizerContextParameters {
10
+ readonly listView: ListViewAccessor | undefined;
11
+ readonly field: SPField;
12
+ }
13
+ /**
14
+ * This object provides contextual information for BaseFieldCustomizer.
15
+ * @public
16
+ */
17
+ export default class FieldCustomizerContext extends ExtensionContext {
18
+ private _listView;
19
+ private _field;
20
+ /**
21
+ * @internal
22
+ */
23
+ constructor(extensionContextParameters: _IExtensionContextParameters, fieldCustomizerContextParameters: IFieldCustomizerContextParameters);
24
+ /**
25
+ * If the field customizer is bounded to the SharePoint list view, this provides access
26
+ * to the list view specific functionality; otherwise the value is undefined.
27
+ *
28
+ * @remarks
29
+ * Although the SharePoint list view is the main usage scenario, field customizers
30
+ * can be used by other user interface surfaces. For example, in the future SharePoint
31
+ * may support field customizers on a display/edit form.
32
+ *
33
+ * @returns the SharePoint list view, or undefined if there is none.
34
+ */
35
+ tryGetListView(): ListViewAccessor | undefined;
36
+ /**
37
+ * Provides access to the SharePoint field that the customizer will operate on.
38
+ */
39
+ get field(): SPField;
40
+ }
41
+ //# sourceMappingURL=FieldCustomizerContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldCustomizerContext.d.ts","sourceRoot":"","sources":["../../src/fieldCustomizer/FieldCustomizerContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,KAAK,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAEnG,OAAO,KAAK,gBAAgB,MAAM,4BAA4B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,gBAAgB;IAClE,OAAO,CAAC,SAAS,CAA+B;IAChD,OAAO,CAAC,MAAM,CAAU;IAExB;;OAEG;gBAED,0BAA0B,EAAE,4BAA4B,EACxD,gCAAgC,EAAE,iCAAiC;IAQrE;;;;;;;;;;OAUG;IACI,cAAc,IAAI,gBAAgB,GAAG,SAAS;IAIrD;;OAEG;IACH,IAAW,KAAK,IAAI,OAAO,CAE1B;CACF"}
@@ -0,0 +1,45 @@
1
+ import { __extends } from "tslib";
2
+ import { ExtensionContext } from '@microsoft/sp-extension-base';
3
+ /**
4
+ * This object provides contextual information for BaseFieldCustomizer.
5
+ * @public
6
+ */
7
+ var FieldCustomizerContext = /** @class */ (function (_super) {
8
+ __extends(FieldCustomizerContext, _super);
9
+ /**
10
+ * @internal
11
+ */
12
+ function FieldCustomizerContext(extensionContextParameters, fieldCustomizerContextParameters) {
13
+ var _this = _super.call(this, extensionContextParameters) || this;
14
+ _this._listView = fieldCustomizerContextParameters.listView;
15
+ _this._field = fieldCustomizerContextParameters.field;
16
+ return _this;
17
+ }
18
+ /**
19
+ * If the field customizer is bounded to the SharePoint list view, this provides access
20
+ * to the list view specific functionality; otherwise the value is undefined.
21
+ *
22
+ * @remarks
23
+ * Although the SharePoint list view is the main usage scenario, field customizers
24
+ * can be used by other user interface surfaces. For example, in the future SharePoint
25
+ * may support field customizers on a display/edit form.
26
+ *
27
+ * @returns the SharePoint list view, or undefined if there is none.
28
+ */
29
+ FieldCustomizerContext.prototype.tryGetListView = function () {
30
+ return this._listView;
31
+ };
32
+ Object.defineProperty(FieldCustomizerContext.prototype, "field", {
33
+ /**
34
+ * Provides access to the SharePoint field that the customizer will operate on.
35
+ */
36
+ get: function () {
37
+ return this._field;
38
+ },
39
+ enumerable: false,
40
+ configurable: true
41
+ });
42
+ return FieldCustomizerContext;
43
+ }(ExtensionContext));
44
+ export default FieldCustomizerContext;
45
+ //# sourceMappingURL=FieldCustomizerContext.js.map
@@ -0,0 +1,102 @@
1
+ import { BaseExtension, type ExtensionContext, type _IAdditionalInitParameters } from '@microsoft/sp-extension-base';
2
+ import { type FormDisplayMode, SPEvent } from '@microsoft/sp-core-library';
3
+ import type FormCustomizerContext from './FormCustomizerContext';
4
+ import { FormActionEventArgs } from './FormActionEventArgs';
5
+ /**
6
+ * @internal
7
+ */
8
+ export interface IFormCustomizerAdditionalInitParameters extends _IAdditionalInitParameters {
9
+ displayMode: FormDisplayMode;
10
+ }
11
+ /**
12
+ * This is the base class that third parties should extend when implementing
13
+ * a client-side extension that provides a custom list form (display, new, edit) for a SharePoint list.
14
+ * @public
15
+ */
16
+ declare abstract class BaseFormCustomizer<TProperties> extends BaseExtension<TProperties> {
17
+ /**
18
+ * SPEvent name when the form action should be performed.
19
+ *
20
+ * @internal
21
+ */
22
+ static _formActionEventName: string;
23
+ /**
24
+ * {@inheritDoc @microsoft/sp-extension-base#BaseExtension.context}
25
+ */
26
+ readonly context: FormCustomizerContext;
27
+ private readonly _formActionEvent;
28
+ private _displayMode;
29
+ /**
30
+ * This property is a pointer to the root DOM element of the form. This is a DIV element and contains the whole
31
+ * DOM subtree of the form.
32
+ *
33
+ * @readonly
34
+ */
35
+ protected get domElement(): HTMLElement;
36
+ /**
37
+ * Display mode of the form: Edit, Display or New.
38
+ *
39
+ * @readonly
40
+ */
41
+ protected get displayMode(): FormDisplayMode;
42
+ /**
43
+ * Event that gets raised every time the selected items in the list view change.
44
+ * Reserved for the future.
45
+ *
46
+ * @eventproperty
47
+ * @internal
48
+ */
49
+ get formActionEvent(): SPEvent<FormActionEventArgs>;
50
+ /**
51
+ * @internal
52
+ */
53
+ _init(context: ExtensionContext, propertiesJson: string | undefined, additionalInitParameters: IFormCustomizerAdditionalInitParameters | undefined): Promise<void>;
54
+ /**
55
+ * @internal
56
+ */
57
+ _internalRender(): void;
58
+ /**
59
+ * Internal API to set form's display mode.
60
+ * @internal
61
+ */
62
+ _internalSetDisplayMode(newDisplayMode: FormDisplayMode): void;
63
+ /**
64
+ * Use this method to initiate saving of the form.
65
+ *
66
+ * @internal
67
+ */
68
+ _save(): void;
69
+ /**
70
+ * Use this method to initiate closing/cancelling of the form.
71
+ *
72
+ * @internal
73
+ */
74
+ _close(): void;
75
+ /**
76
+ * Disposes the component.
77
+ *
78
+ * @remarks
79
+ * Please, do not override this method.
80
+ * Override the `onDispose` method instead.
81
+ */
82
+ dispose(): void;
83
+ /**
84
+ * @internal
85
+ */
86
+ protected _initializeExtensionType(): void;
87
+ /**
88
+ * This API is called to render the form. There is no base implementation of this API and the form is
89
+ * required to override this API.
90
+ */
91
+ protected abstract render(): void;
92
+ /**
93
+ * Call this method after the form has been saved to inform the application that the form has been saved.
94
+ */
95
+ protected formSaved(): void;
96
+ /**
97
+ * Call this method after the form has been closed/cancelled to inform the application that the form has been closed.
98
+ */
99
+ protected formClosed(): void;
100
+ }
101
+ export default BaseFormCustomizer;
102
+ //# sourceMappingURL=BaseFormCustomizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseFormCustomizer.d.ts","sourceRoot":"","sources":["../../src/formCustomizer/BaseFormCustomizer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAChC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,eAAe,EAAE,OAAO,EAAmB,MAAM,4BAA4B,CAAC;AAC5F,OAAO,KAAK,qBAAqB,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAc,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,uCAAwC,SAAQ,0BAA0B;IACzF,WAAW,EAAE,eAAe,CAAC;CAC9B;AAED;;;;GAIG;AACH,uBAAe,kBAAkB,CAAC,WAAW,CAAE,SAAQ,aAAa,CAAC,WAAW,CAAC;IAC/E;;;;OAIG;IACH,OAAc,oBAAoB,EAAE,MAAM,CAA+B;IAEzE;;OAEG;IAEH,SAAgB,OAAO,EAAG,qBAAqB,CAAC;IAEhD,OAAO,CAAC,QAAQ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