form-input-fields 1.0.10 → 1.0.11
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/README.md +21 -0
- package/dist/controls/FormDropDownField/FormDropDownField.d.ts +6 -1
- package/dist/controls/FormDropDownField/FormDropDownField.d.ts.map +1 -1
- package/dist/controls/FormMaskField/FormMaskField.d.ts +5 -0
- package/dist/controls/FormMaskField/FormMaskField.d.ts.map +1 -1
- package/dist/controls/FormTextField/FormTextField.d.ts +5 -0
- package/dist/controls/FormTextField/FormTextField.d.ts.map +1 -1
- package/dist/index.es.js +7351 -7043
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +120 -88
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -173,6 +173,7 @@ If you're still experiencing issues, please reach me at vladimir.vorobiev@gmail.
|
|
|
173
173
|
- [Basic Date Text Input](#basic-date-text-input)
|
|
174
174
|
- [Date Text Field with Formik](#date-text-field-with-formik)
|
|
175
175
|
- [Custom Date Format](#custom-date-format)
|
|
176
|
+
- [History](#history)
|
|
176
177
|
|
|
177
178
|
---
|
|
178
179
|
|
|
@@ -218,6 +219,7 @@ The FormTextField component accepts all props from `FormTextFieldProps`, `FieldP
|
|
|
218
219
|
|------------|------------|---------|-----------------------------------------------|
|
|
219
220
|
| `onChange` | `function` | - | Custom change handler that overrides Formik's |
|
|
220
221
|
| `onBlur` | `function` | - | Custom blur handler that overrides Formik's |
|
|
222
|
+
| `variant` | `'standard' | 'outlined' | 'filled'` | 'standard' | The variant of the MUI TextField. |
|
|
221
223
|
|
|
222
224
|
#### Common Props (from FieldProps & TextFieldProps)
|
|
223
225
|
|
|
@@ -244,6 +246,7 @@ The FormTextField component accepts all props from `FormTextFieldProps`, `FieldP
|
|
|
244
246
|
placeholder="Enter your username"
|
|
245
247
|
fullWidth
|
|
246
248
|
margin="normal"
|
|
249
|
+
variant="outlined" // <-- Example with outlined variant
|
|
247
250
|
/>
|
|
248
251
|
```
|
|
249
252
|
|
|
@@ -354,6 +357,7 @@ The FormDropDownField component accepts all props from `FormDropDownFieldProps`,
|
|
|
354
357
|
| `error` | `boolean` | - | Error state of the field (overrides Formik error state) |
|
|
355
358
|
| `onChange` | `(value: any) => void` | - | Custom change handler |
|
|
356
359
|
| `onBlur` | `(event: React.FocusEvent<HTMLInputElement>) => void` | - | Custom blur handler |
|
|
360
|
+
| `variant` | `'standard' | 'outlined' | 'filled'` | 'standard' | The variant of the MUI TextField. |
|
|
357
361
|
|
|
358
362
|
### Examples
|
|
359
363
|
|
|
@@ -372,6 +376,7 @@ const items = [
|
|
|
372
376
|
label="Country"
|
|
373
377
|
items={items}
|
|
374
378
|
fullWidth
|
|
379
|
+
variant="outlined" // <-- Example with outlined variant
|
|
375
380
|
/>
|
|
376
381
|
```
|
|
377
382
|
|
|
@@ -1267,6 +1272,7 @@ import { FormMaskField } from "form-input-mask-field";
|
|
|
1267
1272
|
| `showMaskPattern` | `boolean` | `false` | Show the mask pattern as helper text below the input field |
|
|
1268
1273
|
| `showPlaceholder` | `boolean` | `false` | Show placeholder text with mask pattern in the input field |
|
|
1269
1274
|
| `onChange` | `function` | - | Custom change handler with masked, clean, and raw values |
|
|
1275
|
+
| `variant` | `'standard' | 'outlined' | 'filled'` | 'standard' | The variant of the MUI TextField. |
|
|
1270
1276
|
|
|
1271
1277
|
Plus all standard Material-UI TextField props and Formik FieldProps.
|
|
1272
1278
|
|
|
@@ -1281,6 +1287,7 @@ Plus all standard Material-UI TextField props and Formik FieldProps.
|
|
|
1281
1287
|
label="Phone Number"
|
|
1282
1288
|
mask="(999) 999-9999"
|
|
1283
1289
|
placeholder="(555) 123-4567"
|
|
1290
|
+
variant="outlined" // <-- Example with outlined variant
|
|
1284
1291
|
/>
|
|
1285
1292
|
```
|
|
1286
1293
|
|
|
@@ -1334,6 +1341,7 @@ Plus all standard Material-UI TextField props and Formik FieldProps.
|
|
|
1334
1341
|
console.log("Clean value:", event.target.cleanValue);
|
|
1335
1342
|
console.log("Raw input:", event.target.rawValue);
|
|
1336
1343
|
}}
|
|
1344
|
+
variant="outlined" // <-- Example with outlined variant
|
|
1337
1345
|
/>
|
|
1338
1346
|
```
|
|
1339
1347
|
|
|
@@ -1522,6 +1530,7 @@ function App() {
|
|
|
1522
1530
|
showPlaceholder={true}
|
|
1523
1531
|
helperText="US phone number format"
|
|
1524
1532
|
onChange={handleCustomChange("phone")}
|
|
1533
|
+
variant="outlined" // <-- Example with outlined variant
|
|
1525
1534
|
/>
|
|
1526
1535
|
</Grid>
|
|
1527
1536
|
|
|
@@ -1791,3 +1800,15 @@ The example demonstrates how FormMaskField seamlessly integrates with existing M
|
|
|
1791
1800
|
If you like my work, you can support me here:
|
|
1792
1801
|
|
|
1793
1802
|
[](https://coff.ee/vavanv)
|
|
1803
|
+
|
|
1804
|
+
## History
|
|
1805
|
+
|
|
1806
|
+
### Added `variant` prop to controls
|
|
1807
|
+
|
|
1808
|
+
The following controls now accept a `variant` prop (`'standard' | 'outlined' | 'filled'`), which is passed to the underlying MUI TextField. The default is `'standard'`:
|
|
1809
|
+
|
|
1810
|
+
- `FormTextField`
|
|
1811
|
+
- `FormDropDownField`
|
|
1812
|
+
- `FormMaskField`
|
|
1813
|
+
|
|
1814
|
+
This allows you to easily switch between Material-UI's standard, outlined, and filled input styles for these components.
|
|
@@ -49,8 +49,13 @@ export interface FormDropDownFieldProps {
|
|
|
49
49
|
* Custom onBlur handler
|
|
50
50
|
*/
|
|
51
51
|
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
52
|
+
/**
|
|
53
|
+
* The variant to use for the MUI TextField ('standard', 'outlined', 'filled')
|
|
54
|
+
* @default 'standard'
|
|
55
|
+
*/
|
|
56
|
+
variant?: 'standard' | 'outlined' | 'filled';
|
|
52
57
|
}
|
|
53
58
|
type FormDropDownFieldComponentProps = FormDropDownFieldProps & FieldProps & Omit<TextFieldProps, 'value' | 'onChange' | 'onBlur' | 'name' | 'defaultValue' | 'onError' | 'onFocus' | 'InputProps' | 'select' | 'SelectProps'>;
|
|
54
|
-
export declare const FormDropDownField: ({ field, form, items, addInputSelect, selectText, required, disabled, className, helperText, error, onChange, onBlur, ...props }: FormDropDownFieldComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare const FormDropDownField: ({ field, form, items, addInputSelect, selectText, required, disabled, className, helperText, error, onChange, onBlur, variant, ...props }: FormDropDownFieldComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
60
|
export {};
|
|
56
61
|
//# sourceMappingURL=FormDropDownField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormDropDownField.d.ts","sourceRoot":"","sources":["../../../src/controls/FormDropDownField/FormDropDownField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAS,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAoC,MAAM,eAAe,CAAC;AAGjF,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE3D;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAEhC;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,K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GACR,aAAa,CAChB,CAAC;AAEJ,eAAO,MAAM,iBAAiB,GAAI,2IAe/B,+BAA+B,4CAiEjC,CAAC"}
|
|
@@ -36,6 +36,11 @@ export interface FormMaskFieldProps {
|
|
|
36
36
|
showMaskPattern?: boolean;
|
|
37
37
|
/** Show the placeholder text (default: false) */
|
|
38
38
|
showPlaceholder?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The variant to use for the MUI TextField ('standard', 'outlined', 'filled')
|
|
41
|
+
* @default 'standard'
|
|
42
|
+
*/
|
|
43
|
+
variant?: 'standard' | 'outlined' | 'filled';
|
|
39
44
|
}
|
|
40
45
|
export type FormMaskFieldComponentProps = FieldProps & TextFieldProps & FormMaskFieldProps;
|
|
41
46
|
export declare const FormMaskField: (props: FormMaskFieldComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormMaskField.d.ts","sourceRoot":"","sources":["../../../src/controls/FormMaskField/FormMaskField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAS,MAAM,QAAQ,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAI9D,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,gEAAgE;IAChE,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE;QACL,MAAM,EAAE;YACN,KAAK,EAAE,MAAM,CAAC;YACd,UAAU,EAAE,MAAM,CAAC;YACnB,QAAQ,EAAE,MAAM,CAAC;SAClB,CAAC;KACH,GAAG,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KACpC,IAAI,CAAC;IAEV,4DAA4D;IAC5D,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,iDAAiD;IACjD,eAAe,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormMaskField.d.ts","sourceRoot":"","sources":["../../../src/controls/FormMaskField/FormMaskField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAS,MAAM,QAAQ,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAI9D,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,gEAAgE;IAChE,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE;QACL,MAAM,EAAE;YACN,KAAK,EAAE,MAAM,CAAC;YACd,UAAU,EAAE,MAAM,CAAC;YACnB,QAAQ,EAAE,MAAM,CAAC;SAClB,CAAC;KACH,GAAG,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KACpC,IAAI,CAAC;IAEV,4DAA4D;IAC5D,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,iDAAiD;IACjD,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;CAC9C;AAED,MAAM,MAAM,2BAA2B,GAAG,UAAU,GAAG,cAAc,GAAG,kBAAkB,CAAC;AAE3F,eAAO,MAAM,aAAa,GAAI,OAAO,2BAA2B,4CA+H/D,CAAC"}
|
|
@@ -5,6 +5,11 @@ export interface FormTextFieldProps extends FieldProps, Omit<TextFieldProps, 'na
|
|
|
5
5
|
onChange?: (value: any) => void;
|
|
6
6
|
/** Custom onBlur handler that will override Formik's default */
|
|
7
7
|
onBlur?: (e: React.FocusEvent<any, Element>) => void;
|
|
8
|
+
/**
|
|
9
|
+
* The variant to use for the MUI TextField ('standard', 'outlined', 'filled')
|
|
10
|
+
* @default 'standard'
|
|
11
|
+
*/
|
|
12
|
+
variant?: 'standard' | 'outlined' | 'filled';
|
|
8
13
|
}
|
|
9
14
|
export declare const FormTextField: (props: FormTextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
15
|
//# sourceMappingURL=FormTextField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormTextField.d.ts","sourceRoot":"","sources":["../../../src/controls/FormTextField/FormTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAS,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,cAAc,EAA0B,MAAM,eAAe,CAAC;AAEvE,MAAM,WAAW,kBAAmB,SAAQ,UAAU,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;IACpH,kEAAkE;IAClE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAEhC,gEAAgE;IAChE,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"FormTextField.d.ts","sourceRoot":"","sources":["../../../src/controls/FormTextField/FormTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAS,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,cAAc,EAA0B,MAAM,eAAe,CAAC;AAEvE,MAAM,WAAW,kBAAmB,SAAQ,UAAU,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;IACpH,kEAAkE;IAClE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAEhC,gEAAgE;IAChE,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAErD;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;CAC9C;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,4CA0BtD,CAAC"}
|