diff --git a/README.md b/README.md index 9db948f..42167a6 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ [![npm](https://img.shields.io/npm/v/jquery.steps)](https://www.npmjs.com/package/jquery.steps) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) -[![npm](https://img.shields.io/npm/dw/jquery.steps)](https://www.npmjs.com/package/jquery.steps) +[![npm](https://img.shields.io/npm/dm/jquery.steps)](https://www.npmjs.com/package/jquery.steps) +[![npm](https://img.shields.io/jsdelivr/npm/hm/jquery.steps)](https://www.npmjs.com/package/jquery.steps) > A simple, lightweight jQuery step wizard plugin. @@ -25,8 +26,8 @@ git clone http://github.com/oguzhanoya/jquery-steps.git ``` CDN ```html - - + + ``` ## Setup @@ -63,7 +64,7 @@ Make necessary markup for wizard. That's all, you don't need to do anything else ``` Include plugin and dependeces. jQuery is the only dependency, make sure to include it. ```html - + ``` Init plugin with choosen options. diff --git a/dist/jquery-steps.js b/dist/jquery-steps.js index 91a1a9c..ba47edd 100644 --- a/dist/jquery-steps.js +++ b/dist/jquery-steps.js @@ -1,5 +1,5 @@ /*! - * Steps v1.1.1 + * Steps v1.1.2 * https://github.com/oguzhanoya/jquery-steps * * Copyright (c) 2021 oguzhanoya @@ -132,7 +132,7 @@ value: function getStepIndex() { var all = this.el.find(this.stepSelector); var stepIndex = all.index(all.filter(".".concat(this.options.activeClass.split(' ').join('.')))); - return stepIndex || 0; + return stepIndex; } }, { key: "getMaxStepIndex", @@ -303,7 +303,7 @@ return Steps; }(); - var version = "1.1.1"; + var version = "1.1.2"; var other = $__default['default'].fn.steps; diff --git a/dist/jquery-steps.js.map b/dist/jquery-steps.js.map index 38484de..b9e4905 100644 --- a/dist/jquery-steps.js.map +++ b/dist/jquery-steps.js.map @@ -1 +1 @@ -{"version":3,"file":"jquery-steps.js","sources":["../src/Defaults.js","../src/Steps.js","../src/Plugin.js"],"sourcesContent":["export default {\n startAt: 0,\n showBackButton: true,\n showFooterButtons: true,\n onInit: $.noop,\n onDestroy: $.noop,\n onFinish: $.noop,\n onChange() { return true; },\n stepSelector: '.step-steps',\n contentSelector: '.step-content',\n footerSelector: '.step-footer',\n activeClass: 'active',\n doneClass: 'done',\n errorClass: 'error',\n};\n","import $ from 'jquery';\nimport DEFAULTS from './Defaults';\n\nclass Steps {\n constructor(element, options) {\n // Extend defaults with the init options.\n this.options = $.extend({}, DEFAULTS, options);\n\n // Store main DOM element.\n this.el = $(element);\n\n this.stepSelector = `${this.options.stepSelector} [data-step-target]`;\n this.footerSelector = `${this.options.footerSelector} [data-step-action]`;\n this.contentSelector = `${this.options.contentSelector} [data-step]`;\n\n // Initialize\n this.init();\n }\n\n stepClick(e) {\n e.preventDefault();\n const { self } = e.data;\n const all = self.el.find(self.stepSelector);\n const next = $(this).closest('[data-step-target]');\n const nextStep = all.index(next);\n const stepIndex = e.data.self.getStepIndex();\n e.data.self.setActiveStep(stepIndex, nextStep);\n }\n\n btnClick(e) {\n e.preventDefault();\n const statusAction = $(this).data('step-action');\n e.data.self.setAction(statusAction);\n }\n\n init() {\n this.hook('onInit');\n const self = this;\n\n // step click event\n $(this.el).find(this.stepSelector).on('click', { self }, this.stepClick);\n\n // button click event\n $(this.el).find(this.footerSelector).on('click', { self }, this.btnClick);\n\n // set default step\n this.setActiveStep(0, this.options.startAt, true);\n\n this.setFooterBtns();\n\n // show footer buttons\n if (!this.options.showFooterButtons) {\n this.hideFooterBtns();\n this.setFooterBtns = $.noop;\n }\n }\n\n hook(hookName) {\n if (this.options[hookName] !== undefined) {\n this.options[hookName].call(this.el);\n }\n }\n\n destroy() {\n this.hook('onDestroy');\n $(this.el).find(this.stepSelector).off('click');\n $(this.el).find(this.footerSelector).off('click');\n this.el.removeData('plugin_Steps');\n this.el.remove();\n }\n\n getStepIndex() {\n const all = this.el.find(this.stepSelector);\n const stepIndex = all.index(all.filter(`.${this.options.activeClass.split(' ').join('.')}`));\n return stepIndex || 0;\n }\n\n getMaxStepIndex() {\n return this.el.find(this.stepSelector).length - 1;\n }\n\n getStepDirection(stepIndex, newIndex) {\n let direction = 'none';\n if (newIndex < stepIndex) {\n direction = 'backward';\n } else if (newIndex > stepIndex) {\n direction = 'forward';\n }\n return direction;\n }\n\n setShowStep(idx, removeClass, addClass = '') {\n const $targetStep = this.el.find(this.stepSelector).eq(idx);\n $targetStep.removeClass(removeClass).addClass(addClass);\n const $tabContent = this.el.find(this.contentSelector);\n $tabContent.removeClass(this.options.activeClass).eq(idx).addClass(this.options.activeClass);\n }\n\n setActiveStep(currentIndex, newIndex, init = false) {\n if (newIndex !== currentIndex || init) {\n const conditionDirection = (newIndex > currentIndex)\n ? (start) => start <= newIndex\n : (start) => start >= newIndex;\n\n const conditionIncrementOrDecrement = (newIndex > currentIndex)\n ? (start) => { let s = start; s += 1; return s; }\n : (start) => { let s = start; s -= 1; return s; };\n\n let i = currentIndex;\n while (conditionDirection(i)) {\n const stepDirection = this.getStepDirection(i, newIndex);\n if (i === newIndex) {\n this.setShowStep(i, this.options.doneClass, this.options.activeClass);\n } else {\n const checkDone = stepDirection === 'forward' && this.options.doneClass;\n this.setShowStep(i, `${this.options.activeClass} ${this.options.errorClass} ${this.options.doneClass}`, checkDone);\n }\n const validStep = this.options.onChange(i, newIndex, stepDirection);\n if (!validStep) {\n this.setShowStep(i, this.options.doneClass, `${this.options.activeClass} ${this.options.errorClass}`);\n i = newIndex;\n }\n i = conditionIncrementOrDecrement(i);\n }\n this.setFooterBtns();\n }\n }\n\n setFooterBtns() {\n const stepIndex = this.getStepIndex();\n const maxIndex = this.getMaxStepIndex();\n const $footer = this.el.find(this.options.footerSelector);\n\n if (stepIndex === 0) {\n $footer.find('[data-step-action=\"prev\"]').hide();\n }\n\n if (stepIndex > 0 && this.options.showBackButton) {\n $footer.find('[data-step-action=\"prev\"]').show();\n }\n\n if (maxIndex === stepIndex) {\n $footer.find('[data-step-action=\"prev\"]').show();\n $footer.find('[data-step-action=\"next\"]').hide();\n $footer.find('[data-step-action=\"finish\"]').show();\n } else {\n $footer.find('[data-step-action=\"next\"]').show();\n $footer.find('[data-step-action=\"finish\"]').hide();\n }\n\n if (!this.options.showBackButton) {\n $footer.find('[data-step-action=\"prev\"]').hide();\n }\n }\n\n setAction(action) {\n const stepIndex = this.getStepIndex();\n let nextStep = stepIndex;\n if (action === 'prev') { nextStep -= 1; }\n if (action === 'next') { nextStep += 1; }\n if (action === 'finish') {\n const validStep = this.options.onChange(stepIndex, nextStep, 'forward');\n if (validStep) {\n this.hook('onFinish');\n } else {\n this.setShowStep(stepIndex, '', this.options.errorClass);\n }\n } else {\n this.setActiveStep(stepIndex, nextStep);\n }\n }\n\n setStepIndex(idx) {\n const maxIndex = this.getMaxStepIndex();\n if (idx <= maxIndex) {\n const stepIndex = this.getStepIndex();\n this.setActiveStep(stepIndex, idx);\n }\n }\n\n next() {\n const stepIndex = this.getStepIndex();\n const maxIndex = this.getMaxStepIndex();\n return maxIndex === stepIndex ? this.setAction('finish') : this.setAction('next');\n }\n\n prev() {\n const stepIndex = this.getStepIndex();\n return stepIndex !== 0 && this.setAction('prev');\n }\n\n finish() {\n this.hook('onFinish');\n }\n\n hideFooterBtns() {\n this.el.find(this.options.footerSelector).hide();\n }\n\n static setDefaults(options) {\n $.extend(DEFAULTS, $.isPlainObject(options) && options);\n }\n}\n\nexport default Steps;\n","import $ from 'jquery';\nimport Steps from './Steps';\nimport { version } from '../package.json';\n\nconst other = $.fn.steps;\n\n$.fn.steps = function (options) {\n return this.each(function () {\n if (!$.data(this, 'plugin_Steps')) {\n $.data(this, 'plugin_Steps', new Steps(this, options));\n }\n });\n};\n\n$.fn.steps.version = version;\n$.fn.steps.setDefaults = Steps.setDefaults;\n\n// No conflict\n$.fn.steps.noConflict = function () {\n $.fn.steps = other;\n return this;\n};\n"],"names":["startAt","showBackButton","showFooterButtons","onInit","$","noop","onDestroy","onFinish","onChange","stepSelector","contentSelector","footerSelector","activeClass","doneClass","errorClass","Steps","element","options","extend","DEFAULTS","el","init","e","preventDefault","self","data","all","find","next","closest","nextStep","index","stepIndex","getStepIndex","setActiveStep","statusAction","setAction","hook","on","stepClick","btnClick","setFooterBtns","hideFooterBtns","hookName","undefined","call","off","removeData","remove","filter","split","join","length","newIndex","direction","idx","removeClass","addClass","$targetStep","eq","$tabContent","currentIndex","conditionDirection","start","conditionIncrementOrDecrement","s","i","stepDirection","getStepDirection","setShowStep","checkDone","validStep","maxIndex","getMaxStepIndex","$footer","hide","show","action","isPlainObject","other","fn","steps","each","version","setDefaults","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iBAAe;EACbA,EAAAA,OAAO,EAAE,CADI;EAEbC,EAAAA,cAAc,EAAE,IAFH;EAGbC,EAAAA,iBAAiB,EAAE,IAHN;EAIbC,EAAAA,MAAM,EAAEC,CAAC,CAACC,IAJG;EAKbC,EAAAA,SAAS,EAAEF,CAAC,CAACC,IALA;EAMbE,EAAAA,QAAQ,EAAEH,CAAC,CAACC,IANC;EAObG,EAAAA,QAPa,sBAOF;EAAE,WAAO,IAAP;EAAc,GAPd;EAQbC,EAAAA,YAAY,EAAE,aARD;EASbC,EAAAA,eAAe,EAAE,eATJ;EAUbC,EAAAA,cAAc,EAAE,cAVH;EAWbC,EAAAA,WAAW,EAAE,QAXA;EAYbC,EAAAA,SAAS,EAAE,MAZE;EAabC,EAAAA,UAAU,EAAE;EAbC,CAAf;;MCGMC;EACJ,iBAAYC,OAAZ,EAAqBC,OAArB,EAA8B;EAAA;;EAC5B;EACA,SAAKA,OAAL,GAAeb,qBAAC,CAACc,MAAF,CAAS,EAAT,EAAaC,QAAb,EAAuBF,OAAvB,CAAf,CAF4B;;EAK5B,SAAKG,EAAL,GAAUhB,qBAAC,CAACY,OAAD,CAAX;EAEA,SAAKP,YAAL,aAAuB,KAAKQ,OAAL,CAAaR,YAApC;EACA,SAAKE,cAAL,aAAyB,KAAKM,OAAL,CAAaN,cAAtC;EACA,SAAKD,eAAL,aAA0B,KAAKO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9B,SAAO,KAAKiE,IAAL,CAAU,YAAY;EAC3B,QAAI,CAAC9E,qBAAC,CAACqB,IAAF,CAAO,IAAP,EAAa,cAAb,CAAL,EAAmC;EACjCrB,MAAAA,qBAAC,CAACqB,IAAF,CAAO,IAAP,EAAa,cAAb,EAA6B,IAAIV,KAAJ,CAAU,IAAV,EAAgBE,OAAhB,CAA7B;EACD;EACF,GAJM,CAAP;EAKD,CAND;;AAQAb,uBAAC,CAAC4E,EAAF,CAAKC,KAAL,CAAWE,OAAX,GAAqBA,OAArB;AACA/E,uBAAC,CAAC4E,EAAF,CAAKC,KAAL,CAAWG,WAAX,GAAyBrE,KAAK,CAACqE,WAA/B;;AAGAhF,uBAAC,CAAC4E,EAAF,CAAKC,KAAL,CAAWI,UAAX,GAAwB,YAAY;EAClCjF,EAAAA,qBAAC,CAAC4E,EAAF,CAAKC,KAAL,GAAaF,KAAb;EACA,SAAO,IAAP;EACD,CAHD;;;;"} \ No newline at end of file +{"version":3,"file":"jquery-steps.js","sources":["../src/Defaults.js","../src/Steps.js","../src/Plugin.js"],"sourcesContent":["export default {\n startAt: 0,\n showBackButton: true,\n showFooterButtons: true,\n onInit: $.noop,\n onDestroy: $.noop,\n onFinish: $.noop,\n onChange() { return true; },\n stepSelector: '.step-steps',\n contentSelector: '.step-content',\n footerSelector: '.step-footer',\n activeClass: 'active',\n doneClass: 'done',\n errorClass: 'error',\n};\n","import $ from 'jquery';\nimport DEFAULTS from './Defaults';\n\nclass Steps {\n constructor(element, options) {\n // Extend defaults with the init options.\n this.options = $.extend({}, DEFAULTS, options);\n\n // Store main DOM element.\n this.el = $(element);\n\n this.stepSelector = `${this.options.stepSelector} [data-step-target]`;\n this.footerSelector = `${this.options.footerSelector} [data-step-action]`;\n this.contentSelector = `${this.options.contentSelector} [data-step]`;\n\n // Initialize\n this.init();\n }\n\n stepClick(e) {\n e.preventDefault();\n const { self } = e.data;\n const all = self.el.find(self.stepSelector);\n const next = $(this).closest('[data-step-target]');\n const nextStep = all.index(next);\n const stepIndex = e.data.self.getStepIndex();\n e.data.self.setActiveStep(stepIndex, nextStep);\n }\n\n btnClick(e) {\n e.preventDefault();\n const statusAction = $(this).data('step-action');\n e.data.self.setAction(statusAction);\n }\n\n init() {\n this.hook('onInit');\n const self = this;\n\n // step click event\n $(this.el).find(this.stepSelector).on('click', { self }, this.stepClick);\n\n // button click event\n $(this.el).find(this.footerSelector).on('click', { self }, this.btnClick);\n\n // set default step\n this.setActiveStep(0, this.options.startAt, true);\n\n this.setFooterBtns();\n\n // show footer buttons\n if (!this.options.showFooterButtons) {\n this.hideFooterBtns();\n this.setFooterBtns = $.noop;\n }\n }\n\n hook(hookName) {\n if (this.options[hookName] !== undefined) {\n this.options[hookName].call(this.el);\n }\n }\n\n destroy() {\n this.hook('onDestroy');\n $(this.el).find(this.stepSelector).off('click');\n $(this.el).find(this.footerSelector).off('click');\n this.el.removeData('plugin_Steps');\n this.el.remove();\n }\n\n getStepIndex() {\n const all = this.el.find(this.stepSelector);\n const stepIndex = all.index(all.filter(`.${this.options.activeClass.split(' ').join('.')}`));\n return stepIndex;\n }\n\n getMaxStepIndex() {\n return this.el.find(this.stepSelector).length - 1;\n }\n\n getStepDirection(stepIndex, newIndex) {\n let direction = 'none';\n if (newIndex < stepIndex) {\n direction = 'backward';\n } else if (newIndex > stepIndex) {\n direction = 'forward';\n }\n return direction;\n }\n\n setShowStep(idx, removeClass, addClass = '') {\n const $targetStep = this.el.find(this.stepSelector).eq(idx);\n $targetStep.removeClass(removeClass).addClass(addClass);\n const $tabContent = this.el.find(this.contentSelector);\n $tabContent.removeClass(this.options.activeClass).eq(idx).addClass(this.options.activeClass);\n }\n\n setActiveStep(currentIndex, newIndex, init = false) {\n if (newIndex !== currentIndex || init) {\n const conditionDirection = (newIndex > currentIndex)\n ? (start) => start <= newIndex\n : (start) => start >= newIndex;\n\n const conditionIncrementOrDecrement = (newIndex > currentIndex)\n ? (start) => { let s = start; s += 1; return s; }\n : (start) => { let s = start; s -= 1; return s; };\n\n let i = currentIndex;\n while (conditionDirection(i)) {\n const stepDirection = this.getStepDirection(i, newIndex);\n if (i === newIndex) {\n this.setShowStep(i, this.options.doneClass, this.options.activeClass);\n } else {\n const checkDone = stepDirection === 'forward' && this.options.doneClass;\n this.setShowStep(i, `${this.options.activeClass} ${this.options.errorClass} ${this.options.doneClass}`, checkDone);\n }\n const validStep = this.options.onChange(i, newIndex, stepDirection);\n if (!validStep) {\n this.setShowStep(i, this.options.doneClass, `${this.options.activeClass} ${this.options.errorClass}`);\n i = newIndex;\n }\n i = conditionIncrementOrDecrement(i);\n }\n this.setFooterBtns();\n }\n }\n\n setFooterBtns() {\n const stepIndex = this.getStepIndex();\n const maxIndex = this.getMaxStepIndex();\n const $footer = this.el.find(this.options.footerSelector);\n\n if (stepIndex === 0) {\n $footer.find('[data-step-action=\"prev\"]').hide();\n }\n\n if (stepIndex > 0 && this.options.showBackButton) {\n $footer.find('[data-step-action=\"prev\"]').show();\n }\n\n if (maxIndex === stepIndex) {\n $footer.find('[data-step-action=\"prev\"]').show();\n $footer.find('[data-step-action=\"next\"]').hide();\n $footer.find('[data-step-action=\"finish\"]').show();\n } else {\n $footer.find('[data-step-action=\"next\"]').show();\n $footer.find('[data-step-action=\"finish\"]').hide();\n }\n\n if (!this.options.showBackButton) {\n $footer.find('[data-step-action=\"prev\"]').hide();\n }\n }\n\n setAction(action) {\n const stepIndex = this.getStepIndex();\n let nextStep = stepIndex;\n if (action === 'prev') { nextStep -= 1; }\n if (action === 'next') { nextStep += 1; }\n if (action === 'finish') {\n const validStep = this.options.onChange(stepIndex, nextStep, 'forward');\n if (validStep) {\n this.hook('onFinish');\n } else {\n this.setShowStep(stepIndex, '', this.options.errorClass);\n }\n } else {\n this.setActiveStep(stepIndex, nextStep);\n }\n }\n\n setStepIndex(idx) {\n const maxIndex = this.getMaxStepIndex();\n if (idx <= maxIndex) {\n const stepIndex = this.getStepIndex();\n this.setActiveStep(stepIndex, idx);\n }\n }\n\n next() {\n const stepIndex = this.getStepIndex();\n const maxIndex = this.getMaxStepIndex();\n return maxIndex === stepIndex ? this.setAction('finish') : this.setAction('next');\n }\n\n prev() {\n const stepIndex = this.getStepIndex();\n return stepIndex !== 0 && this.setAction('prev');\n }\n\n finish() {\n this.hook('onFinish');\n }\n\n hideFooterBtns() {\n this.el.find(this.options.footerSelector).hide();\n }\n\n static setDefaults(options) {\n $.extend(DEFAULTS, $.isPlainObject(options) && options);\n }\n}\n\nexport default Steps;\n","import $ from 'jquery';\nimport Steps from './Steps';\nimport { version } from '../package.json';\n\nconst other = $.fn.steps;\n\n$.fn.steps = function (options) {\n return this.each(function () {\n if (!$.data(this, 'plugin_Steps')) {\n $.data(this, 'plugin_Steps', new Steps(this, options));\n }\n });\n};\n\n$.fn.steps.version = version;\n$.fn.steps.setDefaults = Steps.setDefaults;\n\n// No conflict\n$.fn.steps.noConflict = function () {\n $.fn.steps = other;\n return this;\n};\n"],"names":["startAt","showBackButton","showFooterButtons","onInit","$","noop","onDestroy","onFinish","onChange","stepSelector","contentSelector","footerSelector","activeClass","doneClass","errorClass","Steps","element","options","extend","DEFAULTS","el","init","e","preventDefault","self","data","all","find","next","closest","nextStep","index","stepIndex","getStepIndex","setActiveStep","statusAction","setAction","hook","on","stepClick","btnClick","setFooterBtns","hideFooterBtns","hookName","undefined","call","off","removeData","remove","filter","split","join","length","newIndex","direction","idx","removeClass","addClass","$targetStep","eq","$tabContent","currentIndex","conditionDirection","start","conditionIncrementOrDecrement","s","i","stepDirection","getStepDirection","setShowStep","checkDone","validStep","maxIndex","getMaxStepIndex","$footer","hide","show","action","isPlainObject","other","fn","steps","each","version","setDefaults","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iBAAe;EACbA,EAAAA,OAAO,EAAE,CADI;EAEbC,EAAAA,cAAc,EAAE,IAFH;EAGbC,EAAAA,iBAAiB,EAAE,IAHN;EAIbC,EAAAA,MAAM,EAAEC,CAAC,CAAC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AAF,CAAKC,KAAL,CAAWG,WAAX,GAAyBrE,KAAK,CAACqE,WAA/B;;AAGAhF,uBAAC,CAAC4E,EAAF,CAAKC,KAAL,CAAWI,UAAX,GAAwB,YAAY;EAClCjF,EAAAA,qBAAC,CAAC4E,EAAF,CAAKC,KAAL,GAAaF,KAAb;EACA,SAAO,IAAP;EACD,CAHD;;;;;;"} \ No newline at end of file diff --git a/dist/jquery-steps.min.js b/dist/jquery-steps.min.js index 323c23a..c1a43eb 100644 --- a/dist/jquery-steps.min.js +++ b/dist/jquery-steps.min.js @@ -1,8 +1,8 @@ /*! - * Steps v1.1.1 + * Steps v1.1.2 * https://github.com/oguzhanoya/jquery-steps * * Copyright (c) 2021 oguzhanoya * Released under the MIT license */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).$)}(this,function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=e(t);function i(t,e){for(var s=0;s - + + - + + + - - + + + + -