@progress/kendo-react-layout 5.17.0-dev.202308171202 → 5.17.0-dev.202308231118

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.
@@ -78,4 +78,54 @@ export interface BreadcrumbLinkHandle {
78
78
  */
79
79
  focus: () => void;
80
80
  }
81
+ /**
82
+ * Represents the [BreadcrumbLink](% slug api_layout_breadcrumblink %) component.
83
+ *
84
+ * @example
85
+ * ```jsx
86
+ * import { Breadcrumb, BreadcrumbLink } from '@progress/kendo-react-layout';
87
+ * const items = [
88
+ * {
89
+ * id: 'home',
90
+ * text: 'Home',
91
+ * iconClass: 'k-i-home',
92
+ * },
93
+ * {
94
+ * id: 'products',
95
+ * text: 'Products',
96
+ * },
97
+ * {
98
+ * id: 'computer',
99
+ * text: 'Computer',
100
+ * }
101
+ * ];
102
+ *
103
+ * const App = () => {
104
+ * const [data,setData] = React.useState(items);
105
+ * const handleItemSelect = (event, id) => {
106
+ * const itemIndex = data.findIndex((curValue) => curValue.id === id);
107
+ * const newData = data.slice(0, itemIndex + 1);
108
+ * setData(newData);
109
+ * };
110
+ *
111
+ * const CustomLink = (data) => {
112
+ * return (
113
+ * <BreadcrumbLink
114
+ * id={data.id}
115
+ * text={data.text}
116
+ * onItemSelect={(event) => handleItemSelect(event, data.id)}
117
+ * />
118
+ * );
119
+ * };
120
+ *
121
+ * return (
122
+ * <Breadcrumb
123
+ * data={data}
124
+ * breadcrumbLink={(items) => CustomLink(items)}
125
+ * />
126
+ * )}
127
+ *
128
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
129
+ * ```
130
+ */
81
131
  export declare const BreadcrumbLink: React.ForwardRefExoticComponent<BreadcrumbLinkProps & React.RefAttributes<BreadcrumbLinkHandle | null>>;
@@ -3,6 +3,56 @@ import * as PropTypes from 'prop-types';
3
3
  import { validatePackage } from '@progress/kendo-licensing';
4
4
  import { classNames, getTabIndex, useDir, dispatchEvent } from '@progress/kendo-react-common';
5
5
  import { packageMetadata } from '../package-metadata';
