react-generic-tools 0.0.41 → 0.0.43

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 CHANGED
@@ -5,7 +5,6 @@ import { PaginationProperties } from './type';
5
5
  * using previous constant complex object within a render function.
6
6
  * @param value - Value to memorize.
7
7
  * @param dependencies - Optional dependencies when to update given value.
8
- *
9
8
  * @returns Given cached value.
10
9
  */
11
10
  export declare const useMemorizedValue: <T = unknown>(value: T, ...dependencies: Array<unknown>) => T;
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},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}()}));
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 r="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 n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(function(e,t,r,n,o){return function(){var i=[function(e){e.exports=n},function(t){t.exports=e},function(e){e.exports=r},,,,,function(e){e.exports=t},function(e){e.exports=o}],u={};function a(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}};return i[e](r,r.exports,a),r.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 r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},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={};a.r(l),a.d(l,{Pagination:function(){return x},useMemorizedValue:function(){return h}});var d=a(1),s=a.n(d),p=a(7),c=a.n(p),f=a(2),b=a(0),m=a(8),v=["boundaryCount","className","disabled","hideNextButton","hidePrevButton","page","pageSize","render","showFirstButton","showLastButton","siblingCount","total"],h=function(e){for(var t=arguments.length,r=Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return(0,b.useMemo)((function(){return e}),r)},x=function(e){var t=e.boundaryCount,r=void 0===t?1:t,n=e.className,o=void 0===n?"pagination":n,i=e.disabled,u=e.hideNextButton,a=e.hidePrevButton,l=e.page,d=void 0===l?1:l,p=e.pageSize,b=void 0===p?5:p,h=e.render,x=void 0===h?function(e){var t=e.page,r=e.type;return""+(t||r)}:h,y=e.showFirstButton,g=e.showLastButton,j=e.siblingCount,q=void 0===j?1:j,B=e.total,P=void 0===B?100:B,w=c()(e,v);return P>(null!=b?b:1)?(0,m.jsx)("div",{className:o,children:(0,m.jsx)("ul",s()({},w,{children:(0,f.paginate)({boundaryCount:r,disabled:void 0!==i&&i,hideNextButton:void 0!==u&&u,hidePrevButton:void 0!==a&&a,page:d,pageSize:b,showFirstButton:void 0!==y&&y,showLastButton:void 0!==g&&g,siblingCount:q,total:P}).map((function(e){return(0,m.jsx)("li",{children:x(e)},e.type+("number"==typeof e.page?"-"+e.page:""))}))}))}):(0,m.jsx)(m.Fragment,{})};return l}()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-generic-tools",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "description": "Generic utility types, methods and components.",
5
5
  "keywords": [
6
6
  "utility",
@@ -51,28 +51,29 @@
51
51
  },
52
52
  "runkitExample": "require('@babel/runtime/package.json')\n\nglobalThis.window = globalThis\n\nconst {useMemorizedValue} = require('react-generic-tools')\n\nconst value = useMemorizedValue({date: 'content'})",
53
53
  "devDependencies": {
54
- "@babel/eslint-parser": "^7.23.10",
55
- "@babel/preset-react": "^7.23.3",
56
- "@babel/runtime": "^7.24.0",
57
- "@types/jsdom": "^21.1.6",
58
- "@types/node": "^20.11.24",
59
- "@types/react": "^18.2.63",
60
- "@types/react-dom": "^18.2.20",
61
- "@types/webpack-env": "^1.18.4",
62
- "@typescript-eslint/eslint-plugin": "^7.1.1",
63
- "@typescript-eslint/parser": "^7.1.1",
64
- "clientnode": "^3.0.1138",
65
- "documentation-website": "^1.0.326",
66
- "eslint": "^8.57.0",
54
+ "@babel/eslint-parser": "^7.24.7",
55
+ "@babel/preset-react": "^7.24.7",
56
+ "@babel/runtime": "^7.24.7",
57
+ "@types/jsdom": "^21.1.7",
58
+ "@types/node": "^20.14.10",
59
+ "@types/react": "^18.3.3",
60
+ "@types/react-dom": "^18.3.0",
61
+ "@types/webpack-env": "^1.18.5",
62
+ "@typescript-eslint/eslint-plugin": "^7.16.0",
63
+ "@typescript-eslint/parser": "^7.16.0",
64
+ "clientnode": "^3.0.1157",
65
+ "documentation-website": "^1.0.328",
66
+ "eslint": "^9.6.0",
67
67
  "eslint-config-google": "^0.14.0",
68
- "eslint-plugin-jsdoc": "^48.2.0",
68
+ "eslint-plugin-jsdoc": "^48.6.0",
69
69
  "jest": "^29.7.0",
70
- "jsdoc": "^4.0.2",
71
- "react": "^18.2.0",
72
- "react-dom": "^18.2.0",
73
- "tslib": "^2.6.2",
74
- "weboptimizer": "^2.0.1453",
75
- "webpack-dev-server": "^5.0.2"
70
+ "jsdoc": "^4.0.3",
71
+ "react": "^18.3.1",
72
+ "react-dom": "^18.3.1",
73
+ "tslib": "^2.6.3",
74
+ "typescript-eslint": "^7.16.0",
75
+ "weboptimizer": "^2.0.1483",
76
+ "webpack-dev-server": "^5.0.4"
76
77
  },
