slim-select 2.2.3 → 2.3.1

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/README.md CHANGED
@@ -51,12 +51,8 @@ npm install slim-select
51
51
  ### or
52
52
 
53
53
  ```html
54
- <script src="https://cdnjs.cloudflare.com/ajax/libs/slim-select/<version>/slimselect.js"></script>
55
- <link
56
- rel="stylesheet"
57
- type="text/css"
58
- href="https://cdnjs.cloudflare.com/ajax/libs/slim-select/<version>/slimselect.css"
59
- />
54
+ <script src="https://unpkg.com/slim-select@latest/dist/slimselect.min.js"></script>
55
+ <link rel="stylesheet" href="https://unpkg.com/slim-select@latest/dist/slimselect.css" />
60
56
  ```
61
57
 
62
58
  ## Usage
package/dist/index.d.ts CHANGED
@@ -33,7 +33,7 @@ export default class SlimSelect {
33
33
  getData(): DataArray;
34
34
  setData(data: DataArrayPartial): void;
35
35
  getSelected(): string[];
36
- setSelected(value: string | string[]): void;
36
+ setSelected(value: string | string[], runAfterChange?: boolean): void;
37
37
  addOption(option: OptionOptional): void;
38
38
  open(): void;
39
39
  close(): void;
package/dist/render.d.ts CHANGED
@@ -4,7 +4,7 @@ export interface Callbacks {
4
4
  open: () => void;
5
5
  close: () => void;
6
6
  addable?: (value: string) => Promise<OptionOptional | string> | OptionOptional | string;
7
- setSelected: (value: string[]) => void;
7
+ setSelected: (value: string[], runAfterChange: boolean) => void;
8
8
  addOption: (option: Option) => void;
9
9
  search: (search: string) => void;
10
10
  beforeChange?: (newVal: Option[], oldVal: Option[]) => boolean | void;
@@ -48,6 +48,7 @@ export default class Render {
48
48
  placeholder: string;
49
49
  values: string;
50
50
  single: string;
51
+ max: string;
51
52
  value: string;
52
53
  valueText: string;
53
54
  valueDelete: string;
@@ -89,6 +90,7 @@ export default class Render {
89
90
  disable(): void;
90
91
  open(): void;
91
92
  close(): void;
93
+ updateClassStyles(): void;
92
94
  mainDiv(): Main;
93
95
  mainFocus(trigger: boolean): void;
94
96
  placeholder(): HTMLDivElement;
@@ -112,5 +114,5 @@ export default class Render {
112
114
  moveContentAbove(): void;
113
115
  moveContentBelow(): void;
114
116
  ensureElementInView(container: HTMLElement, element: HTMLElement): void;
115
- putContent(el: HTMLElement, isOpen: boolean): 'up' | 'down';
117
+ putContent(): 'up' | 'down';
116
118
  }
package/dist/select.d.ts CHANGED
@@ -1,25 +1,20 @@
1
1
  import { DataArray, DataArrayPartial, Optgroup, OptgroupOptional, Option } from './store';
2
2
  export default class Select {
3
3
  select: HTMLSelectElement;
4
- listen: boolean;
5
- onSelectChange?: (data: DataArrayPartial) => void;
6
4
  onValueChange?: (value: string[]) => void;
5
+ onClassChange?: (classes: string[]) => void;
6
+ onDisabledChange?: (disabled: boolean) => void;
7
+ onOptionsChange?: (data: DataArrayPartial) => void;
8
+ listen: boolean;
7
9
  private observer;
8
10
  constructor(select: HTMLSelectElement);
9
11
  enable(): void;
10
12
  disable(): void;
11
13
  hideUI(): void;
12
14
  showUI(): void;
13
- changeListen(on: boolean): void;
14
- addSelectChangeListener(func: (data: DataArrayPartial) => void): void;
15
- removeSelectChangeListener(): void;
16
- addValueChangeListener(func: (value: string[]) => void): void;
17
- removeValueChangeListener(): void;
15
+ changeListen(listen: boolean): void;
18
16
  valueChange(ev: Event): boolean;
19
- private observeWrapper;
20
- private addObserver;
21
- private connectObserver;
22
- private disconnectObserver;
17
+ private observeCall;
23
18
  getData(): DataArrayPartial;
24
19
  getDataFromOptgroup(optgroup: HTMLOptGroupElement): OptgroupOptional;
25
20
  getDataFromOption(option: HTMLOptionElement): Option;
@@ -8,7 +8,7 @@ export default class Settings {
8
8
  isOpen: boolean;
9
9
  triggerFocus: boolean;
10
10
  intervalMove: NodeJS.Timeout | null;
11
- isEnabled: boolean;
11
+ disabled: boolean;
12
12
  alwaysOpen: boolean;
13
13
  showSearch: boolean;
14
14
  searchPlaceholder: string;
@@ -26,5 +26,7 @@ export default class Settings {
26
26
  minSelected: number;
27
27
  maxSelected: number;
28
28
  timeoutDelay: number;
29
+ maxValuesShown: number;
30
+ maxValuesMessage: string;
29
31
  constructor(settings?: SettingsPartial);
30
32
  }