@microsoft/sp-listview-extensibility 1.23.1 → 1.24.0-beta.2

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_e2a79004ecc8bfd2e643.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_53622c3076b31a20ece6.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
@@ -1,31 +1,32 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FormActionEventArgs = exports.FormAction = void 0;
4
- var tslib_1 = require("tslib");
5
- var sp_core_library_1 = require("@microsoft/sp-core-library");
6
- /**
7
- * Available Form actions.
8
- *
9
- * @internal
10
- */
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ FormAction: function() {
13
+ return FormAction;
14
+ },
15
+ FormActionEventArgs: function() {
16
+ return FormActionEventArgs;
17
+ }
18
+ });
19
+ const _spcorelibrary = require("@microsoft/sp-core-library");
11
20
  var FormAction;
12
- (function (FormAction) {
21
+ (function(FormAction) {
13
22
  FormAction[FormAction["Save"] = 0] = "Save";
14
23
  FormAction[FormAction["Close"] = 1] = "Close";
15
- })(FormAction || (exports.FormAction = FormAction = {}));
16
- /**
17
- * Arguments for the form close/save event.
18
- *
19
- * @internal
20
- */
21
- var FormActionEventArgs = /** @class */ (function (_super) {
22
- tslib_1.__extends(FormActionEventArgs, _super);
23
- function FormActionEventArgs(formAction) {
24
- var _this = _super.call(this) || this;
25
- _this.action = formAction;
26
- return _this;
24
+ })(FormAction || (FormAction = {}));
25
+ class FormActionEventArgs extends _spcorelibrary.SPEventArgs {
26
+ constructor(formAction){
27
+ super();
28
+ this.action = formAction;
27
29
  }
28
- return FormActionEventArgs;
29
- }(sp_core_library_1.SPEventArgs));
30
- exports.FormActionEventArgs = FormActionEventArgs;
31
- //# sourceMappingURL=FormActionEventArgs.js.map
30
+ }
31
+
32
+ //# sourceMappingURL=./FormActionEventArgs.js.map
@@ -1,101 +1,64 @@
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
- /**
6
- * Form Customizer Context. This object contains contextual services and properties for the form.
7
- *
8
- * @public
9
- */
10
- var FormCustomizerContext = /** @class */ (function (_super) {
11
- tslib_1.__extends(FormCustomizerContext, _super);
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return FormCustomizerContext;
9
+ }
10
+ });
11
+ const _spextensionbase = require("@microsoft/sp-extension-base");
12
+ class FormCustomizerContext extends _spextensionbase.ExtensionContext {
13
+ /**
14
+ * The list associated with the form.
15
+ */ get list() {
16
+ return this._list;
17
+ }
18
+ /**
19
+ * The content type associated with the form.
20
+ */ get contentType() {
21
+ return this._contentType;
22
+ }
23
+ /**
24
+ * The folder information where the item is located/should be created.
25
+ */ get folderInfo() {
26
+ return this._folderInfo;
27
+ }
28
+ /**
29
+ * The item id of the item being edited or viewed.
30
+ */ get itemId() {
31
+ return this._itemId;
32
+ }
33
+ /**
34
+ * The item data of the item being edited or viewed.
35
+ */ get item() {
36
+ return this._item;
37
+ }
38
+ /**
39
+ * The root DOM element of the form. This is a DIV element container for the custom form.
40
+ */ get domElement() {
41
+ return this._domElement;
42
+ }
43
+ /**
44
+ * Form host to interact with the host application.
45
+ *
46
+ * @internal
47
+ */ get _host() {
48
+ return this._formCustomizerHost;
49
+ }
12
50
  /**
13
- * @internal
14
- */
15
- function FormCustomizerContext(extensionContextParameters, formCustomizerContextParameters) {
16
- var _this = _super.call(this, extensionContextParameters) || this;
17
- _this._list = formCustomizerContextParameters.list;
18
- _this._contentType = formCustomizerContextParameters.contentType;
19
- _this._folderInfo = formCustomizerContextParameters.folderInfo;
20
- _this._itemId = formCustomizerContextParameters.itemId;
21
- _this._item = formCustomizerContextParameters.item;
22
- _this._domElement = formCustomizerContextParameters.domElement;
23
- _this._formCustomizerHost = formCustomizerContextParameters.host;
24
- return _this;
51
+ * @internal
52
+ */ constructor(extensionContextParameters, formCustomizerContextParameters){
53
+ super(extensionContextParameters);
54
+ this._list = formCustomizerContextParameters.list;
55
+ this._contentType = formCustomizerContextParameters.contentType;
56
+ this._folderInfo = formCustomizerContextParameters.folderInfo;
57
+ this._itemId = formCustomizerContextParameters.itemId;
58
+ this._item = formCustomizerContextParameters.item;
59
+ this._domElement = formCustomizerContextParameters.domElement;
60
+ this._formCustomizerHost = formCustomizerContextParameters.host;
25
61
  }
26
- Object.defineProperty(FormCustomizerContext.prototype, "list", {
27
- /**
28
- * The list associated with the form.
29
- */
30
- get: function () {
31
- return this._list;
32
- },
33
- enumerable: false,
34
- configurable: true
35
- });
36
- Object.defineProperty(FormCustomizerContext.prototype, "contentType", {
37
- /**
38
- * The content type associated with the form.
39
- */
40
- get: function () {
41
- return this._contentType;
42
- },
43
- enumerable: false,
44
- configurable: true
45
- });
46
- Object.defineProperty(FormCustomizerContext.prototype, "folderInfo", {
47
- /**
48
- * The folder information where the item is located/should be created.
49
- */
50
- get: function () {
51
- return this._folderInfo;
52
- },
53
- enumerable: false,
54
- configurable: true
55
- });
56
- Object.defineProperty(FormCustomizerContext.prototype, "itemId", {
57
- /**
58
- * The item id of the item being edited or viewed.
59
- */
60
- get: function () {
61
- return this._itemId;
62
- },
63
- enumerable: false,
64
- configurable: true
65
- });
66
- Object.defineProperty(FormCustomizerContext.prototype, "item", {
67
- /**
68
- * The item data of the item being edited or viewed.
69
- */
70
- get: function () {
71
- return this._item;
72
- },
73
- enumerable: false,
74
- configurable: true
75
- });
76
- Object.defineProperty(FormCustomizerContext.prototype, "domElement", {
77
- /**
78
- * The root DOM element of the form. This is a DIV element container for the custom form.
79
- */
80
- get: function () {
81
- return this._domElement;
82
- },
83
- enumerable: false,
84
- configurable: true
85
- });
86
- Object.defineProperty(FormCustomizerContext.prototype, "_host", {
87
- /**
88
- * Form host to interact with the host application.
89
- *
90
- * @internal
91
- */
92
- get: function () {
93
- return this._formCustomizerHost;
94
- },
95
- enumerable: false,
96
- configurable: true
97
- });
98
- return FormCustomizerContext;
99
- }(sp_extension_base_1.ExtensionContext));
100
- exports.default = FormCustomizerContext;
101
- //# sourceMappingURL=FormCustomizerContext.js.map
62
+ }
63
+
64
+ //# sourceMappingURL=./FormCustomizerContext.js.map
@@ -1,52 +1,53 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FormCustomizerHost = void 0;
4
1
  /**
5
- * Form Customizer Host
2
+ * Host parameters
6
3
  *
7
4
  * @internal
8
- */
9
- var FormCustomizerHost = /** @class */ (function () {
10
- function FormCustomizerHost(params) {
11
- this._onSaveCallback = params.onSaveCallback;
12
- this._onCloseCallback = params.onCloseCallback;
13
- this._onErrorCallback = params.onErrorCallback;
14
- this._logEngagement = params.logEngagement;
5
+ */ "use strict";
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ Object.defineProperty(exports, "FormCustomizerHost", {
10
+ enumerable: true,
11
+ get: function() {
12
+ return FormCustomizerHost;
15
13
  }
14
+ });
15
+ class FormCustomizerHost {
16
16
  /**
17
- * The host will invoke this._onSaveCallback to inform the application on form save.
18
- */
19
- FormCustomizerHost.prototype.onSave = function () {
17
+ * The host will invoke this._onSaveCallback to inform the application on form save.
18
+ */ onSave() {
20
19
  this.logEngagement('onSave');
21
20
  this._onSaveCallback();
22
- };
21
+ }
23
22
  /**
24
- * The host will invoke this._onCloseCallback to inform the application on form close.
25
- */
26
- FormCustomizerHost.prototype.onClose = function () {
23
+ * The host will invoke this._onCloseCallback to inform the application on form close.
24
+ */ onClose() {
27
25
  this.logEngagement('onClose');
28
26
  this._onCloseCallback();
29
- };
27
+ }
30
28
  /**
31
- * The host will invoke this._onErrorCallback to inform the application on form error.
32
- * @param error - Error message
33
- */
34
- FormCustomizerHost.prototype.onError = function (error) {
29
+ * The host will invoke this._onErrorCallback to inform the application on form error.
30
+ * @param error - Error message
31
+ */ onError(error) {
35
32
  this.logEngagement('onError');
36
33
  if (this._onErrorCallback) {
37
34
  this._onErrorCallback(error);
38
35
  }
39
- };
36
+ }
40
37
  /**
41
- * Logs form engagement event
42
- * @param eventName - Event name
43
- */
44
- FormCustomizerHost.prototype.logEngagement = function (eventName) {
38
+ * Logs form engagement event
39
+ * @param eventName - Event name
40
+ */ logEngagement(eventName) {
45
41
  if (this._logEngagement) {
46
42
  this._logEngagement(eventName);
47
43
  }
48
- };
49
- return FormCustomizerHost;
50
- }());
51
- exports.FormCustomizerHost = FormCustomizerHost;
52
- //# sourceMappingURL=FormCustomizerHost.js.map
44
+ }
45
+ constructor(params){
46
+ this._onSaveCallback = params.onSaveCallback;
47
+ this._onCloseCallback = params.onCloseCallback;
48
+ this._onErrorCallback = params.onErrorCallback;
49
+ this._logEngagement = params.logEngagement;
50
+ }
51
+ }
52
+
53
+ //# sourceMappingURL=./FormCustomizerHost.js.map
@@ -1,41 +1,83 @@
1
- "use strict";
2
1
  /**
3
2
  * SharePoint Framework support for customizing the list view.
4
3
  *
5
4
  * @packagedocumentation
6
- */
7
- var __importDefault = (this && this.__importDefault) || function (mod) {
8
- return (mod && mod.__esModule) ? mod : { "default": mod };
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.ListViewAccessorStateChanges = exports.ListViewAccessor = exports.ListViewStateChangedEventArgs = exports.SelectedRowsChangedEventArgs = exports.RowAccessor = exports.ColumnAccessor = exports.ListItemAccessor = exports._FormAction = exports._FormActionEventArgs = exports._FormCustomizerHost = exports.FormCustomizerContext = exports.BaseFormCustomizer = exports.FieldCustomizerContext = exports.BaseFieldCustomizer = exports.ListViewCommandSetContext = exports.Command = exports.BaseListViewCommandSet = void 0;
12
- var BaseListViewCommandSet_1 = require("./commandSet/BaseListViewCommandSet");
13
- Object.defineProperty(exports, "BaseListViewCommandSet", { enumerable: true, get: function () { return __importDefault(BaseListViewCommandSet_1).default; } });
14
- var Command_1 = require("./commandSet/Command");
15
- Object.defineProperty(exports, "Command", { enumerable: true, get: function () { return __importDefault(Command_1).default; } });
16
- var ListViewCommandSetContext_1 = require("./commandSet/ListViewCommandSetContext");
17
- Object.defineProperty(exports, "ListViewCommandSetContext", { enumerable: true, get: function () { return __importDefault(ListViewCommandSetContext_1).default; } });
18
- var BaseFieldCustomizer_1 = require("./fieldCustomizer/BaseFieldCustomizer");
19
- Object.defineProperty(exports, "BaseFieldCustomizer", { enumerable: true, get: function () { return __importDefault(BaseFieldCustomizer_1).default; } });
20
- var FieldCustomizerContext_1 = require("./fieldCustomizer/FieldCustomizerContext");
21
- Object.defineProperty(exports, "FieldCustomizerContext", { enumerable: true, get: function () { return __importDefault(FieldCustomizerContext_1).default; } });
22
- var BaseFormCustomizer_1 = require("./formCustomizer/BaseFormCustomizer");
23
- Object.defineProperty(exports, "BaseFormCustomizer", { enumerable: true, get: function () { return __importDefault(BaseFormCustomizer_1).default; } });
24
- var FormCustomizerContext_1 = require("./formCustomizer/FormCustomizerContext");
25
- Object.defineProperty(exports, "FormCustomizerContext", { enumerable: true, get: function () { return __importDefault(FormCustomizerContext_1).default; } });
26
- var FormCustomizerHost_1 = require("./formCustomizer/FormCustomizerHost");
27
- Object.defineProperty(exports, "_FormCustomizerHost", { enumerable: true, get: function () { return FormCustomizerHost_1.FormCustomizerHost; } });
28
- var FormActionEventArgs_1 = require("./formCustomizer/FormActionEventArgs");
29
- Object.defineProperty(exports, "_FormActionEventArgs", { enumerable: true, get: function () { return FormActionEventArgs_1.FormActionEventArgs; } });
30
- Object.defineProperty(exports, "_FormAction", { enumerable: true, get: function () { return FormActionEventArgs_1.FormAction; } });
31
- var ListItemAccessor_1 = require("./common/ListItemAccessor");
32
- Object.defineProperty(exports, "ListItemAccessor", { enumerable: true, get: function () { return __importDefault(ListItemAccessor_1).default; } });
33
- var ListViewAccessor_1 = require("./common/ListViewAccessor");
34
- Object.defineProperty(exports, "ColumnAccessor", { enumerable: true, get: function () { return ListViewAccessor_1.ColumnAccessor; } });
35
- Object.defineProperty(exports, "RowAccessor", { enumerable: true, get: function () { return ListViewAccessor_1.RowAccessor; } });
36
- Object.defineProperty(exports, "SelectedRowsChangedEventArgs", { enumerable: true, get: function () { return ListViewAccessor_1.SelectedRowsChangedEventArgs; } });
37
- Object.defineProperty(exports, "ListViewStateChangedEventArgs", { enumerable: true, get: function () { return ListViewAccessor_1.ListViewStateChangedEventArgs; } });
38
- Object.defineProperty(exports, "ListViewAccessor", { enumerable: true, get: function () { return __importDefault(ListViewAccessor_1).default; } });
39
- var ListViewAccessorState_1 = require("./common/ListViewAccessorState");
40
- Object.defineProperty(exports, "ListViewAccessorStateChanges", { enumerable: true, get: function () { return ListViewAccessorState_1.ListViewAccessorStateChanges; } });
41
- //# sourceMappingURL=index.js.map
5
+ */ "use strict";
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ function _export(target, all) {
10
+ for(var name in all)Object.defineProperty(target, name, {
11
+ enumerable: true,
12
+ get: all[name]
13
+ });
14
+ }
15
+ _export(exports, {
16
+ BaseFieldCustomizer: function() {
17
+ return _BaseFieldCustomizer.default;
18
+ },
19
+ BaseFormCustomizer: function() {
20
+ return _BaseFormCustomizer.default;
21
+ },
22
+ BaseListViewCommandSet: function() {
23
+ return _BaseListViewCommandSet.default;
24
+ },
25
+ ColumnAccessor: function() {
26
+ return _ListViewAccessor.ColumnAccessor;
27
+ },
28
+ Command: function() {
29
+ return _Command.default;
30
+ },
31
+ FieldCustomizerContext: function() {
32
+ return _FieldCustomizerContext.default;
33
+ },
34
+ FormCustomizerContext: function() {
35
+ return _FormCustomizerContext.default;
36
+ },
37
+ ListItemAccessor: function() {
38
+ return _ListItemAccessor.default;
39
+ },
40
+ ListViewAccessor: function() {
41
+ return _ListViewAccessor.default;
42
+ },
43
+ ListViewAccessorStateChanges: function() {
44
+ return _ListViewAccessorState.ListViewAccessorStateChanges;
45
+ },
46
+ ListViewCommandSetContext: function() {
47
+ return _ListViewCommandSetContext.default;
48
+ },
49
+ ListViewStateChangedEventArgs: function() {
50
+ return _ListViewAccessor.ListViewStateChangedEventArgs;
51
+ },
52
+ RowAccessor: function() {
53
+ return _ListViewAccessor.RowAccessor;
54
+ },
55
+ SelectedRowsChangedEventArgs: function() {
56
+ return _ListViewAccessor.SelectedRowsChangedEventArgs;
57
+ },
58
+ _FormAction: function() {
59
+ return _FormActionEventArgs.FormAction;
60
+ },
61
+ _FormActionEventArgs: function() {
62
+ return _FormActionEventArgs.FormActionEventArgs;
63
+ },
64
+ _FormCustomizerHost: function() {
65
+ return _FormCustomizerHost.FormCustomizerHost;
66
+ }
67
+ });
68
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
69
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
70
+ const _BaseListViewCommandSet = /*#__PURE__*/ _interop_require_default._(require("./commandSet/BaseListViewCommandSet"));
71
+ const _Command = /*#__PURE__*/ _interop_require_default._(require("./commandSet/Command"));
72
+ const _ListViewCommandSetContext = /*#__PURE__*/ _interop_require_default._(require("./commandSet/ListViewCommandSetContext"));
73
+ const _BaseFieldCustomizer = /*#__PURE__*/ _interop_require_default._(require("./fieldCustomizer/BaseFieldCustomizer"));
74
+ const _FieldCustomizerContext = /*#__PURE__*/ _interop_require_default._(require("./fieldCustomizer/FieldCustomizerContext"));
75
+ const _BaseFormCustomizer = /*#__PURE__*/ _interop_require_default._(require("./formCustomizer/BaseFormCustomizer"));
76
+ const _FormCustomizerContext = /*#__PURE__*/ _interop_require_default._(require("./formCustomizer/FormCustomizerContext"));
77
+ const _FormCustomizerHost = require("./formCustomizer/FormCustomizerHost");
78
+ const _FormActionEventArgs = require("./formCustomizer/FormActionEventArgs");
79
+ const _ListItemAccessor = /*#__PURE__*/ _interop_require_default._(require("./common/ListItemAccessor"));
80
+ const _ListViewAccessor = /*#__PURE__*/ _interop_require_wildcard._(require("./common/ListViewAccessor"));
81
+ const _ListViewAccessorState = require("./common/ListViewAccessorState");
82
+
83
+ //# sourceMappingURL=./index.js.map
@@ -0,0 +1,61 @@
1
+ import { Validate, _ES5CompatibleClass } from '@microsoft/sp-core-library';
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 provides a command set for a SharePoint list view.
6
+ *
7
+ * @remarks
8
+ * In the component manifest, the "extensionType" should be set to "ListViewCommandSet".
9
+ *
10
+ * @privateRemarks
11
+ *
12
+ * Eventually other command set classes will be introduced, and then we will introduce a base class
13
+ * so the hierarchy goes `BaseListViewCommandSet <- BaseCommandSet <- BaseExtension <- BaseComponent`.
14
+ *
15
+ * @public
16
+ */ class BaseListViewCommandSet extends BaseExtension {
17
+ /**
18
+ * Returns the command with the given id.
19
+ * Returns undefined if there is not command with the given id.
20
+ * @param id - Id of the command
21
+ */ tryGetCommand(id) {
22
+ Validate.isNonemptyString(id, 'id');
23
+ const commands = this.context._commands.filter((command)=>command.id === id);
24
+ return commands[0];
25
+ }
26
+ /**
27
+ * This event occurs whenever the ListView state changes.
28
+ * virtual
29
+ * @remarks
30
+ * This event allows the implementor to tailor the visibility of the command.
31
+ *
32
+ * @deprecated Use context.listView.listViewStateChangedEvent instead.
33
+ */ onListViewUpdated(event) {
34
+ // (implemented by child class)
35
+ }
36
+ /**
37
+ * This event occurs when the command is invoked, e.g. because the user
38
+ * clicked on the toolbar button or menu item.
39
+ * virtual
40
+ */ onExecute(event) {
41
+ // (implemented by child class)
42
+ }
43
+ /**
44
+ * Use this method to fire OnChange event and initialize a reflow of the ListView.
45
+ */ raiseOnChange() {
46
+ if (this._raiseOnChange) {
47
+ this._raiseOnChange();
48
+ }
49
+ }
50
+ constructor(...args){
51
+ super(...args);
52
+ /**
53
+ * @internal
54
+ */ this._raiseOnChange = undefined // provided by Command set adapter
55
+ ;
56
+ }
57
+ }
58
+ _ES5CompatibleClass(BaseListViewCommandSet);
59
+ export default BaseListViewCommandSet;
60
+
61
+ //# sourceMappingURL=./BaseListViewCommandSet.js.map
@@ -8,11 +8,7 @@
8
8
  * The command's appearance can be customized by assigning its properties, for example to hide a command that is not
9
9
  * contextually relevant, or to pluralize the title based on the number of selected items.
10
10
  * @public
11
- */
12
- var Command = /** @class */ (function () {
13
- function Command() {
14
- }
15
- return Command;
16
- }());
17
- export default Command;
18
- //# sourceMappingURL=Command.js.map
11
+ */ export default class Command {
12
+ }
13
+
14
+ //# sourceMappingURL=./Command.js.map
@@ -0,0 +1,67 @@
1
+ import { ExtensionContext } from '@microsoft/sp-extension-base';
2
+ import { Text, UrlUtilities } from '@microsoft/sp-core-library';
3
+ import { PageContext } from '@microsoft/sp-page-context';
4
+ import { isSPFxListviewCommandSetGroupingEnabled } from '../common/Flights';
5
+ class ListViewCommandSetContext extends ExtensionContext {
6
+ /**
7
+ * Provides access to the ListView control that the customizer will operate on.
8
+ */ get listView() {
9
+ return this._listView;
10
+ }
11
+ /**
12
+ * Returns an array with all commands.
13
+ *
14
+ * @privateRemarks
15
+ * In the future commands won't be a flat list. This allows us to get all commands together, so we can
16
+ * provide a straight-forward API tryGetCommand in the BaseListViewCommandSet itself.
17
+ *
18
+ * @internal
19
+ */ get _commands() {
20
+ return this._commandArray;
21
+ }
22
+ /**
23
+ * @internal
24
+ */ constructor(extensionContextParameters, listViewCommandSetContextParameters){
25
+ super(extensionContextParameters);
26
+ this._listView = listViewCommandSetContextParameters.listView;
27
+ this._commandArray = [];
28
+ const itemsMap = this.manifest.items;
29
+ for (const itemId of Object.keys(itemsMap)){
30
+ const isValidCommand = isSPFxListviewCommandSetGroupingEnabled() ? itemsMap[itemId].type === 'command' || itemsMap[itemId].type === 'group' : itemsMap[itemId].type === 'command';
31
+ if (isValidCommand) {
32
+ let iconUrl = itemsMap[itemId].iconImageUrl;
33
+ if (iconUrl && !UrlUtilities.isDataUrl(iconUrl)) {
34
+ iconUrl = UrlUtilities.resolve(iconUrl, this.manifest.loaderConfig.internalModuleBaseUrls[0]);
35
+ }
36
+ this._commandArray.push({
37
+ id: itemId,
38
+ title: itemsMap[itemId].title.default || '',
39
+ ariaLabel: itemsMap[itemId].ariaLabel ? itemsMap[itemId].ariaLabel.default : undefined,
40
+ iconImageUrl: iconUrl,
41
+ visible: true,
42
+ disabled: undefined
43
+ });
44
+ }
45
+ }
46
+ // updating title and ariaLabel based on UI culture
47
+ if (this._commandArray.length) {
48
+ this.serviceScope.whenFinished(()=>{
49
+ const pageContext = this.serviceScope.consume(PageContext.serviceKey);
50
+ const currentUICulture = pageContext.cultureInfo.currentUICultureName;
51
+ this._commandArray.forEach((command)=>{
52
+ const item = itemsMap[command.id];
53
+ command.title = Text._getLocalizedString(item.title, currentUICulture) || '';
54
+ if (item.ariaLabel) {
55
+ command.ariaLabel = Text._getLocalizedString(item.ariaLabel, currentUICulture);
56
+ }
57
+ });
58
+ });
59
+ }
60
+ }
61
+ }
62
+ /**
63
+ * This object provides contextual information for BaseListViewCommandSet.
64
+ * @public
65
+ */ export { ListViewCommandSetContext as default };
66
+
67
+ //# sourceMappingURL=./ListViewCommandSetContext.js.map
@@ -2,6 +2,7 @@
2
2
  import { _SPFlight } from '@microsoft/sp-core-library';
3
3
  // https://spoflights.azurewebsites.net/Flight/Edit/SPFxListviewCommandSetGroupingEnabled
4
4
  export function isSPFxListviewCommandSetGroupingEnabled() {
5
- return _SPFlight.isEnabled(62894 /* SPFxListviewCommandSetGroupingEnabled */);
5
+ return _SPFlight.isEnabled(62894 /* SPFxListviewCommandSetGroupingEnabled */ );
6
6
  }
7
- //# sourceMappingURL=Flights.js.map
7
+
8
+ //# sourceMappingURL=./Flights.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @public
3
+ *
4
+ * Represents an SP.ListItem data (OData).
5
+ */ export { };
6
+
7
+ //# sourceMappingURL=./IListItem.js.map
@@ -1,3 +1,8 @@
1
+ class ListItemAccessor {
2
+ /** @internal */ constructor(){
3
+ // (mark constructor as internal)
4
+ }
5
+ }
1
6
  /**
2
7
  * When a field customizer extension is rendering a field, the ListItemAccessor provides
3
8
  * access to the associated SharePoint list item.
@@ -13,13 +18,6 @@
13
18
  * to be exposed, for example determining whether the associated table row is selected or not.
14
19
  *
15
20
  * @public
16
- */
17
- var ListItemAccessor = /** @class */ (function () {
18
- /** @internal */
19
- function ListItemAccessor() {
20
- // (mark constructor as internal)
21
- }
22
- return ListItemAccessor;
23
- }());
24
- export default ListItemAccessor;
25
- //# sourceMappingURL=ListItemAccessor.js.map
21
+ */ export { ListItemAccessor as default };
22
+
23
+ //# sourceMappingURL=./ListItemAccessor.js.map