@progress/kendo-react-scrollview 7.0.0-develop.8 → 7.0.0

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.
@@ -2,4 +2,4 @@
2
2
  * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the package root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- (function(a,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-svg-icons")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-svg-icons"],m):(a=typeof globalThis<"u"?globalThis:a||self,m(a.KendoReactScrollview={},a.React,a.PropTypes,a.KendoReactCommon,a.KendoSvgIcons))})(this,function(a,m,R,c,g){"use strict";function V(o){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const u in o)if(u!=="default"){const w=Object.getOwnPropertyDescriptor(o,u);Object.defineProperty(f,u,w.get?w:{enumerable:!0,get:()=>o[u]})}}return f.default=o,Object.freeze(f)}const e=V(m),s=V(R),D={name:"@progress/kendo-react-scrollview",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},h=e.forwardRef((o,f)=>{c.validatePackage(D);const{className:u,style:w,children:I,pagerOverlay:E,pageable:x,arrows:S,endless:n,activeView:_,automaticViewChange:O,automaticViewChangeInterval:T}=o,[t,i]=e.useState(_||1),d=e.useRef(null),y=e.useRef(null),N=e.useRef(null),l=e.Children.toArray(I),C=c.useRtl(d,o.dir),p=C==="rtl",K=e.useCallback(()=>{d.current&&d.current.focus()},[]),A=e.useCallback(()=>({element:d.current,focus:K}),[K]);e.useImperativeHandle(f,A);const k=e.useCallback(()=>{n?t>1?i(t-1):i(l.length):t>1&&i(t-1)},[t,l.length,n]),b=e.useCallback(()=>{n?t<l.length?i(t+1):i(1):t<l.length&&i(t+1)},[t,l.length,n]);e.useEffect(()=>{let r=l.length;y.current&&(y.current.style.setProperty("--kendo-scrollview-views",`${r}`),y.current.style.setProperty("--kendo-scrollview-current",`${t}`))},[l,t,C]);function P(){N.current&&clearTimeout(N.current)}e.useEffect(()=>{if(O)return P(),N.current=setTimeout(()=>i(r=>r===l.length?n?1:r:r+1),T),()=>{P()}},[O,T,l.length,t,n]);const M=e.useCallback(r=>{switch(r.keyCode){case c.Keys.left:r.preventDefault(),p?b():k();break;case c.Keys.right:r.preventDefault(),p?k():b();break}},[p,b,k]),q=e.useMemo(()=>c.classNames("k-scrollview",{"k-scrollview-light":E==="light","k-scrollview-dark":E==="dark"},u),[u,E]),L=e.Children.map(I||null,(r,v)=>e.createElement("div",{className:"k-scrollview-view","aria-hidden":t!==v+1},r)),z=e.useCallback(()=>{let r;return r=t>1,(n||r)&&l.length>0},[t,l.length,n]),U=e.useCallback(()=>{let r;return r=t<l.length,(n||r)&&l.length>0},[t,l.length,n]);return e.createElement("div",{className:q,style:w,ref:d,tabIndex:0,dir:C,onKeyDown:M},e.createElement("div",{className:"k-scrollview-wrap k-scrollview-animate",ref:y},L),e.createElement("div",{className:"k-scrollview-elements"},S&&e.createElement(e.Fragment,null,z()&&e.createElement("span",{className:"k-scrollview-prev","aria-label":"previous",onClick:k},e.createElement(c.IconWrap,{name:p?"chevron-right":"chevron-left",icon:p?g.chevronRightIcon:g.chevronLeftIcon,size:"xxxlarge"})),U()&&e.createElement("span",{className:"k-scrollview-next",onClick:b},e.createElement(c.IconWrap,{name:p?"chevron-left":"chevron-right",icon:p?g.chevronLeftIcon:g.chevronRightIcon,size:"xxxlarge"}))),x&&e.createElement("div",{className:"k-scrollview-nav-wrap"},e.createElement("div",{className:"k-scrollview-nav"},l.map((r,v)=>e.createElement("span",{className:c.classNames("k-link",{"k-primary":t===v+1}),key:v+1,onClick:()=>i(v+1)}))))))});h.propTypes={activeView:s.number,arrows:s.bool,automaticViewChange:s.bool,automaticViewChangeInterval:s.number,children:s.any,className:s.string,dir:s.string,endless:s.bool,pageable:s.bool,pageOverlay:s.string,style:s.object};const j={activeView:1,arrows:!0,automaticViewChange:!0,automaticViewChangeInterval:5e3,endless:!1,pageable:!0,pageOverlay:"none"};h.defaultProps=j,h.displayName="KendoScrollView",a.ScrollView=h,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
