@progress/kendo-react-listview 8.1.0-develop.9 → 8.1.1-develop.1

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/ListView.js CHANGED
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),a=require("@progress/kendo-react-common"),c=require("./package-metadata.js");function i(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,o.get?o:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const s=i(n);class p extends s.PureComponent{constructor(t){super(t),this.onScroll=e=>a.dispatchEvent(this.props.onScroll,e,this,void 0),a.validatePackage(c.packageMetadata)}render(){const{data:t=[],item:e}=this.props;return s.createElement("div",{className:a.classNames("k-listview",this.props.className),style:this.props.style},this.props.header?s.createElement(this.props.header,null):null,s.createElement("div",{role:"list",className:"k-listview-content",onScroll:this.onScroll},e&&t.map((o,l)=>s.createElement(e,{dataItem:o,index:l,key:l}))),this.props.footer?s.createElement(this.props.footer,null):null)}}exports.ListView=p;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),u=require("@progress/kendo-react-common"),I=require("./package-metadata.js");function S(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(s,r,l.get?l:{enumerable:!0,get:()=>n[r]})}}return s.default=n,Object.freeze(s)}const e=S(D),k=e.forwardRef((n,s)=>{u.validatePackage(I.packageMetadata);const{data:r=[],item:l,footer:d,header:f,className:y,style:E,onScroll:m}=n,v=e.useRef(null),p=e.useRef(null),g=e.useCallback(()=>({onScroll:m,props:n,context:{},state:{},refs:{}}),[]);e.useImperativeHandle(p,g),e.useImperativeHandle(s,()=>p.current);const N=e.useCallback(a=>u.dispatchEvent(m,a,g(),void 0),[]),w=(a,t,o)=>{o.preventDefault(),t.focusNext(a)},b=(a,t,o)=>{o.preventDefault(),t.focusPrevious(a)},i=e.useMemo(()=>new u.Navigation({root:v,selectors:[".k-listview-item"],keyboardEvents:{keydown:{ArrowDown:w,ArrowRight:w,ArrowUp:b,ArrowLeft:b,Home:(a,t,o)=>{o.preventDefault();const c=t.first;c&&t.focusElement(c,a)},End:(a,t,o)=>{o.preventDefault();const c=t.last;c&&t.focusElement(c,a)}}},tabIndex:0,focusClass:"k-focus"}),[]),R=e.useCallback(i.triggerKeyboardEvent.bind(i),[]);return e.useEffect(()=>(i.initializeRovingTab(),()=>i.removeFocusListener()),[]),e.createElement("div",{className:u.classNames("k-listview",y),style:E,onKeyDown:R},f?e.createElement(f,null):null,e.createElement("div",{role:"list",className:"k-listview-content",onScroll:N,ref:v},l&&r.map((a,t)=>e.createElement(l,{dataItem:a,index:t,key:t}))),d?e.createElement(d,null):null)});k.displayName="KendoReactListView";exports.ListView=k;
package/ListView.mjs CHANGED
@@ -7,29 +7,77 @@
7
7
  */
8
8
  "use client";
9
9
  import * as e from "react";
