Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v3.2.1 #1218

Merged
merged 77 commits into from
Jul 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
943dd6e
Fix not working logo
dmtrKovalenko May 26, 2019
fa37e74
Mention required material-ui v4 in README.md
dmtrKovalenko May 29, 2019
e6a5608
📝 improve grammar in docs (#1073)
balazsorban44 May 30, 2019
99f6556
Fix time order in RTL DateTimePicker (mui-org#1071) (#1072)
Scimonster May 31, 2019
7e14b83
Consume fade correctly (#1077)
TrySound Jun 2, 2019
763917b
Remove react-event-listener (#1075)
TrySound Jun 2, 2019
e027868
Update packages | 02 06 2018 (#1079)
dmtrKovalenko Jun 2, 2019
ecf3c4c
Disable ToolbarButtonOverride, closes #1076 (#1080)
dmtrKovalenko Jun 2, 2019
9dc9a06
Fix inputRef collision, closes #1069 (#1081)
dmtrKovalenko Jun 2, 2019
517c5b3
[DatePicker] add strictCompareDates prop (#1067)
sviande Jun 3, 2019
24294fa
Async month changed callbacks (#1052)
lindgren-linus Jun 3, 2019
afb3bd1
[typescript] Fix incorrectly inferred type for keyboard onChange (#1083)
dmtrKovalenko Jun 3, 2019
8ac97be
Support keyboardIcon for v3, closes #1084 (#1085)
dmtrKovalenko Jun 3, 2019
6e43811
Support TextFieldComponent prop (#1087)
dmtrKovalenko Jun 4, 2019
a1c2b86
v3.1.0
dmtrKovalenko Jun 4, 2019
2de017c
Change release script
dmtrKovalenko Jun 4, 2019
9de6b6e
Change bundlephobia badge link
dmtrKovalenko Jun 4, 2019
ff22b9e
Compare date strict tests (#1089)
sviande Jun 5, 2019
a50ccdd
Fix "todayLabel" prop type description. (#1091)
NiklasMM Jun 7, 2019
81c813e
Fix typescript material-ui overrides example (#1092)
arno-le Jun 7, 2019
421ba33
Spread emptyLabel from passing to textField, closes #1093
dmtrKovalenko Jun 8, 2019
14e2033
Fix incorrect DateTimePicker year button alignment on wide devices
dmtrKovalenko Jun 8, 2019
48cd17a
Inner state for picker modal (#1095)
dmtrKovalenko Jun 9, 2019
68779c7
[docs] Add fetching data example (#1097)
dmtrKovalenko Jun 9, 2019
9addb03
[Refactoring] Reorganize folder structure (#1098)
dmtrKovalenko Jun 9, 2019
5dee239
[Refactoring] Refactor Calendar.tsx
dmtrKovalenko Jun 9, 2019
304546d
[Refactoring] Better hook memoization (#1101)
Philipp91 Jun 11, 2019
83d3208
Make "Today" button to set inner state, instead of onChange
dmtrKovalenko Jun 11, 2019
41c49c7
Fix prettier in-merge error
dmtrKovalenko Jun 11, 2019
2aff556
[#1111] Properly rely on views order when switching views (#1116)
dmtrKovalenko Jun 14, 2019
d61f288
Polyfill array includes manually for IE11 (#1117)
dmtrKovalenko Jun 14, 2019
9234a9b
Update release script
dmtrKovalenko Jun 14, 2019
705cd17
v3.1.1
dmtrKovalenko Jun 14, 2019
b797147
Add visual regression tests (#1121)
dmtrKovalenko Jun 16, 2019
6547316
[docs] Fix crashing on changing utils (#1123)
dmtrKovalenko Jun 16, 2019
4a8969c
Update SecondsTimePicker.example.jsx (#1125)
dmtrKovalenko Jun 16, 2019
d57db29
Add Percy badge (#1129)
dmtrKovalenko Jun 17, 2019
2308bfc
[docs] Fix views type labels for DatePicker API (#1138)
dmtrKovalenko Jun 22, 2019
20c03ad
[#1126] Fix rerendering loop
dmtrKovalenko Jun 24, 2019
0abd0ea
Fix invalidLabel prop-type warning
dmtrKovalenko Jun 24, 2019
0567091
[#1126] Fix rerendering loop (#1139)
dmtrKovalenko Jun 24, 2019
f9a77bb
Custom spacing support (#1141)
dmtrKovalenko Jun 24, 2019
433a450
Fix invalidLabel prop-types warning (#1140)
dmtrKovalenko Jun 24, 2019
aba8447
Allow to pass custom rifm formatter (#1142)
dmtrKovalenko Jun 24, 2019
76d7e72
v3.1.2
dmtrKovalenko Jun 24, 2019
b53340b
3.1.2
dmtrKovalenko Jun 24, 2019
ebe40e0
[Calendar] Remove arrows white background on sliding from disabled st…
dmtrKovalenko Jun 29, 2019
634bf87
Add Hijri calendar example (#1153)
alaatm Jun 29, 2019
890af28
Do not throw error if input value was cleared symbol by symbol (#1160)
dmtrKovalenko Jul 5, 2019
f119d6c
[TimePicker] Properly hide separator if views not included (#1161)
dmtrKovalenko Jul 5, 2019
790c7be
[InlineVariant] Do not update value on backdrop click (#1162)
dmtrKovalenko Jul 5, 2019
973dc27
[docs] Fix variant prop type displaying, highlight code in 'type' col…
dmtrKovalenko Jul 5, 2019
15a44a0
Add variant="static" (#1164)
dmtrKovalenko Jul 6, 2019
646db90
Landscape orientation support (#1177)
dmtrKovalenko Jul 15, 2019
a9067fd
Custom toolbar component (#1182)
dmtrKovalenko Jul 15, 2019
5b7e485
Do not accept a and p sympbols in not am/pm mode (#1183)
dmtrKovalenko Jul 15, 2019
6385d85
Fix keyboard popover position (#1184)
dmtrKovalenko Jul 15, 2019
ced572e
Use yarn to publish
dmtrKovalenko Jul 15, 2019
20d93d6
v3.2.0
dmtrKovalenko Jul 15, 2019
81da8e5
Update publish command
dmtrKovalenko Jul 15, 2019
caea115
Use KeyboardDatePicker for formik integration example
dmtrKovalenko Jul 19, 2019
4ef9a9f
[docs] Add redux form integration example (#1189)
igornfaustino Jul 24, 2019
8d9fe9f
Update useIsLandscape.tsx (#1199)
lifeiscontent Jul 24, 2019
3d2e990
Update CSS overrides example (#1201)
pschyma Jul 26, 2019
661544f
Support auto detection of orientation change for safari (#1207)
dmtrKovalenko Jul 27, 2019
42b2cad
Add inputProps to the outputted typescript definitions (#1208)
dmtrKovalenko Jul 27, 2019
41fa537
Fix dispatching 2 onChange events with variant="inline" (#1209)
dmtrKovalenko Jul 27, 2019
c4c9f80
Add releases page (#1210)
dmtrKovalenko Jul 28, 2019
33a803f
Fix grammar
dmtrKovalenko Jul 28, 2019
e616a2b
Add shorthand for static state managment (#1212)
dmtrKovalenko Jul 29, 2019
988664d
[KeyboardDateInput] Fix not updating formatter when new mask passed (…
dmtrKovalenko Jul 30, 2019
c400708
fix when both clear button & showToday button (#1211)
behzadsoleimani Jul 30, 2019
d3f2288
Add babel transpilation to esm (#1206)
dmtrKovalenko Jul 30, 2019
92d8665
Update packages (#1217)
dmtrKovalenko Jul 30, 2019
efd370d
v3.2.1
dmtrKovalenko Jul 30, 2019
3a8e7d1
Remove old versions from readme
dmtrKovalenko Jul 30, 2019
8755559
More clearly highlight requiring version of date-fns
dmtrKovalenko Jul 31, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,30 @@ jobs:
- run: cd lib && yarn test:<<parameters.lib>> -- -- --runInBand
- steps: << parameters.after-tests >>

cypress_tests:
description: Run cypress tests
executor: cypress/browsers-chrome69
steps:
- attach_workspace:
at: .
- restore_cache:
name: Restore Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Additional yarn install
command: yarn install --frozen-lockfile
- run:
name: Install, if no cypress binary found
command: yarn cypress install
- run: yarn workspace docs build
- run:
background: true
name: Run docs in background
command: yarn workspace docs start
- run: npx wait-on http://localhost:3000
- run: yarn percy exec -- cypress run --record

####################
# Workflow
####################
Expand All @@ -90,17 +114,10 @@ workflows:
requires:
- checkout_code

- cypress/run:
- cypress_tests:
name: 'Cypress tests'
requires:
- 'Install deps, lint and build'
executor: cypress/browsers-chrome69
build: 'yarn workspace docs build'
start: 'yarn workspace docs start'
wait-on: 'http://localhost:3000'
record: true
yarn: true
cache-key: yarn-packages-{{ checksum "yarn.lock" }}
- checkout_code

- jest_tests:
name: 'Date-fns jest tests'
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ build/
coverage/
*.mp4
.next
docs/prop-types.json
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<a href="https://material-ui.com/" rel="noopener" target="_blank"><img width="200" src="https://next.material-ui-pickers.dev/static/meta-image.png" alt="Material-UI logo"></a></p>
<a href="https://material-ui.com/" rel="noopener" target="_blank"><img width="200" src="https://material-ui-pickers.dev/static/meta-image.png" alt="Material-ui-pickers logo"></a></p>
</p>

<h1 align="center">Material-UI pickers</h1>
Expand All @@ -11,16 +11,17 @@ Accessible, customizable, delightful date & time pickers for [@material-ui/core]
[![npm package](https://img.shields.io/npm/v/@material-ui/pickers.svg)](https://www.npmjs.org/package/@material-ui/pickers)
[![npm download](https://img.shields.io/npm/dm/@material-ui/pickers.svg)](https://www.npmjs.org/package/@material-ui/pickers)
[![codecov](https://codecov.io/gh/mui-org/material-ui-pickers/branch/next/graph/badge.svg)](https://codecov.io/gh/mui-org/material-ui-pickers)
[![Bundle Size](https://badgen.net/bundlephobia/minzip/@material-ui/pickers)](https://bundlephobia.com/result?p=@material-ui/pickers@3.0.0-beta.1)
[![Bundle Size](https://badgen.net/bundlephobia/minzip/@material-ui/pickers)](https://bundlephobia.com/result?p=@material-ui/pickers@latest)
[![CircleCI](https://circleci.com/gh/mui-org/material-ui-pickers.svg?style=svg)](https://circleci.com/gh/mui-org/material-ui-pickers)
[![Cypress.io tests](https://img.shields.io/badge/cypress.io-tests-green.svg?style=flat-square)](https://dashboard.cypress.io/#/projects/qow28y/runs)
[![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/mui-org/material-ui-pickers)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

</div>

### Installation

Please read the [migration guide](https://material-ui-pickers.dev/guides/upgrading-to-v3) if you are updating from v2
Note that this package reqiures `@material-ui/core` **v4**. It will not work with the old v3. Please read the [migration guide](https://material-ui-pickers.dev/guides/upgrading-to-v3) if you are updating from v2

```sh
// via npm
Expand Down Expand Up @@ -65,12 +66,6 @@ render(<App />, document.querySelector('#app'));

Check out the [documentation website](https://material-ui-pickers.dev/)

Old versions documentation:

| Version | Documentation url |
| ------- | ----------------------------------------------------- |
| v2 | https://material-ui-pickers-v2.dmtr-kovalenko.now.sh/ |

### Recently updated?

Changelog available [here](https://github.com/mui-org/material-ui-pickers/releases)
Expand Down
1 change: 1 addition & 0 deletions cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"baseUrl": "http://localhost:3000",
"integrationFolder": "e2e/integration",
"supportFile": "e2e/support/index.js",
"pluginsFile": "e2e/plugins/index.js",
"chromeWebSecurity": false,
"projectId": "qow28y"
}
4 changes: 3 additions & 1 deletion docs/_constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export const CODESANDBOX_EXAMPLE_ID = 'o7oojxx1pq';

export const HOST_URL = 'https://material-ui-pickers.dev';
export const DOMAIN = 'material-ui-pickers.dev';

export const HOST_URL = 'https://' + DOMAIN;

export const LOGO_URL = HOST_URL + '/static/meta-image.png';

Expand Down
10 changes: 7 additions & 3 deletions docs/_shared/Ad.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import * as React from 'react';
import { loadScript } from 'utils/helpers';
import { Grid, Theme } from '@material-ui/core';
import { makeStyles } from '@material-ui/styles';
import { Grid, makeStyles } from '@material-ui/core';

const useStyles = makeStyles((theme: Theme) => ({
const useStyles = makeStyles(theme => ({
'@global': {
'#codefund': {
'& .cf-wrapper': {
Expand All @@ -16,6 +15,11 @@ const useStyles = makeStyles((theme: Theme) => ({
color: theme.palette.text.primary + '! important',
},
},
'@media only percy': {
'#codefund': {
display: 'none',
},
},
},
}));

Expand Down
42 changes: 32 additions & 10 deletions docs/_shared/Code.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import clsx from 'clsx';
import React from 'react';
import { highlight } from '../utils/prism';
import { withStyles, Theme, WithStyles } from '@material-ui/core';
import { makeStyles } from '@material-ui/core';

const styles = (theme: Theme) => ({
const useStyles = makeStyles(theme => ({
root: {
margin: '0',
margin: 0,
fontFamily: theme.typography.fontFamily,
fontSize: '1em',
color: theme.palette.text.primary,
Expand All @@ -19,23 +19,45 @@ const styles = (theme: Theme) => ({
backgroundColor: theme.palette.background.paper + ' !important',
},
},
inlineRoot: {
padding: 0,
'& pre': {
padding: 0,
},
},
inlineCode: {
fontSize: 14,
// color: theme.palette.secondary.main,
whiteSpace: 'pre-wrap',
},
margin: {
margin: '10px 0 30px',
},
});
}));

type CodeProps = {
interface CodeProps {
children: string;
inline?: boolean;
withMargin?: boolean;
language?: 'jsx' | 'typescript' | 'markup';
} & WithStyles<typeof styles>;
}

const Code: React.SFC<CodeProps> = ({ classes, language = 'jsx', children, withMargin }) => {
const Code: React.SFC<CodeProps> = ({ language = 'jsx', inline, children, withMargin }) => {
const classes = useStyles();
const highlightedCode = highlight(children, language);

return (
<div className={clsx(classes.root, { [classes.margin]: withMargin })}>
<div
className={clsx(classes.root, {
[classes.margin]: withMargin,
[classes.inlineRoot]: inline,
})}
>
<pre>
<code dangerouslySetInnerHTML={{ __html: highlightedCode }} />
<code
className={clsx({ [classes.inlineCode]: inline })}
dangerouslySetInnerHTML={{ __html: highlightedCode }}
/>
</pre>
</div>
);
Expand All @@ -46,4 +68,4 @@ Code.defaultProps = {
language: 'jsx',
};

export default withStyles(styles)(Code);
export default Code;
30 changes: 21 additions & 9 deletions docs/_shared/Example.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as React from 'react';
import clsx from 'clsx';
import Code from './Code';
import CodeIcon from '@material-ui/icons/Code';
import CopyIcon from '@material-ui/icons/FileCopy';
import GithubIcon from '_shared/svgIcons/GithubIcon';
import React, { useState, useCallback, useMemo, useContext } from 'react';
import { copy } from 'utils/helpers';
import { GITHUB_EDIT_URL } from '_constants';
import { replaceGetFormatStrings } from 'utils/utilsService';
Expand All @@ -11,6 +12,8 @@ import { withUtilsService, UtilsContext } from './UtilsServiceContext';
import { makeStyles, IconButton, Collapse, Tooltip } from '@material-ui/core';

interface Props extends InjectedNotistackProps {
testId: string;
paddingBottom?: boolean;
source: { raw: string; relativePath: string; default: React.FC<any> };
}

Expand Down Expand Up @@ -43,6 +46,9 @@ const useStyles = makeStyles(theme => ({
},
},
},
paddingBottom: {
paddingBottom: 40,
},
sourceToolbar: {
display: 'flex',
},
Expand All @@ -59,28 +65,31 @@ const useStyles = makeStyles(theme => ({
},
}));

function Example({ source, enqueueSnackbar }: Props) {
function Example({ source, testId, paddingBottom, enqueueSnackbar }: Props) {
if (!source.default || !source.raw || !source.relativePath) {
throw new Error(
'Missing component or raw component code, you likely forgot to .example to your example extension'
);
}

const classes = useStyles();
const currentLib = useContext(UtilsContext).lib;
const [expanded, setExpanded] = useState(false);
const currentLib = React.useContext(UtilsContext).lib;
const [expanded, setExpanded] = React.useState(false);

const replacedSource = replaceGetFormatStrings(currentLib, source.raw);
const copySource = useCallback(
const copySource = React.useCallback(
() =>
copy(replacedSource).then(() =>
enqueueSnackbar('Source copied', { variant: 'success', autoHideDuration: 1000 })
),
[enqueueSnackbar, replacedSource]
);

// make each component rerender only on utils change
const Component = useMemo(() => withUtilsService(source.default), [source.default]);
// remount component only if utils change
const ExampleComponent = React.useMemo(
() => withUtilsService(source.default),
[currentLib, source.default] // eslint-disable-line
);

return (
<>
Expand Down Expand Up @@ -114,14 +123,17 @@ function Example({ source, enqueueSnackbar }: Props) {
</div>
</Collapse>

<div className={classes.pickers}>
<div
data-test-id={testId}
className={clsx(classes.pickers, { [classes.paddingBottom]: paddingBottom })}
>
<Tooltip title="Show/Hide the source">
<IconButton className={classes.sourceBtn} onClick={() => setExpanded(!expanded)}>
<CodeIcon />
</IconButton>
</Tooltip>

<Component />
<ExampleComponent key={currentLib} />
</div>
</>
);
Expand Down
15 changes: 11 additions & 4 deletions docs/_shared/PropTypesTable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import clsx from 'clsx';
import Code from './Code';
import FuzzySearch from 'fuzzy-search';
import PropTypesDoc from '../prop-types.json';
import SearchBar from 'material-ui-search-bar';
Expand All @@ -12,11 +13,10 @@ import {
TableRow,
makeStyles,
Typography,
Theme,
Grid,
} from '@material-ui/core';

const useStyles = makeStyles((theme: Theme) => ({
const useStyles = makeStyles(theme => ({
header: {
marginTop: 24,
},
Expand Down Expand Up @@ -123,10 +123,17 @@ const PropTypesTableLazy: React.FC<PropTypesTableProps> = ({ disableHeader, src
[classes.required]: prop.required,
})}
>
{prop.required ? `${prop.name} *` : prop.name}
<Typography variant="body2">
{prop.required ? `${prop.name} *` : prop.name}{' '}
</Typography>
</TableCell>

<TableCell>
<Code inline language="typescript">
{prop.type.name}
</Code>
</TableCell>

<TableCell className={classes.type}>{prop.type.name}</TableCell>
<TableCell className={classes.defaultValue}>
<Typography align="center" variant="body1" component="span">
{prop.defaultValue && prop.defaultValue.value}
Expand Down
2 changes: 1 addition & 1 deletion docs/_shared/UtilsServiceContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const UtilsContext = React.createContext<UtilsService>(createUtilsService
export const withUtilsService = <P extends UtilsService>(Component: React.ComponentType<P>) => {
const withUtilsService: React.SFC<Omit<P, keyof UtilsService>> = props => (
<UtilsContext.Consumer>
{service => <Component {...service} {...props as any} />}
{service => <Component {...service} {...(props as any)} />}
</UtilsContext.Consumer>
);

Expand Down
13 changes: 9 additions & 4 deletions docs/_shared/svgIcons/KawaiiIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ const icons = {
};

function getRandomIcon() {
const icon = getRandomItem(Object.keys(icons));
// @ts-ignore
return icons[icon];
if (process.browser && window.Cypress) {
return icons.ghost;
}

const icon = getRandomItem(Object.keys(icons));
return icons[icon as keyof typeof icons];
}

interface KawaiiIconProps extends KawaiiProps {
Expand All @@ -27,8 +31,9 @@ interface KawaiiIconProps extends KawaiiProps {

const KawaiiIcon: React.FunctionComponent<KawaiiIconProps> = ({ icon, size, ...other }) => {
const theme = useTheme();
const dimensionXs = useMediaQuery(theme.breakpoints.down('xs'));
const calculatedSize = size || dimensionXs ? 230 : 320;
const isXs = useMediaQuery(theme.breakpoints.down('xs'));
const calculatedSize = size || isXs ? 230 : 320;

const Component = React.useMemo(() => (icon ? icons[icon] : getRandomIcon()), [icon]);

return (
Expand Down
4 changes: 2 additions & 2 deletions docs/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const styles = (theme: Theme) =>
},
main: {
padding: '20px',
paddingTop: 55,
paddingTop: 75,
minHeight: 'calc(100vh - 55px)',
[theme.breakpoints.up('md')]: {
minHeight: 'calc(100vh - 64px)',
Expand Down Expand Up @@ -160,7 +160,7 @@ class Layout extends Component<LayoutProps> {
</Menu>

<Tooltip title="Toggle light/dark theme" enterDelay={300}>
<IconButton color="inherit" onClick={toggleThemeType}>
<IconButton data-testid="toggle-theme-btn" color="inherit" onClick={toggleThemeType}>
<LightbulbOutlineIcon />
</IconButton>
</Tooltip>
Expand Down
Loading