slim-select 2.0.0 → 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/.github/ISSUE_TEMPLATE/issue-report.md +3 -3
- package/README.md +17 -20
- package/dist/{helper.d.ts → helpers.d.ts} +0 -0
- package/dist/index.d.ts +0 -6
- 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/docs/404.html +18 -12
- package/docs/assets/home.js +1 -1
- package/docs/assets/index.css +1 -1
- package/docs/assets/index.js +7 -7
- package/docs/assets/index5.js +11 -0
- package/docs/assets/install.js +7 -7
- 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 +23 -3
- 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 +46 -12
- package/src/docs/pages/install.vue +29 -4
- 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 -29
- 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
- package/src/slim-select/webpack.config.js +0 -73
|
@@ -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({
|
|
@@ -30,5 +30,5 @@ Use Save As... to download, then click back to return to this page.`)&&(location
|
|
|
30
30
|
</select>
|
|
31
31
|
</body>
|
|
32
32
|
</html>
|
|
33
|
-
`,1),
|
|
34
|
-
`)])]),
|
|
33
|
+
`,1),B(`
|
|
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
|
},
|
|
@@ -88,6 +94,18 @@ export default defineComponent({
|
|
|
88
94
|
})
|
|
89
95
|
|
|
90
96
|
this.$router.afterEach(() => {
|
|
97
|
+
if (this.$route.query.p) {
|
|
98
|
+
// Delay router push to allow for
|
|
99
|
+
// other things to happen first
|
|
100
|
+
setTimeout(() => {
|
|
101
|
+
if (this.$route.query.p) {
|
|
102
|
+
this.$router.push({ path: this.$route.query.p.toString(), hash: this.$route.hash })
|
|
103
|
+
}
|
|
104
|
+
}, 200)
|
|
105
|
+
|
|
106
|
+
return
|
|
107
|
+
}
|
|
108
|
+
|
|
91
109
|
// After route change get the hash and scroll to element in main
|
|
92
110
|
setTimeout(() => {
|
|
93
111
|
const hash = this.$route.hash
|
|
@@ -113,7 +131,7 @@ export default defineComponent({
|
|
|
113
131
|
})
|
|
114
132
|
}
|
|
115
133
|
}
|
|
116
|
-
},
|
|
134
|
+
}, 200)
|
|
117
135
|
})
|
|
118
136
|
|
|
119
137
|
this.setDemensions()
|
|
@@ -121,6 +139,8 @@ export default defineComponent({
|
|
|
121
139
|
},
|
|
122
140
|
unmounted() {
|
|
123
141
|
window.removeEventListener('resize', this.navDebounce)
|
|
142
|
+
|
|
143
|
+
this.nav?.destroy()
|
|
124
144
|
},
|
|
125
145
|
watch: {
|
|
126
146
|
width() {
|
|
@@ -172,7 +192,7 @@ export default defineComponent({
|
|
|
172
192
|
<header>
|
|
173
193
|
<div class="top">
|
|
174
194
|
<div class="text">
|
|
175
|
-
<h1 class="logo">Slim Select</h1>
|
|
195
|
+
<h1 class="logo">Slim Select <small>2.0</small></h1>
|
|
176
196
|
</div>
|
|
177
197
|
<div class="socials">
|
|
178
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
|
@@ -5,44 +5,78 @@ import SlimSelect from '../../slim-select'
|
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
7
7
|
name: 'Home',
|
|
8
|
+
data() {
|
|
9
|
+
return {
|
|
10
|
+
single: null as SlimSelect | null,
|
|
11
|
+
multiple: null as SlimSelect | null,
|
|
12
|
+
}
|
|
13
|
+
},
|
|
8
14
|
mounted() {
|
|
9
|
-
|
|
15
|
+
this.single = new SlimSelect({
|
|
10
16
|
select: this.$refs.slimSingle as HTMLSelectElement,
|
|
11
17
|
})
|
|
12
|
-
|
|
18
|
+
this.multiple = new SlimSelect({
|
|
13
19
|
select: this.$refs.slimMulti as HTMLSelectElement,
|
|
14
20
|
})
|
|
15
21
|
|
|
16
22
|
setTimeout(() => {
|
|
17
|
-
single
|
|
23
|
+
if (this.single) {
|
|
24
|
+
this.single.open()
|
|
25
|
+
}
|
|
18
26
|
setTimeout(() => {
|
|
19
|
-
single
|
|
27
|
+
if (this.single) {
|
|
28
|
+
this.single.setSelected('best')
|
|
29
|
+
}
|
|
20
30
|
}, 500)
|
|
21
31
|
setTimeout(() => {
|
|
22
|
-
single
|
|
32
|
+
if (this.single) {
|
|
33
|
+
this.single.setSelected('select')
|
|
34
|
+
}
|
|
23
35
|
}, 1000)
|
|
24
36
|
setTimeout(() => {
|
|
25
|
-
single
|
|
37
|
+
if (this.single) {
|
|
38
|
+
this.single.setSelected('ever')
|
|
39
|
+
}
|
|
26
40
|
}, 1500)
|
|
27
41
|
setTimeout(() => {
|
|
28
|
-
single
|
|
42
|
+
if (this.single) {
|
|
43
|
+
this.single.close()
|
|
44
|
+
}
|
|
29
45
|
}, 2000)
|
|
30
46
|
|
|
31
|
-
multiple
|
|
47
|
+
if (this.multiple) {
|
|
48
|
+
this.multiple.open()
|
|
49
|
+
}
|
|
32
50
|
setTimeout(() => {
|
|
33
|
-
multiple
|
|
51
|
+
if (this.multiple) {
|
|
52
|
+
this.multiple.setSelected(['best'])
|
|
53
|
+
}
|
|
34
54
|
}, 500)
|
|
35
55
|
setTimeout(() => {
|
|
36
|
-
multiple
|
|
56
|
+
if (this.multiple) {
|
|
57
|
+
this.multiple.setSelected(['best', 'select'])
|
|
58
|
+
}
|
|
37
59
|
}, 1000)
|
|
38
60
|
setTimeout(() => {
|
|
39
|
-
multiple
|
|
61
|
+
if (this.multiple) {
|
|
62
|
+
this.multiple.setSelected(['best', 'select', 'ever'])
|
|
63
|
+
}
|
|
40
64
|
}, 1500)
|
|
41
65
|
setTimeout(() => {
|
|
42
|
-
multiple
|
|
66
|
+
if (this.multiple) {
|
|
67
|
+
this.multiple.close()
|
|
68
|
+
}
|
|
43
69
|
}, 2000)
|
|
44
70
|
}, 500)
|
|
45
71
|
},
|
|
72
|
+
unmounted() {
|
|
73
|
+
if (this.single) {
|
|
74
|
+
this.single.destroy()
|
|
75
|
+
}
|
|
76
|
+
if (this.multiple) {
|
|
77
|
+
this.multiple.destroy()
|
|
78
|
+
}
|
|
79
|
+
},
|
|
46
80
|
})
|
|
47
81
|
</script>
|
|
48
82
|
|
|
@@ -43,15 +43,36 @@ export default defineComponent({
|
|
|
43
43
|
|
|
44
44
|
<div id="cdn" class="content">
|
|
45
45
|
<h2>Cdn</h2>
|
|
46
|
-
<p>
|
|
46
|
+
<p>
|
|
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
|
+
>
|
|
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>
|
|
47
68
|
<div class="alert info">New releases may be delayed until the next time its indexed</div>
|
|
48
69
|
|
|
49
70
|
<pre class="install-code">
|
|
50
71
|
<code class="language-html">
|
|
51
72
|
<html>
|
|
52
73
|
<head>
|
|
53
|
-
<script src="
|
|
54
|
-
<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>
|
|
55
76
|
|
|
56
77
|
<script>
|
|
57
78
|
new SlimSelect({
|
|
@@ -73,7 +94,11 @@ export default defineComponent({
|
|
|
73
94
|
|
|
74
95
|
<div id="download" class="content">
|
|
75
96
|
<h2>Download</h2>
|
|
76
|
-
<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>
|
|
77
102
|
<div class="btn" @click="downloadLink()">Click Here To Download</div>
|
|
78
103
|
</div>
|
|
79
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
|