@microsoft/sp-listview-extensibility 1.13.1 → 1.14.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/d37b65ee-c7d8-4570-bc74-2b294ff3b380.manifest.json +9 -4
- package/dist/index-internal-beta.d.ts +1 -3
- package/dist/index-internal-public.d.ts +1 -3
- package/dist/index-internal.d.ts +1 -3
- package/dist/sp-listview-extensibility_none_7c3cbbaef8efd67369bb.js +1 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-commonjs/commandSet/BaseListViewCommandSet.js +1 -3
- package/lib-commonjs/commandSet/ListViewCommandSetContext.js +16 -0
- package/lib-commonjs/common/KillSwitches.js +11 -0
- package/package.json +5 -5
- package/dist/sp-listview-extensibility_none_abbcd32929f87f9a82df.js +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "d37b65ee-c7d8-4570-bc74-2b294ff3b380",
|
|
3
3
|
"alias": "SPListViewExtensibility",
|
|
4
4
|
"componentType": "Library",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.14.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-
|
|
15
|
+
"path": "sp-listview-extensibility_none_7c3cbbaef8efd67369bb.js"
|
|
16
16
|
},
|
|
17
17
|
"tslib": {
|
|
18
18
|
"type": "component",
|
|
@@ -22,12 +22,17 @@
|
|
|
22
22
|
"@microsoft/sp-core-library": {
|
|
23
23
|
"type": "component",
|
|
24
24
|
"id": "7263c7d0-1d6a-45ec-8d85-d4d1d234171b",
|
|
25
|
-
"version": "1.
|
|
25
|
+
"version": "1.14.0"
|
|
26
|
+
},
|
|
27
|
+
"@microsoft/sp-page-context": {
|
|
28
|
+
"type": "component",
|
|
29
|
+
"id": "1c4541f7-5c31-41aa-9fa8-fbc9dc14c0a8",
|
|
30
|
+
"version": "1.14.0"
|
|
26
31
|
},
|
|
27
32
|
"@microsoft/sp-extension-base": {
|
|
28
33
|
"type": "component",
|
|
29
34
|
"id": "0773bd53-a69e-4293-87e6-ba80ea4d614b",
|
|
30
|
-
"version": "1.
|
|
35
|
+
"version": "1.14.0"
|
|
31
36
|
}
|
|
32
37
|
}
|
|
33
38
|
}
|
|
@@ -59,9 +59,7 @@ export declare abstract class BaseListViewCommandSet<TProperties> extends BaseEx
|
|
|
59
59
|
* This event occurs whenever the ListView state changes.
|
|
60
60
|
* virtual
|
|
61
61
|
* @remarks
|
|
62
|
-
* This event allows the implementor to tailor the
|
|
63
|
-
* For example, to hide the command, assign its property visible = false.
|
|
64
|
-
* To customize the title, modify the command property title.
|
|
62
|
+
* This event allows the implementor to tailor the visibility of the command.
|
|
65
63
|
*/
|
|
66
64
|
onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters): void;
|
|
67
65
|
/**
|
|
@@ -59,9 +59,7 @@ export declare abstract class BaseListViewCommandSet<TProperties> extends BaseEx
|
|
|
59
59
|
* This event occurs whenever the ListView state changes.
|
|
60
60
|
* virtual
|
|
61
61
|
* @remarks
|
|
62
|
-
* This event allows the implementor to tailor the
|
|
63
|
-
* For example, to hide the command, assign its property visible = false.
|
|
64
|
-
* To customize the title, modify the command property title.
|
|
62
|
+
* This event allows the implementor to tailor the visibility of the command.
|
|
65
63
|
*/
|
|
66
64
|
onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters): void;
|
|
67
65
|
/**
|
package/dist/index-internal.d.ts
CHANGED
|
@@ -59,9 +59,7 @@ export declare abstract class BaseListViewCommandSet<TProperties> extends BaseEx
|
|
|
59
59
|
* This event occurs whenever the ListView state changes.
|
|
60
60
|
* virtual
|
|
61
61
|
* @remarks
|
|
62
|
-
* This event allows the implementor to tailor the
|
|
63
|
-
* For example, to hide the command, assign its property visible = false.
|
|
64
|
-
* To customize the title, modify the command property title.
|
|
62
|
+
* This event allows the implementor to tailor the visibility of the command.
|
|
65
63
|
*/
|
|
66
64
|
onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters): void;
|
|
67
65
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
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 o}),n.d(t,"Command",function(){return s}),n.d(t,"ListViewCommandSetContext",function(){return d}),n.d(t,"BaseFieldCustomizer",function(){return l}),n.d(t,"FieldCustomizerContext",function(){return u}),n.d(t,"ListItemAccessor",function(){return f}),n.d(t,"ColumnAccessor",function(){return p}),n.d(t,"RowAccessor",function(){return m}),n.d(t,"SelectedRowsChangedEventArgs",function(){return _}),n.d(t,"ListViewAccessor",function(){return h});var a=n("17wl"),i=n("UWqr"),r=n("ZFc5"),o=function(e){function t(){return e.call(this)||this}return Object(a.__extends)(t,e),t.prototype.tryGetCommand=function(e){return i.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}(r.BaseExtension),s=function(){},c=n("X+PM"),d=function(e){function t(t,n){var a=e.call(this,t)||this;a._listView=n.listView,a._commandArray=[];for(var r=a.manifest.items,o=0,s=Object.keys(r);o<s.length;o++){var d=s[o];if("command"===r[d].type){var l=r[d].iconImageUrl;l&&!i.UrlUtilities.isDataUrl(l)&&(l=i.UrlUtilities.resolve(l,a.manifest.loaderConfig.internalModuleBaseUrls[0])),a._commandArray.push({id:d,title:r[d].title.default||"",ariaLabel:r[d].ariaLabel?r[d].ariaLabel.default:void 0,iconImageUrl:l,visible:!0})}}return!i._SPKillSwitch.isActivated("38c1f92c-5240-42ea-9c8c-8485ae721247")&&a._commandArray.length&&a.serviceScope.whenFinished(function(){var e=a.serviceScope.consume(c.PageContext.serviceKey).cultureInfo.currentUICultureName;a._commandArray.forEach(function(t){var n=r[t.id];t.title=i.Text._getLocalizedString(n.title,e)||"",n.ariaLabel&&(t.ariaLabel=i.Text._getLocalizedString(n.ariaLabel,e))})}),a}return Object(a.__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}(r.ExtensionContext),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.__extends)(t,e),t.prototype.onRenderCell=function(e){var t=""+e.fieldValue;e.fieldValue.innerText=t},t.prototype.onDisposeCell=function(e){},t}(r.BaseExtension),u=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(a.__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}(r.ExtensionContext),f=function(){},p=function(){},m=function(e){function t(){return e.call(this)||this}return Object(a.__extends)(t,e),t}(f),_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.__extends)(t,e),t}(i.SPEventArgs),h=function(){function e(){this._selectedRowsChangedEvent=new i.SPEvent(e._selectedRowsChangedEventName)}return Object.defineProperty(e.prototype,"selectedRowsChangedEvent",{get:function(){return this._selectedRowsChangedEvent},enumerable:!1,configurable:!0}),e._selectedRowsChangedEventName="listView.selectedRowsChanged",e}()}})});
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -39,9 +39,7 @@ var BaseListViewCommandSet = /** @class */ (function (_super) {
|
|
|
39
39
|
* This event occurs whenever the ListView state changes.
|
|
40
40
|
* virtual
|
|
41
41
|
* @remarks
|
|
42
|
-
* This event allows the implementor to tailor the
|
|
43
|
-
* For example, to hide the command, assign its property visible = false.
|
|
44
|
-
* To customize the title, modify the command property title.
|
|
42
|
+
* This event allows the implementor to tailor the visibility of the command.
|
|
45
43
|
*/
|
|
46
44
|
BaseListViewCommandSet.prototype.onListViewUpdated = function (event) {
|
|
47
45
|
// (implemented by child class)
|
|
@@ -3,6 +3,8 @@ 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
|
+
var sp_page_context_1 = require("@microsoft/sp-page-context");
|
|
6
8
|
/**
|
|
7
9
|
* This object provides contextual information for BaseListViewCommandSet.
|
|
8
10
|
* @public
|
|
@@ -36,6 +38,20 @@ var ListViewCommandSetContext = /** @class */ (function (_super) {
|
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
40
|
}
|
|
41
|
+
// updating title and ariaLabel based on UI culture
|
|
42
|
+
if (!KillSwitches_1.localizedCommandSetTitleKSActivated() && !!_this._commandArray.length) {
|
|
43
|
+
_this.serviceScope.whenFinished(function () {
|
|
44
|
+
var pageContext = _this.serviceScope.consume(sp_page_context_1.PageContext.serviceKey);
|
|
45
|
+
var currentUICulture = pageContext.cultureInfo.currentUICultureName;
|
|
46
|
+
_this._commandArray.forEach(function (command) {
|
|
47
|
+
var item = itemsMap[command.id];
|
|
48
|
+
command.title = sp_core_library_1.Text._getLocalizedString(item.title, currentUICulture) || '';
|
|
49
|
+
if (item.ariaLabel) {
|
|
50
|
+
command.ariaLabel = sp_core_library_1.Text._getLocalizedString(item.ariaLabel, currentUICulture);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
39
55
|
return _this;
|
|
40
56
|
}
|
|
41
57
|
Object.defineProperty(ListViewCommandSetContext.prototype, "listView", {
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/sp-listview-extensibility",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0-beta.4",
|
|
4
4
|
"description": "SharePoint Framework developer support for customizing the list view",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"main": "lib-commonjs/index.js",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"tsdocFlavor": "AEDoc"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@microsoft/sp-core-library": "1.
|
|
14
|
-
"@microsoft/sp-extension-base": "1.
|
|
15
|
-
"@microsoft/sp-module-interfaces": "1.
|
|
16
|
-
"@microsoft/sp-page-context": "1.
|
|
13
|
+
"@microsoft/sp-core-library": "1.14.0-beta.4",
|
|
14
|
+
"@microsoft/sp-extension-base": "1.14.0-beta.4",
|
|
15
|
+
"@microsoft/sp-module-interfaces": "1.14.0-beta.4",
|
|
16
|
+
"@microsoft/sp-page-context": "1.14.0-beta.4",
|
|
17
17
|
"tslib": "~1.10.0"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
define("d37b65ee-c7d8-4570-bc74-2b294ff3b380_1.13.1",["tslib","@microsoft/sp-core-library","@microsoft/sp-extension-base"],function(n,a,i){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},ZFc5:function(e,t){e.exports=i},mwqp:function(e,t,n){"use strict";n.r(t),n.d(t,"BaseListViewCommandSet",function(){return o}),n.d(t,"Command",function(){return s}),n.d(t,"ListViewCommandSetContext",function(){return c}),n.d(t,"BaseFieldCustomizer",function(){return d}),n.d(t,"FieldCustomizerContext",function(){return l}),n.d(t,"ListItemAccessor",function(){return u}),n.d(t,"ColumnAccessor",function(){return f}),n.d(t,"RowAccessor",function(){return p}),n.d(t,"SelectedRowsChangedEventArgs",function(){return m}),n.d(t,"ListViewAccessor",function(){return _});var a=n("17wl"),i=n("UWqr"),r=n("ZFc5"),o=function(e){function t(){return e.call(this)||this}return Object(a.__extends)(t,e),t.prototype.tryGetCommand=function(e){return i.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}(r.BaseExtension),s=function(){},c=function(e){function t(t,n){var a=e.call(this,t)||this;a._listView=n.listView,a._commandArray=[];for(var r=a.manifest.items,o=0,s=Object.keys(r);o<s.length;o++){var c=s[o];if("command"===r[c].type){var d=r[c].iconImageUrl;d&&!i.UrlUtilities.isDataUrl(d)&&(d=i.UrlUtilities.resolve(d,a.manifest.loaderConfig.internalModuleBaseUrls[0])),a._commandArray.push({id:c,title:r[c].title.default||"",ariaLabel:r[c].ariaLabel?r[c].ariaLabel.default:void 0,iconImageUrl:d,visible:!0})}}return a}return Object(a.__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}(r.ExtensionContext),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.__extends)(t,e),t.prototype.onRenderCell=function(e){var t=""+e.fieldValue;e.fieldValue.innerText=t},t.prototype.onDisposeCell=function(e){},t}(r.BaseExtension),l=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(a.__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}(r.ExtensionContext),u=function(){},f=function(){},p=function(e){function t(){return e.call(this)||this}return Object(a.__extends)(t,e),t}(u),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.__extends)(t,e),t}(i.SPEventArgs),_=function(){function e(){this._selectedRowsChangedEvent=new i.SPEvent(e._selectedRowsChangedEventName)}return Object.defineProperty(e.prototype,"selectedRowsChangedEvent",{get:function(){return this._selectedRowsChangedEvent},enumerable:!1,configurable:!0}),e._selectedRowsChangedEventName="listView.selectedRowsChanged",e}()}})});
|