@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.es6.js CHANGED
@@ -1,8 +1,8 @@
1
- import { select, Widget as Widget$1, HTMLWidget } from '@hpcc-js/common';
1
+ import { select, Widget as Widget$1, HTMLWidget, Utility } from '@hpcc-js/common';
2
2
 
3
3
  var PKG_NAME = "@hpcc-js/phosphor";
4
- var PKG_VERSION = "2.16.13";
5
- var BUILD_VERSION = "2.104.32";
4
+ var PKG_VERSION = "2.18.0";
5
+ var BUILD_VERSION = "2.104.35";
6
6
 
7
7
  // Copyright (c) Jupyter Development Team.
8
8
  // Distributed under the terms of the Modified BSD License.
@@ -26125,6 +26125,44 @@ var __assign = function() {
26125
26125
  return __assign.apply(this, arguments);
26126
26126
  };
26127
26127
 
26128
+ function __awaiter(thisArg, _arguments, P, generator) {
26129
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
26130
+ return new (P || (P = Promise))(function (resolve, reject) {
26131
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
26132
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26133
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
26134
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
26135
+ });
26136
+ }
26137
+
26138
+ function __generator(thisArg, body) {
26139
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
26140
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26141
+ function verb(n) { return function (v) { return step([n, v]); }; }
26142
+ function step(op) {
26143
+ if (f) throw new TypeError("Generator is already executing.");
26144
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
26145
+ 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;
26146
+ if (y = 0, t) op = [op[0] & 2, t.value];
26147
+ switch (op[0]) {
26148
+ case 0: case 1: t = op; break;
26149
+ case 4: _.label++; return { value: op[1], done: false };
26150
+ case 5: _.label++; y = op[1]; op = [0]; continue;
26151
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
26152
+ default:
26153
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26154
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
26155
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
26156
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
26157
+ if (t[2]) _.ops.pop();
26158
+ _.trys.pop(); continue;
26159
+ }
26160
+ op = body.call(thisArg, _);
26161
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
26162
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
26163
+ }
26164
+ }
26165
+
26128
26166
  function __spreadArray(to, from, pack) {
26129
26167
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
26130
26168
  if (ar || !(i in from)) {
@@ -26172,27 +26210,45 @@ styleInject(css_248z$1);
26172
26210
 
26173
26211
  var Msg;
26174
26212
  (function (Msg) {
26175
- var WAActivateRequest = /** @class */ (function (_super) {
26176
- __extends(WAActivateRequest, _super);
26177
- function WAActivateRequest(wa) {
26178
- var _this = _super.call(this, "wa-activate-request") || this;
26213
+ var WAConflatableMessage = /** @class */ (function (_super) {
26214
+ __extends(WAConflatableMessage, _super);
26215
+ function WAConflatableMessage(wa, msg) {
26216
+ var _this = _super.call(this, msg) || this;
26179
26217
  _this._wa = wa;
26180
26218
  return _this;
26181
26219
  }
26182
- Object.defineProperty(WAActivateRequest.prototype, "wa", {
26220
+ Object.defineProperty(WAConflatableMessage.prototype, "wa", {
26183
26221
  get: function () {
26184
26222
  return this._wa;
26185
26223
  },
26186
26224
  enumerable: false,
26187
26225
  configurable: true
26188
26226
  });
26189
- WAActivateRequest.prototype.conflate = function (other) {
26227
+ WAConflatableMessage.prototype.conflate = function (other) {
26190
26228
  this._wa = other.wa;
26191
26229
  return true;
26192
26230
  };
26193
- return WAActivateRequest;
26231
+ return WAConflatableMessage;
26194
26232
  }(ConflatableMessage));
26233
+ Msg.WAConflatableMessage = WAConflatableMessage;
26234
+ var WAActivateRequest = /** @class */ (function (_super) {
26235
+ __extends(WAActivateRequest, _super);
26236
+ function WAActivateRequest(wa) {
26237
+ return _super.call(this, wa, WAActivateRequest.type) || this;
26238
+ }
26239
+ WAActivateRequest.type = "wa-activate-request";
26240
+ return WAActivateRequest;
26241
+ }(WAConflatableMessage));
26195
26242
  Msg.WAActivateRequest = WAActivateRequest;
26243
+ var WALayoutChanged = /** @class */ (function (_super) {
26244
+ __extends(WALayoutChanged, _super);
26245
+ function WALayoutChanged(wa) {
26246
+ return _super.call(this, wa, WALayoutChanged.type) || this;
26247
+ }
26248
+ WALayoutChanged.type = "wa-layout-changed";
26249
+ return WALayoutChanged;
26250
+ }(WAConflatableMessage));
26251
+ Msg.WALayoutChanged = WALayoutChanged;
26196
26252
  })(Msg || (Msg = {}));
26197
26253
  var WidgetAdapter = /** @class */ (function (_super) {
26198
26254
  __extends(WidgetAdapter, _super);
@@ -26255,6 +26311,9 @@ var WidgetAdapter = /** @class */ (function (_super) {
26255
26311
  this._widget
26256
26312
  .resize({ width: this._width - this.padding * 2 - 2, height: this._height - this.padding * 2 - 2 })
26257
26313
  .lazyRender();
26314
+ if (this._owner) {
26315
+ MessageLoop.postMessage(this._owner, new Msg.WALayoutChanged(this));
26316
+ }
26258
26317
  }
26259
26318
  };
26260
26319
  WidgetAdapter.prototype.onActivateRequest = function (msg) {
@@ -26334,8 +26393,8 @@ var PRenderer = /** @class */ (function (_super) {
26334
26393
  var PDockPanel = /** @class */ (function (_super) {
26335
26394
  __extends(PDockPanel, _super);
26336
26395
  function PDockPanel(options) {
26337
- var _this = this;
26338
26396
  if (options === void 0) { options = {}; }
26397
+ var _this = this;
26339
26398
  options.renderer = options.renderer || new PRenderer();
26340
26399
  _this = _super.call(this, options) || this;
26341
26400
  if (_this["_renderer"] instanceof PRenderer) {
@@ -26428,6 +26487,12 @@ var DockPanel = /** @class */ (function (_super) {
26428
26487
  _this._dock = new PDockPanel({ mode: "multiple-document" });
26429
26488
  // Used to delay load a layout during render...
26430
26489
  _this._layoutObj = null;
26490
+ _this._lazyLayoutChanged = Utility.debounce(function () { return __awaiter(_this, void 0, void 0, function () {
26491
+ return __generator(this, function (_a) {
26492
+ this.layoutChanged();
26493
+ return [2 /*return*/];
26494
+ });
26495
+ }); }, 1000);
26431
26496
  _this._tag = "div";
26432
26497
  _this._dock.id = "p" + _this.id();
26433
26498
  MessageLoop.installMessageHook(_this, _this);
@@ -26444,12 +26509,13 @@ var DockPanel = /** @class */ (function (_super) {
26444
26509
  });
26445
26510
  return retVal;
26446
26511
  };
26447
- DockPanel.prototype.addWidget = function (widget, title, location, refWidget, closable) {
26512
+ DockPanel.prototype.addWidget = function (widget, title, location, refWidget, closable, padding) {
26448
26513
  if (location === void 0) { location = "split-right"; }
26514
+ if (padding === void 0) { padding = 8; }
26449
26515
  var addMode = { mode: location, ref: this.getWidgetAdapter(refWidget) };
26450
26516
  var wa = new WidgetAdapter(this, widget, {}, closable);
26451
26517
  wa.title.label = title;
26452
- wa.padding = 8;
26518
+ wa.padding = padding;
26453
26519
  this._dock.addWidget(wa, addMode);
26454
26520
  this._dock.appendContent(wa);
26455
26521
  this._dock.tabsMovable = true;
@@ -26543,7 +26609,7 @@ var DockPanel = /** @class */ (function (_super) {
26543
26609
  };
26544
26610
  DockPanel.prototype.processMessage = function (msg) {
26545
26611
  switch (msg.type) {
26546
- case "wa-activate-request":
26612
+ case Msg.WAActivateRequest.type:
26547
26613
  var wa = msg.wa;
26548
26614
  var widget = wa.widget;
26549
26615
  if (this._prevActive !== widget) {
@@ -26551,13 +26617,19 @@ var DockPanel = /** @class */ (function (_super) {
26551
26617
  this.childActivation(widget, wa);
26552
26618
  }
26553
26619
  break;
26620
+ case Msg.WALayoutChanged.type:
26621
+ this._lazyLayoutChanged();
26622
+ break;
26554
26623
  }
26555
26624
  };
26556
- DockPanel.prototype.childActivation = function (w, wa) {
26557
- };
26558
26625
  DockPanel.prototype.active = function () {
26559
26626
  return this._prevActive;
26560
26627
  };
26628
+ // Events ---
26629
+ DockPanel.prototype.childActivation = function (w, wa) {
26630
+ };
26631
+ DockPanel.prototype.layoutChanged = function () {
26632
+ };
26561
26633
  return DockPanel;
26562
26634
  }(HTMLWidget));
26563
26635
  DockPanel.prototype._class += " phosphor_DockPanel";