diff --git a/build/build.js b/build/build.js index 8442b2b..cfa676c 100644 --- a/build/build.js +++ b/build/build.js @@ -30,7 +30,7 @@ var LEFT = 37; var RIGHT = 39; var DELETE = 46; - var COPY_PROPS = ["autocomplete", "disabled", "readonly", "type"]; + var COPY_PROPS = ["autocomplete", "disabled", "readonly", "type", "list"]; var MOVE_PROPS = [ "accept", "accesskey", @@ -39,7 +39,6 @@ "dir", "inputmode", "lang", - "list", "max", "maxlength", "min", @@ -96,92 +95,6 @@ const base = createElement("div", "tags-input"); const checker = checkerForSeparator(input.getAttribute("data-separator") || ","); const allowDuplicates = checkAllowDuplicates(); - function $(selector) { - return base.querySelector(selector); - } - function $$(selector) { - return base.querySelectorAll(selector); - } - function getValue() { - let value = []; - if (base.input.value) - value.push(base.input.value); - $$(".tag").forEach(({ textContent }) => value.push(textContent)); - return checker.join(value); - } - function setValue(value) { - $$(".tag").forEach((t) => base.removeChild(t)); - savePartialInput(value, true); - } - function save(init) { - input.value = getValue(); - if (init) { - return; - } - input.dispatchEvent(new Event("change")); - } - function checkAllowDuplicates() { - const allow = input.getAttribute("data-allow-duplicates") || input.getAttribute("duplicates"); - return allow === "on" || allow === "1" || allow === "true"; - } - function addTag(text) { - let added = false; - function addOneTag(text2) { - let tag = text2 && text2.trim(); - if (!tag) - return; - base.input.value = text2; - if (!base.input.checkValidity()) { - base.classList.add("error"); - setTimeout(() => base.classList.remove("error"), 150); - return; - } - if (!allowDuplicates) { - let exisingTag = $(`[data-tag="${tag}"]`); - if (exisingTag) { - exisingTag.classList.add("dupe"); - setTimeout(() => exisingTag.classList.remove("dupe"), 100); - return; - } - } - base.insertBefore( - createElement("span", "tag", tag, { tag }), - base.input - ); - added = true; - } - checker.split(text).forEach(addOneTag); - return added; - } - function select(el) { - let sel = $(".selected"); - if (sel) - sel.classList.remove("selected"); - if (el) - el.classList.add("selected"); - } - function savePartialInput(value, init) { - if (typeof value !== "string" && !Array.isArray(value)) { - value = base.input.value; - } - if (addTag(value) !== false) { - base.input.value = ""; - save(init); - } - } - function refocus(e) { - base.input.focus(); - if (e.target.classList.contains("tag")) - select(e.target); - if (e.target === base.input) - return select(); - e.preventDefault(); - return false; - } - function dispatchEvent(name) { - const ce = new CustomEvent(`tags-input-${name}`, { bubbles: true }); - input.dispatchEvent(ce); - } insertAfter(input, base); input.classList.add("visuallyhidden"); let inputType = input.getAttribute("type"); @@ -201,6 +114,7 @@ } }); base.appendChild(base.input); + const datalistShadow = makeDatalistShadow(); input.setAttribute("type", "text"); input.tabIndex = -1; input.addEventListener("focus", () => { @@ -272,6 +186,7 @@ input.value = getValue(); input.dispatchEvent(new Event("input")); }); + base.input.addEventListener("change", () => setTimeout(savePartialInput, 0)); base.input.addEventListener("paste", () => setTimeout(savePartialInput, 0)); if (window.PointerEvent) { base.addEventListener("pointerdown", refocus); @@ -282,6 +197,7 @@ base.setValue = setValue; base.getValue = getValue; savePartialInput(input.value, true); + datalistShadow?.update(getValues()); let self = { setValue, getValue }; Object.defineProperty(self, "disabled", { get: () => base.input.disabled, @@ -295,6 +211,113 @@ } }); return self; + function $(selector) { + return base.querySelector(selector); + } + function $$(selector) { + return base.querySelectorAll(selector); + } + function getValue(vv = getValues()) { + return checker.join(vv); + } + function getValues() { + let values = []; + $$(".tag").forEach(({ textContent }) => values.push(textContent)); + if (base.input.value) + values.unshift(base.input.value); + return values; + } + function setValue(value) { + $$(".tag").forEach((t) => base.removeChild(t)); + savePartialInput(value, true); + } + function save(init) { + const values = getValues(); + input.value = getValue(values); + datalistShadow?.update(values); + if (init) { + return; + } + input.dispatchEvent(new Event("change")); + } + function checkAllowDuplicates() { + const allow = input.getAttribute("data-allow-duplicates") || input.getAttribute("duplicates"); + return allow === "on" || allow === "1" || allow === "true"; + } + function addTag(text) { + let added = false; + function addOneTag(text2) { + let tag = text2 && text2.trim(); + if (!tag) + return; + base.input.value = text2; + if (!base.input.checkValidity()) { + base.classList.add("error"); + setTimeout(() => base.classList.remove("error"), 150); + return; + } + if (!allowDuplicates) { + let exisingTag = $(`[data-tag="${tag}"]`); + if (exisingTag) { + exisingTag.classList.add("dupe"); + setTimeout(() => exisingTag.classList.remove("dupe"), 100); + return; + } + } + base.insertBefore( + createElement("span", "tag", tag, { tag }), + base.input + ); + added = true; + } + checker.split(text).forEach(addOneTag); + return added; + } + function select(el) { + let sel = $(".selected"); + if (sel) + sel.classList.remove("selected"); + if (el) + el.classList.add("selected"); + } + function savePartialInput(value, init) { + if (typeof value !== "string" && !Array.isArray(value)) { + value = base.input.value; + } + if (addTag(value) !== false) { + base.input.value = ""; + save(init); + } + } + function refocus(e) { + base.input.focus(); + if (e.target.classList.contains("tag")) + select(e.target); + if (e.target === base.input) + return select(); + e.preventDefault(); + return false; + } + function dispatchEvent(name) { + const ce = new CustomEvent(`tags-input-${name}`, { bubbles: true }); + input.dispatchEvent(ce); + } + function makeDatalistShadow() { + if (!input.list || allowDuplicates) + return; + const origList = document.getElementById(input.getAttribute("list")); + const datalist = origList.cloneNode(); + datalist.id = `${origList.id}-tags-input`; + base.input.setAttribute("list", datalist.id); + insertAfter(origList, datalist); + return { + update + }; + function update(values) { + datalist.innerHTML = ""; + Array.from(origList.childNodes).filter((option) => !values.includes(option.value)).forEach((option) => datalist.appendChild(option.cloneNode(true))); + } + } } tagsInput2.enhance = tagsInput2.tagsInput = tagsInput2; } @@ -321,3 +344,4 @@ console.log("complete", ev.details, ev.target.value); } })(); +//# sourceMappingURL=build.js.map diff --git a/build/build.js.map b/build/build.js.map new file mode 100644 index 0000000..39ee156 --- /dev/null +++ b/build/build.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../node_modules/escape-string-regexp/index.js", "../src/tags-input.js", "../demo/index.js"], + "sourcesContent": ["'use strict';\n\nvar matchOperatorsRe = /[|\\\\{}()[\\]^$+*?.]/g;\n\nmodule.exports = function (str) {\n\tif (typeof str !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\treturn str.replace(matchOperatorsRe, '\\\\$&');\n};\n", "const escapeStringRegexp = require('escape-string-regexp');\n\nmodule.exports = tagsInput;\n\nconst BACKSPACE = 8;\nconst TAB = 9;\nconst ENTER = 13;\nconst ESC = 27;\nconst LEFT = 37;\nconst RIGHT = 39;\nconst DELETE = 46;\n\nconst COPY_PROPS = ['autocomplete', 'disabled', 'readonly', 'type', 'list'];\nconst MOVE_PROPS = ['accept', 'accesskey', 'autocapitalize', 'autofocus', 'dir', 'inputmode', 'lang', 'max',\n\t'maxlength', 'min', 'minlength', 'pattern', 'placeholder', 'size', 'spellcheck', 'step', 'tabindex', 'title'];\n\nfunction checkerForSeparator(separator) {\n\tfunction simple(separator) {\n\t\treturn {\n\t\t\tsplit: s => s.split(separator),\n\t\t\tjoin: arr => arr.join(separator),\n\t\t\ttest: char => char === separator\n\t\t};\n\t}\n\n\tfunction multi(separators) {\n\t\tlet regex = separators\n\t\t\t.split('')\n\t\t\t.map(escapeStringRegexp)\n\t\t\t.join('|');\n\n\t\tregex = new RegExp(regex);\n\n\t\treturn {\n\t\t\tsplit: s => s.split(regex),\n\t\t\tjoin: arr => arr.join(separators[0]),\n\t\t\ttest: char => regex.test(char)\n\t\t};\n\t}\n\n\treturn separator.length > 1 ? multi(separator) : simple(separator);\n}\n\nfunction createElement(type, name, text, attributes) {\n\tlet el = document.createElement(type);\n\tif (name) el.className = name;\n\tif (text) el.textContent = text;\n\tfor (let key in attributes) {\n\t\tel.setAttribute(`data-${key}`, attributes[key]);\n\t}\n\treturn el;\n}\n\nfunction insertAfter({ nextSibling, parentNode }, el) {\n\treturn nextSibling ?\n\t\tparentNode.insertBefore(el, nextSibling) :\n\t\tparentNode.appendChild(el);\n}\n\nfunction caretAtStart({ selectionStart, selectionEnd, value }) {\n\ttry {\n\t\treturn selectionStart === 0 && selectionEnd === 0;\n\t}\n\tcatch {\n\t\treturn value === '';\n\t}\n}\n\nfunction tagsInput(input) {\n\n\tconst base = createElement('div', 'tags-input');\n\tconst checker = checkerForSeparator(input.getAttribute('data-separator') || ',');\n\tconst allowDuplicates = checkAllowDuplicates();\n\n\tinsertAfter(input, base);\n\tinput.classList.add('visuallyhidden');\n\n\tlet inputType = input.getAttribute('type');\n\tif (!inputType || inputType === 'tags') {\n\t\tinput.setAttribute('type', 'text');\n\t}\n\tbase.input = createElement('input');\n\tCOPY_PROPS.forEach(prop => {\n\t\tif (input.hasAttribute(prop)) {\n\t\t\tbase.input.setAttribute(prop, input.getAttribute(prop));\n\t\t}\n\t});\n\tMOVE_PROPS.forEach(prop => {\n\t\tif (input.hasAttribute(prop)) {\n\t\t\tbase.input.setAttribute(prop, input.getAttribute(prop));\n\t\t\tinput.removeAttribute(prop);\n\t\t}\n\t});\n\tbase.appendChild(base.input);\n\n\tconst datalistShadow = makeDatalistShadow();\n\n\tinput.setAttribute('type', 'text');\n\tinput.tabIndex = -1;\n\n\tinput.addEventListener('focus', () => {\n\t\tbase.input.focus();\n\t});\n\n\tbase.input.addEventListener('focus', () => {\n\t\tbase.classList.add('focus');\n\t\tselect();\n\t});\n\n\tbase.input.addEventListener('blur', () => {\n\t\tbase.classList.remove('focus');\n\t\tselect();\n\t\tsavePartialInput();\n\t\tdispatchEvent('complete');\n\t});\n\n\tbase.input.addEventListener('keydown', e => {\n\t\tlet el = base.input;\n\t\tlet key = e.keyCode || e.which;\n\t\tlet separator = checker.test(e.key);\n\t\tlet selectedTag = $('.tag.selected');\n\t\tlet lastTag = $('.tag:last-of-type');\n\n\t\tif (key === ESC) {\n\t\t\tbase.input.value = '';\n\t\t\tbase.input.blur();\n\t\t\treturn;\n\t\t}\n\t\telse if (key === ENTER || key === TAB || separator) {\n\t\t\tif (!el.value && !separator) {\n\t\t\t\tif (key === ENTER) base.input.blur();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsavePartialInput();\n\t\t}\n\t\telse if (key === DELETE && selectedTag) {\n\t\t\tif (selectedTag !== lastTag) select(selectedTag.nextSibling);\n\t\t\tbase.removeChild(selectedTag);\n\t\t\tsave();\n\t\t}\n\t\telse if (key === BACKSPACE) {\n\t\t\tif (selectedTag) {\n\t\t\t\tselect(selectedTag.previousSibling);\n\t\t\t\tbase.removeChild(selectedTag);\n\t\t\t\tsave();\n\t\t\t}\n\t\t\telse if (lastTag && caretAtStart(el)) {\n\t\t\t\tselect(lastTag);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse if (key === LEFT) {\n\t\t\tif (selectedTag) {\n\t\t\t\tif (selectedTag.previousSibling) {\n\t\t\t\t\tselect(selectedTag.previousSibling);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!caretAtStart(el)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tselect(lastTag);\n\t\t\t}\n\t\t}\n\t\telse if (key === RIGHT) {\n\t\t\tif (!selectedTag) return;\n\t\t\tselect(selectedTag.nextSibling);\n\t\t}\n\t\telse {\n\t\t\treturn select();\n\t\t}\n\n\t\te.preventDefault();\n\t\treturn false;\n\t});\n\n\t// Proxy \"input\" (live change) events , update the first tag live as the user types\n\t// This means that users who only want one thing don't have to enter commas\n\tbase.input.addEventListener('input', () => {\n\t\tinput.value = getValue();\n\t\tinput.dispatchEvent(new Event('input'));\n\t});\n\n\t// handle selection from datalist\n\tbase.input.addEventListener('change', () => setTimeout(savePartialInput, 0));\n\n\t// One tick after pasting, parse pasted text as CSV:\n\tbase.input.addEventListener('paste', () => setTimeout(savePartialInput, 0));\n\n\tif (window.PointerEvent) {\n\t\tbase.addEventListener('pointerdown', refocus);\n\t} else {\n\t\tbase.addEventListener('mousedown', refocus);\n\t\tbase.addEventListener('touchstart', refocus);\n\t}\n\n\tbase.setValue = setValue;\n\tbase.getValue = getValue;\n\n\t// Add tags for existing values\n\tsavePartialInput(input.value, true);\n\tdatalistShadow?.update(getValues());\n\n\tlet self = { setValue, getValue };\n\tObject.defineProperty(self, 'disabled', {\n\t\tget: () => base.input.disabled,\n\t\tset(v) {\n\t\t\tif (v) {\n\t\t\t\tbase.setAttribute('disabled', '');\n\t\t\t} else {\n\t\t\t\tbase.removeAttribute('disabled');\n\t\t\t}\n\t\t\tbase.input.disabled = v;\n\t\t}\n\t});\n\treturn self;\n\n\tfunction $(selector) {\n\t\treturn base.querySelector(selector);\n\t}\n\n\tfunction $$(selector) {\n\t\treturn base.querySelectorAll(selector);\n\t}\n\n\tfunction getValue(vv = getValues()) {\n\t\treturn checker.join(vv);\n\t}\n\n\tfunction getValues() {\n\t\tlet values = [];\n\t\t$$('.tag').forEach(({ textContent }) => values.push(textContent));\n\t\tif (base.input.value) values.unshift(base.input.value);\n\t\treturn values;\n\t}\n\n\tfunction setValue(value) {\n\t\t$$('.tag').forEach(t => base.removeChild(t));\n\t\tsavePartialInput(value, true);\n\t}\n\n\tfunction save(init) {\n\t\tconst values = getValues();\n\t\tinput.value = getValue(values);\n\t\tdatalistShadow?.update(values);\n\t\tif (init) {\n\t\t\treturn;\n\t\t}\n\t\tinput.dispatchEvent(new Event('change'));\n\t}\n\n\tfunction checkAllowDuplicates() {\n\t\tconst allow =\n\t\t\tinput.getAttribute('data-allow-duplicates') ||\n\t\t\tinput.getAttribute('duplicates');\n\t\treturn allow === 'on' || allow === '1' || allow === 'true';\n\t}\n\n\t// Return false if no need to add a tag\n\tfunction addTag(text) {\n\t\tlet added = false;\n\t\tfunction addOneTag(text) {\n\t\t\tlet tag = text && text.trim();\n\t\t\t// Ignore if text is empty\n\t\t\tif (!tag) return;\n\n\t\t\t// Check input validity (eg, for pattern=)\n\t\t\t// At tags-input init fill the base.input\n\t\t\tbase.input.value = text;\n\t\t\tif (!base.input.checkValidity()) {\n\t\t\t\tbase.classList.add('error');\n\t\t\t\tsetTimeout(() => base.classList.remove('error'), 150);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For duplicates, briefly highlight the existing tag\n\t\t\tif (!allowDuplicates) {\n\t\t\t\tlet exisingTag = $(`[data-tag=\"${tag}\"]`);\n\t\t\t\tif (exisingTag) {\n\t\t\t\t\texisingTag.classList.add('dupe');\n\t\t\t\t\tsetTimeout(() => exisingTag.classList.remove('dupe'), 100);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.insertBefore(\n\t\t\t\tcreateElement('span', 'tag', tag, { tag }),\n\t\t\t\tbase.input\n\t\t\t);\n\t\t\tadded = true;\n\t\t}\n\n\t\t// Add multiple tags if the user pastes in data with SEPERATOR already in it\n\t\tchecker.split(text).forEach(addOneTag);\n\t\treturn added;\n\t}\n\n\tfunction select(el) {\n\t\tlet sel = $('.selected');\n\t\tif (sel) sel.classList.remove('selected');\n\t\tif (el) el.classList.add('selected');\n\t}\n\n\tfunction savePartialInput(value, init) {\n\t\tif (typeof value !== 'string' && !Array.isArray(value)) {\n\t\t\t// If the base input does not contain a value, default to the original element passed\n\t\t\tvalue = base.input.value;\n\t\t}\n\t\tif (addTag(value) !== false) {\n\t\t\tbase.input.value = '';\n\t\t\tsave(init);\n\t\t}\n\t}\n\n\tfunction refocus(e) {\n\t\tbase.input.focus();\n\t\tif (e.target.classList.contains('tag')) select(e.target);\n\t\tif (e.target === base.input) return select();\n\t\te.preventDefault();\n\t\treturn false;\n\t}\n\n\tfunction dispatchEvent(name) {\n\t\tconst ce = new CustomEvent(`tags-input-${name}`, { bubbles: true });\n\t\tinput.dispatchEvent(ce);\n\t}\n\n\tfunction makeDatalistShadow() {\n\t\t// no need to maintain a shadow list if there's no original list or duplicates are allowed\n\t\tif (!input.list || allowDuplicates) return;\n\n\t\tconst origList = document.getElementById(input.getAttribute('list'));\n\t\tconst datalist = origList.cloneNode();\n\t\tdatalist.id = `${origList.id}-tags-input`;\n\t\tbase.input.setAttribute('list', datalist.id);\n\t\tinsertAfter(origList, datalist);\n\n\t\treturn {\n\t\t\tupdate\n\t\t};\n\n\t\tfunction update(values) {\n\t\t\tdatalist.innerHTML = '';\n\t\t\tArray.from(origList.childNodes)\n\t\t\t\t.filter(option => !values.includes(option.value))\n\t\t\t\t.forEach(option => datalist.appendChild(option.cloneNode(true)));\n\t\t}\n\t}\n}\n\n// make life easier:\ntagsInput.enhance = tagsInput.tagsInput = tagsInput;\n", "const tagsInput = require('../src/tags-input');\n\nconst tis = [];\nfor (const input of document.querySelectorAll('form input')) {\n\tconst ti = tagsInput(input);\n\tinput.addEventListener('change', onchange);\n\ttis.push(ti);\n}\n\ndocument\n\t.querySelector('input[type=\"checkbox\"]')\n\t.addEventListener('change', ev => {\n\t\tconst enabled = ev.target.checked;\n\t\ttis.forEach(ti => ti.disabled = !enabled);\n\t});\ndocument\n\t.querySelector('.forms')\n\t.addEventListener('tags-input-complete', oncomplete);\n\nfunction onchange({ target }) {\n\tconst span = target.parentElement.querySelector('.value');\n\tspan.textContent = target.value;\n}\n\nfunction oncomplete(ev) {\n\tconsole.log('complete', ev.details, ev.target.value);\n}\n"], + "mappings": ";;;;;;;AAAA;AAAA;AAAA;AAEA,UAAI,mBAAmB;AAEvB,aAAO,UAAU,SAAU,KAAK;AAC/B,YAAI,OAAO,QAAQ,UAAU;AAC5B,gBAAM,IAAI,UAAU,mBAAmB;AAAA,QACxC;AAEA,eAAO,IAAI,QAAQ,kBAAkB,MAAM;AAAA,MAC5C;AAAA;AAAA;;;ACVA;AAAA;AAAA,UAAM,qBAAqB;AAE3B,aAAO,UAAUA;AAEjB,UAAM,YAAY;AAClB,UAAM,MAAM;AACZ,UAAM,QAAQ;AACd,UAAM,MAAM;AACZ,UAAM,OAAO;AACb,UAAM,QAAQ;AACd,UAAM,SAAS;AAEf,UAAM,aAAa,CAAC,gBAAgB,YAAY,YAAY,QAAQ,MAAM;AAC1E,UAAM,aAAa;AAAA,QAAC;AAAA,QAAU;AAAA,QAAa;AAAA,QAAkB;AAAA,QAAa;AAAA,QAAO;AAAA,QAAa;AAAA,QAAQ;AAAA,QACrG;AAAA,QAAa;AAAA,QAAO;AAAA,QAAa;AAAA,QAAW;AAAA,QAAe;AAAA,QAAQ;AAAA,QAAc;AAAA,QAAQ;AAAA,QAAY;AAAA,MAAO;AAE7G,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,GAAG,OAAO;AAC1B,QAAI,QAAQ,QAAM,GAAG,WAAW,CAAC,OAAO;AAAA,EACzC,CAAC;AACF,WACE,cAAc,QAAQ,EACtB,iBAAiB,uBAAuB,UAAU;AAEpD,WAAS,SAAS,EAAE,OAAO,GAAG;AAC7B,UAAM,OAAO,OAAO,cAAc,cAAc,QAAQ;AACxD,SAAK,cAAc,OAAO;AAAA,EAC3B;AAEA,WAAS,WAAW,IAAI;AACvB,YAAQ,IAAI,YAAY,GAAG,SAAS,GAAG,OAAO,KAAK;AAAA,EACpD;", + "names": ["tagsInput", "separator", "text"] +} diff --git a/index.html b/index.html index 3f4121f..14d9b98 100644 --- a/index.html +++ b/index.html @@ -65,6 +65,20 @@ placeholder="dot and colon as separators"> +
+ + + + + +