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,g,d=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},h=c,m=Function.prototype,S=m.call,j=h&&m.bind.bind(S,S),w=h?j:function(t){return function(){return S.apply(t,arguments)}},O=w,P=O({}.toString),E=O("".slice),T=function(t){return E(P(t),8,-1)},A=i,x=T,M=Object,F=w("".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,_=function(t){if(D(t))throw L("Can't call method on "+t);return t},k=I,z=_,N=function(t){return k(z(t))},R="object"==typeof document&&document.all,G={all:R,IS_HTMLDDA:void 0===R&&void 0!==R},q=G.all,B=G.IS_HTMLDDA?function(t){return"function"==typeof t||t===q}:function(t){return"function"==typeof t},H=B,U=G.all,W=G.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:H(t)||t===U}:function(t){return"object"==typeof t?null!==t:H(t)},J=r,K=B,Q=function(t,n){return arguments.length<2?(e=J[t],K(e)?e:void 0):J[t]&&J[t][n];var e},V=w({}.isPrototypeOf),X=r,Y="undefined"!=typeof navigator&&String(navigator.userAgent)||"",$=X.process,Z=X.Deno,tt=$&&$.versions||Z&&Z.version,nt=tt&&tt.v8;nt&&(g=(v=nt.split("."))[0]>0&&v[0]<4?1:+(v[0]+v[1])),!g&&Y&&(!(v=Y.match(/Edge\/(\d+)/))||v[1]>=74)&&(v=Y.match(/Chrome\/(\d+)/))&&(g=+v[1]);var et=g,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=Q,at=B,lt=V,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=B,vt=function(t){try{return yt(t)}catch(t){return"Object"}},gt=TypeError,dt=function(t){if(bt(t))return t;throw gt(vt(t)+" is not a function")},ht=C,mt=l,St=B,jt=W,wt=TypeError,Ot={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;(Ot.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=Ot.exports,Ct=_,Dt=Object,Lt=function(t){return Dt(Ct(t))},_t=Lt,kt=w({}.hasOwnProperty),zt=Object.hasOwn||function(t,n){return kt(_t(t),n)},Nt=w,Rt=0,Gt=Math.random(),qt=Nt(1..toString),Bt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+qt(++Rt+Gt,36)},Ht=It,Ut=zt,Wt=Bt,Jt=ut,Kt=ct,Qt=r.Symbol,Vt=Ht("wks"),Xt=Kt?Qt.for||Qt:Qt&&Qt.withoutSetter||Wt,Yt=function(t){return Ut(Vt,t)||(Vt[t]=Jt&&Ut(Qt,t)?Qt[t]:Xt("Symbol."+t)),Vt[t]},$t=l,Zt=W,tn=pt,nn=function(t,n){var e=t[n];return ht(e)?void 0:dt(e)},en=function(t,n){var e,r;if("string"===n&&St(e=t.toString)&&!jt(r=mt(e,t)))return r;if(St(e=t.valueOf)&&!jt(r=mt(e,t)))return r;if("string"!==n&&St(e=t.toString)&&!jt(r=mt(e,t)))return r;throw wt("Can't convert object to primitive value")},rn=TypeError,on=Yt("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=$t(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,gn=s,dn=d,hn=N,mn=fn,Sn=zt,jn=yn,wn=Object.getOwnPropertyDescriptor;o.f=bn?wn:function(t,n){if(t=hn(t),n=mn(n),jn)try{return wn(t,n)}catch(t){}if(Sn(t,n))return dn(!vn(gn.f,t,n),t[n])};var On={},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,_n=Object.defineProperty,kn=Object.getOwnPropertyDescriptor,zn="enumerable",Nn="configurable",Rn="writable";On.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=kn(t,n);r&&r[Rn]&&(t[n]=e.value,e={configurable:Nn in e?e[Nn]:r[Nn],enumerable:zn in e?e[zn]:r[zn],writable:!1})}return _n(t,n,e)}:_n:function(t,n,e){if(Cn(t),n=Dn(n),Cn(e),Fn)try{return _n(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=On,qn=d,Bn=u?function(t,n,e){return Gn.f(t,n,qn(1,e))}:function(t,n,e){return t[n]=e,t},Hn={exports:{}},Un=u,Wn=zt,Jn=Function.prototype,Kn=Un&&Object.getOwnPropertyDescriptor,Qn=Wn(Jn,"name"),Vn={EXISTS:Qn,PROPER:Qn&&"something"===function(){}.name,CONFIGURABLE:Qn&&(!Un||Un&&Kn(Jn,"name").configurable)},Xn=B,Yn=Mt,$n=w(Function.toString);Xn(Yn.inspectSource)||(Yn.inspectSource=function(t){return $n(t)});var Zn,te,ne,ee=Yn.inspectSource,re=B,oe=r.WeakMap,ie=re(oe)&&/native code/.test(String(oe)),ue=Bt,ce=It("keys"),fe={},ae=ie,le=r,se=W,pe=Bn,ye=zt,be=Mt,ve=function(t){return ce[t]||(ce[t]=ue(t))},ge=fe,de="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(de);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 je=ve("state");ge[je]=!0,Zn=function(t,n){if(ye(t,je))throw he(de);return n.facade=t,pe(t,je,n),n},te=function(t){return ye(t,je)?t[je]:{}},ne=function(t){return ye(t,je)}}var we={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}}},Oe=w,Pe=i,Ee=B,Te=zt,Ae=u,xe=Vn.CONFIGURABLE,Me=ee,Fe=we.enforce,Ie=we.get,Ce=String,De=Object.defineProperty,Le=Oe("".slice),_e=Oe("".replace),ke=Oe([].join),ze=Ae&&!Pe((function(){return 8!==De((function(){}),"length",{value:8}).length})),Ne=String(String).split("String"),Re=Hn.exports=function(t,n,e){"Symbol("===Le(Ce(n),0,7)&&(n="["+_e(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),ze&&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=ke(Ne,"string"==typeof n?n:"")),t};Function.prototype.toString=Re((function(){return Ee(this)&&Ie(this).source||Me(this)}),"toString");var Ge=Hn.exports,qe=B,Be=On,He=Ge,Ue=Tt,We={},Je=Math.ceil,Ke=Math.floor,Qe=Math.trunc||function(t){var n=+t;return(n>0?Ke:Je)(n)},Ve=function(t){var n=+t;return n!=n||0===n?0:Qe(n)},Xe=Ve,Ye=Math.max,$e=Math.min,Ze=Ve,tr=Math.min,nr=function(t){return t>0?tr(Ze(t),9007199254740991):0},er=function(t){return nr(t.length)},rr=N,or=function(t,n){var e=Xe(t);return e<0?Ye(e+n,0):$e(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=zt,ar=N,lr=cr.indexOf,sr=fe,pr=w([].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 gr=Q,dr=We,hr=vr,mr=xn,Sr=w([].concat),jr=gr("Reflect","ownKeys")||function(t){var n=dr.f(mr(t)),e=hr.f;return e?Sr(n,e(t)):n},wr=zt,Or=jr,Pr=o,Er=On,Tr=i,Ar=B,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,_r=r,kr=o.f,zr=Bn,Nr=function(t,n,e,r){r||(r={});var o=r.enumerable,i=void 0!==r.name?r.name:n;if(qe(e)&&He(e,i,r),r.global)o?t[n]=e:Ue(n,e);else{try{r.unsafe?t[n]&&(o=!0):delete t[n]}catch(t){}o?t[n]=e:Be.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=Or(n),o=Er.f,i=Pr.f,u=0;u<r.length;u++){var c=r[u];wr(t,c)||e&&wr(e,c)||o(t,c,i(n,c))}},qr=Lr,Br=T,Hr=Array.isArray||function(t){return"Array"==Br(t)},Ur=TypeError,Wr=fn,Jr=On,Kr=d,Qr={};Qr[Yt("toStringTag")]="z";var Vr="[object z]"===String(Qr),Xr=B,Yr=T,$r=Yt("toStringTag"),Zr=Object,to="Arguments"==Yr(function(){return arguments}()),no=w,eo=i,ro=B,oo=Vr?Yr: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),$r))?e:to?Yr(n):"Object"==(r=Yr(n))&&Xr(n.callee)?"Arguments":r},io=ee,uo=function(){},co=[],fo=Q("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=Hr,go=bo,ho=W,mo=Yt("species"),So=Array,jo=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},wo=i,Oo=et,Po=Yt("species"),Eo=function(t,n){var e,r,o,i,u,c=t.target,f=t.global,a=t.stat;if(e=f?_r:a?_r[c]||Rr(c,{}):(_r[c]||{}).prototype)for(r in n){if(i=n[r],o=t.dontCallGetSet?(u=kr(e,r))&&u.value:e[r],!qr(f?r:c+(a?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Gr(i,o)}(t.sham||o&&o.sham)&&zr(i,"sham",!0),Nr(e,r,i,t)}},To=i,Ao=Hr,xo=W,Mo=Lt,Fo=er,Io=function(t){if(t>9007199254740991)throw Ur("Maximum allowed index exceeded");return t},Co=function(t,n,e){var r=Wr(n);r in t?Jr.f(t,r,Kr(0,e)):t[r]=e},Do=function(t,n){return new(jo(t))(0===n?0:n)},Lo=function(t){return Oo>=51||!wo((function(){var n=[];return(n.constructor={})[Po]=function(){return{foo:1}},1!==n[t](Boolean).foo}))},_o=et,ko=Yt("isConcatSpreadable"),zo=_o>=51||!To((function(){var t=[];return t[ko]=!1,t.concat()[0]!==t})),No=function(t){if(!xo(t))return!1;var n=t[ko];return void 0!==n?!!n:Ao(t)};Eo({target:"Array",proto:!0,arity:1,forced:!zo||!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(No(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["ja-JP"]={formatSelectAll:function(){return"[すべて選択]"},formatAllSelected:function(){return"すべて選択"},formatCountSelected:function(t,n){return"".concat(n," 件中 ").concat(t," 件選択")},formatNoMatchesFound:function(){return"見つかりません"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["ja-JP"])}));