@hpcc-js/phosphor 2.16.5 → 2.16.7
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 +499 -315
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +499 -315
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +20 -5
- package/dist/index.min.js.map +1 -1
- package/package.json +7 -7
- package/src/__package__.ts +2 -2
- package/types/__package__.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.es6.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { select, Widget as Widget$1, HTMLWidget } from '@hpcc-js/common';
|
|
2
2
|
|
|
3
3
|
var PKG_NAME = "@hpcc-js/phosphor";
|
|
4
|
-
var PKG_VERSION = "2.16.
|
|
5
|
-
var BUILD_VERSION = "2.104.
|
|
4
|
+
var PKG_VERSION = "2.16.7";
|
|
5
|
+
var BUILD_VERSION = "2.104.14";
|
|
6
6
|
|
|
7
7
|
// Copyright (c) Jupyter Development Team.
|
|
8
8
|
// Distributed under the terms of the Modified BSD License.
|
|
@@ -2823,6 +2823,195 @@ var UUID;
|
|
|
2823
2823
|
UUID.uuid4 = uuid4Factory(Random.getRandomValues);
|
|
2824
2824
|
})(UUID || (UUID = {}));
|
|
2825
2825
|
|
|
2826
|
+
// Copyright (c) Jupyter Development Team.
|
|
2827
|
+
// Distributed under the terms of the Modified BSD License.
|
|
2828
|
+
/*-----------------------------------------------------------------------------
|
|
2829
|
+
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
|
2830
|
+
|
|
|
2831
|
+
| Distributed under the terms of the BSD 3-Clause License.
|
|
2832
|
+
|
|
|
2833
|
+
| The full license is in the file LICENSE, distributed with this software.
|
|
2834
|
+
|----------------------------------------------------------------------------*/
|
|
2835
|
+
/**
|
|
2836
|
+
* A class which attaches a value to an external object.
|
|
2837
|
+
*
|
|
2838
|
+
* #### Notes
|
|
2839
|
+
* Attached properties are used to extend the state of an object with
|
|
2840
|
+
* semantic data from an unrelated class. They also encapsulate value
|
|
2841
|
+
* creation, coercion, and notification.
|
|
2842
|
+
*
|
|
2843
|
+
* Because attached property values are stored in a hash table, which
|
|
2844
|
+
* in turn is stored in a WeakMap keyed on the owner object, there is
|
|
2845
|
+
* non-trivial storage overhead involved in their use. The pattern is
|
|
2846
|
+
* therefore best used for the storage of rare data.
|
|
2847
|
+
*/
|
|
2848
|
+
var AttachedProperty = /** @class */ (function () {
|
|
2849
|
+
/**
|
|
2850
|
+
* Construct a new attached property.
|
|
2851
|
+
*
|
|
2852
|
+
* @param options - The options for initializing the property.
|
|
2853
|
+
*/
|
|
2854
|
+
function AttachedProperty(options) {
|
|
2855
|
+
this._pid = Private$r.nextPID();
|
|
2856
|
+
this.name = options.name;
|
|
2857
|
+
this._create = options.create;
|
|
2858
|
+
this._coerce = options.coerce || null;
|
|
2859
|
+
this._compare = options.compare || null;
|
|
2860
|
+
this._changed = options.changed || null;
|
|
2861
|
+
}
|
|
2862
|
+
/**
|
|
2863
|
+
* Get the current value of the property for a given owner.
|
|
2864
|
+
*
|
|
2865
|
+
* @param owner - The property owner of interest.
|
|
2866
|
+
*
|
|
2867
|
+
* @returns The current value of the property.
|
|
2868
|
+
*
|
|
2869
|
+
* #### Notes
|
|
2870
|
+
* If the value has not yet been set, the default value will be
|
|
2871
|
+
* computed and assigned as the current value of the property.
|
|
2872
|
+
*/
|
|
2873
|
+
AttachedProperty.prototype.get = function (owner) {
|
|
2874
|
+
var value;
|
|
2875
|
+
var map = Private$r.ensureMap(owner);
|
|
2876
|
+
if (this._pid in map) {
|
|
2877
|
+
value = map[this._pid];
|
|
2878
|
+
}
|
|
2879
|
+
else {
|
|
2880
|
+
value = map[this._pid] = this._createValue(owner);
|
|
2881
|
+
}
|
|
2882
|
+
return value;
|
|
2883
|
+
};
|
|
2884
|
+
/**
|
|
2885
|
+
* Set the current value of the property for a given owner.
|
|
2886
|
+
*
|
|
2887
|
+
* @param owner - The property owner of interest.
|
|
2888
|
+
*
|
|
2889
|
+
* @param value - The value for the property.
|
|
2890
|
+
*
|
|
2891
|
+
* #### Notes
|
|
2892
|
+
* If the value has not yet been set, the default value will be
|
|
2893
|
+
* computed and used as the previous value for the comparison.
|
|
2894
|
+
*/
|
|
2895
|
+
AttachedProperty.prototype.set = function (owner, value) {
|
|
2896
|
+
var oldValue;
|
|
2897
|
+
var map = Private$r.ensureMap(owner);
|
|
2898
|
+
if (this._pid in map) {
|
|
2899
|
+
oldValue = map[this._pid];
|
|
2900
|
+
}
|
|
2901
|
+
else {
|
|
2902
|
+
oldValue = map[this._pid] = this._createValue(owner);
|
|
2903
|
+
}
|
|
2904
|
+
var newValue = this._coerceValue(owner, value);
|
|
2905
|
+
this._maybeNotify(owner, oldValue, (map[this._pid] = newValue));
|
|
2906
|
+
};
|
|
2907
|
+
/**
|
|
2908
|
+
* Explicitly coerce the current property value for a given owner.
|
|
2909
|
+
*
|
|
2910
|
+
* @param owner - The property owner of interest.
|
|
2911
|
+
*
|
|
2912
|
+
* #### Notes
|
|
2913
|
+
* If the value has not yet been set, the default value will be
|
|
2914
|
+
* computed and used as the previous value for the comparison.
|
|
2915
|
+
*/
|
|
2916
|
+
AttachedProperty.prototype.coerce = function (owner) {
|
|
2917
|
+
var oldValue;
|
|
2918
|
+
var map = Private$r.ensureMap(owner);
|
|
2919
|
+
if (this._pid in map) {
|
|
2920
|
+
oldValue = map[this._pid];
|
|
2921
|
+
}
|
|
2922
|
+
else {
|
|
2923
|
+
oldValue = map[this._pid] = this._createValue(owner);
|
|
2924
|
+
}
|
|
2925
|
+
var newValue = this._coerceValue(owner, oldValue);
|
|
2926
|
+
this._maybeNotify(owner, oldValue, (map[this._pid] = newValue));
|
|
2927
|
+
};
|
|
2928
|
+
/**
|
|
2929
|
+
* Get or create the default value for the given owner.
|
|
2930
|
+
*/
|
|
2931
|
+
AttachedProperty.prototype._createValue = function (owner) {
|
|
2932
|
+
var create = this._create;
|
|
2933
|
+
return create(owner);
|
|
2934
|
+
};
|
|
2935
|
+
/**
|
|
2936
|
+
* Coerce the value for the given owner.
|
|
2937
|
+
*/
|
|
2938
|
+
AttachedProperty.prototype._coerceValue = function (owner, value) {
|
|
2939
|
+
var coerce = this._coerce;
|
|
2940
|
+
return coerce ? coerce(owner, value) : value;
|
|
2941
|
+
};
|
|
2942
|
+
/**
|
|
2943
|
+
* Compare the old value and new value for equality.
|
|
2944
|
+
*/
|
|
2945
|
+
AttachedProperty.prototype._compareValue = function (oldValue, newValue) {
|
|
2946
|
+
var compare = this._compare;
|
|
2947
|
+
return compare ? compare(oldValue, newValue) : oldValue === newValue;
|
|
2948
|
+
};
|
|
2949
|
+
/**
|
|
2950
|
+
* Run the change notification if the given values are different.
|
|
2951
|
+
*/
|
|
2952
|
+
AttachedProperty.prototype._maybeNotify = function (owner, oldValue, newValue) {
|
|
2953
|
+
var changed = this._changed;
|
|
2954
|
+
if (changed && !this._compareValue(oldValue, newValue)) {
|
|
2955
|
+
changed(owner, oldValue, newValue);
|
|
2956
|
+
}
|
|
2957
|
+
};
|
|
2958
|
+
return AttachedProperty;
|
|
2959
|
+
}());
|
|
2960
|
+
/**
|
|
2961
|
+
* The namespace for the `AttachedProperty` class statics.
|
|
2962
|
+
*/
|
|
2963
|
+
(function (AttachedProperty) {
|
|
2964
|
+
/**
|
|
2965
|
+
* Clear the stored property data for the given owner.
|
|
2966
|
+
*
|
|
2967
|
+
* @param owner - The property owner of interest.
|
|
2968
|
+
*
|
|
2969
|
+
* #### Notes
|
|
2970
|
+
* This will clear all property values for the owner, but it will
|
|
2971
|
+
* **not** run the change notification for any of the properties.
|
|
2972
|
+
*/
|
|
2973
|
+
function clearData(owner) {
|
|
2974
|
+
Private$r.ownerData.delete(owner);
|
|
2975
|
+
}
|
|
2976
|
+
AttachedProperty.clearData = clearData;
|
|
2977
|
+
})(AttachedProperty || (AttachedProperty = {}));
|
|
2978
|
+
/**
|
|
2979
|
+
* The namespace for the module implementation details.
|
|
2980
|
+
*/
|
|
2981
|
+
var Private$r;
|
|
2982
|
+
(function (Private) {
|
|
2983
|
+
/**
|
|
2984
|
+
* A weak mapping of property owner to property map.
|
|
2985
|
+
*/
|
|
2986
|
+
Private.ownerData = new WeakMap();
|
|
2987
|
+
/**
|
|
2988
|
+
* A function which computes successive unique property ids.
|
|
2989
|
+
*/
|
|
2990
|
+
Private.nextPID = (function () {
|
|
2991
|
+
var id = 0;
|
|
2992
|
+
return function () {
|
|
2993
|
+
var rand = Math.random();
|
|
2994
|
+
var stem = ("" + rand).slice(2);
|
|
2995
|
+
return "pid-" + stem + "-" + id++;
|
|
2996
|
+
};
|
|
2997
|
+
})();
|
|
2998
|
+
/**
|
|
2999
|
+
* Lookup the data map for the property owner.
|
|
3000
|
+
*
|
|
3001
|
+
* This will create the map if one does not already exist.
|
|
3002
|
+
*/
|
|
3003
|
+
function ensureMap(owner) {
|
|
3004
|
+
var map = Private.ownerData.get(owner);
|
|
3005
|
+
if (map) {
|
|
3006
|
+
return map;
|
|
3007
|
+
}
|
|
3008
|
+
map = Object.create(null);
|
|
3009
|
+
Private.ownerData.set(owner, map);
|
|
3010
|
+
return map;
|
|
3011
|
+
}
|
|
3012
|
+
Private.ensureMap = ensureMap;
|
|
3013
|
+
})(Private$r || (Private$r = {}));
|
|
3014
|
+
|
|
2826
3015
|
// Copyright (c) Jupyter Development Team.
|
|
2827
3016
|
/**
|
|
2828
3017
|
* A concrete implementation of `ISignal`.
|
|
@@ -2880,8 +3069,26 @@ var Signal = /** @class */ (function () {
|
|
|
2880
3069
|
* @param sender - The sender which owns the signal.
|
|
2881
3070
|
*/
|
|
2882
3071
|
function Signal(sender) {
|
|
3072
|
+
this._blockedCount = 0;
|
|
2883
3073
|
this.sender = sender;
|
|
2884
3074
|
}
|
|
3075
|
+
/**
|
|
3076
|
+
* Block the signal during the execution of a callback.
|
|
3077
|
+
*
|
|
3078
|
+
* ### Notes
|
|
3079
|
+
* The callback function must be synchronous.
|
|
3080
|
+
*
|
|
3081
|
+
* @param fn The callback during which the signal is blocked
|
|
3082
|
+
*/
|
|
3083
|
+
Signal.prototype.block = function (fn) {
|
|
3084
|
+
this._blockedCount++;
|
|
3085
|
+
try {
|
|
3086
|
+
fn();
|
|
3087
|
+
}
|
|
3088
|
+
finally {
|
|
3089
|
+
this._blockedCount--;
|
|
3090
|
+
}
|
|
3091
|
+
};
|
|
2885
3092
|
/**
|
|
2886
3093
|
* Connect a slot to the signal.
|
|
2887
3094
|
*
|
|
@@ -2893,7 +3100,7 @@ var Signal = /** @class */ (function () {
|
|
|
2893
3100
|
* @returns `true` if the connection succeeds, `false` otherwise.
|
|
2894
3101
|
*/
|
|
2895
3102
|
Signal.prototype.connect = function (slot, thisArg) {
|
|
2896
|
-
return Private$
|
|
3103
|
+
return Private$q.connect(this, slot, thisArg);
|
|
2897
3104
|
};
|
|
2898
3105
|
/**
|
|
2899
3106
|
* Disconnect a slot from the signal.
|
|
@@ -2906,7 +3113,7 @@ var Signal = /** @class */ (function () {
|
|
|
2906
3113
|
* @returns `true` if the connection is removed, `false` otherwise.
|
|
2907
3114
|
*/
|
|
2908
3115
|
Signal.prototype.disconnect = function (slot, thisArg) {
|
|
2909
|
-
return Private$
|
|
3116
|
+
return Private$q.disconnect(this, slot, thisArg);
|
|
2910
3117
|
};
|
|
2911
3118
|
/**
|
|
2912
3119
|
* Emit the signal and invoke the connected slots.
|
|
@@ -2919,7 +3126,9 @@ var Signal = /** @class */ (function () {
|
|
|
2919
3126
|
* Exceptions thrown by connected slots will be caught and logged.
|
|
2920
3127
|
*/
|
|
2921
3128
|
Signal.prototype.emit = function (args) {
|
|
2922
|
-
|
|
3129
|
+
if (!this._blockedCount) {
|
|
3130
|
+
Private$q.emit(this, args);
|
|
3131
|
+
}
|
|
2923
3132
|
};
|
|
2924
3133
|
return Signal;
|
|
2925
3134
|
}());
|
|
@@ -2927,6 +3136,27 @@ var Signal = /** @class */ (function () {
|
|
|
2927
3136
|
* The namespace for the `Signal` class statics.
|
|
2928
3137
|
*/
|
|
2929
3138
|
(function (Signal) {
|
|
3139
|
+
/**
|
|
3140
|
+
* Block all signals emitted by an object during
|
|
3141
|
+
* the execution of a callback.
|
|
3142
|
+
*
|
|
3143
|
+
* ### Notes
|
|
3144
|
+
* The callback function must be synchronous.
|
|
3145
|
+
*
|
|
3146
|
+
* @param sender The signals sender
|
|
3147
|
+
* @param fn The callback during which all signals are blocked
|
|
3148
|
+
*/
|
|
3149
|
+
function blockAll(sender, fn) {
|
|
3150
|
+
var blockedProperty = Private$q.blockedProperty;
|
|
3151
|
+
blockedProperty.set(sender, blockedProperty.get(sender) + 1);
|
|
3152
|
+
try {
|
|
3153
|
+
fn();
|
|
3154
|
+
}
|
|
3155
|
+
finally {
|
|
3156
|
+
blockedProperty.set(sender, blockedProperty.get(sender) - 1);
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
3159
|
+
Signal.blockAll = blockAll;
|
|
2930
3160
|
/**
|
|
2931
3161
|
* Remove all connections between a sender and receiver.
|
|
2932
3162
|
*
|
|
@@ -2940,7 +3170,7 @@ var Signal = /** @class */ (function () {
|
|
|
2940
3170
|
* the receiver.
|
|
2941
3171
|
*/
|
|
2942
3172
|
function disconnectBetween(sender, receiver) {
|
|
2943
|
-
Private$
|
|
3173
|
+
Private$q.disconnectBetween(sender, receiver);
|
|
2944
3174
|
}
|
|
2945
3175
|
Signal.disconnectBetween = disconnectBetween;
|
|
2946
3176
|
/**
|
|
@@ -2949,7 +3179,7 @@ var Signal = /** @class */ (function () {
|
|
|
2949
3179
|
* @param sender - The sender object of interest.
|
|
2950
3180
|
*/
|
|
2951
3181
|
function disconnectSender(sender) {
|
|
2952
|
-
Private$
|
|
3182
|
+
Private$q.disconnectSender(sender);
|
|
2953
3183
|
}
|
|
2954
3184
|
Signal.disconnectSender = disconnectSender;
|
|
2955
3185
|
/**
|
|
@@ -2963,7 +3193,7 @@ var Signal = /** @class */ (function () {
|
|
|
2963
3193
|
* the receiver.
|
|
2964
3194
|
*/
|
|
2965
3195
|
function disconnectReceiver(receiver) {
|
|
2966
|
-
Private$
|
|
3196
|
+
Private$q.disconnectReceiver(receiver);
|
|
2967
3197
|
}
|
|
2968
3198
|
Signal.disconnectReceiver = disconnectReceiver;
|
|
2969
3199
|
/**
|
|
@@ -2977,7 +3207,7 @@ var Signal = /** @class */ (function () {
|
|
|
2977
3207
|
* the receiver.
|
|
2978
3208
|
*/
|
|
2979
3209
|
function disconnectAll(object) {
|
|
2980
|
-
Private$
|
|
3210
|
+
Private$q.disconnectAll(object);
|
|
2981
3211
|
}
|
|
2982
3212
|
Signal.disconnectAll = disconnectAll;
|
|
2983
3213
|
/**
|
|
@@ -2990,7 +3220,7 @@ var Signal = /** @class */ (function () {
|
|
|
2990
3220
|
* associated with the object.
|
|
2991
3221
|
*/
|
|
2992
3222
|
function clearData(object) {
|
|
2993
|
-
Private$
|
|
3223
|
+
Private$q.disconnectAll(object);
|
|
2994
3224
|
}
|
|
2995
3225
|
Signal.clearData = clearData;
|
|
2996
3226
|
/**
|
|
@@ -3002,7 +3232,7 @@ var Signal = /** @class */ (function () {
|
|
|
3002
3232
|
* The default exception handler is `console.error`.
|
|
3003
3233
|
*/
|
|
3004
3234
|
function getExceptionHandler() {
|
|
3005
|
-
return Private$
|
|
3235
|
+
return Private$q.exceptionHandler;
|
|
3006
3236
|
}
|
|
3007
3237
|
Signal.getExceptionHandler = getExceptionHandler;
|
|
3008
3238
|
/**
|
|
@@ -3016,8 +3246,8 @@ var Signal = /** @class */ (function () {
|
|
|
3016
3246
|
* The exception handler is invoked when a slot throws an exception.
|
|
3017
3247
|
*/
|
|
3018
3248
|
function setExceptionHandler(handler) {
|
|
3019
|
-
var old = Private$
|
|
3020
|
-
Private$
|
|
3249
|
+
var old = Private$q.exceptionHandler;
|
|
3250
|
+
Private$q.exceptionHandler = handler;
|
|
3021
3251
|
return old;
|
|
3022
3252
|
}
|
|
3023
3253
|
Signal.setExceptionHandler = setExceptionHandler;
|
|
@@ -3025,7 +3255,7 @@ var Signal = /** @class */ (function () {
|
|
|
3025
3255
|
/**
|
|
3026
3256
|
* The namespace for the module implementation details.
|
|
3027
3257
|
*/
|
|
3028
|
-
var Private$
|
|
3258
|
+
var Private$q;
|
|
3029
3259
|
(function (Private) {
|
|
3030
3260
|
/**
|
|
3031
3261
|
* The signal exception handler function.
|
|
@@ -3226,6 +3456,9 @@ var Private$r;
|
|
|
3226
3456
|
* Exceptions thrown by connected slots will be caught and logged.
|
|
3227
3457
|
*/
|
|
3228
3458
|
function emit(signal, args) {
|
|
3459
|
+
if (Private.blockedProperty.get(signal.sender) > 0) {
|
|
3460
|
+
return;
|
|
3461
|
+
}
|
|
3229
3462
|
// If there are no receivers, there is nothing to do.
|
|
3230
3463
|
var receivers = receiversForSender.get(signal.sender);
|
|
3231
3464
|
if (!receivers || receivers.length === 0) {
|
|
@@ -3329,7 +3562,14 @@ var Private$r;
|
|
|
3329
3562
|
function isDeadConnection(connection) {
|
|
3330
3563
|
return connection.signal === null;
|
|
3331
3564
|
}
|
|
3332
|
-
|
|
3565
|
+
/**
|
|
3566
|
+
* A property indicating a sender has been blocked if its value is not 0.
|
|
3567
|
+
*/
|
|
3568
|
+
Private.blockedProperty = new AttachedProperty({
|
|
3569
|
+
name: 'blocked',
|
|
3570
|
+
create: function () { return 0; }
|
|
3571
|
+
});
|
|
3572
|
+
})(Private$q || (Private$q = {}));
|
|
3333
3573
|
|
|
3334
3574
|
/*! *****************************************************************************
|
|
3335
3575
|
Copyright (c) Microsoft Corporation.
|
|
@@ -3834,11 +4074,11 @@ var Selector;
|
|
|
3834
4074
|
* same selector are extremely fast.
|
|
3835
4075
|
*/
|
|
3836
4076
|
function calculateSpecificity(selector) {
|
|
3837
|
-
if (selector in Private$
|
|
3838
|
-
return Private$
|
|
4077
|
+
if (selector in Private$p.specificityCache) {
|
|
4078
|
+
return Private$p.specificityCache[selector];
|
|
3839
4079
|
}
|
|
3840
|
-
var result = Private$
|
|
3841
|
-
return (Private$
|
|
4080
|
+
var result = Private$p.calculateSingle(selector);
|
|
4081
|
+
return (Private$p.specificityCache[selector] = result);
|
|
3842
4082
|
}
|
|
3843
4083
|
Selector.calculateSpecificity = calculateSpecificity;
|
|
3844
4084
|
/**
|
|
@@ -3853,17 +4093,17 @@ var Selector;
|
|
|
3853
4093
|
* selector are extremely fast.
|
|
3854
4094
|
*/
|
|
3855
4095
|
function isValid(selector) {
|
|
3856
|
-
if (selector in Private$
|
|
3857
|
-
return Private$
|
|
4096
|
+
if (selector in Private$p.validityCache) {
|
|
4097
|
+
return Private$p.validityCache[selector];
|
|
3858
4098
|
}
|
|
3859
4099
|
var result = true;
|
|
3860
4100
|
try {
|
|
3861
|
-
Private$
|
|
4101
|
+
Private$p.testElem.querySelector(selector);
|
|
3862
4102
|
}
|
|
3863
4103
|
catch (err) {
|
|
3864
4104
|
result = false;
|
|
3865
4105
|
}
|
|
3866
|
-
return (Private$
|
|
4106
|
+
return (Private$p.validityCache[selector] = result);
|
|
3867
4107
|
}
|
|
3868
4108
|
Selector.isValid = isValid;
|
|
3869
4109
|
/**
|
|
@@ -3880,14 +4120,14 @@ var Selector;
|
|
|
3880
4120
|
* falling back onto a document query otherwise.
|
|
3881
4121
|
*/
|
|
3882
4122
|
function matches(element, selector) {
|
|
3883
|
-
return Private$
|
|
4123
|
+
return Private$p.protoMatchFunc.call(element, selector);
|
|
3884
4124
|
}
|
|
3885
4125
|
Selector.matches = matches;
|
|
3886
4126
|
})(Selector || (Selector = {}));
|
|
3887
4127
|
/**
|
|
3888
4128
|
* The namespace for the module implementation details.
|
|
3889
4129
|
*/
|
|
3890
|
-
var Private$
|
|
4130
|
+
var Private$p;
|
|
3891
4131
|
(function (Private) {
|
|
3892
4132
|
/**
|
|
3893
4133
|
* A cache of computed selector specificity values.
|
|
@@ -4025,7 +4265,7 @@ var Private$q;
|
|
|
4025
4265
|
* A regex which matches the negation pseudo-class globally.
|
|
4026
4266
|
*/
|
|
4027
4267
|
var NEGATION_RE = /:not\(([^\)]+)\)/g;
|
|
4028
|
-
})(Private$
|
|
4268
|
+
})(Private$p || (Private$p = {}));
|
|
4029
4269
|
|
|
4030
4270
|
// Copyright (c) Jupyter Development Team.
|
|
4031
4271
|
// Distributed under the terms of the Modified BSD License.
|
|
@@ -4045,7 +4285,7 @@ var Private$q;
|
|
|
4045
4285
|
* The default keyboard layout is US-English.
|
|
4046
4286
|
*/
|
|
4047
4287
|
function getKeyboardLayout() {
|
|
4048
|
-
return Private$
|
|
4288
|
+
return Private$o.keyboardLayout;
|
|
4049
4289
|
}
|
|
4050
4290
|
/**
|
|
4051
4291
|
* A concrete implementation of [[IKeyboardLayout]] based on keycodes.
|
|
@@ -4277,15 +4517,40 @@ var EN_US = new KeycodeLayout('en-us', {
|
|
|
4277
4517
|
/**
|
|
4278
4518
|
* The namespace for the module implementation details.
|
|
4279
4519
|
*/
|
|
4280
|
-
var Private$
|
|
4520
|
+
var Private$o;
|
|
4281
4521
|
(function (Private) {
|
|
4282
4522
|
/**
|
|
4283
4523
|
* The global keyboard layout instance.
|
|
4284
4524
|
*/
|
|
4285
4525
|
Private.keyboardLayout = EN_US;
|
|
4286
|
-
})(Private$
|
|
4526
|
+
})(Private$o || (Private$o = {}));
|
|
4527
|
+
|
|
4528
|
+
/*! *****************************************************************************
|
|
4529
|
+
Copyright (c) Microsoft Corporation.
|
|
4530
|
+
|
|
4531
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
4532
|
+
purpose with or without fee is hereby granted.
|
|
4533
|
+
|
|
4534
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
4535
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
4536
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
4537
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
4538
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
4539
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
4540
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
4541
|
+
***************************************************************************** */
|
|
4542
|
+
|
|
4543
|
+
var __assign$1 = function() {
|
|
4544
|
+
__assign$1 = Object.assign || function __assign(t) {
|
|
4545
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4546
|
+
s = arguments[i];
|
|
4547
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
4548
|
+
}
|
|
4549
|
+
return t;
|
|
4550
|
+
};
|
|
4551
|
+
return __assign$1.apply(this, arguments);
|
|
4552
|
+
};
|
|
4287
4553
|
|
|
4288
|
-
// Copyright (c) Jupyter Development Team.
|
|
4289
4554
|
/**
|
|
4290
4555
|
* An object which manages a collection of commands.
|
|
4291
4556
|
*
|
|
@@ -4391,7 +4656,7 @@ var CommandRegistry = /** @class */ (function () {
|
|
|
4391
4656
|
throw new Error("Command '" + id + "' already registered.");
|
|
4392
4657
|
}
|
|
4393
4658
|
// Add the command to the registry.
|
|
4394
|
-
this._commands[id] = Private$
|
|
4659
|
+
this._commands[id] = Private$n.createCommand(options);
|
|
4395
4660
|
// Emit the `commandChanged` signal.
|
|
4396
4661
|
this._commandChanged.emit({ id: id, type: 'added' });
|
|
4397
4662
|
// Return a disposable which will remove the command.
|
|
@@ -4423,6 +4688,17 @@ var CommandRegistry = /** @class */ (function () {
|
|
|
4423
4688
|
}
|
|
4424
4689
|
this._commandChanged.emit({ id: id, type: id ? 'changed' : 'many-changed' });
|
|
4425
4690
|
};
|
|
4691
|
+
/**
|
|
4692
|
+
* Get the description for a specific command.
|
|
4693
|
+
*
|
|
4694
|
+
* @param id - The id of the command of interest.
|
|
4695
|
+
*
|
|
4696
|
+
* @returns The description for the command.
|
|
4697
|
+
*/
|
|
4698
|
+
CommandRegistry.prototype.describedBy = function (id) {
|
|
4699
|
+
var cmd = this._commands[id];
|
|
4700
|
+
return cmd ? cmd.describedBy || { args: null } : { args: null };
|
|
4701
|
+
};
|
|
4426
4702
|
/**
|
|
4427
4703
|
* Get the display label for a specific command.
|
|
4428
4704
|
*
|
|
@@ -4683,7 +4959,7 @@ var CommandRegistry = /** @class */ (function () {
|
|
|
4683
4959
|
CommandRegistry.prototype.addKeyBinding = function (options) {
|
|
4684
4960
|
var _this = this;
|
|
4685
4961
|
// Create the binding for the given options.
|
|
4686
|
-
var binding = Private$
|
|
4962
|
+
var binding = Private$n.createKeyBinding(options);
|
|
4687
4963
|
// Add the key binding to the bindings array.
|
|
4688
4964
|
this._keyBindings.push(binding);
|
|
4689
4965
|
// Emit the `bindingChanged` signal.
|
|
@@ -4730,7 +5006,7 @@ var CommandRegistry = /** @class */ (function () {
|
|
|
4730
5006
|
// Add the keystroke to the current key sequence.
|
|
4731
5007
|
this._keystrokes.push(keystroke);
|
|
4732
5008
|
// Find the exact and partial matches for the key sequence.
|
|
4733
|
-
var _a = Private$
|
|
5009
|
+
var _a = Private$n.matchKeyBinding(this._keyBindings, this._keystrokes, event), exact = _a.exact, partial = _a.partial;
|
|
4734
5010
|
// If there is no exact match and no partial match, replay
|
|
4735
5011
|
// any suppressed events and clear the pending state.
|
|
4736
5012
|
if (!exact && !partial) {
|
|
@@ -4770,7 +5046,7 @@ var CommandRegistry = /** @class */ (function () {
|
|
|
4770
5046
|
this._clearTimer();
|
|
4771
5047
|
this._timerID = window.setTimeout(function () {
|
|
4772
5048
|
_this._onPendingTimeout();
|
|
4773
|
-
}, Private$
|
|
5049
|
+
}, Private$n.CHORD_TIMEOUT);
|
|
4774
5050
|
};
|
|
4775
5051
|
/**
|
|
4776
5052
|
* Clear the pending timeout.
|
|
@@ -4789,7 +5065,7 @@ var CommandRegistry = /** @class */ (function () {
|
|
|
4789
5065
|
return;
|
|
4790
5066
|
}
|
|
4791
5067
|
this._replaying = true;
|
|
4792
|
-
this._keydownEvents.forEach(Private$
|
|
5068
|
+
this._keydownEvents.forEach(Private$n.replayKeyEvent);
|
|
4793
5069
|
this._replaying = false;
|
|
4794
5070
|
};
|
|
4795
5071
|
/**
|
|
@@ -4947,26 +5223,37 @@ var CommandRegistry = /** @class */ (function () {
|
|
|
4947
5223
|
}
|
|
4948
5224
|
CommandRegistry.normalizeKeys = normalizeKeys;
|
|
4949
5225
|
/**
|
|
4950
|
-
* Format
|
|
5226
|
+
* Format keystrokes for display on the local system.
|
|
5227
|
+
*
|
|
5228
|
+
* If a list of keystrokes is provided, it will be displayed as
|
|
5229
|
+
* a comma-separated string
|
|
5230
|
+
*
|
|
5231
|
+
* @param keystroke The keystrokes to format
|
|
5232
|
+
* @returns The keystrokes representation
|
|
4951
5233
|
*/
|
|
4952
5234
|
function formatKeystroke(keystroke) {
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
mods
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
5235
|
+
return typeof keystroke === 'string'
|
|
5236
|
+
? formatSingleKey(keystroke)
|
|
5237
|
+
: keystroke.map(formatSingleKey).join(', ');
|
|
5238
|
+
function formatSingleKey(key) {
|
|
5239
|
+
var mods = [];
|
|
5240
|
+
var separator = Platform.IS_MAC ? ' ' : '+';
|
|
5241
|
+
var parts = parseKeystroke(key);
|
|
5242
|
+
if (parts.ctrl) {
|
|
5243
|
+
mods.push('Ctrl');
|
|
5244
|
+
}
|
|
5245
|
+
if (parts.alt) {
|
|
5246
|
+
mods.push('Alt');
|
|
5247
|
+
}
|
|
5248
|
+
if (parts.shift) {
|
|
5249
|
+
mods.push('Shift');
|
|
5250
|
+
}
|
|
5251
|
+
if (Platform.IS_MAC && parts.cmd) {
|
|
5252
|
+
mods.push('Cmd');
|
|
5253
|
+
}
|
|
5254
|
+
mods.push(parts.key);
|
|
5255
|
+
return mods.map(Private$n.formatKey).join(separator);
|
|
4967
5256
|
}
|
|
4968
|
-
mods.push(parts.key);
|
|
4969
|
-
return mods.map(Private$o.formatKey).join(separator);
|
|
4970
5257
|
}
|
|
4971
5258
|
CommandRegistry.formatKeystroke = formatKeystroke;
|
|
4972
5259
|
/**
|
|
@@ -5017,7 +5304,7 @@ var CommandRegistry = /** @class */ (function () {
|
|
|
5017
5304
|
/**
|
|
5018
5305
|
* The namespace for the module implementation details.
|
|
5019
5306
|
*/
|
|
5020
|
-
var Private$
|
|
5307
|
+
var Private$n;
|
|
5021
5308
|
(function (Private) {
|
|
5022
5309
|
/**
|
|
5023
5310
|
* The timeout in ms for triggering a key binding chord.
|
|
@@ -5044,6 +5331,7 @@ var Private$o;
|
|
|
5044
5331
|
/* </DEPRECATED> */
|
|
5045
5332
|
return {
|
|
5046
5333
|
execute: options.execute,
|
|
5334
|
+
describedBy: __assign$1({ args: null }, options.describedBy),
|
|
5047
5335
|
label: asFunc(options.label, emptyStringFunc),
|
|
5048
5336
|
mnemonic: asFunc(options.mnemonic, negativeOneFunc),
|
|
5049
5337
|
icon: icon,
|
|
@@ -5289,7 +5577,7 @@ var Private$o;
|
|
|
5289
5577
|
clone.view = event.view || window;
|
|
5290
5578
|
return clone;
|
|
5291
5579
|
}
|
|
5292
|
-
})(Private$
|
|
5580
|
+
})(Private$n || (Private$n = {}));
|
|
5293
5581
|
|
|
5294
5582
|
// Copyright (c) Jupyter Development Team.
|
|
5295
5583
|
/**
|
|
@@ -5297,6 +5585,8 @@ var Private$o;
|
|
|
5297
5585
|
*
|
|
5298
5586
|
* #### Notes
|
|
5299
5587
|
* Most operations have `O(log32 n)` or better complexity.
|
|
5588
|
+
*
|
|
5589
|
+
* @deprecated This class will be removed in @lumino/collections@^2.0.0
|
|
5300
5590
|
*/
|
|
5301
5591
|
var BPlusTree = /** @class */ (function () {
|
|
5302
5592
|
/**
|
|
@@ -5582,6 +5872,8 @@ var BPlusTree = /** @class */ (function () {
|
|
|
5582
5872
|
}());
|
|
5583
5873
|
/**
|
|
5584
5874
|
* The namespace for the `BPlusTree` class statics.
|
|
5875
|
+
*
|
|
5876
|
+
* @deprecated This namespace will be removed in @lumino/collections@^2.0.0
|
|
5585
5877
|
*/
|
|
5586
5878
|
(function (BPlusTree) {
|
|
5587
5879
|
/**
|
|
@@ -6882,7 +7174,7 @@ var LinkedList = /** @class */ (function () {
|
|
|
6882
7174
|
* Constant.
|
|
6883
7175
|
*/
|
|
6884
7176
|
LinkedList.prototype.addFirst = function (value) {
|
|
6885
|
-
var node = new Private$
|
|
7177
|
+
var node = new Private$m.LinkedListNode(this, value);
|
|
6886
7178
|
if (!this._first) {
|
|
6887
7179
|
this._first = node;
|
|
6888
7180
|
this._last = node;
|
|
@@ -6906,7 +7198,7 @@ var LinkedList = /** @class */ (function () {
|
|
|
6906
7198
|
* Constant.
|
|
6907
7199
|
*/
|
|
6908
7200
|
LinkedList.prototype.addLast = function (value) {
|
|
6909
|
-
var node = new Private$
|
|
7201
|
+
var node = new Private$m.LinkedListNode(this, value);
|
|
6910
7202
|
if (!this._last) {
|
|
6911
7203
|
this._first = node;
|
|
6912
7204
|
this._last = node;
|
|
@@ -6939,10 +7231,10 @@ var LinkedList = /** @class */ (function () {
|
|
|
6939
7231
|
if (!ref || ref === this._first) {
|
|
6940
7232
|
return this.addFirst(value);
|
|
6941
7233
|
}
|
|
6942
|
-
if (!(ref instanceof Private$
|
|
7234
|
+
if (!(ref instanceof Private$m.LinkedListNode) || ref.list !== this) {
|
|
6943
7235
|
throw new Error('Reference node is not owned by the list.');
|
|
6944
7236
|
}
|
|
6945
|
-
var node = new Private$
|
|
7237
|
+
var node = new Private$m.LinkedListNode(this, value);
|
|
6946
7238
|
var _ref = ref;
|
|
6947
7239
|
var prev = _ref.prev;
|
|
6948
7240
|
node.next = _ref;
|
|
@@ -6972,10 +7264,10 @@ var LinkedList = /** @class */ (function () {
|
|
|
6972
7264
|
if (!ref || ref === this._last) {
|
|
6973
7265
|
return this.addLast(value);
|
|
6974
7266
|
}
|
|
6975
|
-
if (!(ref instanceof Private$
|
|
7267
|
+
if (!(ref instanceof Private$m.LinkedListNode) || ref.list !== this) {
|
|
6976
7268
|
throw new Error('Reference node is not owned by the list.');
|
|
6977
7269
|
}
|
|
6978
|
-
var node = new Private$
|
|
7270
|
+
var node = new Private$m.LinkedListNode(this, value);
|
|
6979
7271
|
var _ref = ref;
|
|
6980
7272
|
var next = _ref.next;
|
|
6981
7273
|
node.next = next;
|
|
@@ -7051,7 +7343,7 @@ var LinkedList = /** @class */ (function () {
|
|
|
7051
7343
|
* The node must be owned by the list.
|
|
7052
7344
|
*/
|
|
7053
7345
|
LinkedList.prototype.removeNode = function (node) {
|
|
7054
|
-
if (!(node instanceof Private$
|
|
7346
|
+
if (!(node instanceof Private$m.LinkedListNode) || node.list !== this) {
|
|
7055
7347
|
throw new Error('Node is not owned by the list.');
|
|
7056
7348
|
}
|
|
7057
7349
|
var _node = node;
|
|
@@ -7297,7 +7589,7 @@ var LinkedList = /** @class */ (function () {
|
|
|
7297
7589
|
/**
|
|
7298
7590
|
* The namespace for the module implementation details.
|
|
7299
7591
|
*/
|
|
7300
|
-
var Private$
|
|
7592
|
+
var Private$m;
|
|
7301
7593
|
(function (Private) {
|
|
7302
7594
|
/**
|
|
7303
7595
|
* The internal linked list node implementation.
|
|
@@ -7329,7 +7621,7 @@ var Private$n;
|
|
|
7329
7621
|
return LinkedListNode;
|
|
7330
7622
|
}());
|
|
7331
7623
|
Private.LinkedListNode = LinkedListNode;
|
|
7332
|
-
})(Private$
|
|
7624
|
+
})(Private$m || (Private$m = {}));
|
|
7333
7625
|
|
|
7334
7626
|
/*! *****************************************************************************
|
|
7335
7627
|
Copyright (c) Microsoft Corporation.
|
|
@@ -7868,195 +8160,6 @@ var MessageLoop;
|
|
|
7868
8160
|
}
|
|
7869
8161
|
})(MessageLoop || (MessageLoop = {}));
|
|
7870
8162
|
|
|
7871
|
-
// Copyright (c) Jupyter Development Team.
|
|
7872
|
-
// Distributed under the terms of the Modified BSD License.
|
|
7873
|
-
/*-----------------------------------------------------------------------------
|
|
7874
|
-
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
|
7875
|
-
|
|
|
7876
|
-
| Distributed under the terms of the BSD 3-Clause License.
|
|
7877
|
-
|
|
|
7878
|
-
| The full license is in the file LICENSE, distributed with this software.
|
|
7879
|
-
|----------------------------------------------------------------------------*/
|
|
7880
|
-
/**
|
|
7881
|
-
* A class which attaches a value to an external object.
|
|
7882
|
-
*
|
|
7883
|
-
* #### Notes
|
|
7884
|
-
* Attached properties are used to extend the state of an object with
|
|
7885
|
-
* semantic data from an unrelated class. They also encapsulate value
|
|
7886
|
-
* creation, coercion, and notification.
|
|
7887
|
-
*
|
|
7888
|
-
* Because attached property values are stored in a hash table, which
|
|
7889
|
-
* in turn is stored in a WeakMap keyed on the owner object, there is
|
|
7890
|
-
* non-trivial storage overhead involved in their use. The pattern is
|
|
7891
|
-
* therefore best used for the storage of rare data.
|
|
7892
|
-
*/
|
|
7893
|
-
var AttachedProperty = /** @class */ (function () {
|
|
7894
|
-
/**
|
|
7895
|
-
* Construct a new attached property.
|
|
7896
|
-
*
|
|
7897
|
-
* @param options - The options for initializing the property.
|
|
7898
|
-
*/
|
|
7899
|
-
function AttachedProperty(options) {
|
|
7900
|
-
this._pid = Private$m.nextPID();
|
|
7901
|
-
this.name = options.name;
|
|
7902
|
-
this._create = options.create;
|
|
7903
|
-
this._coerce = options.coerce || null;
|
|
7904
|
-
this._compare = options.compare || null;
|
|
7905
|
-
this._changed = options.changed || null;
|
|
7906
|
-
}
|
|
7907
|
-
/**
|
|
7908
|
-
* Get the current value of the property for a given owner.
|
|
7909
|
-
*
|
|
7910
|
-
* @param owner - The property owner of interest.
|
|
7911
|
-
*
|
|
7912
|
-
* @returns The current value of the property.
|
|
7913
|
-
*
|
|
7914
|
-
* #### Notes
|
|
7915
|
-
* If the value has not yet been set, the default value will be
|
|
7916
|
-
* computed and assigned as the current value of the property.
|
|
7917
|
-
*/
|
|
7918
|
-
AttachedProperty.prototype.get = function (owner) {
|
|
7919
|
-
var value;
|
|
7920
|
-
var map = Private$m.ensureMap(owner);
|
|
7921
|
-
if (this._pid in map) {
|
|
7922
|
-
value = map[this._pid];
|
|
7923
|
-
}
|
|
7924
|
-
else {
|
|
7925
|
-
value = map[this._pid] = this._createValue(owner);
|
|
7926
|
-
}
|
|
7927
|
-
return value;
|
|
7928
|
-
};
|
|
7929
|
-
/**
|
|
7930
|
-
* Set the current value of the property for a given owner.
|
|
7931
|
-
*
|
|
7932
|
-
* @param owner - The property owner of interest.
|
|
7933
|
-
*
|
|
7934
|
-
* @param value - The value for the property.
|
|
7935
|
-
*
|
|
7936
|
-
* #### Notes
|
|
7937
|
-
* If the value has not yet been set, the default value will be
|
|
7938
|
-
* computed and used as the previous value for the comparison.
|
|
7939
|
-
*/
|
|
7940
|
-
AttachedProperty.prototype.set = function (owner, value) {
|
|
7941
|
-
var oldValue;
|
|
7942
|
-
var map = Private$m.ensureMap(owner);
|
|
7943
|
-
if (this._pid in map) {
|
|
7944
|
-
oldValue = map[this._pid];
|
|
7945
|
-
}
|
|
7946
|
-
else {
|
|
7947
|
-
oldValue = map[this._pid] = this._createValue(owner);
|
|
7948
|
-
}
|
|
7949
|
-
var newValue = this._coerceValue(owner, value);
|
|
7950
|
-
this._maybeNotify(owner, oldValue, (map[this._pid] = newValue));
|
|
7951
|
-
};
|
|
7952
|
-
/**
|
|
7953
|
-
* Explicitly coerce the current property value for a given owner.
|
|
7954
|
-
*
|
|
7955
|
-
* @param owner - The property owner of interest.
|
|
7956
|
-
*
|
|
7957
|
-
* #### Notes
|
|
7958
|
-
* If the value has not yet been set, the default value will be
|
|
7959
|
-
* computed and used as the previous value for the comparison.
|
|
7960
|
-
*/
|
|
7961
|
-
AttachedProperty.prototype.coerce = function (owner) {
|
|
7962
|
-
var oldValue;
|
|
7963
|
-
var map = Private$m.ensureMap(owner);
|
|
7964
|
-
if (this._pid in map) {
|
|
7965
|
-
oldValue = map[this._pid];
|
|
7966
|
-
}
|
|
7967
|
-
else {
|
|
7968
|
-
oldValue = map[this._pid] = this._createValue(owner);
|
|
7969
|
-
}
|
|
7970
|
-
var newValue = this._coerceValue(owner, oldValue);
|
|
7971
|
-
this._maybeNotify(owner, oldValue, (map[this._pid] = newValue));
|
|
7972
|
-
};
|
|
7973
|
-
/**
|
|
7974
|
-
* Get or create the default value for the given owner.
|
|
7975
|
-
*/
|
|
7976
|
-
AttachedProperty.prototype._createValue = function (owner) {
|
|
7977
|
-
var create = this._create;
|
|
7978
|
-
return create(owner);
|
|
7979
|
-
};
|
|
7980
|
-
/**
|
|
7981
|
-
* Coerce the value for the given owner.
|
|
7982
|
-
*/
|
|
7983
|
-
AttachedProperty.prototype._coerceValue = function (owner, value) {
|
|
7984
|
-
var coerce = this._coerce;
|
|
7985
|
-
return coerce ? coerce(owner, value) : value;
|
|
7986
|
-
};
|
|
7987
|
-
/**
|
|
7988
|
-
* Compare the old value and new value for equality.
|
|
7989
|
-
*/
|
|
7990
|
-
AttachedProperty.prototype._compareValue = function (oldValue, newValue) {
|
|
7991
|
-
var compare = this._compare;
|
|
7992
|
-
return compare ? compare(oldValue, newValue) : oldValue === newValue;
|
|
7993
|
-
};
|
|
7994
|
-
/**
|
|
7995
|
-
* Run the change notification if the given values are different.
|
|
7996
|
-
*/
|
|
7997
|
-
AttachedProperty.prototype._maybeNotify = function (owner, oldValue, newValue) {
|
|
7998
|
-
var changed = this._changed;
|
|
7999
|
-
if (changed && !this._compareValue(oldValue, newValue)) {
|
|
8000
|
-
changed(owner, oldValue, newValue);
|
|
8001
|
-
}
|
|
8002
|
-
};
|
|
8003
|
-
return AttachedProperty;
|
|
8004
|
-
}());
|
|
8005
|
-
/**
|
|
8006
|
-
* The namespace for the `AttachedProperty` class statics.
|
|
8007
|
-
*/
|
|
8008
|
-
(function (AttachedProperty) {
|
|
8009
|
-
/**
|
|
8010
|
-
* Clear the stored property data for the given owner.
|
|
8011
|
-
*
|
|
8012
|
-
* @param owner - The property owner of interest.
|
|
8013
|
-
*
|
|
8014
|
-
* #### Notes
|
|
8015
|
-
* This will clear all property values for the owner, but it will
|
|
8016
|
-
* **not** run the change notification for any of the properties.
|
|
8017
|
-
*/
|
|
8018
|
-
function clearData(owner) {
|
|
8019
|
-
Private$m.ownerData.delete(owner);
|
|
8020
|
-
}
|
|
8021
|
-
AttachedProperty.clearData = clearData;
|
|
8022
|
-
})(AttachedProperty || (AttachedProperty = {}));
|
|
8023
|
-
/**
|
|
8024
|
-
* The namespace for the module implementation details.
|
|
8025
|
-
*/
|
|
8026
|
-
var Private$m;
|
|
8027
|
-
(function (Private) {
|
|
8028
|
-
/**
|
|
8029
|
-
* A weak mapping of property owner to property map.
|
|
8030
|
-
*/
|
|
8031
|
-
Private.ownerData = new WeakMap();
|
|
8032
|
-
/**
|
|
8033
|
-
* A function which computes successive unique property ids.
|
|
8034
|
-
*/
|
|
8035
|
-
Private.nextPID = (function () {
|
|
8036
|
-
var id = 0;
|
|
8037
|
-
return function () {
|
|
8038
|
-
var rand = Math.random();
|
|
8039
|
-
var stem = ("" + rand).slice(2);
|
|
8040
|
-
return "pid-" + stem + "-" + id++;
|
|
8041
|
-
};
|
|
8042
|
-
})();
|
|
8043
|
-
/**
|
|
8044
|
-
* Lookup the data map for the property owner.
|
|
8045
|
-
*
|
|
8046
|
-
* This will create the map if one does not already exist.
|
|
8047
|
-
*/
|
|
8048
|
-
function ensureMap(owner) {
|
|
8049
|
-
var map = Private.ownerData.get(owner);
|
|
8050
|
-
if (map) {
|
|
8051
|
-
return map;
|
|
8052
|
-
}
|
|
8053
|
-
map = Object.create(null);
|
|
8054
|
-
Private.ownerData.set(owner, map);
|
|
8055
|
-
return map;
|
|
8056
|
-
}
|
|
8057
|
-
Private.ensureMap = ensureMap;
|
|
8058
|
-
})(Private$m || (Private$m = {}));
|
|
8059
|
-
|
|
8060
8163
|
/**
|
|
8061
8164
|
* An object which manages a drag-drop operation.
|
|
8062
8165
|
*
|
|
@@ -9363,7 +9466,10 @@ var Private$k;
|
|
|
9363
9466
|
}
|
|
9364
9467
|
// Handle the simplest case of in-place text update first.
|
|
9365
9468
|
if (oldVNode.type === 'text' && newVNode.type === 'text') {
|
|
9366
|
-
|
|
9469
|
+
// Avoid spurious updates for performance.
|
|
9470
|
+
if (currElem.textContent !== newVNode.content) {
|
|
9471
|
+
currElem.textContent = newVNode.content;
|
|
9472
|
+
}
|
|
9367
9473
|
currElem = currElem.nextSibling;
|
|
9368
9474
|
continue;
|
|
9369
9475
|
}
|
|
@@ -9669,15 +9775,15 @@ function __extends$4(d, b) {
|
|
|
9669
9775
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
9670
9776
|
}
|
|
9671
9777
|
|
|
9672
|
-
var __assign$
|
|
9673
|
-
__assign$
|
|
9778
|
+
var __assign$2 = function() {
|
|
9779
|
+
__assign$2 = Object.assign || function __assign(t) {
|
|
9674
9780
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9675
9781
|
s = arguments[i];
|
|
9676
9782
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9677
9783
|
}
|
|
9678
9784
|
return t;
|
|
9679
9785
|
};
|
|
9680
|
-
return __assign$
|
|
9786
|
+
return __assign$2.apply(this, arguments);
|
|
9681
9787
|
};
|
|
9682
9788
|
|
|
9683
9789
|
function __rest(s, e) {
|
|
@@ -13314,7 +13420,7 @@ var AccordionLayout = /** @class */ (function (_super) {
|
|
|
13314
13420
|
* Titles must be rotated for horizontal accordion panel using CSS: see accordionpanel.css
|
|
13315
13421
|
*/
|
|
13316
13422
|
function AccordionLayout(options) {
|
|
13317
|
-
var _this = _super.call(this, __assign$
|
|
13423
|
+
var _this = _super.call(this, __assign$2(__assign$2({}, options), { orientation: options.orientation || 'vertical' })) || this;
|
|
13318
13424
|
_this._titles = [];
|
|
13319
13425
|
_this.titleSpace = options.titleSpace || 22;
|
|
13320
13426
|
return _this;
|
|
@@ -13969,7 +14075,7 @@ var AccordionPanel = /** @class */ (function (_super) {
|
|
|
13969
14075
|
*/
|
|
13970
14076
|
function AccordionPanel(options) {
|
|
13971
14077
|
if (options === void 0) { options = {}; }
|
|
13972
|
-
var _this = _super.call(this, __assign$
|
|
14078
|
+
var _this = _super.call(this, __assign$2(__assign$2({}, options), { layout: Private$d.createLayout(options) })) || this;
|
|
13973
14079
|
_this._widgetSizesCache = new WeakMap();
|
|
13974
14080
|
_this.addClass('lm-AccordionPanel');
|
|
13975
14081
|
return _this;
|
|
@@ -14272,13 +14378,14 @@ var AccordionPanel = /** @class */ (function (_super) {
|
|
|
14272
14378
|
var Renderer = /** @class */ (function (_super) {
|
|
14273
14379
|
__extends$4(Renderer, _super);
|
|
14274
14380
|
function Renderer() {
|
|
14275
|
-
var _this = _super
|
|
14381
|
+
var _this = _super.call(this) || this;
|
|
14276
14382
|
/**
|
|
14277
14383
|
* A selector which matches any title node in the accordion.
|
|
14278
14384
|
*/
|
|
14279
14385
|
_this.titleClassName = 'lm-AccordionPanel-title';
|
|
14280
14386
|
_this._titleID = 0;
|
|
14281
14387
|
_this._titleKeys = new WeakMap();
|
|
14388
|
+
_this._uuid = ++Renderer._nInstance;
|
|
14282
14389
|
return _this;
|
|
14283
14390
|
}
|
|
14284
14391
|
/**
|
|
@@ -14304,7 +14411,6 @@ var AccordionPanel = /** @class */ (function (_super) {
|
|
|
14304
14411
|
handle.setAttribute('tabindex', '0');
|
|
14305
14412
|
handle.id = this.createTitleKey(data);
|
|
14306
14413
|
handle.className = this.titleClassName;
|
|
14307
|
-
handle.title = data.caption;
|
|
14308
14414
|
for (var aData in data.dataset) {
|
|
14309
14415
|
handle.dataset[aData] = data.dataset[aData];
|
|
14310
14416
|
}
|
|
@@ -14313,6 +14419,7 @@ var AccordionPanel = /** @class */ (function (_super) {
|
|
|
14313
14419
|
var label = handle.appendChild(document.createElement('span'));
|
|
14314
14420
|
label.className = 'lm-AccordionPanel-titleLabel';
|
|
14315
14421
|
label.textContent = data.label;
|
|
14422
|
+
label.title = data.caption || data.label;
|
|
14316
14423
|
return handle;
|
|
14317
14424
|
};
|
|
14318
14425
|
/**
|
|
@@ -14329,11 +14436,12 @@ var AccordionPanel = /** @class */ (function (_super) {
|
|
|
14329
14436
|
Renderer.prototype.createTitleKey = function (data) {
|
|
14330
14437
|
var key = this._titleKeys.get(data);
|
|
14331
14438
|
if (key === undefined) {
|
|
14332
|
-
key = "title-key-" + this._titleID++;
|
|
14439
|
+
key = "title-key-" + this._uuid + "-" + this._titleID++;
|
|
14333
14440
|
this._titleKeys.set(data, key);
|
|
14334
14441
|
}
|
|
14335
14442
|
return key;
|
|
14336
14443
|
};
|
|
14444
|
+
Renderer._nInstance = 0;
|
|
14337
14445
|
return Renderer;
|
|
14338
14446
|
}(SplitPanel$1.Renderer));
|
|
14339
14447
|
AccordionPanel.Renderer = Renderer;
|
|
@@ -15696,7 +15804,7 @@ var CommandPalette = /** @class */ (function (_super) {
|
|
|
15696
15804
|
* @returns The dataset for the command palette item.
|
|
15697
15805
|
*/
|
|
15698
15806
|
Renderer.prototype.createItemDataset = function (data) {
|
|
15699
|
-
return __assign$
|
|
15807
|
+
return __assign$2(__assign$2({}, data.item.dataset), { command: data.item.command });
|
|
15700
15808
|
};
|
|
15701
15809
|
/**
|
|
15702
15810
|
* Create the class name for the command item icon.
|
|
@@ -15745,9 +15853,7 @@ var CommandPalette = /** @class */ (function (_super) {
|
|
|
15745
15853
|
*/
|
|
15746
15854
|
Renderer.prototype.formatItemShortcut = function (data) {
|
|
15747
15855
|
var kb = data.item.keyBinding;
|
|
15748
|
-
return kb
|
|
15749
|
-
? kb.keys.map(CommandRegistry.formatKeystroke).join(', ')
|
|
15750
|
-
: null;
|
|
15856
|
+
return kb ? CommandRegistry.formatKeystroke(kb.keys) : null;
|
|
15751
15857
|
};
|
|
15752
15858
|
/**
|
|
15753
15859
|
* Create the render content for the item label node.
|
|
@@ -16948,6 +17054,8 @@ var Menu = /** @class */ (function (_super) {
|
|
|
16948
17054
|
if (submenu === this._childMenu) {
|
|
16949
17055
|
return;
|
|
16950
17056
|
}
|
|
17057
|
+
// Prior to any DOM modifications save window data
|
|
17058
|
+
Menu.saveWindowData();
|
|
16951
17059
|
// Ensure the current child menu is closed.
|
|
16952
17060
|
this._closeChildMenu();
|
|
16953
17061
|
// Update the private child state.
|
|
@@ -17020,6 +17128,18 @@ var Menu = /** @class */ (function (_super) {
|
|
|
17020
17128
|
this._closeTimerID = 0;
|
|
17021
17129
|
}
|
|
17022
17130
|
};
|
|
17131
|
+
/**
|
|
17132
|
+
* Save window data used for menu positioning in transient cache.
|
|
17133
|
+
*
|
|
17134
|
+
* In order to avoid layout trashing it is recommended to invoke this
|
|
17135
|
+
* method immediately prior to opening the menu and any DOM modifications
|
|
17136
|
+
* (like closing previously visible menu, or adding a class to menu widget).
|
|
17137
|
+
*
|
|
17138
|
+
* The transient cache will be released upon `open()` call.
|
|
17139
|
+
*/
|
|
17140
|
+
Menu.saveWindowData = function () {
|
|
17141
|
+
Private$9.saveWindowData();
|
|
17142
|
+
};
|
|
17023
17143
|
return Menu;
|
|
17024
17144
|
}(Widget));
|
|
17025
17145
|
/**
|
|
@@ -17046,7 +17166,7 @@ var Menu = /** @class */ (function (_super) {
|
|
|
17046
17166
|
var className = this.createItemClass(data);
|
|
17047
17167
|
var dataset = this.createItemDataset(data);
|
|
17048
17168
|
var aria = this.createItemARIA(data);
|
|
17049
|
-
return h.li(__assign$
|
|
17169
|
+
return h.li(__assign$2({ className: className,
|
|
17050
17170
|
dataset: dataset, tabindex: '0', onfocus: data.onfocus }, aria), this.renderIcon(data), this.renderLabel(data), this.renderShortcut(data), this.renderSubmenu(data));
|
|
17051
17171
|
};
|
|
17052
17172
|
/**
|
|
@@ -17176,10 +17296,10 @@ var Menu = /** @class */ (function (_super) {
|
|
|
17176
17296
|
var result;
|
|
17177
17297
|
var _a = data.item, type = _a.type, command = _a.command, dataset = _a.dataset;
|
|
17178
17298
|
if (type === 'command') {
|
|
17179
|
-
result = __assign$
|
|
17299
|
+
result = __assign$2(__assign$2({}, dataset), { type: type, command: command });
|
|
17180
17300
|
}
|
|
17181
17301
|
else {
|
|
17182
|
-
result = __assign$
|
|
17302
|
+
result = __assign$2(__assign$2({}, dataset), { type: type });
|
|
17183
17303
|
}
|
|
17184
17304
|
return result;
|
|
17185
17305
|
};
|
|
@@ -17262,9 +17382,7 @@ var Menu = /** @class */ (function (_super) {
|
|
|
17262
17382
|
*/
|
|
17263
17383
|
Renderer.prototype.formatShortcut = function (data) {
|
|
17264
17384
|
var kb = data.item.keyBinding;
|
|
17265
|
-
return kb
|
|
17266
|
-
? kb.keys.map(CommandRegistry.formatKeystroke).join(', ')
|
|
17267
|
-
: null;
|
|
17385
|
+
return kb ? CommandRegistry.formatKeystroke(kb.keys) : null;
|
|
17268
17386
|
};
|
|
17269
17387
|
return Renderer;
|
|
17270
17388
|
}());
|
|
@@ -17287,6 +17405,30 @@ var Private$9;
|
|
|
17287
17405
|
* The horizontal pixel overlap for an open submenu.
|
|
17288
17406
|
*/
|
|
17289
17407
|
Private.SUBMENU_OVERLAP = 3;
|
|
17408
|
+
var transientWindowDataCache = null;
|
|
17409
|
+
var transientCacheCounter = 0;
|
|
17410
|
+
function getWindowData() {
|
|
17411
|
+
// if transient cache is in use, take one from it
|
|
17412
|
+
if (transientCacheCounter > 0) {
|
|
17413
|
+
transientCacheCounter--;
|
|
17414
|
+
return transientWindowDataCache;
|
|
17415
|
+
}
|
|
17416
|
+
return _getWindowData();
|
|
17417
|
+
}
|
|
17418
|
+
/**
|
|
17419
|
+
* Store window data in transient cache.
|
|
17420
|
+
*
|
|
17421
|
+
* The transient cache will be released upon `getWindowData()` call.
|
|
17422
|
+
* If this function is called multiple times, the cache will be
|
|
17423
|
+
* retained until as many calls to `getWindowData()` were made.
|
|
17424
|
+
*
|
|
17425
|
+
* Note: should be called before any DOM modifications.
|
|
17426
|
+
*/
|
|
17427
|
+
function saveWindowData() {
|
|
17428
|
+
transientWindowDataCache = _getWindowData();
|
|
17429
|
+
transientCacheCounter++;
|
|
17430
|
+
}
|
|
17431
|
+
Private.saveWindowData = saveWindowData;
|
|
17290
17432
|
/**
|
|
17291
17433
|
* Create the DOM node for a menu.
|
|
17292
17434
|
*/
|
|
@@ -17382,28 +17524,33 @@ var Private$9;
|
|
|
17382
17524
|
return result;
|
|
17383
17525
|
}
|
|
17384
17526
|
Private.computeCollapsed = computeCollapsed;
|
|
17527
|
+
function _getWindowData() {
|
|
17528
|
+
return {
|
|
17529
|
+
pageXOffset: window.pageXOffset,
|
|
17530
|
+
pageYOffset: window.pageYOffset,
|
|
17531
|
+
clientWidth: document.documentElement.clientWidth,
|
|
17532
|
+
clientHeight: document.documentElement.clientHeight
|
|
17533
|
+
};
|
|
17534
|
+
}
|
|
17385
17535
|
/**
|
|
17386
17536
|
* Open a menu as a root menu at the target location.
|
|
17387
17537
|
*/
|
|
17388
17538
|
function openRootMenu(menu, x, y, forceX, forceY) {
|
|
17539
|
+
// Get the current position and size of the main viewport.
|
|
17540
|
+
var windowData = getWindowData();
|
|
17541
|
+
var px = windowData.pageXOffset;
|
|
17542
|
+
var py = windowData.pageYOffset;
|
|
17543
|
+
var cw = windowData.clientWidth;
|
|
17544
|
+
var ch = windowData.clientHeight;
|
|
17389
17545
|
// Ensure the menu is updated before attaching and measuring.
|
|
17390
17546
|
MessageLoop.sendMessage(menu, Widget.Msg.UpdateRequest);
|
|
17391
|
-
// Get the current position and size of the main viewport.
|
|
17392
|
-
var px = window.pageXOffset;
|
|
17393
|
-
var py = window.pageYOffset;
|
|
17394
|
-
var cw = document.documentElement.clientWidth;
|
|
17395
|
-
var ch = document.documentElement.clientHeight;
|
|
17396
17547
|
// Compute the maximum allowed height for the menu.
|
|
17397
17548
|
var maxHeight = ch - (forceY ? y : 0);
|
|
17398
17549
|
// Fetch common variables.
|
|
17399
17550
|
var node = menu.node;
|
|
17400
17551
|
var style = node.style;
|
|
17401
17552
|
// Clear the menu geometry and prepare it for measuring.
|
|
17402
|
-
style.
|
|
17403
|
-
style.left = '';
|
|
17404
|
-
style.width = '';
|
|
17405
|
-
style.height = '';
|
|
17406
|
-
style.visibility = 'hidden';
|
|
17553
|
+
style.opacity = '0';
|
|
17407
17554
|
style.maxHeight = maxHeight + "px";
|
|
17408
17555
|
// Attach the menu to the document.
|
|
17409
17556
|
Widget.attach(menu, document.body);
|
|
@@ -17423,34 +17570,30 @@ var Private$9;
|
|
|
17423
17570
|
}
|
|
17424
17571
|
}
|
|
17425
17572
|
// Update the position of the menu to the computed position.
|
|
17426
|
-
style.
|
|
17427
|
-
style.left = Math.max(0, x) + "px";
|
|
17573
|
+
style.transform = "translate(" + Math.max(0, x) + "px, " + Math.max(0, y) + "px";
|
|
17428
17574
|
// Finally, make the menu visible on the screen.
|
|
17429
|
-
style.
|
|
17575
|
+
style.opacity = '1';
|
|
17430
17576
|
}
|
|
17431
17577
|
Private.openRootMenu = openRootMenu;
|
|
17432
17578
|
/**
|
|
17433
17579
|
* Open a menu as a submenu using an item node for positioning.
|
|
17434
17580
|
*/
|
|
17435
17581
|
function openSubmenu(submenu, itemNode) {
|
|
17582
|
+
// Get the current position and size of the main viewport.
|
|
17583
|
+
var windowData = getWindowData();
|
|
17584
|
+
var px = windowData.pageXOffset;
|
|
17585
|
+
var py = windowData.pageYOffset;
|
|
17586
|
+
var cw = windowData.clientWidth;
|
|
17587
|
+
var ch = windowData.clientHeight;
|
|
17436
17588
|
// Ensure the menu is updated before opening.
|
|
17437
17589
|
MessageLoop.sendMessage(submenu, Widget.Msg.UpdateRequest);
|
|
17438
|
-
// Get the current position and size of the main viewport.
|
|
17439
|
-
var px = window.pageXOffset;
|
|
17440
|
-
var py = window.pageYOffset;
|
|
17441
|
-
var cw = document.documentElement.clientWidth;
|
|
17442
|
-
var ch = document.documentElement.clientHeight;
|
|
17443
17590
|
// Compute the maximum allowed height for the menu.
|
|
17444
17591
|
var maxHeight = ch;
|
|
17445
17592
|
// Fetch common variables.
|
|
17446
17593
|
var node = submenu.node;
|
|
17447
17594
|
var style = node.style;
|
|
17448
17595
|
// Clear the menu geometry and prepare it for measuring.
|
|
17449
|
-
style.
|
|
17450
|
-
style.left = '';
|
|
17451
|
-
style.width = '';
|
|
17452
|
-
style.height = '';
|
|
17453
|
-
style.visibility = 'hidden';
|
|
17596
|
+
style.opacity = '0';
|
|
17454
17597
|
style.maxHeight = maxHeight + "px";
|
|
17455
17598
|
// Attach the menu to the document.
|
|
17456
17599
|
Widget.attach(submenu, document.body);
|
|
@@ -17473,10 +17616,9 @@ var Private$9;
|
|
|
17473
17616
|
y = itemRect.bottom + box.borderBottom + box.paddingBottom - height;
|
|
17474
17617
|
}
|
|
17475
17618
|
// Update the position of the menu to the computed position.
|
|
17476
|
-
style.
|
|
17477
|
-
style.left = Math.max(0, x) + "px";
|
|
17619
|
+
style.transform = "translate(" + Math.max(0, x) + "px, " + Math.max(0, y) + "px";
|
|
17478
17620
|
// Finally, make the menu visible on the screen.
|
|
17479
|
-
style.
|
|
17621
|
+
style.opacity = '1';
|
|
17480
17622
|
}
|
|
17481
17623
|
Private.openSubmenu = openSubmenu;
|
|
17482
17624
|
/**
|
|
@@ -17800,6 +17942,8 @@ var ContextMenu = /** @class */ (function () {
|
|
|
17800
17942
|
*/
|
|
17801
17943
|
ContextMenu.prototype.open = function (event) {
|
|
17802
17944
|
var _this = this;
|
|
17945
|
+
// Prior to any DOM modifications update the window data.
|
|
17946
|
+
Menu.saveWindowData();
|
|
17803
17947
|
// Clear the current contents of the context menu.
|
|
17804
17948
|
this.menu.clearItems();
|
|
17805
17949
|
// Bail early if there are no items to match.
|
|
@@ -17834,7 +17978,7 @@ var Private$8;
|
|
|
17834
17978
|
function createItem(options, id) {
|
|
17835
17979
|
var selector = validateSelector(options.selector);
|
|
17836
17980
|
var rank = options.rank !== undefined ? options.rank : Infinity;
|
|
17837
|
-
return __assign$
|
|
17981
|
+
return __assign$2(__assign$2({}, options), { selector: selector, rank: rank, id: id });
|
|
17838
17982
|
}
|
|
17839
17983
|
Private.createItem = createItem;
|
|
17840
17984
|
/**
|
|
@@ -19064,6 +19208,7 @@ var TabBar = /** @class */ (function (_super) {
|
|
|
19064
19208
|
this.closeIconSelector = '.lm-TabBar-tabCloseIcon';
|
|
19065
19209
|
this._tabID = 0;
|
|
19066
19210
|
this._tabKeys = new WeakMap();
|
|
19211
|
+
this._uuid = ++Renderer._nInstance;
|
|
19067
19212
|
}
|
|
19068
19213
|
/**
|
|
19069
19214
|
* Render the virtual element for a tab.
|
|
@@ -19081,10 +19226,10 @@ var TabBar = /** @class */ (function (_super) {
|
|
|
19081
19226
|
var dataset = this.createTabDataset(data);
|
|
19082
19227
|
var aria = this.createTabARIA(data);
|
|
19083
19228
|
if (data.title.closable) {
|
|
19084
|
-
return h.li(__assign$
|
|
19229
|
+
return h.li(__assign$2({ id: id, key: key, className: className, title: title, style: style, dataset: dataset }, aria), this.renderIcon(data), this.renderLabel(data), this.renderCloseIcon(data));
|
|
19085
19230
|
}
|
|
19086
19231
|
else {
|
|
19087
|
-
return h.li(__assign$
|
|
19232
|
+
return h.li(__assign$2({ id: id, key: key, className: className, title: title, style: style, dataset: dataset }, aria), this.renderIcon(data), this.renderLabel(data));
|
|
19088
19233
|
}
|
|
19089
19234
|
};
|
|
19090
19235
|
/**
|
|
@@ -19150,7 +19295,7 @@ var TabBar = /** @class */ (function (_super) {
|
|
|
19150
19295
|
Renderer.prototype.createTabKey = function (data) {
|
|
19151
19296
|
var key = this._tabKeys.get(data.title);
|
|
19152
19297
|
if (key === undefined) {
|
|
19153
|
-
key = "tab-key-" + this._tabID++;
|
|
19298
|
+
key = "tab-key-" + this._uuid + "-" + this._tabID++;
|
|
19154
19299
|
this._tabKeys.set(data.title, key);
|
|
19155
19300
|
}
|
|
19156
19301
|
return key;
|
|
@@ -19229,6 +19374,7 @@ var TabBar = /** @class */ (function (_super) {
|
|
|
19229
19374
|
var extra = data.title.iconClass;
|
|
19230
19375
|
return extra ? name + " " + extra : name;
|
|
19231
19376
|
};
|
|
19377
|
+
Renderer._nInstance = 0;
|
|
19232
19378
|
return Renderer;
|
|
19233
19379
|
}());
|
|
19234
19380
|
TabBar.Renderer = Renderer;
|
|
@@ -23726,13 +23872,20 @@ var MenuBar = /** @class */ (function (_super) {
|
|
|
23726
23872
|
};
|
|
23727
23873
|
/**
|
|
23728
23874
|
* Handle the `'keydown'` event for the menu bar.
|
|
23875
|
+
*
|
|
23876
|
+
* #### Notes
|
|
23877
|
+
* All keys are trapped except the tab key that is ignored.
|
|
23729
23878
|
*/
|
|
23730
23879
|
MenuBar.prototype._evtKeyDown = function (event) {
|
|
23731
|
-
// A menu bar handles all keydown events.
|
|
23732
|
-
event.preventDefault();
|
|
23733
|
-
event.stopPropagation();
|
|
23734
23880
|
// Fetch the key code for the event.
|
|
23735
23881
|
var kc = event.keyCode;
|
|
23882
|
+
// Do not trap the tab key.
|
|
23883
|
+
if (kc === 9) {
|
|
23884
|
+
return;
|
|
23885
|
+
}
|
|
23886
|
+
// A menu bar handles all other keydown events.
|
|
23887
|
+
event.preventDefault();
|
|
23888
|
+
event.stopPropagation();
|
|
23736
23889
|
// Enter, Up Arrow, Down Arrow
|
|
23737
23890
|
if (kc === 13 || kc === 38 || kc === 40) {
|
|
23738
23891
|
this.openActiveMenu();
|
|
@@ -23816,8 +23969,11 @@ var MenuBar = /** @class */ (function (_super) {
|
|
|
23816
23969
|
this.activeIndex = index;
|
|
23817
23970
|
}
|
|
23818
23971
|
else {
|
|
23972
|
+
var position = this._positionForMenu(index);
|
|
23973
|
+
Menu.saveWindowData();
|
|
23974
|
+
// Begin DOM modifications.
|
|
23819
23975
|
this.activeIndex = index;
|
|
23820
|
-
this._openChildMenu();
|
|
23976
|
+
this._openChildMenu(position);
|
|
23821
23977
|
}
|
|
23822
23978
|
};
|
|
23823
23979
|
/**
|
|
@@ -23838,13 +23994,33 @@ var MenuBar = /** @class */ (function (_super) {
|
|
|
23838
23994
|
if (index === -1 && this._childMenu) {
|
|
23839
23995
|
return;
|
|
23840
23996
|
}
|
|
23997
|
+
// Get position for the new menu >before< updating active index.
|
|
23998
|
+
var position = this._positionForMenu(index);
|
|
23999
|
+
// Before any modification, update window data.
|
|
24000
|
+
Menu.saveWindowData();
|
|
24001
|
+
// Begin DOM modifications.
|
|
23841
24002
|
// Update the active index to the hovered item.
|
|
23842
24003
|
this.activeIndex = index;
|
|
23843
24004
|
// Open the new menu if a menu is already open.
|
|
23844
24005
|
if (this._childMenu) {
|
|
23845
|
-
this._openChildMenu();
|
|
24006
|
+
this._openChildMenu(position);
|
|
23846
24007
|
}
|
|
23847
24008
|
};
|
|
24009
|
+
/**
|
|
24010
|
+
* Find initial position for the menu based on menubar item position.
|
|
24011
|
+
*
|
|
24012
|
+
* NOTE: this should be called before updating active index to avoid
|
|
24013
|
+
* an additional layout and style invalidation as changing active
|
|
24014
|
+
* index modifies DOM.
|
|
24015
|
+
*/
|
|
24016
|
+
MenuBar.prototype._positionForMenu = function (index) {
|
|
24017
|
+
var itemNode = this.contentNode.children[index];
|
|
24018
|
+
var _a = itemNode.getBoundingClientRect(), left = _a.left, bottom = _a.bottom;
|
|
24019
|
+
return {
|
|
24020
|
+
top: bottom,
|
|
24021
|
+
left: left
|
|
24022
|
+
};
|
|
24023
|
+
};
|
|
23848
24024
|
/**
|
|
23849
24025
|
* Handle the `'mouseleave'` event for the menu bar.
|
|
23850
24026
|
*/
|
|
@@ -23860,7 +24036,9 @@ var MenuBar = /** @class */ (function (_super) {
|
|
|
23860
24036
|
* If a different child menu is already open, it will be closed,
|
|
23861
24037
|
* even if there is no active menu.
|
|
23862
24038
|
*/
|
|
23863
|
-
MenuBar.prototype._openChildMenu = function () {
|
|
24039
|
+
MenuBar.prototype._openChildMenu = function (options) {
|
|
24040
|
+
var _a;
|
|
24041
|
+
if (options === void 0) { options = {}; }
|
|
23864
24042
|
// If there is no active menu, close the current menu.
|
|
23865
24043
|
var newMenu = this.activeMenu;
|
|
23866
24044
|
if (!newMenu) {
|
|
@@ -23879,20 +24057,26 @@ var MenuBar = /** @class */ (function (_super) {
|
|
|
23879
24057
|
oldMenu.close();
|
|
23880
24058
|
}
|
|
23881
24059
|
else {
|
|
23882
|
-
this.addClass('lm-mod-active');
|
|
23883
|
-
/* <DEPRECATED> */
|
|
23884
|
-
this.addClass('p-mod-active');
|
|
23885
|
-
/* </DEPRECATED> */
|
|
23886
24060
|
document.addEventListener('mousedown', this, true);
|
|
23887
24061
|
}
|
|
23888
24062
|
// Ensure the menu bar is updated and look up the item node.
|
|
23889
24063
|
MessageLoop.sendMessage(this, Widget.Msg.UpdateRequest);
|
|
23890
|
-
var itemNode = this.contentNode.children[this._activeIndex];
|
|
23891
24064
|
// Get the positioning data for the new menu.
|
|
23892
|
-
var
|
|
24065
|
+
var left = options.left, top = options.top;
|
|
24066
|
+
if (typeof left === 'undefined' || typeof top === 'undefined') {
|
|
24067
|
+
(_a = this._positionForMenu(this._activeIndex), left = _a.left, top = _a.top);
|
|
24068
|
+
}
|
|
24069
|
+
// Begin DOM modifications
|
|
24070
|
+
if (!oldMenu) {
|
|
24071
|
+
// Continue setup for new menu
|
|
24072
|
+
this.addClass('lm-mod-active');
|
|
24073
|
+
/* <DEPRECATED> */
|
|
24074
|
+
this.addClass('p-mod-active');
|
|
24075
|
+
/* </DEPRECATED> */
|
|
24076
|
+
}
|
|
23893
24077
|
// Open the new menu at the computed location.
|
|
23894
24078
|
if (newMenu.items.length > 0) {
|
|
23895
|
-
newMenu.open(left,
|
|
24079
|
+
newMenu.open(left, top, this._forceItemsPosition);
|
|
23896
24080
|
}
|
|
23897
24081
|
};
|
|
23898
24082
|
/**
|
|
@@ -23995,7 +24179,7 @@ var MenuBar = /** @class */ (function (_super) {
|
|
|
23995
24179
|
var className = this.createItemClass(data);
|
|
23996
24180
|
var dataset = this.createItemDataset(data);
|
|
23997
24181
|
var aria = this.createItemARIA(data);
|
|
23998
|
-
return h.li(__assign$
|
|
24182
|
+
return h.li(__assign$2({ className: className, dataset: dataset, tabindex: '0', onfocus: data.onfocus }, aria), this.renderIcon(data), this.renderLabel(data));
|
|
23999
24183
|
};
|
|
24000
24184
|
/**
|
|
24001
24185
|
* Render the icon element for a menu bar item.
|