@green-code-studio/objects-list 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -94,7 +94,7 @@ eval("\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(obje
94
94
  \******************************/
95
95
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
96
96
 
97
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(variables){const _0=document.createDocumentFragment();const _1=document.createElement(\"form\");const _2=document.createTextNode(\"\\r\\n \");_1.append(_2);const _3=document.createElement(\"label\");const _4=document.createTextNode(\"\\r\\n \");_3.append(_4);const _5=document.createElement(\"span\");const _6=document.createTextNode(variables[\"t\"](\"objectList.mode\"));_5.append(_6);_3.append(_5);const _7=document.createTextNode(\"\\r\\n \");_3.append(_7);const _8=document.createElement(\"select\");const _9=\"mode\";if(typeof _9==='function')_8[\"class\"]=_9;else if(_9!== undefined&&_9!== null&&_9!== false) _8.setAttribute(\"class\",_9);const _10=document.createTextNode(\"\\r\\n \");_8.append(_10);const _11=document.createElement(\"option\");const _12=\"paginationMode\";if(typeof _12==='function')_11[\"value\"]=_12;else if(_12!== undefined&&_12!== null&&_12!== false) _11.setAttribute(\"value\",_12);const _13=document.createTextNode(variables[\"t\"](\"objectList.paginationMode\"));_11.append(_13);_8.append(_11);const _14=document.createTextNode(\"\\r\\n \");_8.append(_14);const _15=document.createElement(\"option\");const _16=\"scrollMode\";if(typeof _16==='function')_15[\"value\"]=_16;else if(_16!== undefined&&_16!== null&&_16!== false) _15.setAttribute(\"value\",_16);const _17=document.createTextNode(variables[\"t\"](\"objectList.scrollMode\"));_15.append(_17);_8.append(_15);const _18=document.createTextNode(\"\\r\\n \");_8.append(_18);_3.append(_8);const _19=document.createTextNode(\"\\r\\n \");_3.append(_19);_1.append(_3);const _20=document.createTextNode(\"\\r\\n \");_1.append(_20);const _21=document.createElement(\"label\");const _22=document.createTextNode(\"\\r\\n \");_21.append(_22);const _23=document.createElement(\"span\");const _24=document.createTextNode(variables[\"t\"](\"objectList.view\"));_23.append(_24);_21.append(_23);const _25=document.createTextNode(\"\\r\\n \");_21.append(_25);const _26=document.createElement(\"select\");const _27=\"view\";if(typeof _27==='function')_26[\"class\"]=_27;else if(_27!== undefined&&_27!== null&&_27!== false) _26.setAttribute(\"class\",_27);const _28=document.createTextNode(\"\\r\\n \");_26.append(_28);const _29=document.createElement(\"option\");const _30=\"tableView\";if(typeof _30==='function')_29[\"value\"]=_30;else if(_30!== undefined&&_30!== null&&_30!== false) _29.setAttribute(\"value\",_30);const _31=document.createTextNode(variables[\"t\"](\"objectList.tableView\"));_29.append(_31);_26.append(_29);const _32=document.createTextNode(\"\\r\\n \");_26.append(_32);const _33=document.createElement(\"option\");const _34=\"listView\";if(typeof _34==='function')_33[\"value\"]=_34;else if(_34!== undefined&&_34!== null&&_34!== false) _33.setAttribute(\"value\",_34);const _35=document.createTextNode(variables[\"t\"](\"objectList.listView\"));_33.append(_35);_26.append(_33);const _36=document.createTextNode(\"\\r\\n \");_26.append(_36);_21.append(_26);const _37=document.createTextNode(\"\\r\\n \");_21.append(_37);_1.append(_21);const _38=document.createTextNode(\"\\r\\n \");_1.append(_38);const _39=document.createElement(\"input\");const _40=\"search\";if(typeof _40==='function')_39[\"type\"]=_40;else if(_40!== undefined&&_40!== null&&_40!== false) _39.setAttribute(\"type\",_40);const _41=variables[\"t\"](\"objectList.search\");if(typeof _41==='function')_39[\"placeholder\"]=_41;else if(_41!== undefined&&_41!== null&&_41!== false) _39.setAttribute(\"placeholder\",_41);_1.append(_39);const _42=document.createTextNode(\"\\r\\n \");_1.append(_42);let _43=document.createDocumentFragment();for(let [_foreachKey,_foreachValue] of Object.entries(variables[\"categories\"])){let category = _foreachValue;const _44=document.createTextNode(\"\\r\\n \");_43.append(_44);const _45=document.createTextNode(category[\"name\"]);_43.append(_45);const _46=document.createTextNode(\"\\r\\n\\r\\n \");_43.append(_46);const _47=document.createElement(\"table\");const _48=document.createTextNode(\"\\r\\n \");_47.append(_48);const _49=document.createElement(\"thead\");const _50=document.createTextNode(\"\\r\\n \");_49.append(_50);const _51=document.createElement(\"tr\");const _52=document.createTextNode(\"\\r\\n \");_51.append(_52);const _53=document.createElement(\"th\");const _54=document.createTextNode(variables[\"t\"](\"objectList.columnEnabled\"));_53.append(_54);_51.append(_53);const _55=document.createTextNode(\"\\r\\n \");_51.append(_55);const _56=document.createElement(\"th\");const _57=document.createTextNode(variables[\"t\"](\"objectList.columnName\"));_56.append(_57);_51.append(_56);const _58=document.createTextNode(\"\\r\\n \");_51.append(_58);const _59=document.createElement(\"th\");const _60=document.createTextNode(variables[\"t\"](\"objectList.columnFilter\"));_59.append(_60);_51.append(_59);const _61=document.createTextNode(\"\\r\\n \");_51.append(_61);_49.append(_51);const _62=document.createTextNode(\"\\r\\n \");_49.append(_62);_47.append(_49);const _63=document.createTextNode(\"\\r\\n \");_47.append(_63);const _64=document.createElement(\"tbody\");const _65=document.createTextNode(\"\\r\\n\\r\\n \");_64.append(_65);let _66=document.createDocumentFragment();for(let [_foreachKey,_foreachValue] of Object.entries(category[\"columns\"])){let column = _foreachValue;const _67=document.createTextNode(\"\\r\\n \");_66.append(_67);const _68=document.createElement(\"tr\");const _69=document.createTextNode(\"\\r\\n \");_68.append(_69);const _70=document.createElement(\"td\");const _71=document.createTextNode(\"\\r\\n \");_70.append(_71);const _72=document.createElement(\"input\");const _73=\"checkbox\";if(typeof _73==='function')_72[\"type\"]=_73;else if(_73!== undefined&&_73!== null&&_73!== false) _72.setAttribute(\"type\",_73);const _74=column[\"dataName\"];if(typeof _74==='function')_72[\"data-name\"]=_74;else if(_74!== undefined&&_74!== null&&_74!== false) _72.setAttribute(\"data-name\",_74);_70.append(_72);const _75=document.createTextNode(\"\\r\\n \");_70.append(_75);_68.append(_70);const _76=document.createTextNode(\"\\r\\n \");_68.append(_76);const _77=document.createElement(\"td\");const _78=document.createTextNode(\"\\r\\n \");_77.append(_78);const _79=document.createTextNode(column[\"name\"]);_77.append(_79);const _80=document.createTextNode(\"\\r\\n \");_77.append(_80);_68.append(_77);const _81=document.createTextNode(\"\\r\\n \");_68.append(_81);const _82=document.createElement(\"td\");const _83=\"filter\";if(typeof _83==='function')_82[\"class\"]=_83;else if(_83!== undefined&&_83!== null&&_83!== false) _82.setAttribute(\"class\",_83);const _84=column[\"dataName\"];if(typeof _84==='function')_82[\"data-name\"]=_84;else if(_84!== undefined&&_84!== null&&_84!== false) _82.setAttribute(\"data-name\",_84);const _85=document.createTextNode(\"\\r\\n\\r\\n \");_82.append(_85);_68.append(_82);const _86=document.createTextNode(\"\\r\\n \");_68.append(_86);_66.append(_68);const _87=document.createTextNode(\"\\r\\n \");_66.append(_87);}_64.append(_66);const _88=document.createTextNode(\"\\r\\n \");_64.append(_88);_47.append(_64);const _89=document.createTextNode(\"\\r\\n \");_47.append(_89);_43.append(_47);const _90=document.createTextNode(\"\\r\\n \");_43.append(_90);}_1.append(_43);const _91=document.createTextNode(\"\\r\\n\");_1.append(_91);_0.append(_1);const _92=document.createTextNode(\"\\r\\n\");_0.append(_92);return _0}\n\n\n//# sourceURL=webpack://@green-code-studio/objects-list/./src/ConfigPopup.mpts?");
97
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(variables){const _0=document.createDocumentFragment();const _1=document.createElement(\"form\");const _2=document.createTextNode(\"\\r\\n \");_1.append(_2);const _3=document.createElement(\"label\");const _4=document.createTextNode(\"\\r\\n \");_3.append(_4);const _5=document.createElement(\"span\");const _6=document.createTextNode(variables[\"t\"](\"objectList.mode\"));_5.append(_6);_3.append(_5);const _7=document.createTextNode(\"\\r\\n \");_3.append(_7);const _8=document.createElement(\"select\");const _9=\"mode\";if(typeof _9==='function')_8[\"class\"]=_9;else if(_9!== undefined&&_9!== null&&_9!== false) _8.setAttribute(\"class\",_9);const _10=document.createTextNode(\"\\r\\n \");_8.append(_10);const _11=document.createElement(\"option\");const _12=\"paginationMode\";if(typeof _12==='function')_11[\"value\"]=_12;else if(_12!== undefined&&_12!== null&&_12!== false) _11.setAttribute(\"value\",_12);const _13=document.createTextNode(variables[\"t\"](\"objectList.paginationMode\"));_11.append(_13);_8.append(_11);const _14=document.createTextNode(\"\\r\\n \");_8.append(_14);const _15=document.createElement(\"option\");const _16=\"scrollMode\";if(typeof _16==='function')_15[\"value\"]=_16;else if(_16!== undefined&&_16!== null&&_16!== false) _15.setAttribute(\"value\",_16);const _17=document.createTextNode(variables[\"t\"](\"objectList.scrollMode\"));_15.append(_17);_8.append(_15);const _18=document.createTextNode(\"\\r\\n \");_8.append(_18);_3.append(_8);const _19=document.createTextNode(\"\\r\\n \");_3.append(_19);_1.append(_3);const _20=document.createTextNode(\"\\r\\n \");_1.append(_20);const _21=document.createElement(\"label\");const _22=document.createTextNode(\"\\r\\n \");_21.append(_22);const _23=document.createElement(\"span\");const _24=document.createTextNode(variables[\"t\"](\"objectList.view\"));_23.append(_24);_21.append(_23);const _25=document.createTextNode(\"\\r\\n \");_21.append(_25);const _26=document.createElement(\"select\");const _27=\"view\";if(typeof _27==='function')_26[\"class\"]=_27;else if(_27!== undefined&&_27!== null&&_27!== false) _26.setAttribute(\"class\",_27);const _28=document.createTextNode(\"\\r\\n \");_26.append(_28);const _29=document.createElement(\"option\");const _30=\"tableView\";if(typeof _30==='function')_29[\"value\"]=_30;else if(_30!== undefined&&_30!== null&&_30!== false) _29.setAttribute(\"value\",_30);const _31=document.createTextNode(variables[\"t\"](\"objectList.tableView\"));_29.append(_31);_26.append(_29);const _32=document.createTextNode(\"\\r\\n \");_26.append(_32);const _33=document.createElement(\"option\");const _34=\"listView\";if(typeof _34==='function')_33[\"value\"]=_34;else if(_34!== undefined&&_34!== null&&_34!== false) _33.setAttribute(\"value\",_34);const _35=document.createTextNode(variables[\"t\"](\"objectList.listView\"));_33.append(_35);_26.append(_33);const _36=document.createTextNode(\"\\r\\n \");_26.append(_36);_21.append(_26);const _37=document.createTextNode(\"\\r\\n \");_21.append(_37);_1.append(_21);const _38=document.createTextNode(\"\\r\\n \");_1.append(_38);const _39=document.createElement(\"input\");const _40=\"search\";if(typeof _40==='function')_39[\"type\"]=_40;else if(_40!== undefined&&_40!== null&&_40!== false) _39.setAttribute(\"type\",_40);const _41=variables[\"t\"](\"objectList.search\");if(typeof _41==='function')_39[\"placeholder\"]=_41;else if(_41!== undefined&&_41!== null&&_41!== false) _39.setAttribute(\"placeholder\",_41);_1.append(_39);const _42=document.createTextNode(\"\\r\\n \");_1.append(_42);let _43=document.createDocumentFragment();for(let [_foreachKey,_foreachValue] of Object.entries(variables[\"categories\"])){let category = _foreachValue;const _44=document.createTextNode(\"\\r\\n \");_43.append(_44);const _45=document.createElement(\"div\");const _46=\"categoryTableContainer\";if(typeof _46==='function')_45[\"class\"]=_46;else if(_46!== undefined&&_46!== null&&_46!== false) _45.setAttribute(\"class\",_46);const _47=document.createTextNode(\"\\r\\n \");_45.append(_47);const _48=document.createTextNode(category[\"name\"]);_45.append(_48);const _49=document.createTextNode(\"\\r\\n\\r\\n \");_45.append(_49);const _50=document.createElement(\"table\");const _51=document.createTextNode(\"\\r\\n \");_50.append(_51);const _52=document.createElement(\"thead\");const _53=document.createTextNode(\"\\r\\n \");_52.append(_53);const _54=document.createElement(\"tr\");const _55=document.createTextNode(\"\\r\\n \");_54.append(_55);const _56=document.createElement(\"th\");const _57=document.createTextNode(variables[\"t\"](\"objectList.columnEnabled\"));_56.append(_57);_54.append(_56);const _58=document.createTextNode(\"\\r\\n \");_54.append(_58);const _59=document.createElement(\"th\");const _60=document.createTextNode(variables[\"t\"](\"objectList.columnName\"));_59.append(_60);_54.append(_59);const _61=document.createTextNode(\"\\r\\n \");_54.append(_61);const _62=document.createElement(\"th\");const _63=document.createTextNode(variables[\"t\"](\"objectList.columnFilter\"));_62.append(_63);_54.append(_62);const _64=document.createTextNode(\"\\r\\n \");_54.append(_64);_52.append(_54);const _65=document.createTextNode(\"\\r\\n \");_52.append(_65);_50.append(_52);const _66=document.createTextNode(\"\\r\\n \");_50.append(_66);const _67=document.createElement(\"tbody\");const _68=document.createTextNode(\"\\r\\n\\r\\n \");_67.append(_68);let _69=document.createDocumentFragment();for(let [_foreachKey,_foreachValue] of Object.entries(category[\"columns\"])){let column = _foreachValue;const _70=document.createTextNode(\"\\r\\n \");_69.append(_70);const _71=document.createElement(\"tr\");const _72=document.createTextNode(\"\\r\\n \");_71.append(_72);const _73=document.createElement(\"td\");const _74=document.createTextNode(\"\\r\\n \");_73.append(_74);const _75=document.createElement(\"input\");const _76=\"checkbox\";if(typeof _76==='function')_75[\"type\"]=_76;else if(_76!== undefined&&_76!== null&&_76!== false) _75.setAttribute(\"type\",_76);const _77=column[\"dataName\"];if(typeof _77==='function')_75[\"data-name\"]=_77;else if(_77!== undefined&&_77!== null&&_77!== false) _75.setAttribute(\"data-name\",_77);_73.append(_75);const _78=document.createTextNode(\"\\r\\n \");_73.append(_78);_71.append(_73);const _79=document.createTextNode(\"\\r\\n \");_71.append(_79);const _80=document.createElement(\"td\");const _81=document.createTextNode(\"\\r\\n \");_80.append(_81);const _82=document.createTextNode(column[\"name\"]);_80.append(_82);const _83=document.createTextNode(\"\\r\\n \");_80.append(_83);_71.append(_80);const _84=document.createTextNode(\"\\r\\n \");_71.append(_84);const _85=document.createElement(\"td\");const _86=\"filter\";if(typeof _86==='function')_85[\"class\"]=_86;else if(_86!== undefined&&_86!== null&&_86!== false) _85.setAttribute(\"class\",_86);const _87=column[\"dataName\"];if(typeof _87==='function')_85[\"data-name\"]=_87;else if(_87!== undefined&&_87!== null&&_87!== false) _85.setAttribute(\"data-name\",_87);const _88=document.createTextNode(\"\\r\\n\\r\\n \");_85.append(_88);_71.append(_85);const _89=document.createTextNode(\"\\r\\n \");_71.append(_89);_69.append(_71);const _90=document.createTextNode(\"\\r\\n \");_69.append(_90);}_67.append(_69);const _91=document.createTextNode(\"\\r\\n \");_67.append(_91);_50.append(_67);const _92=document.createTextNode(\"\\r\\n \");_50.append(_92);_45.append(_50);const _93=document.createTextNode(\"\\r\\n \");_45.append(_93);_43.append(_45);const _94=document.createTextNode(\"\\r\\n \");_43.append(_94);}_1.append(_43);const _95=document.createTextNode(\"\\r\\n\");_1.append(_95);_0.append(_1);const _96=document.createTextNode(\"\\r\\n\");_0.append(_96);return _0}\n\n\n//# sourceURL=webpack://@green-code-studio/objects-list/./src/ConfigPopup.mpts?");
98
98
 
99
99
  /***/ }),
100
100
 
@@ -124,7 +124,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
124
124
  \****************************/
125
125
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
126
126
 
127
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ConfigPopup: () => (/* binding */ ConfigPopup)\n/* harmony export */ });\n/* harmony import */ var _ConfigPopup_mpts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ConfigPopup.mpts */ \"./src/ConfigPopup.mpts\");\n/* harmony import */ var _i18n_xml__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./i18n.xml */ \"./src/i18n.xml\");\n/* harmony import */ var _tableView_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tableView.js */ \"./src/tableView.js\");\n/* harmony import */ var _listView_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./listView.js */ \"./src/listView.js\");\n/* harmony import */ var _ColumnFilter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ColumnFilter.js */ \"./src/ColumnFilter.js\");\n\r\n\r\n\r\n\r\n\r\n\r\nclass ConfigPopup extends HTMLElement {\r\n constructor(objectsList) {\r\n super();\r\n this.append((0,_ConfigPopup_mpts__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\r\n t: _i18n_xml__WEBPACK_IMPORTED_MODULE_1__.t,\r\n categories: Object.entries(objectsList.columns.reduce((o, c) => {\r\n o[c.category] = (o[c.category] ?? [])\r\n o[c.category].push(c);\r\n return o;\r\n }, {}))\r\n .map(([category, columns]) => ({name: category ?? '', columns}))\r\n }))\r\n this.querySelector('.mode').onchange = () => {\r\n objectsList.infiniteScrollEnabled = this.querySelector('.mode').value == 'scrollMode'\r\n objectsList.refresh()\r\n }\r\n this.querySelector('.view').onchange = () => {\r\n if (this.querySelector('.view').value == 'tableView')\r\n objectsList.insideViewClass = _tableView_js__WEBPACK_IMPORTED_MODULE_2__.TableView\r\n else\r\n objectsList.insideViewClass = _listView_js__WEBPACK_IMPORTED_MODULE_3__.ListView\r\n objectsList.refresh()\r\n }\r\n this.addEventListener('blur', () => {\r\n if (!this.matches(':focus-within, :focus'))\r\n this.remove();\r\n })\r\n this.querySelector('select').focus()\r\n console.log('ssss')\r\n for (const checkbox of this.querySelectorAll('table input[type=\"checkbox\"]')) {\r\n checkbox.checked = !objectsList.hiddenColumns.has(checkbox.dataset.name)\r\n checkbox.onchange = () => {\r\n if (checkbox.checked)\r\n objectsList.hiddenColumns.delete(checkbox.dataset.name)\r\n else\r\n objectsList.hiddenColumns.add(checkbox.dataset.name)\r\n\r\n objectsList.refresh()\r\n }\r\n }\r\n\r\n for (const filterContainer of this.querySelectorAll('table .filter')) {\r\n const filter = new _ColumnFilter_js__WEBPACK_IMPORTED_MODULE_4__.ColumnFilter();\r\n filterContainer.append(filter)\r\n filter.addEventListener('x-filter', (e) => {\r\n console.log('dddd', e)\r\n objectsList.columnFilters.set(filterContainer.dataset.name, e.detail)\r\n objectsList.refresh()\r\n });\r\n }\r\n\r\n this.querySelector('[type=\"search\"]').oninput = (event) => {\r\n for (const table of this.querySelectorAll('table')) {\r\n let anyVisible=false;\r\n for (const row of table.querySelectorAll('tr')) {\r\n const visible = row.children[1].textContent.toLowerCase().includes(event.target.value.toLowerCase())\r\n row.style.display = visible ? '' : 'none'\r\n if (visible)\r\n anyVisible=true;\r\n }\r\n table.style.display=anyVisible?'':'none'\r\n }\r\n }\r\n\r\n this.tabIndex = 0\r\n setTimeout(() => this.focus(), 1)\r\n setTimeout(() => this.checkFocus(), 100)\r\n }\r\n\r\n checkFocus() {\r\n console.log('checkFocus')\r\n if (!this.matches(':focus-within, :focus'))\r\n this.remove();\r\n\r\n if (this.parentNode)\r\n setTimeout(() => this.checkFocus(), 100)\r\n }\r\n}\r\n\r\ncustomElements.define('config-popup', ConfigPopup);\r\n\n\n//# sourceURL=webpack://@green-code-studio/objects-list/./src/ConfigPopup.js?");
127
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ConfigPopup: () => (/* binding */ ConfigPopup)\n/* harmony export */ });\n/* harmony import */ var _ConfigPopup_mpts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ConfigPopup.mpts */ \"./src/ConfigPopup.mpts\");\n/* harmony import */ var _i18n_xml__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./i18n.xml */ \"./src/i18n.xml\");\n/* harmony import */ var _tableView_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tableView.js */ \"./src/tableView.js\");\n/* harmony import */ var _listView_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./listView.js */ \"./src/listView.js\");\n/* harmony import */ var _ColumnFilter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ColumnFilter.js */ \"./src/ColumnFilter.js\");\n\r\n\r\n\r\n\r\n\r\n\r\nclass ConfigPopup extends HTMLElement {\r\n constructor(objectsList) {\r\n super();\r\n this.append((0,_ConfigPopup_mpts__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\r\n t: _i18n_xml__WEBPACK_IMPORTED_MODULE_1__.t,\r\n categories: Object.entries(objectsList.columns.reduce((o, c) => {\r\n o[c.category] = (o[c.category] ?? [])\r\n o[c.category].push(c);\r\n return o;\r\n }, {}))\r\n .map(([category, columns]) => ({name: category=='undefined'?'':category, columns}))\r\n }))\r\n this.querySelector('.mode').onchange = () => {\r\n objectsList.infiniteScrollEnabled = this.querySelector('.mode').value == 'scrollMode'\r\n objectsList.refresh()\r\n }\r\n this.querySelector('.view').onchange = () => {\r\n if (this.querySelector('.view').value == 'tableView')\r\n objectsList.insideViewClass = _tableView_js__WEBPACK_IMPORTED_MODULE_2__.TableView\r\n else\r\n objectsList.insideViewClass = _listView_js__WEBPACK_IMPORTED_MODULE_3__.ListView\r\n objectsList.refresh()\r\n }\r\n this.addEventListener('blur', () => {\r\n if (!this.matches(':focus-within, :focus'))\r\n this.remove();\r\n })\r\n this.querySelector('select').focus()\r\n console.log('ssss')\r\n for (const checkbox of this.querySelectorAll('table input[type=\"checkbox\"]')) {\r\n checkbox.checked = !objectsList.hiddenColumns.has(checkbox.dataset.name)\r\n checkbox.onchange = () => {\r\n if (checkbox.checked)\r\n objectsList.hiddenColumns.delete(checkbox.dataset.name)\r\n else\r\n objectsList.hiddenColumns.add(checkbox.dataset.name)\r\n\r\n objectsList.refresh()\r\n }\r\n }\r\n\r\n for (const filterContainer of this.querySelectorAll('table .filter')) {\r\n const filter = new _ColumnFilter_js__WEBPACK_IMPORTED_MODULE_4__.ColumnFilter();\r\n filterContainer.append(filter)\r\n filter.addEventListener('x-filter', (e) => {\r\n console.log('dddd', e)\r\n objectsList.columnFilters.set(filterContainer.dataset.name, e.detail)\r\n objectsList.refresh()\r\n });\r\n }\r\n\r\n this.querySelector('[type=\"search\"]').oninput = (event) => {\r\n for (const table of this.querySelectorAll('.categoryTableContainer')) {\r\n let anyVisible = false;\r\n for (const row of table.querySelectorAll('tbody tr')) {\r\n const visible = row.children[1].textContent.toLowerCase().includes(event.target.value.toLowerCase())\r\n row.style.display = visible ? '' : 'none'\r\n if (visible)\r\n anyVisible = true;\r\n }\r\n table.style.display = anyVisible ? '' : 'none'\r\n }\r\n }\r\n\r\n this.tabIndex = 0\r\n setTimeout(() => this.focus(), 1)\r\n setTimeout(() => this.checkFocus(), 100)\r\n }\r\n\r\n checkFocus() {\r\n console.log('checkFocus')\r\n if (!this.matches(':focus-within, :focus'))\r\n this.remove();\r\n\r\n if (this.parentNode)\r\n setTimeout(() => this.checkFocus(), 100)\r\n }\r\n}\r\n\r\ncustomElements.define('config-popup', ConfigPopup);\r\n\n\n//# sourceURL=webpack://@green-code-studio/objects-list/./src/ConfigPopup.js?");
128
128
 
