Skip to content

Commit 80804cc

Browse files
Merge pull request #377 from nginformatica/feat/calendar-popover
Feat/calendar popover
2 parents 794c5ac + abacf10 commit 80804cc

File tree

3 files changed

+1351
-999
lines changed

3 files changed

+1351
-999
lines changed

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flipper-ui",
3-
"version": "0.35.14",
3+
"version": "0.35.15",
44
"description": "React UI based on the @mui/material toolkit for the web",
55
"main": "dist/index.js",
66
"author": "NG",
@@ -41,12 +41,12 @@
4141
"react-number-format": "5.4.4"
4242
},
4343
"devDependencies": {
44-
"@babel/cli": "7.27.0",
45-
"@babel/core": "7.26.10",
46-
"@babel/plugin-transform-runtime": "7.26.10",
47-
"@babel/preset-env": "7.26.9",
48-
"@babel/preset-react": "7.26.3",
49-
"@babel/preset-typescript": "7.27.0",
44+
"@babel/cli": "7.27.2",
45+
"@babel/core": "7.27.1",
46+
"@babel/plugin-transform-runtime": "7.27.1",
47+
"@babel/preset-env": "7.27.2",
48+
"@babel/preset-react": "7.27.1",
49+
"@babel/preset-typescript": "7.27.1",
5050
"@faker-js/faker": "9.7.0",
5151
"@storybook/addon-essentials": "8.6.12",
5252
"@storybook/addon-webpack5-compiler-babel": "3.0.6",
@@ -59,20 +59,20 @@
5959
"@testing-library/react": "16.3.0",
6060
"@testing-library/user-event": "14.6.1",
6161
"@types/jest": "29.5.14",
62-
"@types/node": "22.15.3",
62+
"@types/node": "22.15.15",
6363
"@types/ramda": "0.30.2",
6464
"@types/react": "18.3.12",
65-
"@typescript-eslint/eslint-plugin": "8.31.1",
66-
"@typescript-eslint/parser": "8.31.1",
65+
"@typescript-eslint/eslint-plugin": "8.32.0",
66+
"@typescript-eslint/parser": "8.32.0",
6767
"babel-loader": "10.0.0",
6868
"babel-plugin-import": "1.13.8",
6969
"babel-plugin-module-resolver": "5.0.2",
7070
"date-fns": "4.1.0",
71-
"eslint": "9.25.1",
72-
"eslint-config-prettier": "10.1.2",
71+
"eslint": "9.26.0",
72+
"eslint-config-prettier": "10.1.3",
7373
"eslint-import-resolver-typescript": "4.3.4",
7474
"eslint-plugin-import": "2.31.0",
75-
"eslint-plugin-prettier": "5.2.6",
75+
"eslint-plugin-prettier": "5.4.0",
7676
"eslint-plugin-react": "7.37.5",
7777
"eslint-plugin-react-hooks": "5.2.0",
7878
"fs-extra": "11.3.0",
@@ -87,9 +87,9 @@
8787
"ts-jest": "29.3.2",
8888
"ts-loader": "9.5.2",
8989
"typescript": "5.8.3",
90-
"typescript-eslint": "8.31.1",
90+
"typescript-eslint": "8.32.0",
9191
"uuid": "11.1.0",
92-
"webpack": "5.99.7"
92+
"webpack": "5.99.8"
9393
},
9494
"peerDependencies": {
9595
"date-fns": "^4.0.0",

src/core/inputs/date-time/index.tsx

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,33 @@ import { theme } from '@/theme'
3333

3434
const { neutral, primary } = theme.colors
3535

36+
export type Placement =
37+
| 'auto'
38+
| 'auto-start'
39+
| 'auto-end'
40+
| 'top'
41+
| 'bottom'
42+
| 'right'
43+
| 'left'
44+
| 'top-start'
45+
| 'top-end'
46+
| 'bottom-start'
47+
| 'bottom-end'
48+
| 'right-start'
49+
| 'right-end'
50+
| 'left-start'
51+
| 'left-end'
52+
3653
export interface IProps {
3754
type?: 'date' | 'time' | 'datetime'
3855
error?: boolean
3956
required?: boolean
4057
disabled?: boolean
4158
placeholder?: string
4259
fullWidth?: boolean
60+
placementDate?: Placement
61+
placementTime?: Placement
62+
placementDateTime?: Placement
4363
}
4464

4565
export type TDateTime = DatePickerProps<Date> &
@@ -198,6 +218,9 @@ const DateTime = ({
198218
placeholder,
199219
fullWidth,
200220
type = 'date',
221+
placementDate,
222+
placementTime,
223+
placementDateTime,
201224
...otherProps
202225
}: TDateTime) => {
203226
const commonProps = {
@@ -252,7 +275,7 @@ const DateTime = ({
252275
hidden: false,
253276
toolbarFormat: 'eee, dd MMM'
254277
},
255-
popper: { placement: 'bottom-end' },
278+
popper: { placement: placementDate || 'bottom-end' },
256279
layout: {
257280
sx: {
258281
'.MuiDateCalendar-root': {
@@ -288,7 +311,7 @@ const DateTime = ({
288311
inputProps: { role: 'date-picker' }
289312
},
290313
toolbar: { hidden: false },
291-
popper: { placement: 'bottom-end' },
314+
popper: { placement: placementTime || 'bottom-end' },
292315
layout: {
293316
sx: {
294317
'.MuiTimeClock-root': {
@@ -348,7 +371,7 @@ const DateTime = ({
348371
fullWidth: fullWidth ?? true,
349372
inputProps: { role: 'date-picker' }
350373
},
351-
popper: { placement: 'bottom-end' }
374+
popper: { placement: placementDateTime || 'bottom-end' }
352375
}}
353376
/>
354377
)

0 commit comments

Comments
 (0)