@rc-component/util 1.0.0
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/LICENSE +22 -0
- package/README.md +303 -0
- package/es/Children/toArray.d.ts +5 -0
- package/es/Children/toArray.js +19 -0
- package/es/Dom/canUseDom.d.ts +1 -0
- package/es/Dom/canUseDom.js +3 -0
- package/es/Dom/contains.d.ts +1 -0
- package/es/Dom/contains.js +20 -0
- package/es/Dom/dynamicCSS.d.ts +25 -0
- package/es/Dom/dynamicCSS.js +153 -0
- package/es/Dom/findDOMNode.d.ts +12 -0
- package/es/Dom/findDOMNode.js +36 -0
- package/es/Dom/focus.d.ts +8 -0
- package/es/Dom/focus.js +87 -0
- package/es/Dom/isVisible.d.ts +2 -0
- package/es/Dom/isVisible.js +27 -0
- package/es/Dom/scrollLocker.d.ts +12 -0
- package/es/Dom/scrollLocker.js +135 -0
- package/es/Dom/shadow.d.ts +8 -0
- package/es/Dom/shadow.js +18 -0
- package/es/Dom/styleChecker.d.ts +2 -0
- package/es/Dom/styleChecker.js +26 -0
- package/es/KeyCode.d.ts +436 -0
- package/es/KeyCode.js +538 -0
- package/es/Portal.d.ts +9 -0
- package/es/Portal.js +44 -0
- package/es/PortalWrapper.d.ts +51 -0
- package/es/PortalWrapper.js +217 -0
- package/es/React/isFragment.d.ts +4 -0
- package/es/React/isFragment.js +18 -0
- package/es/React/render.d.ts +13 -0
- package/es/React/render.js +114 -0
- package/es/composeProps.d.ts +2 -0
- package/es/composeProps.js +24 -0
- package/es/getScrollBarSize.d.ts +7 -0
- package/es/getScrollBarSize.js +76 -0
- package/es/hooks/useEffect.d.ts +2 -0
- package/es/hooks/useEffect.js +14 -0
- package/es/hooks/useEvent.d.ts +2 -0
- package/es/hooks/useEvent.js +16 -0
- package/es/hooks/useId.d.ts +4 -0
- package/es/hooks/useId.js +69 -0
- package/es/hooks/useLayoutEffect.d.ts +4 -0
- package/es/hooks/useLayoutEffect.js +30 -0
- package/es/hooks/useMemo.d.ts +1 -0
- package/es/hooks/useMemo.js +9 -0
- package/es/hooks/useMergedState.d.ts +12 -0
- package/es/hooks/useMergedState.js +68 -0
- package/es/hooks/useMobile.d.ts +6 -0
- package/es/hooks/useMobile.js +25 -0
- package/es/hooks/useState.d.ts +14 -0
- package/es/hooks/useState.js +32 -0
- package/es/hooks/useSyncState.d.ts +9 -0
- package/es/hooks/useSyncState.js +29 -0
- package/es/index.d.ts +6 -0
- package/es/index.js +6 -0
- package/es/isEqual.d.ts +9 -0
- package/es/isEqual.js +55 -0
- package/es/isMobile.d.ts +2 -0
- package/es/isMobile.js +7 -0
- package/es/omit.d.ts +1 -0
- package/es/omit.js +9 -0
- package/es/pickAttrs.d.ts +11 -0
- package/es/pickAttrs.js +51 -0
- package/es/proxyObject.d.ts +4 -0
- package/es/proxyObject.js +19 -0
- package/es/raf.d.ts +6 -0
- package/es/raf.js +54 -0
- package/es/ref.d.ts +19 -0
- package/es/ref.js +89 -0
- package/es/setStyle.d.ts +12 -0
- package/es/setStyle.js +26 -0
- package/es/test/domHook.d.ts +8 -0
- package/es/test/domHook.js +64 -0
- package/es/utils/get.d.ts +1 -0
- package/es/utils/get.js +10 -0
- package/es/utils/set.d.ts +6 -0
- package/es/utils/set.js +93 -0
- package/es/warning.d.ts +32 -0
- package/es/warning.js +68 -0
- package/lib/Children/toArray.d.ts +5 -0
- package/lib/Children/toArray.js +26 -0
- package/lib/Dom/canUseDom.d.ts +1 -0
- package/lib/Dom/canUseDom.js +9 -0
- package/lib/Dom/contains.d.ts +1 -0
- package/lib/Dom/contains.js +26 -0
- package/lib/Dom/dynamicCSS.d.ts +25 -0
- package/lib/Dom/dynamicCSS.js +163 -0
- package/lib/Dom/findDOMNode.d.ts +12 -0
- package/lib/Dom/findDOMNode.js +45 -0
- package/lib/Dom/focus.d.ts +8 -0
- package/lib/Dom/focus.js +98 -0
- package/lib/Dom/isVisible.d.ts +2 -0
- package/lib/Dom/isVisible.js +33 -0
- package/lib/Dom/scrollLocker.d.ts +12 -0
- package/lib/Dom/scrollLocker.js +141 -0
- package/lib/Dom/shadow.d.ts +8 -0
- package/lib/Dom/shadow.js +25 -0
- package/lib/Dom/styleChecker.d.ts +2 -0
- package/lib/Dom/styleChecker.js +33 -0
- package/lib/KeyCode.d.ts +436 -0
- package/lib/KeyCode.js +544 -0
- package/lib/Portal.d.ts +9 -0
- package/lib/Portal.js +51 -0
- package/lib/PortalWrapper.d.ts +51 -0
- package/lib/PortalWrapper.js +226 -0
- package/lib/React/isFragment.d.ts +4 -0
- package/lib/React/isFragment.js +24 -0
- package/lib/React/render.d.ts +13 -0
- package/lib/React/render.js +125 -0
- package/lib/composeProps.d.ts +2 -0
- package/lib/composeProps.js +30 -0
- package/lib/getScrollBarSize.d.ts +7 -0
- package/lib/getScrollBarSize.js +84 -0
- package/lib/hooks/useEffect.d.ts +2 -0
- package/lib/hooks/useEffect.js +22 -0
- package/lib/hooks/useEvent.d.ts +2 -0
- package/lib/hooks/useEvent.js +26 -0
- package/lib/hooks/useId.d.ts +4 -0
- package/lib/hooks/useId.js +78 -0
- package/lib/hooks/useLayoutEffect.d.ts +4 -0
- package/lib/hooks/useLayoutEffect.js +39 -0
- package/lib/hooks/useMemo.d.ts +1 -0
- package/lib/hooks/useMemo.js +18 -0
- package/lib/hooks/useMergedState.d.ts +12 -0
- package/lib/hooks/useMergedState.js +75 -0
- package/lib/hooks/useMobile.d.ts +6 -0
- package/lib/hooks/useMobile.js +31 -0
- package/lib/hooks/useState.d.ts +14 -0
- package/lib/hooks/useState.js +41 -0
- package/lib/hooks/useSyncState.d.ts +9 -0
- package/lib/hooks/useSyncState.js +39 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +60 -0
- package/lib/isEqual.d.ts +9 -0
- package/lib/isEqual.js +61 -0
- package/lib/isMobile.d.ts +2 -0
- package/lib/isMobile.js +13 -0
- package/lib/omit.d.ts +1 -0
- package/lib/omit.js +15 -0
- package/lib/pickAttrs.d.ts +11 -0
- package/lib/pickAttrs.js +57 -0
- package/lib/proxyObject.d.ts +4 -0
- package/lib/proxyObject.js +25 -0
- package/lib/raf.d.ts +6 -0
- package/lib/raf.js +60 -0
- package/lib/ref.d.ts +19 -0
- package/lib/ref.js +96 -0
- package/lib/setStyle.d.ts +12 -0
- package/lib/setStyle.js +32 -0
- package/lib/test/domHook.d.ts +8 -0
- package/lib/test/domHook.js +71 -0
- package/lib/utils/get.d.ts +1 -0
- package/lib/utils/get.js +16 -0
- package/lib/utils/set.d.ts +6 -0
- package/lib/utils/set.js +101 -0
- package/lib/warning.d.ts +32 -0
- package/lib/warning.js +81 -0
- package/package.json +76 -0
package/es/setStyle.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Easy to set element style, return previous style
|
|
3
|
+
* IE browser compatible(IE browser doesn't merge overflow style, need to set it separately)
|
|
4
|
+
* https://github.com/ant-design/ant-design/issues/19393
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
function setStyle(style) {
|
|
8
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
9
|
+
if (!style) {
|
|
10
|
+
return {};
|
|
11
|
+
}
|
|
12
|
+
var _options$element = options.element,
|
|
13
|
+
element = _options$element === void 0 ? document.body : _options$element;
|
|
14
|
+
var oldStyle = {};
|
|
15
|
+
var styleKeys = Object.keys(style);
|
|
16
|
+
|
|
17
|
+
// IE browser compatible
|
|
18
|
+
styleKeys.forEach(function (key) {
|
|
19
|
+
oldStyle[key] = element.style[key];
|
|
20
|
+
});
|
|
21
|
+
styleKeys.forEach(function (key) {
|
|
22
|
+
element.style[key] = style[key];
|
|
23
|
+
});
|
|
24
|
+
return oldStyle;
|
|
25
|
+
}
|
|
26
|
+
export default setStyle;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ElementClass = Function;
|
|
2
|
+
export type Property = PropertyDescriptor | Function;
|
|
3
|
+
export declare function spyElementPrototypes<T extends ElementClass>(elementClass: T, properties: Record<string, Property>): {
|
|
4
|
+
mockRestore(): void;
|
|
5
|
+
};
|
|
6
|
+
export declare function spyElementPrototype(Element: ElementClass, propName: string, property: Property): {
|
|
7
|
+
mockRestore(): void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(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; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
8
|
+
/* eslint-disable no-param-reassign */
|
|
9
|
+
var NO_EXIST = {
|
|
10
|
+
__NOT_EXIST: true
|
|
11
|
+
};
|
|
12
|
+
export function spyElementPrototypes(elementClass, properties) {
|
|
13
|
+
var propNames = Object.keys(properties);
|
|
14
|
+
var originDescriptors = {};
|
|
15
|
+
propNames.forEach(function (propName) {
|
|
16
|
+
var originDescriptor = Object.getOwnPropertyDescriptor(elementClass.prototype, propName);
|
|
17
|
+
originDescriptors[propName] = originDescriptor || NO_EXIST;
|
|
18
|
+
var spyProp = properties[propName];
|
|
19
|
+
if (typeof spyProp === 'function') {
|
|
20
|
+
// If is a function
|
|
21
|
+
elementClass.prototype[propName] = function spyFunc() {
|
|
22
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23
|
+
args[_key] = arguments[_key];
|
|
24
|
+
}
|
|
25
|
+
return spyProp.call.apply(spyProp, [this, originDescriptor].concat(args));
|
|
26
|
+
};
|
|
27
|
+
} else {
|
|
28
|
+
// Otherwise tread as a property
|
|
29
|
+
Object.defineProperty(elementClass.prototype, propName, _objectSpread(_objectSpread({}, spyProp), {}, {
|
|
30
|
+
set: function set(value) {
|
|
31
|
+
if (spyProp.set) {
|
|
32
|
+
return spyProp.set.call(this, originDescriptor, value);
|
|
33
|
+
}
|
|
34
|
+
return originDescriptor.set(value);
|
|
35
|
+
},
|
|
36
|
+
get: function get() {
|
|
37
|
+
if (spyProp.get) {
|
|
38
|
+
return spyProp.get.call(this, originDescriptor);
|
|
39
|
+
}
|
|
40
|
+
return originDescriptor.get();
|
|
41
|
+
},
|
|
42
|
+
configurable: true
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
mockRestore: function mockRestore() {
|
|
48
|
+
propNames.forEach(function (propName) {
|
|
49
|
+
var originDescriptor = originDescriptors[propName];
|
|
50
|
+
if (originDescriptor === NO_EXIST) {
|
|
51
|
+
delete elementClass.prototype[propName];
|
|
52
|
+
} else if (typeof originDescriptor === 'function') {
|
|
53
|
+
elementClass.prototype[propName] = originDescriptor;
|
|
54
|
+
} else {
|
|
55
|
+
Object.defineProperty(elementClass.prototype, propName, originDescriptor);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export function spyElementPrototype(Element, propName, property) {
|
|
62
|
+
return spyElementPrototypes(Element, _defineProperty({}, propName, property));
|
|
63
|
+
}
|
|
64
|
+
/* eslint-enable */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function get(entity: any, path: (string | number | symbol)[] | readonly (string | number | symbol)[]): any;
|
package/es/utils/get.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type Path = (string | number | symbol)[];
|
|
2
|
+
export default function set<Entity = any, Output = Entity, Value = any>(entity: Entity, paths: Path, value: Value, removeIfUndefined?: boolean): Output;
|
|
3
|
+
/**
|
|
4
|
+
* Merge objects which will create
|
|
5
|
+
*/
|
|
6
|
+
export declare function merge<T extends object>(...sources: T[]): T;
|
package/es/utils/set.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(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; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
+
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import get from "./get";
|
|
17
|
+
function internalSet(entity, paths, value, removeIfUndefined) {
|
|
18
|
+
if (!paths.length) {
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
var _paths = _toArray(paths),
|
|
22
|
+
path = _paths[0],
|
|
23
|
+
restPath = _paths.slice(1);
|
|
24
|
+
var clone;
|
|
25
|
+
if (!entity && typeof path === 'number') {
|
|
26
|
+
clone = [];
|
|
27
|
+
} else if (Array.isArray(entity)) {
|
|
28
|
+
clone = _toConsumableArray(entity);
|
|
29
|
+
} else {
|
|
30
|
+
clone = _objectSpread({}, entity);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Delete prop if `removeIfUndefined` and value is undefined
|
|
34
|
+
if (removeIfUndefined && value === undefined && restPath.length === 1) {
|
|
35
|
+
delete clone[path][restPath[0]];
|
|
36
|
+
} else {
|
|
37
|
+
clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
|
|
38
|
+
}
|
|
39
|
+
return clone;
|
|
40
|
+
}
|
|
41
|
+
export default function set(entity, paths, value) {
|
|
42
|
+
var removeIfUndefined = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
43
|
+
// Do nothing if `removeIfUndefined` and parent object not exist
|
|
44
|
+
if (paths.length && removeIfUndefined && value === undefined && !get(entity, paths.slice(0, -1))) {
|
|
45
|
+
return entity;
|
|
46
|
+
}
|
|
47
|
+
return internalSet(entity, paths, value, removeIfUndefined);
|
|
48
|
+
}
|
|
49
|
+
function isObject(obj) {
|
|
50
|
+
return _typeof(obj) === 'object' && obj !== null && Object.getPrototypeOf(obj) === Object.prototype;
|
|
51
|
+
}
|
|
52
|
+
function createEmpty(source) {
|
|
53
|
+
return Array.isArray(source) ? [] : {};
|
|
54
|
+
}
|
|
55
|
+
var keys = typeof Reflect === 'undefined' ? Object.keys : Reflect.ownKeys;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Merge objects which will create
|
|
59
|
+
*/
|
|
60
|
+
export function merge() {
|
|
61
|
+
for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
62
|
+
sources[_key] = arguments[_key];
|
|
63
|
+
}
|
|
64
|
+
var clone = createEmpty(sources[0]);
|
|
65
|
+
sources.forEach(function (src) {
|
|
66
|
+
function internalMerge(path, parentLoopSet) {
|
|
67
|
+
var loopSet = new Set(parentLoopSet);
|
|
68
|
+
var value = get(src, path);
|
|
69
|
+
var isArr = Array.isArray(value);
|
|
70
|
+
if (isArr || isObject(value)) {
|
|
71
|
+
// Only add not loop obj
|
|
72
|
+
if (!loopSet.has(value)) {
|
|
73
|
+
loopSet.add(value);
|
|
74
|
+
var originValue = get(clone, path);
|
|
75
|
+
if (isArr) {
|
|
76
|
+
// Array will always be override
|
|
77
|
+
clone = set(clone, path, []);
|
|
78
|
+
} else if (!originValue || _typeof(originValue) !== 'object') {
|
|
79
|
+
// Init container if not exist
|
|
80
|
+
clone = set(clone, path, createEmpty(value));
|
|
81
|
+
}
|
|
82
|
+
keys(value).forEach(function (key) {
|
|
83
|
+
internalMerge([].concat(_toConsumableArray(path), [key]), loopSet);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
clone = set(clone, path, value);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
internalMerge([]);
|
|
91
|
+
});
|
|
92
|
+
return clone;
|
|
93
|
+
}
|
package/es/warning.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type preMessageFn = (message: string, type: 'warning' | 'note') => string | null | undefined | number;
|
|
2
|
+
/**
|
|
3
|
+
* Pre warning enable you to parse content before console.error.
|
|
4
|
+
* Modify to null will prevent warning.
|
|
5
|
+
*/
|
|
6
|
+
export declare const preMessage: (fn: preMessageFn) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Warning if condition not match.
|
|
9
|
+
* @param valid Condition
|
|
10
|
+
* @param message Warning message
|
|
11
|
+
* @example
|
|
12
|
+
* ```js
|
|
13
|
+
* warning(false, 'some error'); // print some error
|
|
14
|
+
* warning(true, 'some error'); // print nothing
|
|
15
|
+
* warning(1 === 2, 'some error'); // print some error
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function warning(valid: boolean, message: string): void;
|
|
19
|
+
/** @see Similar to {@link warning} */
|
|
20
|
+
export declare function note(valid: boolean, message: string): void;
|
|
21
|
+
export declare function resetWarned(): void;
|
|
22
|
+
export declare function call(method: (valid: boolean, message: string) => void, valid: boolean, message: string): void;
|
|
23
|
+
/** @see Same as {@link warning}, but only warn once for the same message */
|
|
24
|
+
export declare function warningOnce(valid: boolean, message: string): void;
|
|
25
|
+
export declare namespace warningOnce {
|
|
26
|
+
var preMessage: (fn: preMessageFn) => void;
|
|
27
|
+
var resetWarned: typeof import("./warning").resetWarned;
|
|
28
|
+
var noteOnce: typeof import("./warning").noteOnce;
|
|
29
|
+
}
|
|
30
|
+
/** @see Same as {@link warning}, but only warn once for the same message */
|
|
31
|
+
export declare function noteOnce(valid: boolean, message: string): void;
|
|
32
|
+
export default warningOnce;
|
package/es/warning.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
var warned = {};
|
|
3
|
+
var preWarningFns = [];
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Pre warning enable you to parse content before console.error.
|
|
7
|
+
* Modify to null will prevent warning.
|
|
8
|
+
*/
|
|
9
|
+
export var preMessage = function preMessage(fn) {
|
|
10
|
+
preWarningFns.push(fn);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Warning if condition not match.
|
|
15
|
+
* @param valid Condition
|
|
16
|
+
* @param message Warning message
|
|
17
|
+
* @example
|
|
18
|
+
* ```js
|
|
19
|
+
* warning(false, 'some error'); // print some error
|
|
20
|
+
* warning(true, 'some error'); // print nothing
|
|
21
|
+
* warning(1 === 2, 'some error'); // print some error
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function warning(valid, message) {
|
|
25
|
+
if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
|
|
26
|
+
var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
|
|
27
|
+
return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'warning');
|
|
28
|
+
}, message);
|
|
29
|
+
if (finalMessage) {
|
|
30
|
+
console.error("Warning: ".concat(finalMessage));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** @see Similar to {@link warning} */
|
|
36
|
+
export function note(valid, message) {
|
|
37
|
+
if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
|
|
38
|
+
var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
|
|
39
|
+
return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'note');
|
|
40
|
+
}, message);
|
|
41
|
+
if (finalMessage) {
|
|
42
|
+
console.warn("Note: ".concat(finalMessage));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export function resetWarned() {
|
|
47
|
+
warned = {};
|
|
48
|
+
}
|
|
49
|
+
export function call(method, valid, message) {
|
|
50
|
+
if (!valid && !warned[message]) {
|
|
51
|
+
method(false, message);
|
|
52
|
+
warned[message] = true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** @see Same as {@link warning}, but only warn once for the same message */
|
|
57
|
+
export function warningOnce(valid, message) {
|
|
58
|
+
call(warning, valid, message);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** @see Same as {@link warning}, but only warn once for the same message */
|
|
62
|
+
export function noteOnce(valid, message) {
|
|
63
|
+
call(note, valid, message);
|
|
64
|
+
}
|
|
65
|
+
warningOnce.preMessage = preMessage;
|
|
66
|
+
warningOnce.resetWarned = resetWarned;
|
|
67
|
+
warningOnce.noteOnce = noteOnce;
|
|
68
|
+
export default warningOnce;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = toArray;
|
|
7
|
+
var _isFragment = _interopRequireDefault(require("../React/isFragment"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function toArray(children) {
|
|
11
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12
|
+
var ret = [];
|
|
13
|
+
_react.default.Children.forEach(children, function (child) {
|
|
14
|
+
if ((child === undefined || child === null) && !option.keepEmpty) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (Array.isArray(child)) {
|
|
18
|
+
ret = ret.concat(toArray(child));
|
|
19
|
+
} else if ((0, _isFragment.default)(child) && child.props) {
|
|
20
|
+
ret = ret.concat(toArray(child.props.children, option));
|
|
21
|
+
} else {
|
|
22
|
+
ret.push(child);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return ret;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function canUseDom(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function contains(root: Node | null | undefined, n?: Node): boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = contains;
|
|
7
|
+
function contains(root, n) {
|
|
8
|
+
if (!root) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Use native if support
|
|
13
|
+
if (root.contains) {
|
|
14
|
+
return root.contains(n);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// `document.contains` not support with IE11
|
|
18
|
+
var node = n;
|
|
19
|
+
while (node) {
|
|
20
|
+
if (node === root) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
node = node.parentNode;
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type ContainerType = Element | ShadowRoot;
|
|
2
|
+
export type Prepend = boolean | 'queue';
|
|
3
|
+
export type AppendType = 'prependQueue' | 'append' | 'prepend';
|
|
4
|
+
interface Options {
|
|
5
|
+
attachTo?: ContainerType;
|
|
6
|
+
csp?: {
|
|
7
|
+
nonce?: string;
|
|
8
|
+
};
|
|
9
|
+
prepend?: Prepend;
|
|
10
|
+
/**
|
|
11
|
+
* Config the `priority` of `prependQueue`. Default is `0`.
|
|
12
|
+
* It's useful if you need to insert style before other style.
|
|
13
|
+
*/
|
|
14
|
+
priority?: number;
|
|
15
|
+
mark?: string;
|
|
16
|
+
styles?: HTMLElement[];
|
|
17
|
+
}
|
|
18
|
+
export declare function injectCSS(css: string, option?: Options): HTMLStyleElement;
|
|
19
|
+
export declare function removeCSS(key: string, option?: Options): void;
|
|
20
|
+
/**
|
|
21
|
+
* manually clear container cache to avoid global cache in unit testes
|
|
22
|
+
*/
|
|
23
|
+
export declare function clearContainerCache(): void;
|
|
24
|
+
export declare function updateCSS(css: string, key: string, originOption?: Options): HTMLElement;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clearContainerCache = clearContainerCache;
|
|
7
|
+
exports.injectCSS = injectCSS;
|
|
8
|
+
exports.removeCSS = removeCSS;
|
|
9
|
+
exports.updateCSS = updateCSS;
|
|
10
|
+
var _canUseDom = _interopRequireDefault(require("./canUseDom"));
|
|
11
|
+
var _contains = _interopRequireDefault(require("./contains"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
14
|
+
function ownKeys(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; }
|
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
|
+
var APPEND_ORDER = 'data-rc-order';
|
|
20
|
+
var APPEND_PRIORITY = 'data-rc-priority';
|
|
21
|
+
var MARK_KEY = "rc-util-key";
|
|
22
|
+
var containerCache = new Map();
|
|
23
|
+
function getMark() {
|
|
24
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
25
|
+
mark = _ref.mark;
|
|
26
|
+
if (mark) {
|
|
27
|
+
return mark.startsWith('data-') ? mark : "data-".concat(mark);
|
|
28
|
+
}
|
|
29
|
+
return MARK_KEY;
|
|
30
|
+
}
|
|
31
|
+
function getContainer(option) {
|
|
32
|
+
if (option.attachTo) {
|
|
33
|
+
return option.attachTo;
|
|
34
|
+
}
|
|
35
|
+
var head = document.querySelector('head');
|
|
36
|
+
return head || document.body;
|
|
37
|
+
}
|
|
38
|
+
function getOrder(prepend) {
|
|
39
|
+
if (prepend === 'queue') {
|
|
40
|
+
return 'prependQueue';
|
|
41
|
+
}
|
|
42
|
+
return prepend ? 'prepend' : 'append';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Find style which inject by rc-util
|
|
47
|
+
*/
|
|
48
|
+
function findStyles(container) {
|
|
49
|
+
return Array.from((containerCache.get(container) || container).children).filter(function (node) {
|
|
50
|
+
return node.tagName === 'STYLE';
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function injectCSS(css) {
|
|
54
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
55
|
+
if (!(0, _canUseDom.default)()) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
var csp = option.csp,
|
|
59
|
+
prepend = option.prepend,
|
|
60
|
+
_option$priority = option.priority,
|
|
61
|
+
priority = _option$priority === void 0 ? 0 : _option$priority;
|
|
62
|
+
var mergedOrder = getOrder(prepend);
|
|
63
|
+
var isPrependQueue = mergedOrder === 'prependQueue';
|
|
64
|
+
var styleNode = document.createElement('style');
|
|
65
|
+
styleNode.setAttribute(APPEND_ORDER, mergedOrder);
|
|
66
|
+
if (isPrependQueue && priority) {
|
|
67
|
+
styleNode.setAttribute(APPEND_PRIORITY, "".concat(priority));
|
|
68
|
+
}
|
|
69
|
+
if (csp !== null && csp !== void 0 && csp.nonce) {
|
|
70
|
+
styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;
|
|
71
|
+
}
|
|
72
|
+
styleNode.innerHTML = css;
|
|
73
|
+
var container = getContainer(option);
|
|
74
|
+
var firstChild = container.firstChild;
|
|
75
|
+
if (prepend) {
|
|
76
|
+
// If is queue `prepend`, it will prepend first style and then append rest style
|
|
77
|
+
if (isPrependQueue) {
|
|
78
|
+
var existStyle = (option.styles || findStyles(container)).filter(function (node) {
|
|
79
|
+
// Ignore style which not injected by rc-util with prepend
|
|
80
|
+
if (!['prepend', 'prependQueue'].includes(node.getAttribute(APPEND_ORDER))) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Ignore style which priority less then new style
|
|
85
|
+
var nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0);
|
|
86
|
+
return priority >= nodePriority;
|
|
87
|
+
});
|
|
88
|
+
if (existStyle.length) {
|
|
89
|
+
container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
|
|
90
|
+
return styleNode;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Use `insertBefore` as `prepend`
|
|
95
|
+
container.insertBefore(styleNode, firstChild);
|
|
96
|
+
} else {
|
|
97
|
+
container.appendChild(styleNode);
|
|
98
|
+
}
|
|
99
|
+
return styleNode;
|
|
100
|
+
}
|
|
101
|
+
function findExistNode(key) {
|
|
102
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
103
|
+
var container = getContainer(option);
|
|
104
|
+
return (option.styles || findStyles(container)).find(function (node) {
|
|
105
|
+
return node.getAttribute(getMark(option)) === key;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function removeCSS(key) {
|
|
109
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
110
|
+
var existNode = findExistNode(key, option);
|
|
111
|
+
if (existNode) {
|
|
112
|
+
var container = getContainer(option);
|
|
113
|
+
container.removeChild(existNode);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* qiankun will inject `appendChild` to insert into other
|
|
119
|
+
*/
|
|
120
|
+
function syncRealContainer(container, option) {
|
|
121
|
+
var cachedRealContainer = containerCache.get(container);
|
|
122
|
+
|
|
123
|
+
// Find real container when not cached or cached container removed
|
|
124
|
+
if (!cachedRealContainer || !(0, _contains.default)(document, cachedRealContainer)) {
|
|
125
|
+
var placeholderStyle = injectCSS('', option);
|
|
126
|
+
var parentNode = placeholderStyle.parentNode;
|
|
127
|
+
containerCache.set(container, parentNode);
|
|
128
|
+
container.removeChild(placeholderStyle);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* manually clear container cache to avoid global cache in unit testes
|
|
134
|
+
*/
|
|
135
|
+
function clearContainerCache() {
|
|
136
|
+
containerCache.clear();
|
|
137
|
+
}
|
|
138
|
+
function updateCSS(css, key) {
|
|
139
|
+
var originOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
140
|
+
var container = getContainer(originOption);
|
|
141
|
+
var styles = findStyles(container);
|
|
142
|
+
var option = _objectSpread(_objectSpread({}, originOption), {}, {
|
|
143
|
+
styles: styles
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// Sync real parent
|
|
147
|
+
syncRealContainer(container, option);
|
|
148
|
+
var existNode = findExistNode(key, option);
|
|
149
|
+
if (existNode) {
|
|
150
|
+
var _option$csp, _option$csp2;
|
|
151
|
+
if ((_option$csp = option.csp) !== null && _option$csp !== void 0 && _option$csp.nonce && existNode.nonce !== ((_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce)) {
|
|
152
|
+
var _option$csp3;
|
|
153
|
+
existNode.nonce = (_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce;
|
|
154
|
+
}
|
|
155
|
+
if (existNode.innerHTML !== css) {
|
|
156
|
+
existNode.innerHTML = css;
|
|
157
|
+
}
|
|
158
|
+
return existNode;
|
|
159
|
+
}
|
|
160
|
+
var newNode = injectCSS(css, option);
|
|
161
|
+
newNode.setAttribute(getMark(option), key);
|
|
162
|
+
return newNode;
|
|
163
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function isDOM(node: any): node is HTMLElement | SVGElement;
|
|
3
|
+
/**
|
|
4
|
+
* Retrieves a DOM node via a ref, and does not invoke `findDOMNode`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getDOM(node: any): HTMLElement | SVGElement | null;
|
|
7
|
+
/**
|
|
8
|
+
* Return if a node is a DOM node. Else will return by `findDOMNode`
|
|
9
|
+
*/
|
|
10
|
+
export default function findDOMNode<T = Element | Text>(node: React.ReactInstance | HTMLElement | SVGElement | {
|
|
11
|
+
nativeElement: T;
|
|
12
|
+
}): T;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = findDOMNode;
|
|
7
|
+
exports.getDOM = getDOM;
|
|
8
|
+
exports.isDOM = isDOM;
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
13
|
+
function isDOM(node) {
|
|
14
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Element
|
|
15
|
+
// Since XULElement is also subclass of Element, we only need HTMLElement and SVGElement
|
|
16
|
+
return node instanceof HTMLElement || node instanceof SVGElement;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves a DOM node via a ref, and does not invoke `findDOMNode`.
|
|
21
|
+
*/
|
|
22
|
+
function getDOM(node) {
|
|
23
|
+
if (node && _typeof(node) === 'object' && isDOM(node.nativeElement)) {
|
|
24
|
+
return node.nativeElement;
|
|
25
|
+
}
|
|
26
|
+
if (isDOM(node)) {
|
|
27
|
+
return node;
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Return if a node is a DOM node. Else will return by `findDOMNode`
|
|
34
|
+
*/
|
|
35
|
+
function findDOMNode(node) {
|
|
36
|
+
var domNode = getDOM(node);
|
|
37
|
+
if (domNode) {
|
|
38
|
+
return domNode;
|
|
39
|
+
}
|
|
40
|
+
if (node instanceof _react.default.Component) {
|
|
41
|
+
var _ReactDOM$findDOMNode;
|
|
42
|
+
return (_ReactDOM$findDOMNode = _reactDom.default.findDOMNode) === null || _ReactDOM$findDOMNode === void 0 ? void 0 : _ReactDOM$findDOMNode.call(_reactDom.default, node);
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function getFocusNodeList(node: HTMLElement, includePositive?: boolean): HTMLElement[];
|
|
2
|
+
/** @deprecated Do not use since this may failed when used in async */
|
|
3
|
+
export declare function saveLastFocusNode(): void;
|
|
4
|
+
/** @deprecated Do not use since this may failed when used in async */
|
|
5
|
+
export declare function clearLastFocusNode(): void;
|
|
6
|
+
/** @deprecated Do not use since this may failed when used in async */
|
|
7
|
+
export declare function backLastFocusNode(): void;
|
|
8
|
+
export declare function limitTabRange(node: HTMLElement, e: KeyboardEvent): void;
|