gd-sprest-bs 10.4.5 → 10.4.6

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.
@@ -30,8 +30,14 @@ var _SPFxWebPart = /** @class */ (function () {
30
30
  var isEdit = false;
31
31
  // Save the properties
32
32
  this._props = props;
33
- // Set the context
34
- this._props.context ? gd_sprest_1.ContextInfo.setPageContext(this._props.context) : null;
33
+ // Ensure the spfx object was set
34
+ if (this._props.spfx == null) {
35
+ // Error
36
+ console.error("[gd-sprest-bs] The spfx property wasn't set.");
37
+ return;
38
+ }
39
+ // Set the page context
40
+ gd_sprest_1.ContextInfo.setPageContext(this._props.spfx.context.pageContext);
35
41
  // Try to parse the configuration
36
42
  if (this._props.wpCfg) {
37
43
  try {
@@ -46,7 +52,7 @@ var _SPFxWebPart = /** @class */ (function () {
46
52
  }
47
53
  else {
48
54
  // Set the flag
49
- isEdit = this._props.displayMode == gd_sprest_1.SPTypes.FormDisplayMode.Edit;
55
+ isEdit = this._props.spfx.displayMode == gd_sprest_1.SPTypes.FormDisplayMode.Edit;
50
56
  }
51
57
  // Ensure we are in edit mode
52
58
  if (isEdit) {
@@ -71,14 +77,14 @@ var _SPFxWebPart = /** @class */ (function () {
71
77
  // Method to render the webpart
72
78
  _SPFxWebPart.prototype.render = function () {
73
79
  // Call the render event
74
- this._props.render ? this._props.render(this._props.el) : null;
80
+ this._props.render ? this._props.render(this._props.spfx.domElement) : null;
75
81
  };
76
82
  // Method to render the edit interface
77
83
  _SPFxWebPart.prototype.renderEdit = function () {
78
84
  var _this = this;
79
85
  // Render the edit button
80
86
  gd_bs_1.Components.Button({
81
- el: this._props.el,
87
+ el: this._props.spfx.domElement,
82
88
  text: "Edit",
83
89
  onClick: function () {
84
90
  // Display the modal
@@ -86,7 +92,7 @@ var _SPFxWebPart = /** @class */ (function () {
86
92
  });
87
93
  // Create the modal props
88
94
  var modalProps = {
89
- el: this._props.el,
95
+ el: this._props.spfx.domElement,
90
96
  onRenderBody: function (el) {
91
97
  // Create the form properties
92
98
  var formProps = { el: el, value: _this._cfg };