gd-sprest-bs 10.4.9 → 10.5.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.
@@ -49,10 +49,30 @@ var _SPFxWebPart = /** @class */ (function () {
49
49
  // Set the webpart properties pane to trigger the modal from displaying
50
50
  var propertyPageConfig = this._props.spfx.getPropertyPaneConfiguration;
51
51
  this._props.spfx.getPropertyPaneConfiguration = function () {
52
- // Display the modal
53
- _this._modal.show();
54
- // Call the original event
55
- return propertyPageConfig ? propertyPageConfig() : null;
52
+ // Get the original configuration
53
+ var config = propertyPageConfig ? propertyPageConfig() : null;
54
+ // Update the configuration w/ a button
55
+ config = config || {};
56
+ config.pages = config.pages || [];
57
+ config.pages.push({
58
+ header: {
59
+ description: "Configuration"
60
+ },
61
+ groups: [
62
+ {
63
+ groupFields: [{
64
+ targetProperty: "configuration",
65
+ type: gd_sprest_1.SPTypes.PropertyPaneType.Button,
66
+ onClick: function () {
67
+ // Call the click event
68
+ _this.editButtonClick();
69
+ }
70
+ }]
71
+ }
72
+ ]
73
+ });
74
+ // Call the configuration
75
+ return config;
56
76
  };
57
77
  // See if this is the workbench
58
78
  if (window.location.pathname.indexOf("workbench.aspx") > 0) {
@@ -92,6 +112,13 @@ var _SPFxWebPart = /** @class */ (function () {
92
112
  enumerable: false,
93
113
  configurable: true
94
114
  });
115
+ // The click event for the button
116
+ _SPFxWebPart.prototype.editButtonClick = function () {
117
+ // Display the modal
118
+ this._modal.show();
119
+ // Hide the property pane
120
+ this._props.spfx.context.propertyPane.close();
121
+ };
95
122
  // Method to render the webpart
96
123
  _SPFxWebPart.prototype.render = function () {
97
124
  // Call the render event
@@ -105,7 +132,8 @@ var _SPFxWebPart = /** @class */ (function () {
105
132
  el: this._props.spfx.domElement,
106
133
  text: "Edit",
107
134
  onClick: function () {
108
- // Display the modal
135
+ // Call the click event
136
+ _this.editButtonClick();
109
137
  }
110
138
  });
111
139
  // Create the modal props
@@ -145,6 +173,7 @@ var _SPFxWebPart = /** @class */ (function () {
145
173
  catch (_a) { }
146
174
  // Save the configuration
147
175
  _this._props.spfxSaveConfig ? _this._props.spfxSaveConfig(wpCfg) : null;
176
+ _this._props.spfx.properties.configuration = wpCfg;
148
177
  // Call the saved event
149
178
  _this._props.onConfigSaved ? _this._props.onConfigSaved(cfg) : null;
150
179
  }