5
+ (function(n,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-svg-icons")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-svg-icons"],m):(n=typeof globalThis<"u"?globalThis:n||self,m(n.KendoReactScrollview={},n.React,n.PropTypes,n.KendoReactCommon,n.KendoSvgIcons))})(this,function(n,m,R,c,g){"use strict";"use client";function V(o){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const u in o)if(u!=="default"){const w=Object.getOwnPropertyDescriptor(o,u);Object.defineProperty(f,u,w.get?w:{enumerable:!0,get:()=>o[u]})}}return f.default=o,Object.freeze(f)}const e=V(m),s=V(R),D={name:"@progress/kendo-react-scrollview",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},h=e.forwardRef((o,f)=>{c.validatePackage(D);const{className:u,style:w,children:I,pagerOverlay:E,pageable:x,arrows:S,endless:a,activeView:_,automaticViewChange:O,automaticViewChangeInterval:T}=o,[t,i]=e.useState(_||1),d=e.useRef(null),y=e.useRef(null),N=e.useRef(null),l=e.Children.toArray(I),C=c.useRtl(d,o.dir),p=C==="rtl",K=e.useCallback(()=>{d.current&&d.current.focus()},[]),A=e.useCallback(()=>({element:d.current,focus:K}),[K]);e.useImperativeHandle(f,A);const k=e.useCallback(()=>{a?t>1?i(t-1):i(l.length):t>1&&i(t-1)},[t,l.length,a]),b=e.useCallback(()=>{a?t<l.length?i(t+1):i(1):t<l.length&&i(t+1)},[t,l.length,a]);e.useEffect(()=>{let r=l.length;y.current&&(y.current.style.setProperty("--kendo-scrollview-views",`${r}`),y.current.style.setProperty("--kendo-scrollview-current",`${t}`))},[l,t,C]);function P(){N.current&&clearTimeout(N.current)}e.useEffect(()=>{if(O)return P(),N.current=setTimeout(()=>i(r=>r===l.length?a?1:r:r+1),T),()=>{P()}},[O,T,l.length,t,a]);const M=e.useCallback(r=>{switch(r.keyCode){case c.Keys.left:r.preventDefault(),p?b():k();break;case c.Keys.right:r.preventDefault(),p?k():b();break}},[p,b,k]),q=e.useMemo(()=>c.classNames("k-scrollview",{"k-scrollview-light":E==="light","k-scrollview-dark":E==="dark"},u),[u,E]),L=e.Children.map(I||null,(r,v)=>e.createElement("div",{className:"k-scrollview-view","aria-hidden":t!==v+1},r)),z=e.useCallback(()=>{let r;return r=t>1,(a||r)&&l.length>0},[t,l.length,a]),U=e.useCallback(()=>{let r;return r=t<l.length,(a||r)&&l.length>0},[t,l.length,a]);return e.createElement("div",{className:q,style:w,ref:d,tabIndex:0,dir:C,onKeyDown:M},e.createElement("div",{className:"k-scrollview-wrap k-scrollview-animate",ref:y},L),e.createElement("div",{className:"k-scrollview-elements"},S&&e.createElement(e.Fragment,null,z()&&e.createElement("span",{className:"k-scrollview-prev","aria-label":"previous",onClick:k},e.createElement(c.IconWrap,{name:p?"chevron-right":"chevron-left",icon:p?g.chevronRightIcon:g.chevronLeftIcon,size:"xxxlarge"})),U()&&e.createElement("span",{className:"k-scrollview-next",onClick:b},e.createElement(c.IconWrap,{name:p?"chevron-left":"chevron-right",icon:p?g.chevronLeftIcon:g.chevronRightIcon,size:"xxxlarge"}))),x&&e.createElement("div",{className:"k-scrollview-nav-wrap"},e.createElement("div",{className:"k-scrollview-nav"},l.map((r,v)=>e.createElement("span",{className:c.classNames("k-link",{"k-primary":t===v+1}),key:v+1,onClick:()=>i(v+1)}))))))});h.propTypes={activeView:s.number,arrows:s.bool,automaticViewChange:s.bool,automaticViewChangeInterval:s.number,children:s.any,className:s.string,dir:s.string,endless:s.bool,pageable:s.bool,pageOverlay:s.string,style:s.object};const j={activeView:1,arrows:!0,automaticViewChange:!0,automaticViewChangeInterval:5e3,endless:!1,pageable:!0,pageOverlay:"none"};h.defaultProps=j,h.displayName="KendoScrollView",n.ScrollView=h,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
package/index.js CHANGED
@@ -2,4 +2,4 @@
2
2
  * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the package root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react"),q=require("prop-types"),o=require("@progress/kendo-react-common"),h=require("@progress/kendo-svg-icons");function O(s){const m=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const i in s)if(i!=="default"){const d=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(m,i,d.get?d:{enumerable:!0,get:()=>s[i]})}}return m.default=s,Object.freeze(m)}const e=O(M),a=O(q),L={name:"@progress/kendo-react-scrollview",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},k=e.forwardRef((s,m)=>{o.validatePackage(L);const{className:i,style:d,children:E,pagerOverlay:b,pageable:P,arrows:D,endless:n,activeView:T,automaticViewChange:N,automaticViewChangeInterval:R}=s,[t,c]=e.useState(T||1),g=e.useRef(null),p=e.useRef(null),y=e.useRef(null),r=e.Children.toArray(E),C=o.useRtl(g,s.dir),u=C==="rtl",I=e.useCallback(()=>{g.current&&g.current.focus()},[]),S=e.useCallback(()=>({element:g.current,focus:I}),[I]);e.useImperativeHandle(m,S);const f=e.useCallback(()=>{n?t>1?c(t-1):c(r.length):t>1&&c(t-1)},[t,r.length,n]),w=e.useCallback(()=>{n?t<r.length?c(t+1):c(1):t<r.length&&c(t+1)},[t,r.length,n]);e.useEffect(()=>{let l=r.length;p.current&&(p.current.style.setProperty("--kendo-scrollview-views",`${l}`),p.current.style.setProperty("--kendo-scrollview-current",`${t}`))},[r,t,C]);function V(){y.current&&clearTimeout(y.current)}e.useEffect(()=>{if(N)return V(),y.current=setTimeout(()=>c(l=>l===r.length?n?1:l:l+1),R),()=>{V()}},[N,R,r.length,t,n]);const K=e.useCallback(l=>{switch(l.keyCode){case o.Keys.left:l.preventDefault(),u?w():f();break;case o.Keys.right:l.preventDefault(),u?f():w();break}},[u,w,f]),j=e.useMemo(()=>o.classNames("k-scrollview",{"k-scrollview-light":b==="light","k-scrollview-dark":b==="dark"},i),[i,b]),_=e.Children.map(E||null,(l,v)=>e.createElement("div",{className:"k-scrollview-view","aria-hidden":t!==v+1},l)),x=e.useCallback(()=>{let l;return l=t>1,(n||l)&&r.length>0},[t,r.length,n]),A=e.useCallback(()=>{let l;return l=t<r.length,(n||l)&&r.length>0},[t,r.length,n]);return e.createElement("div",{className:j,style:d,ref:g,tabIndex:0,dir:C,onKeyDown:K},e.createElement("div",{className:"k-scrollview-wrap k-scrollview-animate",ref:p},_),e.createElement("div",{className:"k-scrollview-elements"},D&&e.createElement(e.Fragment,null,x()&&e.createElement("span",{className:"k-scrollview-prev","aria-label":"previous",onClick:f},e.createElement(o.IconWrap,{name:u?"chevron-right":"chevron-left",icon:u?h.chevronRightIcon:h.chevronLeftIcon,size:"xxxlarge"})),A()&&e.createElement("span",{className:"k-scrollview-next",onClick:w},e.createElement(o.IconWrap,{name:u?"chevron-left":"chevron-right",icon:u?h.chevronLeftIcon:h.chevronRightIcon,size:"xxxlarge"}))),P&&e.createElement("div",{className:"k-scrollview-nav-wrap"},e.createElement("div",{className:"k-scrollview-nav"},r.map((l,v)=>e.createElement("span",{className:o.classNames("k-link",{"k-primary":t===v+1}),key:v+1,onClick:()=>c(v+1)}))))))});k.propTypes={activeView:a.number,arrows:a.bool,automaticViewChange:a.bool,automaticViewChangeInterval:a.number,children:a.any,className:a.string,dir:a.string,endless:a.bool,pageable:a.bool,pageOverlay:a.string,style:a.object};const z={activeView:1,arrows:!0,automaticViewChange:!0,automaticViewChangeInterval:5e3,endless:!1,pageable:!0,pageOverlay:"none"};k.defaultProps=z;k.displayName="KendoScrollView";exports.ScrollView=k;
