From dbb000c2a9c47028cb7f490853ee672957c71765 Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Thu, 3 Dec 2015 11:35:51 -0600 Subject: [PATCH] reconciled against bs4 --- .editorconfig | 1 + .gitignore | 1 + .travis.yml | 16 +- Gruntfile.js | 90 +++--- _config.yml | 2 +- docs/getting-started/build-tools.md | 4 +- js/.eslintrc | 369 +++++++++++++------------ js/dist/autofill.js | 132 --------- js/dist/autofill.js.map | 1 - js/dist/bootstrapMaterialDesign.js | 169 ----------- js/dist/bootstrapMaterialDesign.js.map | 1 - js/dist/checkbox.js | 105 ------- js/dist/checkbox.js.map | 1 - js/dist/fileinput.js | 128 --------- js/dist/fileinput.js.map | 1 - js/dist/input.js | 217 --------------- js/dist/input.js.map | 1 - js/dist/radio.js | 87 ------ js/dist/radio.js.map | 1 - js/dist/ripples.js | 333 ---------------------- js/dist/ripples.js.map | 1 - js/dist/togglebutton.js | 87 ------ js/dist/togglebutton.js.map | 1 - js/dist/util.js | 103 ------- js/dist/util.js.map | 1 - js/src/fileinput.js | 3 +- js/src/ripples.js | 24 +- package.json | 2 +- 28 files changed, 277 insertions(+), 1605 deletions(-) delete mode 100644 js/dist/autofill.js delete mode 100644 js/dist/autofill.js.map delete mode 100644 js/dist/bootstrapMaterialDesign.js delete mode 100644 js/dist/bootstrapMaterialDesign.js.map delete mode 100644 js/dist/checkbox.js delete mode 100644 js/dist/checkbox.js.map delete mode 100644 js/dist/fileinput.js delete mode 100644 js/dist/fileinput.js.map delete mode 100644 js/dist/input.js delete mode 100644 js/dist/input.js.map delete mode 100644 js/dist/radio.js delete mode 100644 js/dist/radio.js.map delete mode 100644 js/dist/ripples.js delete mode 100644 js/dist/ripples.js.map delete mode 100644 js/dist/togglebutton.js delete mode 100644 js/dist/togglebutton.js.map delete mode 100644 js/dist/util.js delete mode 100644 js/dist/util.js.map diff --git a/.editorconfig b/.editorconfig index c193ae07..7452ef01 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,6 +10,7 @@ indent_style = space insert_final_newline = true trim_trailing_whitespace = true + [*.md] trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 1eb78a44..261c51cb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ dist/**/* docs/dist/**/* docs/assets/css/* +js/dist/**/* # Ignore docs files _gh_pages diff --git a/.travis.yml b/.travis.yml index 635f5d50..852f74b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,9 @@ before_install: - export GEMDIR=$(rvm gemdir) - npm install -g npm@3 - "export TRAVIS_COMMIT_MSG=\"$(git log --format=%B --no-merges -n 1)\"" - - echo "$TRAVIS_COMMIT_MSG" | grep '\[skip validator\]'; export BMD_DO_VALIDATOR=$?; true - - echo "$TRAVIS_COMMIT_MSG" | grep '\[skip sauce\]'; export BMD_DO_SAUCE=$?; true -# - if [ "$TRAVIS_REPO_SLUG" = twbs-savage/bootstrap ]; then export BMD_DO_VALIDATOR=0; fi + - echo "$TRAVIS_COMMIT_MSG" | grep '\[skip validator\]'; export MDB_DO_VALIDATOR=$?; true + - echo "$TRAVIS_COMMIT_MSG" | grep '\[skip sauce\]'; export MDB_DO_SAUCE=$?; true +# - if [ "$TRAVIS_REPO_SLUG" = twbs-savage/bootstrap ]; then export MDB_DO_VALIDATOR=0; fi install: - bundle install --deployment --jobs=3 @@ -37,14 +37,14 @@ addons: env: matrix: - - BMD_TEST=core - - BMD_TEST=validate-html - - BMD_TEST=sauce-js-unit + - MDB_TEST=core + - MDB_TEST=validate-html + - MDB_TEST=sauce-js-unit matrix: fast_finish: true exclude: - node_js: "4" - env: BMD_TEST=validate-html + env: MDB_TEST=validate-html - node_js: "4" - env: BMD_TEST=sauce-js-unit + env: MDB_TEST=sauce-js-unit diff --git a/Gruntfile.js b/Gruntfile.js index 00333c55..13fc9c8b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -47,7 +47,7 @@ module.exports = function (grunt) { }); var generateCommonJSModule = require('./grunt/bs-commonjs-generator.js'); - var configBridge = grunt.file.readJSON('./grunt/configBridge.json', { encoding: 'utf8' }); + var configBridge = grunt.file.readJSON('./grunt/configBridge.json', {encoding: 'utf8'}); Object.keys(configBridge.paths).forEach(function (key) { configBridge.paths[key].forEach(function (val, i, arr) { @@ -100,15 +100,15 @@ module.exports = function (grunt) { modules: 'ignore' }, files: { - 'js/dist/util.js' : 'js/src/util.js', - 'js/dist/ripples.js' : 'js/src/ripples.js', - 'js/dist/autofill.js' : 'js/src/autofill.js', - 'js/dist/input.js' : 'js/src/input.js', - 'js/dist/checkbox.js' : 'js/src/checkbox.js', - 'js/dist/togglebutton.js' : 'js/src/togglebutton.js', - 'js/dist/radio.js' : 'js/src/radio.js', - 'js/dist/fileinput.js' : 'js/src/fileInput.js', - 'js/dist/bootstrapMaterialDesign.js' : 'js/src/bootstrapMaterialDesign.js', + 'js/dist/util.js': 'js/src/util.js', + 'js/dist/ripples.js': 'js/src/ripples.js', + 'js/dist/autofill.js': 'js/src/autofill.js', + 'js/dist/input.js': 'js/src/input.js', + 'js/dist/checkbox.js': 'js/src/checkbox.js', + 'js/dist/togglebutton.js': 'js/src/togglebutton.js', + 'js/dist/radio.js': 'js/src/radio.js', + 'js/dist/fileinput.js': 'js/src/fileInput.js', + 'js/dist/bootstrapMaterialDesign.js': 'js/src/bootstrapMaterialDesign.js', //'js/dist/tab.js' : 'js/src/tab.js', //'js/dist/tooltip.js' : 'js/src/tooltip.js', //'js/dist/popover.js' : 'js/src/popover.js' @@ -119,7 +119,7 @@ module.exports = function (grunt) { modules: 'ignore' }, files: { - '<%= concat.bootstrap.dest %>' : '<%= concat.bootstrap.dest %>' + '<%= concat.bootstrap.dest %>': '<%= concat.bootstrap.dest %>' } }, umd: { @@ -127,15 +127,15 @@ module.exports = function (grunt) { modules: 'umd' }, files: { - 'dist/js/umd/util.js' : 'js/src/util.js', - 'dist/js/umd/ripples.js' : 'js/src/ripples.js', - 'dist/js/umd/autofill.js' : 'js/src/autofill.js', - 'dist/js/umd/input.js' : 'js/src/input.js', - 'dist/js/umd/checkbox.js' : 'js/src/checkbox.js', - 'dist/js/umd/togglebutton.js' : 'js/src/togglebutton.js', - 'dist/js/umd/radio.js' : 'js/src/radio.js', - 'dist/js/umd/fileinput.js' : 'js/src/fileInput.js', - 'dist/js/umd/bootstrapMaterialDesign.js' : 'js/src/bootstrapMaterialDesign.js', + 'dist/js/umd/util.js': 'js/src/util.js', + 'dist/js/umd/ripples.js': 'js/src/ripples.js', + 'dist/js/umd/autofill.js': 'js/src/autofill.js', + 'dist/js/umd/input.js': 'js/src/input.js', + 'dist/js/umd/checkbox.js': 'js/src/checkbox.js', + 'dist/js/umd/togglebutton.js': 'js/src/togglebutton.js', + 'dist/js/umd/radio.js': 'js/src/radio.js', + 'dist/js/umd/fileinput.js': 'js/src/fileInput.js', + 'dist/js/umd/bootstrapMaterialDesign.js': 'js/src/bootstrapMaterialDesign.js', //'dist/js/umd/tab.js' : 'js/src/tab.js', //'dist/js/umd/tooltip.js' : 'js/src/tooltip.js', //'dist/js/umd/popover.js' : 'js/src/popover.js' @@ -246,7 +246,7 @@ module.exports = function (grunt) { options: { map: true, processors: [ - mq4HoverShim.postprocessorFor({ hoverSelectorPrefix: '.bs-true-hover ' }), + mq4HoverShim.postprocessorFor({hoverSelectorPrefix: '.bs-true-hover '}), autoprefixer ] }, @@ -374,13 +374,15 @@ module.exports = function (grunt) { files: '<%= jscs.core.src %>', tasks: ['babel:dev'] }, - sass: { - files: 'scss/**/*.scss', - tasks: ['dist-css', 'docs'] - }, + + // FIXME: restore this after getting fundamentals done, just trying to reduce churn while developing + //sass: { + // files: 'scss/**/*.scss', + // tasks: ['dist-css', 'docs'] + //}, docs: { // watch both the source and docs scss files: ['docs/assets/scss/**/*.scss', 'scss/**/*.scss'], - tasks: ['docs-css'] //['dist-css', 'docs'] + tasks: ['scsslint', 'sass:docs'] //FIXME: docs-css yanks sourcemap from local docs.css, working around just doing the minimal compile here ['docs-css'] //['dist-css', 'docs'] } }, @@ -429,21 +431,43 @@ module.exports = function (grunt) { branch: 'gh-pages' } } + }, + + compress: { + main: { + options: { + archive: 'bootstrap-material-design-<%= pkg.version %>-dist.zip', + mode: 'zip', + level: 9, + pretty: true + }, + files: [ + { + expand: true, + cwd: 'dist/', + src: ['**'], + dest: 'bootstrap-material-design-<%= pkg.version %>-dist' + } + ] + } } + }); // These plugins provide necessary tasks. - require('load-grunt-tasks')(grunt, { scope: 'devDependencies', + require('load-grunt-tasks')(grunt, { + scope: 'devDependencies', // Exclude Sass compilers. We choose the one to load later on. - pattern: ['grunt-*', '!grunt-sass', '!grunt-contrib-sass'] }); + pattern: ['grunt-*', '!grunt-sass', '!grunt-contrib-sass'] + }); require('time-grunt')(grunt); // Docs HTML validation task grunt.registerTask('validate-html', ['jekyll:docs', 'htmllint']); var runSubset = function (subset) { - return !process.env.BMD_TEST || process.env.BMD_TEST === subset; + return !process.env.MDB_TEST || process.env.MDB_TEST === subset; }; var isUndefOrNonZero = function (val) { return val === undefined || val !== '0'; @@ -461,7 +485,7 @@ module.exports = function (grunt) { if (runSubset('validate-html') && isTravis && // Skip HTML5 validator when [skip validator] is in the commit message - isUndefOrNonZero(process.env.BMD_DO_VALIDATOR)) { + isUndefOrNonZero(process.env.MDB_DO_VALIDATOR)) { testSubtasks.push('validate-html'); } // Only run Sauce Labs tests if there's a Sauce access key @@ -469,7 +493,7 @@ module.exports = function (grunt) { // Skip Sauce if running a different subset of the test suite runSubset('sauce-js-unit') && // Skip Sauce on Travis when [skip sauce] is in the commit message - isUndefOrNonZero(process.env.BMD_DO_SAUCE)) { + isUndefOrNonZero(process.env.MDB_DO_SAUCE)) { testSubtasks.push('babel:dev'); testSubtasks.push('connect'); testSubtasks.push('saucelabs-qunit'); @@ -486,7 +510,7 @@ module.exports = function (grunt) { // Supported Compilers: sass (Ruby) and libsass. (function (sassCompilerName) { require('./grunt/bs-sass-compile/' + sassCompilerName + '.js')(grunt); - })(process.env.BMD_SASS || 'libsass'); + })(process.env.MDB_SASS || 'libsass'); // grunt.registerTask('sass-compile', ['sass:core', 'sass:extras', 'sass:docs']); grunt.registerTask('sass-compile', ['sass:core', 'sass:docs']); @@ -529,7 +553,7 @@ module.exports = function (grunt) { grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', '_update-shrinkwrap']); grunt.registerTask('_update-shrinkwrap', function () { var done = this.async(); - npmShrinkwrap({ dev: true, dirname: __dirname }, function (err) { + npmShrinkwrap({dev: true, dirname: __dirname}, function (err) { if (err) { grunt.fail.warn(err); } diff --git a/_config.yml b/_config.yml index 86894ed0..2b7484fd 100644 --- a/_config.yml +++ b/_config.yml @@ -19,7 +19,7 @@ permalink: pretty source: docs destination: _gh_pages host: 0.0.0.0 -port: 9001 +port: 9000 #baseurl: "/bootstrap-material-design" #url: "http://fezvrasta.github.io" encoding: UTF-8 diff --git a/docs/getting-started/build-tools.md b/docs/getting-started/build-tools.md index 55bcf855..61ec3d4f 100644 --- a/docs/getting-started/build-tools.md +++ b/docs/getting-started/build-tools.md @@ -38,12 +38,12 @@ Our Gruntfile includes the following commands and tasks: ## Switching Sass compilers -Material Design for Bootstrap will be compiled with [libsass][libsass] by default, but you can opt into traditional Ruby Sass by setting the `BMD_SASS` environment variable. Two options are supported: +Material Design for Bootstrap will be compiled with [libsass][libsass] by default, but you can opt into traditional Ruby Sass by setting the `MDB_SASS` environment variable. Two options are supported: * `libsass` (default) to use [libsass][libsass] via [grunt-sass][grunt-sass]. * `sass` to use [Ruby Sass][ruby-sass] via [grunt-contrib-sass][grunt-contrib-sass]. -For example, run `BMD_SASS=sass grunt` to test and build Material Design for Bootstrap with Ruby Sass. +For example, run `MDB_SASS=sass grunt` to test and build Material Design for Bootstrap with Ruby Sass. ## Autoprefixer diff --git a/js/.eslintrc b/js/.eslintrc index 05e50cdc..1e6865f1 100644 --- a/js/.eslintrc +++ b/js/.eslintrc @@ -1,179 +1,194 @@ { - "root": true, - "parser": "babel-eslint", - "env": { - "browser": true, - "jquery": true - }, - "rules": { - - // Possible Errors - "comma-dangle": [2, "never"], - "no-cond-assign": 2, - "no-console": 2, - "no-constant-condition": 2, - "no-control-regex": 2, - "no-debugger": 2, - "no-dupe-args": 2, - "no-dupe-keys": 2, - "no-duplicate-case": 2, - "no-empty": 2, - "no-empty-character-class": 2, - "no-ex-assign": 2, - "no-extra-boolean-cast": 2, - "no-extra-parens": 0, - "no-extra-semi": 2, - "no-func-assign": 2, - "no-inner-declarations": 2, - "no-invalid-regexp": 2, - "no-irregular-whitespace": 0, - "no-negated-in-lhs": 2, - "no-obj-calls": 2, - "no-regex-spaces": 2, - "no-sparse-arrays": 2, - "no-unexpected-multiline": 2, - "no-unreachable": 2, - "use-isnan": 2, - "valid-jsdoc": 0, - "valid-typeof": 2, - - //Best Practices - "accessor-pairs": 2, - "block-scoped-var": 2, - "consistent-return": 2, - "curly": 2, - "default-case": 2, - "dot-location": 0, - "dot-notation": 0, - "eqeqeq": 2, -// "guard-for-in": 2, - "no-alert": 2, - "no-caller": 2, - "no-div-regex": 2, - "no-else-return": 2, - "no-empty-label": 2, - "no-eq-null": 2, - "no-eval": 2, - "no-extend-native": 2, - "no-extra-bind": 2, - "no-fallthrough": 2, - "no-floating-decimal": 2, - "no-implicit-coercion": 2, - "no-implied-eval": 2, - "no-invalid-this": 0, - "no-iterator": 2, - "no-labels": 2, - "no-lone-blocks": 2, - "no-loop-func": 2, - "no-multi-spaces": 0, - "no-multi-str": 0, - "no-native-reassign": 2, - "no-new": 2, - "no-new-func": 0, - "no-new-wrappers": 2, - "no-octal": 2, - "no-octal-escape": 2, - "no-param-reassign": 0, - "no-process-env": 2, - "no-proto": 2, - "no-redeclare": 2, - "no-return-assign": 2, - "no-script-url": 2, - "no-self-compare": 2, - "no-sequences": 2, - "no-throw-literal": 2, - "no-unused-expressions": 2, - "no-useless-call": 2, - "no-void": 2, - "no-warning-comments": 0, - "no-with": 2, - "radix": 2, - "vars-on-top": 0, - "wrap-iife": 2, - "yoda": 2, - - // Variables - "init-declarations": 0, - "no-catch-shadow": 2, - "no-delete-var": 2, - "no-label-var": 2, - "no-shadow": 0, - "no-shadow-restricted-names": 2, - "no-undef": 2, - "no-undefined": 0, - "no-undef-init": 2, - "no-unused-vars": [2, {"argsIgnorePattern": "$"}], - "no-use-before-define": 0, - - // Stylistic - "array-bracket-spacing": 2, - "block-spacing": 2, - "brace-style": 2, - "camelcase": 2, - "comma-spacing": 2, - "comma-style": 2, - "computed-property-spacing": 2, - "consistent-this": 2, - "eol-last": 2, - "func-names": 0, - "func-style": 0, - "indent": 0, - "key-spacing": 0, - "linebreak-style": 2, - "lines-around-comment": 0, - "new-cap": 0, - "newline-after-var": 0, - "new-parens": 2, - "no-array-constructor": 2, - "no-continue": 0, - "no-inline-comments": 0, - "no-lonely-if": 2, - "no-mixed-spaces-and-tabs": 2, - "no-multiple-empty-lines": 2, - "no-nested-ternary": 0, - "no-new-object": 2, - "no-spaced-func": 2, - "no-ternary": 0, - "no-trailing-spaces": 2, - "no-underscore-dangle": 0, - "no-unneeded-ternary": 2, - "object-curly-spacing": [1, "always"], - "one-var": 0, - "operator-assignment": 2, - "operator-linebreak": 0, - "padded-blocks": 0, - "quote-props": 0, - "quotes": 0, - "semi": [2, "never"], - "semi-spacing": 0, - "sort-vars": 2, - "space-after-keywords": 2, - "space-before-blocks": 2, - "space-before-function-paren": 0, -// "spaced-comment": 2, - "space-infix-ops": 2, - "space-in-parens": 2, - "space-return-throw-case": 2, - "space-unary-ops": 2, - "quotes": [2, "single", "avoid-escape"], - - // es6 - "arrow-parens": 2, - "arrow-spacing": 2, - "constructor-super": 2, - "generator-star-spacing": 2, - "no-class-assign": 2, - "no-const-assign": 2, - "no-dupe-class-members": 2, - "no-this-before-super": 2, - "no-var": 2, - "object-shorthand": 2, - "prefer-arrow-callback": 2, - "prefer-const": 0, - "prefer-reflect": 0, - "prefer-spread": 2, - "prefer-template": 2, - "require-yield": 2 - - } + "root": true, + "parser": "babel-eslint", + "env": { + "browser": true, + "jquery": true + }, + "rules": { + // Possible Errors + "comma-dangle": [ + 2, + "never" + ], + "handle-callback-err": 2, + "no-bitwise": 0, + "no-cond-assign": 2, + "no-console": 2, + "no-constant-condition": 2, + "no-control-regex": 2, + "no-debugger": 2, + "no-dupe-args": 2, + "no-dupe-keys": 2, + "no-duplicate-case": 2, + "no-empty": 2, + "no-empty-character-class": 2, + "no-ex-assign": 2, + "no-extra-boolean-cast": 2, + "no-extra-parens": 0, + "no-extra-semi": 2, + "no-func-assign": 2, + "no-inner-declarations": 2, + "no-invalid-regexp": 2, + "no-irregular-whitespace": 2, + "no-negated-in-lhs": 2, + "no-obj-calls": 2, + "no-regex-spaces": 2, + "no-sparse-arrays": 2, + "no-unexpected-multiline": 2, + "no-unreachable": 2, + "use-isnan": 2, + "valid-jsdoc": 0, + "valid-typeof": 2, + //Best Practices + "accessor-pairs": 2, + "block-scoped-var": 2, + "consistent-return": 2, + "curly": 2, + "default-case": 2, + "dot-location": 0, + "dot-notation": 0, + "eqeqeq": 2, + // "guard-for-in": 2, + "no-alert": 2, + "no-caller": 2, + "no-div-regex": 2, + "no-else-return": 2, + "no-empty-label": 2, + "no-eq-null": 2, + "no-eval": 2, + "no-extend-native": 2, + "no-extra-bind": 2, + "no-fallthrough": 2, + "no-floating-decimal": 2, + "no-implicit-coercion": 2, + "no-implied-eval": 2, + "no-invalid-this": 0, + "no-iterator": 2, + "no-labels": 2, + "no-lone-blocks": 2, + "no-loop-func": 2, + "no-multi-spaces": 0, + "no-multi-str": 2, + "no-native-reassign": 2, + "no-new": 2, + "no-new-func": 0, + "no-new-wrappers": 2, + "no-octal": 2, + "no-octal-escape": 2, + "no-param-reassign": 0, + "no-process-env": 2, + "no-proto": 2, + "no-redeclare": 2, + "no-return-assign": 2, + "no-script-url": 2, + "no-self-compare": 2, + "no-sequences": 2, + "no-throw-literal": 2, + "no-unused-expressions": 2, + "no-useless-call": 2, + "no-useless-concat": 2, + "no-void": 2, + "no-warning-comments": 0, + "no-with": 2, + "radix": 2, + "vars-on-top": 0, + "wrap-iife": 2, + "yoda": 2, + // Variables + "init-declarations": 0, + "no-catch-shadow": 2, + "no-delete-var": 2, + "no-label-var": 2, + "no-shadow": 0, + "no-shadow-restricted-names": 2, + "no-undef": 2, + "no-undefined": 0, + "no-undef-init": 2, + "no-unused-vars": [ + 2, + { + "argsIgnorePattern": "$" + } + ], + "no-use-before-define": 0, + // Stylistic + "array-bracket-spacing": 2, + "block-spacing": 2, + "brace-style": 2, + "camelcase": 2, + "comma-spacing": 2, + "comma-style": 2, + "computed-property-spacing": 2, + "consistent-this": 2, + "eol-last": 2, + "func-names": 0, + "func-style": 0, +// "indent": [2, 2], //[2, 2, {"SwitchCase": 1}], + "key-spacing": 0, + "linebreak-style": 2, + "lines-around-comment": 0, + "new-cap": 0, + "newline-after-var": 0, + "new-parens": 2, + "no-array-constructor": 2, + "no-continue": 0, + "no-inline-comments": 0, + "no-lonely-if": 2, + "no-mixed-spaces-and-tabs": 2, + "no-multiple-empty-lines": 2, + "no-nested-ternary": 0, + "no-new-object": 2, + "no-spaced-func": 2, + "no-ternary": 0, + "no-trailing-spaces": 2, + "no-underscore-dangle": 0, + "no-unneeded-ternary": 2, +// "object-curly-spacing": [ +// 1, +// "always" +// ], + "one-var": 0, + "operator-assignment": 2, + "operator-linebreak": 0, + "padded-blocks": 0, + "quote-props": [2, "as-needed"], + "quotes": [2, "single"], + "semi": [ + 2, + "never" + ], + "semi-spacing": 2, + "sort-vars": 2, + "space-after-keywords": 2, + "space-before-blocks": 2, + "space-before-function-paren": 0, + // "spaced-comment": 2, + "space-infix-ops": 2, + "space-in-parens": 2, + "space-return-throw-case": 2, + "space-unary-ops": 2, + "quotes": [ + 2, + "single", + "avoid-escape" + ], + // es6 + "arrow-parens": 2, + "arrow-spacing": 2, + "constructor-super": 2, + "generator-star-spacing": 2, + "no-class-assign": 2, + "no-const-assign": 2, + "no-dupe-class-members": 2, + "no-this-before-super": 2, + "no-var": 2, + "object-shorthand": 2, + "prefer-arrow-callback": 2, + "prefer-const": 0, + "prefer-reflect": 0, + "prefer-spread": 2, + "prefer-template": 2, + "require-yield": 2 + } } diff --git a/js/dist/autofill.js b/js/dist/autofill.js deleted file mode 100644 index bb3c32d9..00000000 --- a/js/dist/autofill.js +++ /dev/null @@ -1,132 +0,0 @@ -//import Util from './util' - -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -var Autofill = (function ($) { - - /** - * ------------------------------------------------------------------------ - * Constants - * ------------------------------------------------------------------------ - */ - var NAME = 'autofill'; - var DATA_KEY = 'mdb.' + NAME; - var JQUERY_NO_CONFLICT = $.fn[NAME]; - - var Default = {}; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - - var Autofill = (function () { - function Autofill(element, config) { - _classCallCheck(this, Autofill); - - this.element = element; - this.config = $.extend({}, Default, config); - - this._watchLoading(); - this._attachEventHandlers(); - } - - /** - * ------------------------------------------------------------------------ - * jQuery - * ------------------------------------------------------------------------ - */ - - _createClass(Autofill, [{ - key: 'dispose', - value: function dispose() { - $.removeData(this.element, DATA_KEY); - this.element = null; - this.config = null; - } - - // ------------------------------------------------------------------------ - // private - - }, { - key: '_watchLoading', - value: function _watchLoading() { - var _this = this; - - // After 10 seconds we are quite sure all the needed inputs are autofilled then we can stop checking them - setTimeout(function () { - clearInterval(_this._onLoading); - }, 10000); - } - - // This part of code will detect autofill when the page is loading (username and password inputs for example) - }, { - key: '_onLoading', - value: function _onLoading() { - setInterval(function () { - $('input[type!=checkbox]').each(function (index, element) { - var $element = $(element); - if ($element.val() && $element.val() !== $element.attr('value')) { - $element.triggerStart('change'); - } - }); - }, 100); - } - }, { - key: '_attachEventHandlers', - value: function _attachEventHandlers() { - // Listen on inputs of the focused form - // (because user can select from the autofill dropdown only when the input has focus) - var focused = null; - $(document).on('focus', 'input', function (event) { - var $inputs = $(event.currentTarget).closest('form').find('input').not('[type=file]'); - focused = setInterval(function () { - $inputs.each(function (index, element) { - var $element = $(element); - if ($element.val() !== $element.attr('value')) { - $element.triggerStart('change'); - } - }); - }, 100); - }).on('blur', '.form-group input', function () { - clearInterval(focused); - }); - } - - // ------------------------------------------------------------------------ - // static - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - var _this2 = this; - - return this.each(function () { - var $element = $(_this2); - var data = $element.data(DATA_KEY); - - if (!data) { - data = new Autofill(_this2, config); - $element.data(DATA_KEY, data); - } - }); - } - }]); - - return Autofill; - })(); - - $.fn[NAME] = Autofill._jQueryInterface; - $.fn[NAME].Constructor = Autofill; - $.fn[NAME].noConflict = function () { - $.fn[NAME] = JQUERY_NO_CONFLICT; - return Autofill._jQueryInterface; - }; - - return Autofill; -})(jQuery); -//# sourceMappingURL=autofill.js.map diff --git a/js/dist/autofill.js.map b/js/dist/autofill.js.map deleted file mode 100644 index ccae67ed..00000000 --- a/js/dist/autofill.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/autofill.js"],"names":[],"mappings":";;;;;;;;AAEA,IAAM,QAAQ,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;AAOvB,MAAM,IAAI,GAAG,UAAU,CAAA;AACvB,MAAM,QAAQ,YAAU,IAAI,AAAE,CAAA;AAC9B,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;AAErC,MAAM,OAAO,GAAG,EAAE,CAAA;;;;;;;;MAOZ,QAAQ;AAED,aAFP,QAAQ,CAEA,OAAO,EAAE,MAAM,EAAE;4BAFzB,QAAQ;;AAGV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AQ,CAAA;CAEhB,CAAA,CAAE,MAAM,CAAC,CAAA","file":"autofill.js","sourcesContent":["//import Util from './util'\n\nconst Autofill = (($) => {\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n const NAME = 'autofill'\n const DATA_KEY = `mdb.${NAME}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = {}\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n class Autofill {\n\n constructor(element, config) {\n this.element = element\n this.config = $.extend({}, Default, config)\n\n this._watchLoading()\n this._attachEventHandlers()\n }\n\n dispose() {\n $.removeData(this.element, DATA_KEY)\n this.element = null\n this.config = null\n }\n\n // ------------------------------------------------------------------------\n // private\n\n _watchLoading() {\n // After 10 seconds we are quite sure all the needed inputs are autofilled then we can stop checking them\n setTimeout(() => {\n clearInterval(this._onLoading)\n }, 10000)\n }\n\n // This part of code will detect autofill when the page is loading (username and password inputs for example)\n _onLoading() {\n setInterval(() => {\n $('input[type!=checkbox]').each((index, element) => {\n let $element = $(element)\n if ($element.val() && $element.val() !== $element.attr('value')) {\n $element.triggerStart('change')\n }\n })\n }, 100)\n }\n\n _attachEventHandlers() {\n // Listen on inputs of the focused form\n // (because user can select from the autofill dropdown only when the input has focus)\n let focused = null\n $(document)\n .on('focus', 'input', (event) => {\n let $inputs = $(event.currentTarget).closest('form').find('input').not('[type=file]')\n focused = setInterval(() => {\n $inputs.each((index, element) => {\n let $element = $(element)\n if ($element.val() !== $element.attr('value')) {\n $element.triggerStart('change')\n }\n })\n }, 100)\n })\n .on('blur', '.form-group input', () => {\n clearInterval(focused)\n })\n }\n\n // ------------------------------------------------------------------------\n // static\n static _jQueryInterface(config) {\n return this.each(() => {\n let $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new Autofill(this, config)\n $element.data(DATA_KEY, data)\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n $.fn[NAME] = Autofill._jQueryInterface\n $.fn[NAME].Constructor = Autofill\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Autofill._jQueryInterface\n }\n\n return Autofill\n\n})(jQuery)\n\nexport default Autofill\n"]} \ No newline at end of file diff --git a/js/dist/bootstrapMaterialDesign.js b/js/dist/bootstrapMaterialDesign.js deleted file mode 100644 index 26d56563..00000000 --- a/js/dist/bootstrapMaterialDesign.js +++ /dev/null @@ -1,169 +0,0 @@ -//import Util from './util' - -/** - * $.bootstrapMaterialDesign(config) is a macro class to configure the components generally - * used in Material Design for Bootstrap. You may pass overrides to the configurations - * which will be passed into each component, or you may omit use of this class and - * configure each component separately. - * - * NOTE: If omitting use of this class, please note that the Input component must be - * initialized prior to other decorating components such as radio, checkbox, - * togglebutton, fileInput. - * - */ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -var BootstrapMaterialDesign = (function ($) { - - /** - * ------------------------------------------------------------------------ - * Constants - * ------------------------------------------------------------------------ - */ - var NAME = 'bootstrapMaterialDesign'; - var DATA_KEY = 'mdb.' + NAME; - var JQUERY_NO_CONFLICT = $.fn[NAME]; - - /** - * - * Default macro configuration for each component (primarily selectors). - * - selector: may be a string or an array. Any array will be joined with a comma to generate the selector - * - disable any component by defining it as false with an override. e.g. $.bootstrapMaterialDesign({ autofill: false }) - * - * @see each individual component for more configuration settings. - */ - var Default = { - ripples: { - selector: ['.btn:not(.btn-link):not(.ripple-none)', '.card-image:not(.ripple-none)', '.navbar a:not(.ripple-none)', '.dropdown-menu a:not(.ripple-none)', '.nav-tabs a:not(.ripple-none)', '.pagination li:not(.active):not(.disabled) a:not(.ripple-none)', '.ripple' // generic marker class to add ripple to elements - ] - }, - input: { - selector: ['input.form-control', 'textarea.form-control', 'select.form-control'] - }, - checkbox: { - selector: '.checkbox > label > input[type=checkbox]' - }, - togglebutton: { - selector: '.togglebutton > label > input[type=checkbox]' - }, - radio: { - selector: '.radio > label > input[type=radio]' - }, - fileInput: { - selector: 'input[type=file]' - }, - autofill: { - selector: 'body' - }, - arrive: true, - // create an ordered component list for instantiation - instantiation: ['ripples', 'input', 'checkbox', 'togglebutton', 'radio', 'fileInput', 'autofill'] - }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - - var BootstrapMaterialDesign = (function () { - function BootstrapMaterialDesign(element, config) { - var _this = this; - - _classCallCheck(this, BootstrapMaterialDesign); - - this.element = element; - this.config = $.extend({}, Default, config); - var $document = $(document); - - var _loop = function (component) { - - // the component's config fragment is passed in directly, allowing users to override - var componentConfig = _this.config[component]; - - // check to make sure component config is enabled (not `false`) - if (componentConfig) { - - // assemble the selector as it may be an array - var selector = _this._resolveSelector(componentConfig); - - // instantiate component on selector elements with config - $(selector)[component](componentConfig); - - // add to arrive if present and enabled - if (document.arrive && _this.config.arrive) { - $document.arrive(selector, function (element) { - // eslint-disable-line no-loop-func - $(element)[component](componentConfig); - }); - } - } - }; - - for (var component in this.config.instantiation) { - _loop(component); - } - } - - /** - * ------------------------------------------------------------------------ - * jQuery - * ------------------------------------------------------------------------ - */ - - _createClass(BootstrapMaterialDesign, [{ - key: 'dispose', - value: function dispose() { - $.removeData(this.element, DATA_KEY); - this.element = null; - this.config = null; - } - - // ------------------------------------------------------------------------ - // private - - }, { - key: '_resolveSelector', - value: function _resolveSelector(componentConfig) { - var selector = componentConfig['selector']; - if (Array.isArray(selector)) { - selector = selector.join(', '); - } - - return selector; - } - - // ------------------------------------------------------------------------ - // static - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var $element = $(this); - var data = $element.data(DATA_KEY); - - if (!data) { - data = new BootstrapMaterialDesign(this, config); - $element.data(DATA_KEY, data); - } - }); - } - }]); - - return BootstrapMaterialDesign; - })(); - - $.fn[NAME] = BootstrapMaterialDesign._jQueryInterface; - $.fn[NAME].Constructor = BootstrapMaterialDesign; - $.fn[NAME].noConflict = function () { - $.fn[NAME] = JQUERY_NO_CONFLICT; - return BootstrapMaterialDesign._jQueryInterface; - }; - - return BootstrapMaterialDesign; -})(jQuery); -//# sourceMappingURL=bootstrapMaterialDesign.js.map diff --git a/js/dist/bootstrapMaterialDesign.js.map b/js/dist/bootstrapMaterialDesign.js.map deleted file mode 100644 index 2e610bb9..00000000 --- a/js/dist/bootstrapMaterialDesign.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/bootstrapMaterialDesign.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAaA,IAAM,uBAAuB,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;AAOtC,MAAM,IAAI,GAAG,yBAAyB,CAAA;AACtC,MAAM,QAAQ,YAAU,IAAI,AAAE,CAAA;AAC9B,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;;;;;;;;;AAUrC,MAAM,OAAO,GAAG;AACd,WAAO,EAAE;AACP,cAAQ,EAAE,CACR,uCAAuC,EACvC,+BAA+B,EAC/B,6BAA6B,EAC7B,oCAAoC,EACpC,+BAA+B,EAC/B,gEAAgE,EAChE,SAAS;OACV;KACF;AACD,SAAK,EAAE;AACL,cAAQ,EAAE,CACR,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,CACtB;KACF;AACD,YAAQ,EAAE;AACR,cAAQ,EAAE,0CAA0C;KACrD;AACD,gBAAY,EAAE;AACZ,cAAQ,EAAE,8CAA8C;KACzD;AACD,SAAK,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* $.bootstrapMaterialDesign(config) is a macro class to configure the components generally\n * used in Material Design for Bootstrap. You may pass overrides to the configurations\n * which will be passed into each component, or you may omit use of this class and\n * configure each component separately.\n *\n * NOTE: If omitting use of this class, please note that the Input component must be\n * initialized prior to other decorating components such as radio, checkbox,\n * togglebutton, fileInput.\n *\n */\nconst BootstrapMaterialDesign = (($) => {\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n const NAME = 'bootstrapMaterialDesign'\n const DATA_KEY = `mdb.${NAME}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n /**\n *\n * Default macro configuration for each component (primarily selectors).\n * - selector: may be a string or an array. Any array will be joined with a comma to generate the selector\n * - disable any component by defining it as false with an override. e.g. $.bootstrapMaterialDesign({ autofill: false })\n *\n * @see each individual component for more configuration settings.\n */\n const Default = {\n ripples: {\n selector: [\n '.btn:not(.btn-link):not(.ripple-none)',\n '.card-image:not(.ripple-none)',\n '.navbar a:not(.ripple-none)',\n '.dropdown-menu a:not(.ripple-none)',\n '.nav-tabs a:not(.ripple-none)',\n '.pagination li:not(.active):not(.disabled) a:not(.ripple-none)',\n '.ripple' // generic marker class to add ripple to elements\n ]\n },\n input: {\n selector: [\n 'input.form-control',\n 'textarea.form-control',\n 'select.form-control'\n ]\n },\n checkbox: {\n selector: '.checkbox > label > input[type=checkbox]'\n },\n togglebutton: {\n selector: '.togglebutton > label > input[type=checkbox]'\n },\n radio: {\n selector: '.radio > label > input[type=radio]'\n },\n fileInput: {\n selector: 'input[type=file]'\n },\n autofill: {\n selector: 'body'\n },\n arrive: true,\n // create an ordered component list for instantiation\n instantiation: [\n 'ripples',\n 'input',\n 'checkbox',\n 'togglebutton',\n 'radio',\n 'fileInput',\n 'autofill'\n ]\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n class BootstrapMaterialDesign {\n\n constructor(element, config) {\n this.element = element\n this.config = $.extend({}, Default, config)\n let $document = $(document)\n\n for (let component in this.config.instantiation) {\n\n // the component's config fragment is passed in directly, allowing users to override\n let componentConfig = this.config[component]\n\n // check to make sure component config is enabled (not `false`)\n if (componentConfig) {\n\n // assemble the selector as it may be an array\n let selector = this._resolveSelector(componentConfig)\n\n // instantiate component on selector elements with config\n $(selector)[component](componentConfig)\n\n // add to arrive if present and enabled\n if (document.arrive && this.config.arrive) {\n $document.arrive(selector, (element) => { // eslint-disable-line no-loop-func\n $(element)[component](componentConfig)\n })\n }\n }\n }\n }\n\n dispose() {\n $.removeData(this.element, DATA_KEY)\n this.element = null\n this.config = null\n }\n\n // ------------------------------------------------------------------------\n // private\n\n _resolveSelector(componentConfig) {\n let selector = componentConfig['selector']\n if (Array.isArray(selector)) {\n selector = selector.join(', ')\n }\n\n return selector\n }\n\n // ------------------------------------------------------------------------\n // static\n static _jQueryInterface(config) {\n return this.each(function () {\n let $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new BootstrapMaterialDesign(this, config)\n $element.data(DATA_KEY, data)\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n $.fn[NAME] = BootstrapMaterialDesign._jQueryInterface\n $.fn[NAME].Constructor = BootstrapMaterialDesign\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return BootstrapMaterialDesign._jQueryInterface\n }\n\n return BootstrapMaterialDesign\n\n})(jQuery)\n\nexport default BootstrapMaterialDesign\n"]} \ No newline at end of file diff --git a/js/dist/checkbox.js b/js/dist/checkbox.js deleted file mode 100644 index e325610a..00000000 --- a/js/dist/checkbox.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -// Checkbox decorator, to be called after Input -var Checkbox = (function ($) { - - /** - * ------------------------------------------------------------------------ - * Constants - * ------------------------------------------------------------------------ - */ - var NAME = 'checkbox'; - var DATA_KEY = 'mdb.' + NAME; - var JQUERY_NO_CONFLICT = $.fn[NAME]; - - var Default = { - template: '' - }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - - var Checkbox = (function () { - function Checkbox(element, config) { - _classCallCheck(this, Checkbox); - - this.element = element; - this.config = $.extend({}, Default, config); - - this.element.after(this.config.template); - this.formGroup = Util.findFormGroup(this.element); - - this._bindEventListeners(); - } - - /** - * ------------------------------------------------------------------------ - * jQuery - * ------------------------------------------------------------------------ - */ - - _createClass(Checkbox, [{ - key: 'dispose', - value: function dispose() { - $.removeData(this.element, DATA_KEY); - this.element = null; - this.formGroup = null; - this.config = null; - } - - // ------------------------------------------------------------------------ - // private - }, { - key: '_bindEventListeners', - value: function _bindEventListeners() { - var _this = this; - - // checkboxes didn't appear to bubble to the document, so we'll bind these directly - this.formGroup.find('.checkbox label').hover(function () { - Util.addFormGroupFocus(_this.formGroup); - }, function () { - Util.removeFormGroupFocus(_this.formGroup); - }); - - this.element.change(function () { - _this.element.blur(); - }); - } - - // ------------------------------------------------------------------------ - // static - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var $element = $(this); - var data = $element.data(DATA_KEY); - - if (!data) { - data = new Checkbox(this, config); - $element.data(DATA_KEY, data); - } - }); - } - }]); - - return Checkbox; - })(); - - $.fn[NAME] = Checkbox._jQueryInterface; - $.fn[NAME].Constructor = Checkbox; - $.fn[NAME].noConflict = function () { - $.fn[NAME] = JQUERY_NO_CONFLICT; - return Checkbox._jQueryInterface; - }; - - return Checkbox; -})(jQuery); -//# sourceMappingURL=checkbox.js.map diff --git a/js/dist/checkbox.js.map b/js/dist/checkbox.js.map deleted file mode 100644 index 5b407d12..00000000 --- a/js/dist/checkbox.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/checkbox.js"],"names":[],"mappings":";;;;;;;AAGA,IAAM,QAAQ,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;AAOvB,MAAM,IAAI,GAAG,UAAU,CAAA;AACvB,MAAM,QAAQ,YAAU,IAAI,AAAE,CAAA;AAC9B,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;AAErC,MAAM,OAAO,GAAG;AACd,YAAQ,0EAAsE;GAC/E,CAAA;;;;;;;;MAOK,QAAQ;AAED,aAFP,QAAQ,CAEA,OAAO,EAAE,MAAM,EAAE;4BAFzB,QAAQ;;AAGV,UAAI,CAAC,OAAO,GAAG,OAAO,CAAA;AACtB,UAAI,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;;AAE3C,UAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACxC,UAAI,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;;AAEjD,UAAI,CAAC,mBAAmB,EAAE,CAAA;KAC3B;;;;;;;;iBAVG,QAAQ;;aAYL,mBAAG;AACR,SAAC,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;AACpC,YAAI,CAAC,OAAO,GAAG,IAAI,CAAA;AACnB,YAAI,CAAC,SAAS,GAAG,IAAI,CAAA;AACrB,YAAI,CAAC,MAAM,GAAG,IAAI,CAAA;OACnB;;;;;;aAIkB,+BAAG;;;;AAEpB,YAAI,CAAC,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,YAAM;AACjD,cAAI,CAAC,iBAAiB,CAAC,MAAK,SAAS,CAAC,CAAA;SACvC,EAAE,YAAM;AACP,cAAI,CAAC,oBAAoB,CAAC,MAAK,SAAS,CAAC,CAAA;SAC1C,CAAC,CAAA;;AAEF,YAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAM;AACxB,gBAAK,OAAO,CAAC,IAAI,EAAE,CAAA;SACpB,CAAC,CAAA;OACH;;;;;;aAIsB,0BAAC,MAAM,EAAE;AAC9B,eAAO,IAAI,CAAC,IAAI,CAAC,YAAY;AAC3B,cAAI,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;AACtB,cAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;;AAElC,cAAI,CAAC,IAAI,EAAE;AACT,gBAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AACjC,oBAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;WAC9B;SACF,CAAC,CAAA;OACH;;;WA9CG,QAAQ;;;AAsDd,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAA;AACtC,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,QAAQ,CAAA;AACjC,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,GAAG,YAAM;AAC5B,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,QAAQ,CAAC,gBAAgB,CAAA;GACjC,CAAA;;AAED,SAAO,QAAQ,CAAA;CAEhB,CAAA,CAAE,MAAM,CAAC,CAAA","file":"checkbox.js","sourcesContent":["import Util from './util'\n\n// Checkbox decorator, to be called after Input\nconst Checkbox = (($) => {\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n const NAME = 'checkbox'\n const DATA_KEY = `mdb.${NAME}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = {\n template: ``\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n class Checkbox {\n\n constructor(element, config) {\n this.element = element\n this.config = $.extend({}, Default, config)\n\n this.element.after(this.config.template)\n this.formGroup = Util.findFormGroup(this.element)\n\n this._bindEventListeners()\n }\n\n dispose() {\n $.removeData(this.element, DATA_KEY)\n this.element = null\n this.formGroup = null\n this.config = null\n }\n\n // ------------------------------------------------------------------------\n // private\n _bindEventListeners() {\n // checkboxes didn't appear to bubble to the document, so we'll bind these directly\n this.formGroup.find('.checkbox label').hover(() => {\n Util.addFormGroupFocus(this.formGroup)\n }, () => {\n Util.removeFormGroupFocus(this.formGroup)\n })\n\n this.element.change(() => {\n this.element.blur()\n })\n }\n\n // ------------------------------------------------------------------------\n // static\n static _jQueryInterface(config) {\n return this.each(function () {\n let $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new Checkbox(this, config)\n $element.data(DATA_KEY, data)\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n $.fn[NAME] = Checkbox._jQueryInterface\n $.fn[NAME].Constructor = Checkbox\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Checkbox._jQueryInterface\n }\n\n return Checkbox\n\n})(jQuery)\n\nexport default Checkbox\n"]} \ No newline at end of file diff --git a/js/dist/fileinput.js b/js/dist/fileinput.js deleted file mode 100644 index 7b02ca09..00000000 --- a/js/dist/fileinput.js +++ /dev/null @@ -1,128 +0,0 @@ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -// FileInput decorator, to be called after Input -var FileInput = (function ($) { - - /** - * ------------------------------------------------------------------------ - * Constants - * ------------------------------------------------------------------------ - */ - var NAME = 'fileInput'; - var DATA_KEY = 'mdb.' + NAME; - var JQUERY_NO_CONFLICT = $.fn[NAME]; - - var Default = {}; - - var ClassName = { - IS_FILEINPUT: 'is-fileinput', - IS_EMPTY: 'is-empty' - }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - - var FileInput = (function () { - function FileInput(element, config) { - _classCallCheck(this, FileInput); - - this.element = element; - this.config = $.extend({}, Default, config); - this.formGroup = Util.findFormGroup(this.element); - - this.formGroup.addClass(ClassName.IS_FILEINPUT); - - this._bindEventListeners(); - } - - /** - * ------------------------------------------------------------------------ - * jQuery - * ------------------------------------------------------------------------ - */ - - _createClass(FileInput, [{ - key: 'dispose', - value: function dispose() { - $.removeData(this.element, DATA_KEY); - this.element = null; - this.formGroup = null; - this.config = null; - } - - // ------------------------------------------------------------------------ - // private - }, { - key: '_bindEventListeners', - value: function _bindEventListeners() { - var _this = this; - - this.formGroup.on('focus', function () { - Util.addFormGroupFocus(_this.formGroup); - }).on('blur', function () { - Util.removeFormGroupFocus(_this.formGroup); - }); - - // set the fileinput readonly field with the name of the file - this.element.on('change', function () { - var value = ''; - $.each(_this.element.files, function (i, file) { - value += file.name + ' , '; - }); - value = value.substring(0, value.length - 2); - if (value) { - _this._removeIsEmpty(); - } else { - _this._addIsEmpty(); - } - _this.formGroup.find('input.form-control[readonly]').val(value); - }); - } - }, { - key: '_addIsEmpty', - value: function _addIsEmpty() { - this.formGroup.addClass(ClassName.IS_EMPTY); - } - }, { - key: '_removeIsEmpty', - value: function _removeIsEmpty() { - this.formGroup.removeClass(ClassName.IS_EMPTY); - } - - // ------------------------------------------------------------------------ - // static - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var $element = $(this); - var data = $element.data(DATA_KEY); - - if (!data) { - data = new FileInput(this, config); - $element.data(DATA_KEY, data); - } - }); - } - }]); - - return FileInput; - })(); - - $.fn[NAME] = FileInput._jQueryInterface; - $.fn[NAME].Constructor = FileInput; - $.fn[NAME].noConflict = function () { - $.fn[NAME] = JQUERY_NO_CONFLICT; - return FileInput._jQueryInterface; - }; - - return FileInput; -})(jQuery); -//# sourceMappingURL=fileinput.js.map diff --git a/js/dist/fileinput.js.map b/js/dist/fileinput.js.map deleted file mode 100644 index 8d5ca94f..00000000 --- a/js/dist/fileinput.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/fileInput.js"],"names":[],"mappings":";;;;;;;AAGA,IAAM,SAAS,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;AAOxB,MAAM,IAAI,GAAG,WAAW,CAAA;AACxB,MAAM,QAAQ,YAAU,IAAI,AAAE,CAAA;AAC9B,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;AAErC,MAAM,OAAO,GAAG,EAAE,CAAA;;AAElB,MAAM,SAAS,GAAG;AAChB,gBAAY,EAAE,cAAc;AAC5B,YAAQ,EAAE,UAAU;GACrB,CAAA;;;;;;;;MAQK,SAAS;AAEF,aAFP,SAAS,CAED,OAAO,EAAE,MAAM,EAAE;4BAFzB,SAAS;;AAGX,UAAI,CAAC,OAAO,GAAG,OAAO,CAAA;AACtB,UAAI,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;AAC3C,UAAI,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;;AAEjD,UAAI,CAAC,SAAS,CAAC,QAAQ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AAQ,CAAC,CAAA;OAC5C;;;aAEa,0BAAG;AACf,YAAI,CAAC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;OAC/C;;;;;;aAIsB,0BAAC,MAAM,EAAE;AAC9B,eAAO,IAAI,CAAC,IAAI,CAAC,YAAY;AAC3B,cAAI,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;AACtB,cAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;;AAElC,cAAI,CAAC,IAAI,EAAE;AACT,gBAAI,GAAG,IAAI,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AAClC,oBAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;WAC9B;SACF,CAAC,CAAA;OACH;;;WAjEG,SAAS;;;AAyEf,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,gBAAgB,CAAA;AACvC,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,SAAS,CAAA;AAClC,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,GAAG,YAAM;AAC5B,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,SAAS,CAAC,gBAAgB,CAAA;GAClC,CAAA;;AAED,SAAO,SAAS,CAAA;CAEjB,CAAA,CAAE,MAAM,CAAC,CAAA","file":"fileinput.js","sourcesContent":["import Util from './util'\n\n// FileInput decorator, to be called after Input\nconst FileInput = (($) => {\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n const NAME = 'fileInput'\n const DATA_KEY = `mdb.${NAME}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = {}\n\n const ClassName = {\n IS_FILEINPUT: 'is-fileinput',\n IS_EMPTY: 'is-empty'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n class FileInput {\n\n constructor(element, config) {\n this.element = element\n this.config = $.extend({}, Default, config)\n this.formGroup = Util.findFormGroup(this.element)\n\n this.formGroup.addClass(ClassName.IS_FILEINPUT)\n\n this._bindEventListeners()\n }\n\n dispose() {\n $.removeData(this.element, DATA_KEY)\n this.element = null\n this.formGroup = null\n this.config = null\n }\n\n // ------------------------------------------------------------------------\n // private\n _bindEventListeners() {\n this.formGroup.on('focus', () => {\n Util.addFormGroupFocus(this.formGroup)\n })\n .on('blur', () => {\n Util.removeFormGroupFocus(this.formGroup)\n })\n\n // set the fileinput readonly field with the name of the file\n this.element.on('change', () => {\n let value = ''\n $.each(this.element.files, (i, file) => {\n value += `${file.name} , `\n })\n value = value.substring(0, value.length - 2)\n if (value) {\n this._removeIsEmpty()\n } else {\n this._addIsEmpty()\n }\n this.formGroup.find('input.form-control[readonly]').val(value)\n })\n }\n\n _addIsEmpty() {\n this.formGroup.addClass(ClassName.IS_EMPTY)\n }\n\n _removeIsEmpty() {\n this.formGroup.removeClass(ClassName.IS_EMPTY)\n }\n\n // ------------------------------------------------------------------------\n // static\n static _jQueryInterface(config) {\n return this.each(function () {\n let $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new FileInput(this, config)\n $element.data(DATA_KEY, data)\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n $.fn[NAME] = FileInput._jQueryInterface\n $.fn[NAME].Constructor = FileInput\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return FileInput._jQueryInterface\n }\n\n return FileInput\n\n})(jQuery)\n\nexport default FileInput\n"]} \ No newline at end of file diff --git a/js/dist/input.js b/js/dist/input.js deleted file mode 100644 index e19115cd..00000000 --- a/js/dist/input.js +++ /dev/null @@ -1,217 +0,0 @@ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -var Input = (function ($) { - - /** - * ------------------------------------------------------------------------ - * Constants - * ------------------------------------------------------------------------ - */ - var NAME = 'input'; - var DATA_KEY = 'mdb.' + NAME; - var JQUERY_NO_CONFLICT = $.fn[NAME]; - - var Default = { - convertInputSizeVariations: true, - template: '', - formGroup: { - template: '
' - } - }; - - var InputSizeConversions = { - 'input-lg': 'form-group-lg', - 'input-sm': 'form-group-sm' - }; - - var ClassName = { - IS_EMPTY: 'is-empty', - FORM_GROUP: 'form-group', - HAS_ERROR: 'has-error' - }; - - var Selector = { - FORM_GROUP: '.' + ClassName.FORM_GROUP //, - }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - - var Input = (function () { - function Input(element, config) { - _classCallCheck(this, Input); - - this.element = element; - this.config = $.extend({}, Default, config); - - // Requires form-group standard markup (will add it if necessary) - this.formGroup = this._findOrCreateFormGroup(); - - this._convertInputSizeVariations(); - - // Initially mark as empty - if (this._isEmpty()) { - this.formGroup.addClass(ClassName.IS_EMPTY); - } - - // Add marker div the end of the form-group - this.formGroup.append(this.config.template); - - this._bindEventListeners(); - } - - /** - * ------------------------------------------------------------------------ - * jQuery - * ------------------------------------------------------------------------ - */ - - _createClass(Input, [{ - key: 'dispose', - value: function dispose() { - $.removeData(this.element, DATA_KEY); - this.element = null; - this.formGroup = null; - this.config = null; - } - - // ------------------------------------------------------------------------ - // private - - }, { - key: '_bindEventListeners', - value: function _bindEventListeners() { - var _this = this; - - this.element.on('keydown paste', function (event) { - if (Util.isChar(event)) { - _this._removeIsEmpty(); - } - }).on('keyup change', function (event) { - var isValid = typeof _this.element[0].checkValidity === 'undefined' || _this.element[0].checkValidity(); - - if (_this.element.val() === '' && isValid) { - _this._addIsEmpty(); - } else { - _this._removeIsEmpty(); - } - - // Validation events do not bubble, so they must be attached directly to the input: http://jsfiddle.net/PEpRM/1/ - // Further, even the bind method is being caught, but since we are already calling #checkValidity here, just alter - // the form-group on change. - // - // NOTE: I'm not sure we should be intervening regarding validation, this seems better as a README and snippet of code. - // BUT, I've left it here for backwards compatibility. - if (isValid) { - _this._removeHasError(); - } else { - _this._addHasError(); - } - }).on('focus', function () { - Util.addFormGroupFocus(_this.formGroup); - }).on('blur', function () { - Util.removeFormGroupFocus(_this.formGroup); - }) - // make sure empty is added back when there is a programmatic value change. - // NOTE: programmatic changing of value using $.val() must trigger the change event i.e. $.val('x').trigger('change') - .on('change', function () { - if (_this.element.attr('type') === 'file') { - return; - } - - var value = _this.element.val(); - if (value) { - _this._removeIsEmpty(); - } else { - _this._addIsEmpty(); - } - }); - } - }, { - key: '_addHasError', - value: function _addHasError() { - this.formGroup.addClass(ClassName.HAS_ERROR); - } - }, { - key: '_removeHasError', - value: function _removeHasError() { - this.formGroup.removeClass(ClassName.HAS_ERROR); - } - }, { - key: '_addIsEmpty', - value: function _addIsEmpty() { - this.formGroup.addClass(ClassName.IS_EMPTY); - } - }, { - key: '_removeIsEmpty', - value: function _removeIsEmpty() { - this.formGroup.removeClass(ClassName.IS_EMPTY); - } - }, { - key: '_isEmpty', - value: function _isEmpty() { - return this.element.val() === null || this.element.val() === undefined || this.element.val() === ''; - } - }, { - key: '_convertInputSizeVariations', - value: function _convertInputSizeVariations() { - if (!this.config.convertInputSizeVariations) { - return; - } - - // Modification - Change input-sm/lg to form-group-sm/lg instead (preferred standard and simpler css/less variants) - for (var inputSize in InputSizeConversions) { - if (this.element.hasClass(inputSize)) { - this.element.removeClass(inputSize); - this.formGroup.addClass(InputSizeConversions[inputSize]); - } - } - } - }, { - key: '_findOrCreateFormGroup', - value: function _findOrCreateFormGroup() { - var fg = this.element.closest(Selector.FORM_GROUP); // note that form-group may be grandparent in the case of an input-group - if (fg.length === 0) { - this.element.wrap(this.config.formGroup.template); - fg = this.element.closest(Selector.FORM_GROUP); // find node after attached (otherwise additional attachments don't work) - } - return fg; - } - - // ------------------------------------------------------------------------ - // static - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var $element = $(this); - var data = $element.data(DATA_KEY); - - if (!data) { - data = new Input(this, config); - $element.data(DATA_KEY, data); - } - }); - } - }]); - - return Input; - })(); - - $.fn[NAME] = Input._jQueryInterface; - $.fn[NAME].Constructor = Input; - $.fn[NAME].noConflict = function () { - $.fn[NAME] = JQUERY_NO_CONFLICT; - return Input._jQueryInterface; - }; - - return Input; -})(jQuery); -//# sourceMappingURL=input.js.map diff --git a/js/dist/input.js.map b/js/dist/input.js.map deleted file mode 100644 index a3560ddb..00000000 --- a/js/dist/input.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/input.js"],"names":[],"mappings":";;;;;;AAEA,IAAM,KAAK,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;AAOpB,MAAM,IAAI,GAAG,OAAO,CAAA;AACpB,MAAM,QAAQ,YAAU,IAAI,AAAE,CAAA;AAC9B,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;AAErC,MAAM,OAAO,GAAG;AACd,8BAA0B,EAAE,IAAI;AAChC,YAAQ,0CAAwC;AAChD,aAAS,EAAE;AACT,cAAQ,oCAAkC;KAC3C;GACF,CAAA;;AAED,MAAM,oBAAoB,GAAG;AAC3B,cAAU,EAAE,eAAe;AAC3B,cAAU,EAAE,eAAe;GAC5B,CAAA;;AAED,MAAM,SAAS,GAAG;AAChB,YAAQ,EAAE,UAAU;AACpB,cAAU,EAAE,YAAY;AACxB,aAAS,EAAE,WAAW;GACvB,CAAA;;AAED,MAAM,QAAQ,GAAG;A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C,CAAA;AAC9B,oBAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;WAC9B;SACF,CAAC,CAAA;OACH;;;WA1IG,KAAK;;;AAkJX,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAA;AACnC,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,KAAK,CAAA;AAC9B,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,GAAG,YAAM;AAC5B,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,KAAK,CAAC,gBAAgB,CAAA;GAC9B,CAAA;;AAED,SAAO,KAAK,CAAA;CAEb,CAAA,CAAE,MAAM,CAAC,CAAA","file":"input.js","sourcesContent":["import Util from './util'\n\nconst Input = (($) => {\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n const NAME = 'input'\n const DATA_KEY = `mdb.${NAME}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = {\n convertInputSizeVariations: true,\n template: ``,\n formGroup: {\n template: `
`\n }\n }\n\n const InputSizeConversions = {\n 'input-lg': 'form-group-lg',\n 'input-sm': 'form-group-sm'\n }\n\n const ClassName = {\n IS_EMPTY: 'is-empty',\n FORM_GROUP: 'form-group',\n HAS_ERROR: 'has-error'\n }\n\n const Selector = {\n FORM_GROUP: `.${ClassName.FORM_GROUP}` //,\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n class Input {\n\n constructor(element, config) {\n this.element = element\n this.config = $.extend({}, Default, config)\n\n // Requires form-group standard markup (will add it if necessary)\n this.formGroup = this._findOrCreateFormGroup()\n\n this._convertInputSizeVariations()\n\n // Initially mark as empty\n if (this._isEmpty()) {\n this.formGroup.addClass(ClassName.IS_EMPTY)\n }\n\n // Add marker div the end of the form-group\n this.formGroup.append(this.config.template)\n\n this._bindEventListeners()\n }\n\n dispose() {\n $.removeData(this.element, DATA_KEY)\n this.element = null\n this.formGroup = null\n this.config = null\n }\n\n // ------------------------------------------------------------------------\n // private\n\n _bindEventListeners() {\n\n this.element\n .on('keydown paste', (event) => {\n if (Util.isChar(event)) {\n this._removeIsEmpty()\n }\n })\n .on('keyup change', (event) => {\n let isValid = (typeof this.element[0].checkValidity === 'undefined' || this.element[0].checkValidity())\n\n if (this.element.val() === '' && isValid) {\n this._addIsEmpty()\n } else {\n this._removeIsEmpty()\n }\n\n // Validation events do not bubble, so they must be attached directly to the input: http://jsfiddle.net/PEpRM/1/\n // Further, even the bind method is being caught, but since we are already calling #checkValidity here, just alter\n // the form-group on change.\n //\n // NOTE: I'm not sure we should be intervening regarding validation, this seems better as a README and snippet of code.\n // BUT, I've left it here for backwards compatibility.\n if (isValid) {\n this._removeHasError()\n } else {\n this._addHasError()\n }\n })\n .on('focus', () => {\n Util.addFormGroupFocus(this.formGroup)\n })\n .on('blur', () => {\n Util.removeFormGroupFocus(this.formGroup)\n })\n // make sure empty is added back when there is a programmatic value change.\n // NOTE: programmatic changing of value using $.val() must trigger the change event i.e. $.val('x').trigger('change')\n .on('change', () => {\n if (this.element.attr('type') === 'file') {\n return\n }\n\n let value = this.element.val()\n if (value) {\n this._removeIsEmpty()\n } else {\n this._addIsEmpty()\n }\n })\n }\n\n _addHasError() {\n this.formGroup.addClass(ClassName.HAS_ERROR)\n }\n\n _removeHasError() {\n this.formGroup.removeClass(ClassName.HAS_ERROR)\n }\n\n _addIsEmpty() {\n this.formGroup.addClass(ClassName.IS_EMPTY)\n }\n\n _removeIsEmpty() {\n this.formGroup.removeClass(ClassName.IS_EMPTY)\n }\n\n _isEmpty() {\n return (this.element.val() === null || this.element.val() === undefined || this.element.val() === '')\n }\n\n _convertInputSizeVariations() {\n if (!this.config.convertInputSizeVariations) {\n return\n }\n\n // Modification - Change input-sm/lg to form-group-sm/lg instead (preferred standard and simpler css/less variants)\n for (let inputSize in InputSizeConversions) {\n if (this.element.hasClass(inputSize)) {\n this.element.removeClass(inputSize)\n this.formGroup.addClass(InputSizeConversions[inputSize])\n }\n }\n }\n\n _findOrCreateFormGroup() {\n let fg = this.element.closest(Selector.FORM_GROUP) // note that form-group may be grandparent in the case of an input-group\n if (fg.length === 0) {\n this.element.wrap(this.config.formGroup.template)\n fg = this.element.closest(Selector.FORM_GROUP) // find node after attached (otherwise additional attachments don't work)\n }\n return fg\n }\n\n // ------------------------------------------------------------------------\n // static\n static _jQueryInterface(config) {\n return this.each(function () {\n let $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new Input(this, config)\n $element.data(DATA_KEY, data)\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n $.fn[NAME] = Input._jQueryInterface\n $.fn[NAME].Constructor = Input\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Input._jQueryInterface\n }\n\n return Input\n\n})(jQuery)\n\nexport default Input\n"]} \ No newline at end of file diff --git a/js/dist/radio.js b/js/dist/radio.js deleted file mode 100644 index 6766975e..00000000 --- a/js/dist/radio.js +++ /dev/null @@ -1,87 +0,0 @@ -//import Util from './util' - -// Radio decorator, to be called after Input -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -var Radio = (function ($) { - - /** - * ------------------------------------------------------------------------ - * Constants - * ------------------------------------------------------------------------ - */ - var NAME = 'radio'; - var DATA_KEY = 'mdb.' + NAME; - var JQUERY_NO_CONFLICT = $.fn[NAME]; - - var Default = { - template: '' - }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - - var Radio = (function () { - function Radio(element, config) { - _classCallCheck(this, Radio); - - this.element = element; - this.config = $.extend({}, Default, config); - - this.element.after(this.config.template); - } - - /** - * ------------------------------------------------------------------------ - * jQuery - * ------------------------------------------------------------------------ - */ - - _createClass(Radio, [{ - key: 'dispose', - value: function dispose() { - $.removeData(this.element, DATA_KEY); - this.element = null; - this.config = null; - } - - // ------------------------------------------------------------------------ - // private - - // ------------------------------------------------------------------------ - // static - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var $element = $(this); - var data = $element.data(DATA_KEY); - - if (!data) { - data = new Radio(this, config); - $element.data(DATA_KEY, data); - } - }); - } - }]); - - return Radio; - })(); - - $.fn[NAME] = Radio._jQueryInterface; - $.fn[NAME].Constructor = Radio; - $.fn[NAME].noConflict = function () { - $.fn[NAME] = JQUERY_NO_CONFLICT; - return Radio._jQueryInterface; - }; - - return Radio; -})(jQuery); -//# sourceMappingURL=radio.js.map diff --git a/js/dist/radio.js.map b/js/dist/radio.js.map deleted file mode 100644 index 2e95d613..00000000 --- a/js/dist/radio.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/radio.js"],"names":[],"mappings":";;;;;;;;;AAGA,IAAM,KAAK,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;AAOpB,MAAM,IAAI,GAAG,OAAO,CAAA;AACpB,MAAM,QAAQ,YAAU,IAAI,AAAE,CAAA;AAC9B,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;AAErC,MAAM,OAAO,GAAG;AACd,YAAQ,+DAA2D;GACpE,CAAA;;;;;;;;MAOK,KAAK;AAEE,aAFP,KAAK,CAEG,OAAO,EAAE,MAAM,EAAE;4BAFzB,KAAK;;AAG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file":"radio.js","sourcesContent":["//import Util from './util'\n\n// Radio decorator, to be called after Input\nconst Radio = (($) => {\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n const NAME = 'radio'\n const DATA_KEY = `mdb.${NAME}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = {\n template: ``\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n class Radio {\n\n constructor(element, config) {\n this.element = element\n this.config = $.extend({}, Default, config)\n\n this.element.after(this.config.template)\n }\n\n dispose() {\n $.removeData(this.element, DATA_KEY)\n this.element = null\n this.config = null\n }\n\n // ------------------------------------------------------------------------\n // private\n\n // ------------------------------------------------------------------------\n // static\n static _jQueryInterface(config) {\n return this.each(function () {\n let $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new Radio(this, config)\n $element.data(DATA_KEY, data)\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n $.fn[NAME] = Radio._jQueryInterface\n $.fn[NAME].Constructor = Radio\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Radio._jQueryInterface\n }\n\n return Radio\n\n})(jQuery)\n\nexport default Radio\n"]} \ No newline at end of file diff --git a/js/dist/ripples.js b/js/dist/ripples.js deleted file mode 100644 index 7737433c..00000000 --- a/js/dist/ripples.js +++ /dev/null @@ -1,333 +0,0 @@ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -var Ripples = (function ($) { - - /** - * ------------------------------------------------------------------------ - * Constants - * ------------------------------------------------------------------------ - */ - var NAME = 'ripples'; - var DATA_KEY = 'mdb.' + NAME; - var JQUERY_NO_CONFLICT = $.fn[NAME]; - - var ClassName = { - CONTAINER: 'ripple-container', - DECORATOR: 'ripple-decorator' - }; - - var Selector = { - CONTAINER: '.' + ClassName.CONTAINER, - DECORATOR: '.' + ClassName.DECORATOR //, - }; - - var Default = { - container: { - template: '
' - }, - decorator: { - template: ClassName.DECORATOR + '\'>' - }, - trigger: { - start: 'mousedown touchstart', - end: 'mouseup mouseleave touchend' - }, - touchUserAgentRegex: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i, - duration: 500 - }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - - var Ripples = (function () { - function Ripples(element, config) { - _classCallCheck(this, Ripples); - - this.element = $(element); - this.config = $.extend({}, Default, config); - - // attach initial listener - this.element.on(this.config.triggerStart, this._onStartRipple); - } - - /** - * ------------------------------------------------------------------------ - * jQuery - * ------------------------------------------------------------------------ - */ - - _createClass(Ripples, [{ - key: 'dispose', - value: function dispose() { - $.removeData(this.element, DATA_KEY); - this.element = null; - this.containerElement = null; - this.decoratorElement = null; - this.config = null; - } - - // ------------------------------------------------------------------------ - // private - - }, { - key: '_onStartRipple', - value: function _onStartRipple(event) { - var _this = this; - - // Verify if the user is just touching on a device and return if so - if (this.isTouch() && event.type === 'mousedown') { - return; - } - - // Find or create the ripple container element - this._findOrCreateContainer(); - - // Get relY and relX positions of the container element - var relY = this._getRelY(event); - var relX = this._getRelX(event); - - // If relY and/or relX are false, return the event - if (!relY && !relX) { - return; - } - - // set the location and color each time (even if element is cached) - this.decoratorElement.css({ - 'left': relX, - 'top': relY, - 'background-color': this._getRipplesColor() - }); - - // Make sure the ripple has the styles applied (ugly hack but it works) - this._forceStyleApplication(); - - // Turn on the ripple animation - this.rippleOn(); - - // Call the rippleEnd function when the transition 'on' ends - setTimeout(function () { - _this.rippleEnd(); - }, this.config.duration); - - // Detect when the user leaves the element (attach only when necessary for performance) - this.element.on(this.config.triggerEnd, function () { - _this.decoratorElement.data('mousedown', 'off'); - - if (_this.decoratorElement.data('animating') === 'off') { - _this.rippleOut(); - } - }); - } - }, { - key: '_findOrCreateContainer', - value: function _findOrCreateContainer() { - if (!this.containerElement || !this.containerElement.length > 0) { - this.element.append(this.config.container.template); - this.containerElement = this.element.find(Selector.CONTAINER); - } - - // always add the rippleElement, it is always removed - this.containerElement.append(this.config.element.template); - this.decoratorElement = this.containerElement.find(Selector.DECORATOR); - } - - // Make sure the ripple has the styles applied (ugly hack but it works) - }, { - key: '_forceStyleApplication', - value: function _forceStyleApplication() { - return window.getComputedStyle(this.decoratorElement[0]).opacity; - } - - /** - * Get the relX - */ - }, { - key: '_getRelX', - value: function _getRelX(event) { - var wrapperOffset = this.containerElement.offset(); - - var result = null; - if (!this.isTouch()) { - // Get the mouse position relative to the ripple wrapper - result = event.pageX - wrapperOffset.left; - } else { - // Make sure the user is using only one finger and then get the touch - // position relative to the ripple wrapper - event = event.originalEvent; - - if (event.touches.length === 1) { - result = event.touches[0].pageX - wrapperOffset.left; - } else { - result = false; - } - } - - return result; - } - - /** - * Get the relY - */ - }, { - key: '_getRelY', - value: function _getRelY(event) { - var containerOffset = this.containerElement.offset(); - var result = null; - - if (!this.isTouch()) { - /** - * Get the mouse position relative to the ripple wrapper - */ - result = event.pageY - containerOffset.top; - } else { - /** - * Make sure the user is using only one finger and then get the touch - * position relative to the ripple wrapper - */ - event = event.originalEvent; - - if (event.touches.length === 1) { - result = event.touches[0].pageY - containerOffset.top; - } else { - result = false; - } - } - - return result; - } - - /** - * Get the ripple color - */ - }, { - key: '_getRipplesColor', - value: function _getRipplesColor() { - var color = this.element.data('ripple-color') ? this.element.data('ripple-color') : window.getComputedStyle(this.element[0]).color; - return color; - } - - /** - * Verify if the client is using a mobile device - */ - }, { - key: 'isTouch', - value: function isTouch() { - return this.config.touchUserAgentRegex.test(navigator.userAgent); - } - - /** - * End the animation of the ripple - */ - }, { - key: 'rippleEnd', - value: function rippleEnd() { - this.decoratorElement.data('animating', 'off'); - - if (this.decoratorElement.data('mousedown') === 'off') { - this.rippleOut(this.decoratorElement); - } - } - - /** - * Turn off the ripple effect - */ - }, { - key: 'rippleOut', - value: function rippleOut() { - var _this2 = this; - - this.decoratorElement.off(); - - if (Util.transitionEndSupported()) { - this.decoratorElement.addClass('ripple-out'); - } else { - this.decoratorElement.animate({ 'opacity': 0 }, 100, function () { - _this2.decoratorElement.triggerStart('transitionend'); - }); - } - - this.decoratorElement.on(Util.transitionEndSelector(), function () { - _this2.decoratorElement.remove(); - _this2.decoratorElement = null; - }); - } - - /** - * Turn on the ripple effect - */ - }, { - key: 'rippleOn', - value: function rippleOn() { - var _this3 = this; - - var size = this._getNewSize(); - - if (Util.transitionEndSupported()) { - this.decoratorElement.css({ - '-ms-transform': 'scale(' + size + ')', - '-moz-transform': 'scale(' + size + ')', - '-webkit-transform': 'scale(' + size + ')', - 'transform': 'scale(' + size + ')' - }).addClass('ripple-on').data('animating', 'on').data('mousedown', 'on'); - } else { - this.decoratorElement.animate({ - 'width': Math.max(this.element.outerWidth(), this.element.outerHeight()) * 2, - 'height': Math.max(this.element.outerWidth(), this.element.outerHeight()) * 2, - 'margin-left': Math.max(this.element.outerWidth(), this.element.outerHeight()) * -1, - 'margin-top': Math.max(this.element.outerWidth(), this.element.outerHeight()) * -1, - 'opacity': 0.2 - }, this.config.duration, function () { - _this3.decoratorElement.triggerStart('transitionend'); - }); - } - } - - /** - * Get the new size based on the element height/width and the ripple width - */ - }, { - key: '_getNewSize', - value: function _getNewSize() { - return Math.max(this.element.outerWidth(), this.element.outerHeight()) / this.decoratorElement.outerWidth() * 2.5; - } - - // ------------------------------------------------------------------------ - // static - - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - var _this4 = this; - - return this.each(function () { - var element = $(_this4); - var data = element.data(DATA_KEY); - - if (!data) { - data = new Ripples(_this4, config); - element.data(DATA_KEY, data); - } - }); - } - }]); - - return Ripples; - })(); - - $.fn[NAME] = Ripples._jQueryInterface; - $.fn[NAME].Constructor = Ripples; - $.fn[NAME].noConflict = function () { - $.fn[NAME] = JQUERY_NO_CONFLICT; - return Ripples._jQueryInterface; - }; - - return Ripples; -})(jQuery); -//# sourceMappingURL=ripples.js.map diff --git a/js/dist/ripples.js.map b/js/dist/ripples.js.map deleted file mode 100644 index b3386af9..00000000 --- a/js/dist/ripples.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/ripples.js"],"names":[],"mappings":";;;;;;AAEA,IAAM,OAAO,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;AAOtB,MAAM,IAAI,GAAG,SAAS,CAAA;AACtB,MAAM,QAAQ,YAAU,IAAI,AAAE,CAAA;AAC9B,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;AAErC,MAAM,SAAS,GAAG;AAChB,aAAS,EAAE,kBAAkB;AAC7B,aAAS,EAAE,kBAAkB;GAC9B,CAAA;;AAED,MAAM,QAAQ,GAAG;AACf,aAAS,QAAM,SAAS,CAAC,SAAS,AAAE;AACpC,aAAS,QAAM,SAAS,CAAC,SAAS,AAAE;GACrC,CAAA;;AAGD,MAAM,OAAO,GAAG;AACd,aAAS,EAAE;AACT,cAAQ,oBAAiB,SAAS,CAAC,SAAS,cAAU;KACvD;AACD,aAAS,EAAE;AACT,cAAQ,EAAK,SAAS,CAAC,SAAS,cAAU;KAC3C;AACD,WAAO,EAAE;AACP,WAAK,EAAE,sBAAsB;AAC7B,SAAG,EAAE,6BAA6B;KACnC;AACD,uBAAmB,EAAE,gEAAgE;AACrF,YAAQ,EAAE,GAAG;GACd,CAAA;;;;;;;;MAOK,OAAO;AAEA,aAFP,OAAO,CAEC,OAAO,EAAE,MAAM,EAAE;4BAFzB,O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AA;AACrB,cAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;;AAEjC,cAAI,CAAC,IAAI,EAAE;AACT,gBAAI,GAAG,IAAI,OAAO,SAAO,MAAM,CAAC,CAAA;AAChC,mBAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;WAC7B;SACF,CAAC,CAAA;OACH;;;WA1OG,OAAO;;;AAkPb,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAA;AACrC,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,OAAO,CAAA;AAChC,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,GAAG,YAAM;AAC5B,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,OAAO,CAAC,gBAAgB,CAAA;GAChC,CAAA;;AAED,SAAO,OAAO,CAAA;CAEf,CAAA,CAAE,MAAM,CAAC,CAAA","file":"ripples.js","sourcesContent":["import Util from './util'\n\nconst Ripples = (($) => {\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n const NAME = 'ripples'\n const DATA_KEY = `mdb.${NAME}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const ClassName = {\n CONTAINER: 'ripple-container',\n DECORATOR: 'ripple-decorator'\n }\n\n const Selector = {\n CONTAINER: `.${ClassName.CONTAINER}`,\n DECORATOR: `.${ClassName.DECORATOR}` //,\n }\n\n\n const Default = {\n container: {\n template: `
`\n },\n decorator: {\n template: `${ClassName.DECORATOR}'>`\n },\n trigger: {\n start: 'mousedown touchstart',\n end: 'mouseup mouseleave touchend'\n },\n touchUserAgentRegex: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i,\n duration: 500\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n class Ripples {\n\n constructor(element, config) {\n this.element = $(element)\n this.config = $.extend({}, Default, config)\n\n // attach initial listener\n this.element.on(this.config.triggerStart, this._onStartRipple)\n }\n\n dispose() {\n $.removeData(this.element, DATA_KEY)\n this.element = null\n this.containerElement = null\n this.decoratorElement = null\n this.config = null\n }\n\n // ------------------------------------------------------------------------\n // private\n\n _onStartRipple(event) {\n\n // Verify if the user is just touching on a device and return if so\n if (this.isTouch() && event.type === 'mousedown') {\n return\n }\n\n // Find or create the ripple container element\n this._findOrCreateContainer()\n\n // Get relY and relX positions of the container element\n let relY = this._getRelY(event)\n let relX = this._getRelX(event)\n\n // If relY and/or relX are false, return the event\n if (!relY && !relX) {\n return\n }\n\n // set the location and color each time (even if element is cached)\n this.decoratorElement.css({\n 'left': relX,\n 'top': relY,\n 'background-color': this._getRipplesColor()\n })\n\n // Make sure the ripple has the styles applied (ugly hack but it works)\n this._forceStyleApplication()\n\n // Turn on the ripple animation\n this.rippleOn()\n\n // Call the rippleEnd function when the transition 'on' ends\n setTimeout(() => {\n this.rippleEnd()\n }, this.config.duration)\n\n // Detect when the user leaves the element (attach only when necessary for performance)\n this.element.on(this.config.triggerEnd, () => {\n this.decoratorElement.data('mousedown', 'off')\n\n if (this.decoratorElement.data('animating') === 'off') {\n this.rippleOut()\n }\n })\n }\n\n _findOrCreateContainer() {\n if (!this.containerElement || !this.containerElement.length > 0) {\n this.element.append(this.config.container.template)\n this.containerElement = this.element.find(Selector.CONTAINER)\n }\n\n // always add the rippleElement, it is always removed\n this.containerElement.append(this.config.element.template)\n this.decoratorElement = this.containerElement.find(Selector.DECORATOR)\n }\n\n // Make sure the ripple has the styles applied (ugly hack but it works)\n _forceStyleApplication() {\n return window.getComputedStyle(this.decoratorElement[0]).opacity\n }\n\n /**\n * Get the relX\n */\n _getRelX(event) {\n let wrapperOffset = this.containerElement.offset()\n\n let result = null\n if (!this.isTouch()) {\n // Get the mouse position relative to the ripple wrapper\n result = event.pageX - wrapperOffset.left\n } else {\n // Make sure the user is using only one finger and then get the touch\n // position relative to the ripple wrapper\n event = event.originalEvent\n\n if (event.touches.length === 1) {\n result = event.touches[0].pageX - wrapperOffset.left\n } else {\n result = false\n }\n }\n\n return result\n }\n\n /**\n * Get the relY\n */\n _getRelY(event) {\n let containerOffset = this.containerElement.offset()\n let result = null\n\n if (!this.isTouch()) {\n /**\n * Get the mouse position relative to the ripple wrapper\n */\n result = event.pageY - containerOffset.top\n } else {\n /**\n * Make sure the user is using only one finger and then get the touch\n * position relative to the ripple wrapper\n */\n event = event.originalEvent\n\n if (event.touches.length === 1) {\n result = event.touches[0].pageY - containerOffset.top\n } else {\n result = false\n }\n }\n\n return result\n }\n\n /**\n * Get the ripple color\n */\n _getRipplesColor() {\n let color = this.element.data('ripple-color') ? this.element.data('ripple-color') : window.getComputedStyle(this.element[0]).color\n return color\n }\n\n /**\n * Verify if the client is using a mobile device\n */\n isTouch() {\n return this.config.touchUserAgentRegex.test(navigator.userAgent)\n }\n\n /**\n * End the animation of the ripple\n */\n rippleEnd() {\n this.decoratorElement.data('animating', 'off')\n\n if (this.decoratorElement.data('mousedown') === 'off') {\n this.rippleOut(this.decoratorElement)\n }\n }\n\n /**\n * Turn off the ripple effect\n */\n rippleOut() {\n this.decoratorElement.off()\n\n if (Util.transitionEndSupported()) {\n this.decoratorElement.addClass('ripple-out')\n } else {\n this.decoratorElement.animate({ 'opacity': 0 }, 100, () => {\n this.decoratorElement.triggerStart('transitionend')\n })\n }\n\n this.decoratorElement.on(Util.transitionEndSelector(), () => {\n this.decoratorElement.remove()\n this.decoratorElement = null\n })\n }\n\n /**\n * Turn on the ripple effect\n */\n rippleOn() {\n let size = this._getNewSize()\n\n if (Util.transitionEndSupported()) {\n this.decoratorElement\n .css({\n '-ms-transform': `scale(${size})`,\n '-moz-transform': `scale(${size})`,\n '-webkit-transform': `scale(${size})`,\n 'transform': `scale(${size})`\n })\n .addClass('ripple-on')\n .data('animating', 'on')\n .data('mousedown', 'on')\n } else {\n this.decoratorElement.animate({\n 'width': Math.max(this.element.outerWidth(), this.element.outerHeight()) * 2,\n 'height': Math.max(this.element.outerWidth(), this.element.outerHeight()) * 2,\n 'margin-left': Math.max(this.element.outerWidth(), this.element.outerHeight()) * (-1),\n 'margin-top': Math.max(this.element.outerWidth(), this.element.outerHeight()) * (-1),\n 'opacity': 0.2\n }, this.config.duration, () => {\n this.decoratorElement.triggerStart('transitionend')\n })\n }\n }\n\n /**\n * Get the new size based on the element height/width and the ripple width\n */\n _getNewSize() {\n return (Math.max(this.element.outerWidth(), this.element.outerHeight()) / this.decoratorElement.outerWidth()) * 2.5\n }\n\n // ------------------------------------------------------------------------\n // static\n\n static _jQueryInterface(config) {\n return this.each(() => {\n let element = $(this)\n let data = element.data(DATA_KEY)\n\n if (!data) {\n data = new Ripples(this, config)\n element.data(DATA_KEY, data)\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n $.fn[NAME] = Ripples._jQueryInterface\n $.fn[NAME].Constructor = Ripples\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Ripples._jQueryInterface\n }\n\n return Ripples\n\n})(jQuery)\n\nexport default Ripples\n"]} \ No newline at end of file diff --git a/js/dist/togglebutton.js b/js/dist/togglebutton.js deleted file mode 100644 index a50d24ca..00000000 --- a/js/dist/togglebutton.js +++ /dev/null @@ -1,87 +0,0 @@ -//import Util from './util' - -// Togglebutton decorator, to be called after Input -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -var Togglebutton = (function ($) { - - /** - * ------------------------------------------------------------------------ - * Constants - * ------------------------------------------------------------------------ - */ - var NAME = 'togglebutton'; - var DATA_KEY = 'mdb.' + NAME; - var JQUERY_NO_CONFLICT = $.fn[NAME]; - - var Default = { - template: '' - }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - - var Togglebutton = (function () { - function Togglebutton(element, config) { - _classCallCheck(this, Togglebutton); - - this.element = element; - this.config = $.extend({}, Default, config); - - this.element.after(this.config.template); - } - - /** - * ------------------------------------------------------------------------ - * jQuery - * ------------------------------------------------------------------------ - */ - - _createClass(Togglebutton, [{ - key: 'dispose', - value: function dispose() { - $.removeData(this.element, DATA_KEY); - this.element = null; - this.config = null; - } - - // ------------------------------------------------------------------------ - // private - - // ------------------------------------------------------------------------ - // static - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var $element = $(this); - var data = $element.data(DATA_KEY); - - if (!data) { - data = new Togglebutton(this, config); - $element.data(DATA_KEY, data); - } - }); - } - }]); - - return Togglebutton; - })(); - - $.fn[NAME] = Togglebutton._jQueryInterface; - $.fn[NAME].Constructor = Togglebutton; - $.fn[NAME].noConflict = function () { - $.fn[NAME] = JQUERY_NO_CONFLICT; - return Togglebutton._jQueryInterface; - }; - - return Togglebutton; -})(jQuery); -//# sourceMappingURL=togglebutton.js.map diff --git a/js/dist/togglebutton.js.map b/js/dist/togglebutton.js.map deleted file mode 100644 index 77d7344d..00000000 --- a/js/dist/togglebutton.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/togglebutton.js"],"names":[],"mappings":";;;;;;;;;AAGA,IAAM,YAAY,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;AAO3B,MAAM,IAAI,GAAG,cAAc,CAAA;AAC3B,MAAM,QAAQ,YAAU,IAAI,AAAE,CAAA;AAC9B,MAAM,kBAAkB,GAAG,CAAC,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AAM;AAC5B,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,YAAY,CAAC,gBAAgB,CAAA;GACrC,CAAA;;AAED,SAAO,YAAY,CAAA;CAEpB,CAAA,CAAE,MAAM,CAAC,CAAA","file":"togglebutton.js","sourcesContent":["//import Util from './util'\n\n// Togglebutton decorator, to be called after Input\nconst Togglebutton = (($) => {\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n const NAME = 'togglebutton'\n const DATA_KEY = `mdb.${NAME}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = {\n template: ``\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n class Togglebutton {\n\n constructor(element, config) {\n this.element = element\n this.config = $.extend({}, Default, config)\n\n this.element.after(this.config.template)\n }\n\n dispose() {\n $.removeData(this.element, DATA_KEY)\n this.element = null\n this.config = null\n }\n\n // ------------------------------------------------------------------------\n // private\n\n // ------------------------------------------------------------------------\n // static\n static _jQueryInterface(config) {\n return this.each(function () {\n let $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new Togglebutton(this, config)\n $element.data(DATA_KEY, data)\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n $.fn[NAME] = Togglebutton._jQueryInterface\n $.fn[NAME].Constructor = Togglebutton\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Togglebutton._jQueryInterface\n }\n\n return Togglebutton\n\n})(jQuery)\n\nexport default Togglebutton\n"]} \ No newline at end of file diff --git a/js/dist/util.js b/js/dist/util.js deleted file mode 100644 index 06f53358..00000000 --- a/js/dist/util.js +++ /dev/null @@ -1,103 +0,0 @@ -'use strict'; - -var Util = (function ($) { - - /** - * ------------------------------------------------------------------------ - * Private TransitionEnd Helpers - * ------------------------------------------------------------------------ - */ - - var transitionEnd = false; - var _transitionEndSelector = ''; - - var TransitionEndEvent = { - WebkitTransition: 'webkitTransitionEnd', - MozTransition: 'transitionend', - OTransition: 'oTransitionEnd otransitionend', - transition: 'transitionend' - }; - - var ClassName = { - IS_FOCUSED: 'is-focused', - FORM_GROUP: 'form-group' - }; - - var Selector = { - FORM_GROUP: '.' + ClassName.FORM_GROUP //, - }; - - function transitionEndTest() { - if (window.QUnit) { - return false; - } - - var el = document.createElement('mdb'); - - for (var _name in TransitionEndEvent) { - if (el.style[_name] !== undefined) { - return TransitionEndEvent[_name]; // { end: TransitionEndEvent[name] } - } - } - - return false; - } - - function setTransitionEndSupport() { - transitionEnd = transitionEndTest(); - - // generate a concatenated transition end event selector - for (var _name2 in TransitionEndEvent) { - _transitionEndSelector += ' ' + TransitionEndEvent[_name2]; - } - } - - /** - * -------------------------------------------------------------------------- - * Public Util Api - * -------------------------------------------------------------------------- - */ - - var Util = { - - transitionEndSupported: function transitionEndSupported() { - return transitionEnd; - }, - - transitionEndSelector: function transitionEndSelector() { - return _transitionEndSelector; - }, - - isChar: function isChar(event) { - if (typeof event.which === 'undefined') { - return true; - } else if (typeof event.which === 'number' && event.which > 0) { - return !event.ctrlKey && !event.metaKey && !event.altKey && event.which !== 8 && event.which !== 9; - } - return false; - }, - - addFormGroupFocus: function addFormGroupFocus(formGroup) { - formGroup.addClass(ClassName.IS_FOCUSED); - }, - - removeFormGroupFocus: function removeFormGroupFocus(formGroup) { - formGroup.removeClass(ClassName.IS_FOCUSED); - }, - - /** - Find expected form-group - */ - findFormGroup: function findFormGroup(element) { - var fg = element.closest(Selector.FORM_GROUP); // note that form-group may be grandparent in the case of an input-group - if (fg.length === 0) { - $.error('Failed to find form-group for ' + element); - } - return fg; - } - }; - - setTransitionEndSupport(); - return Util; -})(jQuery); -//# sourceMappingURL=util.js.map diff --git a/js/dist/util.js.map b/js/dist/util.js.map deleted file mode 100644 index 7f6f5910..00000000 --- a/js/dist/util.js.map +++ /dev/null @@ -1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AAI,OAAO,KAAK,CAAC,KAAK,KAAK,WAAW,EAAE;AACtC,eAAO,IAAI,CAAA;OACZ,MAAM,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE;AAC7D,eAAO,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,KAAK,CAAC,CAAA;OACnG;AACD,aAAO,KAAK,CAAA;KACb;;AAED,qBAAiB,EAAA,2BAAC,SAAS,EAAE;AAC3B,eAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;KACzC;;AAED,wBAAoB,EAAA,8BAAC,SAAS,EAAE;AAC9B,eAAS,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;KAC5C;;;;;AAKD,iBAAa,EAAA,uBAAC,OAAO,EAAE;AACrB,UAAI,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;AAC7C,UAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;AACnB,SAAC,CAAC,KAAK,oCAAkC,OAAO,CAAG,CAAA;OACpD;AACD,aAAO,EAAE,CAAA;KACV;GACF,CAAA;;AAED,yBAAuB,EAAE,CAAA;AACzB,SAAO,IAAI,CAAA;CAEZ,CAAA,CAAE,MAAM,CAAC,CAAA","file":"util.js","sourcesContent":["const Util = (($) => {\n\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\n let transitionEnd = false\n let transitionEndSelector = ''\n\n const TransitionEndEvent = {\n WebkitTransition: 'webkitTransitionEnd',\n MozTransition: 'transitionend',\n OTransition: 'oTransitionEnd otransitionend',\n transition: 'transitionend'\n }\n\n const ClassName = {\n IS_FOCUSED: 'is-focused',\n FORM_GROUP: 'form-group'\n }\n\n const Selector = {\n FORM_GROUP: `.${ClassName.FORM_GROUP}` //,\n }\n\n function transitionEndTest() {\n if (window.QUnit) {\n return false\n }\n\n let el = document.createElement('mdb')\n\n for (let name in TransitionEndEvent) {\n if (el.style[name] !== undefined) {\n return TransitionEndEvent[name] // { end: TransitionEndEvent[name] }\n }\n }\n\n return false\n }\n\n function setTransitionEndSupport() {\n transitionEnd = transitionEndTest()\n\n // generate a concatenated transition end event selector\n for (let name in TransitionEndEvent) {\n transitionEndSelector += ` ${TransitionEndEvent[name]}`\n }\n }\n\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n let Util = {\n\n transitionEndSupported() {\n return transitionEnd\n },\n\n transitionEndSelector() {\n return transitionEndSelector\n },\n\n isChar(event) {\n if (typeof event.which === 'undefined') {\n return true\n } else if (typeof event.which === 'number' && event.which > 0) {\n return !event.ctrlKey && !event.metaKey && !event.altKey && event.which !== 8 && event.which !== 9\n }\n return false\n },\n\n addFormGroupFocus(formGroup) {\n formGroup.addClass(ClassName.IS_FOCUSED)\n },\n\n removeFormGroupFocus(formGroup) {\n formGroup.removeClass(ClassName.IS_FOCUSED)\n },\n\n /**\n Find expected form-group\n */\n findFormGroup(element) {\n let fg = element.closest(Selector.FORM_GROUP) // note that form-group may be grandparent in the case of an input-group\n if (fg.length === 0) {\n $.error(`Failed to find form-group for ${element}`)\n }\n return fg\n }\n }\n\n setTransitionEndSupport()\n return Util\n\n})(jQuery)\n\nexport default Util\n"]} \ No newline at end of file diff --git a/js/src/fileinput.js b/js/src/fileinput.js index 80f57a92..a67e7e24 100644 --- a/js/src/fileinput.js +++ b/js/src/fileinput.js @@ -47,7 +47,8 @@ const FileInput = (($) => { // ------------------------------------------------------------------------ // private _bindEventListeners() { - this.formGroup.on('focus', () => { + this.formGroup + .on('focus', () => { Util.addFormGroupFocus(this.formGroup) }) .on('blur', () => { diff --git a/js/src/ripples.js b/js/src/ripples.js index 954139bc..5c9e4f80 100644 --- a/js/src/ripples.js +++ b/js/src/ripples.js @@ -84,10 +84,10 @@ const Ripples = (($) => { // set the location and color each time (even if element is cached) this.decoratorElement.css({ - 'left': relX, - 'top': relY, - 'background-color': this._getRipplesColor() - }) + left: relX, + top: relY, + 'background-color': this._getRipplesColor() + }) // Make sure the ripple has the styles applied (ugly hack but it works) this._forceStyleApplication() @@ -137,8 +137,8 @@ const Ripples = (($) => { // Get the mouse position relative to the ripple wrapper result = event.pageX - wrapperOffset.left } else { - // Make sure the user is using only one finger and then get the touch - // position relative to the ripple wrapper + // Make sure the user is using only one finger and then get the touch + // position relative to the ripple wrapper event = event.originalEvent if (event.touches.length === 1) { @@ -171,7 +171,7 @@ const Ripples = (($) => { event = event.originalEvent if (event.touches.length === 1) { - result = event.touches[0].pageY - containerOffset.top + result = event.touches[0].pageY - containerOffset.top } else { result = false } @@ -215,7 +215,7 @@ const Ripples = (($) => { if (Util.transitionEndSupported()) { this.decoratorElement.addClass('ripple-out') } else { - this.decoratorElement.animate({ 'opacity': 0 }, 100, () => { + this.decoratorElement.animate({opacity: 0}, 100, () => { this.decoratorElement.triggerStart('transitionend') }) } @@ -238,18 +238,18 @@ const Ripples = (($) => { '-ms-transform': `scale(${size})`, '-moz-transform': `scale(${size})`, '-webkit-transform': `scale(${size})`, - 'transform': `scale(${size})` + transform: `scale(${size})` }) .addClass('ripple-on') .data('animating', 'on') .data('mousedown', 'on') } else { this.decoratorElement.animate({ - 'width': Math.max(this.element.outerWidth(), this.element.outerHeight()) * 2, - 'height': Math.max(this.element.outerWidth(), this.element.outerHeight()) * 2, + width: Math.max(this.element.outerWidth(), this.element.outerHeight()) * 2, + height: Math.max(this.element.outerWidth(), this.element.outerHeight()) * 2, 'margin-left': Math.max(this.element.outerWidth(), this.element.outerHeight()) * (-1), 'margin-top': Math.max(this.element.outerWidth(), this.element.outerHeight()) * (-1), - 'opacity': 0.2 + opacity: 0.2 }, this.config.duration, () => { this.decoratorElement.triggerStart('transitionend') }) diff --git a/package.json b/package.json index 43649060..22f32504 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "grunt-exec": "~0.4.6", "grunt-html": "~5.0.0", "grunt-jekyll": "~0.4.2", - "grunt-jscs": "~2.3.0", + "grunt-jscs": "~2.4.0", "grunt-line-remover": "0.0.2", "grunt-postcss": "^0.7.0", "grunt-sass": "^1.0.0",