@progress/kendo-react-common 6.1.1 → 7.0.0-develop.2
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/npm/Draggable.d.ts → Draggable.d.ts} +5 -1
- package/{dist/npm/Droppable.d.ts → Droppable.d.ts} +5 -1
- package/{dist/es/FormComponent.d.ts → FormComponent.d.ts} +4 -0
- package/LICENSE.md +1 -1
- package/browser-support.service.d.ts +11 -0
- package/canUseDOM.d.ts +8 -0
- package/canUseRef.d.ts +9 -0
- package/classNames.d.ts +8 -0
- package/{dist/npm/clone.d.ts → clone.d.ts} +4 -0
- package/constants/index.d.ts +8 -0
- package/contexts/ZIndexContext.d.ts +11 -0
- package/dist/cdn/js/kendo-react-common.js +8 -1
- package/{dist/npm/drag-n-drop → drag-n-drop}/context/index.d.ts +6 -2
- package/{dist/es/drag-n-drop → drag-n-drop}/index.d.ts +6 -2
- package/events/BaseEvent.d.ts +22 -0
- package/{dist/npm/events → events}/dispatchEvent.d.ts +4 -1
- package/fieldList.d.ts +8 -0
- package/focus.d.ts +8 -0
- package/getActiveElement.d.ts +12 -0
- package/getTabIndex.d.ts +8 -0
- package/{dist/es/getter.d.ts → getter.d.ts} +4 -0
- package/guid.d.ts +8 -0
- package/hasRelativeStackingContext.d.ts +6 -0
- package/{dist/npm/hocs → hocs}/AsyncFocusBlur.d.ts +5 -1
- package/{dist/npm/hocs → hocs}/withPropsContext.d.ts +4 -0
- package/{dist/npm/hooks → hooks}/index.d.ts +4 -0
- package/{dist/npm/hooks → hooks}/useAsyncFocusBlur.d.ts +5 -1
- package/hooks/useCollection.d.ts +18 -0
- package/hooks/useControlledState.d.ts +11 -0
- package/hooks/useCustomComponent.d.ts +17 -0
- package/hooks/useDir.d.ts +9 -0
- package/hooks/useDocument.d.ts +11 -0
- package/{dist/es/hooks → hooks}/useDraggable.d.ts +4 -0
- package/{dist/es/hooks → hooks}/useDroppable.d.ts +4 -0
- package/hooks/useInheritedState.d.ts +17 -0
- package/{dist/es/hooks → hooks}/useMouse.d.ts +5 -1
- package/hooks/usePropsContext.d.ts +7 -0
- package/hooks/useRtl.d.ts +9 -0
- package/hooks/useWindow.d.ts +11 -0
- package/{dist/npm/icons → icons}/BaseIconProps.d.ts +4 -1
- package/{dist/es/icons → icons}/Icon.d.ts +4 -0
- package/icons/IconWrap.d.ts +11 -0
- package/{dist/es/icons → icons}/IconsContext.d.ts +4 -0
- package/{dist/es/icons → icons}/SvgIcon.d.ts +4 -0
- package/icons/constants.d.ts +17 -0
- package/icons/models/flip.d.ts +15 -0
- package/{dist/npm/icons → icons}/models/size.d.ts +5 -1
- package/{dist/es/icons → icons}/models/theme-color.d.ts +5 -1
- package/{dist/es/icons → icons}/utils.d.ts +4 -0
- package/{dist/es/main.d.ts → index.d.ts} +4 -0
- package/index.js +8 -0
- package/index.mjs +1787 -0
- package/keys.d.ts +24 -0
- package/memoize.d.ts +14 -0
- package/{dist/es/models → models}/auto-scroll-options.d.ts +4 -1
- package/models/index.d.ts +9 -0
- package/{dist/npm/models → models}/kendoReactComponentBaseProps.d.ts +4 -1
- package/{dist/npm/models → models}/mouse.d.ts +4 -0
- package/{dist/npm/models → models}/pointer.d.ts +4 -0
- package/{dist/es/models → models}/touch.d.ts +4 -0
- package/{dist/npm/navigation.d.ts → navigation.d.ts} +4 -1
- package/noop.d.ts +8 -0
- package/package.json +26 -45
- package/scrollbarWidth.d.ts +12 -0
- package/{dist/npm/setter.d.ts → setter.d.ts} +4 -0
- package/theme.d.ts +12 -0
- package/{dist/es/tree-utils → tree-utils}/FieldsService.d.ts +4 -0
- package/tree-utils/SortedPublicItemIds.d.ts +12 -0
- package/{dist/es/tree-utils → tree-utils}/itemIdUtils.d.ts +4 -0
- package/{dist/es/tree-utils → tree-utils}/itemUtils.d.ts +4 -0
- package/tree-utils/misc.d.ts +12 -0
- package/{dist/es/treeDataOperations.d.ts → treeDataOperations.d.ts} +4 -0
- package/{dist/npm/typography → typography}/Typography.d.ts +4 -0
- package/{dist/es/typography → typography}/TypographyProps.d.ts +4 -1
- package/{dist/npm/typography → typography}/constants.d.ts +4 -0
- package/{dist/es/typography → typography}/models/margin.d.ts +5 -1
- package/validate-package.d.ts +12 -0
- package/watermark/WatermarkOverlay.d.ts +9 -0
- package/about.md +0 -3
- package/dist/es/Draggable.d.ts +0 -86
- package/dist/es/Draggable.js +0 -84
- package/dist/es/Droppable.d.ts +0 -77
- package/dist/es/Droppable.js +0 -68
- package/dist/es/FormComponent.js +0 -9
- package/dist/es/browser-support.service.d.ts +0 -7
- package/dist/es/browser-support.service.js +0 -30
- package/dist/es/canUseDOM.d.ts +0 -4
- package/dist/es/canUseDOM.js +0 -8
- package/dist/es/canUseRef.d.ts +0 -5
- package/dist/es/canUseRef.js +0 -12
- package/dist/es/classNames.d.ts +0 -4
- package/dist/es/classNames.js +0 -30
- package/dist/es/clone.d.ts +0 -20
- package/dist/es/clone.js +0 -52
- package/dist/es/constants/index.d.ts +0 -4
- package/dist/es/constants/index.js +0 -4
- package/dist/es/contexts/ZIndexContext.d.ts +0 -7
- package/dist/es/contexts/ZIndexContext.js +0 -6
- package/dist/es/drag-n-drop/context/index.d.ts +0 -19
- package/dist/es/drag-n-drop/context/index.js +0 -24
- package/dist/es/drag-n-drop/index.js +0 -44
- package/dist/es/events/BaseEvent.d.ts +0 -18
- package/dist/es/events/BaseEvent.js +0 -1
- package/dist/es/events/dispatchEvent.d.ts +0 -15
- package/dist/es/events/dispatchEvent.js +0 -22
- package/dist/es/fieldList.d.ts +0 -4
- package/dist/es/fieldList.js +0 -11
- package/dist/es/focus.d.ts +0 -4
- package/dist/es/focus.js +0 -15
- package/dist/es/getActiveElement.d.ts +0 -8
- package/dist/es/getActiveElement.js +0 -23
- package/dist/es/getTabIndex.d.ts +0 -4
- package/dist/es/getTabIndex.js +0 -23
- package/dist/es/getter.js +0 -30
- package/dist/es/guid.d.ts +0 -4
- package/dist/es/guid.js +0 -17
- package/dist/es/hasRelativeStackingContext.d.ts +0 -2
- package/dist/es/hasRelativeStackingContext.js +0 -25
- package/dist/es/hocs/AsyncFocusBlur.d.ts +0 -13
- package/dist/es/hocs/AsyncFocusBlur.js +0 -26
- package/dist/es/hocs/withPropsContext.d.ts +0 -5
- package/dist/es/hocs/withPropsContext.js +0 -22
- package/dist/es/hooks/index.d.ts +0 -12
- package/dist/es/hooks/index.js +0 -12
- package/dist/es/hooks/useAsyncFocusBlur.d.ts +0 -25
- package/dist/es/hooks/useAsyncFocusBlur.js +0 -72
- package/dist/es/hooks/useCollection.d.ts +0 -14
- package/dist/es/hooks/useCollection.js +0 -26
- package/dist/es/hooks/useControlledState.d.ts +0 -7
- package/dist/es/hooks/useControlledState.js +0 -23
- package/dist/es/hooks/useCustomComponent.d.ts +0 -13
- package/dist/es/hooks/useCustomComponent.js +0 -9
- package/dist/es/hooks/useDir.d.ts +0 -5
- package/dist/es/hooks/useDir.js +0 -19
- package/dist/es/hooks/useDocument.d.ts +0 -7
- package/dist/es/hooks/useDocument.js +0 -14
- package/dist/es/hooks/useDraggable.js +0 -336
- package/dist/es/hooks/useDroppable.js +0 -59
- package/dist/es/hooks/useInheritedState.d.ts +0 -13
- package/dist/es/hooks/useInheritedState.js +0 -21
- package/dist/es/hooks/useMouse.js +0 -117
- package/dist/es/hooks/usePointer.d.ts +0 -21
- package/dist/es/hooks/usePointer.js +0 -29
- package/dist/es/hooks/usePropsContext.d.ts +0 -3
- package/dist/es/hooks/usePropsContext.js +0 -7
- package/dist/es/hooks/useRtl.d.ts +0 -5
- package/dist/es/hooks/useRtl.js +0 -22
- package/dist/es/hooks/useTouch.d.ts +0 -15
- package/dist/es/hooks/useTouch.js +0 -29
- package/dist/es/hooks/useWindow.d.ts +0 -7
- package/dist/es/hooks/useWindow.js +0 -15
- package/dist/es/icons/BaseIconProps.d.ts +0 -73
- package/dist/es/icons/BaseIconProps.js +0 -1
- package/dist/es/icons/Icon.js +0 -78
- package/dist/es/icons/IconWrap.d.ts +0 -7
- package/dist/es/icons/IconWrap.js +0 -41
- package/dist/es/icons/IconsContext.js +0 -7
- package/dist/es/icons/SvgIcon.js +0 -96
- package/dist/es/icons/constants.d.ts +0 -13
- package/dist/es/icons/constants.js +0 -13
- package/dist/es/icons/models/flip.d.ts +0 -11
- package/dist/es/icons/models/flip.js +0 -1
- package/dist/es/icons/models/size.d.ts +0 -15
- package/dist/es/icons/models/size.js +0 -1
- package/dist/es/icons/models/theme-color.js +0 -1
- package/dist/es/icons/utils.js +0 -17
- package/dist/es/keys.d.ts +0 -20
- package/dist/es/keys.js +0 -20
- package/dist/es/main.js +0 -59
- package/dist/es/memoize.d.ts +0 -10
- package/dist/es/memoize.js +0 -41
- package/dist/es/models/auto-scroll-options.js +0 -1
- package/dist/es/models/index.d.ts +0 -5
- package/dist/es/models/index.js +0 -5
- package/dist/es/models/kendoReactComponentBaseProps.d.ts +0 -24
- package/dist/es/models/kendoReactComponentBaseProps.js +0 -1
- package/dist/es/models/mouse.d.ts +0 -16
- package/dist/es/models/mouse.js +0 -1
- package/dist/es/models/pointer.d.ts +0 -23
- package/dist/es/models/pointer.js +0 -1
- package/dist/es/models/touch.js +0 -1
- package/dist/es/navigation.d.ts +0 -128
- package/dist/es/navigation.js +0 -144
- package/dist/es/noop.d.ts +0 -4
- package/dist/es/noop.js +0 -4
- package/dist/es/scrollbarWidth.d.ts +0 -8
- package/dist/es/scrollbarWidth.js +0 -22
- package/dist/es/setter.d.ts +0 -16
- package/dist/es/setter.js +0 -36
- package/dist/es/theme.d.ts +0 -8
- package/dist/es/theme.js +0 -17
- package/dist/es/tree-utils/FieldsService.js +0 -50
- package/dist/es/tree-utils/SortedPublicItemIds.d.ts +0 -8
- package/dist/es/tree-utils/SortedPublicItemIds.js +0 -26
- package/dist/es/tree-utils/itemIdUtils.js +0 -117
- package/dist/es/tree-utils/itemUtils.js +0 -191
- package/dist/es/tree-utils/misc.d.ts +0 -8
- package/dist/es/tree-utils/misc.js +0 -17
- package/dist/es/treeDataOperations.js +0 -105
- package/dist/es/typography/Typography.d.ts +0 -35
- package/dist/es/typography/Typography.js +0 -266
- package/dist/es/typography/TypographyProps.js +0 -1
- package/dist/es/typography/constants.d.ts +0 -84
- package/dist/es/typography/constants.js +0 -84
- package/dist/es/typography/models/margin.js +0 -1
- package/dist/es/validate-package.d.ts +0 -8
- package/dist/es/validate-package.js +0 -23
- package/dist/es/watermark/WatermarkOverlay.d.ts +0 -6
- package/dist/es/watermark/WatermarkOverlay.js +0 -86
- package/dist/npm/Draggable.js +0 -87
- package/dist/npm/Droppable.js +0 -71
- package/dist/npm/FormComponent.d.ts +0 -98
- package/dist/npm/FormComponent.js +0 -12
- package/dist/npm/browser-support.service.d.ts +0 -7
- package/dist/npm/browser-support.service.js +0 -33
- package/dist/npm/canUseDOM.d.ts +0 -4
- package/dist/npm/canUseDOM.js +0 -11
- package/dist/npm/canUseRef.d.ts +0 -5
- package/dist/npm/canUseRef.js +0 -16
- package/dist/npm/classNames.d.ts +0 -4
- package/dist/npm/classNames.js +0 -34
- package/dist/npm/clone.js +0 -60
- package/dist/npm/constants/index.d.ts +0 -4
- package/dist/npm/constants/index.js +0 -7
- package/dist/npm/contexts/ZIndexContext.d.ts +0 -7
- package/dist/npm/contexts/ZIndexContext.js +0 -10
- package/dist/npm/drag-n-drop/context/index.js +0 -27
- package/dist/npm/drag-n-drop/index.d.ts +0 -21
- package/dist/npm/drag-n-drop/index.js +0 -48
- package/dist/npm/events/BaseEvent.d.ts +0 -18
- package/dist/npm/events/BaseEvent.js +0 -2
- package/dist/npm/events/dispatchEvent.js +0 -26
- package/dist/npm/fieldList.d.ts +0 -4
- package/dist/npm/fieldList.js +0 -15
- package/dist/npm/focus.d.ts +0 -4
- package/dist/npm/focus.js +0 -19
- package/dist/npm/getActiveElement.d.ts +0 -8
- package/dist/npm/getActiveElement.js +0 -28
- package/dist/npm/getTabIndex.d.ts +0 -4
- package/dist/npm/getTabIndex.js +0 -27
- package/dist/npm/getter.d.ts +0 -14
- package/dist/npm/getter.js +0 -34
- package/dist/npm/guid.d.ts +0 -4
- package/dist/npm/guid.js +0 -21
- package/dist/npm/hasRelativeStackingContext.d.ts +0 -2
- package/dist/npm/hasRelativeStackingContext.js +0 -29
- package/dist/npm/hocs/AsyncFocusBlur.js +0 -30
- package/dist/npm/hocs/withPropsContext.js +0 -27
- package/dist/npm/hooks/index.js +0 -28
- package/dist/npm/hooks/useAsyncFocusBlur.js +0 -76
- package/dist/npm/hooks/useCollection.d.ts +0 -14
- package/dist/npm/hooks/useCollection.js +0 -30
- package/dist/npm/hooks/useControlledState.d.ts +0 -7
- package/dist/npm/hooks/useControlledState.js +0 -27
- package/dist/npm/hooks/useCustomComponent.d.ts +0 -13
- package/dist/npm/hooks/useCustomComponent.js +0 -13
- package/dist/npm/hooks/useDir.d.ts +0 -5
- package/dist/npm/hooks/useDir.js +0 -23
- package/dist/npm/hooks/useDocument.d.ts +0 -7
- package/dist/npm/hooks/useDocument.js +0 -18
- package/dist/npm/hooks/useDraggable.d.ts +0 -63
- package/dist/npm/hooks/useDraggable.js +0 -340
- package/dist/npm/hooks/useDroppable.d.ts +0 -28
- package/dist/npm/hooks/useDroppable.js +0 -63
- package/dist/npm/hooks/useInheritedState.d.ts +0 -13
- package/dist/npm/hooks/useInheritedState.js +0 -25
- package/dist/npm/hooks/useMouse.d.ts +0 -20
- package/dist/npm/hooks/useMouse.js +0 -121
- package/dist/npm/hooks/usePointer.d.ts +0 -21
- package/dist/npm/hooks/usePointer.js +0 -33
- package/dist/npm/hooks/usePropsContext.d.ts +0 -3
- package/dist/npm/hooks/usePropsContext.js +0 -11
- package/dist/npm/hooks/useRtl.d.ts +0 -5
- package/dist/npm/hooks/useRtl.js +0 -26
- package/dist/npm/hooks/useTouch.d.ts +0 -15
- package/dist/npm/hooks/useTouch.js +0 -33
- package/dist/npm/hooks/useWindow.d.ts +0 -7
- package/dist/npm/hooks/useWindow.js +0 -19
- package/dist/npm/icons/BaseIconProps.js +0 -2
- package/dist/npm/icons/Icon.d.ts +0 -35
- package/dist/npm/icons/Icon.js +0 -81
- package/dist/npm/icons/IconWrap.d.ts +0 -7
- package/dist/npm/icons/IconWrap.js +0 -44
- package/dist/npm/icons/IconsContext.d.ts +0 -21
- package/dist/npm/icons/IconsContext.js +0 -10
- package/dist/npm/icons/SvgIcon.d.ts +0 -71
- package/dist/npm/icons/SvgIcon.js +0 -99
- package/dist/npm/icons/constants.d.ts +0 -13
- package/dist/npm/icons/constants.js +0 -16
- package/dist/npm/icons/models/flip.d.ts +0 -11
- package/dist/npm/icons/models/flip.js +0 -2
- package/dist/npm/icons/models/size.js +0 -2
- package/dist/npm/icons/models/theme-color.d.ts +0 -21
- package/dist/npm/icons/models/theme-color.js +0 -2
- package/dist/npm/icons/utils.d.ts +0 -17
- package/dist/npm/icons/utils.js +0 -22
- package/dist/npm/keys.d.ts +0 -20
- package/dist/npm/keys.js +0 -23
- package/dist/npm/main.d.ts +0 -58
- package/dist/npm/main.js +0 -75
- package/dist/npm/memoize.d.ts +0 -10
- package/dist/npm/memoize.js +0 -45
- package/dist/npm/models/auto-scroll-options.d.ts +0 -23
- package/dist/npm/models/auto-scroll-options.js +0 -2
- package/dist/npm/models/index.d.ts +0 -5
- package/dist/npm/models/index.js +0 -21
- package/dist/npm/models/kendoReactComponentBaseProps.js +0 -2
- package/dist/npm/models/mouse.js +0 -2
- package/dist/npm/models/pointer.js +0 -2
- package/dist/npm/models/touch.d.ts +0 -17
- package/dist/npm/models/touch.js +0 -2
- package/dist/npm/navigation.js +0 -147
- package/dist/npm/noop.d.ts +0 -4
- package/dist/npm/noop.js +0 -8
- package/dist/npm/scrollbarWidth.d.ts +0 -8
- package/dist/npm/scrollbarWidth.js +0 -27
- package/dist/npm/setter.js +0 -40
- package/dist/npm/theme.d.ts +0 -8
- package/dist/npm/theme.js +0 -20
- package/dist/npm/tree-utils/FieldsService.d.ts +0 -25
- package/dist/npm/tree-utils/FieldsService.js +0 -53
- package/dist/npm/tree-utils/SortedPublicItemIds.d.ts +0 -8
- package/dist/npm/tree-utils/SortedPublicItemIds.js +0 -29
- package/dist/npm/tree-utils/itemIdUtils.d.ts +0 -60
- package/dist/npm/tree-utils/itemIdUtils.js +0 -132
- package/dist/npm/tree-utils/itemUtils.d.ts +0 -45
- package/dist/npm/tree-utils/itemUtils.js +0 -205
- package/dist/npm/tree-utils/misc.d.ts +0 -8
- package/dist/npm/tree-utils/misc.js +0 -22
- package/dist/npm/treeDataOperations.d.ts +0 -39
- package/dist/npm/treeDataOperations.js +0 -112
- package/dist/npm/typography/Typography.js +0 -269
- package/dist/npm/typography/TypographyProps.d.ts +0 -121
- package/dist/npm/typography/TypographyProps.js +0 -2
- package/dist/npm/typography/constants.js +0 -87
- package/dist/npm/typography/models/margin.d.ts +0 -23
- package/dist/npm/typography/models/margin.js +0 -2
- package/dist/npm/validate-package.d.ts +0 -8
- package/dist/npm/validate-package.js +0 -28
- package/dist/npm/watermark/WatermarkOverlay.d.ts +0 -6
- package/dist/npm/watermark/WatermarkOverlay.js +0 -90
- package/dist/systemjs/kendo-react-common.js +0 -1
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DragAndDrop = void 0;
|
|
4
|
-
var React = require("react");
|
|
5
|
-
var hooks_1 = require("../hooks");
|
|
6
|
-
var context_1 = require("./context");
|
|
7
|
-
/**
|
|
8
|
-
* The `DragAndDrop` component is required for the `droppable` functionality to work properly.
|
|
9
|
-
*
|
|
10
|
-
* It is used internally to synchronize the `drag` and `drop` functionalities.
|
|
11
|
-
* Accepts properties of type [DragAndDropProps]({% slug api_common_draganddropprops %}).
|
|
12
|
-
*/
|
|
13
|
-
var DragAndDrop = function (props) {
|
|
14
|
-
var _a = (0, hooks_1.useControlledState)(null, undefined), drag = _a[0], setDrag = _a[1];
|
|
15
|
-
var _b = (0, hooks_1.useControlledState)(null, undefined), drop = _b[0], setDrop = _b[1];
|
|
16
|
-
var _c = (0, hooks_1.useCollection)([]), drags = _c[0], dispatchDrags = _c[1];
|
|
17
|
-
var _d = (0, hooks_1.useCollection)([]), drops = _d[0], dispatchDrops = _d[1];
|
|
18
|
-
var registerDrag = function (item) {
|
|
19
|
-
dispatchDrags({
|
|
20
|
-
type: hooks_1.COLLECTION_ACTION.add,
|
|
21
|
-
item: item
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
var deregisterDrag = function (item) {
|
|
25
|
-
dispatchDrags({
|
|
26
|
-
type: hooks_1.COLLECTION_ACTION.remove,
|
|
27
|
-
item: item
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
var registerDrop = function (item) {
|
|
31
|
-
dispatchDrops({
|
|
32
|
-
type: hooks_1.COLLECTION_ACTION.add,
|
|
33
|
-
item: item
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
var deregisterDrop = function (item) {
|
|
37
|
-
dispatchDrops({
|
|
38
|
-
type: hooks_1.COLLECTION_ACTION.remove,
|
|
39
|
-
item: item
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
return (React.createElement(context_1.DragContext.Provider, { value: [drag, setDrag] },
|
|
43
|
-
React.createElement(context_1.DropContext.Provider, { value: [drop, setDrop] },
|
|
44
|
-
React.createElement(context_1.DragsContext.Provider, { value: [drags, registerDrag, deregisterDrag] },
|
|
45
|
-
React.createElement(context_1.DropsContext.Provider, { value: [drops, registerDrop, deregisterDrop] }, props.children)))));
|
|
46
|
-
};
|
|
47
|
-
exports.DragAndDrop = DragAndDrop;
|
|
48
|
-
exports.DragAndDrop.displayName = 'KendoReactDragAndDrop';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
*/
|
|
5
|
-
export interface BaseEvent<T> {
|
|
6
|
-
/**
|
|
7
|
-
* A React Synthetic Event.
|
|
8
|
-
*/
|
|
9
|
-
syntheticEvent: React.SyntheticEvent<any>;
|
|
10
|
-
/**
|
|
11
|
-
* A native DOM event.
|
|
12
|
-
*/
|
|
13
|
-
nativeEvent: any;
|
|
14
|
-
/**
|
|
15
|
-
* An event target.
|
|
16
|
-
*/
|
|
17
|
-
target: T;
|
|
18
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dispatchEvent = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
* Dispatches a new event based on an event that was already internally dispatched to KendoReact users.
|
|
7
|
-
*
|
|
8
|
-
* @param eventHandler - The public event handler that is assigned by the user.
|
|
9
|
-
* When undefined, the method is not an option.
|
|
10
|
-
* @param dispatchedEvent - The event that was already dispatched internally.
|
|
11
|
-
* @param target - The target component of the new event.
|
|
12
|
-
* @param eventData - The additional data that will be passed through the new event.
|
|
13
|
-
* When the new event has no additional data
|
|
14
|
-
* other than the `BaseEvent` arguments, pass `undefined`.
|
|
15
|
-
*/
|
|
16
|
-
function dispatchEvent(eventHandler, dispatchedEvent, target, eventData) {
|
|
17
|
-
if (eventHandler) {
|
|
18
|
-
var eventBaseData = {
|
|
19
|
-
syntheticEvent: dispatchedEvent,
|
|
20
|
-
nativeEvent: dispatchedEvent.nativeEvent,
|
|
21
|
-
target: target
|
|
22
|
-
};
|
|
23
|
-
eventHandler.call(undefined, Object.assign(eventBaseData, eventData));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.dispatchEvent = dispatchEvent;
|
package/dist/npm/fieldList.d.ts
DELETED
package/dist/npm/fieldList.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fieldList = void 0;
|
|
4
|
-
var constants_1 = require("./constants");
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
function fieldList(field) {
|
|
9
|
-
var fields = [];
|
|
10
|
-
field.replace(constants_1.FIELD_REGEX, function (_match, index, indexAccessor, fieldName) {
|
|
11
|
-
fields.push(index !== undefined ? index : (indexAccessor || fieldName));
|
|
12
|
-
});
|
|
13
|
-
return fields;
|
|
14
|
-
}
|
|
15
|
-
exports.fieldList = fieldList;
|
package/dist/npm/focus.d.ts
DELETED
package/dist/npm/focus.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.focusFirstFocusableChild = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
*/
|
|
7
|
-
var focusFirstFocusableChild = function (target) {
|
|
8
|
-
if (target) {
|
|
9
|
-
if ((target instanceof HTMLInputElement || target.tabIndex !== -1) && target.focus) {
|
|
10
|
-
target.focus();
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
var element = target.querySelector('input, [tabindex]:not([tabindex="-1"])');
|
|
14
|
-
if (element && element.focus) {
|
|
15
|
-
element.focus();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
exports.focusFirstFocusableChild = focusFirstFocusableChild;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getActiveElement = exports.getInnerActiveElement = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
*/
|
|
7
|
-
var getInnerActiveElement = function (element) {
|
|
8
|
-
var shadowRoot = element.shadowRoot;
|
|
9
|
-
var contentDocument = element.contentDocument;
|
|
10
|
-
if (shadowRoot && shadowRoot.activeElement) {
|
|
11
|
-
return (0, exports.getInnerActiveElement)(shadowRoot.activeElement);
|
|
12
|
-
}
|
|
13
|
-
if (contentDocument && contentDocument.activeElement) {
|
|
14
|
-
return (0, exports.getInnerActiveElement)(contentDocument.activeElement);
|
|
15
|
-
}
|
|
16
|
-
return element;
|
|
17
|
-
};
|
|
18
|
-
exports.getInnerActiveElement = getInnerActiveElement;
|
|
19
|
-
/**
|
|
20
|
-
* @hidden
|
|
21
|
-
*/
|
|
22
|
-
var getActiveElement = function (document) {
|
|
23
|
-
if (!document || !document.activeElement) {
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
return (0, exports.getInnerActiveElement)(document.activeElement);
|
|
27
|
-
};
|
|
28
|
-
exports.getActiveElement = getActiveElement;
|
package/dist/npm/getTabIndex.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTabIndex = void 0;
|
|
4
|
-
/* eslint-disable radix */
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
var DISABLED_TABINDEX = -1;
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
var DEFAULT_TABINDEX = 0;
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
var getTabIndex = function (tabIndex, disabled, useDefaultTabIndexWhenDisabled) {
|
|
17
|
-
var parsedTabIndex = typeof tabIndex === 'string' ? parseInt(tabIndex, undefined) : tabIndex;
|
|
18
|
-
if (parsedTabIndex === NaN) {
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
return parsedTabIndex !== undefined
|
|
22
|
-
? parsedTabIndex
|
|
23
|
-
: disabled ?
|
|
24
|
-
(useDefaultTabIndexWhenDisabled ? undefined : DISABLED_TABINDEX)
|
|
25
|
-
: DEFAULT_TABINDEX;
|
|
26
|
-
};
|
|
27
|
-
exports.getTabIndex = getTabIndex;
|
package/dist/npm/getter.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Can be used for getting value from object using field path. For example `users[index].name`.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```jsx-no-run
|
|
6
|
-
* const values = {users:[{lastName: 'Doe'}]};
|
|
7
|
-
* const firstUserLastName = getter('user[0].lastName');
|
|
8
|
-
*
|
|
9
|
-
* console.log(firstUserLastName(values))
|
|
10
|
-
*
|
|
11
|
-
* // result: 'Doe'
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export declare function getter(field: string): (values: any) => any;
|
package/dist/npm/getter.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getter = void 0;
|
|
4
|
-
var fieldList_1 = require("./fieldList");
|
|
5
|
-
var getterCache = {};
|
|
6
|
-
getterCache.undefined = function () { return undefined; };
|
|
7
|
-
/**
|
|
8
|
-
* Can be used for getting value from object using field path. For example `users[index].name`.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```jsx-no-run
|
|
12
|
-
* const values = {users:[{lastName: 'Doe'}]};
|
|
13
|
-
* const firstUserLastName = getter('user[0].lastName');
|
|
14
|
-
*
|
|
15
|
-
* console.log(firstUserLastName(values))
|
|
16
|
-
*
|
|
17
|
-
* // result: 'Doe'
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
function getter(field) {
|
|
21
|
-
if (getterCache[field]) {
|
|
22
|
-
return getterCache[field];
|
|
23
|
-
}
|
|
24
|
-
var fields = (0, fieldList_1.fieldList)(field);
|
|
25
|
-
getterCache[field] = function (obj) {
|
|
26
|
-
var result = obj;
|
|
27
|
-
for (var idx = 0; idx < fields.length && result; idx++) {
|
|
28
|
-
result = result[fields[idx]];
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
return getterCache[field];
|
|
33
|
-
}
|
|
34
|
-
exports.getter = getter;
|
package/dist/npm/guid.d.ts
DELETED
package/dist/npm/guid.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable no-bitwise */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.guid = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
var guid = function () {
|
|
9
|
-
var id = '';
|
|
10
|
-
var i;
|
|
11
|
-
var random;
|
|
12
|
-
for (i = 0; i < 32; i++) {
|
|
13
|
-
random = Math.random() * 16 | 0;
|
|
14
|
-
if (i === 8 || i === 12 || i === 16 || i === 20) {
|
|
15
|
-
id += '-';
|
|
16
|
-
}
|
|
17
|
-
id += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16);
|
|
18
|
-
}
|
|
19
|
-
return id;
|
|
20
|
-
};
|
|
21
|
-
exports.guid = guid;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasRelativeStackingContext = void 0;
|
|
4
|
-
var canUseDOM_1 = require("./canUseDOM");
|
|
5
|
-
/** @hidden */
|
|
6
|
-
var hasRelativeStackingContext = function (elementSource) {
|
|
7
|
-
if (!canUseDOM_1.canUseDOM) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
// Component need to pass element to make sure document owner is correct.
|
|
11
|
-
// This however might be performance hit if checked for example on each drag event.
|
|
12
|
-
var currentDocument = elementSource ? elementSource.ownerDocument : document;
|
|
13
|
-
if (!currentDocument || !currentDocument.body) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
var top = 10;
|
|
17
|
-
var parent = currentDocument.createElement('div');
|
|
18
|
-
parent.style.transform = 'matrix(10, 0, 0, 10, 0, 0)';
|
|
19
|
-
var child = currentDocument.createElement('div');
|
|
20
|
-
child.appendChild(currentDocument.createTextNode('child'));
|
|
21
|
-
child.style.position = 'fixed';
|
|
22
|
-
child.style.top = top + 'px';
|
|
23
|
-
parent.appendChild(child);
|
|
24
|
-
currentDocument.body.appendChild(parent);
|
|
25
|
-
var isDifferent = child.getBoundingClientRect().top !== top;
|
|
26
|
-
currentDocument.body.removeChild(parent);
|
|
27
|
-
return isDifferent;
|
|
28
|
-
};
|
|
29
|
-
exports.hasRelativeStackingContext = hasRelativeStackingContext;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.AsyncFocusBlur = void 0;
|
|
15
|
-
var React = require("react");
|
|
16
|
-
var useAsyncFocusBlur_1 = require("../hooks/useAsyncFocusBlur");
|
|
17
|
-
/**
|
|
18
|
-
* An utility High-order Component for asynchronous focus/blur handling.
|
|
19
|
-
*
|
|
20
|
-
* By default, the `onFocus` and `onBlur` callbacks are called every time a child components receives/loses focus.
|
|
21
|
-
* Use this utility HOC for scenarios where you need to know if the parent has received focus for the first time, or completely lost focus.
|
|
22
|
-
*
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
var AsyncFocusBlur = function (_a) {
|
|
26
|
-
var children = _a.children, onFocus = _a.onFocus, onBlur = _a.onBlur, onSyncFocus = _a.onSyncFocus, onSyncBlur = _a.onSyncBlur;
|
|
27
|
-
var args = (0, useAsyncFocusBlur_1.useAsyncFocusBlur)({ onFocus: onFocus, onBlur: onBlur, onSyncFocus: onSyncFocus, onSyncBlur: onSyncBlur });
|
|
28
|
-
return React.createElement(React.Fragment, null, children.call(undefined, __assign({}, args)));
|
|
29
|
-
};
|
|
30
|
-
exports.AsyncFocusBlur = AsyncFocusBlur;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.withPropsContext = exports.createPropsContext = void 0;
|
|
15
|
-
var React = require("react");
|
|
16
|
-
var usePropsContext_1 = require("../hooks/usePropsContext");
|
|
17
|
-
/** @hidden */
|
|
18
|
-
var createPropsContext = function () { return React.createContext(function (props) { return props; }); };
|
|
19
|
-
exports.createPropsContext = createPropsContext;
|
|
20
|
-
/** @hidden */
|
|
21
|
-
var withPropsContext = function (context, Component
|
|
22
|
-
// eslint-disable-next-line react/display-name
|
|
23
|
-
) { return React.forwardRef(function (props, ref) {
|
|
24
|
-
var contextProps = (0, usePropsContext_1.usePropsContext)(context, props);
|
|
25
|
-
return (React.createElement(Component, __assign({}, contextProps, { ref: ref })));
|
|
26
|
-
}); };
|
|
27
|
-
exports.withPropsContext = withPropsContext;
|
package/dist/npm/hooks/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./useMouse"), exports);
|
|
18
|
-
__exportStar(require("./useAsyncFocusBlur"), exports);
|
|
19
|
-
__exportStar(require("./useDir"), exports);
|
|
20
|
-
__exportStar(require("./useDraggable"), exports);
|
|
21
|
-
__exportStar(require("./useDroppable"), exports);
|
|
22
|
-
__exportStar(require("./useRtl"), exports);
|
|
23
|
-
__exportStar(require("./useCustomComponent"), exports);
|
|
24
|
-
__exportStar(require("./useControlledState"), exports);
|
|
25
|
-
__exportStar(require("./useInheritedState"), exports);
|
|
26
|
-
__exportStar(require("./useCollection"), exports);
|
|
27
|
-
__exportStar(require("./useDocument"), exports);
|
|
28
|
-
__exportStar(require("./useWindow"), exports);
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.useAsyncFocusBlur = void 0;
|
|
13
|
-
var React = require("react");
|
|
14
|
-
/**
|
|
15
|
-
* An utility function for asynchronous focus/blur handling.
|
|
16
|
-
*
|
|
17
|
-
* By default, the `onFocus` and `onBlur` callbacks are called every time a child components receives/loses focus.
|
|
18
|
-
* Use this utility hook for scenarios where you need to know if the parent has received focus for the first time, or completely lost focus.
|
|
19
|
-
*
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
function useAsyncFocusBlur(_a) {
|
|
23
|
-
var onFocus = _a.onFocus, onBlur = _a.onBlur, onSyncFocus = _a.onSyncFocus, onSyncBlur = _a.onSyncBlur;
|
|
24
|
-
var focused = React.useRef(false);
|
|
25
|
-
var tick = React.useRef(0);
|
|
26
|
-
var nextTick = React.useCallback(function (f) {
|
|
27
|
-
clearTimeout(tick.current);
|
|
28
|
-
tick.current = window.setTimeout(function () { return f(); });
|
|
29
|
-
}, [tick]);
|
|
30
|
-
var handleFocus = React.useCallback(function () {
|
|
31
|
-
var event = [];
|
|
32
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
33
|
-
event[_i] = arguments[_i];
|
|
34
|
-
}
|
|
35
|
-
clearTimeout(tick.current);
|
|
36
|
-
if (onSyncFocus) {
|
|
37
|
-
onSyncFocus.call(undefined, event[0]);
|
|
38
|
-
}
|
|
39
|
-
if (focused.current) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
;
|
|
43
|
-
focused.current = true;
|
|
44
|
-
if (onFocus) {
|
|
45
|
-
onFocus.call.apply(onFocus, __spreadArray([undefined], event, false));
|
|
46
|
-
}
|
|
47
|
-
}, [focused, onFocus, onSyncFocus]);
|
|
48
|
-
var handleBlur = React.useCallback(function () {
|
|
49
|
-
var event = [];
|
|
50
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
51
|
-
event[_i] = arguments[_i];
|
|
52
|
-
}
|
|
53
|
-
if (onSyncBlur) {
|
|
54
|
-
onSyncBlur.call(undefined, event[0]);
|
|
55
|
-
}
|
|
56
|
-
nextTick(function () {
|
|
57
|
-
if (!focused.current) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (onBlur) {
|
|
61
|
-
focused.current = false;
|
|
62
|
-
onBlur.call.apply(onBlur, __spreadArray([undefined], event, false));
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}, [focused, nextTick, onBlur, onSyncBlur]);
|
|
66
|
-
React.useEffect(function () {
|
|
67
|
-
return function () {
|
|
68
|
-
clearTimeout(tick.current);
|
|
69
|
-
};
|
|
70
|
-
}, []);
|
|
71
|
-
return {
|
|
72
|
-
onFocus: handleFocus,
|
|
73
|
-
onBlur: handleBlur
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
exports.useAsyncFocusBlur = useAsyncFocusBlur;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** @hidden */
|
|
2
|
-
export declare enum COLLECTION_ACTION {
|
|
3
|
-
add = 0,
|
|
4
|
-
remove = 1
|
|
5
|
-
}
|
|
6
|
-
/** @hidden */
|
|
7
|
-
export declare type Collection<T> = T[];
|
|
8
|
-
/** @hidden */
|
|
9
|
-
export interface CollectionAction<T> {
|
|
10
|
-
type: COLLECTION_ACTION;
|
|
11
|
-
item: T;
|
|
12
|
-
}
|
|
13
|
-
/** @hidden */
|
|
14
|
-
export declare const useCollection: <T extends unknown>(initial?: T[]) => [T[], (event: CollectionAction<T>) => void];
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCollection = exports.COLLECTION_ACTION = void 0;
|
|
4
|
-
var React = require("react");
|
|
5
|
-
/** @hidden */
|
|
6
|
-
var COLLECTION_ACTION;
|
|
7
|
-
(function (COLLECTION_ACTION) {
|
|
8
|
-
COLLECTION_ACTION[COLLECTION_ACTION["add"] = 0] = "add";
|
|
9
|
-
COLLECTION_ACTION[COLLECTION_ACTION["remove"] = 1] = "remove";
|
|
10
|
-
})(COLLECTION_ACTION = exports.COLLECTION_ACTION || (exports.COLLECTION_ACTION = {}));
|
|
11
|
-
/** @hidden */
|
|
12
|
-
var useCollection = function (initial) {
|
|
13
|
-
if (initial === void 0) { initial = []; }
|
|
14
|
-
var collection = React.useRef(initial);
|
|
15
|
-
var handleCollectionAction = React.useCallback(function (action) {
|
|
16
|
-
switch (action.type) {
|
|
17
|
-
case COLLECTION_ACTION.add:
|
|
18
|
-
collection.current.push(action.item);
|
|
19
|
-
break;
|
|
20
|
-
case COLLECTION_ACTION.remove:
|
|
21
|
-
var index = collection.current.indexOf(action.item);
|
|
22
|
-
collection.current.splice(index, 1);
|
|
23
|
-
break;
|
|
24
|
-
default:
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
}, []);
|
|
28
|
-
return [collection.current, handleCollectionAction];
|
|
29
|
-
};
|
|
30
|
-
exports.useCollection = useCollection;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/** @hidden */
|
|
2
|
-
export declare type ControlledStateHook<T, A = any> = [
|
|
3
|
-
T,
|
|
4
|
-
(value: T, args?: A) => void
|
|
5
|
-
];
|
|
6
|
-
/** @hidden */
|
|
7
|
-
export declare const useControlledState: <T = any, A = any>(defaultProp: T, prop?: T | undefined, callback?: any) => ControlledStateHook<T, any>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.useControlledState = void 0;
|
|
15
|
-
var React = require("react");
|
|
16
|
-
/** @hidden */
|
|
17
|
-
var useControlledState = function (defaultProp, prop, callback) {
|
|
18
|
-
var _a = React.useState(prop || defaultProp), state = _a[0], setState = _a[1];
|
|
19
|
-
var handleSetEdit = React.useCallback(function (value, args) {
|
|
20
|
-
setState(value);
|
|
21
|
-
if (callback) {
|
|
22
|
-
callback.call(undefined, __assign(__assign({}, args), { value: value }));
|
|
23
|
-
}
|
|
24
|
-
}, [callback, setState]);
|
|
25
|
-
return [prop !== undefined ? prop : state, handleSetEdit];
|
|
26
|
-
};
|
|
27
|
-
exports.useControlledState = useControlledState;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
*/
|
|
5
|
-
export declare type CustomComponent<P extends any> = React.ComponentType<P & {
|
|
6
|
-
ref?: React.Ref<any>;
|
|
7
|
-
}>;
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
export declare const useCustomComponent: <P = {}>(comp: CustomComponent<P>) => [React.ComponentType<P & {
|
|
12
|
-
ref?: React.Ref<any> | undefined;
|
|
13
|
-
}>, Partial<P>];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCustomComponent = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
*/
|
|
7
|
-
var useCustomComponent = function (comp) {
|
|
8
|
-
/* if(React.isValidElement<P>(comp)) {
|
|
9
|
-
return [comp.type, comp.props];
|
|
10
|
-
} */
|
|
11
|
-
return [comp, {}];
|
|
12
|
-
};
|
|
13
|
-
exports.useCustomComponent = useCustomComponent;
|
package/dist/npm/hooks/useDir.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useDir = void 0;
|
|
4
|
-
var React = require("react");
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
function useDir(elementRef, initialDir, args) {
|
|
9
|
-
// Dir prop is read only on initial rendering due to specifics of getComputedStyles - see below
|
|
10
|
-
var _a = React.useState(initialDir), dir = _a[0], setDir = _a[1];
|
|
11
|
-
React.useEffect(function () {
|
|
12
|
-
if (!dir && window && elementRef.current) {
|
|
13
|
-
// Note: getComputedStyle forces reflow
|
|
14
|
-
var rtlCandidate = window.getComputedStyle(elementRef.current).direction;
|
|
15
|
-
if (rtlCandidate) {
|
|
16
|
-
// rerender is needed as DOM is read after first render
|
|
17
|
-
setDir(rtlCandidate);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}, args);
|
|
21
|
-
return dir;
|
|
22
|
-
}
|
|
23
|
-
exports.useDir = useDir;
|