@progress/kendo-vue-layout 3.1.1 → 3.1.3-dev.202203311441
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-vue-layout.js +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/panelbar/PanelBar.d.ts +40 -0
- package/dist/es/panelbar/PanelBar.js +329 -0
- package/dist/es/panelbar/PanelBarItem.d.ts +35 -0
- package/dist/es/panelbar/PanelBarItem.js +219 -0
- package/dist/es/panelbar/interfaces/NavigationAction.d.ts +8 -0
- package/dist/es/panelbar/interfaces/NavigationAction.js +9 -0
- package/dist/es/panelbar/interfaces/PanelBarItemClickEventArguments.d.ts +7 -0
- package/dist/es/panelbar/interfaces/PanelBarItemClickEventArguments.js +0 -0
- package/dist/es/panelbar/interfaces/PanelBarItemProps.d.ts +85 -0
- package/dist/es/panelbar/interfaces/PanelBarItemProps.js +0 -0
- package/dist/es/panelbar/interfaces/PanelBarProps.d.ts +54 -0
- package/dist/es/panelbar/interfaces/PanelBarProps.js +0 -0
- package/dist/es/panelbar/interfaces/PanelBarSelectEventArguments.d.ts +13 -0
- package/dist/es/panelbar/interfaces/PanelBarSelectEventArguments.js +0 -0
- package/dist/es/panelbar/interfaces/RenderPanelBarItem.d.ts +14 -0
- package/dist/es/panelbar/interfaces/RenderPanelBarItem.js +0 -0
- package/dist/es/panelbar/util.d.ts +49 -0
- package/dist/es/panelbar/util.js +246 -0
- package/dist/es/splitter/Splitter.d.ts +86 -0
- package/dist/es/splitter/Splitter.js +439 -0
- package/dist/es/splitter/SplitterBar.d.ts +50 -0
- package/dist/es/splitter/SplitterBar.js +231 -0
- package/dist/es/splitter/SplitterPane.d.ts +109 -0
- package/dist/es/splitter/SplitterPane.js +65 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/panelbar/PanelBar.d.ts +40 -0
- package/dist/npm/panelbar/PanelBar.js +343 -0
- package/dist/npm/panelbar/PanelBarItem.d.ts +35 -0
- package/dist/npm/panelbar/PanelBarItem.js +230 -0
- package/dist/npm/panelbar/interfaces/NavigationAction.d.ts +8 -0
- package/dist/npm/panelbar/interfaces/NavigationAction.js +12 -0
- package/dist/npm/panelbar/interfaces/PanelBarItemClickEventArguments.d.ts +7 -0
- package/dist/npm/panelbar/interfaces/PanelBarItemClickEventArguments.js +2 -0
- package/dist/npm/panelbar/interfaces/PanelBarItemProps.d.ts +85 -0
- package/dist/npm/panelbar/interfaces/PanelBarItemProps.js +2 -0
- package/dist/npm/panelbar/interfaces/PanelBarProps.d.ts +54 -0
- package/dist/npm/panelbar/interfaces/PanelBarProps.js +2 -0
- package/dist/npm/panelbar/interfaces/PanelBarSelectEventArguments.d.ts +13 -0
- package/dist/npm/panelbar/interfaces/PanelBarSelectEventArguments.js +2 -0
- package/dist/npm/panelbar/interfaces/RenderPanelBarItem.d.ts +14 -0
- package/dist/npm/panelbar/interfaces/RenderPanelBarItem.js +2 -0
- package/dist/npm/panelbar/util.d.ts +49 -0
- package/dist/npm/panelbar/util.js +264 -0
- package/dist/npm/splitter/Splitter.d.ts +86 -0
- package/dist/npm/splitter/Splitter.js +453 -0
- package/dist/npm/splitter/SplitterBar.d.ts +50 -0
- package/dist/npm/splitter/SplitterBar.js +241 -0
- package/dist/npm/splitter/SplitterPane.d.ts +109 -0
- package/dist/npm/splitter/SplitterPane.js +75 -0
- package/package.json +10 -10
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the props of the PanelBarItem component.
|
|
3
|
+
*/
|
|
4
|
+
export interface PanelBarItemProps {
|
|
5
|
+
/**
|
|
6
|
+
* Allows individual animation control over the child ([see example]({% slug animations_panelbar %})). By default, it is controlled by the PanelBar component.
|
|
7
|
+
*/
|
|
8
|
+
animation?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The class name that is set to the PanelBarItem component.
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The class name that is set to the PanelBarItem header.
|
|
15
|
+
*/
|
|
16
|
+
headerClassName?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Sets the initial expanded state of the PanelBarItem ([see example]({% slug statesitems_panelbar %}#toc-expanded-items)). Controlled by the PanelBar component.
|
|
19
|
+
*/
|
|
20
|
+
expanded?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Sets the disabled state of the PanelBarItem ([see example]({% slug statesitems_panelbar %}#toc-disabled-items)).
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
onSelect?: Function;
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
level?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Defines an icon that will be rendered next to the title ([see example]({% slug titlesitems_panelbar %}#toc-adding-icons)).
|
|
35
|
+
*/
|
|
36
|
+
icon?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Defines an icon with a custom CSS class that will be rendered next to the title ([see example]({% slug titlesitems_panelbar %}#toc-adding-icons)).
|
|
39
|
+
*/
|
|
40
|
+
iconClass?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Defines the location of the image that will be displayed next to the title ([see example]({% slug titlesitems_panelbar %}#toc-adding-images)).
|
|
43
|
+
*/
|
|
44
|
+
imageUrl?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the initial selected state of the PanelBarItem. Controlled by the PanelBarItem component ([see example]({% slug statesitems_panelbar %}#toc-selected-items)).
|
|
47
|
+
*/
|
|
48
|
+
selected?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Sets the title of the PanelBar item ([see example]({% slug titlesitems_panelbar %}#toc-getting-started)).
|
|
51
|
+
*/
|
|
52
|
+
title?: any;
|
|
53
|
+
/**
|
|
54
|
+
* Allows the component to set the `id` property to each item. If not set, a default `id` is applied.
|
|
55
|
+
*/
|
|
56
|
+
id?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Sets the initial focused state of the PanelBarItem. Controlled by the PanelBar component.
|
|
59
|
+
*/
|
|
60
|
+
focused?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* @hidden
|
|
63
|
+
*/
|
|
64
|
+
parentExpanded?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* @hidden
|
|
67
|
+
*/
|
|
68
|
+
content?: any;
|
|
69
|
+
/**
|
|
70
|
+
* Used to identify the PanelBarItems inside the PanelBar ([see example]({% slug controlling_state_panelbar %})). Does not depend on the state of the PanelBarItem.
|
|
71
|
+
*/
|
|
72
|
+
uniquePrivateKey?: string;
|
|
73
|
+
/**
|
|
74
|
+
* @hidden
|
|
75
|
+
*/
|
|
76
|
+
parentUniquePrivateKey?: string[];
|
|
77
|
+
/**
|
|
78
|
+
* @hidden
|
|
79
|
+
*/
|
|
80
|
+
keepItemsMounted?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Sets a custom property. Contained in the PanelBarItem props that are returned from the `onSelect` PanelBar event.
|
|
83
|
+
*/
|
|
84
|
+
[customProp: string]: any;
|
|
85
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { PanelBarSelectEventArguments } from './PanelBarSelectEventArguments';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the expand modes of the KendoReact PanelBar. Defaults to `multiple`.
|
|
4
|
+
*/
|
|
5
|
+
export declare type PanelBarExpandMode = 'single' | 'multiple';
|
|
6
|
+
/**
|
|
7
|
+
* Represents the props of the [KendoReact PanelBar component]({% slug overview_panelbar %}).
|
|
8
|
+
*/
|
|
9
|
+
export interface PanelBarProps {
|
|
10
|
+
/**
|
|
11
|
+
* The class name that is set to the PanelBar.
|
|
12
|
+
*/
|
|
13
|
+
className?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Sets the animation state of the PanelBar.
|
|
16
|
+
*/
|
|
17
|
+
animation?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Sets the expand mode of the PanelBar ([see example]({% slug expandmodes_panelbar %})).
|
|
20
|
+
*
|
|
21
|
+
* The available modes are:
|
|
22
|
+
* - `"single"`—Allows you to expand only one item at a time. The expanding of an item collapses the item that was previously expanded.
|
|
23
|
+
* - `"multiple"` (default)—Allows you to expand two or more items at a time. Items can also be toggled.
|
|
24
|
+
*/
|
|
25
|
+
expandMode?: PanelBarExpandMode | string;
|
|
26
|
+
/**
|
|
27
|
+
* Sets the direction of the PanelBar component.
|
|
28
|
+
*/
|
|
29
|
+
dir?: string;
|
|
30
|
+
/**
|
|
31
|
+
* If set, overrides the currently selected property in the PanelBar state.
|
|
32
|
+
*/
|
|
33
|
+
selected?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Sets the initial expanded state of the PanelBar.
|
|
36
|
+
*/
|
|
37
|
+
expanded?: string[];
|
|
38
|
+
/**
|
|
39
|
+
* Sets the initial focused state of the PanelBar.
|
|
40
|
+
*/
|
|
41
|
+
focused?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Determines if the PanelBar items will be mounted after expand collapse. Defaults to `false`.
|
|
44
|
+
*/
|
|
45
|
+
keepItemsMounted?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Determines if the PanelBar is going to be used in controlled state.
|
|
48
|
+
*/
|
|
49
|
+
isControlled?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Fires each time the user makes a selection ([see example]({% slug controlling_state_panelbar %})).
|
|
52
|
+
*/
|
|
53
|
+
onSelect?: (event: PanelBarSelectEventArguments) => void;
|
|
54
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The arguments that are passed to the `onSelect` callback function.
|
|
3
|
+
*/
|
|
4
|
+
export interface PanelBarSelectEventArguments {
|
|
5
|
+
/**
|
|
6
|
+
* The selected PanelBar item.
|
|
7
|
+
*/
|
|
8
|
+
target: any;
|
|
9
|
+
/**
|
|
10
|
+
* The new expanded PanelBar items state.
|
|
11
|
+
*/
|
|
12
|
+
expandedItems: string[];
|
|
13
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PanelBarState } from '../PanelBar';
|
|
2
|
+
/**
|
|
3
|
+
* @hidden
|
|
4
|
+
*/
|
|
5
|
+
export interface RenderPanelBarItem {
|
|
6
|
+
animation?: boolean;
|
|
7
|
+
keepItemsMounted?: boolean;
|
|
8
|
+
state: PanelBarState;
|
|
9
|
+
expanded: string[];
|
|
10
|
+
handleSelect: any;
|
|
11
|
+
parentExpanded?: boolean;
|
|
12
|
+
level?: number;
|
|
13
|
+
parentPrivateKey?: string[];
|
|
14
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { PanelBarState } from './PanelBar';
|
|
2
|
+
import { PanelBarItemProps } from './interfaces/PanelBarItemProps';
|
|
3
|
+
import { PanelBarExpandMode } from './interfaces/PanelBarProps';
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
export declare const renderChildren: () => any;
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export declare const getFirstId: (_props: any) => any;
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
export declare const getInitialState: (props: any, _expandMode: PanelBarExpandMode, result?: PanelBarState, _parentExpanded?: boolean, _parentPrivateKey?: string[]) => PanelBarState;
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export declare function flatVisibleItems(data: any, flattedItems?: any[]): any[];
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export declare function flatChildren(_children: any, flattenChildren?: any[]): any[];
|
|
24
|
+
/**
|
|
25
|
+
* @hidden
|
|
26
|
+
*/
|
|
27
|
+
export declare function flatVisibleChildren(_children: any, flattenVisibleChildren?: any[]): any[];
|
|
28
|
+
/**
|
|
29
|
+
* @hidden
|
|
30
|
+
*/
|
|
31
|
+
export declare const isPresent: Function;
|
|
32
|
+
/**
|
|
33
|
+
* Represents the PanelBarUtils functions.
|
|
34
|
+
*/
|
|
35
|
+
export declare namespace PanelBarUtils {
|
|
36
|
+
/**
|
|
37
|
+
* Maps a collection of PanelBarItemProps to PanelBarItem components
|
|
38
|
+
* ([see example]({% slug customization_panelbar %})).
|
|
39
|
+
* Contained in the `PanelBarUtils` object.
|
|
40
|
+
*
|
|
41
|
+
* @param items - A collection of PanelBarItemProps.
|
|
42
|
+
* @return {PanelBarItem[]} Returns an array of PanelBarItem components.
|
|
43
|
+
*/
|
|
44
|
+
function mapItemsToComponents(items: Array<PanelBarItemProps>): any[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
49
|
+
export declare const isArrayEqual: (firstArray: any[], secondArray: any[]) => boolean;
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { PanelBarItem } from './PanelBarItem';
|
|
2
|
+
/**
|
|
3
|
+
* @hidden
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export var renderChildren = function // {
|
|
7
|
+
// animation = true,
|
|
8
|
+
// keepItemsMounted = false,
|
|
9
|
+
// state,
|
|
10
|
+
// expanded,
|
|
11
|
+
// handleSelect,
|
|
12
|
+
// parentExpanded = true,
|
|
13
|
+
// level = 0,
|
|
14
|
+
// parentPrivateKey = []}: RenderPanelBarItem
|
|
15
|
+
renderChildren() {
|
|
16
|
+
return []; // React.Children.map(children, (child: any, idx) => {
|
|
17
|
+
// if (child && child.type === PanelBarItem) {
|
|
18
|
+
// let nestedChildren;
|
|
19
|
+
// let privateKey = getId(child, parentPrivateKey, idx);
|
|
20
|
+
// if (child.props.children) {
|
|
21
|
+
// const renderState: RenderPanelBarItem = {
|
|
22
|
+
// animation,
|
|
23
|
+
// keepItemsMounted,
|
|
24
|
+
// state,
|
|
25
|
+
// expanded,
|
|
26
|
+
// handleSelect,
|
|
27
|
+
// parentExpanded: (expanded || []).indexOf(privateKey) > -1,
|
|
28
|
+
// level: level + 1,
|
|
29
|
+
// parentPrivateKey: [...parentPrivateKey, privateKey]
|
|
30
|
+
// };
|
|
31
|
+
// nestedChildren = renderChildren(renderState);
|
|
32
|
+
// }
|
|
33
|
+
// return React.cloneElement(
|
|
34
|
+
// child, {
|
|
35
|
+
// ...child.props,
|
|
36
|
+
// animation: child.props.animation !== undefined ? child.props.animation : animation,
|
|
37
|
+
// keepItemsMounted,
|
|
38
|
+
// id: child.props.id || `k-panelbar-item-default-${privateKey}`,
|
|
39
|
+
// uniquePrivateKey: privateKey,
|
|
40
|
+
// parentUniquePrivateKey: parentPrivateKey,
|
|
41
|
+
// parentExpanded: parentExpanded,
|
|
42
|
+
// level: level,
|
|
43
|
+
// expanded: (expanded || []).indexOf(privateKey) > -1,
|
|
44
|
+
// focused: state.focused === privateKey && state.wrapperFocused,
|
|
45
|
+
// selected: state.selected === privateKey,
|
|
46
|
+
// children: nestedChildren,
|
|
47
|
+
// onSelect: handleSelect
|
|
48
|
+
// }
|
|
49
|
+
// );
|
|
50
|
+
// } else {
|
|
51
|
+
// return <div className="k-panelbar-content k-content">{child}</div>;
|
|
52
|
+
// }
|
|
53
|
+
// });
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* @hidden
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
export var getFirstId = function getFirstId(_props) {
|
|
60
|
+
var firstItem = []; // React.Children.toArray(props.children)[0];
|
|
61
|
+
|
|
62
|
+
if (firstItem) {
|
|
63
|
+
return getId(firstItem, [], 0);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return '';
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* @hidden
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
export var getInitialState = function getInitialState(props, _expandMode, result, _parentExpanded, _parentPrivateKey) {
|
|
73
|
+
// React.Children.map(props.children, (child: React.ReactElement<any>, idx) => {
|
|
74
|
+
// if (child && child.type === PanelBarItem) {
|
|
75
|
+
// let privateKey = getId(child, parentPrivateKey, idx);
|
|
76
|
+
if (result === void 0) {
|
|
77
|
+
result = {
|
|
78
|
+
expanded: props.expanded || [],
|
|
79
|
+
selected: props.selected || '',
|
|
80
|
+
focused: props.focused || '',
|
|
81
|
+
wrapperFocused: false
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (_parentExpanded === void 0) {
|
|
86
|
+
_parentExpanded = true;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (_parentPrivateKey === void 0) {
|
|
90
|
+
_parentPrivateKey = [];
|
|
91
|
+
} // if (!child.props.disabled && parentExpanded) {
|
|
92
|
+
// if (child.props.selected) {
|
|
93
|
+
// result.selected = privateKey;
|
|
94
|
+
// }
|
|
95
|
+
// if (child.props.focused) {
|
|
96
|
+
// result.focused = privateKey;
|
|
97
|
+
// }
|
|
98
|
+
// if (child.props.expanded) {
|
|
99
|
+
// if (expandMode === 'multiple') {
|
|
100
|
+
// result.expanded.push(privateKey);
|
|
101
|
+
// } else if (expandMode === 'single') {
|
|
102
|
+
// result.expanded = [privateKey];
|
|
103
|
+
// }
|
|
104
|
+
// }
|
|
105
|
+
// if (child.props.children) {
|
|
106
|
+
// result = getInitialState(
|
|
107
|
+
// child.props,
|
|
108
|
+
// expandMode,
|
|
109
|
+
// result,
|
|
110
|
+
// !!child.props.expanded,
|
|
111
|
+
// [...parentPrivateKey, privateKey]);
|
|
112
|
+
// }
|
|
113
|
+
// }
|
|
114
|
+
// }
|
|
115
|
+
// });
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
return result;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* @hidden
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
var getId = function getId(child, parentPrivateKey, idx) {
|
|
125
|
+
return child && child.props && child.props.id ? child.props.id : parentPrivateKey.length ? parentPrivateKey[parentPrivateKey.length - 1] + ("." + idx) : "." + idx;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* @hidden
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
export function flatVisibleItems(data, flattedItems) {
|
|
133
|
+
if (flattedItems === void 0) {
|
|
134
|
+
flattedItems = [];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
(data || []).forEach(function (item) {
|
|
138
|
+
if (!item.disabled) {
|
|
139
|
+
flattedItems.push(item);
|
|
140
|
+
|
|
141
|
+
if (item.expanded && item.children) {
|
|
142
|
+
flatVisibleItems(item.children, flattedItems);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
return flattedItems;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* @hidden
|
|
150
|
+
*/
|
|
151
|
+
|
|
152
|
+
export function flatChildren(_children, flattenChildren) {
|
|
153
|
+
if (flattenChildren === void 0) {
|
|
154
|
+
flattenChildren = [];
|
|
155
|
+
} // React.Children.forEach(children, (child: any) => {
|
|
156
|
+
// if (child && child.props && !child.props.disabled) {
|
|
157
|
+
// flattenChildren.push(child);
|
|
158
|
+
// if (child.props.children) {
|
|
159
|
+
// flatChildren(child.props.children, flattenChildren);
|
|
160
|
+
// }
|
|
161
|
+
// }
|
|
162
|
+
// });
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
return flattenChildren;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* @hidden
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
export function flatVisibleChildren(_children, flattenVisibleChildren) {
|
|
172
|
+
if (flattenVisibleChildren === void 0) {
|
|
173
|
+
flattenVisibleChildren = [];
|
|
174
|
+
} // React.Children.forEach(children, (child: any) => {
|
|
175
|
+
// if (child && child.props && !child.props.disabled && (child.props.expanded || child.props.parentExpanded)) {
|
|
176
|
+
// flattenVisibleChildren.push(child);
|
|
177
|
+
// if (child.props.children) {
|
|
178
|
+
// flatVisibleChildren(child.props.children, flattenVisibleChildren);
|
|
179
|
+
// }
|
|
180
|
+
// }
|
|
181
|
+
// });
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
return flattenVisibleChildren;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* @hidden
|
|
188
|
+
*/
|
|
189
|
+
|
|
190
|
+
export var isPresent = function isPresent(value) {
|
|
191
|
+
return value !== null && value !== undefined;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Represents the PanelBarUtils functions.
|
|
195
|
+
*/
|
|
196
|
+
|
|
197
|
+
export var PanelBarUtils;
|
|
198
|
+
|
|
199
|
+
(function (PanelBarUtils) {
|
|
200
|
+
/**
|
|
201
|
+
* Maps a collection of PanelBarItemProps to PanelBarItem components
|
|
202
|
+
* ([see example]({% slug customization_panelbar %})).
|
|
203
|
+
* Contained in the `PanelBarUtils` object.
|
|
204
|
+
*
|
|
205
|
+
* @param items - A collection of PanelBarItemProps.
|
|
206
|
+
* @return {PanelBarItem[]} Returns an array of PanelBarItem components.
|
|
207
|
+
*/
|
|
208
|
+
function mapItemsToComponents(items) {
|
|
209
|
+
return items.map(function (item, idx) {
|
|
210
|
+
var children;
|
|
211
|
+
|
|
212
|
+
if (item.content) {
|
|
213
|
+
children = item.content;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (item.children) {
|
|
217
|
+
children = mapItemsToComponents(item.children);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return h(PanelBarItem // {...item}
|
|
221
|
+
, {
|
|
222
|
+
children: children,
|
|
223
|
+
attrs: this.v3 ? undefined : {
|
|
224
|
+
children: children
|
|
225
|
+
},
|
|
226
|
+
key: item.id || idx
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
PanelBarUtils.mapItemsToComponents = mapItemsToComponents;
|
|
232
|
+
})(PanelBarUtils || (PanelBarUtils = {}));
|
|
233
|
+
/**
|
|
234
|
+
* @hidden
|
|
235
|
+
*/
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
export var isArrayEqual = function isArrayEqual(firstArray, secondArray) {
|
|
239
|
+
if (firstArray.length !== secondArray.length) {
|
|
240
|
+
return false;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return firstArray.every(function (ex, i) {
|
|
244
|
+
return ex === secondArray[i];
|
|
245
|
+
});
|
|
246
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
|
|
2
|
+
declare type DefaultData<V> = object | ((this: V) => {});
|
|
3
|
+
declare type DefaultMethods<V> = {
|
|
4
|
+
[key: string]: (this: V, ...args: any[]) => any;
|
|
5
|
+
};
|
|
6
|
+
import { SplitterPaneProps } from './SplitterPane';
|
|
7
|
+
/**
|
|
8
|
+
* Represents the onChange event of the Splitter.
|
|
9
|
+
*/
|
|
10
|
+
export interface SplitterOnChangeEvent {
|
|
11
|
+
/**
|
|
12
|
+
* The new panes state.
|
|
13
|
+
*/
|
|
14
|
+
newState: SplitterPaneProps[];
|
|
15
|
+
/**
|
|
16
|
+
* Indicates if is the last event during drag. Can be used to optimize performance.
|
|
17
|
+
*/
|
|
18
|
+
isLast: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The native DOM event.
|
|
21
|
+
*/
|
|
22
|
+
nativeEvent: any;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Represents the options of the Splitter.
|
|
26
|
+
*/
|
|
27
|
+
export interface SplitterProps {
|
|
28
|
+
/**
|
|
29
|
+
* Sets the options of the Splitter panes ([more information and examples]({% slug panes_splitter %})). Can be used for controlled state.
|
|
30
|
+
*/
|
|
31
|
+
panes?: SplitterPaneProps[];
|
|
32
|
+
/**
|
|
33
|
+
* Sets the initial options of the Splitter panes ([more information and examples]({% slug panes_splitter %})). Can be used for uncontrolled state.
|
|
34
|
+
*/
|
|
35
|
+
defaultPanes?: SplitterPaneProps[];
|
|
36
|
+
/**
|
|
37
|
+
* Specifies the orientation of the panes within the Splitter ([more information and examples]({% slug orientation_splitter %})). Panes in a horizontal Splitter are placed horizontally. Panes in a vertical Splitter are placed vertically.
|
|
38
|
+
*/
|
|
39
|
+
orientation?: 'vertical' | 'horizontal' | string;
|
|
40
|
+
/**
|
|
41
|
+
* Fires after a Splitter pane is resized or collapsed. Useful for updating the pane options and triggering layout calculations on components which are positioned inside the panes.
|
|
42
|
+
*/
|
|
43
|
+
onChange?: (event: SplitterOnChangeEvent) => void;
|
|
44
|
+
/**
|
|
45
|
+
* The class name that is set to the Splitter.
|
|
46
|
+
*/
|
|
47
|
+
className?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
export interface SplitterState {
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
56
|
+
*/
|
|
57
|
+
export interface SplitterComputed {
|
|
58
|
+
[key: string]: any;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @hidden
|
|
62
|
+
*/
|
|
63
|
+
export interface SplitterMethods {
|
|
64
|
+
[key: string]: any;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @hidden
|
|
68
|
+
*/
|
|
69
|
+
export interface SplitterData {
|
|
70
|
+
isDragging: boolean;
|
|
71
|
+
dragIndex?: number;
|
|
72
|
+
startTime: number;
|
|
73
|
+
originalX: number;
|
|
74
|
+
originalY: number;
|
|
75
|
+
originalPrevSize: number;
|
|
76
|
+
originalNextSize: number;
|
|
77
|
+
panes: SplitterPaneProps[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @hidden
|
|
81
|
+
*/
|
|
82
|
+
export interface SplitterAll extends Vue2type, SplitterMethods, SplitterData, SplitterComputed, SplitterState {
|
|
83
|
+
}
|
|
84
|
+
declare let SplitterVue2: ComponentOptions<SplitterAll, DefaultData<SplitterData>, DefaultMethods<SplitterAll>, SplitterComputed, RecordPropsDefinition<SplitterProps>>;
|
|
85
|
+
declare const Splitter: DefineComponent<SplitterProps, any, SplitterData, SplitterComputed, SplitterMethods, {}, {}, {}, string, SplitterProps, SplitterProps, {}>;
|
|
86
|
+
export { Splitter, SplitterVue2 };
|