@progress/kendo-vue-layout 3.1.3 → 3.1.5-dev.202204110939

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.
Files changed (43) hide show
  1. package/NOTICE.txt +49 -6
  2. package/dist/cdn/js/kendo-vue-layout.js +1 -1
  3. package/dist/es/card/Avatar.js +1 -1
  4. package/dist/es/main.d.ts +9 -0
  5. package/dist/es/main.js +9 -0
  6. package/dist/es/package-metadata.js +1 -1
  7. package/dist/es/panelbar/PanelBar.d.ts +4 -4
  8. package/dist/es/panelbar/PanelBar.js +62 -95
  9. package/dist/es/panelbar/PanelBarGroup.d.ts +47 -0
  10. package/dist/es/panelbar/PanelBarGroup.js +126 -0
  11. package/dist/es/panelbar/PanelBarItem.d.ts +0 -1
  12. package/dist/es/panelbar/PanelBarItem.js +118 -125
  13. package/dist/es/panelbar/interfaces/PanelBarItemProps.d.ts +9 -13
  14. package/dist/es/panelbar/interfaces/PanelBarProps.d.ts +4 -0
  15. package/dist/es/panelbar/interfaces/RenderPanelBarItem.d.ts +2 -2
  16. package/dist/es/panelbar/util.d.ts +7 -21
  17. package/dist/es/panelbar/util.js +136 -146
  18. package/dist/es/splitter/Splitter.d.ts +1 -5
  19. package/dist/es/splitter/Splitter.js +114 -146
  20. package/dist/es/splitter/SplitterBar.js +118 -68
  21. package/dist/es/splitter/SplitterPane.d.ts +8 -30
  22. package/dist/es/splitter/SplitterPane.js +10 -4
  23. package/dist/npm/card/Avatar.js +1 -1
  24. package/dist/npm/main.d.ts +9 -0
  25. package/dist/npm/main.js +9 -0
  26. package/dist/npm/package-metadata.js +1 -1
  27. package/dist/npm/panelbar/PanelBar.d.ts +4 -4
  28. package/dist/npm/panelbar/PanelBar.js +62 -94
  29. package/dist/npm/panelbar/PanelBarGroup.d.ts +47 -0
  30. package/dist/npm/panelbar/PanelBarGroup.js +138 -0
  31. package/dist/npm/panelbar/PanelBarItem.d.ts +0 -1
  32. package/dist/npm/panelbar/PanelBarItem.js +117 -124
  33. package/dist/npm/panelbar/interfaces/PanelBarItemProps.d.ts +9 -13
  34. package/dist/npm/panelbar/interfaces/PanelBarProps.d.ts +4 -0
  35. package/dist/npm/panelbar/interfaces/RenderPanelBarItem.d.ts +2 -2
  36. package/dist/npm/panelbar/util.d.ts +7 -21
  37. package/dist/npm/panelbar/util.js +137 -147
  38. package/dist/npm/splitter/Splitter.d.ts +1 -5
  39. package/dist/npm/splitter/Splitter.js +113 -145
  40. package/dist/npm/splitter/SplitterBar.js +118 -68
  41. package/dist/npm/splitter/SplitterPane.d.ts +8 -30
  42. package/dist/npm/splitter/SplitterPane.js +9 -3
  43. package/package.json +10 -10
@@ -1,56 +1,31 @@
1
- // @ts-ignore
2
- import * as Vue from 'vue';
3
- var allVue = Vue;
4
- var gh = allVue.h;
5
- import { classNames } from '@progress/kendo-vue-common';
6
- import { Reveal } from '@progress/kendo-vue-animation';
7
- /**
8
- * @hidden
9
- */
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];
10
5
 
11
- function iconElement(_a) {
12
- var imageUrl = _a.imageUrl,
13
- icon = _a.icon,
14
- iconClass = _a.iconClass;
6
+ for (var p in s) {
7
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
+ }
9
+ }
15
10
 
