slim-select 3.0.1 → 3.0.3

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/sitemap.js ADDED
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from 'fs'
4
+ import path from 'path'
5
+ import { fileURLToPath } from 'url'
6
+
7
+ const __filename = fileURLToPath(import.meta.url)
8
+ const __dirname = path.dirname(__filename)
9
+
10
+ // Define all routes and their metadata
11
+ const routes = [
12
+ {
13
+ loc: 'https://slimselectjs.com/',
14
+ lastmod: new Date().toISOString().split('T')[0],
15
+ changefreq: 'weekly',
16
+ priority: '1.0'
17
+ },
18
+ {
19
+ loc: 'https://slimselectjs.com/install',
20
+ lastmod: new Date().toISOString().split('T')[0],
21
+ changefreq: 'monthly',
22
+ priority: '0.9'
23
+ },
24
+ {
25
+ loc: 'https://slimselectjs.com/selects',
26
+ lastmod: new Date().toISOString().split('T')[0],
27
+ changefreq: 'monthly',
28
+ priority: '0.9'
29
+ },
30
+ {
31
+ loc: 'https://slimselectjs.com/data',
32
+ lastmod: new Date().toISOString().split('T')[0],
33
+ changefreq: 'monthly',
34
+ priority: '0.8'
35
+ },
36
+ {
37
+ loc: 'https://slimselectjs.com/settings',
38
+ lastmod: new Date().toISOString().split('T')[0],
39
+ changefreq: 'monthly',
40
+ priority: '0.8'
41
+ },
42
+ {
43
+ loc: 'https://slimselectjs.com/events',
44
+ lastmod: new Date().toISOString().split('T')[0],
45
+ changefreq: 'monthly',
46
+ priority: '0.7'
47
+ },
48
+ {
49
+ loc: 'https://slimselectjs.com/methods',
50
+ lastmod: new Date().toISOString().split('T')[0],
51
+ changefreq: 'monthly',
52
+ priority: '0.7'
53
+ },
54
+ {
55
+ loc: 'https://slimselectjs.com/frameworks/react',
56
+ lastmod: new Date().toISOString().split('T')[0],
57
+ changefreq: 'monthly',
58
+ priority: '0.8'
59
+ },
60
+ {
61
+ loc: 'https://slimselectjs.com/frameworks/vue',
62
+ lastmod: new Date().toISOString().split('T')[0],
63
+ changefreq: 'monthly',
64
+ priority: '0.8'
65
+ }
66
+ ]
67
+
68
+ function generateSitemap() {
69
+ const sitemapContent = `<?xml version="1.0" encoding="UTF-8"?>
70
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
71
+ ${routes
72
+ .map(
73
+ (route) => ` <url>
74
+ <loc>${route.loc}</loc>
75
+ <lastmod>${route.lastmod}</lastmod>
76
+ <changefreq>${route.changefreq}</changefreq>
77
+ <priority>${route.priority}</priority>
78
+ </url>`
79
+ )
80
+ .join('\n')}
81
+ </urlset>`
82
+
83
+ const sitemapPath = path.join(__dirname, 'public', 'sitemap.xml')
84
+ fs.writeFileSync(sitemapPath, sitemapContent, 'utf8')
85
+ console.log('✅ Sitemap generated successfully at:', sitemapPath)
86
+ }
87
+
88
+ // Run the generator
89
+ generateSitemap()
@@ -0,0 +1,8 @@
1
+ // UMD entry point - only exports the default SlimSelect class
2
+ // This avoids the mixed exports issue for UMD/IIFE builds
3
+ import SlimSelect, * as namedExports from './index'
4
+
5
+ // Attach all named exports as properties on the default export
6
+ Object.assign(SlimSelect, namedExports)
7
+
8
+ export default SlimSelect
@@ -143,6 +143,12 @@ export default class Render {
143
143
 
144
144
  // Clear active descendant when closed
145
145
  this.main.main.removeAttribute('aria-activedescendant')
146
+
147
+ // Remove direction class from main and content after animation is complete
148
+ setTimeout(() => {
149
+ this.main.main.classList.remove(this.classes.dirAbove, this.classes.dirBelow)
150
+ this.content.main.classList.remove(this.classes.dirAbove, this.classes.dirBelow)
151
+ }, 100)
146
152
  }
