simple-window-manager 2.1.2 → 2.1.3

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.
Files changed (9) hide show
  1. package/.jsdoc.json +1 -1
  2. package/package.json +14 -14
  3. package/public/simple-window-manager.es.js +352 -338
  4. package/public/simple-window-manager.es.js.map +1 -1
  5. package/public/simple-window-manager.min.js +1 -1
  6. package/public/simple-window-manager.min.js.map +1 -1
  7. package/rollup.config.js +1 -1
  8. package/src/Window.js +2 -0
  9. package/images/src/images.js/export const close = '<?xml version=/"1.0/" encoding=/"UTF-8/" standalone=/"no/"?><!DOCTYPE svg PUBLIC /"-/W3C/DTD SVG 1.1/EN/" /"http:/www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd/"><svg width=/"100%/" height=/"100%/" viewBox=/"0 0 20 20/" version=/"1.1/" xmlns=/"http:/www.w3.org/2000/svg/" xmlns:xlink=/"http:/www.w3.org/1999/xlink/" xml:space=/"preserve/" xmlns:serif=/"http:/www.serif.com//" style=/"fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;/"><rect id=/"close/" x=/"0/" y=/"0/" width=/"20/" height=/"20/" style=/"fill:none;/"/><g><path d=/"M3.5,3.5l13,13/" style=/"fill:none;stroke:#fff;stroke-width:3px;/"/><path d=/"M16.5,3.5l-13,13/" style=/"fill:none;stroke:#fff;stroke-width:3px;/"/></g></svg>';export const minimize = '<?xml version=/"1.0/" encoding=/"UTF-8/" standalone=/"no/"?><!DOCTYPE svg PUBLIC /"-/W3C/DTD SVG 1.1/EN/" /"http:/www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd/"><svg width=/"100%/" height=/"100%/" viewBox=/"0 0 20 20/" version=/"1.1/" xmlns=/"http:/www.w3.org/2000/svg/" xmlns:xlink=/"http:/www.w3.org/1999/xlink/" xml:space=/"preserve/" xmlns:serif=/"http:/www.serif.com//" style=/"fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;/"><rect id=/"minimize/" x=/"0/" y=/"0/" width=/"20/" height=/"20/" style=/"fill:none;/"/><rect x=/"2/" y=/"15.6/" width=/"16/" height=/"3.2/" style=/"fill:#fff;/"/></svg>';export const resize = '<?xml version=/"1.0/" encoding=/"UTF-8/" standalone=/"no/"?><!DOCTYPE svg PUBLIC /"-/W3C/DTD SVG 1.1/EN/" /"http:/www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd/"><svg width=/"100%/" height=/"100%/" viewBox=/"0 0 20 20/" version=/"1.1/" xmlns=/"http:/www.w3.org/2000/svg/" xmlns:xlink=/"http:/www.w3.org/1999/xlink/" xml:space=/"preserve/" xmlns:serif=/"http:/www.serif.com//" style=/"fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;/"><rect id=/"resize/" x=/"0/" y=/"0/" width=/"20/" height=/"20/" style=/"fill:none;/"/><clipPath id=/"_clip1/"><rect x=/"0/" y=/"0/" width=/"20/" height=/"20/"/></clipPath><g clip-path=/"url(#_clip1)/"><rect x=/"0/" y=/"16.8/" width=/"20/" height=/"3.2/" style=/"fill:#fff;/"/><path d=/"M17.737,3.595l-14.142,14.142l2.263,2.263l14.142,-14.142l-2.263,-2.263Z/" style=/"fill:#fff;/"/><path d=/"M16.8,0l0,20l3.2,0l0,-20l-3.2,0Z/" style=/"fill:#fff;/"/><path d=/"M7.099,18.4l11.301,-11.123l0,11.123l-11.301,0Z/" style=/"fill:#fff;/"/></g></svg>';export const restore = '<?xml version=/"1.0/" encoding=/"UTF-8/" standalone=/"no/"?><!DOCTYPE svg PUBLIC /"-/W3C/DTD SVG 1.1/EN/" /"http:/www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd/"><svg width=/"100%/" height=/"100%/" viewBox=/"0 0 20 20/" version=/"1.1/" xmlns=/"http:/www.w3.org/2000/svg/" xmlns:xlink=/"http:/www.w3.org/1999/xlink/" xml:space=/"preserve/" xmlns:serif=/"http:/www.serif.com//" style=/"fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;/"><rect id=/"restore/" x=/"0/" y=/"0/" width=/"20/" height=/"20/" style=/"fill:none;/"/><g><rect x=/"7/" y=/"2.5/" width=/"10/" height=/"10/" style=/"fill:none;stroke:#fff;stroke-width:1.5px;/"/><rect x=/"7/" y=/"2.5/" width=/"10/" height=/"2/" style=/"fill:#fff;/"/></g><g><rect x=/"3/" y=/"7.5/" width=/"10/" height=/"10/" style=/"fill:none;stroke:#fff;stroke-width:1.5px;/"/><g><rect x=/"3/" y=/"7.5/" width=/"10/" height=/"2/" style=/"fill:#fff;/"/></g></g></svg>';" +0 -1
