flat-tree-builder
Advanced tools
Comparing version 1.5.8 to 1.5.9
{ | ||
"name": "flat-tree-builder", | ||
"version": "1.5.8", | ||
"version": "1.5.9", | ||
"description": "A package for building tree structures from postgres ltree data", | ||
@@ -30,3 +30,2 @@ "main": "classifier.mjs", | ||
"verbose": true, | ||
"silent": true, | ||
"setupFiles": [ | ||
@@ -33,0 +32,0 @@ "./tests/setupJest.js" |
16
src.js
@@ -278,4 +278,3 @@ import Sortable from "sortablejs"; | ||
selectCheckboxSpan.textContent = `${item.name}`; | ||
if (this.canSelect) { | ||
selectCheckboxLabel.classList.add("classifier__name--hover"); | ||
if (this.canSelect & (parentUl !== this.mainUl)) { | ||
const selectCheckbox = document.createElement("input"); | ||
@@ -285,3 +284,2 @@ selectCheckbox.type = "checkbox"; | ||
selectCheckbox.checked = this.selectedIds.has(item.id); | ||
selectCheckboxSpan.style.cursor = "pointer"; | ||
selectCheckbox.addEventListener("change", () => | ||
@@ -293,2 +291,4 @@ this.select(item, selectCheckbox) | ||
selectCheckboxLabel.classList.add("classifier__name--tick"); | ||
selectCheckboxLabel.classList.add("cursor-pointer"); | ||
selectCheckboxLabel.classList.add("classifier__name--hover"); | ||
selectCheckboxLabel.append(selectCheckboxSpan); | ||
@@ -492,10 +492,2 @@ } | ||
isValid(str) { | ||
const regex = /^[а-яА-Яa-zA-Z0-9_]+$/; | ||
const res = regex.test(str); | ||
if (res) this.setModalFeedback(""); | ||
else this.setModalFeedback("Недопустимое имя классификатора"); | ||
return res; | ||
} | ||
setModalFeedback(text) { | ||
@@ -506,3 +498,2 @@ this.modalFeedback.textContent = text; | ||
async new() { | ||
if (!this.isValid(this.modalInput.value.trim())) return; | ||
const tree_path = | ||
@@ -540,3 +531,2 @@ this.dataItem instanceof Array | ||
async edit() { | ||
if (!this.isValid(this.modalInput.value.trim())) return; | ||
const treePathArray = this.dataItem.tree_path.split("."); | ||
@@ -543,0 +533,0 @@ const tree_path = |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
177381
4683