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

Maintenance #328

Merged
merged 6 commits into from Jan 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions addons/README.md
Expand Up @@ -33,7 +33,7 @@ after the integer. Defaults to `false`.
#### Usage

```js
import createNumberMask from 'text-mask-addons/dist/createNumberMask.js'
import createNumberMask from 'text-mask-addons/dist/createNumberMask'

// First, you need to create the `numberMask` with your desired configurations
const numberMask = createNumberMask({
Expand All @@ -51,7 +51,7 @@ const numberMask = createNumberMask({
#### Usage

```js
import emailMask from 'text-mask-addons/dist/emailMask.js'
import emailMask from 'text-mask-addons/dist/emailMask'

// ...then pass `emailMask` to the Text Mask component as the mask
```
Expand Down Expand Up @@ -83,7 +83,7 @@ set to `true`.
#### Usage

```js
import createAutoCorrectedDatePipe from 'text-mask-addons/dist/createAutoCorrectedDatePipe.js'
import createAutoCorrectedDatePipe from 'text-mask-addons/dist/createAutoCorrectedDatePipe'

const autoCorrectedDatePipe = createAutoCorrectedDatePipe('mm/dd/yyyy')
// As you can see in the line above, you can pass a string argument to `createAutoCorrectedDatePipe`
Expand Down
2 changes: 1 addition & 1 deletion addons/test/emailMask.spec.js
@@ -1,4 +1,4 @@
import createTextMaskInputElement from '../../core/src/createTextMaskInputElement.js'
import createTextMaskInputElement from '../../core/src/createTextMaskInputElement'

const emailMask = (isVerify()) ?
require('../dist/emailMask.js').default :
Expand Down
7 changes: 1 addition & 6 deletions angular1/src/angular1TextMask.js
Expand Up @@ -21,13 +21,8 @@ function textMask() {
inputElement = element[0].getElementsByTagName('INPUT')[0]
}

var createTextMaskInputElementOpts = {inputElement}
for (var key in scope.textMask) {
createTextMaskInputElementOpts[key] = scope.textMask[key]
}

var textMaskInputElement = createTextMaskInputElement(
createTextMaskInputElementOpts
Object.assign({inputElement}, scope.textMask)
)