129
129
  /***/ }),
130
130
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@green-code-studio/objects-list",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "main": "src/index.js",
5
5
  "author": "Mateusz Krawczyk",
6
6
  "license": "MIT",
@@ -14,7 +14,7 @@ export class ConfigPopup extends HTMLElement {
14
14
  o[c.category].push(c);
15
15
  return o;
16
16
  }, {}))
17
- .map(([category, columns]) => ({name: category ?? '', columns}))
17
+ .map(([category, columns]) => ({name: category=='undefined'?'':category, columns}))
18
18
  }))
19
19
  this.querySelector('.mode').onchange = () => {
20
20
  objectsList.infiniteScrollEnabled = this.querySelector('.mode').value == 'scrollMode'
@@ -56,7 +56,7 @@ export class ConfigPopup extends HTMLElement {
56
56
  }
57
57
 
58
58
  this.querySelector('[type="search"]').oninput = (event) => {
59
- for (const table of this.querySelectorAll('table')) {
59
+ for (const table of this.querySelectorAll('.categoryTableContainer')) {
60
60
  let anyVisible = false;
61
61
  for (const row of table.querySelectorAll('tbody tr')) {
62
62
  const visible = row.children[1].textContent.toLowerCase().includes(event.target.value.toLowerCase())
@@ -15,6 +15,7 @@
15
15
  </label>
16
16
  <input type="search" placeholder=(t('objectList.search')) />
17
17
  <:foreach collection=categories item=category>
18
+ <div class="categoryTableContainer">
18
19
  {{category.name}}
19
20
 
20
21
  <table>
@@ -42,5 +43,6 @@
42
43
  </:foreach>
43
44
  </tbody>
44
45
  </table>
46
+ </div>
45
47
  </:foreach>
46
48
  </form>