10
- import { dispatchEvent as l, validatePackage as a, classNames as i } from "@progress/kendo-react-common";
11
- import { packageMetadata as p } from "./package-metadata.mjs";
12
- class h extends e.PureComponent {
13
- constructor(s) {
14
- super(s), this.onScroll = (t) => l(this.props.onScroll, t, this, void 0), a(p);
15
- }
16
- /**
17
- * @hidden
18
- */
19
- render() {
20
- const { data: s = [], item: t } = this.props;
21
- return /* @__PURE__ */ e.createElement(
10
+ import { validatePackage as y, dispatchEvent as I, Navigation as R, classNames as h } from "@progress/kendo-react-common";
11
+ import { packageMetadata as D } from "./package-metadata.mjs";
12
+ const H = e.forwardRef((n, p) => {
13
+ y(D);
14
+ const { data: k = [], item: r, footer: c, header: i, className: E, style: g, onScroll: u } = n, m = e.useRef(null), f = e.useRef(null), d = e.useCallback(
15
+ () => ({
16
+ onScroll: u,
17
+ props: n,
18
+ context: {},
19
+ state: {},
20
+ refs: {}
21
+ }),
22
+ []
23
+ );
24
+ e.useImperativeHandle(f, d), e.useImperativeHandle(p, () => f.current);
25
+ const b = e.useCallback(
26
+ (a) => I(u, a, d(), void 0),
27
+ []
28
+ ), v = (a, t, s) => {
29
+ s.preventDefault(), t.focusNext(a);
30
+ }, w = (a, t, s) => {
31
+ s.preventDefault(), t.focusPrevious(a);
32
+ }, l = e.useMemo(
33
+ () => new R({
34
+ root: m,
35
+ selectors: [".k-listview-item"],
36
+ keyboardEvents: {
37
+ keydown: {
38
+ ArrowDown: v,
39
+ ArrowRight: v,
40
+ ArrowUp: w,
41
+ ArrowLeft: w,
42
+ Home: (a, t, s) => {
43
+ s.preventDefault();
44
+ const o = t.first;
45
+ o && t.focusElement(o, a);
46
+ },
47
+ End: (a, t, s) => {
48
+ s.preventDefault();
49
+ const o = t.last;
50
+ o && t.focusElement(o, a);
51
+ }
52
+ }
53
+ },
54
+ tabIndex: 0,
55
+ focusClass: "k-focus"
56
+ }),
57
+ []
58
+ ), N = e.useCallback(l.triggerKeyboardEvent.bind(l), []);
59
+ return e.useEffect(() => (l.initializeRovingTab(), () => l.removeFocusListener()), []), /* @__PURE__ */ e.createElement(
60
+ "div",
61
+ {
62
+ className: h("k-listview", E),
63
+ style: g,
64
+ onKeyDown: N
65
+ },
66
+ i ? /* @__PURE__ */ e.createElement(i, null) : null,
67
+ /* @__PURE__ */ e.createElement(
22
68
  "div",
23
69
  {
24
- className: i("k-listview", this.props.className),
25
- style: this.props.style
70
+ role: "list",
71
+ className: "k-listview-content",
72
+ onScroll: b,
73
+ ref: m
26
74
  },
27
- this.props.header ? /* @__PURE__ */ e.createElement(this.props.header, null) : null,
28
- /* @__PURE__ */ e.createElement("div", { role: "list", className: "k-listview-content", onScroll: this.onScroll }, t && s.map((o, r) => /* @__PURE__ */ e.createElement(t, { dataItem: o, index: r, key: r }))),
29
- this.props.footer ? /* @__PURE__ */ e.createElement(this.props.footer, null) : null
30
- );
31
- }
32
- }
75
+ r && k.map((a, t) => /* @__PURE__ */ e.createElement(r, { dataItem: a, index: t, key: t }))
76
+ ),
77
+ c ? /* @__PURE__ */ e.createElement(c, null) : null
78
+ );
79
+ });
80
+ H.displayName = "KendoReactListView";
33
81
  export {
34
- h as ListView
82
+ H as ListView
35
83
  };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),s=require("@progress/kendo-react-common");function a(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const i=a(n),o=e=>{const{children:r,style:t,className:c}=e;return i.createElement("div",{role:"listitem",style:t,className:s.classNames("k-listview-item",c)},r)};exports.ListViewItemWrapper=o;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import * as r from "react";
10
+ import { classNames as m } from "@progress/kendo-react-common";
11
+ const l = (e) => {
12
+ const { children: t, style: s, className: i } = e;
13
+ return /* @__PURE__ */ r.createElement(
14
+ "div",
15
+ {
16
+ role: "listitem",
17
+ style: s,
18
+ className: m("k-listview-item", i)
19
+ },
20
+ t
21
+ );
22
+ };
23
+ export {
24
+ l as ListViewItemWrapper
25
+ };
@@ -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
- !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 r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var o=r(t);const n={name:"@progress/kendo-react-listview",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};class i extends o.PureComponent{constructor(e){super(e),this.onScroll=e=>s.dispatchEvent(this.props.onScroll,e,this,void 0),s.validatePackage(n)}render(){const{data:e=[],item:t}=this.props;return o.createElement("div",{className:s.classNames("k-listview",this.props.className),style:this.props.style},this.props.header?o.createElement(this.props.header,null):null,o.createElement("div",{role:"list",className:"k-listview-content",onScroll:this.onScroll},t&&e.map(((e,s)=>o.createElement(t,{dataItem:e,index:s,key:s})))),this.props.footer?o.createElement(this.props.footer,null):null)}}e.ListView=i,e.ListViewFooter=e=>o.createElement("div",{className:s.classNames("k-listview-footer",e.className),style:e.style},e.children),e.ListViewHeader=e=>o.createElement("div",{className:s.classNames("k-listview-header",e.className),style:e.style},e.children)}));
8
+ !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 r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var a=r(t);const n={name:"@progress/kendo-react-listview",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},l=a.forwardRef(((e,t)=>{s.validatePackage(n);const{data:r=[],item:l,footer:o,header:i,className:c,style:u,onScroll:d}=e,m=a.useRef(null),f=a.useRef(null),p=a.useCallback((()=>({onScroll:d,props:e,context:{},state:{},refs:{}})),[]);a.useImperativeHandle(f,p),a.useImperativeHandle(t,(()=>f.current));const v=a.useCallback((e=>s.dispatchEvent(d,e,p(),void 0)),[]),w=(e,t,s)=>{s.preventDefault(),t.focusNext(e)},y=(e,t,s)=>{s.preventDefault(),t.focusPrevious(e)},E=a.useMemo((()=>new s.Navigation({root:m,selectors:[".k-listview-item"],keyboardEvents:{keydown:{ArrowDown:w,ArrowRight:w,ArrowUp:y,ArrowLeft:y,Home:(e,t,s)=>{s.preventDefault();const r=t.first;r&&t.focusElement(r,e)},End:(e,t,s)=>{s.preventDefault();const r=t.last;r&&t.focusElement(r,e)}}},tabIndex:0,focusClass:"k-focus"})),[]),k=a.useCallback(E.triggerKeyboardEvent.bind(E),[]);return a.useEffect((()=>(E.initializeRovingTab(),()=>E.removeFocusListener())),[]),a.createElement("div",{className:s.classNames("k-listview",c),style:u,onKeyDown:k},i?a.createElement(i,null):null,a.createElement("div",{role:"list",className:"k-listview-content",onScroll:v,ref:m},l&&r.map(((e,t)=>a.createElement(l,{dataItem:e,index:t,key:t})))),o?a.createElement(o,null):null)}));l.displayName="KendoReactListView";e.ListView=l,e.ListViewFooter=e=>a.createElement("div",{className:s.classNames("k-listview-footer",e.className),style:e.style},e.children),e.ListViewHeader=e=>a.createElement("div",{className:s.classNames("k-listview-header",e.className),style:e.style},e.children),e.ListViewItemWrapper=e=>{const{children:t,style:r,className:n}=e;return a.createElement("div",{role:"listitem",style:r,className:s.classNames("k-listview-item",n)},t)}}));
package/index.d.mts CHANGED
@@ -6,17 +6,12 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import { BaseEvent } from '@progress/kendo-react-common';
9
- import { JSX as JSX_2 } from 'react/jsx-runtime';
10
9
  import * as React_2 from 'react';
