UNPKG

multiple-select

Version:

Multiple select is a jQuery plugin to select multiple elements with checkboxes :).

11 lines (9 loc) 12.8 kB
/** * 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:{},r=function(t){return t&&t.Math==Math&&t},e=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("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,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,_=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},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=e,Q=q,V=function(t,n){return arguments.length<2?(r=K[t],Q(r)?r:void 0):K[t]&&K[t][n];var r},X=O({}.isPrototypeOf),Y=e,$="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 rt=g,et=rt,ot=i,it=e.String,ut=!!Object.getOwnPropertySymbols&&!ot((function(){var t=Symbol();return!it(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&et&&et<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)&&lt(n.prototype,st(t))},yt=String,bt=q,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=q,wt=W,Ot=TypeError,jt={exports:{}},Pt=e,Et=Object.defineProperty,Tt=function(t,n){try{Et(Pt,t,{value:n,configurable:!0,writable:!0})}catch(r){Pt[t]=n}return n},At=Tt,xt="__core-js_shared__",Mt=e[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=_,Dt=Object,Lt=function(t){return Dt(Ct(t))},_t=Lt,kt=O({}.hasOwnProperty),zt=Object.hasOwn||function(t,n){return kt(_t(t),n)},Nt=O,Rt=0,Gt=Math.random(),Ut=Nt(1..toString),qt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Ut(++Rt+Gt,36)},Bt=It,Ht=zt,Wt=qt,Kt=ut,Qt=ct,Vt=e.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 r=t[n];return ht(r)?void 0:dt(r)},rn=function(t,n){var r,e;if("string"===n&&St(r=t.toString)&&!wt(e=mt(r,t)))return e;if(St(r=t.valueOf)&&!wt(e=mt(r,t)))return e;if("string"!==n&&St(r=t.toString)&&!wt(e=mt(r,t)))return e;throw Ot("Can't convert object to primitive value")},en=TypeError,on=$t("toPrimitive"),un=function(t,n){if(!Zt(t)||tn(t))return t;var r,e=nn(t,on);if(e){if(void 0===n&&(n="default"),r=Jt(e,t,n),!Zt(r)||tn(r))return r;throw en("Can't convert object to primitive value")}return void 0===n&&(n="number"),rn(t,n)},cn=pt,fn=function(t){var n=un(t,"string");return cn(n)?n:n+""},an=W,ln=e.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,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 dn(!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,Fn=yn,In=Pn,Cn=xn,Dn=fn,Ln=TypeError,_n=Object.defineProperty,kn=Object.getOwnPropertyDescriptor,zn="enumerable",Nn="configurable",Rn="writable";jn.f=Mn?In?function(t,n,r){if(Cn(t),n=Dn(n),Cn(r),"function"==typeof t&&"prototype"===n&&"value"in r&&Rn in r&&!r[Rn]){var e=kn(t,n);e&&e[Rn]&&(t[n]=r.value,r={configurable:Nn in r?r[Nn]:e[Nn],enumerable:zn in r?r[zn]:e[zn],writable:!1})}return _n(t,n,r)}:_n:function(t,n,r){if(Cn(t),n=Dn(n),Cn(r),Fn)try{return _n(t,n,r)}catch(t){}if("get"in r||"set"in r)throw Ln("Accessors not supported");return"value"in r&&(t[n]=r.value),t};var Gn=jn,Un=d,qn=u?function(t,n,r){return Gn.f(t,n,Un(1,r))}:function(t,n,r){return t[n]=r,t},Bn={exports:{}},Hn=u,Wn=zt,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,tr,nr,rr=$n.inspectSource,er=q,or=e.WeakMap,ir=er(or)&&/native code/.test(String(or)),ur=qt,cr=It("keys"),fr={},ar=ir,lr=e,sr=W,pr=qn,yr=zt,br=Mt,vr=function(t){return cr[t]||(cr[t]=ur(t))},gr=fr,dr="Object already initialized",hr=lr.TypeError,mr=lr.WeakMap;if(ar||br.state){var Sr=br.state||(br.state=new mr);Sr.get=Sr.get,Sr.has=Sr.has,Sr.set=Sr.set,Zn=function(t,n){if(Sr.has(t))throw hr(dr);return n.facade=t,Sr.set(t,n),n},tr=function(t){return Sr.get(t)||{}},nr=function(t){return Sr.has(t)}}else{var wr=vr("state");gr[wr]=!0,Zn=function(t,n){if(yr(t,wr))throw hr(dr);return n.facade=t,pr(t,wr,n),n},tr=function(t){return yr(t,wr)?t[wr]:{}},nr=function(t){return yr(t,wr)}}var Or={set:Zn,get:tr,has:nr,enforce:function(t){return nr(t)?tr(t):Zn(t,{})},getterFor:function(t){return function(n){var r;if(!sr(n)||(r=tr(n)).type!==t)throw hr("Incompatible receiver, "+t+" required");return r}}},jr=O,Pr=i,Er=q,Tr=zt,Ar=u,xr=Xn.CONFIGURABLE,Mr=rr,Fr=Or.enforce,Ir=Or.get,Cr=String,Dr=Object.defineProperty,Lr=jr("".slice),_r=jr("".replace),kr=jr([].join),zr=Ar&&!Pr((function(){return 8!==Dr((function(){}),"length",{value:8}).length})),Nr=String(String).split("String"),Rr=Bn.exports=function(t,n,r){"Symbol("===Lr(Cr(n),0,7)&&(n="["+_r(Cr(n),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(n="get "+n),r&&r.setter&&(n="set "+n),(!Tr(t,"name")||xr&&t.name!==n)&&(Ar?Dr(t,"name",{value:n,configurable:!0}):t.name=n),zr&&r&&Tr(r,"arity")&&t.length!==r.arity&&Dr(t,"length",{value:r.arity});try{r&&Tr(r,"constructor")&&r.constructor?Ar&&Dr(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var e=Fr(t);return Tr(e,"source")||(e.source=kr(Nr,"string"==typeof n?n:"")),t};Function.prototype.toString=Rr((function(){return Er(this)&&Ir(this).source||Mr(this)}),"toString");var Gr=Bn.exports,Ur=q,qr=jn,Br=Gr,Hr=Tt,Wr={},Kr=Math.ceil,Qr=Math.floor,Vr=Math.trunc||function(t){var n=+t;return(n>0?Qr:Kr)(n)},Xr=function(t){var n=+t;return n!=n||0===n?0:Vr(n)},Yr=Xr,$r=Math.max,Jr=Math.min,Zr=Xr,te=Math.min,ne=function(t){return t>0?te(Zr(t),9007199254740991):0},re=function(t){return ne(t.length)},ee=N,oe=function(t,n){var r=Yr(t);return r<0?$r(r+n,0):Jr(r,n)},ie=re,ue=function(t){return function(n,r,e){var o,i=ee(n),u=ie(i),c=oe(e,u);if(t&&r!=r){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===r)return t||c||0;return!t&&-1}},ce={includes:ue(!0),indexOf:ue(!1)},fe=zt,ae=N,le=ce.indexOf,se=fr,pe=O([].push),ye=function(t,n){var r,e=ae(t),o=0,i=[];for(r in e)!fe(se,r)&&fe(e,r)&&pe(i,r);for(;n.length>o;)fe(e,r=n[o++])&&(~le(i,r)||pe(i,r));return i},be=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");Wr.f=Object.getOwnPropertyNames||function(t){return ye(t,be)};var ve={};ve.f=Object.getOwnPropertySymbols;var ge=V,de=Wr,he=ve,me=xn,Se=O([].concat),we=ge("Reflect","ownKeys")||function(t){var n=de.f(me(t)),r=he.f;return r?Se(n,r(t)):n},Oe=zt,je=we,Pe=o,Ee=jn,Te=i,Ae=q,xe=/#|\.prototype\./,Me=function(t,n){var r=Ie[Fe(t)];return r==De||r!=Ce&&(Ae(n)?Te(n):!!n)},Fe=Me.normalize=function(t){return String(t).replace(xe,".").toLowerCase()},Ie=Me.data={},Ce=Me.NATIVE="N",De=Me.POLYFILL="P",Le=Me,_e=e,ke=o.f,ze=qn,Ne=function(t,n,r,e){e||(e={});var o=e.enumerable,i=void 0!==e.name?e.name:n;if(Ur(r)&&Br(r,i,e),e.global)o?t[n]=r:Hr(n,r);else{try{e.unsafe?t[n]&&(o=!0):delete t[n]}catch(t){}o?t[n]=r:qr.f(t,n,{value:r,enumerable:!1,configurable:!e.nonConfigurable,writable:!e.nonWritable})}return t},Re=Tt,Ge=function(t,n,r){for(var e=je(n),o=Ee.f,i=Pe.f,u=0;u<e.length;u++){var c=e[u];Oe(t,c)||r&&Oe(r,c)||o(t,c,i(n,c))}},Ue=Le,qe=T,Be=Array.isArray||function(t){return"Array"==qe(t)},He=TypeError,We=fn,Ke=jn,Qe=d,Ve={};Ve[$t("toStringTag")]="z";var Xe="[object z]"===String(Ve),Ye=q,$e=T,Je=$t("toStringTag"),Ze=Object,to="Arguments"==$e(function(){return arguments}()),no=O,ro=i,eo=q,oo=Xe?$e:function(t){var n,r,e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,n){try{return t[n]}catch(t){}}(n=Ze(t),Je))?r:to?$e(n):"Object"==(e=$e(n))&&Ye(n.callee)?"Arguments":e},io=rr,uo=function(){},co=[],fo=V("Reflect","construct"),ao=/^\s*(?:class|function)\b/,lo=no(ao.exec),so=!ao.exec(uo),po=function(t){if(!eo(t))return!1;try{return fo(uo,co,t),!0}catch(t){return!1}},yo=function(t){if(!eo(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||ro((function(){var t;return po(po.call)||!po(Object)||!po((function(){t=!0}))||t}))?yo:po,vo=Be,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=rt,Po=$t("species"),Eo=function(t,n){var r,e,o,i,u,c=t.target,f=t.global,a=t.stat;if(r=f?_e:a?_e[c]||Re(c,{}):(_e[c]||{}).prototype)for(e in n){if(i=n[e],o=t.dontCallGetSet?(u=ke(r,e))&&u.value:r[e],!Ue(f?e:c+(a?".":"#")+e,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Ge(i,o)}(t.sham||o&&o.sham)&&ze(i,"sham",!0),Ne(r,e,i,t)}},To=i,Ao=Be,xo=W,Mo=Lt,Fo=re,Io=function(t){if(t>9007199254740991)throw He("Maximum allowed index exceeded");return t},Co=function(t,n,r){var e=We(n);e in t?Ke.f(t,e,Qe(0,r)):t[e]=r},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}))},_o=rt,ko=$t("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,r,e,o,i,u=Mo(this),c=Do(u,0),f=0;for(n=-1,e=arguments.length;n<e;n++)if(No(i=-1===n?u:arguments[n]))for(o=Fo(i),Io(f+o),r=0;r<o;r++,f++)r in i&&Co(c,f,i[r]);else Io(f+1),Co(c,f++,i);return c.length=f,c}}),t.fn.multipleSelect.locales["ru-RU"]={formatSelectAll:function(){return"[Выбрать все]"},formatAllSelected:function(){return"Выбрано все"},formatCountSelected:function(t,n){return"".concat(t," из ").concat(n," выбрано")},formatNoMatchesFound:function(){return"Совпадений не найдено"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["ru-RU"])}));