16
- if (imageUrl) {
17
- return h("img", {
18
- role: "presentation",
19
- attrs: this.v3 ? undefined : {
20
- role: "presentation",
21
- src: imageUrl
22
- },
23
- "class": 'k-panelbar-item-icon k-image',
24
- src: imageUrl
25
- });
26
- } else if (icon) {
27
- var iconClasses = classNames('k-panelbar-item-icon', 'k-icon', 'k-i-' + icon);
28
- return h("span", {
29
- role: "presentation",
30
- attrs: this.v3 ? undefined : {
31
- role: "presentation"
32
- },
33
- "class": iconClasses
34
- });
35
- } else if (iconClass) {
36
- return h("span", {
37
- role: "presentation",
38
- attrs: this.v3 ? undefined : {
39
- role: "presentation"
40
- },
41
- "class": 'k-panelbar-item-icon ' + iconClass
42
- });
43
- }
11
+ return t;
12
+ };
13
+
14
+ return __assign.apply(this, arguments);
15
+ }; // @ts-ignore
44
16
 
45
- return null;
46
- } // tslint:enable:max-line-length
47
17
 
18
+ import * as Vue from 'vue';
19
+ var allVue = Vue;
20
+ var gh = allVue.h;
21
+ import { classNames, getTemplate } from '@progress/kendo-vue-common';
22
+ import { PanelBarGroup } from './PanelBarGroup'; // tslint:enable:max-line-length
48
23
 
