2 lines
9.1 KiB
JavaScript
2 lines
9.1 KiB
JavaScript
|
import t,{Component as e}from"react";import{Paginator as r}from"primereact/paginator";import{classNames as o,ObjectUtils as n}from"primereact/utils";import{Ripple as a}from"primereact/ripple";import{localeOption as i}from"primereact/api";function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}function p(t){if(Array.isArray(t))return s(t)}function l(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t,e){if(t){if("string"==typeof t)return s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,e):void 0}}function c(){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 h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function g(t,e,r){return e&&f(t.prototype,e),r&&f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(t,e){return d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},d(t,e)}function m(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&&d(t,e)}function v(t){return v="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},v(t)}function b(t,e){if(e&&("object"===v(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return y(t)}function P(t){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},P(t)}function w(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function k(t){var e=E();return function(){var r,o=P(t);if(e){var n=P(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return b(this,r)}}function E(){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 R=function(r){m(i,e);var n=k(i);function i(t){var e;return h(this,i),(e=n.call(this,t)).changeLayout=e.changeLayout.bind(y(e)),e}return g(i,[{key:"changeLayout",value:function(t,e){this.props.onChange({originalEvent:t,value:e}),t.preventDefault()}},{key:"render",value:function(){var e=this,r=o("p-dataview-layout-options p-selectbutton p-buttonset",this.props.className),n=o("p-button p-button-icon-only",{"p-highlight":"list"===this.props.layout}),i=o("p-button p-button-icon-only",{"p-highlight":"grid"===this.props.layout});return t.createElement("div",{id:this.props.id,style:this.props.style,className:r},t.createElement("button",{type:"button",className:n,onClick:function(t){return e.changeLayout(t,"list")}},t.createElement("i",{className:"pi pi-bars"}),t.createElement(a,null)),t.createElement("button",{type:"button",className:i,onClick:function(t){return e.changeLayout(t,"grid")}},t.createElement("i",{className:"pi pi-th-large"}),t.createElement(a,null)))}}]),i}();w(R,"defaultProps",{id:null,style:null,className:null,layout:null,onChange:null});var N=function(t){m(o,e);var r=k(o);function o(){return h(this,o),r.apply(this,arguments)}return g(o,[{key:"render",value:fun
|