@transferwise/components 0.0.0-experimental-adcaf57 → 0.0.0-experimental-d0bd4b4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"WithDisplayFormat.d.ts","sourceRoot":"","sources":["../../../src/withDisplayFormat/WithDisplayFormat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAS7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,MAAM,cAAc,GAAG,KAAK,CAChC,UAAU,EACV;IACE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,GAAG,UAAU,CAAC;IACvD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CACF,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,iBAAiB,CAAC,YAAY,GAAG;IAC1D,MAAM,EAAE,CAAC,WAAW,EAAE,UAAU,GAAG,aAAa,KAAK,GAAG,CAAC,OAAO,CAAC;CAClE,GAAG,cAAc,CAAC;AAEnB,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,OAAO,GACP,KAAK,GACL,MAAM,GACN,MAAM,GACN,WAAW,GACX,Q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AC;IACxB,YAAY,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACpD,YAAY,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACjD,CAAC;AAEF,cAAM,iBAAkB,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACrD,MAAM,CAAC,YAAY;;;;;MAKjB;gBAEU,KAAK,EAAE,KAAK;IAYxB,MAAM,CAAC,wBAAwB,CAC7B,EAAE,cAAc,EAAE,EAAE,KAAK,EACzB,EAAE,kBAAmC,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,KAAK;;;;;;;IAiBzE,aAAa,qBAAsB,MAAM,KAAG,SAAS,CA+BnD;IAEF,UAAU,aAMR;IAEF,cAAc,UAAW,cAAc,gBAAgB,CAAC,4BAMtD;IAEF,eAAe,UAAW,cAAc,gBAAgB,CAAC,UAuBvD;IAEF,aAAa,UAAW,eAAe,gBAAgB,CAAC,UAQtD;IAEF,WAAW,aAET;IAEF,YAAY,WAAY,SAAS,aAK/B;IAEF,cAAc,UAAW,YAAY,gBAAgB,CAAC,UA0BpD;IAEF,YAAY,UAAW,WAAW,gBAAgB,CAAC,UAEjD;IAEF,aAAa,UAAW,WAAW,gBAAgB,CAAC,UAMlD;IAEF,YAAY,qBAAsB,MAAM,UAAU,SAAS,YAwBzD;IAEF,uBAAuB,WAAY,SAAS,UAkB1C;IAEF,MAAM;CAuCP;AAED,eAAe,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-adcaf57",
3
+ "version": "0.0.0-experimental-d0bd4b4",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -23,6 +23,8 @@ export const Basic: Story = {
23
23
  </>
24
24
  );
25
25
  },
26
+ // intentionally use interactive typing (over init value via `value` prop)
27
+ // to trigger event handlers in the component
26
28
  play: ({ canvasElement }) => {
27
29
  const canvas = within(canvasElement);
28
30
  userEvent.type(canvas.getByRole('textbox'), '111122223333');
@@ -276,27 +276,43 @@ class WithDisplayFormat extends Component<Props, State> {
276
276
  };
277
277
 
278
278
  render() {
279
- return this.props.render({
280
- value: this.state.value,
281
- type: this.props.type,
282
- inputMode: this.props.inputMode,
283
- className: this.props.className,
284
- id: this.props.id,
285
- name: this.props.name,
286
- placeholder: this.props.placeholder,
287
- readOnly: this.props.readOnly,
288
- required: this.props.required,
289
- minLength: this.props.minLength,
290
- maxLength: this.props.maxLength,
291
- disabled: this.props.disabled,
292
- autoComplete: this.props.autoComplete,
279
+ const {
280
+ type,
281
+ inputMode,
282
+ className,
283
+ id,
284
+ name,
285
+ placeholder,
286
+ readOnly,
287
+ required,
288
+ minLength,
289
+ maxLength,
290
+ disabled,
291
+ autoComplete,
292
+ } = this.props;
293
+ const { value } = this.state;
294
+ const renderProps = {
295
+ type,
296
+ inputMode,
297
+ className,
298
+ id,
299
+ name,
300
+ placeholder,
301
+ readOnly,
302
+ required,
303
+ minLength,
304
+ maxLength,
305
+ disabled,
306
+ autoComplete,
307
+ value,
293
308
  onFocus: this.handleOnFocus,
294
309
  onBlur: this.handleOnBlur,
295
310
  onPaste: this.handleOnPaste,
296
311
  onKeyDown: this.handleOnKeyDown,
297
312
  onChange: this.handleOnChange,
298
313
  onCut: this.handleOnCut,
299
- });
314
+ };
315
+ return this.props.render(renderProps);
300
316
  }
301
317
  }
302
318