From db98fb6fd7a247a55278487b1f66081625858288 Mon Sep 17 00:00:00 2001 From: yama-dev Date: Fri, 29 Jan 2021 23:56:50 +0900 Subject: [PATCH 1/6] update version text --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 60c3def..da5b252 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "js-multi-data-module", - "version": "0.4.9", + "version": "0.4.11", "description": "Get multi data library.", "keywords": [ "multi-data", From 3eaea0e484a48fe9eaa3384c21c86542b5051ded Mon Sep 17 00:00:00 2001 From: yama-dev Date: Fri, 29 Jan 2021 23:57:10 +0900 Subject: [PATCH 2/6] adjust example html --- examples/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/index.html b/examples/index.html index a9d88f5..214c8ea 100644 --- a/examples/index.html +++ b/examples/index.html @@ -307,7 +307,7 @@

Advanced Use

data_type: this.inputDataType, order: this.inputOrder, orderProperty: this.inputOrderProperty, - filter: this.inputFilter, + filter: this.inputFilter == 'true' ? true : false, fetch_timeout: this.inputFetchTimeout, data_list: [ { From e557eb8183e0cc1c07a03196cc5d7263ba3a8d06 Mon Sep 17 00:00:00 2001 From: yama-dev Date: Sat, 30 Jan 2021 10:57:42 +0900 Subject: [PATCH 3/6] =?UTF-8?q?=E9=9A=8E=E5=B1=A4=E3=81=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=83=87=E3=83=BC=E3=82=BF=E5=BD=A2=E5=BC=8F=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js-multi-data-module.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/js-multi-data-module.js b/src/js-multi-data-module.js index 1b2ffa4..0abab7f 100644 --- a/src/js-multi-data-module.js +++ b/src/js-multi-data-module.js @@ -97,9 +97,11 @@ export default class MULTI_DATA_MODULE { let _data = data; // Select data hierarchy. - dataAry[count].hierarchy.split('.').map((item)=>{ - _data = _data[item]; - }); + if(dataAry[count].hierarchy){ + dataAry[count].hierarchy.split('.').map((item)=>{ + _data = _data[item]; + }); + } // Set function to format data. if(dataAry[count].customFunction){ @@ -192,9 +194,11 @@ export default class MULTI_DATA_MODULE { let _data = data; // Select data hierarchy. - dataAry[count].hierarchy.split('.').map((item)=>{ - _data = _data[item]; - }); + if(dataAry[count].hierarchy){ + dataAry[count].hierarchy.split('.').map((item)=>{ + _data = _data[item]; + }); + } // Set function to format data. if(dataAry[count].customFunction){ From 0819828526a6cca7f90d387ba7786a404c159c55 Mon Sep 17 00:00:00 2001 From: yama-dev Date: Sat, 30 Jan 2021 10:57:52 +0900 Subject: [PATCH 4/6] buiild --- dist/js-multi-data-module.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/js-multi-data-module.js b/dist/js-multi-data-module.js index da42671..04e1f38 100644 --- a/dist/js-multi-data-module.js +++ b/dist/js-multi-data-module.js @@ -1,16 +1,16 @@ /*! * JS MULTI_DATA_MODULE (JavaScript Library) * js-multi-data-module - * Version 0.4.9 + * Version 0.4.11 * Repository https://github.com/yama-dev/js-multi-data-module * Copyright yama-dev * Licensed MIT */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.MULTI_DATA_MODULE=e():t.MULTI_DATA_MODULE=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){(function(e,n){ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.MULTI_DATA_MODULE=e():t.MULTI_DATA_MODULE=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){(function(e,n){ /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE - * @version v4.2.5+7f2b526d - */var r;r=function(){"use strict";function t(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=0,i=void 0,a=void 0,c=function(t,e){d[o]=t,d[o+1]=e,2===(o+=2)&&(a?a(y):b())},s="undefined"!=typeof window?window:void 0,u=s||{},l=u.MutationObserver||u.WebKitMutationObserver,f="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(y,1)}}var d=new Array(1e3);function y(){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);if(!e.data_list||!Array.isArray(e.data_list)){try{throw new Error('Not config "data_list"')}catch(t){console.log(t.name+": "+t.message)}return!1}this.Config=i({data_type:"jsonp",data_list:null,order:"up",orderProperty:"date",filter:!1,empty:!1,jsonpCallback:"callback",fetch_timeout:1e4},e),this.Version="0.4.9",this.DataFix=[],this.DataList={},e.on||(e.on={}),this.On={Update:e.on.Update||"",Complete:e.on.Complete||""},"jsonp"===this.Config.data_type&&this.GetDataJsonp(this.Config.data_list),"json"===this.Config.data_type&&this.GetDataJson(this.Config.data_list),"html"!==this.Config.data_type&&"xml"!==this.Config.data_type||this.GetDataDocument(this.Config.data_list)}var e,n,r;return e=t,(n=[{key:"GetDataJsonp",value:function(t){var e=this,n=0,r=t.length,i=(new Date).getTime();!function a(){new o.a(function(r,o){if(t[n].url){var a=document.createElement("script");t[n].url.match(/\?.*$/)?a.src="".concat(t[n].url,"&callback=").concat(e.Config.jsonpCallback,"&_=").concat(i+n):a.src="".concat(t[n].url,"?callback=").concat(e.Config.jsonpCallback,"&_=").concat(i+n),document.body.appendChild(a),window.callback=function(t){r(t)},setTimeout(function(){o("error")},e.Config.fetch_timeout)}else o("error:not found data.")}).then(function(o){var i=o;t[n].hierarchy.split(".").map(function(t){i=i[t]}),t[n].customFunction&&(i=e.CreateData(i,null,t[n].customFunction)),i?(e.DataFix=e.DataFix.concat(i),e.DataList[n]=i):e.Config.empty&&(e.DataFix=e.DataFix.concat([""]),e.DataList[n]=[]),e.OnUpdate(e.DataList[n],n),++nn?1:0:-1:1}),"down"===this.Config.order&&this.DataFix.sort(function(e,n){return e[t.Config.orderProperty]?n[t.Config.orderProperty]?(e=new Date(e[t.Config.orderProperty].replace(/\./g,"/")))<(n=new Date(n[t.Config.orderProperty].replace(/\./g,"/")))?1:e>n?-1:0:-1:1}),this.OnComplete()}},{key:"OnUpdate",value:function(t,e){this.On.Update&&"function"==typeof this.On.Update&&this.On.Update(t,e)}},{key:"OnComplete",value:function(){this.On.Complete&&"function"==typeof this.On.Complete&&this.On.Complete(this.DataFix,this.DataList)}}])&&a(e.prototype,n),r&&a(e,r),t}()},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,u=[],l=!1,f=-1;function h(){l&&s&&(l=!1,s.length?u=s.concat(u):f=-1,u.length&&p())}function p(){if(!l){var t=c(h);l=!0;for(var e=u.length;e;){for(s=u,u=[];++f1)for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{};a(this,t);var n={data_type:"jsonp",data_list:null,order:"up",orderProperty:"date",filter:!1,empty:!1,jsonpCallback:"callback",fetch_timeout:1e4};if(!e.data_list||!Array.isArray(e.data_list)){try{throw new Error('Not config "data_list"')}catch(t){console.log(t.name+": "+t.message)}return!1}this.Config=i(n,e),this.Version="0.4.11",this.DataFix=[],this.DataList={},e.on||(e.on={}),this.On={Update:e.on.Update||"",Complete:e.on.Complete||""},"jsonp"===this.Config.data_type&&this.GetDataJsonp(this.Config.data_list),"json"===this.Config.data_type&&this.GetDataJson(this.Config.data_list),"html"!==this.Config.data_type&&"xml"!==this.Config.data_type||this.GetDataDocument(this.Config.data_list)}var e,n,r;return e=t,(n=[{key:"GetDataJsonp",value:function(t){var e=this,n=0,r=t.length,i=(new Date).getTime();!function a(){new o.a((function(r,o){if(t[n].url){var a=document.createElement("script");t[n].url.match(/\?.*$/)?a.src="".concat(t[n].url,"&callback=").concat(e.Config.jsonpCallback,"&_=").concat(i+n):a.src="".concat(t[n].url,"?callback=").concat(e.Config.jsonpCallback,"&_=").concat(i+n),document.body.appendChild(a),window.callback=function(t){r(t)},setTimeout((function(){o("error")}),e.Config.fetch_timeout)}else o("error:not found data.")})).then((function(o){var i=o;t[n].hierarchy&&t[n].hierarchy.split(".").map((function(t){i=i[t]})),t[n].customFunction&&(i=e.CreateData(i,null,t[n].customFunction)),i?(e.DataFix=e.DataFix.concat(i),e.DataList[n]=i):e.Config.empty&&(e.DataFix=e.DataFix.concat([""]),e.DataList[n]=[]),e.OnUpdate(e.DataList[n],n),++nn?1:0:-1:1})),"down"===this.Config.order&&this.DataFix.sort((function(e,n){return e[t.Config.orderProperty]?n[t.Config.orderProperty]?(e=new Date(e[t.Config.orderProperty].replace(/\./g,"/")))<(n=new Date(n[t.Config.orderProperty].replace(/\./g,"/")))?1:e>n?-1:0:-1:1})),this.OnComplete()}},{key:"OnUpdate",value:function(t,e){this.On.Update&&"function"==typeof this.On.Update&&this.On.Update(t,e)}},{key:"OnComplete",value:function(){this.On.Complete&&"function"==typeof this.On.Complete&&this.On.Complete(this.DataFix,this.DataList)}}])&&c(e.prototype,n),r&&c(e,r),t}()},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,u=[],l=!1,f=-1;function h(){l&&s&&(l=!1,s.length?u=s.concat(u):f=-1,u.length&&p())}function p(){if(!l){var t=c(h);l=!0;for(var e=u.length;e;){for(s=u,u=[];++f1)for(var n=1;n Date: Sun, 31 Jan 2021 11:01:36 +0900 Subject: [PATCH 5/6] adjust CDN version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11b22db..2bbc686 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Get multi data library. - npm -> [https://www.npmjs.com/package/js-multi-data-module](https://www.npmjs.com/package/js-multi-data-module) -- Standalone(CDN) -> [https://cdn.jsdelivr.net/gh/yama-dev/js-multi-data-module@v0.4.9/dist/js-multi-data-module.js](https://cdn.jsdelivr.net/gh/yama-dev/js-multi-data-module@v0.4.9/dist/js-multi-data-module.js) +- Standalone(CDN) -> [https://cdn.jsdelivr.net/gh/yama-dev/js-multi-data-module@v0.4.11/dist/js-multi-data-module.js](https://cdn.jsdelivr.net/gh/yama-dev/js-multi-data-module@v0.4.11/dist/js-multi-data-module.js) - Zip -> [yama-dev/js-multi-data-module](https://github.com/yama-dev/js-multi-data-module/releases/latest) From 7a064bc9d90e6f6a48b80e44ef3d5bd93a8cf6f9 Mon Sep 17 00:00:00 2001 From: yama-dev Date: Sun, 31 Jan 2021 11:01:48 +0900 Subject: [PATCH 6/6] adjust readme --- README.md | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/README.md b/README.md index 2bbc686..69d7e83 100644 --- a/README.md +++ b/README.md @@ -115,44 +115,6 @@ none


-___ - -**For Developer** - -## Contribution - -1. Fork it ( https://github.com/yama-dev/js-multi-data-module/fork ) -2. Create your feature branch (git checkout -b my-new-feature) -3. Commit your changes (git commit -am 'Add some feature') -4. Push to the branch (git push origin my-new-feature) -5. Create new Pull Request - -
- -## Develop - -### at Development - -Install node modules. - -``` bash -$ npm install -``` - -Run npm script 'develop' - -``` bash -$ npm run develop -``` - -Run npm script 'production' - -``` bash -$ npm run production -``` - -
- ## Licence [MIT](https://github.com/yama-dev/js-multi-data-module/blob/master/LICENSE)