@dartech/arsenal-ui 1.3.49 → 1.3.51
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.js +25 -18
- package/package.json +1 -1
- package/src/lib/Forms/ControlNumberInput.d.ts +6 -2
package/index.js
CHANGED
@@ -72,6 +72,8 @@ import StepConnector from '@mui/material/StepConnector';
|
|
72
72
|
import Select from '@mui/material/Select';
|
73
73
|
import CloseIcon from '@mui/icons-material/Close';
|
74
74
|
import InputLabel from '@mui/material/InputLabel';
|
75
|
+
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
76
|
+
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
75
77
|
import classnames from 'classnames';
|
76
78
|
import { toast } from 'react-toastify';
|
77
79
|
import CssBaseline from '@mui/material/CssBaseline';
|
@@ -1844,9 +1846,10 @@ const ControlNumberInput = _a => {
|
|
1844
1846
|
disabled = false,
|
1845
1847
|
hideErrorMessage = false,
|
1846
1848
|
onChange: customOnChange,
|
1847
|
-
decimal = false
|
1849
|
+
decimal = false,
|
1850
|
+
valueAsNumber
|
1848
1851
|
} = _a,
|
1849
|
-
textFieldProps = __rest(_a, ["control", "validate", "name", "label", "required", "defaultValue", "disabled", "hideErrorMessage", "onChange", "decimal"]);
|
1852
|
+
textFieldProps = __rest(_a, ["control", "validate", "name", "label", "required", "defaultValue", "disabled", "hideErrorMessage", "onChange", "decimal", "valueAsNumber"]);
|
1850
1853
|
const {
|
1851
1854
|
field: {
|
1852
1855
|
ref,
|
@@ -1882,7 +1885,7 @@ const ControlNumberInput = _a => {
|
|
1882
1885
|
if (customOnChange) {
|
1883
1886
|
customOnChange(event);
|
1884
1887
|
} else {
|
1885
|
-
onChange(event.target.value);
|
1888
|
+
onChange(valueAsNumber ? !event.target.value ? null : lastData === '.' ? event.target.value : +event.target.value : event.target.value);
|
1886
1889
|
}
|
1887
1890
|
}
|
1888
1891
|
};
|
@@ -5345,24 +5348,28 @@ const DefinitionFiller = ({
|
|
5345
5348
|
}
|
5346
5349
|
return [];
|
5347
5350
|
}, [properties, dataFieldName, _useExpression]);
|
5348
|
-
return
|
5349
|
-
|
5350
|
-
direction: "column",
|
5351
|
-
spacing: 2
|
5351
|
+
return jsx(LocalizationProvider, Object.assign({
|
5352
|
+
dateAdapter: AdapterDateFns
|
5352
5353
|
}, {
|
5353
|
-
children:
|
5354
|
-
|
5354
|
+
children: jsxs(Grid$1, Object.assign({
|
5355
|
+
container: true,
|
5356
|
+
direction: "column",
|
5357
|
+
spacing: 2
|
5355
5358
|
}, {
|
5356
|
-
children: jsx(
|
5357
|
-
|
5358
|
-
fontWeight: '600'
|
5359
|
-
}
|
5359
|
+
children: [title && jsx(Grid$1, Object.assign({
|
5360
|
+
xs: 12
|
5360
5361
|
}, {
|
5361
|
-
children:
|
5362
|
-
|
5363
|
-
|
5364
|
-
|
5365
|
-
|
5362
|
+
children: jsx("div", Object.assign({
|
5363
|
+
style: {
|
5364
|
+
fontWeight: '600'
|
5365
|
+
}
|
5366
|
+
}, {
|
5367
|
+
children: title
|
5368
|
+
}))
|
5369
|
+
})), jsx(StepperView, {
|
5370
|
+
data: stepperData
|
5371
|
+
})]
|
5372
|
+
}))
|
5366
5373
|
}));
|
5367
5374
|
};
|
5368
5375
|
|
package/package.json
CHANGED
@@ -14,7 +14,7 @@ type Props = TextFieldProps & {
|
|
14
14
|
/**
|
15
15
|
* React Hook Form `control`
|
16
16
|
*/
|
17
|
-
control: Control
|
17
|
+
control: Control<any>;
|
18
18
|
/**
|
19
19
|
* Is input required flag
|
20
20
|
*/
|
@@ -46,6 +46,10 @@ type Props = TextFieldProps & {
|
|
46
46
|
* Is number decimal or integer flag
|
47
47
|
*/
|
48
48
|
decimal?: boolean;
|
49
|
+
/**
|
50
|
+
* Set value as number
|
51
|
+
*/
|
52
|
+
valueAsNumber?: boolean;
|
49
53
|
};
|
50
|
-
export declare const ControlNumberInput: ({ control, validate, name, label, required, defaultValue, disabled, hideErrorMessage, onChange: customOnChange, decimal, ...textFieldProps }: Props) => JSX.Element;
|
54
|
+
export declare const ControlNumberInput: ({ control, validate, name, label, required, defaultValue, disabled, hideErrorMessage, onChange: customOnChange, decimal, valueAsNumber, ...textFieldProps }: Props) => JSX.Element;
|
51
55
|
export default ControlNumberInput;
|