2 lines
9.5 KiB
JavaScript
2 lines
9.5 KiB
JavaScript
|
this.primereact=this.primereact||{},this.primereact.dataview=function(t,e,r,n,o,a){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=i(e);function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function p(t){if(Array.isArray(t))return l(t)}function u(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function c(t,e){if(t){if("string"==typeof t)return l(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)?l(t,e):void 0}}function f(){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 d(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function g(t,e,r){return e&&d(t.prototype,e),r&&d(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 m(t,e){return m=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},m(t,e)}function v(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&&m(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 P(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 y(t)}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}function k(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E(t){var e=N();return function(){var r,n=w(t);if(e){var o=w(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return P(this,r)}}function N(){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 O=function(t){v(r,t);var e=E(r);function r(t){var n;return h(this,r),(n=e.call(this,t)).changeLayout=n.changeLayout.bind(y(n)),n}return g(r,[{key:"changeLayout",value:function(t,e){this.props.onChange({originalEvent:t,value:e}),t.preventDefault()}},{key:"render",value:function(){var t=this,e=n.classNames("p-dataview-layout-options p-selectbutton p-buttonset",this.props.className),r=n.classNames("p-button p-button-icon-only",{"p-highlight":"list"===this.props.layout}),a=n.classNames("p-button p-button-icon-only",{"p-highlight":"grid"===this.props.layout});return s.default.createElement("div",{id:this.props.id,style:this.props.style,className:e},s.default.createElement("button",{type:"button",className:r,onClick:function(e){return t.changeLayout(e,"list")}},s.default.createElement("i",{className:"pi pi-bars"}),s.default.createElement(o.Ripple,null)),s.default.createElement("button",{type:"button",className:a,onClick:function(e){return t.changeLayout(e,"grid")}},s.default.createElement("i",{className:"pi pi-th-large"}),s.default.createElement(o.Ripple,null)))}}]),r}(e.Component);k(O,"defaultProps",{id:null,style:null,className:null,layout:null,onChange:null});var R=function(t){v(r,t);var e=E(r);function r(){return h(this,r),e.ap
|