element.on('blur keyup change input', function() {
Expand Down
2 changes: 1 addition & 1 deletion common/domSetup.js
@@ -1,4 +1,4 @@
import './testSetup.js'
import './testSetup'
import jsdom from 'jsdom'

global.document = jsdom.jsdom('<!doctype html><html><body></body></html>')
Expand Down
2 changes: 1 addition & 1 deletion common/testParameters.js
@@ -1,7 +1,7 @@
/* eslint-disable max-len */

import _ from 'lodash/fp'
import {convertMaskToPlaceholder} from '../core/src/utilities.js'
import {convertMaskToPlaceholder} from '../core/src/utilities'

const alphabetic = /^[A-Z]+$/i

Expand Down
2 changes: 1 addition & 1 deletion common/testSetup.js
Expand Up @@ -2,7 +2,7 @@

import chai from 'chai'
import sinon from 'sinon'
import isVerify from './isVerify.js'
import isVerify from './isVerify'
import dynamicTests from 'mocha-dynamic-tests'
import _ from 'lodash'

Expand Down
6 changes: 3 additions & 3 deletions core/test/adjustCaretPosition.spec.js
Expand Up @@ -3,9 +3,9 @@ import testParameters, {
caretTrapTests,
acceptedCharInMask
} from './../../common/testParameters.js'
import maskFunctionTests from './../../common/maskFunctionTests.js'
import {convertMaskToPlaceholder} from '../src/utilities.js'
import {placeholderChar} from '../src/constants.js'
import maskFunctionTests from './../../common/maskFunctionTests'
import {convertMaskToPlaceholder} from '../src/utilities'
import {placeholderChar} from '../src/constants'
import packageJson from '../package.json'

const adjustCaretPosition = (isVerify()) ?
Expand Down
8 changes: 4 additions & 4 deletions core/test/conformToMask.spec.js
Expand Up @@ -4,11 +4,11 @@ import testParameters, {
acceptedCharInMask,
escapedMaskChar
} from './../../common/testParameters.js'
import keepCharPositionsTests from '../../common/keepCharPositionsTests.js'
import maskFunctionTests from '../../common/maskFunctionTests.js'
import keepCharPositionsTests from '../../common/keepCharPositionsTests'
import maskFunctionTests from '../../common/maskFunctionTests'
import packageJson from '../package.json'
import {convertMaskToPlaceholder} from '../src/utilities.js'
import {placeholderChar} from '../src/constants.js'
import {convertMaskToPlaceholder} from '../src/utilities'
import {placeholderChar} from '../src/constants'

const conformToMask = (isVerify()) ?
require(`../${packageJson.main}`).conformToMask :
Expand Down
4 changes: 2 additions & 2 deletions core/test/createTextMaskInputElement.spec.js
@@ -1,8 +1,8 @@
require('babel-core/register')({plugins: ['babel-plugin-rewire']})

import packageJson from '../package.json'
import conformToMask from '../src/conformToMask.js'
import {placeholderChar} from '../src/constants.js'
import conformToMask from '../src/conformToMask'
import {placeholderChar} from '../src/constants'

const createTextMaskInputElement = (isVerify()) ?
require(`../${packageJson.main}`).createTextMaskInputElement :
Expand Down
2 changes: 1 addition & 1 deletion core/test/utilities.spec.js
@@ -1,4 +1,4 @@
import {processCaretTraps} from '../src/utilities.js'
import {processCaretTraps} from '../src/utilities'

describe('processCaretTraps', () => {
it('returns the mask without caret traps and the caret trap indexes', () => {
Expand Down
4 changes: 4 additions & 0 deletions package.json
Expand Up @@ -7,6 +7,9 @@
"presets": [
"es2015",
"stage-0"
],
"plugins": [
"transform-object-assign"
]
},
"scripts": {
Expand Down Expand Up @@ -75,6 +78,7 @@
"babel-core": "^6.4.5",
"babel-loader": "^6.2.1",
"babel-plugin-rewire": "^1.0.0-rc-3",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion react/example/index.jsx → react/example/index.js
@@ -1,5 +1,5 @@
import React from 'react'
import App from './app.jsx'
import App from './app'
import ReactDOM from 'react-dom'

ReactDOM.render(
Expand Down
2 changes: 1 addition & 1 deletion react/example/webpack.runReactExample.js
Expand Up @@ -7,7 +7,7 @@ module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
path.join(__dirname, '/index.jsx')
path.join(__dirname, '/index.js')
],
output: {
path: path.join(__dirname, '/'),
Expand Down
2 changes: 1 addition & 1 deletion react/src/reactTextMask.jsx → react/src/reactTextMask.js
@@ -1,5 +1,5 @@
import React, {PropTypes} from 'react'
import createTextMaskInputElement from '../../core/src/createTextMaskInputElement.js'
import createTextMaskInputElement from '../../core/src/createTextMaskInputElement'

export const MaskedInput = React.createClass({
propTypes: {
Expand Down
Expand Up @@ -4,7 +4,7 @@ import packageJson from '../package.json'

const MaskedInput = (isVerify()) ?
require(`../${packageJson.main}`).default :
require('../src/reactTextMask.jsx').default
require('../src/reactTextMask.js').default

describe('MaskedInput', () => {
it('does not throw when instantiated', () => {
Expand Down
2 changes: 1 addition & 1 deletion react/webpack.buildReactIntegration.js
Expand Up @@ -3,7 +3,7 @@ var webpack = require('webpack')
var path = require('path')

module.exports = {
entry: path.join(__dirname, './src/reactTextMask.jsx'),
entry: path.join(__dirname, './src/reactTextMask.js'),

module: {
loaders: [
Expand Down
2 changes: 1 addition & 1 deletion vanilla/src/vanillaTextMask.js
@@ -1,4 +1,4 @@
import createTextMaskInputElement from '../../core/src/createTextMaskInputElement.js'
import createTextMaskInputElement from '../../core/src/createTextMaskInputElement'

export function maskInput(textMaskConfig) {
const {inputElement} = textMaskConfig
Expand Down
2 changes: 1 addition & 1 deletion vue/src/vueTextMask.js
@@ -1,4 +1,4 @@
import createTextMaskInputElement from '../../core/src/createTextMaskInputElement.js'
import createTextMaskInputElement from '../../core/src/createTextMaskInputElement'

export default {
textMaskInputElement: null,
Expand Down
10 changes: 5 additions & 5 deletions website/src/app.jsx → website/src/app.js
@@ -1,14 +1,14 @@
import './styles.scss'
import React from 'react'
import ReactDOM from 'react-dom'
import MaskedInput from '../../react/src/reactTextMask.jsx'
import MaskedInput from '../../react/src/reactTextMask'
import classnames from 'classnames'
import appStyles from './app.scss'
import choices from './choices.jsx'
import {Row, DemoTop, DemoBottom, OnOffSwitch} from './partials.jsx'
import choices from './choices'
import {Row, DemoTop, DemoBottom, OnOffSwitch} from './partials'
import {connect} from 'react-redux'
import {actionCreators, selectors} from './redux.js'
import HelpPanel from './helpPanel.jsx'
import {actionCreators, selectors} from './redux'
import HelpPanel from './helpPanel'

const App = React.createClass({
componentDidUpdate() {
Expand Down
8 changes: 4 additions & 4 deletions website/src/choices.jsx → website/src/choices.js
@@ -1,8 +1,8 @@
import React from 'react'
import createAutoCorrectedDatePipe from '../../addons/src/createAutoCorrectedDatePipe.js'
import createNumberMask from '../../addons/src/createNumberMask.js'
import emailMask from '../../addons/src/emailMask.js'
import {placeholderChars, alphabetic, digit} from './constants.js'
import createAutoCorrectedDatePipe from '../../addons/src/createAutoCorrectedDatePipe'
import createNumberMask from '../../addons/src/createNumberMask'
import emailMask from '../../addons/src/emailMask'
import {placeholderChars, alphabetic, digit} from './constants'
import map from 'lodash/fp/map'

const defaultValues = {
Expand Down
2 changes: 1 addition & 1 deletion website/src/createStore.js
@@ -1,5 +1,5 @@
import {createStore} from 'redux'
import {reducer} from './redux.js'
import {reducer} from './redux'

export default function configureStore() {
const store = createStore(reducer)
Expand Down
2 changes: 1 addition & 1 deletion website/src/helpPanel.jsx → website/src/helpPanel.js
@@ -1,7 +1,7 @@
import './styles.scss'
import React from 'react'
import {connect} from 'react-redux'
import {Links, Panel, Row} from './partials.jsx'
import {Links, Panel, Row} from './partials'

const MaskFunctionDefinition = ({maskLink}) => (
<div>
Expand Down
4 changes: 2 additions & 2 deletions website/src/index.jsx → website/src/index.js
@@ -1,8 +1,8 @@
import React from 'react'
import ReactDOM from 'react-dom'
import App from './app.jsx'
import App from './app'
import {Provider} from 'react-redux'
import createStore from './createStore.js'
import createStore from './createStore'

const store = createStore()

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions website/src/redux.js
@@ -1,7 +1,7 @@
import find from 'lodash/fp/find'
import pick from 'lodash/fp/pick'
import choices from './choices.jsx'
import {textMaskProps} from './constants.js'
import choices from './choices'
import {textMaskProps} from './constants'
import {createAction, handleActions} from 'redux-actions'

export const actionCreators = {
Expand Down
2 changes: 1 addition & 1 deletion website/webpack.buildWebsite.js
Expand Up @@ -3,7 +3,7 @@ var path = require('path')
var webpack = require('webpack')

module.exports = {
entry: path.join(__dirname, '../website/src/index.jsx'),
entry: path.join(__dirname, '../website/src/index.js'),
output: {
path: path.join(__dirname, '../website/static'),
filename: 'bundle.js',
Expand Down