slim-select 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{helper.d.ts → helpers.d.ts} +0 -0
- package/dist/index.d.ts +0 -6
- package/dist/settings.d.ts +1 -1
- package/dist/slimselect.cjs.js +1551 -2
- package/dist/slimselect.css +1 -1
- package/dist/slimselect.css.map +1 -1
- package/dist/slimselect.es.js +1549 -2
- package/dist/slimselect.global.js +1554 -2
- package/dist/slimselect.js +1557 -2
- package/dist/slimselect.min.js +1 -0
- package/dist/slimselect.umd.js +1557 -2
- package/dist/slimselect.umd.min.js +1 -0
- package/dist/store.d.ts +5 -5
- package/docs/404.html +18 -12
- package/docs/assets/home.js +1 -1
- package/docs/assets/index.css +1 -1
- package/docs/assets/index.js +5 -5
- package/docs/assets/index5.js +11 -0
- package/docs/assets/install.js +6 -6
- package/docs/index.html +20 -2
- package/index.html +20 -2
- package/package.json +8 -5
- package/public/404.html +18 -12
- package/src/docs/app.vue +8 -2
- package/src/docs/assets/scss/_variables.scss +1 -1
- package/src/docs/pages/frameworks/index.vue +18 -0
- package/src/docs/pages/frameworks/vue.vue +39 -0
- package/src/docs/pages/home.vue +1 -1
- package/src/docs/pages/install.vue +27 -6
- package/src/docs/router.ts +5 -0
- package/src/slim-select/{helper.ts → helpers.ts} +0 -0
- package/src/slim-select/index.ts +1 -11
- package/src/slim-select/render.ts +1 -1
- package/src/slim-select/rollup.config.mjs +112 -30
- package/src/slim-select/select.ts +1 -1
- package/src/slim-select/settings.ts +1 -1
- package/src/slim-select/slimselect.scss +7 -0
- package/src/slim-select/store.ts +1 -1
- package/src/vue/slimselect.vue +30 -48
- package/dist/slimselect.cjs.js.map +0 -1
- package/dist/slimselect.es.js.map +0 -1
- package/dist/slimselect.global.js.map +0 -1
- package/dist/slimselect.js.map +0 -1
- package/dist/slimselect.umd.js.map +0 -1
- package/docs/images/check-mark.svg +0 -6
- package/docs/images/chrome.svg +0 -22
- package/docs/images/firefox.svg +0 -58
- package/docs/images/github.png +0 -0
- package/docs/images/ie.svg +0 -11
- package/docs/images/npm.png +0 -0
- package/docs/images/opera.svg +0 -15
- package/docs/images/safari.svg +0 -22
- package/public/images/check-mark.svg +0 -6
- package/public/images/chrome.svg +0 -22
- package/public/images/firefox.svg +0 -58
- package/public/images/github.png +0 -0
- package/public/images/ie.svg +0 -11
- package/public/images/npm.png +0 -0
- package/public/images/opera.svg +0 -15
- package/public/images/safari.svg +0 -22
- package/public/index.html +0 -28
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{d as n,S as f,_ as o,o as c,c as i,l as h,g as m,a as e,h as u,w as $,f as p}from"./index.js";const S=n({name:"SlimSelect",props:{settings:{type:Object}},data(){return{slim:null}},mounted(){let t={select:this.$refs.slim};this.settings&&(t.settings=this.settings),this.slim=new f(t)},beforeUnmount(){this.slim&&this.slim.destroy()}}),v={ref:"slim"};function g(t,r,a,l,_,d){return c(),i("select",v,[h(t.$slots,"default")],512)}const V=o(S,[["render",g]]),x=n({name:"Vue",components:{SlimSelect:V}}),w={id:"error",class:"content"},O=e("h2",{class:"header"},"Vue",-1),k={class:"row"},B=e("option",{value:"1"},"Option 1",-1),C=e("option",{value:"2"},"Option 2",-1),E=e("option",{value:"3"},"Option 3",-1),N=e("pre",null,[p(" "),e("code",{class:"language-javascript"},`
|
|
2
|
+
var select = new SlimSelect({
|
|
3
|
+
select: '#selectElement',
|
|
4
|
+
events: {
|
|
5
|
+
error: function(err) {
|
|
6
|
+
console.error(err)
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
`),p(`
|
|
11
|
+
`)],-1);function b(t,r,a,l,_,d){const s=m("SlimSelect");return c(),i("div",w,[O,e("div",k,[u(s,null,{default:$(()=>[B,C,E]),_:1})]),N])}const j=o(x,[["render",b]]),y=n({name:"Events",components:{Vue:j}}),T={id:"frameworks",class:"contents"};function U(t,r,a,l,_,d){const s=m("Vue");return c(),i("div",T,[u(s)])}const z=o(y,[["render",U]]);export{z as default};
|
package/docs/assets/install.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{e as
|
|
1
|
+
import{e as M,d as $,_ as I,o as O,c as V,a as o,f as B,t as E,b as L}from"./index.js";var R={exports:{}};(function(d,w){(function(y,v){d.exports=v()})(M,function(){return function y(v,j,k){var n=window,m="application/octet-stream",r=k||m,e=v,c=!j&&!k&&e,t=document.createElement("a"),_=function(s){return String(s)},i=n.Blob||n.MozBlob||n.WebKitBlob||_,p=j||"download",l,S;if(i=i.call?i.bind(n):Blob,String(this)==="true"&&(e=[e,r],r=e[0],e=e[1]),c&&c.length<2048&&(p=c.split("/").pop().split("?")[0],t.href=c,t.href.indexOf(c)!==-1)){var u=new XMLHttpRequest;return u.open("GET",c,!0),u.responseType="blob",u.onload=function(s){y(s.target.response,p,m)},setTimeout(function(){u.send()},0),u}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(e))if(e.length>1024*1024*1.999&&i!==_)e=x(e),r=e.type||m;else return navigator.msSaveBlob?navigator.msSaveBlob(x(e),p):f(e);else if(/([\x80-\xff])/.test(e)){var b=0,C=new Uint8Array(e.length),N=C.length;for(b;b<N;++b)C[b]=e.charCodeAt(b);e=new i([C],{type:r})}l=e instanceof i?e:new i([e],{type:r});function x(s){var a=s.split(/[:;,]/),h=a[1],A=a[2]=="base64"?atob:decodeURIComponent,D=A(a.pop()),U=D.length,g=0,T=new Uint8Array(U);for(g;g<U;++g)T[g]=D.charCodeAt(g);return new i([T],{type:h})}function f(s,a){if("download"in t)return t.href=s,t.setAttribute("download",p),t.className="download-js-link",t.innerHTML="downloading...",t.style.display="none",document.body.appendChild(t),setTimeout(function(){t.click(),document.body.removeChild(t),a===!0&&setTimeout(function(){n.URL.revokeObjectURL(t.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(s)&&(s="data:"+s.replace(/^data:([\w\/\-\+]+)/,m)),window.open(s)||confirm(`Displaying New Document
|
|
2
2
|
|
|
3
|
-
Use Save As... to download, then click back to return to this page.`)&&(location.href=
|
|
3
|
+
Use Save As... to download, then click back to return to this page.`)&&(location.href=s),!0;var h=document.createElement("iframe");document.body.appendChild(h),!a&&/^data:/.test(s)&&(s="data:"+s.replace(/^data:([\w\/\-\+]+)/,m)),h.src=s,setTimeout(function(){document.body.removeChild(h)},333)}if(navigator.msSaveBlob)return navigator.msSaveBlob(l,p);if(n.URL)f(n.URL.createObjectURL(l),!0);else{if(typeof l=="string"||l.constructor===_)try{return f("data:"+r+";base64,"+n.btoa(l))}catch{return f("data:"+r+","+encodeURIComponent(l))}S=new FileReader,S.onload=function(s){f(this.result)},S.readAsDataURL(l)}return!0}})})(R);const H=R.exports,G="slim-select",J="Slim advanced select dropdown",q="2.0.1",z="Brian Voelker <brian@webiswhatido.com> (http://webiswhatido.com)",F="https://slimselectjs.com",K="MIT",W={url:"https://github.com/brianvoe/slim-select/issues"},X="dist/slimselect.cjs.js",P="dist/slimselect.umd.js",Q="dist/slimselect.es.js",Y="dist/slimselect.umd.min.js",Z="dist/index.d.ts",ee="dist/index.d.ts",se="dist/slimselect.css",te="src/slim-select/slimselect.scss",ne={type:"git",url:"git+https://github.com/brianvoe/slim-select.git"},oe=["select","vanilla","dropdown","search","multiselect"],ie={dev:"vite --port=1111",format:'prettier --write --cache --parser typescript "src/**/*.ts"',build:"npm run build:clean && npm run build:docs && npm run build:library","build:clean":"rimraf ./dist/*","build:docs":"vite build","build:library":"npm run build:library:js && npm run build:library:css","build:library:js":"cd src/slim-select && rollup --config ./rollup.config.mjs && cd ../../","build:library:css":"cd src/slim-select && sass ./slimselect.scss ../../dist/slimselect.css --style=compressed && cd ../../",test:"jest"},le={"@jest/globals":"^29.3.1","@rollup/plugin-babel":"^6.0.2","@rollup/plugin-commonjs":"^23.0.2","@rollup/plugin-node-resolve":"^15.0.1","@rollup/plugin-terser":"^0.1.0","@rollup/plugin-typescript":"^9.0.2","@types/downloadjs":"^1.4.3","@vitejs/plugin-vue":"^3.2.0",clipboard:"^2.0.11",downloadjs:"^1.4.7",jest:"^29.3.1","jest-environment-jsdom":"^29.3.1",prettier:"^2.7.1",prismjs:"^1.29.0",rimraf:"^3.0.2",rollup:"^2.79.1",sass:"^1.56.1","ts-jest":"^29.0.3",tslib:"^2.4.1",typescript:"^4.9.3",vite:"^3.2.4",vue:"^3.2.45","vue-router":"^4.1.6","vue-tsc":"^1.0.9",vuex:"^4.0.2"},re={name:G,description:J,version:q,author:z,homepage:F,license:K,bugs:W,main:X,browser:P,module:Q,unpkg:Y,types:Z,typings:ee,style:se,sass:te,repository:ne,keywords:oe,scripts:ie,devDependencies:le},ce=$({name:"Install",data:()=>({version:re.version}),methods:{downloadLink(){H(`https://cdnjs.cloudflare.com/ajax/libs/slim-select/${this.version}/slimselect.min.js`)}}}),ae={id:"install",class:"contents"},de=L(`<div id="npm" class="content"><h2>Npm</h2><p>Most common usage is npm</p><pre class="install-code"> <code class="language-bash">
|
|
4
4
|
npm install slim-select
|
|
5
5
|
</code>
|
|
6
6
|
</pre><pre class="example-code"> <code class="language-javascript">
|
|
@@ -10,11 +10,11 @@ Use Save As... to download, then click back to return to this page.`)&&(location
|
|
|
10
10
|
select: '#selectElement'
|
|
11
11
|
})
|
|
12
12
|
</code>
|
|
13
|
-
</pre></div>`,1),
|
|
13
|
+
</pre></div>`,1),me={id:"cdn",class:"content"},pe=L('<h2>Cdn</h2><p> Cdn has a url link you can grab. Cdn exists on both <a target="_blank" href="https://cdnjs.com">cdnjs.com</a> and <a target="_blank" href="https://unpkg.com">unpkg.com</a></p><p> See full list of available options.<br><strong>cdnjs</strong> - <a target="_blank" href="https://cdnjs.com/libraries/slim-select">cdnjs.com/libraries/slim-select</a><br><strong>unpkg</strong> - <a target="_blank" href="https://unpkg.com/browse/slim-select/dist/">https://unpkg.com/browse/slim-select/dist/</a></p><ul><li>slimselct.js - UMD unminified</li><li>slimselct.min.js - UMD minified</li><li>slimselect.cjs.js - CommonJS (for Node) and ES module (for bundlers) build</li><li>slimselect.umd.js - UMD build for browsers</li><li>slimselect.es.js - ES module build for modern browsers</li><li>slimselect.global.js - IIFE build for modern browsers</li></ul><div class="alert info">New releases may be delayed until the next time its indexed</div>',5),ue={class:"install-code"},be={class:"language-html"},fe={id:"download",class:"content"},he=o("h2",null,"Download",-1),ge=o("p",null,"Download the latest minified umd version of slim select",-1),ve=o("p",null,[B(" See full list of available downloadable options. "),o("a",{target:"_blank",href:"https://cdnjs.com/libraries/slim-select"},"cdnjs.com/libraries/slim-select")],-1);function we(d,w,y,v,j,k){return O(),V("div",ae,[de,o("div",me,[pe,o("pre",ue,[B(" "),o("code",be,`
|
|
14
14
|
<html>
|
|
15
15
|
<head>
|
|
16
|
-
<script src="
|
|
17
|
-
<link href="
|
|
16
|
+
<script src="unpkg.com/slim-select@`+E(d.version)+`/dist/slimselect.min.js"><\/script>
|
|
17
|
+
<link href="unpkg.com/slim-select@`+E(d.version)+`/dist/slimselect.css" rel="stylesheet"></link>
|
|
18
18
|
|
|
19
19
|
<script>
|
|
20
20
|
new SlimSelect({
|
|
@@ -31,4 +31,4 @@ Use Save As... to download, then click back to return to this page.`)&&(location
|
|
|
31
31
|
</body>
|
|
32
32
|
</html>
|
|
33
33
|
`,1),B(`
|
|
34
|
-
`)])]),
|
|
34
|
+
`)])]),o("div",fe,[he,ge,ve,o("div",{class:"btn",onClick:w[0]||(w[0]=n=>d.downloadLink())},"Click Here To Download")])])}const je=I(ce,[["render",we]]);export{je as default};
|
package/docs/index.html
CHANGED
|
@@ -5,14 +5,32 @@
|
|
|
5
5
|
<link rel="icon" href="/favicon.ico" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Slim Select</title>
|
|
8
|
+
<meta name="description" content="Advanced select dropdown" />
|
|
9
|
+
<meta property="og:type" content="article" />
|
|
10
|
+
<meta property="og:title" content="Slim Select" />
|
|
11
|
+
<meta property="og:description" content="Advanced select dropdown" />
|
|
8
12
|
<script type="module" crossorigin src="/assets/index.js"></script>
|
|
9
13
|
<link rel="stylesheet" href="/assets/index.css">
|
|
10
14
|
</head>
|
|
11
15
|
<body>
|
|
12
16
|
<noscript>
|
|
13
|
-
<strong
|
|
17
|
+
<strong
|
|
18
|
+
>We're sorry but this site doesn't work properly without JavaScript enabled. Please enable it to
|
|
19
|
+
continue.</strong
|
|
20
|
+
>
|
|
14
21
|
</noscript>
|
|
15
22
|
<div id="app"></div>
|
|
16
23
|
|
|
24
|
+
<!-- Google tag (gtag.js) -->
|
|
25
|
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-14PMXQVXTC"></script>
|
|
26
|
+
<script>
|
|
27
|
+
window.dataLayer = window.dataLayer || []
|
|
28
|
+
function gtag() {
|
|
29
|
+
dataLayer.push(arguments)
|
|
30
|
+
}
|
|
31
|
+
gtag('js', new Date())
|
|
32
|
+
|
|
33
|
+
gtag('config', 'G-14PMXQVXTC')
|
|
34
|
+
</script>
|
|
17
35
|
</body>
|
|
18
|
-
</html>
|
|
36
|
+
</html>
|
package/index.html
CHANGED
|
@@ -5,12 +5,30 @@
|
|
|
5
5
|
<link rel="icon" href="/favicon.ico" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Slim Select</title>
|
|
8
|
+
<meta name="description" content="Advanced select dropdown" />
|
|
9
|
+
<meta property="og:type" content="article" />
|
|
10
|
+
<meta property="og:title" content="Slim Select" />
|
|
11
|
+
<meta property="og:description" content="Advanced select dropdown" />
|
|
8
12
|
</head>
|
|
9
13
|
<body>
|
|
10
14
|
<noscript>
|
|
11
|
-
<strong
|
|
15
|
+
<strong
|
|
16
|
+
>We're sorry but this site doesn't work properly without JavaScript enabled. Please enable it to
|
|
17
|
+
continue.</strong
|
|
18
|
+
>
|
|
12
19
|
</noscript>
|
|
13
20
|
<div id="app"></div>
|
|
14
21
|
<script type="module" src="/src/docs/main.ts"></script>
|
|
22
|
+
<!-- Google tag (gtag.js) -->
|
|
23
|
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-14PMXQVXTC"></script>
|
|
24
|
+
<script>
|
|
25
|
+
window.dataLayer = window.dataLayer || []
|
|
26
|
+
function gtag() {
|
|
27
|
+
dataLayer.push(arguments)
|
|
28
|
+
}
|
|
29
|
+
gtag('js', new Date())
|
|
30
|
+
|
|
31
|
+
gtag('config', 'G-14PMXQVXTC')
|
|
32
|
+
</script>
|
|
15
33
|
</body>
|
|
16
|
-
</html>
|
|
34
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slim-select",
|
|
3
3
|
"description": "Slim advanced select dropdown",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"author": "Brian Voelker <brian@webiswhatido.com> (http://webiswhatido.com)",
|
|
6
6
|
"homepage": "https://slimselectjs.com",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"bugs": {
|
|
9
9
|
"url": "https://github.com/brianvoe/slim-select/issues"
|
|
10
10
|
},
|
|
11
|
-
"main": "dist/slimselect.js",
|
|
11
|
+
"main": "dist/slimselect.cjs.js",
|
|
12
|
+
"browser": "dist/slimselect.umd.js",
|
|
12
13
|
"module": "dist/slimselect.es.js",
|
|
13
|
-
"unpkg": "dist/slimselect.js",
|
|
14
|
+
"unpkg": "dist/slimselect.umd.min.js",
|
|
14
15
|
"types": "dist/index.d.ts",
|
|
15
16
|
"typings": "dist/index.d.ts",
|
|
16
17
|
"style": "dist/slimselect.css",
|
|
@@ -27,7 +28,6 @@
|
|
|
27
28
|
"multiselect"
|
|
28
29
|
],
|
|
29
30
|
"scripts": {
|
|
30
|
-
"jestinit": "ts-jest config:init",
|
|
31
31
|
"dev": "vite --port=1111",
|
|
32
32
|
"format": "prettier --write --cache --parser typescript \"src/**/*.ts\"",
|
|
33
33
|
"build": "npm run build:clean && npm run build:docs && npm run build:library",
|
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@jest/globals": "^29.3.1",
|
|
43
|
+
"@rollup/plugin-babel": "^6.0.2",
|
|
44
|
+
"@rollup/plugin-commonjs": "^23.0.2",
|
|
45
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
46
|
+
"@rollup/plugin-terser": "^0.1.0",
|
|
43
47
|
"@rollup/plugin-typescript": "^9.0.2",
|
|
44
48
|
"@types/downloadjs": "^1.4.3",
|
|
45
49
|
"@vitejs/plugin-vue": "^3.2.0",
|
|
@@ -51,7 +55,6 @@
|
|
|
51
55
|
"prismjs": "^1.29.0",
|
|
52
56
|
"rimraf": "^3.0.2",
|
|
53
57
|
"rollup": "^2.79.1",
|
|
54
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
55
58
|
"sass": "^1.56.1",
|
|
56
59
|
"ts-jest": "^29.0.3",
|
|
57
60
|
"tslib": "^2.4.1",
|
package/public/404.html
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
|
-
<meta charset="utf-8"
|
|
5
|
-
<title>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Slim Select</title>
|
|
6
6
|
<script type="text/javascript">
|
|
7
7
|
// Single Page Apps for GitHub Pages
|
|
8
8
|
// https://github.com/rafrex/spa-github-pages
|
|
@@ -20,17 +20,23 @@
|
|
|
20
20
|
// https://username.github.io/repo-name/one/two?a=b&c=d#qwe becomes
|
|
21
21
|
// https://username.github.io/repo-name/?p=/one/two&q=a=b~and~c=d#qwe
|
|
22
22
|
// Otherwise, leave pathPrefix as false.
|
|
23
|
-
var pathPrefix = false
|
|
24
|
-
var l = window.location
|
|
23
|
+
var pathPrefix = false
|
|
24
|
+
var l = window.location
|
|
25
25
|
l.replace(
|
|
26
|
-
l.protocol +
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
l.protocol +
|
|
27
|
+
'//' +
|
|
28
|
+
l.hostname +
|
|
29
|
+
(l.port ? ':' + l.port : '') +
|
|
30
|
+
l.pathname
|
|
31
|
+
.split('/')
|
|
32
|
+
.slice(0, 2 * pathPrefix)
|
|
33
|
+
.join('/') +
|
|
34
|
+
'/?p=/' +
|
|
35
|
+
l.pathname.slice(1).split('/').slice(pathPrefix).join('/').replace(/&/g, '~and~') +
|
|
36
|
+
(l.search ? '&q=' + l.search.slice(1).replace(/&/g, '~and~') : '') +
|
|
37
|
+
l.hash,
|
|
38
|
+
)
|
|
32
39
|
</script>
|
|
33
40
|
</head>
|
|
34
|
-
<body>
|
|
35
|
-
</body>
|
|
41
|
+
<body></body>
|
|
36
42
|
</html>
|
package/src/docs/app.vue
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { defineComponent } from 'vue'
|
|
3
3
|
|
|
4
|
-
import SlimSelect
|
|
4
|
+
import SlimSelect from '../slim-select'
|
|
5
|
+
import Settings from '../slim-select/settings'
|
|
6
|
+
import { debounce } from '../slim-select/helpers'
|
|
5
7
|
|
|
6
8
|
export default defineComponent({
|
|
7
9
|
name: 'App',
|
|
@@ -75,6 +77,10 @@ export default defineComponent({
|
|
|
75
77
|
{ text: 'enableDisable', value: 'methods#enableDisable', class: 'mar-l-l' },
|
|
76
78
|
{ text: 'search', value: 'methods#search', class: 'mar-l-l' },
|
|
77
79
|
{ text: 'destroy', value: 'methods#destroy', class: 'mar-l-l' },
|
|
80
|
+
|
|
81
|
+
// Frameworks
|
|
82
|
+
// { text: 'Frameworks', value: 'frameworks', class: 'label' },
|
|
83
|
+
// { text: 'vue', value: 'frameworks#vue', class: 'mar-l-l' },
|
|
78
84
|
],
|
|
79
85
|
}
|
|
80
86
|
},
|
|
@@ -186,7 +192,7 @@ export default defineComponent({
|
|
|
186
192
|
<header>
|
|
187
193
|
<div class="top">
|
|
188
194
|
<div class="text">
|
|
189
|
-
<h1 class="logo">Slim Select</h1>
|
|
195
|
+
<h1 class="logo">Slim Select <small>2.0</small></h1>
|
|
190
196
|
</div>
|
|
191
197
|
<div class="socials">
|
|
192
198
|
<a href="https://github.com/brianvoe/slim-select" target="_blank">
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { defineComponent } from 'vue'
|
|
3
|
+
|
|
4
|
+
import Vue from './vue.vue'
|
|
5
|
+
|
|
6
|
+
export default defineComponent({
|
|
7
|
+
name: 'Events',
|
|
8
|
+
components: {
|
|
9
|
+
Vue,
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div id="frameworks" class="contents">
|
|
16
|
+
<Vue />
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { defineComponent } from 'vue'
|
|
3
|
+
|
|
4
|
+
import SlimSelect from '../../../vue/slimselect.vue'
|
|
5
|
+
|
|
6
|
+
export default defineComponent({
|
|
7
|
+
name: 'Vue',
|
|
8
|
+
components: {
|
|
9
|
+
SlimSelect,
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div id="error" class="content">
|
|
16
|
+
<h2 class="header">Vue</h2>
|
|
17
|
+
|
|
18
|
+
<div class="row">
|
|
19
|
+
<SlimSelect>
|
|
20
|
+
<option value="1">Option 1</option>
|
|
21
|
+
<option value="2">Option 2</option>
|
|
22
|
+
<option value="3">Option 3</option>
|
|
23
|
+
</SlimSelect>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<pre>
|
|
27
|
+
<code class="language-javascript">
|
|
28
|
+
var select = new SlimSelect({
|
|
29
|
+
select: '#selectElement',
|
|
30
|
+
events: {
|
|
31
|
+
error: function(err) {
|
|
32
|
+
console.error(err)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
</code>
|
|
37
|
+
</pre>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
package/src/docs/pages/home.vue
CHANGED
|
@@ -142,7 +142,7 @@ export default defineComponent({
|
|
|
142
142
|
<div id="home" class="content">
|
|
143
143
|
<div class="samples row">
|
|
144
144
|
<div class="single">
|
|
145
|
-
<h2>Single Select
|
|
145
|
+
<h2>Single Select</h2>
|
|
146
146
|
<select ref="slimSingle">
|
|
147
147
|
<option data-placeholder="true"></option>
|
|
148
148
|
<option value="best">Best</option>
|
|
@@ -43,19 +43,36 @@ export default defineComponent({
|
|
|
43
43
|
|
|
44
44
|
<div id="cdn" class="content">
|
|
45
45
|
<h2>Cdn</h2>
|
|
46
|
-
<p>Cdn has a url link you can grab.</p>
|
|
47
46
|
<p>
|
|
48
|
-
|
|
49
|
-
<a target="_blank" href="https://cdnjs.com
|
|
47
|
+
Cdn has a url link you can grab. Cdn exists on both
|
|
48
|
+
<a target="_blank" href="https://cdnjs.com">cdnjs.com</a> and
|
|
49
|
+
<a target="_blank" href="https://unpkg.com">unpkg.com</a>
|
|
50
|
+
</p>
|
|
51
|
+
<p>
|
|
52
|
+
See full list of available options.<br />
|
|
53
|
+
<strong>cdnjs</strong> -
|
|
54
|
+
<a target="_blank" href="https://cdnjs.com/libraries/slim-select">cdnjs.com/libraries/slim-select</a><br />
|
|
55
|
+
<strong>unpkg</strong> -
|
|
56
|
+
<a target="_blank" href="https://unpkg.com/browse/slim-select/dist/"
|
|
57
|
+
>https://unpkg.com/browse/slim-select/dist/</a
|
|
58
|
+
>
|
|
50
59
|
</p>
|
|
60
|
+
<ul>
|
|
61
|
+
<li>slimselct.js - UMD unminified</li>
|
|
62
|
+
<li>slimselct.min.js - UMD minified</li>
|
|
63
|
+
<li>slimselect.cjs.js - CommonJS (for Node) and ES module (for bundlers) build</li>
|
|
64
|
+
<li>slimselect.umd.js - UMD build for browsers</li>
|
|
65
|
+
<li>slimselect.es.js - ES module build for modern browsers</li>
|
|
66
|
+
<li>slimselect.global.js - IIFE build for modern browsers</li>
|
|
67
|
+
</ul>
|
|
51
68
|
<div class="alert info">New releases may be delayed until the next time its indexed</div>
|
|
52
69
|
|
|
53
70
|
<pre class="install-code">
|
|
54
71
|
<code class="language-html">
|
|
55
72
|
<html>
|
|
56
73
|
<head>
|
|
57
|
-
<script src="
|
|
58
|
-
<link href="
|
|
74
|
+
<script src="unpkg.com/slim-select@{{version}}/dist/slimselect.min.js"></script>
|
|
75
|
+
<link href="unpkg.com/slim-select@{{version}}/dist/slimselect.css" rel="stylesheet"></link>
|
|
59
76
|
|
|
60
77
|
<script>
|
|
61
78
|
new SlimSelect({
|
|
@@ -77,7 +94,11 @@ export default defineComponent({
|
|
|
77
94
|
|
|
78
95
|
<div id="download" class="content">
|
|
79
96
|
<h2>Download</h2>
|
|
80
|
-
<p>Download the latest minified version of slim select</p>
|
|
97
|
+
<p>Download the latest minified umd version of slim select</p>
|
|
98
|
+
<p>
|
|
99
|
+
See full list of available downloadable options.
|
|
100
|
+
<a target="_blank" href="https://cdnjs.com/libraries/slim-select">cdnjs.com/libraries/slim-select</a>
|
|
101
|
+
</p>
|
|
81
102
|
<div class="btn" @click="downloadLink()">Click Here To Download</div>
|
|
82
103
|
</div>
|
|
83
104
|
</div>
|
package/src/docs/router.ts
CHANGED
|
File without changes
|
package/src/slim-select/index.ts
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import { debounce, hasClassInTree } from './
|
|
1
|
+
import { debounce, hasClassInTree } from './helpers'
|
|
2
2
|
import Render from './render'
|
|
3
3
|
import Select from './select'
|
|
4
4
|
import Settings, { SettingsPartial } from './settings'
|
|
5
5
|
import Store, { DataArray, DataArrayPartial, Option, OptionOptional } from './store'
|
|
6
6
|
|
|
7
|
-
// Export everything except the "export default"
|
|
8
|
-
export * from './helper'
|
|
9
|
-
export * from './settings'
|
|
10
|
-
export * from './select'
|
|
11
|
-
export * from './store'
|
|
12
|
-
export * from './render'
|
|
13
|
-
|
|
14
|
-
// Export all "export defaults"
|
|
15
|
-
export { Settings, Select, Store, Render }
|
|
16
|
-
|
|
17
7
|
export interface Config {
|
|
18
8
|
select: string | Element
|
|
19
9
|
data?: DataArrayPartial
|
|
@@ -1,40 +1,122 @@
|
|
|
1
1
|
import typescript from '@rollup/plugin-typescript'
|
|
2
|
-
import
|
|
2
|
+
import babel from '@rollup/plugin-babel'
|
|
3
|
+
import commonjs from '@rollup/plugin-commonjs'
|
|
4
|
+
import resolve from '@rollup/plugin-node-resolve'
|
|
5
|
+
import terser from '@rollup/plugin-terser'
|
|
3
6
|
|
|
4
|
-
export default
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
sourcemap: true,
|
|
7
|
+
export default [
|
|
8
|
+
// CommonJS (for Node) and ES module (for bundlers) build
|
|
9
|
+
{
|
|
10
|
+
input: './index.ts',
|
|
11
|
+
output: {
|
|
12
|
+
file: '../../dist/slimselect.cjs.js',
|
|
13
|
+
format: 'cjs',
|
|
14
|
+
exports: 'default',
|
|
13
15
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
plugins: [
|
|
17
|
+
typescript(),
|
|
18
|
+
resolve(),
|
|
19
|
+
commonjs(),
|
|
20
|
+
babel({
|
|
21
|
+
exclude: 'node_modules/**',
|
|
22
|
+
babelrc: false,
|
|
23
|
+
presets: [
|
|
24
|
+
[
|
|
25
|
+
'@babel/env',
|
|
26
|
+
{
|
|
27
|
+
modules: false,
|
|
28
|
+
useBuiltIns: 'usage',
|
|
29
|
+
targets: 'maintained node versions',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
],
|
|
33
|
+
}),
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
// UMD build for browsers
|
|
38
|
+
{
|
|
39
|
+
input: './index.ts',
|
|
40
|
+
output: [
|
|
41
|
+
{
|
|
42
|
+
name: 'SlimSelect',
|
|
43
|
+
file: '../../dist/slimselect.js',
|
|
44
|
+
format: 'umd',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'SlimSelect',
|
|
48
|
+
file: '../../dist/slimselect.umd.js',
|
|
49
|
+
format: 'umd',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
plugins: [
|
|
53
|
+
typescript(),
|
|
54
|
+
resolve(),
|
|
55
|
+
commonjs(),
|
|
56
|
+
babel({
|
|
57
|
+
exclude: 'node_modules/**',
|
|
58
|
+
}),
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
// UMD build for browsers minified with terser
|
|
63
|
+
{
|
|
64
|
+
input: './index.ts',
|
|
65
|
+
output: [
|
|
66
|
+
{
|
|
67
|
+
name: 'SlimSelect',
|
|
68
|
+
file: '../../dist/slimselect.min.js',
|
|
69
|
+
format: 'umd',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'SlimSelect',
|
|
73
|
+
file: '../../dist/slimselect.umd.min.js',
|
|
74
|
+
format: 'umd',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
plugins: [
|
|
78
|
+
typescript(),
|
|
79
|
+
resolve(),
|
|
80
|
+
commonjs(),
|
|
81
|
+
babel({
|
|
82
|
+
exclude: 'node_modules/**',
|
|
83
|
+
}),
|
|
84
|
+
terser(),
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
// ES module build for modern browsers
|
|
89
|
+
{
|
|
90
|
+
input: './index.ts',
|
|
91
|
+
output: {
|
|
16
92
|
file: '../../dist/slimselect.es.js',
|
|
17
93
|
format: 'es',
|
|
18
|
-
sourcemap: true,
|
|
19
94
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
95
|
+
plugins: [
|
|
96
|
+
typescript(),
|
|
97
|
+
resolve(),
|
|
98
|
+
commonjs(),
|
|
99
|
+
babel({
|
|
100
|
+
exclude: 'node_modules/**',
|
|
101
|
+
}),
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
// IIFE build for modern browsers
|
|
106
|
+
{
|
|
107
|
+
input: './index.ts',
|
|
108
|
+
output: {
|
|
27
109
|
name: 'SlimSelect',
|
|
28
110
|
file: '../../dist/slimselect.global.js',
|
|
29
111
|
format: 'iife',
|
|
30
|
-
sourcemap: true,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: 'SlimSelect',
|
|
34
|
-
file: '../../dist/slimselect.umd.js',
|
|
35
|
-
format: 'umd',
|
|
36
|
-
sourcemap: true,
|
|
37
112
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
113
|
+
plugins: [
|
|
114
|
+
typescript(),
|
|
115
|
+
resolve(),
|
|
116
|
+
commonjs(),
|
|
117
|
+
babel({
|
|
118
|
+
exclude: 'node_modules/**',
|
|
119
|
+
}),
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
]
|
|
@@ -150,12 +150,16 @@
|
|
|
150
150
|
.ss-value-delete {
|
|
151
151
|
display: flex;
|
|
152
152
|
align-items: center;
|
|
153
|
+
height: var(--ss-spacing-l);
|
|
153
154
|
width: var(--ss-spacing-l);
|
|
154
155
|
padding: var(--ss-spacing-s) var(--ss-spacing-m);
|
|
155
156
|
cursor: pointer;
|
|
156
157
|
border-left: solid 1px var(--ss-bg-color);
|
|
157
158
|
|
|
158
159
|
svg {
|
|
160
|
+
height: var(--ss-spacing-l);
|
|
161
|
+
width: var(--ss-spacing-l);
|
|
162
|
+
|
|
159
163
|
path {
|
|
160
164
|
fill: none;
|
|
161
165
|
stroke: var(--ss-bg-color);
|
|
@@ -178,6 +182,9 @@
|
|
|
178
182
|
margin: 0 var(--ss-spacing-m) 0 var(--ss-spacing-m);
|
|
179
183
|
|
|
180
184
|
svg {
|
|
185
|
+
width: 8px;
|
|
186
|
+
height: 8px;
|
|
187
|
+
|
|
181
188
|
path {
|
|
182
189
|
fill: none;
|
|
183
190
|
stroke: var(--ss-font-color);
|