From 0f1f865d64ef39fb8b5e8fce4f1e0cf4da291a9d Mon Sep 17 00:00:00 2001 From: William Troup Date: Fri, 6 Sep 2024 15:28:00 +0100 Subject: [PATCH] Fixed version. --- dist/select.esm.js | 2 +- dist/select.js | 2 +- dist/select.min.js | 2 +- src/select.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/select.esm.js b/dist/select.esm.js index 49c58d9..b47ff27 100644 --- a/dist/select.esm.js +++ b/dist/select.esm.js @@ -445,7 +445,7 @@ var Config; return S; }, getVersion: function() { - return "3.0.1"; + return "1.0.0"; } }; (() => { diff --git a/dist/select.js b/dist/select.js index 27ee36c..a315704 100644 --- a/dist/select.js +++ b/dist/select.js @@ -447,7 +447,7 @@ var Config; return S; }, getVersion: function() { - return "3.0.1"; + return "1.0.0"; } }; (() => { diff --git a/dist/select.min.js b/dist/select.min.js index 79bb3c7..277a765 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=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