@progress/kendo-react-common 5.4.0-dev.202205180853 → 5.4.0-dev.202205271059
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/cdn/js/kendo-react-common.js +1 -1
- package/dist/es/FormComponent.d.ts +3 -3
- package/dist/es/browser-support.service.d.ts +1 -1
- package/dist/es/browser-support.service.js +1 -1
- package/dist/es/canUseRef.d.ts +1 -1
- package/dist/es/clone.d.ts +1 -1
- package/dist/es/contexts/ZIndexContext.d.ts +1 -1
- package/dist/es/drag-n-drop/context/index.d.ts +3 -2
- package/dist/es/events/BaseEvent.js +1 -0
- package/dist/es/getTabIndex.d.ts +1 -1
- package/dist/es/hocs/withPropsContext.d.ts +2 -2
- package/dist/es/hooks/useAsyncFocusBlur.js +9 -4
- package/dist/es/hooks/useCollection.d.ts +1 -1
- package/dist/es/hooks/useControlledState.d.ts +5 -2
- package/dist/es/hooks/useControlledState.js +1 -1
- package/dist/es/hooks/useCustomComponent.d.ts +2 -11
- package/dist/es/hooks/useCustomComponent.js +5 -6
- package/dist/es/hooks/useDocument.d.ts +2 -2
- package/dist/es/hooks/usePointer.js +1 -1
- package/dist/es/hooks/usePropsContext.d.ts +1 -1
- package/dist/es/hooks/useTouch.js +1 -1
- package/dist/es/hooks/useWindow.d.ts +2 -2
- package/dist/es/icons/BaseIconProps.js +1 -0
- package/dist/es/icons/Icon.js +4 -2
- package/dist/es/icons/SvgIcon.js +4 -2
- package/dist/es/icons/constants.d.ts +6 -6
- package/dist/es/icons/models/flip.js +1 -0
- package/dist/es/icons/models/size.js +1 -0
- package/dist/es/icons/models/theme-color.js +1 -0
- package/dist/es/main.js +7 -0
- package/dist/es/models/auto-scroll-options.js +1 -0
- package/dist/es/models/index.js +5 -0
- package/dist/es/models/kendoReactComponentBaseProps.js +1 -0
- package/dist/es/models/mouse.js +1 -0
- package/dist/es/models/pointer.js +1 -0
- package/dist/es/models/touch.js +1 -0
- package/dist/es/treeDataOperations.js +9 -4
- package/dist/es/typography/Typography.js +4 -2
- package/dist/es/typography/TypographyProps.js +1 -0
- package/dist/es/typography/constants.d.ts +44 -44
- package/dist/es/typography/models/margin.js +1 -0
- package/dist/npm/Draggable.js +1 -0
- package/dist/npm/Droppable.js +1 -0
- package/dist/npm/FormComponent.d.ts +3 -3
- package/dist/npm/FormComponent.js +1 -0
- package/dist/npm/browser-support.service.d.ts +1 -1
- package/dist/npm/browser-support.service.js +2 -1
- package/dist/npm/canUseDOM.js +1 -0
- package/dist/npm/canUseRef.d.ts +1 -1
- package/dist/npm/canUseRef.js +3 -1
- package/dist/npm/classNames.js +3 -1
- package/dist/npm/clone.d.ts +1 -1
- package/dist/npm/clone.js +3 -1
- package/dist/npm/constants/index.js +1 -0
- package/dist/npm/contexts/ZIndexContext.d.ts +1 -1
- package/dist/npm/contexts/ZIndexContext.js +3 -1
- package/dist/npm/drag-n-drop/context/index.d.ts +3 -2
- package/dist/npm/drag-n-drop/context/index.js +1 -0
- package/dist/npm/drag-n-drop/index.js +3 -1
- package/dist/npm/events/dispatchEvent.js +1 -0
- package/dist/npm/fieldList.js +1 -0
- package/dist/npm/focus.js +3 -1
- package/dist/npm/getTabIndex.d.ts +1 -1
- package/dist/npm/getTabIndex.js +3 -1
- package/dist/npm/getter.js +1 -0
- package/dist/npm/guid.js +3 -1
- package/dist/npm/hasRelativeStackingContext.js +3 -1
- package/dist/npm/hocs/AsyncFocusBlur.js +3 -1
- package/dist/npm/hocs/withPropsContext.d.ts +2 -2
- package/dist/npm/hocs/withPropsContext.js +5 -2
- package/dist/npm/hooks/index.js +22 -15
- package/dist/npm/hooks/useAsyncFocusBlur.js +10 -4
- package/dist/npm/hooks/useCollection.d.ts +1 -1
- package/dist/npm/hooks/useCollection.js +3 -1
- package/dist/npm/hooks/useControlledState.d.ts +5 -2
- package/dist/npm/hooks/useControlledState.js +4 -2
- package/dist/npm/hooks/useCustomComponent.d.ts +2 -11
- package/dist/npm/hooks/useCustomComponent.js +7 -6
- package/dist/npm/hooks/useDir.js +1 -0
- package/dist/npm/hooks/useDocument.d.ts +2 -2
- package/dist/npm/hooks/useDocument.js +3 -1
- package/dist/npm/hooks/useDraggable.js +1 -0
- package/dist/npm/hooks/useDroppable.js +1 -0
- package/dist/npm/hooks/useInheritedState.js +3 -1
- package/dist/npm/hooks/useMouse.js +3 -1
- package/dist/npm/hooks/usePointer.js +4 -2
- package/dist/npm/hooks/usePropsContext.d.ts +1 -1
- package/dist/npm/hooks/usePropsContext.js +3 -1
- package/dist/npm/hooks/useRtl.js +1 -0
- package/dist/npm/hooks/useTouch.js +4 -2
- package/dist/npm/hooks/useWindow.d.ts +2 -2
- package/dist/npm/hooks/useWindow.js +3 -1
- package/dist/npm/icons/Icon.js +5 -2
- package/dist/npm/icons/SvgIcon.js +5 -2
- package/dist/npm/icons/constants.d.ts +6 -6
- package/dist/npm/icons/constants.js +1 -0
- package/dist/npm/keys.js +1 -0
- package/dist/npm/main.js +56 -42
- package/dist/npm/models/index.js +15 -0
- package/dist/npm/noop.js +3 -1
- package/dist/npm/scrollbarWidth.js +5 -2
- package/dist/npm/setter.js +1 -0
- package/dist/npm/theme.js +1 -0
- package/dist/npm/treeDataOperations.js +18 -8
- package/dist/npm/typography/Typography.js +5 -2
- package/dist/npm/typography/constants.d.ts +44 -44
- package/dist/npm/typography/constants.js +1 -0
- package/dist/npm/validate-package.js +1 -0
- package/dist/systemjs/kendo-react-common.js +1 -1
- package/package.json +10 -10
|
@@ -9,14 +9,19 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
13
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
14
|
+
to[j] = from[i];
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
12
17
|
// Gets and sets the children. Returns the children or the re-created item with the new children.
|
|
13
18
|
function children(item, subItemsField, subItems) {
|
|
14
19
|
var _a;
|
|
15
20
|
if (subItems) {
|
|
16
|
-
return __assign({}, item, (_a = {}, _a[subItemsField] = subItems.length ? subItems
|
|
21
|
+
return __assign(__assign({}, item), (_a = {}, _a[subItemsField] = subItems.length ? __spreadArray([], subItems) : undefined, _a));
|
|
17
22
|
}
|
|
18
23
|
else {
|
|
19
|
-
return item && item[subItemsField] ? item[subItemsField]
|
|
24
|
+
return item && item[subItemsField] ? __spreadArray([], item[subItemsField]) : [];
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
function mapItem(dataItem, subItemsField, callbackfn) {
|
|
@@ -36,7 +41,7 @@ function mapItem(dataItem, subItemsField, callbackfn) {
|
|
|
36
41
|
* @returns {any[]} - The new data tree.
|
|
37
42
|
*/
|
|
38
43
|
export var mapTree = function (tree, subItemsField, callback) {
|
|
39
|
-
return tree.map(function (item) { return mapItem(item, subItemsField, callback); })
|
|
44
|
+
return __spreadArray([], tree.map(function (item) { return mapItem(item, subItemsField, callback); }));
|
|
40
45
|
};
|
|
41
46
|
/**
|
|
42
47
|
* Creates a new array with the results of calling the provided callback function
|
|
@@ -83,7 +88,7 @@ export var extendDataItem = function (item, subItemsField, propsToExtend) {
|
|
|
83
88
|
*/
|
|
84
89
|
export var getItemPath = function (tree, level, subItemsField) {
|
|
85
90
|
var nodes = [];
|
|
86
|
-
var itemLevel = level
|
|
91
|
+
var itemLevel = __spreadArray([], level);
|
|
87
92
|
if (itemLevel.length) {
|
|
88
93
|
var element = tree[itemLevel.shift() || 0];
|
|
89
94
|
nodes.push(element);
|
|
@@ -14,8 +14,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
14
14
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
15
|
t[p] = s[p];
|
|
16
16
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
18
|
-
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
19
21
|
return t;
|
|
20
22
|
};
|
|
21
23
|
import * as React from 'react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,83 +2,83 @@
|
|
|
2
2
|
* @hidden
|
|
3
3
|
*/
|
|
4
4
|
export declare const FONT_SIZE_CLASSES: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
xsmall: string;
|
|
6
|
+
small: string;
|
|
7
|
+
medium: string;
|
|
8
|
+
large: string;
|
|
9
|
+
xlarge: string;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* @hidden
|
|
13
13
|
*/
|
|
14
14
|
export declare const FONT_WEIGHT_CLASSES: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
light: string;
|
|
16
|
+
normal: string;
|
|
17
|
+
bold: string;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* @hidden
|
|
21
21
|
*/
|
|
22
22
|
export declare const MARGIN_ENUM_CLASSES: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
xsmall: string;
|
|
24
|
+
small: string;
|
|
25
|
+
medium: string;
|
|
26
|
+
large: string;
|
|
27
|
+
xlarge: string;
|
|
28
|
+
thin: string;
|
|
29
|
+
hair: string;
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
32
|
* @hidden
|
|
33
33
|
*/
|
|
34
34
|
export declare const MARGIN_ENUM_VALUES: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
xsmall: string;
|
|
36
|
+
small: string;
|
|
37
|
+
medium: string;
|
|
38
|
+
large: string;
|
|
39
|
+
xlarge: string;
|
|
40
|
+
thin: string;
|
|
41
|
+
hair: string;
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
44
|
* @hidden
|
|
45
45
|
*/
|
|
46
46
|
export declare const MARGIN_SIDES_CLASSES: {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
top: string;
|
|
48
|
+
right: string;
|
|
49
|
+
bottom: string;
|
|
50
|
+
left: string;
|
|
51
51
|
};
|
|
52
52
|
/**
|
|
53
53
|
* @hidden
|
|
54
54
|
*/
|
|
55
55
|
export declare const TEXT_ALIGN_CLASSES: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
left: string;
|
|
57
|
+
right: string;
|
|
58
|
+
center: string;
|
|
59
|
+
justify: string;
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
62
62
|
* @hidden
|
|
63
63
|
*/
|
|
64
64
|
export declare const TEXT_TRANSFORM_CLASSES: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
lowercase: string;
|
|
66
|
+
uppercase: string;
|
|
67
|
+
capitalize: string;
|
|
68
68
|
};
|
|
69
69
|
/**
|
|
70
70
|
* @hidden
|
|
71
71
|
*/
|
|
72
72
|
export declare const THEME_COLOR_CLASSES: {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
inherit: string;
|
|
74
|
+
primary: string;
|
|
75
|
+
secondary: string;
|
|
76
|
+
tertiary: string;
|
|
77
|
+
info: string;
|
|
78
|
+
success: string;
|
|
79
|
+
warning: string;
|
|
80
|
+
error: string;
|
|
81
|
+
dark: string;
|
|
82
|
+
light: string;
|
|
83
|
+
inverse: string;
|
|
84
84
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/npm/Draggable.js
CHANGED
package/dist/npm/Droppable.js
CHANGED
|
@@ -92,7 +92,7 @@ export interface FormComponentValidity {
|
|
|
92
92
|
* @hidden
|
|
93
93
|
*/
|
|
94
94
|
export declare abstract class FormComponent {
|
|
95
|
-
abstract
|
|
96
|
-
abstract
|
|
97
|
-
abstract
|
|
95
|
+
abstract get value(): any;
|
|
96
|
+
abstract get validity(): FormComponentValidity;
|
|
97
|
+
abstract get name(): string | undefined;
|
|
98
98
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BrowserSupportService = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* @hidden
|
|
5
6
|
*/
|
|
@@ -23,7 +24,7 @@ var BrowserSupportService = /** @class */ (function () {
|
|
|
23
24
|
}
|
|
24
25
|
return this.scrollbar;
|
|
25
26
|
},
|
|
26
|
-
enumerable:
|
|
27
|
+
enumerable: false,
|
|
27
28
|
configurable: true
|
|
28
29
|
});
|
|
29
30
|
return BrowserSupportService;
|
package/dist/npm/canUseDOM.js
CHANGED
package/dist/npm/canUseRef.d.ts
CHANGED
package/dist/npm/canUseRef.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.canUseRef = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* @hidden
|
|
5
6
|
*/
|
|
@@ -11,4 +12,5 @@ var isForwardRef = function (Component) { return Boolean(Component.$$typeof && t
|
|
|
11
12
|
/**
|
|
12
13
|
* @hidden
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
+
var canUseRef = function (Component) { return typeof Comment !== 'string' && (isClassComponent(Component) || isForwardRef(Component)); };
|
|
16
|
+
exports.canUseRef = canUseRef;
|
package/dist/npm/classNames.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.classNames = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* @hidden
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
var classNames = function () {
|
|
7
8
|
var args = [];
|
|
8
9
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
9
10
|
args[_i] = arguments[_i];
|
|
@@ -30,3 +31,4 @@ exports.classNames = function () {
|
|
|
30
31
|
.filter(function (el) { return el !== null; })
|
|
31
32
|
.join(' ');
|
|
32
33
|
};
|
|
34
|
+
exports.classNames = classNames;
|
package/dist/npm/clone.d.ts
CHANGED
package/dist/npm/clone.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cloneArray = exports.cloneValue = exports.cloneObject = exports.clone = exports.cloneDate = void 0;
|
|
3
4
|
var React = require("react");
|
|
4
5
|
/**
|
|
5
6
|
* @hidden
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
+
var cloneDate = function (date) { return date ? new Date(date.getTime()) : null; };
|
|
9
|
+
exports.cloneDate = cloneDate;
|
|
8
10
|
/**
|
|
9
11
|
* @hidden
|
|
10
12
|
*/
|
|
@@ -4,4 +4,4 @@ export declare type ZIndexContextType = number | undefined;
|
|
|
4
4
|
/** @hidden */
|
|
5
5
|
export declare const ZIndexContext: React.Context<number>;
|
|
6
6
|
/** @hidden */
|
|
7
|
-
export declare const useZIndexContext: () =>
|
|
7
|
+
export declare const useZIndexContext: () => ZIndexContextType;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useZIndexContext = exports.ZIndexContext = void 0;
|
|
3
4
|
var React = require("react");
|
|
4
5
|
/** @hidden */
|
|
5
6
|
exports.ZIndexContext = React.createContext(0);
|
|
6
7
|
/** @hidden */
|
|
7
|
-
|
|
8
|
+
var useZIndexContext = function () { return React.useContext(exports.ZIndexContext); };
|
|
9
|
+
exports.useZIndexContext = useZIndexContext;
|
|
8
10
|
exports.ZIndexContext.displayName = 'KendoReactZIndexContext';
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DragTarget, DropTarget } from '@progress/kendo-draggable-common';
|
|
3
|
+
import { ControlledStateHook } from '../../hooks';
|
|
3
4
|
/**
|
|
4
5
|
* @hidden
|
|
5
6
|
*/
|
|
6
|
-
export declare const DragContext: React.Context<
|
|
7
|
+
export declare const DragContext: React.Context<ControlledStateHook<React.RefObject<DragTarget>, any>>;
|
|
7
8
|
/**
|
|
8
9
|
* @hidden
|
|
9
10
|
*/
|
|
10
|
-
export declare const DropContext: React.Context<
|
|
11
|
+
export declare const DropContext: React.Context<ControlledStateHook<React.RefObject<DropTarget>, any>>;
|
|
11
12
|
/**
|
|
12
13
|
* @hidden
|
|
13
14
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DragAndDrop = void 0;
|
|
3
4
|
var React = require("react");
|
|
4
5
|
var hooks_1 = require("../hooks");
|
|
5
6
|
var context_1 = require("./context");
|
|
@@ -9,7 +10,7 @@ var context_1 = require("./context");
|
|
|
9
10
|
* It is used internally to synchronize the `drag` and `drop` functionalities.
|
|
10
11
|
* Accepts properties of type [DragAndDropProps]({% slug api_common_draganddropprops %}).
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
var DragAndDrop = function (props) {
|
|
13
14
|
var _a = hooks_1.useControlledState(null, undefined), drag = _a[0], setDrag = _a[1];
|
|
14
15
|
var _b = hooks_1.useControlledState(null, undefined), drop = _b[0], setDrop = _b[1];
|
|
15
16
|
var _c = hooks_1.useCollection([]), drags = _c[0], dispatchDrags = _c[1];
|
|
@@ -43,4 +44,5 @@ exports.DragAndDrop = function (props) {
|
|
|
43
44
|
React.createElement(context_1.DragsContext.Provider, { value: [drags, registerDrag, deregisterDrag] },
|
|
44
45
|
React.createElement(context_1.DropsContext.Provider, { value: [drops, registerDrop, deregisterDrop] }, props.children)))));
|
|
45
46
|
};
|
|
47
|
+
exports.DragAndDrop = DragAndDrop;
|
|
46
48
|
exports.DragAndDrop.displayName = 'KendoReactDragAndDrop';
|
package/dist/npm/fieldList.js
CHANGED
package/dist/npm/focus.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.focusFirstFocusableChild = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* @hidden
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
var focusFirstFocusableChild = function (target) {
|
|
7
8
|
if (target) {
|
|
8
9
|
if ((target instanceof HTMLInputElement || target.tabIndex !== -1) && target.focus) {
|
|
9
10
|
target.focus();
|
|
@@ -15,3 +16,4 @@ exports.focusFirstFocusableChild = function (target) {
|
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
};
|
|
19
|
+
exports.focusFirstFocusableChild = focusFirstFocusableChild;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @hidden
|
|
3
3
|
*/
|
|
4
|
-
export declare const getTabIndex: (tabIndex?:
|
|
4
|
+
export declare const getTabIndex: (tabIndex?: number | string, disabled?: boolean, useDefaultTabIndexWhenDisabled?: boolean) => number | undefined;
|
package/dist/npm/getTabIndex.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTabIndex = void 0;
|
|
3
4
|
/* eslint-disable radix */
|
|
4
5
|
/**
|
|
5
6
|
* @hidden
|
|
@@ -12,7 +13,7 @@ var DEFAULT_TABINDEX = 0;
|
|
|
12
13
|
/**
|
|
13
14
|
* @hidden
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
+
var getTabIndex = function (tabIndex, disabled, useDefaultTabIndexWhenDisabled) {
|
|
16
17
|
var parsedTabIndex = typeof tabIndex === 'string' ? parseInt(tabIndex, undefined) : tabIndex;
|
|
17
18
|
if (parsedTabIndex === NaN) {
|
|
18
19
|
return undefined;
|
|
@@ -23,3 +24,4 @@ exports.getTabIndex = function (tabIndex, disabled, useDefaultTabIndexWhenDisabl
|
|
|
23
24
|
(useDefaultTabIndexWhenDisabled ? undefined : DISABLED_TABINDEX)
|
|
24
25
|
: DEFAULT_TABINDEX;
|
|
25
26
|
};
|
|
27
|
+
exports.getTabIndex = getTabIndex;
|
package/dist/npm/getter.js
CHANGED
package/dist/npm/guid.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable no-bitwise */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.guid = void 0;
|
|
4
5
|
/**
|
|
5
6
|
* @hidden
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
+
var guid = function () {
|
|
8
9
|
var id = '';
|
|
9
10
|
var i;
|
|
10
11
|
var random;
|
|
@@ -17,3 +18,4 @@ exports.guid = function () {
|
|
|
17
18
|
}
|
|
18
19
|
return id;
|
|
19
20
|
};
|
|
21
|
+
exports.guid = guid;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasRelativeStackingContext = void 0;
|
|
3
4
|
var canUseDOM_1 = require("./canUseDOM");
|
|
4
5
|
/** @hidden */
|
|
5
|
-
|
|
6
|
+
var hasRelativeStackingContext = function (elementSource) {
|
|
6
7
|
if (!canUseDOM_1.canUseDOM) {
|
|
7
8
|
return false;
|
|
8
9
|
}
|
|
@@ -21,3 +22,4 @@ exports.hasRelativeStackingContext = function (elementSource) {
|
|
|
21
22
|
currentDocument.body.removeChild(parent);
|
|
22
23
|
return isDifferent;
|
|
23
24
|
};
|
|
25
|
+
exports.hasRelativeStackingContext = hasRelativeStackingContext;
|
|
@@ -11,6 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.AsyncFocusBlur = void 0;
|
|
14
15
|
var useAsyncFocusBlur_1 = require("../hooks/useAsyncFocusBlur");
|
|
15
16
|
/**
|
|
16
17
|
* An utility High-order Component for asynchronous focus/blur handling.
|
|
@@ -20,8 +21,9 @@ var useAsyncFocusBlur_1 = require("../hooks/useAsyncFocusBlur");
|
|
|
20
21
|
*
|
|
21
22
|
* @returns
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
+
var AsyncFocusBlur = function (_a) {
|
|
24
25
|
var children = _a.children, onFocus = _a.onFocus, onBlur = _a.onBlur, onSyncFocus = _a.onSyncFocus, onSyncBlur = _a.onSyncBlur;
|
|
25
26
|
var args = useAsyncFocusBlur_1.useAsyncFocusBlur({ onFocus: onFocus, onBlur: onBlur, onSyncFocus: onSyncFocus, onSyncBlur: onSyncBlur });
|
|
26
27
|
return children.call(undefined, __assign({}, args));
|
|
27
28
|
};
|
|
29
|
+
exports.AsyncFocusBlur = AsyncFocusBlur;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
/** @hidden */
|
|
3
|
-
export declare const createPropsContext: <T extends
|
|
3
|
+
export declare const createPropsContext: <T extends unknown>() => React.Context<(p: T) => T>;
|
|
4
4
|
/** @hidden */
|
|
5
|
-
export declare const withPropsContext: <T extends
|
|
5
|
+
export declare const withPropsContext: <T extends unknown>(context: React.Context<(p: T) => T>, Component: React.ComponentType<T>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<T> & React.RefAttributes<any>>;
|
|
@@ -11,14 +11,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.withPropsContext = exports.createPropsContext = void 0;
|
|
14
15
|
var React = require("react");
|
|
15
16
|
var usePropsContext_1 = require("../hooks/usePropsContext");
|
|
16
17
|
/** @hidden */
|
|
17
|
-
|
|
18
|
+
var createPropsContext = function () { return React.createContext(function (props) { return props; }); };
|
|
19
|
+
exports.createPropsContext = createPropsContext;
|
|
18
20
|
/** @hidden */
|
|
19
|
-
|
|
21
|
+
var withPropsContext = function (context, Component
|
|
20
22
|
// eslint-disable-next-line react/display-name
|
|
21
23
|
) { return React.forwardRef(function (props, ref) {
|
|
22
24
|
var contextProps = usePropsContext_1.usePropsContext(context, props);
|
|
23
25
|
return (React.createElement(Component, __assign({}, contextProps, { ref: ref })));
|
|
24
26
|
}); };
|
|
27
|
+
exports.withPropsContext = withPropsContext;
|
package/dist/npm/hooks/index.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
5
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__exportStar(require("./useMouse"), exports);
|
|
14
|
+
__exportStar(require("./useAsyncFocusBlur"), exports);
|
|
15
|
+
__exportStar(require("./useDir"), exports);
|
|
16
|
+
__exportStar(require("./useDraggable"), exports);
|
|
17
|
+
__exportStar(require("./useDroppable"), exports);
|
|
18
|
+
__exportStar(require("./useRtl"), exports);
|
|
19
|
+
__exportStar(require("./useCustomComponent"), exports);
|
|
20
|
+
__exportStar(require("./useControlledState"), exports);
|
|
21
|
+
__exportStar(require("./useInheritedState"), exports);
|
|
22
|
+
__exportStar(require("./useCollection"), exports);
|
|
23
|
+
__exportStar(require("./useDocument"), exports);
|
|
24
|
+
__exportStar(require("./useWindow"), exports);
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
3
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
4
|
+
to[j] = from[i];
|
|
5
|
+
return to;
|
|
6
|
+
};
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.useAsyncFocusBlur = void 0;
|
|
3
9
|
var React = require("react");
|
|
4
10
|
/**
|
|
5
11
|
* An utility function for asynchronous focus/blur handling.
|
|
@@ -24,7 +30,7 @@ function useAsyncFocusBlur(_a) {
|
|
|
24
30
|
}
|
|
25
31
|
clearTimeout(tick.current);
|
|
26
32
|
if (onSyncFocus) {
|
|
27
|
-
onSyncFocus.call.apply(onSyncFocus, [undefined]
|
|
33
|
+
onSyncFocus.call.apply(onSyncFocus, __spreadArray([undefined], event));
|
|
28
34
|
}
|
|
29
35
|
if (focused.current) {
|
|
30
36
|
return;
|
|
@@ -32,7 +38,7 @@ function useAsyncFocusBlur(_a) {
|
|
|
32
38
|
;
|
|
33
39
|
focused.current = true;
|
|
34
40
|
if (onFocus) {
|
|
35
|
-
onFocus.call.apply(onFocus, [undefined]
|
|
41
|
+
onFocus.call.apply(onFocus, __spreadArray([undefined], event));
|
|
36
42
|
}
|
|
37
43
|
}, [focused, onFocus, onSyncFocus]);
|
|
38
44
|
var handleBlur = React.useCallback(function () {
|
|
@@ -41,7 +47,7 @@ function useAsyncFocusBlur(_a) {
|
|
|
41
47
|
event[_i] = arguments[_i];
|
|
42
48
|
}
|
|
43
49
|
if (onSyncBlur) {
|
|
44
|
-
onSyncBlur.call.apply(onSyncBlur, [undefined]
|
|
50
|
+
onSyncBlur.call.apply(onSyncBlur, __spreadArray([undefined], event));
|
|
45
51
|
}
|
|
46
52
|
nextTick(function () {
|
|
47
53
|
if (!focused.current) {
|
|
@@ -49,7 +55,7 @@ function useAsyncFocusBlur(_a) {
|
|
|
49
55
|
}
|
|
50
56
|
if (onBlur) {
|
|
51
57
|
focused.current = false;
|
|
52
|
-
onBlur.call.apply(onBlur, [undefined]
|
|
58
|
+
onBlur.call.apply(onBlur, __spreadArray([undefined], event));
|
|
53
59
|
}
|
|
54
60
|
});
|
|
55
61
|
}, [focused, nextTick, onBlur, onSyncBlur]);
|
|
@@ -11,4 +11,4 @@ export interface CollectionAction<T> {
|
|
|
11
11
|
item: T;
|
|
12
12
|
}
|
|
13
13
|
/** @hidden */
|
|
14
|
-
export declare const useCollection: <T extends
|
|
14
|
+
export declare const useCollection: <T extends unknown>(initial?: T[]) => [T[], (event: CollectionAction<T>) => void];
|