@microsoft/sp-listview-extensibility 1.23.2 → 1.24.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 (76) hide show
  1. package/dist/d37b65ee-c7d8-4570-bc74-2b294ff3b380.manifest.json +6 -11
  2. package/dist/sp-listview-extensibility_none_92a24595575d0757a2c6.js +1 -0
  3. package/dist/tsdoc-metadata.json +1 -1
  4. package/lib-commonjs/commandSet/BaseListViewCommandSet.js +49 -49
  5. package/lib-commonjs/commandSet/Command.js +13 -9
  6. package/lib-commonjs/commandSet/ListViewCommandSetContext.js +54 -70
  7. package/lib-commonjs/common/Flights.js +14 -8
  8. package/lib-commonjs/common/IListItem.js +5 -2
  9. package/lib-commonjs/common/ListItemAccessor.js +15 -25
  10. package/lib-commonjs/common/ListViewAccessor.js +83 -135
  11. package/lib-commonjs/common/ListViewAccessorState.js +13 -10
  12. package/lib-commonjs/fieldCustomizer/BaseFieldCustomizer.js +25 -25
  13. package/lib-commonjs/fieldCustomizer/FieldCustomizerContext.js +36 -43
  14. package/lib-commonjs/formCustomizer/BaseFormCustomizer.js +93 -114
  15. package/lib-commonjs/formCustomizer/FormActionEventArgs.js +27 -26
  16. package/lib-commonjs/formCustomizer/FormCustomizerContext.js +61 -98
  17. package/lib-commonjs/formCustomizer/FormCustomizerHost.js +34 -33
  18. package/lib-commonjs/index.js +79 -37
  19. package/lib-esm/commandSet/BaseListViewCommandSet.js +61 -0
  20. package/{lib → lib-esm}/commandSet/Command.js +4 -8
  21. package/lib-esm/commandSet/ListViewCommandSetContext.js +67 -0
  22. package/{lib → lib-esm}/common/Flights.js +3 -2
  23. package/lib-esm/common/IListItem.js +7 -0
  24. package/{lib → lib-esm}/common/ListItemAccessor.js +8 -10
  25. package/lib-esm/common/ListViewAccessor.js +102 -0
  26. package/{lib → lib-esm}/common/ListViewAccessorState.js +3 -7
  27. package/lib-esm/fieldCustomizer/BaseFieldCustomizer.js +27 -0
  28. package/lib-esm/fieldCustomizer/FieldCustomizerContext.js +34 -0
  29. package/lib-esm/formCustomizer/BaseFormCustomizer.js +106 -0
  30. package/lib-esm/formCustomizer/FormActionEventArgs.js +18 -0
  31. package/lib-esm/formCustomizer/FormCustomizerContext.js +59 -0
  32. package/lib-esm/formCustomizer/FormCustomizerHost.js +47 -0
  33. package/{lib → lib-esm}/index.js +3 -3
  34. package/package.json +35 -8
  35. package/dist/sp-listview-extensibility_none_94ba6a6b18c530c5bdda.js +0 -1
  36. package/lib/commandSet/BaseListViewCommandSet.d.ts.map +0 -1
  37. package/lib/commandSet/BaseListViewCommandSet.js +0 -69
  38. package/lib/commandSet/Command.d.ts.map +0 -1
  39. package/lib/commandSet/ListViewCommandSetContext.d.ts.map +0 -1
  40. package/lib/commandSet/ListViewCommandSetContext.js +0 -87
  41. package/lib/common/Flights.d.ts.map +0 -1
  42. package/lib/common/IListItem.d.ts.map +0 -1
  43. package/lib/common/IListItem.js +0 -2
  44. package/lib/common/ListItemAccessor.d.ts.map +0 -1
  45. package/lib/common/ListViewAccessor.d.ts.map +0 -1
  46. package/lib/common/ListViewAccessor.js +0 -146
  47. package/lib/common/ListViewAccessorState.d.ts.map +0 -1
  48. package/lib/fieldCustomizer/BaseFieldCustomizer.d.ts.map +0 -1
  49. package/lib/fieldCustomizer/BaseFieldCustomizer.js +0 -35
  50. package/lib/fieldCustomizer/FieldCustomizerContext.d.ts.map +0 -1
  51. package/lib/fieldCustomizer/FieldCustomizerContext.js +0 -45
  52. package/lib/formCustomizer/BaseFormCustomizer.d.ts.map +0 -1
  53. package/lib/formCustomizer/BaseFormCustomizer.js +0 -135
  54. package/lib/formCustomizer/FormActionEventArgs.d.ts.map +0 -1
  55. package/lib/formCustomizer/FormActionEventArgs.js +0 -28
  56. package/lib/formCustomizer/FormCustomizerContext.d.ts.map +0 -1
  57. package/lib/formCustomizer/FormCustomizerContext.js +0 -99
  58. package/lib/formCustomizer/FormCustomizerHost.d.ts.map +0 -1
  59. package/lib/formCustomizer/FormCustomizerHost.js +0 -49
  60. package/lib/index.d.ts.map +0 -1
  61. /package/{lib → lib-dts}/commandSet/BaseListViewCommandSet.d.ts +0 -0
  62. /package/{lib → lib-dts}/commandSet/Command.d.ts +0 -0
  63. /package/{lib → lib-dts}/commandSet/ListViewCommandSetContext.d.ts +0 -0
  64. /package/{lib → lib-dts}/common/Flights.d.ts +0 -0
  65. /package/{lib → lib-dts}/common/IListItem.d.ts +0 -0
  66. /package/{lib → lib-dts}/common/ListItemAccessor.d.ts +0 -0
  67. /package/{lib → lib-dts}/common/ListViewAccessor.d.ts +0 -0
  68. /package/{lib → lib-dts}/common/ListViewAccessorState.d.ts +0 -0
  69. /package/{lib → lib-dts}/fieldCustomizer/BaseFieldCustomizer.d.ts +0 -0
  70. /package/{lib → lib-dts}/fieldCustomizer/FieldCustomizerContext.d.ts +0 -0
  71. /package/{lib → lib-dts}/formCustomizer/BaseFormCustomizer.d.ts +0 -0
  72. /package/{lib → lib-dts}/formCustomizer/FormActionEventArgs.d.ts +0 -0
  73. /package/{lib → lib-dts}/formCustomizer/FormCustomizerContext.d.ts +0 -0
  74. /package/{lib → lib-dts}/formCustomizer/FormCustomizerHost.d.ts +0 -0
  75. /package/{lib → lib-dts}/index.d.ts +0 -0
  76. /package/{lib → lib-esm}/sp-listview-extensibility.manifest.json +0 -0
