@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
package/dist/es/navigation.js
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @hidden
|
|
3
|
-
*/
|
|
4
|
-
export var FOCUSABLE_ELEMENTS = [
|
|
5
|
-
'input:not([disabled]):not([type=hidden])',
|
|
6
|
-
'select:not([disabled])',
|
|
7
|
-
'textarea:not([disabled])',
|
|
8
|
-
'button:not([disabled])',
|
|
9
|
-
'a[href]',
|
|
10
|
-
'area[href]',
|
|
11
|
-
'summary',
|
|
12
|
-
'iframe',
|
|
13
|
-
'object',
|
|
14
|
-
'embed',
|
|
15
|
-
'audio[controls]',
|
|
16
|
-
'video[controls]',
|
|
17
|
-
'[contenteditable]'
|
|
18
|
-
];
|
|
19
|
-
/**
|
|
20
|
-
* Represents the [KendoReact Navigation functionality]({% slug overview_navigation %}).
|
|
21
|
-
* It handles the navigation through a collection of DOM elements.
|
|
22
|
-
*/
|
|
23
|
-
var Navigation = /** @class */ (function () {
|
|
24
|
-
function Navigation(options) {
|
|
25
|
-
var _this = this;
|
|
26
|
-
/**
|
|
27
|
-
* @hidden
|
|
28
|
-
*/
|
|
29
|
-
this.rovingTabIndex = true;
|
|
30
|
-
/**
|
|
31
|
-
* @hidden
|
|
32
|
-
*/
|
|
33
|
-
this.update = function () { };
|
|
34
|
-
this.focusNextIndex = function (target, indexDiff) {
|
|
35
|
-
var all = _this.elements;
|
|
36
|
-
var index = all.indexOf(target) + indexDiff;
|
|
37
|
-
index = index < 0 ? all.length - 1 : index;
|
|
38
|
-
var next = all[index % all.length];
|
|
39
|
-
_this.focusElement(next, target);
|
|
40
|
-
return next;
|
|
41
|
-
};
|
|
42
|
-
this.tabIndex = options.tabIndex || 0;
|
|
43
|
-
this.root = options.root;
|
|
44
|
-
this.selectors = options.selectors;
|
|
45
|
-
this.focusOptions = options.focusOptions || { preventScroll: true };
|
|
46
|
-
this.rovingTabIndex = options.rovingTabIndex !== undefined ? options.rovingTabIndex : true;
|
|
47
|
-
this.mouseEvents = options.mouseEvents || {};
|
|
48
|
-
this.keyboardEvents = options.keyboardEvents || {};
|
|
49
|
-
}
|
|
50
|
-
Object.defineProperty(Navigation.prototype, "elements", {
|
|
51
|
-
/**
|
|
52
|
-
* Returns the collection of DOM elements which the module will navigate in.
|
|
53
|
-
*/
|
|
54
|
-
get: function () {
|
|
55
|
-
return this.root.current ? Array.from(this.root.current.querySelectorAll(this.selectors.join(','))) : [];
|
|
56
|
-
},
|
|
57
|
-
enumerable: false,
|
|
58
|
-
configurable: true
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(Navigation.prototype, "first", {
|
|
61
|
-
/**
|
|
62
|
-
* Returns the first navigation DOM element.
|
|
63
|
-
*/
|
|
64
|
-
get: function () {
|
|
65
|
-
return (this.root.current && this.root.current.querySelector(this.selectors.join(','))) || null;
|
|
66
|
-
},
|
|
67
|
-
enumerable: false,
|
|
68
|
-
configurable: true
|
|
69
|
-
});
|
|
70
|
-
Object.defineProperty(Navigation.prototype, "last", {
|
|
71
|
-
/**
|
|
72
|
-
* Returns the last navigation DOM element.
|
|
73
|
-
*/
|
|
74
|
-
get: function () {
|
|
75
|
-
var all = this.elements;
|
|
76
|
-
return all[all.length - 1] || null;
|
|
77
|
-
},
|
|
78
|
-
enumerable: false,
|
|
79
|
-
configurable: true
|
|
80
|
-
});
|
|
81
|
-
Object.defineProperty(Navigation.prototype, "current", {
|
|
82
|
-
/**
|
|
83
|
-
* Returns the focused DOM element from the navigation collection of DOM elements.
|
|
84
|
-
*/
|
|
85
|
-
get: function () {
|
|
86
|
-
return this.elements.find(function (el) { return el.matches(':focus'); }) || null;
|
|
87
|
-
},
|
|
88
|
-
enumerable: false,
|
|
89
|
-
configurable: true
|
|
90
|
-
});
|
|
91
|
-
/**
|
|
92
|
-
* Focuses the next element from the navigation collection of DOM elements.
|
|
93
|
-
*/
|
|
94
|
-
Navigation.prototype.focusNext = function (target) {
|
|
95
|
-
return this.focusNextIndex(target, 1);
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* Focuses the previous element from the navigation collection of DOM elements.
|
|
99
|
-
*/
|
|
100
|
-
Navigation.prototype.focusPrevious = function (target) {
|
|
101
|
-
return this.focusNextIndex(target, -1);
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* The keyboard events handler.
|
|
105
|
-
*/
|
|
106
|
-
Navigation.prototype.triggerKeyboardEvent = function (ev, options) {
|
|
107
|
-
var target = ev.target instanceof Element && ev.target.closest(this.selectors.join(','));
|
|
108
|
-
var key = ev.key === ' ' ? 'Space' : ev.key;
|
|
109
|
-
var eventType = ev.nativeEvent.type;
|
|
110
|
-
if (target && this.keyboardEvents[eventType][key]) {
|
|
111
|
-
this.keyboardEvents[eventType][key].call(undefined, target, this, ev, options);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* The mouse events handler.
|
|
116
|
-
*/
|
|
117
|
-
Navigation.prototype.triggerMouseEvent = function (ev) {
|
|
118
|
-
var target = ev.target instanceof Element && ev.target.closest(this.selectors.join(','));
|
|
119
|
-
var eventType = ev.nativeEvent.type;
|
|
120
|
-
if (target) {
|
|
121
|
-
this.mouseEvents[eventType].call(undefined, target, this, ev);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
/**
|
|
125
|
-
* Focuses the passed element from the navigation collection of DOM elements.
|
|
126
|
-
*/
|
|
127
|
-
Navigation.prototype.focusElement = function (element, previous) {
|
|
128
|
-
if (element) {
|
|
129
|
-
if (previous) {
|
|
130
|
-
if (this.rovingTabIndex) {
|
|
131
|
-
previous.removeAttribute('tabindex');
|
|
132
|
-
}
|
|
133
|
-
previous.classList.remove('k-focus');
|
|
134
|
-
}
|
|
135
|
-
if (this.rovingTabIndex) {
|
|
136
|
-
element.setAttribute('tabindex', String(this.tabIndex));
|
|
137
|
-
}
|
|
138
|
-
element.focus(this.focusOptions);
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
return Navigation;
|
|
142
|
-
}());
|
|
143
|
-
export { Navigation };
|
|
144
|
-
;
|
package/dist/es/noop.d.ts
DELETED
package/dist/es/noop.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { BrowserSupportService } from './browser-support.service';
|
|
2
|
-
import { canUseDOM } from './canUseDOM';
|
|
3
|
-
/**
|
|
4
|
-
* @hidden
|
|
5
|
-
*/
|
|
6
|
-
export var getScrollbarWidth = function () {
|
|
7
|
-
if (!canUseDOM || !document.body) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
var scrollbarWidth = new BrowserSupportService().scrollbarWidth;
|
|
11
|
-
return scrollbarWidth;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
export var setScrollbarWidth = function () {
|
|
17
|
-
if (!canUseDOM || !document.body) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
var scrollbarWidth = new BrowserSupportService().scrollbarWidth;
|
|
21
|
-
document.body.style.setProperty('--kendo-scrollbar-width', "".concat(scrollbarWidth, "px"));
|
|
22
|
-
};
|
package/dist/es/setter.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Can be used for setting value to object using field path. For example `users[index].name`.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```jsx-no-run
|
|
6
|
-
* const values = {users:[{lastName: 'Doe'}]};
|
|
7
|
-
* const firstUserFirstName = setter('user[0].firstName');
|
|
8
|
-
*
|
|
9
|
-
* firstUserFirstName(values, 'John');
|
|
10
|
-
*
|
|
11
|
-
* console.log(values)
|
|
12
|
-
*
|
|
13
|
-
* // result: {users:[{firstName: 'John', lastName: 'Doe'}]}
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export declare function setter(field: string): any;
|
package/dist/es/setter.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { fieldList } from './fieldList';
|
|
2
|
-
var setterCache = {};
|
|
3
|
-
setterCache.undefined = function (obj) { return obj; };
|
|
4
|
-
var defaultValue = function (nextField, options) {
|
|
5
|
-
return options && options.arrays && !isNaN(Number(nextField)) ? [] : {};
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Can be used for setting value to object using field path. For example `users[index].name`.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```jsx-no-run
|
|
12
|
-
* const values = {users:[{lastName: 'Doe'}]};
|
|
13
|
-
* const firstUserFirstName = setter('user[0].firstName');
|
|
14
|
-
*
|
|
15
|
-
* firstUserFirstName(values, 'John');
|
|
16
|
-
*
|
|
17
|
-
* console.log(values)
|
|
18
|
-
*
|
|
19
|
-
* // result: {users:[{firstName: 'John', lastName: 'Doe'}]}
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export function setter(field) {
|
|
23
|
-
if (setterCache[field]) {
|
|
24
|
-
return setterCache[field];
|
|
25
|
-
}
|
|
26
|
-
var fields = fieldList(field);
|
|
27
|
-
setterCache[field] = function (obj, value, options) {
|
|
28
|
-
var root = obj;
|
|
29
|
-
var depth = fields.length - 1;
|
|
30
|
-
for (var idx = 0; idx < depth && root; idx++) {
|
|
31
|
-
root = root[fields[idx]] = root[fields[idx]] || defaultValue(fields[idx + 1], options);
|
|
32
|
-
}
|
|
33
|
-
root[fields[depth]] = value;
|
|
34
|
-
};
|
|
35
|
-
return setterCache[field];
|
|
36
|
-
}
|
package/dist/es/theme.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** @hidden */
|
|
2
|
-
export interface KendoThemeMaps {
|
|
3
|
-
sizeMap: Record<Exclude<any, null>, String>;
|
|
4
|
-
roundedMap: Record<Exclude<any, null>, String>;
|
|
5
|
-
orientationMap: Record<Exclude<any, null>, String>;
|
|
6
|
-
}
|
|
7
|
-
/** @hidden */
|
|
8
|
-
export declare const kendoThemeMaps: KendoThemeMaps;
|
package/dist/es/theme.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** @hidden */
|
|
2
|
-
export var kendoThemeMaps = {
|
|
3
|
-
sizeMap: {
|
|
4
|
-
small: 'sm',
|
|
5
|
-
medium: 'md',
|
|
6
|
-
large: 'lg'
|
|
7
|
-
},
|
|
8
|
-
roundedMap: {
|
|
9
|
-
small: 'sm',
|
|
10
|
-
medium: 'md',
|
|
11
|
-
large: 'lg'
|
|
12
|
-
},
|
|
13
|
-
orientationMap: {
|
|
14
|
-
vertical: 'vstack',
|
|
15
|
-
horizontal: 'hstack'
|
|
16
|
-
}
|
|
17
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { getNestedValue } from './misc';
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
*/
|
|
5
|
-
var TreeFieldsService = /** @class */ (function () {
|
|
6
|
-
function TreeFieldsService(treeViewProps) {
|
|
7
|
-
this.expandField = treeViewProps.expandField;
|
|
8
|
-
this.selectField = treeViewProps.selectField;
|
|
9
|
-
this.hasChildrenField = treeViewProps.hasChildrenField;
|
|
10
|
-
this.childrenField = treeViewProps.childrenField;
|
|
11
|
-
this.textField = treeViewProps.textField;
|
|
12
|
-
this.disableField = treeViewProps.disableField;
|
|
13
|
-
this.checkField = treeViewProps.checkField;
|
|
14
|
-
this.checkIndeterminateField = treeViewProps.checkIndeterminateField;
|
|
15
|
-
this.focusIdField = treeViewProps.focusIdField;
|
|
16
|
-
}
|
|
17
|
-
TreeFieldsService.prototype.expanded = function (item) {
|
|
18
|
-
return getNestedValue(this.expandField, item);
|
|
19
|
-
};
|
|
20
|
-
TreeFieldsService.prototype.selected = function (item) {
|
|
21
|
-
return getNestedValue(this.selectField, item);
|
|
22
|
-
};
|
|
23
|
-
TreeFieldsService.prototype.text = function (item) {
|
|
24
|
-
return getNestedValue(this.textField, item);
|
|
25
|
-
};
|
|
26
|
-
TreeFieldsService.prototype.disabled = function (item) {
|
|
27
|
-
return getNestedValue(this.disableField, item);
|
|
28
|
-
};
|
|
29
|
-
TreeFieldsService.prototype.hasChildren = function (item) {
|
|
30
|
-
return getNestedValue(this.hasChildrenField, item);
|
|
31
|
-
};
|
|
32
|
-
TreeFieldsService.prototype.children = function (item) {
|
|
33
|
-
var children = getNestedValue(this.childrenField, item);
|
|
34
|
-
return children ? children : [];
|
|
35
|
-
};
|
|
36
|
-
TreeFieldsService.prototype.checked = function (item) {
|
|
37
|
-
return getNestedValue(this.checkField, item);
|
|
38
|
-
};
|
|
39
|
-
TreeFieldsService.prototype.checkIndeterminate = function (item) {
|
|
40
|
-
return getNestedValue(this.checkIndeterminateField, item);
|
|
41
|
-
};
|
|
42
|
-
TreeFieldsService.prototype.focusId = function (item) {
|
|
43
|
-
return this.focusIdField && getNestedValue(this.focusIdField, item);
|
|
44
|
-
};
|
|
45
|
-
TreeFieldsService.prototype.getChildrenField = function () {
|
|
46
|
-
return this.childrenField;
|
|
47
|
-
};
|
|
48
|
-
return TreeFieldsService;
|
|
49
|
-
}());
|
|
50
|
-
export { TreeFieldsService };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
var PROPS_COUNT_LIMIT = 50000;
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
*/
|
|
5
|
-
// An alternative is to use array.sort() and
|
|
6
|
-
// implement a binary search function.
|
|
7
|
-
var SortedPublicItemIds = /** @class */ (function () {
|
|
8
|
-
function SortedPublicItemIds() {
|
|
9
|
-
this.objects = [];
|
|
10
|
-
}
|
|
11
|
-
SortedPublicItemIds.prototype.init = function (publicItemIds) {
|
|
12
|
-
var currentObj;
|
|
13
|
-
for (var i = 0; i < publicItemIds.length; i++) {
|
|
14
|
-
if (i % PROPS_COUNT_LIMIT === 0) {
|
|
15
|
-
currentObj = {};
|
|
16
|
-
this.objects.push(currentObj);
|
|
17
|
-
}
|
|
18
|
-
currentObj[publicItemIds[i]] = true;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
SortedPublicItemIds.prototype.hasId = function (publicItemId) {
|
|
22
|
-
return this.objects.some(function (obj) { return obj[publicItemId]; });
|
|
23
|
-
};
|
|
24
|
-
return SortedPublicItemIds;
|
|
25
|
-
}());
|
|
26
|
-
export { SortedPublicItemIds };
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @hidden
|
|
3
|
-
*/
|
|
4
|
-
export var EMPTY_ID = '';
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
export var ZERO_LEVEL_ZERO_NODE_ID = '0';
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
export var SEPARATOR = '_';
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
export function getItemById(itemId, items, childrenField) {
|
|
17
|
-
if (isIdZeroLevel(itemId)) {
|
|
18
|
-
return items[Number(itemId)];
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
var rootParentItem = items[Number(getRootParentId(itemId))];
|
|
22
|
-
var subItems = (rootParentItem && rootParentItem[childrenField]) || [];
|
|
23
|
-
return subItems.length ?
|
|
24
|
-
getItemById(getIdWithoutRootParentId(itemId), subItems, childrenField) : undefined;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @hidden
|
|
29
|
-
*/
|
|
30
|
-
export function getRootParentId(itemId) {
|
|
31
|
-
return isIdEmptyOrZeroLevel(itemId) ? itemId : itemId.split(SEPARATOR)[0];
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
|
-
export function getIdWithoutRootParentId(itemId) {
|
|
37
|
-
if (isIdEmptyOrZeroLevel(itemId)) {
|
|
38
|
-
return itemId;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
var firstSeparatorIndex = itemId.indexOf(SEPARATOR);
|
|
42
|
-
return itemId.substring(firstSeparatorIndex + 1);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* @hidden
|
|
47
|
-
*/
|
|
48
|
-
export function getFirstChildId(itemId) {
|
|
49
|
-
return createId('0', itemId);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* @hidden
|
|
53
|
-
*/
|
|
54
|
-
export function createId(childId, parentId) {
|
|
55
|
-
childId = childId.toString();
|
|
56
|
-
return parentId ? parentId + SEPARATOR + childId : childId;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* @hidden
|
|
60
|
-
*/
|
|
61
|
-
export function getDirectParentId(itemId) {
|
|
62
|
-
var lastSeparatorIndex = itemId.lastIndexOf(SEPARATOR);
|
|
63
|
-
return lastSeparatorIndex < 0 ? EMPTY_ID : itemId.substring(0, lastSeparatorIndex);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* @hidden
|
|
67
|
-
*/
|
|
68
|
-
export function isIdEmptyOrZeroLevel(itemId) {
|
|
69
|
-
return itemId === EMPTY_ID || itemId.indexOf(SEPARATOR) < 0;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* @hidden
|
|
73
|
-
*/
|
|
74
|
-
export function isIdZeroLevel(itemId) {
|
|
75
|
-
return itemId !== EMPTY_ID && itemId.indexOf(SEPARATOR) < 0;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* @hidden
|
|
79
|
-
*/
|
|
80
|
-
export function getAllShortIds(itemId) {
|
|
81
|
-
return itemId.split(SEPARATOR);
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* @hidden
|
|
85
|
-
*/
|
|
86
|
-
export function getShortId(itemId) {
|
|
87
|
-
var lastSeparatorIndex = itemId.lastIndexOf(SEPARATOR);
|
|
88
|
-
return lastSeparatorIndex < 0 ? itemId : itemId.substring(lastSeparatorIndex + 1);
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* @hidden
|
|
92
|
-
*/
|
|
93
|
-
export function isItemFirstFromSiblings(itemId) {
|
|
94
|
-
return getShortId(itemId) === ZERO_LEVEL_ZERO_NODE_ID;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* @hidden
|
|
98
|
-
*/
|
|
99
|
-
export function getDecrementedItemIdAfterRemoval(removedItemId, itemId) {
|
|
100
|
-
var preservedItemId = itemId;
|
|
101
|
-
removedItemId = 'r' + SEPARATOR + removedItemId;
|
|
102
|
-
itemId = 'r' + SEPARATOR + itemId;
|
|
103
|
-
var itemSharedPath = getDirectParentId(removedItemId) + SEPARATOR;
|
|
104
|
-
if (itemId.startsWith(itemSharedPath)) {
|
|
105
|
-
var itemNotSharedPath = itemId.substring(itemSharedPath.length);
|
|
106
|
-
if (itemNotSharedPath) {
|
|
107
|
-
var siblingShortId = getRootParentId(itemNotSharedPath);
|
|
108
|
-
if (Number(getShortId(removedItemId)) < Number(siblingShortId)) {
|
|
109
|
-
var decrementedId = itemSharedPath +
|
|
110
|
-
(Number(siblingShortId) - 1).toString() +
|
|
111
|
-
itemNotSharedPath.substring(siblingShortId.length);
|
|
112
|
-
return getIdWithoutRootParentId(decrementedId);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return preservedItemId;
|
|
117
|
-
}
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { EMPTY_ID, isIdZeroLevel, createId, getRootParentId, getIdWithoutRootParentId, getAllShortIds } from './itemIdUtils';
|
|
13
|
-
import { SortedPublicItemIds } from './SortedPublicItemIds';
|
|
14
|
-
import { getNestedValue } from './misc';
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*/
|
|
18
|
-
export function hasChildren(item, childrenField) {
|
|
19
|
-
var children = getNestedValue(childrenField, item);
|
|
20
|
-
return Boolean(children && children.length);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* @hidden
|
|
24
|
-
*/
|
|
25
|
-
export function isItemExpandedAndWithChildren(item, fieldsSvc) {
|
|
26
|
-
return fieldsSvc.expanded(item) && hasChildren(item, fieldsSvc.getChildrenField());
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* @hidden
|
|
30
|
-
*/
|
|
31
|
-
export function resolveItemId(publicId, idField, items, childrenField) {
|
|
32
|
-
var resolvedIds = resolveItemsIds([publicId], idField, items, childrenField);
|
|
33
|
-
return resolvedIds.length ? resolvedIds[0] : undefined;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @hidden
|
|
37
|
-
*/
|
|
38
|
-
export function resolveItemsIds(publicIds, idField, items, childrenField) {
|
|
39
|
-
var result = [];
|
|
40
|
-
var sortedIds = new SortedPublicItemIds();
|
|
41
|
-
sortedIds.init(publicIds);
|
|
42
|
-
resolveItemsIdsHelper(sortedIds, idField, items, EMPTY_ID, result, childrenField);
|
|
43
|
-
return result;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* @hidden
|
|
47
|
-
*/
|
|
48
|
-
export function updateItem(items, itemId, update, cloneField, childrenField) {
|
|
49
|
-
var _a;
|
|
50
|
-
var itemIndex = Number(getRootParentId(itemId));
|
|
51
|
-
if (itemIndex >= items.length) {
|
|
52
|
-
return items;
|
|
53
|
-
}
|
|
54
|
-
var result = items;
|
|
55
|
-
var item = items[itemIndex];
|
|
56
|
-
// Clone the item before updating it.
|
|
57
|
-
if (!item[cloneField]) {
|
|
58
|
-
result = items.slice();
|
|
59
|
-
item = result[itemIndex] = Object.assign({}, item, (_a = {}, _a[cloneField] = true, _a));
|
|
60
|
-
}
|
|
61
|
-
// Directly update the item.
|
|
62
|
-
if (isIdZeroLevel(itemId)) {
|
|
63
|
-
update(item);
|
|
64
|
-
}
|
|
65
|
-
else if (item[childrenField]) {
|
|
66
|
-
item[childrenField] = updateItem(item[childrenField], getIdWithoutRootParentId(itemId), update, cloneField, childrenField);
|
|
67
|
-
}
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* @hidden
|
|
72
|
-
*/
|
|
73
|
-
export function isEnabledAndAllParentsEnabled(itemId, items, fieldsSvc) {
|
|
74
|
-
var ids = getAllShortIds(itemId);
|
|
75
|
-
var currentItems = items;
|
|
76
|
-
for (var i = 0; i < ids.length; i++) {
|
|
77
|
-
var currentItem = currentItems[Number(ids[i])];
|
|
78
|
-
if (fieldsSvc.disabled(currentItem)) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
currentItems = currentItem[fieldsSvc.getChildrenField()];
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* @hidden
|
|
89
|
-
*/
|
|
90
|
-
export function getAllDirectIndirectChildrenIds(item, itemId, childrenField, idField) {
|
|
91
|
-
return idField ? getChildrenPublicIds(item) : getChildrenHierarchicalIndices(item, itemId);
|
|
92
|
-
function getChildrenHierarchicalIndices(startItem, startItemId) {
|
|
93
|
-
var result = [];
|
|
94
|
-
var children = startItem[childrenField] || [];
|
|
95
|
-
for (var i = 0; i < children.length; i++) {
|
|
96
|
-
var id = createId(i, startItemId);
|
|
97
|
-
result.push(id);
|
|
98
|
-
result = result.concat(getChildrenHierarchicalIndices(children[i], id));
|
|
99
|
-
}
|
|
100
|
-
return result;
|
|
101
|
-
}
|
|
102
|
-
function getChildrenPublicIds(startItem) {
|
|
103
|
-
var result = [];
|
|
104
|
-
var children = startItem[childrenField] || [];
|
|
105
|
-
for (var i = 0; i < children.length; i++) {
|
|
106
|
-
result.push(getNestedValue(idField, children[i]));
|
|
107
|
-
result = result.concat(getChildrenPublicIds(children[i]));
|
|
108
|
-
}
|
|
109
|
-
return result;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* @hidden
|
|
114
|
-
*/
|
|
115
|
-
export function areAllDirectChildrenChecked(item, itemId, idField, childrenField, check) {
|
|
116
|
-
var children = item[childrenField] || [];
|
|
117
|
-
return children.every(function (child, index) {
|
|
118
|
-
return check.indexOf(idField ? getNestedValue(idField, child) : createId(index, itemId)) > -1;
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* @hidden
|
|
123
|
-
*/
|
|
124
|
-
export function getAllParents(itemId, childrenField, items) {
|
|
125
|
-
var result = [];
|
|
126
|
-
var ids = getAllShortIds(itemId);
|
|
127
|
-
var currentItems = items;
|
|
128
|
-
for (var i = 0; i < ids.length - 1; i++) {
|
|
129
|
-
if (!currentItems) {
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
var currentItem = currentItems[Number(ids[i])];
|
|
133
|
-
result.push(currentItem);
|
|
134
|
-
currentItems = currentItem[childrenField];
|
|
135
|
-
}
|
|
136
|
-
return result;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* @hidden
|
|
140
|
-
*/
|
|
141
|
-
export function removeItem(itemId, childrenField, items) {
|
|
142
|
-
var result = items.slice();
|
|
143
|
-
if (isIdZeroLevel(itemId)) {
|
|
144
|
-
result.splice(Number(itemId), 1);
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
var rootParentIndex = Number(getRootParentId(itemId));
|
|
148
|
-
var rootParent = result[rootParentIndex] = __assign({}, result[rootParentIndex]);
|
|
149
|
-
rootParent[childrenField] = removeItem(getIdWithoutRootParentId(itemId), childrenField, rootParent[childrenField]);
|
|
150
|
-
}
|
|
151
|
-
return result;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* @hidden
|
|
155
|
-
*/
|
|
156
|
-
export function addItem(item, operation, childrenField, targetItemId, items) {
|
|
157
|
-
var result = items.slice();
|
|
158
|
-
if (isIdZeroLevel(targetItemId)) {
|
|
159
|
-
if (operation === 'child') {
|
|
160
|
-
var targetItem = result[Number(targetItemId)] = __assign({}, result[Number(targetItemId)]);
|
|
161
|
-
if (targetItem[childrenField]) {
|
|
162
|
-
targetItem[childrenField] = targetItem[childrenField].slice();
|
|
163
|
-
targetItem[childrenField].push(item);
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
targetItem[childrenField] = [item];
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
result.splice(Number(targetItemId) + (operation === 'after' ? 1 : 0), 0, item);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
var rootParentIndex = Number(getRootParentId(targetItemId));
|
|
175
|
-
var rootParent = result[rootParentIndex] = __assign({}, result[rootParentIndex]);
|
|
176
|
-
rootParent[childrenField] = addItem(item, operation, childrenField, getIdWithoutRootParentId(targetItemId), rootParent[childrenField]);
|
|
177
|
-
}
|
|
178
|
-
return result;
|
|
179
|
-
}
|
|
180
|
-
function resolveItemsIdsHelper(publicItemIds, idField, items, parentItemId, resolvedIds, childrenField) {
|
|
181
|
-
for (var i = 0; i < items.length; i++) {
|
|
182
|
-
var item = items[i];
|
|
183
|
-
var id = createId(i, parentItemId);
|
|
184
|
-
if (publicItemIds.hasId(getNestedValue(idField, item))) {
|
|
185
|
-
resolvedIds.push(id);
|
|
186
|
-
}
|
|
187
|
-
if (hasChildren(item, childrenField)) {
|
|
188
|
-
resolveItemsIdsHelper(publicItemIds, idField, getNestedValue(childrenField, item), id, resolvedIds, childrenField);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @hidden
|
|
3
|
-
*/
|
|
4
|
-
export function getNestedValue(fieldName, dataItem) {
|
|
5
|
-
var path = (fieldName || '').split('.');
|
|
6
|
-
var data = dataItem;
|
|
7
|
-
path.forEach(function (p) {
|
|
8
|
-
data = data ? data[p] : undefined;
|
|
9
|
-
});
|
|
10
|
-
return data;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @hidden
|
|
14
|
-
*/
|
|
15
|
-
export function isArray(operation) {
|
|
16
|
-
return operation.length !== undefined;
|
|
17
|
-
}
|