UNPKG

multiple-select

Version:

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

11 lines (9 loc) 17.3 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,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jQuery)}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=function(t){return t&&t.Math==Math&&t},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||e||Function("return this")(),o={},c=function(t){try{return!!t()}catch(t){return!0}},u=!c((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),l=!c((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),i=l,a=Function.prototype.call,f=i?a.bind(a):function(){return a.apply(a,arguments)},s={},p={}.propertyIsEnumerable,d=Object.getOwnPropertyDescriptor,m=d&&!p.call({1:2},1);s.f=m?function(t){var e=d(this,t);return!!e&&e.enumerable}:p;var S,y,h=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},v=l,b=Function.prototype,g=b.call,A=v&&b.bind.bind(g,g),j=v?A:function(t){return function(){return g.apply(t,arguments)}},w=j,O=w({}.toString),T=w("".slice),N=function(t){return T(O(t),8,-1)},C=c,x=N,F=Object,M=j("".split),P=C((function(){return!F("z").propertyIsEnumerable(0)}))?function(t){return"String"==x(t)?M(t,""):F(t)}:F,z=function(t){return null==t},E=z,I=TypeError,D=function(t){if(E(t))throw I("Can't call method on "+t);return t},k=P,R=D,L=function(t){return k(R(t))},U="object"==typeof document&&document.all,_={all:U,IS_HTMLDDA:void 0===U&&void 0!==U},V=_.all,q=_.IS_HTMLDDA?function(t){return"function"==typeof t||t===V}:function(t){return"function"==typeof t},B=q,G=_.all,H=_.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:B(t)||t===G}:function(t){return"object"==typeof t?null!==t:B(t)},W=r,K=q,J=function(t,e){return arguments.length<2?(n=W[t],K(n)?n:void 0):W[t]&&W[t][e];var n},Q=j({}.isPrototypeOf),X=r,Y="undefined"!=typeof navigator&&String(navigator.userAgent)||"",$=X.process,Z=X.Deno,tt=$&&$.versions||Z&&Z.version,et=tt&&tt.v8;et&&(y=(S=et.split("."))[0]>0&&S[0]<4?1:+(S[0]+S[1])),!y&&Y&&(!(S=Y.match(/Edge\/(\d+)/))||S[1]>=74)&&(S=Y.match(/Chrome\/(\d+)/))&&(y=+S[1]);var nt=y,rt=nt,ot=c,ct=r.String,ut=!!Object.getOwnPropertySymbols&&!ot((function(){var t=Symbol();return!ct(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&rt&&rt<41})),lt=ut&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,it=J,at=q,ft=Q,st=Object,pt=lt?function(t){return"symbol"==typeof t}:function(t){var e=it("Symbol");return at(e)&&ft(e.prototype,st(t))},dt=String,mt=q,St=function(t){try{return dt(t)}catch(t){return"Object"}},yt=TypeError,ht=function(t){if(mt(t))return t;throw yt(St(t)+" is not a function")},vt=z,bt=f,gt=q,At=H,jt=TypeError,wt={exports:{}},Ot=r,Tt=Object.defineProperty,Nt=function(t,e){try{Tt(Ot,t,{value:e,configurable:!0,writable:!0})}catch(n){Ot[t]=e}return e},Ct=Nt,xt="__core-js_shared__",Ft=r[xt]||Ct(xt,{}),Mt=Ft;(wt.exports=function(t,e){return Mt[t]||(Mt[t]=void 0!==e?e:{})})("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 Pt=wt.exports,zt=D,Et=Object,It=function(t){return Et(zt(t))},Dt=It,kt=j({}.hasOwnProperty),Rt=Object.hasOwn||function(t,e){return kt(Dt(t),e)},Lt=j,Ut=0,_t=Math.random(),Vt=Lt(1..toString),qt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Vt(++Ut+_t,36)},Bt=Pt,Gt=Rt,Ht=qt,Wt=ut,Kt=lt,Jt=r.Symbol,Qt=Bt("wks"),Xt=Kt?Jt.for||Jt:Jt&&Jt.withoutSetter||Ht,Yt=function(t){return Gt(Qt,t)||(Qt[t]=Wt&&Gt(Jt,t)?Jt[t]:Xt("Symbol."+t)),Qt[t]},$t=f,Zt=H,te=pt,ee=function(t,e){var n=t[e];return vt(n)?void 0:ht(n)},ne=function(t,e){var n,r;if("string"===e&&gt(n=t.toString)&&!At(r=bt(n,t)))return r;if(gt(n=t.valueOf)&&!At(r=bt(n,t)))return r;if("string"!==e&&gt(n=t.toString)&&!At(r=bt(n,t)))return r;throw jt("Can't convert object to primitive value")},re=TypeError,oe=Yt("toPrimitive"),ce=function(t,e){if(!Zt(t)||te(t))return t;var n,r=ee(t,oe);if(r){if(void 0===e&&(e="default"),n=$t(r,t,e),!Zt(n)||te(n))return n;throw re("Can't convert object to primitive value")}return void 0===e&&(e="number"),ne(t,e)},ue=pt,le=function(t){var e=ce(t,"string");return ue(e)?e:e+""},ie=H,ae=r.document,fe=ie(ae)&&ie(ae.createElement),se=function(t){return fe?ae.createElement(t):{}},pe=!u&&!c((function(){return 7!=Object.defineProperty(se("div"),"a",{get:function(){return 7}}).a})),de=u,me=f,Se=s,ye=h,he=L,ve=le,be=Rt,ge=pe,Ae=Object.getOwnPropertyDescriptor;o.f=de?Ae:function(t,e){if(t=he(t),e=ve(e),ge)try{return Ae(t,e)}catch(t){}if(be(t,e))return ye(!me(Se.f,t,e),t[e])};var je={},we=u&&c((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Oe=H,Te=String,Ne=TypeError,Ce=function(t){if(Oe(t))return t;throw Ne(Te(t)+" is not an object")},xe=u,Fe=pe,Me=we,Pe=Ce,ze=le,Ee=TypeError,Ie=Object.defineProperty,De=Object.getOwnPropertyDescriptor,ke="enumerable",Re="configurable",Le="writable";je.f=xe?Me?function(t,e,n){if(Pe(t),e=ze(e),Pe(n),"function"==typeof t&&"prototype"===e&&"value"in n&&Le in n&&!n[Le]){var r=De(t,e);r&&r[Le]&&(t[e]=n.value,n={configurable:Re in n?n[Re]:r[Re],enumerable:ke in n?n[ke]:r[ke],writable:!1})}return Ie(t,e,n)}:Ie:function(t,e,n){if(Pe(t),e=ze(e),Pe(n),Fe)try{return Ie(t,e,n)}catch(t){}if("get"in n||"set"in n)throw Ee("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var Ue=je,_e=h,Ve=u?function(t,e,n){return Ue.f(t,e,_e(1,n))}:function(t,e,n){return t[e]=n,t},qe={exports:{}},Be=u,Ge=Rt,He=Function.prototype,We=Be&&Object.getOwnPropertyDescriptor,Ke=Ge(He,"name"),Je={EXISTS:Ke,PROPER:Ke&&"something"===function(){}.name,CONFIGURABLE:Ke&&(!Be||Be&&We(He,"name").configurable)},Qe=q,Xe=Ft,Ye=j(Function.toString);Qe(Xe.inspectSource)||(Xe.inspectSource=function(t){return Ye(t)});var $e,Ze,tn,en=Xe.inspectSource,nn=q,rn=r.WeakMap,on=nn(rn)&&/native code/.test(String(rn)),cn=qt,un=Pt("keys"),ln={},an=on,fn=r,sn=H,pn=Ve,dn=Rt,mn=Ft,Sn=function(t){return un[t]||(un[t]=cn(t))},yn=ln,hn="Object already initialized",vn=fn.TypeError,bn=fn.WeakMap;if(an||mn.state){var gn=mn.state||(mn.state=new bn);gn.get=gn.get,gn.has=gn.has,gn.set=gn.set,$e=function(t,e){if(gn.has(t))throw vn(hn);return e.facade=t,gn.set(t,e),e},Ze=function(t){return gn.get(t)||{}},tn=function(t){return gn.has(t)}}else{var An=Sn("state");yn[An]=!0,$e=function(t,e){if(dn(t,An))throw vn(hn);return e.facade=t,pn(t,An,e),e},Ze=function(t){return dn(t,An)?t[An]:{}},tn=function(t){return dn(t,An)}}var jn={set:$e,get:Ze,has:tn,enforce:function(t){return tn(t)?Ze(t):$e(t,{})},getterFor:function(t){return function(e){var n;if(!sn(e)||(n=Ze(e)).type!==t)throw vn("Incompatible receiver, "+t+" required");return n}}},wn=j,On=c,Tn=q,Nn=Rt,Cn=u,xn=Je.CONFIGURABLE,Fn=en,Mn=jn.enforce,Pn=jn.get,zn=String,En=Object.defineProperty,In=wn("".slice),Dn=wn("".replace),kn=wn([].join),Rn=Cn&&!On((function(){return 8!==En((function(){}),"length",{value:8}).length})),Ln=String(String).split("String"),Un=qe.exports=function(t,e,n){"Symbol("===In(zn(e),0,7)&&(e="["+Dn(zn(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!Nn(t,"name")||xn&&t.name!==e)&&(Cn?En(t,"name",{value:e,configurable:!0}):t.name=e),Rn&&n&&Nn(n,"arity")&&t.length!==n.arity&&En(t,"length",{value:n.arity});try{n&&Nn(n,"constructor")&&n.constructor?Cn&&En(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=Mn(t);return Nn(r,"source")||(r.source=kn(Ln,"string"==typeof e?e:"")),t};Function.prototype.toString=Un((function(){return Tn(this)&&Pn(this).source||Fn(this)}),"toString");var _n=qe.exports,Vn=q,qn=je,Bn=_n,Gn=Nt,Hn={},Wn=Math.ceil,Kn=Math.floor,Jn=Math.trunc||function(t){var e=+t;return(e>0?Kn:Wn)(e)},Qn=function(t){var e=+t;return e!=e||0===e?0:Jn(e)},Xn=Qn,Yn=Math.max,$n=Math.min,Zn=Qn,tr=Math.min,er=function(t){return t>0?tr(Zn(t),9007199254740991):0},nr=function(t){return er(t.length)},rr=L,or=function(t,e){var n=Xn(t);return n<0?Yn(n+e,0):$n(n,e)},cr=nr,ur=function(t){return function(e,n,r){var o,c=rr(e),u=cr(c),l=or(r,u);if(t&&n!=n){for(;u>l;)if((o=c[l++])!=o)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}},lr={includes:ur(!0),indexOf:ur(!1)},ir=Rt,ar=L,fr=lr.indexOf,sr=ln,pr=j([].push),dr=function(t,e){var n,r=ar(t),o=0,c=[];for(n in r)!ir(sr,n)&&ir(r,n)&&pr(c,n);for(;e.length>o;)ir(r,n=e[o++])&&(~fr(c,n)||pr(c,n));return c},mr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");Hn.f=Object.getOwnPropertyNames||function(t){return dr(t,mr)};var Sr={};Sr.f=Object.getOwnPropertySymbols;var yr=J,hr=Hn,vr=Sr,br=Ce,gr=j([].concat),Ar=yr("Reflect","ownKeys")||function(t){var e=hr.f(br(t)),n=vr.f;return n?gr(e,n(t)):e},jr=Rt,wr=Ar,Or=o,Tr=je,Nr=c,Cr=q,xr=/#|\.prototype\./,Fr=function(t,e){var n=Pr[Mr(t)];return n==Er||n!=zr&&(Cr(e)?Nr(e):!!e)},Mr=Fr.normalize=function(t){return String(t).replace(xr,".").toLowerCase()},Pr=Fr.data={},zr=Fr.NATIVE="N",Er=Fr.POLYFILL="P",Ir=Fr,Dr=r,kr=o.f,Rr=Ve,Lr=function(t,e,n,r){r||(r={});var o=r.enumerable,c=void 0!==r.name?r.name:e;if(Vn(n)&&Bn(n,c,r),r.global)o?t[e]=n:Gn(e,n);else{try{r.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=n:qn.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},Ur=Nt,_r=function(t,e,n){for(var r=wr(e),o=Tr.f,c=Or.f,u=0;u<r.length;u++){var l=r[u];jr(t,l)||n&&jr(n,l)||o(t,l,c(e,l))}},Vr=Ir,qr=N,Br=Array.isArray||function(t){return"Array"==qr(t)},Gr=TypeError,Hr=le,Wr=je,Kr=h,Jr={};Jr[Yt("toStringTag")]="z";var Qr="[object z]"===String(Jr),Xr=q,Yr=N,$r=Yt("toStringTag"),Zr=Object,to="Arguments"==Yr(function(){return arguments}()),eo=j,no=c,ro=q,oo=Qr?Yr:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Zr(t),$r))?n:to?Yr(e):"Object"==(r=Yr(e))&&Xr(e.callee)?"Arguments":r},co=en,uo=function(){},lo=[],io=J("Reflect","construct"),ao=/^\s*(?:class|function)\b/,fo=eo(ao.exec),so=!ao.exec(uo),po=function(t){if(!ro(t))return!1;try{return io(uo,lo,t),!0}catch(t){return!1}},mo=function(t){if(!ro(t))return!1;switch(oo(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return so||!!fo(ao,co(t))}catch(t){return!0}};mo.sham=!0;var So=!io||no((function(){var t;return po(po.call)||!po(Object)||!po((function(){t=!0}))||t}))?mo:po,yo=Br,ho=So,vo=H,bo=Yt("species"),go=Array,Ao=function(t){var e;return yo(t)&&(e=t.constructor,(ho(e)&&(e===go||yo(e.prototype))||vo(e)&&null===(e=e[bo]))&&(e=void 0)),void 0===e?go:e},jo=c,wo=nt,Oo=Yt("species"),To=function(t,e){var n,r,o,c,u,l=t.target,i=t.global,a=t.stat;if(n=i?Dr:a?Dr[l]||Ur(l,{}):(Dr[l]||{}).prototype)for(r in e){if(c=e[r],o=t.dontCallGetSet?(u=kr(n,r))&&u.value:n[r],!Vr(i?r:l+(a?".":"#")+r,t.forced)&&void 0!==o){if(typeof c==typeof o)continue;_r(c,o)}(t.sham||o&&o.sham)&&Rr(c,"sham",!0),Lr(n,r,c,t)}},No=c,Co=Br,xo=H,Fo=It,Mo=nr,Po=function(t){if(t>9007199254740991)throw Gr("Maximum allowed index exceeded");return t},zo=function(t,e,n){var r=Hr(e);r in t?Wr.f(t,r,Kr(0,n)):t[r]=n},Eo=function(t,e){return new(Ao(t))(0===e?0:e)},Io=function(t){return wo>=51||!jo((function(){var e=[];return(e.constructor={})[Oo]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Do=nt,ko=Yt("isConcatSpreadable"),Ro=Do>=51||!No((function(){var t=[];return t[ko]=!1,t.concat()[0]!==t})),Lo=function(t){if(!xo(t))return!1;var e=t[ko];return void 0!==e?!!e:Co(t)};To({target:"Array",proto:!0,arity:1,forced:!Ro||!Io("concat")},{concat:function(t){var e,n,r,o,c,u=Fo(this),l=Eo(u,0),i=0;for(e=-1,r=arguments.length;e<r;e++)if(Lo(c=-1===e?u:arguments[e]))for(o=Mo(c),Po(i+o),n=0;n<o;n++,i++)n in c&&zo(l,i,c[n]);else Po(i+1),zo(l,i++,c);return l.length=i,l}}),t.fn.multipleSelect.locales["es-ES"]={formatSelectAll:function(){return"[Seleccionar todo]"},formatAllSelected:function(){return"Todos seleccionados"},formatCountSelected:function(t,e){return"".concat(t," de ").concat(e," seleccionado")},formatNoMatchesFound:function(){return"No se encontraron coincidencias"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["es-ES"]),t.fn.multipleSelect.locales["ru-RU"]={formatSelectAll:function(){return"[Выбрать все]"},formatAllSelected:function(){return"Выбрано все"},formatCountSelected:function(t,e){return"".concat(t," из ").concat(e," выбрано")},formatNoMatchesFound:function(){return"Совпадений не найдено"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["ru-RU"]),t.fn.multipleSelect.locales["zh-CN"]={formatSelectAll:function(){return"[全选]"},formatAllSelected:function(){return"已选择所有记录"},formatCountSelected:function(t,e){return"已从".concat(e,"条记录中选择").concat(t,"条")},formatNoMatchesFound:function(){return"没有找到记录"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["zh-CN"]),t.fn.multipleSelect.locales["zh-TW"]={formatSelectAll:function(){return"[全選]"},formatAllSelected:function(){return"已選擇所有記錄"},formatCountSelected:function(t,e){return"已從".concat(e,"條記錄中選擇").concat(t,"條")},formatNoMatchesFound:function(){return"沒有找到記錄"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["zh-TW"]),t.fn.multipleSelect.locales["cz-CS"]={formatSelectAll:function(){return"[Vybrat vše]"},formatAllSelected:function(){return"Vše vybráno"},formatCountSelected:function(t,e){return"".concat(t," z ").concat(e," vybráno")},formatNoMatchesFound:function(){return"Nebylo nalezeno"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["cz-CS"]),t.fn.multipleSelect.locales["pt-BR"]={formatSelectAll:function(){return"[Selecionar todos]"},formatAllSelected:function(){return"Todos selecionados"},formatCountSelected:function(t,e){return"".concat(t," de ").concat(e," selecionado(s)")},formatNoMatchesFound:function(){return"Nenhum resultado encontrado"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["pt-BR"]),t.fn.multipleSelect.locales["vi-VN"]={formatSelectAll:function(){return"[Tất cả]"},formatAllSelected:function(){return"Chọn tất cả"},formatCountSelected:function(t,e){return"Đã chọn ".concat(t," trong ").concat(e)},formatNoMatchesFound:function(){return"Không tìm thấy kết quả."}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["vi-VN"]),t.fn.multipleSelect.locales["en-US"]={formatSelectAll:function(){return"[Select all]"},formatAllSelected:function(){return"All selected"},formatCountSelected:function(t,e){return"".concat(t," of ").concat(e," selected")},formatNoMatchesFound:function(){return"No matches found"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["en-US"]),t.fn.multipleSelect.locales["fr-FR"]={formatSelectAll:function(){return"[Tout sélectionner]"},formatAllSelected:function(){return"Tous sélectionnés"},formatCountSelected:function(t,e){return"".concat(t," de ").concat(e," sélectionnés")},formatNoMatchesFound:function(){return"Aucun résultat"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["fr-FR"]),t.fn.multipleSelect.locales["hu-HU"]={formatSelectAll:function(){return"[Összes kiválasztása]"},formatAllSelected:function(){return"Összes kiválasztva"},formatCountSelected:function(t,e){return"".concat(t," / ").concat(e," kiválasztva")},formatNoMatchesFound:function(){return"Nincs találat"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["hu-HU"]),t.fn.multipleSelect.locales["ja-JP"]={formatSelectAll:function(){return"[すべて選択]"},formatAllSelected:function(){return"すべて選択"},formatCountSelected:function(t,e){return"".concat(e," 件中 ").concat(t," 件選択")},formatNoMatchesFound:function(){return"見つかりません"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["ja-JP"]),t.fn.multipleSelect.locales["da-DK"]={formatSelectAll:function(){return"[Vælg/fravælg alle]"},formatAllSelected:function(){return"Alle valgt"},formatCountSelected:function(t,e){return"".concat(t," af ").concat(e," valgt")},formatNoMatchesFound:function(){return"Søgning uden resultat"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["da-DK"]),t.fn.multipleSelect.locales["it-IT"]={formatSelectAll:function(){return"[Seleziona tutti]"},formatAllSelected:function(){return"Tutti selezionati"},formatCountSelected:function(t,e){return"".concat(t," di ").concat(e," selezionati")},formatNoMatchesFound:function(){return"Nessun risultato"}},t.extend(t.fn.multipleSelect.defaults,t.fn.multipleSelect.locales["it-IT"])}));