147
153
 
148
154
  public updateClassStyles(): void {
@@ -12,16 +12,11 @@ export default defineConfig({
12
12
  build: {
13
13
  minify: true,
14
14
  sourcemap: true,
15
+ emptyOutDir: false, // package.json rimraf ./dist/*
15
16
  lib: {
16
17
  entry: path.resolve(__dirname, 'src/slim-select/index.ts'),
17
- name: 'SlimSelect',
18
- formats: ['es', 'cjs', 'umd', 'iife'],
19
- fileName: (format) => {
20
- if (format === 'es') return 'slimselect.es.js'
21
- if (format === 'cjs') return 'slimselect.cjs.js'
22
- if (format === 'iife') return 'slimselect.iife.js'
23
- return 'slimselect.js' // UMD minified (default)
24
- }
18
+ formats: ['es', 'cjs'],
19
+ fileName: (format) => (format === 'es' ? 'slimselect.es.js' : 'slimselect.cjs.js')
25
20
  },
26
21
  outDir: path.resolve(__dirname, 'dist'),
27
22
  rollupOptions: {
@@ -30,10 +25,7 @@ export default defineConfig({
30
25
  assetFileNames: (assetInfo) => {
31
26
  if (assetInfo.name === 'style.css') return 'slimselect.css'
32
27
  return assetInfo.name || 'asset'
33
- },
34
- // Prevent Rollup from automatically splitting the library into multiple chunks
35
- // This ensures we get single files per format (UMD, ES, CJS, IIFE)
36
- manualChunks: undefined
28
+ }
37
29
  }
38
30
  }
39
31
  },
@@ -0,0 +1,34 @@
1
+ import { defineConfig } from 'vite'
2
+ import path from 'path'
3
+
4
+ export default defineConfig({
5
+ publicDir: false,
6
+ resolve: {
7
+ alias: {
8
+ '@': path.resolve(__dirname, 'src')
9
+ }
10
+ },
11
+ build: {
12
+ minify: true,
13
+ sourcemap: true,
14
+ emptyOutDir: false, // package.json rimraf ./dist/*
15
+ lib: {
16
+ entry: path.resolve(__dirname, 'src/slim-select/index.umd.ts'),
17
+ name: 'SlimSelect',
18
+ formats: ['umd', 'iife'],
19
+ fileName: (format) => (format === 'iife' ? 'slimselect.iife.js' : 'slimselect.js')
20
+ },
21
+ outDir: path.resolve(__dirname, 'dist'),
22
+ rollupOptions: {
23
+ output: {
24
+ exports: 'default',
25
+ assetFileNames: (assetInfo) => {
26
+ if (assetInfo.name === 'style.css') return 'slimselect.css'
27
+ return assetInfo.name || 'asset'
28
+ },
29
+ banner: '/*! SlimSelect - Advanced select dropdown */',
30
+ footer: '/*! End SlimSelect */'
31
+ }
32
+ }
33
+ }
34
+ })
@@ -11,6 +11,7 @@ export default defineConfig({
11
11
  }
12
12
  },
13
13
  build: {
14
+ emptyOutDir: false, // package.json rimraf ./dist/*
14
15
  lib: {
15
16
  entry: path.resolve(__dirname, 'src/slim-select/react/index.tsx'),
16
17
  name: 'SlimSelectReact',
@@ -11,6 +11,7 @@ export default defineConfig({
11
11
  }
12
12
  },
13
13
  build: {
14
+ emptyOutDir: false, // package.json rimraf ./dist/*
14
15
  lib: {
15
16
  entry: path.resolve(__dirname, 'src/slim-select/vue/index.ts'),
16
17
  name: 'SlimSelectVue',