@@ -31,347 +31,359 @@ function html(options = {})
31
31
  return element
32
32
  }
33
33
 
34
- function createCommonjsModule(fn, module) {
35
- return module = { exports: {} }, fn(module, module.exports), module.exports;
34
+ function getDefaultExportFromCjs (x) {
35
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
36
36
  }
37
37
 
38
- var eventemitter3 = createCommonjsModule(function (module) {
39
-
40
- var has = Object.prototype.hasOwnProperty
41
- , prefix = '~';
42
-
43
- /**
44
- * Constructor to create a storage for our `EE` objects.
45
- * An `Events` instance is a plain object whose properties are event names.
46
- *
47
- * @constructor
48
- * @private
49
- */
50
- function Events() {}
51
-
52
- //
53
- // We try to not inherit from `Object.prototype`. In some engines creating an
54
- // instance in this way is faster than calling `Object.create(null)` directly.
55
- // If `Object.create(null)` is not supported we prefix the event names with a
56
- // character to make sure that the built-in object properties are not
57
- // overridden or used as an attack vector.
58
- //
59
- if (Object.create) {
60
- Events.prototype = Object.create(null);
61
-
62
- //
63
- // This hack is needed because the `__proto__` property is still inherited in
64
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
65
- //
66
- if (!new Events().__proto__) prefix = false;
67
- }
68
-
69
- /**
70
- * Representation of a single event listener.
71
- *
72
- * @param {Function} fn The listener function.
73
- * @param {*} context The context to invoke the listener with.
74
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
75
- * @constructor
76
- * @private
77
- */
78
- function EE(fn, context, once) {
79
- this.fn = fn;
80
- this.context = context;
81
- this.once = once || false;
82
- }
83
-
84
- /**
85
- * Add a listener for a given event.
86
- *
87
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
88
- * @param {(String|Symbol)} event The event name.
89
- * @param {Function} fn The listener function.
90
- * @param {*} context The context to invoke the listener with.
91
- * @param {Boolean} once Specify if the listener is a one-time listener.
92
- * @returns {EventEmitter}
93
- * @private
94
- */
95
- function addListener(emitter, event, fn, context, once) {
96
- if (typeof fn !== 'function') {
97
- throw new TypeError('The listener must be a function');
98
- }
99
-
100
- var listener = new EE(fn, context || emitter, once)
101
- , evt = prefix ? prefix + event : event;
102
-
103
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
104
- else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
105
- else emitter._events[evt] = [emitter._events[evt], listener];
106
-
107
- return emitter;
108
- }
109
-
110
- /**
111
- * Clear event by name.
112
- *
113
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
114
- * @param {(String|Symbol)} evt The Event name.
115
- * @private
116
- */
117
- function clearEvent(emitter, evt) {
118
- if (--emitter._eventsCount === 0) emitter._events = new Events();
119
- else delete emitter._events[evt];
120
- }
121
-
122
- /**
123
- * Minimal `EventEmitter` interface that is molded against the Node.js
124
- * `EventEmitter` interface.
125
- *
126
- * @constructor
127
- * @public
128
- */
129
- function EventEmitter() {
130
- this._events = new Events();
131
- this._eventsCount = 0;
38
+ var eventemitter3 = {exports: {}};
39
+
40
+ var hasRequiredEventemitter3;
41
+
42
+ function requireEventemitter3 () {
43
+ if (hasRequiredEventemitter3) return eventemitter3.exports;
44
+ hasRequiredEventemitter3 = 1;
45
+ (function (module) {
46
+
47
+ var has = Object.prototype.hasOwnProperty
48
+ , prefix = '~';
49
+
50
+ /**
51
+ * Constructor to create a storage for our `EE` objects.
52
+ * An `Events` instance is a plain object whose properties are event names.
53
+ *
54
+ * @constructor
55
+ * @private
56
+ */
57
+ function Events() {}
58
+
59
+ //
60
+ // We try to not inherit from `Object.prototype`. In some engines creating an
61
+ // instance in this way is faster than calling `Object.create(null)` directly.
62
+ // If `Object.create(null)` is not supported we prefix the event names with a
63
+ // character to make sure that the built-in object properties are not
64
+ // overridden or used as an attack vector.
65
+ //
66
+ if (Object.create) {
67
+ Events.prototype = Object.create(null);
68
+
69
+ //
70
+ // This hack is needed because the `__proto__` property is still inherited in
71
+ // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
72
+ //
73
+ if (!new Events().__proto__) prefix = false;
74
+ }
75
+
76
+ /**
77
+ * Representation of a single event listener.
78
+ *
79
+ * @param {Function} fn The listener function.
80
+ * @param {*} context The context to invoke the listener with.
81
+ * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
82
+ * @constructor
83
+ * @private
84
+ */
85
+ function EE(fn, context, once) {
86
+ this.fn = fn;
87
+ this.context = context;
88
+ this.once = once || false;
89
+ }
90
+
91
+ /**
92
+ * Add a listener for a given event.
93
+ *
94
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
95
+ * @param {(String|Symbol)} event The event name.
96
+ * @param {Function} fn The listener function.
97
+ * @param {*} context The context to invoke the listener with.
98
+ * @param {Boolean} once Specify if the listener is a one-time listener.
99
+ * @returns {EventEmitter}
100
+ * @private
101
+ */
102
+ function addListener(emitter, event, fn, context, once) {
103
+ if (typeof fn !== 'function') {
104
+ throw new TypeError('The listener must be a function');
105
+ }
106
+
107
+ var listener = new EE(fn, context || emitter, once)
108
+ , evt = prefix ? prefix + event : event;
109
+
110
+ if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
111
+ else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
112
+ else emitter._events[evt] = [emitter._events[evt], listener];
113
+
114
+ return emitter;
115
+ }
116
+
117
+ /**
118
+ * Clear event by name.
119
+ *
120
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
121
+ * @param {(String|Symbol)} evt The Event name.
122
+ * @private
123
+ */
124
+ function clearEvent(emitter, evt) {
125
+ if (--emitter._eventsCount === 0) emitter._events = new Events();
126
+ else delete emitter._events[evt];
127
+ }
128
+
129
+ /**
130
+ * Minimal `EventEmitter` interface that is molded against the Node.js
131
+ * `EventEmitter` interface.
132
+ *
133
+ * @constructor
134
+ * @public
135
+ */
136
+ function EventEmitter() {
137
+ this._events = new Events();
138
+ this._eventsCount = 0;
139
+ }
140
+
141
+ /**
142
+ * Return an array listing the events for which the emitter has registered
143
+ * listeners.
144
+ *
145
+ * @returns {Array}
146
+ * @public
147
+ */
148
+ EventEmitter.prototype.eventNames = function eventNames() {
149
+ var names = []
150
+ , events
151
+ , name;
152
+
153
+ if (this._eventsCount === 0) return names;
154
+
155
+ for (name in (events = this._events)) {
156
+ if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
157
+ }
158
+
159
+ if (Object.getOwnPropertySymbols) {
160
+ return names.concat(Object.getOwnPropertySymbols(events));
161
+ }
162
+
163
+ return names;
164
+ };
165
+
166
+ /**
167
+ * Return the listeners registered for a given event.
168
+ *
169
+ * @param {(String|Symbol)} event The event name.
170
+ * @returns {Array} The registered listeners.
171
+ * @public
172
+ */
173
+ EventEmitter.prototype.listeners = function listeners(event) {
174
+ var evt = prefix ? prefix + event : event
175
+ , handlers = this._events[evt];
176
+
177
+ if (!handlers) return [];
178
+ if (handlers.fn) return [handlers.fn];
179
+
180
+ for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
181
+ ee[i] = handlers[i].fn;
182
+ }
183
+
184
+ return ee;
185
+ };
186
+
187
+ /**
188
+ * Return the number of listeners listening to a given event.
189
+ *
190
+ * @param {(String|Symbol)} event The event name.
191
+ * @returns {Number} The number of listeners.
192
+ * @public
193
+ */
194
+ EventEmitter.prototype.listenerCount = function listenerCount(event) {
195
+ var evt = prefix ? prefix + event : event
196
+ , listeners = this._events[evt];
197
+
198
+ if (!listeners) return 0;
199
+ if (listeners.fn) return 1;
200
+ return listeners.length;
201
+ };
202
+
203
+ /**
204
+ * Calls each of the listeners registered for a given event.
205
+ *
206
+ * @param {(String|Symbol)} event The event name.
207
+ * @returns {Boolean} `true` if the event had listeners, else `false`.
208
+ * @public
209
+ */
210
+ EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
211
+ var evt = prefix ? prefix + event : event;
212
+
213
+ if (!this._events[evt]) return false;
214
+
215
+ var listeners = this._events[evt]
216
+ , len = arguments.length
217
+ , args
218
+ , i;
219
+
220
+ if (listeners.fn) {
221
+ if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
222
+
223
+ switch (len) {
224
+ case 1: return listeners.fn.call(listeners.context), true;
225
+ case 2: return listeners.fn.call(listeners.context, a1), true;
226
+ case 3: return listeners.fn.call(listeners.context, a1, a2), true;
227
+ case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
228
+ case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
229
+ case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
230
+ }
231
+
232
+ for (i = 1, args = new Array(len -1); i < len; i++) {
233
+ args[i - 1] = arguments[i];
234
+ }
235
+
236
+ listeners.fn.apply(listeners.context, args);
237
+ } else {
238
+ var length = listeners.length
239
+ , j;
240
+
241
+ for (i = 0; i < length; i++) {
242
+ if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
243
+
244
+ switch (len) {
245
+ case 1: listeners[i].fn.call(listeners[i].context); break;
246
+ case 2: listeners[i].fn.call(listeners[i].context, a1); break;
247
+ case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
248
+ case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
249
+ default:
250
+ if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
251
+ args[j - 1] = arguments[j];
252
+ }
253
+
254
+ listeners[i].fn.apply(listeners[i].context, args);
255
+ }
256
+ }
257
+ }
258
+
259
+ return true;
260
+ };
261
+
262
+ /**
263
+ * Add a listener for a given event.
264
+ *
265
+ * @param {(String|Symbol)} event The event name.
266
+ * @param {Function} fn The listener function.
267
+ * @param {*} [context=this] The context to invoke the listener with.
268
+ * @returns {EventEmitter} `this`.
269
+ * @public
270
+ */
271
+ EventEmitter.prototype.on = function on(event, fn, context) {
272
+ return addListener(this, event, fn, context, false);
273
+ };
274
+
275
+ /**
276
+ * Add a one-time listener for a given event.
277
+ *
278
+ * @param {(String|Symbol)} event The event name.
279
+ * @param {Function} fn The listener function.
280
+ * @param {*} [context=this] The context to invoke the listener with.
281
+ * @returns {EventEmitter} `this`.
282
+ * @public
283
+ */
284
+ EventEmitter.prototype.once = function once(event, fn, context) {
285
+ return addListener(this, event, fn, context, true);
286
+ };
287
+
288
+ /**
289
+ * Remove the listeners of a given event.
290
+ *
291
+ * @param {(String|Symbol)} event The event name.
292
+ * @param {Function} fn Only remove the listeners that match this function.
293
+ * @param {*} context Only remove the listeners that have this context.
294
+ * @param {Boolean} once Only remove one-time listeners.
295
+ * @returns {EventEmitter} `this`.
296
+ * @public
297
+ */
298
+ EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
299
+ var evt = prefix ? prefix + event : event;
300
+
301
+ if (!this._events[evt]) return this;
302
+ if (!fn) {
303
+ clearEvent(this, evt);
304
+ return this;
305
+ }
306
+
307
+ var listeners = this._events[evt];
308
+
309
+ if (listeners.fn) {
310
+ if (
311
+ listeners.fn === fn &&
312
+ (!once || listeners.once) &&
313
+ (!context || listeners.context === context)
314
+ ) {
315
+ clearEvent(this, evt);
316
+ }
317
+ } else {
318
+ for (var i = 0, events = [], length = listeners.length; i < length; i++) {
319
+ if (
320
+ listeners[i].fn !== fn ||
321
+ (once && !listeners[i].once) ||
322
+ (context && listeners[i].context !== context)
323
+ ) {
324
+ events.push(listeners[i]);
325
+ }
326
+ }
327
+
328
+ //
329
+ // Reset the array, or remove it completely if we have no more listeners.
330
+ //
331
+ if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
332
+ else clearEvent(this, evt);
333
+ }
334
+
335
+ return this;
336
+ };
337
+
338
+ /**
339
+ * Remove all listeners, or those of the specified event.
340
+ *
341
+ * @param {(String|Symbol)} [event] The event name.
342
+ * @returns {EventEmitter} `this`.
343
+ * @public
344
+ */
345
+ EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
346
+ var evt;
347
+
348
+ if (event) {
349
+ evt = prefix ? prefix + event : event;
350
+ if (this._events[evt]) clearEvent(this, evt);
351
+ } else {
352
+ this._events = new Events();
353
+ this._eventsCount = 0;
354
+ }
355
+
356
+ return this;
357
+ };
358
+
359
+ //
360
+ // Alias methods names because people roll like that.
361
+ //
362
+ EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
363
+ EventEmitter.prototype.addListener = EventEmitter.prototype.on;
364
+
365
+ //
366
+ // Expose the prefix.
367
+ //
368
+ EventEmitter.prefixed = prefix;
369
+
370
+ //
371
+ // Allow `EventEmitter` to be imported as module namespace.
372
+ //
373
+ EventEmitter.EventEmitter = EventEmitter;
374
+
375
+ //
376
+ // Expose the module.
377
+ //
378
+ {
379
+ module.exports = EventEmitter;
380
+ }
381
+ } (eventemitter3));
382
+ return eventemitter3.exports;
132
383
  }