@@ -2,7 +2,7 @@
2
2
  "id": "d37b65ee-c7d8-4570-bc74-2b294ff3b380",
3
3
  "alias": "SPListViewExtensibility",
4
4
  "componentType": "Library",
5
- "version": "1.23.2",
5
+ "version": "1.24.0",
6
6
  "manifestVersion": 2,
7
7
  "loaderConfig": {
8
8
  "internalModuleBaseUrls": [
@@ -13,29 +13,24 @@
13
13
  "sp-listview-extensibility": {
14
14
  "type": "path",
15
15
  "path": {
16
- "path": "sp-listview-extensibility_none_94ba6a6b18c530c5bdda.js",
17
- "integrity": "sha256-PZ9K02MZeehv3TzKtgRj8+0b8srywgAMM1ve9Yeu+qI="
16
+ "path": "sp-listview-extensibility_none_92a24595575d0757a2c6.js",
17
+ "integrity": "sha256-95myOUyRY/MCAUC7kfELnbGUwk46fgcfR2QGFRA5U9w="
18
18
  }
19
19
  },
20
- "tslib": {
21
- "type": "component",
22
- "id": "01c4df03-e775-48cb-aa14-171ee5199a15",
23
- "version": "2.3.1"
24
- },
25
20
  "@microsoft/sp-core-library": {
26
21
  "type": "component",
27
22
  "id": "7263c7d0-1d6a-45ec-8d85-d4d1d234171b",
28
- "version": "1.23.2"
23
+ "version": "1.24.0"
29
24
  },
30
25
  "@microsoft/sp-extension-base": {
31
26
  "type": "component",
32
27
  "id": "0773bd53-a69e-4293-87e6-ba80ea4d614b",
33
- "version": "1.23.2"
28
+ "version": "1.24.0"
34
29
  },
35
30
  "@microsoft/sp-page-context": {
36
31
  "type": "component",
37
32
  "id": "1c4541f7-5c31-41aa-9fa8-fbc9dc14c0a8",
38
- "version": "1.23.2"
33
+ "version": "1.24.0"
39
34
  }
40
35
  }
41
36
  }
