slim-select 3.0.3 → 3.0.5

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.
@@ -17,7 +17,7 @@ export declare interface Config {
17
17
  events?: Events;
18
18
  }
19
19
 
20
- declare interface Content {
20
+ export declare interface Content {
21
21
  main: HTMLDivElement;
22
22
  search: Search;
23
23
  list: HTMLDivElement;
@@ -81,7 +81,7 @@ export declare interface Events {
81
81
  error?: (err: Error) => void;
82
82
  }
83
83
 
84
- declare interface Main {
84
+ export declare interface Main {
85
85
  main: HTMLDivElement;
86
86
  values: HTMLDivElement;
87
87
  deselect: {
@@ -125,7 +125,7 @@ declare class Option_2 {
125
125
  }
126
126
  export { Option_2 as Option }
127
127
 
128
- export declare class Render {
128
+ declare class Render {
129
129
  settings: Settings;
130
130
  store: Store;
131
131
  callbacks: Callbacks;
@@ -168,7 +168,7 @@ export declare class Render {
168
168
  updateDeselectAll(): void;
169
169
  }
170
170
 
171
- declare interface Search {
171
+ export declare interface Search {
172
172
  main: HTMLDivElement;
173
173
  input: HTMLInputElement;
174
174
  addable?: {
@@ -178,13 +178,13 @@ declare interface Search {
178
178
  };
179
179
  }
180
180
 
181
- export declare class Select {
181
+ declare class Select {
182
182
  select: HTMLSelectElement;
183
183
  onValueChange?: (value: Option_2[]) => void;
184
184
  onClassChange?: (classes: string[]) => void;
185
185
  onDisabledChange?: (disabled: boolean) => void;
186
186
  onOptionsChange?: (data: (Option_2 | Optgroup)[]) => void;
187
- listen: boolean;
187
+ private listen;
188
188
  private observer;
189
189
  constructor(select: HTMLSelectElement);
190
190
  enable(): void;
@@ -208,8 +208,6 @@ export declare class Select {
208
208
  destroy(): void;
209
209
  }
210
210
 
211
- declare type selectType = 'single' | 'multiple';
212
-
213
211
  export declare class Settings {
214
212
  id: string;
215
213
  style: string;
@@ -274,11 +272,11 @@ declare class SlimSelect {
274
272
  }
275
273
  export default SlimSelect;
276
274
 
277
- export declare class Store {
275
+ declare class Store {
278
276
  private selectType;
279
277
  private data;
280
278
  private selectedOrder;
281
- constructor(type: selectType, data: (Partial<Option_2> | Partial<Optgroup>)[]);
279
+ constructor(type: 'single' | 'multiple', data: (Partial<Option_2> | Partial<Optgroup>)[]);
282
280
  validateDataArray(data: (Partial<Option_2> | Partial<Optgroup>)[]): Error | null;
283
281
  validateOption(option: Partial<Option_2>): Error | null;
284
282
  partialToFullData(data: (Partial<Option_2> | Partial<Optgroup>)[]): (Option_2 | Optgroup)[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "slim-select",
3
3
  "description": "Slim advanced select dropdown",
4
- "version": "3.0.3",
4
+ "version": "3.0.5",
5
5
  "type": "module",
6
6
  "author": "Brian Voelker <brian@webiswhatido.com> (http://webiswhatido.com)",
7
7
  "homepage": "https://slimselectjs.com",
@@ -73,11 +73,11 @@
73
73
  "@types/node": "^24.9.1",
74
74
  "@types/react": "^19.2.2",
75
75
  "@types/react-dom": "^19.2.2",
76
- "@typescript-eslint/eslint-plugin": "^8.46.1",
76
+ "@typescript-eslint/eslint-plugin": "^8.46.2",
77
77
  "@typescript-eslint/parser": "^8.46.1",
78
- "@vitejs/plugin-react": "^5.0.4",
78
+ "@vitejs/plugin-react": "^5.1.0",
79
79
  "@vitejs/plugin-vue": "^6.0.1",
80
- "@vitest/coverage-v8": "^3.2.4",
80
+ "@vitest/coverage-v8": "^4.0.3",
81
81
  "@vue/test-utils": "^2.4.6",
82
82
  "axe-core": "^4.11.0",
83
83
  "clipboard": "^2.0.11",
@@ -89,17 +89,17 @@
89
89
  "jsdom": "^27.0.1",
90
90
  "pinia": "^3.0.3",
91
91
  "prettier": "^3.6.2",
92
- "prismjs": "^1.30.0",
93
92
  "react": "^19.2.0",
94
93
  "react-dom": "^19.2.0",
95
94
  "rimraf": "^6.0.1",
96
95
  "sass": "^1.93.2",
96
+ "shiki": "^3.13.0",
97
97
  "terser": "^5.44.0",
98
98
  "tslib": "^2.8.1",
99
99
  "typescript": "^5.9.3",
100
- "vite": "^7.1.11",
100
+ "vite": "^7.1.12",
101
101
  "vite-plugin-dts": "^4.5.4",
102
- "vitest": "^3.2.4",
102
+ "vitest": "^4.0.3",
103
103
  "vue": "^3.5.22",
104
104
  "vue-router": "^4.6.3",
105
105
  "vue-tsc": "^3.1.1",
@@ -6,7 +6,10 @@ import Settings from './settings'
6
6
  import Store, { Option, Optgroup } from './store'
7
7
 
8
8
  // Export classes
9
- export { Select, Settings, Render, Store, Option, Optgroup }
9
+ export { Settings, Option, Optgroup }
10
+
11
+ // Export interfaces from render
12
+ export type { Main, Content, Search } from './render'
10
13
 
11
14
  export interface Config {
12
15
  select: string | Element
@@ -50,6 +50,7 @@ export default class Render {
50
50
  public settings: Settings
51
51
  public store: Store
52
52
  public callbacks: Callbacks
53
+
53
54
  // Used to compute the range selection
54
55
  private lastSelectedOption: Option | null
55
56
 
@@ -37,8 +37,7 @@ describe('select module', () => {
37
37
  const select = new Select(selectElement)
38
38
 
39
39
  expect(select).toBeInstanceOf(Select)
40
- expect(select.listen).toBe(true)
41
- expect((<any>select).observer).toBeInstanceOf(MutationObserver)
40
+ expect(select.select).toBeInstanceOf(HTMLSelectElement)
42
41
  })
43
42
  })
44
43
 
@@ -11,7 +11,7 @@ export default class Select {
11
11
  public onOptionsChange?: (data: (Option | Optgroup)[]) => void
12
12
 
13
13
  // Change observers
14
- public listen: boolean = false
14
+ private listen: boolean = false
15
15
  private observer: MutationObserver | null = null
16
16
 
17
17
  constructor(select: HTMLSelectElement) {
@@ -1,7 +1,5 @@
1
1
  import { generateID } from './helpers'
2
2
 
3
- type selectType = 'single' | 'multiple'
4
-
5
3
  export class Option {
6
4
  id: string
7
5
  value: string
@@ -60,13 +58,13 @@ export class Optgroup {
60
58
  }
61
59
 
62
60
  export default class Store {
63
- private selectType: selectType = 'single'
61
+ private selectType: 'single' | 'multiple' = 'single'
64
62
 
65
63
  // Main data set, never null
66
64
  private data: (Option | Optgroup)[] = []
67
65
  private selectedOrder: string[] = []
68
66
 
69
- constructor(type: selectType, data: (Partial<Option> | Partial<Optgroup>)[]) {
67
+ constructor(type: 'single' | 'multiple', data: (Partial<Option> | Partial<Optgroup>)[]) {
70
68
  this.selectType = type
71
69
  this.setData(data)
72
70
  }
@@ -6,8 +6,8 @@ import SlimSelectVue from './vue.vue'
6
6
 
7
7
  describe('SlimSelect Vue Component', () => {
8
8
  let wrapper: VueWrapper<any>
9
- let consoleInfoSpy: ReturnType<typeof vi.spyOn>
10
- let consoleWarnSpy: ReturnType<typeof vi.spyOn>
9
+ let consoleInfoSpy: any
10
+ let consoleWarnSpy: any
11
11
 
12
12
  beforeEach(() => {
13
13
  // Mock console methods
package/tsconfig.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "target": "esnext",
8
8
  "useDefineForClassFields": true,
9
9
  "module": "esnext",
10
- "moduleResolution": "node",
10
+ "moduleResolution": "bundler",
11
11
  "jsx": "react-jsx",
12
12
  "strict": true,
13
13
  "allowJs": false,
@@ -34,7 +34,7 @@ export default defineConfig({
34
34
  react(),
35
35
  dts({
36
36
  rollupTypes: true,
37
- include: ['src/slim-select/react/**/*'],
37
+ include: ['src/slim-select/react/index.tsx'],
38
38
  exclude: ['src/slim-select/**/*.test.ts', 'src/docs/**/*']
39
39
  })
40
40
  ]
@@ -33,7 +33,7 @@ export default defineConfig({
33
33
  vue(),
34
34
  dts({
35
35
  rollupTypes: true,
36
- include: ['src/slim-select/vue/**/*'],
36
+ include: ['src/slim-select/vue/index.ts'],
37
37
  exclude: ['src/slim-select/**/*.test.ts', 'src/docs/**/*']
38
38
  })
39
39
  ]