@progress/kendo-react-listview 10.2.0-develop.1 → 10.2.0-develop.11

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.
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactListview={},e.React,e.KendoReactCommon)}(this,(function(e,t,s){"use strict";function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var r=a(t);const n={name:"@progress/kendo-react-listview",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"10.2.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},l="k-focus",o=r.forwardRef(((e,t)=>{const a=!s.validatePackage(n,{component:"ListView"}),{data:o=[],item:i,footer:c,header:d,className:u,style:m,onScroll:f,navigatable:v}=e,p=r.useRef(null),w=r.useRef(null),E=r.useCallback((()=>({onScroll:f,props:e,context:{},state:{},refs:{}})),[]);r.useImperativeHandle(w,E),r.useImperativeHandle(t,(()=>w.current));const k=r.useCallback((e=>s.dispatchEvent(f,e,E(),void 0)),[]),y=(e,t,s)=>{s.preventDefault(),t.focusNext(e),t.next(e).classList.add(l),t.previous(e).classList.remove(l)},b=(e,t,s)=>{s.preventDefault(),t.focusPrevious(e),t.next(e).classList.remove(l),t.previous(e).classList.add(l)},N=r.useMemo((()=>new s.Navigation({root:p,selectors:[".k-listview-item"],rovingTabIndex:!0,keyboardEvents:{keydown:{ArrowDown:y,ArrowRight:y,ArrowUp:b,ArrowLeft:b,Home:(e,t,s)=>{s.preventDefault();const a=t.first;a&&t.focusElement(a,e)},End:(e,t,s)=>{s.preventDefault();const a=t.last;a&&t.focusElement(a,e)},Tab:(e,t,s)=>{t.removeFocusClass(e)}}},tabIndex:0,focusClass:l})),[]),g=r.useCallback(N.triggerKeyboardEvent.bind(N),[]),L=r.useCallback((e=>{e.nativeEvent.target.classList.add(l),N.elements.forEach((t=>{t!==e.nativeEvent.target&&t.classList.remove(l)}))}),[]);return r.useEffect((()=>{if(v)return N.initializeRovingTab(),()=>N.removeFocusListener()}),[]),r.createElement("div",{className:s.classNames("k-listview",u),style:m,onKeyDown:e=>v&&g(e),onClick:L},d?r.createElement(d,null):null,r.createElement("div",{role:"list",className:"k-listview-content",onScroll:k,ref:p},i&&o.map(((e,t)=>r.createElement(i,{dataItem:e,index:t,key:t})))),c?r.createElement(c,null):null,a&&r.createElement(s.WatermarkOverlay,null))}));o.displayName="KendoReactListView";e.ListView=o,e.ListViewFooter=e=>r.createElement("div",{className:s.classNames("k-listview-footer",e.className),style:e.style},e.children),e.ListViewHeader=e=>r.createElement("div",{className:s.classNames("k-listview-header",e.className),style:e.style},e.children),e.ListViewItemWrapper=e=>{const{children:t,style:a,className:n}=e;return r.createElement("div",{role:"listitem",style:a,className:s.classNames("k-listview-item",n)},t)}}));
15
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactListview={},e.React,e.KendoReactCommon)}(this,(function(e,t,s){"use strict";function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var r=a(t);const n={name:"@progress/kendo-react-listview",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"10.2.0-develop.11",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},l="k-focus",o=r.forwardRef(((e,t)=>{const a=!s.validatePackage(n,{component:"ListView"}),{data:o=[],item:i,footer:c,header:d,className:u,style:m,onScroll:f,navigatable:v}=e,p=r.useRef(null),w=r.useRef(null),E=r.useCallback((()=>({onScroll:f,props:e,context:{},state:{},refs:{}})),[]);r.useImperativeHandle(w,E),r.useImperativeHandle(t,(()=>w.current));const k=r.useCallback((e=>s.dispatchEvent(f,e,E(),void 0)),[]),y=(e,t,s)=>{s.preventDefault(),t.focusNext(e),t.next(e).classList.add(l),t.previous(e).classList.remove(l)},b=(e,t,s)=>{s.preventDefault(),t.focusPrevious(e),t.next(e).classList.remove(l),t.previous(e).classList.add(l)},N=r.useMemo((()=>new s.Navigation({root:p,selectors:[".k-listview-item"],rovingTabIndex:!0,keyboardEvents:{keydown:{ArrowDown:y,ArrowRight:y,ArrowUp:b,ArrowLeft:b,Home:(e,t,s)=>{s.preventDefault();const a=t.first;a&&t.focusElement(a,e)},End:(e,t,s)=>{s.preventDefault();const a=t.last;a&&t.focusElement(a,e)},Tab:(e,t,s)=>{t.removeFocusClass(e)}}},tabIndex:0,focusClass:l})),[]),g=r.useCallback(N.triggerKeyboardEvent.bind(N),[]),L=r.useCallback((e=>{e.nativeEvent.target.classList.add(l),N.elements.forEach((t=>{t!==e.nativeEvent.target&&t.classList.remove(l)}))}),[]);return r.useEffect((()=>{if(v)return N.initializeRovingTab(),()=>N.removeFocusListener()}),[]),r.createElement("div",{className:s.classNames("k-listview",u),style:m,onKeyDown:e=>v&&g(e),onClick:L},d?r.createElement(d,null):null,r.createElement("div",{role:"list",className:"k-listview-content",onScroll:k,ref:p},i&&o.map(((e,t)=>r.createElement(i,{dataItem:e,index:t,key:t})))),c?r.createElement(c,null):null,a&&r.createElement(s.WatermarkOverlay,null))}));o.displayName="KendoReactListView";e.ListView=o,e.ListViewFooter=e=>r.createElement("div",{className:s.classNames("k-listview-footer",e.className),style:e.style},e.children),e.ListViewHeader=e=>r.createElement("div",{className:s.classNames("k-listview-header",e.className),style:e.style},e.children),e.ListViewItemWrapper=e=>{const{children:t,style:a,className:n}=e;return r.createElement("div",{role:"listitem",style:a,className:s.classNames("k-listview-item",n)},t)}}));
package/index.d.mts CHANGED
@@ -99,35 +99,81 @@ declare interface ListViewItemWrapperProps {
99
99
  export declare interface ListViewProps {
100
100
  /**
101
101
  * Sets a class of the ListView DOM element.
102
+ *
103
+ * @example
104
+ * ```jsx
105
+ * <ListView className="custom-class" />
106
+ * ```
102
107
  */
103
108
  className?: string;
104
109
  /**
105
110
  * Sets the data of the ListView.
111
+ *
112
+ * @example
113
+ * ```jsx
114
+ * <ListView data={[{ text: 'Item 1' }, { text: 'Item 2' }]} />
115
+ * ```
106
116
  */
107
117
  data?: any[];
108
118
  /**
109
119
  * Defines the component that will be rendered for each item of the data collection.
120
+ *
121
+ * @example
122
+ * ```jsx
123
+ * const CustomItem = (props) => <div>{props.text}</div>;
124
+ *
125
+ * <ListView item={CustomItem} />
126
+ * ```
110
127
  */
111
128
  item?: React.ComponentType<ListViewItemProps>;
112
129
  /**
113
- * Defines the component that will be rendered for ListView header.
130
+ * Defines the component that will be rendered for the ListView header.
131
+ *
132
+ * @example
133
+ * ```jsx
134
+ * const CustomHeader = (props) => <div>Custom Header</div>;
135
+ *
136
+ * <ListView header={CustomHeader} />
137
+ * ```
114
138
  */
115
139
  header?: React.ComponentType<any>;
116
140
  /**
117
- * Defines the component that will be rendered for ListView footer.
141
+ * Defines the component that will be rendered for the ListView footer.
142
+ *
143
+ * @example
144
+ * ```jsx
145
+ * const CustomFooter = (props) => <div>Custom Footer</div>;
146
+ *
147
+ * <ListView footer={CustomFooter} />
148
+ * ```
118
149
  */
119
150
  footer?: React.ComponentType<any>;
120
151
  /**
121
152
  * Sets styles to the ListView container.
153
+ *
154
+ * @example
155
+ * ```jsx
156
+ * <ListView style={{ height: '400px' }} />
157
+ * ```
122
158
  */
123
159
  style?: React.CSSProperties;
124
160
  /**
125
161
  * Fires when the ListView has been scrolled.
162
+ *
163
+ * @example
164
+ * ```jsx
165
+ * <ListView onScroll={(event) => console.log(event)} />
166
+ * ```
126
167
  */
127
168
  onScroll?: (event: ListViewEvent) => void;
128
169
  /**
129
170
  * If set to `true`, the user can use dedicated shortcuts to interact with the ListView.
130
171
  * By default, navigation is disabled.
172
+ *
173
+ * @example
174
+ * ```jsx
175
+ * <ListView navigatable={true} />
176
+ * ```
131
177
  */
132
178
  navigatable?: boolean;
133
179
  }
package/index.d.ts CHANGED
@@ -99,35 +99,81 @@ declare interface ListViewItemWrapperProps {
99
99
  export declare interface ListViewProps {
100
100
  /**
101
101
  * Sets a class of the ListView DOM element.
102
+ *
103
+ * @example
104
+ * ```jsx
105
+ * <ListView className="custom-class" />
106
+ * ```
102
107
  */
103
108
  className?: string;
104
109
  /**
105
110
  * Sets the data of the ListView.
111
+ *
112
+ * @example
113
+ * ```jsx
114
+ * <ListView data={[{ text: 'Item 1' }, { text: 'Item 2' }]} />
115
+ * ```
106
116
  */
107
117
  data?: any[];
108
118
  /**
109
119
  * Defines the component that will be rendered for each item of the data collection.
120
+ *
121
+ * @example
122
+ * ```jsx
123
+ * const CustomItem = (props) => <div>{props.text}</div>;
124
+ *
125
+ * <ListView item={CustomItem} />
126
+ * ```
110
127
  */
111
128
  item?: React.ComponentType<ListViewItemProps>;
112
129
  /**
113
- * Defines the component that will be rendered for ListView header.
130
+ * Defines the component that will be rendered for the ListView header.
131
+ *
132
+ * @example
133
+ * ```jsx
134
+ * const CustomHeader = (props) => <div>Custom Header</div>;
135
+ *
136
+ * <ListView header={CustomHeader} />
137
+ * ```
114
138
  */
115
139
  header?: React.ComponentType<any>;
116
140
  /**
117
- * Defines the component that will be rendered for ListView footer.
141
+ * Defines the component that will be rendered for the ListView footer.
142
+ *
143
+ * @example
144
+ * ```jsx
145
+ * const CustomFooter = (props) => <div>Custom Footer</div>;
146
+ *
147
+ * <ListView footer={CustomFooter} />
148
+ * ```
118
149
  */
119
150
  footer?: React.ComponentType<any>;
120
151
  /**
121
152
  * Sets styles to the ListView container.
153
+ *
154
+ * @example
155
+ * ```jsx
156
+ * <ListView style={{ height: '400px' }} />
157
+ * ```
122
158
  */
123
159
  style?: React.CSSProperties;
124
160
  /**
125
161
  * Fires when the ListView has been scrolled.
162
+ *
163
+ * @example
164
+ * ```jsx
165
+ * <ListView onScroll={(event) => console.log(event)} />
166
+ * ```
126
167
  */
127
168
  onScroll?: (event: ListViewEvent) => void;
128
169
  /**
129
170
  * If set to `true`, the user can use dedicated shortcuts to interact with the ListView.
130
171
  * By default, navigation is disabled.
172
+ *
173
+ * @example
174
+ * ```jsx
175
+ * <ListView navigatable={true} />
176
+ * ```
131
177
  */
132
178
  navigatable?: boolean;
133
179
  }
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-listview",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1743432556,version:"10.2.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-listview",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1745388354,version:"10.2.0-develop.11",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
@@ -10,8 +10,8 @@ const e = {
10
10
  productName: "KendoReact",
11
11
  productCode: "KENDOUIREACT",
12
12
  productCodes: ["KENDOUIREACT"],
13
- publishDate: 1743432556,
14
- version: "10.2.0-develop.1",
13
+ publishDate: 1745388354,
14
+ version: "10.2.0-develop.11",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
16
16
  };
17
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-listview",
3
- "version": "10.2.0-develop.1",
3
+ "version": "10.2.0-develop.11",
4
4
  "description": "React ListView enables you to display a custom layout of data items. KendoReact ListView package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -26,7 +26,7 @@
26
26
  "sideEffects": false,
27
27
  "peerDependencies": {
28
28
  "@progress/kendo-licensing": "^1.5.1",
29
- "@progress/kendo-react-common": "10.2.0-develop.1",
29
+ "@progress/kendo-react-common": "10.2.0-develop.11",
30
30
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
31
31
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
32
32
  },
@@ -51,7 +51,7 @@
51
51
  "package": {
52
52
  "productName": "KendoReact",
53
53
  "productCode": "KENDOUIREACT",
54
- "publishDate": 1743432556,
54
+ "publishDate": 1745388354,
55
55
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
56
56
  }
57
57
  },