rmt-fileupload 0.2.6 → 0.2.11
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/rmt-fileupload.common.js +1046 -968
- package/lib/rmt-fileupload.umd.js +1046 -968
- package/lib/rmt-fileupload.umd.min.js +3 -3
- package/package.json +1 -1
|
@@ -6624,7 +6624,7 @@ exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
|
|
|
6624
6624
|
|
|
6625
6625
|
/***/ }),
|
|
6626
6626
|
|
|
6627
|
-
/***/
|
|
6627
|
+
/***/ 5569:
|
|
6628
6628
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6629
6629
|
|
|
6630
6630
|
"use strict";
|
|
@@ -65780,931 +65780,931 @@ module.exports = normalizeWheel;
|
|
|
65780
65780
|
|
|
65781
65781
|
"use strict";
|
|
65782
65782
|
__webpack_require__.r(__webpack_exports__);
|
|
65783
|
-
/**
|
|
65784
|
-
* A collection of shims that provide minimal functionality of the ES6 collections.
|
|
65785
|
-
*
|
|
65786
|
-
* These implementations are not meant to be used outside of the ResizeObserver
|
|
65787
|
-
* modules as they cover only a limited range of use cases.
|
|
65788
|
-
*/
|
|
65789
|
-
/* eslint-disable require-jsdoc, valid-jsdoc */
|
|
65790
|
-
var MapShim = (function () {
|
|
65791
|
-
if (typeof Map !== 'undefined') {
|
|
65792
|
-
return Map;
|
|
65793
|
-
}
|
|
65794
|
-
/**
|
|
65795
|
-
* Returns index in provided array that matches the specified key.
|
|
65796
|
-
*
|
|
65797
|
-
* @param {Array<Array>} arr
|
|
65798
|
-
* @param {*} key
|
|
65799
|
-
* @returns {number}
|
|
65800
|
-
*/
|
|
65801
|
-
function getIndex(arr, key) {
|
|
65802
|
-
var result = -1;
|
|
65803
|
-
arr.some(function (entry, index) {
|
|
65804
|
-
if (entry[0] === key) {
|
|
65805
|
-
result = index;
|
|
65806
|
-
return true;
|
|
65807
|
-
}
|
|
65808
|
-
return false;
|
|
65809
|
-
});
|
|
65810
|
-
return result;
|
|
65811
|
-
}
|
|
65812
|
-
return /** @class */ (function () {
|
|
65813
|
-
function class_1() {
|
|
65814
|
-
this.__entries__ = [];
|
|
65815
|
-
}
|
|
65816
|
-
Object.defineProperty(class_1.prototype, "size", {
|
|
65817
|
-
/**
|
|
65818
|
-
* @returns {boolean}
|
|
65819
|
-
*/
|
|
65820
|
-
get: function () {
|
|
65821
|
-
return this.__entries__.length;
|
|
65822
|
-
},
|
|
65823
|
-
enumerable: true,
|
|
65824
|
-
configurable: true
|
|
65825
|
-
});
|
|
65826
|
-
/**
|
|
65827
|
-
* @param {*} key
|
|
65828
|
-
* @returns {*}
|
|
65829
|
-
*/
|
|
65830
|
-
class_1.prototype.get = function (key) {
|
|
65831
|
-
var index = getIndex(this.__entries__, key);
|
|
65832
|
-
var entry = this.__entries__[index];
|
|
65833
|
-
return entry && entry[1];
|
|
65834
|
-
};
|
|
65835
|
-
/**
|
|
65836
|
-
* @param {*} key
|
|
65837
|
-
* @param {*} value
|
|
65838
|
-
* @returns {void}
|
|
65839
|
-
*/
|
|
65840
|
-
class_1.prototype.set = function (key, value) {
|
|
65841
|
-
var index = getIndex(this.__entries__, key);
|
|
65842
|
-
if (~index) {
|
|
65843
|
-
this.__entries__[index][1] = value;
|
|
65844
|
-
}
|
|
65845
|
-
else {
|
|
65846
|
-
this.__entries__.push([key, value]);
|
|
65847
|
-
}
|
|
65848
|
-
};
|
|
65849
|
-
/**
|
|
65850
|
-
* @param {*} key
|
|
65851
|
-
* @returns {void}
|
|
65852
|
-
*/
|
|
65853
|
-
class_1.prototype.delete = function (key) {
|
|
65854
|
-
var entries = this.__entries__;
|
|
65855
|
-
var index = getIndex(entries, key);
|
|
65856
|
-
if (~index) {
|
|
65857
|
-
entries.splice(index, 1);
|
|
65858
|
-
}
|
|
65859
|
-
};
|
|
65860
|
-
/**
|
|
65861
|
-
* @param {*} key
|
|
65862
|
-
* @returns {void}
|
|
65863
|
-
*/
|
|
65864
|
-
class_1.prototype.has = function (key) {
|
|
65865
|
-
return !!~getIndex(this.__entries__, key);
|
|
65866
|
-
};
|
|
65867
|
-
/**
|
|
65868
|
-
* @returns {void}
|
|
65869
|
-
*/
|
|
65870
|
-
class_1.prototype.clear = function () {
|
|
65871
|
-
this.__entries__.splice(0);
|
|
65872
|
-
};
|
|
65873
|
-
/**
|
|
65874
|
-
* @param {Function} callback
|
|
65875
|
-
* @param {*} [ctx=null]
|
|
65876
|
-
* @returns {void}
|
|
65877
|
-
*/
|
|
65878
|
-
class_1.prototype.forEach = function (callback, ctx) {
|
|
65879
|
-
if (ctx === void 0) { ctx = null; }
|
|
65880
|
-
for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
|
|
65881
|
-
var entry = _a[_i];
|
|
65882
|
-
callback.call(ctx, entry[1], entry[0]);
|
|
65883
|
-
}
|
|
65884
|
-
};
|
|
65885
|
-
return class_1;
|
|
65886
|
-
}());
|
|
65783
|
+
/**
|
|
65784
|
+
* A collection of shims that provide minimal functionality of the ES6 collections.
|
|
65785
|
+
*
|
|
65786
|
+
* These implementations are not meant to be used outside of the ResizeObserver
|
|
65787
|
+
* modules as they cover only a limited range of use cases.
|
|
65788
|
+
*/
|
|
65789
|
+
/* eslint-disable require-jsdoc, valid-jsdoc */
|
|
65790
|
+
var MapShim = (function () {
|
|
65791
|
+
if (typeof Map !== 'undefined') {
|
|
65792
|
+
return Map;
|
|
65793
|
+
}
|
|
65794
|
+
/**
|
|
65795
|
+
* Returns index in provided array that matches the specified key.
|
|
65796
|
+
*
|
|
65797
|
+
* @param {Array<Array>} arr
|
|
65798
|
+
* @param {*} key
|
|
65799
|
+
* @returns {number}
|
|
65800
|
+
*/
|
|
65801
|
+
function getIndex(arr, key) {
|
|
65802
|
+
var result = -1;
|
|
65803
|
+
arr.some(function (entry, index) {
|
|
65804
|
+
if (entry[0] === key) {
|
|
65805
|
+
result = index;
|
|
65806
|
+
return true;
|
|
65807
|
+
}
|
|
65808
|
+
return false;
|
|
65809
|
+
});
|
|
65810
|
+
return result;
|
|
65811
|
+
}
|
|
65812
|
+
return /** @class */ (function () {
|
|
65813
|
+
function class_1() {
|
|
65814
|
+
this.__entries__ = [];
|
|
65815
|
+
}
|
|
65816
|
+
Object.defineProperty(class_1.prototype, "size", {
|
|
65817
|
+
/**
|
|
65818
|
+
* @returns {boolean}
|
|
65819
|
+
*/
|
|
65820
|
+
get: function () {
|
|
65821
|
+
return this.__entries__.length;
|
|
65822
|
+
},
|
|
65823
|
+
enumerable: true,
|
|
65824
|
+
configurable: true
|
|
65825
|
+
});
|
|
65826
|
+
/**
|
|
65827
|
+
* @param {*} key
|
|
65828
|
+
* @returns {*}
|
|
65829
|
+
*/
|
|
65830
|
+
class_1.prototype.get = function (key) {
|
|
65831
|
+
var index = getIndex(this.__entries__, key);
|
|
65832
|
+
var entry = this.__entries__[index];
|
|
65833
|
+
return entry && entry[1];
|
|
65834
|
+
};
|
|
65835
|
+
/**
|
|
65836
|
+
* @param {*} key
|
|
65837
|
+
* @param {*} value
|
|
65838
|
+
* @returns {void}
|
|
65839
|
+
*/
|
|
65840
|
+
class_1.prototype.set = function (key, value) {
|
|
65841
|
+
var index = getIndex(this.__entries__, key);
|
|
65842
|
+
if (~index) {
|
|
65843
|
+
this.__entries__[index][1] = value;
|
|
65844
|
+
}
|
|
65845
|
+
else {
|
|
65846
|
+
this.__entries__.push([key, value]);
|
|
65847
|
+
}
|
|
65848
|
+
};
|
|
65849
|
+
/**
|
|
65850
|
+
* @param {*} key
|
|
65851
|
+
* @returns {void}
|
|
65852
|
+
*/
|
|
65853
|
+
class_1.prototype.delete = function (key) {
|
|
65854
|
+
var entries = this.__entries__;
|
|
65855
|
+
var index = getIndex(entries, key);
|
|
65856
|
+
if (~index) {
|
|
65857
|
+
entries.splice(index, 1);
|
|
65858
|
+
}
|
|
65859
|
+
};
|
|
65860
|
+
/**
|
|
65861
|
+
* @param {*} key
|
|
65862
|
+
* @returns {void}
|
|
65863
|
+
*/
|
|
65864
|
+
class_1.prototype.has = function (key) {
|
|
65865
|
+
return !!~getIndex(this.__entries__, key);
|
|
65866
|
+
};
|
|
65867
|
+
/**
|
|
65868
|
+
* @returns {void}
|
|
65869
|
+
*/
|
|
65870
|
+
class_1.prototype.clear = function () {
|
|
65871
|
+
this.__entries__.splice(0);
|
|
65872
|
+
};
|
|
65873
|
+
/**
|
|
65874
|
+
* @param {Function} callback
|
|
65875
|
+
* @param {*} [ctx=null]
|
|
65876
|
+
* @returns {void}
|
|
65877
|
+
*/
|
|
65878
|
+
class_1.prototype.forEach = function (callback, ctx) {
|
|
65879
|
+
if (ctx === void 0) { ctx = null; }
|
|
65880
|
+
for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
|
|
65881
|
+
var entry = _a[_i];
|
|
65882
|
+
callback.call(ctx, entry[1], entry[0]);
|
|
65883
|
+
}
|
|
65884
|
+
};
|
|
65885
|
+
return class_1;
|
|
65886
|
+
}());
|
|
65887
65887
|
})();
|
|
65888
65888
|
|
|
65889
|
-
/**
|
|
65890
|
-
* Detects whether window and document objects are available in current environment.
|
|
65891
|
-
*/
|
|
65889
|
+
/**
|
|
65890
|
+
* Detects whether window and document objects are available in current environment.
|
|
65891
|
+
*/
|
|
65892
65892
|
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
|
|
65893
65893
|
|
|
65894
|
-
// Returns global object of a current environment.
|
|
65895
|
-
var global$1 = (function () {
|
|
65896
|
-
if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.Math === Math) {
|
|
65897
|
-
return __webpack_require__.g;
|
|
65898
|
-
}
|
|
65899
|
-
if (typeof self !== 'undefined' && self.Math === Math) {
|
|
65900
|
-
return self;
|
|
65901
|
-
}
|
|
65902
|
-
if (typeof window !== 'undefined' && window.Math === Math) {
|
|
65903
|
-
return window;
|
|
65904
|
-
}
|
|
65905
|
-
// eslint-disable-next-line no-new-func
|
|
65906
|
-
return Function('return this')();
|
|
65894
|
+
// Returns global object of a current environment.
|
|
65895
|
+
var global$1 = (function () {
|
|
65896
|
+
if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.Math === Math) {
|
|
65897
|
+
return __webpack_require__.g;
|
|
65898
|
+
}
|
|
65899
|
+
if (typeof self !== 'undefined' && self.Math === Math) {
|
|
65900
|
+
return self;
|
|
65901
|
+
}
|
|
65902
|
+
if (typeof window !== 'undefined' && window.Math === Math) {
|
|
65903
|
+
return window;
|
|
65904
|
+
}
|
|
65905
|
+
// eslint-disable-next-line no-new-func
|
|
65906
|
+
return Function('return this')();
|
|
65907
65907
|
})();
|
|
65908
65908
|
|
|
65909
|
-
/**
|
|
65910
|
-
* A shim for the requestAnimationFrame which falls back to the setTimeout if
|
|
65911
|
-
* first one is not supported.
|
|
65912
|
-
*
|
|
65913
|
-
* @returns {number} Requests' identifier.
|
|
65914
|
-
*/
|
|
65915
|
-
var requestAnimationFrame$1 = (function () {
|
|
65916
|
-
if (typeof requestAnimationFrame === 'function') {
|
|
65917
|
-
// It's required to use a bounded function because IE sometimes throws
|
|
65918
|
-
// an "Invalid calling object" error if rAF is invoked without the global
|
|
65919
|
-
// object on the left hand side.
|
|
65920
|
-
return requestAnimationFrame.bind(global$1);
|
|
65921
|
-
}
|
|
65922
|
-
return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
|
|
65909
|
+
/**
|
|
65910
|
+
* A shim for the requestAnimationFrame which falls back to the setTimeout if
|
|
65911
|
+
* first one is not supported.
|
|
65912
|
+
*
|
|
65913
|
+
* @returns {number} Requests' identifier.
|
|
65914
|
+
*/
|
|
65915
|
+
var requestAnimationFrame$1 = (function () {
|
|
65916
|
+
if (typeof requestAnimationFrame === 'function') {
|
|
65917
|
+
// It's required to use a bounded function because IE sometimes throws
|
|
65918
|
+
// an "Invalid calling object" error if rAF is invoked without the global
|
|
65919
|
+
// object on the left hand side.
|
|
65920
|
+
return requestAnimationFrame.bind(global$1);
|
|
65921
|
+
}
|
|
65922
|
+
return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
|
|
65923
65923
|
})();
|
|
65924
65924
|
|
|
65925
|
-
// Defines minimum timeout before adding a trailing call.
|
|
65926
|
-
var trailingTimeout = 2;
|
|
65927
|
-
/**
|
|
65928
|
-
* Creates a wrapper function which ensures that provided callback will be
|
|
65929
|
-
* invoked only once during the specified delay period.
|
|
65930
|
-
*
|
|
65931
|
-
* @param {Function} callback - Function to be invoked after the delay period.
|
|
65932
|
-
* @param {number} delay - Delay after which to invoke callback.
|
|
65933
|
-
* @returns {Function}
|
|
65934
|
-
*/
|
|
65935
|
-
function throttle (callback, delay) {
|
|
65936
|
-
var leadingCall = false, trailingCall = false, lastCallTime = 0;
|
|
65937
|
-
/**
|
|
65938
|
-
* Invokes the original callback function and schedules new invocation if
|
|
65939
|
-
* the "proxy" was called during current request.
|
|
65940
|
-
*
|
|
65941
|
-
* @returns {void}
|
|
65942
|
-
*/
|
|
65943
|
-
function resolvePending() {
|
|
65944
|
-
if (leadingCall) {
|
|
65945
|
-
leadingCall = false;
|
|
65946
|
-
callback();
|
|
65947
|
-
}
|
|
65948
|
-
if (trailingCall) {
|
|
65949
|
-
proxy();
|
|
65950
|
-
}
|
|
65951
|
-
}
|
|
65952
|
-
/**
|
|
65953
|
-
* Callback invoked after the specified delay. It will further postpone
|
|
65954
|
-
* invocation of the original function delegating it to the
|
|
65955
|
-
* requestAnimationFrame.
|
|
65956
|
-
*
|
|
65957
|
-
* @returns {void}
|
|
65958
|
-
*/
|
|
65959
|
-
function timeoutCallback() {
|
|
65960
|
-
requestAnimationFrame$1(resolvePending);
|
|
65961
|
-
}
|
|
65962
|
-
/**
|
|
65963
|
-
* Schedules invocation of the original function.
|
|
65964
|
-
*
|
|
65965
|
-
* @returns {void}
|
|
65966
|
-
*/
|
|
65967
|
-
function proxy() {
|
|
65968
|
-
var timeStamp = Date.now();
|
|
65969
|
-
if (leadingCall) {
|
|
65970
|
-
// Reject immediately following calls.
|
|
65971
|
-
if (timeStamp - lastCallTime < trailingTimeout) {
|
|
65972
|
-
return;
|
|
65973
|
-
}
|
|
65974
|
-
// Schedule new call to be in invoked when the pending one is resolved.
|
|
65975
|
-
// This is important for "transitions" which never actually start
|
|
65976
|
-
// immediately so there is a chance that we might miss one if change
|
|
65977
|
-
// happens amids the pending invocation.
|
|
65978
|
-
trailingCall = true;
|
|
65979
|
-
}
|
|
65980
|
-
else {
|
|
65981
|
-
leadingCall = true;
|
|
65982
|
-
trailingCall = false;
|
|
65983
|
-
setTimeout(timeoutCallback, delay);
|
|
65984
|
-
}
|
|
65985
|
-
lastCallTime = timeStamp;
|
|
65986
|
-
}
|
|
65987
|
-
return proxy;
|
|
65925
|
+
// Defines minimum timeout before adding a trailing call.
|
|
65926
|
+
var trailingTimeout = 2;
|
|
65927
|
+
/**
|
|
65928
|
+
* Creates a wrapper function which ensures that provided callback will be
|
|
65929
|
+
* invoked only once during the specified delay period.
|
|
65930
|
+
*
|
|
65931
|
+
* @param {Function} callback - Function to be invoked after the delay period.
|
|
65932
|
+
* @param {number} delay - Delay after which to invoke callback.
|
|
65933
|
+
* @returns {Function}
|
|
65934
|
+
*/
|
|
65935
|
+
function throttle (callback, delay) {
|
|
65936
|
+
var leadingCall = false, trailingCall = false, lastCallTime = 0;
|
|
65937
|
+
/**
|
|
65938
|
+
* Invokes the original callback function and schedules new invocation if
|
|
65939
|
+
* the "proxy" was called during current request.
|
|
65940
|
+
*
|
|
65941
|
+
* @returns {void}
|
|
65942
|
+
*/
|
|
65943
|
+
function resolvePending() {
|
|
65944
|
+
if (leadingCall) {
|
|
65945
|
+
leadingCall = false;
|
|
65946
|
+
callback();
|
|
65947
|
+
}
|
|
65948
|
+
if (trailingCall) {
|
|
65949
|
+
proxy();
|
|
65950
|
+
}
|
|
65951
|
+
}
|
|
65952
|
+
/**
|
|
65953
|
+
* Callback invoked after the specified delay. It will further postpone
|
|
65954
|
+
* invocation of the original function delegating it to the
|
|
65955
|
+
* requestAnimationFrame.
|
|
65956
|
+
*
|
|
65957
|
+
* @returns {void}
|
|
65958
|
+
*/
|
|
65959
|
+
function timeoutCallback() {
|
|
65960
|
+
requestAnimationFrame$1(resolvePending);
|
|
65961
|
+
}
|
|
65962
|
+
/**
|
|
65963
|
+
* Schedules invocation of the original function.
|
|
65964
|
+
*
|
|
65965
|
+
* @returns {void}
|
|
65966
|
+
*/
|
|
65967
|
+
function proxy() {
|
|
65968
|
+
var timeStamp = Date.now();
|
|
65969
|
+
if (leadingCall) {
|
|
65970
|
+
// Reject immediately following calls.
|
|
65971
|
+
if (timeStamp - lastCallTime < trailingTimeout) {
|
|
65972
|
+
return;
|
|
65973
|
+
}
|
|
65974
|
+
// Schedule new call to be in invoked when the pending one is resolved.
|
|
65975
|
+
// This is important for "transitions" which never actually start
|
|
65976
|
+
// immediately so there is a chance that we might miss one if change
|
|
65977
|
+
// happens amids the pending invocation.
|
|
65978
|
+
trailingCall = true;
|
|
65979
|
+
}
|
|
65980
|
+
else {
|
|
65981
|
+
leadingCall = true;
|
|
65982
|
+
trailingCall = false;
|
|
65983
|
+
setTimeout(timeoutCallback, delay);
|
|
65984
|
+
}
|
|
65985
|
+
lastCallTime = timeStamp;
|
|
65986
|
+
}
|
|
65987
|
+
return proxy;
|
|
65988
65988
|
}
|
|
65989
65989
|
|
|
65990
|
-
// Minimum delay before invoking the update of observers.
|
|
65991
|
-
var REFRESH_DELAY = 20;
|
|
65992
|
-
// A list of substrings of CSS properties used to find transition events that
|
|
65993
|
-
// might affect dimensions of observed elements.
|
|
65994
|
-
var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
|
|
65995
|
-
// Check if MutationObserver is available.
|
|
65996
|
-
var mutationObserverSupported = typeof MutationObserver !== 'undefined';
|
|
65997
|
-
/**
|
|
65998
|
-
* Singleton controller class which handles updates of ResizeObserver instances.
|
|
65999
|
-
*/
|
|
66000
|
-
var ResizeObserverController = /** @class */ (function () {
|
|
66001
|
-
/**
|
|
66002
|
-
* Creates a new instance of ResizeObserverController.
|
|
66003
|
-
*
|
|
66004
|
-
* @private
|
|
66005
|
-
*/
|
|
66006
|
-
function ResizeObserverController() {
|
|
66007
|
-
/**
|
|
66008
|
-
* Indicates whether DOM listeners have been added.
|
|
66009
|
-
*
|
|
66010
|
-
* @private {boolean}
|
|
66011
|
-
*/
|
|
66012
|
-
this.connected_ = false;
|
|
66013
|
-
/**
|
|
66014
|
-
* Tells that controller has subscribed for Mutation Events.
|
|
66015
|
-
*
|
|
66016
|
-
* @private {boolean}
|
|
66017
|
-
*/
|
|
66018
|
-
this.mutationEventsAdded_ = false;
|
|
66019
|
-
/**
|
|
66020
|
-
* Keeps reference to the instance of MutationObserver.
|
|
66021
|
-
*
|
|
66022
|
-
* @private {MutationObserver}
|
|
66023
|
-
*/
|
|
66024
|
-
this.mutationsObserver_ = null;
|
|
66025
|
-
/**
|
|
66026
|
-
* A list of connected observers.
|
|
66027
|
-
*
|
|
66028
|
-
* @private {Array<ResizeObserverSPI>}
|
|
66029
|
-
*/
|
|
66030
|
-
this.observers_ = [];
|
|
66031
|
-
this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
|
|
66032
|
-
this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
|
|
66033
|
-
}
|
|
66034
|
-
/**
|
|
66035
|
-
* Adds observer to observers list.
|
|
66036
|
-
*
|
|
66037
|
-
* @param {ResizeObserverSPI} observer - Observer to be added.
|
|
66038
|
-
* @returns {void}
|
|
66039
|
-
*/
|
|
66040
|
-
ResizeObserverController.prototype.addObserver = function (observer) {
|
|
66041
|
-
if (!~this.observers_.indexOf(observer)) {
|
|
66042
|
-
this.observers_.push(observer);
|
|
66043
|
-
}
|
|
66044
|
-
// Add listeners if they haven't been added yet.
|
|
66045
|
-
if (!this.connected_) {
|
|
66046
|
-
this.connect_();
|
|
66047
|
-
}
|
|
66048
|
-
};
|
|
66049
|
-
/**
|
|
66050
|
-
* Removes observer from observers list.
|
|
66051
|
-
*
|
|
66052
|
-
* @param {ResizeObserverSPI} observer - Observer to be removed.
|
|
66053
|
-
* @returns {void}
|
|
66054
|
-
*/
|
|
66055
|
-
ResizeObserverController.prototype.removeObserver = function (observer) {
|
|
66056
|
-
var observers = this.observers_;
|
|
66057
|
-
var index = observers.indexOf(observer);
|
|
66058
|
-
// Remove observer if it's present in registry.
|
|
66059
|
-
if (~index) {
|
|
66060
|
-
observers.splice(index, 1);
|
|
66061
|
-
}
|
|
66062
|
-
// Remove listeners if controller has no connected observers.
|
|
66063
|
-
if (!observers.length && this.connected_) {
|
|
66064
|
-
this.disconnect_();
|
|
66065
|
-
}
|
|
66066
|
-
};
|
|
66067
|
-
/**
|
|
66068
|
-
* Invokes the update of observers. It will continue running updates insofar
|
|
66069
|
-
* it detects changes.
|
|
66070
|
-
*
|
|
66071
|
-
* @returns {void}
|
|
66072
|
-
*/
|
|
66073
|
-
ResizeObserverController.prototype.refresh = function () {
|
|
66074
|
-
var changesDetected = this.updateObservers_();
|
|
66075
|
-
// Continue running updates if changes have been detected as there might
|
|
66076
|
-
// be future ones caused by CSS transitions.
|
|
66077
|
-
if (changesDetected) {
|
|
66078
|
-
this.refresh();
|
|
66079
|
-
}
|
|
66080
|
-
};
|
|
66081
|
-
/**
|
|
66082
|
-
* Updates every observer from observers list and notifies them of queued
|
|
66083
|
-
* entries.
|
|
66084
|
-
*
|
|
66085
|
-
* @private
|
|
66086
|
-
* @returns {boolean} Returns "true" if any observer has detected changes in
|
|
66087
|
-
* dimensions of it's elements.
|
|
66088
|
-
*/
|
|
66089
|
-
ResizeObserverController.prototype.updateObservers_ = function () {
|
|
66090
|
-
// Collect observers that have active observations.
|
|
66091
|
-
var activeObservers = this.observers_.filter(function (observer) {
|
|
66092
|
-
return observer.gatherActive(), observer.hasActive();
|
|
66093
|
-
});
|
|
66094
|
-
// Deliver notifications in a separate cycle in order to avoid any
|
|
66095
|
-
// collisions between observers, e.g. when multiple instances of
|
|
66096
|
-
// ResizeObserver are tracking the same element and the callback of one
|
|
66097
|
-
// of them changes content dimensions of the observed target. Sometimes
|
|
66098
|
-
// this may result in notifications being blocked for the rest of observers.
|
|
66099
|
-
activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
|
|
66100
|
-
return activeObservers.length > 0;
|
|
66101
|
-
};
|
|
66102
|
-
/**
|
|
66103
|
-
* Initializes DOM listeners.
|
|
66104
|
-
*
|
|
66105
|
-
* @private
|
|
66106
|
-
* @returns {void}
|
|
66107
|
-
*/
|
|
66108
|
-
ResizeObserverController.prototype.connect_ = function () {
|
|
66109
|
-
// Do nothing if running in a non-browser environment or if listeners
|
|
66110
|
-
// have been already added.
|
|
66111
|
-
if (!isBrowser || this.connected_) {
|
|
66112
|
-
return;
|
|
66113
|
-
}
|
|
66114
|
-
// Subscription to the "Transitionend" event is used as a workaround for
|
|
66115
|
-
// delayed transitions. This way it's possible to capture at least the
|
|
66116
|
-
// final state of an element.
|
|
66117
|
-
document.addEventListener('transitionend', this.onTransitionEnd_);
|
|
66118
|
-
window.addEventListener('resize', this.refresh);
|
|
66119
|
-
if (mutationObserverSupported) {
|
|
66120
|
-
this.mutationsObserver_ = new MutationObserver(this.refresh);
|
|
66121
|
-
this.mutationsObserver_.observe(document, {
|
|
66122
|
-
attributes: true,
|
|
66123
|
-
childList: true,
|
|
66124
|
-
characterData: true,
|
|
66125
|
-
subtree: true
|
|
66126
|
-
});
|
|
66127
|
-
}
|
|
66128
|
-
else {
|
|
66129
|
-
document.addEventListener('DOMSubtreeModified', this.refresh);
|
|
66130
|
-
this.mutationEventsAdded_ = true;
|
|
66131
|
-
}
|
|
66132
|
-
this.connected_ = true;
|
|
66133
|
-
};
|
|
66134
|
-
/**
|
|
66135
|
-
* Removes DOM listeners.
|
|
66136
|
-
*
|
|
66137
|
-
* @private
|
|
66138
|
-
* @returns {void}
|
|
66139
|
-
*/
|
|
66140
|
-
ResizeObserverController.prototype.disconnect_ = function () {
|
|
66141
|
-
// Do nothing if running in a non-browser environment or if listeners
|
|
66142
|
-
// have been already removed.
|
|
66143
|
-
if (!isBrowser || !this.connected_) {
|
|
66144
|
-
return;
|
|
66145
|
-
}
|
|
66146
|
-
document.removeEventListener('transitionend', this.onTransitionEnd_);
|
|
66147
|
-
window.removeEventListener('resize', this.refresh);
|
|
66148
|
-
if (this.mutationsObserver_) {
|
|
66149
|
-
this.mutationsObserver_.disconnect();
|
|
66150
|
-
}
|
|
66151
|
-
if (this.mutationEventsAdded_) {
|
|
66152
|
-
document.removeEventListener('DOMSubtreeModified', this.refresh);
|
|
66153
|
-
}
|
|
66154
|
-
this.mutationsObserver_ = null;
|
|
66155
|
-
this.mutationEventsAdded_ = false;
|
|
66156
|
-
this.connected_ = false;
|
|
66157
|
-
};
|
|
66158
|
-
/**
|
|
66159
|
-
* "Transitionend" event handler.
|
|
66160
|
-
*
|
|
66161
|
-
* @private
|
|
66162
|
-
* @param {TransitionEvent} event
|
|
66163
|
-
* @returns {void}
|
|
66164
|
-
*/
|
|
66165
|
-
ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
|
|
66166
|
-
var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
|
|
66167
|
-
// Detect whether transition may affect dimensions of an element.
|
|
66168
|
-
var isReflowProperty = transitionKeys.some(function (key) {
|
|
66169
|
-
return !!~propertyName.indexOf(key);
|
|
66170
|
-
});
|
|
66171
|
-
if (isReflowProperty) {
|
|
66172
|
-
this.refresh();
|
|
66173
|
-
}
|
|
66174
|
-
};
|
|
66175
|
-
/**
|
|
66176
|
-
* Returns instance of the ResizeObserverController.
|
|
66177
|
-
*
|
|
66178
|
-
* @returns {ResizeObserverController}
|
|
66179
|
-
*/
|
|
66180
|
-
ResizeObserverController.getInstance = function () {
|
|
66181
|
-
if (!this.instance_) {
|
|
66182
|
-
this.instance_ = new ResizeObserverController();
|
|
66183
|
-
}
|
|
66184
|
-
return this.instance_;
|
|
66185
|
-
};
|
|
66186
|
-
/**
|
|
66187
|
-
* Holds reference to the controller's instance.
|
|
66188
|
-
*
|
|
66189
|
-
* @private {ResizeObserverController}
|
|
66190
|
-
*/
|
|
66191
|
-
ResizeObserverController.instance_ = null;
|
|
66192
|
-
return ResizeObserverController;
|
|
65990
|
+
// Minimum delay before invoking the update of observers.
|
|
65991
|
+
var REFRESH_DELAY = 20;
|
|
65992
|
+
// A list of substrings of CSS properties used to find transition events that
|
|
65993
|
+
// might affect dimensions of observed elements.
|
|
65994
|
+
var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
|
|
65995
|
+
// Check if MutationObserver is available.
|
|
65996
|
+
var mutationObserverSupported = typeof MutationObserver !== 'undefined';
|
|
65997
|
+
/**
|
|
65998
|
+
* Singleton controller class which handles updates of ResizeObserver instances.
|
|
65999
|
+
*/
|
|
66000
|
+
var ResizeObserverController = /** @class */ (function () {
|
|
66001
|
+
/**
|
|
66002
|
+
* Creates a new instance of ResizeObserverController.
|
|
66003
|
+
*
|
|
66004
|
+
* @private
|
|
66005
|
+
*/
|
|
66006
|
+
function ResizeObserverController() {
|
|
66007
|
+
/**
|
|
66008
|
+
* Indicates whether DOM listeners have been added.
|
|
66009
|
+
*
|
|
66010
|
+
* @private {boolean}
|
|
66011
|
+
*/
|
|
66012
|
+
this.connected_ = false;
|
|
66013
|
+
/**
|
|
66014
|
+
* Tells that controller has subscribed for Mutation Events.
|
|
66015
|
+
*
|
|
66016
|
+
* @private {boolean}
|
|
66017
|
+
*/
|
|
66018
|
+
this.mutationEventsAdded_ = false;
|
|
66019
|
+
/**
|
|
66020
|
+
* Keeps reference to the instance of MutationObserver.
|
|
66021
|
+
*
|
|
66022
|
+
* @private {MutationObserver}
|
|
66023
|
+
*/
|
|
66024
|
+
this.mutationsObserver_ = null;
|
|
66025
|
+
/**
|
|
66026
|
+
* A list of connected observers.
|
|
66027
|
+
*
|
|
66028
|
+
* @private {Array<ResizeObserverSPI>}
|
|
66029
|
+
*/
|
|
66030
|
+
this.observers_ = [];
|
|
66031
|
+
this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
|
|
66032
|
+
this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
|
|
66033
|
+
}
|
|
66034
|
+
/**
|
|
66035
|
+
* Adds observer to observers list.
|
|
66036
|
+
*
|
|
66037
|
+
* @param {ResizeObserverSPI} observer - Observer to be added.
|
|
66038
|
+
* @returns {void}
|
|
66039
|
+
*/
|
|
66040
|
+
ResizeObserverController.prototype.addObserver = function (observer) {
|
|
66041
|
+
if (!~this.observers_.indexOf(observer)) {
|
|
66042
|
+
this.observers_.push(observer);
|
|
66043
|
+
}
|
|
66044
|
+
// Add listeners if they haven't been added yet.
|
|
66045
|
+
if (!this.connected_) {
|
|
66046
|
+
this.connect_();
|
|
66047
|
+
}
|
|
66048
|
+
};
|
|
66049
|
+
/**
|
|
66050
|
+
* Removes observer from observers list.
|
|
66051
|
+
*
|
|
66052
|
+
* @param {ResizeObserverSPI} observer - Observer to be removed.
|
|
66053
|
+
* @returns {void}
|
|
66054
|
+
*/
|
|
66055
|
+
ResizeObserverController.prototype.removeObserver = function (observer) {
|
|
66056
|
+
var observers = this.observers_;
|
|
66057
|
+
var index = observers.indexOf(observer);
|
|
66058
|
+
// Remove observer if it's present in registry.
|
|
66059
|
+
if (~index) {
|
|
66060
|
+
observers.splice(index, 1);
|
|
66061
|
+
}
|
|
66062
|
+
// Remove listeners if controller has no connected observers.
|
|
66063
|
+
if (!observers.length && this.connected_) {
|
|
66064
|
+
this.disconnect_();
|
|
66065
|
+
}
|
|
66066
|
+
};
|
|
66067
|
+
/**
|
|
66068
|
+
* Invokes the update of observers. It will continue running updates insofar
|
|
66069
|
+
* it detects changes.
|
|
66070
|
+
*
|
|
66071
|
+
* @returns {void}
|
|
66072
|
+
*/
|
|
66073
|
+
ResizeObserverController.prototype.refresh = function () {
|
|
66074
|
+
var changesDetected = this.updateObservers_();
|
|
66075
|
+
// Continue running updates if changes have been detected as there might
|
|
66076
|
+
// be future ones caused by CSS transitions.
|
|
66077
|
+
if (changesDetected) {
|
|
66078
|
+
this.refresh();
|
|
66079
|
+
}
|
|
66080
|
+
};
|
|
66081
|
+
/**
|
|
66082
|
+
* Updates every observer from observers list and notifies them of queued
|
|
66083
|
+
* entries.
|
|
66084
|
+
*
|
|
66085
|
+
* @private
|
|
66086
|
+
* @returns {boolean} Returns "true" if any observer has detected changes in
|
|
66087
|
+
* dimensions of it's elements.
|
|
66088
|
+
*/
|
|
66089
|
+
ResizeObserverController.prototype.updateObservers_ = function () {
|
|
66090
|
+
// Collect observers that have active observations.
|
|
66091
|
+
var activeObservers = this.observers_.filter(function (observer) {
|
|
66092
|
+
return observer.gatherActive(), observer.hasActive();
|
|
66093
|
+
});
|
|
66094
|
+
// Deliver notifications in a separate cycle in order to avoid any
|
|
66095
|
+
// collisions between observers, e.g. when multiple instances of
|
|
66096
|
+
// ResizeObserver are tracking the same element and the callback of one
|
|
66097
|
+
// of them changes content dimensions of the observed target. Sometimes
|
|
66098
|
+
// this may result in notifications being blocked for the rest of observers.
|
|
66099
|
+
activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
|
|
66100
|
+
return activeObservers.length > 0;
|
|
66101
|
+
};
|
|
66102
|
+
/**
|
|
66103
|
+
* Initializes DOM listeners.
|
|
66104
|
+
*
|
|
66105
|
+
* @private
|
|
66106
|
+
* @returns {void}
|
|
66107
|
+
*/
|
|
66108
|
+
ResizeObserverController.prototype.connect_ = function () {
|
|
66109
|
+
// Do nothing if running in a non-browser environment or if listeners
|
|
66110
|
+
// have been already added.
|
|
66111
|
+
if (!isBrowser || this.connected_) {
|
|
66112
|
+
return;
|
|
66113
|
+
}
|
|
66114
|
+
// Subscription to the "Transitionend" event is used as a workaround for
|
|
66115
|
+
// delayed transitions. This way it's possible to capture at least the
|
|
66116
|
+
// final state of an element.
|
|
66117
|
+
document.addEventListener('transitionend', this.onTransitionEnd_);
|
|
66118
|
+
window.addEventListener('resize', this.refresh);
|
|
66119
|
+
if (mutationObserverSupported) {
|
|
66120
|
+
this.mutationsObserver_ = new MutationObserver(this.refresh);
|
|
66121
|
+
this.mutationsObserver_.observe(document, {
|
|
66122
|
+
attributes: true,
|
|
66123
|
+
childList: true,
|
|
66124
|
+
characterData: true,
|
|
66125
|
+
subtree: true
|
|
66126
|
+
});
|
|
66127
|
+
}
|
|
66128
|
+
else {
|
|
66129
|
+
document.addEventListener('DOMSubtreeModified', this.refresh);
|
|
66130
|
+
this.mutationEventsAdded_ = true;
|
|
66131
|
+
}
|
|
66132
|
+
this.connected_ = true;
|
|
66133
|
+
};
|
|
66134
|
+
/**
|
|
66135
|
+
* Removes DOM listeners.
|
|
66136
|
+
*
|
|
66137
|
+
* @private
|
|
66138
|
+
* @returns {void}
|
|
66139
|
+
*/
|
|
66140
|
+
ResizeObserverController.prototype.disconnect_ = function () {
|
|
66141
|
+
// Do nothing if running in a non-browser environment or if listeners
|
|
66142
|
+
// have been already removed.
|
|
66143
|
+
if (!isBrowser || !this.connected_) {
|
|
66144
|
+
return;
|
|
66145
|
+
}
|
|
66146
|
+
document.removeEventListener('transitionend', this.onTransitionEnd_);
|
|
66147
|
+
window.removeEventListener('resize', this.refresh);
|
|
66148
|
+
if (this.mutationsObserver_) {
|
|
66149
|
+
this.mutationsObserver_.disconnect();
|
|
66150
|
+
}
|
|
66151
|
+
if (this.mutationEventsAdded_) {
|
|
66152
|
+
document.removeEventListener('DOMSubtreeModified', this.refresh);
|
|
66153
|
+
}
|
|
66154
|
+
this.mutationsObserver_ = null;
|
|
66155
|
+
this.mutationEventsAdded_ = false;
|
|
66156
|
+
this.connected_ = false;
|
|
66157
|
+
};
|
|
66158
|
+
/**
|
|
66159
|
+
* "Transitionend" event handler.
|
|
66160
|
+
*
|
|
66161
|
+
* @private
|
|
66162
|
+
* @param {TransitionEvent} event
|
|
66163
|
+
* @returns {void}
|
|
66164
|
+
*/
|
|
66165
|
+
ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
|
|
66166
|
+
var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
|
|
66167
|
+
// Detect whether transition may affect dimensions of an element.
|
|
66168
|
+
var isReflowProperty = transitionKeys.some(function (key) {
|
|
66169
|
+
return !!~propertyName.indexOf(key);
|
|
66170
|
+
});
|
|
66171
|
+
if (isReflowProperty) {
|
|
66172
|
+
this.refresh();
|
|
66173
|
+
}
|
|
66174
|
+
};
|
|
66175
|
+
/**
|
|
66176
|
+
* Returns instance of the ResizeObserverController.
|
|
66177
|
+
*
|
|
66178
|
+
* @returns {ResizeObserverController}
|
|
66179
|
+
*/
|
|
66180
|
+
ResizeObserverController.getInstance = function () {
|
|
66181
|
+
if (!this.instance_) {
|
|
66182
|
+
this.instance_ = new ResizeObserverController();
|
|
66183
|
+
}
|
|
66184
|
+
return this.instance_;
|
|
66185
|
+
};
|
|
66186
|
+
/**
|
|
66187
|
+
* Holds reference to the controller's instance.
|
|
66188
|
+
*
|
|
66189
|
+
* @private {ResizeObserverController}
|
|
66190
|
+
*/
|
|
66191
|
+
ResizeObserverController.instance_ = null;
|
|
66192
|
+
return ResizeObserverController;
|
|
66193
66193
|
}());
|
|
66194
66194
|
|
|
66195
|
-
/**
|
|
66196
|
-
* Defines non-writable/enumerable properties of the provided target object.
|
|
66197
|
-
*
|
|
66198
|
-
* @param {Object} target - Object for which to define properties.
|
|
66199
|
-
* @param {Object} props - Properties to be defined.
|
|
66200
|
-
* @returns {Object} Target object.
|
|
66201
|
-
*/
|
|
66202
|
-
var defineConfigurable = (function (target, props) {
|
|
66203
|
-
for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
|
|
66204
|
-
var key = _a[_i];
|
|
66205
|
-
Object.defineProperty(target, key, {
|
|
66206
|
-
value: props[key],
|
|
66207
|
-
enumerable: false,
|
|
66208
|
-
writable: false,
|
|
66209
|
-
configurable: true
|
|
66210
|
-
});
|
|
66211
|
-
}
|
|
66212
|
-
return target;
|
|
66195
|
+
/**
|
|
66196
|
+
* Defines non-writable/enumerable properties of the provided target object.
|
|
66197
|
+
*
|
|
66198
|
+
* @param {Object} target - Object for which to define properties.
|
|
66199
|
+
* @param {Object} props - Properties to be defined.
|
|
66200
|
+
* @returns {Object} Target object.
|
|
66201
|
+
*/
|
|
66202
|
+
var defineConfigurable = (function (target, props) {
|
|
66203
|
+
for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
|
|
66204
|
+
var key = _a[_i];
|
|
66205
|
+
Object.defineProperty(target, key, {
|
|
66206
|
+
value: props[key],
|
|
66207
|
+
enumerable: false,
|
|
66208
|
+
writable: false,
|
|
66209
|
+
configurable: true
|
|
66210
|
+
});
|
|
66211
|
+
}
|
|
66212
|
+
return target;
|
|
66213
66213
|
});
|
|
66214
66214
|
|
|
66215
|
-
/**
|
|
66216
|
-
* Returns the global object associated with provided element.
|
|
66217
|
-
*
|
|
66218
|
-
* @param {Object} target
|
|
66219
|
-
* @returns {Object}
|
|
66220
|
-
*/
|
|
66221
|
-
var getWindowOf = (function (target) {
|
|
66222
|
-
// Assume that the element is an instance of Node, which means that it
|
|
66223
|
-
// has the "ownerDocument" property from which we can retrieve a
|
|
66224
|
-
// corresponding global object.
|
|
66225
|
-
var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
|
|
66226
|
-
// Return the local global object if it's not possible extract one from
|
|
66227
|
-
// provided element.
|
|
66228
|
-
return ownerGlobal || global$1;
|
|
66215
|
+
/**
|
|
66216
|
+
* Returns the global object associated with provided element.
|
|
66217
|
+
*
|
|
66218
|
+
* @param {Object} target
|
|
66219
|
+
* @returns {Object}
|
|
66220
|
+
*/
|
|
66221
|
+
var getWindowOf = (function (target) {
|
|
66222
|
+
// Assume that the element is an instance of Node, which means that it
|
|
66223
|
+
// has the "ownerDocument" property from which we can retrieve a
|
|
66224
|
+
// corresponding global object.
|
|
66225
|
+
var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
|
|
66226
|
+
// Return the local global object if it's not possible extract one from
|
|
66227
|
+
// provided element.
|
|
66228
|
+
return ownerGlobal || global$1;
|
|
66229
66229
|
});
|
|
66230
66230
|
|
|
66231
|
-
// Placeholder of an empty content rectangle.
|
|
66232
|
-
var emptyRect = createRectInit(0, 0, 0, 0);
|
|
66233
|
-
/**
|
|
66234
|
-
* Converts provided string to a number.
|
|
66235
|
-
*
|
|
66236
|
-
* @param {number|string} value
|
|
66237
|
-
* @returns {number}
|
|
66238
|
-
*/
|
|
66239
|
-
function toFloat(value) {
|
|
66240
|
-
return parseFloat(value) || 0;
|
|
66241
|
-
}
|
|
66242
|
-
/**
|
|
66243
|
-
* Extracts borders size from provided styles.
|
|
66244
|
-
*
|
|
66245
|
-
* @param {CSSStyleDeclaration} styles
|
|
66246
|
-
* @param {...string} positions - Borders positions (top, right, ...)
|
|
66247
|
-
* @returns {number}
|
|
66248
|
-
*/
|
|
66249
|
-
function getBordersSize(styles) {
|
|
66250
|
-
var positions = [];
|
|
66251
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
66252
|
-
positions[_i - 1] = arguments[_i];
|
|
66253
|
-
}
|
|
66254
|
-
return positions.reduce(function (size, position) {
|
|
66255
|
-
var value = styles['border-' + position + '-width'];
|
|
66256
|
-
return size + toFloat(value);
|
|
66257
|
-
}, 0);
|
|
66258
|
-
}
|
|
66259
|
-
/**
|
|
66260
|
-
* Extracts paddings sizes from provided styles.
|
|
66261
|
-
*
|
|
66262
|
-
* @param {CSSStyleDeclaration} styles
|
|
66263
|
-
* @returns {Object} Paddings box.
|
|
66264
|
-
*/
|
|
66265
|
-
function getPaddings(styles) {
|
|
66266
|
-
var positions = ['top', 'right', 'bottom', 'left'];
|
|
66267
|
-
var paddings = {};
|
|
66268
|
-
for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
|
|
66269
|
-
var position = positions_1[_i];
|
|
66270
|
-
var value = styles['padding-' + position];
|
|
66271
|
-
paddings[position] = toFloat(value);
|
|
66272
|
-
}
|
|
66273
|
-
return paddings;
|
|
66274
|
-
}
|
|
66275
|
-
/**
|
|
66276
|
-
* Calculates content rectangle of provided SVG element.
|
|
66277
|
-
*
|
|
66278
|
-
* @param {SVGGraphicsElement} target - Element content rectangle of which needs
|
|
66279
|
-
* to be calculated.
|
|
66280
|
-
* @returns {DOMRectInit}
|
|
66281
|
-
*/
|
|
66282
|
-
function getSVGContentRect(target) {
|
|
66283
|
-
var bbox = target.getBBox();
|
|
66284
|
-
return createRectInit(0, 0, bbox.width, bbox.height);
|
|
66285
|
-
}
|
|
66286
|
-
/**
|
|
66287
|
-
* Calculates content rectangle of provided HTMLElement.
|
|
66288
|
-
*
|
|
66289
|
-
* @param {HTMLElement} target - Element for which to calculate the content rectangle.
|
|
66290
|
-
* @returns {DOMRectInit}
|
|
66291
|
-
*/
|
|
66292
|
-
function getHTMLElementContentRect(target) {
|
|
66293
|
-
// Client width & height properties can't be
|
|
66294
|
-
// used exclusively as they provide rounded values.
|
|
66295
|
-
var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
|
|
66296
|
-
// By this condition we can catch all non-replaced inline, hidden and
|
|
66297
|
-
// detached elements. Though elements with width & height properties less
|
|
66298
|
-
// than 0.5 will be discarded as well.
|
|
66299
|
-
//
|
|
66300
|
-
// Without it we would need to implement separate methods for each of
|
|
66301
|
-
// those cases and it's not possible to perform a precise and performance
|
|
66302
|
-
// effective test for hidden elements. E.g. even jQuery's ':visible' filter
|
|
66303
|
-
// gives wrong results for elements with width & height less than 0.5.
|
|
66304
|
-
if (!clientWidth && !clientHeight) {
|
|
66305
|
-
return emptyRect;
|
|
66306
|
-
}
|
|
66307
|
-
var styles = getWindowOf(target).getComputedStyle(target);
|
|
66308
|
-
var paddings = getPaddings(styles);
|
|
66309
|
-
var horizPad = paddings.left + paddings.right;
|
|
66310
|
-
var vertPad = paddings.top + paddings.bottom;
|
|
66311
|
-
// Computed styles of width & height are being used because they are the
|
|
66312
|
-
// only dimensions available to JS that contain non-rounded values. It could
|
|
66313
|
-
// be possible to utilize the getBoundingClientRect if only it's data wasn't
|
|
66314
|
-
// affected by CSS transformations let alone paddings, borders and scroll bars.
|
|
66315
|
-
var width = toFloat(styles.width), height = toFloat(styles.height);
|
|
66316
|
-
// Width & height include paddings and borders when the 'border-box' box
|
|
66317
|
-
// model is applied (except for IE).
|
|
66318
|
-
if (styles.boxSizing === 'border-box') {
|
|
66319
|
-
// Following conditions are required to handle Internet Explorer which
|
|
66320
|
-
// doesn't include paddings and borders to computed CSS dimensions.
|
|
66321
|
-
//
|
|
66322
|
-
// We can say that if CSS dimensions + paddings are equal to the "client"
|
|
66323
|
-
// properties then it's either IE, and thus we don't need to subtract
|
|
66324
|
-
// anything, or an element merely doesn't have paddings/borders styles.
|
|
66325
|
-
if (Math.round(width + horizPad) !== clientWidth) {
|
|
66326
|
-
width -= getBordersSize(styles, 'left', 'right') + horizPad;
|
|
66327
|
-
}
|
|
66328
|
-
if (Math.round(height + vertPad) !== clientHeight) {
|
|
66329
|
-
height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
|
|
66330
|
-
}
|
|
66331
|
-
}
|
|
66332
|
-
// Following steps can't be applied to the document's root element as its
|
|
66333
|
-
// client[Width/Height] properties represent viewport area of the window.
|
|
66334
|
-
// Besides, it's as well not necessary as the <html> itself neither has
|
|
66335
|
-
// rendered scroll bars nor it can be clipped.
|
|
66336
|
-
if (!isDocumentElement(target)) {
|
|
66337
|
-
// In some browsers (only in Firefox, actually) CSS width & height
|
|
66338
|
-
// include scroll bars size which can be removed at this step as scroll
|
|
66339
|
-
// bars are the only difference between rounded dimensions + paddings
|
|
66340
|
-
// and "client" properties, though that is not always true in Chrome.
|
|
66341
|
-
var vertScrollbar = Math.round(width + horizPad) - clientWidth;
|
|
66342
|
-
var horizScrollbar = Math.round(height + vertPad) - clientHeight;
|
|
66343
|
-
// Chrome has a rather weird rounding of "client" properties.
|
|
66344
|
-
// E.g. for an element with content width of 314.2px it sometimes gives
|
|
66345
|
-
// the client width of 315px and for the width of 314.7px it may give
|
|
66346
|
-
// 314px. And it doesn't happen all the time. So just ignore this delta
|
|
66347
|
-
// as a non-relevant.
|
|
66348
|
-
if (Math.abs(vertScrollbar) !== 1) {
|
|
66349
|
-
width -= vertScrollbar;
|
|
66350
|
-
}
|
|
66351
|
-
if (Math.abs(horizScrollbar) !== 1) {
|
|
66352
|
-
height -= horizScrollbar;
|
|
66353
|
-
}
|
|
66354
|
-
}
|
|
66355
|
-
return createRectInit(paddings.left, paddings.top, width, height);
|
|
66356
|
-
}
|
|
66357
|
-
/**
|
|
66358
|
-
* Checks whether provided element is an instance of the SVGGraphicsElement.
|
|
66359
|
-
*
|
|
66360
|
-
* @param {Element} target - Element to be checked.
|
|
66361
|
-
* @returns {boolean}
|
|
66362
|
-
*/
|
|
66363
|
-
var isSVGGraphicsElement = (function () {
|
|
66364
|
-
// Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
|
|
66365
|
-
// interface.
|
|
66366
|
-
if (typeof SVGGraphicsElement !== 'undefined') {
|
|
66367
|
-
return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
|
|
66368
|
-
}
|
|
66369
|
-
// If it's so, then check that element is at least an instance of the
|
|
66370
|
-
// SVGElement and that it has the "getBBox" method.
|
|
66371
|
-
// eslint-disable-next-line no-extra-parens
|
|
66372
|
-
return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
|
|
66373
|
-
typeof target.getBBox === 'function'); };
|
|
66374
|
-
})();
|
|
66375
|
-
/**
|
|
66376
|
-
* Checks whether provided element is a document element (<html>).
|
|
66377
|
-
*
|
|
66378
|
-
* @param {Element} target - Element to be checked.
|
|
66379
|
-
* @returns {boolean}
|
|
66380
|
-
*/
|
|
66381
|
-
function isDocumentElement(target) {
|
|
66382
|
-
return target === getWindowOf(target).document.documentElement;
|
|
66383
|
-
}
|
|
66384
|
-
/**
|
|
66385
|
-
* Calculates an appropriate content rectangle for provided html or svg element.
|
|
66386
|
-
*
|
|
66387
|
-
* @param {Element} target - Element content rectangle of which needs to be calculated.
|
|
66388
|
-
* @returns {DOMRectInit}
|
|
66389
|
-
*/
|
|
66390
|
-
function getContentRect(target) {
|
|
66391
|
-
if (!isBrowser) {
|
|
66392
|
-
return emptyRect;
|
|
66393
|
-
}
|
|
66394
|
-
if (isSVGGraphicsElement(target)) {
|
|
66395
|
-
return getSVGContentRect(target);
|
|
66396
|
-
}
|
|
66397
|
-
return getHTMLElementContentRect(target);
|
|
66398
|
-
}
|
|
66399
|
-
/**
|
|
66400
|
-
* Creates rectangle with an interface of the DOMRectReadOnly.
|
|
66401
|
-
* Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
|
|
66402
|
-
*
|
|
66403
|
-
* @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
|
|
66404
|
-
* @returns {DOMRectReadOnly}
|
|
66405
|
-
*/
|
|
66406
|
-
function createReadOnlyRect(_a) {
|
|
66407
|
-
var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
|
66408
|
-
// If DOMRectReadOnly is available use it as a prototype for the rectangle.
|
|
66409
|
-
var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
|
|
66410
|
-
var rect = Object.create(Constr.prototype);
|
|
66411
|
-
// Rectangle's properties are not writable and non-enumerable.
|
|
66412
|
-
defineConfigurable(rect, {
|
|
66413
|
-
x: x, y: y, width: width, height: height,
|
|
66414
|
-
top: y,
|
|
66415
|
-
right: x + width,
|
|
66416
|
-
bottom: height + y,
|
|
66417
|
-
left: x
|
|
66418
|
-
});
|
|
66419
|
-
return rect;
|
|
66420
|
-
}
|
|
66421
|
-
/**
|
|
66422
|
-
* Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
|
|
66423
|
-
* Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
|
|
66424
|
-
*
|
|
66425
|
-
* @param {number} x - X coordinate.
|
|
66426
|
-
* @param {number} y - Y coordinate.
|
|
66427
|
-
* @param {number} width - Rectangle's width.
|
|
66428
|
-
* @param {number} height - Rectangle's height.
|
|
66429
|
-
* @returns {DOMRectInit}
|
|
66430
|
-
*/
|
|
66431
|
-
function createRectInit(x, y, width, height) {
|
|
66432
|
-
return { x: x, y: y, width: width, height: height };
|
|
66231
|
+
// Placeholder of an empty content rectangle.
|
|
66232
|
+
var emptyRect = createRectInit(0, 0, 0, 0);
|
|
66233
|
+
/**
|
|
66234
|
+
* Converts provided string to a number.
|
|
66235
|
+
*
|
|
66236
|
+
* @param {number|string} value
|
|
66237
|
+
* @returns {number}
|
|
66238
|
+
*/
|
|
66239
|
+
function toFloat(value) {
|
|
66240
|
+
return parseFloat(value) || 0;
|
|
66241
|
+
}
|
|
66242
|
+
/**
|
|
66243
|
+
* Extracts borders size from provided styles.
|
|
66244
|
+
*
|
|
66245
|
+
* @param {CSSStyleDeclaration} styles
|
|
66246
|
+
* @param {...string} positions - Borders positions (top, right, ...)
|
|
66247
|
+
* @returns {number}
|
|
66248
|
+
*/
|
|
66249
|
+
function getBordersSize(styles) {
|
|
66250
|
+
var positions = [];
|
|
66251
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
66252
|
+
positions[_i - 1] = arguments[_i];
|
|
66253
|
+
}
|
|
66254
|
+
return positions.reduce(function (size, position) {
|
|
66255
|
+
var value = styles['border-' + position + '-width'];
|
|
66256
|
+
return size + toFloat(value);
|
|
66257
|
+
}, 0);
|
|
66258
|
+
}
|
|
66259
|
+
/**
|
|
66260
|
+
* Extracts paddings sizes from provided styles.
|
|
66261
|
+
*
|
|
66262
|
+
* @param {CSSStyleDeclaration} styles
|
|
66263
|
+
* @returns {Object} Paddings box.
|
|
66264
|
+
*/
|
|
66265
|
+
function getPaddings(styles) {
|
|
66266
|
+
var positions = ['top', 'right', 'bottom', 'left'];
|
|
66267
|
+
var paddings = {};
|
|
66268
|
+
for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
|
|
66269
|
+
var position = positions_1[_i];
|
|
66270
|
+
var value = styles['padding-' + position];
|
|
66271
|
+
paddings[position] = toFloat(value);
|
|
66272
|
+
}
|
|
66273
|
+
return paddings;
|
|
66274
|
+
}
|
|
66275
|
+
/**
|
|
66276
|
+
* Calculates content rectangle of provided SVG element.
|
|
66277
|
+
*
|
|
66278
|
+
* @param {SVGGraphicsElement} target - Element content rectangle of which needs
|
|
66279
|
+
* to be calculated.
|
|
66280
|
+
* @returns {DOMRectInit}
|
|
66281
|
+
*/
|
|
66282
|
+
function getSVGContentRect(target) {
|
|
66283
|
+
var bbox = target.getBBox();
|
|
66284
|
+
return createRectInit(0, 0, bbox.width, bbox.height);
|
|
66285
|
+
}
|
|
66286
|
+
/**
|
|
66287
|
+
* Calculates content rectangle of provided HTMLElement.
|
|
66288
|
+
*
|
|
66289
|
+
* @param {HTMLElement} target - Element for which to calculate the content rectangle.
|
|
66290
|
+
* @returns {DOMRectInit}
|
|
66291
|
+
*/
|
|
66292
|
+
function getHTMLElementContentRect(target) {
|
|
66293
|
+
// Client width & height properties can't be
|
|
66294
|
+
// used exclusively as they provide rounded values.
|
|
66295
|
+
var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
|
|
66296
|
+
// By this condition we can catch all non-replaced inline, hidden and
|
|
66297
|
+
// detached elements. Though elements with width & height properties less
|
|
66298
|
+
// than 0.5 will be discarded as well.
|
|
66299
|
+
//
|
|
66300
|
+
// Without it we would need to implement separate methods for each of
|
|
66301
|
+
// those cases and it's not possible to perform a precise and performance
|
|
66302
|
+
// effective test for hidden elements. E.g. even jQuery's ':visible' filter
|
|
66303
|
+
// gives wrong results for elements with width & height less than 0.5.
|
|
66304
|
+
if (!clientWidth && !clientHeight) {
|
|
66305
|
+
return emptyRect;
|
|
66306
|
+
}
|
|
66307
|
+
var styles = getWindowOf(target).getComputedStyle(target);
|
|
66308
|
+
var paddings = getPaddings(styles);
|
|
66309
|
+
var horizPad = paddings.left + paddings.right;
|
|
66310
|
+
var vertPad = paddings.top + paddings.bottom;
|
|
66311
|
+
// Computed styles of width & height are being used because they are the
|
|
66312
|
+
// only dimensions available to JS that contain non-rounded values. It could
|
|
66313
|
+
// be possible to utilize the getBoundingClientRect if only it's data wasn't
|
|
66314
|
+
// affected by CSS transformations let alone paddings, borders and scroll bars.
|
|
66315
|
+
var width = toFloat(styles.width), height = toFloat(styles.height);
|
|
66316
|
+
// Width & height include paddings and borders when the 'border-box' box
|
|
66317
|
+
// model is applied (except for IE).
|
|
66318
|
+
if (styles.boxSizing === 'border-box') {
|
|
66319
|
+
// Following conditions are required to handle Internet Explorer which
|
|
66320
|
+
// doesn't include paddings and borders to computed CSS dimensions.
|
|
66321
|
+
//
|
|
66322
|
+
// We can say that if CSS dimensions + paddings are equal to the "client"
|
|
66323
|
+
// properties then it's either IE, and thus we don't need to subtract
|
|
66324
|
+
// anything, or an element merely doesn't have paddings/borders styles.
|
|
66325
|
+
if (Math.round(width + horizPad) !== clientWidth) {
|
|
66326
|
+
width -= getBordersSize(styles, 'left', 'right') + horizPad;
|
|
66327
|
+
}
|
|
66328
|
+
if (Math.round(height + vertPad) !== clientHeight) {
|
|
66329
|
+
height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
|
|
66330
|
+
}
|
|
66331
|
+
}
|
|
66332
|
+
// Following steps can't be applied to the document's root element as its
|
|
66333
|
+
// client[Width/Height] properties represent viewport area of the window.
|
|
66334
|
+
// Besides, it's as well not necessary as the <html> itself neither has
|
|
66335
|
+
// rendered scroll bars nor it can be clipped.
|
|
66336
|
+
if (!isDocumentElement(target)) {
|
|
66337
|
+
// In some browsers (only in Firefox, actually) CSS width & height
|
|
66338
|
+
// include scroll bars size which can be removed at this step as scroll
|
|
66339
|
+
// bars are the only difference between rounded dimensions + paddings
|
|
66340
|
+
// and "client" properties, though that is not always true in Chrome.
|
|
66341
|
+
var vertScrollbar = Math.round(width + horizPad) - clientWidth;
|
|
66342
|
+
var horizScrollbar = Math.round(height + vertPad) - clientHeight;
|
|
66343
|
+
// Chrome has a rather weird rounding of "client" properties.
|
|
66344
|
+
// E.g. for an element with content width of 314.2px it sometimes gives
|
|
66345
|
+
// the client width of 315px and for the width of 314.7px it may give
|
|
66346
|
+
// 314px. And it doesn't happen all the time. So just ignore this delta
|
|
66347
|
+
// as a non-relevant.
|
|
66348
|
+
if (Math.abs(vertScrollbar) !== 1) {
|
|
66349
|
+
width -= vertScrollbar;
|
|
66350
|
+
}
|
|
66351
|
+
if (Math.abs(horizScrollbar) !== 1) {
|
|
66352
|
+
height -= horizScrollbar;
|
|
66353
|
+
}
|
|
66354
|
+
}
|
|
66355
|
+
return createRectInit(paddings.left, paddings.top, width, height);
|
|
66356
|
+
}
|
|
66357
|
+
/**
|
|
66358
|
+
* Checks whether provided element is an instance of the SVGGraphicsElement.
|
|
66359
|
+
*
|
|
66360
|
+
* @param {Element} target - Element to be checked.
|
|
66361
|
+
* @returns {boolean}
|
|
66362
|
+
*/
|
|
66363
|
+
var isSVGGraphicsElement = (function () {
|
|
66364
|
+
// Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
|
|
66365
|
+
// interface.
|
|
66366
|
+
if (typeof SVGGraphicsElement !== 'undefined') {
|
|
66367
|
+
return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
|
|
66368
|
+
}
|
|
66369
|
+
// If it's so, then check that element is at least an instance of the
|
|
66370
|
+
// SVGElement and that it has the "getBBox" method.
|
|
66371
|
+
// eslint-disable-next-line no-extra-parens
|
|
66372
|
+
return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
|
|
66373
|
+
typeof target.getBBox === 'function'); };
|
|
66374
|
+
})();
|
|
66375
|
+
/**
|
|
66376
|
+
* Checks whether provided element is a document element (<html>).
|
|
66377
|
+
*
|
|
66378
|
+
* @param {Element} target - Element to be checked.
|
|
66379
|
+
* @returns {boolean}
|
|
66380
|
+
*/
|
|
66381
|
+
function isDocumentElement(target) {
|
|
66382
|
+
return target === getWindowOf(target).document.documentElement;
|
|
66383
|
+
}
|
|
66384
|
+
/**
|
|
66385
|
+
* Calculates an appropriate content rectangle for provided html or svg element.
|
|
66386
|
+
*
|
|
66387
|
+
* @param {Element} target - Element content rectangle of which needs to be calculated.
|
|
66388
|
+
* @returns {DOMRectInit}
|
|
66389
|
+
*/
|
|
66390
|
+
function getContentRect(target) {
|
|
66391
|
+
if (!isBrowser) {
|
|
66392
|
+
return emptyRect;
|
|
66393
|
+
}
|
|
66394
|
+
if (isSVGGraphicsElement(target)) {
|
|
66395
|
+
return getSVGContentRect(target);
|
|
66396
|
+
}
|
|
66397
|
+
return getHTMLElementContentRect(target);
|
|
66398
|
+
}
|
|
66399
|
+
/**
|
|
66400
|
+
* Creates rectangle with an interface of the DOMRectReadOnly.
|
|
66401
|
+
* Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
|
|
66402
|
+
*
|
|
66403
|
+
* @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
|
|
66404
|
+
* @returns {DOMRectReadOnly}
|
|
66405
|
+
*/
|
|
66406
|
+
function createReadOnlyRect(_a) {
|
|
66407
|
+
var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
|
66408
|
+
// If DOMRectReadOnly is available use it as a prototype for the rectangle.
|
|
66409
|
+
var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
|
|
66410
|
+
var rect = Object.create(Constr.prototype);
|
|
66411
|
+
// Rectangle's properties are not writable and non-enumerable.
|
|
66412
|
+
defineConfigurable(rect, {
|
|
66413
|
+
x: x, y: y, width: width, height: height,
|
|
66414
|
+
top: y,
|
|
66415
|
+
right: x + width,
|
|
66416
|
+
bottom: height + y,
|
|
66417
|
+
left: x
|
|
66418
|
+
});
|
|
66419
|
+
return rect;
|
|
66420
|
+
}
|
|
66421
|
+
/**
|
|
66422
|
+
* Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
|
|
66423
|
+
* Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
|
|
66424
|
+
*
|
|
66425
|
+
* @param {number} x - X coordinate.
|
|
66426
|
+
* @param {number} y - Y coordinate.
|
|
66427
|
+
* @param {number} width - Rectangle's width.
|
|
66428
|
+
* @param {number} height - Rectangle's height.
|
|
66429
|
+
* @returns {DOMRectInit}
|
|
66430
|
+
*/
|
|
66431
|
+
function createRectInit(x, y, width, height) {
|
|
66432
|
+
return { x: x, y: y, width: width, height: height };
|
|
66433
66433
|
}
|
|
66434
66434
|
|
|
66435
|
-
/**
|
|
66436
|
-
* Class that is responsible for computations of the content rectangle of
|
|
66437
|
-
* provided DOM element and for keeping track of it's changes.
|
|
66438
|
-
*/
|
|
66439
|
-
var ResizeObservation = /** @class */ (function () {
|
|
66440
|
-
/**
|
|
66441
|
-
* Creates an instance of ResizeObservation.
|
|
66442
|
-
*
|
|
66443
|
-
* @param {Element} target - Element to be observed.
|
|
66444
|
-
*/
|
|
66445
|
-
function ResizeObservation(target) {
|
|
66446
|
-
/**
|
|
66447
|
-
* Broadcasted width of content rectangle.
|
|
66448
|
-
*
|
|
66449
|
-
* @type {number}
|
|
66450
|
-
*/
|
|
66451
|
-
this.broadcastWidth = 0;
|
|
66452
|
-
/**
|
|
66453
|
-
* Broadcasted height of content rectangle.
|
|
66454
|
-
*
|
|
66455
|
-
* @type {number}
|
|
66456
|
-
*/
|
|
66457
|
-
this.broadcastHeight = 0;
|
|
66458
|
-
/**
|
|
66459
|
-
* Reference to the last observed content rectangle.
|
|
66460
|
-
*
|
|
66461
|
-
* @private {DOMRectInit}
|
|
66462
|
-
*/
|
|
66463
|
-
this.contentRect_ = createRectInit(0, 0, 0, 0);
|
|
66464
|
-
this.target = target;
|
|
66465
|
-
}
|
|
66466
|
-
/**
|
|
66467
|
-
* Updates content rectangle and tells whether it's width or height properties
|
|
66468
|
-
* have changed since the last broadcast.
|
|
66469
|
-
*
|
|
66470
|
-
* @returns {boolean}
|
|
66471
|
-
*/
|
|
66472
|
-
ResizeObservation.prototype.isActive = function () {
|
|
66473
|
-
var rect = getContentRect(this.target);
|
|
66474
|
-
this.contentRect_ = rect;
|
|
66475
|
-
return (rect.width !== this.broadcastWidth ||
|
|
66476
|
-
rect.height !== this.broadcastHeight);
|
|
66477
|
-
};
|
|
66478
|
-
/**
|
|
66479
|
-
* Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
|
|
66480
|
-
* from the corresponding properties of the last observed content rectangle.
|
|
66481
|
-
*
|
|
66482
|
-
* @returns {DOMRectInit} Last observed content rectangle.
|
|
66483
|
-
*/
|
|
66484
|
-
ResizeObservation.prototype.broadcastRect = function () {
|
|
66485
|
-
var rect = this.contentRect_;
|
|
66486
|
-
this.broadcastWidth = rect.width;
|
|
66487
|
-
this.broadcastHeight = rect.height;
|
|
66488
|
-
return rect;
|
|
66489
|
-
};
|
|
66490
|
-
return ResizeObservation;
|
|
66435
|
+
/**
|
|
66436
|
+
* Class that is responsible for computations of the content rectangle of
|
|
66437
|
+
* provided DOM element and for keeping track of it's changes.
|
|
66438
|
+
*/
|
|
66439
|
+
var ResizeObservation = /** @class */ (function () {
|
|
66440
|
+
/**
|
|
66441
|
+
* Creates an instance of ResizeObservation.
|
|
66442
|
+
*
|
|
66443
|
+
* @param {Element} target - Element to be observed.
|
|
66444
|
+
*/
|
|
66445
|
+
function ResizeObservation(target) {
|
|
66446
|
+
/**
|
|
66447
|
+
* Broadcasted width of content rectangle.
|
|
66448
|
+
*
|
|
66449
|
+
* @type {number}
|
|
66450
|
+
*/
|
|
66451
|
+
this.broadcastWidth = 0;
|
|
66452
|
+
/**
|
|
66453
|
+
* Broadcasted height of content rectangle.
|
|
66454
|
+
*
|
|
66455
|
+
* @type {number}
|
|
66456
|
+
*/
|
|
66457
|
+
this.broadcastHeight = 0;
|
|
66458
|
+
/**
|
|
66459
|
+
* Reference to the last observed content rectangle.
|
|
66460
|
+
*
|
|
66461
|
+
* @private {DOMRectInit}
|
|
66462
|
+
*/
|
|
66463
|
+
this.contentRect_ = createRectInit(0, 0, 0, 0);
|
|
66464
|
+
this.target = target;
|
|
66465
|
+
}
|
|
66466
|
+
/**
|
|
66467
|
+
* Updates content rectangle and tells whether it's width or height properties
|
|
66468
|
+
* have changed since the last broadcast.
|
|
66469
|
+
*
|
|
66470
|
+
* @returns {boolean}
|
|
66471
|
+
*/
|
|
66472
|
+
ResizeObservation.prototype.isActive = function () {
|
|
66473
|
+
var rect = getContentRect(this.target);
|
|
66474
|
+
this.contentRect_ = rect;
|
|
66475
|
+
return (rect.width !== this.broadcastWidth ||
|
|
66476
|
+
rect.height !== this.broadcastHeight);
|
|
66477
|
+
};
|
|
66478
|
+
/**
|
|
66479
|
+
* Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
|
|
66480
|
+
* from the corresponding properties of the last observed content rectangle.
|
|
66481
|
+
*
|
|
66482
|
+
* @returns {DOMRectInit} Last observed content rectangle.
|
|
66483
|
+
*/
|
|
66484
|
+
ResizeObservation.prototype.broadcastRect = function () {
|
|
66485
|
+
var rect = this.contentRect_;
|
|
66486
|
+
this.broadcastWidth = rect.width;
|
|
66487
|
+
this.broadcastHeight = rect.height;
|
|
66488
|
+
return rect;
|
|
66489
|
+
};
|
|
66490
|
+
return ResizeObservation;
|
|
66491
66491
|
}());
|
|
66492
66492
|
|
|
66493
|
-
var ResizeObserverEntry = /** @class */ (function () {
|
|
66494
|
-
/**
|
|
66495
|
-
* Creates an instance of ResizeObserverEntry.
|
|
66496
|
-
*
|
|
66497
|
-
* @param {Element} target - Element that is being observed.
|
|
66498
|
-
* @param {DOMRectInit} rectInit - Data of the element's content rectangle.
|
|
66499
|
-
*/
|
|
66500
|
-
function ResizeObserverEntry(target, rectInit) {
|
|
66501
|
-
var contentRect = createReadOnlyRect(rectInit);
|
|
66502
|
-
// According to the specification following properties are not writable
|
|
66503
|
-
// and are also not enumerable in the native implementation.
|
|
66504
|
-
//
|
|
66505
|
-
// Property accessors are not being used as they'd require to define a
|
|
66506
|
-
// private WeakMap storage which may cause memory leaks in browsers that
|
|
66507
|
-
// don't support this type of collections.
|
|
66508
|
-
defineConfigurable(this, { target: target, contentRect: contentRect });
|
|
66509
|
-
}
|
|
66510
|
-
return ResizeObserverEntry;
|
|
66493
|
+
var ResizeObserverEntry = /** @class */ (function () {
|
|
66494
|
+
/**
|
|
66495
|
+
* Creates an instance of ResizeObserverEntry.
|
|
66496
|
+
*
|
|
66497
|
+
* @param {Element} target - Element that is being observed.
|
|
66498
|
+
* @param {DOMRectInit} rectInit - Data of the element's content rectangle.
|
|
66499
|
+
*/
|
|
66500
|
+
function ResizeObserverEntry(target, rectInit) {
|
|
66501
|
+
var contentRect = createReadOnlyRect(rectInit);
|
|
66502
|
+
// According to the specification following properties are not writable
|
|
66503
|
+
// and are also not enumerable in the native implementation.
|
|
66504
|
+
//
|
|
66505
|
+
// Property accessors are not being used as they'd require to define a
|
|
66506
|
+
// private WeakMap storage which may cause memory leaks in browsers that
|
|
66507
|
+
// don't support this type of collections.
|
|
66508
|
+
defineConfigurable(this, { target: target, contentRect: contentRect });
|
|
66509
|
+
}
|
|
66510
|
+
return ResizeObserverEntry;
|
|
66511
66511
|
}());
|
|
66512
66512
|
|
|
66513
|
-
var ResizeObserverSPI = /** @class */ (function () {
|
|
66514
|
-
/**
|
|
66515
|
-
* Creates a new instance of ResizeObserver.
|
|
66516
|
-
*
|
|
66517
|
-
* @param {ResizeObserverCallback} callback - Callback function that is invoked
|
|
66518
|
-
* when one of the observed elements changes it's content dimensions.
|
|
66519
|
-
* @param {ResizeObserverController} controller - Controller instance which
|
|
66520
|
-
* is responsible for the updates of observer.
|
|
66521
|
-
* @param {ResizeObserver} callbackCtx - Reference to the public
|
|
66522
|
-
* ResizeObserver instance which will be passed to callback function.
|
|
66523
|
-
*/
|
|
66524
|
-
function ResizeObserverSPI(callback, controller, callbackCtx) {
|
|
66525
|
-
/**
|
|
66526
|
-
* Collection of resize observations that have detected changes in dimensions
|
|
66527
|
-
* of elements.
|
|
66528
|
-
*
|
|
66529
|
-
* @private {Array<ResizeObservation>}
|
|
66530
|
-
*/
|
|
66531
|
-
this.activeObservations_ = [];
|
|
66532
|
-
/**
|
|
66533
|
-
* Registry of the ResizeObservation instances.
|
|
66534
|
-
*
|
|
66535
|
-
* @private {Map<Element, ResizeObservation>}
|
|
66536
|
-
*/
|
|
66537
|
-
this.observations_ = new MapShim();
|
|
66538
|
-
if (typeof callback !== 'function') {
|
|
66539
|
-
throw new TypeError('The callback provided as parameter 1 is not a function.');
|
|
66540
|
-
}
|
|
66541
|
-
this.callback_ = callback;
|
|
66542
|
-
this.controller_ = controller;
|
|
66543
|
-
this.callbackCtx_ = callbackCtx;
|
|
66544
|
-
}
|
|
66545
|
-
/**
|
|
66546
|
-
* Starts observing provided element.
|
|
66547
|
-
*
|
|
66548
|
-
* @param {Element} target - Element to be observed.
|
|
66549
|
-
* @returns {void}
|
|
66550
|
-
*/
|
|
66551
|
-
ResizeObserverSPI.prototype.observe = function (target) {
|
|
66552
|
-
if (!arguments.length) {
|
|
66553
|
-
throw new TypeError('1 argument required, but only 0 present.');
|
|
66554
|
-
}
|
|
66555
|
-
// Do nothing if current environment doesn't have the Element interface.
|
|
66556
|
-
if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
|
66557
|
-
return;
|
|
66558
|
-
}
|
|
66559
|
-
if (!(target instanceof getWindowOf(target).Element)) {
|
|
66560
|
-
throw new TypeError('parameter 1 is not of type "Element".');
|
|
66561
|
-
}
|
|
66562
|
-
var observations = this.observations_;
|
|
66563
|
-
// Do nothing if element is already being observed.
|
|
66564
|
-
if (observations.has(target)) {
|
|
66565
|
-
return;
|
|
66566
|
-
}
|
|
66567
|
-
observations.set(target, new ResizeObservation(target));
|
|
66568
|
-
this.controller_.addObserver(this);
|
|
66569
|
-
// Force the update of observations.
|
|
66570
|
-
this.controller_.refresh();
|
|
66571
|
-
};
|
|
66572
|
-
/**
|
|
66573
|
-
* Stops observing provided element.
|
|
66574
|
-
*
|
|
66575
|
-
* @param {Element} target - Element to stop observing.
|
|
66576
|
-
* @returns {void}
|
|
66577
|
-
*/
|
|
66578
|
-
ResizeObserverSPI.prototype.unobserve = function (target) {
|
|
66579
|
-
if (!arguments.length) {
|
|
66580
|
-
throw new TypeError('1 argument required, but only 0 present.');
|
|
66581
|
-
}
|
|
66582
|
-
// Do nothing if current environment doesn't have the Element interface.
|
|
66583
|
-
if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
|
66584
|
-
return;
|
|
66585
|
-
}
|
|
66586
|
-
if (!(target instanceof getWindowOf(target).Element)) {
|
|
66587
|
-
throw new TypeError('parameter 1 is not of type "Element".');
|
|
66588
|
-
}
|
|
66589
|
-
var observations = this.observations_;
|
|
66590
|
-
// Do nothing if element is not being observed.
|
|
66591
|
-
if (!observations.has(target)) {
|
|
66592
|
-
return;
|
|
66593
|
-
}
|
|
66594
|
-
observations.delete(target);
|
|
66595
|
-
if (!observations.size) {
|
|
66596
|
-
this.controller_.removeObserver(this);
|
|
66597
|
-
}
|
|
66598
|
-
};
|
|
66599
|
-
/**
|
|
66600
|
-
* Stops observing all elements.
|
|
66601
|
-
*
|
|
66602
|
-
* @returns {void}
|
|
66603
|
-
*/
|
|
66604
|
-
ResizeObserverSPI.prototype.disconnect = function () {
|
|
66605
|
-
this.clearActive();
|
|
66606
|
-
this.observations_.clear();
|
|
66607
|
-
this.controller_.removeObserver(this);
|
|
66608
|
-
};
|
|
66609
|
-
/**
|
|
66610
|
-
* Collects observation instances the associated element of which has changed
|
|
66611
|
-
* it's content rectangle.
|
|
66612
|
-
*
|
|
66613
|
-
* @returns {void}
|
|
66614
|
-
*/
|
|
66615
|
-
ResizeObserverSPI.prototype.gatherActive = function () {
|
|
66616
|
-
var _this = this;
|
|
66617
|
-
this.clearActive();
|
|
66618
|
-
this.observations_.forEach(function (observation) {
|
|
66619
|
-
if (observation.isActive()) {
|
|
66620
|
-
_this.activeObservations_.push(observation);
|
|
66621
|
-
}
|
|
66622
|
-
});
|
|
66623
|
-
};
|
|
66624
|
-
/**
|
|
66625
|
-
* Invokes initial callback function with a list of ResizeObserverEntry
|
|
66626
|
-
* instances collected from active resize observations.
|
|
66627
|
-
*
|
|
66628
|
-
* @returns {void}
|
|
66629
|
-
*/
|
|
66630
|
-
ResizeObserverSPI.prototype.broadcastActive = function () {
|
|
66631
|
-
// Do nothing if observer doesn't have active observations.
|
|
66632
|
-
if (!this.hasActive()) {
|
|
66633
|
-
return;
|
|
66634
|
-
}
|
|
66635
|
-
var ctx = this.callbackCtx_;
|
|
66636
|
-
// Create ResizeObserverEntry instance for every active observation.
|
|
66637
|
-
var entries = this.activeObservations_.map(function (observation) {
|
|
66638
|
-
return new ResizeObserverEntry(observation.target, observation.broadcastRect());
|
|
66639
|
-
});
|
|
66640
|
-
this.callback_.call(ctx, entries, ctx);
|
|
66641
|
-
this.clearActive();
|
|
66642
|
-
};
|
|
66643
|
-
/**
|
|
66644
|
-
* Clears the collection of active observations.
|
|
66645
|
-
*
|
|
66646
|
-
* @returns {void}
|
|
66647
|
-
*/
|
|
66648
|
-
ResizeObserverSPI.prototype.clearActive = function () {
|
|
66649
|
-
this.activeObservations_.splice(0);
|
|
66650
|
-
};
|
|
66651
|
-
/**
|
|
66652
|
-
* Tells whether observer has active observations.
|
|
66653
|
-
*
|
|
66654
|
-
* @returns {boolean}
|
|
66655
|
-
*/
|
|
66656
|
-
ResizeObserverSPI.prototype.hasActive = function () {
|
|
66657
|
-
return this.activeObservations_.length > 0;
|
|
66658
|
-
};
|
|
66659
|
-
return ResizeObserverSPI;
|
|
66513
|
+
var ResizeObserverSPI = /** @class */ (function () {
|
|
66514
|
+
/**
|
|
66515
|
+
* Creates a new instance of ResizeObserver.
|
|
66516
|
+
*
|
|
66517
|
+
* @param {ResizeObserverCallback} callback - Callback function that is invoked
|
|
66518
|
+
* when one of the observed elements changes it's content dimensions.
|
|
66519
|
+
* @param {ResizeObserverController} controller - Controller instance which
|
|
66520
|
+
* is responsible for the updates of observer.
|
|
66521
|
+
* @param {ResizeObserver} callbackCtx - Reference to the public
|
|
66522
|
+
* ResizeObserver instance which will be passed to callback function.
|
|
66523
|
+
*/
|
|
66524
|
+
function ResizeObserverSPI(callback, controller, callbackCtx) {
|
|
66525
|
+
/**
|
|
66526
|
+
* Collection of resize observations that have detected changes in dimensions
|
|
66527
|
+
* of elements.
|
|
66528
|
+
*
|
|
66529
|
+
* @private {Array<ResizeObservation>}
|
|
66530
|
+
*/
|
|
66531
|
+
this.activeObservations_ = [];
|
|
66532
|
+
/**
|
|
66533
|
+
* Registry of the ResizeObservation instances.
|
|
66534
|
+
*
|
|
66535
|
+
* @private {Map<Element, ResizeObservation>}
|
|
66536
|
+
*/
|
|
66537
|
+
this.observations_ = new MapShim();
|
|
66538
|
+
if (typeof callback !== 'function') {
|
|
66539
|
+
throw new TypeError('The callback provided as parameter 1 is not a function.');
|
|
66540
|
+
}
|
|
66541
|
+
this.callback_ = callback;
|
|
66542
|
+
this.controller_ = controller;
|
|
66543
|
+
this.callbackCtx_ = callbackCtx;
|
|
66544
|
+
}
|
|
66545
|
+
/**
|
|
66546
|
+
* Starts observing provided element.
|
|
66547
|
+
*
|
|
66548
|
+
* @param {Element} target - Element to be observed.
|
|
66549
|
+
* @returns {void}
|
|
66550
|
+
*/
|
|
66551
|
+
ResizeObserverSPI.prototype.observe = function (target) {
|
|
66552
|
+
if (!arguments.length) {
|
|
66553
|
+
throw new TypeError('1 argument required, but only 0 present.');
|
|
66554
|
+
}
|
|
66555
|
+
// Do nothing if current environment doesn't have the Element interface.
|
|
66556
|
+
if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
|
66557
|
+
return;
|
|
66558
|
+
}
|
|
66559
|
+
if (!(target instanceof getWindowOf(target).Element)) {
|
|
66560
|
+
throw new TypeError('parameter 1 is not of type "Element".');
|
|
66561
|
+
}
|
|
66562
|
+
var observations = this.observations_;
|
|
66563
|
+
// Do nothing if element is already being observed.
|
|
66564
|
+
if (observations.has(target)) {
|
|
66565
|
+
return;
|
|
66566
|
+
}
|
|
66567
|
+
observations.set(target, new ResizeObservation(target));
|
|
66568
|
+
this.controller_.addObserver(this);
|
|
66569
|
+
// Force the update of observations.
|
|
66570
|
+
this.controller_.refresh();
|
|
66571
|
+
};
|
|
66572
|
+
/**
|
|
66573
|
+
* Stops observing provided element.
|
|
66574
|
+
*
|
|
66575
|
+
* @param {Element} target - Element to stop observing.
|
|
66576
|
+
* @returns {void}
|
|
66577
|
+
*/
|
|
66578
|
+
ResizeObserverSPI.prototype.unobserve = function (target) {
|
|
66579
|
+
if (!arguments.length) {
|
|
66580
|
+
throw new TypeError('1 argument required, but only 0 present.');
|
|
66581
|
+
}
|
|
66582
|
+
// Do nothing if current environment doesn't have the Element interface.
|
|
66583
|
+
if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
|
66584
|
+
return;
|
|
66585
|
+
}
|
|
66586
|
+
if (!(target instanceof getWindowOf(target).Element)) {
|
|
66587
|
+
throw new TypeError('parameter 1 is not of type "Element".');
|
|
66588
|
+
}
|
|
66589
|
+
var observations = this.observations_;
|
|
66590
|
+
// Do nothing if element is not being observed.
|
|
66591
|
+
if (!observations.has(target)) {
|
|
66592
|
+
return;
|
|
66593
|
+
}
|
|
66594
|
+
observations.delete(target);
|
|
66595
|
+
if (!observations.size) {
|
|
66596
|
+
this.controller_.removeObserver(this);
|
|
66597
|
+
}
|
|
66598
|
+
};
|
|
66599
|
+
/**
|
|
66600
|
+
* Stops observing all elements.
|
|
66601
|
+
*
|
|
66602
|
+
* @returns {void}
|
|
66603
|
+
*/
|
|
66604
|
+
ResizeObserverSPI.prototype.disconnect = function () {
|
|
66605
|
+
this.clearActive();
|
|
66606
|
+
this.observations_.clear();
|
|
66607
|
+
this.controller_.removeObserver(this);
|
|
66608
|
+
};
|
|
66609
|
+
/**
|
|
66610
|
+
* Collects observation instances the associated element of which has changed
|
|
66611
|
+
* it's content rectangle.
|
|
66612
|
+
*
|
|
66613
|
+
* @returns {void}
|
|
66614
|
+
*/
|
|
66615
|
+
ResizeObserverSPI.prototype.gatherActive = function () {
|
|
66616
|
+
var _this = this;
|
|
66617
|
+
this.clearActive();
|
|
66618
|
+
this.observations_.forEach(function (observation) {
|
|
66619
|
+
if (observation.isActive()) {
|
|
66620
|
+
_this.activeObservations_.push(observation);
|
|
66621
|
+
}
|
|
66622
|
+
});
|
|
66623
|
+
};
|
|
66624
|
+
/**
|
|
66625
|
+
* Invokes initial callback function with a list of ResizeObserverEntry
|
|
66626
|
+
* instances collected from active resize observations.
|
|
66627
|
+
*
|
|
66628
|
+
* @returns {void}
|
|
66629
|
+
*/
|
|
66630
|
+
ResizeObserverSPI.prototype.broadcastActive = function () {
|
|
66631
|
+
// Do nothing if observer doesn't have active observations.
|
|
66632
|
+
if (!this.hasActive()) {
|
|
66633
|
+
return;
|
|
66634
|
+
}
|
|
66635
|
+
var ctx = this.callbackCtx_;
|
|
66636
|
+
// Create ResizeObserverEntry instance for every active observation.
|
|
66637
|
+
var entries = this.activeObservations_.map(function (observation) {
|
|
66638
|
+
return new ResizeObserverEntry(observation.target, observation.broadcastRect());
|
|
66639
|
+
});
|
|
66640
|
+
this.callback_.call(ctx, entries, ctx);
|
|
66641
|
+
this.clearActive();
|
|
66642
|
+
};
|
|
66643
|
+
/**
|
|
66644
|
+
* Clears the collection of active observations.
|
|
66645
|
+
*
|
|
66646
|
+
* @returns {void}
|
|
66647
|
+
*/
|
|
66648
|
+
ResizeObserverSPI.prototype.clearActive = function () {
|
|
66649
|
+
this.activeObservations_.splice(0);
|
|
66650
|
+
};
|
|
66651
|
+
/**
|
|
66652
|
+
* Tells whether observer has active observations.
|
|
66653
|
+
*
|
|
66654
|
+
* @returns {boolean}
|
|
66655
|
+
*/
|
|
66656
|
+
ResizeObserverSPI.prototype.hasActive = function () {
|
|
66657
|
+
return this.activeObservations_.length > 0;
|
|
66658
|
+
};
|
|
66659
|
+
return ResizeObserverSPI;
|
|
66660
66660
|
}());
|
|
66661
66661
|
|
|
66662
|
-
// Registry of internal observers. If WeakMap is not available use current shim
|
|
66663
|
-
// for the Map collection as it has all required methods and because WeakMap
|
|
66664
|
-
// can't be fully polyfilled anyway.
|
|
66665
|
-
var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
|
|
66666
|
-
/**
|
|
66667
|
-
* ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
|
|
66668
|
-
* exposing only those methods and properties that are defined in the spec.
|
|
66669
|
-
*/
|
|
66670
|
-
var ResizeObserver = /** @class */ (function () {
|
|
66671
|
-
/**
|
|
66672
|
-
* Creates a new instance of ResizeObserver.
|
|
66673
|
-
*
|
|
66674
|
-
* @param {ResizeObserverCallback} callback - Callback that is invoked when
|
|
66675
|
-
* dimensions of the observed elements change.
|
|
66676
|
-
*/
|
|
66677
|
-
function ResizeObserver(callback) {
|
|
66678
|
-
if (!(this instanceof ResizeObserver)) {
|
|
66679
|
-
throw new TypeError('Cannot call a class as a function.');
|
|
66680
|
-
}
|
|
66681
|
-
if (!arguments.length) {
|
|
66682
|
-
throw new TypeError('1 argument required, but only 0 present.');
|
|
66683
|
-
}
|
|
66684
|
-
var controller = ResizeObserverController.getInstance();
|
|
66685
|
-
var observer = new ResizeObserverSPI(callback, controller, this);
|
|
66686
|
-
observers.set(this, observer);
|
|
66687
|
-
}
|
|
66688
|
-
return ResizeObserver;
|
|
66689
|
-
}());
|
|
66690
|
-
// Expose public methods of ResizeObserver.
|
|
66691
|
-
[
|
|
66692
|
-
'observe',
|
|
66693
|
-
'unobserve',
|
|
66694
|
-
'disconnect'
|
|
66695
|
-
].forEach(function (method) {
|
|
66696
|
-
ResizeObserver.prototype[method] = function () {
|
|
66697
|
-
var _a;
|
|
66698
|
-
return (_a = observers.get(this))[method].apply(_a, arguments);
|
|
66699
|
-
};
|
|
66662
|
+
// Registry of internal observers. If WeakMap is not available use current shim
|
|
66663
|
+
// for the Map collection as it has all required methods and because WeakMap
|
|
66664
|
+
// can't be fully polyfilled anyway.
|
|
66665
|
+
var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
|
|
66666
|
+
/**
|
|
66667
|
+
* ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
|
|
66668
|
+
* exposing only those methods and properties that are defined in the spec.
|
|
66669
|
+
*/
|
|
66670
|
+
var ResizeObserver = /** @class */ (function () {
|
|
66671
|
+
/**
|
|
66672
|
+
* Creates a new instance of ResizeObserver.
|
|
66673
|
+
*
|
|
66674
|
+
* @param {ResizeObserverCallback} callback - Callback that is invoked when
|
|
66675
|
+
* dimensions of the observed elements change.
|
|
66676
|
+
*/
|
|
66677
|
+
function ResizeObserver(callback) {
|
|
66678
|
+
if (!(this instanceof ResizeObserver)) {
|
|
66679
|
+
throw new TypeError('Cannot call a class as a function.');
|
|
66680
|
+
}
|
|
66681
|
+
if (!arguments.length) {
|
|
66682
|
+
throw new TypeError('1 argument required, but only 0 present.');
|
|
66683
|
+
}
|
|
66684
|
+
var controller = ResizeObserverController.getInstance();
|
|
66685
|
+
var observer = new ResizeObserverSPI(callback, controller, this);
|
|
66686
|
+
observers.set(this, observer);
|
|
66687
|
+
}
|
|
66688
|
+
return ResizeObserver;
|
|
66689
|
+
}());
|
|
66690
|
+
// Expose public methods of ResizeObserver.
|
|
66691
|
+
[
|
|
66692
|
+
'observe',
|
|
66693
|
+
'unobserve',
|
|
66694
|
+
'disconnect'
|
|
66695
|
+
].forEach(function (method) {
|
|
66696
|
+
ResizeObserver.prototype[method] = function () {
|
|
66697
|
+
var _a;
|
|
66698
|
+
return (_a = observers.get(this))[method].apply(_a, arguments);
|
|
66699
|
+
};
|
|
66700
66700
|
});
|
|
66701
66701
|
|
|
66702
|
-
var index = (function () {
|
|
66703
|
-
// Export existing implementation if available.
|
|
66704
|
-
if (typeof global$1.ResizeObserver !== 'undefined') {
|
|
66705
|
-
return global$1.ResizeObserver;
|
|
66706
|
-
}
|
|
66707
|
-
return ResizeObserver;
|
|
66702
|
+
var index = (function () {
|
|
66703
|
+
// Export existing implementation if available.
|
|
66704
|
+
if (typeof global$1.ResizeObserver !== 'undefined') {
|
|
66705
|
+
return global$1.ResizeObserver;
|
|
66706
|
+
}
|
|
66707
|
+
return ResizeObserver;
|
|
66708
66708
|
})();
|
|
66709
66709
|
|
|
66710
66710
|
/* harmony default export */ __webpack_exports__["default"] = (index);
|
|
@@ -66852,19 +66852,19 @@ module.exports = function ( delay, noTrailing, callback, debounceMode ) {
|
|
|
66852
66852
|
|
|
66853
66853
|
/***/ }),
|
|
66854
66854
|
|
|
66855
|
-
/***/
|
|
66855
|
+
/***/ 3049:
|
|
66856
66856
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
66857
66857
|
|
|
66858
66858
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
66859
66859
|
|
|
66860
66860
|
// load the styles
|
|
66861
|
-
var content = __webpack_require__(
|
|
66861
|
+
var content = __webpack_require__(5569);
|
|
66862
66862
|
if(content.__esModule) content = content.default;
|
|
66863
66863
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
66864
66864
|
if(content.locals) module.exports = content.locals;
|
|
66865
66865
|
// add the styles to the DOM
|
|
66866
66866
|
var add = (__webpack_require__(4402)/* ["default"] */ .Z)
|
|
66867
|
-
var update = add("
|
|
66867
|
+
var update = add("e910f8aa", content, true, {"sourceMap":false,"shadowMode":false});
|
|
66868
66868
|
|
|
66869
66869
|
/***/ }),
|
|
66870
66870
|
|
|
@@ -67368,7 +67368,7 @@ if (typeof window !== 'undefined') {
|
|
|
67368
67368
|
// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
|
67369
67369
|
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(3797);
|
|
67370
67370
|
var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
|
|
67371
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=template&id=
|
|
67371
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=template&id=09d51dff&scoped=true&
|
|
67372
67372
|
var render = function render() {
|
|
67373
67373
|
var _vm = this,
|
|
67374
67374
|
_c = _vm._self._c;
|
|
@@ -67388,7 +67388,8 @@ var render = function render() {
|
|
|
67388
67388
|
"on-exceed": _vm.handleExceed,
|
|
67389
67389
|
"on-success": _vm.handleUploadSuccess,
|
|
67390
67390
|
"show-file-list": false,
|
|
67391
|
-
"headers": _vm.headers
|
|
67391
|
+
"headers": _vm.headers,
|
|
67392
|
+
"data": _vm.data
|
|
67392
67393
|
}
|
|
67393
67394
|
}, [_c('el-button', {
|
|
67394
67395
|
attrs: {
|
|
@@ -67418,7 +67419,7 @@ var render = function render() {
|
|
|
67418
67419
|
staticClass: "el-upload-list__item ele-upload-list__item-content"
|
|
67419
67420
|
}, [_c('el-link', {
|
|
67420
67421
|
attrs: {
|
|
67421
|
-
"href": `${
|
|
67422
|
+
"href": `${file.url}`,
|
|
67422
67423
|
"underline": false,
|
|
67423
67424
|
"target": "_blank"
|
|
67424
67425
|
}
|
|
@@ -67528,7 +67529,28 @@ var render = function render() {
|
|
|
67528
67529
|
staticStyle: {
|
|
67529
67530
|
"color": "#f56c6c"
|
|
67530
67531
|
}
|
|
67531
|
-
}, [_vm._v(_vm._s(_vm.fileType.join("/")))])] : _vm._e(), _vm._v(" 的文件 ")], 2) : _vm._e()], 1)]) : _vm._e()
|
|
67532
|
+
}, [_vm._v(_vm._s(_vm.fileType.join("/")))])] : _vm._e(), _vm._v(" 的文件 ")], 2) : _vm._e()], 1)]) : _vm._e(), _vm.type === 'igw-media' ? _c('div', [_c('el-upload', {
|
|
67533
|
+
ref: "upload",
|
|
67534
|
+
staticClass: "upload-file-uploader",
|
|
67535
|
+
attrs: {
|
|
67536
|
+
"multiple": "",
|
|
67537
|
+
"action": _vm.uploadDomain + _vm.uploadFileUrl,
|
|
67538
|
+
"before-upload": _vm.handleBeforeUpload,
|
|
67539
|
+
"file-list": _vm.fileList,
|
|
67540
|
+
"limit": _vm.limit,
|
|
67541
|
+
"on-error": _vm.handleUploadError,
|
|
67542
|
+
"on-exceed": _vm.handleExceed,
|
|
67543
|
+
"on-success": _vm.handleUploadSuccess,
|
|
67544
|
+
"show-file-list": false,
|
|
67545
|
+
"headers": _vm.headers,
|
|
67546
|
+
"data": _vm.data
|
|
67547
|
+
}
|
|
67548
|
+
}, _vm._l(_vm.mechanismList, function (item, index) {
|
|
67549
|
+
return _c('div', {
|
|
67550
|
+
key: index,
|
|
67551
|
+
staticClass: "mechanism-item"
|
|
67552
|
+
}, [_vm._v(_vm._s(item))]);
|
|
67553
|
+
}), 0)], 1) : _vm._e()]);
|
|
67532
67554
|
};
|
|
67533
67555
|
|
|
67534
67556
|
var staticRenderFns = [];
|
|
@@ -68221,7 +68243,7 @@ function download(url, params, filename) {
|
|
|
68221
68243
|
downloadLoadingInstance.close();
|
|
68222
68244
|
});
|
|
68223
68245
|
}
|
|
68224
|
-
/* harmony default export */ var
|
|
68246
|
+
/* harmony default export */ var request = (service);
|
|
68225
68247
|
;// CONCATENATED MODULE: ./packages/rmtFileUpload/api/rmtFileUploadSdk.js
|
|
68226
68248
|
// import attachmentRequest from '../../utils/attachmentRequest'
|
|
68227
68249
|
|
|
@@ -68230,6 +68252,7 @@ let headers = {
|
|
|
68230
68252
|
'X-Key': '',
|
|
68231
68253
|
'X-Token': ''
|
|
68232
68254
|
};
|
|
68255
|
+
|
|
68233
68256
|
function getCookies(_name, _data) {
|
|
68234
68257
|
if (_data) {
|
|
68235
68258
|
let storeData = typeof _data === 'object' ? JSON.stringify(_data) : _data;
|
|
@@ -68238,9 +68261,10 @@ function getCookies(_name, _data) {
|
|
|
68238
68261
|
return js_cookie.get(_name);
|
|
68239
68262
|
}
|
|
68240
68263
|
}
|
|
68264
|
+
|
|
68241
68265
|
function getUpToken(_fun) {
|
|
68242
68266
|
getCookies('isUpToken', 'loading');
|
|
68243
|
-
|
|
68267
|
+
request({
|
|
68244
68268
|
url: '/attachment/getAttachmentInfo',
|
|
68245
68269
|
method: 'get'
|
|
68246
68270
|
}).then(response => {
|
|
@@ -68269,6 +68293,7 @@ function getUpToken(_fun) {
|
|
|
68269
68293
|
});
|
|
68270
68294
|
} // Token是否过期
|
|
68271
68295
|
|
|
68296
|
+
|
|
68272
68297
|
function isTokenExpired(_fun) {
|
|
68273
68298
|
let expiresAt = getCookies('expiresAt');
|
|
68274
68299
|
|
|
@@ -68296,34 +68321,35 @@ function isTokenExpired(_fun) {
|
|
|
68296
68321
|
* @param {string} params
|
|
68297
68322
|
* @returns
|
|
68298
68323
|
*/
|
|
68324
|
+
// function uploadFile(params) {
|
|
68325
|
+
// // 判断token是否过期
|
|
68326
|
+
// isTokenExpired();
|
|
68327
|
+
// return request({
|
|
68328
|
+
// baseURL: 'https://attachment.pengbei.tech',
|
|
68329
|
+
// headers: {
|
|
68330
|
+
// 'accept': '*/*',
|
|
68331
|
+
// 'X-Client': 'WEB',
|
|
68332
|
+
// 'X-Key': getCookies('X-Key'),
|
|
68333
|
+
// 'X-Token': getCookies('X-Token')
|
|
68334
|
+
// },
|
|
68335
|
+
// url: '/upload/upload',
|
|
68336
|
+
// method: 'post',
|
|
68337
|
+
// data: params
|
|
68338
|
+
// })
|
|
68339
|
+
// }
|
|
68299
68340
|
|
|
68300
|
-
function uploadFile(params) {
|
|
68301
|
-
// 判断token是否过期
|
|
68302
|
-
isTokenExpired();
|
|
68303
|
-
return request({
|
|
68304
|
-
baseURL: 'https://attachment.pengbei.tech',
|
|
68305
|
-
headers: {
|
|
68306
|
-
'accept': '*/*',
|
|
68307
|
-
'X-Client': 'WEB',
|
|
68308
|
-
'X-Key': getCookies('X-Key'),
|
|
68309
|
-
'X-Token': getCookies('X-Token')
|
|
68310
|
-
},
|
|
68311
|
-
url: '/upload/upload',
|
|
68312
|
-
method: 'post',
|
|
68313
|
-
data: params
|
|
68314
|
-
});
|
|
68315
|
-
}
|
|
68316
68341
|
/**
|
|
68317
68342
|
* 通过后台转存网络图片
|
|
68318
68343
|
* @param {string} params
|
|
68319
68344
|
* @returns
|
|
68320
68345
|
*/
|
|
68321
68346
|
|
|
68347
|
+
|
|
68322
68348
|
function uploadNetworkImg(params) {
|
|
68323
68349
|
// 判断token是否过期
|
|
68324
68350
|
isTokenExpired();
|
|
68325
|
-
return
|
|
68326
|
-
baseURL:
|
|
68351
|
+
return request({
|
|
68352
|
+
baseURL: params.domain,
|
|
68327
68353
|
headers: {
|
|
68328
68354
|
'accept': '*/*',
|
|
68329
68355
|
'X-Client': 'WEB',
|
|
@@ -68343,6 +68369,15 @@ function uploadNetworkImg(params) {
|
|
|
68343
68369
|
// export function removeToken() {
|
|
68344
68370
|
// return Cookies.remove(TokenKey)
|
|
68345
68371
|
// }
|
|
68372
|
+
|
|
68373
|
+
|
|
68374
|
+
/* harmony default export */ var rmtFileUploadSdk = ({
|
|
68375
|
+
getCookies,
|
|
68376
|
+
getUpToken,
|
|
68377
|
+
isTokenExpired,
|
|
68378
|
+
uploadNetworkImg // uploadFile
|
|
68379
|
+
|
|
68380
|
+
});
|
|
68346
68381
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=script&lang=js&
|
|
68347
68382
|
|
|
68348
68383
|
// import { rmtFileUpload } from "./index.js";
|
|
@@ -68367,7 +68402,8 @@ function uploadNetworkImg(params) {
|
|
|
68367
68402
|
type: Object,
|
|
68368
68403
|
default: function () {
|
|
68369
68404
|
return {
|
|
68370
|
-
'type': 'img'
|
|
68405
|
+
'type': 'img',
|
|
68406
|
+
'removeOrientation': true
|
|
68371
68407
|
};
|
|
68372
68408
|
}
|
|
68373
68409
|
},
|
|
@@ -68418,15 +68454,34 @@ function uploadNetworkImg(params) {
|
|
|
68418
68454
|
type: String,
|
|
68419
68455
|
default: "/service-api"
|
|
68420
68456
|
},
|
|
68457
|
+
// 上传的图片服务器地址
|
|
68421
68458
|
uploadFileUrl: {
|
|
68422
68459
|
type: String,
|
|
68423
|
-
default: "/upload/upload"
|
|
68424
|
-
|
|
68460
|
+
default: "/upload/upload"
|
|
68425
68461
|
},
|
|
68462
|
+
// 上传的图片服务器地址
|
|
68426
68463
|
uploadDomain: {
|
|
68427
68464
|
type: String,
|
|
68428
|
-
default: 'https://attachment.pengbei.tech'
|
|
68429
|
-
|
|
68465
|
+
default: 'https://attachment.pengbei.tech'
|
|
68466
|
+
},
|
|
68467
|
+
// 请求前回调函数
|
|
68468
|
+
beforeFun: {
|
|
68469
|
+
type: Function,
|
|
68470
|
+
default: null
|
|
68471
|
+
},
|
|
68472
|
+
// 请求成功回调函数
|
|
68473
|
+
successFun: {
|
|
68474
|
+
type: Function,
|
|
68475
|
+
default: null
|
|
68476
|
+
},
|
|
68477
|
+
// 请求失败回调函数
|
|
68478
|
+
errorFun: {
|
|
68479
|
+
type: Function,
|
|
68480
|
+
default: null
|
|
68481
|
+
},
|
|
68482
|
+
mechanismList: {
|
|
68483
|
+
type: Array,
|
|
68484
|
+
default: null
|
|
68430
68485
|
}
|
|
68431
68486
|
},
|
|
68432
68487
|
|
|
@@ -68436,8 +68491,8 @@ function uploadNetworkImg(params) {
|
|
|
68436
68491
|
uploadList: [],
|
|
68437
68492
|
headers: {
|
|
68438
68493
|
// Authorization: "Bearer " + getToken(),
|
|
68439
|
-
// 'X-Key': getCookies('X-Key'),
|
|
68440
|
-
// 'X-Token': getCookies('X-Token'),
|
|
68494
|
+
// 'X-Key': rmtFileUploadSdk.getCookies('X-Key'),
|
|
68495
|
+
// 'X-Token': rmtFileUploadSdk.getCookies('X-Token'),
|
|
68441
68496
|
'X-Key': '',
|
|
68442
68497
|
'X-Token': '',
|
|
68443
68498
|
'X-Client': 'WEB'
|
|
@@ -68475,6 +68530,8 @@ function uploadNetworkImg(params) {
|
|
|
68475
68530
|
return item;
|
|
68476
68531
|
});
|
|
68477
68532
|
} else {
|
|
68533
|
+
this.imageUrl = "";
|
|
68534
|
+
this.hasUpload = false;
|
|
68478
68535
|
this.fileList = [];
|
|
68479
68536
|
return [];
|
|
68480
68537
|
}
|
|
@@ -68486,9 +68543,9 @@ function uploadNetworkImg(params) {
|
|
|
68486
68543
|
},
|
|
68487
68544
|
|
|
68488
68545
|
created() {
|
|
68489
|
-
isTokenExpired(() => {
|
|
68490
|
-
this.headers['X-Key'] = getCookies('X-Key');
|
|
68491
|
-
this.headers['X-Token'] = getCookies('X-Token');
|
|
68546
|
+
rmtFileUploadSdk.isTokenExpired(() => {
|
|
68547
|
+
this.headers['X-Key'] = rmtFileUploadSdk.getCookies('X-Key');
|
|
68548
|
+
this.headers['X-Token'] = rmtFileUploadSdk.getCookies('X-Token');
|
|
68492
68549
|
});
|
|
68493
68550
|
},
|
|
68494
68551
|
|
|
@@ -68502,7 +68559,12 @@ function uploadNetworkImg(params) {
|
|
|
68502
68559
|
methods: {
|
|
68503
68560
|
// 上传前校检格式和大小
|
|
68504
68561
|
async handleBeforeUpload(file) {
|
|
68505
|
-
var that = this;
|
|
68562
|
+
var that = this;
|
|
68563
|
+
|
|
68564
|
+
if (typeof that.beforeFun == 'function') {
|
|
68565
|
+
that.beforeFun(file);
|
|
68566
|
+
} // 校检文件类型
|
|
68567
|
+
|
|
68506
68568
|
|
|
68507
68569
|
if (that.fileType) {
|
|
68508
68570
|
let fileExtension = "";
|
|
@@ -68537,9 +68599,9 @@ function uploadNetworkImg(params) {
|
|
|
68537
68599
|
|
|
68538
68600
|
var isTokenOk = function () {
|
|
68539
68601
|
return new Promise((resolve, reject) => {
|
|
68540
|
-
isTokenExpired(() => {
|
|
68541
|
-
that.headers['X-Key'] = getCookies('X-Key');
|
|
68542
|
-
that.headers['X-Token'] = getCookies('X-Token');
|
|
68602
|
+
rmtFileUploadSdk.isTokenExpired(() => {
|
|
68603
|
+
that.headers['X-Key'] = rmtFileUploadSdk.getCookies('X-Key');
|
|
68604
|
+
that.headers['X-Token'] = rmtFileUploadSdk.getCookies('X-Token');
|
|
68543
68605
|
|
|
68544
68606
|
if (that.headers['X-Key']) {
|
|
68545
68607
|
console.log("token ok");
|
|
@@ -68573,10 +68635,14 @@ function uploadNetworkImg(params) {
|
|
|
68573
68635
|
},
|
|
68574
68636
|
|
|
68575
68637
|
// 上传失败
|
|
68576
|
-
handleUploadError() {
|
|
68638
|
+
handleUploadError(res) {
|
|
68577
68639
|
var that = this;
|
|
68578
68640
|
that.$message.error("上传失败,请重试");
|
|
68579
68641
|
that.$modal.closeLoading();
|
|
68642
|
+
|
|
68643
|
+
if (typeof that.errorFun == 'function') {
|
|
68644
|
+
that.errorFun(res);
|
|
68645
|
+
}
|
|
68580
68646
|
},
|
|
68581
68647
|
|
|
68582
68648
|
// 上传成功回调
|
|
@@ -68596,8 +68662,16 @@ function uploadNetworkImg(params) {
|
|
|
68596
68662
|
that.number = 0;
|
|
68597
68663
|
that.$emit("input", that.listToString(that.fileList));
|
|
68598
68664
|
}
|
|
68665
|
+
|
|
68666
|
+
if (typeof that.successFun == 'function') {
|
|
68667
|
+
that.successFun(res);
|
|
68668
|
+
}
|
|
68599
68669
|
} else {
|
|
68600
68670
|
that.$message.error(res.message || "上传失败");
|
|
68671
|
+
|
|
68672
|
+
if (typeof that.errorFun == 'function') {
|
|
68673
|
+
that.errorFun(res);
|
|
68674
|
+
}
|
|
68601
68675
|
}
|
|
68602
68676
|
|
|
68603
68677
|
that.$modal.closeLoading();
|
|
@@ -68639,7 +68713,6 @@ function uploadNetworkImg(params) {
|
|
|
68639
68713
|
var that = this;
|
|
68640
68714
|
|
|
68641
68715
|
if (res.data && res.data.url) {
|
|
68642
|
-
console.log(res);
|
|
68643
68716
|
that.$message.success("上传成功");
|
|
68644
68717
|
that.uploadList = [{
|
|
68645
68718
|
FileName: res.data.originalFileName,
|
|
@@ -68654,14 +68727,23 @@ function uploadNetworkImg(params) {
|
|
|
68654
68727
|
that.imageUrl = res.data.url;
|
|
68655
68728
|
that.$emit("input", that.listToString(that.uploadList));
|
|
68656
68729
|
that.hasUpload = true; // that.$emit("input", res.data.url);
|
|
68730
|
+
|
|
68731
|
+
if (typeof that.successFun == 'function') {
|
|
68732
|
+
that.successFun(res);
|
|
68733
|
+
}
|
|
68657
68734
|
} else {
|
|
68658
|
-
|
|
68735
|
+
this.$message.error("上传失败");
|
|
68736
|
+
|
|
68737
|
+
if (typeof that.errorFun == 'function') {
|
|
68738
|
+
that.errorFun(res);
|
|
68739
|
+
}
|
|
68659
68740
|
}
|
|
68660
68741
|
|
|
68661
68742
|
that.$modal.closeLoading();
|
|
68662
68743
|
},
|
|
68663
68744
|
|
|
68664
68745
|
uploadNetworkImg() {
|
|
68746
|
+
var that = this;
|
|
68665
68747
|
this.$prompt("请输入完整的图片网址", "请输入", {
|
|
68666
68748
|
inputValidator: v => {
|
|
68667
68749
|
console.log(v);
|
|
@@ -68681,11 +68763,12 @@ function uploadNetworkImg(params) {
|
|
|
68681
68763
|
|
|
68682
68764
|
if (v.value) {
|
|
68683
68765
|
const url = v.value.trim();
|
|
68684
|
-
const p = await uploadNetworkImg({
|
|
68766
|
+
const p = await rmtFileUploadSdk.uploadNetworkImg({
|
|
68685
68767
|
group: "cms",
|
|
68686
68768
|
urls: [{
|
|
68687
68769
|
url: url
|
|
68688
|
-
}]
|
|
68770
|
+
}],
|
|
68771
|
+
domain: that.uploadDomain
|
|
68689
68772
|
}).then(response => {
|
|
68690
68773
|
this.imageUrl = response.data[0].transferUrl;
|
|
68691
68774
|
this.$emit("input", response.data[0].transferUrl);
|
|
@@ -68697,33 +68780,28 @@ function uploadNetworkImg(params) {
|
|
|
68697
68780
|
}
|
|
68698
68781
|
}
|
|
68699
68782
|
});
|
|
68700
|
-
}
|
|
68701
|
-
|
|
68702
|
-
|
|
68703
|
-
|
|
68704
|
-
|
|
68705
|
-
|
|
68783
|
+
} // rmtFileUploadSdk.isTokenExpired() {
|
|
68784
|
+
// let expiresAt = rmtFileUploadSdk.getCookies('expiresAt');
|
|
68785
|
+
// let _expiresAt = new Date(expiresAt);
|
|
68786
|
+
// let _nowTime = Date.now();
|
|
68787
|
+
// let _timeNum = _expiresAt - _nowTime;
|
|
68788
|
+
// if (typeof expiresAt == 'undefined') {
|
|
68789
|
+
// return true
|
|
68790
|
+
// } else if (_timeNum > 0 && _timeNum <= 1000 * 60 * 30) {
|
|
68791
|
+
// return true
|
|
68792
|
+
// } else {
|
|
68793
|
+
// return false
|
|
68794
|
+
// }
|
|
68795
|
+
// }
|
|
68706
68796
|
|
|
68707
|
-
let _nowTime = Date.now();
|
|
68708
|
-
|
|
68709
|
-
let _timeNum = _expiresAt - _nowTime;
|
|
68710
|
-
|
|
68711
|
-
if (typeof expiresAt == 'undefined') {
|
|
68712
|
-
return true;
|
|
68713
|
-
} else if (_timeNum > 0 && _timeNum <= 1000 * 60 * 30) {
|
|
68714
|
-
return true;
|
|
68715
|
-
} else {
|
|
68716
|
-
return false;
|
|
68717
|
-
}
|
|
68718
|
-
}
|
|
68719
68797
|
|
|
68720
68798
|
}
|
|
68721
68799
|
});
|
|
68722
68800
|
;// CONCATENATED MODULE: ./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=script&lang=js&
|
|
68723
68801
|
/* harmony default export */ var rmtFileUpload_rmtFileUploadvue_type_script_lang_js_ = (rmtFileUploadvue_type_script_lang_js_);
|
|
68724
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=style&index=0&id=
|
|
68725
|
-
var
|
|
68726
|
-
;// CONCATENATED MODULE: ./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=style&index=0&id=
|
|
68802
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=style&index=0&id=09d51dff&prod&scoped=true&lang=scss&
|
|
68803
|
+
var rmtFileUploadvue_type_style_index_0_id_09d51dff_prod_scoped_true_lang_scss_ = __webpack_require__(3049);
|
|
68804
|
+
;// CONCATENATED MODULE: ./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=style&index=0&id=09d51dff&prod&scoped=true&lang=scss&
|
|
68727
68805
|
|
|
68728
68806
|
;// CONCATENATED MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
|
|
68729
68807
|
/* globals __VUE_SSR_CONTEXT__ */
|
|
@@ -68838,7 +68916,7 @@ var component = normalizeComponent(
|
|
|
68838
68916
|
staticRenderFns,
|
|
68839
68917
|
false,
|
|
68840
68918
|
null,
|
|
68841
|
-
"
|
|
68919
|
+
"09d51dff",
|
|
68842
68920
|
null
|
|
68843
68921
|
|
|
68844
68922
|
)
|