-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
[utils] Move @material-ui/core/utils to @material-ui/utils #23203
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
Closed
Closed
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
75b5b12
init
mnajdova 0e26ee0
fixes
mnajdova 0031104
prettier & fixes
mnajdova 615da0e
fixed imports move functions to ts
mnajdova 42022b3
prettier
mnajdova e2cd5e4
lint & other fixes
mnajdova e2bf14f
normalized imports & prettier
mnajdova 8cdc310
lint, prettier, ts:formatted
mnajdova 7f44905
codemod
mnajdova 8558080
Update packages/material-ui-codemod/src/v1.0.0/import-path.test/actua…
mnajdova faab32c
added codemod
mnajdova d8177d8
Merge branch 'next' into feat/move-core-utils-to-utils
mnajdova d4e42fa
prettier
mnajdova 3377b82
added special case handling for createSvgIcon
mnajdova 2401d3b
improve codemod
mnajdova 2bef269
prettier
mnajdova File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| export { createSvgIcon as default } from '@material-ui/core/utils'; | ||
| export { createSvgIcon as default } from '@material-ui/core/SvgIcon'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/material-ui-lab/src/SliderUnstyled/SliderUnstyled.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/material-ui-lab/src/SliderUnstyled/ValueLabelUnstyled.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/material-ui-lab/src/TimelineContent/TimelineContent.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/material-ui-lab/src/TimelineOppositeContent/TimelineOppositeContent.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // TODO: error TS7016: Could not find a declaration file for module '../macros/MuiError.macro'. '/tmp/material-ui/packages/material-ui-utils/macros/MuiError.macro.js' implicitly has an 'any' type. | ||
| // import MuiError from '../macros/MuiError.macro'; | ||
| // It should to be noted that this function isn't equivalent to `text-transform: capitalize`. | ||
| // | ||
| // A strict capitalization should uppercase the first letter of each word a the sentence. | ||
| // We only handle the first word. | ||
| export default function capitalize(string: string): string { | ||
| if (typeof string !== 'string') { | ||
| throw new Error('Material-UI: capitalize(string) expects a string argument.'); | ||
| } | ||
|
|
||
| return string.charAt(0).toUpperCase() + string.slice(1); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 2 additions & 1 deletion
3
...terial-ui/src/utils/deprecatedPropType.js → ...terial-ui-utils/src/deprecatedPropType.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import * as React from 'react'; | ||
|
|
||
| export type ClassNameMap<ClassKey extends string = string> = Record<ClassKey, string>; | ||
|
|
||
| export interface StyledComponentProps<ClassKey extends string = string> { | ||
| /** | ||
| * Override or extend the styles applied to the component. | ||
| */ | ||
| classes?: Partial<ClassNameMap<ClassKey>>; | ||
| innerRef?: React.Ref<any>; | ||
| } | ||
|
|
||
| /** | ||
| * @private ONLY USE FROM WITHIN mui-org/material-ui | ||
| * | ||
| * Internal helper type for conform (describeConformance) components that are decorated with `withStyles | ||
| * However, we don't declare classes on this type. | ||
| * It is recommended to declare them manually with an interface so that each class can have a separate JSDOC. | ||
| */ | ||
| export type StandardProps<C, Removals extends keyof C = never> = Omit<C, 'classes' | Removals> & | ||
| // each component declares it's classes in a separate interface for proper JSDOC | ||
| StyledComponentProps<never> & { | ||
| ref?: C extends { ref?: infer RefType } ? RefType : React.Ref<unknown>; | ||
| // TODO: Remove implicit props. Up to each component. | ||
| className?: string; | ||
| style?: React.CSSProperties; | ||
| }; | ||
|
|
||
| export type NamedMuiComponent = React.ComponentType & { muiName: string }; | ||
|
|
||
| export interface NamedMuiElement { | ||
| type: NamedMuiComponent; | ||
| props: StandardProps<{}>; | ||
| key: string | number | null; | ||
| } | ||
|
|
||
| export default function isMuiElement(element: any, muiNames: string[]): element is NamedMuiElement { | ||
| // @ts-ignore | ||
| return React.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1; | ||
| } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions
14
...terial-ui/src/utils/requirePropFactory.js → ...terial-ui-utils/src/requirePropFactory.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.