2021-08-13 20:00:03 +02:00
|
|
|
/******/ (() => { // webpackBootstrap
|
|
|
|
/******/ var __webpack_modules__ = ({
|
|
|
|
|
|
|
|
/***/ "./node_modules/papaparse/papaparse.min.js":
|
|
|
|
/*!*************************************************!*\
|
|
|
|
!*** ./node_modules/papaparse/papaparse.min.js ***!
|
|
|
|
\*************************************************/
|
|
|
|
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* @license
|
|
|
|
Papa Parse
|
|
|
|
v5.3.1
|
|
|
|
https://github.com/mholt/PapaParse
|
|
|
|
License: MIT
|
|
|
|
*/
|
|
|
|
!function(e,t){ true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (t),
|
|
|
|
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
|
|
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
|
|
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):0}(this,function s(){"use strict";var f="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==f?f:{};var n=!f.document&&!!f.postMessage,o=n&&/blob:/i.test((f.location||{}).protocol),a={},h=0,b={parse:function(e,t){var i=(t=t||{}).dynamicTyping||!1;M(i)&&(t.dynamicTypingFunction=i,i={});if(t.dynamicTyping=i,t.transform=!!M(t.transform)&&t.transform,t.worker&&b.WORKERS_SUPPORTED){var r=function(){if(!b.WORKERS_SUPPORTED)return!1;var e=(i=f.URL||f.webkitURL||null,r=s.toString(),b.BLOB_URL||(b.BLOB_URL=i.createObjectURL(new Blob(["(",r,")();"],{type:"text/javascript"})))),t=new f.Worker(e);var i,r;return t.onmessage=_,t.id=h++,a[t.id]=t}();return r.userStep=t.step,r.userChunk=t.chunk,r.userComplete=t.complete,r.userError=t.error,t.step=M(t.step),t.chunk=M(t.chunk),t.complete=M(t.complete),t.error=M(t.error),delete t.worker,void r.postMessage({input:e,config:t,workerId:r.id})}var n=null;b.NODE_STREAM_INPUT,"string"==typeof e?n=t.download?new l(t):new p(t):!0===e.readable&&M(e.read)&&M(e.on)?n=new g(t):(f.File&&e instanceof File||e instanceof Object)&&(n=new c(t));return n.stream(e)},unparse:function(e,t){var n=!1,_=!0,m=",",y="\r\n",s='"',a=s+s,i=!1,r=null,o=!1;!function(){if("object"!=typeof t)return;"string"!=typeof t.delimiter||b.BAD_DELIMITERS.filter(function(e){return-1!==t.delimiter.indexOf(e)}).length||(m=t.delimiter);("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes);"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(i=t.skipEmptyLines);"string"==typeof t.newline&&(y=t.newline);"string"==typeof t.quoteChar&&(s=t.quoteChar);"boolean"==typeof t.header&&(_=t.header);if(Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");r=t.columns}void 0!==t.escapeChar&&(a=t.escapeChar+s);"boolean"==typeof t.escapeFormulae&&(o=t.escapeFormulae)}();var h=new RegExp(j(s),"g");"string"==typeof e&&(e=JSON.parse(e));if(Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return u(null,e,i);if("object"==typeof e[0])return u(r||Object.keys(e[0]),e,i)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),u(e.fields||[],e.data||[],i);throw new Error("Unable to serialize unrecognized input");function u(e,t,i){var r="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var n=Array.isArray(e)&&0<e.length,s=!Array.isArray(t[0]);if(n&&_){for(var a=0;a<e.length;a++)0<a&&(r+=m),r+=v(e[a],a);0<t.length&&(r+=y)}for(var o=0;o<t.length;o++){var h=n?e.length:t[o].length,u=!1,f=n?0===Object.keys(t[o]).length:0===t[o].length;if(i&&!n&&(u="greedy"===i?""===t[o].join("").trim():1===t[o].length&&0===t[o][0].length),"greedy"===i&&n){for(var d=[],l=0;l<h;l++){var c=s?e[l]:l;d.push(t[o][c])}u=""===d.join("").trim()}if(!u){for(var p=0;p<h;p++){0<p&&!f&&(r+=m);var g=n&&s?e[p]:p;r+=v(t[o][g],p)}o<t.length-1&&(!i||0<h&&!f)&&(r+=y)}}return r}function v(e,t){if(null==e)return"";if(e.constructor===Date)return JSON.stringify(e).slice(1,25);!0===o&&"string"==typeof e&&null!==e.match(/^[=+\-@].*$/)&&(e="'"+e);var i=e.toString().replace(h,a),r="boolean"==typeof n&&n||"function"==typeof n&&n(e,t)||Array.isArray(n)&&n[t]||function(e,t){for(var i=0;i<t.length;i++)if(-1<e.indexOf(t[i]))return!0;return!1}(i,b.BAD_DELIMITERS)||-1<i.indexOf(m)||" "===i.charAt(0)||" "===i.charAt(i.length-1);return r?s+i+s:i}}};if(b.RECORD_SEP=String.fromCharCode(30),b.UNIT_SEP=String.fromCharCode(31),b.BYTE_ORDER_MARK="\ufeff",b.BAD_DELIMITERS=["\r","\n",'"',b.BYTE_ORDER_MARK],b.WORKERS_SUPPORTED=!n&&!!f.Worker,b.NODE_STREAM_INPUT=1,b.LocalChunkSize=10485760,b.RemoteChunkSize=5242880,b.DefaultDelimiter=",",b.Parser=E,b.ParserHandle=i,b.NetworkStreamer=l,b.FileStreamer=c,b.StringS
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
2021-08-30 18:10:21 +02:00
|
|
|
/***/ "./src/freeDatas2HTML.ts":
|
|
|
|
/*!*******************************!*\
|
|
|
|
!*** ./src/freeDatas2HTML.ts ***!
|
|
|
|
\*******************************/
|
2021-08-13 20:00:03 +02:00
|
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
2021-08-30 18:10:21 +02:00
|
|
|
/* harmony export */ "freeDatas2HTML": () => (/* binding */ freeDatas2HTML)
|
2021-08-13 20:00:03 +02:00
|
|
|
/* harmony export */ });
|
|
|
|
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
|
});
|
|
|
|
};
|
|
|
|
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
|
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
|
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
|
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
|
|
function step(op) {
|
|
|
|
if (f) throw new TypeError("Generator is already executing.");
|
|
|
|
while (_) try {
|
|
|
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
|
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
|
|
switch (op[0]) {
|
|
|
|
case 0: case 1: t = op; break;
|
|
|
|
case 4: _.label++; return { value: op[1], done: false };
|
|
|
|
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
|
|
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
|
|
default:
|
|
|
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
|
|
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
|
|
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
|
|
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
|
|
if (t[2]) _.ops.pop();
|
|
|
|
_.trys.pop(); continue;
|
|
|
|
}
|
|
|
|
op = body.call(thisArg, _);
|
|
|
|
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
|
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
|
|
}
|
|
|
|
};
|
|
|
|
var Papa = __webpack_require__(/*! papaparse */ "./node_modules/papaparse/papaparse.min.js");
|
|
|
|
var errors = __webpack_require__(/*! ./errors.js */ "./src/errors.js");
|
2021-08-30 18:10:21 +02:00
|
|
|
var freeDatas2HTML = (function () {
|
|
|
|
function freeDatas2HTML() {
|
2021-08-13 20:00:03 +02:00
|
|
|
this._datasViewElt = { id: "", eltDOM: undefined };
|
|
|
|
this._datasSourceUrl = "";
|
|
|
|
this._datasSelectors = [];
|
|
|
|
this.parseMeta = undefined;
|
|
|
|
this.parseDatas = [];
|
|
|
|
this.parseErrors = [];
|
|
|
|
this.datasHTML = "";
|
|
|
|
this.stopIfParseErrors = false;
|
|
|
|
}
|
2021-08-30 18:10:21 +02:00
|
|
|
Object.defineProperty(freeDatas2HTML.prototype, "datasViewElt", {
|
2021-08-13 20:00:03 +02:00
|
|
|
set: function (elt) {
|
|
|
|
var checkContainerExist = document.getElementById(elt.id);
|
|
|
|
if (checkContainerExist === null)
|
|
|
|
throw new Error(errors.elementNotFound + elt.id);
|
|
|
|
else {
|
|
|
|
this._datasViewElt.id = elt.id;
|
|
|
|
this._datasViewElt.eltDOM = checkContainerExist;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
enumerable: false,
|
|
|
|
configurable: true
|
|
|
|
});
|
2021-08-30 18:10:21 +02:00
|
|
|
Object.defineProperty(freeDatas2HTML.prototype, "datasSourceUrl", {
|
2021-08-13 20:00:03 +02:00
|
|
|
set: function (url) {
|
|
|
|
if (url.trim().length === 0)
|
|
|
|
throw new Error(errors.needUrl);
|
|
|
|
else
|
|
|
|
this._datasSourceUrl = url.trim();
|
|
|
|
},
|
|
|
|
enumerable: false,
|
|
|
|
configurable: true
|
|
|
|
});
|
2021-08-30 18:10:21 +02:00
|
|
|
Object.defineProperty(freeDatas2HTML.prototype, "datasSelectors", {
|
2021-08-13 20:00:03 +02:00
|
|
|
get: function () {
|
|
|
|
return this._datasSelectors;
|
|
|
|
},
|
|
|
|
set: function (selectionElts) {
|
|
|
|
this._datasSelectors = [];
|
|
|
|
var checkContainerExist;
|
|
|
|
for (var i = 0; i < selectionElts.length; i++) {
|
|
|
|
checkContainerExist = document.getElementById(selectionElts[i].id);
|
|
|
|
if (checkContainerExist === null)
|
|
|
|
console.error(errors.elementNotFound + selectionElts[i].id);
|
2021-08-30 18:10:21 +02:00
|
|
|
else if (Number.isInteger(selectionElts[i].datasFielNb) === false || selectionElts[i].datasFielNb < 0)
|
2021-08-13 20:00:03 +02:00
|
|
|
console.error(errors.needNaturalNumber);
|
|
|
|
else {
|
|
|
|
selectionElts[i].eltDOM = checkContainerExist;
|
|
|
|
this._datasSelectors.push(selectionElts[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
enumerable: false,
|
|
|
|
configurable: true
|
|
|
|
});
|
2021-08-30 18:10:21 +02:00
|
|
|
freeDatas2HTML.prototype.parse = function () {
|
2021-08-13 20:00:03 +02:00
|
|
|
return __awaiter(this, void 0, void 0, function () {
|
|
|
|
var converter;
|
|
|
|
return __generator(this, function (_a) {
|
|
|
|
converter = this;
|
|
|
|
return [2, new Promise(function (resolve, reject) {
|
|
|
|
if (converter._datasSourceUrl !== "") {
|
|
|
|
Papa.parse(converter._datasSourceUrl, {
|
|
|
|
quoteChar: '"',
|
|
|
|
header: true,
|
|
|
|
complete: function (results) {
|
|
|
|
converter.parseErrors = results.errors;
|
|
|
|
converter.parseDatas = results.data;
|
|
|
|
var realFields = [];
|
|
|
|
for (var i in results.meta.fields) {
|
|
|
|
if (results.meta.fields[i].trim() !== "")
|
|
|
|
realFields.push(results.meta.fields[i]);
|
|
|
|
}
|
|
|
|
results.meta.fields = realFields;
|
|
|
|
converter.parseMeta = results.meta;
|
|
|
|
resolve(true);
|
|
|
|
},
|
|
|
|
error: function (error) {
|
|
|
|
reject(new Error(errors.parserFail));
|
|
|
|
},
|
|
|
|
download: true,
|
|
|
|
skipEmptyLines: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
else
|
|
|
|
reject(new Error(errors.needUrl));
|
|
|
|
})];
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
2021-08-30 18:10:21 +02:00
|
|
|
freeDatas2HTML.prototype.run = function () {
|
2021-08-13 20:00:03 +02:00
|
|
|
return __awaiter(this, void 0, void 0, function () {
|
|
|
|
var converter_1, selectorsHTML, i, values, colName, row, j, selectElement;
|
|
|
|
return __generator(this, function (_a) {
|
|
|
|
switch (_a.label) {
|
|
|
|
case 0:
|
|
|
|
if (this._datasViewElt.eltDOM === undefined)
|
|
|
|
throw new Error(errors.needDatasElt);
|
|
|
|
if (this._datasSourceUrl === "")
|
|
|
|
throw new Error(errors.needUrl);
|
|
|
|
return [4, this.parse()];
|
|
|
|
case 1:
|
|
|
|
_a.sent();
|
|
|
|
if (this.parseDatas.length === 0 || this.parseMeta.fields === undefined)
|
|
|
|
throw new Error(errors.datasNotFound);
|
|
|
|
else if (this.stopIfParseErrors && this.parseErrors.length !== 0)
|
|
|
|
console.error(this.parseErrors);
|
|
|
|
else {
|
|
|
|
converter_1 = this;
|
|
|
|
this.datasHTML = this.createDatasHTML(this.parseMeta.fields, this.parseDatas);
|
|
|
|
this._datasViewElt.eltDOM.innerHTML = this.datasHTML;
|
|
|
|
if (this._datasSelectors.length > 0) {
|
|
|
|
selectorsHTML = [];
|
|
|
|
for (i in this._datasSelectors) {
|
2021-08-30 18:10:21 +02:00
|
|
|
if (this._datasSelectors[i].datasFielNb > (this.parseMeta.fields.length - 1))
|
2021-08-13 20:00:03 +02:00
|
|
|
throw new Error(errors.selectorFieldNotFound);
|
|
|
|
else {
|
2021-08-30 18:10:21 +02:00
|
|
|
values = [], colName = this.parseMeta.fields[this._datasSelectors[i].datasFielNb];
|
2021-08-13 20:00:03 +02:00
|
|
|
for (row in this.parseDatas) {
|
|
|
|
if (values.indexOf(this.parseDatas[row][colName].trim()) === -1)
|
|
|
|
values.push(this.parseDatas[row][colName].trim());
|
|
|
|
}
|
|
|
|
if (values.length > 0) {
|
|
|
|
values.sort();
|
|
|
|
this._datasSelectors[i].name = colName;
|
|
|
|
this._datasSelectors[i].values = values;
|
2021-08-30 18:10:21 +02:00
|
|
|
selectorsHTML[i] = "<label for='freeDatas2HTMLSelector" + i + "'>" + colName + " : </label><select name='freeDatas2HTMLSelector" + i + "' id='freeDatas2HTMLSelector" + i + "'><option value='0'>----</option>";
|
2021-08-13 20:00:03 +02:00
|
|
|
for (j in values)
|
|
|
|
selectorsHTML[i] += "<option value='" + (Number(j) + 1) + "'>" + values[j] + "</option>";
|
|
|
|
selectorsHTML[i] += "</select>";
|
|
|
|
this._datasSelectors[i].eltDOM.innerHTML = selectorsHTML[i];
|
2021-08-30 18:10:21 +02:00
|
|
|
selectElement = document.getElementById("freeDatas2HTMLSelector" + i);
|
2021-08-13 20:00:03 +02:00
|
|
|
selectElement.addEventListener('change', function (e) {
|
|
|
|
converter_1.datasHTML = converter_1.createDatasHTML(converter_1.parseMeta.fields, converter_1.parseDatas);
|
|
|
|
converter_1._datasViewElt.eltDOM.innerHTML = converter_1.datasHTML;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return [2, true];
|
|
|
|
}
|
|
|
|
return [2];
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
2021-08-30 18:10:21 +02:00
|
|
|
freeDatas2HTML.prototype.createDatasHTML = function (fields, datas) {
|
2021-08-13 20:00:03 +02:00
|
|
|
var checkSelectorExist, filters = [];
|
|
|
|
for (var i in this._datasSelectors) {
|
|
|
|
checkSelectorExist = document.querySelector("#" + this._datasSelectors[i].id + " select");
|
|
|
|
if (checkSelectorExist != null && checkSelectorExist.value != "0")
|
|
|
|
filters.push({ field: this._datasSelectors[i].name, value: this._datasSelectors[i].values[checkSelectorExist.selectedIndex - 1] });
|
|
|
|
}
|
|
|
|
var datasHTML = "<table><thead>";
|
|
|
|
for (var i in fields)
|
|
|
|
datasHTML += "<th>" + fields[i] + "</th>";
|
|
|
|
datasHTML += "</thead><tbody>";
|
|
|
|
for (var row in datas) {
|
|
|
|
var visible = true;
|
|
|
|
if (filters.length !== 0) {
|
|
|
|
for (var i in filters) {
|
|
|
|
if (datas[row][filters[i].field].trim() != filters[i].value)
|
|
|
|
visible = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (visible) {
|
|
|
|
datasHTML += "<tr>";
|
|
|
|
for (var field in datas[row]) {
|
|
|
|
if (fields.indexOf(field) !== -1)
|
|
|
|
datasHTML += "<td>" + datas[row][field] + "</td>";
|
|
|
|
}
|
|
|
|
datasHTML += "</tr>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
datasHTML += "</tbody></table>";
|
|
|
|
return datasHTML;
|
|
|
|
};
|
2021-08-30 18:10:21 +02:00
|
|
|
return freeDatas2HTML;
|
2021-08-13 20:00:03 +02:00
|
|
|
}());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "./src/errors.js":
|
|
|
|
/*!***********************!*\
|
|
|
|
!*** ./src/errors.js ***!
|
|
|
|
\***********************/
|
|
|
|
/***/ ((module) => {
|
|
|
|
|
|
|
|
module.exports =
|
|
|
|
{
|
|
|
|
datasNotFound : "Aucune donnée n'a été trouvée.",
|
|
|
|
elementNotFound : "Aucun élément HTML n'a été trouvé ayant comme \"id\" : ",
|
|
|
|
needDatasElt: "Merci de fournir un id valide pour l'élément où afficher les données.",
|
|
|
|
needNaturalNumber: "Merci de fournir un nombre entier supérieur ou égal à zéro pour désigner chaque colonne.",
|
|
|
|
needUrl: "Merci de fournir une url valide pour le fichier CSV à parser.",
|
|
|
|
parserFail: "La lecture des données du fichier a échoué.",
|
|
|
|
selectorFieldNotFound: "Au moins une des colonnes devant servir à filtrer les données n'existe pas dans le fichier.",
|
|
|
|
};
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
|
|
/******/ });
|
|
|
|
/************************************************************************/
|
|
|
|
/******/ // The module cache
|
|
|
|
/******/ var __webpack_module_cache__ = {};
|
|
|
|
/******/
|
|
|
|
/******/ // The require function
|
|
|
|
/******/ function __webpack_require__(moduleId) {
|
|
|
|
/******/ // Check if module is in cache
|
|
|
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
|
|
/******/ if (cachedModule !== undefined) {
|
|
|
|
/******/ return cachedModule.exports;
|
|
|
|
/******/ }
|
|
|
|
/******/ // Create a new module (and put it into the cache)
|
|
|
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
|
|
/******/ // no module.id needed
|
|
|
|
/******/ // no module.loaded needed
|
|
|
|
/******/ exports: {}
|
|
|
|
/******/ };
|
|
|
|
/******/
|
|
|
|
/******/ // Execute the module function
|
|
|
|
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
|
|
/******/
|
|
|
|
/******/ // Return the exports of the module
|
|
|
|
/******/ return module.exports;
|
|
|
|
/******/ }
|
|
|
|
/******/
|
|
|
|
/************************************************************************/
|
|
|
|
/******/ /* webpack/runtime/define property getters */
|
|
|
|
/******/ (() => {
|
|
|
|
/******/ // define getter functions for harmony exports
|
|
|
|
/******/ __webpack_require__.d = (exports, definition) => {
|
|
|
|
/******/ for(var key in definition) {
|
|
|
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
|
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
|
|
/******/ }
|
|
|
|
/******/ }
|
|
|
|
/******/ };
|
|
|
|
/******/ })();
|
|
|
|
/******/
|
|
|
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
|
|
/******/ (() => {
|
|
|
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
|
|
/******/ })();
|
|
|
|
/******/
|
|
|
|
/******/ /* webpack/runtime/make namespace object */
|
|
|
|
/******/ (() => {
|
|
|
|
/******/ // define __esModule on exports
|
|
|
|
/******/ __webpack_require__.r = (exports) => {
|
|
|
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
|
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
|
/******/ }
|
|
|
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
|
/******/ };
|
|
|
|
/******/ })();
|
|
|
|
/******/
|
|
|
|
/************************************************************************/
|
|
|
|
var __webpack_exports__ = {};
|
|
|
|
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
|
|
|
(() => {
|
|
|
|
"use strict";
|
|
|
|
/*!*****************************!*\
|
|
|
|
!*** ./src/firstExample.ts ***!
|
|
|
|
\*****************************/
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
2021-08-30 18:10:21 +02:00
|
|
|
/* harmony import */ var _freeDatas2HTML__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./freeDatas2HTML */ "./src/freeDatas2HTML.ts");
|
2021-08-13 20:00:03 +02:00
|
|
|
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
|
});
|
|
|
|
};
|
|
|
|
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
|
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
|
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
|
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
|
|
function step(op) {
|
|
|
|
if (f) throw new TypeError("Generator is already executing.");
|
|
|
|
while (_) try {
|
|
|
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
|
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
|
|
switch (op[0]) {
|
|
|
|
case 0: case 1: t = op; break;
|
|
|
|
case 4: _.label++; return { value: op[1], done: false };
|
|
|
|
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
|
|
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
|
|
default:
|
|
|
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
|
|
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
|
|
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
|
|
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
|
|
if (t[2]) _.ops.pop();
|
|
|
|
_.trys.pop(); continue;
|
|
|
|
}
|
|
|
|
op = body.call(thisArg, _);
|
|
|
|
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
|
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
var initialise = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
|
|
var converter, e_1;
|
|
|
|
return __generator(this, function (_a) {
|
|
|
|
switch (_a.label) {
|
|
|
|
case 0:
|
|
|
|
_a.trys.push([0, 2, , 3]);
|
2021-08-30 18:10:21 +02:00
|
|
|
converter = new _freeDatas2HTML__WEBPACK_IMPORTED_MODULE_0__.freeDatas2HTML();
|
2021-08-13 20:00:03 +02:00
|
|
|
converter.datasViewElt = { id: "datas" };
|
2021-08-30 18:10:21 +02:00
|
|
|
converter.datasSelectors = [{ datasFielNb: 3, id: "filtre1" }, { datasFielNb: 4, id: "filtre2" }];
|
2021-08-13 20:00:03 +02:00
|
|
|
converter.datasSourceUrl = "http://localhost:8080/datas/elements-chimiques.csv";
|
|
|
|
return [4, converter.run()];
|
|
|
|
case 1:
|
|
|
|
_a.sent();
|
|
|
|
return [3, 3];
|
|
|
|
case 2:
|
|
|
|
e_1 = _a.sent();
|
|
|
|
console.error(e_1);
|
|
|
|
if (document.getElementById("datas") !== null)
|
|
|
|
document.getElementById("datas").innerHTML = "<strong>Désolé, mais un problème technique empêche l'affichage des données.</strong>";
|
|
|
|
return [3, 3];
|
|
|
|
case 3: return [2];
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}); };
|
|
|
|
initialise();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