@@ -0,0 +1 @@
1
+ define("d37b65ee-c7d8-4570-bc74-2b294ff3b380_1.24.0",["@microsoft/sp-core-library","@microsoft/sp-extension-base","@microsoft/sp-page-context"],(a,b,c)=>(()=>{"use strict";var d={676(b){b.exports=a},0(a){a.exports=b},408(a){a.exports=c}},e={};function f(a){var b=e[a];if(void 0!==b)return b.exports;var c=e[a]={exports:{}};return d[a](c,c.exports,f),c.exports}f.d=(a,b)=>{for(var c in b)f.o(b,c)&&!f.o(a,c)&&Object.defineProperty(a,c,{enumerable:!0,get:b[c]})},f.o=(a,b)=>Object.prototype.hasOwnProperty.call(a,b),f.r=a=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var g={};return(()=>{f.r(g),f.d(g,{BaseFieldCustomizer:()=>o,BaseFormCustomizer:()=>s,BaseListViewCommandSet:()=>j,ColumnAccessor:()=>w,Command:()=>k,FieldCustomizerContext:()=>p,FormCustomizerContext:()=>t,ListItemAccessor:()=>v,ListViewAccessor:()=>B,ListViewAccessorStateChanges:()=>d,ListViewCommandSetContext:()=>m,ListViewStateChangedEventArgs:()=>z,RowAccessor:()=>x,SelectedRowsChangedEventArgs:()=>y,_FormAction:()=>c,_FormActionEventArgs:()=>q,_FormCustomizerHost:()=>u});var a,b,c,d,e=f(676),h=f(0);class i extends h.BaseExtension{tryGetCommand(a){return e.Validate.isNonemptyString(a,"id"),this.context._commands.filter(b=>b.id===a)[0]}onListViewUpdated(a){}onExecute(a){}raiseOnChange(){this._raiseOnChange&&this._raiseOnChange()}constructor(...a){super(...a),this._raiseOnChange=void 0}}(0,e._ES5CompatibleClass)(i);let j=i;class k{}var l=f(408);class m extends h.ExtensionContext{get listView(){return this._listView}get _commands(){return this._commandArray}constructor(a,b){super(a),this._listView=b.listView,this._commandArray=[];const c=this.manifest.items;for(const a of Object.keys(c))if(e._SPFlight.isEnabled(62894)?"command"===c[a].type||"group"===c[a].type:"command"===c[a].type){let b=c[a].iconImageUrl;b&&!e.UrlUtilities.isDataUrl(b)&&(b=e.UrlUtilities.resolve(b,this.manifest.loaderConfig.internalModuleBaseUrls[0])),this._commandArray.push({id:a,title:c[a].title.default||"",ariaLabel:c[a].ariaLabel?c[a].ariaLabel.default:void 0,iconImageUrl:b,visible:!0,disabled:void 0})}this._commandArray.length&&this.serviceScope.whenFinished(()=>{let a=this.serviceScope.consume(l.PageContext.serviceKey).cultureInfo.currentUICultureName;this._commandArray.forEach(b=>{let d=c[b.id];b.title=e.Text._getLocalizedString(d.title,a)||"",d.ariaLabel&&(b.ariaLabel=e.Text._getLocalizedString(d.ariaLabel,a))})})}}class n extends h.BaseExtension{onRenderCell(a){let b=`${a.fieldValue}`;a.fieldValue.innerText=b}onDisposeCell(a){}}(0,e._ES5CompatibleClass)(n);let o=n;class p extends h.ExtensionContext{tryGetListView(){return this._listView}get field(){return this._field}constructor(a,b){super(a),this._listView=b.listView,this._field=b.field}}(a=c||(c={}))[a.Save=0]="Save",a[a.Close=1]="Close";class q extends e.SPEventArgs{constructor(a){super(),this.action=a}}class r extends h.BaseExtension{get domElement(){return this.context.domElement}get displayMode(){return this._displayMode}get formActionEvent(){return this._formActionEvent}_init(a,b,c){return c&&(this._displayMode=c.displayMode),super._init(a,b,c)}_internalRender(){this.render()}_internalSetDisplayMode(a){this._displayMode=a}_save(){e._SPEventManager.instance.raiseStickyEvent(r._formActionEventName,new q(c.Save))}_close(){e._SPEventManager.instance.raiseStickyEvent(r._formActionEventName,new q(c.Close))}dispose(){e._SPEventManager.instance.removeEvent(r._formActionEventName),super.dispose()}_initializeExtensionType(){super._initializeExtensionType(),this.context._host.logEngagement("init")}formSaved(){this.context._host.onSave()}formClosed(){this.context._host.onClose()}constructor(...a){super(...a),this._formActionEvent=new e.SPEvent(r._formActionEventName)}}r._formActionEventName="formCustomizer.formAction",(0,e._ES5CompatibleClass)(r);let s=r;class t extends h.ExtensionContext{get list(){return this._list}get contentType(){return this._contentType}get folderInfo(){return this._folderInfo}get itemId(){return this._itemId}get item(){return this._item}get domElement(){return this._domElement}get _host(){return this._formCustomizerHost}constructor(a,b){super(a),this._list=b.list,this._contentType=b.contentType,this._folderInfo=b.folderInfo,this._itemId=b.itemId,this._item=b.item,this._domElement=b.domElement,this._formCustomizerHost=b.host}}class u{onSave(){this.logEngagement("onSave"),this._onSaveCallback()}onClose(){this.logEngagement("onClose"),this._onCloseCallback()}onError(a){this.logEngagement("onError"),this._onErrorCallback&&this._onErrorCallback(a)}logEngagement(a){this._logEngagement&&this._logEngagement(a)}constructor(a){this._onSaveCallback=a.onSaveCallback,this._onCloseCallback=a.onCloseCallback,this._onErrorCallback=a.onErrorCallback,this._logEngagement=a.logEngagement}}class v{}class w{}class x extends v{constructor(){super()}}class y extends e.SPEventArgs{}class z extends e.SPEventArgs{}class A{get selectedRowsChangedEvent(){return this._selectedRowsChangedEvent}get listViewStateChangedEvent(){return this._listViewStateChangedEvent}dispose(){e._SPEventManager.instance.removeEvent(this._listViewStateChangedEventName),this._isDisposed=!0}get isDisposed(){return this._isDisposed}constructor(a){this._isDisposed=!1,this._selectedRowsChangedEvent=new e.SPEvent(A._selectedRowsChangedEventName),this._listViewStateChangedEventName=`${A._listViewStateChangedEventName}${a||""}`,this._listViewStateChangedEvent=new e.SPEvent(this._listViewStateChangedEventName)}}A._selectedRowsChangedEventName="listView.selectedRowsChanged",A._listViewStateChangedEventName="listView.stateChanged";let B=A;(b=d||(d={}))[b.None=0]="None",b[b.List=1]="List",b[b.View=2]="View",b[b.Columns=4]="Columns",b[b.SelectedRows=8]="SelectedRows",b[b.Rows=16]="Rows",b[b.AppliedFilters=32]="AppliedFilters",b[b.Sort=64]="Sort",b[b.FolderInfo=128]="FolderInfo"})(),g})());
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.57.7"
8
+ "packageVersion": "7.58.12"
9
9
  }