6
+ /**
7
+ * Represents the [BreadcrumbLink](% slug api_layout_breadcrumblink %) component.
8
+ *
9
+ * @example
10
+ * ```jsx
11
+ * import { Breadcrumb, BreadcrumbLink } from '@progress/kendo-react-layout';
12
+ * const items = [
13
+ * {
14
+ * id: 'home',
15
+ * text: 'Home',
16
+ * iconClass: 'k-i-home',
17
+ * },
18
+ * {
19
+ * id: 'products',
20
+ * text: 'Products',
21
+ * },
22
+ * {
23
+ * id: 'computer',
24
+ * text: 'Computer',
25
+ * }
26
+ * ];
27
+ *
28
+ * const App = () => {
29
+ * const [data,setData] = React.useState(items);
30
+ * const handleItemSelect = (event, id) => {
31
+ * const itemIndex = data.findIndex((curValue) => curValue.id === id);
32
+ * const newData = data.slice(0, itemIndex + 1);
33
+ * setData(newData);
34
+ * };
35
+ *
36
+ * const CustomLink = (data) => {
37
+ * return (
38
+ * <BreadcrumbLink
39
+ * id={data.id}
40
+ * text={data.text}
41
+ * onItemSelect={(event) => handleItemSelect(event, data.id)}
42
+ * />
43
+ * );
44
+ * };
45
+ *
46
+ * return (
47
+ * <Breadcrumb
48
+ * data={data}
49
+ * breadcrumbLink={(items) => CustomLink(items)}
50
+ * />
51
+ * )}
52
+ *
53
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
54
+ * ```
55
+ */
6
56
  export var BreadcrumbLink = React.forwardRef(function (props, ref) {
7
57
  validatePackage(packageMetadata);
8
58
  var target = React.useRef(null);
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-react-layout',
6
6
  productName: 'KendoReact',
7
7
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
- publishDate: 1692271013,
8
+ publishDate: 1692787346,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
11
11
  };
@@ -54,6 +54,7 @@ export declare class InternalTile extends React.Component<InternalTileProps, {
54
54
  dragging: boolean;
55
55
  resizing: boolean;
56
56
  element: HTMLElement | null;
57
+ hintElement: HTMLElement | null;
57
58
  get dragElement(): HTMLElement | null | undefined;
58
59
  ignoreDrag: boolean;
59
60
  pressOffset: {
@@ -47,6 +47,7 @@ var InternalTile = /** @class */ (function (_super) {
47
47
  _this.dragging = false;
48
48
  _this.resizing = false;
49
49
  _this.element = null;
50
+ _this.hintElement = null;
50
51
  _this.ignoreDrag = false;
51
52
  _this.pressOffset = { x: 0, y: 0 };
52
53
  _this.pressXY = { x: 0, y: 0 };
@@ -57,7 +58,7 @@ var InternalTile = /** @class */ (function (_super) {
57
58
  _this.handleRelease();
58
59
  return;
59
60
  }
60
- if (!_this.element) {
61
+ if (!_this.element || !_this.hintElement) {
61
62
  return;
62
63
  }
63
64
  var x = e.clientX;
@@ -74,7 +75,7 @@ var InternalTile = /** @class */ (function (_super) {
74
75
  }
75
76
  _this.dragElement.style.height = "calc(100% + ".concat(dY, "px)");
76
77
  }
77
- _this.element.classList.add('k-layout-item-hint', 'k-layout-item-hint-resize');
78
+ _this.hintElement.classList.add('k-layout-item-hint-resize');
78
79
  if (_this.preventDataOps) {
79
80
  return;
80
81
  }
@@ -111,9 +112,9 @@ var InternalTile = /** @class */ (function (_super) {
111
112
  _this.ignoreDrag = true;
112
113
  return;
113
114
  }
114
- if (_this.element) {
115
+ if (_this.element && _this.hintElement) {
115
116
  _this.element.style.zIndex = '10';
116
- _this.element.classList.add('k-layout-item-hint');
117
+ _this.hintElement.style.display = 'block';
117
118
  }
118
119
  _this.dragElement.classList.remove('k-cursor-grab');
119
120
  _this.dragElement.classList.add('k-cursor-grabbing');
@@ -162,9 +163,10 @@ var InternalTile = /** @class */ (function (_super) {
162
163
  _this.handleRelease = function () {
163
164
  _this.dragging = _this.resizing = false;
164
165
  _this.currentTranslate = { x: 0, y: 0 };
165
- if (_this.element) {
166
+ if (_this.element && _this.hintElement) {
166
167
  _this.element.style.zIndex = '1';
167
- _this.element.classList.remove('k-layout-item-hint', 'k-layout-item-hint-resize');
168
+ _this.hintElement.classList.remove('k-layout-item-hint-resize');
169
+ _this.hintElement.style.display = 'none';
168
170
  }
169
171
  var dragElement = _this.dragElement;
170
172
  if (dragElement) {
@@ -202,6 +204,10 @@ var InternalTile = /** @class */ (function (_super) {
202
204
  rtl: true
203
205
  });
204
206
  }
207
+ if (this.hintElement) {
208
+ this.hintElement.style.height = this.element.offsetHeight + 'px';
209
+ this.hintElement.style.width = this.element.offsetWidth + 'px';
210
+ }
205
211
  };
206
212
  InternalTile.prototype.render = function () {
207
213
  var _this = this;
@@ -211,11 +217,19 @@ var InternalTile = /** @class */ (function (_super) {
211
217
  }
212
218
  var position = this.props.defaultPosition;
213
219
  var resizable = this.props.resizable !== undefined ? this.props.resizable : InternalTile.defaultProps.resizable;
214
- var itemStyles = __assign({ gridColumnStart: position.col, gridColumnEnd: "span ".concat(position.colSpan), gridRowStart: position.row, gridRowEnd: "span ".concat(position.rowSpan), outline: 'none', order: position.order }, this.props.hintStyle);
215
- var card = (React.createElement("div", { ref: function (e) { _this.draggable = e ? ({ element: e }) : null; }, className: classNames('k-tilelayout-item k-card', { 'k-cursor-grab': this.reorderable }, this.props.className), style: __assign({ height: '100%' }, this.props.style) },
220
+ var hintItemStyles = __assign({ gridColumnStart: position.col, gridColumnEnd: "span ".concat(position.colSpan), gridRowStart: position.row, gridRowEnd: "span ".concat(position.rowSpan), outline: 'none', order: position.order, display: 'none' }, this.props.hintStyle);
221
+ var itemStyles = {
222
+ gridColumnStart: position.col,
223
+ gridColumnEnd: "span ".concat(position.colSpan),
224
+ gridRowStart: position.row,
225
+ gridRowEnd: "span ".concat(position.rowSpan),
226
+ order: position.order
227
+ };
228
+ var card = (React.createElement("div", { ref: function (e) { _this.draggable = e ? ({ element: e }) : null; }, className: classNames('k-tilelayout-item k-card', { 'k-cursor-grab': this.reorderable }, this.props.className), style: __assign(__assign({ height: '100%' }, itemStyles), this.props.style) },
216
229
  this.props.children,
217
230
  React.createElement(ResizeHandlers, { onPress: this.handlePress, onResize: this.handleResize, resizable: resizable, rtl: this.state.rtl })));
218
- return (React.createElement("div", { ref: function (e) { _this.element = e; }, style: itemStyles, className: this.props.hintClassName },
231
+ return (React.createElement("div", { ref: function (e) { _this.element = e; }, style: itemStyles },
232
+ React.createElement("div", { ref: function (e) { _this.hintElement = e; }, style: __assign({ position: 'absolute' }, hintItemStyles), className: classNames('k-layout-item-hint', this.props.hintClassName) }),
219
233
  React.createElement(Draggable, { ref: function (e) { _this.draggable = e; }, onDrag: this.props.reorderable ? this.handleDrag : undefined, onRelease: this.props.reorderable ? this.handleRelease : undefined, onPress: this.props.reorderable ? this.handlePress : undefined }, card)));
220
234
  };
221
235
  /**
@@ -78,4 +78,54 @@ export interface BreadcrumbLinkHandle {
78
78
  */
79
79
  focus: () => void;
80
80
  }
81
+ /**
82
+ * Represents the [BreadcrumbLink](% slug api_layout_breadcrumblink %) component.
83
+ *
84
+ * @example
85
+ * ```jsx
86
+ * import { Breadcrumb, BreadcrumbLink } from '@progress/kendo-react-layout';
87
+ * const items = [
88
+ * {
89
+ * id: 'home',
90
+ * text: 'Home',
91
+ * iconClass: 'k-i-home',
92
+ * },
93
+ * {
94
+ * id: 'products',
95
+ * text: 'Products',
96
+ * },
97
+ * {
98
+ * id: 'computer',
99
+ * text: 'Computer',
100
+ * }
101
+ * ];
102
+ *
103
+ * const App = () => {
104
+ * const [data,setData] = React.useState(items);
105
+ * const handleItemSelect = (event, id) => {
106
+ * const itemIndex = data.findIndex((curValue) => curValue.id === id);
107
+ * const newData = data.slice(0, itemIndex + 1);
108
+ * setData(newData);
109
+ * };
110
+ *
111
+ * const CustomLink = (data) => {
112
+ * return (
113
+ * <BreadcrumbLink
114
+ * id={data.id}
115
+ * text={data.text}
116
+ * onItemSelect={(event) => handleItemSelect(event, data.id)}
117
+ * />
118
+ * );
119
+ * };
120
+ *
121
+ * return (
122
+ * <Breadcrumb
123
+ * data={data}
124
+ * breadcrumbLink={(items) => CustomLink(items)}
125
+ * />
126
+ * )}
127
+ *
128
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
129
+ * ```
130
+ */
81
131
  export declare const BreadcrumbLink: React.ForwardRefExoticComponent<BreadcrumbLinkProps & React.RefAttributes<BreadcrumbLinkHandle | null>>;
@@ -6,6 +6,56 @@ var PropTypes = require("prop-types");
6
6
  var kendo_licensing_1 = require("@progress/kendo-licensing");
7
7
  var kendo_react_common_1 = require("@progress/kendo-react-common");
8
8
  var package_metadata_1 = require("../package-metadata");
9
+ /**
10
+ * Represents the [BreadcrumbLink](% slug api_layout_breadcrumblink %) component.
11
+ *
12
+ * @example
13
+ * ```jsx
14
+ * import { Breadcrumb, BreadcrumbLink } from '@progress/kendo-react-layout';
15
+ * const items = [
16
+ * {
17
+ * id: 'home',
18
+ * text: 'Home',
19
+ * iconClass: 'k-i-home',
20
+ * },
21
+ * {
22
+ * id: 'products',
23
+ * text: 'Products',
24
+ * },
25
+ * {
26
+ * id: 'computer',
27
+ * text: 'Computer',
28
+ * }
29
+ * ];
30
+ *
31
+ * const App = () => {
32
+ * const [data,setData] = React.useState(items);
33
+ * const handleItemSelect = (event, id) => {
34
+ * const itemIndex = data.findIndex((curValue) => curValue.id === id);
35
+ * const newData = data.slice(0, itemIndex + 1);
36
+ * setData(newData);
37
+ * };
38
+ *
39
+ * const CustomLink = (data) => {
40
+ * return (
41
+ * <BreadcrumbLink
42
+ * id={data.id}
43
+ * text={data.text}
44
+ * onItemSelect={(event) => handleItemSelect(event, data.id)}
45
+ * />
46
+ * );
47
+ * };
48
+ *
49
+ * return (
50
+ * <Breadcrumb
51
+ * data={data}
52
+ * breadcrumbLink={(items) => CustomLink(items)}
53
+ * />
54
+ * )}
55
+ *
56
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
57
+ * ```
58
+ */
9
59
  exports.BreadcrumbLink = React.forwardRef(function (props, ref) {
10
60
  (0, kendo_licensing_1.validatePackage)(package_metadata_1.packageMetadata);
11
61
  var target = React.useRef(null);
@@ -8,7 +8,7 @@ exports.packageMetadata = {
8
8
  name: '@progress/kendo-react-layout',
9
9
  productName: 'KendoReact',
10
10
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
11
- publishDate: 1692271013,
11
+ publishDate: 1692787346,
12
12
  version: '',
13
13
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
14
14
  };
@@ -54,6 +54,7 @@ export declare class InternalTile extends React.Component<InternalTileProps, {
54
54
  dragging: boolean;
55
55
  resizing: boolean;
56
56
  element: HTMLElement | null;
57
+ hintElement: HTMLElement | null;
57
58
  get dragElement(): HTMLElement | null | undefined;
58
59
  ignoreDrag: boolean;
59
60
  pressOffset: {
@@ -50,6 +50,7 @@ var InternalTile = /** @class */ (function (_super) {
50
50
  _this.dragging = false;
51
51
  _this.resizing = false;
52
52
  _this.element = null;
53
+ _this.hintElement = null;
53
54
  _this.ignoreDrag = false;
54
55
  _this.pressOffset = { x: 0, y: 0 };
55
56
  _this.pressXY = { x: 0, y: 0 };
@@ -60,7 +61,7 @@ var InternalTile = /** @class */ (function (_super) {
60
61
  _this.handleRelease();
61
62
  return;
62
63
  }
63
- if (!_this.element) {
64
+ if (!_this.element || !_this.hintElement) {
64
65
  return;
65
66
  }
66
67
  var x = e.clientX;
@@ -77,7 +78,7 @@ var InternalTile = /** @class */ (function (_super) {
77
78
  }
78
79
  _this.dragElement.style.height = "calc(100% + ".concat(dY, "px)");
79
80
  }
80
- _this.element.classList.add('k-layout-item-hint', 'k-layout-item-hint-resize');
81
+ _this.hintElement.classList.add('k-layout-item-hint-resize');
81
82
  if (_this.preventDataOps) {
82
83
  return;
83
84
  }
@@ -114,9 +115,9 @@ var InternalTile = /** @class */ (function (_super) {
114
115
  _this.ignoreDrag = true;
115
116
  return;
116
117
  }
117
- if (_this.element) {
118
+ if (_this.element && _this.hintElement) {
118
119
  _this.element.style.zIndex = '10';
119
- _this.element.classList.add('k-layout-item-hint');
120
+ _this.hintElement.style.display = 'block';
120
121
  }
121
122
  _this.dragElement.classList.remove('k-cursor-grab');
122
123
  _this.dragElement.classList.add('k-cursor-grabbing');
@@ -165,9 +166,10 @@ var InternalTile = /** @class */ (function (_super) {
165
166
  _this.handleRelease = function () {
166
167
  _this.dragging = _this.resizing = false;
167
168
  _this.currentTranslate = { x: 0, y: 0 };
168
- if (_this.element) {
169
+ if (_this.element && _this.hintElement) {
169
170
  _this.element.style.zIndex = '1';
170
- _this.element.classList.remove('k-layout-item-hint', 'k-layout-item-hint-resize');
171
+ _this.hintElement.classList.remove('k-layout-item-hint-resize');
172
+ _this.hintElement.style.display = 'none';
171
173
  }
172
174
  var dragElement = _this.dragElement;
173
175
  if (dragElement) {
@@ -205,6 +207,10 @@ var InternalTile = /** @class */ (function (_super) {
205
207
  rtl: true
206
208
  });
207
209
  }
210
+ if (this.hintElement) {
211
+ this.hintElement.style.height = this.element.offsetHeight + 'px';
212
+ this.hintElement.style.width = this.element.offsetWidth + 'px';
213
+ }
208
214
  };
209
215
  InternalTile.prototype.render = function () {
210
216
  var _this = this;
@@ -214,11 +220,19 @@ var InternalTile = /** @class */ (function (_super) {
214
220
  }
215
221
  var position = this.props.defaultPosition;
216
222
  var resizable = this.props.resizable !== undefined ? this.props.resizable : InternalTile.defaultProps.resizable;
217
- var itemStyles = __assign({ gridColumnStart: position.col, gridColumnEnd: "span ".concat(position.colSpan), gridRowStart: position.row, gridRowEnd: "span ".concat(position.rowSpan), outline: 'none', order: position.order }, this.props.hintStyle);
218
- var card = (React.createElement("div", { ref: function (e) { _this.draggable = e ? ({ element: e }) : null; }, className: (0, kendo_react_common_1.classNames)('k-tilelayout-item k-card', { 'k-cursor-grab': this.reorderable }, this.props.className), style: __assign({ height: '100%' }, this.props.style) },
223
+ var hintItemStyles = __assign({ gridColumnStart: position.col, gridColumnEnd: "span ".concat(position.colSpan), gridRowStart: position.row, gridRowEnd: "span ".concat(position.rowSpan), outline: 'none', order: position.order, display: 'none' }, this.props.hintStyle);
224
+ var itemStyles = {
225
+ gridColumnStart: position.col,
226
+ gridColumnEnd: "span ".concat(position.colSpan),
227
+ gridRowStart: position.row,
228
+ gridRowEnd: "span ".concat(position.rowSpan),
229
+ order: position.order
230
+ };
231
+ var card = (React.createElement("div", { ref: function (e) { _this.draggable = e ? ({ element: e }) : null; }, className: (0, kendo_react_common_1.classNames)('k-tilelayout-item k-card', { 'k-cursor-grab': this.reorderable }, this.props.className), style: __assign(__assign({ height: '100%' }, itemStyles), this.props.style) },
219
232
  this.props.children,
220
233
  React.createElement(ResizeHandlers_1.ResizeHandlers, { onPress: this.handlePress, onResize: this.handleResize, resizable: resizable, rtl: this.state.rtl })));
221
- return (React.createElement("div", { ref: function (e) { _this.element = e; }, style: itemStyles, className: this.props.hintClassName },
234
+ return (React.createElement("div", { ref: function (e) { _this.element = e; }, style: itemStyles },
235
+ React.createElement("div", { ref: function (e) { _this.hintElement = e; }, style: __assign({ position: 'absolute' }, hintItemStyles), className: (0, kendo_react_common_1.classNames)('k-layout-item-hint', this.props.hintClassName) }),
222
236
  React.createElement(kendo_react_common_1.Draggable, { ref: function (e) { _this.draggable = e; }, onDrag: this.props.reorderable ? this.handleDrag : undefined, onRelease: this.props.reorderable ? this.handleRelease : undefined, onPress: this.props.reorderable ? this.handlePress : undefined }, card)));
223
237
  };
224
238
  /**