From 9040e538141d41e9cc22b0d810eae0bca82cf484 Mon Sep 17 00:00:00 2001 From: Karen Date: Thu, 25 May 2017 16:51:19 +0600 Subject: [PATCH] isSkip method in the step --- classes/Step.js | 3 +++ classes/StepSystem.js | 21 ++++++++++++--------- example/app.js | 3 +++ example/dist/app.js | 28 ++++++++++++++++++---------- example/dist/app.js.map | 2 +- 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/classes/Step.js b/classes/Step.js index e272945..a7055f2 100644 --- a/classes/Step.js +++ b/classes/Step.js @@ -12,6 +12,9 @@ export class Step { this._data = params.data || {} params.interceptors = params.interceptors || {} this.interceptors = { + isSkip: params.interceptors.isSkip || this.methods.isSkip || function () { + return false + }, beforeRender: params.interceptors.beforeRender || this.methods.beforeRender || function () { return {status: true} }, diff --git a/classes/StepSystem.js b/classes/StepSystem.js index 30d639a..52c094e 100644 --- a/classes/StepSystem.js +++ b/classes/StepSystem.js @@ -1,6 +1,6 @@ /** - * StepSystem v1.0.0 - * Last update: 19.05.2017 + * StepSystem v1.0.1 + * Last update: 25.05.2017 * * Dependencies: jQuery * @@ -89,12 +89,6 @@ export class StepSystem { this.onProgress(this.progress) } - finish () { - if (this.onFinish) { - this.onFinish() - } - } - goNextTimeout (timeout = 300) { const $this = this clearTimeout(this._next_timeout) @@ -114,8 +108,11 @@ export class StepSystem { if (next_step) { this.goToStep(this.step(next_step), { from: curr_step.name }) } else { - this.finish() + if (this.onFinish) { + this.onFinish() + } } + return this } goBack () { @@ -132,9 +129,14 @@ export class StepSystem { } this.goToStep(this.step(prev_step), { is_back: true }) } + return this } goToStep (step, params = {}) { + let is_skip = step.interceptors.isSkip(step) + if (is_skip) { + step = this.step(step.next) + } let from = params.from || null let is_back = params.is_back || false if (from) { @@ -146,6 +148,7 @@ export class StepSystem { this.steps_past.push(step.name) } this.updateProgress() + return this } collectData () { diff --git a/example/app.js b/example/app.js index a6698a6..2d80f5a 100644 --- a/example/app.js +++ b/example/app.js @@ -48,6 +48,9 @@ window.app = new StepSystem({ name: 'second-step', next: 'third-step', methods: { + isSkip: (step) => { + return app.step('first-step').data.lol == 'lol' + }, beforeRender: (step) => { console.log('second-step beforeRender') return { status: true } diff --git a/example/dist/app.js b/example/dist/app.js index ea67c3b..65893f6 100644 --- a/example/dist/app.js +++ b/example/dist/app.js @@ -25,6 +25,9 @@ var Step = exports.Step = function () { this._data = params.data || {}; params.interceptors = params.interceptors || {}; this.interceptors = { + isSkip: params.interceptors.isSkip || this.methods.isSkip || function () { + return false; + }, beforeRender: params.interceptors.beforeRender || this.methods.beforeRender || function () { return { status: true }; }, @@ -77,8 +80,8 @@ var _createClass = function () { function defineProperties(target, props) { for function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** - * StepSystem v1.0.0 - * Last update: 19.05.2017 + * StepSystem v1.0.1 + * Last update: 25.05.2017 * * Dependencies: jQuery * @@ -160,13 +163,6 @@ var StepSystem = exports.StepSystem = function () { this.progress = this.steps_past.length * 100 / (this.steps_past.length + future_steps); this.onProgress(this.progress); } - }, { - key: 'finish', - value: function finish() { - if (this.onFinish) { - this.onFinish(); - } - } }, { key: 'goNextTimeout', value: function goNextTimeout() { @@ -191,8 +187,11 @@ var StepSystem = exports.StepSystem = function () { if (next_step) { this.goToStep(this.step(next_step), { from: curr_step.name }); } else { - this.finish(); + if (this.onFinish) { + this.onFinish(); + } } + return this; } }, { key: 'goBack', @@ -210,12 +209,17 @@ var StepSystem = exports.StepSystem = function () { } this.goToStep(this.step(prev_step), { is_back: true }); } + return this; } }, { key: 'goToStep', value: function goToStep(step) { var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var is_skip = step.interceptors.isSkip(step); + if (is_skip) { + step = this.step(step.next); + } var from = params.from || null; var is_back = params.is_back || false; if (from) { @@ -227,6 +231,7 @@ var StepSystem = exports.StepSystem = function () { this.steps_past.push(step.name); } this.updateProgress(); + return this; } }, { key: 'collectData', @@ -326,6 +331,9 @@ window.app = new _StepSystem.StepSystem({ name: 'second-step', next: 'third-step', methods: { + isSkip: function isSkip(step) { + return app.step('first-step').data.lol == 'lol'; + }, beforeRender: function beforeRender(step) { console.log('second-step beforeRender'); return { status: true }; diff --git a/example/dist/app.js.map b/example/dist/app.js.map index 3a8dccd..1afd20f 100644 --- a/example/dist/app.js.map +++ b/example/dist/app.js.map @@ -1 +1 @@ -{"version":3,"sources":["node_modules/browserify/node_modules/browser-pack/_prelude.js","classes/Step.js","classes/StepSystem.js","example/app.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;ICAa,I,WAAA,I;AACX,gBAAa,MAAb,EAAqB;AAAA;;AACnB,SAAK,MAAL,GAAc,OAAO,MAAP,IAAiB,IAA/B;AACA,SAAK,IAAL,GAAY,OAAO,IAAnB;AACA,SAAK,IAAL,GAAY,OAAO,IAAnB;AACA,SAAK,OAAL,GAAe,OAAO,OAAP,IAAkB,EAAjC;AACA,SAAK,QAAL,GAAgB,OAAO,QAAP,IAAmB,EAAnC;AACA,SAAK,eAAL,GAAuB,OAAO,eAAP,IAA0B,KAAjD;AACA,SAAK,aAAL,GAAqB,OAAO,aAAP,IAAwB,KAA7C;AACA,SAAK,IAAL,GAAY,IAAZ;AACA,SAAK,QAAL,GAAgB,OAAO,QAAP,IAAmB,KAAnC;AACA,SAAK,KAAL,GAAa,OAAO,IAAP,IAAe,EAA5B;AACA,WAAO,YAAP,GAAsB,OAAO,YAAP,IAAuB,EAA7C;AACA,SAAK,YAAL,GAAoB;AAClB,oBAAc,OAAO,YAAP,CAAoB,YAApB,IAAoC,KAAK,OAAL,CAAa,YAAjD,IAAiE,YAAY;AACzF,eAAO,EAAC,QAAQ,IAAT,EAAP;AACD,OAHiB;AAIlB,kBAAY,OAAO,YAAP,CAAoB,UAApB,IAAkC,KAAK,OAAL,CAAa,UAA/C,IAA6D,YAAY;AACnF,eAAO,EAAC,QAAQ,IAAT,EAAP;AACD,OANiB;AAOlB,kBAAY,OAAO,YAAP,CAAoB,UA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esContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o {\n console.log('handlers init')\n\n })\n \n /**\n * FIRST STEP\n */\n .addStep(new Step({\n name: 'first-step',\n next: 'second-step',\n methods: {\n beforeRender: (step) => {\n console.log('first-step beforeRender')\n return { status: true }\n },\n beforeNext: (step) => {\n console.log('first-step beforeNext', this)\n step.data.lol = 'lol'\n return { status: true }\n },\n onRender: (step) => {\n app.container.find('.step').css({'color': 'green'})\n }\n }\n }))\n\n /**\n * SECOND STEP\n */\n .addStep(new Step({\n name: 'second-step',\n next: 'third-step',\n methods: {\n beforeRender: (step) => {\n console.log('second-step beforeRender')\n return { status: true }\n },\n beforeNext: (step) => {\n console.log('second-step beforeNext')\n step.data.azaza = 'azaza'\n return { status: true }\n },\n onRender: (step) => {\n app.container.find('.step').css({'color': 'red'})\n }\n }\n }))\n\n /**\n * THIRD STEP\n */\n .addStep(new Step({\n name: 'third-step',\n methods: {\n beforeRender: (step) => {\n console.log('third-step beforeRender')\n return { status: true }\n },\n beforeNext: (step) => {\n console.log('third-step beforeNext')\n step.data.kek = 'kek'\n return { status: true }\n },\n onRender: (step) => {\n app.container.find('.step').css({'color': 'blue'})\n }\n }\n }))\n\n /**\n * FINISH\n */\n .addStep(new Step({\n name: 'finish',\n hide_progress: true,\n ignore_progress: true,\n methods: {\n beforeRender: (step) => {\n console.log('finish beforeRender')\n return { status: true }\n },\n beforeNext: (step) => {\n console.log('finish beforeNext')\n step.data.kek = 'kek'\n return { status: true }\n },\n onRender: (step) => { }\n }\n }))\n\n /**\n * GLOBAL\n */\n\n app.onFinish = () => {\n app.goToStep(app.step('finish'))\n console.log(app.collectData())\n }\n\n app.onProgress = (progress) => {\n app.container.find('.progress').html(Math.floor(progress) + '%')\n }\n\n app.onStepRender = (step) => {\n app.container.find('.step .next').click(function () {\n app.goNext()\n })\n app.container.find('.step .back').click(function () {\n app.goBack()\n })\n\n console.log(step)\n\n if (step.hide_progress) {\n app.container.find('.progress').hide()\n } else {\n app.container.find('.progress').show()\n }\n }\n\n app.init(first_step)\n\n})(window.app)\n"],"preExistingComment":"//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJjbGFzc2VzL1N0ZXAuanMiLCJjbGFzc2VzL1N0ZXBTeXN0ZW0uanMiLCJleGFtcGxlL2FwcC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7SUNBYSxJLFdBQUEsSTtBQUNYLGdCQUFhLE1BQWIsRUFBcUI7QUFBQTs7QUFDbkIsU0FBSyxNQUFMLEdBQWMsT0FBTyxNQUFQLElBQWlCLElBQS9CO0FBQ0EsU0FBSyxJQUFMLEdBQVksT0FBTyxJQUFuQjtBQUNBLFNBQUssSUFBTCxHQUFZLE9BQU8sSUFBbkI7QUFDQSxTQUFLLE9BQUwsR0FBZSxPQUFPLE9BQVAsSUFBa0IsRUFBakM7QUFDQSxTQUFLLFFBQUwsR0FBZ0IsT0FBTyxRQUFQLElBQW1CLEVBQW5DO0FBQ0EsU0FBSyxlQUFMLEdBQXVCLE9BQU8sZUFBUCxJQUEwQixLQUFqRDtBQUNBLFNBQUssYUFBTCxHQUFxQixPQUFPLGFBQVAsSUFBd0IsS0FBN0M7QUFDQSxTQUFLLElBQUwsR0FBWSxJQUFaO0FBQ0EsU0FBSyxRQUFMLEdBQWdCLE9BQU8sUUFBUCxJQUFtQ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pXG4gICAgfVxuICB9XG5cbiAgYXBwLmluaXQoZmlyc3Rfc3RlcClcblxufSkod2luZG93LmFwcClcbiJdfQ=="} \ No newline at end of file +{"version":3,"sources":["node_modules/browserify/node_modules/browser-pack/_prelude.js","classes/Step.js","classes/StepSystem.js","example/app.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;ICAa,I,WAAA,I;AACX,gBAAa,MAAb,EAAqB;AAAA;;AACnB,SAAK,MAAL,GAAc,OAAO,MAAP,IAAiB,IAA/B;AACA,SAAK,IAAL,GAAY,OAAO,IAAnB;AACA,SAAK,IAAL,GAAY,OAAO,IAAnB;AACA,SAAK,OAAL,GAAe,OAAO,OAAP,IAAkB,EAAjC;AACA,SAAK,QAAL,GAAgB,OAAO,QAAP,IAAmB,EAAnC;AACA,SAAK,eAAL,GAAuB,OAAO,eAAP,IAA0B,KAAjD;AACA,SAAK,aAAL,GAAqB,OAAO,aAAP,IAAwB,KAA7C;AACA,SAAK,IAAL,GAAY,IAAZ;AACA,SAAK,QAAL,GAAgB,OAAO,QAAP,IAAmB,KAAnC;AACA,SAAK,KAAL,GAAa,OAAO,IAAP,IAAe,EAA5B;AACA,WAAO,YAAP,GAAsB,OAAO,YAAP,IAAuB,EAA7C;AACA,SAAK,YAAL,GAAoB;AAClB,cAAQ,OAAO,YAAP,CAAoB,MAApB,IAA8B,KAAK,OAAL,CAAa,MAA3C,IAAqD,YAAY;AACvE,eAAO,KAAP;AACD,OAHiB;AAIlB,oBAAc,OAAO,YAAP,CAAoB,YAApB,IAAoC,KAAK,OAAL,CAAa,YAAjD,IAAiE,YAAY;AACzF,eAAO,EAAC,QAAQ,IAAT,EAAP;AACD,OANiB;AAOlB,kBAAY,OAAO,YAAP,CAAoB,UAApB,IAAkC,KAAK,OAAL,CAAa,UAA/C,IAA6D,YAAY;AACnF,eAAO,EAAC,QAAQ,IAAT,EAAP;AACD,OATiB;AAUlB,kBAAY,OAAO,YAAP,CAAoB,UAApB,IAAkC,KAAK,OAAL,C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;;AAEA,QAAI,KAAK,aAAT,EAAwB;AACtB,UAAI,SAAJ,CAAc,IAAd,CAAmB,WAAnB,EAAgC,IAAhC;AACD,KAFD,MAEO;AACL,UAAI,SAAJ,CAAc,IAAd,CAAmB,WAAnB,EAAgC,IAAhC;AACD;AACF,GAfD;;AAiBA,MAAI,IAAJ,CAAS,UAAT;AAED,CAtID,EAsIG,OAAO,GAtIV","file":"app.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o {\n console.log('handlers init')\n\n })\n \n /**\n * FIRST STEP\n */\n .addStep(new Step({\n name: 'first-step',\n next: 'second-step',\n methods: {\n beforeRender: (step) => {\n console.log('first-step beforeRender')\n return { status: true }\n },\n beforeNext: (step) => {\n console.log('first-step beforeNext', this)\n step.data.lol = 'lol'\n return { status: true }\n },\n onRender: (step) => {\n app.container.find('.step').css({'color': 'green'})\n }\n }\n }))\n\n /**\n * SECOND STEP\n */\n .addStep(new Step({\n name: 'second-step',\n next: 'third-step',\n methods: {\n isSkip: (step) => {\n return app.step('first-step').data.lol == 'lol'\n },\n beforeRender: (step) => {\n console.log('second-step beforeRender')\n return { status: true }\n },\n beforeNext: (step) => {\n console.log('second-step beforeNext')\n step.data.azaza = 'azaza'\n return { status: true }\n },\n onRender: (step) => {\n app.container.find('.step').css({'color': 'red'})\n }\n }\n }))\n\n /**\n * THIRD STEP\n */\n .addStep(new Step({\n name: 'third-step',\n methods: {\n beforeRender: (step) => {\n console.log('third-step beforeRender')\n return { status: true }\n },\n beforeNext: (step) => {\n console.log('third-step beforeNext')\n step.data.kek = 'kek'\n return { status: true }\n },\n onRender: (step) => {\n app.container.find('.step').css({'color': 'blue'})\n }\n }\n }))\n\n /**\n * FINISH\n */\n .addStep(new Step({\n name: 'finish',\n hide_progress: true,\n ignore_progress: true,\n methods: {\n beforeRender: (step) => {\n console.log('finish beforeRender')\n return { status: true }\n },\n beforeNext: (step) => {\n console.log('finish beforeNext')\n step.data.kek = 'kek'\n return { status: true }\n },\n onRender: (step) => { }\n }\n }))\n\n /**\n * GLOBAL\n */\n\n app.onFinish = () => {\n app.goToStep(app.step('finish'))\n console.log(app.collectData())\n }\n\n app.onProgress = (progress) => {\n app.container.find('.progress').html(Math.floor(progress) + '%')\n }\n\n app.onStepRender = (step) => {\n app.container.find('.step .next').click(function () {\n app.goNext()\n })\n app.container.find('.step .back').click(function () {\n app.goBack()\n })\n\n console.log(step)\n\n if (step.hide_progress) {\n app.container.find('.progress').hide()\n } else {\n app.container.find('.progress').show()\n }\n }\n\n app.init(first_step)\n\n})(window.app)\n"],"preExistingComment":"//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJjbGFzc2VzL1N0ZXAuanMiLCJjbGFzc2VzL1N0ZXBTeXN0ZW0uanMiLCJleGFtcGxlL2FwcC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7SUNBYSxJLFdBQUEsSTtBQUNYLGdCQUFhLE1BQWIsRUFBcUI7QUFBQTs7QUFDbkIsU0FBSyxNQUFMLEdBQWMsT0FBTyxNQUFQLElBQWlCLElBQS9CO0FBQ0EsU0FBSyxJQUFMLEdBQVksT0FBTyxJQUFuQjtBQUNBLFNBQUssSUFBTCxHQUFZLE9BQU8sSUFBbkI7QUFDQSxTQUFLLE9BQUwsR0FBZSxPQUFPLE9BQVAsSUFBa0IsRUF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