react-generic-tools 0.0.42 → 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 +0 -1
- package/index.js +1 -1
- package/package.json +28 -22
- package/testHelper.js +1 -1
- package/type.d.ts +3 -2
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
|
|
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.
|
|
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.
|
|
55
|
-
"@babel/preset-react": "^7.
|
|
56
|
-
"@babel/runtime": "^7.24.
|
|
57
|
-
"@types/jsdom": "^21.1.
|
|
58
|
-
"@types/node": "^20.
|
|
59
|
-
"@types/react": "^18.
|
|
60
|
-
"@types/react-dom": "^18.
|
|
61
|
-
"@types/webpack-env": "^1.18.
|
|
62
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
63
|
-
"@typescript-eslint/parser": "^7.
|
|
64
|
-
"clientnode": "^3.0.
|
|
65
|
-
"documentation-website": "^1.0.
|
|
66
|
-
"eslint": "^
|
|
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.
|
|
68
|
+
"eslint-plugin-jsdoc": "^48.6.0",
|
|
69
69
|
"jest": "^29.7.0",
|
|
70
|
-
"jsdoc": "^4.0.
|
|
71
|
-
"react": "^18.
|
|
72
|
-
"react-dom": "^18.
|
|
73
|
-
"tslib": "^2.6.
|
|
74
|
-
"
|
|
75
|
-
"
|
|
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,
|
|
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
|
|
2
|
-
import { FunctionComponent, FunctionComponentElement, PropsWithChildren, ReactElement, ReactNode, SyntheticEvent,
|
|
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
|
}
|