jtui3.0 1.0.59 → 1.0.60
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/lib/jtui3.0.common.js +1821 -25
- package/lib/jtui3.0.css +1 -1
- package/lib/jtui3.0.umd.js +1821 -25
- package/lib/jtui3.0.umd.min.js +6 -6
- package/package.json +2 -1
package/lib/jtui3.0.common.js
CHANGED
|
@@ -2832,6 +2832,177 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2832
2832
|
// extracted by mini-css-extract-plugin
|
|
2833
2833
|
|
|
2834
2834
|
|
|
2835
|
+
/***/ }),
|
|
2836
|
+
|
|
2837
|
+
/***/ 8845:
|
|
2838
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
2839
|
+
|
|
2840
|
+
"use strict";
|
|
2841
|
+
|
|
2842
|
+
|
|
2843
|
+
var utils = __webpack_require__(1373);
|
|
2844
|
+
|
|
2845
|
+
module.exports = function batchProcessorMaker(options) {
|
|
2846
|
+
options = options || {};
|
|
2847
|
+
var reporter = options.reporter;
|
|
2848
|
+
var asyncProcess = utils.getOption(options, "async", true);
|
|
2849
|
+
var autoProcess = utils.getOption(options, "auto", true);
|
|
2850
|
+
|
|
2851
|
+
if (autoProcess && !asyncProcess) {
|
|
2852
|
+
reporter && reporter.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true.");
|
|
2853
|
+
asyncProcess = true;
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2856
|
+
var batch = Batch();
|
|
2857
|
+
var asyncFrameHandler;
|
|
2858
|
+
var isProcessing = false;
|
|
2859
|
+
|
|
2860
|
+
function addFunction(level, fn) {
|
|
2861
|
+
if (!isProcessing && autoProcess && asyncProcess && batch.size() === 0) {
|
|
2862
|
+
// Since this is async, it is guaranteed to be executed after that the fn is added to the batch.
|
|
2863
|
+
// This needs to be done before, since we're checking the size of the batch to be 0.
|
|
2864
|
+
processBatchAsync();
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
batch.add(level, fn);
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
function processBatch() {
|
|
2871
|
+
// Save the current batch, and create a new batch so that incoming functions are not added into the currently processing batch.
|
|
2872
|
+
// Continue processing until the top-level batch is empty (functions may be added to the new batch while processing, and so on).
|
|
2873
|
+
isProcessing = true;
|
|
2874
|
+
|
|
2875
|
+
while (batch.size()) {
|
|
2876
|
+
var processingBatch = batch;
|
|
2877
|
+
batch = Batch();
|
|
2878
|
+
processingBatch.process();
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2881
|
+
isProcessing = false;
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
function forceProcessBatch(localAsyncProcess) {
|
|
2885
|
+
if (isProcessing) {
|
|
2886
|
+
return;
|
|
2887
|
+
}
|
|
2888
|
+
|
|
2889
|
+
if (localAsyncProcess === undefined) {
|
|
2890
|
+
localAsyncProcess = asyncProcess;
|
|
2891
|
+
}
|
|
2892
|
+
|
|
2893
|
+
if (asyncFrameHandler) {
|
|
2894
|
+
cancelFrame(asyncFrameHandler);
|
|
2895
|
+
asyncFrameHandler = null;
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
if (localAsyncProcess) {
|
|
2899
|
+
processBatchAsync();
|
|
2900
|
+
} else {
|
|
2901
|
+
processBatch();
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
|
|
2905
|
+
function processBatchAsync() {
|
|
2906
|
+
asyncFrameHandler = requestFrame(processBatch);
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2909
|
+
function clearBatch() {
|
|
2910
|
+
batch = {};
|
|
2911
|
+
batchSize = 0;
|
|
2912
|
+
topLevel = 0;
|
|
2913
|
+
bottomLevel = 0;
|
|
2914
|
+
}
|
|
2915
|
+
|
|
2916
|
+
function cancelFrame(listener) {
|
|
2917
|
+
// var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout;
|
|
2918
|
+
var cancel = clearTimeout;
|
|
2919
|
+
return cancel(listener);
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
function requestFrame(callback) {
|
|
2923
|
+
// var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function(fn) { return window.setTimeout(fn, 20); };
|
|
2924
|
+
var raf = function (fn) {
|
|
2925
|
+
return setTimeout(fn, 0);
|
|
2926
|
+
};
|
|
2927
|
+
|
|
2928
|
+
return raf(callback);
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2931
|
+
return {
|
|
2932
|
+
add: addFunction,
|
|
2933
|
+
force: forceProcessBatch
|
|
2934
|
+
};
|
|
2935
|
+
};
|
|
2936
|
+
|
|
2937
|
+
function Batch() {
|
|
2938
|
+
var batch = {};
|
|
2939
|
+
var size = 0;
|
|
2940
|
+
var topLevel = 0;
|
|
2941
|
+
var bottomLevel = 0;
|
|
2942
|
+
|
|
2943
|
+
function add(level, fn) {
|
|
2944
|
+
if (!fn) {
|
|
2945
|
+
fn = level;
|
|
2946
|
+
level = 0;
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
if (level > topLevel) {
|
|
2950
|
+
topLevel = level;
|
|
2951
|
+
} else if (level < bottomLevel) {
|
|
2952
|
+
bottomLevel = level;
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
if (!batch[level]) {
|
|
2956
|
+
batch[level] = [];
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
batch[level].push(fn);
|
|
2960
|
+
size++;
|
|
2961
|
+
}
|
|
2962
|
+
|
|
2963
|
+
function process() {
|
|
2964
|
+
for (var level = bottomLevel; level <= topLevel; level++) {
|
|
2965
|
+
var fns = batch[level];
|
|
2966
|
+
|
|
2967
|
+
for (var i = 0; i < fns.length; i++) {
|
|
2968
|
+
var fn = fns[i];
|
|
2969
|
+
fn();
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
function getSize() {
|
|
2975
|
+
return size;
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
return {
|
|
2979
|
+
add: add,
|
|
2980
|
+
process: process,
|
|
2981
|
+
size: getSize
|
|
2982
|
+
};
|
|
2983
|
+
}
|
|
2984
|
+
|
|
2985
|
+
/***/ }),
|
|
2986
|
+
|
|
2987
|
+
/***/ 1373:
|
|
2988
|
+
/***/ (function(module) {
|
|
2989
|
+
|
|
2990
|
+
"use strict";
|
|
2991
|
+
|
|
2992
|
+
|
|
2993
|
+
var utils = module.exports = {};
|
|
2994
|
+
utils.getOption = getOption;
|
|
2995
|
+
|
|
2996
|
+
function getOption(options, name, defaultValue) {
|
|
2997
|
+
var value = options[name];
|
|
2998
|
+
|
|
2999
|
+
if ((value === undefined || value === null) && defaultValue !== undefined) {
|
|
3000
|
+
return defaultValue;
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
return value;
|
|
3004
|
+
}
|
|
3005
|
+
|
|
2835
3006
|
/***/ }),
|
|
2836
3007
|
|
|
2837
3008
|
/***/ 5743:
|
|
@@ -4164,6 +4335,1623 @@ __webpack_require__(1703);
|
|
|
4164
4335
|
|
|
4165
4336
|
/***/ }),
|
|
4166
4337
|
|
|
4338
|
+
/***/ 2499:
|
|
4339
|
+
/***/ (function(module) {
|
|
4340
|
+
|
|
4341
|
+
"use strict";
|
|
4342
|
+
|
|
4343
|
+
|
|
4344
|
+
var detector = module.exports = {};
|
|
4345
|
+
|
|
4346
|
+
detector.isIE = function (version) {
|
|
4347
|
+
function isAnyIeVersion() {
|
|
4348
|
+
var agent = navigator.userAgent.toLowerCase();
|
|
4349
|
+
return agent.indexOf("msie") !== -1 || agent.indexOf("trident") !== -1 || agent.indexOf(" edge/") !== -1;
|
|
4350
|
+
}
|
|
4351
|
+
|
|
4352
|
+
if (!isAnyIeVersion()) {
|
|
4353
|
+
return false;
|
|
4354
|
+
}
|
|
4355
|
+
|
|
4356
|
+
if (!version) {
|
|
4357
|
+
return true;
|
|
4358
|
+
} //Shamelessly stolen from https://gist.github.com/padolsey/527683
|
|
4359
|
+
|
|
4360
|
+
|
|
4361
|
+
var ieVersion = function () {
|
|
4362
|
+
var undef,
|
|
4363
|
+
v = 3,
|
|
4364
|
+
div = document.createElement("div"),
|
|
4365
|
+
all = div.getElementsByTagName("i");
|
|
4366
|
+
|
|
4367
|
+
do {
|
|
4368
|
+
div.innerHTML = "<!--[if gt IE " + ++v + "]><i></i><![endif]-->";
|
|
4369
|
+
} while (all[0]);
|
|
4370
|
+
|
|
4371
|
+
return v > 4 ? v : undef;
|
|
4372
|
+
}();
|
|
4373
|
+
|
|
4374
|
+
return version === ieVersion;
|
|
4375
|
+
};
|
|
4376
|
+
|
|
4377
|
+
detector.isLegacyOpera = function () {
|
|
4378
|
+
return !!window.opera;
|
|
4379
|
+
};
|
|
4380
|
+
|
|
4381
|
+
/***/ }),
|
|
4382
|
+
|
|
4383
|
+
/***/ 8485:
|
|
4384
|
+
/***/ (function(module) {
|
|
4385
|
+
|
|
4386
|
+
"use strict";
|
|
4387
|
+
|
|
4388
|
+
|
|
4389
|
+
var utils = module.exports = {};
|
|
4390
|
+
/**
|
|
4391
|
+
* Loops through the collection and calls the callback for each element. if the callback returns truthy, the loop is broken and returns the same value.
|
|
4392
|
+
* @public
|
|
4393
|
+
* @param {*} collection The collection to loop through. Needs to have a length property set and have indices set from 0 to length - 1.
|
|
4394
|
+
* @param {function} callback The callback to be called for each element. The element will be given as a parameter to the callback. If this callback returns truthy, the loop is broken and the same value is returned.
|
|
4395
|
+
* @returns {*} The value that a callback has returned (if truthy). Otherwise nothing.
|
|
4396
|
+
*/
|
|
4397
|
+
|
|
4398
|
+
utils.forEach = function (collection, callback) {
|
|
4399
|
+
for (var i = 0; i < collection.length; i++) {
|
|
4400
|
+
var result = callback(collection[i]);
|
|
4401
|
+
|
|
4402
|
+
if (result) {
|
|
4403
|
+
return result;
|
|
4404
|
+
}
|
|
4405
|
+
}
|
|
4406
|
+
};
|
|
4407
|
+
|
|
4408
|
+
/***/ }),
|
|
4409
|
+
|
|
4410
|
+
/***/ 8862:
|
|
4411
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
4412
|
+
|
|
4413
|
+
"use strict";
|
|
4414
|
+
/**
|
|
4415
|
+
* Resize detection strategy that injects objects to elements in order to detect resize events.
|
|
4416
|
+
* Heavily inspired by: http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/
|
|
4417
|
+
*/
|
|
4418
|
+
|
|
4419
|
+
|
|
4420
|
+
__webpack_require__(1703);
|
|
4421
|
+
|
|
4422
|
+
var browserDetector = __webpack_require__(2499);
|
|
4423
|
+
|
|
4424
|
+
module.exports = function (options) {
|
|
4425
|
+
options = options || {};
|
|
4426
|
+
var reporter = options.reporter;
|
|
4427
|
+
var batchProcessor = options.batchProcessor;
|
|
4428
|
+
var getState = options.stateHandler.getState;
|
|
4429
|
+
|
|
4430
|
+
if (!reporter) {
|
|
4431
|
+
throw new Error("Missing required dependency: reporter.");
|
|
4432
|
+
}
|
|
4433
|
+
/**
|
|
4434
|
+
* Adds a resize event listener to the element.
|
|
4435
|
+
* @public
|
|
4436
|
+
* @param {element} element The element that should have the listener added.
|
|
4437
|
+
* @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.
|
|
4438
|
+
*/
|
|
4439
|
+
|
|
4440
|
+
|
|
4441
|
+
function addListener(element, listener) {
|
|
4442
|
+
function listenerProxy() {
|
|
4443
|
+
listener(element);
|
|
4444
|
+
}
|
|
4445
|
+
|
|
4446
|
+
if (browserDetector.isIE(8)) {
|
|
4447
|
+
//IE 8 does not support object, but supports the resize event directly on elements.
|
|
4448
|
+
getState(element).object = {
|
|
4449
|
+
proxy: listenerProxy
|
|
4450
|
+
};
|
|
4451
|
+
element.attachEvent("onresize", listenerProxy);
|
|
4452
|
+
} else {
|
|
4453
|
+
var object = getObject(element);
|
|
4454
|
+
|
|
4455
|
+
if (!object) {
|
|
4456
|
+
throw new Error("Element is not detectable by this strategy.");
|
|
4457
|
+
}
|
|
4458
|
+
|
|
4459
|
+
object.contentDocument.defaultView.addEventListener("resize", listenerProxy);
|
|
4460
|
+
}
|
|
4461
|
+
}
|
|
4462
|
+
|
|
4463
|
+
function buildCssTextString(rules) {
|
|
4464
|
+
var seperator = options.important ? " !important; " : "; ";
|
|
4465
|
+
return (rules.join(seperator) + seperator).trim();
|
|
4466
|
+
}
|
|
4467
|
+
/**
|
|
4468
|
+
* Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.
|
|
4469
|
+
* @private
|
|
4470
|
+
* @param {object} options Optional options object.
|
|
4471
|
+
* @param {element} element The element to make detectable
|
|
4472
|
+
* @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.
|
|
4473
|
+
*/
|
|
4474
|
+
|
|
4475
|
+
|
|
4476
|
+
function makeDetectable(options, element, callback) {
|
|
4477
|
+
if (!callback) {
|
|
4478
|
+
callback = element;
|
|
4479
|
+
element = options;
|
|
4480
|
+
options = null;
|
|
4481
|
+
}
|
|
4482
|
+
|
|
4483
|
+
options = options || {};
|
|
4484
|
+
var debug = options.debug;
|
|
4485
|
+
|
|
4486
|
+
function injectObject(element, callback) {
|
|
4487
|
+
var OBJECT_STYLE = buildCssTextString(["display: block", "position: absolute", "top: 0", "left: 0", "width: 100%", "height: 100%", "border: none", "padding: 0", "margin: 0", "opacity: 0", "z-index: -1000", "pointer-events: none"]); //The target element needs to be positioned (everything except static) so the absolute positioned object will be positioned relative to the target element.
|
|
4488
|
+
// Position altering may be performed directly or on object load, depending on if style resolution is possible directly or not.
|
|
4489
|
+
|
|
4490
|
+
var positionCheckPerformed = false; // The element may not yet be attached to the DOM, and therefore the style object may be empty in some browsers.
|
|
4491
|
+
// Since the style object is a reference, it will be updated as soon as the element is attached to the DOM.
|
|
4492
|
+
|
|
4493
|
+
var style = window.getComputedStyle(element);
|
|
4494
|
+
var width = element.offsetWidth;
|
|
4495
|
+
var height = element.offsetHeight;
|
|
4496
|
+
getState(element).startSize = {
|
|
4497
|
+
width: width,
|
|
4498
|
+
height: height
|
|
4499
|
+
};
|
|
4500
|
+
|
|
4501
|
+
function mutateDom() {
|
|
4502
|
+
function alterPositionStyles() {
|
|
4503
|
+
if (style.position === "static") {
|
|
4504
|
+
element.style.setProperty("position", "relative", options.important ? "important" : "");
|
|
4505
|
+
|
|
4506
|
+
var removeRelativeStyles = function (reporter, element, style, property) {
|
|
4507
|
+
function getNumericalValue(value) {
|
|
4508
|
+
return value.replace(/[^-\d\.]/g, "");
|
|
4509
|
+
}
|
|
4510
|
+
|
|
4511
|
+
var value = style[property];
|
|
4512
|
+
|
|
4513
|
+
if (value !== "auto" && getNumericalValue(value) !== "0") {
|
|
4514
|
+
reporter.warn("An element that is positioned static has style." + property + "=" + value + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + property + " will be set to 0. Element: ", element);
|
|
4515
|
+
element.style.setProperty(property, "0", options.important ? "important" : "");
|
|
4516
|
+
}
|
|
4517
|
+
}; //Check so that there are no accidental styles that will make the element styled differently now that is is relative.
|
|
4518
|
+
//If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).
|
|
4519
|
+
|
|
4520
|
+
|
|
4521
|
+
removeRelativeStyles(reporter, element, style, "top");
|
|
4522
|
+
removeRelativeStyles(reporter, element, style, "right");
|
|
4523
|
+
removeRelativeStyles(reporter, element, style, "bottom");
|
|
4524
|
+
removeRelativeStyles(reporter, element, style, "left");
|
|
4525
|
+
}
|
|
4526
|
+
}
|
|
4527
|
+
|
|
4528
|
+
function onObjectLoad() {
|
|
4529
|
+
// The object has been loaded, which means that the element now is guaranteed to be attached to the DOM.
|
|
4530
|
+
if (!positionCheckPerformed) {
|
|
4531
|
+
alterPositionStyles();
|
|
4532
|
+
}
|
|
4533
|
+
/*jshint validthis: true */
|
|
4534
|
+
|
|
4535
|
+
|
|
4536
|
+
function getDocument(element, callback) {
|
|
4537
|
+
//Opera 12 seem to call the object.onload before the actual document has been created.
|
|
4538
|
+
//So if it is not present, poll it with an timeout until it is present.
|
|
4539
|
+
//TODO: Could maybe be handled better with object.onreadystatechange or similar.
|
|
4540
|
+
if (!element.contentDocument) {
|
|
4541
|
+
var state = getState(element);
|
|
4542
|
+
|
|
4543
|
+
if (state.checkForObjectDocumentTimeoutId) {
|
|
4544
|
+
window.clearTimeout(state.checkForObjectDocumentTimeoutId);
|
|
4545
|
+
}
|
|
4546
|
+
|
|
4547
|
+
state.checkForObjectDocumentTimeoutId = setTimeout(function checkForObjectDocument() {
|
|
4548
|
+
state.checkForObjectDocumentTimeoutId = 0;
|
|
4549
|
+
getDocument(element, callback);
|
|
4550
|
+
}, 100);
|
|
4551
|
+
return;
|
|
4552
|
+
}
|
|
4553
|
+
|
|
4554
|
+
callback(element.contentDocument);
|
|
4555
|
+
} //Mutating the object element here seems to fire another load event.
|
|
4556
|
+
//Mutating the inner document of the object element is fine though.
|
|
4557
|
+
|
|
4558
|
+
|
|
4559
|
+
var objectElement = this; //Create the style element to be added to the object.
|
|
4560
|
+
|
|
4561
|
+
getDocument(objectElement, function onObjectDocumentReady(objectDocument) {
|
|
4562
|
+
//Notify that the element is ready to be listened to.
|
|
4563
|
+
callback(element);
|
|
4564
|
+
});
|
|
4565
|
+
} // The element may be detached from the DOM, and some browsers does not support style resolving of detached elements.
|
|
4566
|
+
// The alterPositionStyles needs to be delayed until we know the element has been attached to the DOM (which we are sure of when the onObjectLoad has been fired), if style resolution is not possible.
|
|
4567
|
+
|
|
4568
|
+
|
|
4569
|
+
if (style.position !== "") {
|
|
4570
|
+
alterPositionStyles(style);
|
|
4571
|
+
positionCheckPerformed = true;
|
|
4572
|
+
} //Add an object element as a child to the target element that will be listened to for resize events.
|
|
4573
|
+
|
|
4574
|
+
|
|
4575
|
+
var object = document.createElement("object");
|
|
4576
|
+
object.style.cssText = OBJECT_STYLE;
|
|
4577
|
+
object.tabIndex = -1;
|
|
4578
|
+
object.type = "text/html";
|
|
4579
|
+
object.setAttribute("aria-hidden", "true");
|
|
4580
|
+
object.onload = onObjectLoad; //Safari: This must occur before adding the object to the DOM.
|
|
4581
|
+
//IE: Does not like that this happens before, even if it is also added after.
|
|
4582
|
+
|
|
4583
|
+
if (!browserDetector.isIE()) {
|
|
4584
|
+
object.data = "about:blank";
|
|
4585
|
+
}
|
|
4586
|
+
|
|
4587
|
+
if (!getState(element)) {
|
|
4588
|
+
// The element has been uninstalled before the actual loading happened.
|
|
4589
|
+
return;
|
|
4590
|
+
}
|
|
4591
|
+
|
|
4592
|
+
element.appendChild(object);
|
|
4593
|
+
getState(element).object = object; //IE: This must occur after adding the object to the DOM.
|
|
4594
|
+
|
|
4595
|
+
if (browserDetector.isIE()) {
|
|
4596
|
+
object.data = "about:blank";
|
|
4597
|
+
}
|
|
4598
|
+
}
|
|
4599
|
+
|
|
4600
|
+
if (batchProcessor) {
|
|
4601
|
+
batchProcessor.add(mutateDom);
|
|
4602
|
+
} else {
|
|
4603
|
+
mutateDom();
|
|
4604
|
+
}
|
|
4605
|
+
}
|
|
4606
|
+
|
|
4607
|
+
if (browserDetector.isIE(8)) {
|
|
4608
|
+
//IE 8 does not support objects properly. Luckily they do support the resize event.
|
|
4609
|
+
//So do not inject the object and notify that the element is already ready to be listened to.
|
|
4610
|
+
//The event handler for the resize event is attached in the utils.addListener instead.
|
|
4611
|
+
callback(element);
|
|
4612
|
+
} else {
|
|
4613
|
+
injectObject(element, callback);
|
|
4614
|
+
}
|
|
4615
|
+
}
|
|
4616
|
+
/**
|
|
4617
|
+
* Returns the child object of the target element.
|
|
4618
|
+
* @private
|
|
4619
|
+
* @param {element} element The target element.
|
|
4620
|
+
* @returns The object element of the target.
|
|
4621
|
+
*/
|
|
4622
|
+
|
|
4623
|
+
|
|
4624
|
+
function getObject(element) {
|
|
4625
|
+
return getState(element).object;
|
|
4626
|
+
}
|
|
4627
|
+
|
|
4628
|
+
function uninstall(element) {
|
|
4629
|
+
if (!getState(element)) {
|
|
4630
|
+
return;
|
|
4631
|
+
}
|
|
4632
|
+
|
|
4633
|
+
var object = getObject(element);
|
|
4634
|
+
|
|
4635
|
+
if (!object) {
|
|
4636
|
+
return;
|
|
4637
|
+
}
|
|
4638
|
+
|
|
4639
|
+
if (browserDetector.isIE(8)) {
|
|
4640
|
+
element.detachEvent("onresize", object.proxy);
|
|
4641
|
+
} else {
|
|
4642
|
+
element.removeChild(object);
|
|
4643
|
+
}
|
|
4644
|
+
|
|
4645
|
+
if (getState(element).checkForObjectDocumentTimeoutId) {
|
|
4646
|
+
window.clearTimeout(getState(element).checkForObjectDocumentTimeoutId);
|
|
4647
|
+
}
|
|
4648
|
+
|
|
4649
|
+
delete getState(element).object;
|
|
4650
|
+
}
|
|
4651
|
+
|
|
4652
|
+
return {
|
|
4653
|
+
makeDetectable: makeDetectable,
|
|
4654
|
+
addListener: addListener,
|
|
4655
|
+
uninstall: uninstall
|
|
4656
|
+
};
|
|
4657
|
+
};
|
|
4658
|
+
|
|
4659
|
+
/***/ }),
|
|
4660
|
+
|
|
4661
|
+
/***/ 8197:
|
|
4662
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
4663
|
+
|
|
4664
|
+
"use strict";
|
|
4665
|
+
/**
|
|
4666
|
+
* Resize detection strategy that injects divs to elements in order to detect resize events on scroll events.
|
|
4667
|
+
* Heavily inspired by: https://github.com/marcj/css-element-queries/blob/master/src/ResizeSensor.js
|
|
4668
|
+
*/
|
|
4669
|
+
|
|
4670
|
+
|
|
4671
|
+
__webpack_require__(1703);
|
|
4672
|
+
|
|
4673
|
+
var forEach = (__webpack_require__(8485).forEach);
|
|
4674
|
+
|
|
4675
|
+
module.exports = function (options) {
|
|
4676
|
+
options = options || {};
|
|
4677
|
+
var reporter = options.reporter;
|
|
4678
|
+
var batchProcessor = options.batchProcessor;
|
|
4679
|
+
var getState = options.stateHandler.getState;
|
|
4680
|
+
var hasState = options.stateHandler.hasState;
|
|
4681
|
+
var idHandler = options.idHandler;
|
|
4682
|
+
|
|
4683
|
+
if (!batchProcessor) {
|
|
4684
|
+
throw new Error("Missing required dependency: batchProcessor");
|
|
4685
|
+
}
|
|
4686
|
+
|
|
4687
|
+
if (!reporter) {
|
|
4688
|
+
throw new Error("Missing required dependency: reporter.");
|
|
4689
|
+
} //TODO: Could this perhaps be done at installation time?
|
|
4690
|
+
|
|
4691
|
+
|
|
4692
|
+
var scrollbarSizes = getScrollbarSizes();
|
|
4693
|
+
var styleId = "erd_scroll_detection_scrollbar_style";
|
|
4694
|
+
var detectionContainerClass = "erd_scroll_detection_container";
|
|
4695
|
+
|
|
4696
|
+
function initDocument(targetDocument) {
|
|
4697
|
+
// Inject the scrollbar styling that prevents them from appearing sometimes in Chrome.
|
|
4698
|
+
// The injected container needs to have a class, so that it may be styled with CSS (pseudo elements).
|
|
4699
|
+
injectScrollStyle(targetDocument, styleId, detectionContainerClass);
|
|
4700
|
+
}
|
|
4701
|
+
|
|
4702
|
+
initDocument(window.document);
|
|
4703
|
+
|
|
4704
|
+
function buildCssTextString(rules) {
|
|
4705
|
+
var seperator = options.important ? " !important; " : "; ";
|
|
4706
|
+
return (rules.join(seperator) + seperator).trim();
|
|
4707
|
+
}
|
|
4708
|
+
|
|
4709
|
+
function getScrollbarSizes() {
|
|
4710
|
+
var width = 500;
|
|
4711
|
+
var height = 500;
|
|
4712
|
+
var child = document.createElement("div");
|
|
4713
|
+
child.style.cssText = buildCssTextString(["position: absolute", "width: " + width * 2 + "px", "height: " + height * 2 + "px", "visibility: hidden", "margin: 0", "padding: 0"]);
|
|
4714
|
+
var container = document.createElement("div");
|
|
4715
|
+
container.style.cssText = buildCssTextString(["position: absolute", "width: " + width + "px", "height: " + height + "px", "overflow: scroll", "visibility: none", "top: " + -width * 3 + "px", "left: " + -height * 3 + "px", "visibility: hidden", "margin: 0", "padding: 0"]);
|
|
4716
|
+
container.appendChild(child);
|
|
4717
|
+
document.body.insertBefore(container, document.body.firstChild);
|
|
4718
|
+
var widthSize = width - container.clientWidth;
|
|
4719
|
+
var heightSize = height - container.clientHeight;
|
|
4720
|
+
document.body.removeChild(container);
|
|
4721
|
+
return {
|
|
4722
|
+
width: widthSize,
|
|
4723
|
+
height: heightSize
|
|
4724
|
+
};
|
|
4725
|
+
}
|
|
4726
|
+
|
|
4727
|
+
function injectScrollStyle(targetDocument, styleId, containerClass) {
|
|
4728
|
+
function injectStyle(style, method) {
|
|
4729
|
+
method = method || function (element) {
|
|
4730
|
+
targetDocument.head.appendChild(element);
|
|
4731
|
+
};
|
|
4732
|
+
|
|
4733
|
+
var styleElement = targetDocument.createElement("style");
|
|
4734
|
+
styleElement.innerHTML = style;
|
|
4735
|
+
styleElement.id = styleId;
|
|
4736
|
+
method(styleElement);
|
|
4737
|
+
return styleElement;
|
|
4738
|
+
}
|
|
4739
|
+
|
|
4740
|
+
if (!targetDocument.getElementById(styleId)) {
|
|
4741
|
+
var containerAnimationClass = containerClass + "_animation";
|
|
4742
|
+
var containerAnimationActiveClass = containerClass + "_animation_active";
|
|
4743
|
+
var style = "/* Created by the element-resize-detector library. */\n";
|
|
4744
|
+
style += "." + containerClass + " > div::-webkit-scrollbar { " + buildCssTextString(["display: none"]) + " }\n\n";
|
|
4745
|
+
style += "." + containerAnimationActiveClass + " { " + buildCssTextString(["-webkit-animation-duration: 0.1s", "animation-duration: 0.1s", "-webkit-animation-name: " + containerAnimationClass, "animation-name: " + containerAnimationClass]) + " }\n";
|
|
4746
|
+
style += "@-webkit-keyframes " + containerAnimationClass + " { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n";
|
|
4747
|
+
style += "@keyframes " + containerAnimationClass + " { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }";
|
|
4748
|
+
injectStyle(style);
|
|
4749
|
+
}
|
|
4750
|
+
}
|
|
4751
|
+
|
|
4752
|
+
function addAnimationClass(element) {
|
|
4753
|
+
element.className += " " + detectionContainerClass + "_animation_active";
|
|
4754
|
+
}
|
|
4755
|
+
|
|
4756
|
+
function addEvent(el, name, cb) {
|
|
4757
|
+
if (el.addEventListener) {
|
|
4758
|
+
el.addEventListener(name, cb);
|
|
4759
|
+
} else if (el.attachEvent) {
|
|
4760
|
+
el.attachEvent("on" + name, cb);
|
|
4761
|
+
} else {
|
|
4762
|
+
return reporter.error("[scroll] Don't know how to add event listeners.");
|
|
4763
|
+
}
|
|
4764
|
+
}
|
|
4765
|
+
|
|
4766
|
+
function removeEvent(el, name, cb) {
|
|
4767
|
+
if (el.removeEventListener) {
|
|
4768
|
+
el.removeEventListener(name, cb);
|
|
4769
|
+
} else if (el.detachEvent) {
|
|
4770
|
+
el.detachEvent("on" + name, cb);
|
|
4771
|
+
} else {
|
|
4772
|
+
return reporter.error("[scroll] Don't know how to remove event listeners.");
|
|
4773
|
+
}
|
|
4774
|
+
}
|
|
4775
|
+
|
|
4776
|
+
function getExpandElement(element) {
|
|
4777
|
+
return getState(element).container.childNodes[0].childNodes[0].childNodes[0];
|
|
4778
|
+
}
|
|
4779
|
+
|
|
4780
|
+
function getShrinkElement(element) {
|
|
4781
|
+
return getState(element).container.childNodes[0].childNodes[0].childNodes[1];
|
|
4782
|
+
}
|
|
4783
|
+
/**
|
|
4784
|
+
* Adds a resize event listener to the element.
|
|
4785
|
+
* @public
|
|
4786
|
+
* @param {element} element The element that should have the listener added.
|
|
4787
|
+
* @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.
|
|
4788
|
+
*/
|
|
4789
|
+
|
|
4790
|
+
|
|
4791
|
+
function addListener(element, listener) {
|
|
4792
|
+
var listeners = getState(element).listeners;
|
|
4793
|
+
|
|
4794
|
+
if (!listeners.push) {
|
|
4795
|
+
throw new Error("Cannot add listener to an element that is not detectable.");
|
|
4796
|
+
}
|
|
4797
|
+
|
|
4798
|
+
getState(element).listeners.push(listener);
|
|
4799
|
+
}
|
|
4800
|
+
/**
|
|
4801
|
+
* Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.
|
|
4802
|
+
* @private
|
|
4803
|
+
* @param {object} options Optional options object.
|
|
4804
|
+
* @param {element} element The element to make detectable
|
|
4805
|
+
* @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.
|
|
4806
|
+
*/
|
|
4807
|
+
|
|
4808
|
+
|
|
4809
|
+
function makeDetectable(options, element, callback) {
|
|
4810
|
+
if (!callback) {
|
|
4811
|
+
callback = element;
|
|
4812
|
+
element = options;
|
|
4813
|
+
options = null;
|
|
4814
|
+
}
|
|
4815
|
+
|
|
4816
|
+
options = options || {};
|
|
4817
|
+
|
|
4818
|
+
function debug() {
|
|
4819
|
+
if (options.debug) {
|
|
4820
|
+
var args = Array.prototype.slice.call(arguments);
|
|
4821
|
+
args.unshift(idHandler.get(element), "Scroll: ");
|
|
4822
|
+
|
|
4823
|
+
if (reporter.log.apply) {
|
|
4824
|
+
reporter.log.apply(null, args);
|
|
4825
|
+
} else {
|
|
4826
|
+
for (var i = 0; i < args.length; i++) {
|
|
4827
|
+
reporter.log(args[i]);
|
|
4828
|
+
}
|
|
4829
|
+
}
|
|
4830
|
+
}
|
|
4831
|
+
}
|
|
4832
|
+
|
|
4833
|
+
function isDetached(element) {
|
|
4834
|
+
function isInDocument(element) {
|
|
4835
|
+
var isInShadowRoot = element.getRootNode && element.getRootNode().contains(element);
|
|
4836
|
+
return element === element.ownerDocument.body || element.ownerDocument.body.contains(element) || isInShadowRoot;
|
|
4837
|
+
}
|
|
4838
|
+
|
|
4839
|
+
if (!isInDocument(element)) {
|
|
4840
|
+
return true;
|
|
4841
|
+
} // FireFox returns null style in hidden iframes. See https://github.com/wnr/element-resize-detector/issues/68 and https://bugzilla.mozilla.org/show_bug.cgi?id=795520
|
|
4842
|
+
|
|
4843
|
+
|
|
4844
|
+
if (window.getComputedStyle(element) === null) {
|
|
4845
|
+
return true;
|
|
4846
|
+
}
|
|
4847
|
+
|
|
4848
|
+
return false;
|
|
4849
|
+
}
|
|
4850
|
+
|
|
4851
|
+
function isUnrendered(element) {
|
|
4852
|
+
// Check the absolute positioned container since the top level container is display: inline.
|
|
4853
|
+
var container = getState(element).container.childNodes[0];
|
|
4854
|
+
var style = window.getComputedStyle(container);
|
|
4855
|
+
return !style.width || style.width.indexOf("px") === -1; //Can only compute pixel value when rendered.
|
|
4856
|
+
}
|
|
4857
|
+
|
|
4858
|
+
function getStyle() {
|
|
4859
|
+
// Some browsers only force layouts when actually reading the style properties of the style object, so make sure that they are all read here,
|
|
4860
|
+
// so that the user of the function can be sure that it will perform the layout here, instead of later (important for batching).
|
|
4861
|
+
var elementStyle = window.getComputedStyle(element);
|
|
4862
|
+
var style = {};
|
|
4863
|
+
style.position = elementStyle.position;
|
|
4864
|
+
style.width = element.offsetWidth;
|
|
4865
|
+
style.height = element.offsetHeight;
|
|
4866
|
+
style.top = elementStyle.top;
|
|
4867
|
+
style.right = elementStyle.right;
|
|
4868
|
+
style.bottom = elementStyle.bottom;
|
|
4869
|
+
style.left = elementStyle.left;
|
|
4870
|
+
style.widthCSS = elementStyle.width;
|
|
4871
|
+
style.heightCSS = elementStyle.height;
|
|
4872
|
+
return style;
|
|
4873
|
+
}
|
|
4874
|
+
|
|
4875
|
+
function storeStartSize() {
|
|
4876
|
+
var style = getStyle();
|
|
4877
|
+
getState(element).startSize = {
|
|
4878
|
+
width: style.width,
|
|
4879
|
+
height: style.height
|
|
4880
|
+
};
|
|
4881
|
+
debug("Element start size", getState(element).startSize);
|
|
4882
|
+
}
|
|
4883
|
+
|
|
4884
|
+
function initListeners() {
|
|
4885
|
+
getState(element).listeners = [];
|
|
4886
|
+
}
|
|
4887
|
+
|
|
4888
|
+
function storeStyle() {
|
|
4889
|
+
debug("storeStyle invoked.");
|
|
4890
|
+
|
|
4891
|
+
if (!getState(element)) {
|
|
4892
|
+
debug("Aborting because element has been uninstalled");
|
|
4893
|
+
return;
|
|
4894
|
+
}
|
|
4895
|
+
|
|
4896
|
+
var style = getStyle();
|
|
4897
|
+
getState(element).style = style;
|
|
4898
|
+
}
|
|
4899
|
+
|
|
4900
|
+
function storeCurrentSize(element, width, height) {
|
|
4901
|
+
getState(element).lastWidth = width;
|
|
4902
|
+
getState(element).lastHeight = height;
|
|
4903
|
+
}
|
|
4904
|
+
|
|
4905
|
+
function getExpandChildElement(element) {
|
|
4906
|
+
return getExpandElement(element).childNodes[0];
|
|
4907
|
+
}
|
|
4908
|
+
|
|
4909
|
+
function getWidthOffset() {
|
|
4910
|
+
return 2 * scrollbarSizes.width + 1;
|
|
4911
|
+
}
|
|
4912
|
+
|
|
4913
|
+
function getHeightOffset() {
|
|
4914
|
+
return 2 * scrollbarSizes.height + 1;
|
|
4915
|
+
}
|
|
4916
|
+
|
|
4917
|
+
function getExpandWidth(width) {
|
|
4918
|
+
return width + 10 + getWidthOffset();
|
|
4919
|
+
}
|
|
4920
|
+
|
|
4921
|
+
function getExpandHeight(height) {
|
|
4922
|
+
return height + 10 + getHeightOffset();
|
|
4923
|
+
}
|
|
4924
|
+
|
|
4925
|
+
function getShrinkWidth(width) {
|
|
4926
|
+
return width * 2 + getWidthOffset();
|
|
4927
|
+
}
|
|
4928
|
+
|
|
4929
|
+
function getShrinkHeight(height) {
|
|
4930
|
+
return height * 2 + getHeightOffset();
|
|
4931
|
+
}
|
|
4932
|
+
|
|
4933
|
+
function positionScrollbars(element, width, height) {
|
|
4934
|
+
var expand = getExpandElement(element);
|
|
4935
|
+
var shrink = getShrinkElement(element);
|
|
4936
|
+
var expandWidth = getExpandWidth(width);
|
|
4937
|
+
var expandHeight = getExpandHeight(height);
|
|
4938
|
+
var shrinkWidth = getShrinkWidth(width);
|
|
4939
|
+
var shrinkHeight = getShrinkHeight(height);
|
|
4940
|
+
expand.scrollLeft = expandWidth;
|
|
4941
|
+
expand.scrollTop = expandHeight;
|
|
4942
|
+
shrink.scrollLeft = shrinkWidth;
|
|
4943
|
+
shrink.scrollTop = shrinkHeight;
|
|
4944
|
+
}
|
|
4945
|
+
|
|
4946
|
+
function injectContainerElement() {
|
|
4947
|
+
var container = getState(element).container;
|
|
4948
|
+
|
|
4949
|
+
if (!container) {
|
|
4950
|
+
container = document.createElement("div");
|
|
4951
|
+
container.className = detectionContainerClass;
|
|
4952
|
+
container.style.cssText = buildCssTextString(["visibility: hidden", "display: inline", "width: 0px", "height: 0px", "z-index: -1", "overflow: hidden", "margin: 0", "padding: 0"]);
|
|
4953
|
+
getState(element).container = container;
|
|
4954
|
+
addAnimationClass(container);
|
|
4955
|
+
element.appendChild(container);
|
|
4956
|
+
|
|
4957
|
+
var onAnimationStart = function () {
|
|
4958
|
+
getState(element).onRendered && getState(element).onRendered();
|
|
4959
|
+
};
|
|
4960
|
+
|
|
4961
|
+
addEvent(container, "animationstart", onAnimationStart); // Store the event handler here so that they may be removed when uninstall is called.
|
|
4962
|
+
// See uninstall function for an explanation why it is needed.
|
|
4963
|
+
|
|
4964
|
+
getState(element).onAnimationStart = onAnimationStart;
|
|
4965
|
+
}
|
|
4966
|
+
|
|
4967
|
+
return container;
|
|
4968
|
+
}
|
|
4969
|
+
|
|
4970
|
+
function injectScrollElements() {
|
|
4971
|
+
function alterPositionStyles() {
|
|
4972
|
+
var style = getState(element).style;
|
|
4973
|
+
|
|
4974
|
+
if (style.position === "static") {
|
|
4975
|
+
element.style.setProperty("position", "relative", options.important ? "important" : "");
|
|
4976
|
+
|
|
4977
|
+
var removeRelativeStyles = function (reporter, element, style, property) {
|
|
4978
|
+
function getNumericalValue(value) {
|
|
4979
|
+
return value.replace(/[^-\d\.]/g, "");
|
|
4980
|
+
}
|
|
4981
|
+
|
|
4982
|
+
var value = style[property];
|
|
4983
|
+
|
|
4984
|
+
if (value !== "auto" && getNumericalValue(value) !== "0") {
|
|
4985
|
+
reporter.warn("An element that is positioned static has style." + property + "=" + value + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + property + " will be set to 0. Element: ", element);
|
|
4986
|
+
element.style[property] = 0;
|
|
4987
|
+
}
|
|
4988
|
+
}; //Check so that there are no accidental styles that will make the element styled differently now that is is relative.
|
|
4989
|
+
//If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).
|
|
4990
|
+
|
|
4991
|
+
|
|
4992
|
+
removeRelativeStyles(reporter, element, style, "top");
|
|
4993
|
+
removeRelativeStyles(reporter, element, style, "right");
|
|
4994
|
+
removeRelativeStyles(reporter, element, style, "bottom");
|
|
4995
|
+
removeRelativeStyles(reporter, element, style, "left");
|
|
4996
|
+
}
|
|
4997
|
+
}
|
|
4998
|
+
|
|
4999
|
+
function getLeftTopBottomRightCssText(left, top, bottom, right) {
|
|
5000
|
+
left = !left ? "0" : left + "px";
|
|
5001
|
+
top = !top ? "0" : top + "px";
|
|
5002
|
+
bottom = !bottom ? "0" : bottom + "px";
|
|
5003
|
+
right = !right ? "0" : right + "px";
|
|
5004
|
+
return ["left: " + left, "top: " + top, "right: " + right, "bottom: " + bottom];
|
|
5005
|
+
}
|
|
5006
|
+
|
|
5007
|
+
debug("Injecting elements");
|
|
5008
|
+
|
|
5009
|
+
if (!getState(element)) {
|
|
5010
|
+
debug("Aborting because element has been uninstalled");
|
|
5011
|
+
return;
|
|
5012
|
+
}
|
|
5013
|
+
|
|
5014
|
+
alterPositionStyles();
|
|
5015
|
+
var rootContainer = getState(element).container;
|
|
5016
|
+
|
|
5017
|
+
if (!rootContainer) {
|
|
5018
|
+
rootContainer = injectContainerElement();
|
|
5019
|
+
} // Due to this WebKit bug https://bugs.webkit.org/show_bug.cgi?id=80808 (currently fixed in Blink, but still present in WebKit browsers such as Safari),
|
|
5020
|
+
// we need to inject two containers, one that is width/height 100% and another that is left/top -1px so that the final container always is 1x1 pixels bigger than
|
|
5021
|
+
// the targeted element.
|
|
5022
|
+
// When the bug is resolved, "containerContainer" may be removed.
|
|
5023
|
+
// The outer container can occasionally be less wide than the targeted when inside inline elements element in WebKit (see https://bugs.webkit.org/show_bug.cgi?id=152980).
|
|
5024
|
+
// This should be no problem since the inner container either way makes sure the injected scroll elements are at least 1x1 px.
|
|
5025
|
+
|
|
5026
|
+
|
|
5027
|
+
var scrollbarWidth = scrollbarSizes.width;
|
|
5028
|
+
var scrollbarHeight = scrollbarSizes.height;
|
|
5029
|
+
var containerContainerStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: hidden", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%", "left: 0px", "top: 0px"]);
|
|
5030
|
+
var containerStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: hidden", "z-index: -1", "visibility: hidden"].concat(getLeftTopBottomRightCssText(-(1 + scrollbarWidth), -(1 + scrollbarHeight), -scrollbarHeight, -scrollbarWidth)));
|
|
5031
|
+
var expandStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: scroll", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%"]);
|
|
5032
|
+
var shrinkStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: scroll", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%"]);
|
|
5033
|
+
var expandChildStyle = buildCssTextString(["position: absolute", "left: 0", "top: 0"]);
|
|
5034
|
+
var shrinkChildStyle = buildCssTextString(["position: absolute", "width: 200%", "height: 200%"]);
|
|
5035
|
+
var containerContainer = document.createElement("div");
|
|
5036
|
+
var container = document.createElement("div");
|
|
5037
|
+
var expand = document.createElement("div");
|
|
5038
|
+
var expandChild = document.createElement("div");
|
|
5039
|
+
var shrink = document.createElement("div");
|
|
5040
|
+
var shrinkChild = document.createElement("div"); // Some browsers choke on the resize system being rtl, so force it to ltr. https://github.com/wnr/element-resize-detector/issues/56
|
|
5041
|
+
// However, dir should not be set on the top level container as it alters the dimensions of the target element in some browsers.
|
|
5042
|
+
|
|
5043
|
+
containerContainer.dir = "ltr";
|
|
5044
|
+
containerContainer.style.cssText = containerContainerStyle;
|
|
5045
|
+
containerContainer.className = detectionContainerClass;
|
|
5046
|
+
container.className = detectionContainerClass;
|
|
5047
|
+
container.style.cssText = containerStyle;
|
|
5048
|
+
expand.style.cssText = expandStyle;
|
|
5049
|
+
expandChild.style.cssText = expandChildStyle;
|
|
5050
|
+
shrink.style.cssText = shrinkStyle;
|
|
5051
|
+
shrinkChild.style.cssText = shrinkChildStyle;
|
|
5052
|
+
expand.appendChild(expandChild);
|
|
5053
|
+
shrink.appendChild(shrinkChild);
|
|
5054
|
+
container.appendChild(expand);
|
|
5055
|
+
container.appendChild(shrink);
|
|
5056
|
+
containerContainer.appendChild(container);
|
|
5057
|
+
rootContainer.appendChild(containerContainer);
|
|
5058
|
+
|
|
5059
|
+
function onExpandScroll() {
|
|
5060
|
+
var state = getState(element);
|
|
5061
|
+
|
|
5062
|
+
if (state && state.onExpand) {
|
|
5063
|
+
state.onExpand();
|
|
5064
|
+
} else {
|
|
5065
|
+
debug("Aborting expand scroll handler: element has been uninstalled");
|
|
5066
|
+
}
|
|
5067
|
+
}
|
|
5068
|
+
|
|
5069
|
+
function onShrinkScroll() {
|
|
5070
|
+
var state = getState(element);
|
|
5071
|
+
|
|
5072
|
+
if (state && state.onShrink) {
|
|
5073
|
+
state.onShrink();
|
|
5074
|
+
} else {
|
|
5075
|
+
debug("Aborting shrink scroll handler: element has been uninstalled");
|
|
5076
|
+
}
|
|
5077
|
+
}
|
|
5078
|
+
|
|
5079
|
+
addEvent(expand, "scroll", onExpandScroll);
|
|
5080
|
+
addEvent(shrink, "scroll", onShrinkScroll); // Store the event handlers here so that they may be removed when uninstall is called.
|
|
5081
|
+
// See uninstall function for an explanation why it is needed.
|
|
5082
|
+
|
|
5083
|
+
getState(element).onExpandScroll = onExpandScroll;
|
|
5084
|
+
getState(element).onShrinkScroll = onShrinkScroll;
|
|
5085
|
+
}
|
|
5086
|
+
|
|
5087
|
+
function registerListenersAndPositionElements() {
|
|
5088
|
+
function updateChildSizes(element, width, height) {
|
|
5089
|
+
var expandChild = getExpandChildElement(element);
|
|
5090
|
+
var expandWidth = getExpandWidth(width);
|
|
5091
|
+
var expandHeight = getExpandHeight(height);
|
|
5092
|
+
expandChild.style.setProperty("width", expandWidth + "px", options.important ? "important" : "");
|
|
5093
|
+
expandChild.style.setProperty("height", expandHeight + "px", options.important ? "important" : "");
|
|
5094
|
+
}
|
|
5095
|
+
|
|
5096
|
+
function updateDetectorElements(done) {
|
|
5097
|
+
var width = element.offsetWidth;
|
|
5098
|
+
var height = element.offsetHeight; // Check whether the size has actually changed since last time the algorithm ran. If not, some steps may be skipped.
|
|
5099
|
+
|
|
5100
|
+
var sizeChanged = width !== getState(element).lastWidth || height !== getState(element).lastHeight;
|
|
5101
|
+
debug("Storing current size", width, height); // Store the size of the element sync here, so that multiple scroll events may be ignored in the event listeners.
|
|
5102
|
+
// Otherwise the if-check in handleScroll is useless.
|
|
5103
|
+
|
|
5104
|
+
storeCurrentSize(element, width, height); // Since we delay the processing of the batch, there is a risk that uninstall has been called before the batch gets to execute.
|
|
5105
|
+
// Since there is no way to cancel the fn executions, we need to add an uninstall guard to all fns of the batch.
|
|
5106
|
+
|
|
5107
|
+
batchProcessor.add(0, function performUpdateChildSizes() {
|
|
5108
|
+
if (!sizeChanged) {
|
|
5109
|
+
return;
|
|
5110
|
+
}
|
|
5111
|
+
|
|
5112
|
+
if (!getState(element)) {
|
|
5113
|
+
debug("Aborting because element has been uninstalled");
|
|
5114
|
+
return;
|
|
5115
|
+
}
|
|
5116
|
+
|
|
5117
|
+
if (!areElementsInjected()) {
|
|
5118
|
+
debug("Aborting because element container has not been initialized");
|
|
5119
|
+
return;
|
|
5120
|
+
}
|
|
5121
|
+
|
|
5122
|
+
if (options.debug) {
|
|
5123
|
+
var w = element.offsetWidth;
|
|
5124
|
+
var h = element.offsetHeight;
|
|
5125
|
+
|
|
5126
|
+
if (w !== width || h !== height) {
|
|
5127
|
+
reporter.warn(idHandler.get(element), "Scroll: Size changed before updating detector elements.");
|
|
5128
|
+
}
|
|
5129
|
+
}
|
|
5130
|
+
|
|
5131
|
+
updateChildSizes(element, width, height);
|
|
5132
|
+
});
|
|
5133
|
+
batchProcessor.add(1, function updateScrollbars() {
|
|
5134
|
+
// This function needs to be invoked event though the size is unchanged. The element could have been resized very quickly and then
|
|
5135
|
+
// been restored to the original size, which will have changed the scrollbar positions.
|
|
5136
|
+
if (!getState(element)) {
|
|
5137
|
+
debug("Aborting because element has been uninstalled");
|
|
5138
|
+
return;
|
|
5139
|
+
}
|
|
5140
|
+
|
|
5141
|
+
if (!areElementsInjected()) {
|
|
5142
|
+
debug("Aborting because element container has not been initialized");
|
|
5143
|
+
return;
|
|
5144
|
+
}
|
|
5145
|
+
|
|
5146
|
+
positionScrollbars(element, width, height);
|
|
5147
|
+
});
|
|
5148
|
+
|
|
5149
|
+
if (sizeChanged && done) {
|
|
5150
|
+
batchProcessor.add(2, function () {
|
|
5151
|
+
if (!getState(element)) {
|
|
5152
|
+
debug("Aborting because element has been uninstalled");
|
|
5153
|
+
return;
|
|
5154
|
+
}
|
|
5155
|
+
|
|
5156
|
+
if (!areElementsInjected()) {
|
|
5157
|
+
debug("Aborting because element container has not been initialized");
|
|
5158
|
+
return;
|
|
5159
|
+
}
|
|
5160
|
+
|
|
5161
|
+
done();
|
|
5162
|
+
});
|
|
5163
|
+
}
|
|
5164
|
+
}
|
|
5165
|
+
|
|
5166
|
+
function areElementsInjected() {
|
|
5167
|
+
return !!getState(element).container;
|
|
5168
|
+
}
|
|
5169
|
+
|
|
5170
|
+
function notifyListenersIfNeeded() {
|
|
5171
|
+
function isFirstNotify() {
|
|
5172
|
+
return getState(element).lastNotifiedWidth === undefined;
|
|
5173
|
+
}
|
|
5174
|
+
|
|
5175
|
+
debug("notifyListenersIfNeeded invoked");
|
|
5176
|
+
var state = getState(element); // Don't notify if the current size is the start size, and this is the first notification.
|
|
5177
|
+
|
|
5178
|
+
if (isFirstNotify() && state.lastWidth === state.startSize.width && state.lastHeight === state.startSize.height) {
|
|
5179
|
+
return debug("Not notifying: Size is the same as the start size, and there has been no notification yet.");
|
|
5180
|
+
} // Don't notify if the size already has been notified.
|
|
5181
|
+
|
|
5182
|
+
|
|
5183
|
+
if (state.lastWidth === state.lastNotifiedWidth && state.lastHeight === state.lastNotifiedHeight) {
|
|
5184
|
+
return debug("Not notifying: Size already notified");
|
|
5185
|
+
}
|
|
5186
|
+
|
|
5187
|
+
debug("Current size not notified, notifying...");
|
|
5188
|
+
state.lastNotifiedWidth = state.lastWidth;
|
|
5189
|
+
state.lastNotifiedHeight = state.lastHeight;
|
|
5190
|
+
forEach(getState(element).listeners, function (listener) {
|
|
5191
|
+
listener(element);
|
|
5192
|
+
});
|
|
5193
|
+
}
|
|
5194
|
+
|
|
5195
|
+
function handleRender() {
|
|
5196
|
+
debug("startanimation triggered.");
|
|
5197
|
+
|
|
5198
|
+
if (isUnrendered(element)) {
|
|
5199
|
+
debug("Ignoring since element is still unrendered...");
|
|
5200
|
+
return;
|
|
5201
|
+
}
|
|
5202
|
+
|
|
5203
|
+
debug("Element rendered.");
|
|
5204
|
+
var expand = getExpandElement(element);
|
|
5205
|
+
var shrink = getShrinkElement(element);
|
|
5206
|
+
|
|
5207
|
+
if (expand.scrollLeft === 0 || expand.scrollTop === 0 || shrink.scrollLeft === 0 || shrink.scrollTop === 0) {
|
|
5208
|
+
debug("Scrollbars out of sync. Updating detector elements...");
|
|
5209
|
+
updateDetectorElements(notifyListenersIfNeeded);
|
|
5210
|
+
}
|
|
5211
|
+
}
|
|
5212
|
+
|
|
5213
|
+
function handleScroll() {
|
|
5214
|
+
debug("Scroll detected.");
|
|
5215
|
+
|
|
5216
|
+
if (isUnrendered(element)) {
|
|
5217
|
+
// Element is still unrendered. Skip this scroll event.
|
|
5218
|
+
debug("Scroll event fired while unrendered. Ignoring...");
|
|
5219
|
+
return;
|
|
5220
|
+
}
|
|
5221
|
+
|
|
5222
|
+
updateDetectorElements(notifyListenersIfNeeded);
|
|
5223
|
+
}
|
|
5224
|
+
|
|
5225
|
+
debug("registerListenersAndPositionElements invoked.");
|
|
5226
|
+
|
|
5227
|
+
if (!getState(element)) {
|
|
5228
|
+
debug("Aborting because element has been uninstalled");
|
|
5229
|
+
return;
|
|
5230
|
+
}
|
|
5231
|
+
|
|
5232
|
+
getState(element).onRendered = handleRender;
|
|
5233
|
+
getState(element).onExpand = handleScroll;
|
|
5234
|
+
getState(element).onShrink = handleScroll;
|
|
5235
|
+
var style = getState(element).style;
|
|
5236
|
+
updateChildSizes(element, style.width, style.height);
|
|
5237
|
+
}
|
|
5238
|
+
|
|
5239
|
+
function finalizeDomMutation() {
|
|
5240
|
+
debug("finalizeDomMutation invoked.");
|
|
5241
|
+
|
|
5242
|
+
if (!getState(element)) {
|
|
5243
|
+
debug("Aborting because element has been uninstalled");
|
|
5244
|
+
return;
|
|
5245
|
+
}
|
|
5246
|
+
|
|
5247
|
+
var style = getState(element).style;
|
|
5248
|
+
storeCurrentSize(element, style.width, style.height);
|
|
5249
|
+
positionScrollbars(element, style.width, style.height);
|
|
5250
|
+
}
|
|
5251
|
+
|
|
5252
|
+
function ready() {
|
|
5253
|
+
callback(element);
|
|
5254
|
+
}
|
|
5255
|
+
|
|
5256
|
+
function install() {
|
|
5257
|
+
debug("Installing...");
|
|
5258
|
+
initListeners();
|
|
5259
|
+
storeStartSize();
|
|
5260
|
+
batchProcessor.add(0, storeStyle);
|
|
5261
|
+
batchProcessor.add(1, injectScrollElements);
|
|
5262
|
+
batchProcessor.add(2, registerListenersAndPositionElements);
|
|
5263
|
+
batchProcessor.add(3, finalizeDomMutation);
|
|
5264
|
+
batchProcessor.add(4, ready);
|
|
5265
|
+
}
|
|
5266
|
+
|
|
5267
|
+
debug("Making detectable...");
|
|
5268
|
+
|
|
5269
|
+
if (isDetached(element)) {
|
|
5270
|
+
debug("Element is detached");
|
|
5271
|
+
injectContainerElement();
|
|
5272
|
+
debug("Waiting until element is attached...");
|
|
5273
|
+
|
|
5274
|
+
getState(element).onRendered = function () {
|
|
5275
|
+
debug("Element is now attached");
|
|
5276
|
+
install();
|
|
5277
|
+
};
|
|
5278
|
+
} else {
|
|
5279
|
+
install();
|
|
5280
|
+
}
|
|
5281
|
+
}
|
|
5282
|
+
|
|
5283
|
+
function uninstall(element) {
|
|
5284
|
+
var state = getState(element);
|
|
5285
|
+
|
|
5286
|
+
if (!state) {
|
|
5287
|
+
// Uninstall has been called on a non-erd element.
|
|
5288
|
+
return;
|
|
5289
|
+
} // Uninstall may have been called in the following scenarios:
|
|
5290
|
+
// (1) Right between the sync code and async batch (here state.busy = true, but nothing have been registered or injected).
|
|
5291
|
+
// (2) In the ready callback of the last level of the batch by another element (here, state.busy = true, but all the stuff has been injected).
|
|
5292
|
+
// (3) After the installation process (here, state.busy = false and all the stuff has been injected).
|
|
5293
|
+
// So to be on the safe side, let's check for each thing before removing.
|
|
5294
|
+
// We need to remove the event listeners, because otherwise the event might fire on an uninstall element which results in an error when trying to get the state of the element.
|
|
5295
|
+
|
|
5296
|
+
|
|
5297
|
+
state.onExpandScroll && removeEvent(getExpandElement(element), "scroll", state.onExpandScroll);
|
|
5298
|
+
state.onShrinkScroll && removeEvent(getShrinkElement(element), "scroll", state.onShrinkScroll);
|
|
5299
|
+
state.onAnimationStart && removeEvent(state.container, "animationstart", state.onAnimationStart);
|
|
5300
|
+
state.container && element.removeChild(state.container);
|
|
5301
|
+
}
|
|
5302
|
+
|
|
5303
|
+
return {
|
|
5304
|
+
makeDetectable: makeDetectable,
|
|
5305
|
+
addListener: addListener,
|
|
5306
|
+
uninstall: uninstall,
|
|
5307
|
+
initDocument: initDocument
|
|
5308
|
+
};
|
|
5309
|
+
};
|
|
5310
|
+
|
|
5311
|
+
/***/ }),
|
|
5312
|
+
|
|
5313
|
+
/***/ 6084:
|
|
5314
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
5315
|
+
|
|
5316
|
+
"use strict";
|
|
5317
|
+
|
|
5318
|
+
|
|
5319
|
+
__webpack_require__(1703);
|
|
5320
|
+
|
|
5321
|
+
var forEach = (__webpack_require__(8485).forEach);
|
|
5322
|
+
|
|
5323
|
+
var elementUtilsMaker = __webpack_require__(5048);
|
|
5324
|
+
|
|
5325
|
+
var listenerHandlerMaker = __webpack_require__(8655);
|
|
5326
|
+
|
|
5327
|
+
var idGeneratorMaker = __webpack_require__(5509);
|
|
5328
|
+
|
|
5329
|
+
var idHandlerMaker = __webpack_require__(6186);
|
|
5330
|
+
|
|
5331
|
+
var reporterMaker = __webpack_require__(9009);
|
|
5332
|
+
|
|
5333
|
+
var browserDetector = __webpack_require__(2499);
|
|
5334
|
+
|
|
5335
|
+
var batchProcessorMaker = __webpack_require__(8845);
|
|
5336
|
+
|
|
5337
|
+
var stateHandler = __webpack_require__(544); //Detection strategies.
|
|
5338
|
+
|
|
5339
|
+
|
|
5340
|
+
var objectStrategyMaker = __webpack_require__(8862);
|
|
5341
|
+
|
|
5342
|
+
var scrollStrategyMaker = __webpack_require__(8197);
|
|
5343
|
+
|
|
5344
|
+
function isCollection(obj) {
|
|
5345
|
+
return Array.isArray(obj) || obj.length !== undefined;
|
|
5346
|
+
}
|
|
5347
|
+
|
|
5348
|
+
function toArray(collection) {
|
|
5349
|
+
if (!Array.isArray(collection)) {
|
|
5350
|
+
var array = [];
|
|
5351
|
+
forEach(collection, function (obj) {
|
|
5352
|
+
array.push(obj);
|
|
5353
|
+
});
|
|
5354
|
+
return array;
|
|
5355
|
+
} else {
|
|
5356
|
+
return collection;
|
|
5357
|
+
}
|
|
5358
|
+
}
|
|
5359
|
+
|
|
5360
|
+
function isElement(obj) {
|
|
5361
|
+
return obj && obj.nodeType === 1;
|
|
5362
|
+
}
|
|
5363
|
+
/**
|
|
5364
|
+
* @typedef idHandler
|
|
5365
|
+
* @type {object}
|
|
5366
|
+
* @property {function} get Gets the resize detector id of the element.
|
|
5367
|
+
* @property {function} set Generate and sets the resize detector id of the element.
|
|
5368
|
+
*/
|
|
5369
|
+
|
|
5370
|
+
/**
|
|
5371
|
+
* @typedef Options
|
|
5372
|
+
* @type {object}
|
|
5373
|
+
* @property {boolean} callOnAdd Determines if listeners should be called when they are getting added.
|
|
5374
|
+
Default is true. If true, the listener is guaranteed to be called when it has been added.
|
|
5375
|
+
If false, the listener will not be guarenteed to be called when it has been added (does not prevent it from being called).
|
|
5376
|
+
* @property {idHandler} idHandler A custom id handler that is responsible for generating, setting and retrieving id's for elements.
|
|
5377
|
+
If not provided, a default id handler will be used.
|
|
5378
|
+
* @property {reporter} reporter A custom reporter that handles reporting logs, warnings and errors.
|
|
5379
|
+
If not provided, a default id handler will be used.
|
|
5380
|
+
If set to false, then nothing will be reported.
|
|
5381
|
+
* @property {boolean} debug If set to true, the the system will report debug messages as default for the listenTo method.
|
|
5382
|
+
*/
|
|
5383
|
+
|
|
5384
|
+
/**
|
|
5385
|
+
* Creates an element resize detector instance.
|
|
5386
|
+
* @public
|
|
5387
|
+
* @param {Options?} options Optional global options object that will decide how this instance will work.
|
|
5388
|
+
*/
|
|
5389
|
+
|
|
5390
|
+
|
|
5391
|
+
module.exports = function (options) {
|
|
5392
|
+
options = options || {}; //idHandler is currently not an option to the listenTo function, so it should not be added to globalOptions.
|
|
5393
|
+
|
|
5394
|
+
var idHandler;
|
|
5395
|
+
|
|
5396
|
+
if (options.idHandler) {
|
|
5397
|
+
// To maintain compatability with idHandler.get(element, readonly), make sure to wrap the given idHandler
|
|
5398
|
+
// so that readonly flag always is true when it's used here. This may be removed next major version bump.
|
|
5399
|
+
idHandler = {
|
|
5400
|
+
get: function (element) {
|
|
5401
|
+
return options.idHandler.get(element, true);
|
|
5402
|
+
},
|
|
5403
|
+
set: options.idHandler.set
|
|
5404
|
+
};
|
|
5405
|
+
} else {
|
|
5406
|
+
var idGenerator = idGeneratorMaker();
|
|
5407
|
+
var defaultIdHandler = idHandlerMaker({
|
|
5408
|
+
idGenerator: idGenerator,
|
|
5409
|
+
stateHandler: stateHandler
|
|
5410
|
+
});
|
|
5411
|
+
idHandler = defaultIdHandler;
|
|
5412
|
+
} //reporter is currently not an option to the listenTo function, so it should not be added to globalOptions.
|
|
5413
|
+
|
|
5414
|
+
|
|
5415
|
+
var reporter = options.reporter;
|
|
5416
|
+
|
|
5417
|
+
if (!reporter) {
|
|
5418
|
+
//If options.reporter is false, then the reporter should be quiet.
|
|
5419
|
+
var quiet = reporter === false;
|
|
5420
|
+
reporter = reporterMaker(quiet);
|
|
5421
|
+
} //batchProcessor is currently not an option to the listenTo function, so it should not be added to globalOptions.
|
|
5422
|
+
|
|
5423
|
+
|
|
5424
|
+
var batchProcessor = getOption(options, "batchProcessor", batchProcessorMaker({
|
|
5425
|
+
reporter: reporter
|
|
5426
|
+
})); //Options to be used as default for the listenTo function.
|
|
5427
|
+
|
|
5428
|
+
var globalOptions = {};
|
|
5429
|
+
globalOptions.callOnAdd = !!getOption(options, "callOnAdd", true);
|
|
5430
|
+
globalOptions.debug = !!getOption(options, "debug", false);
|
|
5431
|
+
var eventListenerHandler = listenerHandlerMaker(idHandler);
|
|
5432
|
+
var elementUtils = elementUtilsMaker({
|
|
5433
|
+
stateHandler: stateHandler
|
|
5434
|
+
}); //The detection strategy to be used.
|
|
5435
|
+
|
|
5436
|
+
var detectionStrategy;
|
|
5437
|
+
var desiredStrategy = getOption(options, "strategy", "object");
|
|
5438
|
+
var importantCssRules = getOption(options, "important", false);
|
|
5439
|
+
var strategyOptions = {
|
|
5440
|
+
reporter: reporter,
|
|
5441
|
+
batchProcessor: batchProcessor,
|
|
5442
|
+
stateHandler: stateHandler,
|
|
5443
|
+
idHandler: idHandler,
|
|
5444
|
+
important: importantCssRules
|
|
5445
|
+
};
|
|
5446
|
+
|
|
5447
|
+
if (desiredStrategy === "scroll") {
|
|
5448
|
+
if (browserDetector.isLegacyOpera()) {
|
|
5449
|
+
reporter.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy.");
|
|
5450
|
+
desiredStrategy = "object";
|
|
5451
|
+
} else if (browserDetector.isIE(9)) {
|
|
5452
|
+
reporter.warn("Scroll strategy is not supported on IE9. Changing to object strategy.");
|
|
5453
|
+
desiredStrategy = "object";
|
|
5454
|
+
}
|
|
5455
|
+
}
|
|
5456
|
+
|
|
5457
|
+
if (desiredStrategy === "scroll") {
|
|
5458
|
+
detectionStrategy = scrollStrategyMaker(strategyOptions);
|
|
5459
|
+
} else if (desiredStrategy === "object") {
|
|
5460
|
+
detectionStrategy = objectStrategyMaker(strategyOptions);
|
|
5461
|
+
} else {
|
|
5462
|
+
throw new Error("Invalid strategy name: " + desiredStrategy);
|
|
5463
|
+
} //Calls can be made to listenTo with elements that are still being installed.
|
|
5464
|
+
//Also, same elements can occur in the elements list in the listenTo function.
|
|
5465
|
+
//With this map, the ready callbacks can be synchronized between the calls
|
|
5466
|
+
//so that the ready callback can always be called when an element is ready - even if
|
|
5467
|
+
//it wasn't installed from the function itself.
|
|
5468
|
+
|
|
5469
|
+
|
|
5470
|
+
var onReadyCallbacks = {};
|
|
5471
|
+
/**
|
|
5472
|
+
* Makes the given elements resize-detectable and starts listening to resize events on the elements. Calls the event callback for each event for each element.
|
|
5473
|
+
* @public
|
|
5474
|
+
* @param {Options?} options Optional options object. These options will override the global options. Some options may not be overriden, such as idHandler.
|
|
5475
|
+
* @param {element[]|element} elements The given array of elements to detect resize events of. Single element is also valid.
|
|
5476
|
+
* @param {function} listener The callback to be executed for each resize event for each element.
|
|
5477
|
+
*/
|
|
5478
|
+
|
|
5479
|
+
function listenTo(options, elements, listener) {
|
|
5480
|
+
function onResizeCallback(element) {
|
|
5481
|
+
var listeners = eventListenerHandler.get(element);
|
|
5482
|
+
forEach(listeners, function callListenerProxy(listener) {
|
|
5483
|
+
listener(element);
|
|
5484
|
+
});
|
|
5485
|
+
}
|
|
5486
|
+
|
|
5487
|
+
function addListener(callOnAdd, element, listener) {
|
|
5488
|
+
eventListenerHandler.add(element, listener);
|
|
5489
|
+
|
|
5490
|
+
if (callOnAdd) {
|
|
5491
|
+
listener(element);
|
|
5492
|
+
}
|
|
5493
|
+
} //Options object may be omitted.
|
|
5494
|
+
|
|
5495
|
+
|
|
5496
|
+
if (!listener) {
|
|
5497
|
+
listener = elements;
|
|
5498
|
+
elements = options;
|
|
5499
|
+
options = {};
|
|
5500
|
+
}
|
|
5501
|
+
|
|
5502
|
+
if (!elements) {
|
|
5503
|
+
throw new Error("At least one element required.");
|
|
5504
|
+
}
|
|
5505
|
+
|
|
5506
|
+
if (!listener) {
|
|
5507
|
+
throw new Error("Listener required.");
|
|
5508
|
+
}
|
|
5509
|
+
|
|
5510
|
+
if (isElement(elements)) {
|
|
5511
|
+
// A single element has been passed in.
|
|
5512
|
+
elements = [elements];
|
|
5513
|
+
} else if (isCollection(elements)) {
|
|
5514
|
+
// Convert collection to array for plugins.
|
|
5515
|
+
// TODO: May want to check so that all the elements in the collection are valid elements.
|
|
5516
|
+
elements = toArray(elements);
|
|
5517
|
+
} else {
|
|
5518
|
+
return reporter.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
|
|
5519
|
+
}
|
|
5520
|
+
|
|
5521
|
+
var elementsReady = 0;
|
|
5522
|
+
var callOnAdd = getOption(options, "callOnAdd", globalOptions.callOnAdd);
|
|
5523
|
+
var onReadyCallback = getOption(options, "onReady", function noop() {});
|
|
5524
|
+
var debug = getOption(options, "debug", globalOptions.debug);
|
|
5525
|
+
forEach(elements, function attachListenerToElement(element) {
|
|
5526
|
+
if (!stateHandler.getState(element)) {
|
|
5527
|
+
stateHandler.initState(element);
|
|
5528
|
+
idHandler.set(element);
|
|
5529
|
+
}
|
|
5530
|
+
|
|
5531
|
+
var id = idHandler.get(element);
|
|
5532
|
+
debug && reporter.log("Attaching listener to element", id, element);
|
|
5533
|
+
|
|
5534
|
+
if (!elementUtils.isDetectable(element)) {
|
|
5535
|
+
debug && reporter.log(id, "Not detectable.");
|
|
5536
|
+
|
|
5537
|
+
if (elementUtils.isBusy(element)) {
|
|
5538
|
+
debug && reporter.log(id, "System busy making it detectable"); //The element is being prepared to be detectable. Do not make it detectable.
|
|
5539
|
+
//Just add the listener, because the element will soon be detectable.
|
|
5540
|
+
|
|
5541
|
+
addListener(callOnAdd, element, listener);
|
|
5542
|
+
onReadyCallbacks[id] = onReadyCallbacks[id] || [];
|
|
5543
|
+
onReadyCallbacks[id].push(function onReady() {
|
|
5544
|
+
elementsReady++;
|
|
5545
|
+
|
|
5546
|
+
if (elementsReady === elements.length) {
|
|
5547
|
+
onReadyCallback();
|
|
5548
|
+
}
|
|
5549
|
+
});
|
|
5550
|
+
return;
|
|
5551
|
+
}
|
|
5552
|
+
|
|
5553
|
+
debug && reporter.log(id, "Making detectable..."); //The element is not prepared to be detectable, so do prepare it and add a listener to it.
|
|
5554
|
+
|
|
5555
|
+
elementUtils.markBusy(element, true);
|
|
5556
|
+
return detectionStrategy.makeDetectable({
|
|
5557
|
+
debug: debug,
|
|
5558
|
+
important: importantCssRules
|
|
5559
|
+
}, element, function onElementDetectable(element) {
|
|
5560
|
+
debug && reporter.log(id, "onElementDetectable");
|
|
5561
|
+
|
|
5562
|
+
if (stateHandler.getState(element)) {
|
|
5563
|
+
elementUtils.markAsDetectable(element);
|
|
5564
|
+
elementUtils.markBusy(element, false);
|
|
5565
|
+
detectionStrategy.addListener(element, onResizeCallback);
|
|
5566
|
+
addListener(callOnAdd, element, listener); // Since the element size might have changed since the call to "listenTo", we need to check for this change,
|
|
5567
|
+
// so that a resize event may be emitted.
|
|
5568
|
+
// Having the startSize object is optional (since it does not make sense in some cases such as unrendered elements), so check for its existance before.
|
|
5569
|
+
// Also, check the state existance before since the element may have been uninstalled in the installation process.
|
|
5570
|
+
|
|
5571
|
+
var state = stateHandler.getState(element);
|
|
5572
|
+
|
|
5573
|
+
if (state && state.startSize) {
|
|
5574
|
+
var width = element.offsetWidth;
|
|
5575
|
+
var height = element.offsetHeight;
|
|
5576
|
+
|
|
5577
|
+
if (state.startSize.width !== width || state.startSize.height !== height) {
|
|
5578
|
+
onResizeCallback(element);
|
|
5579
|
+
}
|
|
5580
|
+
}
|
|
5581
|
+
|
|
5582
|
+
if (onReadyCallbacks[id]) {
|
|
5583
|
+
forEach(onReadyCallbacks[id], function (callback) {
|
|
5584
|
+
callback();
|
|
5585
|
+
});
|
|
5586
|
+
}
|
|
5587
|
+
} else {
|
|
5588
|
+
// The element has been unisntalled before being detectable.
|
|
5589
|
+
debug && reporter.log(id, "Element uninstalled before being detectable.");
|
|
5590
|
+
}
|
|
5591
|
+
|
|
5592
|
+
delete onReadyCallbacks[id];
|
|
5593
|
+
elementsReady++;
|
|
5594
|
+
|
|
5595
|
+
if (elementsReady === elements.length) {
|
|
5596
|
+
onReadyCallback();
|
|
5597
|
+
}
|
|
5598
|
+
});
|
|
5599
|
+
}
|
|
5600
|
+
|
|
5601
|
+
debug && reporter.log(id, "Already detecable, adding listener."); //The element has been prepared to be detectable and is ready to be listened to.
|
|
5602
|
+
|
|
5603
|
+
addListener(callOnAdd, element, listener);
|
|
5604
|
+
elementsReady++;
|
|
5605
|
+
});
|
|
5606
|
+
|
|
5607
|
+
if (elementsReady === elements.length) {
|
|
5608
|
+
onReadyCallback();
|
|
5609
|
+
}
|
|
5610
|
+
}
|
|
5611
|
+
|
|
5612
|
+
function uninstall(elements) {
|
|
5613
|
+
if (!elements) {
|
|
5614
|
+
return reporter.error("At least one element is required.");
|
|
5615
|
+
}
|
|
5616
|
+
|
|
5617
|
+
if (isElement(elements)) {
|
|
5618
|
+
// A single element has been passed in.
|
|
5619
|
+
elements = [elements];
|
|
5620
|
+
} else if (isCollection(elements)) {
|
|
5621
|
+
// Convert collection to array for plugins.
|
|
5622
|
+
// TODO: May want to check so that all the elements in the collection are valid elements.
|
|
5623
|
+
elements = toArray(elements);
|
|
5624
|
+
} else {
|
|
5625
|
+
return reporter.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
|
|
5626
|
+
}
|
|
5627
|
+
|
|
5628
|
+
forEach(elements, function (element) {
|
|
5629
|
+
eventListenerHandler.removeAllListeners(element);
|
|
5630
|
+
detectionStrategy.uninstall(element);
|
|
5631
|
+
stateHandler.cleanState(element);
|
|
5632
|
+
});
|
|
5633
|
+
}
|
|
5634
|
+
|
|
5635
|
+
function initDocument(targetDocument) {
|
|
5636
|
+
detectionStrategy.initDocument && detectionStrategy.initDocument(targetDocument);
|
|
5637
|
+
}
|
|
5638
|
+
|
|
5639
|
+
return {
|
|
5640
|
+
listenTo: listenTo,
|
|
5641
|
+
removeListener: eventListenerHandler.removeListener,
|
|
5642
|
+
removeAllListeners: eventListenerHandler.removeAllListeners,
|
|
5643
|
+
uninstall: uninstall,
|
|
5644
|
+
initDocument: initDocument
|
|
5645
|
+
};
|
|
5646
|
+
};
|
|
5647
|
+
|
|
5648
|
+
function getOption(options, name, defaultValue) {
|
|
5649
|
+
var value = options[name];
|
|
5650
|
+
|
|
5651
|
+
if ((value === undefined || value === null) && defaultValue !== undefined) {
|
|
5652
|
+
return defaultValue;
|
|
5653
|
+
}
|
|
5654
|
+
|
|
5655
|
+
return value;
|
|
5656
|
+
}
|
|
5657
|
+
|
|
5658
|
+
/***/ }),
|
|
5659
|
+
|
|
5660
|
+
/***/ 5048:
|
|
5661
|
+
/***/ (function(module) {
|
|
5662
|
+
|
|
5663
|
+
"use strict";
|
|
5664
|
+
|
|
5665
|
+
|
|
5666
|
+
module.exports = function (options) {
|
|
5667
|
+
var getState = options.stateHandler.getState;
|
|
5668
|
+
/**
|
|
5669
|
+
* Tells if the element has been made detectable and ready to be listened for resize events.
|
|
5670
|
+
* @public
|
|
5671
|
+
* @param {element} The element to check.
|
|
5672
|
+
* @returns {boolean} True or false depending on if the element is detectable or not.
|
|
5673
|
+
*/
|
|
5674
|
+
|
|
5675
|
+
function isDetectable(element) {
|
|
5676
|
+
var state = getState(element);
|
|
5677
|
+
return state && !!state.isDetectable;
|
|
5678
|
+
}
|
|
5679
|
+
/**
|
|
5680
|
+
* Marks the element that it has been made detectable and ready to be listened for resize events.
|
|
5681
|
+
* @public
|
|
5682
|
+
* @param {element} The element to mark.
|
|
5683
|
+
*/
|
|
5684
|
+
|
|
5685
|
+
|
|
5686
|
+
function markAsDetectable(element) {
|
|
5687
|
+
getState(element).isDetectable = true;
|
|
5688
|
+
}
|
|
5689
|
+
/**
|
|
5690
|
+
* Tells if the element is busy or not.
|
|
5691
|
+
* @public
|
|
5692
|
+
* @param {element} The element to check.
|
|
5693
|
+
* @returns {boolean} True or false depending on if the element is busy or not.
|
|
5694
|
+
*/
|
|
5695
|
+
|
|
5696
|
+
|
|
5697
|
+
function isBusy(element) {
|
|
5698
|
+
return !!getState(element).busy;
|
|
5699
|
+
}
|
|
5700
|
+
/**
|
|
5701
|
+
* Marks the object is busy and should not be made detectable.
|
|
5702
|
+
* @public
|
|
5703
|
+
* @param {element} element The element to mark.
|
|
5704
|
+
* @param {boolean} busy If the element is busy or not.
|
|
5705
|
+
*/
|
|
5706
|
+
|
|
5707
|
+
|
|
5708
|
+
function markBusy(element, busy) {
|
|
5709
|
+
getState(element).busy = !!busy;
|
|
5710
|
+
}
|
|
5711
|
+
|
|
5712
|
+
return {
|
|
5713
|
+
isDetectable: isDetectable,
|
|
5714
|
+
markAsDetectable: markAsDetectable,
|
|
5715
|
+
isBusy: isBusy,
|
|
5716
|
+
markBusy: markBusy
|
|
5717
|
+
};
|
|
5718
|
+
};
|
|
5719
|
+
|
|
5720
|
+
/***/ }),
|
|
5721
|
+
|
|
5722
|
+
/***/ 5509:
|
|
5723
|
+
/***/ (function(module) {
|
|
5724
|
+
|
|
5725
|
+
"use strict";
|
|
5726
|
+
|
|
5727
|
+
|
|
5728
|
+
module.exports = function () {
|
|
5729
|
+
var idCount = 1;
|
|
5730
|
+
/**
|
|
5731
|
+
* Generates a new unique id in the context.
|
|
5732
|
+
* @public
|
|
5733
|
+
* @returns {number} A unique id in the context.
|
|
5734
|
+
*/
|
|
5735
|
+
|
|
5736
|
+
function generate() {
|
|
5737
|
+
return idCount++;
|
|
5738
|
+
}
|
|
5739
|
+
|
|
5740
|
+
return {
|
|
5741
|
+
generate: generate
|
|
5742
|
+
};
|
|
5743
|
+
};
|
|
5744
|
+
|
|
5745
|
+
/***/ }),
|
|
5746
|
+
|
|
5747
|
+
/***/ 6186:
|
|
5748
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
5749
|
+
|
|
5750
|
+
"use strict";
|
|
5751
|
+
|
|
5752
|
+
|
|
5753
|
+
__webpack_require__(1703);
|
|
5754
|
+
|
|
5755
|
+
module.exports = function (options) {
|
|
5756
|
+
var idGenerator = options.idGenerator;
|
|
5757
|
+
var getState = options.stateHandler.getState;
|
|
5758
|
+
/**
|
|
5759
|
+
* Gets the resize detector id of the element.
|
|
5760
|
+
* @public
|
|
5761
|
+
* @param {element} element The target element to get the id of.
|
|
5762
|
+
* @returns {string|number|null} The id of the element. Null if it has no id.
|
|
5763
|
+
*/
|
|
5764
|
+
|
|
5765
|
+
function getId(element) {
|
|
5766
|
+
var state = getState(element);
|
|
5767
|
+
|
|
5768
|
+
if (state && state.id !== undefined) {
|
|
5769
|
+
return state.id;
|
|
5770
|
+
}
|
|
5771
|
+
|
|
5772
|
+
return null;
|
|
5773
|
+
}
|
|
5774
|
+
/**
|
|
5775
|
+
* Sets the resize detector id of the element. Requires the element to have a resize detector state initialized.
|
|
5776
|
+
* @public
|
|
5777
|
+
* @param {element} element The target element to set the id of.
|
|
5778
|
+
* @returns {string|number|null} The id of the element.
|
|
5779
|
+
*/
|
|
5780
|
+
|
|
5781
|
+
|
|
5782
|
+
function setId(element) {
|
|
5783
|
+
var state = getState(element);
|
|
5784
|
+
|
|
5785
|
+
if (!state) {
|
|
5786
|
+
throw new Error("setId required the element to have a resize detection state.");
|
|
5787
|
+
}
|
|
5788
|
+
|
|
5789
|
+
var id = idGenerator.generate();
|
|
5790
|
+
state.id = id;
|
|
5791
|
+
return id;
|
|
5792
|
+
}
|
|
5793
|
+
|
|
5794
|
+
return {
|
|
5795
|
+
get: getId,
|
|
5796
|
+
set: setId
|
|
5797
|
+
};
|
|
5798
|
+
};
|
|
5799
|
+
|
|
5800
|
+
/***/ }),
|
|
5801
|
+
|
|
5802
|
+
/***/ 8655:
|
|
5803
|
+
/***/ (function(module) {
|
|
5804
|
+
|
|
5805
|
+
"use strict";
|
|
5806
|
+
|
|
5807
|
+
|
|
5808
|
+
module.exports = function (idHandler) {
|
|
5809
|
+
var eventListeners = {};
|
|
5810
|
+
/**
|
|
5811
|
+
* Gets all listeners for the given element.
|
|
5812
|
+
* @public
|
|
5813
|
+
* @param {element} element The element to get all listeners for.
|
|
5814
|
+
* @returns All listeners for the given element.
|
|
5815
|
+
*/
|
|
5816
|
+
|
|
5817
|
+
function getListeners(element) {
|
|
5818
|
+
var id = idHandler.get(element);
|
|
5819
|
+
|
|
5820
|
+
if (id === undefined) {
|
|
5821
|
+
return [];
|
|
5822
|
+
}
|
|
5823
|
+
|
|
5824
|
+
return eventListeners[id] || [];
|
|
5825
|
+
}
|
|
5826
|
+
/**
|
|
5827
|
+
* Stores the given listener for the given element. Will not actually add the listener to the element.
|
|
5828
|
+
* @public
|
|
5829
|
+
* @param {element} element The element that should have the listener added.
|
|
5830
|
+
* @param {function} listener The callback that the element has added.
|
|
5831
|
+
*/
|
|
5832
|
+
|
|
5833
|
+
|
|
5834
|
+
function addListener(element, listener) {
|
|
5835
|
+
var id = idHandler.get(element);
|
|
5836
|
+
|
|
5837
|
+
if (!eventListeners[id]) {
|
|
5838
|
+
eventListeners[id] = [];
|
|
5839
|
+
}
|
|
5840
|
+
|
|
5841
|
+
eventListeners[id].push(listener);
|
|
5842
|
+
}
|
|
5843
|
+
|
|
5844
|
+
function removeListener(element, listener) {
|
|
5845
|
+
var listeners = getListeners(element);
|
|
5846
|
+
|
|
5847
|
+
for (var i = 0, len = listeners.length; i < len; ++i) {
|
|
5848
|
+
if (listeners[i] === listener) {
|
|
5849
|
+
listeners.splice(i, 1);
|
|
5850
|
+
break;
|
|
5851
|
+
}
|
|
5852
|
+
}
|
|
5853
|
+
}
|
|
5854
|
+
|
|
5855
|
+
function removeAllListeners(element) {
|
|
5856
|
+
var listeners = getListeners(element);
|
|
5857
|
+
|
|
5858
|
+
if (!listeners) {
|
|
5859
|
+
return;
|
|
5860
|
+
}
|
|
5861
|
+
|
|
5862
|
+
listeners.length = 0;
|
|
5863
|
+
}
|
|
5864
|
+
|
|
5865
|
+
return {
|
|
5866
|
+
get: getListeners,
|
|
5867
|
+
add: addListener,
|
|
5868
|
+
removeListener: removeListener,
|
|
5869
|
+
removeAllListeners: removeAllListeners
|
|
5870
|
+
};
|
|
5871
|
+
};
|
|
5872
|
+
|
|
5873
|
+
/***/ }),
|
|
5874
|
+
|
|
5875
|
+
/***/ 9009:
|
|
5876
|
+
/***/ (function(module) {
|
|
5877
|
+
|
|
5878
|
+
"use strict";
|
|
5879
|
+
|
|
5880
|
+
/* global console: false */
|
|
5881
|
+
|
|
5882
|
+
/**
|
|
5883
|
+
* Reporter that handles the reporting of logs, warnings and errors.
|
|
5884
|
+
* @public
|
|
5885
|
+
* @param {boolean} quiet Tells if the reporter should be quiet or not.
|
|
5886
|
+
*/
|
|
5887
|
+
|
|
5888
|
+
module.exports = function (quiet) {
|
|
5889
|
+
function noop() {//Does nothing.
|
|
5890
|
+
}
|
|
5891
|
+
|
|
5892
|
+
var reporter = {
|
|
5893
|
+
log: noop,
|
|
5894
|
+
warn: noop,
|
|
5895
|
+
error: noop
|
|
5896
|
+
};
|
|
5897
|
+
|
|
5898
|
+
if (!quiet && window.console) {
|
|
5899
|
+
var attachFunction = function (reporter, name) {
|
|
5900
|
+
//The proxy is needed to be able to call the method with the console context,
|
|
5901
|
+
//since we cannot use bind.
|
|
5902
|
+
reporter[name] = function reporterProxy() {
|
|
5903
|
+
var f = console[name];
|
|
5904
|
+
|
|
5905
|
+
if (f.apply) {
|
|
5906
|
+
//IE9 does not support console.log.apply :)
|
|
5907
|
+
f.apply(console, arguments);
|
|
5908
|
+
} else {
|
|
5909
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
5910
|
+
f(arguments[i]);
|
|
5911
|
+
}
|
|
5912
|
+
}
|
|
5913
|
+
};
|
|
5914
|
+
};
|
|
5915
|
+
|
|
5916
|
+
attachFunction(reporter, "log");
|
|
5917
|
+
attachFunction(reporter, "warn");
|
|
5918
|
+
attachFunction(reporter, "error");
|
|
5919
|
+
}
|
|
5920
|
+
|
|
5921
|
+
return reporter;
|
|
5922
|
+
};
|
|
5923
|
+
|
|
5924
|
+
/***/ }),
|
|
5925
|
+
|
|
5926
|
+
/***/ 544:
|
|
5927
|
+
/***/ (function(module) {
|
|
5928
|
+
|
|
5929
|
+
"use strict";
|
|
5930
|
+
|
|
5931
|
+
|
|
5932
|
+
var prop = "_erd";
|
|
5933
|
+
|
|
5934
|
+
function initState(element) {
|
|
5935
|
+
element[prop] = {};
|
|
5936
|
+
return getState(element);
|
|
5937
|
+
}
|
|
5938
|
+
|
|
5939
|
+
function getState(element) {
|
|
5940
|
+
return element[prop];
|
|
5941
|
+
}
|
|
5942
|
+
|
|
5943
|
+
function cleanState(element) {
|
|
5944
|
+
delete element[prop];
|
|
5945
|
+
}
|
|
5946
|
+
|
|
5947
|
+
module.exports = {
|
|
5948
|
+
initState: initState,
|
|
5949
|
+
getState: getState,
|
|
5950
|
+
cleanState: cleanState
|
|
5951
|
+
};
|
|
5952
|
+
|
|
5953
|
+
/***/ }),
|
|
5954
|
+
|
|
4167
5955
|
/***/ 4973:
|
|
4168
5956
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
4169
5957
|
|
|
@@ -98828,7 +100616,7 @@ const ElColorPicker = _ColorPicker;
|
|
|
98828
100616
|
|
|
98829
100617
|
;// CONCATENATED MODULE: ./node_modules/element-plus/es/components/color-picker/style/css.mjs
|
|
98830
100618
|
|
|
98831
|
-
;// CONCATENATED MODULE: ./node_modules/unplugin/dist/webpack/loaders/transform.js??ruleSet[1].rules[33].use[0]!./node_modules/unplugin/dist/webpack/loaders/transform.js??ruleSet[1].rules[34].use[0]!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./packages/echarts/index.vue?vue&type=template&id=
|
|
100619
|
+
;// CONCATENATED MODULE: ./node_modules/unplugin/dist/webpack/loaders/transform.js??ruleSet[1].rules[33].use[0]!./node_modules/unplugin/dist/webpack/loaders/transform.js??ruleSet[1].rules[34].use[0]!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./packages/echarts/index.vue?vue&type=template&id=04f62cec&scoped=true
|
|
98832
100620
|
/* unplugin-vue-components disabled */
|
|
98833
100621
|
|
|
98834
100622
|
|
|
@@ -98838,26 +100626,26 @@ const ElColorPicker = _ColorPicker;
|
|
|
98838
100626
|
|
|
98839
100627
|
|
|
98840
100628
|
|
|
98841
|
-
const
|
|
100629
|
+
const echartsvue_type_template_id_04f62cec_scoped_true_withScopeId = n => (_pushScopeId("data-v-04f62cec"), n = n(), _popScopeId(), n);
|
|
98842
100630
|
|
|
98843
|
-
const
|
|
100631
|
+
const echartsvue_type_template_id_04f62cec_scoped_true_hoisted_1 = {
|
|
98844
100632
|
class: "echarts-wapper"
|
|
98845
100633
|
};
|
|
98846
|
-
const
|
|
100634
|
+
const echartsvue_type_template_id_04f62cec_scoped_true_hoisted_2 = ["id"];
|
|
98847
100635
|
|
|
98848
|
-
const
|
|
100636
|
+
const echartsvue_type_template_id_04f62cec_scoped_true_hoisted_3 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createTextVNode)("实线");
|
|
98849
100637
|
|
|
98850
|
-
const
|
|
100638
|
+
const echartsvue_type_template_id_04f62cec_scoped_true_hoisted_4 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createTextVNode)("虚线");
|
|
98851
100639
|
|
|
98852
|
-
const
|
|
100640
|
+
const echartsvue_type_template_id_04f62cec_scoped_true_hoisted_5 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createTextVNode)("点");
|
|
98853
100641
|
|
|
98854
|
-
const
|
|
100642
|
+
const echartsvue_type_template_id_04f62cec_scoped_true_hoisted_6 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createTextVNode)("实线");
|
|
98855
100643
|
|
|
98856
|
-
const
|
|
100644
|
+
const echartsvue_type_template_id_04f62cec_scoped_true_hoisted_7 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createTextVNode)("虚线");
|
|
98857
100645
|
|
|
98858
|
-
const
|
|
100646
|
+
const echartsvue_type_template_id_04f62cec_scoped_true_hoisted_8 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createTextVNode)("点");
|
|
98859
100647
|
|
|
98860
|
-
function
|
|
100648
|
+
function echartsvue_type_template_id_04f62cec_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
98861
100649
|
const _component_el_switch = ElSwitch;
|
|
98862
100650
|
|
|
98863
100651
|
const _component_el_form_item = ElFormItem;
|
|
@@ -98872,11 +100660,11 @@ function echartsvue_type_template_id_195b5eaf_scoped_true_render(_ctx, _cache, $
|
|
|
98872
100660
|
|
|
98873
100661
|
const _component_el_dialog = ElDialog;
|
|
98874
100662
|
|
|
98875
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div",
|
|
100663
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", echartsvue_type_template_id_04f62cec_scoped_true_hoisted_1, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
98876
100664
|
ref: el => $setup.setRef(el),
|
|
98877
100665
|
id: $props.id,
|
|
98878
100666
|
class: "jt-chart-vm"
|
|
98879
|
-
}, null, 8,
|
|
100667
|
+
}, null, 8, echartsvue_type_template_id_04f62cec_scoped_true_hoisted_2), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("span", {
|
|
98880
100668
|
class: "jtIcon iconpeizhi41 eitid-icon",
|
|
98881
100669
|
onClick: _cache[0] || (_cache[0] = $event => $setup.dialogVisible = true)
|
|
98882
100670
|
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createVNode)(_component_el_dialog, {
|
|
@@ -98959,21 +100747,21 @@ function echartsvue_type_template_id_195b5eaf_scoped_true_render(_ctx, _cache, $
|
|
|
98959
100747
|
"onUpdate:modelValue": _cache[8] || (_cache[8] = $event => $setup.gridLineConfig.lineType = $event),
|
|
98960
100748
|
label: "solid"
|
|
98961
100749
|
}, {
|
|
98962
|
-
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [
|
|
100750
|
+
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [echartsvue_type_template_id_04f62cec_scoped_true_hoisted_3]),
|
|
98963
100751
|
_: 1
|
|
98964
100752
|
}, 8, ["modelValue"]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createVNode)(_component_el_radio, {
|
|
98965
100753
|
modelValue: $setup.gridLineConfig.lineType,
|
|
98966
100754
|
"onUpdate:modelValue": _cache[9] || (_cache[9] = $event => $setup.gridLineConfig.lineType = $event),
|
|
98967
100755
|
label: "dashed"
|
|
98968
100756
|
}, {
|
|
98969
|
-
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [
|
|
100757
|
+
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [echartsvue_type_template_id_04f62cec_scoped_true_hoisted_4]),
|
|
98970
100758
|
_: 1
|
|
98971
100759
|
}, 8, ["modelValue"]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createVNode)(_component_el_radio, {
|
|
98972
100760
|
modelValue: $setup.gridLineConfig.lineType,
|
|
98973
100761
|
"onUpdate:modelValue": _cache[10] || (_cache[10] = $event => $setup.gridLineConfig.lineType = $event),
|
|
98974
100762
|
label: "dotted"
|
|
98975
100763
|
}, {
|
|
98976
|
-
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [
|
|
100764
|
+
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [echartsvue_type_template_id_04f62cec_scoped_true_hoisted_5]),
|
|
98977
100765
|
_: 1
|
|
98978
100766
|
}, 8, ["modelValue"])]),
|
|
98979
100767
|
_: 1
|
|
@@ -99020,21 +100808,21 @@ function echartsvue_type_template_id_195b5eaf_scoped_true_render(_ctx, _cache, $
|
|
|
99020
100808
|
"onUpdate:modelValue": _cache[15] || (_cache[15] = $event => $setup.tickLineConfig.lineType = $event),
|
|
99021
100809
|
label: "solid"
|
|
99022
100810
|
}, {
|
|
99023
|
-
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [
|
|
100811
|
+
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [echartsvue_type_template_id_04f62cec_scoped_true_hoisted_6]),
|
|
99024
100812
|
_: 1
|
|
99025
100813
|
}, 8, ["modelValue"]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createVNode)(_component_el_radio, {
|
|
99026
100814
|
modelValue: $setup.tickLineConfig.lineType,
|
|
99027
100815
|
"onUpdate:modelValue": _cache[16] || (_cache[16] = $event => $setup.tickLineConfig.lineType = $event),
|
|
99028
100816
|
label: "dashed"
|
|
99029
100817
|
}, {
|
|
99030
|
-
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [
|
|
100818
|
+
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [echartsvue_type_template_id_04f62cec_scoped_true_hoisted_7]),
|
|
99031
100819
|
_: 1
|
|
99032
100820
|
}, 8, ["modelValue"]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createVNode)(_component_el_radio, {
|
|
99033
100821
|
modelValue: $setup.tickLineConfig.lineType,
|
|
99034
100822
|
"onUpdate:modelValue": _cache[17] || (_cache[17] = $event => $setup.tickLineConfig.lineType = $event),
|
|
99035
100823
|
label: "dotted"
|
|
99036
100824
|
}, {
|
|
99037
|
-
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [
|
|
100825
|
+
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [echartsvue_type_template_id_04f62cec_scoped_true_hoisted_8]),
|
|
99038
100826
|
_: 1
|
|
99039
100827
|
}, 8, ["modelValue"])]),
|
|
99040
100828
|
_: 1
|
|
@@ -99044,7 +100832,7 @@ function echartsvue_type_template_id_195b5eaf_scoped_true_render(_ctx, _cache, $
|
|
|
99044
100832
|
_: 1
|
|
99045
100833
|
}, 8, ["modelValue"])]);
|
|
99046
100834
|
}
|
|
99047
|
-
;// CONCATENATED MODULE: ./packages/echarts/index.vue?vue&type=template&id=
|
|
100835
|
+
;// CONCATENATED MODULE: ./packages/echarts/index.vue?vue&type=template&id=04f62cec&scoped=true
|
|
99048
100836
|
/* unplugin-vue-components disabled */
|
|
99049
100837
|
;// CONCATENATED MODULE: ./node_modules/echarts/node_modules/tslib/tslib.es6.js
|
|
99050
100838
|
|
|
@@ -217540,11 +219328,16 @@ function getInterval(min, max, total) {
|
|
|
217540
219328
|
|
|
217541
219329
|
return obj;
|
|
217542
219330
|
}
|
|
219331
|
+
// EXTERNAL MODULE: ./node_modules/element-resize-detector/src/element-resize-detector.js
|
|
219332
|
+
var element_resize_detector = __webpack_require__(6084);
|
|
219333
|
+
var element_resize_detector_default = /*#__PURE__*/__webpack_require__.n(element_resize_detector);
|
|
217543
219334
|
;// CONCATENATED MODULE: ./node_modules/unplugin/dist/webpack/loaders/transform.js??ruleSet[1].rules[33].use[0]!./node_modules/unplugin/dist/webpack/loaders/transform.js??ruleSet[1].rules[34].use[0]!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./packages/echarts/index.vue?vue&type=script&lang=js
|
|
217544
219335
|
/* unplugin-vue-components disabled */
|
|
217545
219336
|
|
|
217546
219337
|
|
|
217547
219338
|
|
|
219339
|
+
|
|
219340
|
+
const erd = element_resize_detector_default()();
|
|
217548
219341
|
/* harmony default export */ var echartsvue_type_script_lang_js = ({
|
|
217549
219342
|
name: "jt-chart",
|
|
217550
219343
|
props: {
|
|
@@ -217720,9 +219513,12 @@ function getInterval(min, max, total) {
|
|
|
217720
219513
|
computedTimeInterval(timeRange.value);
|
|
217721
219514
|
} else {
|
|
217722
219515
|
chartVM.setOption(option);
|
|
217723
|
-
}
|
|
219516
|
+
} // window.addEventListener('resize',() => {
|
|
219517
|
+
// chartVM.resize()
|
|
219518
|
+
// })
|
|
219519
|
+
|
|
217724
219520
|
|
|
217725
|
-
|
|
219521
|
+
erd.listenTo(activeRef.value, () => {
|
|
217726
219522
|
chartVM.resize();
|
|
217727
219523
|
});
|
|
217728
219524
|
}); //监听外部时间选择
|
|
@@ -217881,10 +219677,10 @@ function getInterval(min, max, total) {
|
|
|
217881
219677
|
});
|
|
217882
219678
|
;// CONCATENATED MODULE: ./packages/echarts/index.vue?vue&type=script&lang=js
|
|
217883
219679
|
/* unplugin-vue-components disabled */
|
|
217884
|
-
;// CONCATENATED MODULE: ./node_modules/unplugin/dist/webpack/loaders/transform.js??ruleSet[1].rules[33].use[0]!./node_modules/unplugin/dist/webpack/loaders/transform.js??ruleSet[1].rules[34].use[0]!./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./packages/echarts/index.vue?vue&type=style&index=0&id=
|
|
219680
|
+
;// CONCATENATED MODULE: ./node_modules/unplugin/dist/webpack/loaders/transform.js??ruleSet[1].rules[33].use[0]!./node_modules/unplugin/dist/webpack/loaders/transform.js??ruleSet[1].rules[34].use[0]!./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./packages/echarts/index.vue?vue&type=style&index=0&id=04f62cec&lang=scss&scoped=true
|
|
217885
219681
|
/* unplugin-vue-components disabled */// extracted by mini-css-extract-plugin
|
|
217886
219682
|
|
|
217887
|
-
;// CONCATENATED MODULE: ./packages/echarts/index.vue?vue&type=style&index=0&id=
|
|
219683
|
+
;// CONCATENATED MODULE: ./packages/echarts/index.vue?vue&type=style&index=0&id=04f62cec&lang=scss&scoped=true
|
|
217888
219684
|
/* unplugin-vue-components disabled */
|
|
217889
219685
|
;// CONCATENATED MODULE: ./packages/echarts/index.vue
|
|
217890
219686
|
/* unplugin-vue-components disabled */
|
|
@@ -217894,7 +219690,7 @@ function getInterval(min, max, total) {
|
|
|
217894
219690
|
;
|
|
217895
219691
|
|
|
217896
219692
|
|
|
217897
|
-
const echarts_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(echartsvue_type_script_lang_js, [['render',
|
|
219693
|
+
const echarts_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(echartsvue_type_script_lang_js, [['render',echartsvue_type_template_id_04f62cec_scoped_true_render],['__scopeId',"data-v-04f62cec"]])
|
|
217898
219694
|
|
|
217899
219695
|
/* harmony default export */ var echarts = (echarts_exports_);
|
|
217900
219696
|
;// CONCATENATED MODULE: ./packages/echarts/index.js
|