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,h=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},d=c,m=Function.prototype,S=m.call,w=d&&m.bind.bind(S,S),O=d?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,C=O("".split),F=A((function(){return!M("z").propertyIsEnumerable(0)}))?function(t){return"String"==x(t)?C(t,""):M(t)}:M,I=function(t){return null==t},D=I,L=TypeError,z=function(t){if(D(t))throw L("Can't call method on "+t);return t},N=F,_=z,k=function(t){return N(_(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)},K=r,Q=B,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&&(g=(v=nt.split("."))[0]>0&&v[0]<4?1:+(v[0]+v[1])),!g&&$&&(!(v=$.match(/Edge\/(\d+)/))||v[1]>=74)&&(v=$.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=V,at=B,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=B,vt=function(t){try{return yt(t)}catch(t){return"Object"}},gt=TypeError,ht=function(t){if(bt(t))return t;throw gt(vt(t)+" is not a function")},dt=I,mt=l,St=B,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,{}),Ct=Mt;(jt.exports=function(t,n){return Ct[t]||(Ct[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 Ft=jt.exports,It=z,Dt=Object,Lt=function(t){return Dt(It(t))},zt=Lt,Nt=O({}.hasOwnProperty),_t=Object.hasOwn||function(t,n){return Nt(zt(t),n)},kt=O,Rt=0,Gt=Math.random(),qt=kt(1..toString),Bt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+qt(++Rt+Gt,36)},Ht=Ft,Ut=_t,Wt=Bt,Kt=ut,Qt=ct,Vt=r.Symbol,Xt=Ht("wks"),Yt=Qt?Vt.for||Vt:Vt&&Vt.withoutSetter||Wt,$t=function(t){return Ut(Xt,t)||(Xt[t]=Kt&&Ut(Vt,t)?Vt[t]:Yt("Symbol."+t)),Xt[t]},Jt=l,Zt=W,tn=pt,nn=function(t,n){var e=t[n];return dt(e)?void 0:ht(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,gn=s,hn=h,dn=k,mn=fn,Sn=_t,wn=yn,On=Object.getOwnPropertyDescriptor;o.f=bn?On:function(t,n){if(t=dn(t),n=mn(n),wn)try{return On(t,n)}catch(t){}if(Sn(t,n))return hn(!vn(gn.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,Cn=yn,Fn=Pn,In=xn,Dn=fn,Ln=TypeError,zn=Object.defineProperty,Nn=Object.getOwnPropertyDescriptor,_n="enumerable",kn="configurable",Rn="writable";jn.f=Mn?Fn?function(t,n,e){if(In(t),n=Dn(n),In(e),"function"==typeof t&&"prototype"===n&&"value"in e&&Rn in e&&!e[Rn]){var r=Nn(t,n);r&&r[Rn]&&(t[n]=e.value,e={configurable:kn in e?e[kn]:r[kn],enumerable:_n in e?e[_n]:r[_n],writable:!1})}return zn(t,n,e)}:zn:function(t,n,e){if(In(t),n=Dn(n),In(e),Cn)try{return zn(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,qn=h,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=_t,Kn=Function.prototype,Qn=Un&&Object.getOwnPropertyDescriptor,Vn=Wn(Kn,"name"),Xn={EXISTS:Vn,PROPER:Vn&&"something"===function(){}.name,CONFIGURABLE:Vn&&(!Un||Un&&Qn(Kn,"name").configurable)},Yn=B,$n=Mt,Jn=O(Function.toString);Yn($n.inspectSource)||($n.inspectSource=function(t){return Jn(t)});var Zn,te,ne,ee=$n.inspectSource,re=B,oe=r.WeakMap,ie=re(oe)&&/native code/.test(String(oe)),ue=Bt,ce=Ft("keys"),fe={},ae=ie,le=r,se=W,pe=Bn,ye=_t,be=Mt,ve=function(t){return ce[t]||(ce[t]=ue(t))},ge=fe,he="Object already initialized",de=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 de(he);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");ge[we]=!0,Zn=function(t,n){if(ye(t,we))throw de(he);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 de("Incompatible receiver, "+t+" required");return e}}},je=O,Pe=i,Ee=B,Te=_t,Ae=u,xe=Xn.CONFIGURABLE,Me=ee,Ce=Oe.enforce,Fe=Oe.get,Ie=String,De=Object.defineProperty,Le=je("".slice),ze=je("".replace),Ne=je([].join),_e=Ae&&!Pe((function(){return 8!==De((function(){}),"length",{value:8}).length})),ke=String(String).split("String"),Re=Hn.exports=function(t,n,e){"Symbol("===Le(Ie(n),0,7)&&(n="["+ze(Ie(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),_e&&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=Ce(t);return Te(r,"source")||(r.source=Ne(ke,"string"==typeof n?n:"")),t};Function.prototype.toString=Re((function(){return Ee(this)&&Fe(this).source||Me(this)}),"toString");var Ge=Hn.exports,qe=B,Be=jn,He=Ge,Ue=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=k,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=_t,ar=k,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 gr=V,hr=We,dr=vr,mr=xn,Sr=O([].concat),wr=gr("Reflect","ownKeys")||function(t){var n=hr.f(mr(t)),e=dr.f;return e?Sr(n,e(t)):n},Or=_t,jr=wr,Pr=o,Er=jn,Tr=i,Ar=B,xr=/#|\.prototype\./,Mr=function(t,n){var e=Fr[Cr(t)];return e==Dr||e!=Ir&&(Ar(n)?Tr(n):!!n)},Cr=Mr.normalize=function(t){return String(t).replace(xr,".").toLowerCase()},Fr=Mr.data={},Ir=Mr.NATIVE="N",Dr=Mr.POLYFILL="P",Lr=Mr,zr=r,Nr=o.f,_r=Bn,kr=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=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))}},qr=Lr,Br=T,Hr=Array.isArray||function(t){return"Array"==Br(t)},Ur=TypeError,Wr=fn,Kr=jn,Qr=h,Vr={};Vr[$t("toStringTag")]="z";var Xr="[object z]"===String(Vr),Yr=B,$r=T,Jr=$t("toStringTag"),Zr=Object,to="Arguments"==$r(function(){return arguments}()),no=O,eo=i,ro=B,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=Hr,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?zr:a?zr[c]||Rr(c,{}):(zr[c]||{}).prototype)for(r in n){if(i=n[r],o=t.dontCallGetSet?(u=Nr(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)&&_r(i,"sham",!0),kr(e,r,i,t)}},To=i,Ao=Hr,xo=W,Mo=Lt,Co=er,Fo=function(t){if(t>9007199254740991)throw Ur("Maximum allowed index exceeded");return t},Io=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}))},zo=et,No=$t("isConcatSpreadable"),_o=zo>=51||!To((function(){var t=[];return t[No]=!1,t.concat()[0]!==t})),ko=function(t){if(!xo(t))return!1;var n=t[No];return void 0!==n?!!n:Ao(t)};Eo({target:"Array",proto:!0,arity:1,forced:!_o||!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(ko(i=-1===n?u:arguments[n]))for(o=Co(i),Fo(f+o),e=0;e<o;e++,f++)e in i&&Io(c,f,i[e]);else Fo(f+1),Io(c,f++,i);return c.length=f,c}}),t.fn.multipleSelect.locales["zh-CN"]={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["zh-CN"])}));