@prom-ui/core 0.0.24 → 0.0.32
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/Body/cjs/index.development.js +14 -0
- package/Body/cjs/index.production.js +1 -0
- package/Body/cjs/style.development.css +1 -0
- package/Body/cjs/style.production.css +1 -0
- package/Body/index.js +5 -12
- package/Body/package.json +1 -1
- package/Box/cjs/index.development.js +20 -0
- package/Box/cjs/index.production.js +1 -0
- package/Box/cjs/style.development.css +1 -0
- package/Box/cjs/style.production.css +1 -0
- package/Box/index.js +5 -18
- package/Box/package.json +1 -1
- package/Button/cjs/index.development.js +95 -0
- package/Button/cjs/index.production.js +1 -0
- package/Button/cjs/style.development.css +1 -0
- package/Button/cjs/style.production.css +1 -0
- package/Button/index.d.ts +5 -4
- package/Button/index.js +4 -81
- package/Button/package.json +1 -1
- package/ButtonPageUp/cjs/index.development.js +170 -0
- package/ButtonPageUp/cjs/index.production.js +1 -0
- package/ButtonPageUp/index.d.ts +12 -5
- package/ButtonPageUp/index.js +4 -169
- package/ButtonPageUp/package.json +1 -2
- package/Checkbox/cjs/index.development.js +111 -0
- package/Checkbox/cjs/index.production.js +1 -0
- package/Checkbox/cjs/style.development.css +1 -0
- package/Checkbox/cjs/style.production.css +1 -0
- package/Checkbox/index.d.ts +4 -4
- package/Checkbox/index.js +4 -96
- package/Checkbox/package.json +1 -1
- package/Flex/cjs/index.development.js +25 -0
- package/Flex/cjs/index.production.js +1 -0
- package/Flex/cjs/style.development.css +1 -0
- package/Flex/cjs/style.production.css +1 -0
- package/Flex/index.js +5 -23
- package/Flex/package.json +1 -1
- package/Grid/cjs/index.development.js +25 -0
- package/Grid/cjs/index.production.js +1 -0
- package/Grid/cjs/style.development.css +1 -0
- package/Grid/cjs/style.production.css +1 -0
- package/Grid/index.js +5 -23
- package/Grid/package.json +1 -1
- package/Icon/cjs/index.development.js +41 -0
- package/Icon/cjs/index.production.js +1 -0
- package/Icon/cjs/style.development.css +1 -0
- package/Icon/cjs/style.production.css +1 -0
- package/Icon/index.d.ts +7 -12
- package/Icon/index.js +4 -76
- package/Icon/package.json +1 -1
- package/Image/cjs/index.development.js +20 -0
- package/Image/cjs/index.production.js +1 -0
- package/Image/cjs/style.development.css +1 -0
- package/Image/cjs/style.production.css +1 -0
- package/Image/index.js +5 -18
- package/Image/package.json +1 -1
- package/ImageEmoji/cjs/index.development.js +90 -0
- package/ImageEmoji/cjs/index.production.js +1 -0
- package/ImageEmoji/index.d.ts +6 -4
- package/ImageEmoji/index.js +4 -86
- package/ImageEmoji/package.json +1 -1
- package/Input/cjs/index.development.js +39 -0
- package/Input/cjs/index.production.js +1 -0
- package/Input/cjs/style.development.css +1 -0
- package/Input/cjs/style.production.css +1 -0
- package/Input/index.d.ts +23 -23
- package/Input/index.js +4 -81
- package/Input/package.json +1 -1
- package/KeyPress/cjs/index.development.js +56 -0
- package/KeyPress/cjs/index.production.js +1 -0
- package/KeyPress/index.d.ts +8 -7
- package/KeyPress/index.js +5 -53
- package/KeyPress/package.json +2 -5
- package/Line/cjs/index.development.js +20 -0
- package/Line/cjs/index.production.js +1 -0
- package/Line/cjs/style.development.css +1 -0
- package/Line/cjs/style.production.css +1 -0
- package/Line/index.js +5 -18
- package/Line/package.json +1 -1
- package/Link/cjs/index.development.js +22 -0
- package/Link/cjs/index.production.js +1 -0
- package/Link/cjs/style.development.css +1 -0
- package/Link/cjs/style.production.css +1 -0
- package/Link/index.js +5 -20
- package/Link/package.json +1 -1
- package/List/cjs/index.development.js +25 -0
- package/List/cjs/index.production.js +1 -0
- package/List/cjs/style.development.css +1 -0
- package/List/cjs/style.production.css +1 -0
- package/List/index.js +5 -23
- package/List/package.json +1 -1
- package/Media/cjs/index.development.js +98 -0
- package/Media/cjs/index.production.js +1 -0
- package/Media/context.d.ts +2 -2
- package/Media/index.d.ts +9 -11
- package/Media/index.js +5 -73
- package/Media/package.json +1 -1
- package/Media/useMedia.d.ts +7 -0
- package/OutsideClick/cjs/index.development.js +84 -0
- package/OutsideClick/cjs/index.production.js +1 -0
- package/OutsideClick/index.d.ts +6 -3
- package/OutsideClick/index.js +4 -74
- package/OutsideClick/package.json +2 -5
- package/Picture/cjs/index.development.js +25 -0
- package/Picture/cjs/index.production.js +1 -0
- package/Picture/cjs/style.development.css +1 -0
- package/Picture/cjs/style.production.css +1 -0
- package/Picture/index.js +5 -23
- package/Picture/package.json +1 -1
- package/PortableOverlay/cjs/index.development.js +111 -0
- package/PortableOverlay/cjs/index.production.js +1 -0
- package/PortableOverlay/cjs/style.development.css +1 -0
- package/PortableOverlay/cjs/style.production.css +1 -0
- package/PortableOverlay/index.d.ts +6 -4
- package/PortableOverlay/index.js +5 -112
- package/PortableOverlay/package.json +1 -2
- package/Portal/cjs/index.development.js +57 -0
- package/Portal/cjs/index.production.js +1 -0
- package/Portal/index.d.ts +6 -4
- package/Portal/index.js +5 -52
- package/Portal/package.json +2 -5
- package/Rating/cjs/index.development.js +105 -0
- package/Rating/cjs/index.production.js +1 -0
- package/Rating/cjs/style.development.css +1 -0
- package/Rating/cjs/style.production.css +1 -0
- package/Rating/index.d.ts +6 -5
- package/Rating/index.js +4 -98
- package/Rating/package.json +1 -1
- package/SafeQuery/cjs/index.development.js +181 -0
- package/SafeQuery/cjs/index.production.js +1 -0
- package/SafeQuery/cjs/style.development.css +1 -0
- package/SafeQuery/cjs/style.production.css +1 -0
- package/SafeQuery/components/Error.d.ts +2 -2
- package/SafeQuery/index.d.ts +7 -4
- package/SafeQuery/index.js +4 -173
- package/SafeQuery/package.json +1 -1
- package/Scroll/cjs/index.development.js +40 -0
- package/Scroll/cjs/index.production.js +1 -0
- package/Scroll/cjs/style.development.css +1 -0
- package/Scroll/cjs/style.production.css +1 -0
- package/Scroll/index.d.ts +18 -16
- package/Scroll/index.js +4 -76
- package/Scroll/package.json +1 -1
- package/ScrollControls/cjs/index.development.js +243 -0
- package/ScrollControls/cjs/index.production.js +1 -0
- package/ScrollControls/cjs/style.development.css +1 -0
- package/ScrollControls/cjs/style.production.css +1 -0
- package/ScrollControls/index.d.ts +16 -6
- package/ScrollControls/index.js +4 -244
- package/ScrollControls/package.json +1 -2
- package/SideOverlay/cjs/index.development.js +210 -0
- package/SideOverlay/cjs/index.production.js +1 -0
- package/SideOverlay/cjs/style.development.css +1 -0
- package/SideOverlay/cjs/style.production.css +1 -0
- package/SideOverlay/index.d.ts +29 -14
- package/SideOverlay/index.js +4 -251
- package/SideOverlay/package.json +1 -1
- package/SimpleSlider/cjs/index.development.js +433 -0
- package/SimpleSlider/cjs/index.production.js +1 -0
- package/SimpleSlider/cjs/style.development.css +1 -0
- package/SimpleSlider/cjs/style.production.css +1 -0
- package/SimpleSlider/index.d.ts +17 -3
- package/SimpleSlider/index.js +4 -477
- package/SimpleSlider/package.json +1 -1
- package/Skeleton/cjs/index.development.js +103 -0
- package/Skeleton/cjs/index.production.js +1 -0
- package/Skeleton/cjs/style.development.css +1 -0
- package/Skeleton/cjs/style.production.css +1 -0
- package/Skeleton/index.d.ts +9 -5
- package/Skeleton/index.js +4 -110
- package/Skeleton/package.json +1 -1
- package/Spinner/cjs/index.development.js +85 -0
- package/Spinner/cjs/index.production.js +1 -0
- package/Spinner/cjs/style.development.css +1 -0
- package/Spinner/cjs/style.production.css +1 -0
- package/Spinner/index.d.ts +7 -6
- package/Spinner/index.js +5 -76
- package/Spinner/package.json +1 -1
- package/Text/cjs/index.development.js +20 -0
- package/Text/cjs/index.production.js +1 -0
- package/Text/cjs/style.development.css +1 -0
- package/Text/cjs/style.production.css +1 -0
- package/Text/index.js +5 -18
- package/Text/package.json +1 -1
- package/TextEmoji/cjs/index.development.js +94 -0
- package/TextEmoji/cjs/index.production.js +1 -0
- package/TextEmoji/index.d.ts +4 -4
- package/TextEmoji/index.js +4 -84
- package/TextEmoji/package.json +1 -1
- package/Tumbler/cjs/index.development.js +110 -0
- package/Tumbler/cjs/index.production.js +1 -0
- package/Tumbler/cjs/style.development.css +1 -0
- package/Tumbler/cjs/style.production.css +1 -0
- package/Tumbler/index.d.ts +4 -4
- package/Tumbler/index.js +4 -95
- package/Tumbler/package.json +1 -1
- package/package.json +7 -10
- package/Body/style.css +0 -741
- package/Box/style.css +0 -9676
- package/Button/style.css +0 -3393
- package/Checkbox/style.css +0 -133
- package/Flex/style.css +0 -786
- package/Grid/style.css +0 -7350
- package/Icon/style.css +0 -46
- package/Image/style.css +0 -664
- package/Input/style.css +0 -345
- package/Line/style.css +0 -138
- package/Link/style.css +0 -259
- package/List/style.css +0 -312
- package/Picture/style.css +0 -1426
- package/PortableOverlay/style.css +0 -44
- package/Rating/style.css +0 -26
- package/SafeQuery/style.css +0 -4
- package/Scroll/style.css +0 -169
- package/ScrollControls/style.css +0 -67
- package/SideOverlay/style.css +0 -208
- package/SimpleSlider/style.css +0 -134
- package/Skeleton/style.css +0 -145
- package/Spinner/style.css +0 -80
- package/Text/style.css +0 -840
- package/Tumbler/style.css +0 -118
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("ttag"),n=require("react-easy-swipe"),r=require("classnames");require("intersection-observer");var i=require("@prom-ui/core/Button");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=a(e),u=o(n),s=o(r),l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},l.apply(this,arguments)};function f(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var d,v,p,m=function(e){return!!e&&/\d\/\d/.test(e)},h=function(e,t){return Math.abs((e%t+t)%t)},y=function(e){return{paddingTop:"calc(".concat(e.split("/").reverse().join("/")," * 100%)")}},w=function(e){var t=e.width,n=e.height,r=e.ratio,i=e.style,o=m(r);return l({width:t,height:o?"auto":n,maxWidth:o?"100%":"none",aspectRatio:o?r:void 0},i)},x=function(e){var t=e.index,n=e.childrenCount,r=e.duration,i=e.offset,o="number"==typeof i,a=o?i:0;return{transform:"translateX(calc(".concat(t*(100/n)*-1,"% + ").concat(a,"px))"),transition:o?void 0:"transform ".concat(r,"ms ease"),width:"".concat(100*n,"%")}},b="WuTIM",g="G8BYu",E="_94Eq7",O="UqTOk I5yQD",N="BbLNv I5yQD",C="_89h6n",k="yssoj",j="E7g4J",S="cbWCu",P="_7N4yb",B="ig5DV",q=c.forwardRef((function(n,r){var o,a,q,_,L,I=n.autoPlay,M=void 0===I?0:I,D=n.children,R=n.className,T=n.duration,H=void 0===T?500:T,z=n.height,W=n.infinite,Q=void 0!==W&&W,A=n.ratio,F=n.style,G=n.width,J=n.onChangeIndex,U=n.onClickDot,V=n.onClickItem,X=n.onClickButtonNext,Y=n.onClickButtonPrev,K=n.onSwipeNext,Z=n.onSwipePrev,$=n.showOnHoverButtons,ee=void 0!==$&&$,te=n.showOnHoverDots,ne=void 0!==te&&te,re=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(n,["autoPlay","children","className","duration","height","infinite","ratio","style","width","onChangeIndex","onClickDot","onClickItem","onClickButtonNext","onClickButtonPrev","onSwipeNext","onSwipePrev","showOnHoverButtons","showOnHoverDots"]),ie=c.useRef(null),oe=c.useRef(!1),ae=c.useState(!1),ce=ae[0],ue=ae[1],se=c.useState({index:0,offset:void 0}),le=se[0],fe=se[1],de=c.Children.count(D),ve=c.Children.toArray(D),pe=!Q&&0===le.index,me=!Q&&le.index===de-1,he=de>1,ye=de>1,we=!ce&&M>0,xe=le.index-1,be=le.index+1,ge=h(le.index,de),Ee=h(xe,de),Oe=h(be,de),Ne=(a=function(){oe.current||me||fe({index:be,offset:void 0})},q=M,_=e.useRef(null),[function(){L(),_.current=setTimeout(a,q)},L=function(){clearTimeout(_.current)}]),Ce=Ne[0],ke=Ne[1],je=function(){oe.current=!0,ke()},Se=function(){oe.current=!1,we&&Ce(),le.index in ve||fe({index:ge,offset:0}),"function"==typeof J&&J(ge)};return c.useEffect((function(){var e,t,n=new IntersectionObserver((function(e){e[0].isIntersecting?Ce():ke()}));return null===(e=ie.current)||void 0===e||e.addEventListener("transitionstart",je),null===(t=ie.current)||void 0===t||t.addEventListener("transitionend",Se),we&&ie.current&&n.observe(ie.current),function(){var e,t;null===(e=ie.current)||void 0===e||e.removeEventListener("transitionstart",je),null===(t=ie.current)||void 0===t||t.removeEventListener("transitionend",Se),ke(),n.disconnect()}}),[le.index,we]),c.createElement(u.default,l({ref:r,onSwipeLeft:function(){oe.current||me||("function"==typeof K&&K(Oe),fe({index:be,offset:void 0}))},onSwipeRight:function(){oe.current||pe||("function"==typeof Z&&Z(Ee),fe({index:xe,offset:void 0}))},onSwipeMove:function(e,t){var n=e.x;if(!(oe.current||t.touches&&t.touches.length>1)){var r=n;(pe&&n>0||me&&n<0)&&(r=0),fe({index:le.index,offset:r})}},className:s.default(b,R,(o={},o[k]=ee,o[B]=ne,o)),style:w({width:G,height:z,ratio:A,style:F}),onSwipeStart:function(){return ue(!0)},onSwipeEnd:function(){return ue(!1)},onMouseEnter:function(){return ue(!0)},onMouseLeave:function(){return ue(!1)}},re),m(A)&&c.createElement("div",{style:y(A)}),c.createElement("ul",{ref:ie,className:g,style:x({index:Q?le.index+1:le.index,childrenCount:Q?de+2:de,duration:H,offset:le.offset})},Q&&c.createElement("li",{className:E},ve[ve.length-1]),ve.map((function(e,t){return c.createElement("li",{key:e.key,className:E,onClick:function(){"function"==typeof V&&V(t)},"data-qaid":"image_slider_".concat(t)},e)})),Q&&c.createElement("li",{className:E},ve[0])),he&&c.createElement(c.Fragment,null,c.createElement(i.Button,{type:"button",className:O,onClick:function(){oe.current||pe||("function"==typeof Y&&Y(Ee),fe({index:xe,offset:void 0}))},disabled:pe,"aria-label":t.t(d||(d=f(["Показать предыдущий баннер"],["Показать предыдущий баннер"]))),"data-qaid":"prev_image"},c.createElement("svg",{className:C,width:18,height:18,viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg"},c.createElement("path",{d:"M41.625 60.375L16 32 41.625 3.625 48.5 10 28.375 32 48.5 54z"}))),c.createElement(i.Button,{type:"button",className:N,onClick:function(){oe.current||me||("function"==typeof X&&X(Oe),fe({index:be,offset:void 0}))},disabled:me,"aria-label":t.t(v||(v=f(["Показать следующий баннер"],["Показать следующий баннер"]))),"data-qaid":"next_image"},c.createElement("svg",{className:C,width:18,height:18,viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg"},c.createElement("path",{d:"M22.875 60.375L16 54l20.125-22L16 10l6.875-6.375L48.5 32z"})))),ye&&c.createElement("ul",{className:j},ve.map((function(e,n){var r=n+1;return c.createElement("li",{className:S,key:e.key},c.createElement(i.Button,{className:P,type:"button",onClick:function(){return e=n,void(oe.current||("function"==typeof U&&U(e),fe({index:e,offset:void 0})));var e},disabled:n===ge,"aria-label":t.t(p||(p=f(["Показать баннер номер ",""],["Показать баннер номер ",""])),r),"data-qaid":"view_image_".concat(r)},r))}))))}));exports.SimpleSlider=q,require("./style.production.css");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.SimpleSlider__root___WuTIM{position:relative;overflow:hidden;height:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}.SimpleSlider__track___G8BYu{position:absolute;left:0;top:0;height:100%;list-style:none;padding:0;margin:0;width:100%;display:flex;flex-wrap:nowrap}.SimpleSlider__trackItem___94Eq7{position:relative;display:block;flex:1;min-width:0}.SimpleSlider__buttonCommon___I5yQD{position:absolute;top:50%;transform:translateY(-50%);font-weight:400;border:0;border-radius:4px;background:var(--white);box-shadow:0 0 10px rgba(0,0,0,.08);padding:0;width:30px;height:66px;max-height:70%}.SimpleSlider__buttonCommon___I5yQD:disabled{opacity:.3;pointer-events:auto}.SimpleSlider__buttonCommon___I5yQD:active{background:var(--black-200)}.SimpleSlider__buttonPrev___UqTOk{left:0;margin-left:8px}.SimpleSlider__buttonNext___BbLNv{right:0;margin-right:8px}.SimpleSlider__buttonIcon___89h6n{fill:currentColor}.SimpleSlider__showOnHoverButtons___yssoj .SimpleSlider__buttonNext___BbLNv{right:-40px}.SimpleSlider__showOnHoverButtons___yssoj .SimpleSlider__buttonPrev___UqTOk{left:-40px}.SimpleSlider__dots___E7g4J{position:absolute;left:50%;bottom:0;transform:translateX(-50%);display:flex;align-items:center;list-style:none;padding:4px 8px;margin:0 0 8px;background:var(--white);border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.08);transition:bottom 150ms ease-in-out}.SimpleSlider__dotsItem___cbWCu{display:block}.SimpleSlider__dotsItem___cbWCu+.SimpleSlider__dotsItem___cbWCu{margin-left:6px}.SimpleSlider__dotsButton___7N4yb{display:block;padding:0;width:6px;height:6px;border-radius:50%;font-size:0;background:var(--black-400)}.SimpleSlider__dotsButton___7N4yb:hover{background:var(--black-500)}.SimpleSlider__dotsButton___7N4yb:disabled{background:var(--yellow-500)}.SimpleSlider__showOnHoverDots___ig5DV .SimpleSlider__dots___E7g4J{bottom:-24px}@media (hover:hover){.SimpleSlider__showOnHoverButtons___yssoj:hover .SimpleSlider__buttonNext___BbLNv{right:0}.SimpleSlider__showOnHoverButtons___yssoj:hover .SimpleSlider__buttonPrev___UqTOk{left:0}.SimpleSlider__showOnHoverDots___ig5DV:hover .SimpleSlider__dots___E7g4J{bottom:0}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.WuTIM{position:relative;overflow:hidden;height:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}.G8BYu{position:absolute;left:0;top:0;height:100%;list-style:none;padding:0;margin:0;width:100%;display:flex;flex-wrap:nowrap}._94Eq7{position:relative;display:block;flex:1;min-width:0}.I5yQD{position:absolute;top:50%;transform:translateY(-50%);font-weight:400;border:0;border-radius:4px;background:var(--white);box-shadow:0 0 10px rgba(0,0,0,.08);padding:0;width:30px;height:66px;max-height:70%}.I5yQD:disabled{opacity:.3;pointer-events:auto}.I5yQD:active{background:var(--black-200)}.UqTOk{left:0;margin-left:8px}.BbLNv{right:0;margin-right:8px}._89h6n{fill:currentColor}.yssoj .BbLNv{right:-40px}.yssoj .UqTOk{left:-40px}.E7g4J{position:absolute;left:50%;bottom:0;transform:translateX(-50%);display:flex;align-items:center;list-style:none;padding:4px 8px;margin:0 0 8px;background:var(--white);border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.08);transition:bottom 150ms ease-in-out}.cbWCu{display:block}.cbWCu+.cbWCu{margin-left:6px}._7N4yb{display:block;padding:0;width:6px;height:6px;border-radius:50%;font-size:0;background:var(--black-400)}._7N4yb:hover{background:var(--black-500)}._7N4yb:disabled{background:var(--yellow-500)}.ig5DV .E7g4J{bottom:-24px}@media (hover:hover){.yssoj:hover .BbLNv{right:0}.yssoj:hover .UqTOk{left:0}.ig5DV:hover .E7g4J{bottom:0}}
|
package/SimpleSlider/index.d.ts
CHANGED
|
@@ -1,23 +1,37 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import 'intersection-observer';
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type SimpleSliderProps = {
|
|
4
|
+
/** React children */
|
|
4
5
|
children: React.ReactNode;
|
|
5
6
|
height: number | string;
|
|
6
7
|
width: number | string;
|
|
8
|
+
/** Автоматические листание в `ms`, по умолчанию `0` - выключено */
|
|
7
9
|
autoPlay?: number;
|
|
8
10
|
className?: string;
|
|
11
|
+
/** Скорость анимации листания в `ms` */
|
|
9
12
|
duration?: number;
|
|
13
|
+
/** Бесконечное листание */
|
|
10
14
|
infinite?: boolean;
|
|
15
|
+
/** Соотношение сторон `16/9`, `4/3`, `1/1` или нестандартное `900/400` */
|
|
11
16
|
ratio: string;
|
|
12
17
|
style?: React.CSSProperties;
|
|
18
|
+
/** Показывать при наведении кнопки по бокам Вперед и Назад */
|
|
13
19
|
showOnHoverButtons?: boolean;
|
|
20
|
+
/** Показывать при наведении точки снизу */
|
|
14
21
|
showOnHoverDots?: boolean;
|
|
22
|
+
/** Обратный вызов изменения `index` в конце анимации `(index) =>` */
|
|
15
23
|
onChangeIndex?: (index: number) => void;
|
|
24
|
+
/** Обратный вызов изменения `(index) =>` */
|
|
16
25
|
onClickDot?: (index: number) => void;
|
|
26
|
+
/** Обратный вызов изменения `(index) =>` */
|
|
17
27
|
onClickItem?: (index: number) => void;
|
|
28
|
+
/** Обратный вызов изменения `(index) =>` */
|
|
18
29
|
onClickButtonNext?: (index: number) => void;
|
|
30
|
+
/** Обратный вызов изменения `(index) =>` */
|
|
19
31
|
onClickButtonPrev?: (index: number) => void;
|
|
32
|
+
/** Обратный вызов изменения `(index) =>` */
|
|
20
33
|
onSwipeNext?: (index: number) => void;
|
|
34
|
+
/** Обратный вызов изменения `(index) =>` */
|
|
21
35
|
onSwipePrev?: (index: number) => void;
|
|
22
36
|
};
|
|
23
|
-
export declare const SimpleSlider: React.
|
|
37
|
+
export declare const SimpleSlider: React.ForwardRefExoticComponent<SimpleSliderProps & React.RefAttributes<any>>;
|
package/SimpleSlider/index.js
CHANGED
|
@@ -1,480 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var ttag = require('ttag');
|
|
8
|
-
var Swipe = require('react-easy-swipe');
|
|
9
|
-
var classNames = require('classnames');
|
|
10
|
-
require('intersection-observer');
|
|
11
|
-
var Button = require('@prom-ui/core/Button');
|
|
12
|
-
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
-
|
|
15
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
17
|
-
var Swipe__default = /*#__PURE__*/_interopDefaultLegacy(Swipe);
|
|
18
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
19
|
-
|
|
20
|
-
/******************************************************************************
|
|
21
|
-
Copyright (c) Microsoft Corporation.
|
|
22
|
-
|
|
23
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
24
|
-
purpose with or without fee is hereby granted.
|
|
25
|
-
|
|
26
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
27
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
28
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
29
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
30
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
31
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
32
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
33
|
-
***************************************************************************** */
|
|
34
|
-
|
|
35
|
-
var __assign = function() {
|
|
36
|
-
__assign = Object.assign || function __assign(t) {
|
|
37
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
38
|
-
s = arguments[i];
|
|
39
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
40
|
-
}
|
|
41
|
-
return t;
|
|
42
|
-
};
|
|
43
|
-
return __assign.apply(this, arguments);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
function __rest(s, e) {
|
|
47
|
-
var t = {};
|
|
48
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
49
|
-
t[p] = s[p];
|
|
50
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
51
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
52
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
53
|
-
t[p[i]] = s[p[i]];
|
|
54
|
-
}
|
|
55
|
-
return t;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function __makeTemplateObject(cooked, raw) {
|
|
59
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
60
|
-
return cooked;
|
|
3
|
+
if (process.env.NODE_ENV === 'production') {
|
|
4
|
+
module.exports = require('./cjs/index.production.js');
|
|
5
|
+
} else {
|
|
6
|
+
module.exports = require('./cjs/index.development.js');
|
|
61
7
|
}
|
|
62
|
-
|
|
63
|
-
var useAutoPlay = function (callback, delay) {
|
|
64
|
-
var timeout = React.useRef(null);
|
|
65
|
-
|
|
66
|
-
var stop = function () {
|
|
67
|
-
clearTimeout(timeout.current);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
var start = function () {
|
|
71
|
-
stop();
|
|
72
|
-
timeout.current = setTimeout(callback, delay);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return [start, stop];
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
var isValidRatio = function (ratio) {
|
|
79
|
-
return !!ratio && /\d\/\d/.test(ratio);
|
|
80
|
-
};
|
|
81
|
-
var getInfiniteIndex = function (index, count) {
|
|
82
|
-
return Math.abs((index % count + count) % count);
|
|
83
|
-
};
|
|
84
|
-
var getRatioHolderStyle = function (ratio) {
|
|
85
|
-
return {
|
|
86
|
-
paddingTop: "calc(".concat(ratio.split('/').reverse().join('/'), " * 100%)")
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
var getRootStyle = function (_a) {
|
|
90
|
-
var width = _a.width,
|
|
91
|
-
height = _a.height,
|
|
92
|
-
ratio = _a.ratio,
|
|
93
|
-
style = _a.style;
|
|
94
|
-
var hasRatio = isValidRatio(ratio);
|
|
95
|
-
return __assign({
|
|
96
|
-
width: width,
|
|
97
|
-
height: hasRatio ? 'auto' : height,
|
|
98
|
-
maxWidth: hasRatio ? '100%' : 'none',
|
|
99
|
-
aspectRatio: hasRatio ? ratio : undefined
|
|
100
|
-
}, style);
|
|
101
|
-
};
|
|
102
|
-
var getTrackStyle = function (_a) {
|
|
103
|
-
var index = _a.index,
|
|
104
|
-
childrenCount = _a.childrenCount,
|
|
105
|
-
duration = _a.duration,
|
|
106
|
-
offset = _a.offset;
|
|
107
|
-
var hasOffset = typeof offset === 'number';
|
|
108
|
-
var currentOffset = hasOffset ? offset : 0;
|
|
109
|
-
return {
|
|
110
|
-
transform: "translateX(calc(".concat(index * (100 / childrenCount) * -1, "% + ").concat(currentOffset, "px))"),
|
|
111
|
-
transition: hasOffset ? undefined : "transform ".concat(duration, "ms ease"),
|
|
112
|
-
width: "".concat(childrenCount * 100, "%") // willChange: 'transform',
|
|
113
|
-
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
var css = {"root":"SimpleSlider__root___WuTIM","track":"SimpleSlider__track___G8BYu","trackItem":"SimpleSlider__trackItem___94Eq7","buttonCommon":"SimpleSlider__buttonCommon___I5yQD","buttonPrev":"SimpleSlider__buttonPrev___UqTOk SimpleSlider__buttonCommon___I5yQD","buttonNext":"SimpleSlider__buttonNext___BbLNv SimpleSlider__buttonCommon___I5yQD","buttonIcon":"SimpleSlider__buttonIcon___89h6n","showOnHoverButtons":"SimpleSlider__showOnHoverButtons___yssoj","dots":"SimpleSlider__dots___E7g4J","dotsItem":"SimpleSlider__dotsItem___cbWCu","dotsButton":"SimpleSlider__dotsButton___7N4yb","showOnHoverDots":"SimpleSlider__showOnHoverDots___ig5DV"};
|
|
118
|
-
|
|
119
|
-
var SimpleSlider = React.forwardRef(function (_a, ref) {
|
|
120
|
-
var _b;
|
|
121
|
-
|
|
122
|
-
var _c = _a.autoPlay,
|
|
123
|
-
autoPlay = _c === void 0 ? 0 : _c,
|
|
124
|
-
children = _a.children,
|
|
125
|
-
className = _a.className,
|
|
126
|
-
_d = _a.duration,
|
|
127
|
-
duration = _d === void 0 ? 500 : _d,
|
|
128
|
-
height = _a.height,
|
|
129
|
-
_e = _a.infinite,
|
|
130
|
-
infinite = _e === void 0 ? false : _e,
|
|
131
|
-
ratio = _a.ratio,
|
|
132
|
-
style = _a.style,
|
|
133
|
-
width = _a.width,
|
|
134
|
-
onChangeIndex = _a.onChangeIndex,
|
|
135
|
-
onClickDot = _a.onClickDot,
|
|
136
|
-
onClickItem = _a.onClickItem,
|
|
137
|
-
onClickButtonNext = _a.onClickButtonNext,
|
|
138
|
-
onClickButtonPrev = _a.onClickButtonPrev,
|
|
139
|
-
onSwipeNext = _a.onSwipeNext,
|
|
140
|
-
onSwipePrev = _a.onSwipePrev,
|
|
141
|
-
_f = _a.showOnHoverButtons,
|
|
142
|
-
showOnHoverButtons = _f === void 0 ? false : _f,
|
|
143
|
-
_g = _a.showOnHoverDots,
|
|
144
|
-
showOnHoverDots = _g === void 0 ? false : _g,
|
|
145
|
-
props = __rest(_a, ["autoPlay", "children", "className", "duration", "height", "infinite", "ratio", "style", "width", "onChangeIndex", "onClickDot", "onClickItem", "onClickButtonNext", "onClickButtonPrev", "onSwipeNext", "onSwipePrev", "showOnHoverButtons", "showOnHoverDots"]);
|
|
146
|
-
|
|
147
|
-
var refTrack = React.useRef(null);
|
|
148
|
-
var transitionRunning = React.useRef(false);
|
|
149
|
-
|
|
150
|
-
var _h = React.useState(false),
|
|
151
|
-
disableAutoPlay = _h[0],
|
|
152
|
-
setDisableAutoPlay = _h[1];
|
|
153
|
-
|
|
154
|
-
var _j = React.useState({
|
|
155
|
-
index: 0,
|
|
156
|
-
offset: undefined
|
|
157
|
-
}),
|
|
158
|
-
position = _j[0],
|
|
159
|
-
setPosition = _j[1];
|
|
160
|
-
|
|
161
|
-
var childrenCount = React.Children.count(children);
|
|
162
|
-
var childrenArray = React.Children.toArray(children);
|
|
163
|
-
var isDisablePrev = !infinite && position.index === 0;
|
|
164
|
-
var isDisableNext = !infinite && position.index === childrenCount - 1;
|
|
165
|
-
var isShowNavi = childrenCount > 1;
|
|
166
|
-
var isShowDots = childrenCount > 1;
|
|
167
|
-
var isAutoPlay = !disableAutoPlay && autoPlay > 0;
|
|
168
|
-
var prevIndex = position.index - 1;
|
|
169
|
-
var nextIndex = position.index + 1;
|
|
170
|
-
var infiniteIndex = getInfiniteIndex(position.index, childrenCount);
|
|
171
|
-
var infinitePrevIndex = getInfiniteIndex(prevIndex, childrenCount);
|
|
172
|
-
var infiniteNextIndex = getInfiniteIndex(nextIndex, childrenCount);
|
|
173
|
-
|
|
174
|
-
var handleClickButtonNext = function () {
|
|
175
|
-
if (transitionRunning.current || isDisableNext) return;
|
|
176
|
-
|
|
177
|
-
if (typeof onClickButtonNext === 'function') {
|
|
178
|
-
onClickButtonNext(infiniteNextIndex);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
setPosition({
|
|
182
|
-
index: nextIndex,
|
|
183
|
-
offset: undefined
|
|
184
|
-
});
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
var handleClickButtonPrev = function () {
|
|
188
|
-
if (transitionRunning.current || isDisablePrev) return;
|
|
189
|
-
|
|
190
|
-
if (typeof onClickButtonPrev === 'function') {
|
|
191
|
-
onClickButtonPrev(infinitePrevIndex);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
setPosition({
|
|
195
|
-
index: prevIndex,
|
|
196
|
-
offset: undefined
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
var handleClickDot = function (i) {
|
|
201
|
-
if (transitionRunning.current) return;
|
|
202
|
-
|
|
203
|
-
if (typeof onClickDot === 'function') {
|
|
204
|
-
onClickDot(i);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
setPosition({
|
|
208
|
-
index: i,
|
|
209
|
-
offset: undefined
|
|
210
|
-
});
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
var handleSwipeNext = function () {
|
|
214
|
-
if (transitionRunning.current || isDisableNext) return;
|
|
215
|
-
|
|
216
|
-
if (typeof onSwipeNext === 'function') {
|
|
217
|
-
onSwipeNext(infiniteNextIndex);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
setPosition({
|
|
221
|
-
index: nextIndex,
|
|
222
|
-
offset: undefined
|
|
223
|
-
});
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
var handleSwipePrev = function () {
|
|
227
|
-
if (transitionRunning.current || isDisablePrev) return;
|
|
228
|
-
|
|
229
|
-
if (typeof onSwipePrev === 'function') {
|
|
230
|
-
onSwipePrev(infinitePrevIndex);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
setPosition({
|
|
234
|
-
index: prevIndex,
|
|
235
|
-
offset: undefined
|
|
236
|
-
});
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
var handleSwipeMove = function (_a, event) {
|
|
240
|
-
var x = _a.x;
|
|
241
|
-
if (transitionRunning.current || event.touches && event.touches.length > 1) return;
|
|
242
|
-
var offset = x;
|
|
243
|
-
|
|
244
|
-
if (isDisablePrev && x > 0 || isDisableNext && x < 0) {
|
|
245
|
-
offset = 0;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
setPosition({
|
|
249
|
-
index: position.index,
|
|
250
|
-
offset: offset
|
|
251
|
-
});
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
var _k = useAutoPlay(function () {
|
|
255
|
-
if (transitionRunning.current || isDisableNext) return;
|
|
256
|
-
setPosition({
|
|
257
|
-
index: nextIndex,
|
|
258
|
-
offset: undefined
|
|
259
|
-
});
|
|
260
|
-
}, autoPlay),
|
|
261
|
-
startAutoPlay = _k[0],
|
|
262
|
-
stopAutoPlay = _k[1];
|
|
263
|
-
|
|
264
|
-
var handleTransitionStart = function () {
|
|
265
|
-
transitionRunning.current = true;
|
|
266
|
-
stopAutoPlay();
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
var handleTransitionEnd = function () {
|
|
270
|
-
transitionRunning.current = false;
|
|
271
|
-
|
|
272
|
-
if (isAutoPlay) {
|
|
273
|
-
startAutoPlay();
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
if (!(position.index in childrenArray)) {
|
|
277
|
-
setPosition({
|
|
278
|
-
index: infiniteIndex,
|
|
279
|
-
offset: 0
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
if (typeof onChangeIndex === 'function') {
|
|
284
|
-
onChangeIndex(infiniteIndex);
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
React.useEffect(function () {
|
|
289
|
-
var _a, _b;
|
|
290
|
-
|
|
291
|
-
var autoPlayObserver = new IntersectionObserver(function (entries) {
|
|
292
|
-
if (entries[0].isIntersecting) {
|
|
293
|
-
startAutoPlay();
|
|
294
|
-
} else {
|
|
295
|
-
stopAutoPlay();
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
(_a = refTrack.current) === null || _a === void 0 ? void 0 : _a.addEventListener('transitionstart', handleTransitionStart);
|
|
299
|
-
(_b = refTrack.current) === null || _b === void 0 ? void 0 : _b.addEventListener('transitionend', handleTransitionEnd);
|
|
300
|
-
|
|
301
|
-
if (isAutoPlay && refTrack.current) {
|
|
302
|
-
autoPlayObserver.observe(refTrack.current);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return function () {
|
|
306
|
-
var _a, _b;
|
|
307
|
-
|
|
308
|
-
(_a = refTrack.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('transitionstart', handleTransitionStart);
|
|
309
|
-
(_b = refTrack.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('transitionend', handleTransitionEnd);
|
|
310
|
-
stopAutoPlay();
|
|
311
|
-
autoPlayObserver.disconnect();
|
|
312
|
-
};
|
|
313
|
-
}, [position.index, isAutoPlay]);
|
|
314
|
-
return React__default["default"].createElement(Swipe__default["default"], __assign({
|
|
315
|
-
ref: ref,
|
|
316
|
-
onSwipeLeft: handleSwipeNext,
|
|
317
|
-
onSwipeRight: handleSwipePrev,
|
|
318
|
-
onSwipeMove: handleSwipeMove,
|
|
319
|
-
className: classNames__default["default"](css.root, className, (_b = {}, _b[css.showOnHoverButtons] = showOnHoverButtons, _b[css.showOnHoverDots] = showOnHoverDots, _b)),
|
|
320
|
-
style: getRootStyle({
|
|
321
|
-
width: width,
|
|
322
|
-
height: height,
|
|
323
|
-
ratio: ratio,
|
|
324
|
-
style: style
|
|
325
|
-
}),
|
|
326
|
-
onSwipeStart: function () {
|
|
327
|
-
return setDisableAutoPlay(true);
|
|
328
|
-
},
|
|
329
|
-
onSwipeEnd: function () {
|
|
330
|
-
return setDisableAutoPlay(false);
|
|
331
|
-
},
|
|
332
|
-
onMouseEnter: function () {
|
|
333
|
-
return setDisableAutoPlay(true);
|
|
334
|
-
},
|
|
335
|
-
onMouseLeave: function () {
|
|
336
|
-
return setDisableAutoPlay(false);
|
|
337
|
-
}
|
|
338
|
-
}, props), isValidRatio(ratio) && React__default["default"].createElement("div", {
|
|
339
|
-
style: getRatioHolderStyle(ratio)
|
|
340
|
-
}), React__default["default"].createElement("ul", {
|
|
341
|
-
ref: refTrack,
|
|
342
|
-
className: css.track,
|
|
343
|
-
style: getTrackStyle({
|
|
344
|
-
index: infinite ? position.index + 1 : position.index,
|
|
345
|
-
childrenCount: infinite ? childrenCount + 2 : childrenCount,
|
|
346
|
-
duration: duration,
|
|
347
|
-
offset: position.offset
|
|
348
|
-
})
|
|
349
|
-
}, infinite && React__default["default"].createElement("li", {
|
|
350
|
-
className: css.trackItem
|
|
351
|
-
}, childrenArray[childrenArray.length - 1]), childrenArray.map(function (child, index) {
|
|
352
|
-
return React__default["default"].createElement("li", {
|
|
353
|
-
key: child.key,
|
|
354
|
-
className: css.trackItem,
|
|
355
|
-
onClick: function () {
|
|
356
|
-
if (typeof onClickItem === 'function') {
|
|
357
|
-
onClickItem(index);
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
"data-qaid": "image_slider_".concat(index)
|
|
361
|
-
}, child);
|
|
362
|
-
}), infinite && React__default["default"].createElement("li", {
|
|
363
|
-
className: css.trackItem
|
|
364
|
-
}, childrenArray[0])), isShowNavi && React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement(Button.Button, {
|
|
365
|
-
type: 'button',
|
|
366
|
-
className: css.buttonPrev,
|
|
367
|
-
onClick: handleClickButtonPrev,
|
|
368
|
-
disabled: isDisablePrev,
|
|
369
|
-
"aria-label": ttag.t(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"], ["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"]))),
|
|
370
|
-
"data-qaid": 'prev_image'
|
|
371
|
-
}, React__default["default"].createElement("svg", {
|
|
372
|
-
className: css.buttonIcon,
|
|
373
|
-
width: 18,
|
|
374
|
-
height: 18,
|
|
375
|
-
viewBox: '0 0 64 64',
|
|
376
|
-
xmlns: 'http://www.w3.org/2000/svg'
|
|
377
|
-
}, React__default["default"].createElement("path", {
|
|
378
|
-
d: 'M41.625 60.375L16 32 41.625 3.625 48.5 10 28.375 32 48.5 54z'
|
|
379
|
-
}))), React__default["default"].createElement(Button.Button, {
|
|
380
|
-
type: 'button',
|
|
381
|
-
className: css.buttonNext,
|
|
382
|
-
onClick: handleClickButtonNext,
|
|
383
|
-
disabled: isDisableNext,
|
|
384
|
-
"aria-label": ttag.t(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"], ["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"]))),
|
|
385
|
-
"data-qaid": 'next_image'
|
|
386
|
-
}, React__default["default"].createElement("svg", {
|
|
387
|
-
className: css.buttonIcon,
|
|
388
|
-
width: 18,
|
|
389
|
-
height: 18,
|
|
390
|
-
viewBox: '0 0 64 64',
|
|
391
|
-
xmlns: 'http://www.w3.org/2000/svg'
|
|
392
|
-
}, React__default["default"].createElement("path", {
|
|
393
|
-
d: 'M22.875 60.375L16 54l20.125-22L16 10l6.875-6.375L48.5 32z'
|
|
394
|
-
})))), isShowDots && React__default["default"].createElement("ul", {
|
|
395
|
-
className: css.dots
|
|
396
|
-
}, childrenArray.map(function (child, index) {
|
|
397
|
-
var viewIndex = index + 1;
|
|
398
|
-
return React__default["default"].createElement("li", {
|
|
399
|
-
className: css.dotsItem,
|
|
400
|
-
key: child.key
|
|
401
|
-
}, React__default["default"].createElement(Button.Button, {
|
|
402
|
-
className: css.dotsButton,
|
|
403
|
-
type: 'button',
|
|
404
|
-
onClick: function () {
|
|
405
|
-
return handleClickDot(index);
|
|
406
|
-
},
|
|
407
|
-
disabled: index === infiniteIndex,
|
|
408
|
-
"aria-label": ttag.t(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0431\u0430\u043D\u043D\u0435\u0440 \u043D\u043E\u043C\u0435\u0440 ", ""], ["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0431\u0430\u043D\u043D\u0435\u0440 \u043D\u043E\u043C\u0435\u0440 ", ""])), viewIndex),
|
|
409
|
-
"data-qaid": "view_image_".concat(viewIndex)
|
|
410
|
-
}, viewIndex));
|
|
411
|
-
})));
|
|
412
|
-
}); // SimpleSlider.defaultProps = {
|
|
413
|
-
// autoPlay: 0,
|
|
414
|
-
// className: undefined,
|
|
415
|
-
// duration: 500,
|
|
416
|
-
// infinite: false,
|
|
417
|
-
// onClickButtonNext: undefined,
|
|
418
|
-
// onClickButtonPrev: undefined,
|
|
419
|
-
// onClickDot: undefined,
|
|
420
|
-
// onClickItem: undefined,
|
|
421
|
-
// onSwipeNext: undefined,
|
|
422
|
-
// onSwipePrev: undefined,
|
|
423
|
-
// onChangeIndex: undefined,
|
|
424
|
-
// ratio: undefined,
|
|
425
|
-
// style: undefined,
|
|
426
|
-
// showOnHoverButtons: false,
|
|
427
|
-
// showOnHoverDots: false,
|
|
428
|
-
// };
|
|
429
|
-
|
|
430
|
-
SimpleSlider.propTypes = {
|
|
431
|
-
height: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]).isRequired,
|
|
432
|
-
|
|
433
|
-
/** Бесконечное листание */
|
|
434
|
-
infinite: PropTypes__default["default"].bool,
|
|
435
|
-
|
|
436
|
-
/** Скорость анимации листания в `ms` */
|
|
437
|
-
duration: PropTypes__default["default"].number,
|
|
438
|
-
|
|
439
|
-
/** Соотношение сторон `16/9`, `4/3`, `1/1` или нестандартное `900/400` */
|
|
440
|
-
// ratio: PropTypes.string,
|
|
441
|
-
width: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]).isRequired,
|
|
442
|
-
// children: PropTypes.node.isRequired,
|
|
443
|
-
className: PropTypes__default["default"].string,
|
|
444
|
-
style: PropTypes__default["default"].object,
|
|
445
|
-
|
|
446
|
-
/** Обратный вызов изменения `(index) =>` */
|
|
447
|
-
onClickButtonNext: PropTypes__default["default"].func,
|
|
448
|
-
|
|
449
|
-
/** Обратный вызов изменения `(index) =>` */
|
|
450
|
-
onClickButtonPrev: PropTypes__default["default"].func,
|
|
451
|
-
|
|
452
|
-
/** Обратный вызов изменения `(index) =>` */
|
|
453
|
-
onClickDot: PropTypes__default["default"].func,
|
|
454
|
-
|
|
455
|
-
/** Обратный вызов изменения `(index) =>` */
|
|
456
|
-
onClickItem: PropTypes__default["default"].func,
|
|
457
|
-
|
|
458
|
-
/** Обратный вызов изменения `(index) =>` */
|
|
459
|
-
onSwipeNext: PropTypes__default["default"].func,
|
|
460
|
-
|
|
461
|
-
/** Обратный вызов изменения `(index) =>` */
|
|
462
|
-
onSwipePrev: PropTypes__default["default"].func,
|
|
463
|
-
|
|
464
|
-
/** Обратный вызов изменения `index` в конце анимации `(index) =>` */
|
|
465
|
-
onChangeIndex: PropTypes__default["default"].func,
|
|
466
|
-
|
|
467
|
-
/** Автоматические листание в `ms`, по умолчанию `0` - выключено */
|
|
468
|
-
autoPlay: PropTypes__default["default"].number,
|
|
469
|
-
|
|
470
|
-
/** Показывать при наведении кнопки по бокам Вперед и Назад */
|
|
471
|
-
showOnHoverButtons: PropTypes__default["default"].bool,
|
|
472
|
-
|
|
473
|
-
/** Показывать при наведении точки снизу */
|
|
474
|
-
showOnHoverDots: PropTypes__default["default"].bool
|
|
475
|
-
};
|
|
476
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
477
|
-
|
|
478
|
-
exports.SimpleSlider = SimpleSlider;
|
|
479
|
-
|
|
480
|
-
require('./style.css');
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var evokit = require('evokit');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n["default"] = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
|
+
|
|
28
|
+
/******************************************************************************
|
|
29
|
+
Copyright (c) Microsoft Corporation.
|
|
30
|
+
|
|
31
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
32
|
+
purpose with or without fee is hereby granted.
|
|
33
|
+
|
|
34
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
35
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
36
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
37
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
38
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
39
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
40
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
41
|
+
***************************************************************************** */
|
|
42
|
+
|
|
43
|
+
var __assign = function() {
|
|
44
|
+
__assign = Object.assign || function __assign(t) {
|
|
45
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
46
|
+
s = arguments[i];
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
48
|
+
}
|
|
49
|
+
return t;
|
|
50
|
+
};
|
|
51
|
+
return __assign.apply(this, arguments);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
function __rest(s, e) {
|
|
55
|
+
var t = {};
|
|
56
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
57
|
+
t[p] = s[p];
|
|
58
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
59
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
60
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
61
|
+
t[p[i]] = s[p[i]];
|
|
62
|
+
}
|
|
63
|
+
return t;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var css = {"ek-skeleton":"Skeleton__ek-skeleton___YQ77B","ek-skeleton_theme_grey":"Skeleton__ek-skeleton_theme_grey___fLU-I","skeleton-keyframes-wave":"Skeleton__skeleton-keyframes-wave___tx4t3","ek-skeleton_theme_black-100":"Skeleton__ek-skeleton_theme_black-100___7Lfmq","ek-skeleton_theme_white":"Skeleton__ek-skeleton_theme_white___HJ4sO","ek-skeleton_variant_text":"Skeleton__ek-skeleton_variant_text___8cqBE","ek-skeleton_variant_circle":"Skeleton__ek-skeleton_variant_circle___-y8Ac","ek-skeleton_variant_square":"Skeleton__ek-skeleton_variant_square___ER7Aa","ek-skeleton_variant_rect":"Skeleton__ek-skeleton_variant_rect___PqK20","ek-skeleton_align_left":"Skeleton__ek-skeleton_align_left___vFpty","ek-skeleton_align_center":"Skeleton__ek-skeleton_align_center___xLcUn","ek-skeleton_align_right":"Skeleton__ek-skeleton_align_right___YXQvi","ek-skeleton_opacity_0":"Skeleton__ek-skeleton_opacity_0___hV3fo","ek-skeleton_opacity_10":"Skeleton__ek-skeleton_opacity_10___SWeYg","ek-skeleton_opacity_20":"Skeleton__ek-skeleton_opacity_20___uh-KW","ek-skeleton_opacity_30":"Skeleton__ek-skeleton_opacity_30___o-fsf","ek-skeleton_opacity_40":"Skeleton__ek-skeleton_opacity_40___yQNnj","ek-skeleton_opacity_50":"Skeleton__ek-skeleton_opacity_50___8ChyF","ek-skeleton_opacity_60":"Skeleton__ek-skeleton_opacity_60___jPfCj","ek-skeleton_opacity_70":"Skeleton__ek-skeleton_opacity_70___yi2qY","ek-skeleton_opacity_80":"Skeleton__ek-skeleton_opacity_80___kUBbU","ek-skeleton_opacity_90":"Skeleton__ek-skeleton_opacity_90___C0qIh","ek-skeleton_opacity_100":"Skeleton__ek-skeleton_opacity_100___PYOu-"};
|
|
67
|
+
|
|
68
|
+
var SkeletonBlock = evokit.createBlock('div', 'skeleton', ['align', 'theme', 'variant', 'opacity'], {
|
|
69
|
+
css: css
|
|
70
|
+
});
|
|
71
|
+
var Skeleton = React__namespace.forwardRef(function (_a, ref) {
|
|
72
|
+
var _b = _a.align,
|
|
73
|
+
align = _b === void 0 ? 'left' : _b,
|
|
74
|
+
height = _a.height,
|
|
75
|
+
opacity = _a.opacity,
|
|
76
|
+
style = _a.style,
|
|
77
|
+
_c = _a.theme,
|
|
78
|
+
theme = _c === void 0 ? 'grey' : _c,
|
|
79
|
+
_d = _a.variant,
|
|
80
|
+
variant = _d === void 0 ? 'text' : _d,
|
|
81
|
+
width = _a.width,
|
|
82
|
+
props = __rest(_a, ["align", "height", "opacity", "style", "theme", "variant", "width"]);
|
|
83
|
+
|
|
84
|
+
var blockStyle = React__namespace.useMemo(function () {
|
|
85
|
+
return __assign({
|
|
86
|
+
height: height,
|
|
87
|
+
width: width
|
|
88
|
+
}, style);
|
|
89
|
+
}, [height, width, style]);
|
|
90
|
+
return React__namespace.createElement(SkeletonBlock, __assign({
|
|
91
|
+
"skeleton-align": align,
|
|
92
|
+
"skeleton-theme": theme,
|
|
93
|
+
"skeleton-variant": variant,
|
|
94
|
+
"skeleton-opacity": opacity,
|
|
95
|
+
style: blockStyle
|
|
96
|
+
}, props, {
|
|
97
|
+
ref: ref
|
|
98
|
+
}));
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
exports.Skeleton = Skeleton;
|
|
102
|
+
|
|
103
|
+
require('./style.development.css');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("evokit");function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=n(e),r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};var a=t.createBlock("div","skeleton",["align","theme","variant","opacity"],{css:{"ek-skeleton":"YQ77B","ek-skeleton_theme_grey":"fLU-I","skeleton-keyframes-wave":"tx4t3","ek-skeleton_theme_black-100":"_7Lfmq","ek-skeleton_theme_white":"HJ4sO","ek-skeleton_variant_text":"_8cqBE","ek-skeleton_variant_circle":"-y8Ac","ek-skeleton_variant_square":"ER7Aa","ek-skeleton_variant_rect":"PqK20","ek-skeleton_align_left":"vFpty","ek-skeleton_align_center":"xLcUn","ek-skeleton_align_right":"YXQvi","ek-skeleton_opacity_0":"hV3fo","ek-skeleton_opacity_10":"SWeYg","ek-skeleton_opacity_20":"uh-KW","ek-skeleton_opacity_30":"o-fsf","ek-skeleton_opacity_40":"yQNnj","ek-skeleton_opacity_50":"_8ChyF","ek-skeleton_opacity_60":"jPfCj","ek-skeleton_opacity_70":"yi2qY","ek-skeleton_opacity_80":"kUBbU","ek-skeleton_opacity_90":"C0qIh","ek-skeleton_opacity_100":"PYOu-"}}),i=o.forwardRef((function(e,t){var n=e.align,i=void 0===n?"left":n,l=e.height,c=e.opacity,k=e.style,s=e.theme,_=void 0===s?"grey":s,y=e.variant,p=void 0===y?"text":y,f=e.width,u=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["align","height","opacity","style","theme","variant","width"]),h=o.useMemo((function(){return r({height:l,width:f},k)}),[l,f,k]);return o.createElement(a,r({"skeleton-align":i,"skeleton-theme":_,"skeleton-variant":p,"skeleton-opacity":c,style:h},u,{ref:t}))}));exports.Skeleton=i,require("./style.production.css");
|