slim-select 2.1.0 → 2.2.0

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.
Files changed (46) hide show
  1. package/README.md +8 -0
  2. package/dist/render.d.ts +9 -2
  3. package/dist/select.d.ts +6 -6
  4. package/dist/settings.d.ts +0 -3
  5. package/dist/slimselect.cjs.js +148 -51
  6. package/dist/slimselect.css +1 -1
  7. package/dist/slimselect.css.map +1 -1
  8. package/dist/slimselect.es.js +148 -51
  9. package/dist/slimselect.global.js +148 -51
  10. package/dist/slimselect.js +148 -51
  11. package/dist/slimselect.min.js +1 -1
  12. package/dist/slimselect.umd.js +148 -51
  13. package/dist/slimselect.umd.min.js +1 -1
  14. package/dist/store.d.ts +5 -0
  15. package/docs/assets/data.js +7 -3
  16. package/docs/assets/home.css +1 -1
  17. package/docs/assets/home.js +1 -1
  18. package/docs/assets/index.css +1 -1
  19. package/docs/assets/index.js +7 -7
  20. package/docs/assets/index2.js +119 -35
  21. package/docs/assets/index3.js +22 -15
  22. package/docs/assets/index4.js +1 -1
  23. package/docs/assets/index5.js +4 -2
  24. package/docs/assets/install.js +4 -4
  25. package/docs/assets/selects.js +1 -1
  26. package/package.json +2 -2
  27. package/src/docs/app.vue +2 -1
  28. package/src/docs/pages/data.vue +4 -0
  29. package/src/docs/pages/events/search.vue +29 -15
  30. package/src/docs/pages/frameworks/vue.vue +3 -1
  31. package/src/docs/pages/home.vue +104 -57
  32. package/src/docs/pages/settings/closable.vue +128 -0
  33. package/src/docs/pages/settings/index.vue +6 -3
  34. package/src/docs/pages/settings/select_all.vue +88 -0
  35. package/src/slim-select/index.ts +3 -1
  36. package/src/slim-select/render.ts +164 -34
  37. package/src/slim-select/select.ts +35 -27
  38. package/src/slim-select/settings.ts +0 -4
  39. package/src/slim-select/slimselect.scss +112 -11
  40. package/src/slim-select/store.ts +19 -1
  41. package/src/vue/README.md +48 -0
  42. package/src/vue/dist/slimselectvue.es.js +148 -51
  43. package/src/vue/dist/slimselectvue.global.js +148 -51
  44. package/src/vue/dist/slimselectvue.ssr.js +148 -51
  45. package/src/vue/package.json +3 -2
  46. package/src/docs/pages/settings/select_by_group.vue +0 -46
@@ -7,6 +7,7 @@
7
7
  --ss-disabled-color: #8a8a8a;
8
8
  --ss-border-color: #dcdee2;
9
9
  --ss-highlight-color: #fffb8c;
10
+ --ss-success-color: #00b755;
10
11
  --ss-error-color: #dc3545;
11
12
 
12
13
  // Heights
@@ -334,9 +335,117 @@
334
335
  }
335
336
 