11
10
 
12
- export declare class ListView extends React_2.PureComponent<ListViewProps, {}> {
13
- constructor(props: ListViewProps);
14
- /**
15
- * @hidden
16
- */
17
- render(): JSX_2.Element;
18
- private onScroll;
19
- }
11
+ export declare const ListView: React_2.ForwardRefExoticComponent<ListViewProps & React_2.RefAttributes<ListViewHandle | null>>;
12
+
13
+ /** @hidden */
14
+ export declare type ListView = ListViewHandle;
20
15
 
21
16
  export declare interface ListViewEvent extends BaseEvent<ListView> {
22
17
  }
@@ -38,6 +33,17 @@ export declare interface ListViewFooterProps {
38
33
  className?: string;
39
34
  }
40
35
 
36
+ /**
37
+ * @hidden
38
+ */
39
+ declare interface ListViewHandle {
40
+ onScroll?: (event: ListViewEvent) => void;
41
+ props: ListViewProps;
42
+ context: {};
43
+ state: {};
44
+ refs: {};
45
+ }
46
+
41
47
  export declare const ListViewHeader: React_2.FunctionComponent<ListViewHeaderProps>;
42
48
 
43
49
  export declare interface ListViewHeaderProps {
@@ -69,6 +75,26 @@ export declare interface ListViewItemProps {
69
75
  index?: number;
70
76
  }
71
77
 
78
+ export declare const ListViewItemWrapper: React_2.FunctionComponent<ListViewItemWrapperProps>;
79
+
80
+ /**
81
+ * Represents the props of the each ListViewWrapper item.
82
+ */
83
+ declare interface ListViewItemWrapperProps {
84
+ /**
85
+ * Sets the ListViewItemWrapper children elements.
86
+ */
87
+ children?: React.ReactNode;
88
+ /**
89
+ * Sets additional CSS styles to the ListViewItemWrapper.
90
+ */
91
+ style?: React.CSSProperties;
92
+ /**
93
+ * Specifies the CSS class names which are set to the ListViewItemWrapper.
94
+ */
95
+ className?: string;
96
+ }
97
+
72
98
  /**
73
99
  * Represents the props of the [KendoReact ListView component]({% slug overview_listview %}).
74
100
  */
package/index.d.ts CHANGED
@@ -6,17 +6,12 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import { BaseEvent } from '@progress/kendo-react-common';
9
- import { JSX as JSX_2 } from 'react/jsx-runtime';
10
9
  import * as React_2 from 'react';
11
10
 
12
- export declare class ListView extends React_2.PureComponent<ListViewProps, {}> {
13
- constructor(props: ListViewProps);
14
- /**
15
- * @hidden
16
- */
17
- render(): JSX_2.Element;
18
- private onScroll;
19
- }
11
+ export declare const ListView: React_2.ForwardRefExoticComponent<ListViewProps & React_2.RefAttributes<ListViewHandle | null>>;
12
+
13
+ /** @hidden */
14
+ export declare type ListView = ListViewHandle;
20
15
 
21
16
  export declare interface ListViewEvent extends BaseEvent<ListView> {
22
17
  }
@@ -38,6 +33,17 @@ export declare interface ListViewFooterProps {
38
33
  className?: string;
39
34
  }
40
35
 
36
+ /**
37
+ * @hidden
38
+ */
39
+ declare interface ListViewHandle {
40
+ onScroll?: (event: ListViewEvent) => void;
41
+ props: ListViewProps;
42
+ context: {};
43
+ state: {};
44
+ refs: {};
45
+ }
46
+
41
47
  export declare const ListViewHeader: React_2.FunctionComponent<ListViewHeaderProps>;
42
48
 
43
49
  export declare interface ListViewHeaderProps {
@@ -69,6 +75,26 @@ export declare interface ListViewItemProps {
69
75
  index?: number;
70
76
  }
71
77
 
78
+ export declare const ListViewItemWrapper: React_2.FunctionComponent<ListViewItemWrapperProps>;
79
+
80
+ /**
81
+ * Represents the props of the each ListViewWrapper item.
82
+ */
83
+ declare interface ListViewItemWrapperProps {
84
+ /**
85
+ * Sets the ListViewItemWrapper children elements.
86
+ */
87
+ children?: React.ReactNode;
88
+ /**
89
+ * Sets additional CSS styles to the ListViewItemWrapper.
90
+ */
91
+ style?: React.CSSProperties;
92
+ /**
93
+ * Specifies the CSS class names which are set to the ListViewItemWrapper.
94
+ */
95
+ className?: string;
96
+ }
97
+
72
98
  /**
73
99
  * Represents the props of the [KendoReact ListView component]({% slug overview_listview %}).
74
100
  */
package/index.js CHANGED
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ListView.js"),i=require("./ListViewHeader.js"),t=require("./ListViewFooter.js");exports.ListView=e.ListView;exports.ListViewHeader=i.ListViewHeader;exports.ListViewFooter=t.ListViewFooter;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ListView.js"),i=require("./ListViewHeader.js"),t=require("./ListViewFooter.js"),r=require("./ListViewItemWrapper.js");exports.ListView=e.ListView;exports.ListViewHeader=i.ListViewHeader;exports.ListViewFooter=t.ListViewFooter;exports.ListViewItemWrapper=r.ListViewItemWrapper;
package/index.mjs CHANGED
@@ -6,11 +6,13 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import { ListView as r } from "./ListView.mjs";
9
+ import { ListView as t } from "./ListView.mjs";
10
10
  import { ListViewHeader as i } from "./ListViewHeader.mjs";
11
- import { ListViewFooter as f } from "./ListViewFooter.mjs";
11
+ import { ListViewFooter as m } from "./ListViewFooter.mjs";
12
+ import { ListViewItemWrapper as f } from "./ListViewItemWrapper.mjs";
12
13
  export {
13
- r as ListView,
14
- f as ListViewFooter,
15
- i as ListViewHeader
14
+ t as ListView,
15
+ m as ListViewFooter,
16
+ i as ListViewHeader,
17
+ f as ListViewItemWrapper
16
18
  };
@@ -10,7 +10,7 @@ const e = {
10
10
  name: "@progress/kendo-react-listview",
11
11
  productName: "KendoReact",
12
12
  productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
13
- publishDate: 1718182643,
13
+ publishDate: 1719494638,
14
14
  version: "",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-listview",
3
- "version": "8.1.0-develop.9",
3
+ "version": "8.1.1-develop.1",
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",
@@ -23,7 +23,7 @@
23
23
  "sideEffects": false,
24
24
  "peerDependencies": {
25
25
  "@progress/kendo-licensing": "^1.3.4",
26
- "@progress/kendo-react-common": "8.1.0-develop.9",
26
+ "@progress/kendo-react-common": "8.1.1-develop.1",
27
27
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
28
28
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
29
29
  },