Skip to content

Commit

Permalink
4.0.0-beta.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetemrekilinc committed Nov 3, 2023
1 parent e8b9934 commit 1d717e8
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 16 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "comfort-react-demo",
"version": "4.0.0-beta.1",
"version": "4.0.0-beta.2",
"type": "module",
"license": "MIT",
"scripts": {
Expand All @@ -16,7 +16,7 @@
"@mui/material": "5.14.16",
"@mui/utils": "5.14.16",
"@mui/x-date-pickers": "6.17.0",
"comfort-react": "4.0.0-beta.1",
"comfort-react": "4.0.0-beta.2",
"date-fns": "2.30.0",
"jsx-to-string": "1.4.0",
"miragejs": "0.1.48",
Expand Down
54 changes: 45 additions & 9 deletions src/components/components/ComponentDatePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const INPUT_FORMAT_OPTIONS = [
'MM/dd/yyyy',
'MM-dd-yyyy',
'do MMM yyyy',
'dd/MM/yyyy HH:mm',
];
const INPUT_STYLE = { color: 'red' };
const PLACEHOLDER_TEXT = 'custom placeholder';
Expand All @@ -41,6 +42,9 @@ const ComponentDatePicker = () => {
const [enableUseValidatableForm, setEnableUseValidatableForm] = useState(false);
const [selectedFocusedLabel, setSelectedFocusedLabel] = useState(false);
const [format, setFormat] = useState();
const [enableTime, setEnableTime] = useState(false);
const [okText, setOkText] = useState();
const [cancelText, setCancelText] = useState();
const { setPathValue, setPathIsBlurred, getValue, getError } = useValidatableForm({
rules,
});
Expand Down Expand Up @@ -68,11 +72,14 @@ const ComponentDatePicker = () => {
variant={selectedVariant}
disabled={selectedDisabled}
fullWidth={selectedFullWidth}
InputProps={{
style: selectedInputStyle ? INPUT_STYLE : null,
textFieldProps={{
sx: selectedInputStyle ? { input: INPUT_STYLE } : null,
}}
renderErrorMessage={selectedRenderErrorMessage ? customErrorMessageRenderer : undefined}
focusedLabel={selectedFocusedLabel ? 'Focused DatePicker' : null}
enableTime={enableTime}
okText={okText}
cancelText={cancelText}
/>
);

Expand Down Expand Up @@ -206,6 +213,35 @@ const ComponentDatePicker = () => {
label={'format'}
/>
</Grid>
<Grid item xs={12} sm={6}>
<FormGroup>
<Checkbox
label={'enableTime'}
value={enableTime}
onChange={(newValue) => {
setEnableTime(newValue);
}}
/>
</FormGroup>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
value={okText}
onChange={(val) => {
setOkText(val);
}}
label="okText"
/>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
value={cancelText}
onChange={(val) => {
setCancelText(val);
}}
label="cancelText"
/>
</Grid>
</Grid>
<CurrentRulesInfo currentRules={currentJsx} dontStringify={true} header="Current Jsx" />
<CurrentComponentApiInfo
Expand Down Expand Up @@ -292,12 +328,6 @@ const DateApiInfo = [
defaultValue: '',
description: '',
},
{
name: 'renderedTextFieldSx',
type: 'Object',
defaultValue: '',
description: '',
},
{
name: 'fullWidth',
type: 'Bool',
Expand All @@ -311,7 +341,7 @@ const DateApiInfo = [
description: '',
},
{
name: 'inputProps',
name: 'textFieldProps',
type: 'Object',
defaultValue: '',
description: '',
Expand Down Expand Up @@ -352,4 +382,10 @@ const DateApiInfo = [
defaultValue: '',
description: '',
},
{
name: 'enableTime',
type: 'Bool',
defaultValue: '',
description: '',
},
];
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3313,7 +3313,7 @@ __metadata:
"@mui/utils": "npm:5.14.16"
"@mui/x-date-pickers": "npm:6.17.0"
"@vitejs/plugin-react": "npm:4.1.0"
comfort-react: "npm:4.0.0-beta.1"
comfort-react: "npm:4.0.0-beta.2"
date-fns: "npm:2.30.0"
eslint: "npm:8.52.0"
eslint-config-prettier: "npm:9.0.0"
Expand All @@ -3337,9 +3337,9 @@ __metadata:
languageName: unknown
linkType: soft

"comfort-react@npm:4.0.0-beta.1":
version: 4.0.0-beta.1
resolution: "comfort-react@npm:4.0.0-beta.1"
"comfort-react@npm:4.0.0-beta.2":
version: 4.0.0-beta.2
resolution: "comfort-react@npm:4.0.0-beta.2"
dependencies:
libphonenumber-js: "npm:1.10.49"
notistack: "npm:3.0.1"
Expand All @@ -3365,7 +3365,7 @@ __metadata:
react-dropzone: 14.2.3
react-imask: 7.1.3
react-phone-input-2: 2.15.1
checksum: f86af696cf77259ce0eafaedd678761edf85cccf00491e6a7f06790792a0f9e241ed3ae2857d273700ccd696e77a37c6f28f8995e73346957dca44aaca55f57b
checksum: 91b95438946bf5f69e1af21eb33a27626e66f4c86681f260a825968cfef7145bfa59da9021ce16b923afb79e3bb3c33e33507a9f4f5d30a6d93dc3e44d11cc61
languageName: node
linkType: hard

Expand Down

0 comments on commit 1d717e8

Please sign in to comment.