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

Braxex #97

Draft
wants to merge 31 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1234166
remove unneeded dependencies: css-loader, less, less-loader, style-lo…
braxex Mar 30, 2020
11556c1
remove unneeded webpack loader code
braxex Mar 30, 2020
f80d67e
transfer styles from less to jss; modify flag image pass-through
braxex Mar 30, 2020
411741d
add needed classes to index.jsx and Item.jsx
braxex Mar 30, 2020
c619f2f
make new dist build
braxex Mar 30, 2020
88032cd
Merge pull request #2 from braxtonex/fix
braxex Mar 30, 2020
b93e7b9
update files
braxex Apr 13, 2020
7dc55e7
update readme.md
braxex Apr 13, 2020
49d3062
update readme.md
braxex Apr 13, 2020
10f31fd
update readme.md
braxex Apr 13, 2020
93bee7b
updated package.json
braxex Apr 13, 2020
6b97520
add bundled typings (#1)
quantizor Jun 4, 2021
1a96ba0
v1.1.0
braxex Jun 4, 2021
012df0e
updated changelog
braxex Jun 4, 2021
409aecb
update readme
braxex Jun 4, 2021
b1c9dda
upgrading to yarn 2
braxex Jun 4, 2021
e5fb7b3
update gitignore & yarnlock
braxex Jun 4, 2021
c33ba56
1.1.1
braxex Jun 4, 2021
6115cf4
Null-guard input (#3)
braxex Jul 6, 2021
8167bc3
Add CodeQL (#4)
braxex Jul 6, 2021
a7be60f
update changelog and dist build
braxex Jul 6, 2021
ddb7681
1.2.0
braxex Jul 6, 2021
07c036f
update formats for italy, luxembourg, netherlands (#7)
braxex Jul 9, 2021
9084763
1.2.1
braxex Jul 9, 2021
95a7713
update changelog
braxex Jul 9, 2021
b165eb8
Fix local dev environment (#6)
braxex Jul 9, 2021
1b278a6
update netherlands formatting and rebuild
braxex Jul 9, 2021
e519e47
1.2.2
braxex Jul 9, 2021
94e97c4
Revert v1.2.2 and fix country number formatting (#8)
braxex Jul 9, 2021
2e6f446
1.2.2
braxex Jul 9, 2021
d15b3ad
1.2.3
braxex Jul 9, 2021
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist/*.js
index.d.ts
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '27 13 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@ node_modules
package-lock.json
animation.gif
./package-lock.json
dist
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.git
.editorconfig
.editorconfig
55 changes: 55 additions & 0 deletions .yarn/releases/yarn-berry.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarnPath: ".yarn/releases/yarn-berry.cjs"
nodeLinker: node-modules
4 changes: 3 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Raza Gill <[email protected]> (http://github.com/razagill)
Nikita Lebedev <[email protected]> (http://github.com/bl00mber)
Alex Plumb <[email protected]> (http://github.com/alexplumb)
Alex Plumb <[email protected]> (http://github.com/alexplumb)
Nathaniel Allred <[email protected]> (http://github.com/neallred)
Braxton Excell <[email protected]> (http://github.com/braxex)
115 changes: 24 additions & 91 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,109 +4,42 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.2.6] - 2019-03-20
### Fixed
- [The dropdown should now be correctly attached to the field](https://github.com/alexplumb/material-ui-phone-number/issues/50)

## [2.2.5] - 2019-12-05
### Changed
- Moved `@material-ui/core` back to peerDependencies

## [2.2.4] - 2019-11-13
### Fixed
- Fixed an issue with builds not being generated correctly - see https://github.com/alexplumb/material-ui-phone-number/issues/34 and https://github.com/alexplumb/material-ui-phone-number/issues/32

## [2.2.3] - 2019-11-12
## [1.2.3] - 2021-07-09
### Revert 1.2.2, fix country number formatting
### Changed
- Changed `clsx` to `clsx`
- Moved all packages to dependencies rather than peerDependencies

## [2.2.2] - 2019-10-17
### Fixed
[Fixed a regression caused by updating to `@material-ui/[email protected]`](https://github.com/alexplumb/material-ui-phone-number/issues/31)
- Reverted 1.2.2, fixed country number formatting

## [2.2.1] - 2019-10-02
### Fixed
- [Fixed a regression caused by switching from `componentWillReceiveProps` to `componentDidUpdate`](https://github.com/alexplumb/material-ui-phone-number/issues/28)
- Fixed a regression with setting the `value` property

## [2.2.0] - 2019-10-02
### Added
- [Added support for all remaining TextField properties](https://github.com/alexplumb/material-ui-phone-number/issues/27)

## [2.1.0] - 2019-08-27
## [1.2.2] - 2021-07-09
### Update country number formatting
### Changed
- [**BREAKING** If you were previously using `InputProps`, change it to `inputProps` with a lowercase `i`](https://github.com/alexplumb/material-ui-phone-number/issues/20)
- Removed `@material-ui/styles` dependency
- Additional revision to Netherlands formatting and redeployment

## [2.0.1] - 2019-07-17
### Fixed
- [Changed the phone number format for Sweden](https://github.com/alexplumb/material-ui-phone-number/pull/19)
- Update lodash for security vulnerability
- [Removed reliance on theme providers](https://github.com/alexplumb/material-ui-phone-number/issues/18)

## [2.0.0-beta0] - 2019-05-02
### Added
- Added support for a new `native` property for people who want to use a native select for the button dropdown
## [1.2.1] - 2021-07-08
### Update country number formatting
### Changed
- Added support for material-ui 4
- Added `clsx` to peer dependencies
- Added `lodash` to peer dependencies
- Updated number formatting for Italy, Luxembourg, and The Netherlands

## [1.6.0] - 2019-04-23
## [1.2.0] - 2021-07-06
### Null-guard cursorToEnd input
### Changed
- Moved material-ui and react to peer dependencies
### Fixed
- [Added missing .npmignore file](https://github.com/alexplumb/material-ui-phone-number/issues/10)
- Added a null guard to cursorToEnd input

## [1.5.0] - 2019-04-03
### Added
- [Added support for `fullWidth` TextField prop](https://github.com/alexplumb/material-ui-phone-number/issues/8)
### Fixed
- [Fixed an issue where `onChange` wouldn't work correctly if there was no value property](https://github.com/alexplumb/material-ui-phone-number/issues/7)

## [1.4.0] - 2019-03-11
### Added
- Add support for `variant` TextField prop

## [1.3.0] - 2019-02-15
### Fixed
- [Fixed several issues with out-of-date documentation](https://github.com/alexplumb/material-ui-phone-number/issues/5)
### Added
- [Added support for `error` prop](https://github.com/alexplumb/material-ui-phone-number/issues/3)

## [1.2.3] - 2018-12-07
### Fixed
- Fixed a React warning caused by having the first child of a menu being a React.Fragment
## [1.1.1] - 2021-06-04
### Upgrade Yarn
### Changed
- Added @material-ui/core to webpack externals and removed lodash from externals

## [1.2.1] - 2018-11-14
### Added
- Added support for `inputProps` TextField parameter
- Upgraded to Yarn 2

## [1.2.0] - 2018-11-14
### Fixed
- [Fixed an issue with flags.png being loaded twice](https://github.com/alexplumb/material-ui-phone-number/issues/2)
## [1.1.0] - 2021-06-04
### Add type support
### Added
- Re-added support for `disableDropdown` parameter

## [1.1.2] - 2018-10-30
### Fixed
- Fixed a spooky issue with the wrong value being sent to the onChange event listener

## [1.1.1] - 2018-10-30
### Fixed
- Fixed a regression caused by moving on* event listeners to InputProps
- Added type support

## [1.1.0] - 2018-10-30
## [1.0.0] - 2020-04-13
### Initial deployment
### Fixed
- Fixed an issue with dropdowns not popping over the flag button
- Fixed an issue with the divider not appearing in the dropdown
- Fixed a regression with the dropdown not scrolling to the selected country
- Removed several style-related dependencies (`less`, `less-loader`, `css-loader`, `style-loader`)
### Added
- Added support for `helperText` TextField property
- Added classes necessary to pass JSS styling to components
### Changed
- Set `error` property on the TextField for invalid phone numbers
### Security
### Deprecated
- Converted flag styles from Less to JSS
- Modified webpack rules associate with loading styles
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# material-ui-phone-number
Highly customizable phone input component with auto formatting. Based on the wonderful [react-phone-input-2](https://github.com/bl00mber/react-phone-input-2) package.
# mui-phone-input-ssr
An SSR-friendly, highly customizable Material UI React phone number input component with auto number formatting.

It looks like this, but in Material Design:
Based on the excellent [material-ui-phone-number](https://github.com/alexplumb/material-ui-phone-number), based on [react-phone-input-2](https://github.com/bl00mber/react-phone-input-2), based on [react-phone-input](https://github.com/razagill/react-phone-input).

![alt tag](https://media.giphy.com/media/l378A8qFNzgiuPUre/giphy.gif)
Additional credit to Nathaniel Allred ([@neallred](https://github.com/neallred)).

Uses @material-ui/core/TextField for rendering the phone input
It uses @material-ui/core/TextField for rendering the phone input and looks like this:

![alt tag](https://media.giphy.com/media/hu0wOWOqgxJP3IDvzR/giphy.gif)

## Installation

```shell-script
npm install material-ui-phone-number --save
yarn add mui-phone-input-ssr
```
```shell-script
npm install mui-phone-input-ssr --save
```

## Usage
Expand Down Expand Up @@ -215,8 +220,19 @@ Country data object not returns from onKeyDown event
</tr>
</table>

### Additional documentation

See the following repos for additional documentation:
- [material-ui-phone-number](https://github.com/alexplumb/material-ui-phone-number)
- [react-phone-input-2](https://github.com/bl00mber/react-phone-input-2)
- [react-phone-input](https://github.com/razagill/react-phone-input)

## Issues

Please submit unrelated PRs to [material-ui-phone-number](https://github.com/alexplumb/material-ui-phone-number/issues)

## License

Based on [react-phone-input-2](https://github.com/bl00mber/react-phone-input-2)
[MIT](https://opensource.org/licenses/MIT)

Based on [react-phone-input](https://github.com/razagill/react-phone-input) using [MIT](https://opensource.org/licenses/MIT)
Based on [material-ui-phone-number](https://github.com/alexplumb/material-ui-phone-number), based on [react-phone-input-2](https://github.com/bl00mber/react-phone-input-2), based on [react-phone-input](https://github.com/razagill/react-phone-input) using [MIT](https://opensource.org/licenses/MIT).
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { TextFieldProps } from "@material-ui/core";
import * as React from "react";

export type MuiPhoneNumberProps = TextFieldProps & {
autoFormat?: boolean;
classes?: any;
countryCodeEditable?: boolean;
defaultCountry?: string;
disableAreaCodes?: boolean;
disableCountryCode?: boolean;
disableDropdown?: boolean;
dropdownClass?: string;
enableLongNumbers?: boolean;
excludeCountries?: string[];
inputClass?: string;
onChange: (
e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement> | string
) => void;
onlyCountries?: string[];
preferredCountries?: string[];
regions?: [string] | string;
};

declare const MuiPhoneNumber: React.FC<MuiPhoneNumberProps>;

export default MuiPhoneNumber;
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
{
"name": "material-ui-phone-number",
"version": "2.2.6",
"description": "A material-ui react component to format phone numbers. Based on react-phone-input-2",
"name": "mui-phone-input-ssr",
"version": "1.2.3",
"description": "An SSR-friendly Material UI React phone number input component. Based on the excellent material-ui-phone-number.",
"main": "dist/index.js",
"types": "index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack-dev-server --config webpack.config.dev.js --hot --progress --mode development",
"build": "webpack --config webpack.config.build.js --progress --mode production"
},
"repository": {
"type": "git",
"url": "https://github.com/alexplumb/material-ui-phone-number"
"url": "git+https://github.com/braxex/mui-phone-input-ssr.git"
},
"keywords": [
"material",
"react",
"phone",
"telephone",
"input",
"format",
"telephone"
"ssr"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/alexplumb/material-ui-phone-number/issues"
"url": "https://github.com/braxex/mui-phone-input-ssr/issues"
},
"homepage": "https://github.com/alexplumb/material-ui-phone-number",
"homepage": "https://github.com/braxex/mui-phone-input-ssr",
"devDependencies": {
"@babel/core": "^7.5.4",
"@babel/plugin-proposal-class-properties": "^7.5.0",
"@babel/plugin-proposal-object-rest-spread": "^7.5.4",
"@babel/preset-env": "^7.5.4",
"@babel/preset-react": "^7.0.0",
"@material-ui/core": "^4.2.1",
"@types/react": "^17.0.8",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6",
"babel-plugin-lodash": "^3.3.4",
"css-loader": "^3.0.0",
"eslint": "^6.2.2",
"eslint-config-airbnb": "^18.0.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.3",
"file-loader": "^4.0.0",
"less": "^3.9.0",
"less-loader": "^5.0.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"react-hot-loader": "^4.12.7",
"style-loader": "^0.23.1",
"uglifyjs-webpack-plugin": "^2.1.3",
"url-loader": "^2.0.1",
"webpack": "^4.36.1",
Expand All @@ -63,5 +63,6 @@
},
"peerDependencies": {
"@material-ui/core": "^4.2.1"
}
},
"author": ""
}
Loading