10
10
  ]
11
11
  }
@@ -1,8 +1,15 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- var sp_core_library_1 = require("@microsoft/sp-core-library");
5
- var sp_extension_base_1 = require("@microsoft/sp-extension-base");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ const _spcorelibrary = require("@microsoft/sp-core-library");
12
+ const _spextensionbase = require("@microsoft/sp-extension-base");
6
13
  /**
7
14
  * This is the base class that third parties should extend when implementing
8
15
  * a client-side extension that provides a command set for a SharePoint list view.
@@ -16,56 +23,49 @@ var sp_extension_base_1 = require("@microsoft/sp-extension-base");
16
23
  * so the hierarchy goes `BaseListViewCommandSet <- BaseCommandSet <- BaseExtension <- BaseComponent`.
17
24
  *
18
25
  * @public
19
- */
20
- var BaseListViewCommandSet = /** @class */ (function (_super) {
21
- tslib_1.__extends(BaseListViewCommandSet, _super);
22
- function BaseListViewCommandSet() {
23
- var _this = _super !== null && _super.apply(this, arguments) || this;
24
- /**
25
- * @internal
26
- */
27
- _this._raiseOnChange = undefined; // provided by Command set adapter
28
- return _this;
29
- }
26
+ */ class BaseListViewCommandSet extends _spextensionbase.BaseExtension {
30
27
  /**
31
- * Returns the command with the given id.
32
- * Returns undefined if there is not command with the given id.
33
- * @param id - Id of the command
34
- */
35
- BaseListViewCommandSet.prototype.tryGetCommand = function (id) {
36
- sp_core_library_1.Validate.isNonemptyString(id, 'id');
37
- var commands = this.context._commands.filter(function (command) { return command.id === id; });
28
+ * Returns the command with the given id.
29
+ * Returns undefined if there is not command with the given id.
30
+ * @param id - Id of the command
31
+ */ tryGetCommand(id) {
32
+ _spcorelibrary.Validate.isNonemptyString(id, 'id');
33
+ const commands = this.context._commands.filter((command)=>command.id === id);
38
34
  return commands[0];
39
- };
35
+ }
40
36
  /**
41
- * This event occurs whenever the ListView state changes.
42
- * virtual
43
- * @remarks
44
- * This event allows the implementor to tailor the visibility of the command.
45
- *
46
- * @deprecated Use context.listView.listViewStateChangedEvent instead.
47
- */
48
- BaseListViewCommandSet.prototype.onListViewUpdated = function (event) {
49
- // (implemented by child class)
50
- };
37
+ * This event occurs whenever the ListView state changes.
38
+ * virtual
39
+ * @remarks
40
+ * This event allows the implementor to tailor the visibility of the command.
41
+ *
42
+ * @deprecated Use context.listView.listViewStateChangedEvent instead.
43
+ */ onListViewUpdated(event) {
44
+ // (implemented by child class)
45
+ }
51
46
  /**
52
- * This event occurs when the command is invoked, e.g. because the user
53
- * clicked on the toolbar button or menu item.
54
- * virtual
55
- */
56
- BaseListViewCommandSet.prototype.onExecute = function (event) {
57
- // (implemented by child class)
58
- };
47
+ * This event occurs when the command is invoked, e.g. because the user
48
+ * clicked on the toolbar button or menu item.
49
+ * virtual
50
+ */ onExecute(event) {
51
+ // (implemented by child class)
52
+ }
59
53
  /**
60
- * Use this method to fire OnChange event and initialize a reflow of the ListView.
61
- */
62
- BaseListViewCommandSet.prototype.raiseOnChange = function () {
54
+ * Use this method to fire OnChange event and initialize a reflow of the ListView.
55
+ */ raiseOnChange() {
63
56
  if (this._raiseOnChange) {
64
57
  this._raiseOnChange();
65
58
  }
66
- };
67
- return BaseListViewCommandSet;
68
- }(sp_extension_base_1.BaseExtension));
69
- (0, sp_core_library_1._ES5CompatibleClass)(BaseListViewCommandSet);
70
- exports.default = BaseListViewCommandSet;
71
- //# sourceMappingURL=BaseListViewCommandSet.js.map
59
+ }
60
+ constructor(...args){
61
+ super(...args);
62
+ /**
63
+ * @internal
64
+ */ this._raiseOnChange = undefined // provided by Command set adapter
65
+ ;
66
+ }
67
+ }
68
+ (0, _spcorelibrary._ES5CompatibleClass)(BaseListViewCommandSet);
69
+ const _default = BaseListViewCommandSet;
70
+
71
+ //# sourceMappingURL=./BaseListViewCommandSet.js.map
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /**
4
2
  * Represents a command belonging to a command set.
5
3
  *
@@ -10,11 +8,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
8
  * The command's appearance can be customized by assigning its properties, for example to hide a command that is not
11
9
  * contextually relevant, or to pluralize the title based on the number of selected items.
12
10
  * @public
13
- */
14
- var Command = /** @class */ (function () {
15
- function Command() {
11
+ */ "use strict";
12
+ Object.defineProperty(exports, "__esModule", {
13
+ value: true
14
+ });
15
+ Object.defineProperty(exports, "default", {
16
+ enumerable: true,
17
+ get: function() {
18
+ return Command;
16
19
  }
17
- return Command;
18
- }());
19
- exports.default = Command;
20
- //# sourceMappingURL=Command.js.map
20
+ });
21
+ class Command {
22
+ }
23
+
24
+ //# sourceMappingURL=./Command.js.map
@@ -1,40 +1,52 @@
1
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
- var sp_core_library_1 = require("@microsoft/sp-core-library");
6
- var sp_page_context_1 = require("@microsoft/sp-page-context");
7
- var Flights_1 = require("../common/Flights");
8
- /**
9
- * This object provides contextual information for BaseListViewCommandSet.
10
- * @public
11
- */
12
- var ListViewCommandSetContext = /** @class */ (function (_super) {
13
- tslib_1.__extends(ListViewCommandSetContext, _super);
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return ListViewCommandSetContext;
9
+ }
10
+ });
11
+ const _spextensionbase = require("@microsoft/sp-extension-base");
12
+ const _spcorelibrary = require("@microsoft/sp-core-library");
13
+ const _sppagecontext = require("@microsoft/sp-page-context");
14
+ const _Flights = require("../common/Flights");
15
+ class ListViewCommandSetContext extends _spextensionbase.ExtensionContext {
16
+ /**
17
+ * Provides access to the ListView control that the customizer will operate on.
18
+ */ get listView() {
19
+ return this._listView;
20
+ }
21
+ /**
22
+ * Returns an array with all commands.
23
+ *
24
+ * @privateRemarks
25
+ * In the future commands won't be a flat list. This allows us to get all commands together, so we can
26
+ * provide a straight-forward API tryGetCommand in the BaseListViewCommandSet itself.
27
+ *
28
+ * @internal
29
+ */ get _commands() {
30
+ return this._commandArray;
31
+ }
14
32
  /**
15
- * @internal
16
- */
17
- function ListViewCommandSetContext(extensionContextParameters, listViewCommandSetContextParameters) {
18
- var _this = _super.call(this, extensionContextParameters) || this;
19
- _this._listView = listViewCommandSetContextParameters.listView;
20
- _this._commandArray = [];
21
- var itemsMap = _this.manifest.items;
22
- for (var _i = 0, _a = Object.keys(itemsMap); _i < _a.length; _i++) {
23
- var itemId = _a[_i];
24
- var isValidCommand = (0, Flights_1.isSPFxListviewCommandSetGroupingEnabled)()
25
- ? itemsMap[itemId].type === 'command' || itemsMap[itemId].type === 'group'
26
- : itemsMap[itemId].type === 'command';
33
+ * @internal
34
+ */ constructor(extensionContextParameters, listViewCommandSetContextParameters){
35
+ super(extensionContextParameters);
36
+ this._listView = listViewCommandSetContextParameters.listView;
37
+ this._commandArray = [];
38
+ const itemsMap = this.manifest.items;
39
+ for (const itemId of Object.keys(itemsMap)){
40
+ const isValidCommand = (0, _Flights.isSPFxListviewCommandSetGroupingEnabled)() ? itemsMap[itemId].type === 'command' || itemsMap[itemId].type === 'group' : itemsMap[itemId].type === 'command';
27
41
  if (isValidCommand) {
28
- var iconUrl = itemsMap[itemId].iconImageUrl;
29
- if (iconUrl && !sp_core_library_1.UrlUtilities.isDataUrl(iconUrl)) {
30
- iconUrl = sp_core_library_1.UrlUtilities.resolve(iconUrl, _this.manifest.loaderConfig.internalModuleBaseUrls[0]);
42
+ let iconUrl = itemsMap[itemId].iconImageUrl;
43
+ if (iconUrl && !_spcorelibrary.UrlUtilities.isDataUrl(iconUrl)) {
44
+ iconUrl = _spcorelibrary.UrlUtilities.resolve(iconUrl, this.manifest.loaderConfig.internalModuleBaseUrls[0]);
31
45
  }
32
- _this._commandArray.push({
46
+ this._commandArray.push({
33
47
  id: itemId,
34
48
  title: itemsMap[itemId].title.default || '',
35
- ariaLabel: itemsMap[itemId].ariaLabel
36
- ? itemsMap[itemId].ariaLabel.default
37
- : undefined,
49
+ ariaLabel: itemsMap[itemId].ariaLabel ? itemsMap[itemId].ariaLabel.default : undefined,
38
50
  iconImageUrl: iconUrl,
39
51
  visible: true,
40
52
  disabled: undefined
@@ -42,48 +54,20 @@ var ListViewCommandSetContext = /** @class */ (function (_super) {
42
54
  }
43
55
  }
44
56
  // updating title and ariaLabel based on UI culture
45
- if (_this._commandArray.length) {
46
- _this.serviceScope.whenFinished(function () {
47
- var pageContext = _this.serviceScope.consume(sp_page_context_1.PageContext.serviceKey);
48
- var currentUICulture = pageContext.cultureInfo.currentUICultureName;
49
- _this._commandArray.forEach(function (command) {
50
- var item = itemsMap[command.id];
51
- command.title = sp_core_library_1.Text._getLocalizedString(item.title, currentUICulture) || '';
57
+ if (this._commandArray.length) {
58
+ this.serviceScope.whenFinished(()=>{
59
+ const pageContext = this.serviceScope.consume(_sppagecontext.PageContext.serviceKey);
60
+ const currentUICulture = pageContext.cultureInfo.currentUICultureName;
61
+ this._commandArray.forEach((command)=>{
62
+ const item = itemsMap[command.id];
63
+ command.title = _spcorelibrary.Text._getLocalizedString(item.title, currentUICulture) || '';
52
64
  if (item.ariaLabel) {
53
- command.ariaLabel = sp_core_library_1.Text._getLocalizedString(item.ariaLabel, currentUICulture);
65
+ command.ariaLabel = _spcorelibrary.Text._getLocalizedString(item.ariaLabel, currentUICulture);
54
66
  }
55
67
  });
56
68
  });
57
69
  }
58
- return _this;
59
70
  }
60
- Object.defineProperty(ListViewCommandSetContext.prototype, "listView", {
61
- /**
62
- * Provides access to the ListView control that the customizer will operate on.
63
- */
64
- get: function () {
65
- return this._listView;
66
- },
67
- enumerable: false,
68
- configurable: true
69
- });
70
- Object.defineProperty(ListViewCommandSetContext.prototype, "_commands", {
71
- /**
72
- * Returns an array with all commands.
73
- *
74
- * @privateRemarks
75
- * In the future commands won't be a flat list. This allows us to get all commands together, so we can
76
- * provide a straight-forward API tryGetCommand in the BaseListViewCommandSet itself.
77
- *
78
- * @internal
79
- */
80
- get: function () {
81
- return this._commandArray;
82
- },
83
- enumerable: false,
84
- configurable: true
85
- });
86
- return ListViewCommandSetContext;
87
- }(sp_extension_base_1.ExtensionContext));
88
- exports.default = ListViewCommandSetContext;
89
- //# sourceMappingURL=ListViewCommandSetContext.js.map
71
+ }
72
+
73
+ //# sourceMappingURL=./ListViewCommandSetContext.js.map
@@ -1,11 +1,17 @@
1
- "use strict";
2
1
  // @copyright Microsoft Corporation. All rights reserved.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.isSPFxListviewCommandSetGroupingEnabled = void 0;
5
- var sp_core_library_1 = require("@microsoft/sp-core-library");
6
- // https://spoflights.azurewebsites.net/Flight/Edit/SPFxListviewCommandSetGroupingEnabled
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "isSPFxListviewCommandSetGroupingEnabled", {
7
+ enumerable: true,
8
+ get: function() {
9
+ return isSPFxListviewCommandSetGroupingEnabled;
10
+ }
11
+ });
12
+ const _spcorelibrary = require("@microsoft/sp-core-library");
7
13
  function isSPFxListviewCommandSetGroupingEnabled() {
8
- return sp_core_library_1._SPFlight.isEnabled(62894 /* SPFxListviewCommandSetGroupingEnabled */);
14
+ return _spcorelibrary._SPFlight.isEnabled(62894 /* SPFxListviewCommandSetGroupingEnabled */ );
9
15
  }
10
- exports.isSPFxListviewCommandSetGroupingEnabled = isSPFxListviewCommandSetGroupingEnabled;
11
- //# sourceMappingURL=Flights.js.map
16
+
17
+ //# sourceMappingURL=./Flights.js.map
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IListItem.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //# sourceMappingURL=./IListItem.js.map
@@ -1,27 +1,17 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * When a field customizer extension is rendering a field, the ListItemAccessor provides
5
- * access to the associated SharePoint list item.
6
- *
7
- * @remarks
8
- *
9
- * ListItemAccessor allows a field customizer extension to determine which fields are available
10
- * in the editor and retrieve the current values for those fields. In the future, it may
11
- * also support validation and editing operations.
12
- *
13
- * When the editor is the SharePoint list view, the ListViewAccessor uses the RowAccessor
14
- * subclass instead of the ListItemAccessor base class. This allows additional functionality
15
- * to be exposed, for example determining whether the associated table row is selected or not.
16
- *
17
- * @public
18
- */
19
- var ListItemAccessor = /** @class */ (function () {
20
- /** @internal */
21
- function ListItemAccessor() {
22
- // (mark constructor as internal)
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return ListItemAccessor;
23
9
  }
24
- return ListItemAccessor;
25
- }());
26
- exports.default = ListItemAccessor;
27
- //# sourceMappingURL=ListItemAccessor.js.map
10
+ });
11
+ class ListItemAccessor {
12
+ /** @internal */ constructor(){
13
+ // (mark constructor as internal)
14
+ }
15
+ }
16
+
17
+ //# sourceMappingURL=./ListItemAccessor.js.map