arisu.js 1.0.4 → 2.0.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ## 项目名称
2
- 常用JS方法集合
2
+ 常用JS方法集合,测试:D:\workspaces\idea\WebLibrary\npm\p2test
3
3
 
4
4
  ### 简介
5
5
  包含了基础工具类,以及一些普通网站管理平台上可能需要的组件,按钮状态设置、返回顶部、局部loading、数据增删改查列表等等..,API文档访问:https://www.arisu.cn/springmvc/api/0
@@ -129,6 +129,8 @@
129
129
  b.same([1,2], [7,9,4,2,5,6,1]) //[1, 2]
130
130
  // 获取两个数组中的不相同值
131
131
  b.different([1,2], [7,9,4,2,5,6,1]) //[7, 9, 4, 5, 6]
132
+ // 对比数组一和数组二,如果数组二有数组一没有则返回该数
133
+ b.contrast([1,2], [3]); //3
132
134
  // 判断字符串是否为html标签,如<li></li><div></div><img/>返回true
133
135
  console.log(b.isHtmlTag('<img />')); // true
134
136
  // 允许插件扩展plugin静态方法
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e={d:(t,n)=>{for(var s in n)e.o(n,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:n[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{Base:()=>n,GoTop:()=>o,IAccordion:()=>l,default:()=>r});class n{constructor(e,t){if(this.elements=[],this.length=0,t=t instanceof n?t.elements[0]:t||document,"string"==typeof e)if(t&&"string"==typeof t&&(t=document.querySelector(t)),n.isEqSelector(e)){const s=e.split(":")[0],i=e.match(/:eq\((\d+)\)/);if(i){const e=parseInt(i[1]),l=n.contextQuerySelector(">"+s,t);l.length>0?this.elements=[l[e]]:this.elements=[]}else this.elements=[]}else this.elements=n.contextQuerySelector(e,t);else e instanceof NodeList||e instanceof HTMLElement?this.elements=e instanceof NodeList?Array.from(e):[e]:e instanceof Window?this.elements=[window]:null!==e&&"object"==typeof e&&"documentElement"in e?this.elements=[t]:Array.isArray(e)?this.elements=e:this.elements=[];this.length=this.elements.length}each(e){return this.elements.forEach(((t,n)=>{e(t,n)})),this}hasClass(e){let t=!1;return this.each((n=>{t=n.classList.contains(e)})),t}addClass(e){return this.each((t=>{if(/\s/.test(e)){const n=e.split(" ");for(let e=0;e<n.length;e++)n[e]&&t.classList.add(n[e])}else e&&t.classList.add(e)}))}removeClass(e){return this.each((t=>{if(void 0===e)t.className="";else if(e||0!==e.length)if(/\s/.test(e)){const n=e.split(" ");for(let e=0;e<n.length;e++)n[e]&&t.classList.remove(n[e].trim())}else t.classList.remove(e.trim())}))}toggleClass(e){return this.each((t=>{if(t.classList)t.classList.toggle(e);else{let n=t.className.split(/\s+/),s=n.indexOf(e);s>=0?n.splice(s,1):n.push(e),t.className=n.join(" ")}}))}not(e){let t=e instanceof n?e.elements:Array.from(document.querySelectorAll(e));return this.elements=Array.from(this.elements).filter((e=>!t.includes(e))),this}is(e){var t;let n=this.elements[0];if(":visible"===e){if("none"===n.style.display||"hidden"===n.style.visibility||"0"===getComputedStyle(n).opacity)return!1}else{if(":first-child"===e)return(null===(t=n.parentNode)||void 0===t?void 0:t.firstChild)===n;if(":last-child"!==e)return n.matches(e);{const e=n.parentNode;if(e){const t=e.children;return t[t.length-1]===n}}}return!1}closest(e){let t=this.elements[0];if(!t)return n.build([]);const s=t.matches||t.webkitMatchesSelector;if(s.call(t,e))return this.constructor===n?n.build(this.elements):this;let i=t.parentElement;for(;i;){if(s.call(i,e))return n.build(i);i=i.parentElement}return n.build([])}next(){if(1===this.elements.length){const e=this.elements[0].nextElementSibling;return e instanceof Element?n.build(e):n.build([])}if(this.elements.length>1){const e=[],t=this.elements[0].nextElementSibling;t instanceof Element&&e.push(t);for(let t=1;t<this.elements.length-1;t++)this.elements[t]instanceof Element&&e.push(this.elements[t]);const s=this.elements[this.elements.length-1].nextElementSibling;return s instanceof Element&&e.push(s),n.build(e)}return null}nextAll(e){const t=[];let n=this.elements[0],s=n.nextSibling,i=n.parentElement;for(;s&&(1===s.nodeType&&(e&&!s.matches(e)||t.unshift(s)),s=s.nextSibling,null!==s||0!==t.length||(null==i?void 0:i.firstChild)!==n););return this.elements=t,this.length=this.elements.length,this}prev(){if(1===this.elements.length)return n.build(this.elements[0].previousElementSibling);if(this.elements.length>1){let e=n.build(this.elements[0].previousElementSibling);return this.each(((t,n)=>{n>1&&(e.elements.push(t),n===this.elements.length-1&&e.elements.push(t.previousElementSibling))})),e}return null}prevAll(e){const t=[];let n=this.elements[this.elements.length-1],s=n.previousSibling,i=n.parentElement;for(;s&&(1===s.nodeType&&(e&&!s.matches(e)||t.unshift(s)),s=s.previousSibling,null!==s||0!==t.length||(null==i?void 0:i.firstChild)!==n););return this.elements=t,this.length=this.elements.length,this}first(){return new n([this.elements[0]])}find(e){if(e&&"option:selected"===e.trim()){const e=[];return this.each((t=>{("select-one"===t.type||"select-multiple"===t.type)&&t.selectedIndex>=0&&e.push(t.options[t.selectedIndex])})),new n(e)}{const t=[];return this.elements.forEach((n=>{n instanceof HTMLElement&&n.querySelectorAll(e).forEach((e=>t.push(e)))})),new n(t)}}parent(){let e=this.elements[0];return e?new n(e.parentNode):new n}parents(e){const t=[];let s=this.elements[0].parentElement;for(;s&&s!==document.documentElement;)e&&!s.matches(e)||t.push(s),s=s.parentElement;return new n(t)}siblings(){let e=this.elements[0];if(e&&1===e.nodeType){let t=e.parentNode;if(t){let s=[];for(let n=0;n<t.childNodes.length;n++){let i=t.childNodes[n];1===i.nodeType&&i!==e&&s.push(i)}return new n(s)}return new n}return new n}children(){let e=[];return this.each((t=>{e.push(...Array.from(t.children))})),new n(e)}index(){var e;const t=this.elements[0],n=null===(e=t.parentNode)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return e;return-1}size(){return this.elements?this.elements.length:0}on(e,t){return this.each((function(n){n.addEventListener(e,t)}))}off(e,t){return this.each((function(n){n.removeEventListener&&t&&n.removeEventListener(e,t)}))}click(e){return"function"==typeof e?this.on("click",e):this.each((e=>{const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(t)})),this}focus(e){return"function"==typeof e&&this.on("focus",e),this}change(e){return e&&this.each((t=>{t.addEventListener("change",e,!1)})),this}trigger(e,t){return this.each((function(n){let s;try{s=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0})}catch(n){s=document.createEvent("CustomEvent"),s.initCustomEvent(e,!0,!0,t)}n.dispatchEvent(s)})),this}remove(){return this.each((e=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)}))}data(e,t){if(void 0===e)throw new Error("读取的或设置的键值不能为空");let s=this.elements[0];if(void 0!==t){let i=n.elementData.get(s);return i||(i=new Map,n.elementData.set(s,i)),i.set(n.camelCase(e),t),this}{const t=n.elementData.get(s);return t?t.get(n.camelCase(e)):n.dataAttr(s,e)}}removeData(e){let t=this.elements[0],s=n.elementData.get(t);s&&s.set(n.camelCase(e),void 0)}attr(e,t){if(0===this.elements.length)return void 0===t?"":this;const n=this.elements[0];return void 0===t?(null==n?void 0:n.getAttribute(e))||"":this.each((n=>n.setAttribute(e,t)))}removeAttr(e){return this.each((t=>{"function"==typeof t.removeAttribute&&t.removeAttribute(e)}))}offset(){let e=this.elements[0].getBoundingClientRect(),t=window.pageYOffset||document.documentElement.scrollTop,n=window.pageXOffset||document.documentElement.scrollLeft;return{top:e.top+t,left:e.left+n}}scrollTop(){return this.elements[0]instanceof Window?void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop:document.documentElement.scrollTop}height(){const e=this.elements[0];return e===window?window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight:e.offsetHeight}width(){const e=this.elements[0];return e===window?window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth:e.offsetWidth}val(e){let t=this.elements[0];if("select-multiple"===t.type){if(void 0!==e){for(let n=t.options.length-1;n>=0;n--)t.options[n].selected=t.options[n].value===e;return this}{let e=[];for(let n=0;n<t.options.length;n++)t.options[n].selected&&e.push(t.options[n].value);return e}}return void 0!==e?(t.value=e,this):t.value}css(e,t){if(0===this.elements.length)return this;if(void 0===t){if("object"==typeof e){const t=e;for(const e in t)if(t.hasOwnProperty(e)){const n=t[e];this.each((t=>{t.style[e]=n}))}return this}return this.elements[0].style[e]||""}return this.each((n=>{n.style[e]=t}))}text(e){if(0===this.elements.length)return void 0===e?"":this;const t=this.elements[0];return void 0===e?t.textContent||"":this.each((t=>{t.textContent=e}))}html(e){if(0===this.elements.length)return void 0===e?"":this;const t=this.elements[0];return void 0===e?t&&1===t.nodeType?t.innerHTML:"":this.each((t=>{t&&1===t.nodeType&&(t.innerHTML=e)}))}after(e){return this.each((t=>{t.insertAdjacentHTML("afterend",e)}))}append(e){return this.each((t=>{let n=document.createElement("div");if("string"==typeof e)n.innerHTML=e;else if(e instanceof Node)n.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)n.appendChild(e[t]);for(;n.firstChild;)t.appendChild(n.firstChild);return t}))}prepend(e){return this.each((t=>{let n=document.createElement("div");if("string"==typeof e)n.innerHTML=e;else if(e instanceof Node)n.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)n.appendChild(e[t]);for(;n.firstChild;)t.insertBefore(n.firstChild,t.firstChild);return t}))}hide(e,t){return this.each((n=>{n.style.display="block",e?setTimeout((()=>{n.style.display="none",t&&"function"==typeof t&&t(n)}),e):(n.style.display="none",t&&"function"==typeof t&&t(n))}))}show(e,t){return this.each((n=>{n.style.display="block",e?setTimeout((()=>{n.style.display="block",t&&"function"==typeof t&&t(n)}),e):(n.style.display="block",t&&"function"==typeof t&&t(n))}))}slideUp(e,t){const s=n.extend({duration:e,callback:t},{duration:300,callback:null});return this.each((e=>{e.style.height=e.scrollHeight+"px",e.style.overflow="hidden",e.style.transition=`height ${s.duration}ms ease-in-out`,setTimeout((()=>{e.style.height="0px"}),s.duration/100),setTimeout((()=>{e.style.display="none",e.style.overflow="",e.style.transition="",e.style.height="",s.callback&&"function"==typeof s.callback&&s.callback(e)}),s.duration-s.duration/100)}))}slideDown(e,t){const s=n.extend({duration:e,callback:t},{duration:300,callback:null});return this.each((e=>{let t=e.offsetHeight;"none"===e.style.display&&(e.style.display="",t=0),e.style.height=t+"px",e.style.transition=`height ${s.duration}ms ease-in-out`,e.offsetHeight,e.style.height=e.scrollHeight+"px",e.style.display="block",setTimeout((()=>{e.style.overflow="",e.style.transition="",e.style.display="",e.style.height="",s.callback&&"function"==typeof s.callback&&s.callback(e)}),s.duration)}))}slideToggle(e,t){const s=n.extend({duration:e,callback:t},{duration:500,callback:null});let i=!0;return this.each((e=>{"none"===e.style.display&&(i=!1)})),i?this.slideUp(s.duration,s.callback):this.slideDown(s.duration,s.callback),this}fadeOut(e,t){const s=n.extend({duration:e,callback:t},{duration:300,callback:null});return this.each((e=>{e.style.transition=`opacity ${s.duration}ms ease-in-out`,e.style.opacity="0",setTimeout((()=>{e.style.display="none",s.callback&&"function"==typeof s.callback&&s.callback(e)}),s.duration)}))}checkAll(e){const t=n.extend({checkboxes:e},{checkboxes:".be-check"});return this.each((e=>{let n=document.querySelectorAll(t.checkboxes);e.addEventListener("change",(function(){n.forEach((function(t){t.checked=e.checked}))}))}))}checkReverse(e){const t=n.extend({checkboxes:e},{checkboxes:".be-check"});return this.each((e=>{let n=document.querySelectorAll(t.checkboxes);e.addEventListener("click",(function(){n.forEach((function(e){e.checked=!e.checked}))}))}))}numStep(e){return e=n.extend(e,{start:0,end:100,duration:1500,callback:!1}),this.each((t=>{let s=null;requestAnimationFrame((function i(l){null===s&&(s=l);const o=Math.min((l-s)/e.duration,1),r=Math.floor(o*(e.end-e.start)+e.start);n.build(t).text(r.toString()),o<1?requestAnimationFrame(i):"function"==typeof e.callback&&e.callback()}))}))}scrollBG(e){return e=n.extend(e,{speed:0}),this.each((t=>{n.build(t).css("background-position","50% 0px"),n.build(window).on("scroll",(()=>{const s=n.build(t),i=s.offset().top,l=s.height(),o=s.scrollTop(),r=s.height();if(r+o>i&&r+o<i+r+l){const t=(i+l-o)/e.speed;s.css("background-position","50% -"+t+"px")}}))}))}setActive(e){const{className:t="active"}=e||{};n.build(this.elements).click((e=>{const s=n.build(e.currentTarget);s.hasClass(t)?s.removeClass(t):(n.build(this.elements).removeClass(t),s.addClass(t))}))}loading(e){let t=!1;return void 0!==e&&"object"!=typeof e&&(t=!0,e={}),e=n.extend(e,{isFull:!0,loadingTarget:"#do-preloader",template:'<div id="do-preloader" class="do-preloader"><span class="do-pr-loader"><span class="do-pr-lr"></span></span></div>'}),this.each((s=>{const i=e,l=i.loadingTarget,o=i.template;if(t)n.build("> *",s).removeClass("be-blur-2"),n.build(l).addClass("oy-0"),setTimeout((()=>{n.build("> *",s).removeClass("be-ts"),n.build(l).remove()}),300);else{n.build("> *",s).addClass("be-ts").addClass("be-blur-2"),n.build(s).prepend(o);const e=n.build(l);e.length&&e.css("position","fixed").css("height","100vh").css("width","100vw")}}))}static extend(e,t){if(!t)return e;{let n;for(n in e)if(null==e?void 0:e.hasOwnProperty(n)){const s=e[n];null==t[n]&&(t[n]=s)}}return t}static camelCase(e){let t=e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}));return t=t.replace(/\./g,""),t}static l(...e){window.console&&e&&console.log(...e)}static toRound(e,t){let n=parseFloat(String(e));return n=n?Math.round(e*Math.pow(10,t))/Math.pow(10,t):0,n}static isNull(e){let t=!0;return null!=e&&""!==e&&"undefined"!==e&&"null"!==e||(t=!1),t}static setDefault(e,t){return null!=e&&""!==e&&"undefined"!==e&&"null"!==e||(e=t),e}static isObject(e){return!!e&&e&&"object"==typeof e&&!Array.isArray(e)&&!0}static same(e,t){return e.filter((function(e){return-1!==t.indexOf(e)}))}static different(e,t){return e.concat(t).filter((function(n){return-1===e.indexOf(n)||-1===t.indexOf(n)}))}static contrast(e,t){return e.concat(t).filter((function(n){return-1===e.indexOf(n)&&-1!==t.indexOf(n)}))}static isHtmlTag(e){return/^<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>$|^<([a-z][a-z0-9]*)\b[^>]*\/>$/i.test(e)}static plugin(e,t){n.fn[e]=function(){t()}}static createElement(e){let t=document.createElement("div");t.innerHTML=e.trim();let n=t.firstChild;if((null==n?void 0:n.nodeType)===Node.TEXT_NODE){n=n.nextSibling;let e=document.createDocumentFragment();for(;n;)e.appendChild(n),n=n.nextSibling;return e}return n}static ajax(e){var t;if("get"===(null===(t=null==(e=n.extend(e,{url:"",method:"GET",async:!0,headerMap:{},cache:"default",dataType:"json",data:null,success:function(){},error:function(){}}))?void 0:e.method)||void 0===t?void 0:t.toLowerCase())){if(!e.url.includes("?")){let t=new URLSearchParams;for(let n in e.data)e.data.hasOwnProperty(n)&&t.append(n,e.data[n]);e.url=e.url+"?"+t.toString()}e.data=null}if(fetch)fetch(e.url,{method:e.method,headers:new Headers(e.headerMap),cache:e.cache,body:e.data?JSON.stringify(e.data):null}).then((function(t){return t.ok?"json"===e.dataType?t.json():t.text():Promise.reject(new Error("Failed to fetch resource"))})).then((function(t){e.success&&e.success(t)})).catch((function(t){e.error&&e.error(t)}));else{let t=new XMLHttpRequest;t.onload=function(){if(t.status>=200&&t.status<300){let n;switch(e.dataType){case"json":try{n=JSON.parse(t.responseText)}catch(t){return void(e.error&&e.error(t))}break;case"text":n=t.responseText;break;default:n=t.responseText||t.response}e.success&&e.success(n,t.status,t)}else{let n=new Error("Request failed. Status: "+t.status);e.error&&e.error(n)}},t.onerror=function(){e.error&&e.error(new Error("Network Error"))},t.open((null==e?void 0:e.method)||"get",e.url,e.async||!1);for(let n in e.headerMap)e.headerMap.hasOwnProperty(n)&&t.setRequestHeader(n,e.headerMap[n]);e.data?t.send(e.data):t.send()}}static getParam(e){let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),n=window.location.search.substr(1).match(t);return null!=n?unescape(n[2]):null}static move(e){const t=document.querySelector(e);if(t){let e=new n(t).offset();window.scrollTo(e.left,e.top)}}static strValidation(e,t,n){let s=0;return e.length<=t||e.length>=n?s=1:/^[0-9]{0,32}$/.test(e)?s=2:/^[a-zA-z]{0,32}$/.test(e)?s=3:/^[0-9a-zA-z]{0,32}$/.test(e)?s=4:/^[^\u4e00-\u9fa5a-zA-Z\d,.,。]{0,32}$/.test(e)?s=5:/^(?=.*\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])[\da-zA-Z~!@#$%^&*]*$/.test(e)&&(s=8),s}static hotkey(e,t){document.addEventListener("keydown",(function(n){e===n.key&&t()}))}static setCookie(e,t,n={}){let s="",i=n.path||"/",l=n.domain,o=n.secure?"; Secure":"";if(n.expires){let e;"number"==typeof n.expires?(e=new Date,e.setTime(e.getTime()+24*n.expires*60*60*1e3)):e=n.expires,s=`; expires=${e.toUTCString()}`}document.cookie=`${e}=${encodeURIComponent(t)}${s}; path=${i}; domain=${l||""}${o}`}static getCookie(e){let t=`${e}=`,n=document.cookie.split(";");for(let e=0;e<n.length;e++){let s=n[e];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}return null}static removeCookie(e,t={}){this.setCookie(e,"",Object.assign(Object.assign({},t),{expires:-1}))}static menu(e,t){const n=function(e,s,i){let l="";++s;for(let o=0;o<e.length;o++){const r=e[o];let a="#";if(r.link&&(a=r.link),r.pId||0!==s){if(r.pId===i){let t="";r.isParent&&(t=n(e,s,r.id),t&&(t="<ul class='sub'>"+t+"</ul>"));let i="";1===s&&(i=`<i class='${r.icon}'></i>`);let o=r.hash?` data-hash='${r.hash}' `:" ",c=r.actionId?` id='${r.actionId}' `:" ";l+=`<li class='sub-menu'><a${r.isParent?" class='mu-js-a' ":" "}${o}${r.tid?` data-tid='${r.tid}' `:" "}${c}href='${a}'>`+i+`<span>${r.name}</span></a>`+t+"</li>"}}else if(t)l=n(e,s,r.id);else{let t=n(e,s,r.id);t&&(t="<ul class='sub'>"+t+"</ul>"),l+=`<li class='sub-menu'><a${r.hash?` data-hash='${r.hash}' `:" "}${r.actionId?` id='${r.actionId}' `:" "}href='${a}'><span>${r.name}</span></a>`+t+"</li>"}}return l};let s="";return e&&(s=n(e,-1,0)),""+s}static menu2Tree(e,t,s){let i=[];return e.forEach((function(l){l.pId===t&&(l.isactive=`a${l.id}`===s,i.push(l),l.isParent&&(l.children=n.menu2Tree(e,l.id)))})),i}static search(e){var t;const s=n.build(".fm-search"),i=n.build("input",s),l=n.build("span:eq(0)",s),o=n.build("span:eq(1)",s);i.on("change",(e=>{var t,s;const i=n.build(e.currentTarget);""!==i.val()?null===(t=i.next())||void 0===t||t.css("opacity","1").css("visibility","visible"):null===(s=i.next())||void 0===s||s.css("opacity","0").css("visibility","hidden")})),""!==i.val()&&(null===(t=i.next())||void 0===t||t.css("opacity","1").css("visibility","visible")),o.on("click",(e=>{var t;const s=n.build(e.currentTarget);s.css("opacity","0").css("visibility","hidden"),null===(t=s.prev())||void 0===t||t.val("")})),l.on("click",(t=>{var s;const i=n.build(t.currentTarget);e&&e(null===(s=i.next())||void 0===s?void 0:s.val())}))}static shuffleArray(e){if(!Array.isArray(e))return e;const t=[...e];for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}static defaultConstructor(e,t,s,i){"string"==typeof t?e.elements=document.querySelectorAll(t):t instanceof NodeList?e.elements=t:t instanceof HTMLElement?e.elements=Array.of(t):e.elements=[],e.options=n.extend(s,e.options),i(e)}static contextQuerySelector(e,t){if(e.startsWith(">"))return Array.from(t.querySelectorAll(e.substring(1))).filter((function(e){return e.parentNode===t}));{const n=t.querySelectorAll(e);return 0===n.length?Array.from(document.querySelectorAll(e)):Array.from(n)}}static isEqSelector(e){const t=e.match(/^[\w-]+:eq\((\d+)\)$/);return null!==t&&void 0!==t[1]}static build(e,t){return new(this||n)(e,t)}}n.keys={esc:"Escape",backspace:"Backspace",space:" ",enter:"Enter",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight"},n.dataAttr=function(e,t){var n;let s="data-"+t;return null!==(n=e.getAttribute(s))&&void 0!==n?n:void 0},n.expando="base"+(""+Math.random()).replace(/\D/g,""),n.elementData=new Map,n.cache={},n.build.extend=n.extend,n.build.camelCase=n.camelCase,n.build.l=n.l,n.build.getParam=n.getParam,n.build.toRound=n.toRound,n.build.isNull=n.isNull,n.build.setDefault=n.setDefault,n.build.same=n.same,n.build.different=n.different,n.build.contrast=n.contrast,n.build.strValidation=n.strValidation,n.build.move=n.move,n.build.keys=n.keys,n.build.hotkey=n.hotkey,n.build.isHtmlTag=n.isHtmlTag,n.build.isObject=n.isObject,n.build.plugin=n.plugin,n.build.ajax=n.ajax,n.build.setCookie=n.setCookie,n.build.getCookie=n.getCookie,n.build.removeCookie=n.removeCookie,n.build.menu=n.menu,n.build.menu2Tree=n.menu2Tree,n.build.search=n.search,n.build.shuffleArray=n.shuffleArray,n.build.defaultConstructor=n.defaultConstructor;const s=n.build;Date.prototype.format=function(e){let t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(let n in t)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1===RegExp.$1.length?t[n]:("00"+t[n]).substr((""+t[n]).length)));return e},Array.prototype.remove=function(e,t){let n=this.slice((t||e)+1||this.length);return this.length=e<0?this.length+e:e,this.push.apply(this,n)},Array.prototype.unique=function(){let e=[];this.sort();for(let t=0;t<this.length;t++)this[t]!==this[t+1]&&(e[e.length]=this[t]);return e};const i=s;class l{constructor(e,t){this.options={classParent:"ia-parent",classActive:"active",classArrow:"ia-icon",classCount:"ia-count",autoExpand:!1,classExpand:"ia-current-parent",autoClose:!0,speed:300,saveState:!0,disableLink:!0,showCount:!1,cookie:"ia-cookie",smallClass:"ce-accordion-small"},this.selector=e,n.defaultConstructor(this,e,t,(e=>{e.elements.forEach((n=>{let s=i(n);s.data("be.iaccordion")||s.data("be.iaccordion",e),e.init(n,t)}))}))}init(e,t){const n=this,s=i("li > a",e),l=i("li > ul",e),o=(t=i.extend(t,n.options)).classActive;this.setUpAccordion(e,s,l,t),!0===t.saveState&&n.checkCookie(t.cookie,e,o),!0===t.autoExpand&&i("li."+t.classExpand+" > a").addClass(o),s.click((s=>{const l=i(s.currentTarget),r=l.parent(),a=n.isSmall(s,e,t.smallClass);!0===t.disableLink&&l.siblings().length>0&&s.preventDefault(),!0===t.autoClose&&n.autoCloseAccordion(e,l,a,t),0===i("> ul",r).length?i("> a",r).addClass(o):"none"!==i("> ul",r).css("display")?(n.slideUp(i("ul",r),a,t),i("a",r).removeClass(o)):("none"===i(s.currentTarget).siblings().css("display")?n.slideDown(i(s.currentTarget).siblings().css("overflow","hidden"),a,t):n.slideUp(i(s.currentTarget).siblings(),a,t),i("> a",r).addClass(o)),!0===t.saveState&&n.createCookie(t.cookie,e,o)}))}setUpAccordion(e,t,n,s){const l='<span class="'+s.classArrow+'"></span>',o=s.classParent+"-li";n.show(),i("li",e).each((e=>{i("> ul",e).length>0&&(i(e).addClass(o),i("> a",e).addClass(s.classParent).append(l))})),n.hide(),!0===s.showCount&&i("ul",e).each((e=>{i("> a",i(e).parent()).append(' <span class="'+s.classCount+'">('+e.children.length+")</span>")}))}autoCloseAccordion(e,t,n,s){const l=this;i("ul",e).each((e=>{let o=!1;t.parents("ul").each((t=>{t===e&&(o=!0)})),o||t.siblings().elements[0]===e||"none"===e.style.display||l.slideUp(i(e),n,s)})),i("a",e).removeClass(s.classActive),t.parents("li").each((e=>{i("> a",e).addClass(s.classActive)}))}checkCookie(e,t,n){const s=this,l=i.getCookie(e);if(null!==l&&""!==l){const e=l.split(",");s.setActiveMenu(t,e,0,n)}}setActiveMenu(e,t,n,s){const l=i("li:eq("+t[n]+")",e),o=i("> a",l),r=o.siblings();o.addClass(s),r.css("display",""),t.length>n+1&&this.setActiveMenu(r,t,++n,s)}createCookie(e,t,n){let s=[];i("li a."+n,t).each((e=>{const t=i(e).parent().index();s.push(t.toString())})),i.setCookie(e,s.join(","))}isSmall(e,t,n){return!(!i(t).hasClass(n)||0===i(e.currentTarget).siblings().length||(e.preventDefault(),0))}slideDown(e,t,n){t||e.slideDown(n.speed)}slideUp(e,t,n){t||e.slideUp(n.speed)}}class o{constructor(e,t){this.options={position:{bottom:"15px",right:"15px"},showEffect:" animate__zoomIn ",hideEffect:" animate__zoomOut ",type:"fixed",offsetTop:400},this.selector=e,n.defaultConstructor(this,e,t,(e=>{e.elements.forEach((n=>{let s=i(n);s.data("be.gotop")||s.data("be.gotop",e),e.init(n,t)}))}))}init(e,t){const n=i(e),s=(t=i.extend(t,this.options)).type||"fixed",l=t.showEffect||" animate__zoomIn ",o=t.position,r=void 0!==t.offsetTop?Number(t.offsetTop):400,a=t.hideEffect||" animate__zoomOut ";n.addClass("animate__animated").css({display:"inline-block",position:s,opacity:0}),"fixed"!==s&&"absolute"!==s||n.css(o),n.on("click",(e=>{e.preventDefault(),window.scrollTo(0,0)})),r&&!n.hasClass("animated-running")&&n.offset().top<=i(window).height()&&n.addClass("animated-running "+l).css({opacity:""}),i(window).on("scroll",(()=>{if(r)i(window).scrollTop()>=r&&!n.hasClass("animated-running")?(n.addClass("animated-running "+l).css({opacity:""}),n.removeClass(a)):i(window).scrollTop()<=r&&n.hasClass("animated-running")&&(n.removeClass("animated-running "+l).css({opacity:0}),n.addClass(a));else{let e=n.offset().top;n.hasClass("animated-running")||i(window).scrollTop()>=e-i(window).height()&&(n.addClass("animated-running "+l).css({opacity:""}),n.removeClass(a))}})),i(window).trigger("scroll")}}const r=i;module.exports.b=t})();
@@ -0,0 +1 @@
1
+ class e{constructor(t,n){if(this.elements=[],this.length=0,n=n instanceof e?n.elements[0]:n||document,"string"==typeof t)if(n&&"string"==typeof n&&(n=document.querySelector(n)),e.isEqSelector(t)){const s=t.split(":")[0],i=t.match(/:eq\((\d+)\)/);if(i){const t=parseInt(i[1]),l=e.contextQuerySelector(">"+s,n);l.length>0?this.elements=[l[t]]:this.elements=[]}else this.elements=[]}else this.elements=e.contextQuerySelector(t,n);else t instanceof NodeList||t instanceof HTMLElement?this.elements=t instanceof NodeList?Array.from(t):[t]:t instanceof Window?this.elements=[window]:null!==t&&"object"==typeof t&&"documentElement"in t?this.elements=[n]:Array.isArray(t)?this.elements=t:this.elements=[];this.length=this.elements.length}each(e){return this.elements.forEach(((t,n)=>{e(t,n)})),this}hasClass(e){let t=!1;return this.each((n=>{t=n.classList.contains(e)})),t}addClass(e){return this.each((t=>{if(/\s/.test(e)){const n=e.split(" ");for(let e=0;e<n.length;e++)n[e]&&t.classList.add(n[e])}else e&&t.classList.add(e)}))}removeClass(e){return this.each((t=>{if(void 0===e)t.className="";else if(e||0!==e.length)if(/\s/.test(e)){const n=e.split(" ");for(let e=0;e<n.length;e++)n[e]&&t.classList.remove(n[e].trim())}else t.classList.remove(e.trim())}))}toggleClass(e){return this.each((t=>{if(t.classList)t.classList.toggle(e);else{let n=t.className.split(/\s+/),s=n.indexOf(e);s>=0?n.splice(s,1):n.push(e),t.className=n.join(" ")}}))}not(t){let n=t instanceof e?t.elements:Array.from(document.querySelectorAll(t));return this.elements=Array.from(this.elements).filter((e=>!n.includes(e))),this}is(e){var t;let n=this.elements[0];if(":visible"===e){if("none"===n.style.display||"hidden"===n.style.visibility||"0"===getComputedStyle(n).opacity)return!1}else{if(":first-child"===e)return(null===(t=n.parentNode)||void 0===t?void 0:t.firstChild)===n;if(":last-child"!==e)return n.matches(e);{const e=n.parentNode;if(e){const t=e.children;return t[t.length-1]===n}}}return!1}closest(t){let n=this.elements[0];if(!n)return e.build([]);const s=n.matches||n.webkitMatchesSelector;if(s.call(n,t))return this.constructor===e?e.build(this.elements):this;let i=n.parentElement;for(;i;){if(s.call(i,t))return e.build(i);i=i.parentElement}return e.build([])}next(){if(1===this.elements.length){const t=this.elements[0].nextElementSibling;return t instanceof Element?e.build(t):e.build([])}if(this.elements.length>1){const t=[],n=this.elements[0].nextElementSibling;n instanceof Element&&t.push(n);for(let e=1;e<this.elements.length-1;e++)this.elements[e]instanceof Element&&t.push(this.elements[e]);const s=this.elements[this.elements.length-1].nextElementSibling;return s instanceof Element&&t.push(s),e.build(t)}return null}nextAll(e){const t=[];let n=this.elements[0],s=n.nextSibling,i=n.parentElement;for(;s&&(1===s.nodeType&&(e&&!s.matches(e)||t.unshift(s)),s=s.nextSibling,null!==s||0!==t.length||(null==i?void 0:i.firstChild)!==n););return this.elements=t,this.length=this.elements.length,this}prev(){if(1===this.elements.length)return e.build(this.elements[0].previousElementSibling);if(this.elements.length>1){let t=e.build(this.elements[0].previousElementSibling);return this.each(((e,n)=>{n>1&&(t.elements.push(e),n===this.elements.length-1&&t.elements.push(e.previousElementSibling))})),t}return null}prevAll(e){const t=[];let n=this.elements[this.elements.length-1],s=n.previousSibling,i=n.parentElement;for(;s&&(1===s.nodeType&&(e&&!s.matches(e)||t.unshift(s)),s=s.previousSibling,null!==s||0!==t.length||(null==i?void 0:i.firstChild)!==n););return this.elements=t,this.length=this.elements.length,this}first(){return new e([this.elements[0]])}find(t){if(t&&"option:selected"===t.trim()){const t=[];return this.each((e=>{("select-one"===e.type||"select-multiple"===e.type)&&e.selectedIndex>=0&&t.push(e.options[e.selectedIndex])})),new e(t)}{const n=[];return this.elements.forEach((e=>{e instanceof HTMLElement&&e.querySelectorAll(t).forEach((e=>n.push(e)))})),new e(n)}}parent(){let t=this.elements[0];return t?new e(t.parentNode):new e}parents(t){const n=[];let s=this.elements[0].parentElement;for(;s&&s!==document.documentElement;)t&&!s.matches(t)||n.push(s),s=s.parentElement;return new e(n)}siblings(){let t=this.elements[0];if(t&&1===t.nodeType){let n=t.parentNode;if(n){let s=[];for(let e=0;e<n.childNodes.length;e++){let i=n.childNodes[e];1===i.nodeType&&i!==t&&s.push(i)}return new e(s)}return new e}return new e}children(){let t=[];return this.each((e=>{t.push(...Array.from(e.children))})),new e(t)}index(){var e;const t=this.elements[0],n=null===(e=t.parentNode)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return e;return-1}size(){return this.elements?this.elements.length:0}on(e,t){return this.each((function(n){n.addEventListener(e,t)}))}off(e,t){return this.each((function(n){n.removeEventListener&&t&&n.removeEventListener(e,t)}))}click(e){return"function"==typeof e?this.on("click",e):this.each((e=>{const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(t)})),this}focus(e){return"function"==typeof e&&this.on("focus",e),this}change(e){return e&&this.each((t=>{t.addEventListener("change",e,!1)})),this}trigger(e,t){return this.each((function(n){let s;try{s=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0})}catch(n){s=document.createEvent("CustomEvent"),s.initCustomEvent(e,!0,!0,t)}n.dispatchEvent(s)})),this}remove(){return this.each((e=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)}))}data(t,n){if(void 0===t)throw new Error("读取的或设置的键值不能为空");let s=this.elements[0];if(void 0!==n){let i=e.elementData.get(s);return i||(i=new Map,e.elementData.set(s,i)),i.set(e.camelCase(t),n),this}{const n=e.elementData.get(s);return n?n.get(e.camelCase(t)):e.dataAttr(s,t)}}removeData(t){let n=this.elements[0],s=e.elementData.get(n);s&&s.set(e.camelCase(t),void 0)}attr(e,t){if(0===this.elements.length)return void 0===t?"":this;const n=this.elements[0];return void 0===t?(null==n?void 0:n.getAttribute(e))||"":this.each((n=>n.setAttribute(e,t)))}removeAttr(e){return this.each((t=>{"function"==typeof t.removeAttribute&&t.removeAttribute(e)}))}offset(){let e=this.elements[0].getBoundingClientRect(),t=window.pageYOffset||document.documentElement.scrollTop,n=window.pageXOffset||document.documentElement.scrollLeft;return{top:e.top+t,left:e.left+n}}scrollTop(){return this.elements[0]instanceof Window?void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop:document.documentElement.scrollTop}height(){const e=this.elements[0];return e===window?window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight:e.offsetHeight}width(){const e=this.elements[0];return e===window?window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth:e.offsetWidth}val(e){let t=this.elements[0];if("select-multiple"===t.type){if(void 0!==e){for(let n=t.options.length-1;n>=0;n--)t.options[n].selected=t.options[n].value===e;return this}{let e=[];for(let n=0;n<t.options.length;n++)t.options[n].selected&&e.push(t.options[n].value);return e}}return void 0!==e?(t.value=e,this):t.value}css(e,t){if(0===this.elements.length)return this;if(void 0===t){if("object"==typeof e){const t=e;for(const e in t)if(t.hasOwnProperty(e)){const n=t[e];this.each((t=>{t.style[e]=n}))}return this}return this.elements[0].style[e]||""}return this.each((n=>{n.style[e]=t}))}text(e){if(0===this.elements.length)return void 0===e?"":this;const t=this.elements[0];return void 0===e?t.textContent||"":this.each((t=>{t.textContent=e}))}html(e){if(0===this.elements.length)return void 0===e?"":this;const t=this.elements[0];return void 0===e?t&&1===t.nodeType?t.innerHTML:"":this.each((t=>{t&&1===t.nodeType&&(t.innerHTML=e)}))}after(e){return this.each((t=>{t.insertAdjacentHTML("afterend",e)}))}append(e){return this.each((t=>{let n=document.createElement("div");if("string"==typeof e)n.innerHTML=e;else if(e instanceof Node)n.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)n.appendChild(e[t]);for(;n.firstChild;)t.appendChild(n.firstChild);return t}))}prepend(e){return this.each((t=>{let n=document.createElement("div");if("string"==typeof e)n.innerHTML=e;else if(e instanceof Node)n.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)n.appendChild(e[t]);for(;n.firstChild;)t.insertBefore(n.firstChild,t.firstChild);return t}))}hide(e,t){return this.each((n=>{n.style.display="block",e?setTimeout((()=>{n.style.display="none",t&&"function"==typeof t&&t(n)}),e):(n.style.display="none",t&&"function"==typeof t&&t(n))}))}show(e,t){return this.each((n=>{n.style.display="block",e?setTimeout((()=>{n.style.display="block",t&&"function"==typeof t&&t(n)}),e):(n.style.display="block",t&&"function"==typeof t&&t(n))}))}slideUp(t,n){const s=e.extend({duration:t,callback:n},{duration:300,callback:null});return this.each((e=>{e.style.height=e.scrollHeight+"px",e.style.overflow="hidden",e.style.transition=`height ${s.duration}ms ease-in-out`,setTimeout((()=>{e.style.height="0px"}),s.duration/100),setTimeout((()=>{e.style.display="none",e.style.overflow="",e.style.transition="",e.style.height="",s.callback&&"function"==typeof s.callback&&s.callback(e)}),s.duration-s.duration/100)}))}slideDown(t,n){const s=e.extend({duration:t,callback:n},{duration:300,callback:null});return this.each((e=>{let t=e.offsetHeight;"none"===e.style.display&&(e.style.display="",t=0),e.style.height=t+"px",e.style.transition=`height ${s.duration}ms ease-in-out`,e.offsetHeight,e.style.height=e.scrollHeight+"px",e.style.display="block",setTimeout((()=>{e.style.overflow="",e.style.transition="",e.style.display="",e.style.height="",s.callback&&"function"==typeof s.callback&&s.callback(e)}),s.duration)}))}slideToggle(t,n){const s=e.extend({duration:t,callback:n},{duration:500,callback:null});let i=!0;return this.each((e=>{"none"===e.style.display&&(i=!1)})),i?this.slideUp(s.duration,s.callback):this.slideDown(s.duration,s.callback),this}fadeOut(t,n){const s=e.extend({duration:t,callback:n},{duration:300,callback:null});return this.each((e=>{e.style.transition=`opacity ${s.duration}ms ease-in-out`,e.style.opacity="0",setTimeout((()=>{e.style.display="none",s.callback&&"function"==typeof s.callback&&s.callback(e)}),s.duration)}))}checkAll(t){const n=e.extend({checkboxes:t},{checkboxes:".be-check"});return this.each((e=>{let t=document.querySelectorAll(n.checkboxes);e.addEventListener("change",(function(){t.forEach((function(t){t.checked=e.checked}))}))}))}checkReverse(t){const n=e.extend({checkboxes:t},{checkboxes:".be-check"});return this.each((e=>{let t=document.querySelectorAll(n.checkboxes);e.addEventListener("click",(function(){t.forEach((function(e){e.checked=!e.checked}))}))}))}numStep(t){return t=e.extend(t,{start:0,end:100,duration:1500,callback:!1}),this.each((n=>{let s=null;requestAnimationFrame((function i(l){null===s&&(s=l);const o=Math.min((l-s)/t.duration,1),r=Math.floor(o*(t.end-t.start)+t.start);e.build(n).text(r.toString()),o<1?requestAnimationFrame(i):"function"==typeof t.callback&&t.callback()}))}))}scrollBG(t){return t=e.extend(t,{speed:0}),this.each((n=>{e.build(n).css("background-position","50% 0px"),e.build(window).on("scroll",(()=>{const s=e.build(n),i=s.offset().top,l=s.height(),o=s.scrollTop(),r=s.height();if(r+o>i&&r+o<i+r+l){const e=(i+l-o)/t.speed;s.css("background-position","50% -"+e+"px")}}))}))}setActive(t){const{className:n="active"}=t||{};e.build(this.elements).click((t=>{const s=e.build(t.currentTarget);s.hasClass(n)?s.removeClass(n):(e.build(this.elements).removeClass(n),s.addClass(n))}))}loading(t){let n=!1;return void 0!==t&&"object"!=typeof t&&(n=!0,t={}),t=e.extend(t,{isFull:!0,loadingTarget:"#do-preloader",template:'<div id="do-preloader" class="do-preloader"><span class="do-pr-loader"><span class="do-pr-lr"></span></span></div>'}),this.each((s=>{const i=t,l=i.loadingTarget,o=i.template;if(n)e.build("> *",s).removeClass("be-blur-2"),e.build(l).addClass("oy-0"),setTimeout((()=>{e.build("> *",s).removeClass("be-ts"),e.build(l).remove()}),300);else{e.build("> *",s).addClass("be-ts").addClass("be-blur-2"),e.build(s).prepend(o);const t=e.build(l);t.length&&t.css("position","fixed").css("height","100vh").css("width","100vw")}}))}static extend(e,t){if(!t)return e;{let n;for(n in e)if(null==e?void 0:e.hasOwnProperty(n)){const s=e[n];null==t[n]&&(t[n]=s)}}return t}static camelCase(e){let t=e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}));return t=t.replace(/\./g,""),t}static l(...e){window.console&&e&&console.log(...e)}static toRound(e,t){let n=parseFloat(String(e));return n=n?Math.round(e*Math.pow(10,t))/Math.pow(10,t):0,n}static isNull(e){let t=!0;return null!=e&&""!==e&&"undefined"!==e&&"null"!==e||(t=!1),t}static setDefault(e,t){return null!=e&&""!==e&&"undefined"!==e&&"null"!==e||(e=t),e}static isObject(e){return!!e&&e&&"object"==typeof e&&!Array.isArray(e)&&!0}static same(e,t){return e.filter((function(e){return-1!==t.indexOf(e)}))}static different(e,t){return e.concat(t).filter((function(n){return-1===e.indexOf(n)||-1===t.indexOf(n)}))}static contrast(e,t){return e.concat(t).filter((function(n){return-1===e.indexOf(n)&&-1!==t.indexOf(n)}))}static isHtmlTag(e){return/^<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>$|^<([a-z][a-z0-9]*)\b[^>]*\/>$/i.test(e)}static plugin(t,n){e.fn[t]=function(){n()}}static createElement(e){let t=document.createElement("div");t.innerHTML=e.trim();let n=t.firstChild;if((null==n?void 0:n.nodeType)===Node.TEXT_NODE){n=n.nextSibling;let e=document.createDocumentFragment();for(;n;)e.appendChild(n),n=n.nextSibling;return e}return n}static ajax(t){var n;if("get"===(null===(n=null==(t=e.extend(t,{url:"",method:"GET",async:!0,headerMap:{},cache:"default",dataType:"json",data:null,success:function(){},error:function(){}}))?void 0:t.method)||void 0===n?void 0:n.toLowerCase())){if(!t.url.includes("?")){let e=new URLSearchParams;for(let n in t.data)t.data.hasOwnProperty(n)&&e.append(n,t.data[n]);t.url=t.url+"?"+e.toString()}t.data=null}if(fetch)fetch(t.url,{method:t.method,headers:new Headers(t.headerMap),cache:t.cache,body:t.data?JSON.stringify(t.data):null}).then((function(e){return e.ok?"json"===t.dataType?e.json():e.text():Promise.reject(new Error("Failed to fetch resource"))})).then((function(e){t.success&&t.success(e)})).catch((function(e){t.error&&t.error(e)}));else{let e=new XMLHttpRequest;e.onload=function(){if(e.status>=200&&e.status<300){let n;switch(t.dataType){case"json":try{n=JSON.parse(e.responseText)}catch(e){return void(t.error&&t.error(e))}break;case"text":n=e.responseText;break;default:n=e.responseText||e.response}t.success&&t.success(n,e.status,e)}else{let n=new Error("Request failed. Status: "+e.status);t.error&&t.error(n)}},e.onerror=function(){t.error&&t.error(new Error("Network Error"))},e.open((null==t?void 0:t.method)||"get",t.url,t.async||!1);for(let n in t.headerMap)t.headerMap.hasOwnProperty(n)&&e.setRequestHeader(n,t.headerMap[n]);t.data?e.send(t.data):e.send()}}static getParam(e){let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),n=window.location.search.substr(1).match(t);return null!=n?unescape(n[2]):null}static move(t){const n=document.querySelector(t);if(n){let t=new e(n).offset();window.scrollTo(t.left,t.top)}}static strValidation(e,t,n){let s=0;return e.length<=t||e.length>=n?s=1:/^[0-9]{0,32}$/.test(e)?s=2:/^[a-zA-z]{0,32}$/.test(e)?s=3:/^[0-9a-zA-z]{0,32}$/.test(e)?s=4:/^[^\u4e00-\u9fa5a-zA-Z\d,.,。]{0,32}$/.test(e)?s=5:/^(?=.*\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])[\da-zA-Z~!@#$%^&*]*$/.test(e)&&(s=8),s}static hotkey(e,t){document.addEventListener("keydown",(function(n){e===n.key&&t()}))}static setCookie(e,t,n={}){let s="",i=n.path||"/",l=n.domain,o=n.secure?"; Secure":"";if(n.expires){let e;"number"==typeof n.expires?(e=new Date,e.setTime(e.getTime()+24*n.expires*60*60*1e3)):e=n.expires,s=`; expires=${e.toUTCString()}`}document.cookie=`${e}=${encodeURIComponent(t)}${s}; path=${i}; domain=${l||""}${o}`}static getCookie(e){let t=`${e}=`,n=document.cookie.split(";");for(let e=0;e<n.length;e++){let s=n[e];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}return null}static removeCookie(e,t={}){this.setCookie(e,"",Object.assign(Object.assign({},t),{expires:-1}))}static menu(e,t){const n=function(e,s,i){let l="";++s;for(let o=0;o<e.length;o++){const r=e[o];let a="#";if(r.link&&(a=r.link),r.pId||0!==s){if(r.pId===i){let t="";r.isParent&&(t=n(e,s,r.id),t&&(t="<ul class='sub'>"+t+"</ul>"));let i="";1===s&&(i=`<i class='${r.icon}'></i>`);let o=r.hash?` data-hash='${r.hash}' `:" ",c=r.actionId?` id='${r.actionId}' `:" ";l+=`<li class='sub-menu'><a${r.isParent?" class='mu-js-a' ":" "}${o}${r.tid?` data-tid='${r.tid}' `:" "}${c}href='${a}'>`+i+`<span>${r.name}</span></a>`+t+"</li>"}}else if(t)l=n(e,s,r.id);else{let t=n(e,s,r.id);t&&(t="<ul class='sub'>"+t+"</ul>"),l+=`<li class='sub-menu'><a${r.hash?` data-hash='${r.hash}' `:" "}${r.actionId?` id='${r.actionId}' `:" "}href='${a}'><span>${r.name}</span></a>`+t+"</li>"}}return l};let s="";return e&&(s=n(e,-1,0)),""+s}static menu2Tree(t,n,s){let i=[];return t.forEach((function(l){l.pId===n&&(l.isactive=`a${l.id}`===s,i.push(l),l.isParent&&(l.children=e.menu2Tree(t,l.id)))})),i}static search(t){var n;const s=e.build(".fm-search"),i=e.build("input",s),l=e.build("span:eq(0)",s),o=e.build("span:eq(1)",s);i.on("change",(t=>{var n,s;const i=e.build(t.currentTarget);""!==i.val()?null===(n=i.next())||void 0===n||n.css("opacity","1").css("visibility","visible"):null===(s=i.next())||void 0===s||s.css("opacity","0").css("visibility","hidden")})),""!==i.val()&&(null===(n=i.next())||void 0===n||n.css("opacity","1").css("visibility","visible")),o.on("click",(t=>{var n;const s=e.build(t.currentTarget);s.css("opacity","0").css("visibility","hidden"),null===(n=s.prev())||void 0===n||n.val("")})),l.on("click",(n=>{var s;const i=e.build(n.currentTarget);t&&t(null===(s=i.next())||void 0===s?void 0:s.val())}))}static shuffleArray(e){if(!Array.isArray(e))return e;const t=[...e];for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}static defaultConstructor(t,n,s,i){"string"==typeof n?t.elements=document.querySelectorAll(n):n instanceof NodeList?t.elements=n:n instanceof HTMLElement?t.elements=Array.of(n):t.elements=[],t.options=e.extend(s,t.options),i(t)}static contextQuerySelector(e,t){if(e.startsWith(">"))return Array.from(t.querySelectorAll(e.substring(1))).filter((function(e){return e.parentNode===t}));{const n=t.querySelectorAll(e);return 0===n.length?Array.from(document.querySelectorAll(e)):Array.from(n)}}static isEqSelector(e){const t=e.match(/^[\w-]+:eq\((\d+)\)$/);return null!==t&&void 0!==t[1]}static build(t,n){return new(this||e)(t,n)}}e.keys={esc:"Escape",backspace:"Backspace",space:" ",enter:"Enter",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight"},e.dataAttr=function(e,t){var n;let s="data-"+t;return null!==(n=e.getAttribute(s))&&void 0!==n?n:void 0},e.expando="base"+(""+Math.random()).replace(/\D/g,""),e.elementData=new Map,e.cache={},e.build.extend=e.extend,e.build.camelCase=e.camelCase,e.build.l=e.l,e.build.getParam=e.getParam,e.build.toRound=e.toRound,e.build.isNull=e.isNull,e.build.setDefault=e.setDefault,e.build.same=e.same,e.build.different=e.different,e.build.contrast=e.contrast,e.build.strValidation=e.strValidation,e.build.move=e.move,e.build.keys=e.keys,e.build.hotkey=e.hotkey,e.build.isHtmlTag=e.isHtmlTag,e.build.isObject=e.isObject,e.build.plugin=e.plugin,e.build.ajax=e.ajax,e.build.setCookie=e.setCookie,e.build.getCookie=e.getCookie,e.build.removeCookie=e.removeCookie,e.build.menu=e.menu,e.build.menu2Tree=e.menu2Tree,e.build.search=e.search,e.build.shuffleArray=e.shuffleArray,e.build.defaultConstructor=e.defaultConstructor;const t=e.build;Date.prototype.format=function(e){let t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(let n in t)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1===RegExp.$1.length?t[n]:("00"+t[n]).substr((""+t[n]).length)));return e},Array.prototype.remove=function(e,t){let n=this.slice((t||e)+1||this.length);return this.length=e<0?this.length+e:e,this.push.apply(this,n)},Array.prototype.unique=function(){let e=[];this.sort();for(let t=0;t<this.length;t++)this[t]!==this[t+1]&&(e[e.length]=this[t]);return e};const n=t;class s{constructor(t,s){this.options={classParent:"ia-parent",classActive:"active",classArrow:"ia-icon",classCount:"ia-count",autoExpand:!1,classExpand:"ia-current-parent",autoClose:!0,speed:300,saveState:!0,disableLink:!0,showCount:!1,cookie:"ia-cookie",smallClass:"ce-accordion-small"},this.selector=t,e.defaultConstructor(this,t,s,(e=>{e.elements.forEach((t=>{let i=n(t);i.data("be.iaccordion")||i.data("be.iaccordion",e),e.init(t,s)}))}))}init(e,t){const s=this,i=n("li > a",e),l=n("li > ul",e),o=(t=n.extend(t,s.options)).classActive;this.setUpAccordion(e,i,l,t),!0===t.saveState&&s.checkCookie(t.cookie,e,o),!0===t.autoExpand&&n("li."+t.classExpand+" > a").addClass(o),i.click((i=>{const l=n(i.currentTarget),r=l.parent(),a=s.isSmall(i,e,t.smallClass);!0===t.disableLink&&l.siblings().length>0&&i.preventDefault(),!0===t.autoClose&&s.autoCloseAccordion(e,l,a,t),0===n("> ul",r).length?n("> a",r).addClass(o):"none"!==n("> ul",r).css("display")?(s.slideUp(n("ul",r),a,t),n("a",r).removeClass(o)):("none"===n(i.currentTarget).siblings().css("display")?s.slideDown(n(i.currentTarget).siblings().css("overflow","hidden"),a,t):s.slideUp(n(i.currentTarget).siblings(),a,t),n("> a",r).addClass(o)),!0===t.saveState&&s.createCookie(t.cookie,e,o)}))}setUpAccordion(e,t,s,i){const l='<span class="'+i.classArrow+'"></span>',o=i.classParent+"-li";s.show(),n("li",e).each((e=>{n("> ul",e).length>0&&(n(e).addClass(o),n("> a",e).addClass(i.classParent).append(l))})),s.hide(),!0===i.showCount&&n("ul",e).each((e=>{n("> a",n(e).parent()).append(' <span class="'+i.classCount+'">('+e.children.length+")</span>")}))}autoCloseAccordion(e,t,s,i){const l=this;n("ul",e).each((e=>{let o=!1;t.parents("ul").each((t=>{t===e&&(o=!0)})),o||t.siblings().elements[0]===e||"none"===e.style.display||l.slideUp(n(e),s,i)})),n("a",e).removeClass(i.classActive),t.parents("li").each((e=>{n("> a",e).addClass(i.classActive)}))}checkCookie(e,t,s){const i=this,l=n.getCookie(e);if(null!==l&&""!==l){const e=l.split(",");i.setActiveMenu(t,e,0,s)}}setActiveMenu(e,t,s,i){const l=n("li:eq("+t[s]+")",e),o=n("> a",l),r=o.siblings();o.addClass(i),r.css("display",""),t.length>s+1&&this.setActiveMenu(r,t,++s,i)}createCookie(e,t,s){let i=[];n("li a."+s,t).each((e=>{const t=n(e).parent().index();i.push(t.toString())})),n.setCookie(e,i.join(","))}isSmall(e,t,s){return!(!n(t).hasClass(s)||0===n(e.currentTarget).siblings().length||(e.preventDefault(),0))}slideDown(e,t,n){t||e.slideDown(n.speed)}slideUp(e,t,n){t||e.slideUp(n.speed)}}class i{constructor(t,s){this.options={position:{bottom:"15px",right:"15px"},showEffect:" animate__zoomIn ",hideEffect:" animate__zoomOut ",type:"fixed",offsetTop:400},this.selector=t,e.defaultConstructor(this,t,s,(e=>{e.elements.forEach((t=>{let i=n(t);i.data("be.gotop")||i.data("be.gotop",e),e.init(t,s)}))}))}init(e,t){const s=n(e),i=(t=n.extend(t,this.options)).type||"fixed",l=t.showEffect||" animate__zoomIn ",o=t.position,r=void 0!==t.offsetTop?Number(t.offsetTop):400,a=t.hideEffect||" animate__zoomOut ";s.addClass("animate__animated").css({display:"inline-block",position:i,opacity:0}),"fixed"!==i&&"absolute"!==i||s.css(o),s.on("click",(e=>{e.preventDefault(),window.scrollTo(0,0)})),r&&!s.hasClass("animated-running")&&s.offset().top<=n(window).height()&&s.addClass("animated-running "+l).css({opacity:""}),n(window).on("scroll",(()=>{if(r)n(window).scrollTop()>=r&&!s.hasClass("animated-running")?(s.addClass("animated-running "+l).css({opacity:""}),s.removeClass(a)):n(window).scrollTop()<=r&&s.hasClass("animated-running")&&(s.removeClass("animated-running "+l).css({opacity:0}),s.addClass(a));else{let e=s.offset().top;s.hasClass("animated-running")||n(window).scrollTop()>=e-n(window).height()&&(s.addClass("animated-running "+l).css({opacity:""}),s.removeClass(a))}})),n(window).trigger("scroll")}}const l=n;export{e as Base,i as GoTop,s as IAccordion,l as default};
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("b",[],t):"object"==typeof exports?exports.b=t():e.b=t()}(this,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var s in n)e.o(n,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:n[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{Base:()=>n,GoTop:()=>o,IAccordion:()=>l,default:()=>r});class n{constructor(e,t){if(this.elements=[],this.length=0,t=t instanceof n?t.elements[0]:t||document,"string"==typeof e)if(t&&"string"==typeof t&&(t=document.querySelector(t)),n.isEqSelector(e)){const s=e.split(":")[0],i=e.match(/:eq\((\d+)\)/);if(i){const e=parseInt(i[1]),l=n.contextQuerySelector(">"+s,t);l.length>0?this.elements=[l[e]]:this.elements=[]}else this.elements=[]}else this.elements=n.contextQuerySelector(e,t);else e instanceof NodeList||e instanceof HTMLElement?this.elements=e instanceof NodeList?Array.from(e):[e]:e instanceof Window?this.elements=[window]:null!==e&&"object"==typeof e&&"documentElement"in e?this.elements=[t]:Array.isArray(e)?this.elements=e:this.elements=[];this.length=this.elements.length}each(e){return this.elements.forEach(((t,n)=>{e(t,n)})),this}hasClass(e){let t=!1;return this.each((n=>{t=n.classList.contains(e)})),t}addClass(e){return this.each((t=>{if(/\s/.test(e)){const n=e.split(" ");for(let e=0;e<n.length;e++)n[e]&&t.classList.add(n[e])}else e&&t.classList.add(e)}))}removeClass(e){return this.each((t=>{if(void 0===e)t.className="";else if(e||0!==e.length)if(/\s/.test(e)){const n=e.split(" ");for(let e=0;e<n.length;e++)n[e]&&t.classList.remove(n[e].trim())}else t.classList.remove(e.trim())}))}toggleClass(e){return this.each((t=>{if(t.classList)t.classList.toggle(e);else{let n=t.className.split(/\s+/),s=n.indexOf(e);s>=0?n.splice(s,1):n.push(e),t.className=n.join(" ")}}))}not(e){let t=e instanceof n?e.elements:Array.from(document.querySelectorAll(e));return this.elements=Array.from(this.elements).filter((e=>!t.includes(e))),this}is(e){var t;let n=this.elements[0];if(":visible"===e){if("none"===n.style.display||"hidden"===n.style.visibility||"0"===getComputedStyle(n).opacity)return!1}else{if(":first-child"===e)return(null===(t=n.parentNode)||void 0===t?void 0:t.firstChild)===n;if(":last-child"!==e)return n.matches(e);{const e=n.parentNode;if(e){const t=e.children;return t[t.length-1]===n}}}return!1}closest(e){let t=this.elements[0];if(!t)return n.build([]);const s=t.matches||t.webkitMatchesSelector;if(s.call(t,e))return this.constructor===n?n.build(this.elements):this;let i=t.parentElement;for(;i;){if(s.call(i,e))return n.build(i);i=i.parentElement}return n.build([])}next(){if(1===this.elements.length){const e=this.elements[0].nextElementSibling;return e instanceof Element?n.build(e):n.build([])}if(this.elements.length>1){const e=[],t=this.elements[0].nextElementSibling;t instanceof Element&&e.push(t);for(let t=1;t<this.elements.length-1;t++)this.elements[t]instanceof Element&&e.push(this.elements[t]);const s=this.elements[this.elements.length-1].nextElementSibling;return s instanceof Element&&e.push(s),n.build(e)}return null}nextAll(e){const t=[];let n=this.elements[0],s=n.nextSibling,i=n.parentElement;for(;s&&(1===s.nodeType&&(e&&!s.matches(e)||t.unshift(s)),s=s.nextSibling,null!==s||0!==t.length||(null==i?void 0:i.firstChild)!==n););return this.elements=t,this.length=this.elements.length,this}prev(){if(1===this.elements.length)return n.build(this.elements[0].previousElementSibling);if(this.elements.length>1){let e=n.build(this.elements[0].previousElementSibling);return this.each(((t,n)=>{n>1&&(e.elements.push(t),n===this.elements.length-1&&e.elements.push(t.previousElementSibling))})),e}return null}prevAll(e){const t=[];let n=this.elements[this.elements.length-1],s=n.previousSibling,i=n.parentElement;for(;s&&(1===s.nodeType&&(e&&!s.matches(e)||t.unshift(s)),s=s.previousSibling,null!==s||0!==t.length||(null==i?void 0:i.firstChild)!==n););return this.elements=t,this.length=this.elements.length,this}first(){return new n([this.elements[0]])}find(e){if(e&&"option:selected"===e.trim()){const e=[];return this.each((t=>{("select-one"===t.type||"select-multiple"===t.type)&&t.selectedIndex>=0&&e.push(t.options[t.selectedIndex])})),new n(e)}{const t=[];return this.elements.forEach((n=>{n instanceof HTMLElement&&n.querySelectorAll(e).forEach((e=>t.push(e)))})),new n(t)}}parent(){let e=this.elements[0];return e?new n(e.parentNode):new n}parents(e){const t=[];let s=this.elements[0].parentElement;for(;s&&s!==document.documentElement;)e&&!s.matches(e)||t.push(s),s=s.parentElement;return new n(t)}siblings(){let e=this.elements[0];if(e&&1===e.nodeType){let t=e.parentNode;if(t){let s=[];for(let n=0;n<t.childNodes.length;n++){let i=t.childNodes[n];1===i.nodeType&&i!==e&&s.push(i)}return new n(s)}return new n}return new n}children(){let e=[];return this.each((t=>{e.push(...Array.from(t.children))})),new n(e)}index(){var e;const t=this.elements[0],n=null===(e=t.parentNode)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return e;return-1}size(){return this.elements?this.elements.length:0}on(e,t){return this.each((function(n){n.addEventListener(e,t)}))}off(e,t){return this.each((function(n){n.removeEventListener&&t&&n.removeEventListener(e,t)}))}click(e){return"function"==typeof e?this.on("click",e):this.each((e=>{const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(t)})),this}focus(e){return"function"==typeof e&&this.on("focus",e),this}change(e){return e&&this.each((t=>{t.addEventListener("change",e,!1)})),this}trigger(e,t){return this.each((function(n){let s;try{s=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0})}catch(n){s=document.createEvent("CustomEvent"),s.initCustomEvent(e,!0,!0,t)}n.dispatchEvent(s)})),this}remove(){return this.each((e=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)}))}data(e,t){if(void 0===e)throw new Error("读取的或设置的键值不能为空");let s=this.elements[0];if(void 0!==t){let i=n.elementData.get(s);return i||(i=new Map,n.elementData.set(s,i)),i.set(n.camelCase(e),t),this}{const t=n.elementData.get(s);return t?t.get(n.camelCase(e)):n.dataAttr(s,e)}}removeData(e){let t=this.elements[0],s=n.elementData.get(t);s&&s.set(n.camelCase(e),void 0)}attr(e,t){if(0===this.elements.length)return void 0===t?"":this;const n=this.elements[0];return void 0===t?(null==n?void 0:n.getAttribute(e))||"":this.each((n=>n.setAttribute(e,t)))}removeAttr(e){return this.each((t=>{"function"==typeof t.removeAttribute&&t.removeAttribute(e)}))}offset(){let e=this.elements[0].getBoundingClientRect(),t=window.pageYOffset||document.documentElement.scrollTop,n=window.pageXOffset||document.documentElement.scrollLeft;return{top:e.top+t,left:e.left+n}}scrollTop(){return this.elements[0]instanceof Window?void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop:document.documentElement.scrollTop}height(){const e=this.elements[0];return e===window?window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight:e.offsetHeight}width(){const e=this.elements[0];return e===window?window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth:e.offsetWidth}val(e){let t=this.elements[0];if("select-multiple"===t.type){if(void 0!==e){for(let n=t.options.length-1;n>=0;n--)t.options[n].selected=t.options[n].value===e;return this}{let e=[];for(let n=0;n<t.options.length;n++)t.options[n].selected&&e.push(t.options[n].value);return e}}return void 0!==e?(t.value=e,this):t.value}css(e,t){if(0===this.elements.length)return this;if(void 0===t){if("object"==typeof e){const t=e;for(const e in t)if(t.hasOwnProperty(e)){const n=t[e];this.each((t=>{t.style[e]=n}))}return this}return this.elements[0].style[e]||""}return this.each((n=>{n.style[e]=t}))}text(e){if(0===this.elements.length)return void 0===e?"":this;const t=this.elements[0];return void 0===e?t.textContent||"":this.each((t=>{t.textContent=e}))}html(e){if(0===this.elements.length)return void 0===e?"":this;const t=this.elements[0];return void 0===e?t&&1===t.nodeType?t.innerHTML:"":this.each((t=>{t&&1===t.nodeType&&(t.innerHTML=e)}))}after(e){return this.each((t=>{t.insertAdjacentHTML("afterend",e)}))}append(e){return this.each((t=>{let n=document.createElement("div");if("string"==typeof e)n.innerHTML=e;else if(e instanceof Node)n.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)n.appendChild(e[t]);for(;n.firstChild;)t.appendChild(n.firstChild);return t}))}prepend(e){return this.each((t=>{let n=document.createElement("div");if("string"==typeof e)n.innerHTML=e;else if(e instanceof Node)n.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)n.appendChild(e[t]);for(;n.firstChild;)t.insertBefore(n.firstChild,t.firstChild);return t}))}hide(e,t){return this.each((n=>{n.style.display="block",e?setTimeout((()=>{n.style.display="none",t&&"function"==typeof t&&t(n)}),e):(n.style.display="none",t&&"function"==typeof t&&t(n))}))}show(e,t){return this.each((n=>{n.style.display="block",e?setTimeout((()=>{n.style.display="block",t&&"function"==typeof t&&t(n)}),e):(n.style.display="block",t&&"function"==typeof t&&t(n))}))}slideUp(e,t){const s=n.extend({duration:e,callback:t},{duration:300,callback:null});return this.each((e=>{e.style.height=e.scrollHeight+"px",e.style.overflow="hidden",e.style.transition=`height ${s.duration}ms ease-in-out`,setTimeout((()=>{e.style.height="0px"}),s.duration/100),setTimeout((()=>{e.style.display="none",e.style.overflow="",e.style.transition="",e.style.height="",s.callback&&"function"==typeof s.callback&&s.callback(e)}),s.duration-s.duration/100)}))}slideDown(e,t){const s=n.extend({duration:e,callback:t},{duration:300,callback:null});return this.each((e=>{let t=e.offsetHeight;"none"===e.style.display&&(e.style.display="",t=0),e.style.height=t+"px",e.style.transition=`height ${s.duration}ms ease-in-out`,e.offsetHeight,e.style.height=e.scrollHeight+"px",e.style.display="block",setTimeout((()=>{e.style.overflow="",e.style.transition="",e.style.display="",e.style.height="",s.callback&&"function"==typeof s.callback&&s.callback(e)}),s.duration)}))}slideToggle(e,t){const s=n.extend({duration:e,callback:t},{duration:500,callback:null});let i=!0;return this.each((e=>{"none"===e.style.display&&(i=!1)})),i?this.slideUp(s.duration,s.callback):this.slideDown(s.duration,s.callback),this}fadeOut(e,t){const s=n.extend({duration:e,callback:t},{duration:300,callback:null});return this.each((e=>{e.style.transition=`opacity ${s.duration}ms ease-in-out`,e.style.opacity="0",setTimeout((()=>{e.style.display="none",s.callback&&"function"==typeof s.callback&&s.callback(e)}),s.duration)}))}checkAll(e){const t=n.extend({checkboxes:e},{checkboxes:".be-check"});return this.each((e=>{let n=document.querySelectorAll(t.checkboxes);e.addEventListener("change",(function(){n.forEach((function(t){t.checked=e.checked}))}))}))}checkReverse(e){const t=n.extend({checkboxes:e},{checkboxes:".be-check"});return this.each((e=>{let n=document.querySelectorAll(t.checkboxes);e.addEventListener("click",(function(){n.forEach((function(e){e.checked=!e.checked}))}))}))}numStep(e){return e=n.extend(e,{start:0,end:100,duration:1500,callback:!1}),this.each((t=>{let s=null;requestAnimationFrame((function i(l){null===s&&(s=l);const o=Math.min((l-s)/e.duration,1),r=Math.floor(o*(e.end-e.start)+e.start);n.build(t).text(r.toString()),o<1?requestAnimationFrame(i):"function"==typeof e.callback&&e.callback()}))}))}scrollBG(e){return e=n.extend(e,{speed:0}),this.each((t=>{n.build(t).css("background-position","50% 0px"),n.build(window).on("scroll",(()=>{const s=n.build(t),i=s.offset().top,l=s.height(),o=s.scrollTop(),r=s.height();if(r+o>i&&r+o<i+r+l){const t=(i+l-o)/e.speed;s.css("background-position","50% -"+t+"px")}}))}))}setActive(e){const{className:t="active"}=e||{};n.build(this.elements).click((e=>{const s=n.build(e.currentTarget);s.hasClass(t)?s.removeClass(t):(n.build(this.elements).removeClass(t),s.addClass(t))}))}loading(e){let t=!1;return void 0!==e&&"object"!=typeof e&&(t=!0,e={}),e=n.extend(e,{isFull:!0,loadingTarget:"#do-preloader",template:'<div id="do-preloader" class="do-preloader"><span class="do-pr-loader"><span class="do-pr-lr"></span></span></div>'}),this.each((s=>{const i=e,l=i.loadingTarget,o=i.template;if(t)n.build("> *",s).removeClass("be-blur-2"),n.build(l).addClass("oy-0"),setTimeout((()=>{n.build("> *",s).removeClass("be-ts"),n.build(l).remove()}),300);else{n.build("> *",s).addClass("be-ts").addClass("be-blur-2"),n.build(s).prepend(o);const e=n.build(l);e.length&&e.css("position","fixed").css("height","100vh").css("width","100vw")}}))}static extend(e,t){if(!t)return e;{let n;for(n in e)if(null==e?void 0:e.hasOwnProperty(n)){const s=e[n];null==t[n]&&(t[n]=s)}}return t}static camelCase(e){let t=e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}));return t=t.replace(/\./g,""),t}static l(...e){window.console&&e&&console.log(...e)}static toRound(e,t){let n=parseFloat(String(e));return n=n?Math.round(e*Math.pow(10,t))/Math.pow(10,t):0,n}static isNull(e){let t=!0;return null!=e&&""!==e&&"undefined"!==e&&"null"!==e||(t=!1),t}static setDefault(e,t){return null!=e&&""!==e&&"undefined"!==e&&"null"!==e||(e=t),e}static isObject(e){return!!e&&e&&"object"==typeof e&&!Array.isArray(e)&&!0}static same(e,t){return e.filter((function(e){return-1!==t.indexOf(e)}))}static different(e,t){return e.concat(t).filter((function(n){return-1===e.indexOf(n)||-1===t.indexOf(n)}))}static contrast(e,t){return e.concat(t).filter((function(n){return-1===e.indexOf(n)&&-1!==t.indexOf(n)}))}static isHtmlTag(e){return/^<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>$|^<([a-z][a-z0-9]*)\b[^>]*\/>$/i.test(e)}static plugin(e,t){n.fn[e]=function(){t()}}static createElement(e){let t=document.createElement("div");t.innerHTML=e.trim();let n=t.firstChild;if((null==n?void 0:n.nodeType)===Node.TEXT_NODE){n=n.nextSibling;let e=document.createDocumentFragment();for(;n;)e.appendChild(n),n=n.nextSibling;return e}return n}static ajax(e){var t;if("get"===(null===(t=null==(e=n.extend(e,{url:"",method:"GET",async:!0,headerMap:{},cache:"default",dataType:"json",data:null,success:function(){},error:function(){}}))?void 0:e.method)||void 0===t?void 0:t.toLowerCase())){if(!e.url.includes("?")){let t=new URLSearchParams;for(let n in e.data)e.data.hasOwnProperty(n)&&t.append(n,e.data[n]);e.url=e.url+"?"+t.toString()}e.data=null}if(fetch)fetch(e.url,{method:e.method,headers:new Headers(e.headerMap),cache:e.cache,body:e.data?JSON.stringify(e.data):null}).then((function(t){return t.ok?"json"===e.dataType?t.json():t.text():Promise.reject(new Error("Failed to fetch resource"))})).then((function(t){e.success&&e.success(t)})).catch((function(t){e.error&&e.error(t)}));else{let t=new XMLHttpRequest;t.onload=function(){if(t.status>=200&&t.status<300){let n;switch(e.dataType){case"json":try{n=JSON.parse(t.responseText)}catch(t){return void(e.error&&e.error(t))}break;case"text":n=t.responseText;break;default:n=t.responseText||t.response}e.success&&e.success(n,t.status,t)}else{let n=new Error("Request failed. Status: "+t.status);e.error&&e.error(n)}},t.onerror=function(){e.error&&e.error(new Error("Network Error"))},t.open((null==e?void 0:e.method)||"get",e.url,e.async||!1);for(let n in e.headerMap)e.headerMap.hasOwnProperty(n)&&t.setRequestHeader(n,e.headerMap[n]);e.data?t.send(e.data):t.send()}}static getParam(e){let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),n=window.location.search.substr(1).match(t);return null!=n?unescape(n[2]):null}static move(e){const t=document.querySelector(e);if(t){let e=new n(t).offset();window.scrollTo(e.left,e.top)}}static strValidation(e,t,n){let s=0;return e.length<=t||e.length>=n?s=1:/^[0-9]{0,32}$/.test(e)?s=2:/^[a-zA-z]{0,32}$/.test(e)?s=3:/^[0-9a-zA-z]{0,32}$/.test(e)?s=4:/^[^\u4e00-\u9fa5a-zA-Z\d,.,。]{0,32}$/.test(e)?s=5:/^(?=.*\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])[\da-zA-Z~!@#$%^&*]*$/.test(e)&&(s=8),s}static hotkey(e,t){document.addEventListener("keydown",(function(n){e===n.key&&t()}))}static setCookie(e,t,n={}){let s="",i=n.path||"/",l=n.domain,o=n.secure?"; Secure":"";if(n.expires){let e;"number"==typeof n.expires?(e=new Date,e.setTime(e.getTime()+24*n.expires*60*60*1e3)):e=n.expires,s=`; expires=${e.toUTCString()}`}document.cookie=`${e}=${encodeURIComponent(t)}${s}; path=${i}; domain=${l||""}${o}`}static getCookie(e){let t=`${e}=`,n=document.cookie.split(";");for(let e=0;e<n.length;e++){let s=n[e];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}return null}static removeCookie(e,t={}){this.setCookie(e,"",Object.assign(Object.assign({},t),{expires:-1}))}static menu(e,t){const n=function(e,s,i){let l="";++s;for(let o=0;o<e.length;o++){const r=e[o];let a="#";if(r.link&&(a=r.link),r.pId||0!==s){if(r.pId===i){let t="";r.isParent&&(t=n(e,s,r.id),t&&(t="<ul class='sub'>"+t+"</ul>"));let i="";1===s&&(i=`<i class='${r.icon}'></i>`);let o=r.hash?` data-hash='${r.hash}' `:" ",c=r.actionId?` id='${r.actionId}' `:" ";l+=`<li class='sub-menu'><a${r.isParent?" class='mu-js-a' ":" "}${o}${r.tid?` data-tid='${r.tid}' `:" "}${c}href='${a}'>`+i+`<span>${r.name}</span></a>`+t+"</li>"}}else if(t)l=n(e,s,r.id);else{let t=n(e,s,r.id);t&&(t="<ul class='sub'>"+t+"</ul>"),l+=`<li class='sub-menu'><a${r.hash?` data-hash='${r.hash}' `:" "}${r.actionId?` id='${r.actionId}' `:" "}href='${a}'><span>${r.name}</span></a>`+t+"</li>"}}return l};let s="";return e&&(s=n(e,-1,0)),""+s}static menu2Tree(e,t,s){let i=[];return e.forEach((function(l){l.pId===t&&(l.isactive=`a${l.id}`===s,i.push(l),l.isParent&&(l.children=n.menu2Tree(e,l.id)))})),i}static search(e){var t;const s=n.build(".fm-search"),i=n.build("input",s),l=n.build("span:eq(0)",s),o=n.build("span:eq(1)",s);i.on("change",(e=>{var t,s;const i=n.build(e.currentTarget);""!==i.val()?null===(t=i.next())||void 0===t||t.css("opacity","1").css("visibility","visible"):null===(s=i.next())||void 0===s||s.css("opacity","0").css("visibility","hidden")})),""!==i.val()&&(null===(t=i.next())||void 0===t||t.css("opacity","1").css("visibility","visible")),o.on("click",(e=>{var t;const s=n.build(e.currentTarget);s.css("opacity","0").css("visibility","hidden"),null===(t=s.prev())||void 0===t||t.val("")})),l.on("click",(t=>{var s;const i=n.build(t.currentTarget);e&&e(null===(s=i.next())||void 0===s?void 0:s.val())}))}static shuffleArray(e){if(!Array.isArray(e))return e;const t=[...e];for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}static defaultConstructor(e,t,s,i){"string"==typeof t?e.elements=document.querySelectorAll(t):t instanceof NodeList?e.elements=t:t instanceof HTMLElement?e.elements=Array.of(t):e.elements=[],e.options=n.extend(s,e.options),i(e)}static contextQuerySelector(e,t){if(e.startsWith(">"))return Array.from(t.querySelectorAll(e.substring(1))).filter((function(e){return e.parentNode===t}));{const n=t.querySelectorAll(e);return 0===n.length?Array.from(document.querySelectorAll(e)):Array.from(n)}}static isEqSelector(e){const t=e.match(/^[\w-]+:eq\((\d+)\)$/);return null!==t&&void 0!==t[1]}static build(e,t){return new(this||n)(e,t)}}n.keys={esc:"Escape",backspace:"Backspace",space:" ",enter:"Enter",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight"},n.dataAttr=function(e,t){var n;let s="data-"+t;return null!==(n=e.getAttribute(s))&&void 0!==n?n:void 0},n.expando="base"+(""+Math.random()).replace(/\D/g,""),n.elementData=new Map,n.cache={},n.build.extend=n.extend,n.build.camelCase=n.camelCase,n.build.l=n.l,n.build.getParam=n.getParam,n.build.toRound=n.toRound,n.build.isNull=n.isNull,n.build.setDefault=n.setDefault,n.build.same=n.same,n.build.different=n.different,n.build.contrast=n.contrast,n.build.strValidation=n.strValidation,n.build.move=n.move,n.build.keys=n.keys,n.build.hotkey=n.hotkey,n.build.isHtmlTag=n.isHtmlTag,n.build.isObject=n.isObject,n.build.plugin=n.plugin,n.build.ajax=n.ajax,n.build.setCookie=n.setCookie,n.build.getCookie=n.getCookie,n.build.removeCookie=n.removeCookie,n.build.menu=n.menu,n.build.menu2Tree=n.menu2Tree,n.build.search=n.search,n.build.shuffleArray=n.shuffleArray,n.build.defaultConstructor=n.defaultConstructor;const s=n.build;Date.prototype.format=function(e){let t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(let n in t)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1===RegExp.$1.length?t[n]:("00"+t[n]).substr((""+t[n]).length)));return e},Array.prototype.remove=function(e,t){let n=this.slice((t||e)+1||this.length);return this.length=e<0?this.length+e:e,this.push.apply(this,n)},Array.prototype.unique=function(){let e=[];this.sort();for(let t=0;t<this.length;t++)this[t]!==this[t+1]&&(e[e.length]=this[t]);return e};const i=s;class l{constructor(e,t){this.options={classParent:"ia-parent",classActive:"active",classArrow:"ia-icon",classCount:"ia-count",autoExpand:!1,classExpand:"ia-current-parent",autoClose:!0,speed:300,saveState:!0,disableLink:!0,showCount:!1,cookie:"ia-cookie",smallClass:"ce-accordion-small"},this.selector=e,n.defaultConstructor(this,e,t,(e=>{e.elements.forEach((n=>{let s=i(n);s.data("be.iaccordion")||s.data("be.iaccordion",e),e.init(n,t)}))}))}init(e,t){const n=this,s=i("li > a",e),l=i("li > ul",e),o=(t=i.extend(t,n.options)).classActive;this.setUpAccordion(e,s,l,t),!0===t.saveState&&n.checkCookie(t.cookie,e,o),!0===t.autoExpand&&i("li."+t.classExpand+" > a").addClass(o),s.click((s=>{const l=i(s.currentTarget),r=l.parent(),a=n.isSmall(s,e,t.smallClass);!0===t.disableLink&&l.siblings().length>0&&s.preventDefault(),!0===t.autoClose&&n.autoCloseAccordion(e,l,a,t),0===i("> ul",r).length?i("> a",r).addClass(o):"none"!==i("> ul",r).css("display")?(n.slideUp(i("ul",r),a,t),i("a",r).removeClass(o)):("none"===i(s.currentTarget).siblings().css("display")?n.slideDown(i(s.currentTarget).siblings().css("overflow","hidden"),a,t):n.slideUp(i(s.currentTarget).siblings(),a,t),i("> a",r).addClass(o)),!0===t.saveState&&n.createCookie(t.cookie,e,o)}))}setUpAccordion(e,t,n,s){const l='<span class="'+s.classArrow+'"></span>',o=s.classParent+"-li";n.show(),i("li",e).each((e=>{i("> ul",e).length>0&&(i(e).addClass(o),i("> a",e).addClass(s.classParent).append(l))})),n.hide(),!0===s.showCount&&i("ul",e).each((e=>{i("> a",i(e).parent()).append(' <span class="'+s.classCount+'">('+e.children.length+")</span>")}))}autoCloseAccordion(e,t,n,s){const l=this;i("ul",e).each((e=>{let o=!1;t.parents("ul").each((t=>{t===e&&(o=!0)})),o||t.siblings().elements[0]===e||"none"===e.style.display||l.slideUp(i(e),n,s)})),i("a",e).removeClass(s.classActive),t.parents("li").each((e=>{i("> a",e).addClass(s.classActive)}))}checkCookie(e,t,n){const s=this,l=i.getCookie(e);if(null!==l&&""!==l){const e=l.split(",");s.setActiveMenu(t,e,0,n)}}setActiveMenu(e,t,n,s){const l=i("li:eq("+t[n]+")",e),o=i("> a",l),r=o.siblings();o.addClass(s),r.css("display",""),t.length>n+1&&this.setActiveMenu(r,t,++n,s)}createCookie(e,t,n){let s=[];i("li a."+n,t).each((e=>{const t=i(e).parent().index();s.push(t.toString())})),i.setCookie(e,s.join(","))}isSmall(e,t,n){return!(!i(t).hasClass(n)||0===i(e.currentTarget).siblings().length||(e.preventDefault(),0))}slideDown(e,t,n){t||e.slideDown(n.speed)}slideUp(e,t,n){t||e.slideUp(n.speed)}}class o{constructor(e,t){this.options={position:{bottom:"15px",right:"15px"},showEffect:" animate__zoomIn ",hideEffect:" animate__zoomOut ",type:"fixed",offsetTop:400},this.selector=e,n.defaultConstructor(this,e,t,(e=>{e.elements.forEach((n=>{let s=i(n);s.data("be.gotop")||s.data("be.gotop",e),e.init(n,t)}))}))}init(e,t){const n=i(e),s=(t=i.extend(t,this.options)).type||"fixed",l=t.showEffect||" animate__zoomIn ",o=t.position,r=void 0!==t.offsetTop?Number(t.offsetTop):400,a=t.hideEffect||" animate__zoomOut ";n.addClass("animate__animated").css({display:"inline-block",position:s,opacity:0}),"fixed"!==s&&"absolute"!==s||n.css(o),n.on("click",(e=>{e.preventDefault(),window.scrollTo(0,0)})),r&&!n.hasClass("animated-running")&&n.offset().top<=i(window).height()&&n.addClass("animated-running "+l).css({opacity:""}),i(window).on("scroll",(()=>{if(r)i(window).scrollTop()>=r&&!n.hasClass("animated-running")?(n.addClass("animated-running "+l).css({opacity:""}),n.removeClass(a)):i(window).scrollTop()<=r&&n.hasClass("animated-running")&&(n.removeClass("animated-running "+l).css({opacity:0}),n.addClass(a));else{let e=n.offset().top;n.hasClass("animated-running")||i(window).scrollTop()>=e-i(window).height()&&(n.addClass("animated-running "+l).css({opacity:""}),n.removeClass(a))}})),i(window).trigger("scroll")}}const r=i;return t})()));
@@ -0,0 +1,7 @@
1
+ import b, { Base } from './js/base';
2
+ import { IAccordion } from './js/utils/IAccordion';
3
+ import { GoTop } from './js/utils/GoTop';
4
+ export type { BaseElement, BaseStatic, BaseConstructor, NumStepOptions, ScrollBGOptions, LoadingOptions, AjaxOptions, CookieOptions, TreeItem, AccordionOptions, IAccordionInstance, PositionOptions, GoTopOptions, IGoTopInstance, UtilsModule } from './types/index';
5
+ export { Base, IAccordion, GoTop };
6
+ export default b;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,YAAY,EACR,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAC/H,gBAAgB,EAAE,kBAAkB,EACpC,eAAe,EAAE,YAAY,EAAE,cAAc,EAC7C,WAAW,EACd,MAAM,eAAe,CAAC;AAGvB,OAAO,EACH,IAAI,EACJ,UAAU,EACV,KAAK,EACR,CAAC;AAEF,eAAe,CAAC,CAAC"}
@@ -0,0 +1,152 @@
1
+ import type { BaseElement, AjaxOptions, CookieOptions, TreeItem, NumStepOptions, ScrollBGOptions, LoadingOptions } from '../types/index';
2
+ declare class Base implements BaseElement {
3
+ elements: (HTMLElement | Document | Window)[];
4
+ length: number;
5
+ constructor(selector?: any, context?: any);
6
+ each(callback: (element: any, index: number) => void): this;
7
+ hasClass(className: string): boolean;
8
+ addClass(className: string): this;
9
+ removeClass(className?: string): this;
10
+ toggleClass(className: string): this;
11
+ not(selector: string | BaseElement): this;
12
+ is(selector: string): boolean;
13
+ closest(selector: string): this;
14
+ next(): this | null;
15
+ nextAll(selector?: string): this;
16
+ prev(): this | null;
17
+ prevAll(selector?: string): this;
18
+ first(): this;
19
+ find(context: string): this;
20
+ parent(): this;
21
+ parents(selector?: string): this;
22
+ siblings(): this;
23
+ children(): this;
24
+ index(): number;
25
+ size(): number;
26
+ on(eventType: string, handler: EventListener): this;
27
+ off(eventName: string, callback?: EventListener): this;
28
+ click(handler?: EventListener): this;
29
+ focus(handler?: EventListener): this;
30
+ change(handler: EventListener): this;
31
+ trigger(eventName: string, eventData?: any): this;
32
+ remove(): this;
33
+ data(key: string, value?: any): any;
34
+ removeData(key: string): void;
35
+ attr(attributeName: string): string;
36
+ attr(attributeName: string, value: string): this;
37
+ removeAttr(attributeName: string): this;
38
+ offset(): {
39
+ top: number;
40
+ left: number;
41
+ };
42
+ scrollTop(): number;
43
+ height(): number;
44
+ width(): number;
45
+ val(newValue?: string | string[]): string | string[] | this;
46
+ css(propertyName: string): string;
47
+ css(propertyName: string | Record<string, string | number>, value: string): this;
48
+ css(styles: Record<string, string | number>): this;
49
+ text(): string;
50
+ text(content: string): this;
51
+ html(): string;
52
+ html(content: string): this;
53
+ after(html: string): this;
54
+ append(content: string | Node | NodeList): this;
55
+ prepend(content: string | Node | NodeList): this;
56
+ hide(duration?: number, callback?: (element: HTMLElement) => void): this;
57
+ show(duration?: number, callback?: (element: HTMLElement) => void): this;
58
+ slideUp(duration?: number, callback?: (element: HTMLElement) => void): this;
59
+ slideDown(duration?: number, callback?: (element: HTMLElement) => void): this;
60
+ slideToggle(duration?: number, callback?: (element: HTMLElement) => void): this;
61
+ fadeOut(duration?: number, callback?: (element: HTMLElement) => void): this;
62
+ checkAll(checkboxes: string): this;
63
+ /**
64
+ * 反选
65
+ */
66
+ checkReverse(checkboxes: string): this;
67
+ /** 数字特效递增动画 */
68
+ numStep(options: NumStepOptions): this;
69
+ /** 背景滚动动画 */
70
+ scrollBG(options: ScrollBGOptions): this;
71
+ /** 点击切换激活项(添加active class),已经激活则取消(删除active class) */
72
+ setActive(options?: {
73
+ className?: string;
74
+ }): void;
75
+ /**
76
+ * 全屏loading
77
+ */
78
+ loading(options?: LoadingOptions | string): this;
79
+ static extend<U, T>(defaults: U, custom: T): T & U;
80
+ static camelCase(str: string): string;
81
+ static l(...message: any[]): void;
82
+ static toRound(number: number, save: number): number;
83
+ static isNull(target: any): boolean;
84
+ static setDefault<T>(target: T, defaultVal: T): T;
85
+ static isObject(item: any): boolean;
86
+ static same<T>(arr1: T[], arr2: T[]): T[];
87
+ static different<T>(arr1: T[], arr2: T[]): T[];
88
+ static contrast<T>(arr1: T[], arr2: T[]): T[];
89
+ static isHtmlTag(str: string): boolean;
90
+ static plugin(pluginName: string, pluginFunction: Function): void;
91
+ static createElement(htmlString: string): Element | DocumentFragment;
92
+ static ajax(options: AjaxOptions): void;
93
+ static getParam(key: string): string | null;
94
+ static move(target: string): void;
95
+ /**
96
+ * 字符串复杂度验证,表单验证
97
+ */
98
+ static strValidation(str: string, lenMin: number, lenMax: number): number;
99
+ static keys: {
100
+ esc: string;
101
+ backspace: string;
102
+ space: string;
103
+ enter: string;
104
+ up: string;
105
+ down: string;
106
+ left: string;
107
+ right: string;
108
+ };
109
+ static hotkey(key: string, callback: () => void): void;
110
+ static setCookie(name: string, value: string, options?: CookieOptions): void;
111
+ static getCookie(name: string): string | null;
112
+ static removeCookie(name: string, options?: CookieOptions): void;
113
+ static menu(trees: TreeItem[], isIgnoreTop: boolean): string;
114
+ /**
115
+ * 数据库普通的数据列表转换成有层次的数组,
116
+ * menus内对象包含字段:{ "icon": "", "id": 2, "isParent": false, "link": "", "name": "查询", "tid": 59, "pId": 35}
117
+ */
118
+ static menu2Tree(menus: TreeItem[], pid: number, activeid?: string): TreeItem[];
119
+ /**
120
+ * 包含搜索按钮删除按钮的搜索框
121
+ */
122
+ static search(fun: (txt: string) => void): void;
123
+ /**
124
+ * 随机打乱数组
125
+ * @param {Array} arr - 要打乱的数组
126
+ * @returns {Array} - 打乱后的数组
127
+ */
128
+ static shuffleArray<T>(arr: T[]): T[];
129
+ /**
130
+ * 自定义组件初始化参数
131
+ * @param iclass 自定义组件
132
+ * @param selector 选择器
133
+ * @param custom 自定义参数
134
+ * @param callback 回调方法
135
+ */
136
+ static defaultConstructor(iclass: any, selector: string | Node | NodeList, custom: any, callback: (target: any) => void): void;
137
+ static dataAttr: (elem: Element, key: string) => string | undefined;
138
+ static contextQuerySelector(selector: string, context: Element | Document): Element[];
139
+ static isEqSelector(str: string): boolean;
140
+ static expando: string;
141
+ static elementData: Map<any, any>;
142
+ static cache: Record<string, any>;
143
+ static build<T extends Base>(this: new (selector: any, context?: any) => T, selector: any, context?: any): T;
144
+ }
145
+ export interface BaseCallable {
146
+ (selector: any, context?: any): Base;
147
+ }
148
+ type BaseTypeStatics = typeof Base;
149
+ declare const b: BaseCallable & BaseTypeStatics;
150
+ export { Base };
151
+ export default b;
152
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/js/base.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,9 @@
1
+ import type { GoTopOptions, IGoTopInstance } from '../../types/index';
2
+ export declare class GoTop implements IGoTopInstance {
3
+ selector: string;
4
+ options: GoTopOptions;
5
+ elements: NodeListOf<Element>;
6
+ constructor(selector: string, custom?: Partial<GoTopOptions>);
7
+ init(element: Element, options?: Partial<GoTopOptions>): void;
8
+ }
9
+ //# sourceMappingURL=GoTop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoTop.d.ts","sourceRoot":"","sources":["../../../../src/js/utils/GoTop.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAO,mBAAmB,CAAC;AAwBvE,qBAAa,KAAM,YAAW,cAAc;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,YAAY,CASnB;IACF,QAAQ,EAAG,UAAU,CAAC,OAAO,CAAC,CAAC;gBAEnB,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;IAa5D,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;CA+DzD"}
@@ -0,0 +1,17 @@
1
+ import type { AccordionOptions, IAccordionInstance } from '../../types/index';
2
+ export declare class IAccordion implements IAccordionInstance {
3
+ selector: string;
4
+ options: AccordionOptions;
5
+ elements: NodeListOf<Element>;
6
+ constructor(selector: string, custom?: Partial<AccordionOptions>);
7
+ init(element: Element, options?: Partial<AccordionOptions>): void;
8
+ setUpAccordion(target: Element, myLinks: any, mySub: any, options: AccordionOptions): void;
9
+ autoCloseAccordion(element: Element, target: any, isSmall: boolean, options: AccordionOptions): void;
10
+ checkCookie(cookieId: string, target: Element, classActive: string): void;
11
+ setActiveMenu(target: Element, activeArray: string[], index: number, classActive: string): void;
12
+ createCookie(cookieId: string, target: Element, classActive: string): void;
13
+ isSmall(e: Event, element: Element, smallClass: string): boolean;
14
+ slideDown(myElement: any, isSmall: boolean, options: AccordionOptions): void;
15
+ slideUp(myElement: any, isSmall: boolean, options: AccordionOptions): void;
16
+ }
17
+ //# sourceMappingURL=IAccordion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAccordion.d.ts","sourceRoot":"","sources":["../../../../src/js/utils/IAccordion.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AA0C9E,qBAAa,UAAW,YAAW,kBAAkB;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,gBAAgB,CAcvB;IACF,QAAQ,EAAG,UAAU,CAAC,OAAO,CAAC,CAAC;gBAEnB,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC;IAahE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC;IAsD1D,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,gBAAgB;IAoBnF,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB;IAqB7F,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM;IAUlE,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAaxF,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM;IAanE,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM;IAUtD,SAAS,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB;IAMrE,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB;CAItE"}
package/package.json CHANGED
@@ -1,24 +1,41 @@
1
1
  {
2
2
  "name": "arisu.js",
3
- "version": "1.0.4",
4
- "description": "",
5
- "main": "dist/arisu.min.js",
3
+ "version": "2.0.1-alpha.1",
4
+ "description": "npm publish --tag alpha,安装:npm install arisu.js@alpha",
5
+ "main": "dist/arisu.umd.js",
6
+ "module": "dist/arisu.esm.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
6
11
  "scripts": {
7
12
  "start": "http-server",
8
- "build": "webpack"
13
+ "build:types": "rimraf dist/types && tsc -p tsconfig.build.json",
14
+ "build": "webpack --config webpack.config.js",
15
+ "build:commonjs": "webpack --config webpack.commonjs.config.js",
16
+ "build:esm": "webpack --config webpack.esm.config.js",
17
+ "build:all": "npm run build:types && npm run build && npm run build:commonjs && npm run build:esm"
9
18
  },
10
19
  "keywords": [],
11
20
  "author": "arisu.cn",
12
21
  "license": "ISC",
13
22
  "devDependencies": {
23
+ "@microsoft/api-extractor": "^7.58.7",
14
24
  "css-loader": "^7.1.2",
15
25
  "handlebars": "^4.7.8",
16
26
  "html-webpack-plugin": "^5.6.0",
17
27
  "http-server": "^14.1.1",
28
+ "strict-loader": "^1.2.0",
18
29
  "style-loader": "^4.0.0",
30
+ "ts-loader": "^9.5.7",
31
+ "tsc-alias": "^1.8.17",
32
+ "typescript": "^6.0.3",
19
33
  "url-loader": "^4.1.1",
20
- "webpack": "^5.92.1",
34
+ "webpack": "^5.107.0",
21
35
  "webpack-cli": "^5.1.4",
22
36
  "webpack-dev-server": "^5.0.4"
37
+ },
38
+ "dependencies": {
39
+ "jsonwebtoken": "^9.0.2"
23
40
  }
24
- }
41
+ }