arengibook 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +599 -1718
- package/package.json +6 -4
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { useContext, useEffect, useState, useRef } from 'react';
|
|
2
|
+
import React__default, { useContext, useEffect, useState, useRef, Fragment } from 'react';
|
|
3
3
|
import ReactDOM from 'react-dom';
|
|
4
4
|
|
|
5
5
|
function _arrayWithHoles$g(r) {
|
|
@@ -526,11 +526,18 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
526
526
|
element.style.transformOrigin = 'top';
|
|
527
527
|
}
|
|
528
528
|
var targetOffsetPx = targetOffset.left;
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
529
|
+
if (align === 'left') {
|
|
530
|
+
if (targetOffsetPx + elementOuterWidth > viewport.width) {
|
|
531
|
+
left = Math.max(0, targetOffsetPx + windowScrollLeft + targetOuterWidth - elementOuterWidth);
|
|
532
|
+
} else {
|
|
533
|
+
left = targetOffsetPx + windowScrollLeft;
|
|
534
|
+
}
|
|
532
535
|
} else {
|
|
533
|
-
|
|
536
|
+
if (targetOffsetPx + targetOuterWidth - elementOuterWidth < 0) {
|
|
537
|
+
left = windowScrollLeft;
|
|
538
|
+
} else {
|
|
539
|
+
left = targetOffsetPx + targetOuterWidth - elementOuterWidth + windowScrollLeft;
|
|
540
|
+
}
|
|
534
541
|
}
|
|
535
542
|
element.style.top = top + 'px';
|
|
536
543
|
element.style.left = left + 'px';
|
|
@@ -739,13 +746,12 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
739
746
|
/**
|
|
740
747
|
* Gets all scrollable parent elements of a given element
|
|
741
748
|
* @param {HTMLElement} element - The element to find scrollable parents for
|
|
742
|
-
* @param {boolean} hideOverlaysOnDocumentScrolling - Whether to include window/document level scrolling
|
|
743
749
|
* @returns {Array} Array of scrollable parent elements
|
|
744
750
|
*/
|
|
745
751
|
}, {
|
|
746
752
|
key: "getScrollableParents",
|
|
747
753
|
value: function getScrollableParents(element) {
|
|
748
|
-
var
|
|
754
|
+
var _this3 = this;
|
|
749
755
|
var scrollableParents = [];
|
|
750
756
|
if (element) {
|
|
751
757
|
// Get all parent elements
|
|
@@ -768,10 +774,8 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
768
774
|
* @param {HTMLElement} node - Element to add
|
|
769
775
|
*/
|
|
770
776
|
var addScrollableParent = function addScrollableParent(node) {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
scrollableParents.push(node.nodeName === 'BODY' || node.nodeName === 'HTML' || node.nodeType === 9 ? window : node);
|
|
774
|
-
}
|
|
777
|
+
// For document/body/html elements, add window instead
|
|
778
|
+
scrollableParents.push(node.nodeName === 'BODY' || node.nodeName === 'HTML' || _this3.isDocument(node) ? window : node);
|
|
775
779
|
};
|
|
776
780
|
|
|
777
781
|
// Iterate through all parent elements
|
|
@@ -815,13 +819,6 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
815
819
|
_iterator.f();
|
|
816
820
|
}
|
|
817
821
|
}
|
|
818
|
-
|
|
819
|
-
// Ensure window/body is always included as fallback
|
|
820
|
-
if (!scrollableParents.some(function (node) {
|
|
821
|
-
return node === document.body || node === window;
|
|
822
|
-
})) {
|
|
823
|
-
scrollableParents.push(hideOverlaysOnDocumentScrolling ? window : document.body);
|
|
824
|
-
}
|
|
825
822
|
return scrollableParents;
|
|
826
823
|
}
|
|
827
824
|
}, {
|
|
@@ -961,6 +958,11 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
961
958
|
value: function isElement(obj) {
|
|
962
959
|
return (typeof HTMLElement === "undefined" ? "undefined" : _typeof$h(HTMLElement)) === 'object' ? obj instanceof HTMLElement : obj && _typeof$h(obj) === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string';
|
|
963
960
|
}
|
|
961
|
+
}, {
|
|
962
|
+
key: "isDocument",
|
|
963
|
+
value: function isDocument(obj) {
|
|
964
|
+
return (typeof Document === "undefined" ? "undefined" : _typeof$h(Document)) === 'object' ? obj instanceof Document : obj && _typeof$h(obj) === 'object' && obj !== null && obj.nodeType === 9;
|
|
965
|
+
}
|
|
964
966
|
}, {
|
|
965
967
|
key: "scrollInView",
|
|
966
968
|
value: function scrollInView(container, item) {
|
|
@@ -1298,7 +1300,7 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
1298
1300
|
return !!(obj && obj.constructor && obj.call && obj.apply);
|
|
1299
1301
|
};
|
|
1300
1302
|
var element = isFunction(target) ? target() : target;
|
|
1301
|
-
return element
|
|
1303
|
+
return this.isDocument(element) || this.isExist(element) ? element : null;
|
|
1302
1304
|
}
|
|
1303
1305
|
|
|
1304
1306
|
/**
|
|
@@ -2011,6 +2013,122 @@ var ObjectUtils = /*#__PURE__*/function () {
|
|
|
2011
2013
|
obj = obj[fields[i]];
|
|
2012
2014
|
}
|
|
2013
2015
|
}
|
|
2016
|
+
|
|
2017
|
+
/**
|
|
2018
|
+
* This helper function takes an object and a dot-separated key path. It traverses the object based on the path,
|
|
2019
|
+
* returning the value at the specified depth. If any part of the path is missing or undefined, it returns undefined.
|
|
2020
|
+
*
|
|
2021
|
+
* Example:
|
|
2022
|
+
* const obj = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
|
|
2023
|
+
* const path = 'address.city';
|
|
2024
|
+
* const result = ObjectUtils.getNestedValue(obj, path);
|
|
2025
|
+
* console.log(result); // Output: "Wonderland"
|
|
2026
|
+
*
|
|
2027
|
+
* @param {object} obj - The object to traverse.
|
|
2028
|
+
* @param {string} path - The dot-separated key path.
|
|
2029
|
+
* @returns {*} The value at the specified depth, or undefined if any part of the path is missing or undefined.
|
|
2030
|
+
*/
|
|
2031
|
+
}, {
|
|
2032
|
+
key: "getNestedValue",
|
|
2033
|
+
value: function getNestedValue(obj, path) {
|
|
2034
|
+
return path.split('.').reduce(function (acc, part) {
|
|
2035
|
+
return acc && acc[part] !== undefined ? acc[part] : undefined;
|
|
2036
|
+
}, obj);
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
/**
|
|
2040
|
+
* This function takes an object and a dot-separated key path. It traverses the object based on the path,
|
|
2041
|
+
* returning the value at the specified depth. If any part of the path is missing or undefined, it returns undefined.
|
|
2042
|
+
*
|
|
2043
|
+
* Example:
|
|
2044
|
+
* const objA = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
|
|
2045
|
+
* const objB = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
|
|
2046
|
+
* const result = ObjectUtils.absoluteCompare(objA, objB);
|
|
2047
|
+
* console.log(result); // Output: true
|
|
2048
|
+
*
|
|
2049
|
+
* const objC = { name: 'Alice', address: { city: 'Wonderland', zip: 12346 } };
|
|
2050
|
+
* const result2 = ObjectUtils.absoluteCompare(objA, objC);
|
|
2051
|
+
* console.log(result2); // Output: false
|
|
2052
|
+
*
|
|
2053
|
+
* @param {object} objA - The first object to compare.
|
|
2054
|
+
* @param {object} objB - The second object to compare.
|
|
2055
|
+
* @param {number} [maxDepth=1] - The maximum depth to compare.
|
|
2056
|
+
* @param {number} [currentDepth=0] - The current depth (used internally for recursion).
|
|
2057
|
+
* @returns {boolean} True if the objects are equal within the specified depth, false otherwise.
|
|
2058
|
+
*
|
|
2059
|
+
*/
|
|
2060
|
+
}, {
|
|
2061
|
+
key: "absoluteCompare",
|
|
2062
|
+
value: function absoluteCompare(objA, objB) {
|
|
2063
|
+
var maxDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
2064
|
+
var currentDepth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
2065
|
+
if (!objA || !objB) return true;
|
|
2066
|
+
if (currentDepth > maxDepth) return true;
|
|
2067
|
+
if (_typeof$h(objA) !== _typeof$h(objB)) return false;
|
|
2068
|
+
var aKeys = Object.keys(objA);
|
|
2069
|
+
var bKeys = Object.keys(objB);
|
|
2070
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
2071
|
+
for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) {
|
|
2072
|
+
var key = _aKeys[_i];
|
|
2073
|
+
var aValue = objA[key];
|
|
2074
|
+
var bValue = objB[key];
|
|
2075
|
+
|
|
2076
|
+
// Skip comparison if values are objects
|
|
2077
|
+
var isObject = ObjectUtils.isObject(aValue) && ObjectUtils.isObject(bValue);
|
|
2078
|
+
var isFunction = ObjectUtils.isFunction(aValue) && ObjectUtils.isFunction(bValue);
|
|
2079
|
+
if ((isObject || isFunction) && !this.absoluteCompare(aValue, bValue, maxDepth, currentDepth + 1)) return false;
|
|
2080
|
+
if (!isObject && aValue !== bValue) return false;
|
|
2081
|
+
}
|
|
2082
|
+
return true;
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
/**
|
|
2086
|
+
* This helper function takes two objects and a list of keys to compare. It compares the values of the specified keys
|
|
2087
|
+
* in both objects. If any comparison fails, it returns false. If all specified properties are equal, it returns true.
|
|
2088
|
+
* It performs a shallow comparison using absoluteCompare if no keys are provided.
|
|
2089
|
+
*
|
|
2090
|
+
* Example:
|
|
2091
|
+
* const objA = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
|
|
2092
|
+
* const objB = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
|
|
2093
|
+
* const keysToCompare = ['name', 'address.city', 'address.zip'];
|
|
2094
|
+
* const result = ObjectUtils.selectiveCompare(objA, objB, keysToCompare);
|
|
2095
|
+
* console.log(result); // Output: true
|
|
2096
|
+
*
|
|
2097
|
+
* const objC = { name: 'Alice', address: { city: 'Wonderland', zip: 12346 } };
|
|
2098
|
+
* const result2 = ObjectUtils.selectiveCompare(objA, objC, keysToCompare);
|
|
2099
|
+
* console.log(result2); // Output: false
|
|
2100
|
+
*
|
|
2101
|
+
* @param {object} a - The first object to compare.
|
|
2102
|
+
* @param {object} b - The second object to compare.
|
|
2103
|
+
* @param {string[]} [keysToCompare] - The keys to compare. If not provided, performs a shallow comparison using absoluteCompare.
|
|
2104
|
+
* @returns {boolean} True if all specified properties are equal, false otherwise.
|
|
2105
|
+
*/
|
|
2106
|
+
}, {
|
|
2107
|
+
key: "selectiveCompare",
|
|
2108
|
+
value: function selectiveCompare(a, b, keysToCompare) {
|
|
2109
|
+
if (a === b) return true;
|
|
2110
|
+
if (!a || !b || _typeof$h(a) !== 'object' || _typeof$h(b) !== 'object') return false;
|
|
2111
|
+
if (!keysToCompare) return this.absoluteCompare(a, b, 1); // If no keys are provided, the comparison is limited to one depth level.
|
|
2112
|
+
var _iterator2 = _createForOfIteratorHelper$4(keysToCompare),
|
|
2113
|
+
_step2;
|
|
2114
|
+
try {
|
|
2115
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
2116
|
+
var key = _step2.value;
|
|
2117
|
+
var aValue = this.getNestedValue(a, key);
|
|
2118
|
+
var bValue = this.getNestedValue(b, key);
|
|
2119
|
+
var isObject = _typeof$h(aValue) === 'object' && aValue !== null && _typeof$h(bValue) === 'object' && bValue !== null;
|
|
2120
|
+
|
|
2121
|
+
// If the current key is an object, they are compared in one further level only.
|
|
2122
|
+
if (isObject && !this.absoluteCompare(aValue, bValue, 1)) return false;
|
|
2123
|
+
if (!isObject && aValue !== bValue) return false;
|
|
2124
|
+
}
|
|
2125
|
+
} catch (err) {
|
|
2126
|
+
_iterator2.e(err);
|
|
2127
|
+
} finally {
|
|
2128
|
+
_iterator2.f();
|
|
2129
|
+
}
|
|
2130
|
+
return true;
|
|
2131
|
+
}
|
|
2014
2132
|
}]);
|
|
2015
2133
|
}();
|
|
2016
2134
|
|
|
@@ -3531,7 +3649,14 @@ var useOverlayScrollListener = function useOverlayScrollListener(_ref) {
|
|
|
3531
3649
|
}
|
|
3532
3650
|
if (!listenerRef.current && targetRef.current) {
|
|
3533
3651
|
var hideOnScroll = context ? context.hideOverlaysOnDocumentScrolling : PrimeReact$2.hideOverlaysOnDocumentScrolling;
|
|
3534
|
-
var nodes = scrollableParentsRef.current = DomHandler.getScrollableParents(targetRef.current
|
|
3652
|
+
var nodes = scrollableParentsRef.current = DomHandler.getScrollableParents(targetRef.current);
|
|
3653
|
+
|
|
3654
|
+
// Ensure window/body is always included as fallback
|
|
3655
|
+
if (!nodes.some(function (node) {
|
|
3656
|
+
return node === document.body || node === window;
|
|
3657
|
+
})) {
|
|
3658
|
+
nodes.push(hideOnScroll ? window : document.body);
|
|
3659
|
+
}
|
|
3535
3660
|
listenerRef.current = function (event) {
|
|
3536
3661
|
return listener && listener(event);
|
|
3537
3662
|
};
|
|
@@ -3623,7 +3748,8 @@ var useOverlayListener = function useOverlayListener(_ref) {
|
|
|
3623
3748
|
type: 'outside',
|
|
3624
3749
|
valid: event.which !== 3 && isOutsideClicked(event)
|
|
3625
3750
|
});
|
|
3626
|
-
}
|
|
3751
|
+
},
|
|
3752
|
+
when: when
|
|
3627
3753
|
}),
|
|
3628
3754
|
_useEventListener2 = _slicedToArray$f(_useEventListener, 2),
|
|
3629
3755
|
bindDocumentClickListener = _useEventListener2[0],
|
|
@@ -3634,7 +3760,8 @@ var useOverlayListener = function useOverlayListener(_ref) {
|
|
|
3634
3760
|
type: 'resize',
|
|
3635
3761
|
valid: !DomHandler.isTouchDevice()
|
|
3636
3762
|
});
|
|
3637
|
-
}
|
|
3763
|
+
},
|
|
3764
|
+
when: when
|
|
3638
3765
|
}),
|
|
3639
3766
|
_useResizeListener2 = _slicedToArray$f(_useResizeListener, 2),
|
|
3640
3767
|
bindWindowResizeListener = _useResizeListener2[0],
|
|
@@ -3647,7 +3774,8 @@ var useOverlayListener = function useOverlayListener(_ref) {
|
|
|
3647
3774
|
type: 'orientationchange',
|
|
3648
3775
|
valid: true
|
|
3649
3776
|
});
|
|
3650
|
-
}
|
|
3777
|
+
},
|
|
3778
|
+
when: when
|
|
3651
3779
|
}),
|
|
3652
3780
|
_useEventListener4 = _slicedToArray$f(_useEventListener3, 2),
|
|
3653
3781
|
bindWindowOrientationChangeListener = _useEventListener4[0],
|
|
@@ -3659,7 +3787,8 @@ var useOverlayListener = function useOverlayListener(_ref) {
|
|
|
3659
3787
|
type: 'scroll',
|
|
3660
3788
|
valid: true
|
|
3661
3789
|
});
|
|
3662
|
-
}
|
|
3790
|
+
},
|
|
3791
|
+
when: when
|
|
3663
3792
|
}),
|
|
3664
3793
|
_useOverlayScrollList2 = _slicedToArray$f(_useOverlayScrollList, 2),
|
|
3665
3794
|
bindOverlayScrollListener = _useOverlayScrollList2[0],
|
|
@@ -8827,7 +8956,7 @@ var Calendar = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (i
|
|
|
8827
8956
|
isUnstyled = _CalendarBase$setMeta.isUnstyled;
|
|
8828
8957
|
useGlobalOnEscapeKey({
|
|
8829
8958
|
callback: function callback() {
|
|
8830
|
-
hide();
|
|
8959
|
+
hide(null, reFocusInputField);
|
|
8831
8960
|
},
|
|
8832
8961
|
when: overlayVisibleState && overlayDisplayOrder,
|
|
8833
8962
|
priority: [ESC_KEY_HANDLING_PRIORITIES.OVERLAY_PANEL, overlayDisplayOrder]
|
|
@@ -8878,7 +9007,15 @@ var Calendar = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (i
|
|
|
8878
9007
|
var type = _ref.type,
|
|
8879
9008
|
valid = _ref.valid;
|
|
8880
9009
|
if (valid) {
|
|
8881
|
-
type === 'outside'
|
|
9010
|
+
if (type === 'outside') {
|
|
9011
|
+
if (!isOverlayClicked.current && !isNavIconClicked(event.target)) {
|
|
9012
|
+
hide('outside');
|
|
9013
|
+
}
|
|
9014
|
+
} else if (context.hideOverlaysOnDocumentScrolling) {
|
|
9015
|
+
hide();
|
|
9016
|
+
} else if (!DomHandler.isDocument(event.target)) {
|
|
9017
|
+
alignOverlay();
|
|
9018
|
+
}
|
|
8882
9019
|
}
|
|
8883
9020
|
isOverlayClicked.current = false;
|
|
8884
9021
|
},
|
|
@@ -15677,7 +15814,15 @@ var Dropdown$1 = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
|
|
|
15677
15814
|
var type = _ref.type,
|
|
15678
15815
|
valid = _ref.valid;
|
|
15679
15816
|
if (valid) {
|
|
15680
|
-
type === 'outside'
|
|
15817
|
+
if (type === 'outside') {
|
|
15818
|
+
if (!isClearClicked(event)) {
|
|
15819
|
+
hide();
|
|
15820
|
+
}
|
|
15821
|
+
} else if (context.hideOverlaysOnDocumentScrolling) {
|
|
15822
|
+
hide();
|
|
15823
|
+
} else if (!DomHandler.isDocument(event.target)) {
|
|
15824
|
+
alignOverlay();
|
|
15825
|
+
}
|
|
15681
15826
|
}
|
|
15682
15827
|
},
|
|
15683
15828
|
when: overlayVisibleState
|
|
@@ -15876,12 +16021,14 @@ var Dropdown$1 = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
|
|
|
15876
16021
|
case 'ArrowRight':
|
|
15877
16022
|
onArrowLeftKey(event, true);
|
|
15878
16023
|
break;
|
|
15879
|
-
case 'Escape':
|
|
15880
16024
|
case 'Enter':
|
|
15881
16025
|
case 'NumpadEnter':
|
|
15882
16026
|
onEnterKey(event);
|
|
15883
16027
|
event.preventDefault();
|
|
15884
16028
|
break;
|
|
16029
|
+
case 'Escape':
|
|
16030
|
+
onEscapeKey(event);
|
|
16031
|
+
break;
|
|
15885
16032
|
}
|
|
15886
16033
|
};
|
|
15887
16034
|
var hasFocusableElements = function hasFocusableElements() {
|
|
@@ -16623,6 +16770,7 @@ var Dropdown$1 = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
|
|
|
16623
16770
|
"in": overlayVisibleState,
|
|
16624
16771
|
isOptionDisabled: isOptionDisabled,
|
|
16625
16772
|
isSelected: isSelected,
|
|
16773
|
+
onOverlayHide: hide,
|
|
16626
16774
|
onClick: onPanelClick,
|
|
16627
16775
|
onEnter: onOverlayEnter,
|
|
16628
16776
|
onEntered: onOverlayEntered,
|
|
@@ -18165,8 +18313,11 @@ var InputNumber = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
|
|
|
18165
18313
|
newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
|
|
18166
18314
|
updateValue(event, newValueStr, text, 'insert');
|
|
18167
18315
|
} else if (decimalCharIndex === -1 && (maxFractionDigits || props.maxFractionDigits)) {
|
|
18168
|
-
|
|
18169
|
-
|
|
18316
|
+
var allowedDecimal = inputMode !== 'numeric' || inputMode === 'numeric' && (props.min || props.max);
|
|
18317
|
+
if (allowedDecimal) {
|
|
18318
|
+
newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
|
|
18319
|
+
updateValue(event, newValueStr, text, 'insert');
|
|
18320
|
+
}
|
|
18170
18321
|
}
|
|
18171
18322
|
} else {
|
|
18172
18323
|
var operation = selectionStart !== selectionEnd ? 'range-insert' : 'insert';
|
|
@@ -20863,7 +21014,7 @@ var Checkbox = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (i
|
|
|
20863
21014
|
return props.checked === props.trueValue;
|
|
20864
21015
|
};
|
|
20865
21016
|
var _onChange = function onChange(event) {
|
|
20866
|
-
if (props.disabled || props.
|
|
21017
|
+
if (props.disabled || props.readOnly) {
|
|
20867
21018
|
return;
|
|
20868
21019
|
}
|
|
20869
21020
|
if (props.onChange) {
|
|
@@ -21122,7 +21273,7 @@ var RadioButton = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
|
|
|
21122
21273
|
onChange(event);
|
|
21123
21274
|
};
|
|
21124
21275
|
var onChange = function onChange(event) {
|
|
21125
|
-
if (props.disabled || props.
|
|
21276
|
+
if (props.disabled || props.readOnly) {
|
|
21126
21277
|
return;
|
|
21127
21278
|
}
|
|
21128
21279
|
if (props.onChange) {
|
|
@@ -21225,7 +21376,7 @@ var RadioButton = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function
|
|
|
21225
21376
|
onBlur: onBlur,
|
|
21226
21377
|
onChange: onChange,
|
|
21227
21378
|
disabled: props.disabled,
|
|
21228
|
-
readOnly: props.
|
|
21379
|
+
readOnly: props.readOnly,
|
|
21229
21380
|
required: props.required,
|
|
21230
21381
|
tabIndex: props.tabIndex,
|
|
21231
21382
|
className: cx('input')
|
|
@@ -21298,7 +21449,7 @@ RowRadioButton.displayName = 'RowRadioButton';
|
|
|
21298
21449
|
|
|
21299
21450
|
function ownKeys$b(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21300
21451
|
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), true).forEach(function (r) { _defineProperty$2(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21301
|
-
var
|
|
21452
|
+
var Cell = function Cell(props) {
|
|
21302
21453
|
var mergeProps = useMergeProps();
|
|
21303
21454
|
var _React$useState = React.useState(props.editing),
|
|
21304
21455
|
_React$useState2 = _slicedToArray$3(_React$useState, 2),
|
|
@@ -21326,13 +21477,9 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21326
21477
|
var getColumnProp = function getColumnProp(name) {
|
|
21327
21478
|
return ColumnBase.getCProp(props.column, name);
|
|
21328
21479
|
};
|
|
21329
|
-
var getColumnProps = function getColumnProps() {
|
|
21330
|
-
return ColumnBase.getCProps(props.column);
|
|
21331
|
-
};
|
|
21332
21480
|
var getColumnPTOptions = function getColumnPTOptions(key) {
|
|
21333
|
-
var cProps = getColumnProps();
|
|
21334
21481
|
var columnMetaData = {
|
|
21335
|
-
props: cProps,
|
|
21482
|
+
props: props.cProps,
|
|
21336
21483
|
parent: props.metaData,
|
|
21337
21484
|
hostName: props.hostName,
|
|
21338
21485
|
state: {
|
|
@@ -21348,10 +21495,8 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21348
21495
|
};
|
|
21349
21496
|
return mergeProps(ptm("column.".concat(key), {
|
|
21350
21497
|
column: columnMetaData
|
|
21351
|
-
}), ptm("column.".concat(key), columnMetaData), ptmo(cProps, key, columnMetaData));
|
|
21498
|
+
}), ptm("column.".concat(key), columnMetaData), ptmo(props.cProps, key, columnMetaData));
|
|
21352
21499
|
};
|
|
21353
|
-
var field = getColumnProp('field') || "field_".concat(props.index);
|
|
21354
|
-
var editingKey = props.dataKey ? props.rowData && props.rowData[props.dataKey] || props.rowIndex : props.rowIndex;
|
|
21355
21500
|
var isEditable = function isEditable() {
|
|
21356
21501
|
return ObjectUtils.isNotEmpty(props.editMode) && getColumnProp('editor');
|
|
21357
21502
|
};
|
|
@@ -21376,34 +21521,22 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21376
21521
|
_useEventListener2 = _slicedToArray$3(_useEventListener, 2),
|
|
21377
21522
|
bindDocumentClickListener = _useEventListener2[0],
|
|
21378
21523
|
unbindDocumentClickListener = _useEventListener2[1];
|
|
21379
|
-
var isSelected = function isSelected() {
|
|
21380
|
-
return props.selection ? props.selection instanceof Array ? findIndex(props.selection) > -1 : equals(props.selection) : false;
|
|
21381
|
-
};
|
|
21382
|
-
var equalsData = function equalsData(data) {
|
|
21383
|
-
return props.compareSelectionBy === 'equals' ? data === props.rowData : ObjectUtils.equals(data, props.rowData, props.dataKey);
|
|
21384
|
-
};
|
|
21385
|
-
var equals = function equals(selectedCell) {
|
|
21386
|
-
return selectedCell && (selectedCell.rowIndex === props.rowIndex || equalsData(selectedCell.rowData)) && (selectedCell.field === field || selectedCell.cellIndex === props.index);
|
|
21387
|
-
};
|
|
21388
21524
|
var isOutsideClicked = function isOutsideClicked(target) {
|
|
21389
21525
|
return elementRef.current && !(elementRef.current.isSameNode(target) || elementRef.current.contains(target));
|
|
21390
21526
|
};
|
|
21391
|
-
var getVirtualScrollerOption = function getVirtualScrollerOption(option) {
|
|
21392
|
-
return props.virtualScrollerOptions ? props.virtualScrollerOptions[option] : null;
|
|
21393
|
-
};
|
|
21394
21527
|
var getStyle = function getStyle() {
|
|
21395
21528
|
var bodyStyle = getColumnProp('bodyStyle');
|
|
21396
21529
|
var columnStyle = getColumnProp('style');
|
|
21397
|
-
return
|
|
21530
|
+
return props.frozenCol ? Object.assign({}, columnStyle, bodyStyle, styleObjectState) : Object.assign({}, columnStyle, bodyStyle);
|
|
21398
21531
|
};
|
|
21399
21532
|
var getCellParams = function getCellParams() {
|
|
21400
21533
|
return {
|
|
21401
|
-
value: resolveFieldData(),
|
|
21402
|
-
field: field,
|
|
21534
|
+
value: props.resolveFieldData(),
|
|
21535
|
+
field: props.field,
|
|
21403
21536
|
rowData: props.rowData,
|
|
21404
21537
|
rowIndex: props.rowIndex,
|
|
21405
21538
|
cellIndex: props.index,
|
|
21406
|
-
selected:
|
|
21539
|
+
selected: props.isCellSelected,
|
|
21407
21540
|
column: props.column,
|
|
21408
21541
|
props: props
|
|
21409
21542
|
};
|
|
@@ -21414,20 +21547,6 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21414
21547
|
originalEvent: event
|
|
21415
21548
|
}, params);
|
|
21416
21549
|
};
|
|
21417
|
-
var resolveFieldData = function resolveFieldData(data) {
|
|
21418
|
-
return ObjectUtils.resolveFieldData(data || props.rowData, field);
|
|
21419
|
-
};
|
|
21420
|
-
var getEditingRowData = function getEditingRowData() {
|
|
21421
|
-
return props.editingMeta && props.editingMeta[editingKey] ? props.editingMeta[editingKey].data : props.rowData;
|
|
21422
|
-
};
|
|
21423
|
-
var getTabIndex = function getTabIndex(cellSelected) {
|
|
21424
|
-
return props.allowCellSelection ? cellSelected ? 0 : props.rowIndex === 0 && props.index === 0 ? props.tabIndex : -1 : null;
|
|
21425
|
-
};
|
|
21426
|
-
var findIndex = function findIndex(collection) {
|
|
21427
|
-
return (collection || []).findIndex(function (data) {
|
|
21428
|
-
return equals(data);
|
|
21429
|
-
});
|
|
21430
|
-
};
|
|
21431
21550
|
var closeCell = function closeCell(event) {
|
|
21432
21551
|
var params = getCellCallbackParams(event);
|
|
21433
21552
|
var onBeforeCellEditHide = getColumnProp('onBeforeCellEditHide');
|
|
@@ -21448,7 +21567,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21448
21567
|
var switchCellToViewMode = function switchCellToViewMode(event, submit) {
|
|
21449
21568
|
var callbackParams = getCellCallbackParams(event);
|
|
21450
21569
|
var newRowData = _objectSpread$b({}, editingRowDataStateRef.current);
|
|
21451
|
-
var newValue = resolveFieldData(newRowData);
|
|
21570
|
+
var newValue = props.resolveFieldData(newRowData);
|
|
21452
21571
|
var params = _objectSpread$b(_objectSpread$b({}, callbackParams), {}, {
|
|
21453
21572
|
newRowData: newRowData,
|
|
21454
21573
|
newValue: newValue
|
|
@@ -21473,128 +21592,20 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21473
21592
|
}
|
|
21474
21593
|
setEditingRowDataState(newRowData);
|
|
21475
21594
|
};
|
|
21476
|
-
var _findNextSelectableCell = function findNextSelectableCell(cell) {
|
|
21477
|
-
var nextCell = cell.nextElementSibling;
|
|
21478
|
-
return nextCell ? DomHandler.getAttribute(nextCell, 'data-p-selectable-cell') ? nextCell : _findNextSelectableCell(nextCell) : null;
|
|
21479
|
-
};
|
|
21480
|
-
var _findPrevSelectableCell = function findPrevSelectableCell(cell) {
|
|
21481
|
-
var prevCell = cell.previousElementSibling;
|
|
21482
|
-
return prevCell ? DomHandler.getAttribute(prevCell, 'data-p-selectable-cell') ? prevCell : _findPrevSelectableCell(prevCell) : null;
|
|
21483
|
-
};
|
|
21484
|
-
var _findDownSelectableCell = function findDownSelectableCell(cell) {
|
|
21485
|
-
var downRow = cell.parentElement.nextElementSibling;
|
|
21486
|
-
var downCell = downRow ? downRow.children[props.index] : null;
|
|
21487
|
-
return downRow && downCell ? DomHandler.getAttribute(downRow, 'data-p-selectable-row') && DomHandler.getAttribute(downCell, 'data-p-selectable-cell') ? downCell : _findDownSelectableCell(downCell) : null;
|
|
21488
|
-
};
|
|
21489
|
-
var _findUpSelectableCell = function findUpSelectableCell(cell) {
|
|
21490
|
-
var upRow = cell.parentElement.previousElementSibling;
|
|
21491
|
-
var upCell = upRow ? upRow.children[props.index] : null;
|
|
21492
|
-
return upRow && upCell ? DomHandler.getAttribute(upRow, 'data-p-selectable-row') && DomHandler.getAttribute(upCell, 'data-p-selectable-cell') ? upCell : _findUpSelectableCell(upCell) : null;
|
|
21493
|
-
};
|
|
21494
|
-
var changeTabIndex = function changeTabIndex(currentCell, nextCell) {
|
|
21495
|
-
if (currentCell && nextCell) {
|
|
21496
|
-
currentCell.tabIndex = -1;
|
|
21497
|
-
nextCell.tabIndex = props.tabIndex;
|
|
21498
|
-
}
|
|
21499
|
-
};
|
|
21500
|
-
var focusOnElement = function focusOnElement() {
|
|
21501
|
-
clearTimeout(focusTimeout.current);
|
|
21502
|
-
focusTimeout.current = setTimeout(function () {
|
|
21503
|
-
if (editingState) {
|
|
21504
|
-
var focusableEl = props.editMode === 'cell' ? DomHandler.getFirstFocusableElement(elementRef.current, ':not([data-pc-section="editorkeyhelperlabel"])') : DomHandler.findSingle(elementRef.current, '[data-p-row-editor-save="true"]');
|
|
21505
|
-
focusableEl && focusableEl.focus();
|
|
21506
|
-
}
|
|
21507
|
-
keyHelperRef.current && (keyHelperRef.current.tabIndex = editingState ? -1 : 0);
|
|
21508
|
-
}, 1);
|
|
21509
|
-
};
|
|
21510
|
-
var focusOnInit = function focusOnInit() {
|
|
21511
|
-
clearTimeout(initFocusTimeout.current);
|
|
21512
|
-
initFocusTimeout.current = setTimeout(function () {
|
|
21513
|
-
var focusableEl = props.editMode === 'row' ? DomHandler.findSingle(elementRef.current, '[data-p-row-editor-init="true"]') : null;
|
|
21514
|
-
focusableEl && focusableEl.focus();
|
|
21515
|
-
}, 1);
|
|
21516
|
-
};
|
|
21517
|
-
var updateStickyPosition = function updateStickyPosition() {
|
|
21518
|
-
if (getColumnProp('frozen')) {
|
|
21519
|
-
var styleObject = _objectSpread$b({}, styleObjectState);
|
|
21520
|
-
var align = getColumnProp('alignFrozen');
|
|
21521
|
-
if (align === 'right') {
|
|
21522
|
-
var right = 0;
|
|
21523
|
-
var next = elementRef.current && elementRef.current.nextElementSibling;
|
|
21524
|
-
if (next && next.classList.contains('p-frozen-column')) {
|
|
21525
|
-
right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right || 0);
|
|
21526
|
-
}
|
|
21527
|
-
styleObject.right = right + 'px';
|
|
21528
|
-
} else {
|
|
21529
|
-
var left = 0;
|
|
21530
|
-
var prev = elementRef.current && elementRef.current.previousElementSibling;
|
|
21531
|
-
if (prev && prev.classList.contains('p-frozen-column')) {
|
|
21532
|
-
left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left || 0);
|
|
21533
|
-
}
|
|
21534
|
-
styleObject.left = left + 'px';
|
|
21535
|
-
}
|
|
21536
|
-
var isSameStyle = styleObjectState.left === styleObject.left && styleObjectState.right === styleObject.right;
|
|
21537
|
-
!isSameStyle && setStyleObjectState(styleObject);
|
|
21538
|
-
}
|
|
21539
|
-
};
|
|
21540
21595
|
var editorCallback = function editorCallback(val) {
|
|
21541
21596
|
var editingRowData = _objectSpread$b({}, editingRowDataState);
|
|
21542
|
-
ObjectUtils.mutateFieldData(editingRowData, field, val);
|
|
21597
|
+
ObjectUtils.mutateFieldData(editingRowData, props.field, val);
|
|
21543
21598
|
setEditingRowDataState(editingRowData);
|
|
21544
21599
|
|
|
21545
21600
|
// update editing meta for complete methods on row mode
|
|
21546
|
-
var currentData = getEditingRowData();
|
|
21601
|
+
var currentData = props.getEditingRowData();
|
|
21547
21602
|
if (currentData) {
|
|
21548
|
-
ObjectUtils.mutateFieldData(currentData, field, val);
|
|
21603
|
+
ObjectUtils.mutateFieldData(currentData, props.field, val);
|
|
21549
21604
|
}
|
|
21550
21605
|
editingRowDataStateRef.current = editingRowData;
|
|
21551
21606
|
};
|
|
21552
21607
|
var _onClick = function onClick(event) {
|
|
21553
|
-
|
|
21554
|
-
if (props.editMode !== 'row' && isEditable() && !editingState && (props.selectOnEdit || !props.selectOnEdit && props.selected)) {
|
|
21555
|
-
selfClick.current = true;
|
|
21556
|
-
var onBeforeCellEditShow = getColumnProp('onBeforeCellEditShow');
|
|
21557
|
-
var onCellEditInit = getColumnProp('onCellEditInit');
|
|
21558
|
-
var cellEditValidatorEvent = getColumnProp('cellEditValidatorEvent');
|
|
21559
|
-
if (onBeforeCellEditShow) {
|
|
21560
|
-
// if user returns false do not show the editor
|
|
21561
|
-
if (onBeforeCellEditShow(params) === false) {
|
|
21562
|
-
return;
|
|
21563
|
-
}
|
|
21564
|
-
|
|
21565
|
-
// if user prevents default stop the editor
|
|
21566
|
-
if (event && event.defaultPrevented) {
|
|
21567
|
-
return;
|
|
21568
|
-
}
|
|
21569
|
-
}
|
|
21570
|
-
|
|
21571
|
-
// If the data is sorted using sort icon, it has been added to wait for the sort operation when any cell is wanted to be opened.
|
|
21572
|
-
setTimeout(function () {
|
|
21573
|
-
setEditingState(true);
|
|
21574
|
-
if (onCellEditInit) {
|
|
21575
|
-
if (onCellEditInit(params) === false) {
|
|
21576
|
-
return;
|
|
21577
|
-
}
|
|
21578
|
-
|
|
21579
|
-
// if user prevents default stop the editor
|
|
21580
|
-
if (event && event.defaultPrevented) {
|
|
21581
|
-
return;
|
|
21582
|
-
}
|
|
21583
|
-
}
|
|
21584
|
-
if (cellEditValidatorEvent === 'click') {
|
|
21585
|
-
bindDocumentClickListener();
|
|
21586
|
-
overlayEventListener.current = function (e) {
|
|
21587
|
-
if (!isOutsideClicked(e.target)) {
|
|
21588
|
-
selfClick.current = true;
|
|
21589
|
-
}
|
|
21590
|
-
};
|
|
21591
|
-
OverlayService.on('overlay-click', overlayEventListener.current);
|
|
21592
|
-
}
|
|
21593
|
-
}, 1);
|
|
21594
|
-
}
|
|
21595
|
-
if (props.allowCellSelection && props.onClick) {
|
|
21596
|
-
props.onClick(params);
|
|
21597
|
-
}
|
|
21608
|
+
props.onClick(event, getCellCallbackParams(event), isEditable(), editingState, setEditingState, selfClick, props.column, bindDocumentClickListener, overlayEventListener);
|
|
21598
21609
|
};
|
|
21599
21610
|
var _onMouseDown = function onMouseDown(event) {
|
|
21600
21611
|
var params = getCellCallbackParams(event);
|
|
@@ -21618,7 +21629,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21618
21629
|
cell = event.currentTarget;
|
|
21619
21630
|
switch (event.code) {
|
|
21620
21631
|
case 'ArrowLeft':
|
|
21621
|
-
var prevCell =
|
|
21632
|
+
var prevCell = props.findPrevSelectableCell(cell);
|
|
21622
21633
|
if (prevCell) {
|
|
21623
21634
|
changeTabIndex(cell, prevCell);
|
|
21624
21635
|
prevCell.focus();
|
|
@@ -21626,7 +21637,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21626
21637
|
event.preventDefault();
|
|
21627
21638
|
break;
|
|
21628
21639
|
case 'ArrowRight':
|
|
21629
|
-
var nextCell =
|
|
21640
|
+
var nextCell = props.findNextSelectableCell(cell);
|
|
21630
21641
|
if (nextCell) {
|
|
21631
21642
|
changeTabIndex(cell, nextCell);
|
|
21632
21643
|
nextCell.focus();
|
|
@@ -21634,7 +21645,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21634
21645
|
event.preventDefault();
|
|
21635
21646
|
break;
|
|
21636
21647
|
case 'ArrowUp':
|
|
21637
|
-
var upCell =
|
|
21648
|
+
var upCell = props.findUpSelectableCell(cell, index);
|
|
21638
21649
|
if (upCell) {
|
|
21639
21650
|
changeTabIndex(cell, upCell);
|
|
21640
21651
|
upCell.focus();
|
|
@@ -21642,7 +21653,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21642
21653
|
event.preventDefault();
|
|
21643
21654
|
break;
|
|
21644
21655
|
case 'ArrowDown':
|
|
21645
|
-
var downCell =
|
|
21656
|
+
var downCell = props.findDownSelectableCell(cell, index);
|
|
21646
21657
|
if (downCell) {
|
|
21647
21658
|
changeTabIndex(cell, downCell);
|
|
21648
21659
|
downCell.focus();
|
|
@@ -21681,13 +21692,6 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21681
21692
|
index: props.rowIndex
|
|
21682
21693
|
});
|
|
21683
21694
|
};
|
|
21684
|
-
var onCheckboxChange = function onCheckboxChange(event) {
|
|
21685
|
-
props.onCheckboxChange({
|
|
21686
|
-
originalEvent: event,
|
|
21687
|
-
data: props.rowData,
|
|
21688
|
-
index: props.rowIndex
|
|
21689
|
-
});
|
|
21690
|
-
};
|
|
21691
21695
|
var onRowToggle = function onRowToggle(event) {
|
|
21692
21696
|
props.onRowToggle({
|
|
21693
21697
|
originalEvent: event,
|
|
@@ -21700,8 +21704,8 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21700
21704
|
props.onRowEditInit({
|
|
21701
21705
|
originalEvent: event,
|
|
21702
21706
|
data: props.rowData,
|
|
21703
|
-
newData: getEditingRowData(),
|
|
21704
|
-
field: field,
|
|
21707
|
+
newData: props.getEditingRowData(),
|
|
21708
|
+
field: props.field,
|
|
21705
21709
|
index: props.rowIndex
|
|
21706
21710
|
});
|
|
21707
21711
|
};
|
|
@@ -21709,32 +21713,26 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21709
21713
|
props.onRowEditSave({
|
|
21710
21714
|
originalEvent: event,
|
|
21711
21715
|
data: props.rowData,
|
|
21712
|
-
newData: getEditingRowData(),
|
|
21713
|
-
field: field,
|
|
21716
|
+
newData: props.getEditingRowData(),
|
|
21717
|
+
field: props.field,
|
|
21714
21718
|
index: props.rowIndex
|
|
21715
21719
|
});
|
|
21716
|
-
focusOnInit();
|
|
21720
|
+
props.focusOnInit(initFocusTimeout, elementRef);
|
|
21717
21721
|
};
|
|
21718
21722
|
var onRowEditCancel = function onRowEditCancel(event) {
|
|
21719
21723
|
props.onRowEditCancel({
|
|
21720
21724
|
originalEvent: event,
|
|
21721
21725
|
data: props.rowData,
|
|
21722
|
-
newData: getEditingRowData(),
|
|
21723
|
-
field: field,
|
|
21726
|
+
newData: props.getEditingRowData(),
|
|
21727
|
+
field: props.field,
|
|
21724
21728
|
index: props.rowIndex
|
|
21725
21729
|
});
|
|
21726
|
-
focusOnInit();
|
|
21730
|
+
props.focusOnInit();
|
|
21727
21731
|
};
|
|
21728
21732
|
React.useEffect(function () {
|
|
21729
|
-
if (
|
|
21730
|
-
|
|
21731
|
-
|
|
21732
|
-
});
|
|
21733
|
-
React.useEffect(function () {
|
|
21734
|
-
if (props.editMode === 'cell' || props.editMode === 'row') {
|
|
21735
|
-
focusOnElement();
|
|
21736
|
-
}
|
|
21737
|
-
}, [props.editMode, props.editing, editingState]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
21733
|
+
if (props.frozenCol) props.updateStickyPosition(elementRef, props.frozenCol, props.alignFrozenCol, styleObjectState, setStyleObjectState);
|
|
21734
|
+
if (props.editMode === 'cell' || props.editMode === 'row') props.focusOnElement(focusTimeout, editingState, elementRef, keyHelperRef);
|
|
21735
|
+
}, [props.editMode, props.editing, editingState, props.frozenCol, props.alignFrozenCol]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
21738
21736
|
|
|
21739
21737
|
React.useEffect(function () {
|
|
21740
21738
|
if (props.editMode === 'row' && props.editing !== editingState) {
|
|
@@ -21743,7 +21741,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21743
21741
|
}, [props.editMode, props.editing, editingState]);
|
|
21744
21742
|
useUpdateEffect(function () {
|
|
21745
21743
|
if (props.editMode === 'cell' || props.editMode === 'row') {
|
|
21746
|
-
var editingRowData = getEditingRowData();
|
|
21744
|
+
var editingRowData = props.getEditingRowData();
|
|
21747
21745
|
setEditingRowDataState(editingRowData);
|
|
21748
21746
|
editingRowDataStateRef.current = editingRowData;
|
|
21749
21747
|
}
|
|
@@ -21753,7 +21751,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21753
21751
|
var callbackParams = getCellCallbackParams();
|
|
21754
21752
|
var params = _objectSpread$b(_objectSpread$b({}, callbackParams), {}, {
|
|
21755
21753
|
editing: editingState,
|
|
21756
|
-
editingKey: editingKey
|
|
21754
|
+
editingKey: props.editingKey
|
|
21757
21755
|
});
|
|
21758
21756
|
props.onEditingMetaChange(params);
|
|
21759
21757
|
}
|
|
@@ -21766,16 +21764,16 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21766
21764
|
}
|
|
21767
21765
|
});
|
|
21768
21766
|
var createLoading = function createLoading() {
|
|
21769
|
-
var options = getVirtualScrollerOption('getLoaderOptions')(props.rowIndex, {
|
|
21767
|
+
var options = props.getVirtualScrollerOption('getLoaderOptions')(props.rowIndex, {
|
|
21770
21768
|
cellIndex: props.index,
|
|
21771
21769
|
cellFirst: props.index === 0,
|
|
21772
|
-
cellLast: props.index === getVirtualScrollerOption('columns').length - 1,
|
|
21770
|
+
cellLast: props.index === props.getVirtualScrollerOption('columns').length - 1,
|
|
21773
21771
|
cellEven: props.index % 2 === 0,
|
|
21774
21772
|
cellOdd: props.index % 2 !== 0,
|
|
21775
21773
|
column: props.column,
|
|
21776
|
-
field: field
|
|
21774
|
+
field: props.field
|
|
21777
21775
|
});
|
|
21778
|
-
var content = ObjectUtils.getJSXElement(getVirtualScrollerOption('loadingTemplate'), options);
|
|
21776
|
+
var content = ObjectUtils.getJSXElement(props.getVirtualScrollerOption('loadingTemplate'), options);
|
|
21779
21777
|
var bodyCellProps = mergeProps(getColumnPTOptions('bodyCell'), {
|
|
21780
21778
|
role: 'cell'
|
|
21781
21779
|
});
|
|
@@ -21784,20 +21782,20 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21784
21782
|
var createElement = function createElement() {
|
|
21785
21783
|
var content;
|
|
21786
21784
|
var editorKeyHelper;
|
|
21787
|
-
var cellSelected = props.allowCellSelection &&
|
|
21785
|
+
var cellSelected = props.allowCellSelection && props.isCellSelected;
|
|
21788
21786
|
var isRowEditor = props.editMode === 'row';
|
|
21789
|
-
var tabIndex = getTabIndex(cellSelected);
|
|
21787
|
+
var tabIndex = props.getTabIndex(cellSelected, props.index);
|
|
21790
21788
|
var selectionMode = getColumnProp('selectionMode');
|
|
21791
21789
|
var rowReorder = getColumnProp('rowReorder');
|
|
21792
21790
|
var header = getColumnProp('header');
|
|
21793
21791
|
var body = getColumnProp('body');
|
|
21794
21792
|
var editor = getColumnProp('editor');
|
|
21795
|
-
var frozen =
|
|
21793
|
+
var frozen = props.frozenCol;
|
|
21796
21794
|
var align = getColumnProp('align');
|
|
21797
|
-
var value = resolveFieldData();
|
|
21795
|
+
var value = props.resolveFieldData();
|
|
21798
21796
|
var columnBodyOptions = {
|
|
21799
21797
|
column: props.column,
|
|
21800
|
-
field: field,
|
|
21798
|
+
field: props.field,
|
|
21801
21799
|
rowIndex: props.rowIndex,
|
|
21802
21800
|
frozenRow: props.frozenRow,
|
|
21803
21801
|
props: props.tableProps
|
|
@@ -21822,12 +21820,12 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21822
21820
|
if (showSelection) {
|
|
21823
21821
|
var ariaLabelField = props.selectionAriaLabel || props.tableProps.dataKey;
|
|
21824
21822
|
var ariaLabelText = ObjectUtils.resolveFieldData(props.rowData, ariaLabelField);
|
|
21825
|
-
label = "".concat(props.
|
|
21823
|
+
label = "".concat(props.isRowSelected ? ariaLabel$2('unselectRow') : ariaLabel$2('selectRow'), " ").concat(ariaLabelText);
|
|
21826
21824
|
}
|
|
21827
21825
|
content = showSelection && /*#__PURE__*/React.createElement(React.Fragment, null, selectionMode === 'single' && /*#__PURE__*/React.createElement(RowRadioButton, {
|
|
21828
21826
|
hostName: props.hostName,
|
|
21829
21827
|
column: props.column,
|
|
21830
|
-
checked: props.
|
|
21828
|
+
checked: props.isRowSelected,
|
|
21831
21829
|
disabled: !props.isSelectable({
|
|
21832
21830
|
data: props.rowData,
|
|
21833
21831
|
index: props.rowIndex
|
|
@@ -21842,12 +21840,12 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21842
21840
|
}), selectionMode === 'multiple' && /*#__PURE__*/React.createElement(RowCheckbox, {
|
|
21843
21841
|
hostName: props.hostName,
|
|
21844
21842
|
column: props.column,
|
|
21845
|
-
checked: props.
|
|
21843
|
+
checked: props.isRowSelected,
|
|
21846
21844
|
disabled: !props.isSelectable({
|
|
21847
21845
|
data: props.rowData,
|
|
21848
21846
|
index: props.rowIndex
|
|
21849
21847
|
}),
|
|
21850
|
-
onChange: onCheckboxChange,
|
|
21848
|
+
onChange: props.onCheckboxChange,
|
|
21851
21849
|
tabIndex: props.tabIndex,
|
|
21852
21850
|
ariaLabel: label,
|
|
21853
21851
|
checkIcon: props.checkIcon,
|
|
@@ -21897,7 +21895,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21897
21895
|
expanderProps.element = content;
|
|
21898
21896
|
content = ObjectUtils.getJSXElement(body, props.rowData, {
|
|
21899
21897
|
column: props.column,
|
|
21900
|
-
field: field,
|
|
21898
|
+
field: props.field,
|
|
21901
21899
|
rowIndex: props.rowIndex,
|
|
21902
21900
|
frozenRow: props.frozenRow,
|
|
21903
21901
|
props: props.tableProps,
|
|
@@ -21971,7 +21969,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21971
21969
|
rowEditorProps.element = content;
|
|
21972
21970
|
content = ObjectUtils.getJSXElement(body, props.rowData, {
|
|
21973
21971
|
column: props.column,
|
|
21974
|
-
field: field,
|
|
21972
|
+
field: props.field,
|
|
21975
21973
|
rowIndex: props.rowIndex,
|
|
21976
21974
|
frozenRow: props.frozenRow,
|
|
21977
21975
|
props: props.tableProps,
|
|
@@ -21981,7 +21979,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21981
21979
|
} else if (body && (!editingState || !editor)) {
|
|
21982
21980
|
content = body ? ObjectUtils.getJSXElement(body, props.rowData, {
|
|
21983
21981
|
column: props.column,
|
|
21984
|
-
field: field,
|
|
21982
|
+
field: props.field,
|
|
21985
21983
|
rowIndex: props.rowIndex,
|
|
21986
21984
|
frozenRow: props.frozenRow,
|
|
21987
21985
|
props: props.tableProps
|
|
@@ -21989,9 +21987,9 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
21989
21987
|
} else if (editor && editingState) {
|
|
21990
21988
|
content = ObjectUtils.getJSXElement(editor, {
|
|
21991
21989
|
rowData: editingRowDataState,
|
|
21992
|
-
value: resolveFieldData(editingRowDataState),
|
|
21990
|
+
value: props.resolveFieldData(editingRowDataState),
|
|
21993
21991
|
column: props.column,
|
|
21994
|
-
field: field,
|
|
21992
|
+
field: props.field,
|
|
21995
21993
|
rowIndex: props.rowIndex,
|
|
21996
21994
|
frozenRow: props.frozenRow,
|
|
21997
21995
|
props: props.tableProps,
|
|
@@ -22059,7 +22057,22 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
22059
22057
|
ref: elementRef
|
|
22060
22058
|
}, bodyCellProps), editorKeyHelper, title, content);
|
|
22061
22059
|
};
|
|
22062
|
-
return getVirtualScrollerOption('loading') ? createLoading() : createElement();
|
|
22060
|
+
return props.getVirtualScrollerOption('loading') ? createLoading() : createElement();
|
|
22061
|
+
};
|
|
22062
|
+
|
|
22063
|
+
// RadioCheckCell is used for the Radio and Checkbox selection and has the isRowSelected dependency
|
|
22064
|
+
var RadioCheckCell = /*#__PURE__*/React.memo(function (props) {
|
|
22065
|
+
return /*#__PURE__*/React.createElement(Cell, props);
|
|
22066
|
+
}, function (prevProps, nextProps) {
|
|
22067
|
+
var keysToCompare = ['isRowSelected', 'field', 'allowCellSelection', 'isCellSelected', 'editMode', 'index', 'tabIndex', 'editing', 'expanded', 'editingMeta', 'rowData'];
|
|
22068
|
+
return ObjectUtils.selectiveCompare(prevProps, nextProps, keysToCompare);
|
|
22069
|
+
});
|
|
22070
|
+
RadioCheckCell.displayName = 'RadioCheckCell';
|
|
22071
|
+
var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
22072
|
+
return /*#__PURE__*/React.createElement(Cell, props);
|
|
22073
|
+
}, function (prevProps, nextProps) {
|
|
22074
|
+
var keysToCompare = ['field', 'allowCellSelection', 'isCellSelected', 'editMode', 'index', 'tabIndex', 'editing', 'expanded', 'editingMeta', 'rowData', 'frozenCol', 'alignFrozenCol'];
|
|
22075
|
+
return ObjectUtils.selectiveCompare(prevProps, nextProps, keysToCompare);
|
|
22063
22076
|
});
|
|
22064
22077
|
BodyCell.displayName = 'BodyCell';
|
|
22065
22078
|
|
|
@@ -22075,6 +22088,7 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
22075
22088
|
var _props$ptCallbacks = props.ptCallbacks,
|
|
22076
22089
|
ptm = _props$ptCallbacks.ptm,
|
|
22077
22090
|
cx = _props$ptCallbacks.cx;
|
|
22091
|
+
var isRowSelected = !props.allowCellSelection && props.selected || props.contextMenuSelected;
|
|
22078
22092
|
var getBodyRowPTOptions = function getBodyRowPTOptions(key) {
|
|
22079
22093
|
return ptm(key, {
|
|
22080
22094
|
parent: props.metaData,
|
|
@@ -22088,7 +22102,7 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
22088
22102
|
data: props.rowData,
|
|
22089
22103
|
index: props.rowIndex
|
|
22090
22104
|
}),
|
|
22091
|
-
selected:
|
|
22105
|
+
selected: isRowSelected,
|
|
22092
22106
|
stripedRows: props.metaData.props.stripedRows
|
|
22093
22107
|
}
|
|
22094
22108
|
});
|
|
@@ -22117,10 +22131,10 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
22117
22131
|
return equals(rowData, data);
|
|
22118
22132
|
});
|
|
22119
22133
|
};
|
|
22120
|
-
var changeTabIndex = function changeTabIndex(
|
|
22121
|
-
if (
|
|
22122
|
-
|
|
22123
|
-
|
|
22134
|
+
var changeTabIndex = function changeTabIndex(currentElement, nextElement) {
|
|
22135
|
+
if (currentElement && nextElement) {
|
|
22136
|
+
currentElement.tabIndex = -1;
|
|
22137
|
+
nextElement.tabIndex = props.tabIndex;
|
|
22124
22138
|
}
|
|
22125
22139
|
};
|
|
22126
22140
|
var findFirstSelectableRow = function findFirstSelectableRow(row) {
|
|
@@ -22447,32 +22461,176 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
22447
22461
|
onEditChange(e, false);
|
|
22448
22462
|
event.preventDefault();
|
|
22449
22463
|
};
|
|
22464
|
+
var equalsDataCell = function equalsDataCell(data) {
|
|
22465
|
+
return props.compareSelectionBy === 'equals' ? data === props.rowData : ObjectUtils.equals(data, props.rowData, props.dataKey);
|
|
22466
|
+
};
|
|
22467
|
+
var equalsCell = function equalsCell(selectedCell, field, colIndex) {
|
|
22468
|
+
return selectedCell && (selectedCell.rowIndex === props.rowIndex || equalsDataCell(selectedCell.rowData)) && (selectedCell.field === field || selectedCell.cellIndex === colIndex);
|
|
22469
|
+
};
|
|
22470
|
+
var findIndexCell = function findIndexCell(collection, field, colIndex) {
|
|
22471
|
+
return (collection || []).findIndex(function (data) {
|
|
22472
|
+
return equalsCell(data, field, colIndex);
|
|
22473
|
+
});
|
|
22474
|
+
};
|
|
22475
|
+
var isCellSelected = function isCellSelected(selection, field, colIndex) {
|
|
22476
|
+
return selection ? selection instanceof Array ? findIndexCell(selection, field, colIndex) > -1 : equalsCell(selection, field, colIndex) : false;
|
|
22477
|
+
};
|
|
22478
|
+
var onCheckboxChange = function onCheckboxChange(event) {
|
|
22479
|
+
props.onCheckboxChange({
|
|
22480
|
+
originalEvent: event,
|
|
22481
|
+
data: props.rowData,
|
|
22482
|
+
index: props.rowIndex
|
|
22483
|
+
});
|
|
22484
|
+
};
|
|
22485
|
+
var editingKey = props.dataKey ? props.rowData && props.rowData[props.dataKey] || props.rowIndex : props.rowIndex;
|
|
22486
|
+
var getVirtualScrollerOption = React.useCallback(function (option) {
|
|
22487
|
+
return props.virtualScrollerOptions ? props.virtualScrollerOptions[option] : null;
|
|
22488
|
+
}, [props.virtualScrollerOptions]);
|
|
22489
|
+
var getEditingRowData = function getEditingRowData() {
|
|
22490
|
+
return props.editingMeta && props.editingMeta[editingKey] ? props.editingMeta[editingKey].data : props.rowData;
|
|
22491
|
+
};
|
|
22492
|
+
var getTabIndexCell = React.useCallback(function (cellSelected, cellIndex) {
|
|
22493
|
+
return props.allowCellSelection ? cellSelected ? 0 : props.rowIndex === 0 && cellIndex === 0 ? props.tabIndex : -1 : null;
|
|
22494
|
+
}, [props.allowCellSelection, props.rowIndex, props.tabIndex]);
|
|
22495
|
+
var findNextSelectableCell = React.useCallback(function (cell) {
|
|
22496
|
+
var nextCell = cell.nextElementSibling;
|
|
22497
|
+
return nextCell ? DomHandler.getAttribute(nextCell, 'data-p-selectable-cell') ? nextCell : findNextSelectableCell(nextCell) : null;
|
|
22498
|
+
}, []);
|
|
22499
|
+
var findPrevSelectableCell = React.useCallback(function (cell) {
|
|
22500
|
+
var prevCell = cell.previousElementSibling;
|
|
22501
|
+
return prevCell ? DomHandler.getAttribute(prevCell, 'data-p-selectable-cell') ? prevCell : findPrevSelectableCell(prevCell) : null;
|
|
22502
|
+
}, []);
|
|
22503
|
+
var findDownSelectableCell = React.useCallback(function (cell, cellIndex) {
|
|
22504
|
+
var downRow = cell.parentElement.nextElementSibling;
|
|
22505
|
+
var downCell = downRow ? downRow.children[cellIndex] : null;
|
|
22506
|
+
return downRow && downCell ? DomHandler.getAttribute(downRow, 'data-p-selectable-row') && DomHandler.getAttribute(downCell, 'data-p-selectable-cell') ? downCell : findDownSelectableCell(downCell) : null;
|
|
22507
|
+
}, []);
|
|
22508
|
+
var findUpSelectableCell = React.useCallback(function (cell, cellIndex) {
|
|
22509
|
+
var upRow = cell.parentElement.previousElementSibling;
|
|
22510
|
+
var upCell = upRow ? upRow.children[cellIndex] : null;
|
|
22511
|
+
return upRow && upCell ? DomHandler.getAttribute(upRow, 'data-p-selectable-row') && DomHandler.getAttribute(upCell, 'data-p-selectable-cell') ? upCell : findUpSelectableCell(upCell) : null;
|
|
22512
|
+
}, []);
|
|
22513
|
+
var focusOnElement = React.useCallback(function (focusTimeoutRef, editingState, elementRef, keyHelperRef) {
|
|
22514
|
+
clearTimeout(focusTimeoutRef.current);
|
|
22515
|
+
focusTimeoutRef.current = setTimeout(function () {
|
|
22516
|
+
if (editingState) {
|
|
22517
|
+
var focusableEl = props.editMode === 'cell' ? DomHandler.getFirstFocusableElement(elementRef.current, ':not([data-pc-section="editorkeyhelperlabel"])') : DomHandler.findSingle(elementRef.current, '[data-p-row-editor-save="true"]');
|
|
22518
|
+
focusableEl && focusableEl.focus();
|
|
22519
|
+
}
|
|
22520
|
+
keyHelperRef.current && (keyHelperRef.current.tabIndex = editingState ? -1 : 0);
|
|
22521
|
+
}, 1);
|
|
22522
|
+
}, [props.editMode]);
|
|
22523
|
+
var focusOnInit = React.useCallback(function (initFocusTimeoutRef, elementRef) {
|
|
22524
|
+
clearTimeout(initFocusTimeoutRef.current);
|
|
22525
|
+
initFocusTimeoutRef.current = setTimeout(function () {
|
|
22526
|
+
var focusableEl = props.editMode === 'row' ? DomHandler.findSingle(elementRef.current, '[data-p-row-editor-init="true"]') : null;
|
|
22527
|
+
focusableEl && focusableEl.focus();
|
|
22528
|
+
}, 1);
|
|
22529
|
+
}, [props.editMode]);
|
|
22530
|
+
var updateStickyPosition = React.useCallback(function (elementRef, frozen, alignFrozen, styleObjectState, setStyleObjectState) {
|
|
22531
|
+
if (frozen) {
|
|
22532
|
+
var styleObject = _objectSpread$a({}, styleObjectState);
|
|
22533
|
+
if (alignFrozen === 'right') {
|
|
22534
|
+
var right = 0;
|
|
22535
|
+
var next = elementRef.current && elementRef.current.nextElementSibling;
|
|
22536
|
+
if (next && next.classList.contains('p-frozen-column')) {
|
|
22537
|
+
right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right || 0);
|
|
22538
|
+
}
|
|
22539
|
+
styleObject.right = right + 'px';
|
|
22540
|
+
} else {
|
|
22541
|
+
var left = 0;
|
|
22542
|
+
var prev = elementRef.current && elementRef.current.previousElementSibling;
|
|
22543
|
+
if (prev && prev.classList.contains('p-frozen-column')) {
|
|
22544
|
+
left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left || 0);
|
|
22545
|
+
}
|
|
22546
|
+
styleObject.left = left + 'px';
|
|
22547
|
+
}
|
|
22548
|
+
var isSameStyle = styleObjectState.left === styleObject.left && styleObjectState.right === styleObject.right;
|
|
22549
|
+
!isSameStyle && setStyleObjectState(styleObject);
|
|
22550
|
+
}
|
|
22551
|
+
}, []);
|
|
22552
|
+
var onCellClick = function onCellClick(event, params, isEditable, editingState, setEditingState, selfClick, column, bindDocumentClickListener, overlayEventListener) {
|
|
22553
|
+
if (props.editMode !== 'row' && isEditable && !editingState && (props.selectOnEdit || !props.selectOnEdit && props.isRowSelected)) {
|
|
22554
|
+
selfClick.current = true;
|
|
22555
|
+
var onBeforeCellEditShow = getColumnProp(column, 'onBeforeCellEditShow');
|
|
22556
|
+
var onCellEditInit = getColumnProp(column, 'onCellEditInit');
|
|
22557
|
+
var cellEditValidatorEvent = getColumnProp(column, 'cellEditValidatorEvent');
|
|
22558
|
+
if (onBeforeCellEditShow) {
|
|
22559
|
+
// if user returns false do not show the editor
|
|
22560
|
+
if (onBeforeCellEditShow(params) === false) {
|
|
22561
|
+
return;
|
|
22562
|
+
}
|
|
22563
|
+
|
|
22564
|
+
// if user prevents default stop the editor
|
|
22565
|
+
if (event && event.defaultPrevented) {
|
|
22566
|
+
return;
|
|
22567
|
+
}
|
|
22568
|
+
}
|
|
22569
|
+
|
|
22570
|
+
// If the data is sorted using sort icon, it has been added to wait for the sort operation when any cell is wanted to be opened.
|
|
22571
|
+
setTimeout(function () {
|
|
22572
|
+
setEditingState(true);
|
|
22573
|
+
if (onCellEditInit) {
|
|
22574
|
+
if (onCellEditInit(params) === false) {
|
|
22575
|
+
return;
|
|
22576
|
+
}
|
|
22577
|
+
|
|
22578
|
+
// if user prevents default stop the editor
|
|
22579
|
+
if (event && event.defaultPrevented) {
|
|
22580
|
+
return;
|
|
22581
|
+
}
|
|
22582
|
+
}
|
|
22583
|
+
if (cellEditValidatorEvent === 'click') {
|
|
22584
|
+
bindDocumentClickListener();
|
|
22585
|
+
overlayEventListener.current = function (e) {
|
|
22586
|
+
if (!isOutsideClicked(e.target)) {
|
|
22587
|
+
selfClick.current = true;
|
|
22588
|
+
}
|
|
22589
|
+
};
|
|
22590
|
+
OverlayService.on('overlay-click', overlayEventListener.current);
|
|
22591
|
+
}
|
|
22592
|
+
}, 1);
|
|
22593
|
+
}
|
|
22594
|
+
if (props.allowCellSelection && props.onCellClick) {
|
|
22595
|
+
props.onCellClick(params);
|
|
22596
|
+
}
|
|
22597
|
+
};
|
|
22450
22598
|
var createContent = function createContent() {
|
|
22451
22599
|
return props.columns.map(function (col, i) {
|
|
22452
22600
|
if (shouldRenderBodyCell(props.value, col, props.index)) {
|
|
22453
22601
|
var key = "".concat(props.rowIndex, "_").concat(getColumnProp(col, 'columnKey') || getColumnProp(col, 'field'), "_").concat(i);
|
|
22454
22602
|
var rowSpan = props.rowGroupMode === 'rowspan' ? calculateRowGroupSize(props.value, col, props.index) : null;
|
|
22455
|
-
|
|
22603
|
+
var field = getColumnProp(col, 'field') || "field_".concat(i);
|
|
22604
|
+
var resolveFieldData = function resolveFieldData(data) {
|
|
22605
|
+
return ObjectUtils.resolveFieldData(data || props.rowData, field);
|
|
22606
|
+
};
|
|
22607
|
+
var selectionMode = getColumnProp(col, 'selectionMode');
|
|
22608
|
+
var cellProps = mergeProps({
|
|
22456
22609
|
hostName: props.hostName,
|
|
22457
|
-
key: key,
|
|
22458
22610
|
allowCellSelection: props.allowCellSelection,
|
|
22459
22611
|
cellClassName: props.cellClassName,
|
|
22460
22612
|
checkIcon: props.checkIcon,
|
|
22461
22613
|
collapsedRowIcon: props.collapsedRowIcon,
|
|
22614
|
+
field: field,
|
|
22615
|
+
resolveFieldData: resolveFieldData,
|
|
22462
22616
|
column: col,
|
|
22463
|
-
|
|
22617
|
+
cProps: props.colsProps[i],
|
|
22464
22618
|
dataKey: props.dataKey,
|
|
22465
22619
|
editMode: props.editMode,
|
|
22466
22620
|
editing: editing,
|
|
22467
22621
|
editingMeta: props.editingMeta,
|
|
22622
|
+
onEditingMetaChange: props.onEditingMetaChange,
|
|
22623
|
+
editingKey: editingKey,
|
|
22624
|
+
getEditingRowData: getEditingRowData,
|
|
22468
22625
|
expanded: props.expanded,
|
|
22469
22626
|
expandedRowIcon: props.expandedRowIcon,
|
|
22470
22627
|
frozenRow: props.frozenRow,
|
|
22628
|
+
frozenCol: getColumnProp(col, 'frozen'),
|
|
22629
|
+
alignFrozenCol: getColumnProp(col, 'alignFrozen'),
|
|
22471
22630
|
index: i,
|
|
22472
22631
|
isSelectable: props.isSelectable,
|
|
22473
|
-
onCheckboxChange:
|
|
22474
|
-
onClick:
|
|
22475
|
-
onEditingMetaChange: props.onEditingMetaChange,
|
|
22632
|
+
onCheckboxChange: onCheckboxChange,
|
|
22633
|
+
onClick: onCellClick,
|
|
22476
22634
|
onMouseDown: props.onCellMouseDown,
|
|
22477
22635
|
onMouseUp: props.onCellMouseUp,
|
|
22478
22636
|
onRadioChange: props.onRadioChange,
|
|
@@ -22488,20 +22646,31 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
22488
22646
|
rowIndex: props.rowIndex,
|
|
22489
22647
|
rowSpan: rowSpan,
|
|
22490
22648
|
selectOnEdit: props.selectOnEdit,
|
|
22491
|
-
|
|
22492
|
-
|
|
22649
|
+
isRowSelected: isRowSelected,
|
|
22650
|
+
isCellSelected: isCellSelected(props.selection, field, i),
|
|
22493
22651
|
selectionAriaLabel: props.tableProps.selectionAriaLabel,
|
|
22494
22652
|
showRowReorderElement: props.showRowReorderElement,
|
|
22495
22653
|
showSelectionElement: props.showSelectionElement,
|
|
22496
22654
|
tabIndex: props.tabIndex,
|
|
22655
|
+
getTabIndex: getTabIndexCell,
|
|
22497
22656
|
tableProps: props.tableProps,
|
|
22498
22657
|
tableSelector: props.tableSelector,
|
|
22499
22658
|
value: props.value,
|
|
22500
|
-
|
|
22659
|
+
getVirtualScrollerOption: getVirtualScrollerOption,
|
|
22501
22660
|
ptCallbacks: props.ptCallbacks,
|
|
22502
22661
|
metaData: props.metaData,
|
|
22503
|
-
unstyled: props.unstyled
|
|
22662
|
+
unstyled: props.unstyled,
|
|
22663
|
+
findNextSelectableCell: findNextSelectableCell,
|
|
22664
|
+
findPrevSelectableCell: findPrevSelectableCell,
|
|
22665
|
+
findDownSelectableCell: findDownSelectableCell,
|
|
22666
|
+
findUpSelectableCell: findUpSelectableCell,
|
|
22667
|
+
focusOnElement: focusOnElement,
|
|
22668
|
+
focusOnInit: focusOnInit,
|
|
22669
|
+
updateStickyPosition: updateStickyPosition
|
|
22504
22670
|
});
|
|
22671
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
|
22672
|
+
key: key
|
|
22673
|
+
}, selectionMode ? /*#__PURE__*/React.createElement(RadioCheckCell, cellProps) : /*#__PURE__*/React.createElement(BodyCell, cellProps));
|
|
22505
22674
|
}
|
|
22506
22675
|
return null;
|
|
22507
22676
|
});
|
|
@@ -22651,8 +22820,11 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
|
|
|
22651
22820
|
var getColumnProps = function getColumnProps(column) {
|
|
22652
22821
|
return ColumnBase.getCProps(column);
|
|
22653
22822
|
};
|
|
22823
|
+
var cProps = getColumnProps(props.column);
|
|
22824
|
+
var colsProps = props.columns ? props.columns.map(function (col) {
|
|
22825
|
+
return getColumnProps(col);
|
|
22826
|
+
}) : [];
|
|
22654
22827
|
var getColumnPTOptions = function getColumnPTOptions(key) {
|
|
22655
|
-
var cProps = getColumnProps(props.column);
|
|
22656
22828
|
var columnMetaData = {
|
|
22657
22829
|
props: cProps,
|
|
22658
22830
|
parent: props.metaData,
|
|
@@ -22777,8 +22949,12 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
|
|
|
22777
22949
|
var allowSelection = function allowSelection(event) {
|
|
22778
22950
|
return !DomHandler.isClickable(event.originalEvent.target);
|
|
22779
22951
|
};
|
|
22952
|
+
var metaKeySelectionRef = React.useRef(props.metaKeySelection);
|
|
22953
|
+
React.useEffect(function () {
|
|
22954
|
+
metaKeySelectionRef.current = props.metaKeySelection;
|
|
22955
|
+
}, [props.metaKeySelection]);
|
|
22780
22956
|
var allowMetaKeySelection = function allowMetaKeySelection(event) {
|
|
22781
|
-
return !rowTouched.current && (!
|
|
22957
|
+
return !rowTouched.current && (!metaKeySelectionRef.current || metaKeySelectionRef.current && (event.originalEvent.metaKey || event.originalEvent.ctrlKey));
|
|
22782
22958
|
};
|
|
22783
22959
|
var allowRangeSelection = function allowRangeSelection(event) {
|
|
22784
22960
|
return isMultipleSelection() && event.originalEvent.shiftKey && anchorRowIndex.current !== null;
|
|
@@ -22851,6 +23027,10 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
|
|
|
22851
23027
|
});
|
|
22852
23028
|
}
|
|
22853
23029
|
};
|
|
23030
|
+
var selectionRef = React.useRef(props.selection);
|
|
23031
|
+
React.useEffect(function () {
|
|
23032
|
+
selectionRef.current = props.selection;
|
|
23033
|
+
}, [props.selection]);
|
|
22854
23034
|
var onSingleSelection = function onSingleSelection(_ref) {
|
|
22855
23035
|
var originalEvent = _ref.originalEvent,
|
|
22856
23036
|
data = _ref.data,
|
|
@@ -22864,10 +23044,11 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
|
|
|
22864
23044
|
return;
|
|
22865
23045
|
}
|
|
22866
23046
|
var selected = isSelected(data);
|
|
22867
|
-
var
|
|
23047
|
+
var currentSelection = selectionRef.current || [];
|
|
23048
|
+
var newSelection = currentSelection;
|
|
22868
23049
|
if (selected) {
|
|
22869
23050
|
if (toggleable) {
|
|
22870
|
-
|
|
23051
|
+
newSelection = null;
|
|
22871
23052
|
onUnselect({
|
|
22872
23053
|
originalEvent: originalEvent,
|
|
22873
23054
|
data: data,
|
|
@@ -22875,7 +23056,7 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
|
|
|
22875
23056
|
});
|
|
22876
23057
|
}
|
|
22877
23058
|
} else {
|
|
22878
|
-
|
|
23059
|
+
newSelection = data;
|
|
22879
23060
|
onSelect({
|
|
22880
23061
|
originalEvent: originalEvent,
|
|
22881
23062
|
data: data,
|
|
@@ -22883,10 +23064,10 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
|
|
|
22883
23064
|
});
|
|
22884
23065
|
}
|
|
22885
23066
|
focusOnElement(originalEvent, true);
|
|
22886
|
-
if (props.onSelectionChange &&
|
|
23067
|
+
if (props.onSelectionChange && newSelection !== currentSelection) {
|
|
22887
23068
|
props.onSelectionChange({
|
|
22888
23069
|
originalEvent: originalEvent,
|
|
22889
|
-
value:
|
|
23070
|
+
value: newSelection,
|
|
22890
23071
|
type: type
|
|
22891
23072
|
});
|
|
22892
23073
|
}
|
|
@@ -22904,11 +23085,12 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
|
|
|
22904
23085
|
return;
|
|
22905
23086
|
}
|
|
22906
23087
|
var selected = isSelected(data);
|
|
22907
|
-
var
|
|
23088
|
+
var currentSelection = selectionRef.current || [];
|
|
23089
|
+
var newSelection = currentSelection;
|
|
22908
23090
|
if (selected) {
|
|
22909
23091
|
if (toggleable) {
|
|
22910
|
-
var selectionIndex = findIndex(
|
|
22911
|
-
|
|
23092
|
+
var selectionIndex = findIndex(currentSelection, data);
|
|
23093
|
+
newSelection = currentSelection.filter(function (val, i) {
|
|
22912
23094
|
return i !== selectionIndex;
|
|
22913
23095
|
});
|
|
22914
23096
|
onUnselect({
|
|
@@ -22916,15 +23098,15 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
|
|
|
22916
23098
|
data: data,
|
|
22917
23099
|
type: type
|
|
22918
23100
|
});
|
|
22919
|
-
} else if (
|
|
22920
|
-
|
|
23101
|
+
} else if (currentSelection.length) {
|
|
23102
|
+
currentSelection.forEach(function (d) {
|
|
22921
23103
|
return onUnselect({
|
|
22922
23104
|
originalEvent: originalEvent,
|
|
22923
23105
|
data: d,
|
|
22924
23106
|
type: type
|
|
22925
23107
|
});
|
|
22926
23108
|
});
|
|
22927
|
-
|
|
23109
|
+
newSelection = [data];
|
|
22928
23110
|
onSelect({
|
|
22929
23111
|
originalEvent: originalEvent,
|
|
22930
23112
|
data: data,
|
|
@@ -22932,18 +23114,18 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
|
|
|
22932
23114
|
});
|
|
22933
23115
|
}
|
|
22934
23116
|
} else {
|
|
22935
|
-
|
|
22936
|
-
|
|
23117
|
+
newSelection = ObjectUtils.isObject(currentSelection) ? [currentSelection] : currentSelection;
|
|
23118
|
+
newSelection = toggleable && isMultipleSelection() ? [].concat(_toConsumableArray$1(newSelection), [data]) : [data];
|
|
22937
23119
|
onSelect({
|
|
22938
23120
|
originalEvent: originalEvent,
|
|
22939
23121
|
data: data,
|
|
22940
23122
|
type: type
|
|
22941
23123
|
});
|
|
22942
23124
|
}
|
|
22943
|
-
if (props.onSelectionChange &&
|
|
23125
|
+
if (props.onSelectionChange && newSelection !== currentSelection) {
|
|
22944
23126
|
props.onSelectionChange({
|
|
22945
23127
|
originalEvent: originalEvent,
|
|
22946
|
-
value:
|
|
23128
|
+
value: newSelection,
|
|
22947
23129
|
type: type
|
|
22948
23130
|
});
|
|
22949
23131
|
}
|
|
@@ -23545,6 +23727,7 @@ var TableBody = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (
|
|
|
23545
23727
|
checkIcon: props.checkIcon,
|
|
23546
23728
|
collapsedRowIcon: props.collapsedRowIcon,
|
|
23547
23729
|
columns: props.columns,
|
|
23730
|
+
colsProps: colsProps,
|
|
23548
23731
|
compareSelectionBy: props.compareSelectionBy,
|
|
23549
23732
|
contextMenuSelected: contextMenuSelected,
|
|
23550
23733
|
dataKey: props.dataKey,
|
|
@@ -24321,9 +24504,17 @@ var ColumnFilter = /*#__PURE__*/React.memo(function (props) {
|
|
|
24321
24504
|
var type = _ref.type,
|
|
24322
24505
|
valid = _ref.valid;
|
|
24323
24506
|
if (valid) {
|
|
24324
|
-
type === 'outside'
|
|
24507
|
+
if (type === 'outside') {
|
|
24508
|
+
if (!selfClick.current && !isTargetClicked(event.target)) {
|
|
24509
|
+
hide();
|
|
24510
|
+
}
|
|
24511
|
+
selfClick.current = false;
|
|
24512
|
+
} else if (context.hideOverlaysOnDocumentScrolling) {
|
|
24513
|
+
hide();
|
|
24514
|
+
} else if (!DomHandler.isDocument(event.target)) {
|
|
24515
|
+
DomHandler.alignOverlay(overlayRef.current, iconRef.current, context && context.appendTo || PrimeReact$2.appendTo, false);
|
|
24516
|
+
}
|
|
24325
24517
|
}
|
|
24326
|
-
selfClick.current = false;
|
|
24327
24518
|
},
|
|
24328
24519
|
when: overlayVisibleState
|
|
24329
24520
|
}),
|
|
@@ -28512,10 +28703,15 @@ var Menu = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inPro
|
|
|
28512
28703
|
target: targetRef,
|
|
28513
28704
|
overlay: menuRef,
|
|
28514
28705
|
listener: function listener(event, _ref) {
|
|
28515
|
-
var valid = _ref.valid
|
|
28706
|
+
var valid = _ref.valid,
|
|
28707
|
+
type = _ref.type;
|
|
28516
28708
|
if (valid) {
|
|
28517
|
-
|
|
28518
|
-
|
|
28709
|
+
if (context.hideOverlaysOnDocumentScrolling || type === 'outside') {
|
|
28710
|
+
hide(event);
|
|
28711
|
+
setFocusedOptionIndex(-1);
|
|
28712
|
+
} else if (!DomHandler.isDocument(event.target)) {
|
|
28713
|
+
DomHandler.absolutePosition(menuRef.current, targetRef.current, props.popupAlignment);
|
|
28714
|
+
}
|
|
28519
28715
|
}
|
|
28520
28716
|
},
|
|
28521
28717
|
when: visibleState
|
|
@@ -28571,6 +28767,9 @@ var Menu = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inPro
|
|
|
28571
28767
|
props.onFocus && props.onFocus(event);
|
|
28572
28768
|
};
|
|
28573
28769
|
var onListBlur = function onListBlur(event) {
|
|
28770
|
+
var currentTarget = event.currentTarget,
|
|
28771
|
+
relatedTarget = event.relatedTarget;
|
|
28772
|
+
if (relatedTarget && currentTarget.contains(relatedTarget)) return;
|
|
28574
28773
|
setFocused(false);
|
|
28575
28774
|
setFocusedOptionIndex(-1);
|
|
28576
28775
|
props.onBlur && props.onBlur(event);
|
|
@@ -29061,21 +29260,21 @@ var Table = function Table(_ref) {
|
|
|
29061
29260
|
|
|
29062
29261
|
var imgArengi = "d7bb817f9a84ae47.png";
|
|
29063
29262
|
|
|
29064
|
-
var lib$
|
|
29263
|
+
var lib$7 = {};
|
|
29065
29264
|
|
|
29066
|
-
var lib$
|
|
29265
|
+
var lib$6 = {};
|
|
29067
29266
|
|
|
29068
29267
|
var htmlToDom = {};
|
|
29069
29268
|
|
|
29070
|
-
var lib$
|
|
29269
|
+
var lib$5 = {};
|
|
29071
29270
|
|
|
29072
|
-
var lib$
|
|
29271
|
+
var lib$4 = {};
|
|
29073
29272
|
|
|
29074
|
-
var hasRequiredLib$
|
|
29273
|
+
var hasRequiredLib$7;
|
|
29075
29274
|
|
|
29076
|
-
function requireLib$
|
|
29077
|
-
if (hasRequiredLib$
|
|
29078
|
-
hasRequiredLib$
|
|
29275
|
+
function requireLib$7 () {
|
|
29276
|
+
if (hasRequiredLib$7) return lib$4;
|
|
29277
|
+
hasRequiredLib$7 = 1;
|
|
29079
29278
|
(function (exports) {
|
|
29080
29279
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29081
29280
|
exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;
|
|
@@ -29131,18 +29330,18 @@ function requireLib$9 () {
|
|
|
29131
29330
|
exports.CDATA = ElementType.CDATA;
|
|
29132
29331
|
/** Type for <!doctype ...> */
|
|
29133
29332
|
exports.Doctype = ElementType.Doctype;
|
|
29134
|
-
} (lib$
|
|
29135
|
-
return lib$
|
|
29333
|
+
} (lib$4));
|
|
29334
|
+
return lib$4;
|
|
29136
29335
|
}
|
|
29137
29336
|
|
|
29138
|
-
var node
|
|
29337
|
+
var node = {};
|
|
29139
29338
|
|
|
29140
|
-
var hasRequiredNode
|
|
29339
|
+
var hasRequiredNode;
|
|
29141
29340
|
|
|
29142
|
-
function requireNode
|
|
29143
|
-
if (hasRequiredNode
|
|
29144
|
-
hasRequiredNode
|
|
29145
|
-
var __extends = (node
|
|
29341
|
+
function requireNode () {
|
|
29342
|
+
if (hasRequiredNode) return node;
|
|
29343
|
+
hasRequiredNode = 1;
|
|
29344
|
+
var __extends = (node && node.__extends) || (function () {
|
|
29146
29345
|
var extendStatics = function (d, b) {
|
|
29147
29346
|
extendStatics = Object.setPrototypeOf ||
|
|
29148
29347
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -29157,7 +29356,7 @@ function requireNode$2 () {
|
|
|
29157
29356
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
29158
29357
|
};
|
|
29159
29358
|
})();
|
|
29160
|
-
var __assign = (node
|
|
29359
|
+
var __assign = (node && node.__assign) || function () {
|
|
29161
29360
|
__assign = Object.assign || function(t) {
|
|
29162
29361
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
29163
29362
|
s = arguments[i];
|
|
@@ -29168,9 +29367,9 @@ function requireNode$2 () {
|
|
|
29168
29367
|
};
|
|
29169
29368
|
return __assign.apply(this, arguments);
|
|
29170
29369
|
};
|
|
29171
|
-
Object.defineProperty(node
|
|
29172
|
-
node
|
|
29173
|
-
var domelementtype_1 = /*@__PURE__*/ requireLib$
|
|
29370
|
+
Object.defineProperty(node, "__esModule", { value: true });
|
|
29371
|
+
node.cloneNode = node.hasChildren = node.isDocument = node.isDirective = node.isComment = node.isText = node.isCDATA = node.isTag = node.Element = node.Document = node.CDATA = node.NodeWithChildren = node.ProcessingInstruction = node.Comment = node.Text = node.DataNode = node.Node = void 0;
|
|
29372
|
+
var domelementtype_1 = /*@__PURE__*/ requireLib$7();
|
|
29174
29373
|
/**
|
|
29175
29374
|
* This object will be used as the prototype for Nodes when creating a
|
|
29176
29375
|
* DOM-Level-1-compliant structure.
|
|
@@ -29243,7 +29442,7 @@ function requireNode$2 () {
|
|
|
29243
29442
|
};
|
|
29244
29443
|
return Node;
|
|
29245
29444
|
}());
|
|
29246
|
-
node
|
|
29445
|
+
node.Node = Node;
|
|
29247
29446
|
/**
|
|
29248
29447
|
* A node that contains some data.
|
|
29249
29448
|
*/
|
|
@@ -29273,7 +29472,7 @@ function requireNode$2 () {
|
|
|
29273
29472
|
});
|
|
29274
29473
|
return DataNode;
|
|
29275
29474
|
}(Node));
|
|
29276
|
-
node
|
|
29475
|
+
node.DataNode = DataNode;
|
|
29277
29476
|
/**
|
|
29278
29477
|
* Text within the document.
|
|
29279
29478
|
*/
|
|
@@ -29293,7 +29492,7 @@ function requireNode$2 () {
|
|
|
29293
29492
|
});
|
|
29294
29493
|
return Text;
|
|
29295
29494
|
}(DataNode));
|
|
29296
|
-
node
|
|
29495
|
+
node.Text = Text;
|
|
29297
29496
|
/**
|
|
29298
29497
|
* Comments within the document.
|
|
29299
29498
|
*/
|
|
@@ -29313,7 +29512,7 @@ function requireNode$2 () {
|
|
|
29313
29512
|
});
|
|
29314
29513
|
return Comment;
|
|
29315
29514
|
}(DataNode));
|
|
29316
|
-
node
|
|
29515
|
+
node.Comment = Comment;
|
|
29317
29516
|
/**
|
|
29318
29517
|
* Processing instructions, including doc types.
|
|
29319
29518
|
*/
|
|
@@ -29334,7 +29533,7 @@ function requireNode$2 () {
|
|
|
29334
29533
|
});
|
|
29335
29534
|
return ProcessingInstruction;
|
|
29336
29535
|
}(DataNode));
|
|
29337
|
-
node
|
|
29536
|
+
node.ProcessingInstruction = ProcessingInstruction;
|
|
29338
29537
|
/**
|
|
29339
29538
|
* A `Node` that can have children.
|
|
29340
29539
|
*/
|
|
@@ -29384,7 +29583,7 @@ function requireNode$2 () {
|
|
|
29384
29583
|
});
|
|
29385
29584
|
return NodeWithChildren;
|
|
29386
29585
|
}(Node));
|
|
29387
|
-
node
|
|
29586
|
+
node.NodeWithChildren = NodeWithChildren;
|
|
29388
29587
|
var CDATA = /** @class */ (function (_super) {
|
|
29389
29588
|
__extends(CDATA, _super);
|
|
29390
29589
|
function CDATA() {
|
|
@@ -29401,7 +29600,7 @@ function requireNode$2 () {
|
|
|
29401
29600
|
});
|
|
29402
29601
|
return CDATA;
|
|
29403
29602
|
}(NodeWithChildren));
|
|
29404
|
-
node
|
|
29603
|
+
node.CDATA = CDATA;
|
|
29405
29604
|
/**
|
|
29406
29605
|
* The root node of the document.
|
|
29407
29606
|
*/
|
|
@@ -29421,7 +29620,7 @@ function requireNode$2 () {
|
|
|
29421
29620
|
});
|
|
29422
29621
|
return Document;
|
|
29423
29622
|
}(NodeWithChildren));
|
|
29424
|
-
node
|
|
29623
|
+
node.Document = Document;
|
|
29425
29624
|
/**
|
|
29426
29625
|
* An element within the DOM.
|
|
29427
29626
|
*/
|
|
@@ -29485,7 +29684,7 @@ function requireNode$2 () {
|
|
|
29485
29684
|
});
|
|
29486
29685
|
return Element;
|
|
29487
29686
|
}(NodeWithChildren));
|
|
29488
|
-
node
|
|
29687
|
+
node.Element = Element;
|
|
29489
29688
|
/**
|
|
29490
29689
|
* @param node Node to check.
|
|
29491
29690
|
* @returns `true` if the node is a `Element`, `false` otherwise.
|
|
@@ -29493,7 +29692,7 @@ function requireNode$2 () {
|
|
|
29493
29692
|
function isTag(node) {
|
|
29494
29693
|
return (0, domelementtype_1.isTag)(node);
|
|
29495
29694
|
}
|
|
29496
|
-
node
|
|
29695
|
+
node.isTag = isTag;
|
|
29497
29696
|
/**
|
|
29498
29697
|
* @param node Node to check.
|
|
29499
29698
|
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
|
|
@@ -29501,7 +29700,7 @@ function requireNode$2 () {
|
|
|
29501
29700
|
function isCDATA(node) {
|
|
29502
29701
|
return node.type === domelementtype_1.ElementType.CDATA;
|
|
29503
29702
|
}
|
|
29504
|
-
node
|
|
29703
|
+
node.isCDATA = isCDATA;
|
|
29505
29704
|
/**
|
|
29506
29705
|
* @param node Node to check.
|
|
29507
29706
|
* @returns `true` if the node has the type `Text`, `false` otherwise.
|
|
@@ -29509,7 +29708,7 @@ function requireNode$2 () {
|
|
|
29509
29708
|
function isText(node) {
|
|
29510
29709
|
return node.type === domelementtype_1.ElementType.Text;
|
|
29511
29710
|
}
|
|
29512
|
-
node
|
|
29711
|
+
node.isText = isText;
|
|
29513
29712
|
/**
|
|
29514
29713
|
* @param node Node to check.
|
|
29515
29714
|
* @returns `true` if the node has the type `Comment`, `false` otherwise.
|
|
@@ -29517,7 +29716,7 @@ function requireNode$2 () {
|
|
|
29517
29716
|
function isComment(node) {
|
|
29518
29717
|
return node.type === domelementtype_1.ElementType.Comment;
|
|
29519
29718
|
}
|
|
29520
|
-
node
|
|
29719
|
+
node.isComment = isComment;
|
|
29521
29720
|
/**
|
|
29522
29721
|
* @param node Node to check.
|
|
29523
29722
|
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
@@ -29525,7 +29724,7 @@ function requireNode$2 () {
|
|
|
29525
29724
|
function isDirective(node) {
|
|
29526
29725
|
return node.type === domelementtype_1.ElementType.Directive;
|
|
29527
29726
|
}
|
|
29528
|
-
node
|
|
29727
|
+
node.isDirective = isDirective;
|
|
29529
29728
|
/**
|
|
29530
29729
|
* @param node Node to check.
|
|
29531
29730
|
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
@@ -29533,7 +29732,7 @@ function requireNode$2 () {
|
|
|
29533
29732
|
function isDocument(node) {
|
|
29534
29733
|
return node.type === domelementtype_1.ElementType.Root;
|
|
29535
29734
|
}
|
|
29536
|
-
node
|
|
29735
|
+
node.isDocument = isDocument;
|
|
29537
29736
|
/**
|
|
29538
29737
|
* @param node Node to check.
|
|
29539
29738
|
* @returns `true` if the node has children, `false` otherwise.
|
|
@@ -29541,7 +29740,7 @@ function requireNode$2 () {
|
|
|
29541
29740
|
function hasChildren(node) {
|
|
29542
29741
|
return Object.prototype.hasOwnProperty.call(node, "children");
|
|
29543
29742
|
}
|
|
29544
|
-
node
|
|
29743
|
+
node.hasChildren = hasChildren;
|
|
29545
29744
|
/**
|
|
29546
29745
|
* Clone a node, and optionally its children.
|
|
29547
29746
|
*
|
|
@@ -29606,7 +29805,7 @@ function requireNode$2 () {
|
|
|
29606
29805
|
}
|
|
29607
29806
|
return result;
|
|
29608
29807
|
}
|
|
29609
|
-
node
|
|
29808
|
+
node.cloneNode = cloneNode;
|
|
29610
29809
|
function cloneChildren(childs) {
|
|
29611
29810
|
var children = childs.map(function (child) { return cloneNode(child, true); });
|
|
29612
29811
|
for (var i = 1; i < children.length; i++) {
|
|
@@ -29615,16 +29814,16 @@ function requireNode$2 () {
|
|
|
29615
29814
|
}
|
|
29616
29815
|
return children;
|
|
29617
29816
|
}
|
|
29618
|
-
return node
|
|
29817
|
+
return node;
|
|
29619
29818
|
}
|
|
29620
29819
|
|
|
29621
|
-
var hasRequiredLib$
|
|
29820
|
+
var hasRequiredLib$6;
|
|
29622
29821
|
|
|
29623
|
-
function requireLib$
|
|
29624
|
-
if (hasRequiredLib$
|
|
29625
|
-
hasRequiredLib$
|
|
29822
|
+
function requireLib$6 () {
|
|
29823
|
+
if (hasRequiredLib$6) return lib$5;
|
|
29824
|
+
hasRequiredLib$6 = 1;
|
|
29626
29825
|
(function (exports) {
|
|
29627
|
-
var __createBinding = (lib$
|
|
29826
|
+
var __createBinding = (lib$5 && lib$5.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29628
29827
|
if (k2 === undefined) k2 = k;
|
|
29629
29828
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
29630
29829
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -29635,14 +29834,14 @@ function requireLib$8 () {
|
|
|
29635
29834
|
if (k2 === undefined) k2 = k;
|
|
29636
29835
|
o[k2] = m[k];
|
|
29637
29836
|
}));
|
|
29638
|
-
var __exportStar = (lib$
|
|
29837
|
+
var __exportStar = (lib$5 && lib$5.__exportStar) || function(m, exports) {
|
|
29639
29838
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
29640
29839
|
};
|
|
29641
29840
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29642
29841
|
exports.DomHandler = void 0;
|
|
29643
|
-
var domelementtype_1 = /*@__PURE__*/ requireLib$
|
|
29644
|
-
var node_js_1 = /*@__PURE__*/ requireNode
|
|
29645
|
-
__exportStar(/*@__PURE__*/ requireNode
|
|
29842
|
+
var domelementtype_1 = /*@__PURE__*/ requireLib$7();
|
|
29843
|
+
var node_js_1 = /*@__PURE__*/ requireNode();
|
|
29844
|
+
__exportStar(/*@__PURE__*/ requireNode(), exports);
|
|
29646
29845
|
// Default options
|
|
29647
29846
|
var defaultOpts = {
|
|
29648
29847
|
withStartIndices: false,
|
|
@@ -29788,8 +29987,8 @@ function requireLib$8 () {
|
|
|
29788
29987
|
}());
|
|
29789
29988
|
exports.DomHandler = DomHandler;
|
|
29790
29989
|
exports.default = DomHandler;
|
|
29791
|
-
} (lib$
|
|
29792
|
-
return lib$
|
|
29990
|
+
} (lib$5));
|
|
29991
|
+
return lib$5;
|
|
29793
29992
|
}
|
|
29794
29993
|
|
|
29795
29994
|
var commonjs = {};
|
|
@@ -31778,672 +31977,13 @@ function requireParser () {
|
|
|
31778
31977
|
return Parser;
|
|
31779
31978
|
}
|
|
31780
31979
|
|
|
31781
|
-
var lib$
|
|
31980
|
+
var lib$3 = {};
|
|
31782
31981
|
|
|
31783
|
-
var
|
|
31982
|
+
var stringify = {};
|
|
31784
31983
|
|
|
31785
|
-
var
|
|
31984
|
+
var lib$2 = {};
|
|
31786
31985
|
|
|
31787
|
-
|
|
31788
|
-
if (hasRequiredNode$1) return node$1;
|
|
31789
|
-
hasRequiredNode$1 = 1;
|
|
31790
|
-
var __extends = (node$1 && node$1.__extends) || (function () {
|
|
31791
|
-
var extendStatics = function (d, b) {
|
|
31792
|
-
extendStatics = Object.setPrototypeOf ||
|
|
31793
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
31794
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
31795
|
-
return extendStatics(d, b);
|
|
31796
|
-
};
|
|
31797
|
-
return function (d, b) {
|
|
31798
|
-
if (typeof b !== "function" && b !== null)
|
|
31799
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
31800
|
-
extendStatics(d, b);
|
|
31801
|
-
function __() { this.constructor = d; }
|
|
31802
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
31803
|
-
};
|
|
31804
|
-
})();
|
|
31805
|
-
var __assign = (node$1 && node$1.__assign) || function () {
|
|
31806
|
-
__assign = Object.assign || function(t) {
|
|
31807
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
31808
|
-
s = arguments[i];
|
|
31809
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
31810
|
-
t[p] = s[p];
|
|
31811
|
-
}
|
|
31812
|
-
return t;
|
|
31813
|
-
};
|
|
31814
|
-
return __assign.apply(this, arguments);
|
|
31815
|
-
};
|
|
31816
|
-
Object.defineProperty(node$1, "__esModule", { value: true });
|
|
31817
|
-
node$1.cloneNode = node$1.hasChildren = node$1.isDocument = node$1.isDirective = node$1.isComment = node$1.isText = node$1.isCDATA = node$1.isTag = node$1.Element = node$1.Document = node$1.CDATA = node$1.NodeWithChildren = node$1.ProcessingInstruction = node$1.Comment = node$1.Text = node$1.DataNode = node$1.Node = void 0;
|
|
31818
|
-
var domelementtype_1 = /*@__PURE__*/ requireLib$9();
|
|
31819
|
-
/**
|
|
31820
|
-
* This object will be used as the prototype for Nodes when creating a
|
|
31821
|
-
* DOM-Level-1-compliant structure.
|
|
31822
|
-
*/
|
|
31823
|
-
var Node = /** @class */ (function () {
|
|
31824
|
-
function Node() {
|
|
31825
|
-
/** Parent of the node */
|
|
31826
|
-
this.parent = null;
|
|
31827
|
-
/** Previous sibling */
|
|
31828
|
-
this.prev = null;
|
|
31829
|
-
/** Next sibling */
|
|
31830
|
-
this.next = null;
|
|
31831
|
-
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
|
|
31832
|
-
this.startIndex = null;
|
|
31833
|
-
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
|
|
31834
|
-
this.endIndex = null;
|
|
31835
|
-
}
|
|
31836
|
-
Object.defineProperty(Node.prototype, "parentNode", {
|
|
31837
|
-
// Read-write aliases for properties
|
|
31838
|
-
/**
|
|
31839
|
-
* Same as {@link parent}.
|
|
31840
|
-
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
31841
|
-
*/
|
|
31842
|
-
get: function () {
|
|
31843
|
-
return this.parent;
|
|
31844
|
-
},
|
|
31845
|
-
set: function (parent) {
|
|
31846
|
-
this.parent = parent;
|
|
31847
|
-
},
|
|
31848
|
-
enumerable: false,
|
|
31849
|
-
configurable: true
|
|
31850
|
-
});
|
|
31851
|
-
Object.defineProperty(Node.prototype, "previousSibling", {
|
|
31852
|
-
/**
|
|
31853
|
-
* Same as {@link prev}.
|
|
31854
|
-
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
31855
|
-
*/
|
|
31856
|
-
get: function () {
|
|
31857
|
-
return this.prev;
|
|
31858
|
-
},
|
|
31859
|
-
set: function (prev) {
|
|
31860
|
-
this.prev = prev;
|
|
31861
|
-
},
|
|
31862
|
-
enumerable: false,
|
|
31863
|
-
configurable: true
|
|
31864
|
-
});
|
|
31865
|
-
Object.defineProperty(Node.prototype, "nextSibling", {
|
|
31866
|
-
/**
|
|
31867
|
-
* Same as {@link next}.
|
|
31868
|
-
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
31869
|
-
*/
|
|
31870
|
-
get: function () {
|
|
31871
|
-
return this.next;
|
|
31872
|
-
},
|
|
31873
|
-
set: function (next) {
|
|
31874
|
-
this.next = next;
|
|
31875
|
-
},
|
|
31876
|
-
enumerable: false,
|
|
31877
|
-
configurable: true
|
|
31878
|
-
});
|
|
31879
|
-
/**
|
|
31880
|
-
* Clone this node, and optionally its children.
|
|
31881
|
-
*
|
|
31882
|
-
* @param recursive Clone child nodes as well.
|
|
31883
|
-
* @returns A clone of the node.
|
|
31884
|
-
*/
|
|
31885
|
-
Node.prototype.cloneNode = function (recursive) {
|
|
31886
|
-
if (recursive === void 0) { recursive = false; }
|
|
31887
|
-
return cloneNode(this, recursive);
|
|
31888
|
-
};
|
|
31889
|
-
return Node;
|
|
31890
|
-
}());
|
|
31891
|
-
node$1.Node = Node;
|
|
31892
|
-
/**
|
|
31893
|
-
* A node that contains some data.
|
|
31894
|
-
*/
|
|
31895
|
-
var DataNode = /** @class */ (function (_super) {
|
|
31896
|
-
__extends(DataNode, _super);
|
|
31897
|
-
/**
|
|
31898
|
-
* @param data The content of the data node
|
|
31899
|
-
*/
|
|
31900
|
-
function DataNode(data) {
|
|
31901
|
-
var _this = _super.call(this) || this;
|
|
31902
|
-
_this.data = data;
|
|
31903
|
-
return _this;
|
|
31904
|
-
}
|
|
31905
|
-
Object.defineProperty(DataNode.prototype, "nodeValue", {
|
|
31906
|
-
/**
|
|
31907
|
-
* Same as {@link data}.
|
|
31908
|
-
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
31909
|
-
*/
|
|
31910
|
-
get: function () {
|
|
31911
|
-
return this.data;
|
|
31912
|
-
},
|
|
31913
|
-
set: function (data) {
|
|
31914
|
-
this.data = data;
|
|
31915
|
-
},
|
|
31916
|
-
enumerable: false,
|
|
31917
|
-
configurable: true
|
|
31918
|
-
});
|
|
31919
|
-
return DataNode;
|
|
31920
|
-
}(Node));
|
|
31921
|
-
node$1.DataNode = DataNode;
|
|
31922
|
-
/**
|
|
31923
|
-
* Text within the document.
|
|
31924
|
-
*/
|
|
31925
|
-
var Text = /** @class */ (function (_super) {
|
|
31926
|
-
__extends(Text, _super);
|
|
31927
|
-
function Text() {
|
|
31928
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
31929
|
-
_this.type = domelementtype_1.ElementType.Text;
|
|
31930
|
-
return _this;
|
|
31931
|
-
}
|
|
31932
|
-
Object.defineProperty(Text.prototype, "nodeType", {
|
|
31933
|
-
get: function () {
|
|
31934
|
-
return 3;
|
|
31935
|
-
},
|
|
31936
|
-
enumerable: false,
|
|
31937
|
-
configurable: true
|
|
31938
|
-
});
|
|
31939
|
-
return Text;
|
|
31940
|
-
}(DataNode));
|
|
31941
|
-
node$1.Text = Text;
|
|
31942
|
-
/**
|
|
31943
|
-
* Comments within the document.
|
|
31944
|
-
*/
|
|
31945
|
-
var Comment = /** @class */ (function (_super) {
|
|
31946
|
-
__extends(Comment, _super);
|
|
31947
|
-
function Comment() {
|
|
31948
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
31949
|
-
_this.type = domelementtype_1.ElementType.Comment;
|
|
31950
|
-
return _this;
|
|
31951
|
-
}
|
|
31952
|
-
Object.defineProperty(Comment.prototype, "nodeType", {
|
|
31953
|
-
get: function () {
|
|
31954
|
-
return 8;
|
|
31955
|
-
},
|
|
31956
|
-
enumerable: false,
|
|
31957
|
-
configurable: true
|
|
31958
|
-
});
|
|
31959
|
-
return Comment;
|
|
31960
|
-
}(DataNode));
|
|
31961
|
-
node$1.Comment = Comment;
|
|
31962
|
-
/**
|
|
31963
|
-
* Processing instructions, including doc types.
|
|
31964
|
-
*/
|
|
31965
|
-
var ProcessingInstruction = /** @class */ (function (_super) {
|
|
31966
|
-
__extends(ProcessingInstruction, _super);
|
|
31967
|
-
function ProcessingInstruction(name, data) {
|
|
31968
|
-
var _this = _super.call(this, data) || this;
|
|
31969
|
-
_this.name = name;
|
|
31970
|
-
_this.type = domelementtype_1.ElementType.Directive;
|
|
31971
|
-
return _this;
|
|
31972
|
-
}
|
|
31973
|
-
Object.defineProperty(ProcessingInstruction.prototype, "nodeType", {
|
|
31974
|
-
get: function () {
|
|
31975
|
-
return 1;
|
|
31976
|
-
},
|
|
31977
|
-
enumerable: false,
|
|
31978
|
-
configurable: true
|
|
31979
|
-
});
|
|
31980
|
-
return ProcessingInstruction;
|
|
31981
|
-
}(DataNode));
|
|
31982
|
-
node$1.ProcessingInstruction = ProcessingInstruction;
|
|
31983
|
-
/**
|
|
31984
|
-
* A `Node` that can have children.
|
|
31985
|
-
*/
|
|
31986
|
-
var NodeWithChildren = /** @class */ (function (_super) {
|
|
31987
|
-
__extends(NodeWithChildren, _super);
|
|
31988
|
-
/**
|
|
31989
|
-
* @param children Children of the node. Only certain node types can have children.
|
|
31990
|
-
*/
|
|
31991
|
-
function NodeWithChildren(children) {
|
|
31992
|
-
var _this = _super.call(this) || this;
|
|
31993
|
-
_this.children = children;
|
|
31994
|
-
return _this;
|
|
31995
|
-
}
|
|
31996
|
-
Object.defineProperty(NodeWithChildren.prototype, "firstChild", {
|
|
31997
|
-
// Aliases
|
|
31998
|
-
/** First child of the node. */
|
|
31999
|
-
get: function () {
|
|
32000
|
-
var _a;
|
|
32001
|
-
return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
|
|
32002
|
-
},
|
|
32003
|
-
enumerable: false,
|
|
32004
|
-
configurable: true
|
|
32005
|
-
});
|
|
32006
|
-
Object.defineProperty(NodeWithChildren.prototype, "lastChild", {
|
|
32007
|
-
/** Last child of the node. */
|
|
32008
|
-
get: function () {
|
|
32009
|
-
return this.children.length > 0
|
|
32010
|
-
? this.children[this.children.length - 1]
|
|
32011
|
-
: null;
|
|
32012
|
-
},
|
|
32013
|
-
enumerable: false,
|
|
32014
|
-
configurable: true
|
|
32015
|
-
});
|
|
32016
|
-
Object.defineProperty(NodeWithChildren.prototype, "childNodes", {
|
|
32017
|
-
/**
|
|
32018
|
-
* Same as {@link children}.
|
|
32019
|
-
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
32020
|
-
*/
|
|
32021
|
-
get: function () {
|
|
32022
|
-
return this.children;
|
|
32023
|
-
},
|
|
32024
|
-
set: function (children) {
|
|
32025
|
-
this.children = children;
|
|
32026
|
-
},
|
|
32027
|
-
enumerable: false,
|
|
32028
|
-
configurable: true
|
|
32029
|
-
});
|
|
32030
|
-
return NodeWithChildren;
|
|
32031
|
-
}(Node));
|
|
32032
|
-
node$1.NodeWithChildren = NodeWithChildren;
|
|
32033
|
-
var CDATA = /** @class */ (function (_super) {
|
|
32034
|
-
__extends(CDATA, _super);
|
|
32035
|
-
function CDATA() {
|
|
32036
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
32037
|
-
_this.type = domelementtype_1.ElementType.CDATA;
|
|
32038
|
-
return _this;
|
|
32039
|
-
}
|
|
32040
|
-
Object.defineProperty(CDATA.prototype, "nodeType", {
|
|
32041
|
-
get: function () {
|
|
32042
|
-
return 4;
|
|
32043
|
-
},
|
|
32044
|
-
enumerable: false,
|
|
32045
|
-
configurable: true
|
|
32046
|
-
});
|
|
32047
|
-
return CDATA;
|
|
32048
|
-
}(NodeWithChildren));
|
|
32049
|
-
node$1.CDATA = CDATA;
|
|
32050
|
-
/**
|
|
32051
|
-
* The root node of the document.
|
|
32052
|
-
*/
|
|
32053
|
-
var Document = /** @class */ (function (_super) {
|
|
32054
|
-
__extends(Document, _super);
|
|
32055
|
-
function Document() {
|
|
32056
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
32057
|
-
_this.type = domelementtype_1.ElementType.Root;
|
|
32058
|
-
return _this;
|
|
32059
|
-
}
|
|
32060
|
-
Object.defineProperty(Document.prototype, "nodeType", {
|
|
32061
|
-
get: function () {
|
|
32062
|
-
return 9;
|
|
32063
|
-
},
|
|
32064
|
-
enumerable: false,
|
|
32065
|
-
configurable: true
|
|
32066
|
-
});
|
|
32067
|
-
return Document;
|
|
32068
|
-
}(NodeWithChildren));
|
|
32069
|
-
node$1.Document = Document;
|
|
32070
|
-
/**
|
|
32071
|
-
* An element within the DOM.
|
|
32072
|
-
*/
|
|
32073
|
-
var Element = /** @class */ (function (_super) {
|
|
32074
|
-
__extends(Element, _super);
|
|
32075
|
-
/**
|
|
32076
|
-
* @param name Name of the tag, eg. `div`, `span`.
|
|
32077
|
-
* @param attribs Object mapping attribute names to attribute values.
|
|
32078
|
-
* @param children Children of the node.
|
|
32079
|
-
*/
|
|
32080
|
-
function Element(name, attribs, children, type) {
|
|
32081
|
-
if (children === void 0) { children = []; }
|
|
32082
|
-
if (type === void 0) { type = name === "script"
|
|
32083
|
-
? domelementtype_1.ElementType.Script
|
|
32084
|
-
: name === "style"
|
|
32085
|
-
? domelementtype_1.ElementType.Style
|
|
32086
|
-
: domelementtype_1.ElementType.Tag; }
|
|
32087
|
-
var _this = _super.call(this, children) || this;
|
|
32088
|
-
_this.name = name;
|
|
32089
|
-
_this.attribs = attribs;
|
|
32090
|
-
_this.type = type;
|
|
32091
|
-
return _this;
|
|
32092
|
-
}
|
|
32093
|
-
Object.defineProperty(Element.prototype, "nodeType", {
|
|
32094
|
-
get: function () {
|
|
32095
|
-
return 1;
|
|
32096
|
-
},
|
|
32097
|
-
enumerable: false,
|
|
32098
|
-
configurable: true
|
|
32099
|
-
});
|
|
32100
|
-
Object.defineProperty(Element.prototype, "tagName", {
|
|
32101
|
-
// DOM Level 1 aliases
|
|
32102
|
-
/**
|
|
32103
|
-
* Same as {@link name}.
|
|
32104
|
-
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
32105
|
-
*/
|
|
32106
|
-
get: function () {
|
|
32107
|
-
return this.name;
|
|
32108
|
-
},
|
|
32109
|
-
set: function (name) {
|
|
32110
|
-
this.name = name;
|
|
32111
|
-
},
|
|
32112
|
-
enumerable: false,
|
|
32113
|
-
configurable: true
|
|
32114
|
-
});
|
|
32115
|
-
Object.defineProperty(Element.prototype, "attributes", {
|
|
32116
|
-
get: function () {
|
|
32117
|
-
var _this = this;
|
|
32118
|
-
return Object.keys(this.attribs).map(function (name) {
|
|
32119
|
-
var _a, _b;
|
|
32120
|
-
return ({
|
|
32121
|
-
name: name,
|
|
32122
|
-
value: _this.attribs[name],
|
|
32123
|
-
namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
|
|
32124
|
-
prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name],
|
|
32125
|
-
});
|
|
32126
|
-
});
|
|
32127
|
-
},
|
|
32128
|
-
enumerable: false,
|
|
32129
|
-
configurable: true
|
|
32130
|
-
});
|
|
32131
|
-
return Element;
|
|
32132
|
-
}(NodeWithChildren));
|
|
32133
|
-
node$1.Element = Element;
|
|
32134
|
-
/**
|
|
32135
|
-
* @param node Node to check.
|
|
32136
|
-
* @returns `true` if the node is a `Element`, `false` otherwise.
|
|
32137
|
-
*/
|
|
32138
|
-
function isTag(node) {
|
|
32139
|
-
return (0, domelementtype_1.isTag)(node);
|
|
32140
|
-
}
|
|
32141
|
-
node$1.isTag = isTag;
|
|
32142
|
-
/**
|
|
32143
|
-
* @param node Node to check.
|
|
32144
|
-
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
|
|
32145
|
-
*/
|
|
32146
|
-
function isCDATA(node) {
|
|
32147
|
-
return node.type === domelementtype_1.ElementType.CDATA;
|
|
32148
|
-
}
|
|
32149
|
-
node$1.isCDATA = isCDATA;
|
|
32150
|
-
/**
|
|
32151
|
-
* @param node Node to check.
|
|
32152
|
-
* @returns `true` if the node has the type `Text`, `false` otherwise.
|
|
32153
|
-
*/
|
|
32154
|
-
function isText(node) {
|
|
32155
|
-
return node.type === domelementtype_1.ElementType.Text;
|
|
32156
|
-
}
|
|
32157
|
-
node$1.isText = isText;
|
|
32158
|
-
/**
|
|
32159
|
-
* @param node Node to check.
|
|
32160
|
-
* @returns `true` if the node has the type `Comment`, `false` otherwise.
|
|
32161
|
-
*/
|
|
32162
|
-
function isComment(node) {
|
|
32163
|
-
return node.type === domelementtype_1.ElementType.Comment;
|
|
32164
|
-
}
|
|
32165
|
-
node$1.isComment = isComment;
|
|
32166
|
-
/**
|
|
32167
|
-
* @param node Node to check.
|
|
32168
|
-
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
32169
|
-
*/
|
|
32170
|
-
function isDirective(node) {
|
|
32171
|
-
return node.type === domelementtype_1.ElementType.Directive;
|
|
32172
|
-
}
|
|
32173
|
-
node$1.isDirective = isDirective;
|
|
32174
|
-
/**
|
|
32175
|
-
* @param node Node to check.
|
|
32176
|
-
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
32177
|
-
*/
|
|
32178
|
-
function isDocument(node) {
|
|
32179
|
-
return node.type === domelementtype_1.ElementType.Root;
|
|
32180
|
-
}
|
|
32181
|
-
node$1.isDocument = isDocument;
|
|
32182
|
-
/**
|
|
32183
|
-
* @param node Node to check.
|
|
32184
|
-
* @returns `true` if the node has children, `false` otherwise.
|
|
32185
|
-
*/
|
|
32186
|
-
function hasChildren(node) {
|
|
32187
|
-
return Object.prototype.hasOwnProperty.call(node, "children");
|
|
32188
|
-
}
|
|
32189
|
-
node$1.hasChildren = hasChildren;
|
|
32190
|
-
/**
|
|
32191
|
-
* Clone a node, and optionally its children.
|
|
32192
|
-
*
|
|
32193
|
-
* @param recursive Clone child nodes as well.
|
|
32194
|
-
* @returns A clone of the node.
|
|
32195
|
-
*/
|
|
32196
|
-
function cloneNode(node, recursive) {
|
|
32197
|
-
if (recursive === void 0) { recursive = false; }
|
|
32198
|
-
var result;
|
|
32199
|
-
if (isText(node)) {
|
|
32200
|
-
result = new Text(node.data);
|
|
32201
|
-
}
|
|
32202
|
-
else if (isComment(node)) {
|
|
32203
|
-
result = new Comment(node.data);
|
|
32204
|
-
}
|
|
32205
|
-
else if (isTag(node)) {
|
|
32206
|
-
var children = recursive ? cloneChildren(node.children) : [];
|
|
32207
|
-
var clone_1 = new Element(node.name, __assign({}, node.attribs), children);
|
|
32208
|
-
children.forEach(function (child) { return (child.parent = clone_1); });
|
|
32209
|
-
if (node.namespace != null) {
|
|
32210
|
-
clone_1.namespace = node.namespace;
|
|
32211
|
-
}
|
|
32212
|
-
if (node["x-attribsNamespace"]) {
|
|
32213
|
-
clone_1["x-attribsNamespace"] = __assign({}, node["x-attribsNamespace"]);
|
|
32214
|
-
}
|
|
32215
|
-
if (node["x-attribsPrefix"]) {
|
|
32216
|
-
clone_1["x-attribsPrefix"] = __assign({}, node["x-attribsPrefix"]);
|
|
32217
|
-
}
|
|
32218
|
-
result = clone_1;
|
|
32219
|
-
}
|
|
32220
|
-
else if (isCDATA(node)) {
|
|
32221
|
-
var children = recursive ? cloneChildren(node.children) : [];
|
|
32222
|
-
var clone_2 = new CDATA(children);
|
|
32223
|
-
children.forEach(function (child) { return (child.parent = clone_2); });
|
|
32224
|
-
result = clone_2;
|
|
32225
|
-
}
|
|
32226
|
-
else if (isDocument(node)) {
|
|
32227
|
-
var children = recursive ? cloneChildren(node.children) : [];
|
|
32228
|
-
var clone_3 = new Document(children);
|
|
32229
|
-
children.forEach(function (child) { return (child.parent = clone_3); });
|
|
32230
|
-
if (node["x-mode"]) {
|
|
32231
|
-
clone_3["x-mode"] = node["x-mode"];
|
|
32232
|
-
}
|
|
32233
|
-
result = clone_3;
|
|
32234
|
-
}
|
|
32235
|
-
else if (isDirective(node)) {
|
|
32236
|
-
var instruction = new ProcessingInstruction(node.name, node.data);
|
|
32237
|
-
if (node["x-name"] != null) {
|
|
32238
|
-
instruction["x-name"] = node["x-name"];
|
|
32239
|
-
instruction["x-publicId"] = node["x-publicId"];
|
|
32240
|
-
instruction["x-systemId"] = node["x-systemId"];
|
|
32241
|
-
}
|
|
32242
|
-
result = instruction;
|
|
32243
|
-
}
|
|
32244
|
-
else {
|
|
32245
|
-
throw new Error("Not implemented yet: ".concat(node.type));
|
|
32246
|
-
}
|
|
32247
|
-
result.startIndex = node.startIndex;
|
|
32248
|
-
result.endIndex = node.endIndex;
|
|
32249
|
-
if (node.sourceCodeLocation != null) {
|
|
32250
|
-
result.sourceCodeLocation = node.sourceCodeLocation;
|
|
32251
|
-
}
|
|
32252
|
-
return result;
|
|
32253
|
-
}
|
|
32254
|
-
node$1.cloneNode = cloneNode;
|
|
32255
|
-
function cloneChildren(childs) {
|
|
32256
|
-
var children = childs.map(function (child) { return cloneNode(child, true); });
|
|
32257
|
-
for (var i = 1; i < children.length; i++) {
|
|
32258
|
-
children[i].prev = children[i - 1];
|
|
32259
|
-
children[i - 1].next = children[i];
|
|
32260
|
-
}
|
|
32261
|
-
return children;
|
|
32262
|
-
}
|
|
32263
|
-
return node$1;
|
|
32264
|
-
}
|
|
32265
|
-
|
|
32266
|
-
var hasRequiredLib$7;
|
|
32267
|
-
|
|
32268
|
-
function requireLib$7 () {
|
|
32269
|
-
if (hasRequiredLib$7) return lib$5;
|
|
32270
|
-
hasRequiredLib$7 = 1;
|
|
32271
|
-
(function (exports) {
|
|
32272
|
-
var __createBinding = (lib$5 && lib$5.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
32273
|
-
if (k2 === undefined) k2 = k;
|
|
32274
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
32275
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32276
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
32277
|
-
}
|
|
32278
|
-
Object.defineProperty(o, k2, desc);
|
|
32279
|
-
}) : (function(o, m, k, k2) {
|
|
32280
|
-
if (k2 === undefined) k2 = k;
|
|
32281
|
-
o[k2] = m[k];
|
|
32282
|
-
}));
|
|
32283
|
-
var __exportStar = (lib$5 && lib$5.__exportStar) || function(m, exports) {
|
|
32284
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
32285
|
-
};
|
|
32286
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32287
|
-
exports.DomHandler = void 0;
|
|
32288
|
-
var domelementtype_1 = /*@__PURE__*/ requireLib$9();
|
|
32289
|
-
var node_js_1 = /*@__PURE__*/ requireNode$1();
|
|
32290
|
-
__exportStar(/*@__PURE__*/ requireNode$1(), exports);
|
|
32291
|
-
// Default options
|
|
32292
|
-
var defaultOpts = {
|
|
32293
|
-
withStartIndices: false,
|
|
32294
|
-
withEndIndices: false,
|
|
32295
|
-
xmlMode: false,
|
|
32296
|
-
};
|
|
32297
|
-
var DomHandler = /** @class */ (function () {
|
|
32298
|
-
/**
|
|
32299
|
-
* @param callback Called once parsing has completed.
|
|
32300
|
-
* @param options Settings for the handler.
|
|
32301
|
-
* @param elementCB Callback whenever a tag is closed.
|
|
32302
|
-
*/
|
|
32303
|
-
function DomHandler(callback, options, elementCB) {
|
|
32304
|
-
/** The elements of the DOM */
|
|
32305
|
-
this.dom = [];
|
|
32306
|
-
/** The root element for the DOM */
|
|
32307
|
-
this.root = new node_js_1.Document(this.dom);
|
|
32308
|
-
/** Indicated whether parsing has been completed. */
|
|
32309
|
-
this.done = false;
|
|
32310
|
-
/** Stack of open tags. */
|
|
32311
|
-
this.tagStack = [this.root];
|
|
32312
|
-
/** A data node that is still being written to. */
|
|
32313
|
-
this.lastNode = null;
|
|
32314
|
-
/** Reference to the parser instance. Used for location information. */
|
|
32315
|
-
this.parser = null;
|
|
32316
|
-
// Make it possible to skip arguments, for backwards-compatibility
|
|
32317
|
-
if (typeof options === "function") {
|
|
32318
|
-
elementCB = options;
|
|
32319
|
-
options = defaultOpts;
|
|
32320
|
-
}
|
|
32321
|
-
if (typeof callback === "object") {
|
|
32322
|
-
options = callback;
|
|
32323
|
-
callback = undefined;
|
|
32324
|
-
}
|
|
32325
|
-
this.callback = callback !== null && callback !== void 0 ? callback : null;
|
|
32326
|
-
this.options = options !== null && options !== void 0 ? options : defaultOpts;
|
|
32327
|
-
this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
|
|
32328
|
-
}
|
|
32329
|
-
DomHandler.prototype.onparserinit = function (parser) {
|
|
32330
|
-
this.parser = parser;
|
|
32331
|
-
};
|
|
32332
|
-
// Resets the handler back to starting state
|
|
32333
|
-
DomHandler.prototype.onreset = function () {
|
|
32334
|
-
this.dom = [];
|
|
32335
|
-
this.root = new node_js_1.Document(this.dom);
|
|
32336
|
-
this.done = false;
|
|
32337
|
-
this.tagStack = [this.root];
|
|
32338
|
-
this.lastNode = null;
|
|
32339
|
-
this.parser = null;
|
|
32340
|
-
};
|
|
32341
|
-
// Signals the handler that parsing is done
|
|
32342
|
-
DomHandler.prototype.onend = function () {
|
|
32343
|
-
if (this.done)
|
|
32344
|
-
return;
|
|
32345
|
-
this.done = true;
|
|
32346
|
-
this.parser = null;
|
|
32347
|
-
this.handleCallback(null);
|
|
32348
|
-
};
|
|
32349
|
-
DomHandler.prototype.onerror = function (error) {
|
|
32350
|
-
this.handleCallback(error);
|
|
32351
|
-
};
|
|
32352
|
-
DomHandler.prototype.onclosetag = function () {
|
|
32353
|
-
this.lastNode = null;
|
|
32354
|
-
var elem = this.tagStack.pop();
|
|
32355
|
-
if (this.options.withEndIndices) {
|
|
32356
|
-
elem.endIndex = this.parser.endIndex;
|
|
32357
|
-
}
|
|
32358
|
-
if (this.elementCB)
|
|
32359
|
-
this.elementCB(elem);
|
|
32360
|
-
};
|
|
32361
|
-
DomHandler.prototype.onopentag = function (name, attribs) {
|
|
32362
|
-
var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : undefined;
|
|
32363
|
-
var element = new node_js_1.Element(name, attribs, undefined, type);
|
|
32364
|
-
this.addNode(element);
|
|
32365
|
-
this.tagStack.push(element);
|
|
32366
|
-
};
|
|
32367
|
-
DomHandler.prototype.ontext = function (data) {
|
|
32368
|
-
var lastNode = this.lastNode;
|
|
32369
|
-
if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {
|
|
32370
|
-
lastNode.data += data;
|
|
32371
|
-
if (this.options.withEndIndices) {
|
|
32372
|
-
lastNode.endIndex = this.parser.endIndex;
|
|
32373
|
-
}
|
|
32374
|
-
}
|
|
32375
|
-
else {
|
|
32376
|
-
var node = new node_js_1.Text(data);
|
|
32377
|
-
this.addNode(node);
|
|
32378
|
-
this.lastNode = node;
|
|
32379
|
-
}
|
|
32380
|
-
};
|
|
32381
|
-
DomHandler.prototype.oncomment = function (data) {
|
|
32382
|
-
if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {
|
|
32383
|
-
this.lastNode.data += data;
|
|
32384
|
-
return;
|
|
32385
|
-
}
|
|
32386
|
-
var node = new node_js_1.Comment(data);
|
|
32387
|
-
this.addNode(node);
|
|
32388
|
-
this.lastNode = node;
|
|
32389
|
-
};
|
|
32390
|
-
DomHandler.prototype.oncommentend = function () {
|
|
32391
|
-
this.lastNode = null;
|
|
32392
|
-
};
|
|
32393
|
-
DomHandler.prototype.oncdatastart = function () {
|
|
32394
|
-
var text = new node_js_1.Text("");
|
|
32395
|
-
var node = new node_js_1.CDATA([text]);
|
|
32396
|
-
this.addNode(node);
|
|
32397
|
-
text.parent = node;
|
|
32398
|
-
this.lastNode = text;
|
|
32399
|
-
};
|
|
32400
|
-
DomHandler.prototype.oncdataend = function () {
|
|
32401
|
-
this.lastNode = null;
|
|
32402
|
-
};
|
|
32403
|
-
DomHandler.prototype.onprocessinginstruction = function (name, data) {
|
|
32404
|
-
var node = new node_js_1.ProcessingInstruction(name, data);
|
|
32405
|
-
this.addNode(node);
|
|
32406
|
-
};
|
|
32407
|
-
DomHandler.prototype.handleCallback = function (error) {
|
|
32408
|
-
if (typeof this.callback === "function") {
|
|
32409
|
-
this.callback(error, this.dom);
|
|
32410
|
-
}
|
|
32411
|
-
else if (error) {
|
|
32412
|
-
throw error;
|
|
32413
|
-
}
|
|
32414
|
-
};
|
|
32415
|
-
DomHandler.prototype.addNode = function (node) {
|
|
32416
|
-
var parent = this.tagStack[this.tagStack.length - 1];
|
|
32417
|
-
var previousSibling = parent.children[parent.children.length - 1];
|
|
32418
|
-
if (this.options.withStartIndices) {
|
|
32419
|
-
node.startIndex = this.parser.startIndex;
|
|
32420
|
-
}
|
|
32421
|
-
if (this.options.withEndIndices) {
|
|
32422
|
-
node.endIndex = this.parser.endIndex;
|
|
32423
|
-
}
|
|
32424
|
-
parent.children.push(node);
|
|
32425
|
-
if (previousSibling) {
|
|
32426
|
-
node.prev = previousSibling;
|
|
32427
|
-
previousSibling.next = node;
|
|
32428
|
-
}
|
|
32429
|
-
node.parent = parent;
|
|
32430
|
-
this.lastNode = null;
|
|
32431
|
-
};
|
|
32432
|
-
return DomHandler;
|
|
32433
|
-
}());
|
|
32434
|
-
exports.DomHandler = DomHandler;
|
|
32435
|
-
exports.default = DomHandler;
|
|
32436
|
-
} (lib$5));
|
|
32437
|
-
return lib$5;
|
|
32438
|
-
}
|
|
32439
|
-
|
|
32440
|
-
var lib$4 = {};
|
|
32441
|
-
|
|
32442
|
-
var stringify = {};
|
|
32443
|
-
|
|
32444
|
-
var lib$3 = {};
|
|
32445
|
-
|
|
32446
|
-
var lib$2 = {};
|
|
31986
|
+
var lib$1 = {};
|
|
32447
31987
|
|
|
32448
31988
|
var decode = {};
|
|
32449
31989
|
|
|
@@ -33355,11 +32895,11 @@ function requireEncode () {
|
|
|
33355
32895
|
return encode;
|
|
33356
32896
|
}
|
|
33357
32897
|
|
|
33358
|
-
var hasRequiredLib$
|
|
32898
|
+
var hasRequiredLib$5;
|
|
33359
32899
|
|
|
33360
|
-
function requireLib$
|
|
33361
|
-
if (hasRequiredLib$
|
|
33362
|
-
hasRequiredLib$
|
|
32900
|
+
function requireLib$5 () {
|
|
32901
|
+
if (hasRequiredLib$5) return lib$1;
|
|
32902
|
+
hasRequiredLib$5 = 1;
|
|
33363
32903
|
(function (exports) {
|
|
33364
32904
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33365
32905
|
exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLAttribute = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.DecodingMode = exports.EntityDecoder = exports.encodeHTML5 = exports.encodeHTML4 = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = exports.EncodingMode = exports.EntityLevel = void 0;
|
|
@@ -33486,8 +33026,8 @@ function requireLib$6 () {
|
|
|
33486
33026
|
Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } });
|
|
33487
33027
|
Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function () { return decode_js_2.decodeXML; } });
|
|
33488
33028
|
|
|
33489
|
-
} (lib$
|
|
33490
|
-
return lib$
|
|
33029
|
+
} (lib$1));
|
|
33030
|
+
return lib$1;
|
|
33491
33031
|
}
|
|
33492
33032
|
|
|
33493
33033
|
var foreignNames = {};
|
|
@@ -33602,12 +33142,12 @@ function requireForeignNames () {
|
|
|
33602
33142
|
return foreignNames;
|
|
33603
33143
|
}
|
|
33604
33144
|
|
|
33605
|
-
var hasRequiredLib$
|
|
33145
|
+
var hasRequiredLib$4;
|
|
33606
33146
|
|
|
33607
|
-
function requireLib$
|
|
33608
|
-
if (hasRequiredLib$
|
|
33609
|
-
hasRequiredLib$
|
|
33610
|
-
var __assign = (lib$
|
|
33147
|
+
function requireLib$4 () {
|
|
33148
|
+
if (hasRequiredLib$4) return lib$2;
|
|
33149
|
+
hasRequiredLib$4 = 1;
|
|
33150
|
+
var __assign = (lib$2 && lib$2.__assign) || function () {
|
|
33611
33151
|
__assign = Object.assign || function(t) {
|
|
33612
33152
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
33613
33153
|
s = arguments[i];
|
|
@@ -33618,7 +33158,7 @@ function requireLib$5 () {
|
|
|
33618
33158
|
};
|
|
33619
33159
|
return __assign.apply(this, arguments);
|
|
33620
33160
|
};
|
|
33621
|
-
var __createBinding = (lib$
|
|
33161
|
+
var __createBinding = (lib$2 && lib$2.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
33622
33162
|
if (k2 === undefined) k2 = k;
|
|
33623
33163
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
33624
33164
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -33629,25 +33169,25 @@ function requireLib$5 () {
|
|
|
33629
33169
|
if (k2 === undefined) k2 = k;
|
|
33630
33170
|
o[k2] = m[k];
|
|
33631
33171
|
}));
|
|
33632
|
-
var __setModuleDefault = (lib$
|
|
33172
|
+
var __setModuleDefault = (lib$2 && lib$2.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
33633
33173
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
33634
33174
|
}) : function(o, v) {
|
|
33635
33175
|
o["default"] = v;
|
|
33636
33176
|
});
|
|
33637
|
-
var __importStar = (lib$
|
|
33177
|
+
var __importStar = (lib$2 && lib$2.__importStar) || function (mod) {
|
|
33638
33178
|
if (mod && mod.__esModule) return mod;
|
|
33639
33179
|
var result = {};
|
|
33640
33180
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33641
33181
|
__setModuleDefault(result, mod);
|
|
33642
33182
|
return result;
|
|
33643
33183
|
};
|
|
33644
|
-
Object.defineProperty(lib$
|
|
33645
|
-
lib$
|
|
33184
|
+
Object.defineProperty(lib$2, "__esModule", { value: true });
|
|
33185
|
+
lib$2.render = void 0;
|
|
33646
33186
|
/*
|
|
33647
33187
|
* Module dependencies
|
|
33648
33188
|
*/
|
|
33649
|
-
var ElementType = __importStar(/*@__PURE__*/ requireLib$
|
|
33650
|
-
var entities_1 = /*@__PURE__*/ requireLib$
|
|
33189
|
+
var ElementType = __importStar(/*@__PURE__*/ requireLib$7());
|
|
33190
|
+
var entities_1 = /*@__PURE__*/ requireLib$5();
|
|
33651
33191
|
/**
|
|
33652
33192
|
* Mixed-case SVG and MathML tags & attributes
|
|
33653
33193
|
* recognized by the HTML parser.
|
|
@@ -33736,8 +33276,8 @@ function requireLib$5 () {
|
|
|
33736
33276
|
}
|
|
33737
33277
|
return output;
|
|
33738
33278
|
}
|
|
33739
|
-
lib$
|
|
33740
|
-
lib$
|
|
33279
|
+
lib$2.render = render;
|
|
33280
|
+
lib$2.default = render;
|
|
33741
33281
|
function renderNode(node, options) {
|
|
33742
33282
|
switch (node.type) {
|
|
33743
33283
|
case ElementType.Root:
|
|
@@ -33835,7 +33375,7 @@ function requireLib$5 () {
|
|
|
33835
33375
|
function renderComment(elem) {
|
|
33836
33376
|
return "<!--".concat(elem.data, "-->");
|
|
33837
33377
|
}
|
|
33838
|
-
return lib$
|
|
33378
|
+
return lib$2;
|
|
33839
33379
|
}
|
|
33840
33380
|
|
|
33841
33381
|
var hasRequiredStringify;
|
|
@@ -33852,9 +33392,9 @@ function requireStringify () {
|
|
|
33852
33392
|
stringify.getText = getText;
|
|
33853
33393
|
stringify.textContent = textContent;
|
|
33854
33394
|
stringify.innerText = innerText;
|
|
33855
|
-
var domhandler_1 = /*@__PURE__*/ requireLib$
|
|
33856
|
-
var dom_serializer_1 = __importDefault(/*@__PURE__*/ requireLib$
|
|
33857
|
-
var domelementtype_1 = /*@__PURE__*/ requireLib$
|
|
33395
|
+
var domhandler_1 = /*@__PURE__*/ requireLib$6();
|
|
33396
|
+
var dom_serializer_1 = __importDefault(/*@__PURE__*/ requireLib$4());
|
|
33397
|
+
var domelementtype_1 = /*@__PURE__*/ requireLib$7();
|
|
33858
33398
|
/**
|
|
33859
33399
|
* @category Stringify
|
|
33860
33400
|
* @deprecated Use the `dom-serializer` module directly.
|
|
@@ -33952,7 +33492,7 @@ function requireTraversal () {
|
|
|
33952
33492
|
traversal.getName = getName;
|
|
33953
33493
|
traversal.nextElementSibling = nextElementSibling;
|
|
33954
33494
|
traversal.prevElementSibling = prevElementSibling;
|
|
33955
|
-
var domhandler_1 = /*@__PURE__*/ requireLib$
|
|
33495
|
+
var domhandler_1 = /*@__PURE__*/ requireLib$6();
|
|
33956
33496
|
/**
|
|
33957
33497
|
* Get a node's children.
|
|
33958
33498
|
*
|
|
@@ -34235,7 +33775,7 @@ function requireQuerying () {
|
|
|
34235
33775
|
querying.findOne = findOne;
|
|
34236
33776
|
querying.existsOne = existsOne;
|
|
34237
33777
|
querying.findAll = findAll;
|
|
34238
|
-
var domhandler_1 = /*@__PURE__*/ requireLib$
|
|
33778
|
+
var domhandler_1 = /*@__PURE__*/ requireLib$6();
|
|
34239
33779
|
/**
|
|
34240
33780
|
* Search a node and its children for nodes passing a test function. If `node` is not an array, it will be wrapped in one.
|
|
34241
33781
|
*
|
|
@@ -34399,7 +33939,7 @@ function requireLegacy () {
|
|
|
34399
33939
|
legacy.getElementsByTagName = getElementsByTagName;
|
|
34400
33940
|
legacy.getElementsByClassName = getElementsByClassName;
|
|
34401
33941
|
legacy.getElementsByTagType = getElementsByTagType;
|
|
34402
|
-
var domhandler_1 = /*@__PURE__*/ requireLib$
|
|
33942
|
+
var domhandler_1 = /*@__PURE__*/ requireLib$6();
|
|
34403
33943
|
var querying_js_1 = /*@__PURE__*/ requireQuerying();
|
|
34404
33944
|
/**
|
|
34405
33945
|
* A map of functions to check nodes against.
|
|
@@ -34574,7 +34114,7 @@ function requireHelpers () {
|
|
|
34574
34114
|
helpers.removeSubsets = removeSubsets;
|
|
34575
34115
|
helpers.compareDocumentPosition = compareDocumentPosition;
|
|
34576
34116
|
helpers.uniqueSort = uniqueSort;
|
|
34577
|
-
var domhandler_1 = /*@__PURE__*/ requireLib$
|
|
34117
|
+
var domhandler_1 = /*@__PURE__*/ requireLib$6();
|
|
34578
34118
|
/**
|
|
34579
34119
|
* Given an array of nodes, remove any member that is contained by another
|
|
34580
34120
|
* member.
|
|
@@ -34912,13 +34452,13 @@ function requireFeeds () {
|
|
|
34912
34452
|
return feeds;
|
|
34913
34453
|
}
|
|
34914
34454
|
|
|
34915
|
-
var hasRequiredLib$
|
|
34455
|
+
var hasRequiredLib$3;
|
|
34916
34456
|
|
|
34917
|
-
function requireLib$
|
|
34918
|
-
if (hasRequiredLib$
|
|
34919
|
-
hasRequiredLib$
|
|
34457
|
+
function requireLib$3 () {
|
|
34458
|
+
if (hasRequiredLib$3) return lib$3;
|
|
34459
|
+
hasRequiredLib$3 = 1;
|
|
34920
34460
|
(function (exports) {
|
|
34921
|
-
var __createBinding = (lib$
|
|
34461
|
+
var __createBinding = (lib$3 && lib$3.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
34922
34462
|
if (k2 === undefined) k2 = k;
|
|
34923
34463
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
34924
34464
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -34929,7 +34469,7 @@ function requireLib$4 () {
|
|
|
34929
34469
|
if (k2 === undefined) k2 = k;
|
|
34930
34470
|
o[k2] = m[k];
|
|
34931
34471
|
}));
|
|
34932
|
-
var __exportStar = (lib$
|
|
34472
|
+
var __exportStar = (lib$3 && lib$3.__exportStar) || function(m, exports) {
|
|
34933
34473
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
34934
34474
|
};
|
|
34935
34475
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -34942,7 +34482,7 @@ function requireLib$4 () {
|
|
|
34942
34482
|
__exportStar(/*@__PURE__*/ requireHelpers(), exports);
|
|
34943
34483
|
__exportStar(/*@__PURE__*/ requireFeeds(), exports);
|
|
34944
34484
|
/** @deprecated Use these methods from `domhandler` directly. */
|
|
34945
|
-
var domhandler_1 = /*@__PURE__*/ requireLib$
|
|
34485
|
+
var domhandler_1 = /*@__PURE__*/ requireLib$6();
|
|
34946
34486
|
Object.defineProperty(exports, "isTag", { enumerable: true, get: function () { return domhandler_1.isTag; } });
|
|
34947
34487
|
Object.defineProperty(exports, "isCDATA", { enumerable: true, get: function () { return domhandler_1.isCDATA; } });
|
|
34948
34488
|
Object.defineProperty(exports, "isText", { enumerable: true, get: function () { return domhandler_1.isText; } });
|
|
@@ -34950,8 +34490,8 @@ function requireLib$4 () {
|
|
|
34950
34490
|
Object.defineProperty(exports, "isDocument", { enumerable: true, get: function () { return domhandler_1.isDocument; } });
|
|
34951
34491
|
Object.defineProperty(exports, "hasChildren", { enumerable: true, get: function () { return domhandler_1.hasChildren; } });
|
|
34952
34492
|
|
|
34953
|
-
} (lib$
|
|
34954
|
-
return lib$
|
|
34493
|
+
} (lib$3));
|
|
34494
|
+
return lib$3;
|
|
34955
34495
|
}
|
|
34956
34496
|
|
|
34957
34497
|
var hasRequiredCommonjs;
|
|
@@ -35006,8 +34546,8 @@ function requireCommonjs () {
|
|
|
35006
34546
|
const Parser_js_1 = requireParser();
|
|
35007
34547
|
var Parser_js_2 = requireParser();
|
|
35008
34548
|
Object.defineProperty(exports, "Parser", { enumerable: true, get: function () { return Parser_js_2.Parser; } });
|
|
35009
|
-
const domhandler_1 = /*@__PURE__*/ requireLib$
|
|
35010
|
-
var domhandler_2 = /*@__PURE__*/ requireLib$
|
|
34549
|
+
const domhandler_1 = /*@__PURE__*/ requireLib$6();
|
|
34550
|
+
var domhandler_2 = /*@__PURE__*/ requireLib$6();
|
|
35011
34551
|
Object.defineProperty(exports, "DomHandler", { enumerable: true, get: function () { return domhandler_2.DomHandler; } });
|
|
35012
34552
|
// Old name for DomHandler
|
|
35013
34553
|
Object.defineProperty(exports, "DefaultHandler", { enumerable: true, get: function () { return domhandler_2.DomHandler; } });
|
|
@@ -35066,9 +34606,9 @@ function requireCommonjs () {
|
|
|
35066
34606
|
* All of the following exports exist for backwards-compatibility.
|
|
35067
34607
|
* They should probably be removed eventually.
|
|
35068
34608
|
*/
|
|
35069
|
-
exports.ElementType = __importStar(/*@__PURE__*/ requireLib$
|
|
35070
|
-
const domutils_1 = /*@__PURE__*/ requireLib$
|
|
35071
|
-
var domutils_2 = /*@__PURE__*/ requireLib$
|
|
34609
|
+
exports.ElementType = __importStar(/*@__PURE__*/ requireLib$7());
|
|
34610
|
+
const domutils_1 = /*@__PURE__*/ requireLib$3();
|
|
34611
|
+
var domutils_2 = /*@__PURE__*/ requireLib$3();
|
|
35072
34612
|
Object.defineProperty(exports, "getFeed", { enumerable: true, get: function () { return domutils_2.getFeed; } });
|
|
35073
34613
|
const parseFeedDefaultOptions = { xmlMode: true };
|
|
35074
34614
|
/**
|
|
@@ -35080,7 +34620,7 @@ function requireCommonjs () {
|
|
|
35080
34620
|
function parseFeed(feed, options = parseFeedDefaultOptions) {
|
|
35081
34621
|
return (0, domutils_1.getFeed)(parseDOM(feed, options));
|
|
35082
34622
|
}
|
|
35083
|
-
exports.DomUtils = __importStar(/*@__PURE__*/ requireLib$
|
|
34623
|
+
exports.DomUtils = __importStar(/*@__PURE__*/ requireLib$3());
|
|
35084
34624
|
|
|
35085
34625
|
} (commonjs));
|
|
35086
34626
|
return commonjs;
|
|
@@ -35121,7 +34661,7 @@ function requireHtmlToDom () {
|
|
|
35121
34661
|
hasRequiredHtmlToDom = 1;
|
|
35122
34662
|
Object.defineProperty(htmlToDom, "__esModule", { value: true });
|
|
35123
34663
|
htmlToDom.default = HTMLDOMParser;
|
|
35124
|
-
var domhandler_1 = /*@__PURE__*/ requireLib$
|
|
34664
|
+
var domhandler_1 = /*@__PURE__*/ requireLib$6();
|
|
35125
34665
|
var htmlparser2_1 = /*@__PURE__*/ requireCommonjs();
|
|
35126
34666
|
var utilities_1 = requireUtilities$2();
|
|
35127
34667
|
/**
|
|
@@ -35163,13 +34703,13 @@ function requireTypes () {
|
|
|
35163
34703
|
return types;
|
|
35164
34704
|
}
|
|
35165
34705
|
|
|
35166
|
-
var hasRequiredLib$
|
|
34706
|
+
var hasRequiredLib$2;
|
|
35167
34707
|
|
|
35168
|
-
function requireLib$
|
|
35169
|
-
if (hasRequiredLib$
|
|
35170
|
-
hasRequiredLib$
|
|
34708
|
+
function requireLib$2 () {
|
|
34709
|
+
if (hasRequiredLib$2) return lib$6;
|
|
34710
|
+
hasRequiredLib$2 = 1;
|
|
35171
34711
|
(function (exports) {
|
|
35172
|
-
var __createBinding = (lib$
|
|
34712
|
+
var __createBinding = (lib$6 && lib$6.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
35173
34713
|
if (k2 === undefined) k2 = k;
|
|
35174
34714
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
35175
34715
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -35180,10 +34720,10 @@ function requireLib$3 () {
|
|
|
35180
34720
|
if (k2 === undefined) k2 = k;
|
|
35181
34721
|
o[k2] = m[k];
|
|
35182
34722
|
}));
|
|
35183
|
-
var __exportStar = (lib$
|
|
34723
|
+
var __exportStar = (lib$6 && lib$6.__exportStar) || function(m, exports) {
|
|
35184
34724
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
35185
34725
|
};
|
|
35186
|
-
var __importDefault = (lib$
|
|
34726
|
+
var __importDefault = (lib$6 && lib$6.__importDefault) || function (mod) {
|
|
35187
34727
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
35188
34728
|
};
|
|
35189
34729
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -35198,13 +34738,13 @@ function requireLib$3 () {
|
|
|
35198
34738
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(html_to_dom_1).default; } });
|
|
35199
34739
|
__exportStar(requireTypes(), exports);
|
|
35200
34740
|
|
|
35201
|
-
} (lib$
|
|
35202
|
-
return lib$
|
|
34741
|
+
} (lib$6));
|
|
34742
|
+
return lib$6;
|
|
35203
34743
|
}
|
|
35204
34744
|
|
|
35205
34745
|
var attributesToProps = {};
|
|
35206
34746
|
|
|
35207
|
-
var lib
|
|
34747
|
+
var lib = {};
|
|
35208
34748
|
|
|
35209
34749
|
var possibleStandardNamesOptimized = {};
|
|
35210
34750
|
|
|
@@ -35709,11 +35249,11 @@ function requirePossibleStandardNamesOptimized () {
|
|
|
35709
35249
|
return possibleStandardNamesOptimized;
|
|
35710
35250
|
}
|
|
35711
35251
|
|
|
35712
|
-
var hasRequiredLib$
|
|
35252
|
+
var hasRequiredLib$1;
|
|
35713
35253
|
|
|
35714
|
-
function requireLib$
|
|
35715
|
-
if (hasRequiredLib$
|
|
35716
|
-
hasRequiredLib$
|
|
35254
|
+
function requireLib$1 () {
|
|
35255
|
+
if (hasRequiredLib$1) return lib;
|
|
35256
|
+
hasRequiredLib$1 = 1;
|
|
35717
35257
|
|
|
35718
35258
|
/**
|
|
35719
35259
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -36223,17 +35763,17 @@ function requireLib$2 () {
|
|
|
36223
35763
|
return accumulator;
|
|
36224
35764
|
}, {});
|
|
36225
35765
|
|
|
36226
|
-
lib
|
|
36227
|
-
lib
|
|
36228
|
-
lib
|
|
36229
|
-
lib
|
|
36230
|
-
lib
|
|
36231
|
-
lib
|
|
36232
|
-
lib
|
|
36233
|
-
lib
|
|
36234
|
-
lib
|
|
36235
|
-
lib
|
|
36236
|
-
return lib
|
|
35766
|
+
lib.BOOLEAN = BOOLEAN;
|
|
35767
|
+
lib.BOOLEANISH_STRING = BOOLEANISH_STRING;
|
|
35768
|
+
lib.NUMERIC = NUMERIC;
|
|
35769
|
+
lib.OVERLOADED_BOOLEAN = OVERLOADED_BOOLEAN;
|
|
35770
|
+
lib.POSITIVE_NUMERIC = POSITIVE_NUMERIC;
|
|
35771
|
+
lib.RESERVED = RESERVED;
|
|
35772
|
+
lib.STRING = STRING;
|
|
35773
|
+
lib.getPropertyInfo = getPropertyInfo;
|
|
35774
|
+
lib.isCustomAttribute = isCustomAttribute;
|
|
35775
|
+
lib.possibleStandardNames = possibleStandardNames;
|
|
35776
|
+
return lib;
|
|
36237
35777
|
}
|
|
36238
35778
|
|
|
36239
35779
|
var utilities$1 = {};
|
|
@@ -36766,7 +36306,7 @@ function requireAttributesToProps () {
|
|
|
36766
36306
|
hasRequiredAttributesToProps = 1;
|
|
36767
36307
|
Object.defineProperty(attributesToProps, "__esModule", { value: true });
|
|
36768
36308
|
attributesToProps.default = attributesToProps$1;
|
|
36769
|
-
var react_property_1 = requireLib$
|
|
36309
|
+
var react_property_1 = requireLib$1();
|
|
36770
36310
|
var utilities_1 = requireUtilities();
|
|
36771
36311
|
// https://react.dev/learn/sharing-state-between-components#controlled-and-uncontrolled-components
|
|
36772
36312
|
// https://developer.mozilla.org/docs/Web/HTML/Attributes
|
|
@@ -36971,684 +36511,25 @@ function requireDomToReact () {
|
|
|
36971
36511
|
return domToReact;
|
|
36972
36512
|
}
|
|
36973
36513
|
|
|
36974
|
-
var lib = {};
|
|
36975
|
-
|
|
36976
|
-
var node = {};
|
|
36977
|
-
|
|
36978
|
-
var hasRequiredNode;
|
|
36979
|
-
|
|
36980
|
-
function requireNode () {
|
|
36981
|
-
if (hasRequiredNode) return node;
|
|
36982
|
-
hasRequiredNode = 1;
|
|
36983
|
-
var __extends = (node && node.__extends) || (function () {
|
|
36984
|
-
var extendStatics = function (d, b) {
|
|
36985
|
-
extendStatics = Object.setPrototypeOf ||
|
|
36986
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
36987
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
36988
|
-
return extendStatics(d, b);
|
|
36989
|
-
};
|
|
36990
|
-
return function (d, b) {
|
|
36991
|
-
if (typeof b !== "function" && b !== null)
|
|
36992
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
36993
|
-
extendStatics(d, b);
|
|
36994
|
-
function __() { this.constructor = d; }
|
|
36995
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
36996
|
-
};
|
|
36997
|
-
})();
|
|
36998
|
-
var __assign = (node && node.__assign) || function () {
|
|
36999
|
-
__assign = Object.assign || function(t) {
|
|
37000
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
37001
|
-
s = arguments[i];
|
|
37002
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
37003
|
-
t[p] = s[p];
|
|
37004
|
-
}
|
|
37005
|
-
return t;
|
|
37006
|
-
};
|
|
37007
|
-
return __assign.apply(this, arguments);
|
|
37008
|
-
};
|
|
37009
|
-
Object.defineProperty(node, "__esModule", { value: true });
|
|
37010
|
-
node.cloneNode = node.hasChildren = node.isDocument = node.isDirective = node.isComment = node.isText = node.isCDATA = node.isTag = node.Element = node.Document = node.CDATA = node.NodeWithChildren = node.ProcessingInstruction = node.Comment = node.Text = node.DataNode = node.Node = void 0;
|
|
37011
|
-
var domelementtype_1 = /*@__PURE__*/ requireLib$9();
|
|
37012
|
-
/**
|
|
37013
|
-
* This object will be used as the prototype for Nodes when creating a
|
|
37014
|
-
* DOM-Level-1-compliant structure.
|
|
37015
|
-
*/
|
|
37016
|
-
var Node = /** @class */ (function () {
|
|
37017
|
-
function Node() {
|
|
37018
|
-
/** Parent of the node */
|
|
37019
|
-
this.parent = null;
|
|
37020
|
-
/** Previous sibling */
|
|
37021
|
-
this.prev = null;
|
|
37022
|
-
/** Next sibling */
|
|
37023
|
-
this.next = null;
|
|
37024
|
-
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
|
|
37025
|
-
this.startIndex = null;
|
|
37026
|
-
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
|
|
37027
|
-
this.endIndex = null;
|
|
37028
|
-
}
|
|
37029
|
-
Object.defineProperty(Node.prototype, "parentNode", {
|
|
37030
|
-
// Read-write aliases for properties
|
|
37031
|
-
/**
|
|
37032
|
-
* Same as {@link parent}.
|
|
37033
|
-
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
37034
|
-
*/
|
|
37035
|
-
get: function () {
|
|
37036
|
-
return this.parent;
|
|
37037
|
-
},
|
|
37038
|
-
set: function (parent) {
|
|
37039
|
-
this.parent = parent;
|
|
37040
|
-
},
|
|
37041
|
-
enumerable: false,
|
|
37042
|
-
configurable: true
|
|
37043
|
-
});
|
|
37044
|
-
Object.defineProperty(Node.prototype, "previousSibling", {
|
|
37045
|
-
/**
|
|
37046
|
-
* Same as {@link prev}.
|
|
37047
|
-
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
37048
|
-
*/
|
|
37049
|
-
get: function () {
|
|
37050
|
-
return this.prev;
|
|
37051
|
-
},
|
|
37052
|
-
set: function (prev) {
|
|
37053
|
-
this.prev = prev;
|
|
37054
|
-
},
|
|
37055
|
-
enumerable: false,
|
|
37056
|
-
configurable: true
|
|
37057
|
-
});
|
|
37058
|
-
Object.defineProperty(Node.prototype, "nextSibling", {
|
|
37059
|
-
/**
|
|
37060
|
-
* Same as {@link next}.
|
|
37061
|
-
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
37062
|
-
*/
|
|
37063
|
-
get: function () {
|
|
37064
|
-
return this.next;
|
|
37065
|
-
},
|
|
37066
|
-
set: function (next) {
|
|
37067
|
-
this.next = next;
|
|
37068
|
-
},
|
|
37069
|
-
enumerable: false,
|
|
37070
|
-
configurable: true
|
|
37071
|
-
});
|
|
37072
|
-
/**
|
|
37073
|
-
* Clone this node, and optionally its children.
|
|
37074
|
-
*
|
|
37075
|
-
* @param recursive Clone child nodes as well.
|
|
37076
|
-
* @returns A clone of the node.
|
|
37077
|
-
*/
|
|
37078
|
-
Node.prototype.cloneNode = function (recursive) {
|
|
37079
|
-
if (recursive === void 0) { recursive = false; }
|
|
37080
|
-
return cloneNode(this, recursive);
|
|
37081
|
-
};
|
|
37082
|
-
return Node;
|
|
37083
|
-
}());
|
|
37084
|
-
node.Node = Node;
|
|
37085
|
-
/**
|
|
37086
|
-
* A node that contains some data.
|
|
37087
|
-
*/
|
|
37088
|
-
var DataNode = /** @class */ (function (_super) {
|
|
37089
|
-
__extends(DataNode, _super);
|
|
37090
|
-
/**
|
|
37091
|
-
* @param data The content of the data node
|
|
37092
|
-
*/
|
|
37093
|
-
function DataNode(data) {
|
|
37094
|
-
var _this = _super.call(this) || this;
|
|
37095
|
-
_this.data = data;
|
|
37096
|
-
return _this;
|
|
37097
|
-
}
|
|
37098
|
-
Object.defineProperty(DataNode.prototype, "nodeValue", {
|
|
37099
|
-
/**
|
|
37100
|
-
* Same as {@link data}.
|
|
37101
|
-
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
37102
|
-
*/
|
|
37103
|
-
get: function () {
|
|
37104
|
-
return this.data;
|
|
37105
|
-
},
|
|
37106
|
-
set: function (data) {
|
|
37107
|
-
this.data = data;
|
|
37108
|
-
},
|
|
37109
|
-
enumerable: false,
|
|
37110
|
-
configurable: true
|
|
37111
|
-
});
|
|
37112
|
-
return DataNode;
|
|
37113
|
-
}(Node));
|
|
37114
|
-
node.DataNode = DataNode;
|
|
37115
|
-
/**
|
|
37116
|
-
* Text within the document.
|
|
37117
|
-
*/
|
|
37118
|
-
var Text = /** @class */ (function (_super) {
|
|
37119
|
-
__extends(Text, _super);
|
|
37120
|
-
function Text() {
|
|
37121
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
37122
|
-
_this.type = domelementtype_1.ElementType.Text;
|
|
37123
|
-
return _this;
|
|
37124
|
-
}
|
|
37125
|
-
Object.defineProperty(Text.prototype, "nodeType", {
|
|
37126
|
-
get: function () {
|
|
37127
|
-
return 3;
|
|
37128
|
-
},
|
|
37129
|
-
enumerable: false,
|
|
37130
|
-
configurable: true
|
|
37131
|
-
});
|
|
37132
|
-
return Text;
|
|
37133
|
-
}(DataNode));
|
|
37134
|
-
node.Text = Text;
|
|
37135
|
-
/**
|
|
37136
|
-
* Comments within the document.
|
|
37137
|
-
*/
|
|
37138
|
-
var Comment = /** @class */ (function (_super) {
|
|
37139
|
-
__extends(Comment, _super);
|
|
37140
|
-
function Comment() {
|
|
37141
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
37142
|
-
_this.type = domelementtype_1.ElementType.Comment;
|
|
37143
|
-
return _this;
|
|
37144
|
-
}
|
|
37145
|
-
Object.defineProperty(Comment.prototype, "nodeType", {
|
|
37146
|
-
get: function () {
|
|
37147
|
-
return 8;
|
|
37148
|
-
},
|
|
37149
|
-
enumerable: false,
|
|
37150
|
-
configurable: true
|
|
37151
|
-
});
|
|
37152
|
-
return Comment;
|
|
37153
|
-
}(DataNode));
|
|
37154
|
-
node.Comment = Comment;
|
|
37155
|
-
/**
|
|
37156
|
-
* Processing instructions, including doc types.
|
|
37157
|
-
*/
|
|
37158
|
-
var ProcessingInstruction = /** @class */ (function (_super) {
|
|
37159
|
-
__extends(ProcessingInstruction, _super);
|
|
37160
|
-
function ProcessingInstruction(name, data) {
|
|
37161
|
-
var _this = _super.call(this, data) || this;
|
|
37162
|
-
_this.name = name;
|
|
37163
|
-
_this.type = domelementtype_1.ElementType.Directive;
|
|
37164
|
-
return _this;
|
|
37165
|
-
}
|
|
37166
|
-
Object.defineProperty(ProcessingInstruction.prototype, "nodeType", {
|
|
37167
|
-
get: function () {
|
|
37168
|
-
return 1;
|
|
37169
|
-
},
|
|
37170
|
-
enumerable: false,
|
|
37171
|
-
configurable: true
|
|
37172
|
-
});
|
|
37173
|
-
return ProcessingInstruction;
|
|
37174
|
-
}(DataNode));
|
|
37175
|
-
node.ProcessingInstruction = ProcessingInstruction;
|
|
37176
|
-
/**
|
|
37177
|
-
* A `Node` that can have children.
|
|
37178
|
-
*/
|
|
37179
|
-
var NodeWithChildren = /** @class */ (function (_super) {
|
|
37180
|
-
__extends(NodeWithChildren, _super);
|
|
37181
|
-
/**
|
|
37182
|
-
* @param children Children of the node. Only certain node types can have children.
|
|
37183
|
-
*/
|
|
37184
|
-
function NodeWithChildren(children) {
|
|
37185
|
-
var _this = _super.call(this) || this;
|
|
37186
|
-
_this.children = children;
|
|
37187
|
-
return _this;
|
|
37188
|
-
}
|
|
37189
|
-
Object.defineProperty(NodeWithChildren.prototype, "firstChild", {
|
|
37190
|
-
// Aliases
|
|
37191
|
-
/** First child of the node. */
|
|
37192
|
-
get: function () {
|
|
37193
|
-
var _a;
|
|
37194
|
-
return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
|
|
37195
|
-
},
|
|
37196
|
-
enumerable: false,
|
|
37197
|
-
configurable: true
|
|
37198
|
-
});
|
|
37199
|
-
Object.defineProperty(NodeWithChildren.prototype, "lastChild", {
|
|
37200
|
-
/** Last child of the node. */
|
|
37201
|
-
get: function () {
|
|
37202
|
-
return this.children.length > 0
|
|
37203
|
-
? this.children[this.children.length - 1]
|
|
37204
|
-
: null;
|
|
37205
|
-
},
|
|
37206
|
-
enumerable: false,
|
|
37207
|
-
configurable: true
|
|
37208
|
-
});
|
|
37209
|
-
Object.defineProperty(NodeWithChildren.prototype, "childNodes", {
|
|
37210
|
-
/**
|
|
37211
|
-
* Same as {@link children}.
|
|
37212
|
-
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
37213
|
-
*/
|
|
37214
|
-
get: function () {
|
|
37215
|
-
return this.children;
|
|
37216
|
-
},
|
|
37217
|
-
set: function (children) {
|
|
37218
|
-
this.children = children;
|
|
37219
|
-
},
|
|
37220
|
-
enumerable: false,
|
|
37221
|
-
configurable: true
|
|
37222
|
-
});
|
|
37223
|
-
return NodeWithChildren;
|
|
37224
|
-
}(Node));
|
|
37225
|
-
node.NodeWithChildren = NodeWithChildren;
|
|
37226
|
-
var CDATA = /** @class */ (function (_super) {
|
|
37227
|
-
__extends(CDATA, _super);
|
|
37228
|
-
function CDATA() {
|
|
37229
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
37230
|
-
_this.type = domelementtype_1.ElementType.CDATA;
|
|
37231
|
-
return _this;
|
|
37232
|
-
}
|
|
37233
|
-
Object.defineProperty(CDATA.prototype, "nodeType", {
|
|
37234
|
-
get: function () {
|
|
37235
|
-
return 4;
|
|
37236
|
-
},
|
|
37237
|
-
enumerable: false,
|
|
37238
|
-
configurable: true
|
|
37239
|
-
});
|
|
37240
|
-
return CDATA;
|
|
37241
|
-
}(NodeWithChildren));
|
|
37242
|
-
node.CDATA = CDATA;
|
|
37243
|
-
/**
|
|
37244
|
-
* The root node of the document.
|
|
37245
|
-
*/
|
|
37246
|
-
var Document = /** @class */ (function (_super) {
|
|
37247
|
-
__extends(Document, _super);
|
|
37248
|
-
function Document() {
|
|
37249
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
37250
|
-
_this.type = domelementtype_1.ElementType.Root;
|
|
37251
|
-
return _this;
|
|
37252
|
-
}
|
|
37253
|
-
Object.defineProperty(Document.prototype, "nodeType", {
|
|
37254
|
-
get: function () {
|
|
37255
|
-
return 9;
|
|
37256
|
-
},
|
|
37257
|
-
enumerable: false,
|
|
37258
|
-
configurable: true
|
|
37259
|
-
});
|
|
37260
|
-
return Document;
|
|
37261
|
-
}(NodeWithChildren));
|
|
37262
|
-
node.Document = Document;
|
|
37263
|
-
/**
|
|
37264
|
-
* An element within the DOM.
|
|
37265
|
-
*/
|
|
37266
|
-
var Element = /** @class */ (function (_super) {
|
|
37267
|
-
__extends(Element, _super);
|
|
37268
|
-
/**
|
|
37269
|
-
* @param name Name of the tag, eg. `div`, `span`.
|
|
37270
|
-
* @param attribs Object mapping attribute names to attribute values.
|
|
37271
|
-
* @param children Children of the node.
|
|
37272
|
-
*/
|
|
37273
|
-
function Element(name, attribs, children, type) {
|
|
37274
|
-
if (children === void 0) { children = []; }
|
|
37275
|
-
if (type === void 0) { type = name === "script"
|
|
37276
|
-
? domelementtype_1.ElementType.Script
|
|
37277
|
-
: name === "style"
|
|
37278
|
-
? domelementtype_1.ElementType.Style
|
|
37279
|
-
: domelementtype_1.ElementType.Tag; }
|
|
37280
|
-
var _this = _super.call(this, children) || this;
|
|
37281
|
-
_this.name = name;
|
|
37282
|
-
_this.attribs = attribs;
|
|
37283
|
-
_this.type = type;
|
|
37284
|
-
return _this;
|
|
37285
|
-
}
|
|
37286
|
-
Object.defineProperty(Element.prototype, "nodeType", {
|
|
37287
|
-
get: function () {
|
|
37288
|
-
return 1;
|
|
37289
|
-
},
|
|
37290
|
-
enumerable: false,
|
|
37291
|
-
configurable: true
|
|
37292
|
-
});
|
|
37293
|
-
Object.defineProperty(Element.prototype, "tagName", {
|
|
37294
|
-
// DOM Level 1 aliases
|
|
37295
|
-
/**
|
|
37296
|
-
* Same as {@link name}.
|
|
37297
|
-
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
37298
|
-
*/
|
|
37299
|
-
get: function () {
|
|
37300
|
-
return this.name;
|
|
37301
|
-
},
|
|
37302
|
-
set: function (name) {
|
|
37303
|
-
this.name = name;
|
|
37304
|
-
},
|
|
37305
|
-
enumerable: false,
|
|
37306
|
-
configurable: true
|
|
37307
|
-
});
|
|
37308
|
-
Object.defineProperty(Element.prototype, "attributes", {
|
|
37309
|
-
get: function () {
|
|
37310
|
-
var _this = this;
|
|
37311
|
-
return Object.keys(this.attribs).map(function (name) {
|
|
37312
|
-
var _a, _b;
|
|
37313
|
-
return ({
|
|
37314
|
-
name: name,
|
|
37315
|
-
value: _this.attribs[name],
|
|
37316
|
-
namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
|
|
37317
|
-
prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name],
|
|
37318
|
-
});
|
|
37319
|
-
});
|
|
37320
|
-
},
|
|
37321
|
-
enumerable: false,
|
|
37322
|
-
configurable: true
|
|
37323
|
-
});
|
|
37324
|
-
return Element;
|
|
37325
|
-
}(NodeWithChildren));
|
|
37326
|
-
node.Element = Element;
|
|
37327
|
-
/**
|
|
37328
|
-
* @param node Node to check.
|
|
37329
|
-
* @returns `true` if the node is a `Element`, `false` otherwise.
|
|
37330
|
-
*/
|
|
37331
|
-
function isTag(node) {
|
|
37332
|
-
return (0, domelementtype_1.isTag)(node);
|
|
37333
|
-
}
|
|
37334
|
-
node.isTag = isTag;
|
|
37335
|
-
/**
|
|
37336
|
-
* @param node Node to check.
|
|
37337
|
-
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
|
|
37338
|
-
*/
|
|
37339
|
-
function isCDATA(node) {
|
|
37340
|
-
return node.type === domelementtype_1.ElementType.CDATA;
|
|
37341
|
-
}
|
|
37342
|
-
node.isCDATA = isCDATA;
|
|
37343
|
-
/**
|
|
37344
|
-
* @param node Node to check.
|
|
37345
|
-
* @returns `true` if the node has the type `Text`, `false` otherwise.
|
|
37346
|
-
*/
|
|
37347
|
-
function isText(node) {
|
|
37348
|
-
return node.type === domelementtype_1.ElementType.Text;
|
|
37349
|
-
}
|
|
37350
|
-
node.isText = isText;
|
|
37351
|
-
/**
|
|
37352
|
-
* @param node Node to check.
|
|
37353
|
-
* @returns `true` if the node has the type `Comment`, `false` otherwise.
|
|
37354
|
-
*/
|
|
37355
|
-
function isComment(node) {
|
|
37356
|
-
return node.type === domelementtype_1.ElementType.Comment;
|
|
37357
|
-
}
|
|
37358
|
-
node.isComment = isComment;
|
|
37359
|
-
/**
|
|
37360
|
-
* @param node Node to check.
|
|
37361
|
-
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
37362
|
-
*/
|
|
37363
|
-
function isDirective(node) {
|
|
37364
|
-
return node.type === domelementtype_1.ElementType.Directive;
|
|
37365
|
-
}
|
|
37366
|
-
node.isDirective = isDirective;
|
|
37367
|
-
/**
|
|
37368
|
-
* @param node Node to check.
|
|
37369
|
-
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
37370
|
-
*/
|
|
37371
|
-
function isDocument(node) {
|
|
37372
|
-
return node.type === domelementtype_1.ElementType.Root;
|
|
37373
|
-
}
|
|
37374
|
-
node.isDocument = isDocument;
|
|
37375
|
-
/**
|
|
37376
|
-
* @param node Node to check.
|
|
37377
|
-
* @returns `true` if the node has children, `false` otherwise.
|
|
37378
|
-
*/
|
|
37379
|
-
function hasChildren(node) {
|
|
37380
|
-
return Object.prototype.hasOwnProperty.call(node, "children");
|
|
37381
|
-
}
|
|
37382
|
-
node.hasChildren = hasChildren;
|
|
37383
|
-
/**
|
|
37384
|
-
* Clone a node, and optionally its children.
|
|
37385
|
-
*
|
|
37386
|
-
* @param recursive Clone child nodes as well.
|
|
37387
|
-
* @returns A clone of the node.
|
|
37388
|
-
*/
|
|
37389
|
-
function cloneNode(node, recursive) {
|
|
37390
|
-
if (recursive === void 0) { recursive = false; }
|
|
37391
|
-
var result;
|
|
37392
|
-
if (isText(node)) {
|
|
37393
|
-
result = new Text(node.data);
|
|
37394
|
-
}
|
|
37395
|
-
else if (isComment(node)) {
|
|
37396
|
-
result = new Comment(node.data);
|
|
37397
|
-
}
|
|
37398
|
-
else if (isTag(node)) {
|
|
37399
|
-
var children = recursive ? cloneChildren(node.children) : [];
|
|
37400
|
-
var clone_1 = new Element(node.name, __assign({}, node.attribs), children);
|
|
37401
|
-
children.forEach(function (child) { return (child.parent = clone_1); });
|
|
37402
|
-
if (node.namespace != null) {
|
|
37403
|
-
clone_1.namespace = node.namespace;
|
|
37404
|
-
}
|
|
37405
|
-
if (node["x-attribsNamespace"]) {
|
|
37406
|
-
clone_1["x-attribsNamespace"] = __assign({}, node["x-attribsNamespace"]);
|
|
37407
|
-
}
|
|
37408
|
-
if (node["x-attribsPrefix"]) {
|
|
37409
|
-
clone_1["x-attribsPrefix"] = __assign({}, node["x-attribsPrefix"]);
|
|
37410
|
-
}
|
|
37411
|
-
result = clone_1;
|
|
37412
|
-
}
|
|
37413
|
-
else if (isCDATA(node)) {
|
|
37414
|
-
var children = recursive ? cloneChildren(node.children) : [];
|
|
37415
|
-
var clone_2 = new CDATA(children);
|
|
37416
|
-
children.forEach(function (child) { return (child.parent = clone_2); });
|
|
37417
|
-
result = clone_2;
|
|
37418
|
-
}
|
|
37419
|
-
else if (isDocument(node)) {
|
|
37420
|
-
var children = recursive ? cloneChildren(node.children) : [];
|
|
37421
|
-
var clone_3 = new Document(children);
|
|
37422
|
-
children.forEach(function (child) { return (child.parent = clone_3); });
|
|
37423
|
-
if (node["x-mode"]) {
|
|
37424
|
-
clone_3["x-mode"] = node["x-mode"];
|
|
37425
|
-
}
|
|
37426
|
-
result = clone_3;
|
|
37427
|
-
}
|
|
37428
|
-
else if (isDirective(node)) {
|
|
37429
|
-
var instruction = new ProcessingInstruction(node.name, node.data);
|
|
37430
|
-
if (node["x-name"] != null) {
|
|
37431
|
-
instruction["x-name"] = node["x-name"];
|
|
37432
|
-
instruction["x-publicId"] = node["x-publicId"];
|
|
37433
|
-
instruction["x-systemId"] = node["x-systemId"];
|
|
37434
|
-
}
|
|
37435
|
-
result = instruction;
|
|
37436
|
-
}
|
|
37437
|
-
else {
|
|
37438
|
-
throw new Error("Not implemented yet: ".concat(node.type));
|
|
37439
|
-
}
|
|
37440
|
-
result.startIndex = node.startIndex;
|
|
37441
|
-
result.endIndex = node.endIndex;
|
|
37442
|
-
if (node.sourceCodeLocation != null) {
|
|
37443
|
-
result.sourceCodeLocation = node.sourceCodeLocation;
|
|
37444
|
-
}
|
|
37445
|
-
return result;
|
|
37446
|
-
}
|
|
37447
|
-
node.cloneNode = cloneNode;
|
|
37448
|
-
function cloneChildren(childs) {
|
|
37449
|
-
var children = childs.map(function (child) { return cloneNode(child, true); });
|
|
37450
|
-
for (var i = 1; i < children.length; i++) {
|
|
37451
|
-
children[i].prev = children[i - 1];
|
|
37452
|
-
children[i - 1].next = children[i];
|
|
37453
|
-
}
|
|
37454
|
-
return children;
|
|
37455
|
-
}
|
|
37456
|
-
return node;
|
|
37457
|
-
}
|
|
37458
|
-
|
|
37459
|
-
var hasRequiredLib$1;
|
|
37460
|
-
|
|
37461
|
-
function requireLib$1 () {
|
|
37462
|
-
if (hasRequiredLib$1) return lib;
|
|
37463
|
-
hasRequiredLib$1 = 1;
|
|
37464
|
-
(function (exports) {
|
|
37465
|
-
var __createBinding = (lib && lib.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
37466
|
-
if (k2 === undefined) k2 = k;
|
|
37467
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
37468
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
37469
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
37470
|
-
}
|
|
37471
|
-
Object.defineProperty(o, k2, desc);
|
|
37472
|
-
}) : (function(o, m, k, k2) {
|
|
37473
|
-
if (k2 === undefined) k2 = k;
|
|
37474
|
-
o[k2] = m[k];
|
|
37475
|
-
}));
|
|
37476
|
-
var __exportStar = (lib && lib.__exportStar) || function(m, exports) {
|
|
37477
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37478
|
-
};
|
|
37479
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37480
|
-
exports.DomHandler = void 0;
|
|
37481
|
-
var domelementtype_1 = /*@__PURE__*/ requireLib$9();
|
|
37482
|
-
var node_js_1 = /*@__PURE__*/ requireNode();
|
|
37483
|
-
__exportStar(/*@__PURE__*/ requireNode(), exports);
|
|
37484
|
-
// Default options
|
|
37485
|
-
var defaultOpts = {
|
|
37486
|
-
withStartIndices: false,
|
|
37487
|
-
withEndIndices: false,
|
|
37488
|
-
xmlMode: false,
|
|
37489
|
-
};
|
|
37490
|
-
var DomHandler = /** @class */ (function () {
|
|
37491
|
-
/**
|
|
37492
|
-
* @param callback Called once parsing has completed.
|
|
37493
|
-
* @param options Settings for the handler.
|
|
37494
|
-
* @param elementCB Callback whenever a tag is closed.
|
|
37495
|
-
*/
|
|
37496
|
-
function DomHandler(callback, options, elementCB) {
|
|
37497
|
-
/** The elements of the DOM */
|
|
37498
|
-
this.dom = [];
|
|
37499
|
-
/** The root element for the DOM */
|
|
37500
|
-
this.root = new node_js_1.Document(this.dom);
|
|
37501
|
-
/** Indicated whether parsing has been completed. */
|
|
37502
|
-
this.done = false;
|
|
37503
|
-
/** Stack of open tags. */
|
|
37504
|
-
this.tagStack = [this.root];
|
|
37505
|
-
/** A data node that is still being written to. */
|
|
37506
|
-
this.lastNode = null;
|
|
37507
|
-
/** Reference to the parser instance. Used for location information. */
|
|
37508
|
-
this.parser = null;
|
|
37509
|
-
// Make it possible to skip arguments, for backwards-compatibility
|
|
37510
|
-
if (typeof options === "function") {
|
|
37511
|
-
elementCB = options;
|
|
37512
|
-
options = defaultOpts;
|
|
37513
|
-
}
|
|
37514
|
-
if (typeof callback === "object") {
|
|
37515
|
-
options = callback;
|
|
37516
|
-
callback = undefined;
|
|
37517
|
-
}
|
|
37518
|
-
this.callback = callback !== null && callback !== void 0 ? callback : null;
|
|
37519
|
-
this.options = options !== null && options !== void 0 ? options : defaultOpts;
|
|
37520
|
-
this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
|
|
37521
|
-
}
|
|
37522
|
-
DomHandler.prototype.onparserinit = function (parser) {
|
|
37523
|
-
this.parser = parser;
|
|
37524
|
-
};
|
|
37525
|
-
// Resets the handler back to starting state
|
|
37526
|
-
DomHandler.prototype.onreset = function () {
|
|
37527
|
-
this.dom = [];
|
|
37528
|
-
this.root = new node_js_1.Document(this.dom);
|
|
37529
|
-
this.done = false;
|
|
37530
|
-
this.tagStack = [this.root];
|
|
37531
|
-
this.lastNode = null;
|
|
37532
|
-
this.parser = null;
|
|
37533
|
-
};
|
|
37534
|
-
// Signals the handler that parsing is done
|
|
37535
|
-
DomHandler.prototype.onend = function () {
|
|
37536
|
-
if (this.done)
|
|
37537
|
-
return;
|
|
37538
|
-
this.done = true;
|
|
37539
|
-
this.parser = null;
|
|
37540
|
-
this.handleCallback(null);
|
|
37541
|
-
};
|
|
37542
|
-
DomHandler.prototype.onerror = function (error) {
|
|
37543
|
-
this.handleCallback(error);
|
|
37544
|
-
};
|
|
37545
|
-
DomHandler.prototype.onclosetag = function () {
|
|
37546
|
-
this.lastNode = null;
|
|
37547
|
-
var elem = this.tagStack.pop();
|
|
37548
|
-
if (this.options.withEndIndices) {
|
|
37549
|
-
elem.endIndex = this.parser.endIndex;
|
|
37550
|
-
}
|
|
37551
|
-
if (this.elementCB)
|
|
37552
|
-
this.elementCB(elem);
|
|
37553
|
-
};
|
|
37554
|
-
DomHandler.prototype.onopentag = function (name, attribs) {
|
|
37555
|
-
var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : undefined;
|
|
37556
|
-
var element = new node_js_1.Element(name, attribs, undefined, type);
|
|
37557
|
-
this.addNode(element);
|
|
37558
|
-
this.tagStack.push(element);
|
|
37559
|
-
};
|
|
37560
|
-
DomHandler.prototype.ontext = function (data) {
|
|
37561
|
-
var lastNode = this.lastNode;
|
|
37562
|
-
if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {
|
|
37563
|
-
lastNode.data += data;
|
|
37564
|
-
if (this.options.withEndIndices) {
|
|
37565
|
-
lastNode.endIndex = this.parser.endIndex;
|
|
37566
|
-
}
|
|
37567
|
-
}
|
|
37568
|
-
else {
|
|
37569
|
-
var node = new node_js_1.Text(data);
|
|
37570
|
-
this.addNode(node);
|
|
37571
|
-
this.lastNode = node;
|
|
37572
|
-
}
|
|
37573
|
-
};
|
|
37574
|
-
DomHandler.prototype.oncomment = function (data) {
|
|
37575
|
-
if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {
|
|
37576
|
-
this.lastNode.data += data;
|
|
37577
|
-
return;
|
|
37578
|
-
}
|
|
37579
|
-
var node = new node_js_1.Comment(data);
|
|
37580
|
-
this.addNode(node);
|
|
37581
|
-
this.lastNode = node;
|
|
37582
|
-
};
|
|
37583
|
-
DomHandler.prototype.oncommentend = function () {
|
|
37584
|
-
this.lastNode = null;
|
|
37585
|
-
};
|
|
37586
|
-
DomHandler.prototype.oncdatastart = function () {
|
|
37587
|
-
var text = new node_js_1.Text("");
|
|
37588
|
-
var node = new node_js_1.CDATA([text]);
|
|
37589
|
-
this.addNode(node);
|
|
37590
|
-
text.parent = node;
|
|
37591
|
-
this.lastNode = text;
|
|
37592
|
-
};
|
|
37593
|
-
DomHandler.prototype.oncdataend = function () {
|
|
37594
|
-
this.lastNode = null;
|
|
37595
|
-
};
|
|
37596
|
-
DomHandler.prototype.onprocessinginstruction = function (name, data) {
|
|
37597
|
-
var node = new node_js_1.ProcessingInstruction(name, data);
|
|
37598
|
-
this.addNode(node);
|
|
37599
|
-
};
|
|
37600
|
-
DomHandler.prototype.handleCallback = function (error) {
|
|
37601
|
-
if (typeof this.callback === "function") {
|
|
37602
|
-
this.callback(error, this.dom);
|
|
37603
|
-
}
|
|
37604
|
-
else if (error) {
|
|
37605
|
-
throw error;
|
|
37606
|
-
}
|
|
37607
|
-
};
|
|
37608
|
-
DomHandler.prototype.addNode = function (node) {
|
|
37609
|
-
var parent = this.tagStack[this.tagStack.length - 1];
|
|
37610
|
-
var previousSibling = parent.children[parent.children.length - 1];
|
|
37611
|
-
if (this.options.withStartIndices) {
|
|
37612
|
-
node.startIndex = this.parser.startIndex;
|
|
37613
|
-
}
|
|
37614
|
-
if (this.options.withEndIndices) {
|
|
37615
|
-
node.endIndex = this.parser.endIndex;
|
|
37616
|
-
}
|
|
37617
|
-
parent.children.push(node);
|
|
37618
|
-
if (previousSibling) {
|
|
37619
|
-
node.prev = previousSibling;
|
|
37620
|
-
previousSibling.next = node;
|
|
37621
|
-
}
|
|
37622
|
-
node.parent = parent;
|
|
37623
|
-
this.lastNode = null;
|
|
37624
|
-
};
|
|
37625
|
-
return DomHandler;
|
|
37626
|
-
}());
|
|
37627
|
-
exports.DomHandler = DomHandler;
|
|
37628
|
-
exports.default = DomHandler;
|
|
37629
|
-
} (lib));
|
|
37630
|
-
return lib;
|
|
37631
|
-
}
|
|
37632
|
-
|
|
37633
36514
|
var hasRequiredLib;
|
|
37634
36515
|
|
|
37635
36516
|
function requireLib () {
|
|
37636
|
-
if (hasRequiredLib) return lib$
|
|
36517
|
+
if (hasRequiredLib) return lib$7;
|
|
37637
36518
|
hasRequiredLib = 1;
|
|
37638
36519
|
(function (exports) {
|
|
37639
|
-
var __importDefault = (lib$
|
|
36520
|
+
var __importDefault = (lib$7 && lib$7.__importDefault) || function (mod) {
|
|
37640
36521
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37641
36522
|
};
|
|
37642
36523
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37643
36524
|
exports.htmlToDOM = exports.domToReact = exports.attributesToProps = exports.Text = exports.ProcessingInstruction = exports.Element = exports.Comment = void 0;
|
|
37644
36525
|
exports.default = HTMLReactParser;
|
|
37645
|
-
var html_dom_parser_1 = __importDefault(requireLib$
|
|
36526
|
+
var html_dom_parser_1 = __importDefault(requireLib$2());
|
|
37646
36527
|
exports.htmlToDOM = html_dom_parser_1.default;
|
|
37647
36528
|
var attributes_to_props_1 = __importDefault(requireAttributesToProps());
|
|
37648
36529
|
exports.attributesToProps = attributes_to_props_1.default;
|
|
37649
36530
|
var dom_to_react_1 = __importDefault(requireDomToReact());
|
|
37650
36531
|
exports.domToReact = dom_to_react_1.default;
|
|
37651
|
-
var domhandler_1 = /*@__PURE__*/ requireLib$
|
|
36532
|
+
var domhandler_1 = /*@__PURE__*/ requireLib$6();
|
|
37652
36533
|
Object.defineProperty(exports, "Comment", { enumerable: true, get: function () { return domhandler_1.Comment; } });
|
|
37653
36534
|
Object.defineProperty(exports, "Element", { enumerable: true, get: function () { return domhandler_1.Element; } });
|
|
37654
36535
|
Object.defineProperty(exports, "ProcessingInstruction", { enumerable: true, get: function () { return domhandler_1.ProcessingInstruction; } });
|
|
@@ -37671,8 +36552,8 @@ function requireLib () {
|
|
|
37671
36552
|
return (0, dom_to_react_1.default)((0, html_dom_parser_1.default)(html, (options === null || options === void 0 ? void 0 : options.htmlparser2) || domParserOptions), options);
|
|
37672
36553
|
}
|
|
37673
36554
|
|
|
37674
|
-
} (lib$
|
|
37675
|
-
return lib$
|
|
36555
|
+
} (lib$7));
|
|
36556
|
+
return lib$7;
|
|
37676
36557
|
}
|
|
37677
36558
|
|
|
37678
36559
|
var libExports = requireLib();
|