77
78
  "peerDependencies": {
78
79
  "@babel/runtime": "*",
@@ -146,5 +147,10 @@
146
147
  }
147
148
  }
148
149
  },
149
- "packageManager": "yarn@4.1.0+sha256.81a00df816059803e6b5148acf03ce313cad36b7f6e5af6efa040a15981a6ffb"
150
+ "packageManager": "yarn@4.1.0+sha256.81a00df816059803e6b5148acf03ce313cad36b7f6e5af6efa040a15981a6ffb",
151
+ "resolutions": {
152
+ "globals@npm:^11.1.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
153
+ "globals@npm:^14.0.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
154
+ "globals@npm:^9.18.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch"
155
+ }
150
156
  }
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},,,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}()}));
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,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n(require("@babel/runtime/helpers/extends"),require("clientnode"),require("react"),require("react-dom"),require("react-dom/client"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/extends","clientnode","react","react-dom","react-dom/client"],n);else{var r="object"==typeof exports?n(require("@babel/runtime/helpers/extends"),require("clientnode"),require("react"),require("react-dom"),require("react-dom/client")):n(e["@babel/runtime/helpers/extends"],e.clientnode,e.react,e["react-dom"],e["react-dom/client"]);for(var t in r)("object"==typeof exports?exports:e)[t]=r[t]}}(this,(function(e,n,r,t,o){return function(){var i=[function(e){e.exports=r},function(n){n.exports=e},function(e){e.exports=n},,function(e){e.exports=t},function(e){e.exports=o}],u={};function a(e){var n=u[e];if(void 0!==n)return n.exports;var r=u[e]={exports:{}};return i[e](r,r.exports,a),r.exports}a.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(n,{a:n}),n},a.d=function(e,n){for(var r in n)a.o(n,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},a.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};a.r(l),a.d(l,{prepareTestEnvironment:function(){return v}});var c=a(1),d=a.n(c),f=a(2),p=a(0),s=a(4),m=a(5);f.globalContext.IS_REACT_ACT_ENVIRONMENT=!0;var v=function(e,n){var r=null,t={container:null,render:function(e,n){var o;return void 0===n&&(n=!0),(0,p.act)((function(){r&&(n?(0,s.flushSync)((function(){return r.render(e)})):r.render(e))})),null!=(o=t.container)&&null!=(o=o.childNodes)&&o.length?t.container.childNodes[0]:t.container},runHook:function(e,n){void 0===n&&(n={});var t=d()({flush:!0,parameters:[],wrapper:null},n),o={},i=function(n){var r=n.parameters;return o.value=e.apply(void 0,r),null},u=function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];var u=(0,p.createElement)(i,{parameters:n});t.wrapper&&(u=(0,p.createElement)(t.wrapper.component,d()({},t.wrapper.properties||{},{children:u}))),(0,p.act)((function(){r&&(t.flush?(0,s.flushSync)((function(){return r.render(u)})):r.render(u))}))};return u.apply(void 0,t.parameters),{result:o,render:u}}};return e((function(){t.container=document.createElement("div"),t.container.setAttribute("class","test-wrapper"),document.body.appendChild(t.container),r||(0,p.act)((function(){r=(0,m.createRoot)(t.container)}))})),n((function(){r&&(0,p.act)((function(){r.unmount(),r=null})),t.container.remove(),t.container=null})),t};return l.default=v,l}()}));
package/type.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { Page, PaginateOptions } from 'clientnode/type';
2
- import { FunctionComponent, FunctionComponentElement, PropsWithChildren, ReactElement, ReactNode, SyntheticEvent, ValidationMap, WeakValidationMap } from 'react';
1
+ import { Page, PaginateOptions } from 'clientnode';
2
+ import { FunctionComponent, FunctionComponentElement, PropsWithChildren, ReactElement, ReactNode, SyntheticEvent, WeakValidationMap } from 'react';
3
+ import { ValidationMap } from 'prop-types';
3
4
  export interface GenericEvent<T = unknown> extends SyntheticEvent {
4
5
  detail?: T;
5
6
  }