@microsoft/sp-listview-extensibility 1.14.0 → 1.15.0-beta.1

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.
@@ -2,7 +2,7 @@
2
2
  "id": "d37b65ee-c7d8-4570-bc74-2b294ff3b380",
3
3
  "alias": "SPListViewExtensibility",
4
4
  "componentType": "Library",
5
- "version": "1.14.0",
5
+ "version": "1.15.0",
6
6
  "manifestVersion": 2,
7
7
  "loaderConfig": {
8
8
  "internalModuleBaseUrls": [
@@ -12,7 +12,7 @@
12
12
  "scriptResources": {
13
13
  "sp-listview-extensibility": {
14
14
  "type": "path",
15
- "path": "sp-listview-extensibility_none_a53ef3010444ac520245.js"
15
+ "path": "sp-listview-extensibility_none_356e5e10e07fd2101e9c.js"
16
16
  },
17
17
  "tslib": {
18
18
  "type": "component",
@@ -22,17 +22,17 @@
22
22
  "@microsoft/sp-core-library": {
23
23
  "type": "component",
24
24
  "id": "7263c7d0-1d6a-45ec-8d85-d4d1d234171b",
25
- "version": "1.14.0"
25
+ "version": "1.15.0"
26
26
  },
27
27
  "@microsoft/sp-page-context": {
28
28
  "type": "component",
29
29
  "id": "1c4541f7-5c31-41aa-9fa8-fbc9dc14c0a8",
30
- "version": "1.14.0"
30
+ "version": "1.15.0"
31
31
  },
32
32
  "@microsoft/sp-extension-base": {
33
33
  "type": "component",
34
34
  "id": "0773bd53-a69e-4293-87e6-ba80ea4d614b",
35
- "version": "1.14.0"
35
+ "version": "1.15.0"
36
36
  }
37
37
  }
38
38
  }
@@ -6,6 +6,7 @@
6
6
 
7
7
  import { BaseExtension } from '@microsoft/sp-extension-base';
8
8
  import { ExtensionContext } from '@microsoft/sp-extension-base';
9
+ import { FormDisplayMode } from '@microsoft/sp-core-library';
9
10
  import { Guid } from '@microsoft/sp-core-library';
10
11
  import { ICommandSetExtensionManifest } from '@microsoft/sp-module-interfaces';
11
12
  import { IDisposable } from '@microsoft/sp-core-library';
@@ -31,6 +32,51 @@ export declare abstract class BaseFieldCustomizer<TProperties> extends BaseExten
31
32
  onDisposeCell(event: IFieldCustomizerCellEventParameters): void;
32
33
  }
33
34
 
35
+ /**
36
+ * @public
37
+ */
38
+ export declare abstract class BaseFormCustomizer<TProperties> extends BaseExtension<TProperties> {
39
+ /**
40
+ * {@inheritDoc @microsoft/sp-extension-base#BaseExtension.context}
41
+ */
42
+ readonly context: FormCustomizerContext;
43
+ private _displayMode;
44
+ /**
45
+ * This property is a pointer to the root DOM element of the form. This is a DIV element and contains the whole
46
+ * DOM subtree of the form.
47
+ *
48
+ * @readonly
49
+ */
50
+ protected get domElement(): HTMLElement;
51
+ /**
52
+ * @readonly
53
+ */
54
+ protected get displayMode(): FormDisplayMode;
55
+ /**
56
+ * This API is called to render the form. There is no base implementation of this API and the form is
57
+ * required to override this API.
58
+ */
59
+ protected abstract render(): void;
60
+ /**
61
+ * Use this method to implement save logic for the form.
62
+ * formSaved should be called at the end of the method.
63
+ */
64
+ protected abstract onSave(): void;
65
+ /**
66
+ * Use this method to implement cancel logic for the form.
67
+ * formClosed should be called at the end of the method.
68
+ */
69
+ protected abstract onClose(): void;
70
+ /**
71
+ * Call this method after the form has been saved to inform the application that the form has been saved.
72
+ */
73
+ protected formSaved(): void;
74
+ /**
75
+ * Call this method after the form has been closed/cancelled to inform the application that the form has been closed.
76
+ */
77
+ protected formClosed(): void;
78
+ }
79
+
34
80
  /**
35
81
  * This is the base class that third parties should extend when implementing
36
82
  * a client-side extension that provides a command set for a SharePoint list view.
@@ -111,9 +157,9 @@ export declare abstract class ColumnAccessor {
111
157
  *
112
158
  * @remarks
113
159
  * The BaseListViewCommandSet extension type exposes generalized commands that may be displayed as tool bar buttons,
114
- * context menu items, etc. These commands are initially defined in the extensions manifest file. At runtime, the
160
+ * context menu items, etc. These commands are initially defined in the extension's manifest file. At runtime, the
115
161
  * corresponding Command object can be obtained by calling {@link BaseListViewCommandSet.tryGetCommand}.
116
- * The commands appearance can be customized by assigning its properties, for example to hide a command that is not
162
+ * The command's appearance can be customized by assigning its properties, for example to hide a command that is not
117
163
  * contextually relevant, or to pluralize the title based on the number of selected items.
118
164
  * @public
119
165
  */
@@ -183,6 +229,23 @@ export declare class FieldCustomizerContext extends ExtensionContext {
183
229
  get field(): SPField;
184
230
  }
185
231
 
232
+ /**
233
+ * @public
234
+ */
235
+ export declare class FormCustomizerContext extends ExtensionContext implements IFormCustomizerContext {
236
+ private _list;
237
+ private _contentTypes;
238
+ private _folderInfo;
239
+ private _itemIds;
240
+ private _domElement;
241
+ constructor(extensionContextParameters: _IExtensionContextParameters, formCustomizerContextParameters: _IFormCustomizerContextParameters);
242
+ get list(): IList;
243
+ get contentTypes(): IContentType[];
244
+ get folderInfo(): IFolderInfo | undefined;
245
+ get itemIds(): number[] | undefined;
246
+ get domElement(): HTMLElement;
247
+ }
248
+
186
249
  /**
187
250
  * Provides information about the state of a column in the list view
188
251
  *
@@ -227,6 +290,16 @@ export declare interface IColumn {
227
290
  readonly clientSideComponentProperties: string;
228
291
  }
229
292
 
293
+ /**
294
+ * Provides information about the content type
295
+ *
296
+ * @public
297
+ */
298
+ export declare interface IContentType {
299
+ readonly id: string;
300
+ readonly name: string;
301
+ }
302
+
230
303
  /* Excluded from this release type: _IExtensionContextParameters */
231
304
 
232
305
  /**
@@ -289,6 +362,19 @@ export declare interface IFolderInfo {
289
362
  readonly folderPath: string;
290
363
  }
291
364
 
365
+ /**
366
+ * @public
367
+ */
368
+ export declare interface IFormCustomizerContext {
369
+ readonly list: IList;
370
+ readonly contentTypes: IContentType[];
371
+ readonly folderInfo?: IFolderInfo;
372
+ readonly itemIds?: number[];
373
+ readonly domElement: HTMLElement;
374
+ }
375
+
376
+ /* Excluded from this release type: _IFormCustomizerContextParameters */
377
+
292
378
  /**
293
379
  * Provides information about the list rendered by the ListView.
294
380
  *
@@ -6,6 +6,7 @@
6
6
 
7
7
  import { BaseExtension } from '@microsoft/sp-extension-base';
8
8
  import { ExtensionContext } from '@microsoft/sp-extension-base';
9
+ import { FormDisplayMode } from '@microsoft/sp-core-library';
9
10
  import { Guid } from '@microsoft/sp-core-library';
10
11
  import { ICommandSetExtensionManifest } from '@microsoft/sp-module-interfaces';
11
12
  import { IDisposable } from '@microsoft/sp-core-library';
@@ -31,6 +32,51 @@ export declare abstract class BaseFieldCustomizer<TProperties> extends BaseExten
31
32
  onDisposeCell(event: IFieldCustomizerCellEventParameters): void;
32
33
  }
33
34
 
35
+ /**
36
+ * @public
37
+ */
38
+ export declare abstract class BaseFormCustomizer<TProperties> extends BaseExtension<TProperties> {
39
+ /**
40
+ * {@inheritDoc @microsoft/sp-extension-base#BaseExtension.context}
41
+ */
42
+ readonly context: FormCustomizerContext;
43
+ private _displayMode;
44
+ /**
45
+ * This property is a pointer to the root DOM element of the form. This is a DIV element and contains the whole
46
+ * DOM subtree of the form.
47
+ *
48
+ * @readonly
49
+ */
50
+ protected get domElement(): HTMLElement;
51
+ /**
52
+ * @readonly
53
+ */
54
+ protected get displayMode(): FormDisplayMode;
55
+ /**
56
+ * This API is called to render the form. There is no base implementation of this API and the form is
57
+ * required to override this API.
58
+ */
59
+ protected abstract render(): void;
60
+ /**
61
+ * Use this method to implement save logic for the form.
62
+ * formSaved should be called at the end of the method.
63
+ */
64
+ protected abstract onSave(): void;
65
+ /**
66
+ * Use this method to implement cancel logic for the form.
67
+ * formClosed should be called at the end of the method.
68
+ */
69
+ protected abstract onClose(): void;
70
+ /**
71
+ * Call this method after the form has been saved to inform the application that the form has been saved.
72
+ */
73
+ protected formSaved(): void;
74
+ /**
75
+ * Call this method after the form has been closed/cancelled to inform the application that the form has been closed.
76
+ */
77
+ protected formClosed(): void;
78
+ }
79
+
34
80
  /**
35
81
  * This is the base class that third parties should extend when implementing
36
82
  * a client-side extension that provides a command set for a SharePoint list view.
@@ -111,9 +157,9 @@ export declare abstract class ColumnAccessor {
111
157
  *
112
158
  * @remarks
113
159
  * The BaseListViewCommandSet extension type exposes generalized commands that may be displayed as tool bar buttons,
114
- * context menu items, etc. These commands are initially defined in the extensions manifest file. At runtime, the
160
+ * context menu items, etc. These commands are initially defined in the extension's manifest file. At runtime, the
115
161
  * corresponding Command object can be obtained by calling {@link BaseListViewCommandSet.tryGetCommand}.
116
- * The commands appearance can be customized by assigning its properties, for example to hide a command that is not
162
+ * The command's appearance can be customized by assigning its properties, for example to hide a command that is not
117
163
  * contextually relevant, or to pluralize the title based on the number of selected items.
118
164
  * @public
119
165
  */
@@ -183,6 +229,23 @@ export declare class FieldCustomizerContext extends ExtensionContext {
183
229
  get field(): SPField;
184
230
  }
185
231
 
232
+ /**
233
+ * @public
234
+ */
235
+ export declare class FormCustomizerContext extends ExtensionContext implements IFormCustomizerContext {
236
+ private _list;
237
+ private _contentTypes;
238
+ private _folderInfo;
239
+ private _itemIds;
240
+ private _domElement;
241
+ constructor(extensionContextParameters: _IExtensionContextParameters, formCustomizerContextParameters: _IFormCustomizerContextParameters);
242
+ get list(): IList;
243
+ get contentTypes(): IContentType[];
244
+ get folderInfo(): IFolderInfo | undefined;
245
+ get itemIds(): number[] | undefined;
246
+ get domElement(): HTMLElement;
247
+ }
248
+
186
249
  /**
187
250
  * Provides information about the state of a column in the list view
188
251
  *
@@ -227,6 +290,16 @@ export declare interface IColumn {
227
290
  readonly clientSideComponentProperties: string;
228
291
  }
229
292
 
293
+ /**
294
+ * Provides information about the content type
295
+ *
296
+ * @public
297
+ */
298
+ export declare interface IContentType {
299
+ readonly id: string;
300
+ readonly name: string;
301
+ }
302
+
230
303
  /* Excluded from this release type: _IExtensionContextParameters */
231
304
 
232
305
  /**
@@ -289,6 +362,19 @@ export declare interface IFolderInfo {
289
362
  readonly folderPath: string;
290
363
  }
291
364
 
365
+ /**
366
+ * @public
367
+ */
368
+ export declare interface IFormCustomizerContext {
369
+ readonly list: IList;
370
+ readonly contentTypes: IContentType[];
371
+ readonly folderInfo?: IFolderInfo;
372
+ readonly itemIds?: number[];
373
+ readonly domElement: HTMLElement;
374
+ }
375
+
376
+ /* Excluded from this release type: _IFormCustomizerContextParameters */
377
+
292
378
  /**
293
379
  * Provides information about the list rendered by the ListView.
294
380
  *
@@ -6,6 +6,7 @@
6
6
 
7
7
  import { BaseExtension } from '@microsoft/sp-extension-base';
8
8
  import { ExtensionContext } from '@microsoft/sp-extension-base';
9
+ import { FormDisplayMode } from '@microsoft/sp-core-library';
9
10
  import { Guid } from '@microsoft/sp-core-library';
10
11
  import { ICommandSetExtensionManifest } from '@microsoft/sp-module-interfaces';
11
12
  import { IDisposable } from '@microsoft/sp-core-library';
@@ -31,6 +32,51 @@ export declare abstract class BaseFieldCustomizer<TProperties> extends BaseExten
31
32
  onDisposeCell(event: IFieldCustomizerCellEventParameters): void;
32
33
  }
33
34
 
35
+ /**
36
+ * @public
37
+ */
38
+ export declare abstract class BaseFormCustomizer<TProperties> extends BaseExtension<TProperties> {
39
+ /**
40
+ * {@inheritDoc @microsoft/sp-extension-base#BaseExtension.context}
41
+ */
42
+ readonly context: FormCustomizerContext;
43
+ private _displayMode;
44
+ /**
45
+ * This property is a pointer to the root DOM element of the form. This is a DIV element and contains the whole
46
+ * DOM subtree of the form.
47
+ *
48
+ * @readonly
49
+ */
50
+ protected get domElement(): HTMLElement;
51
+ /**
52
+ * @readonly
53
+ */
54
+ protected get displayMode(): FormDisplayMode;
55
+ /**
56
+ * This API is called to render the form. There is no base implementation of this API and the form is
57
+ * required to override this API.
58
+ */
59
+ protected abstract render(): void;
60
+ /**
61
+ * Use this method to implement save logic for the form.
62
+ * formSaved should be called at the end of the method.
63
+ */
64
+ protected abstract onSave(): void;
65
+ /**
66
+ * Use this method to implement cancel logic for the form.
67
+ * formClosed should be called at the end of the method.
68
+ */
69
+ protected abstract onClose(): void;
70
+ /**
71
+ * Call this method after the form has been saved to inform the application that the form has been saved.
72
+ */
73
+ protected formSaved(): void;
74
+ /**
75
+ * Call this method after the form has been closed/cancelled to inform the application that the form has been closed.
76
+ */
77
+ protected formClosed(): void;
78
+ }
79
+
34
80
  /**
35
81
  * This is the base class that third parties should extend when implementing
36
82
  * a client-side extension that provides a command set for a SharePoint list view.
@@ -111,9 +157,9 @@ export declare abstract class ColumnAccessor {
111
157
  *
112
158
  * @remarks
113
159
  * The BaseListViewCommandSet extension type exposes generalized commands that may be displayed as tool bar buttons,
114
- * context menu items, etc. These commands are initially defined in the extensions manifest file. At runtime, the
160
+ * context menu items, etc. These commands are initially defined in the extension's manifest file. At runtime, the
115
161
  * corresponding Command object can be obtained by calling {@link BaseListViewCommandSet.tryGetCommand}.
116
- * The commands appearance can be customized by assigning its properties, for example to hide a command that is not
162
+ * The command's appearance can be customized by assigning its properties, for example to hide a command that is not
117
163
  * contextually relevant, or to pluralize the title based on the number of selected items.
118
164
  * @public
119
165
  */
@@ -183,6 +229,23 @@ export declare class FieldCustomizerContext extends ExtensionContext {
183
229
  get field(): SPField;
184
230
  }
185
231
 
232
+ /**
233
+ * @public
234
+ */
235
+ export declare class FormCustomizerContext extends ExtensionContext implements IFormCustomizerContext {
236
+ private _list;
237
+ private _contentTypes;
238
+ private _folderInfo;
239
+ private _itemIds;
240
+ private _domElement;
241
+ constructor(extensionContextParameters: _IExtensionContextParameters, formCustomizerContextParameters: _IFormCustomizerContextParameters);
242
+ get list(): IList;
243
+ get contentTypes(): IContentType[];
244
+ get folderInfo(): IFolderInfo | undefined;
245
+ get itemIds(): number[] | undefined;
246
+ get domElement(): HTMLElement;
247
+ }
248
+
186
249
  /**
187
250
  * Provides information about the state of a column in the list view
188
251
  *
@@ -227,6 +290,16 @@ export declare interface IColumn {
227
290
  readonly clientSideComponentProperties: string;
228
291
  }
229
292
 
293
+ /**
294
+ * Provides information about the content type
295
+ *
296
+ * @public
297
+ */
298
+ export declare interface IContentType {
299
+ readonly id: string;
300
+ readonly name: string;
301
+ }
302
+
230
303
  /* Excluded from this release type: _IExtensionContextParameters */
231
304
 
232
305
  /**
@@ -289,6 +362,19 @@ export declare interface IFolderInfo {
289
362
  readonly folderPath: string;
290
363
  }
291
364
 
365
+ /**
366
+ * @public
367
+ */
368
+ export declare interface IFormCustomizerContext {
369
+ readonly list: IList;
370
+ readonly contentTypes: IContentType[];
371
+ readonly folderInfo?: IFolderInfo;
372
+ readonly itemIds?: number[];
373
+ readonly domElement: HTMLElement;
374
+ }
375
+
376
+ /* Excluded from this release type: _IFormCustomizerContextParameters */
377
+
292
378
  /**
293
379
  * Provides information about the list rendered by the ListView.
294
380
  *
@@ -0,0 +1 @@
1
+ define("d37b65ee-c7d8-4570-bc74-2b294ff3b380_1.15.0",["tslib","@microsoft/sp-core-library","@microsoft/sp-page-context","@microsoft/sp-extension-base"],function(n,a,i,r){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="mwqp")}({"17wl":function(e,t){e.exports=n},UWqr:function(e,t){e.exports=a},"X+PM":function(e,t){e.exports=i},ZFc5:function(e,t){e.exports=r},mwqp:function(e,t,n){"use strict";n.r(t),n.d(t,"BaseListViewCommandSet",function(){return s}),n.d(t,"Command",function(){return c}),n.d(t,"ListViewCommandSetContext",function(){return l}),n.d(t,"BaseFieldCustomizer",function(){return f}),n.d(t,"FieldCustomizerContext",function(){return p}),n.d(t,"BaseFormCustomizer",function(){return _}),n.d(t,"FormCustomizerContext",function(){return h}),n.d(t,"ListItemAccessor",function(){return b}),n.d(t,"ColumnAccessor",function(){return g}),n.d(t,"RowAccessor",function(){return v}),n.d(t,"SelectedRowsChangedEventArgs",function(){return y}),n.d(t,"ListViewStateChangedEventArgs",function(){return S}),n.d(t,"ListViewAccessor",function(){return D}),n.d(t,"ListViewAccessorStateChanges",function(){return a});var a,i=n("17wl"),r=n("UWqr"),o=n("ZFc5"),s=function(e){function t(){var t=e.call(this)||this;return t._raiseOnChange=void 0,t}return Object(i.__extends)(t,e),t.prototype.tryGetCommand=function(e){return r.Validate.isNonemptyString(e,"id"),this.context._commands.filter(function(t){return t.id===e})[0]},t.prototype.onListViewUpdated=function(e){},t.prototype.onExecute=function(e){},t.prototype.raiseOnChange=function(){this._raiseOnChange&&this._raiseOnChange()},t}(o.BaseExtension),c=function(){},d=n("X+PM"),l=function(e){function t(t,n){var a=e.call(this,t)||this;a._listView=n.listView,a._commandArray=[];for(var i=a.manifest.items,o=0,s=Object.keys(i);o<s.length;o++){var c=s[o];if("command"===i[c].type){var l=i[c].iconImageUrl;l&&!r.UrlUtilities.isDataUrl(l)&&(l=r.UrlUtilities.resolve(l,a.manifest.loaderConfig.internalModuleBaseUrls[0])),a._commandArray.push({id:c,title:i[c].title.default||"",ariaLabel:i[c].ariaLabel?i[c].ariaLabel.default:void 0,iconImageUrl:l,visible:!0,disabled:void 0})}}return a._commandArray.length&&a.serviceScope.whenFinished(function(){var e=a.serviceScope.consume(d.PageContext.serviceKey).cultureInfo.currentUICultureName;a._commandArray.forEach(function(t){var n=i[t.id];t.title=r.Text._getLocalizedString(n.title,e)||"",n.ariaLabel&&(t.ariaLabel=r.Text._getLocalizedString(n.ariaLabel,e))})}),a}return Object(i.__extends)(t,e),Object.defineProperty(t.prototype,"listView",{get:function(){return this._listView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_commands",{get:function(){return this._commandArray},enumerable:!1,configurable:!0}),t}(o.ExtensionContext),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),t.prototype.onRenderCell=function(e){var t=""+e.fieldValue;e.fieldValue.innerText=t},t.prototype.onDisposeCell=function(e){},t}(o.BaseExtension),f=u,p=function(e){function t(t,n){var a=e.call(this,t)||this;return a._listView=n.listView,a._field=n.field,a}return Object(i.__extends)(t,e),t.prototype.tryGetListView=function(){return this._listView},Object.defineProperty(t.prototype,"field",{get:function(){return this._field},enumerable:!1,configurable:!0}),t}(o.ExtensionContext),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),Object.defineProperty(t.prototype,"domElement",{get:function(){return this.context.domElement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayMode",{get:function(){return this._displayMode},enumerable:!1,configurable:!0}),t.prototype.formSaved=function(){},t.prototype.formClosed=function(){},t}(o.BaseExtension),_=m,h=function(e){function t(t,n){var a=e.call(this,t)||this;return a._list=n.list,a._contentTypes=n.contentTypes,a._folderInfo=n.folderInfo,a._itemIds=n.itemIds,a._domElement=n.domElement,a}return Object(i.__extends)(t,e),Object.defineProperty(t.prototype,"list",{get:function(){return this._list},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentTypes",{get:function(){return this._contentTypes},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"folderInfo",{get:function(){return this._folderInfo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"itemIds",{get:function(){return this._itemIds},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"domElement",{get:function(){return this._domElement},enumerable:!1,configurable:!0}),t}(o.ExtensionContext),b=function(){},g=function(){},v=function(e){function t(){return e.call(this)||this}return Object(i.__extends)(t,e),t}(b),y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),t}(r.SPEventArgs),S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),t}(r.SPEventArgs),D=function(){function e(t){this._isDisposed=!1,this._selectedRowsChangedEvent=new r.SPEvent(e._selectedRowsChangedEventName),this._listViewStateChangedEventName=""+e._listViewStateChangedEventName+(t||""),this._listViewStateChangedEvent=new r.SPEvent(this._listViewStateChangedEventName)}return Object.defineProperty(e.prototype,"selectedRowsChangedEvent",{get:function(){return this._selectedRowsChangedEvent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"listViewStateChangedEvent",{get:function(){return this._listViewStateChangedEvent},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){r._SPEventManager.instance.removeEvent(this._listViewStateChangedEventName),this._isDisposed=!0},Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!1,configurable:!0}),e._selectedRowsChangedEventName="listView.selectedRowsChanged",e._listViewStateChangedEventName="listView.stateChanged",e}();!function(e){e[e.None=0]="None",e[e.List=1]="List",e[e.View=2]="View",e[e.Columns=4]="Columns",e[e.SelectedRows=8]="SelectedRows",e[e.Rows=16]="Rows",e[e.AppliedFilters=32]="AppliedFilters",e[e.Sort=64]="Sort",e[e.FolderInfo=128]="FolderInfo"}(a||(a={}))}})});
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  *
6
6
  * @remarks
7
7
  * The BaseListViewCommandSet extension type exposes generalized commands that may be displayed as tool bar buttons,
8
- * context menu items, etc. These commands are initially defined in the extensions manifest file. At runtime, the
8
+ * context menu items, etc. These commands are initially defined in the extension's manifest file. At runtime, the
9
9
  * corresponding Command object can be obtained by calling {@link BaseListViewCommandSet.tryGetCommand}.
10
- * The commands appearance can be customized by assigning its properties, for example to hide a command that is not
10
+ * The command's appearance can be customized by assigning its properties, for example to hide a command that is not
11
11
  * contextually relevant, or to pluralize the title based on the number of selected items.
12
12
  * @public
13
13
  */
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
4
  var sp_extension_base_1 = require("@microsoft/sp-extension-base");
5
5
  var sp_core_library_1 = require("@microsoft/sp-core-library");
6
- var KillSwitches_1 = require("../common/KillSwitches");
7
6
  var sp_page_context_1 = require("@microsoft/sp-page-context");
8
7
  /**
9
8
  * This object provides contextual information for BaseListViewCommandSet.
@@ -40,7 +39,7 @@ var ListViewCommandSetContext = /** @class */ (function (_super) {
40
39
  }
41
40
  }
42
41
  // updating title and ariaLabel based on UI culture
43
- if (!KillSwitches_1.localizedCommandSetTitleKSActivated() && !!_this._commandArray.length) {
42
+ if (!!_this._commandArray.length) {
44
43
  _this.serviceScope.whenFinished(function () {
45
44
  var pageContext = _this.serviceScope.consume(sp_page_context_1.PageContext.serviceKey);
46
45
  var currentUICulture = pageContext.cultureInfo.currentUICultureName;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ var sp_extension_base_1 = require("@microsoft/sp-extension-base");
5
+ /**
6
+ * @public
7
+ */
8
+ var BaseFormCustomizer = /** @class */ (function (_super) {
9
+ tslib_1.__extends(BaseFormCustomizer, _super);
10
+ function BaseFormCustomizer() {
11
+ return _super !== null && _super.apply(this, arguments) || this;
12
+ }
13
+ Object.defineProperty(BaseFormCustomizer.prototype, "domElement", {
14
+ // Readonly protected properties. To change these to readonly once TypeScript supports that feature.
15
+ /**
16
+ * This property is a pointer to the root DOM element of the form. This is a DIV element and contains the whole
17
+ * DOM subtree of the form.
18
+ *
19
+ * @readonly
20
+ */
21
+ get: function () {
22
+ return this.context.domElement;
23
+ },
24
+ enumerable: false,
25
+ configurable: true
26
+ });
27
+ Object.defineProperty(BaseFormCustomizer.prototype, "displayMode", {
28
+ /**
29
+ * @readonly
30
+ */
31
+ get: function () {
32
+ return this._displayMode;
33
+ },
34
+ enumerable: false,
35
+ configurable: true
36
+ });
37
+ /**
38
+ * Call this method after the form has been saved to inform the application that the form has been saved.
39
+ */
40
+ BaseFormCustomizer.prototype.formSaved = function () {
41
+ // TODO: inform the application that the form has been closed.
42
+ };
43
+ /**
44
+ * Call this method after the form has been closed/cancelled to inform the application that the form has been closed.
45
+ */
46
+ BaseFormCustomizer.prototype.formClosed = function () {
47
+ // TODO: inform the application that the form has been closed.
48
+ };
49
+ return BaseFormCustomizer;
50
+ }(sp_extension_base_1.BaseExtension));
51
+ exports.default = BaseFormCustomizer;
52
+ //# sourceMappingURL=BaseFormCustomizer.js.map
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ var sp_extension_base_1 = require("@microsoft/sp-extension-base");
5
+ /**
6
+ * @public
7
+ */
8
+ var FormCustomizerContext = /** @class */ (function (_super) {
9
+ tslib_1.__extends(FormCustomizerContext, _super);
10
+ function FormCustomizerContext(extensionContextParameters, formCustomizerContextParameters) {
11
+ var _this = _super.call(this, extensionContextParameters) || this;
12
+ _this._list = formCustomizerContextParameters.list;
13
+ _this._contentTypes = formCustomizerContextParameters.contentTypes;
14
+ _this._folderInfo = formCustomizerContextParameters.folderInfo;
15
+ _this._itemIds = formCustomizerContextParameters.itemIds;
16
+ _this._domElement = formCustomizerContextParameters.domElement;
17
+ return _this;
18
+ }
19
+ Object.defineProperty(FormCustomizerContext.prototype, "list", {
20
+ get: function () {
21
+ return this._list;
22
+ },
23
+ enumerable: false,
24
+ configurable: true
25
+ });
26
+ Object.defineProperty(FormCustomizerContext.prototype, "contentTypes", {
27
+ get: function () {
28
+ return this._contentTypes;
29
+ },
30
+ enumerable: false,
31
+ configurable: true
32
+ });
33
+ Object.defineProperty(FormCustomizerContext.prototype, "folderInfo", {
34
+ get: function () {
35
+ return this._folderInfo;
36
+ },
37
+ enumerable: false,
38
+ configurable: true
39
+ });
40
+ Object.defineProperty(FormCustomizerContext.prototype, "itemIds", {
41
+ get: function () {
42
+ return this._itemIds;
43
+ },
44
+ enumerable: false,
45
+ configurable: true
46
+ });
47
+ Object.defineProperty(FormCustomizerContext.prototype, "domElement", {
48
+ get: function () {
49
+ return this._domElement;
50
+ },
51
+ enumerable: false,
52
+ configurable: true
53
+ });
54
+ return FormCustomizerContext;
55
+ }(sp_extension_base_1.ExtensionContext));
56
+ exports.default = FormCustomizerContext;
57
+ //# sourceMappingURL=FormCustomizerContext.js.map
@@ -15,6 +15,10 @@ var BaseFieldCustomizer_1 = require("./fieldCustomizer/BaseFieldCustomizer");
15
15
  Object.defineProperty(exports, "BaseFieldCustomizer", { enumerable: true, get: function () { return BaseFieldCustomizer_1.default; } });
16
16
  var FieldCustomizerContext_1 = require("./fieldCustomizer/FieldCustomizerContext");
17
17
  Object.defineProperty(exports, "FieldCustomizerContext", { enumerable: true, get: function () { return FieldCustomizerContext_1.default; } });
18
+ var BaseFormCustomizer_1 = require("./formCustomizer/BaseFormCustomizer");
19
+ Object.defineProperty(exports, "BaseFormCustomizer", { enumerable: true, get: function () { return BaseFormCustomizer_1.default; } });
20
+ var FormCustomizerContext_1 = require("./formCustomizer/FormCustomizerContext");
21
+ Object.defineProperty(exports, "FormCustomizerContext", { enumerable: true, get: function () { return FormCustomizerContext_1.default; } });
18
22
  var ListItemAccessor_1 = require("./common/ListItemAccessor");
19
23
  Object.defineProperty(exports, "ListItemAccessor", { enumerable: true, get: function () { return ListItemAccessor_1.default; } });
20
24
  var ListViewAccessor_1 = require("./common/ListViewAccessor");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/sp-listview-extensibility",
3
- "version": "1.14.0",
3
+ "version": "1.15.0-beta.1",
4
4
  "description": "SharePoint Framework developer support for customizing the list view",
5
5
  "license": "UNLICENSED",
6
6
  "main": "lib-commonjs/index.js",
@@ -10,14 +10,14 @@
10
10
  "tsdocFlavor": "AEDoc"
11
11
  },
12
12
  "dependencies": {
13
- "@microsoft/sp-core-library": "1.14.0",
14
- "@microsoft/sp-extension-base": "1.14.0",
15
- "@microsoft/sp-module-interfaces": "1.14.0",
16
- "@microsoft/sp-page-context": "1.14.0",
13
+ "@microsoft/sp-core-library": "1.15.0-beta.1",
14
+ "@microsoft/sp-extension-base": "1.15.0-beta.1",
15
+ "@microsoft/sp-module-interfaces": "1.15.0-beta.1",
16
+ "@microsoft/sp-page-context": "1.15.0-beta.1",
17
17
  "tslib": "~1.10.0"
18
18
  },
19
19
  "scripts": {},
20
20
  "engines": {
21
- "node": ">=12.13.0 <13.0.0 || >=14.15.0 <15.0.0"
21
+ "node": ">=12.13.0 <13.0.0 || >=14.15.0 <15.0.0 || >=16.13.0 <17.0.0"
22
22
  }
23
23
  }
@@ -1 +0,0 @@
1
- define("d37b65ee-c7d8-4570-bc74-2b294ff3b380_1.14.0",["tslib","@microsoft/sp-core-library","@microsoft/sp-page-context","@microsoft/sp-extension-base"],function(n,a,i,r){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="mwqp")}({"17wl":function(e,t){e.exports=n},UWqr:function(e,t){e.exports=a},"X+PM":function(e,t){e.exports=i},ZFc5:function(e,t){e.exports=r},mwqp:function(e,t,n){"use strict";n.r(t),n.d(t,"BaseListViewCommandSet",function(){return s}),n.d(t,"Command",function(){return c}),n.d(t,"ListViewCommandSetContext",function(){return l}),n.d(t,"BaseFieldCustomizer",function(){return f}),n.d(t,"FieldCustomizerContext",function(){return p}),n.d(t,"ListItemAccessor",function(){return m}),n.d(t,"ColumnAccessor",function(){return _}),n.d(t,"RowAccessor",function(){return h}),n.d(t,"SelectedRowsChangedEventArgs",function(){return b}),n.d(t,"ListViewStateChangedEventArgs",function(){return g}),n.d(t,"ListViewAccessor",function(){return v}),n.d(t,"ListViewAccessorStateChanges",function(){return a});var a,i=n("17wl"),r=n("UWqr"),o=n("ZFc5"),s=function(e){function t(){var t=e.call(this)||this;return t._raiseOnChange=void 0,t}return Object(i.__extends)(t,e),t.prototype.tryGetCommand=function(e){return r.Validate.isNonemptyString(e,"id"),this.context._commands.filter(function(t){return t.id===e})[0]},t.prototype.onListViewUpdated=function(e){},t.prototype.onExecute=function(e){},t.prototype.raiseOnChange=function(){this._raiseOnChange&&this._raiseOnChange()},t}(o.BaseExtension),c=function(){},d=n("X+PM"),l=function(e){function t(t,n){var a=e.call(this,t)||this;a._listView=n.listView,a._commandArray=[];for(var i=a.manifest.items,o=0,s=Object.keys(i);o<s.length;o++){var c=s[o];if("command"===i[c].type){var l=i[c].iconImageUrl;l&&!r.UrlUtilities.isDataUrl(l)&&(l=r.UrlUtilities.resolve(l,a.manifest.loaderConfig.internalModuleBaseUrls[0])),a._commandArray.push({id:c,title:i[c].title.default||"",ariaLabel:i[c].ariaLabel?i[c].ariaLabel.default:void 0,iconImageUrl:l,visible:!0,disabled:void 0})}}return!r._SPKillSwitch.isActivated("38c1f92c-5240-42ea-9c8c-8485ae721247")&&a._commandArray.length&&a.serviceScope.whenFinished(function(){var e=a.serviceScope.consume(d.PageContext.serviceKey).cultureInfo.currentUICultureName;a._commandArray.forEach(function(t){var n=i[t.id];t.title=r.Text._getLocalizedString(n.title,e)||"",n.ariaLabel&&(t.ariaLabel=r.Text._getLocalizedString(n.ariaLabel,e))})}),a}return Object(i.__extends)(t,e),Object.defineProperty(t.prototype,"listView",{get:function(){return this._listView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_commands",{get:function(){return this._commandArray},enumerable:!1,configurable:!0}),t}(o.ExtensionContext),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),t.prototype.onRenderCell=function(e){var t=""+e.fieldValue;e.fieldValue.innerText=t},t.prototype.onDisposeCell=function(e){},t}(o.BaseExtension),f=u,p=function(e){function t(t,n){var a=e.call(this,t)||this;return a._listView=n.listView,a._field=n.field,a}return Object(i.__extends)(t,e),t.prototype.tryGetListView=function(){return this._listView},Object.defineProperty(t.prototype,"field",{get:function(){return this._field},enumerable:!1,configurable:!0}),t}(o.ExtensionContext),m=function(){},_=function(){},h=function(e){function t(){return e.call(this)||this}return Object(i.__extends)(t,e),t}(m),b=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),t}(r.SPEventArgs),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),t}(r.SPEventArgs),v=function(){function e(t){this._isDisposed=!1,this._selectedRowsChangedEvent=new r.SPEvent(e._selectedRowsChangedEventName),this._listViewStateChangedEventName=""+e._listViewStateChangedEventName+(t||""),this._listViewStateChangedEvent=new r.SPEvent(this._listViewStateChangedEventName)}return Object.defineProperty(e.prototype,"selectedRowsChangedEvent",{get:function(){return this._selectedRowsChangedEvent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"listViewStateChangedEvent",{get:function(){return this._listViewStateChangedEvent},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){r._SPEventManager.instance.removeEvent(this._listViewStateChangedEventName),this._isDisposed=!0},Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!1,configurable:!0}),e._selectedRowsChangedEventName="listView.selectedRowsChanged",e._listViewStateChangedEventName="listView.stateChanged",e}();!function(e){e[e.None=0]="None",e[e.List=1]="List",e[e.View=2]="View",e[e.Columns=4]="Columns",e[e.SelectedRows=8]="SelectedRows",e[e.Rows=16]="Rows",e[e.AppliedFilters=32]="AppliedFilters",e[e.Sort=64]="Sort",e[e.FolderInfo=128]="FolderInfo"}(a||(a={}))}})});
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.localizedCommandSetTitleKSActivated = void 0;
4
- var sp_core_library_1 = require("@microsoft/sp-core-library");
5
- function localizedCommandSetTitleKSActivated() {
6
- return sp_core_library_1._SPKillSwitch.isActivated('38c1f92c-5240-42ea-9c8c-8485ae721247'
7
- /* '10/04/2021', 'Getting localized title for the Command Set' */
8
- );
9
- }
10
- exports.localizedCommandSetTitleKSActivated = localizedCommandSetTitleKSActivated;
11
- //# sourceMappingURL=KillSwitches.js.map