336
337
  .ss-optgroup {
338
+ // If optgroup is open, show the options
339
+ &.ss-open {
340
+ .ss-option {
341
+ }
342
+ }
343
+
344
+ // If optgroup has close, hide all options
345
+ &.ss-close {
346
+ .ss-option {
347
+ display: none !important;
348
+ }
349
+ }
350
+
337
351
  .ss-optgroup-label {
352
+ display: flex;
353
+ flex-direction: row;
354
+ align-items: center;
355
+ justify-content: space-between;
338
356
  padding: var(--ss-spacing-m) var(--ss-spacing-l) var(--ss-spacing-m) var(--ss-spacing-l);
339
- font-weight: bold;
357
+
358
+ .ss-optgroup-label-text {
359
+ flex: 1 1 auto;
360
+ font-weight: bold;
361
+ color: var(--ss-font-color);
362
+ }
363
+
364
+ // If optgroup has arrow, make label clickable
365
+ &:has(.ss-arrow) {
366
+ cursor: pointer;
367
+ }
368
+
369
+ .ss-optgroup-actions {
370
+ flex: 0 1 auto;
371
+ display: flex;
372
+ flex-direction: row;
373
+ align-items: center;
374
+ justify-content: center;
375
+ gap: var(--ss-spacing-m);
376
+
377
+ .ss-selectall {
378
+ flex: 0 0 auto;
379
+ display: flex;
380
+ flex-direction: row;
381
+ cursor: pointer;
382
+
383
+ &:hover {
384
+ opacity: 0.5;
385
+ }
386
+
387
+ &.ss-selected {
388
+ svg {
389
+ path {
390
+ stroke: var(--ss-error-color);
391
+ }
392
+ }
393
+ }
394
+
395
+ span {
396
+ flex: 0 1 auto;
397
+ display: flex;
398
+ align-items: center;
399
+ justify-content: center;
400
+ font-size: calc(100% * 0.6);
401
+ text-align: center;
402
+ padding: 0 var(--ss-spacing-s) 0 0;
403
+ }
404
+
405
+ svg {
406
+ flex: 0 1 auto;
407
+ width: 13px;
408
+ height: 13px;
409
+
410
+ path {
411
+ fill: none;
412
+ stroke: var(--ss-success-color);
413
+ stroke-linecap: round;
414
+ stroke-linejoin: round;
415
+ }
416
+
417
+ &:first-child {
418
+ stroke-width: 5;
419
+ }
420
+ &:last-child {
421
+ stroke-width: 11;
422
+ }
423
+ }
424
+ }
425
+
426
+ .ss-closable {
427
+ flex: 0 1 auto;
428
+ display: flex;
429
+ flex-direction: row;
430
+ cursor: pointer;
431
+
432
+ .ss-arrow {
433
+ flex: 1 1 auto;
434
+ width: 10px;
435
+ height: 10px;
436
+
437
+ path {
438
+ fill: none;
439
+ stroke: var(--ss-font-color);
440
+ stroke-width: 18;
441
+ stroke-linecap: round;
442
+ stroke-linejoin: round;
443
+ transition-timing-function: ease-out;
444
+ transition: var(--ss-animation-timing);
445
+ }
446
+ }
447
+ }
448
+ }
340
449
  }
341
450
 
342
451
  .ss-option {
@@ -344,16 +453,8 @@
344
453
  }
345
454
  }
346
455
 
347
- .ss-optgroup-selectable {
348
- cursor: pointer;
349
-
350
- &:hover {
351
- color: var(--ss-bg-color);
352
- background-color: var(--ss-primary-color);
353
- }
354
- }
355
-
356
456
  .ss-option {
457
+ display: flex;
357
458
  padding: var(--ss-spacing-m) var(--ss-spacing-l) var(--ss-spacing-m) var(--ss-spacing-l);
358
459
  cursor: pointer;
359
460
  user-select: none;
@@ -370,7 +471,7 @@
370
471
  background-color: var(--ss-bg-color);
371
472
  }
372
473
 
