react-generic-tools 0.0.13 → 0.0.15
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/index.d.ts +3 -2
- package/index.js +1 -1
- package/package.json +1 -1
- package/testHelper.js +1 -1
package/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { PaginationProperties } from './type';
|
|
2
3
|
/**
|
|
3
4
|
* Custom hook to memorize any values with a default empty array. Useful if
|
|
4
5
|
* using previous constant complex object within a render function.
|
|
@@ -8,4 +9,4 @@ import { GenericFunctionComponent, PaginationProperties } from './type';
|
|
|
8
9
|
* @returns Given cached value.
|
|
9
10
|
*/
|
|
10
11
|
export declare const useMemorizedValue: <T = unknown>(value: T, ...dependencies: Array<unknown>) => T;
|
|
11
|
-
export declare const Pagination:
|
|
12
|
+
export declare const Pagination: FunctionComponent<Partial<PaginationProperties>>;
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),require("clientnode"),require("react"),require("react/jsx-runtime"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/extends","@babel/runtime/helpers/objectWithoutPropertiesLoose","clientnode","react","react/jsx-runtime"],t);else{var n="object"==typeof exports?t(require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),require("clientnode"),require("react"),require("react/jsx-runtime")):t(e["@babel/runtime/helpers/extends"],e["@babel/runtime/helpers/objectWithoutPropertiesLoose"],e.clientnode,e.react,e["react/jsx-runtime"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,(function(e,t,n,r,o){return function(){var i=[function(t){t.exports=e},function(e){e.exports=n},function(e){e.exports=r}
|
|
1
|
+
"use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),require("clientnode"),require("react"),require("react/jsx-runtime"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/extends","@babel/runtime/helpers/objectWithoutPropertiesLoose","clientnode","react","react/jsx-runtime"],t);else{var n="object"==typeof exports?t(require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),require("clientnode"),require("react"),require("react/jsx-runtime")):t(e["@babel/runtime/helpers/extends"],e["@babel/runtime/helpers/objectWithoutPropertiesLoose"],e.clientnode,e.react,e["react/jsx-runtime"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,(function(e,t,n,r,o){return function(){var i=[function(t){t.exports=e},function(e){e.exports=n},function(e){e.exports=r},function(e){e.exports=o},,,,,,function(e){e.exports=t}],u={};function a(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return i[e](n,n.exports,a),n.exports}a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return function(){a.r(l),a.d(l,{Pagination:function(){return c},useMemorizedValue:function(){return p}});var e=a(0),t=a.n(e),n=a(9),r=a.n(n),o=a(1),i=a.n(o),u=a(2),d=a(3),s=["boundaryCount","className","disabled","hideNextButton","hidePrevButton","page","pageSize","render","showFirstButton","showLastButton","siblingCount","total"],p=function(e){for(var t=arguments.length,n=Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return(0,u.useMemo)((function(){return e}),n)},c=function(e){var n=e.boundaryCount,o=void 0===n?1:n,u=e.className,a=void 0===u?"pagination":u,l=e.disabled,p=e.hideNextButton,c=e.hidePrevButton,f=e.page,b=void 0===f?1:f,m=e.pageSize,v=void 0===m?5:m,h=e.render,x=void 0===h?function(e){var t=e.page,n=e.type;return""+(t||n)}:h,y=e.showFirstButton,g=e.showLastButton,j=e.siblingCount,q=void 0===j?1:j,P=e.total,B=void 0===P?100:P,w=r()(e,s);return B>(null!=v?v:1)?(0,d.jsx)("div",{className:a,children:(0,d.jsx)("ul",t()({},w,{children:i().arrayPaginate({boundaryCount:o,disabled:void 0!==l&&l,hideNextButton:void 0!==p&&p,hidePrevButton:void 0!==c&&c,page:b,pageSize:v,showFirstButton:void 0!==y&&y,showLastButton:void 0!==g&&g,siblingCount:q,total:B}).map((function(e){return(0,d.jsx)("li",{children:x(e)},e.type+("number"==typeof e.page?"-"+e.page:""))}))}))}):(0,d.jsx)(d.Fragment,{})}}(),l}()}));
|
package/package.json
CHANGED
package/testHelper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("@babel/runtime/helpers/extends"),require("clientnode"),require("react"),require("react-dom"),require("react-dom/client"),require("react-dom/test-utils"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/extends","clientnode","react","react-dom","react-dom/client","react-dom/test-utils"],r);else{var n="object"==typeof exports?r(require("@babel/runtime/helpers/extends"),require("clientnode"),require("react"),require("react-dom"),require("react-dom/client"),require("react-dom/test-utils")):r(e["@babel/runtime/helpers/extends"],e.clientnode,e.react,e["react-dom"],e["react-dom/client"],e["react-dom/test-utils"]);for(var t in n)("object"==typeof exports?exports:e)[t]=n[t]}}(this,(function(e,r,n,t,o,i){return function(){var u=[function(r){r.exports=e},function(e){e.exports=r},function(e){e.exports=n}
|
|
1
|
+
"use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("@babel/runtime/helpers/extends"),require("clientnode"),require("react"),require("react-dom"),require("react-dom/client"),require("react-dom/test-utils"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/extends","clientnode","react","react-dom","react-dom/client","react-dom/test-utils"],r);else{var n="object"==typeof exports?r(require("@babel/runtime/helpers/extends"),require("clientnode"),require("react"),require("react-dom"),require("react-dom/client"),require("react-dom/test-utils")):r(e["@babel/runtime/helpers/extends"],e.clientnode,e.react,e["react-dom"],e["react-dom/client"],e["react-dom/test-utils"]);for(var t in n)("object"==typeof exports?exports:e)[t]=n[t]}}(this,(function(e,r,n,t,o,i){return function(){var u=[function(r){r.exports=e},function(e){e.exports=r},function(e){e.exports=n},,,function(e){e.exports=t},function(e){e.exports=o},function(e){e.exports=i}],a={};function l(e){var r=a[e];if(void 0!==r)return r.exports;var n=a[e]={exports:{}};return u[e](n,n.exports,l),n.exports}l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,{a:r}),r},l.d=function(e,r){for(var n in r)l.o(r,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return function(){l.r(c),l.d(c,{prepareTestEnvironment:function(){return a}});var e=l(0),r=l.n(e),n=l(1),t=l(2),o=l(5),i=l(6),u=l(7);n.globalContext.IS_REACT_ACT_ENVIRONMENT=!0;var a=function(e,n){var a=null,l={container:null,render:function(e,r){var n;return void 0===r&&(r=!0),(0,u.act)((function(){a&&(r?(0,o.flushSync)((function(){return a.render(e)})):a.render(e))})),null!=(n=l.container)&&null!=(n=n.childNodes)&&n.length?l.container.childNodes[0]:l.container},runHook:function(e,n){void 0===n&&(n={});var i=r()({flush:!0,parameters:[],wrapper:null},n),l={},c=function(r){var n=r.parameters;return l.value=e.apply(void 0,n),null},d=function(){for(var e=arguments.length,n=Array(e),l=0;l<e;l++)n[l]=arguments[l];var d=(0,t.createElement)(c,{parameters:n});i.wrapper&&(d=(0,t.createElement)(i.wrapper.component,r()({},i.wrapper.properties||{},{children:d}))),(0,u.act)((function(){a&&(i.flush?(0,o.flushSync)((function(){return a.render(d)})):a.render(d))}))};return d.apply(void 0,i.parameters),{result:l,render:d}}};return e((function(){l.container=document.createElement("div"),l.container.setAttribute("class","test-wrapper"),document.body.appendChild(l.container),a||(0,u.act)((function(){a=(0,i.createRoot)(l.container)}))})),n((function(){a&&(0,u.act)((function(){a.unmount(),a=null})),l.container.remove(),l.container=null})),l};c.default=a}(),c}()}));
|