49
24
  var PanelBarItemVue2 = {
50
25
  name: 'KendoPanelBarItem',
51
26
  props: {
27
+ items: Array,
52
28
  animation: Boolean,
53
- className: String,
54
29
  expanded: Boolean,
55
30
  disabled: Boolean,
56
31
  selected: Boolean,
@@ -63,12 +38,21 @@ var PanelBarItemVue2 = {
63
38
  },
64
39
  id: String,
65
40
  focused: Boolean,
66
- keepItemsMounted: Boolean
41
+ keepItemsMounted: Boolean,
42
+ uniquePrivateKey: String,
43
+ parentUniquePrivateKey: Array,
44
+ parentExpanded: Boolean,
45
+ headerClassName: String,
46
+ iconClass: String,
47
+ imageUrl: String,
48
+ icon: String,
49
+ content: Object,
50
+ header: Object
67
51
  },
68
- data: function data() {
69
- return {
70
- show: this.$props.expanded
71
- };
52
+ inject: {
53
+ dispatchItemSelect: {
54
+ default: null
55
+ }
72
56
  },
73
57
  // @ts-ignore
74
58
  setup: !gh ? undefined : function () {
@@ -81,12 +65,11 @@ var PanelBarItemVue2 = {
81
65
  render: function render(createElement) {
82
66
  var _a;
83
67
 
84
- var _this = this;
85
-
86
68
  var h = gh || createElement;
87
- var _b = this.props,
69
+ var _b = this.$props,
88
70
  id = _b.id,
89
- children = _b.children,
71
+ items = _b.items,
72
+ content = _b.content,
90
73
  title = _b.title,
91
74
  uniquePrivateKey = _b.uniquePrivateKey,
92
75
  disabled = _b.disabled,
@@ -98,117 +81,127 @@ var PanelBarItemVue2 = {
98
81
  headerClassName = _b.headerClassName,
99
82
  animation = _b.animation,
100
83
  keepItemsMounted = _b.keepItemsMounted;
101
- var panelBarItemAriaAttributes = {
102
- 'role': 'treeitem',
103
- 'aria-disabled': disabled,
104
- 'aria-hidden': !disabled && !expanded,
105
- 'aria-selected': !disabled && selected,
106
- 'aria-expanded': !disabled && expanded && !!children
107
- };
84
+ var hasContent = !!items || content;
108
85
  var panelBarItemClassName = classNames('k-item', {
109
86
  'k-panelbar-header': level === 0,
110
87
  'k-panelbar-item': level !== 0,
111
- 'k-state-expanded': expanded && !!children
88
+ 'k-state-expanded': expanded && hasContent
112
89
  }, "k-level-" + level, className);
113
90
  var panelBarLinkClassName = classNames('k-link', {
114
91
  'k-state-selected': !disabled && selected,
115
92
  'k-state-focus': !disabled && focused,
116
93
  'k-state-disabled': disabled
117
94
  }, headerClassName);
118
- var panelBarItemArrowClassName = classNames('k-panelbar-toggle', 'k-icon', (_a = {}, _a['k-i-arrow-chevron-up'] = expanded && !!children, _a['k-panelbar-collapse'] = expanded && !!children, _a['k-i-arrow-chevron-down'] = !expanded && !!children, _a['k-panelbar-expand'] = !expanded && !!children, _a));
119
- var animationStyle = {
120
- display: 'block'
95
+ var panelBarItemArrowClassName = classNames('k-panelbar-toggle', 'k-icon', (_a = {}, _a['k-i-arrow-chevron-up'] = expanded && hasContent, _a['k-panelbar-collapse'] = expanded && hasContent, _a['k-i-arrow-chevron-down'] = !expanded && hasContent, _a['k-panelbar-expand'] = !expanded && hasContent, _a));
96
+
97
+ var iconElement = function iconElement() {
98
+ if (this.imageUrl) {
99
+ return h("img", {
100
+ role: "presentation",
101
+ attrs: this.v3 ? undefined : {
102
+ role: "presentation",
103
+ src: this.imageUrl
104
+ },
105
+ "class": 'k-panelbar-item-icon k-image',
106
+ src: this.imageUrl
107
+ });
108
+ } else if (icon) {
109
+ var iconClasses = classNames('k-panelbar-item-icon', 'k-icon', 'k-i-' + icon);
110
+ return h("span", {
111
+ role: "presentation",
112
+ attrs: this.v3 ? undefined : {
113
+ role: "presentation"
114
+ },
115
+ "class": iconClasses
116
+ });
117
+ } else if (this.iconClass) {
118
+ return h("span", {
119
+ role: "presentation",
120
+ attrs: this.v3 ? undefined : {
121
+ role: "presentation"
122
+ },
123
+ "class": 'k-panelbar-item-icon ' + this.iconClass
124
+ });
125
+ }
126
+
127
+ return null;
121
128
  };
122
- var icon = iconElement(this.props);
123
- var arrow = !disabled && children ? h("span", {
129
+
130
+ var icon = iconElement.call(this);
131
+ var arrow = !disabled && (items || content) ? h("span", {
124
132
  "class": panelBarItemArrowClassName
125
133
  }) : null;
126
- var opened = !disabled && expanded;
127
- var content = opened || keepItemsMounted ? h("ul", {
128
- role: "group",
134
+ var group = items || content ? h(PanelBarGroup, {
135
+ items: items,
129
136
  attrs: this.v3 ? undefined : {
130
- role: "group",
131
- className: "k-panelbar-group k-panel k-group"
137
+ items: items,
138
+ item: __assign({}, this.$props),
139
+ content: content,
140
+ uniquePrivateKey: uniquePrivateKey,
141
+ disabled: disabled,
142
+ expanded: expanded,
143
+ animation: animation,
144
+ keepItemsMounted: keepItemsMounted
132
145
  },
133
- className: "k-panelbar-group k-panel k-group",
134
- style: {
135
- display: keepItemsMounted ? this.state.show ? 'block' : 'none' : 'block'
136
- }
137
- }, [children]) : null;
138
- var child = (animation !== undefined ? animation : true) && !disabled && children ? h(Reveal, {
139
- transitionEnterDuration: 200,
140
- attrs: this.v3 ? undefined : {
141
- transitionEnterDuration: 200,
142
- transitionExitDuration: 200,
143
- children: content,
144
- childFactory: keepItemsMounted && this.childFactory,
145
- unmountOnExit: !keepItemsMounted
146
- },
147
- transitionExitDuration: 200,
148
- key: uniquePrivateKey + '_animation',
149
- style: animationStyle,
150
- children: content,
151
- childFactory: keepItemsMounted && this.childFactory,
152
- unmountOnExit: !keepItemsMounted,
153
- onBeforeEnter: function onBeforeEnter() {
154
- return keepItemsMounted && _this.setState({
155
- show: true
156
- });
157
- },
158
- on: this.v3 ? undefined : {
159
- "beforeEnter": function onBeforeEnter() {
160
- return keepItemsMounted && _this.setState({
161
- show: true
162
- });
163
- },
164
- "afterExited": function afterExited() {
165
- return keepItemsMounted && _this.setState({
166
- show: false
167
- });
168
- }
169
- },
170
- onAfterExited: function afterExited() {
171
- return keepItemsMounted && _this.setState({
172
- show: false
173
- });
174
- }
175
- }) : content;
146
+ item: __assign({}, this.$props),
147
+ content: content,
148
+ uniquePrivateKey: uniquePrivateKey,
149
+ disabled: disabled,
150
+ expanded: expanded,
151
+ animation: animation,
152
+ keepItemsMounted: keepItemsMounted
153
+ }) : null;
154
+ var header = getTemplate.call(this, {
155
+ h: h,
156
+ template: this.$props.header,
157
+ defaultRendering: null,
158
+ additionalProps: __assign({}, this.$props)
159
+ });
176
160
  return h("li", {
177
161
  id: id,
178
162
  attrs: this.v3 ? undefined : {
179
- id: id
163
+ id: id,
164
+ role: 'treeitem',
165
+ "aria-disabled": disabled,
166
+ "aria-hidden": !disabled && !expanded,
167
+ "aria-selected": !disabled && selected,
168
+ "aria-expanded": !disabled && expanded && hasContent
180
169
  },
181
- "class": panelBarItemClassName
170
+ "class": panelBarItemClassName,
171
+ role: 'treeitem',
172
+ "aria-disabled": disabled,
173
+ "aria-hidden": !disabled && !expanded,
174
+ "aria-selected": !disabled && selected,
175
+ "aria-expanded": !disabled && expanded && hasContent
182
176
  }, [h("span", {
183
177
  "class": panelBarLinkClassName,
184
178
  onClick: this.handleItemClick,
185
179
  on: this.v3 ? undefined : {
186
180
  "click": this.handleItemClick
187
181
  }
188
- }, [icon, h("span", {
182
+ }, [icon, this.$props.header ? header : h("span", {
189
183
  "class": 'k-panelbar-item-text'
190
- }, [title]), arrow]), child]);
184
+ }, [title]), arrow]), group]);
191
185
  },
192
186
  methods: {
193
187
  handleItemClick: function handleItemClick() {
194
- var _a = this.props,
195
- onSelect = _a.onSelect,
188
+ var _a = this.$props,
196
189
  disabled = _a.disabled,
197
190
  id = _a.id;
198
191
 
199
- if (onSelect && !disabled) {
200
- onSelect.call(undefined, {
201
- uniquePrivateKey: this.props.uniquePrivateKey,
192
+ if (!disabled) {
193
+ this.dispatchItemSelect({
194
+ uniquePrivateKey: this.$props.uniquePrivateKey,
202
195
  id: id,
203
196
  target: this
204
197
  });
205
198
  }
206
199
  },
207
200
  childFactory: function childFactory(child) {
208
- // if (this.props.keepItemsMounted) {
201
+ // if (this.$props.keepItemsMounted) {
209
202
  // return React.cloneElement(child, {
210
203
  // ...child.props,
211
- // in: this.props.expanded
204
+ // in: this.$props.expanded
212
205
  // });
213
206
  // }
214
207
  return child;
@@ -3,13 +3,13 @@
3
3
  */
4
4
  export interface PanelBarItemProps {
5
5
  /**
6
- * Allows individual animation control over the child ([see example]({% slug animations_panelbar %})). By default, it is controlled by the PanelBar component.
6
+ * Sets the subitems of the item.
7
7
  */
8
- animation?: boolean;
8
+ items?: any[];
9
9
  /**
10
- * The class name that is set to the PanelBarItem component.
10
+ * Allows individual animation control over the child ([see example]({% slug animations_panelbar %})). By default, it is controlled by the PanelBar component.
11
11
  */
12
- className?: string;
12
+ animation?: boolean;
13
13
  /**
14
14
  * The class name that is set to the PanelBarItem header.
15
15
  */
@@ -22,10 +22,6 @@ export interface PanelBarItemProps {
22
22
  * Sets the disabled state of the PanelBarItem ([see example]({% slug statesitems_panelbar %}#toc-disabled-items)).
23
23
  */
24
24
  disabled?: boolean;
25
- /**
26
- * @hidden
27
- */
28
- onSelect?: Function;
29
25
  /**
30
26
  * @hidden
31
27
  */
@@ -63,9 +59,13 @@ export interface PanelBarItemProps {
63
59
  */
64
60
  parentExpanded?: boolean;
65
61
  /**
66
- * @hidden
62
+ * Defines the custom rendering of the content of the PanelBarItem. Accepts a Vue component, a `render` function, or a slot name.
67
63
  */
68
64
  content?: any;
65
+ /**
66
+ * Defines the custom rendering of the header of the PanelBarItem. Accepts a Vue component, a `render` function, or a slot name.
67
+ */
68
+ header?: any;
69
69
  /**
70
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
71
  */
@@ -78,8 +78,4 @@ export interface PanelBarItemProps {
78
78
  * @hidden
79
79
  */
80
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
81
  }
@@ -15,6 +15,10 @@ export interface PanelBarProps {
15
15
  * Sets the animation state of the PanelBar.
16
16
  */
17
17
  animation?: boolean;
18
+ /**
19
+ * Sets the items of the PanelBar.
20
+ */
21
+ items?: any[];
18
22
  /**
19
23
  * Sets the expand mode of the PanelBar ([see example]({% slug expandmodes_panelbar %})).
20
24
  *
@@ -1,11 +1,11 @@
1
- import { PanelBarState } from '../PanelBar';
1
+ import { PanelBarData } from '../PanelBar';
2
2
  /**
3
3
  * @hidden
4
4
  */
5
5
  export interface RenderPanelBarItem {
6
6
  animation?: boolean;
7
7
  keepItemsMounted?: boolean;
8
- state: PanelBarState;
8
+ state: PanelBarData;
9
9
  expanded: string[];
10
10
  handleSelect: any;
11
11
  parentExpanded?: boolean;
@@ -1,18 +1,18 @@
1
- import { PanelBarState } from './PanelBar';
2
- import { PanelBarItemProps } from './interfaces/PanelBarItemProps';
1
+ import { PanelBarAll, PanelBarData } from './PanelBar';
2
+ import { RenderPanelBarItem } from './interfaces/RenderPanelBarItem';
3
3
  import { PanelBarExpandMode } from './interfaces/PanelBarProps';
4
4
  /**
5
5
  * @hidden
6
6
  */
7
- export declare const renderChildren: () => any;
7
+ export declare const renderChildren: (this: PanelBarAll, items: any[], { animation, keepItemsMounted, state, expanded, handleSelect, parentExpanded, level, parentPrivateKey }: RenderPanelBarItem) => any;
8
8
  /**
9
9
  * @hidden
10
10
  */
11
- export declare const getFirstId: (_props: any) => any;
11
+ export declare const getFirstId: (props: any) => any;
12
12
  /**
13
13
  * @hidden
14
14
  */
15
- export declare const getInitialState: (props: any, _expandMode: PanelBarExpandMode, result?: PanelBarState, _parentExpanded?: boolean, _parentPrivateKey?: string[]) => PanelBarState;
15
+ export declare const getInitialState: (props: any, expandMode: PanelBarExpandMode, result?: PanelBarData, parentExpanded?: boolean, parentPrivateKey?: string[]) => PanelBarData;
16
16
  /**
17
17
  * @hidden
18
18
  */
@@ -20,29 +20,15 @@ export declare function flatVisibleItems(data: any, flattedItems?: any[]): any[]
20
20
  /**
21
21
  * @hidden
22
22
  */
23
- export declare function flatChildren(_children: any, flattenChildren?: any[]): any[];
23
+ export declare function flatChildren(children: any, flattenChildren?: any[]): any[];
24
24
  /**
25
25
  * @hidden
26
26
  */
27
- export declare function flatVisibleChildren(_children: any, flattenVisibleChildren?: any[]): any[];
27
+ export declare function flatVisibleChildren(children: any, flattenVisibleChildren?: any[]): any[];
28
28
  /**
29
29
  * @hidden
30
30
  */
31
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
32
  /**
47
33
  * @hidden
48
34
  */