react-generic-tools 0.0.46 → 0.0.47

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.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 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}()}));
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.46",
3
+ "version": "0.0.47",
4
4
  "description": "Generic utility types, methods and components.",
5
5
  "keywords": [
6
6
  "utility",
@@ -51,29 +51,30 @@
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.24.8",
54
+ "@babel/eslint-parser": "^7.25.1",
55
55
  "@babel/preset-react": "^7.24.7",
56
- "@babel/runtime": "^7.24.8",
56
+ "@babel/runtime": "^7.25.6",
57
+ "@stylistic/eslint-plugin-ts": "^2.8.0",
57
58
  "@types/jsdom": "^21.1.7",
58
- "@types/node": "^20.14.11",
59
- "@types/react": "^18.3.3",
59
+ "@types/node": "^22.7.4",
60
+ "@types/react": "^18.3.10",
60
61
  "@types/react-dom": "^18.3.0",
61
62
  "@types/webpack-env": "^1.18.5",
62
- "@typescript-eslint/eslint-plugin": "^7.16.1",
63
- "@typescript-eslint/parser": "^7.16.1",
64
- "clientnode": "^3.0.1166",
65
- "documentation-website": "^1.0.328",
66
- "eslint": "^9.7.0",
63
+ "@typescript-eslint/eslint-plugin": "^8.7.0",
64
+ "@typescript-eslint/parser": "^8.7.0",
65
+ "clientnode": "^3.0.1193",
66
+ "documentation-website": "^1.0.332",
67
+ "eslint": "^9.11.1",
67
68
  "eslint-config-google": "^0.14.0",
68
- "eslint-plugin-jsdoc": "^48.7.0",
69
+ "eslint-plugin-jsdoc": "^50.3.0",
69
70
  "jest": "^29.7.0",
70
71
  "jsdoc": "^4.0.3",
71
72
  "react": "^18.3.1",
72
73
  "react-dom": "^18.3.1",
73
- "tslib": "^2.6.3",
74
- "typescript-eslint": "^7.16.1",
75
- "weboptimizer": "^2.0.1487",
76
- "webpack-dev-server": "^5.0.4"
74
+ "tslib": "^2.7.0",
75
+ "typescript-eslint": "^8.7.0",
76
+ "weboptimizer": "^2.0.1516",
77
+ "webpack-dev-server": "^5.1.0"
77
78
  },
78
79
  "peerDependencies": {
79
80
  "@babel/runtime": "*",
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,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}()}));
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(){r&&r.render(e)})):r.render(e))})),null!=(o=t.container)&&o.childNodes.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(){r&&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(){var e;r&&(0,p.act)((function(){r&&r.unmount(),r=null})),null==(e=t.container)||e.remove(),t.container=null})),t};return l.default=v,l}()}));
package/type.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Page, PaginateOptions } from 'clientnode';
2
- import { FunctionComponent, FunctionComponentElement, PropsWithChildren, ReactElement, ReactNode, SyntheticEvent, WeakValidationMap } from 'react';
2
+ import { FunctionComponent, FunctionComponentElement, PropsWithChildren, ReactElement, ReactNode, SyntheticEvent } from 'react';
3
3
  import { ValidationMap } from 'prop-types';
4
4
  export interface GenericEvent<T = unknown> extends SyntheticEvent {
5
5
  detail?: T;
@@ -9,9 +9,9 @@ export interface GenericEvent<T = unknown> extends SyntheticEvent {
9
9
  * Copied reacts component type but with "ReactNode" instead of "ReactElement"
10
10
  * as allowed return value.
11
11
  */
12
- export interface GenericFunctionComponent<P = {}> {
12
+ export interface GenericFunctionComponent<P = object> {
13
13
  (props: PropsWithChildren<P>, context?: any): ReactNode;
14
- propTypes?: WeakValidationMap<P>;
14
+ propTypes?: ValidationMap<P>;
15
15
  contextTypes?: ValidationMap<any>;
16
16
  defaultProps?: Partial<P>;
17
17
  displayName?: string;