primereact 7.2.0 → 7.2.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/calendar/calendar.cjs.js +1 -1
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +1 -1
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +1 -1
- package/calendar/calendar.min.js +1 -1
- package/carousel/carousel.cjs.js +212 -5
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +212 -5
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +212 -5
- package/carousel/carousel.min.js +1 -1
- package/core/core.js +34 -3
- package/core/core.min.js +4 -4
- package/datatable/datatable.cjs.js +21 -16
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +1 -0
- package/datatable/datatable.esm.js +21 -16
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +21 -16
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +1 -5
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +1 -5
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +1 -5
- package/dataview/dataview.min.js +1 -1
- package/dropdown/dropdown.cjs.js +1 -1
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +1 -1
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +1 -1
- package/dropdown/dropdown.min.js +1 -1
- package/galleria/galleria.cjs.js +212 -5
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +212 -5
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +212 -5
- package/galleria/galleria.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +5 -1
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +5 -1
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +5 -1
- package/inputnumber/inputnumber.min.js +1 -1
- package/knob/knob.cjs.js +1 -1
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +1 -1
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +1 -1
- package/knob/knob.min.js +1 -1
- package/multiselect/multiselect.cjs.js +1 -1
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +1 -1
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +1 -1
- package/multiselect/multiselect.min.js +1 -1
- package/package.json +1 -1
- package/primereact.all.cjs.js +142 -122
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +142 -122
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +142 -122
- package/primereact.all.min.js +1 -1
- package/resources/primereact.css +7 -2
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +254 -2
- package/resources/themes/arya-green/theme.css +254 -2
- package/resources/themes/arya-orange/theme.css +254 -2
- package/resources/themes/arya-purple/theme.css +254 -2
- package/resources/themes/bootstrap4-dark-blue/theme.css +254 -2
- package/resources/themes/bootstrap4-dark-purple/theme.css +254 -2
- package/resources/themes/bootstrap4-light-blue/theme.css +252 -0
- package/resources/themes/bootstrap4-light-purple/theme.css +252 -0
- package/resources/themes/fluent-light/theme.css +252 -0
- package/resources/themes/lara-dark-blue/theme.css +261 -44
- package/resources/themes/lara-dark-indigo/theme.css +261 -44
- package/resources/themes/lara-dark-purple/theme.css +261 -44
- package/resources/themes/lara-dark-teal/theme.css +261 -44
- package/resources/themes/lara-light-blue/theme.css +259 -42
- package/resources/themes/lara-light-indigo/theme.css +259 -42
- package/resources/themes/lara-light-purple/theme.css +259 -42
- package/resources/themes/lara-light-teal/theme.css +259 -42
- package/resources/themes/luna-amber/theme.css +252 -0
- package/resources/themes/luna-blue/theme.css +252 -0
- package/resources/themes/luna-green/theme.css +252 -0
- package/resources/themes/luna-pink/theme.css +252 -0
- package/resources/themes/md-dark-deeppurple/theme.css +328 -2
- package/resources/themes/md-dark-indigo/theme.css +328 -2
- package/resources/themes/md-light-deeppurple/theme.css +326 -0
- package/resources/themes/md-light-indigo/theme.css +326 -0
- package/resources/themes/mdc-dark-deeppurple/theme.css +328 -2
- package/resources/themes/mdc-dark-indigo/theme.css +328 -2
- package/resources/themes/mdc-light-deeppurple/theme.css +326 -0
- package/resources/themes/mdc-light-indigo/theme.css +326 -0
- package/resources/themes/nova/theme.css +252 -0
- package/resources/themes/nova-accent/theme.css +252 -0
- package/resources/themes/nova-alt/theme.css +252 -0
- package/resources/themes/rhea/theme.css +252 -0
- package/resources/themes/saga-blue/theme.css +252 -0
- package/resources/themes/saga-green/theme.css +252 -0
- package/resources/themes/saga-orange/theme.css +252 -0
- package/resources/themes/saga-purple/theme.css +252 -0
- package/resources/themes/tailwind-light/theme.css +252 -0
- package/resources/themes/vela-blue/theme.css +254 -2
- package/resources/themes/vela-green/theme.css +254 -2
- package/resources/themes/vela-orange/theme.css +254 -2
- package/resources/themes/vela-purple/theme.css +254 -2
- package/splitbutton/splitbutton.d.ts +4 -1
- package/splitbutton/splitbutton.min.css +1 -1
- package/tabmenu/tabmenu.cjs.js +1 -1
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +1 -1
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +1 -1
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +1 -1
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +1 -1
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +1 -1
- package/tabview/tabview.min.js +1 -1
- package/toolbar/toolbar.min.css +1 -1
- package/tree/tree.cjs.js +2 -1
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +2 -1
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +2 -1
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +3 -3
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +3 -3
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +3 -3
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +12 -10
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +8 -7
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +12 -10
- package/treetable/treetable.min.js +1 -1
- package/utils/utils.cjs.js +26 -0
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +1 -0
- package/utils/utils.esm.js +26 -0
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +26 -0
- package/utils/utils.min.js +1 -1
- package/web-types.json +15 -3
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff2 +0 -0
package/carousel/carousel.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.carousel=function(t,e,i,n,s){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=a(e),o=a(s);function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function u(t){if(Array.isArray(t))return l(t)}function c(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function p(t,e){if(t){if("string"==typeof t)return l(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?l(t,e):void 0}}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function v(t,e,i){return e&&f(t.prototype,e),i&&f(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t,e){return y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},y(t,e)}function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function S(t,e){if(e&&("object"===b(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return m(t)}function I(t){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},I(t)}function k(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function w(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function P(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?w(Object(i),!0).forEach((function(e){k(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):w(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function O(t){var e=C();return function(){var i,n=I(t);if(e){var s=I(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return S(this,i)}}function C(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var V=function(t){g(n,t);var e=O(n);function n(){return d(this,n),e.apply(this,arguments)}return v(n,[{key:"render",value:function(){var t=this.props.template(this.props.item),e=i.classNames(this.props.className,"p-carousel-item",{"p-carousel-item-active":this.props.active,"p-carousel-item-start":this.props.start,"p-carousel-item-end":this.props.end});return r.default.createElement("div",{className:e},t)}}]),n}(e.Component);k(V,"defaultProps",{template:null,item:null,active:!1,start:!1,end:!1,className:null});var N=function(t){g(s,t);var e=O(s);function s(t){var n;return d(this,s),(n=e.call(this,t)).state={numVisible:t.numVisible,numScroll:t.numScroll,totalShiftedItems:t.page*t.numScroll*-1},n.props.onPageChange||(n.state=P(P({},n.state),{},{page:t.page})),n.navBackward=n.navBackward.bind(m(n)),n.navForward=n.navForward.bind(m(n)),n.onTransitionEnd=n.onTransitionEnd.bind(m(n)),n.onTouchStart=n.onTouchStart.bind(m(n)),n.onTouchMove=n.onTouchMove.bind(m(n)),n.onTouchEnd=n.onTouchEnd.bind(m(n)),n.totalIndicators=0,n.remainingItems=0,n.allowAutoplay=!!n.props.autoplayInterval,n.circular=n.props.circular||n.allowAutoplay,n.attributeSelector=i.UniqueComponentId(),n.swipeThreshold=20,n}return v(s,[{key:"step",value:function(t,e){var n=this.state.totalShiftedItems,s=this.isCircular();null!=e?(n=this.state.numScroll*e*-1,s&&(n-=this.state.numVisible),this.isRemainingItemsAdded=!1):(n+=this.state.numScroll*t,this.isRemainingItemsAdded&&(n+=this.remainingItems-this.state.numScroll*t,this.isRemainingItemsAdded=!1),e=Math.abs(Math.floor((s?n+this.state.numVisible:n)/this.state.numScroll)));s&&this.state.page===this.totalIndicators-1&&-1===t?(n=-1*(this.props.value.length+this.state.numVisible),e=0):s&&0===this.state.page&&1===t?(n=0,e=this.totalIndicators-1):e===this.totalIndicators-1&&this.remainingItems>0&&(n+=-1*this.remainingItems-this.state.numScroll*t,this.isRemainingItemsAdded=!0),this.itemsContainer&&(i.DomHandler.removeClass(this.itemsContainer,"p-items-hidden"),this.changePosition(n),this.itemsContainer.style.transition="transform 500ms ease 0s"),this.props.onPageChange?(this.setState({totalShiftedItems:n}),this.props.onPageChange({page:e})):this.setState({page:e,totalShiftedItems:n})}},{key:"calculatePosition",value:function(){if(this.itemsContainer&&this.responsiveOptions){for(var t=window.innerWidth,e={numVisible:this.props.numVisible,numScroll:this.props.numScroll},i=0;i<this.responsiveOptions.length;i++){var n=this.responsiveOptions[i];parseInt(n.breakpoint,10)>=t&&(e=n)}var s={};if(this.state.numScroll!==e.numScroll){var a=this.getPage();a=Math.floor(a*this.state.numScroll/e.numScroll);var r=e.numScroll*a*-1;this.isCircular()&&(r-=e.numVisible),s={totalShiftedItems:r,numScroll:e.numScroll},this.props.onPageChange?this.props.onPageChange({page:a}):s=P(P({},s),{},{page:a})}this.state.numVisible!==e.numVisible&&(s=P(P({},s),{},{numVisible:e.numVisible})),Object.keys(s).length&&this.setState(s)}}},{key:"navBackward",value:function(t,e){(this.circular||0!==this.getPage())&&this.step(1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()}},{key:"navForward",value:function(t,e){(this.circular||this.getPage()<this.totalIndicators-1)&&this.step(-1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()}},{key:"onDotClick",value:function(t,e){var i=this.getPage();e>i?this.navForward(t,e):e<i&&this.navBackward(t,e)}},{key:"onTransitionEnd",value:function(t){this.itemsContainer&&"transform"===t.propertyName&&(i.DomHandler.addClass(this.itemsContainer,"p-items-hidden"),this.itemsContainer.style.transition="",0!==this.state.page&&this.state.page!==this.totalIndicators-1||!this.isCircular()||this.changePosition(this.state.totalShiftedItems))}},{key:"onTouchStart",value:function(t){var e=t.changedTouches[0];this.startPos={x:e.pageX,y:e.pageY}}},{key:"onTouchMove",value:function(t){t.cancelable&&t.preventDefault()}},{key:"onTouchEnd",value:function(t){var e=t.changedTouches[0];this.isVertical()?this.changePageOnTouch(t,e.pageY-this.startPos.y):this.changePageOnTouch(t,e.pageX-this.startPos.x)}},{key:"changePageOnTouch",value:function(t,e){Math.abs(e)>this.swipeThreshold&&(e<0?this.navForward(t):this.navBackward(t))}},{key:"bindDocumentListeners",value:function(){var t=this;this.documentResizeListener||(this.documentResizeListener=function(){t.calculatePosition()},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentListeners",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"isVertical",value:function(){return"vertical"===this.props.orientation}},{key:"isCircular",value:function(){return this.circular&&this.props.value.length>=this.state.numVisible}},{key:"getPage",value:function(){return this.props.onPageChange?this.props.page:this.state.page}},{key:"getTotalIndicators",value:function(){return this.props.value?Math.ceil((this.props.value.length-this.state.numVisible)/this.state.numScroll)+1:0}},{key:"isAutoplay",value:function(){return this.props.autoplayInterval&&this.allowAutoplay}},{key:"startAutoplay",value:function(){var t=this;this.interval=setInterval((function(){t.step(-1,t.state.page===t.totalIndicators-1?0:t.state.page+1)}),this.props.autoplayInterval)}},{key:"stopAutoplay",value:function(){this.interval&&clearInterval(this.interval)}},{key:"createStyle",value:function(){this.carouselStyle||(this.carouselStyle=i.DomHandler.createInlineStyle(o.default.nonce));var t,e="\n .p-carousel[".concat(this.attributeSelector,"] .p-carousel-item {\n flex: 1 0 ").concat(100/this.state.numVisible,"%\n }\n ");if(this.props.responsiveOptions){this.responsiveOptions=u(t=this.props.responsiveOptions)||c(t)||p(t)||h(),this.responsiveOptions.sort((function(t,e){var i=t.breakpoint,n=e.breakpoint;return-1*(null==i&&null!=n?-1:null!=i&&null==n?1:null==i&&null==n?0:"string"==typeof i&&"string"==typeof n?i.localeCompare(n,void 0,{numeric:!0}):i<n?-1:i>n?1:0)}));for(var n=0;n<this.responsiveOptions.length;n++){var s=this.responsiveOptions[n];e+="\n @media screen and (max-width: ".concat(s.breakpoint,") {\n .p-carousel[").concat(this.attributeSelector,"] .p-carousel-item {\n flex: 1 0 ").concat(100/s.numVisible,"%\n }\n }\n ")}}this.carouselStyle.innerHTML=e}},{key:"changePosition",value:function(t){this.itemsContainer&&(this.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(t*(100/this.state.numVisible),"%, 0)"):"translate3d(".concat(t*(100/this.state.numVisible),"%, 0, 0)"))}},{key:"componentDidMount",value:function(){this.container&&this.container.setAttribute(this.attributeSelector,""),this.createStyle(),this.calculatePosition(),this.changePosition(this.state.totalShiftedItems),this.props.responsiveOptions&&this.bindDocumentListeners()}},{key:"componentDidUpdate",value:function(t,e){var i=this.isCircular(),n=!1,s=this.state.totalShiftedItems;if(this.props.autoplayInterval&&this.stopAutoplay(),e.numScroll!==this.state.numScroll||e.numVisible!==this.state.numVisible||this.props.value&&t.value&&t.value.length!==this.props.value.length){this.remainingItems=(this.props.value.length-this.state.numVisible)%this.state.numScroll;var a=this.getPage();0!==this.totalIndicators&&a>=this.totalIndicators&&(a=this.totalIndicators-1,this.props.onPageChange?this.props.onPageChange({page:a}):this.setState({page:a}),n=!0),s=a*this.state.numScroll*-1,i&&(s-=this.state.numVisible),a===this.totalIndicators-1&&this.remainingItems>0?(s+=-1*this.remainingItems+this.state.numScroll,this.isRemainingItemsAdded=!0):this.isRemainingItemsAdded=!1,s!==this.state.totalShiftedItems&&(this.setState({totalShiftedItems:s}),n=!0),this.changePosition(s)}i&&(0===this.state.page?s=-1*this.state.numVisible:0===s&&(s=-1*this.props.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),s!==this.state.totalShiftedItems&&(this.setState({totalShiftedItems:s}),n=!0)),t.page!==this.props.page&&(this.props.page>t.page&&this.props.page<=this.totalIndicators-1?this.step(-1,this.props.page):this.props.page<t.page&&this.step(1,this.props.page)),!n&&this.isAutoplay()&&this.startAutoplay()}},{key:"componentWillUnmount",value:function(){this.props.responsiveOptions&&this.unbindDocumentListeners(),this.props.autoplayInterval&&this.stopAutoplay()}},{key:"renderItems",value:function(){var t=this;if(this.props.value&&this.props.value.length){var e=this.isCircular(),i=null,n=null;if(e){var s=null;i=(s=this.props.value.slice(-1*this.state.numVisible)).map((function(e,i){return r.default.createElement(V,{key:i+"_scloned",className:"p-carousel-item-cloned",template:t.props.itemTemplate,item:e,active:-1*t.state.totalShiftedItems===t.props.value.length+t.state.numVisible,start:0===i,end:i===s.length-1})})),n=(s=this.props.value.slice(0,this.state.numVisible)).map((function(e,i){return r.default.createElement(V,{key:i+"_fcloned",className:"p-carousel-item-cloned",template:t.props.itemTemplate,item:e,active:0===t.state.totalShiftedItems,start:0===i,end:i===s.length-1})}))}var a=this.props.value.map((function(i,n){var s=e?-1*(t.state.totalShiftedItems+t.state.numVisible):-1*t.state.totalShiftedItems,a=s+t.state.numVisible-1;return r.default.createElement(V,{key:n,template:t.props.itemTemplate,item:i,active:s<=n&&a>=n,start:s===n,end:a===n})}));return r.default.createElement(r.default.Fragment,null,i,a,n)}}},{key:"renderHeader",value:function(){return this.props.header?r.default.createElement("div",{className:"p-carousel-header"},this.props.header):null}},{key:"renderFooter",value:function(){return this.props.footer?r.default.createElement("div",{className:"p-carousel-footer"},this.props.footer):null}},{key:"renderContent",value:function(){var t=this,e=this.renderItems(),n=this.isVertical()?this.props.verticalViewPortHeight:"auto",s=this.renderBackwardNavigator(),a=this.renderForwardNavigator(),o=i.classNames("p-carousel-container",this.props.containerClassName);return r.default.createElement("div",{className:o},s,r.default.createElement("div",{className:"p-carousel-items-content",style:{height:n},onTouchStart:this.onTouchStart,onTouchMove:this.onTouchMove,onTouchEnd:this.onTouchEnd},r.default.createElement("div",{ref:function(e){return t.itemsContainer=e},className:"p-carousel-items-container",onTransitionEnd:this.onTransitionEnd},e)),a)}},{key:"renderBackwardNavigator",value:function(){var t=(!this.circular||this.props.value&&this.props.value.length<this.state.numVisible)&&0===this.getPage(),e=i.classNames("p-carousel-prev p-link",{"p-disabled":t}),s=i.classNames("p-carousel-prev-icon pi",{"pi-chevron-left":!this.isVertical(),"pi-chevron-up":this.isVertical()});return r.default.createElement("button",{type:"button",className:e,onClick:this.navBackward,disabled:t},r.default.createElement("span",{className:s}),r.default.createElement(n.Ripple,null))}},{key:"renderForwardNavigator",value:function(){var t=(!this.circular||this.props.value&&this.props.value.length<this.state.numVisible)&&(this.getPage()===this.totalIndicators-1||0===this.totalIndicators),e=i.classNames("p-carousel-next p-link",{"p-disabled":t}),s=i.classNames("p-carousel-next-icon pi",{"pi-chevron-right":!this.isVertical(),"pi-chevron-down":this.isVertical()});return r.default.createElement("button",{type:"button",className:e,onClick:this.navForward,disabled:t},r.default.createElement("span",{className:s}),r.default.createElement(n.Ripple,null))}},{key:"renderIndicator",value:function(t){var e=this,s=this.getPage()===t,a=i.classNames("p-carousel-indicator",{"p-highlight":s});return r.default.createElement("li",{className:a,key:"p-carousel-indicator-"+t},r.default.createElement("button",{type:"button",className:"p-link",onClick:function(i){return e.onDotClick(i,t)}},r.default.createElement(n.Ripple,null)))}},{key:"renderIndicators",value:function(){for(var t=i.classNames("p-carousel-indicators p-reset",this.props.indicatorsContentClassName),e=[],n=0;n<this.totalIndicators;n++)e.push(this.renderIndicator(n));return r.default.createElement("ul",{className:t},e)}},{key:"render",value:function(){var t=this,e=i.classNames("p-carousel p-component",{"p-carousel-vertical":this.isVertical(),"p-carousel-horizontal":!this.isVertical()},this.props.className),n=i.classNames("p-carousel-content",this.props.contentClassName);this.totalIndicators=this.getTotalIndicators();var s=this.renderContent(),a=this.renderIndicators(),o=this.renderHeader(),l=this.renderFooter();return r.default.createElement("div",{ref:function(e){return t.container=e},id:this.props.id,className:e,style:this.props.style},o,r.default.createElement("div",{className:n},s,a),l)}}]),s}(e.Component);return k(N,"defaultProps",{id:null,value:null,page:0,header:null,footer:null,style:null,className:null,itemTemplate:null,circular:!1,autoplayInterval:0,numVisible:1,numScroll:1,responsiveOptions:null,orientation:"horizontal",verticalViewPortHeight:"300px",contentClassName:null,containerClassName:null,indicatorsContentClassName:null,onPageChange:null}),t.Carousel=N,Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,primereact.utils,primereact.ripple,primereact.api);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.carousel=function(t,e,n,i,r){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=a(e),o=a(r);function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function u(t){if(Array.isArray(t))return l(t)}function c(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function p(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function v(t,e,n){return e&&d(t.prototype,e),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function g(t,e){return g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},g(t,e)}function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&g(t,e)}function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function k(t,e){if(e&&("object"===b(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return m(t)}function S(t){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},S(t)}function I(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var E=function(){function t(){f(this,t)}return v(t,null,[{key:"equals",value:function(t,e,n){return n&&t&&"object"===b(t)&&e&&"object"===b(e)?this.resolveFieldData(t,n)===this.resolveFieldData(e,n):this.deepEquals(t,e)}},{key:"deepEquals",value:function(t,e){if(t===e)return!0;if(t&&e&&"object"==b(t)&&"object"==b(e)){var n,i,r,a=Array.isArray(t),s=Array.isArray(e);if(a&&s){if((i=t.length)!==e.length)return!1;for(n=i;0!=n--;)if(!this.deepEquals(t[n],e[n]))return!1;return!0}if(a!==s)return!1;var o=t instanceof Date,l=e instanceof Date;if(o!==l)return!1;if(o&&l)return t.getTime()===e.getTime();var u=t instanceof RegExp,c=e instanceof RegExp;if(u!==c)return!1;if(u&&c)return t.toString()===e.toString();var p=Object.keys(t);if((i=p.length)!==Object.keys(e).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(e,p[n]))return!1;for(n=i;0!=n--;)if(!this.deepEquals(t[r=p[n]],e[r]))return!1;return!0}return t!=t&&e!=e}},{key:"resolveFieldData",value:function(t,e){if(t&&Object.keys(t).length&&e){if(this.isFunction(e))return e(t);if(-1===e.indexOf("."))return t[e];for(var n=e.split("."),i=t,r=0,a=n.length;r<a;++r){if(null==i)return null;i=i[n[r]]}return i}return null}},{key:"isFunction",value:function(t){return!!(t&&t.constructor&&t.call&&t.apply)}},{key:"findDiffKeys",value:function(t,e){return t&&e?Object.keys(t).filter((function(t){return!e.hasOwnProperty(t)})).reduce((function(e,n){return e[n]=t[n],e}),{}):{}}},{key:"reorderArray",value:function(t,e,n){var i;if(t&&e!==n){if(n>=t.length)for(i=n-t.length;1+i--;)t.push(void 0);t.splice(n,0,t.splice(e,1)[0])}}},{key:"findIndexInList",value:function(t,e,n){var i=this;return e?e.findIndex(n?function(e){return i.equals(e,t,n)}:function(e){return e===t}):-1}},{key:"getJSXElement",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return this.isFunction(t)?t.apply(void 0,n):t}},{key:"getPropValue",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return this.isFunction(t)?t.apply(void 0,n):t}},{key:"getRefElement",value:function(t){return t?"object"===b(t)&&t.hasOwnProperty("current")?t.current:t:null}},{key:"removeAccents",value:function(t){return t&&t.search(/[\xC0-\xFF]/g)>-1&&(t=t.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),t}},{key:"isEmpty",value:function(t){return null==t||""===t||Array.isArray(t)&&0===t.length||!(t instanceof Date)&&"object"===b(t)&&0===Object.keys(t).length}},{key:"isNotEmpty",value:function(t){return!this.isEmpty(t)}},{key:"sort",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3?arguments[3]:void 0;return n*(null==t&&null!=e?-1:null!=t&&null==e?1:null==t&&null==e?0:"string"==typeof t&&"string"==typeof e?t.localeCompare(e,i,{numeric:!0}):t<e?-1:t>e?1:0)}}]),t}();function C(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function O(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?C(Object(n),!0).forEach((function(e){I(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function w(t){var e=P();return function(){var n,i=S(t);if(e){var r=S(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return k(this,n)}}function P(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var x=function(t){y(i,t);var e=w(i);function i(){return f(this,i),e.apply(this,arguments)}return v(i,[{key:"render",value:function(){var t=this.props.template(this.props.item),e=n.classNames(this.props.className,"p-carousel-item",{"p-carousel-item-active":this.props.active,"p-carousel-item-start":this.props.start,"p-carousel-item-end":this.props.end});return s.default.createElement("div",{className:e},t)}}]),i}(e.Component);I(x,"defaultProps",{template:null,item:null,active:!1,start:!1,end:!1,className:null});var N=function(t){y(r,t);var e=w(r);function r(t){var i;return f(this,r),(i=e.call(this,t)).state={numVisible:t.numVisible,numScroll:t.numScroll,totalShiftedItems:t.page*t.numScroll*-1},i.props.onPageChange||(i.state=O(O({},i.state),{},{page:t.page})),i.navBackward=i.navBackward.bind(m(i)),i.navForward=i.navForward.bind(m(i)),i.onTransitionEnd=i.onTransitionEnd.bind(m(i)),i.onTouchStart=i.onTouchStart.bind(m(i)),i.onTouchMove=i.onTouchMove.bind(m(i)),i.onTouchEnd=i.onTouchEnd.bind(m(i)),i.totalIndicators=0,i.remainingItems=0,i.allowAutoplay=!!i.props.autoplayInterval,i.circular=i.props.circular||i.allowAutoplay,i.attributeSelector=n.UniqueComponentId(),i.swipeThreshold=20,i}return v(r,[{key:"step",value:function(t,e){var i=this.state.totalShiftedItems,r=this.isCircular();null!=e?(i=this.state.numScroll*e*-1,r&&(i-=this.state.numVisible),this.isRemainingItemsAdded=!1):(i+=this.state.numScroll*t,this.isRemainingItemsAdded&&(i+=this.remainingItems-this.state.numScroll*t,this.isRemainingItemsAdded=!1),e=Math.abs(Math.floor((r?i+this.state.numVisible:i)/this.state.numScroll)));r&&this.state.page===this.totalIndicators-1&&-1===t?(i=-1*(this.props.value.length+this.state.numVisible),e=0):r&&0===this.state.page&&1===t?(i=0,e=this.totalIndicators-1):e===this.totalIndicators-1&&this.remainingItems>0&&(i+=-1*this.remainingItems-this.state.numScroll*t,this.isRemainingItemsAdded=!0),this.itemsContainer&&(n.DomHandler.removeClass(this.itemsContainer,"p-items-hidden"),this.changePosition(i),this.itemsContainer.style.transition="transform 500ms ease 0s"),this.props.onPageChange?(this.setState({totalShiftedItems:i}),this.props.onPageChange({page:e})):this.setState({page:e,totalShiftedItems:i})}},{key:"calculatePosition",value:function(){if(this.itemsContainer&&this.responsiveOptions){for(var t=window.innerWidth,e={numVisible:this.props.numVisible,numScroll:this.props.numScroll},n=0;n<this.responsiveOptions.length;n++){var i=this.responsiveOptions[n];parseInt(i.breakpoint,10)>=t&&(e=i)}var r={};if(this.state.numScroll!==e.numScroll){var a=this.getPage();a=Math.floor(a*this.state.numScroll/e.numScroll);var s=e.numScroll*a*-1;this.isCircular()&&(s-=e.numVisible),r={totalShiftedItems:s,numScroll:e.numScroll},this.props.onPageChange?this.props.onPageChange({page:a}):r=O(O({},r),{},{page:a})}this.state.numVisible!==e.numVisible&&(r=O(O({},r),{},{numVisible:e.numVisible})),Object.keys(r).length&&this.setState(r)}}},{key:"navBackward",value:function(t,e){(this.circular||0!==this.getPage())&&this.step(1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()}},{key:"navForward",value:function(t,e){(this.circular||this.getPage()<this.totalIndicators-1)&&this.step(-1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()}},{key:"onDotClick",value:function(t,e){var n=this.getPage();e>n?this.navForward(t,e):e<n&&this.navBackward(t,e)}},{key:"onTransitionEnd",value:function(t){this.itemsContainer&&"transform"===t.propertyName&&(n.DomHandler.addClass(this.itemsContainer,"p-items-hidden"),this.itemsContainer.style.transition="",0!==this.state.page&&this.state.page!==this.totalIndicators-1||!this.isCircular()||this.changePosition(this.state.totalShiftedItems))}},{key:"onTouchStart",value:function(t){var e=t.changedTouches[0];this.startPos={x:e.pageX,y:e.pageY}}},{key:"onTouchMove",value:function(t){t.cancelable&&t.preventDefault()}},{key:"onTouchEnd",value:function(t){var e=t.changedTouches[0];this.isVertical()?this.changePageOnTouch(t,e.pageY-this.startPos.y):this.changePageOnTouch(t,e.pageX-this.startPos.x)}},{key:"changePageOnTouch",value:function(t,e){Math.abs(e)>this.swipeThreshold&&(e<0?this.navForward(t):this.navBackward(t))}},{key:"bindDocumentListeners",value:function(){var t=this;this.documentResizeListener||(this.documentResizeListener=function(){t.calculatePosition()},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentListeners",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"isVertical",value:function(){return"vertical"===this.props.orientation}},{key:"isCircular",value:function(){return this.circular&&this.props.value.length>=this.state.numVisible}},{key:"getPage",value:function(){return this.props.onPageChange?this.props.page:this.state.page}},{key:"getTotalIndicators",value:function(){return this.props.value?Math.ceil((this.props.value.length-this.state.numVisible)/this.state.numScroll)+1:0}},{key:"isAutoplay",value:function(){return this.props.autoplayInterval&&this.allowAutoplay}},{key:"startAutoplay",value:function(){var t=this;this.interval=setInterval((function(){t.step(-1,t.state.page===t.totalIndicators-1?0:t.state.page+1)}),this.props.autoplayInterval)}},{key:"stopAutoplay",value:function(){this.interval&&clearInterval(this.interval)}},{key:"createStyle",value:function(){this.carouselStyle||(this.carouselStyle=n.DomHandler.createInlineStyle(o.default.nonce));var t,e="\n .p-carousel[".concat(this.attributeSelector,"] .p-carousel-item {\n flex: 1 0 ").concat(100/this.state.numVisible,"%\n }\n ");if(this.props.responsiveOptions){this.responsiveOptions=u(t=this.props.responsiveOptions)||c(t)||p(t)||h(),this.responsiveOptions.sort((function(t,e){return E.sort(t.breakpoint,e.breakpoint,-1,o.default.locale)}));for(var i=0;i<this.responsiveOptions.length;i++){var r=this.responsiveOptions[i];e+="\n @media screen and (max-width: ".concat(r.breakpoint,") {\n .p-carousel[").concat(this.attributeSelector,"] .p-carousel-item {\n flex: 1 0 ").concat(100/r.numVisible,"%\n }\n }\n ")}}this.carouselStyle.innerHTML=e}},{key:"changePosition",value:function(t){this.itemsContainer&&(this.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(t*(100/this.state.numVisible),"%, 0)"):"translate3d(".concat(t*(100/this.state.numVisible),"%, 0, 0)"))}},{key:"componentDidMount",value:function(){this.container&&this.container.setAttribute(this.attributeSelector,""),this.createStyle(),this.calculatePosition(),this.changePosition(this.state.totalShiftedItems),this.props.responsiveOptions&&this.bindDocumentListeners()}},{key:"componentDidUpdate",value:function(t,e){var n=this.isCircular(),i=!1,r=this.state.totalShiftedItems;if(this.props.autoplayInterval&&this.stopAutoplay(),e.numScroll!==this.state.numScroll||e.numVisible!==this.state.numVisible||this.props.value&&t.value&&t.value.length!==this.props.value.length){this.remainingItems=(this.props.value.length-this.state.numVisible)%this.state.numScroll;var a=this.getPage();0!==this.totalIndicators&&a>=this.totalIndicators&&(a=this.totalIndicators-1,this.props.onPageChange?this.props.onPageChange({page:a}):this.setState({page:a}),i=!0),r=a*this.state.numScroll*-1,n&&(r-=this.state.numVisible),a===this.totalIndicators-1&&this.remainingItems>0?(r+=-1*this.remainingItems+this.state.numScroll,this.isRemainingItemsAdded=!0):this.isRemainingItemsAdded=!1,r!==this.state.totalShiftedItems&&(this.setState({totalShiftedItems:r}),i=!0),this.changePosition(r)}n&&(0===this.state.page?r=-1*this.state.numVisible:0===r&&(r=-1*this.props.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),r!==this.state.totalShiftedItems&&(this.setState({totalShiftedItems:r}),i=!0)),t.page!==this.props.page&&(this.props.page>t.page&&this.props.page<=this.totalIndicators-1?this.step(-1,this.props.page):this.props.page<t.page&&this.step(1,this.props.page)),!i&&this.isAutoplay()&&this.startAutoplay()}},{key:"componentWillUnmount",value:function(){this.props.responsiveOptions&&this.unbindDocumentListeners(),this.props.autoplayInterval&&this.stopAutoplay()}},{key:"renderItems",value:function(){var t=this;if(this.props.value&&this.props.value.length){var e=this.isCircular(),n=null,i=null;if(e){var r=null;n=(r=this.props.value.slice(-1*this.state.numVisible)).map((function(e,n){return s.default.createElement(x,{key:n+"_scloned",className:"p-carousel-item-cloned",template:t.props.itemTemplate,item:e,active:-1*t.state.totalShiftedItems===t.props.value.length+t.state.numVisible,start:0===n,end:n===r.length-1})})),i=(r=this.props.value.slice(0,this.state.numVisible)).map((function(e,n){return s.default.createElement(x,{key:n+"_fcloned",className:"p-carousel-item-cloned",template:t.props.itemTemplate,item:e,active:0===t.state.totalShiftedItems,start:0===n,end:n===r.length-1})}))}var a=this.props.value.map((function(n,i){var r=e?-1*(t.state.totalShiftedItems+t.state.numVisible):-1*t.state.totalShiftedItems,a=r+t.state.numVisible-1;return s.default.createElement(x,{key:i,template:t.props.itemTemplate,item:n,active:r<=i&&a>=i,start:r===i,end:a===i})}));return s.default.createElement(s.default.Fragment,null,n,a,i)}}},{key:"renderHeader",value:function(){return this.props.header?s.default.createElement("div",{className:"p-carousel-header"},this.props.header):null}},{key:"renderFooter",value:function(){return this.props.footer?s.default.createElement("div",{className:"p-carousel-footer"},this.props.footer):null}},{key:"renderContent",value:function(){var t=this,e=this.renderItems(),i=this.isVertical()?this.props.verticalViewPortHeight:"auto",r=this.renderBackwardNavigator(),a=this.renderForwardNavigator(),o=n.classNames("p-carousel-container",this.props.containerClassName);return s.default.createElement("div",{className:o},r,s.default.createElement("div",{className:"p-carousel-items-content",style:{height:i},onTouchStart:this.onTouchStart,onTouchMove:this.onTouchMove,onTouchEnd:this.onTouchEnd},s.default.createElement("div",{ref:function(e){return t.itemsContainer=e},className:"p-carousel-items-container",onTransitionEnd:this.onTransitionEnd},e)),a)}},{key:"renderBackwardNavigator",value:function(){var t=(!this.circular||this.props.value&&this.props.value.length<this.state.numVisible)&&0===this.getPage(),e=n.classNames("p-carousel-prev p-link",{"p-disabled":t}),r=n.classNames("p-carousel-prev-icon pi",{"pi-chevron-left":!this.isVertical(),"pi-chevron-up":this.isVertical()});return s.default.createElement("button",{type:"button",className:e,onClick:this.navBackward,disabled:t},s.default.createElement("span",{className:r}),s.default.createElement(i.Ripple,null))}},{key:"renderForwardNavigator",value:function(){var t=(!this.circular||this.props.value&&this.props.value.length<this.state.numVisible)&&(this.getPage()===this.totalIndicators-1||0===this.totalIndicators),e=n.classNames("p-carousel-next p-link",{"p-disabled":t}),r=n.classNames("p-carousel-next-icon pi",{"pi-chevron-right":!this.isVertical(),"pi-chevron-down":this.isVertical()});return s.default.createElement("button",{type:"button",className:e,onClick:this.navForward,disabled:t},s.default.createElement("span",{className:r}),s.default.createElement(i.Ripple,null))}},{key:"renderIndicator",value:function(t){var e=this,r=this.getPage()===t,a=n.classNames("p-carousel-indicator",{"p-highlight":r});return s.default.createElement("li",{className:a,key:"p-carousel-indicator-"+t},s.default.createElement("button",{type:"button",className:"p-link",onClick:function(n){return e.onDotClick(n,t)}},s.default.createElement(i.Ripple,null)))}},{key:"renderIndicators",value:function(){for(var t=n.classNames("p-carousel-indicators p-reset",this.props.indicatorsContentClassName),e=[],i=0;i<this.totalIndicators;i++)e.push(this.renderIndicator(i));return s.default.createElement("ul",{className:t},e)}},{key:"render",value:function(){var t=this,e=n.classNames("p-carousel p-component",{"p-carousel-vertical":this.isVertical(),"p-carousel-horizontal":!this.isVertical()},this.props.className),i=n.classNames("p-carousel-content",this.props.contentClassName);this.totalIndicators=this.getTotalIndicators();var r=this.renderContent(),a=this.renderIndicators(),o=this.renderHeader(),l=this.renderFooter();return s.default.createElement("div",{ref:function(e){return t.container=e},id:this.props.id,className:e,style:this.props.style},o,s.default.createElement("div",{className:i},r,a),l)}}]),r}(e.Component);return I(N,"defaultProps",{id:null,value:null,page:0,header:null,footer:null,style:null,className:null,itemTemplate:null,circular:!1,autoplayInterval:0,numVisible:1,numScroll:1,responsiveOptions:null,orientation:"horizontal",verticalViewPortHeight:"300px",contentClassName:null,containerClassName:null,indicatorsContentClassName:null,onPageChange:null}),t.Carousel=N,Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,primereact.utils,primereact.ripple,primereact.api);
|
package/core/core.js
CHANGED
|
@@ -174,6 +174,11 @@ this.primereact.utils = (function (exports, React) {
|
|
|
174
174
|
|
|
175
175
|
return 0;
|
|
176
176
|
}
|
|
177
|
+
}, {
|
|
178
|
+
key: "getBrowserLanguage",
|
|
179
|
+
value: function getBrowserLanguage() {
|
|
180
|
+
return navigator.userLanguage || navigator.languages && navigator.languages.length && navigator.languages[0] || navigator.language || navigator.browserLanguage || navigator.systemLanguage || 'en';
|
|
181
|
+
}
|
|
177
182
|
}, {
|
|
178
183
|
key: "getWindowScrollTop",
|
|
179
184
|
value: function getWindowScrollTop() {
|
|
@@ -1884,6 +1889,27 @@ this.primereact.utils = (function (exports, React) {
|
|
|
1884
1889
|
value: function isNotEmpty(value) {
|
|
1885
1890
|
return !this.isEmpty(value);
|
|
1886
1891
|
}
|
|
1892
|
+
/**
|
|
1893
|
+
* Compare value1 and value2 ascending by default (1) or pass in order as -1 for descending.
|
|
1894
|
+
*
|
|
1895
|
+
* @param {any} value1 the first value
|
|
1896
|
+
* @param {any} value2 the second value
|
|
1897
|
+
* @param {number | undefined} order by default ascending (1) set to descending (-1)
|
|
1898
|
+
* @param {string | undefined} locale the locale to use (default to browser locale if null)
|
|
1899
|
+
* @returns either 0, 1 or -1 for comparing the two values
|
|
1900
|
+
*/
|
|
1901
|
+
|
|
1902
|
+
}, {
|
|
1903
|
+
key: "sort",
|
|
1904
|
+
value: function sort(value1, value2) {
|
|
1905
|
+
var order = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
1906
|
+
var locale = arguments.length > 3 ? arguments[3] : undefined;
|
|
1907
|
+
var result = null;
|
|
1908
|
+
if (value1 == null && value2 != null) result = -1;else if (value1 != null && value2 == null) result = 1;else if (value1 == null && value2 == null) result = 0;else if (typeof value1 === 'string' && typeof value2 === 'string') result = value1.localeCompare(value2, locale, {
|
|
1909
|
+
numeric: true
|
|
1910
|
+
});else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
|
|
1911
|
+
return order * result;
|
|
1912
|
+
}
|
|
1887
1913
|
}]);
|
|
1888
1914
|
|
|
1889
1915
|
return ObjectUtils;
|
|
@@ -6882,6 +6908,11 @@ this.primereact.inputnumber = (function (exports, React, inputtext, utils, toolt
|
|
|
6882
6908
|
|
|
6883
6909
|
var code = event.which || event.keyCode;
|
|
6884
6910
|
|
|
6911
|
+
if (code !== 13) {
|
|
6912
|
+
// to submit a form
|
|
6913
|
+
event.preventDefault();
|
|
6914
|
+
}
|
|
6915
|
+
|
|
6885
6916
|
var _char = String.fromCharCode(code);
|
|
6886
6917
|
|
|
6887
6918
|
var isDecimalSign = this.isDecimalSign(_char);
|
|
@@ -6892,7 +6923,6 @@ this.primereact.inputnumber = (function (exports, React, inputtext, utils, toolt
|
|
|
6892
6923
|
isDecimalSign: isDecimalSign,
|
|
6893
6924
|
isMinusSign: isMinusSign
|
|
6894
6925
|
});
|
|
6895
|
-
event.preventDefault();
|
|
6896
6926
|
}
|
|
6897
6927
|
}
|
|
6898
6928
|
}, {
|
|
@@ -9381,7 +9411,7 @@ this.primereact.dropdown = (function (exports, React, utils, ripple, csstransiti
|
|
|
9381
9411
|
value: function scrollInView() {
|
|
9382
9412
|
var highlightItem = utils.DomHandler.findSingle(this.overlayRef.current, 'li.p-highlight');
|
|
9383
9413
|
|
|
9384
|
-
if (highlightItem) {
|
|
9414
|
+
if (highlightItem && highlightItem.scrollIntoView) {
|
|
9385
9415
|
highlightItem.scrollIntoView({
|
|
9386
9416
|
block: 'nearest',
|
|
9387
9417
|
inline: 'start'
|
|
@@ -12459,10 +12489,11 @@ this.primereact.tree = (function (exports, React, utils, ripple) {
|
|
|
12459
12489
|
utils.DomHandler.removeClass(event.target, 'p-treenode-droppoint-active');
|
|
12460
12490
|
|
|
12461
12491
|
if (this.props.onDropPoint) {
|
|
12492
|
+
var dropIndex = position === -1 ? this.props.index : this.props.index + 1;
|
|
12462
12493
|
this.props.onDropPoint({
|
|
12463
12494
|
originalEvent: event,
|
|
12464
12495
|
path: this.props.path,
|
|
12465
|
-
index:
|
|
12496
|
+
index: dropIndex,
|
|
12466
12497
|
position: position
|
|
12467
12498
|
});
|
|
12468
12499
|
}
|