5
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react"),q=require("prop-types"),o=require("@progress/kendo-react-common"),h=require("@progress/kendo-svg-icons");function O(s){const m=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const i in s)if(i!=="default"){const d=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(m,i,d.get?d:{enumerable:!0,get:()=>s[i]})}}return m.default=s,Object.freeze(m)}const e=O(M),a=O(q),L={name:"@progress/kendo-react-scrollview",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},k=e.forwardRef((s,m)=>{o.validatePackage(L);const{className:i,style:d,children:E,pagerOverlay:b,pageable:P,arrows:D,endless:n,activeView:T,automaticViewChange:N,automaticViewChangeInterval:R}=s,[t,c]=e.useState(T||1),g=e.useRef(null),p=e.useRef(null),y=e.useRef(null),r=e.Children.toArray(E),C=o.useRtl(g,s.dir),u=C==="rtl",I=e.useCallback(()=>{g.current&&g.current.focus()},[]),S=e.useCallback(()=>({element:g.current,focus:I}),[I]);e.useImperativeHandle(m,S);const f=e.useCallback(()=>{n?t>1?c(t-1):c(r.length):t>1&&c(t-1)},[t,r.length,n]),w=e.useCallback(()=>{n?t<r.length?c(t+1):c(1):t<r.length&&c(t+1)},[t,r.length,n]);e.useEffect(()=>{let l=r.length;p.current&&(p.current.style.setProperty("--kendo-scrollview-views",`${l}`),p.current.style.setProperty("--kendo-scrollview-current",`${t}`))},[r,t,C]);function V(){y.current&&clearTimeout(y.current)}e.useEffect(()=>{if(N)return V(),y.current=setTimeout(()=>c(l=>l===r.length?n?1:l:l+1),R),()=>{V()}},[N,R,r.length,t,n]);const K=e.useCallback(l=>{switch(l.keyCode){case o.Keys.left:l.preventDefault(),u?w():f();break;case o.Keys.right:l.preventDefault(),u?f():w();break}},[u,w,f]),j=e.useMemo(()=>o.classNames("k-scrollview",{"k-scrollview-light":b==="light","k-scrollview-dark":b==="dark"},i),[i,b]),_=e.Children.map(E||null,(l,v)=>e.createElement("div",{className:"k-scrollview-view","aria-hidden":t!==v+1},l)),x=e.useCallback(()=>{let l;return l=t>1,(n||l)&&r.length>0},[t,r.length,n]),A=e.useCallback(()=>{let l;return l=t<r.length,(n||l)&&r.length>0},[t,r.length,n]);return e.createElement("div",{className:j,style:d,ref:g,tabIndex:0,dir:C,onKeyDown:K},e.createElement("div",{className:"k-scrollview-wrap k-scrollview-animate",ref:p},_),e.createElement("div",{className:"k-scrollview-elements"},D&&e.createElement(e.Fragment,null,x()&&e.createElement("span",{className:"k-scrollview-prev","aria-label":"previous",onClick:f},e.createElement(o.IconWrap,{name:u?"chevron-right":"chevron-left",icon:u?h.chevronRightIcon:h.chevronLeftIcon,size:"xxxlarge"})),A()&&e.createElement("span",{className:"k-scrollview-next",onClick:w},e.createElement(o.IconWrap,{name:u?"chevron-left":"chevron-right",icon:u?h.chevronLeftIcon:h.chevronRightIcon,size:"xxxlarge"}))),P&&e.createElement("div",{className:"k-scrollview-nav-wrap"},e.createElement("div",{className:"k-scrollview-nav"},r.map((l,v)=>e.createElement("span",{className:o.classNames("k-link",{"k-primary":t===v+1}),key:v+1,onClick:()=>c(v+1)}))))))});k.propTypes={activeView:a.number,arrows:a.bool,automaticViewChange:a.bool,automaticViewChangeInterval:a.number,children:a.any,className:a.string,dir:a.string,endless:a.bool,pageable:a.bool,pageOverlay:a.string,style:a.object};const z={activeView:1,arrows:!0,automaticViewChange:!0,automaticViewChangeInterval:5e3,endless:!1,pageable:!0,pageOverlay:"none"};k.defaultProps=z;k.displayName="KendoScrollView";exports.ScrollView=k;
package/index.mjs CHANGED
@@ -2,6 +2,7 @@
2
2
  * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the package root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