373
- &:not(.ss-disabled).ss-option-selected {
474
+ &:not(.ss-disabled).ss-selected {
374
475
  color: var(--ss-font-color);
375
476
  background-color: var(--ss-highlight-color);
376
477
  }
@@ -11,17 +11,23 @@ type selectType = 'single' | 'multiple'
11
11
  export interface OptgroupOptional {
12
12
  id?: string
13
13
  label: string // Required
14
+ selectAll?: boolean
15
+ closable?: 'off' | 'open' | 'close'
14
16
  options?: OptionOptional[]
15
17
  }
16
18
 
17
19
  export class Optgroup {
18
20
  public id: string
19
21
  public label: string
22
+ public selectAll: boolean
23
+ public closable: 'off' | 'open' | 'close'
20
24
  public options: Option[]
21
25
 
22
26
  constructor(optgroup: OptgroupOptional) {
23
27
  this.id = !optgroup.id || optgroup.id === '' ? generateID() : optgroup.id
24
28
  this.label = optgroup.label || ''
29
+ this.selectAll = optgroup.selectAll === undefined ? false : optgroup.selectAll
30
+ this.closable = optgroup.closable || 'off'
25
31
 
26
32
  // If options exist, loop through options and create new option class
27
33
  // and set the options to the optgroup options field
@@ -255,6 +261,18 @@ export default class Store {
255
261
  return selectedIDs
256
262
  }
257
263
 
264
+ public getOptgroupByID(id: string): Optgroup | null {
265
+ // Loop through each data object
266
+ // and if optgroup is found, return it
267
+ for (let dataObj of this.data) {
268
+ if (dataObj instanceof Optgroup && dataObj.id === id) {
269
+ return dataObj
270
+ }
271
+ }
272
+
273
+ return null
274
+ }
275
+
258
276
  public getOptionByID(id: string): Option | null {
259
277
  let options = this.filter((opt: Option) => {
260
278
  return opt.id === id
@@ -302,7 +320,7 @@ export default class Store {
302
320
  })
303
321
 
304
322
  if (optOptions.length > 0) {
305
- dataSearch.push(new Optgroup({ id: dataObj.id, label: dataObj.label, options: optOptions }))
323
+ dataSearch.push(new Optgroup(dataObj))
306
324
  }
307
325
  }
308
326
  }
@@ -0,0 +1,48 @@
1
+ # Slim Select Vue
2
+
3
+ ## slimselectjs.com
4
+
5
+ Vue integration for the SlimSelect
6
+
7
+ See the website for the best details on how to use the vue integration
8
+
9
+ [![NPM Downloads](https://img.shields.io/npm/dt/@slim-select/vue)](https://www.npmjs.com/package/@slim-select/vue)
10
+
11
+ ## Support
12
+
13
+ [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/brianvoe)
14
+
15
+ <a href="https://www.buymeacoffee.com/brianvoe" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ npm install @slim-select/vue
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ```javascript
26
+ import { defineComponent } from 'vue'
27
+ import SlimSelect from '@slim-select/vue'
28
+
29
+ export default defineComponent({
30
+ components: {
31
+ SlimSelect,
32
+ },
33
+ })
34
+ ```
35
+
36
+ ```html
37
+ <SlimSelect>
38
+ <option value="1">Option 1</option>
39
+ <option value="2">Option 2</option>
40
+ <option value="3">Option 3</option>
41
+ </SlimSelect>
42
+
43
+ <SlimSelect multiple>
44
+ <option value="1">Option 1</option>
45
+ <option value="2">Option 2</option>
46
+ <option value="3">Option 3</option>
47
+ </SlimSelect>
48
+ ```
@@ -53,6 +53,8 @@ class Optgroup {
53
53
  constructor(optgroup) {
54
54
  this.id = !optgroup.id || optgroup.id === '' ? generateID() : optgroup.id;
55
55
  this.label = optgroup.label || '';
56
+ this.selectAll = optgroup.selectAll === undefined ? false : optgroup.selectAll;
57
+ this.closable = optgroup.closable || 'off';
56
58
  this.options = [];
57
59
  if (optgroup.options) {
58
60
  for (const o of optgroup.options) {
@@ -199,6 +201,14 @@ class Store {
199
201
  });
200
202
  return selectedIDs;
201
203
  }
204
+ getOptgroupByID(id) {
205
+ for (let dataObj of this.data) {
206
+ if (dataObj instanceof Optgroup && dataObj.id === id) {
207
+ return dataObj;
208
+ }
209
+ }
210
+ return null;
211
+ }
202
212
  getOptionByID(id) {
203
213
  let options = this.filter((opt) => {
204
214
  return opt.id === id;
@@ -233,7 +243,7 @@ class Store {
233
243
  }
234
244
  });
235
245
  if (optOptions.length > 0) {
236
- dataSearch.push(new Optgroup({ id: dataObj.id, label: dataObj.label, options: optOptions }));
246
+ dataSearch.push(new Optgroup(dataObj));
237
247
  }
238
248
  }
239
249
  }
@@ -274,11 +284,18 @@ class Render {
274
284
  list: 'ss-list',
275
285
  optgroup: 'ss-optgroup',
276
286
  optgroupLabel: 'ss-optgroup-label',
277
- optgroupSelectable: 'ss-optgroup-selectable',
287
+ optgroupLabelText: 'ss-optgroup-label-text',
288
+ optgroupActions: 'ss-optgroup-actions',
289
+ optgroupSelectAll: 'ss-selectall',
290
+ optgroupSelectAllBox: 'M60,10 L10,10 L10,90 L90,90 L90,50',
291
+ optgroupSelectAllCheck: 'M30,45 L50,70 L90,10',
292
+ optgroupClosable: 'ss-closable',
278
293
  option: 'ss-option',
279
- optionSelected: 'ss-option-selected',
280
294
  optionDelete: 'M10,10 L90,90 M10,90 L90,10',
281
295
  highlighted: 'ss-highlighted',
296
+ open: 'ss-open',
297
+ close: 'ss-close',
298
+ selected: 'ss-selected',
282
299
  error: 'ss-error',
283
300
  disabled: 'ss-disabled',
284
301
  hide: 'ss-hide',
@@ -288,8 +305,6 @@ class Render {
288
305
  this.callbacks = callbacks;
289
306
  this.main = this.mainDiv();
290
307
  this.content = this.contentDiv();
291
- this.renderValues();
292
- this.renderOptions(this.store.getData());
293
308
  this.settings.contentLocation.appendChild(this.content.main);
294
309
  }
295
310
  enable() {
@@ -802,25 +817,23 @@ class Render {
802
817
  }
803
818
  for (let i = 0; i < options.length; i++) {
804
819
  if (options[i].classList.contains(this.classes.highlighted)) {
805
- options[i].classList.remove(this.classes.highlighted);
806
- if (dir === 'down') {
807
- if (i + 1 < options.length) {
808
- options[i + 1].classList.add(this.classes.highlighted);
809
- this.ensureElementInView(this.content.list, options[i + 1]);
810
- }
811
- else {
812
- options[0].classList.add(this.classes.highlighted);
813
- this.ensureElementInView(this.content.list, options[0]);
820
+ const prevOption = options[i];
821
+ prevOption.classList.remove(this.classes.highlighted);
822
+ const prevParent = prevOption.parentElement;
823
+ if (prevParent && prevParent.classList.contains(this.classes.open)) {
824
+ const optgroupLabel = prevParent.querySelector('.' + this.classes.optgroupLabel);
825
+ if (optgroupLabel) {
826
+ optgroupLabel.click();
814
827
  }
815
828
  }
816
- else {
817
- if (i - 1 >= 0) {
818
- options[i - 1].classList.add(this.classes.highlighted);
819
- this.ensureElementInView(this.content.list, options[i - 1]);
820
- }
821
- else {
822
- options[options.length - 1].classList.add(this.classes.highlighted);
823
- this.ensureElementInView(this.content.list, options[options.length - 1]);
829
+ let selectOption = options[dir === 'down' ? (i + 1 < options.length ? i + 1 : 0) : i - 1 >= 0 ? i - 1 : options.length - 1];
830
+ selectOption.classList.add(this.classes.highlighted);
831
+ this.ensureElementInView(this.content.list, selectOption);
832
+ const selectParent = selectOption.parentElement;
833
+ if (selectParent && selectParent.classList.contains(this.classes.close)) {
834
+ const optgroupLabel = selectParent.querySelector('.' + this.classes.optgroupLabel);
835
+ if (optgroupLabel) {
836
+ optgroupLabel.click();
824
837
  }
825
838
  }
826
839
  return;
@@ -865,18 +878,95 @@ class Render {
865
878
  optgroupEl.classList.add(this.classes.optgroup);
866
879
  const optgroupLabel = document.createElement('div');
867
880
  optgroupLabel.classList.add(this.classes.optgroupLabel);
868
- optgroupLabel.innerHTML = d.label;
869
- if (this.settings.selectByGroup && this.settings.isMultiple) {
870
- optgroupLabel.classList.add(this.classes.optgroupSelectable);
881
+ optgroupEl.appendChild(optgroupLabel);
882
+ const optgroupLabelText = document.createElement('div');
883
+ optgroupLabelText.classList.add(this.classes.optgroupLabelText);
884
+ optgroupLabelText.textContent = d.label;
885
+ optgroupLabel.appendChild(optgroupLabelText);
886
+ const optgroupActions = document.createElement('div');
887
+ optgroupActions.classList.add(this.classes.optgroupActions);
888
+ optgroupLabel.appendChild(optgroupActions);
889
+ if (this.settings.isMultiple && d.selectAll) {
890
+ const selectAll = document.createElement('div');
891
+ selectAll.classList.add(this.classes.optgroupSelectAll);
892
+ let allSelected = true;
893
+ for (const o of d.options) {
894
+ if (!o.selected) {
895
+ allSelected = false;
896
+ break;
897
+ }
898
+ }
899
+ if (allSelected) {
900
+ selectAll.classList.add(this.classes.selected);
901
+ }
902
+ const selectAllText = document.createElement('span');
903
+ selectAllText.textContent = 'Select All';
904
+ selectAll.appendChild(selectAllText);
905
+ const selectAllSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
906
+ selectAllSvg.setAttribute('viewBox', '0 0 100 100');
907
+ selectAll.appendChild(selectAllSvg);
908
+ const selectAllBox = document.createElementNS('http://www.w3.org/2000/svg', 'path');
909
+ selectAllBox.setAttribute('d', this.classes.optgroupSelectAllBox);
910
+ selectAllSvg.appendChild(selectAllBox);
911
+ const selectAllCheck = document.createElementNS('http://www.w3.org/2000/svg', 'path');
912
+ selectAllCheck.setAttribute('d', this.classes.optgroupSelectAllCheck);
913
+ selectAllSvg.appendChild(selectAllCheck);
914
+ selectAll.addEventListener('click', (e) => {
915
+ e.preventDefault();
916
+ e.stopPropagation();
917
+ const currentSelected = this.store.getSelected();
918
+ if (allSelected) {
919
+ const newSelected = currentSelected.filter((s) => {
920
+ for (const o of d.options) {
921
+ if (s === o.value) {
922
+ return false;
923
+ }
924
+ }
925
+ return true;
926
+ });
927
+ this.callbacks.setSelected(newSelected);
928
+ return;
929
+ }
930
+ else {
931
+ const newSelected = currentSelected.concat(d.options.map((o) => o.value));
932
+ this.callbacks.setSelected(newSelected);
933
+ }
934
+ });
935
+ optgroupActions.appendChild(selectAll);
936
+ }
937
+ if (d.closable !== 'off') {
938
+ const optgroupClosable = document.createElement('div');
939
+ optgroupClosable.classList.add(this.classes.optgroupClosable);
940
+ const optgroupClosableSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
941
+ optgroupClosableSvg.setAttribute('viewBox', '0 0 100 100');
942
+ optgroupClosableSvg.classList.add(this.classes.arrow);
943
+ optgroupClosable.appendChild(optgroupClosableSvg);
944
+ const optgroupClosableArrow = document.createElementNS('http://www.w3.org/2000/svg', 'path');
945
+ optgroupClosableArrow.setAttribute('d', this.classes.arrow);
946
+ optgroupClosableSvg.appendChild(optgroupClosableArrow);
947
+ if (d.closable === 'open') {
948
+ optgroupEl.classList.add(this.classes.open);
949
+ optgroupClosableArrow.setAttribute('d', this.classes.arrowOpen);
950
+ }
951
+ else if (d.closable === 'close') {
952
+ optgroupEl.classList.add(this.classes.close);
953
+ optgroupClosableArrow.setAttribute('d', this.classes.arrowClose);
954
+ }
871
955
  optgroupLabel.addEventListener('click', (e) => {
872
956
  e.preventDefault();
873
957
  e.stopPropagation();
874
- for (const childEl of optgroupEl.children) {
875
- if (childEl.className.indexOf(this.classes.option) !== -1) {
876
- childEl.click();
877
- }
958
+ if (optgroupEl.classList.contains(this.classes.close)) {
959
+ optgroupEl.classList.remove(this.classes.close);
960
+ optgroupEl.classList.add(this.classes.open);
961
+ optgroupClosableArrow.setAttribute('d', this.classes.arrowOpen);
962
+ }
963
+ else {
964
+ optgroupEl.classList.remove(this.classes.open);
965
+ optgroupEl.classList.add(this.classes.close);
966
+ optgroupClosableArrow.setAttribute('d', this.classes.arrowClose);
878
967
  }
879
968
  });
969
+ optgroupActions.appendChild(optgroupClosable);
880
970
  }
881
971
  optgroupEl.appendChild(optgroupLabel);
882
972
  for (const o of d.options) {
@@ -928,10 +1018,10 @@ class Render {
928
1018
  optionEl.classList.add(this.classes.hide);
929
1019
  }
930
1020
  if (option.selected) {
931
- optionEl.classList.add(this.classes.optionSelected);
1021
+ optionEl.classList.add(this.classes.selected);
932
1022
  }
933
1023
  else {
934
- optionEl.classList.remove(this.classes.optionSelected);
1024
+ optionEl.classList.remove(this.classes.selected);
935
1025
  }
936
1026
  optionEl.addEventListener('click', (e) => {
937
1027
  e.preventDefault();
@@ -1153,8 +1243,10 @@ class Select {
1153
1243
  }
1154
1244
  getDataFromOptgroup(optgroup) {
1155
1245
  let data = {
1156
- id: '',
1246
+ id: (optgroup.dataset ? optgroup.dataset.id : false) || '',
1157
1247
  label: optgroup.label,
1248
+ selectAll: optgroup.dataset ? optgroup.dataset.selectall === 'true' : false,
1249
+ closable: optgroup.dataset ? optgroup.dataset.closable : 'off',
1158
1250
  options: [],
1159
1251
  };
1160
1252
  const options = optgroup.childNodes;
@@ -1165,6 +1257,22 @@ class Select {
1165
1257
  }
1166
1258
  return data;
1167
1259
  }
1260
+ getDataFromOption(option) {
1261
+ return {
1262
+ id: (option.dataset ? option.dataset.id : false) || '',
1263
+ value: option.value,
1264
+ text: option.text,
1265
+ html: option.innerHTML,
1266
+ selected: option.selected,
1267
+ display: option.style.display === 'none' ? false : true,
1268
+ disabled: option.disabled,
1269
+ mandatory: option.dataset ? option.dataset.mandatory === 'true' : false,
1270
+ placeholder: option.dataset.placeholder === 'true',
1271
+ class: option.className,
1272
+ style: option.style.cssText,
1273
+ data: option.dataset,
1274
+ };
1275
+ }
1168
1276
  getSelectedValues() {
1169
1277
  let values = [];
1170
1278
  const options = this.select.childNodes;
@@ -1189,22 +1297,6 @@ class Select {
1189
1297
  }
1190
1298
  return values;
1191
1299
  }
1192
- getDataFromOption(option) {
1193
- return {
1194
- id: (option.dataset ? option.dataset.id : false) || generateID(),
1195
- value: option.value,
1196
- text: option.text,
1197
- html: option.innerHTML,
1198
- selected: option.selected,
1199
- display: option.style.display === 'none' ? false : true,
1200
- disabled: option.disabled,
1201
- mandatory: option.dataset ? option.dataset.mandatory === 'true' : false,
1202
- placeholder: option.dataset.placeholder === 'true',
1203
- class: option.className,
1204
- style: option.style.cssText,
1205
- data: option.dataset,
1206
- };
1207
- }
1208
1300
  setSelected(value) {
1209
1301
  const options = this.select.childNodes;
1210
1302
  for (const o of options) {
@@ -1259,6 +1351,12 @@ class Select {
1259
1351
  const optgroupEl = document.createElement('optgroup');
1260
1352
  optgroupEl.id = optgroup.id;
1261
1353
  optgroupEl.label = optgroup.label;
1354
+ if (optgroup.selectAll) {
1355
+ optgroupEl.dataset.selectAll = 'true';
1356
+ }
1357
+ if (optgroup.closable !== 'off') {
1358
+ optgroupEl.dataset.closable = optgroup.closable;
1359
+ }
1262
1360
  if (optgroup.options) {
1263
1361
  for (const o of optgroup.options) {
1264
1362
  optgroupEl.appendChild(this.createOption(o));
@@ -1315,8 +1413,6 @@ class Settings {
1315
1413
  this.isOpen = false;
1316
1414
  this.triggerFocus = true;
1317
1415
  this.intervalMove = null;
1318
- this.mainHeight = 30;
1319
- this.contentHeight = 0;
1320
1416
  if (!settings) {
1321
1417
  settings = {};
1322
1418
  }
@@ -1338,7 +1434,6 @@ class Settings {
1338
1434
  this.allowDeselect = settings.allowDeselect !== undefined ? settings.allowDeselect : false;
1339
1435
  this.hideSelected = settings.hideSelected !== undefined ? settings.hideSelected : false;
1340
1436
  this.showOptionTooltips = settings.showOptionTooltips !== undefined ? settings.showOptionTooltips : false;
1341
- this.selectByGroup = settings.selectByGroup !== undefined ? settings.selectByGroup : false;
1342
1437
  this.minSelected = settings.minSelected || 0;
1343
1438
  this.maxSelected = settings.maxSelected || 1000;
1344
1439
  this.timeoutDelay = settings.timeoutDelay || 200;
@@ -1445,6 +1540,8 @@ class SlimSelect {
1445
1540
  afterChange: this.events.afterChange,
1446
1541
  };
1447
1542
  this.render = new Render(this.settings, this.store, callbacks);
1543
+ this.render.renderValues();
1544
+ this.render.renderOptions(this.store.getData());
1448
1545
  if (this.selectEl.parentNode) {
1449
1546
  this.selectEl.parentNode.insertBefore(this.render.main.main, this.selectEl.nextSibling);
1450
1547
  }