133
384
 
134
- /**
135
- * Return an array listing the events for which the emitter has registered
136
- * listeners.
137
- *
138
- * @returns {Array}
139
- * @public
140
- */
141
- EventEmitter.prototype.eventNames = function eventNames() {
142
- var names = []
143
- , events
144
- , name;
145
-
146
- if (this._eventsCount === 0) return names;
147
-
148
- for (name in (events = this._events)) {
149
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
150
- }
151
-
152
- if (Object.getOwnPropertySymbols) {
153
- return names.concat(Object.getOwnPropertySymbols(events));
154
- }
155
-
156
- return names;
157
- };
158
-
159
- /**
160
- * Return the listeners registered for a given event.
161
- *
162
- * @param {(String|Symbol)} event The event name.
163
- * @returns {Array} The registered listeners.
164
- * @public
165
- */
166
- EventEmitter.prototype.listeners = function listeners(event) {
167
- var evt = prefix ? prefix + event : event
168
- , handlers = this._events[evt];
169
-
170
- if (!handlers) return [];
171
- if (handlers.fn) return [handlers.fn];
172
-
173
- for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
174
- ee[i] = handlers[i].fn;
175
- }
176
-
177
- return ee;
178
- };
179
-
180
- /**
181
- * Return the number of listeners listening to a given event.
182
- *
183
- * @param {(String|Symbol)} event The event name.
184
- * @returns {Number} The number of listeners.
185
- * @public
186
- */
187
- EventEmitter.prototype.listenerCount = function listenerCount(event) {
188
- var evt = prefix ? prefix + event : event
189
- , listeners = this._events[evt];
190
-
191
- if (!listeners) return 0;
192
- if (listeners.fn) return 1;
193
- return listeners.length;
194
- };
195
-
196
- /**
197
- * Calls each of the listeners registered for a given event.
198
- *
199
- * @param {(String|Symbol)} event The event name.
200
- * @returns {Boolean} `true` if the event had listeners, else `false`.
201
- * @public
202
- */
203
- EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
204
- var evt = prefix ? prefix + event : event;
205
-
206
- if (!this._events[evt]) return false;
207
-
208
- var listeners = this._events[evt]
209
- , len = arguments.length
210
- , args
211
- , i;
212
-
213
- if (listeners.fn) {
214
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
215
-
216
- switch (len) {
217
- case 1: return listeners.fn.call(listeners.context), true;
218
- case 2: return listeners.fn.call(listeners.context, a1), true;
219
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
220
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
221
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
222
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
223
- }
224
-
225
- for (i = 1, args = new Array(len -1); i < len; i++) {
226
- args[i - 1] = arguments[i];
227
- }
228
-
229
- listeners.fn.apply(listeners.context, args);
230
- } else {
231
- var length = listeners.length
232
- , j;
233
-
234
- for (i = 0; i < length; i++) {
235
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
236
-
237
- switch (len) {
238
- case 1: listeners[i].fn.call(listeners[i].context); break;
239
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
240
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
241
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
242
- default:
243
- if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
244
- args[j - 1] = arguments[j];
245
- }
246
-
247
- listeners[i].fn.apply(listeners[i].context, args);
248
- }
249
- }
250
- }
251
-
252
- return true;
253
- };
254
-
255
- /**
256
- * Add a listener for a given event.
257
- *
258
- * @param {(String|Symbol)} event The event name.
259
- * @param {Function} fn The listener function.
260
- * @param {*} [context=this] The context to invoke the listener with.
261
- * @returns {EventEmitter} `this`.
262
- * @public
263
- */
264
- EventEmitter.prototype.on = function on(event, fn, context) {
265
- return addListener(this, event, fn, context, false);
266
- };
267
-
268
- /**
269
- * Add a one-time listener for a given event.
270
- *
271
- * @param {(String|Symbol)} event The event name.
272
- * @param {Function} fn The listener function.
273
- * @param {*} [context=this] The context to invoke the listener with.
274
- * @returns {EventEmitter} `this`.
275
- * @public
276
- */
277
- EventEmitter.prototype.once = function once(event, fn, context) {
278
- return addListener(this, event, fn, context, true);
279
- };
280
-
281
- /**
282
- * Remove the listeners of a given event.
283
- *
284
- * @param {(String|Symbol)} event The event name.
285
- * @param {Function} fn Only remove the listeners that match this function.
286
- * @param {*} context Only remove the listeners that have this context.
287
- * @param {Boolean} once Only remove one-time listeners.
288
- * @returns {EventEmitter} `this`.
289
- * @public
290
- */
291
- EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
292
- var evt = prefix ? prefix + event : event;
293
-
294
- if (!this._events[evt]) return this;
295
- if (!fn) {
296
- clearEvent(this, evt);
297
- return this;
298
- }
299
-
300
- var listeners = this._events[evt];
301
-
302
- if (listeners.fn) {
303
- if (
304
- listeners.fn === fn &&
305
- (!once || listeners.once) &&
306
- (!context || listeners.context === context)
307
- ) {
308
- clearEvent(this, evt);
309
- }
310
- } else {
311
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
312
- if (
313
- listeners[i].fn !== fn ||
314
- (once && !listeners[i].once) ||
315
- (context && listeners[i].context !== context)
316
- ) {
317
- events.push(listeners[i]);
318
- }
319
- }
320
-
321
- //
322
- // Reset the array, or remove it completely if we have no more listeners.
323
- //
324
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
325
- else clearEvent(this, evt);
326
- }
327
-
328
- return this;
329
- };
330
-
331
- /**
332
- * Remove all listeners, or those of the specified event.
333
- *
334
- * @param {(String|Symbol)} [event] The event name.
335
- * @returns {EventEmitter} `this`.
336
- * @public
337
- */
338
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
339
- var evt;
340
-
341
- if (event) {
342
- evt = prefix ? prefix + event : event;
343
- if (this._events[evt]) clearEvent(this, evt);
344
- } else {
345
- this._events = new Events();
346
- this._eventsCount = 0;
347
- }
348
-
349
- return this;
350
- };
351
-
352
- //
353
- // Alias methods names because people roll like that.
354
- //
355
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
356
- EventEmitter.prototype.addListener = EventEmitter.prototype.on;
357
-
358
- //
359
- // Expose the prefix.
360
- //
361
- EventEmitter.prefixed = prefix;
362
-
363
- //
364
- // Allow `EventEmitter` to be imported as module namespace.
365
- //
366
- EventEmitter.EventEmitter = EventEmitter;
367
-
368
- //
369
- // Expose the module.
370
- //
371
- {
372
- module.exports = EventEmitter;
373
- }
374
- });
385
+ var eventemitter3Exports = requireEventemitter3();
386
+ var Events = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
375
387
 
376
388
  /**
377
389
  * Watcher for click, double-click, or long-click event for both mouse and touch
@@ -1539,7 +1551,7 @@ class Menu
1539
1551
  * @fires resize-height
1540
1552
  * @fires loaded
1541
1553
  */
1542
- class Window extends eventemitter3
1554
+ class Window extends Events
1543
1555
  {
1544
1556
  constructor(wm, options = {})
1545
1557
  {
@@ -1996,6 +2008,8 @@ class Window extends eventemitter3
1996
2008
  'display': 'block',
1997
2009
  'flex': 1,
1998
2010
  'min-height': this.options.minHeight,
2011
+ // leave room under the content for the resize handle, so it can't cover the scrollbar
2012
+ 'margin-bottom': this.options.resizable ? '15px' : 0,
1999
2013
  'overflow-x': 'hidden',
2000
2014
  'overflow-y': 'auto'
2001
2015
  }