@udixio/ui-react 2.9.16 → 2.9.18

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":"AnchorPositioner.d.ts","sourceRoot":"","sources":["../../../src/lib/components/AnchorPositioner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,SAAS,EAIV,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;AAEnB,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,GAAI,2CAK9B,qBAAqB,4CAmGvB,CAAC"}
1
+ {"version":3,"file":"AnchorPositioner.d.ts","sourceRoot":"","sources":["../../../src/lib/components/AnchorPositioner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,SAAS,EAIV,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;AAEnB,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,GAAI,2CAK9B,qBAAqB,4CAsGvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/lib/components/TextField.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GAAI,6PAuBvB,UAAU,CAAC,kBAAkB,CAAC,4CAwUhC,CAAC"}
1
+ {"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/lib/components/TextField.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GAAI,6PAuBvB,UAAU,CAAC,kBAAkB,CAAC,4CAuUhC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@udixio/ui-react",
3
- "version": "2.9.16",
3
+ "version": "2.9.18",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -6,6 +6,7 @@ import React, {
6
6
  useState,
7
7
  } from 'react';
8
8
  import { SyncedFixedWrapper } from '../effects';
9
+ import { createPortal } from 'react-dom';
9
10
 
10
11
  export type Position =
11
12
  | 'top'
@@ -76,7 +77,10 @@ export const AnchorPositioner = ({
76
77
  ...style,
77
78
  } as any;
78
79
 
79
- return <div style={floatingStyles}>{children}</div>;
80
+ return createPortal(
81
+ <div style={floatingStyles}>{children}</div>,
82
+ document.body,
83
+ );
80
84
  }
81
85
 
82
86
  const fallbackStyles: CSSProperties = {
@@ -79,9 +79,12 @@ export const TextField = ({
79
79
  }
80
80
  };
81
81
 
82
- const handleOnFocus = () => {
82
+ const handleOnFocus = (
83
+ e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>,
84
+ ) => {
83
85
  setIsFocused(true);
84
86
  setShowErrorIcon(false);
87
+ restProps.onFocus?.(e);
85
88
  };
86
89
 
87
90
  const handleChange = (
@@ -100,11 +103,14 @@ export const TextField = ({
100
103
  }
101
104
  };
102
105
 
103
- const handleBlur = () => {
106
+ const handleBlur = (
107
+ e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>,
108
+ ) => {
104
109
  setIsFocused(false);
105
110
  if (errorText?.length) {
106
111
  setShowErrorIcon(true);
107
112
  }
113
+ restProps.onBlur?.(e);
108
114
  };
109
115
 
110
116
  // Date Picker Logic
@@ -258,6 +264,7 @@ export const TextField = ({
258
264
  )}
259
265
 
260
266
  <TextComponent
267
+ {...(restProps as any)}
261
268
  ref={inputRef as any}
262
269
  value={value}
263
270
  onChange={handleChange}
@@ -265,21 +272,13 @@ export const TextField = ({
265
272
  id={id}
266
273
  name={name}
267
274
  placeholder={isFocused ? (placeholder ?? undefined) : ''}
268
- onFocus={(e) => {
269
- handleOnFocus();
270
- if (isDateInput) {
271
- // Maybe open picker on focus? User preference.
272
- // Often better on click/icon click.
273
- // But let's stick to icon click for now or explicit open.
274
- }
275
- }}
275
+ onFocus={handleOnFocus}
276
276
  onBlur={handleBlur}
277
277
  disabled={disabled}
278
278
  autoComplete={autoComplete}
279
279
  aria-invalid={!!errorText?.length}
280
280
  aria-describedby={hasSupportingText ? helperTextId : undefined}
281
281
  {...textComponentProps}
282
- {...(restProps as any)}
283
282
  />
284
283
  </div>
285
284