+ "use client";
5
6
  import * as e from "react";
6
7
  import * as r from "prop-types";
7
8
  import { validatePackage as B, useRtl as H, Keys as N, classNames as R, IconWrap as V } from "@progress/kendo-react-common";
@@ -10,7 +11,7 @@ const $ = {
10
11
  name: "@progress/kendo-react-scrollview",
11
12
  productName: "KendoReact",
12
13
  productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
13
- publishDate: 1701260593,
14
+ publishDate: 1702305173,
14
15
  version: "",
15
16
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
16
17
  }, d = e.forwardRef((f, K) => {
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-scrollview",
3
- "version": "7.0.0-develop.8",
3
+ "version": "7.0.0",
4
4
  "description": "React ScrollView (React Carousel) displays images or content in a horizontally scrollable collection. KendoReact ScrollView package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
7
7
  "homepage": "https://www.telerik.com/kendo-react-ui",
8
8
  "main": "./index.js",
9
+ "module": "./index.mjs",
9
10
  "types": "./index.d.ts",
10
11
  "exports": {
11
12
  ".": {
@@ -16,7 +17,7 @@
16
17
  "sideEffects": false,
17
18
  "peerDependencies": {
18
19
  "@progress/kendo-licensing": "^1.3.0",
19
- "@progress/kendo-react-common": "7.0.0-develop.8",
20
+ "@progress/kendo-react-common": "7.0.0",
20
21
  "@progress/kendo-svg-icons": "^2.0.0",
21
22
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
22
23
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"