From f6326b8d1a1b1e42106e76e24d9fa9c64181ca4c Mon Sep 17 00:00:00 2001 From: William Troup Date: Fri, 6 Sep 2024 15:21:51 +0100 Subject: [PATCH] Event assignment and lambda shift. --- dist/select.esm.js | 22 ++++++++-------------- dist/select.esm.js.map | 2 +- dist/select.js | 22 ++++++++-------------- dist/select.js.map | 2 +- dist/select.min.js | 2 +- src/select.ts | 16 +++++----------- 6 files changed, 24 insertions(+), 42 deletions(-) diff --git a/dist/select.esm.js b/dist/select.esm.js index 8205f85..49c58d9 100644 --- a/dist/select.esm.js +++ b/dist/select.esm.js @@ -221,7 +221,7 @@ var Config; const o = r(n, t, e); s(o); u(o, false); - f(o); + a(o); Trigger.customEvent(e.onRenderComplete, e._currentView.element); } } else { @@ -280,9 +280,7 @@ var Config; multiSelectEnabled: n.hasAttribute("multiple") }; if (!o.showDropDownButton) { - i.onclick = function() { - a(l); - }; + i.onclick = () => f(l); } t.push(l); return l; @@ -294,9 +292,7 @@ var Config; if (p(e)) { t.classList.add("button-open"); } - t.onclick = function() { - a(e); - }; + t.onclick = () => f(e); } } function s(e) { @@ -315,7 +311,7 @@ var Config; if (o.selected) { n.classList.add("selected"); } - n.onclick = function(o) { + n.onclick = o => { DomElement.cancelBubble(o); if (!e.multiSelectEnabled) { const t = e.select.options.length; @@ -367,7 +363,7 @@ var Config; const o = DomElement.create("div", "remove"); o.innerHTML = e.bindingOptions.removeText; n.appendChild(o); - o.onclick = function(n) { + o.onclick = n => { DomElement.cancelBubble(n); e.select.options[t].selected = false; g(e); @@ -375,15 +371,13 @@ var Config; }; } } - function f(e) { - const t = function() { - g(e); - }; + function a(e) { + const t = () => g(e); document.body.addEventListener("click", t); window.addEventListener("resize", t); window.addEventListener("click", t); } - function a(e) { + function f(e) { if (!p(e)) { setTimeout((function() { e.dropDown.style.display = "block"; diff --git a/dist/select.esm.js.map b/dist/select.esm.js.map index f15287f..14b3dc7 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,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,OAAO3B,GAAGO,eA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AcF,GAAeE,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,EA5RD","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","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,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A,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 diff --git a/dist/select.js b/dist/select.js index 349fdb0..27ee36c 100644 --- a/dist/select.js +++ b/dist/select.js @@ -223,7 +223,7 @@ var Config; const o = r(n, t, e); l(o); u(o, false); - f(o); + a(o); Trigger.customEvent(e.onRenderComplete, e._currentView.element); } } else { @@ -282,9 +282,7 @@ var Config; multiSelectEnabled: n.hasAttribute("multiple") }; if (!o.showDropDownButton) { - i.onclick = function() { - a(s); - }; + i.onclick = () => f(s); } t.push(s); return s; @@ -296,9 +294,7 @@ var Config; if (p(e)) { t.classList.add("button-open"); } - t.onclick = function() { - a(e); - }; + t.onclick = () => f(e); } } function l(e) { @@ -317,7 +313,7 @@ var Config; if (o.selected) { n.classList.add("selected"); } - n.onclick = function(o) { + n.onclick = o => { DomElement.cancelBubble(o); if (!e.multiSelectEnabled) { const t = e.select.options.length; @@ -369,7 +365,7 @@ var Config; const o = DomElement.create("div", "remove"); o.innerHTML = e.bindingOptions.removeText; n.appendChild(o); - o.onclick = function(n) { + o.onclick = n => { DomElement.cancelBubble(n); e.select.options[t].selected = false; g(e); @@ -377,15 +373,13 @@ var Config; }; } } - function f(e) { - const t = function() { - g(e); - }; + function a(e) { + const t = () => g(e); document.body.addEventListener("click", t); window.addEventListener("resize", t); window.addEventListener("click", t); } - function a(e) { + function f(e) { if (!p(e)) { setTimeout((function() { e.dropDown.style.display = "block"; diff --git a/dist/select.js.map b/dist/select.js.map index 6029c62..9921652 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,kBAAkB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F,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,EA5RD","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","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,SA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,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 diff --git a/dist/select.min.js b/dist/select.min.js index acae8ac..79bb3c7 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 i=!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 i=function(e){const t=e.parentNode,n=t.children,o=n.length;let i=null,r=!1;for(let t=0;t{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 showDropDownMenu( controlElement ); } _control_Elements.push( controlElement ); @@ -173,9 +171,7 @@ import { Config } from "./ts/options/config"; dropDownButton.classList.add( "button-open" ); } - dropDownButton.onclick = function() { - showDropDownMenu( controlElement ); - }; + dropDownButton.onclick = () => showDropDownMenu( controlElement ); } } @@ -201,7 +197,7 @@ import { Config } from "./ts/options/config"; item.classList.add( "selected" ); } - item.onclick = function( e: MouseEvent ) { + item.onclick = ( e: MouseEvent ) => { DomElement.cancelBubble( e ); if ( !controlElement.multiSelectEnabled ) { @@ -271,7 +267,7 @@ import { Config } from "./ts/options/config"; removeButton.innerHTML = controlElement.bindingOptions.removeText!; selectedItem.appendChild( removeButton ); - removeButton.onclick = function( e: MouseEvent ) { + removeButton.onclick = ( e: MouseEvent ) => { DomElement.cancelBubble( e ); controlElement.select.options[ optionIndex ].selected = false; @@ -283,9 +279,7 @@ import { Config } from "./ts/options/config"; } function buildDocumentEvents( controlElement: ControlElement ) : void { - const hideMenu: any = function() { - hideDropDownMenu( controlElement ); - }; + const hideMenu: any = () => hideDropDownMenu( controlElement ); document.body.addEventListener( "click", hideMenu ); window.addEventListener( "resize", hideMenu );