@hpcc-js/phosphor 2.16.13 → 2.18.0

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/index.js CHANGED
@@ -5,8 +5,8 @@
5
5
  })(this, (function (exports, common) { 'use strict';
6
6
 
7
7
  var PKG_NAME = "@hpcc-js/phosphor";
8
- var PKG_VERSION = "2.16.13";
9
- var BUILD_VERSION = "2.104.32";
8
+ var PKG_VERSION = "2.18.0";
9
+ var BUILD_VERSION = "2.104.35";
10
10
 
11
11
  // Copyright (c) Jupyter Development Team.
12
12
  // Distributed under the terms of the Modified BSD License.
@@ -26129,6 +26129,44 @@
26129
26129
  return __assign.apply(this, arguments);
26130
26130
  };
26131
26131
 
26132
+ function __awaiter(thisArg, _arguments, P, generator) {
26133
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
26134
+ return new (P || (P = Promise))(function (resolve, reject) {
26135
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
26136
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26137
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
26138
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
26139
+ });
26140
+ }
26141
+
26142
+ function __generator(thisArg, body) {
26143
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
26144
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26145
+ function verb(n) { return function (v) { return step([n, v]); }; }
26146
+ function step(op) {
26147
+ if (f) throw new TypeError("Generator is already executing.");
26148
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
26149
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
26150
+ if (y = 0, t) op = [op[0] & 2, t.value];
26151
+ switch (op[0]) {
26152
+ case 0: case 1: t = op; break;
26153
+ case 4: _.label++; return { value: op[1], done: false };
26154
+ case 5: _.label++; y = op[1]; op = [0]; continue;
26155
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
26156
+ default:
26157
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26158
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
26159
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
26160
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
26161
+ if (t[2]) _.ops.pop();
26162
+ _.trys.pop(); continue;
26163
+ }
26164
+ op = body.call(thisArg, _);
26165
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
26166
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
26167
+ }
26168
+ }
26169
+
26132
26170
  function __spreadArray(to, from, pack) {
26133
26171
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
26134
26172
  if (ar || !(i in from)) {
@@ -26176,27 +26214,45 @@
26176
26214
 
26177
26215
  exports.Msg = void 0;
26178
26216
  (function (Msg) {
26179
- var WAActivateRequest = /** @class */ (function (_super) {
26180
- __extends(WAActivateRequest, _super);
26181
- function WAActivateRequest(wa) {
26182
- var _this = _super.call(this, "wa-activate-request") || this;
26217
+ var WAConflatableMessage = /** @class */ (function (_super) {
26218
+ __extends(WAConflatableMessage, _super);
26219
+ function WAConflatableMessage(wa, msg) {
26220
+ var _this = _super.call(this, msg) || this;
26183
26221
  _this._wa = wa;
26184
26222
  return _this;
26185
26223
  }
26186
- Object.defineProperty(WAActivateRequest.prototype, "wa", {
26224
+ Object.defineProperty(WAConflatableMessage.prototype, "wa", {
26187
26225
  get: function () {
26188
26226
  return this._wa;
26189
26227
  },
26190
26228
  enumerable: false,
26191
26229
  configurable: true
26192
26230
  });
26193
- WAActivateRequest.prototype.conflate = function (other) {
26231
+ WAConflatableMessage.prototype.conflate = function (other) {
26194
26232
  this._wa = other.wa;
26195
26233
  return true;
26196
26234
  };
26197
- return WAActivateRequest;
26235
+ return WAConflatableMessage;
26198
26236
  }(ConflatableMessage));
26237
+ Msg.WAConflatableMessage = WAConflatableMessage;
26238
+ var WAActivateRequest = /** @class */ (function (_super) {
26239
+ __extends(WAActivateRequest, _super);
26240
+ function WAActivateRequest(wa) {
26241
+ return _super.call(this, wa, WAActivateRequest.type) || this;
26242
+ }
26243
+ WAActivateRequest.type = "wa-activate-request";
26244
+ return WAActivateRequest;
26245
+ }(WAConflatableMessage));
26199
26246
  Msg.WAActivateRequest = WAActivateRequest;
26247
+ var WALayoutChanged = /** @class */ (function (_super) {
26248
+ __extends(WALayoutChanged, _super);
26249
+ function WALayoutChanged(wa) {
26250
+ return _super.call(this, wa, WALayoutChanged.type) || this;
26251
+ }
26252
+ WALayoutChanged.type = "wa-layout-changed";
26253
+ return WALayoutChanged;
26254
+ }(WAConflatableMessage));
26255
+ Msg.WALayoutChanged = WALayoutChanged;
26200
26256
  })(exports.Msg || (exports.Msg = {}));
26201
26257
  var WidgetAdapter = /** @class */ (function (_super) {
26202
26258
  __extends(WidgetAdapter, _super);
@@ -26259,6 +26315,9 @@
26259
26315
  this._widget
26260
26316
  .resize({ width: this._width - this.padding * 2 - 2, height: this._height - this.padding * 2 - 2 })
26261
26317
  .lazyRender();
26318
+ if (this._owner) {
26319
+ MessageLoop.postMessage(this._owner, new exports.Msg.WALayoutChanged(this));
26320
+ }
26262
26321
  }
26263
26322
  };
26264
26323
  WidgetAdapter.prototype.onActivateRequest = function (msg) {
@@ -26338,8 +26397,8 @@
26338
26397
  var PDockPanel = /** @class */ (function (_super) {
26339
26398
  __extends(PDockPanel, _super);
26340
26399
  function PDockPanel(options) {
26341
- var _this = this;
26342
26400
  if (options === void 0) { options = {}; }
26401
+ var _this = this;
26343
26402
  options.renderer = options.renderer || new PRenderer();
26344
26403
  _this = _super.call(this, options) || this;
26345
26404
  if (_this["_renderer"] instanceof PRenderer) {
@@ -26432,6 +26491,12 @@
26432
26491
  _this._dock = new PDockPanel({ mode: "multiple-document" });
26433
26492
  // Used to delay load a layout during render...
26434
26493
  _this._layoutObj = null;
26494
+ _this._lazyLayoutChanged = common.Utility.debounce(function () { return __awaiter(_this, void 0, void 0, function () {
26495
+ return __generator(this, function (_a) {
26496
+ this.layoutChanged();
26497
+ return [2 /*return*/];
26498
+ });
26499
+ }); }, 1000);
26435
26500
  _this._tag = "div";
26436
26501
  _this._dock.id = "p" + _this.id();
26437
26502
  MessageLoop.installMessageHook(_this, _this);
@@ -26448,12 +26513,13 @@
26448
26513
  });
26449
26514
  return retVal;
26450
26515
  };
26451
- DockPanel.prototype.addWidget = function (widget, title, location, refWidget, closable) {
26516
+ DockPanel.prototype.addWidget = function (widget, title, location, refWidget, closable, padding) {
26452
26517
  if (location === void 0) { location = "split-right"; }
26518
+ if (padding === void 0) { padding = 8; }
26453
26519
  var addMode = { mode: location, ref: this.getWidgetAdapter(refWidget) };
26454
26520
  var wa = new WidgetAdapter(this, widget, {}, closable);
26455
26521
  wa.title.label = title;
26456
- wa.padding = 8;
26522
+ wa.padding = padding;
26457
26523
  this._dock.addWidget(wa, addMode);
26458
26524
  this._dock.appendContent(wa);
26459
26525
  this._dock.tabsMovable = true;
@@ -26547,7 +26613,7 @@
26547
26613
  };
26548
26614
  DockPanel.prototype.processMessage = function (msg) {
26549
26615
  switch (msg.type) {
26550
- case "wa-activate-request":
26616
+ case exports.Msg.WAActivateRequest.type:
26551
26617
  var wa = msg.wa;
26552
26618
  var widget = wa.widget;
26553
26619
  if (this._prevActive !== widget) {
@@ -26555,13 +26621,19 @@
26555
26621
  this.childActivation(widget, wa);
26556
26622
  }
26557
26623
  break;
26624
+ case exports.Msg.WALayoutChanged.type:
26625
+ this._lazyLayoutChanged();
26626
+ break;
26558
26627
  }
26559
26628
  };
26560
- DockPanel.prototype.childActivation = function (w, wa) {
26561
- };
26562
26629
  DockPanel.prototype.active = function () {
26563
26630
  return this._prevActive;
26564
26631
  };
26632
+ // Events ---
26633
+ DockPanel.prototype.childActivation = function (w, wa) {
26634
+ };
26635
+ DockPanel.prototype.layoutChanged = function () {
26636
+ };
26565
26637
  return DockPanel;
26566
26638
  }(common.HTMLWidget));
26567
26639
  DockPanel.prototype._class += " phosphor_DockPanel";