diff --git a/README.md b/README.md index 4a014ce..91c366c 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ Select.js [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Select.js%2C%20a%20free%20JavaScript%select%builder&url=https://github.com/williamtroup/Select.js&hashtags=javascript,html,select) -[![npm](https://img.shields.io/badge/npmjs-v1.0.0-blue)](https://www.npmjs.com/package/jselect.js) -[![nuget](https://img.shields.io/badge/nuget-v1.0.0-purple)](https://www.nuget.org/packages/jSelect.js/) +[![npm](https://img.shields.io/badge/npmjs-v1.1.0-blue)](https://www.npmjs.com/package/jselect.js) +[![nuget](https://img.shields.io/badge/nuget-v1.1.0-purple)](https://www.nuget.org/packages/jSelect.js/) [![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Select.js/blob/main/LICENSE.txt) [![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Select.js/discussions) [![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://github.com/williamtroup) >

A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists!

->

v1.0.0

+>

v1.1.0


![Select.js](docs/images/main.png) @@ -20,15 +20,15 @@ Select.js

What features does Select.js have?

-- Zero-dependencies and extremely lightweight! -- Written in TypeScript, allowing greater support for React, Angular, and other libraries! -- Maintains existing SELECT DOM element for FORM compatibility. -- Easily select and de-select your list items, which are shown as tags! -- Full API available via public functions. -- Fully styled in CSS/SASS (including the buttons) and compatible with the Bootstrap library. -- Full CSS theme support (using :root variables, with a default dark-mode theme). -- Custom triggers for actions (when elements are rendered, selection is changed, etc). -- Shortcut keys (click [here](docs/SHORTCUT_KEYS.md) to see the full list). +- 😏 Zero-dependencies and extremely lightweight! +- 🦾 Written in TypeScript, allowing greater support for React, Angular, and other libraries! +- ✏️ Maintains existing SELECT DOM element for FORM compatibility, allowing easy editing. +- ☑️ Easily select and de-select your list items, which are shown as tags! +- 💻 Full API available via public functions. +- 📱 Fully styled in CSS/SASS (including the buttons) and compatible with the Bootstrap library. +- 🌈 Full CSS theme support (using :root variables, with a default dark-mode theme). +- 🚀 Custom triggers for actions (when elements are rendered, selection is changed, etc). +- 🔠 Shortcut keys (click [here](https://github.com/williamtroup/docs/SHORTCUT_KEYS.md) to see the full list).

diff --git a/README_NUGET.md b/README_NUGET.md index f6f0732..40199c1 100644 --- a/README_NUGET.md +++ b/README_NUGET.md @@ -1,8 +1,8 @@ -# Select.js v1.0.0 +# Select.js v1.1.0 [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Select.js%2C%20a%20free%20JavaScript%select%builder&url=https://github.com/williamtroup/Select.js&hashtags=javascript,html,select) -[![npm](https://img.shields.io/badge/npmjs-v1.0.0-blue)](https://www.npmjs.com/package/jselect.js) -[![nuget](https://img.shields.io/badge/nuget-v1.0.0-purple)](https://www.nuget.org/packages/jSelect.js/) +[![npm](https://img.shields.io/badge/npmjs-v1.1.0-blue)](https://www.npmjs.com/package/jselect.js) +[![nuget](https://img.shields.io/badge/nuget-v1.1.0-purple)](https://www.nuget.org/packages/jSelect.js/) [![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Select.js/blob/main/LICENSE.txt) [![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Select.js/discussions) [![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://github.com/williamtroup) @@ -12,15 +12,15 @@ ## What features does Select.js have? -- Zero-dependencies and extremely lightweight! -- Written in TypeScript, allowing greater support for React, Angular, and other libraries! -- Maintains existing SELECT DOM element for FORM compatibility. -- Easily select and de-select your list items, which are shown as tags! -- Full API available via public functions. -- Fully styled in CSS/SASS (including the buttons) and compatible with the Bootstrap library. -- Full CSS theme support (using :root variables, with a default dark-mode theme). -- Custom triggers for actions (when elements are rendered, selection is changed, etc). -- Shortcut keys (click [here](https://github.com/williamtroup/docs/SHORTCUT_KEYS.md) to see the full list). +- 😏 Zero-dependencies and extremely lightweight! +- 🦾 Written in TypeScript, allowing greater support for React, Angular, and other libraries! +- ✏️ Maintains existing SELECT DOM element for FORM compatibility, allowing easy editing. +- ☑️ Easily select and de-select your list items, which are shown as tags! +- 💻 Full API available via public functions. +- 📱 Fully styled in CSS/SASS (including the buttons) and compatible with the Bootstrap library. +- 🌈 Full CSS theme support (using :root variables, with a default dark-mode theme). +- 🚀 Custom triggers for actions (when elements are rendered, selection is changed, etc). +- 🔠 Shortcut keys (click [here](https://github.com/williamtroup/docs/SHORTCUT_KEYS.md) to see the full list). ## What browsers are supported? diff --git a/dist/select.esm.js b/dist/select.esm.js index b47ff27..80081b9 100644 --- a/dist/select.esm.js +++ b/dist/select.esm.js @@ -21,14 +21,14 @@ var Is; return t(e) && typeof e === "function"; } e.definedFunction = r; - function l(e) { + function s(e) { return t(e) && typeof e === "number"; } - e.definedNumber = l; - function s(e) { + e.definedNumber = s; + function l(e) { return n(e) && e instanceof Array; } - e.definedArray = s; + e.definedArray = l; })(Is || (Is = {})); var Trigger; @@ -155,21 +155,24 @@ var Binding; t.render = Default2.getBoolean(t.render, true); t.dropDownShowDelay = Default2.getNumber(t.dropDownShowDelay, 50); t.showDropDownButton = Default2.getBoolean(t.showDropDownButton, true); + t.showRemoveButtonOnLeft = Default2.getBoolean(t.showRemoveButtonOnLeft, false); t = i(t); t = r(t); return t; } t.get = o; function i(e) { - e.removeText = Default2.getString(e.removeText, "X"); - e.noItemsSelectedText = Default2.getString(e.noItemsSelectedText, "There are no items selected"); + e.text = Default2.getObject(e.text, {}); + e.text.removeText = Default2.getString(e.text.removeText, "✖"); + e.text.noItemsSelectedText = Default2.getString(e.text.noItemsSelectedText, "There are no items selected"); return e; } function r(e) { - e.onRenderComplete = Default2.getFunction(e.onRenderComplete, null); - e.onSelectedItemsChanged = Default2.getFunction(e.onSelectedItemsChanged, null); - e.onDropDownShow = Default2.getFunction(e.onDropDownShow, null); - e.onDropDownHide = Default2.getFunction(e.onDropDownHide, null); + e.events = Default2.getObject(e.events, {}); + e.events.onRenderComplete = Default2.getFunction(e.events.onRenderComplete, null); + e.events.onSelectedItemsChanged = Default2.getFunction(e.events.onSelectedItemsChanged, null); + e.events.onDropDownShow = Default2.getFunction(e.events.onDropDownShow, null); + e.events.onDropDownHide = Default2.getFunction(e.events.onDropDownHide, null); return e; } })(t = e.Options || (e.Options = {})); @@ -212,17 +215,17 @@ var Config; if (Is.defined(t) && t.hasAttribute(Constants.SELECT_JS_ATTRIBUTE_NAME)) { const o = t.getAttribute(Constants.SELECT_JS_ATTRIBUTE_NAME); if (Is.definedString(o)) { - const l = Default2.getObjectFromString(o, e); - if (l.parsed && Is.definedObject(l.object)) { - const e = Binding.Options.getForNewInstance(l.object, t); + const s = Default2.getObjectFromString(o, e); + if (s.parsed && Is.definedObject(s.object)) { + const e = Binding.Options.getForNewInstance(s.object, t); if (e.render) { t.removeAttribute(Constants.SELECT_JS_ATTRIBUTE_NAME); const n = i(t); const o = r(n, t, e); - s(o); + l(o); u(o, false); - a(o); - Trigger.customEvent(e.onRenderComplete, e._currentView.element); + f(o); + Trigger.customEvent(e.events.onRenderComplete, e._currentView.element); } } else { if (!e.safeMode) { @@ -256,15 +259,15 @@ var Config; break; } } - const l = DomElement.create("div", "select-js"); + const s = DomElement.create("div", "select-js"); if (Is.defined(i)) { - t.insertBefore(l, i); + t.insertBefore(s, i); } else { - t.appendChild(l); + t.appendChild(s); } t.removeChild(e); - l.appendChild(e); - return l; + s.appendChild(e); + return s; } function r(e, n, o) { const i = DomElement.create("div", "control"); @@ -272,7 +275,7 @@ var Config; const r = DomElement.create("div", "drop-down"); r.style.display = "none"; e.appendChild(r); - const l = { + const s = { control: i, dropDown: r, select: n, @@ -280,22 +283,22 @@ var Config; multiSelectEnabled: n.hasAttribute("multiple") }; if (!o.showDropDownButton) { - i.onclick = () => f(l); + i.onclick = () => a(s); } - t.push(l); - return l; + t.push(s); + return s; } - function l(e) { + function s(e) { if (e.bindingOptions.showDropDownButton) { - const t = DomElement.create("div", "button"); + const t = DomElement.create("div", "open-close-button"); e.control.appendChild(t); if (p(e)) { t.classList.add("button-open"); } - t.onclick = () => f(e); + t.onclick = () => a(e); } } - function s(e) { + function l(e) { const t = e.select.options; const n = t.length; e.dropDown.innerHTML = ""; @@ -336,7 +339,7 @@ var Config; const o = n.length; let i = false; e.control.innerHTML = ""; - l(e); + s(e); for (let t = 0; t < o; t++) { const o = n[t]; if (o.selected) { @@ -346,11 +349,11 @@ var Config; } if (!i) { const t = DomElement.create("div", "no-items-selected"); - t.innerHTML = e.bindingOptions.noItemsSelectedText; + t.innerHTML = e.bindingOptions.text.noItemsSelectedText; e.control.appendChild(t); } if (t) { - Trigger.customEvent(e.bindingOptions.onSelectedItemsChanged, m(e)); + Trigger.customEvent(e.bindingOptions.events.onSelectedItemsChanged, m(e)); } } function d(e, t) { @@ -360,10 +363,14 @@ var Config; o.innerHTML = e.select.options[t].text; n.appendChild(o); if (e.multiSelectEnabled) { - const o = DomElement.create("div", "remove"); - o.innerHTML = e.bindingOptions.removeText; - n.appendChild(o); - o.onclick = n => { + const i = DomElement.create("div", "remove"); + i.innerHTML = e.bindingOptions.text.removeText; + if (e.bindingOptions.showRemoveButtonOnLeft) { + n.insertBefore(i, o); + } else { + n.appendChild(i); + } + i.onclick = n => { DomElement.cancelBubble(n); e.select.options[t].selected = false; g(e); @@ -371,19 +378,19 @@ var Config; }; } } - function a(e) { + function f(e) { const t = () => g(e); document.body.addEventListener("click", t); window.addEventListener("resize", t); window.addEventListener("click", t); } - function f(e) { + function a(e) { if (!p(e)) { setTimeout((function() { e.dropDown.style.display = "block"; - s(e); + l(e); u(e, false); - Trigger.customEvent(e.bindingOptions.onDropDownShow); + Trigger.customEvent(e.bindingOptions.events.onDropDownShow); }), e.bindingOptions.dropDownShowDelay); } else { g(e); @@ -393,7 +400,7 @@ var Config; if (e.dropDown !== null && e.dropDown.style.display !== "none") { e.dropDown.style.display = "none"; u(e, false); - Trigger.customEvent(e.bindingOptions.onDropDownHide); + Trigger.customEvent(e.bindingOptions.events.onDropDownHide); } } function p(e) { @@ -427,7 +434,7 @@ var Config; g(t[n]); } } - const S = { + const v = { setConfiguration: function(t) { if (Is.definedObject(t)) { let n = false; @@ -442,10 +449,10 @@ var Config; e = Config.Options.get(o); } } - return S; + return v; }, getVersion: function() { - return "1.0.0"; + return "1.1.0"; } }; (() => { @@ -455,7 +462,7 @@ var Config; D(); })); if (!Is.defined(window.$select)) { - window.$select = S; + window.$select = v; } })(); })();//# sourceMappingURL=select.esm.js.map \ No newline at end of file diff --git a/dist/select.esm.js.map b/dist/select.esm.js.map index 14b3dc7..f406f6e 100644 --- a/dist/select.esm.js.map +++ b/dist/select.esm.js.map @@ -1 +1 @@ -{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Select.js/dist/select.esm.js"],"names":["Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","Trigger","Trigger2","customEvent","triggerFunction","args","apply","slice","call","Constants","Constants2","SELECT_JS_ATTRIBUTE_NAME","Default2","Default","getString","defaultValue","getBoolean","getNumber","getFunction","getArray","getObject","getStringOrArray","result2","values","split","length","getObjectFromString","objectString","configuration","result","parsed","JSON","parse","e1","eval","e2","safeMode","console","error","message","DomElement","DomElement2","create","type","className","nodeType","toLowerCase","isText","document","createTextNode","createElement","cancelBubble","e","preventDefault","stopPropagation","Binding","Binding2","Options","Options2","getForNewInstance","data","element","bindingOptions","get","_currentView","newOptions","options","render","dropDownShowDelay","showDropDownButton","getText","getCustomTriggers","removeText","noItemsSelectedText","onRenderComplete","onSelectedItemsChanged","onDropDownShow","onDropDownHide","Config","Config2","newConfiguration","configuration2","domElementTypes","_configuration","_control_Elements","tagTypes","tagTypesLength","tagTypeIndex","domElements","getElementsByTagName","elements","elementsLength","elementIndex","renderElement","hasAttribute","bindingOptionsData","getAttribute","bindingData","removeAttribute","container","renderContainer","controlElements","renderControl","renderDropDownItems","renderSelectedItems","buildDocumentEvents","parentNode","parentNodeChildren","children","parentNodeChildrenLength","parentNodeNextChild","findNextChild","parentNodeChildIndex","parentNodeChild","insertBefore","appendChild","removeChild","control","dropDown","style","display","controlElement","select","multiSelectEnabled","onclick","showDropDownMenu","push","renderControlButton","dropDownButton","isDropDownMenuVisible","classList","add","optionsLength","innerHTML","optionIndex","renderDropDownItem","item","option","text","selected","optionResetIndex","hideDropDownMenu","callCustomTrigger","optionsSelected","renderSelectedItem","noItemsSelected","getValuesSelected","selectedItem","selectedItemText","removeButton","hideMenu","body","addEventListener","window","setTimeout","optionValuesSelected","buildGlobalDocumentEvents","addEvents","documentFunc","removeEventListener","onWindowKeyDown","code","hideDropDownMenus","controlElementsLength","controlElementIndex","_public","setConfiguration","configurationHasChanged","newInternalConfiguration","propertyName","hasOwnProperty","getVersion","$select"],"mappings":"AACA,IAAIA;;AACJ,CAAEC;IACA,SAASC,EAAQC;QACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;IACAH,EAAIC,UAAUA;IACd,SAASG,EAAcC;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAII,gBAAgBA;IACpB,SAASE,EAAeD;QACtB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIM,iBAAiBA;IACrB,SAASC,EAAcF;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIO,gBAAgBA;IACpB,SAASC,EAAgBH;QACvB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIQ,kBAAkBA;IACtB,SAASC,EAAcJ;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIS,gBAAgBA;IACpB,SAASC,EAAaL;QACpB,OAAOD,EAAcC,MAAWA,aAAkBM;AACpD;IACAX,EAAIU,eAAeA;AACpB,EA7BD,CA6BGX,OAAOA,KAAK,CAAC;;AAGhB,IAA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;wBAC1DF,IAA0B;AAC5B;AACF;gBACA,IAAIA,GAAyB;oBAC3BpF,IAAiBL,OAAOrB,QAAQM,IAAIyG;AACtC;AACF;YACA,OAAOH;AACT;QAMAM,YAAY;YACV,OAAO;AACT;;IAEF;QACExF,IAAiBL,OAAOrB,QAAQM;QAChCf,SAASwG,iBAAiB,qBAAoB;YAC5CrF;YACAyF;AACF;QACA,KAAKxK,GAAGE,QAAQmK,OAAOmB,UAAU;YAC/BnB,OAAOmB,UAAUP;AACnB;AACD,MATD;AAUD,EAtRD","sourcesContent":[null]} \ No newline at end of file +{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Select.js/dist/select.esm.js"],"names":["Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","Trigger","Trigger2","customEvent","triggerFunction","args","apply","slice","call","Constants","Constants2","SELECT_JS_ATTRIBUTE_NAME","Default2","Default","getString","defaultValue","getBoolean","getNumber","getFunction","getArray","getObject","getStringOrArray","result2","values","split","length","getObjectFromString","objectString","configuration","result","parsed","JSON","parse","e1","eval","e2","safeMode","console","error","message","DomElement","DomElement2","create","type","className","nodeType","toLowerCase","isText","document","createTextNode","createElement","cancelBubble","e","preventDefault","stopPropagation","Binding","Binding2","Options","Options2","getForNewInstance","data","element","bindingOptions","get","_currentView","newOptions","options","render","dropDownShowDelay","showDropDownButton","showRemoveButtonOnLeft","getText","getCustomTriggers","text","removeText","noItemsSelectedText","events","onRenderComplete","onSelectedItemsChanged","onDropDownShow","onDropDownHide","Config","Config2","newConfiguration","configuration2","domElementTypes","_configuration","_control_Elements","tagTypes","tagTypesLength","tagTypeIndex","domElements","getElementsByTagName","elements","elementsLength","elementIndex","renderElement","hasAttribute","bindingOptionsData","getAttribute","bindingData","removeAttribute","container","renderContainer","controlElements","renderControl","renderDropDownItems","renderSelectedItems","buildDocumentEvents","parentNode","parentNodeChildren","children","parentNodeChildrenLength","parentNodeNextChild","findNextChild","parentNodeChildIndex","parentNodeChild","insertBefore","appendChild","removeChild","control","dropDown","style","display","controlElement","select","multiSelectEnabled","onclick","showDropDownMenu","push","renderControlButton","dropDownButton","isDropDownMenuVisible","classList","add","optionsLength","innerHTML","optionIndex","renderDropDownItem","item","option","selected","optionResetIndex","hideDropDownMenu","callCustomTrigger","optionsSelected","renderSelectedItem","noItemsSelected","getValuesSelected","selectedItem","selectedItemText","removeButton","hideMenu","body","addEventListener","window","setTimeout","optionValuesSelected","buildGlobalDocumentEvents","addEvents","documentFunc","removeEventListener","onWindowKeyDown","code","hideDropDownMenus","controlElementsLength","controlElementIndex","_public","setConfiguration","configurationHasChanged","newInternalConfiguration","propertyName","hasOwnProperty","getVersion","$select"],"mappings":"AACA,IAAIA;;AACJ,CAAEC;IACA,SAASC,EAAQC;QACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;IACAH,EAAIC,UAAUA;IACd,SAASG,EAAcC;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAII,gBAAgBA;IACpB,SAASE,EAAeD;QACtB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIM,iBAAiBA;IACrB,SAASC,EAAcF;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIO,gBAAgBA;IACpB,SAASC,EAAgBH;QACvB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIQ,kBAAkBA;IACtB,SAASC,EAAcJ;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIS,gBAAgBA;IACpB,SAASC,EAAaL;QACpB,OAAOD,EAAcC,MAAWA,aAAkBM;AACpD;IACAX,EAAIU,eAAeA;AACpB,EA7BD,CA6BGX,OAAOA,KAAK,CAAC;;AAGhB,IAAIa;;AACJ,CAAEC;IACA,SAASC,EAAYC,MAAoBC;QACvC,IAAIjB,GAAGS,gBAAgBO,IAAkB;YACvCA,EAAgBE,MAAM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IAAU;QAMdC,kBAAkB,SAASrF;YACzB,IAAI/F,GAAGK,cAAc0F,IAAmB;gBACtC,IAAIsF,IAA0B;gBAC9B,MAAMC,IAA2BpF;gBACjC,KAAK,IAAIqF,KAAgBxF,GAAkB;oBACzC,IAAIA,EAAiByF,eAAeD,MAAiBrF,EAAesF,eAAeD,MAAiBD,EAAyBC,OAAkBxF,EAAiBwF,IAAe;wBAC7KD,EAAyBC,KAAgBxF,EAAiBwF;wBAC1DF,IAA0B;AAC5B;AACF;gBACA,IAAIA,GAAyB;oBAC3BnF,IAAiBL,OAAOxB,QAAQM,IAAI2G;AACtC;AACF;YACA,OAAOH;AACT;QAMAM,YAAY;YACV,OAAO;AACT;;IAEF;QACEvF,IAAiBL,OAAOxB,QAAQM;QAChCf,SAAS0G,iBAAiB,qBAAoB;YAC5CvF;YACA2F;AACF;QACA,KAAK1K,GAAGE,QAAQqK,OAAOmB,UAAU;YAC/BnB,OAAOmB,UAAUP;AACnB;AACD,MATD;AAUD,EA1RD","sourcesContent":[null]} \ No newline at end of file diff --git a/dist/select.js b/dist/select.js index a315704..7026665 100644 --- a/dist/select.js +++ b/dist/select.js @@ -157,21 +157,24 @@ var Binding; t.render = Default2.getBoolean(t.render, true); t.dropDownShowDelay = Default2.getNumber(t.dropDownShowDelay, 50); t.showDropDownButton = Default2.getBoolean(t.showDropDownButton, true); + t.showRemoveButtonOnLeft = Default2.getBoolean(t.showRemoveButtonOnLeft, false); t = i(t); t = r(t); return t; } t.get = o; function i(e) { - e.removeText = Default2.getString(e.removeText, "X"); - e.noItemsSelectedText = Default2.getString(e.noItemsSelectedText, "There are no items selected"); + e.text = Default2.getObject(e.text, {}); + e.text.removeText = Default2.getString(e.text.removeText, "✖"); + e.text.noItemsSelectedText = Default2.getString(e.text.noItemsSelectedText, "There are no items selected"); return e; } function r(e) { - e.onRenderComplete = Default2.getFunction(e.onRenderComplete, null); - e.onSelectedItemsChanged = Default2.getFunction(e.onSelectedItemsChanged, null); - e.onDropDownShow = Default2.getFunction(e.onDropDownShow, null); - e.onDropDownHide = Default2.getFunction(e.onDropDownHide, null); + e.events = Default2.getObject(e.events, {}); + e.events.onRenderComplete = Default2.getFunction(e.events.onRenderComplete, null); + e.events.onSelectedItemsChanged = Default2.getFunction(e.events.onSelectedItemsChanged, null); + e.events.onDropDownShow = Default2.getFunction(e.events.onDropDownShow, null); + e.events.onDropDownHide = Default2.getFunction(e.events.onDropDownHide, null); return e; } })(t = e.Options || (e.Options = {})); @@ -223,8 +226,8 @@ var Config; const o = r(n, t, e); l(o); u(o, false); - a(o); - Trigger.customEvent(e.onRenderComplete, e._currentView.element); + f(o); + Trigger.customEvent(e.events.onRenderComplete, e._currentView.element); } } else { if (!e.safeMode) { @@ -282,19 +285,19 @@ var Config; multiSelectEnabled: n.hasAttribute("multiple") }; if (!o.showDropDownButton) { - i.onclick = () => f(s); + i.onclick = () => a(s); } t.push(s); return s; } function s(e) { if (e.bindingOptions.showDropDownButton) { - const t = DomElement.create("div", "button"); + const t = DomElement.create("div", "open-close-button"); e.control.appendChild(t); if (p(e)) { t.classList.add("button-open"); } - t.onclick = () => f(e); + t.onclick = () => a(e); } } function l(e) { @@ -348,11 +351,11 @@ var Config; } if (!i) { const t = DomElement.create("div", "no-items-selected"); - t.innerHTML = e.bindingOptions.noItemsSelectedText; + t.innerHTML = e.bindingOptions.text.noItemsSelectedText; e.control.appendChild(t); } if (t) { - Trigger.customEvent(e.bindingOptions.onSelectedItemsChanged, m(e)); + Trigger.customEvent(e.bindingOptions.events.onSelectedItemsChanged, m(e)); } } function d(e, t) { @@ -362,10 +365,14 @@ var Config; o.innerHTML = e.select.options[t].text; n.appendChild(o); if (e.multiSelectEnabled) { - const o = DomElement.create("div", "remove"); - o.innerHTML = e.bindingOptions.removeText; - n.appendChild(o); - o.onclick = n => { + const i = DomElement.create("div", "remove"); + i.innerHTML = e.bindingOptions.text.removeText; + if (e.bindingOptions.showRemoveButtonOnLeft) { + n.insertBefore(i, o); + } else { + n.appendChild(i); + } + i.onclick = n => { DomElement.cancelBubble(n); e.select.options[t].selected = false; g(e); @@ -373,19 +380,19 @@ var Config; }; } } - function a(e) { + function f(e) { const t = () => g(e); document.body.addEventListener("click", t); window.addEventListener("resize", t); window.addEventListener("click", t); } - function f(e) { + function a(e) { if (!p(e)) { setTimeout((function() { e.dropDown.style.display = "block"; l(e); u(e, false); - Trigger.customEvent(e.bindingOptions.onDropDownShow); + Trigger.customEvent(e.bindingOptions.events.onDropDownShow); }), e.bindingOptions.dropDownShowDelay); } else { g(e); @@ -395,7 +402,7 @@ var Config; if (e.dropDown !== null && e.dropDown.style.display !== "none") { e.dropDown.style.display = "none"; u(e, false); - Trigger.customEvent(e.bindingOptions.onDropDownHide); + Trigger.customEvent(e.bindingOptions.events.onDropDownHide); } } function p(e) { @@ -429,7 +436,7 @@ var Config; g(t[n]); } } - const S = { + const v = { setConfiguration: function(t) { if (Is.definedObject(t)) { let n = false; @@ -444,10 +451,10 @@ var Config; e = Config.Options.get(o); } } - return S; + return v; }, getVersion: function() { - return "1.0.0"; + return "1.1.0"; } }; (() => { @@ -457,7 +464,7 @@ var Config; D(); })); if (!Is.defined(window.$select)) { - window.$select = S; + window.$select = v; } })(); })();//# sourceMappingURL=select.js.map \ No newline at end of file diff --git a/dist/select.js.css b/dist/select.js.css index 61b5be9..f99ed9a 100644 --- a/dist/select.js.css +++ b/dist/select.js.css @@ -1,5 +1,5 @@ /* - * Select.js Library v1.0.0 + * Select.js Library v1.1.0 * * Copyright 2023 Bunoon * Released under the MIT License @@ -114,7 +114,7 @@ div.select-js div.drop-down div.selected { div.select-js div.control { position: relative; } -div.select-js div.control div.button { +div.select-js div.control div.open-close-button { position: absolute; border-right: 5px solid var(--select-js-color-black); border-bottom: 5px solid var(--select-js-color-black); @@ -125,11 +125,11 @@ div.select-js div.control div.button { transform: rotate(45deg); transition: var(--select-js-transition); } -div.select-js div.control div.button:hover { +div.select-js div.control div.open-close-button:hover { cursor: pointer; opacity: 0.7; } -div.select-js div.control div.button:active { +div.select-js div.control div.open-close-button:active { cursor: pointer; opacity: 0.5; } @@ -152,15 +152,20 @@ div.select-js div.control div.selected-item span.text { color: var(--select-js-color-black); } div.select-js div.control div.selected-item div.remove { - margin-left: var(--select-js-spacing); display: inline-block; - font-weight: bold; + font-weight: 900; transition: var(--select-js-transition); } div.select-js div.control div.selected-item div.remove:hover { cursor: pointer; opacity: 0.7; } +div.select-js div.control div.selected-item div.remove:first-child { + margin-right: var(--select-js-spacing); +} +div.select-js div.control div.selected-item div.remove:last-child { + margin-left: var(--select-js-spacing); +} div.select-js div.control div.no-items-selected { background-color: var(--select-js-color-light-gray); border-radius: var(--select-js-border-radius); diff --git a/dist/select.js.css.map b/dist/select.js.css.map index 9591a94..5b5ade4 100644 --- a/dist/select.js.css.map +++ b/dist/select.js.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../src/select.js.scss","../src/sass/_styles.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA;EAEI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAaA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EAGA;EACA;EACA;EAGA;EAGA;EACA;;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAMA;ECrDI;EACA;EACA;EACA;EACA;EACA;EAIA;EACA;ED8CA;EACA;EACA;EACA;;AAEA;ECpDA;EACA;;ADsDI;ECvDJ;EACA;;AD4DA;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;;AAKR;AAAA;AAAA;AAAA;AAAA;AAOI;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;EACA;;AAIR;EACI;EACA;;;AAMZ;AAAA;AAAA;AAAA;AAAA;AAOI;EACI;;AAEA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAGJ;EACI;EACA;;AAIR;EACI;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;;AAGJ;EACI;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAKZ;EACI;EACA;EACA;EACA;EACA;EACA","file":"select.js.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../src/select.js.scss","../src/sass/_styles.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA;EAEI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAaA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EAGA;EACA;EACA;EAGA;EAGA;EACA;;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAMA;ECrDI;EACA;EACA;EACA;EACA;EACA;EAIA;EACA;ED8CA;EACA;EACA;EACA;;AAEA;ECpDA;EACA;;ADsDI;ECvDJ;EACA;;AD4DA;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;;AAKR;AAAA;AAAA;AAAA;AAAA;AAOI;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;EACA;;AAIR;EACI;EACA;;;AAMZ;AAAA;AAAA;AAAA;AAAA;AAOI;EACI;;AAEA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAGJ;EACI;EACA;;AAIR;EACI;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;;AAGJ;EACI;EACA;EACA;;AAEA;EACI;EACA;;AAGJ;EACI;;AAGJ;EACI;;AAKZ;EACI;EACA;EACA;EACA;EACA;EACA","file":"select.js.css"} \ No newline at end of file diff --git a/dist/select.js.map b/dist/select.js.map index 9921652..bf5bfe1 100644 --- a/dist/select.js.map +++ b/dist/select.js.map @@ -1 +1 @@ -{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Select.js/dist/select.js"],"names":["Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","Trigger","Trigger2","customEvent","triggerFunction","args","apply","slice","call","Constants","Constants2","SELECT_JS_ATTRIBUTE_NAME","Default2","Default","getString","defaultValue","getBoolean","getNumber","getFunction","getArray","getObject","getStringOrArray","result2","values","split","length","getObjectFromString","objectString","configuration","result","parsed","JSON","parse","e1","eval","e2","safeMode","console","error","message","DomElement","DomElement2","create","type","className","nodeType","toLowerCase","isText","document","createTextNode","createElement","cancelBubble","e","preventDefault","stopPropagation","Binding","Binding2","Options","Options2","getForNewInstance","data","element","bindingOptions","get","_currentView","newOptions","options","render","dropDownShowDelay","showDropDownButton","getText","getCustomTriggers","removeText","noItemsSelectedText","onRenderComplete","onSelectedItemsChanged","onDropDownShow","onDropDownHide","Config","Config2","newConfiguration","configuration2","domElementTypes","_configuration","_control_Elements","tagTypes","tagTypesLength","tagTypeIndex","domElements","getElementsByTagName","elements","elementsLength","elementIndex","renderElement","hasAttribute","bindingOptionsData","getAttribute","bindingData","removeAttribute","container","renderContainer","controlElements","renderControl","renderDropDownItems","renderSelectedItems","buildDocumentEvents","parentNode","parentNodeChildren","children","parentNodeChildrenLength","parentNodeNextChild","findNextChild","parentNodeChildIndex","parentNodeChild","insertBefore","appendChild","removeChild","control","dropDown","style","display","controlElement","select","multiSelectEnabled","onclick","showDropDownMenu","push","renderControlButton","dropDownButton","isDropDownMenuVisible","classList","add","optionsLength","innerHTML","optionIndex","renderDropDownItem","item","option","text","selected","optionResetIndex","hideDropDownMenu","callCustomTrigger","optionsSelected","renderSelectedItem","noItemsSelected","getValuesSelected","selectedItem","selectedItemText","removeButton","hideMenu","body","addEventListener","window","setTimeout","optionValuesSelected","buildGlobalDocumentEvents","addEvents","documentFunc","removeEventListener","onWindowKeyDown","code","hideDropDownMenus","controlElementsLength","controlElementIndex","_public","setConfiguration","configurationHasChanged","newInternalConfiguration","propertyName","hasOwnProperty","getVersion","$select"],"mappings":"AAAA;;AAGA,IAAIA;;AACJ,CAAEC;IACA,SAASC,EAAQC;QACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;IACAH,EAAIC,UAAUA;IACd,SAASG,EAAcC;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAII,gBAAgBA;IACpB,SAASE,EAAeD;QACtB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIM,iBAAiBA;IACrB,SAASC,EAAcF;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIO,gBAAgBA;IACpB,SAASC,EAAgBH;QACvB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIQ,kBAAkBA;IACtB,SAASC,EAAcJ;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIS,gBAAgBA;IACpB,SAASC,EAAaL;QACpB,OAAOD,EAAcC,MAAWA,aAAkBM;AACpD;IACAX,EAAIU,eAAeA;AACpB,EA7BD,CA6BGX,OAAOA,KAAK,CAAC;;AAGhB,IAAIa;;AACJ,CAAEC;IACA,SAASC,EAAYC,MAAoBC;QACvC,IAAIjB,GAAGS,gBAAgBO,IAAkB;YACvCA,EAAgBE,MAAM,MAAM,GAAGC,MAAMC,KAAKH,GAAM;AAClD;AACF;IACAH,EAASC,cAAcA;AACxB,EAPD,CAOGF,YAAYA,UAAU,CAAC;;AAG1B,IAAIQ;;AACJ,CAAEC;IACAA,EAAWC,2BAA2B;AACvC,EAFD,CAEGF,cAAcA,YAAY,CAAC;;AAG9B,IAAIG;;AACJ,CAAEC;IACA,SAASC,UAAUvB,GAAOwB;QACxB,OAAO3B,GAAGQ,cAAcL,KAASA,IAAQwB;AAC3C;IACAF,QAAQC,YAAYA;IACpB,SAASE,WAAWzB,GAAOwB;QACzB,OAAO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AeE,KAAe;YACpE,MAAMG,IAASvE,EAAQoE;YACvB,IAAIG,EAAOE,UAAU;gBACnBgB,EAAqB7B,KAAKW,EAAOlJ;AACnC;AACF;QACA,OAAOoK;AACT;IACA,SAASC,EAA0BC,IAAY;QAC7C,MAAMC,IAAeD,IAAY7G,SAASwG,mBAAmBxG,SAAS+G;QACtED,EAAa,WAAWE;AAC1B;IACA,SAASA,EAAgB5G;QACvB,IAAIA,EAAE6G,SAAS,UAAuB;YACpC7G,EAAEC;YACF6G;AACF;AACF;IACA,SAASA;QACP,MAAMC,IAAwB/E,EAAkB3D;QAChD,KAAK,IAAI2I,IAAsB,GAAGA,IAAsBD,GAAuBC,KAAuB;YACpGvB,EAAiBzD,EAAkBgF;AACrC;AACF;IACA,MAAMC,IAAU;QAMdC,kBAAkB,SAAStF;YACzB,IAAI5F,GAAGK,cAAcuF,IAAmB;gBACtC,IAAIuF,IAA0B;gBAC9B,MAAMC,IAA2BrF;gBACjC,KAAK,IAAIsF,KAAgBzF,GAAkB;oBACzC,IAAIA,EAAiB0F,eAAeD,MAAiBtF,EAAeuF,eAAeD,MAAiBD,EAAyBC,OAAkBzF,EAAiByF,IAAe;wBAC7KD,EAAyBC,KAAgBzF,EAAiByF;wBAC1DF,IAA0B;AAC5B;AACF;gBACA,IAAIA,GAAyB;oBAC3BpF,IAAiBL,OAAOrB,QAAQM,IAAIyG;AACtC;AACF;YACA,OAAOH;AACT;QAMAM,YAAY;YACV,OAAO;AACT;;IAEF;QACExF,IAAiBL,OAAOrB,QAAQM;QAChCf,SAASwG,iBAAiB,qBAAoB;YAC5CrF;YACAyF;AACF;QACA,KAAKxK,GAAGE,QAAQmK,OAAOmB,UAAU;YAC/BnB,OAAOmB,UAAUP;AACnB;AACD,MATD;AAUD,EAtRD","sourcesContent":[null]} \ No newline at end of file +{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Select.js/dist/select.js"],"names":["Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","Trigger","Trigger2","customEvent","triggerFunction","args","apply","slice","call","Constants","Constants2","SELECT_JS_ATTRIBUTE_NAME","Default2","Default","getString","defaultValue","getBoolean","getNumber","getFunction","getArray","getObject","getStringOrArray","result2","values","split","length","getObjectFromString","objectString","configuration","result","parsed","JSON","parse","e1","eval","e2","safeMode","console","error","message","DomElement","DomElement2","create","type","className","nodeType","toLowerCase","isText","document","createTextNode","createElement","cancelBubble","e","preventDefault","stopPropagation","Binding","Binding2","Options","Options2","getForNewInstance","data","element","bindingOptions","get","_currentView","newOptions","options","render","dropDownShowDelay","showDropDownButton","showRemoveButtonOnLeft","getText","getCustomTriggers","text","removeText","noItemsSelectedText","events","onRenderComplete","onSelectedItemsChanged","onDropDownShow","onDropDownHide","Config","Config2","newConfiguration","configuration2","domElementTypes","_configuration","_control_Elements","tagTypes","tagTypesLength","tagTypeIndex","domElements","getElementsByTagName","elements","elementsLength","elementIndex","renderElement","hasAttribute","bindingOptionsData","getAttribute","bindingData","removeAttribute","container","renderContainer","controlElements","renderControl","renderDropDownItems","renderSelectedItems","buildDocumentEvents","parentNode","parentNodeChildren","children","parentNodeChildrenLength","parentNodeNextChild","findNextChild","parentNodeChildIndex","parentNodeChild","insertBefore","appendChild","removeChild","control","dropDown","style","display","controlElement","select","multiSelectEnabled","onclick","showDropDownMenu","push","renderControlButton","dropDownButton","isDropDownMenuVisible","classList","add","optionsLength","innerHTML","optionIndex","renderDropDownItem","item","option","selected","optionResetIndex","hideDropDownMenu","callCustomTrigger","optionsSelected","renderSelectedItem","noItemsSelected","getValuesSelected","selectedItem","selectedItemText","removeButton","hideMenu","body","addEventListener","window","setTimeout","optionValuesSelected","buildGlobalDocumentEvents","addEvents","documentFunc","removeEventListener","onWindowKeyDown","code","hideDropDownMenus","controlElementsLength","controlElementIndex","_public","setConfiguration","configurationHasChanged","newInternalConfiguration","propertyName","hasOwnProperty","getVersion","$select"],"mappings":"AAAA;;AAGA,IAAIA;;AACJ,C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xB,QAAQM;QAChCf,SAAS0G,iBAAiB,qBAAoB;YAC5CvF;YACA2F;AACF;QACA,KAAK1K,GAAGE,QAAQqK,OAAOmB,UAAU;YAC/BnB,OAAOmB,UAAUP;AACnB;AACD,MATD;AAUD,EA1RD","sourcesContent":[null]} \ No newline at end of file diff --git a/dist/select.js.min.css b/dist/select.js.min.css index 20d5b66..3e102d3 100644 --- a/dist/select.js.min.css +++ b/dist/select.js.min.css @@ -1 +1 @@ -:root{--select-js-default-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--select-js-color-black: #3b3a3a;--select-js-color-white: #F5F5F5;--select-js-color-gray: #AAAAAA;--select-js-color-light-gray: #CCCCCC;--select-js-container-background-color: #e8e6e6;--select-js-container-border-color: #3b3a3a;--select-js-container-background-color-drop-down: #e8e6e6;--select-js-container-border-color-drop-down: #3b3a3a;--select-js-border-radius: 0.5rem;--select-js-border-style-scrollbar: inset 0 0 6px --color-dark-gray;--select-js-border-size: 0.5px;--select-js-transition: all .3s;--select-js-spacing-shadow-size: 4px;--select-js-spacing: 8px}div.select-js{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:default;box-sizing:border-box;line-height:normal;font-family:var(--select-js-default-font);font-size:.8rem;margin-bottom:var(--select-js-spacing);position:relative}div.select-js *{box-sizing:border-box;line-height:normal}div.select-js *::before,div.select-js *::after{box-sizing:border-box;line-height:normal}div.select-js select{display:none !important}div.select-js div.control{background-color:var(--select-js-container-background-color);border:var(--select-js-border-size) solid var(--select-js-container-border-color);border-radius:var(--select-js-border-radius);padding:calc(var(--select-js-spacing) - 2px);padding-right:32px;overflow:hidden}div.select-js div.drop-down{background-color:var(--select-js-container-background-color-drop-down);border:var(--select-js-border-size) solid var(--select-js-container-border-color-drop-down);border-radius:var(--select-js-border-radius);position:absolute;width:100%;z-index:10;max-height:400px;margin-top:2px;box-shadow:var(--select-js-spacing-shadow-size) var(--select-js-spacing-shadow-size) var(--select-js-spacing-shadow-size) var(--select-js-color-gray);overflow-y:auto;overflow-x:hidden}div.select-js div.drop-down div.item{padding:var(--select-js-spacing);border-bottom:var(--select-js-border-size) var(--select-js-color-black) dotted;transition:var(--select-js-transition)}div.select-js div.drop-down div.item:last-child{border-bottom:none}div.select-js div.drop-down div.item:hover{cursor:pointer;background-color:var(--select-js-color-light-gray)}div.select-js div.drop-down div.selected{color:var(--select-js-color-gray);font-style:italic}div.select-js div.control{position:relative}div.select-js div.control div.button{position:absolute;border-right:5px solid var(--select-js-color-black);border-bottom:5px solid var(--select-js-color-black);height:14px;width:14px;right:14px;top:14px;transform:rotate(45deg);transition:var(--select-js-transition)}div.select-js div.control div.button:hover{cursor:pointer;opacity:.7}div.select-js div.control div.button:active{cursor:pointer;opacity:.5}div.select-js div.control div.button-open{transform:rotate(-135deg);top:18px}div.select-js div.control div.selected-item{padding:var(--select-js-spacing);background-color:var(--select-js-color-gray);border-radius:var(--select-js-border-radius);display:inline-block;margin:2px;margin-right:var(--select-js-spacing)}div.select-js div.control div.selected-item:last-child{margin-right:0}div.select-js div.control div.selected-item span.text{color:var(--select-js-color-black)}div.select-js div.control div.selected-item div.remove{margin-left:var(--select-js-spacing);display:inline-block;font-weight:bold;transition:var(--select-js-transition)}div.select-js div.control div.selected-item div.remove:hover{cursor:pointer;opacity:.7}div.select-js div.control div.no-items-selected{background-color:var(--select-js-color-light-gray);border-radius:var(--select-js-border-radius);font-style:italic;color:var(--select-js-color-black);padding:var(--select-js-spacing);display:inline-block} +:root{--select-js-default-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--select-js-color-black: #3b3a3a;--select-js-color-white: #F5F5F5;--select-js-color-gray: #AAAAAA;--select-js-color-light-gray: #CCCCCC;--select-js-container-background-color: #e8e6e6;--select-js-container-border-color: #3b3a3a;--select-js-container-background-color-drop-down: #e8e6e6;--select-js-container-border-color-drop-down: #3b3a3a;--select-js-border-radius: 0.5rem;--select-js-border-style-scrollbar: inset 0 0 6px --color-dark-gray;--select-js-border-size: 0.5px;--select-js-transition: all .3s;--select-js-spacing-shadow-size: 4px;--select-js-spacing: 8px}div.select-js{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:default;box-sizing:border-box;line-height:normal;font-family:var(--select-js-default-font);font-size:.8rem;margin-bottom:var(--select-js-spacing);position:relative}div.select-js *{box-sizing:border-box;line-height:normal}div.select-js *::before,div.select-js *::after{box-sizing:border-box;line-height:normal}div.select-js select{display:none !important}div.select-js div.control{background-color:var(--select-js-container-background-color);border:var(--select-js-border-size) solid var(--select-js-container-border-color);border-radius:var(--select-js-border-radius);padding:calc(var(--select-js-spacing) - 2px);padding-right:32px;overflow:hidden}div.select-js div.drop-down{background-color:var(--select-js-container-background-color-drop-down);border:var(--select-js-border-size) solid var(--select-js-container-border-color-drop-down);border-radius:var(--select-js-border-radius);position:absolute;width:100%;z-index:10;max-height:400px;margin-top:2px;box-shadow:var(--select-js-spacing-shadow-size) var(--select-js-spacing-shadow-size) var(--select-js-spacing-shadow-size) var(--select-js-color-gray);overflow-y:auto;overflow-x:hidden}div.select-js div.drop-down div.item{padding:var(--select-js-spacing);border-bottom:var(--select-js-border-size) var(--select-js-color-black) dotted;transition:var(--select-js-transition)}div.select-js div.drop-down div.item:last-child{border-bottom:none}div.select-js div.drop-down div.item:hover{cursor:pointer;background-color:var(--select-js-color-light-gray)}div.select-js div.drop-down div.selected{color:var(--select-js-color-gray);font-style:italic}div.select-js div.control{position:relative}div.select-js div.control div.open-close-button{position:absolute;border-right:5px solid var(--select-js-color-black);border-bottom:5px solid var(--select-js-color-black);height:14px;width:14px;right:14px;top:14px;transform:rotate(45deg);transition:var(--select-js-transition)}div.select-js div.control div.open-close-button:hover{cursor:pointer;opacity:.7}div.select-js div.control div.open-close-button:active{cursor:pointer;opacity:.5}div.select-js div.control div.button-open{transform:rotate(-135deg);top:18px}div.select-js div.control div.selected-item{padding:var(--select-js-spacing);background-color:var(--select-js-color-gray);border-radius:var(--select-js-border-radius);display:inline-block;margin:2px;margin-right:var(--select-js-spacing)}div.select-js div.control div.selected-item:last-child{margin-right:0}div.select-js div.control div.selected-item span.text{color:var(--select-js-color-black)}div.select-js div.control div.selected-item div.remove{display:inline-block;font-weight:900;transition:var(--select-js-transition)}div.select-js div.control div.selected-item div.remove:hover{cursor:pointer;opacity:.7}div.select-js div.control div.selected-item div.remove:first-child{margin-right:var(--select-js-spacing)}div.select-js div.control div.selected-item div.remove:last-child{margin-left:var(--select-js-spacing)}div.select-js div.control div.no-items-selected{background-color:var(--select-js-color-light-gray);border-radius:var(--select-js-border-radius);font-style:italic;color:var(--select-js-color-black);padding:var(--select-js-spacing);display:inline-block} diff --git a/dist/select.min.js b/dist/select.min.js index 277a765..4d5b5a5 100644 --- a/dist/select.min.js +++ b/dist/select.min.js @@ -1 +1 @@ -"use strict";var Is,Trigger,Constants,Default2,DomElement,DomElement2,Binding,Config;(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=function(e){return n(e)&&e instanceof Array}})(Is||(Is={})),(Trigger||(Trigger={})).customEvent=function(e,...t){Is.definedFunction(e)&&e.apply(null,[].slice.call(t,0))},(Constants||(Constants={})).SELECT_JS_ATTRIBUTE_NAME="data-select-js",(Default=>{function getString(e,t){return Is.definedString(e)?e:t}function getBoolean(e,t){return Is.definedBoolean(e)?e:t}function getNumber(e,t){return Is.definedNumber(e)?e:t}function getFunction(e,t){return Is.definedFunction(e)?e:t}function getArray(e,t){return Is.definedArray(e)?e:t}function getObject(e,t){return Is.definedObject(e)?e:t}function getStringOrArray(e,t){let n=t;if(Is.definedString(e)){const o=e.toString().split(" ");0===o.length?e=t:n=o}else n=getArray(e,t);return n}function getObjectFromString(objectString,configuration){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval(`(${objectString})`),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){configuration.safeMode||(console.error("Errors in object: "+e1.message+", "+e.message),result.parsed=!1),result.object=null}}return result}Default.getString=getString,Default.getBoolean=getBoolean,Default.getNumber=getNumber,Default.getFunction=getFunction,Default.getArray=getArray,Default.getObject=getObject,Default.getStringOrArray=getStringOrArray,Default.getObjectFromString=getObjectFromString})(Default2||(Default2={})),DomElement2=DomElement||(DomElement={}),DomElement2.create=function(e,t=""){const n=e.toLowerCase();let o="text"===n?document.createTextNode(""):document.createElement(n);return Is.defined(t)&&(o.className=t),o},DomElement2.cancelBubble=function(e){e.preventDefault(),e.stopPropagation()},(e=>{let t;var n;(n=t=e.Options||(e.Options={})).getForNewInstance=function(t,n){const o=e.Options.get(t);return o._currentView={},o._currentView.element=n,o},n.get=function(e){let t=Default2.getObject(e,{});return t.render=Default2.getBoolean(t.render,!0),t.dropDownShowDelay=Default2.getNumber(t.dropDownShowDelay,50),t.showDropDownButton=Default2.getBoolean(t.showDropDownButton,!0),t=function(e){return e.removeText=Default2.getString(e.removeText,"X"),e.noItemsSelectedText=Default2.getString(e.noItemsSelectedText,"There are no items selected"),e}(t),t=function(e){return e.onRenderComplete=Default2.getFunction(e.onRenderComplete,null),e.onSelectedItemsChanged=Default2.getFunction(e.onSelectedItemsChanged,null),e.onDropDownShow=Default2.getFunction(e.onDropDownShow,null),e.onDropDownHide=Default2.getFunction(e.onDropDownHide,null),e}(t),t}})(Binding||(Binding={})),(e=>{let t;(t=e.Options||(e.Options={})).get=function(e=null){let t=Default2.getObject(e,{});return t.safeMode=Default2.getBoolean(t.safeMode,!0),t.domElementTypes=Default2.getStringOrArray(t.domElementTypes,["select"]),t}})(Config||(Config={})),(()=>{let e={},t=[];function n(n){let r=!0;if(Is.defined(n)&&n.hasAttribute(Constants.SELECT_JS_ATTRIBUTE_NAME)){const l=n.getAttribute(Constants.SELECT_JS_ATTRIBUTE_NAME);if(Is.definedString(l)){const d=Default2.getObjectFromString(l,e);if(d.parsed&&Is.definedObject(d.object)){const e=Binding.Options.getForNewInstance(d.object,n);if(e.render){n.removeAttribute(Constants.SELECT_JS_ATTRIBUTE_NAME);const r=function(e){const t=e.parentNode,n=t.children,o=n.length;let r=null,i=!1;for(let t=0;tc(l));return t.push(l),l}(r,n,e);o(l),i(l,!1),function(e){const t=()=>s(e);document.body.addEventListener("click",t),window.addEventListener("resize",t),window.addEventListener("click",t)}(l),Trigger.customEvent(e.onRenderComplete,e._currentView.element)}}else e.safeMode||(console.error(`The attribute '${Constants.SELECT_JS_ATTRIBUTE_NAME}' is not a valid object.`),r=!1)}else e.safeMode||(console.error(`The attribute '${Constants.SELECT_JS_ATTRIBUTE_NAME}' has not been set correctly.`),r=!1)}return r}function o(e){const t=e.select.options.length;e.dropDown.innerHTML="";for(let n=0;n{if(DomElement.cancelBubble(o),!e.multiSelectEnabled){const t=e.select.options.length;for(let n=0;nc(e)}}(e);for(let t=0;t{DomElement.cancelBubble(n),e.select.options[t].selected=!1,s(e),i(e)}}}function c(e){d(e)?s(e):setTimeout((function(){e.dropDown.style.display="block",o(e),i(e,!1),Trigger.customEvent(e.bindingOptions.onDropDownShow)}),e.bindingOptions.dropDownShowDelay)}function s(e){null!==e.dropDown&&"none"!==e.dropDown.style.display&&(e.dropDown.style.display="none",i(e,!1),Trigger.customEvent(e.bindingOptions.onDropDownHide))}function d(e){return null!==e.dropDown&&"block"===e.dropDown.style.display}function u(e){"Escape"===e.code&&(e.preventDefault(),function(){const e=t.length;for(let n=0;n{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=function(e){return n(e)&&e instanceof Array}})(Is||(Is={})),(Trigger||(Trigger={})).customEvent=function(e,...t){Is.definedFunction(e)&&e.apply(null,[].slice.call(t,0))},(Constants||(Constants={})).SELECT_JS_ATTRIBUTE_NAME="data-select-js",(Default=>{function getString(e,t){return Is.definedString(e)?e:t}function getBoolean(e,t){return Is.definedBoolean(e)?e:t}function getNumber(e,t){return Is.definedNumber(e)?e:t}function getFunction(e,t){return Is.definedFunction(e)?e:t}function getArray(e,t){return Is.definedArray(e)?e:t}function getObject(e,t){return Is.definedObject(e)?e:t}function getStringOrArray(e,t){let n=t;if(Is.definedString(e)){const o=e.toString().split(" ");0===o.length?e=t:n=o}else n=getArray(e,t);return n}function getObjectFromString(objectString,configuration){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval(`(${objectString})`),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){configuration.safeMode||(console.error("Errors in object: "+e1.message+", "+e.message),result.parsed=!1),result.object=null}}return result}Default.getString=getString,Default.getBoolean=getBoolean,Default.getNumber=getNumber,Default.getFunction=getFunction,Default.getArray=getArray,Default.getObject=getObject,Default.getStringOrArray=getStringOrArray,Default.getObjectFromString=getObjectFromString})(Default2||(Default2={})),DomElement2=DomElement||(DomElement={}),DomElement2.create=function(e,t=""){const n=e.toLowerCase();let o="text"===n?document.createTextNode(""):document.createElement(n);return Is.defined(t)&&(o.className=t),o},DomElement2.cancelBubble=function(e){e.preventDefault(),e.stopPropagation()},(e=>{let t;var n;(n=t=e.Options||(e.Options={})).getForNewInstance=function(t,n){const o=e.Options.get(t);return o._currentView={},o._currentView.element=n,o},n.get=function(e){let t=Default2.getObject(e,{});return t.render=Default2.getBoolean(t.render,!0),t.dropDownShowDelay=Default2.getNumber(t.dropDownShowDelay,50),t.showDropDownButton=Default2.getBoolean(t.showDropDownButton,!0),t.showRemoveButtonOnLeft=Default2.getBoolean(t.showRemoveButtonOnLeft,!1),t=function(e){return e.text=Default2.getObject(e.text,{}),e.text.removeText=Default2.getString(e.text.removeText,"✖"),e.text.noItemsSelectedText=Default2.getString(e.text.noItemsSelectedText,"There are no items selected"),e}(t),t=function(e){return e.events=Default2.getObject(e.events,{}),e.events.onRenderComplete=Default2.getFunction(e.events.onRenderComplete,null),e.events.onSelectedItemsChanged=Default2.getFunction(e.events.onSelectedItemsChanged,null),e.events.onDropDownShow=Default2.getFunction(e.events.onDropDownShow,null),e.events.onDropDownHide=Default2.getFunction(e.events.onDropDownHide,null),e}(t),t}})(Binding||(Binding={})),(e=>{let t;(t=e.Options||(e.Options={})).get=function(e=null){let t=Default2.getObject(e,{});return t.safeMode=Default2.getBoolean(t.safeMode,!0),t.domElementTypes=Default2.getStringOrArray(t.domElementTypes,["select"]),t}})(Config||(Config={})),(()=>{let e={},t=[];function n(n){let r=!0;if(Is.defined(n)&&n.hasAttribute(Constants.SELECT_JS_ATTRIBUTE_NAME)){const s=n.getAttribute(Constants.SELECT_JS_ATTRIBUTE_NAME);if(Is.definedString(s)){const d=Default2.getObjectFromString(s,e);if(d.parsed&&Is.definedObject(d.object)){const e=Binding.Options.getForNewInstance(d.object,n);if(e.render){n.removeAttribute(Constants.SELECT_JS_ATTRIBUTE_NAME);const r=function(e){const t=e.parentNode,n=t.children,o=n.length;let r=null,i=!1;for(let t=0;tl(s));return t.push(s),s}(r,n,e);o(s),i(s,!1),function(e){const t=()=>c(e);document.body.addEventListener("click",t),window.addEventListener("resize",t),window.addEventListener("click",t)}(s),Trigger.customEvent(e.events.onRenderComplete,e._currentView.element)}}else e.safeMode||(console.error(`The attribute '${Constants.SELECT_JS_ATTRIBUTE_NAME}' is not a valid object.`),r=!1)}else e.safeMode||(console.error(`The attribute '${Constants.SELECT_JS_ATTRIBUTE_NAME}' has not been set correctly.`),r=!1)}return r}function o(e){const t=e.select.options.length;e.dropDown.innerHTML="";for(let n=0;n{if(DomElement.cancelBubble(o),!e.multiSelectEnabled){const t=e.select.options.length;for(let n=0;nl(e)}}(e);for(let t=0;t{DomElement.cancelBubble(n),e.select.options[t].selected=!1,c(e),i(e)}}}function l(e){d(e)?c(e):setTimeout((function(){e.dropDown.style.display="block",o(e),i(e,!1),Trigger.customEvent(e.bindingOptions.events.onDropDownShow)}),e.bindingOptions.dropDownShowDelay)}function c(e){null!==e.dropDown&&"none"!==e.dropDown.style.display&&(e.dropDown.style.display="none",i(e,!1),Trigger.customEvent(e.bindingOptions.events.onDropDownHide))}function d(e){return null!==e.dropDown&&"block"===e.dropDown.style.display}function u(e){"Escape"===e.code&&(e.preventDefault(),function(){const e=t.length;for(let n=0;n + + ## Version 1.0.0: #### **Language Shift:** diff --git a/docs/binding/CUSTOM_TRIGGERS.md b/docs/binding/CUSTOM_TRIGGERS.md index 817d214..d43fc55 100644 --- a/docs/binding/CUSTOM_TRIGGERS.md +++ b/docs/binding/CUSTOM_TRIGGERS.md @@ -7,7 +7,7 @@ Below is a list of all the custom triggers supported in the "data-select-js" bin

For Rendering:

-### options.onRenderComplete( *element* ): +### options.events.onRenderComplete( *element* ): Fires when the rendering for a a DOM element is complete.
***Parameter:*** element: '*object*' - The DOM element that was rendered. @@ -16,7 +16,7 @@ Fires when the rendering for a a DOM element is complete.

For Item Selections:

-### options.onSelectedItemsChanged( *values* ): +### options.events.onSelectedItemsChanged( *values* ): Fires when the selected items have changed.
***Parameter:*** values: '*string[]*' - The values that have been selected. @@ -25,10 +25,10 @@ Fires when the selected items have changed.

For Drop-Down Showing/Hiding:

-### options.onDropDownShow(): +### options.events.onDropDownShow(): Fires when the drop-down menu is shown. -### options.onDropDownHide(): +### options.events.onDropDownHide(): Fires when the drop-down menu is hidden.
@@ -37,7 +37,7 @@ Fires when the drop-down menu is hidden. ## Binding Example: ```markdown - diff --git a/docs/binding/OPTIONS.md b/docs/binding/OPTIONS.md index abbfb12..af524a7 100644 --- a/docs/binding/OPTIONS.md +++ b/docs/binding/OPTIONS.md @@ -16,12 +16,12 @@ Below are all the JSON properties that can be passed in the "data-select-js" bin
-### Translatable String Options: +### String Options: -| Type: | Name: | Description: | -| --- | --- | --- | -| *string* | removeText | The text that should be shown for the remove button (defaults to "X".) | -| *string* | noItemsSelectedText | The text that should be shown when no items are selected (defaults to "There are no items selected"). | +| Category: | Type: | Name: | Description: | +| --- | --- | --- | --- | +| text | *string* | removeText | The text that should be shown for the remove button (defaults to "✖".) | +| text | *string* | noItemsSelectedText | The text that should be shown when no items are selected (defaults to "There are no items selected"). |
diff --git a/package-lock.json b/package-lock.json index a25ac2e..f60e171 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jselect.js", - "version": "1.0.0", + "version": "1.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jselect.js", - "version": "1.0.0", + "version": "1.1.0", "license": "MIT", "devDependencies": { "@swc/core": "^1.7.23", diff --git a/package.json b/package.json index 3200d28..f5c6781 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "jselect.js", "title": "Select.js", "description": "A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists!", - "version": "1.0.0", + "version": "1.1.0", "homepage": "https://www.william-troup.com/select-js/", "author": { "name": "Bunoon" diff --git a/select.js.nuspec b/select.js.nuspec index 6062c3a..e3a4982 100644 --- a/select.js.nuspec +++ b/select.js.nuspec @@ -2,7 +2,7 @@ jSelect.js - 1.0.0 + 1.1.0 Select.js A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists! William Troup diff --git a/src/_old/select.js b/src/_old/select.js index e63dd2a..2900fea 100644 --- a/src/_old/select.js +++ b/src/_old/select.js @@ -4,7 +4,7 @@ * A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists! * * @file select.js - * @version v1.0.0 + * @version v1.1.0 * @author Bunoon * @license MIT License * @copyright Bunoon 2023 @@ -624,7 +624,7 @@ * @returns {string} The version number. */ this.getVersion = function() { - return "1.0.0"; + return "1.1.0"; }; diff --git a/src/select.js.scss b/src/select.js.scss index 04c1d0e..285ff7a 100644 --- a/src/select.js.scss +++ b/src/select.js.scss @@ -1,5 +1,5 @@ /* - * Select.js Library v1.0.0 + * Select.js Library v1.1.0 * * Copyright 2023 Bunoon * Released under the MIT License @@ -139,7 +139,7 @@ div.select-js { div.control { position: relative; - div.button { + div.open-close-button { position: absolute; border-right: 5px solid var(--select-js-color-black); border-bottom: 5px solid var(--select-js-color-black); @@ -183,15 +183,22 @@ div.select-js { } div.remove { - margin-left: var(--select-js-spacing); display: inline-block; - font-weight: bold; + font-weight: 900; transition: var(--select-js-transition); &:hover { cursor: pointer; opacity: 0.7; } + + &:first-child { + margin-right: var(--select-js-spacing); + } + + &:last-child { + margin-left: var(--select-js-spacing); + } } } diff --git a/src/select.ts b/src/select.ts index af9962d..4a6bc8c 100644 --- a/src/select.ts +++ b/src/select.ts @@ -4,7 +4,7 @@ * A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists! * * @file select.ts - * @version v1.0.0 + * @version v1.1.0 * @author Bunoon * @license MIT License * @copyright Bunoon 2023 @@ -81,7 +81,7 @@ import { Config } from "./ts/options/config"; renderSelectedItems( controlElements, false ); buildDocumentEvents( controlElements ); - Trigger.customEvent( bindingOptions.onRenderComplete!, bindingOptions._currentView.element ); + Trigger.customEvent( bindingOptions.events!.onRenderComplete!, bindingOptions._currentView.element ); } } else { @@ -164,7 +164,7 @@ import { Config } from "./ts/options/config"; function renderControlButton( controlElement: ControlElement ) : void { if ( controlElement.bindingOptions.showDropDownButton ) { - const dropDownButton: HTMLElement = DomElement.create( "div", "button" ); + const dropDownButton: HTMLElement = DomElement.create( "div", "open-close-button" ); controlElement.control.appendChild( dropDownButton ); if ( isDropDownMenuVisible( controlElement ) ) { @@ -245,12 +245,12 @@ import { Config } from "./ts/options/config"; if ( !optionsSelected ) { const noItemsSelected: HTMLElement = DomElement.create( "div", "no-items-selected" ); - noItemsSelected.innerHTML = controlElement.bindingOptions.noItemsSelectedText!; + noItemsSelected.innerHTML = controlElement.bindingOptions.text!.noItemsSelectedText!; controlElement.control.appendChild( noItemsSelected ); } if ( callCustomTrigger ) { - Trigger.customEvent( controlElement.bindingOptions.onSelectedItemsChanged!, getValuesSelected( controlElement ) ); + Trigger.customEvent( controlElement.bindingOptions.events!.onSelectedItemsChanged!, getValuesSelected( controlElement ) ); } } @@ -264,8 +264,13 @@ import { Config } from "./ts/options/config"; if ( controlElement.multiSelectEnabled ) { const removeButton: HTMLElement = DomElement.create( "div", "remove" ); - removeButton.innerHTML = controlElement.bindingOptions.removeText!; - selectedItem.appendChild( removeButton ); + removeButton.innerHTML = controlElement.bindingOptions.text!.removeText!; + + if ( controlElement.bindingOptions.showRemoveButtonOnLeft ) { + selectedItem.insertBefore( removeButton, selectedItemText ); + } else { + selectedItem.appendChild( removeButton ); + } removeButton.onclick = ( e: MouseEvent ) => { DomElement.cancelBubble( e ); @@ -294,7 +299,7 @@ import { Config } from "./ts/options/config"; renderDropDownItems( controlElement ); renderSelectedItems( controlElement, false ); - Trigger.customEvent( controlElement.bindingOptions.onDropDownShow! ); + Trigger.customEvent( controlElement.bindingOptions.events!.onDropDownShow! ); }, controlElement.bindingOptions.dropDownShowDelay ); @@ -309,7 +314,7 @@ import { Config } from "./ts/options/config"; renderSelectedItems( controlElement, false ); - Trigger.customEvent( controlElement.bindingOptions.onDropDownHide! ); + Trigger.customEvent( controlElement.bindingOptions.events!.onDropDownHide! ); } } @@ -404,7 +409,7 @@ import { Config } from "./ts/options/config"; */ getVersion: function () : string { - return "1.0.0"; + return "1.1.0"; } }; diff --git a/src/ts/api.ts b/src/ts/api.ts index 716bc6d..d217a7b 100644 --- a/src/ts/api.ts +++ b/src/ts/api.ts @@ -4,7 +4,7 @@ * A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists! * * @file api.ts - * @version v1.0.0 + * @version v1.1.0 * @author Bunoon * @license MIT License * @copyright Bunoon 2023 diff --git a/src/ts/area/trigger.ts b/src/ts/area/trigger.ts index 146978d..58cf458 100644 --- a/src/ts/area/trigger.ts +++ b/src/ts/area/trigger.ts @@ -4,7 +4,7 @@ * A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists! * * @file trigger.ts - * @version v1.0.0 + * @version v1.1.0 * @author Bunoon * @license MIT License * @copyright Bunoon 2023 diff --git a/src/ts/constant.ts b/src/ts/constant.ts index b066121..58a1350 100644 --- a/src/ts/constant.ts +++ b/src/ts/constant.ts @@ -4,7 +4,7 @@ * A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists! * * @file constant.js - * @version v1.0.0 + * @version v1.1.0 * @author Bunoon * @license MIT License * @copyright Bunoon 2023 diff --git a/src/ts/data/default.ts b/src/ts/data/default.ts index 7f9654c..95d39e6 100644 --- a/src/ts/data/default.ts +++ b/src/ts/data/default.ts @@ -4,7 +4,7 @@ * A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists! * * @file default.js - * @version v1.0.0 + * @version v1.1.0 * @author Bunoon * @license MIT License * @copyright Bunoon 2023 diff --git a/src/ts/data/enum.ts b/src/ts/data/enum.ts index fe10599..ca2b275 100644 --- a/src/ts/data/enum.ts +++ b/src/ts/data/enum.ts @@ -4,7 +4,7 @@ * A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists! * * @file enum.js - * @version v1.0.0 + * @version v1.1.0 * @author Bunoon * @license MIT License * @copyright Bunoon 2023 diff --git a/src/ts/data/is.ts b/src/ts/data/is.ts index 3ceab0e..6e82e00 100644 --- a/src/ts/data/is.ts +++ b/src/ts/data/is.ts @@ -4,7 +4,7 @@ * A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists! * * @file is.js - * @version v1.0.0 + * @version v1.1.0 * @author Bunoon * @license MIT License * @copyright Bunoon 2023 diff --git a/src/ts/dom/dom.ts b/src/ts/dom/dom.ts index cd83198..38af308 100644 --- a/src/ts/dom/dom.ts +++ b/src/ts/dom/dom.ts @@ -4,7 +4,7 @@ * A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists! * * @file dom.ts - * @version v1.0.0 + * @version v1.1.0 * @author Bunoon * @license MIT License * @copyright Bunoon 2023 diff --git a/src/ts/options/binding.ts b/src/ts/options/binding.ts index 5885cda..480c2ef 100644 --- a/src/ts/options/binding.ts +++ b/src/ts/options/binding.ts @@ -4,14 +4,19 @@ * A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists! * * @file binding.js - * @version v1.0.0 + * @version v1.1.0 * @author Bunoon * @license MIT License * @copyright Bunoon 2023 */ -import { type BindingOptionsCurrentView, type BindingOptions } from "../type"; +import { + type BindingOptionsCurrentView, + type BindingOptions, + type BindingOptionsEvents, + type BindingOptionsText } from "../type"; + import { Default } from "../data/default"; @@ -31,7 +36,8 @@ export namespace Binding { options.render = Default.getBoolean( options.render, true ); options.dropDownShowDelay = Default.getNumber( options.dropDownShowDelay, 50 ); options.showDropDownButton = Default.getBoolean( options.showDropDownButton, true ); - + options.showRemoveButtonOnLeft = Default.getBoolean( options.showRemoveButtonOnLeft, false ); + options = getText( options ); options = getCustomTriggers( options ); @@ -39,17 +45,19 @@ export namespace Binding { } function getText( options: BindingOptions ) : BindingOptions { - options.removeText = Default.getString( options.removeText, "X" ); - options.noItemsSelectedText = Default.getString( options.noItemsSelectedText, "There are no items selected" ); + options.text = Default.getObject( options.text, {} as BindingOptionsText ); + options.text!.removeText = Default.getString( options.text!.removeText, "✖" ); + options.text!.noItemsSelectedText = Default.getString( options.text!.noItemsSelectedText, "There are no items selected" ); return options; } function getCustomTriggers( options: BindingOptions ) : BindingOptions { - options.onRenderComplete = Default.getFunction( options.onRenderComplete, null! ); - options.onSelectedItemsChanged = Default.getFunction( options.onSelectedItemsChanged, null! ); - options.onDropDownShow = Default.getFunction( options.onDropDownShow, null! ); - options.onDropDownHide = Default.getFunction( options.onDropDownHide, null! ); + options.events = Default.getObject( options.events, {} as BindingOptionsEvents ); + options.events!.onRenderComplete = Default.getFunction( options.events!.onRenderComplete, null! ); + options.events!.onSelectedItemsChanged = Default.getFunction( options.events!.onSelectedItemsChanged, null! ); + options.events!.onDropDownShow = Default.getFunction( options.events!.onDropDownShow, null! ); + options.events!.onDropDownHide = Default.getFunction( options.events!.onDropDownHide, null! ); return options; } diff --git a/src/ts/options/config.ts b/src/ts/options/config.ts index f3bbc3b..ad01781 100644 --- a/src/ts/options/config.ts +++ b/src/ts/options/config.ts @@ -4,7 +4,7 @@ * A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists! * * @file config.js - * @version v1.0.0 + * @version v1.1.0 * @author Bunoon * @license MIT License * @copyright Bunoon 2023 diff --git a/src/ts/type.ts b/src/ts/type.ts index 0680614..f85628a 100644 --- a/src/ts/type.ts +++ b/src/ts/type.ts @@ -4,7 +4,7 @@ * A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists! * * @file type.js - * @version v1.0.0 + * @version v1.1.0 * @author Bunoon * @license MIT License * @copyright Bunoon 2023 @@ -34,8 +34,17 @@ export type BindingOptions = { render?: boolean; dropDownShowDelay?: number; showDropDownButton?: boolean; + showRemoveButtonOnLeft?: boolean; + text?: BindingOptionsText; + events?: BindingOptionsEvents; +}; + +export type BindingOptionsText = { removeText?: string; noItemsSelectedText?: string; +}; + +export type BindingOptionsEvents = { onRenderComplete?: ( element: HTMLElement ) => void; onSelectedItemsChanged?: ( selectValues: any[] ) => void; onDropDownShow?: ( element: HTMLElement ) => void; diff --git a/test/select.js.bootstrap.html b/test/select.js.bootstrap.html index 82fd2a8..de218ae 100644 --- a/test/select.js.bootstrap.html +++ b/test/select.js.bootstrap.html @@ -17,7 +17,7 @@

Select.js - Basic

- +