react-input-material 0.0.416 → 0.0.419

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-input-material",
3
- "version": "0.0.416",
3
+ "version": "0.0.419",
4
4
  "description": "Reusable material design based input field with support for (richt-)text, code, selections, numbers, dates and so on.",
5
5
  "keywords": [
6
6
  "form-field",
package/testHelper.js CHANGED
@@ -1 +1 @@
1
- 'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(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"],t);else{var r="object"==typeof exports?t(require("@babel/runtime/helpers/extends"),require("clientnode"),require("react"),require("react-dom"),require("react-dom/client"),require("react-dom/test-utils")):t(e["@babel/runtime/helpers/extends"],e.clientnode,e.react,e["react-dom"],e["react-dom/client"],e["react-dom/test-utils"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(function(e,t,r,n,o,i){return function(){"use strict";var u={1:function(t){t.exports=e},3:function(e){e.exports=t},2:function(e){e.exports=r},41:function(e){e.exports=n},42:function(e){e.exports=o},43:function(e){e.exports=i}},c={};function a(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return u[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={};return function(){a.r(l),a.d(l,{prepareTestEnvironment:function(){return c}});var e=a(1),t=a.n(e),r=a(3),n=a(2),o=a(41),i=a(42),u=a(43);r.globalContext.IS_REACT_ACT_ENVIRONMENT=!0;var c=function(e,r){var c=null,a={container:null,render:function(e,t){var r,n;return void 0===t&&(t=!0),(0,u.act)((function(){c?t?(0,o.flushSync)((function(){return c.render(e)})):c.render(e):console.error('You call "render" outside a testing context.')})),null!=(r=a.container)&&null!=(n=r.childNodes)&&n.length?a.container.childNodes[0]:a.container},runHook:function(e,r,i,a){void 0===r&&(r=[]),void 0===i&&(i=null),void 0===a&&(a=!0);var l={},d=function(t){var r=t.parameters;return l.result=e.apply(void 0,r),null},s=function(){for(var e=arguments.length,r=new Array(e),l=0;l<e;l++)r[l]=arguments[l];var s=(0,n.createElement)(d,{parameters:r});i&&(s=(0,n.createElement)(i.component,t()({},i.properties||{},{children:s}))),(0,u.act)((function(){c?a?(0,o.flushSync)((function(){return c.render(s)})):c.render(s):console.error('You call "render" outside a testing context.')}))};return s.apply(void 0,r),{result:l,render:s}}};return e((function(){a.container=document.createElement("div"),a.container.setAttribute("class","test-wrapper"),document.body.appendChild(a.container),c||(0,u.act)((function(){c=(0,i.createRoot)(a.container)}))})),r((function(){c&&(0,u.act)((function(){c.unmount(),c=null})),a.container.remove(),a.container=null})),a};l.default=c}(),l}()}));
1
+ 'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}: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 t="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 n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(this,(function(e,r,t,n,o,i){return function(){"use strict";var u={1:function(r){r.exports=e},3:function(e){e.exports=r},2:function(e){e.exports=t},41:function(e){e.exports=n},42:function(e){e.exports=o},43:function(e){e.exports=i}},c={};function a(e){var r=c[e];if(void 0!==r)return r.exports;var t=c[e]={exports:{}};return u[e](t,t.exports,a),t.exports}a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,{a:r}),r},a.d=function(e,r){for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},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,{prepareTestEnvironment:function(){return c}});var e=a(1),r=a.n(e),t=a(3),n=a(2),o=a(41),i=a(42),u=a(43);t.globalContext.IS_REACT_ACT_ENVIRONMENT=!0;var c=function(e,t){var c=null,a={container:null,render:function(e,r){var t,n;return void 0===r&&(r=!0),(0,u.act)((function(){c?r?(0,o.flushSync)((function(){return c.render(e)})):c.render(e):console.error('You call "render" outside a testing context.')})),null!=(t=a.container)&&null!=(n=t.childNodes)&&n.length?a.container.childNodes[0]:a.container},runHook:function(e,t){void 0===t&&(t={});var i=r()({flush:!0,parameters:[],wrapper:null},t),a={},l=function(r){var t=r.parameters;return a.value=e.apply(void 0,t),null},d=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var d=(0,n.createElement)(l,{parameters:t});i.wrapper&&(d=(0,n.createElement)(i.wrapper.component,r()({},i.wrapper.properties||{},{children:d}))),(0,u.act)((function(){c?i.flush?(0,o.flushSync)((function(){return c.render(d)})):c.render(d):console.error('You call "render" outside a testing context.')}))};return d.apply(void 0,i.parameters),{result:a,render:d}}};return e((function(){a.container=document.createElement("div"),a.container.setAttribute("class","test-wrapper"),document.body.appendChild(a.container),c||(0,u.act)((function(){c=(0,i.createRoot)(a.container)}))})),t((function(){c&&(0,u.act)((function(){c.unmount(),c=null})),a.container.remove(),a.container=null})),a};l.default=c}(),l}()}));
package/type.d.ts CHANGED
@@ -35,10 +35,23 @@ export interface TestHookWrapper<P extends Array<unknown> = Array<unknown>, WP e
35
35
  }
36
36
  export interface TestHookResult<R = unknown, P extends Array<unknown> = Array<unknown>> {
37
37
  result: {
38
- result: R;
38
+ value: R;
39
39
  };
40
40
  render: (...parameters: P) => void;
41
41
  }
42
+ export interface HookOptions<P extends Array<unknown> = Array<unknown>, WP extends {
43
+ children: FunctionComponentElement<{
44
+ parameters: P;
45
+ }>;
46
+ } = {
47
+ children: FunctionComponentElement<{
48
+ parameters: P;
49
+ }>;
50
+ }> {
51
+ parameters: P;
52
+ wrapper?: null | TestHookWrapper<P, WP>;
53
+ flush?: boolean;
54
+ }
42
55
  export interface TestEnvironment {
43
56
  container: HTMLDivElement | null;
44
57
  render: <T = HTMLElement>(component: ReactElement) => null | T;
@@ -50,7 +63,7 @@ export interface TestEnvironment {
50
63
  children: FunctionComponentElement<{
51
64
  parameters: P;
52
65
  }>;
53
- }>(hook: (...parameters: P) => R, parameters: P, wrapper: null | TestHookWrapper<P, WP>, flush: boolean) => TestHookResult<R, P>;
66
+ }>(hook: (...parameters: P) => R, options: Partial<HookOptions<P, WP>>) => TestHookResult<R, P>;
54
67
  }
55
68
  export interface CursorState {
56
69
  end: number;
@@ -270,7 +283,7 @@ export interface InputProperties<T = unknown> extends InputModelState, Propertie
270
283
  });
271
284
  inputProperties: Partial<CodeEditorProps | RichTextEditorProps | SelectProps | TextFieldProps>;
272
285
  invertedPatternText: string;
273
- labels: Array<string> | Mapping;
286
+ labels: Array<[string, string]> | Array<string> | Mapping;
274
287
  maximumLengthText: string;
275
288
  maximumText: string;
276
289
  minimumLengthText: string;