multiple-select
Version:
Multiple select is a jQuery plugin to select multiple elements with checkboxes :).
11 lines (9 loc) • 12.8 kB
JavaScript
/**
* multiple-select - Multiple select is a jQuery plugin to select multiple elements with checkboxes :).
*
* @version v1.7.0
* @homepage http://multiple-select.wenzhixin.net.cn
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
* @license MIT
*/
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).jQuery)}(this,(function(t){"use strict";var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(t){return t&&t.Math==Math&&t},r=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof n&&n)||function(){return this}()||n||Function("return this")(),o={},i=function(t){try{return!!t()}catch(t){return!0}},u=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),c=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),f=c,a=Function.prototype.call,l=f?a.bind(a):function(){return a.apply(a,arguments)},s={},p={}.propertyIsEnumerable,y=Object.getOwnPropertyDescriptor,b=y&&!p.call({1:2},1);s.f=b?function(t){var n=y(this,t);return!!n&&n.enumerable}:p;var v,d,g=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},h=c,m=Function.prototype,S=m.call,w=h&&m.bind.bind(S,S),O=h?w:function(t){return function(){return S.apply(t,arguments)}},j=O,P=j({}.toString),E=j("".slice),T=function(t){return E(P(t),8,-1)},A=i,x=T,M=Object,F=O("".split),I=A((function(){return!M("z").propertyIsEnumerable(0)}))?function(t){return"String"==x(t)?F(t,""):M(t)}:M,C=function(t){return null==t},D=C,L=TypeError,N=function(t){if(D(t))throw L("Can't call method on "+t);return t},_=I,k=N,z=function(t){return _(k(t))},R="object"==typeof document&&document.all,G={all:R,IS_HTMLDDA:void 0===R&&void 0!==R},U=G.all,q=G.IS_HTMLDDA?function(t){return"function"==typeof t||t===U}:function(t){return"function"==typeof t},B=q,H=G.all,W=G.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:B(t)||t===H}:function(t){return"object"==typeof t?null!==t:B(t)},K=r,Q=q,V=function(t,n){return arguments.length<2?(e=K[t],Q(e)?e:void 0):K[t]&&K[t][n];var e},X=O({}.isPrototypeOf),Y=r,$="undefined"!=typeof navigator&&String(navigator.userAgent)||"",J=Y.process,Z=Y.Deno,tt=J&&J.versions||Z&&Z.version,nt=tt&&tt.v8;nt&&(d=(v=nt.split("."))[0]>0&&v[0]<4?1:+(v[0]+v[1])),!d&&$&&(!(v=$.match(/Edge\/(\d+)/))||v[1]>=74)&&(v=$.match(/Chrome\/(\d+)/))&&(d=+v[1]);var et=d,rt=et,ot=i,it=r.String,ut=!!Object.getOwnPropertySymbols&&!ot((function(){var t=Symbol();return!it(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&rt&&rt<41})),ct=ut&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ft=V,at=q,lt=X,st=Object,pt=ct?function(t){return"symbol"==typeof t}:function(t){var n=ft("Symbol");return at(n)&<(n.prototype,st(t))},yt=String,bt=q,vt=function(t){try{return yt(t)}catch(t){return"Object"}},dt=TypeError,gt=function(t){if(bt(t))return t;throw dt(vt(t)+" is not a function")},ht=C,mt=l,St=q,wt=W,Ot=TypeError,jt={exports:{}},Pt=r,Et=Object.defineProperty,Tt=function(t,n){try{Et(Pt,t,{value:n,configurable:!0,writable:!0})}catch(e){Pt[t]=n}return n},At=Tt,xt="__core-js_shared__",Mt=r[xt]||At(xt,{}),Ft=Mt;(jt.exports=function(t,n){return Ft[t]||(Ft[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.30.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var It=jt.exports,Ct=N,Dt=Object,Lt=function(t){return Dt(Ct(t))},Nt=Lt,_t=O({}.hasOwnProperty),kt=Object.hasOwn||function(t,n){return _t(Nt(t),n)},zt=O,Rt=0,Gt=Math.random(),Ut=zt(1..toString),qt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Ut(++Rt+Gt,36)},Bt=It,Ht=kt,Wt=qt,Kt=ut,Qt=ct,Vt=r.Symbol,Xt=Bt("wks"),Yt=Qt?Vt.for||Vt:Vt&&Vt.withoutSetter||Wt,$t=function(t){return Ht(Xt,t)||(Xt[t]=Kt&&Ht(Vt,t)?Vt[t]:Yt("Symbol."+t)),Xt[t]},Jt=l,Zt=W,tn=pt,nn=function(t,n){var e=t[n];return ht(e)?void 0:gt(e)},en=function(t,n){var e,r;if("string"===n&&St(e=t.toString)&&!wt(r=mt(e,t)))return r;if(St(e=t.valueOf)&&!wt(r=mt(e,t)))return r;if("string"!==n&&St(e=t.toString)&&!wt(r=mt(e,t)))return r;throw Ot("Can't convert object to primitive value")},rn=TypeError,on=$t("toPrimitive"),un=function(t,n){if(!Zt(t)||tn(t))return t;var e,r=nn(t,on);if(r){if(void 0===n&&(n="default"),e=Jt(r,t,n),!Zt(e)||tn(e))return e;throw rn("Can't convert object to primitive value")}return void 0===n&&(n="number"),en(t,n)},cn=pt,fn=function(t){var n=un(t,"string");return cn(n)?n:n+""},an=W,ln=r.document,sn=an(ln)&&an(ln.createElement),pn=function(t){return sn?ln.createElement(t):{}},yn=!u&&!i((function(){return 7!=Object.defineProperty(pn("div"),"a",{get:function(){return 7}}).a})),bn=u,vn=l,dn=s,gn=g,hn=z,mn=fn,Sn=kt,wn=yn,On=Object.getOwnPropertyDescriptor;o.f=bn?On:function(t,n){if(t=hn(t),n=mn(n),wn)try{return On(t,n)}catch(t){}if(Sn(t,n))return gn(!vn(dn.f,t,n),t[n])};var jn={},Pn=u&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),En=W,Tn=String,An=TypeError,xn=function(t){if(En(t))return t;throw An(Tn(t)+" is not an object")},Mn=u,Fn=yn,In=Pn,Cn=xn,Dn=fn,Ln=TypeError,Nn=Object.defineProperty,_n=Object.getOwnPropertyDescriptor,kn="enumerable",zn="configurable",Rn="writable";jn.f=Mn?In?function(t,n,e){if(Cn(t),n=Dn(n),Cn(e),"function"==typeof t&&"prototype"===n&&"value"in e&&Rn in e&&!e[Rn]){var r=_n(t,n);r&&r[Rn]&&(t[n]=e.value,e={configurable:zn in e?e[zn]:r[zn],enumerable:kn in e?e[kn]:r[kn],writable:!1})}return Nn(t,n,e)}:Nn:function(t,n,e){if(Cn(t),n=Dn(n),Cn(e),Fn)try{return Nn(t,n,e)}catch(t){}if("get"in e||"set"in e)throw Ln("Accessors not supported");return"value"in e&&(t[n]=e.value),t};var Gn=jn,Un=g,qn=u?function(t,n,e){return Gn.f(t,n,Un(1,e))}:function(t,n,e){return t[n]=e,t},Bn={exports:{}},Hn=u,Wn=kt,Kn=Function.prototype,Qn=Hn&&Object.getOwnPropertyDescriptor,Vn=Wn(Kn,"name"),Xn={EXISTS:Vn,PROPER:Vn&&"something"===function(){}.name,CONFIGURABLE:Vn&&(!Hn||Hn&&Qn(Kn,"name").configurable)},Yn=q,$n=Mt,Jn=O(Function.toString);Yn($n.inspectSource)||($n.inspectSource=function(t){return Jn(t)});var Zn,te,ne,ee=$n.inspectSource,re=q,oe=r.WeakMap,ie=re(oe)&&/native code/.test(String(oe)),ue=qt,ce=It("keys"),fe={},ae=ie,le=r,se=W,pe=qn,ye=kt,be=Mt,ve=function(t){return ce[t]||(ce[t]=ue(t))},de=fe,ge="Object already initialized",he=le.TypeError,me=le.WeakMap;if(ae||be.state){var Se=be.state||(be.state=new me);Se.get=Se.get,Se.has=Se.has,Se.set=Se.set,Zn=function(t,n){if(Se.has(t))throw he(ge);return n.facade=t,Se.set(t,n),n},te=function(t){return Se.get(t)||{}},ne=function(t){return Se.has(t)}}else{var we=ve("state");de[we]=!0,Zn=function(t,n){if(ye(t,we))throw he(ge);return n.facade=t,pe(t,we,n),n},te=function(t){return ye(t,we)?t[we]:{}},ne=function(t){return ye(t,we)}}var Oe={set:Zn,get:te,has:ne,enforce:function(t){return ne(t)?te(t):Zn(t,{})},getterFor:function(t){return function(n){var e;if(!se(n)||(e=te(n)).type!==t)throw he("Incompatible receiver, "+t+" required");return e}}},je=O,Pe=i,Ee=q,Te=kt,Ae=u,xe=Xn.CONFIGURABLE,Me=ee,Fe=Oe.enforce,Ie=Oe.get,Ce=String,De=Object.defineProperty,Le=je("".slice),Ne=je("".replace),_e=je([].join),ke=Ae&&!Pe((function(){return 8!==De((function(){}),"length",{value:8}).length})),ze=String(String).split("String"),Re=Bn.exports=function(t,n,e){"Symbol("===Le(Ce(n),0,7)&&(n="["+Ne(Ce(n),/^Symbol\(([^)]*)\)/,"$1")+"]"),e&&e.getter&&(n="get "+n),e&&e.setter&&(n="set "+n),(!Te(t,"name")||xe&&t.name!==n)&&(Ae?De(t,"name",{value:n,configurable:!0}):t.name=n),ke&&e&&Te(e,"arity")&&t.length!==e.arity&&De(t,"length",{value:e.arity});try{e&&Te(e,"constructor")&&e.constructor?Ae&&De(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=Fe(t);return Te(r,"source")||(r.source=_e(ze,"string"==typeof n?n:"")),t};Function.prototype.toString=Re((function(){return Ee(this)&&Ie(this).source||Me(this)}),"toString");var Ge=Bn.exports,Ue=q,qe=jn,Be=Ge,He=Tt,We={},Ke=Math.ceil,Qe=Math.floor,Ve=Math.trunc||function(t){var n=+t;return(n>0?Qe:Ke)(n)},Xe=function(t){var n=+t;return n!=n||0===n?0:Ve(n)},Ye=Xe,$e=Math.max,Je=Math.min,Ze=Xe,tr=Math.min,nr=function(t){return t>0?tr(Ze(t),9007199254740991):0},er=function(t){return nr(t.length)},rr=z,or=function(t,n){var e=Ye(t);return e<0?$e(e+n,0):Je(e,n)},ir=er,ur=function(t){return function(n,e,r){var o,i=rr(n),u=ir(i),c=or(r,u);if(t&&e!=e){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===e)return t||c||0;return!t&&-1}},cr={includes:ur(!0),indexOf:ur(!1)},fr=kt,ar=z,lr=cr.indexOf,sr=fe,pr=O([].push),yr=function(t,n){var e,r=ar(t),o=0,i=[];for(e in r)!fr(sr,e)&&fr(r,e)&&pr(i,e);for(;n.length>o;)fr(r,e=n[o++])&&(~lr(i,e)||pr(i,e));return i},br=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");We.f=Object.getOwnPropertyNames||function(t){return yr(t,br)};var vr={};vr.f=Object.getOwnPropertySymbols;var dr=V,gr=We,hr=vr,mr=xn,Sr=O([].concat),wr=dr("Reflect","ownKeys")||function(t){var n=gr.f(mr(t)),e=hr.f;return e?Sr(n,e(t)):n},Or=kt,jr=wr,Pr=o,Er=jn,Tr=i,Ar=q,xr=/#|\.prototype\./,Mr=function(t,n){var e=Ir[Fr(t)];return e==Dr||e!=Cr&&(Ar(n)?Tr(n):!!n)},Fr=Mr.normalize=function(t){return String(t).replace(xr,".").toLowerCase()},Ir=Mr.data={},Cr=Mr.NATIVE="N",Dr=Mr.POLYFILL="P",Lr=Mr,Nr=r,_r=o.f,kr=qn,zr=function(t,n,e,r){r||(r={});var o=r.enumerable,i=void 0!==r.name?r.name:n;if(Ue(e)&&Be(e,i,r),r.global)o?t[n]=e:He(n,e);else{try{r.unsafe?t[n]&&(o=!0):delete t[n]}catch(t){}o?t[n]=e:qe.f(t,n,{value:e,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},Rr=Tt,Gr=function(t,n,e){for(var r=jr(n),o=Er.f,i=Pr.f,u=0;u<r.length;u++){var c=r[u];Or(t,c)||e&&Or(e,c)||o(t,c,i(n,c))}},Ur=Lr,qr=T,Br=Array.isArray||function(t){return"Array"==qr(t)},Hr=TypeError,Wr=fn,Kr=jn,Qr=g,Vr={};Vr[$t("toStringTag")]="z";var Xr="[object z]"===String(Vr),Yr=q,$r=T,Jr=$t("toStringTag"),Zr=Object,to="Arguments"==$r(function(){return arguments}()),no=O,eo=i,ro=q,oo=Xr?$r:function(t){var n,e,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,n){try{return t[n]}catch(t){}}(n=Zr(t),Jr))?e:to?$r(n):"Object"==(r=$r(n))&&Yr(n.callee)?"Arguments":r},io=ee,uo=function(){},co=[],fo=V("Reflect","construct"),ao=/^\s*(?:class|function)\b/,lo=no(ao.exec),so=!ao.exec(uo),po=function(t){if(!ro(t))return!1;try{return fo(uo,co,t),!0}catch(t){return!1}},yo=function(t){if(!ro(t))return!1;switch(oo(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return so||!!lo(ao,io(t))}catch(t){return!0}};yo.sham=!0;var bo=!fo||eo((function(){var t;return po(po.call)||!po(Object)||!po((function(){t=!0}))||t}))?yo:po,vo=Br,go=bo,ho=W,mo=$t("species"),So=Array,wo=function(t){var n;return vo(t)&&(n=t.constructor,(go(n)&&(n===So||vo(n.prototype))||ho(n)&&null===(n=n[mo]))&&(n=void 0)),void 0===n?So:n},Oo=i,jo=et,Po=$t("species"),Eo=function(t,n){var e,r,o,i,u,c=t.target,f=t.global,a=t.stat;if(e=f?Nr:a?Nr[c]||Rr(c,{}):(Nr[c]||{}).prototype)for(r in n){if(i=n[r],o=t.dontCallGetSet?(u=_r(e,r))&&u.value:e[r],!Ur(f?r:c+(a?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Gr(i,o)}(t.sham||o&&o.sham)&&kr(i,"sham",!0),zr(e,r,i,t)}},To=i,Ao=Br,xo=W,Mo=Lt,Fo=er,Io=function(t){if(t>9007199254740991)throw Hr("Maximum allowed index exceeded");return t},Co=function(t,n,e){var r=Wr(n);r in t?Kr.f(t,r,Qr(0,e)):t[r]=e},Do=function(t,n){return new(wo(t))(0===n?0:n)},Lo=function(t){return jo>=51||!Oo((function(){var n=[];return(n.constructor={})[Po]=function(){return{foo:1}},1!==n[t](Boolean).foo}))},No=et,_o=$t("isConcatSpreadable"),ko=No>=51||!To((function(){var t=[];return t[_o]=!1,t.concat()[0]!==t})),zo=function(t){if(!xo(t))return!1;var n=t[_o];return void 0!==n?!!n:Ao(t)};Eo({target:"Array",proto:!0,arity:1,forced:!ko||!Lo("concat")},{concat:function(t){var n,e,r,o,i,u=Mo(this),c=Do(u,0),f=0;for(n=-1,r=arguments.length;n<r;n++)if(zo(i=-1===n?u:arguments[n]))for(o=Fo(i),Io(f+o),e=0;e<o;e++,f++)e in i&&Co(c,f,i[e]);else Io(f+1),Co(c,f++,i);return c.length=f,c}}),t.fn.multipleSelect.locales["en-US"]={formatSelectAll:function(){return"[Select all]"},formatAllSelected:function(){return"All selected"},formatCountSelected:function(t,n){return"".concat(t," of ").concat(n," selected")},formatNoMatchesFound:function(){return"No matches found"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["en-US"])}));