slim-select 2.2.1 → 2.2.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.
Files changed (149) hide show
  1. package/dist/helpers.d.ts +1 -0
  2. package/dist/index.d.ts +1 -1
  3. package/dist/select.d.ts +1 -1
  4. package/dist/slimselect.cjs.js +68 -52
  5. package/dist/slimselect.es.js +68 -52
  6. package/dist/slimselect.global.js +68 -52
  7. package/dist/slimselect.js +68 -52
  8. package/dist/slimselect.min.js +1 -1
  9. package/dist/slimselect.umd.js +68 -52
  10. package/dist/slimselect.umd.min.js +1 -1
  11. package/package.json +1 -1
  12. package/src/slim-select/helpers.ts +4 -0
  13. package/src/slim-select/index.ts +26 -2
  14. package/src/slim-select/render.ts +0 -1
  15. package/src/slim-select/select.ts +12 -3
  16. package/src/slim-select/store.ts +19 -16
  17. package/src/vue/dist/slim-select/helpers.d.ts +1 -0
  18. package/src/vue/dist/slim-select/index.d.ts +1 -1
  19. package/src/vue/dist/slim-select/select.d.ts +1 -1
  20. package/src/vue/dist/slimselectvue.es.js +120 -55
  21. package/src/vue/dist/slimselectvue.global.js +120 -55
  22. package/src/vue/dist/slimselectvue.ssr.js +120 -55
  23. package/src/vue/dist/vue/slimselect.vue.d.ts +50 -27
  24. package/src/vue/package.json +1 -1
  25. package/src/vue/rollup.config.mjs +3 -3
  26. package/src/vue/slimselect.vue +66 -2
  27. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/code/cache/05b27cf262de47962f4beeba3d4b4f67616bdf24 +0 -1
  28. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/code/cache/26c90bc22e366b540ff134ba7de2ab3715155a20 +0 -1
  29. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/code/cache/7a2b654bed9256f52421aec7d04cd8553486335b +0 -1
  30. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/code/cache/80fdd1aafff88316e6a7f63509fb7304c94ae6d3 +0 -1
  31. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/code/cache/88c6c8bf5346a961efcdff848fba6e3f2d24b26c +0 -1
  32. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/code/cache/b2f217f16a7744eb13543dc90442443538b724b8 +0 -1
  33. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/code/cache/be60813c21c2fbc627fcf99127ca2a96a3065fba +0 -1
  34. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/semanticDiagnostics/cache/05b27cf262de47962f4beeba3d4b4f67616bdf24 +0 -1
  35. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/semanticDiagnostics/cache/26c90bc22e366b540ff134ba7de2ab3715155a20 +0 -1
  36. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/semanticDiagnostics/cache/7a2b654bed9256f52421aec7d04cd8553486335b +0 -1
  37. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/semanticDiagnostics/cache/80fdd1aafff88316e6a7f63509fb7304c94ae6d3 +0 -1
  38. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/semanticDiagnostics/cache/88c6c8bf5346a961efcdff848fba6e3f2d24b26c +0 -1
  39. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/semanticDiagnostics/cache/a8a4a8a1b06b6c8069e965f4a30a4b42013b830a +0 -1
  40. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/semanticDiagnostics/cache/b2f217f16a7744eb13543dc90442443538b724b8 +0 -1
  41. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/semanticDiagnostics/cache/be60813c21c2fbc627fcf99127ca2a96a3065fba +0 -1
  42. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/syntacticDiagnostics/cache/05b27cf262de47962f4beeba3d4b4f67616bdf24 +0 -1
  43. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/syntacticDiagnostics/cache/26c90bc22e366b540ff134ba7de2ab3715155a20 +0 -1
  44. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/syntacticDiagnostics/cache/7a2b654bed9256f52421aec7d04cd8553486335b +0 -1
  45. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/syntacticDiagnostics/cache/80fdd1aafff88316e6a7f63509fb7304c94ae6d3 +0 -1
  46. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/syntacticDiagnostics/cache/88c6c8bf5346a961efcdff848fba6e3f2d24b26c +0 -1
  47. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/syntacticDiagnostics/cache/a8a4a8a1b06b6c8069e965f4a30a4b42013b830a +0 -1
  48. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/syntacticDiagnostics/cache/b2f217f16a7744eb13543dc90442443538b724b8 +0 -1
  49. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/syntacticDiagnostics/cache/be60813c21c2fbc627fcf99127ca2a96a3065fba +0 -1
  50. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/068e7904209e205518dbc9726d632bbaf28bfc55 +0 -0
  51. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/06b75ecfe63fda3fcfaa42593fa1f22167f3a9f8 +0 -0
  52. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/2aa9d56fc4a9661ee8e3de277da5ee3f960713de +0 -0
  53. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/2c58b356be1a9572c64469d50a7a25c46f94aaeb +0 -0
  54. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/36d3fb579feb4cad7a15b7a2f509f338caf72fa0 +0 -0
  55. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/388b297c3f73fcba25b8174fda975235e5d12b5a +0 -0
  56. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/40e43895ec63e1e25aa7e278ca1e8c3adefc815d +0 -0
  57. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/645e188194be07518ebbb0a5b4304f5170fee599 +0 -0
  58. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/65515bf3a44aaf1306f589073f1c8b98be747f5f +0 -0
  59. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/6a357fe7542e07f7919ea9b22401027dd1e8a0c1 +0 -0
  60. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/72087cac150d02ed6d19e37d6f1436566d5ac798 +0 -0
  61. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/9ff120b6426a4c7a03236428f26a92772586c3e5 +0 -0
  62. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/a6917de673fc74a6cfca5133913982e54e58a7fb +0 -0
  63. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/aa4aee440d13b06b4bb05c36eee326513aa6c040 +0 -0
  64. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/b02a4d0c40fac4c7f9ea7acd7944ee8844afcedf +0 -0
  65. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/b21a02b948881426bc4dcff649fc4fba07ca34d2 +0 -0
  66. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/c10c11f9c426095ab3f504dd8b7622ad7ba7c8ed +0 -0
  67. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_1e8d68e0803222688213218fda500c83f6c6476e/types/cache/dc186595636217ded2d4a4cfbb789d68ea485b6b +0 -0
  68. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/code/cache/05b27cf262de47962f4beeba3d4b4f67616bdf24 +0 -1
  69. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/code/cache/26c90bc22e366b540ff134ba7de2ab3715155a20 +0 -1
  70. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/code/cache/7a2b654bed9256f52421aec7d04cd8553486335b +0 -1
  71. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/code/cache/80fdd1aafff88316e6a7f63509fb7304c94ae6d3 +0 -1
  72. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/code/cache/88c6c8bf5346a961efcdff848fba6e3f2d24b26c +0 -1
  73. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/code/cache/b2f217f16a7744eb13543dc90442443538b724b8 +0 -1
  74. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/code/cache/be60813c21c2fbc627fcf99127ca2a96a3065fba +0 -1
  75. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/semanticDiagnostics/cache/05b27cf262de47962f4beeba3d4b4f67616bdf24 +0 -1
  76. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/semanticDiagnostics/cache/26c90bc22e366b540ff134ba7de2ab3715155a20 +0 -1
  77. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/semanticDiagnostics/cache/7a2b654bed9256f52421aec7d04cd8553486335b +0 -1
  78. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/semanticDiagnostics/cache/80fdd1aafff88316e6a7f63509fb7304c94ae6d3 +0 -1
  79. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/semanticDiagnostics/cache/88c6c8bf5346a961efcdff848fba6e3f2d24b26c +0 -1
  80. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/semanticDiagnostics/cache/a8a4a8a1b06b6c8069e965f4a30a4b42013b830a +0 -1
  81. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/semanticDiagnostics/cache/b2f217f16a7744eb13543dc90442443538b724b8 +0 -1
  82. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/semanticDiagnostics/cache/be60813c21c2fbc627fcf99127ca2a96a3065fba +0 -1
  83. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/syntacticDiagnostics/cache/05b27cf262de47962f4beeba3d4b4f67616bdf24 +0 -1
  84. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/syntacticDiagnostics/cache/26c90bc22e366b540ff134ba7de2ab3715155a20 +0 -1
  85. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/syntacticDiagnostics/cache/7a2b654bed9256f52421aec7d04cd8553486335b +0 -1
  86. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/syntacticDiagnostics/cache/80fdd1aafff88316e6a7f63509fb7304c94ae6d3 +0 -1
  87. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/syntacticDiagnostics/cache/88c6c8bf5346a961efcdff848fba6e3f2d24b26c +0 -1
  88. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/syntacticDiagnostics/cache/a8a4a8a1b06b6c8069e965f4a30a4b42013b830a +0 -1
  89. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/syntacticDiagnostics/cache/b2f217f16a7744eb13543dc90442443538b724b8 +0 -1
  90. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/syntacticDiagnostics/cache/be60813c21c2fbc627fcf99127ca2a96a3065fba +0 -1
  91. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/068e7904209e205518dbc9726d632bbaf28bfc55 +0 -0
  92. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/06b75ecfe63fda3fcfaa42593fa1f22167f3a9f8 +0 -0
  93. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/2aa9d56fc4a9661ee8e3de277da5ee3f960713de +0 -0
  94. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/2c58b356be1a9572c64469d50a7a25c46f94aaeb +0 -0
  95. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/36d3fb579feb4cad7a15b7a2f509f338caf72fa0 +0 -0
  96. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/388b297c3f73fcba25b8174fda975235e5d12b5a +0 -0
  97. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/40e43895ec63e1e25aa7e278ca1e8c3adefc815d +0 -0
  98. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/645e188194be07518ebbb0a5b4304f5170fee599 +0 -0
  99. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/65515bf3a44aaf1306f589073f1c8b98be747f5f +0 -0
  100. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/6a357fe7542e07f7919ea9b22401027dd1e8a0c1 +0 -0
  101. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/72087cac150d02ed6d19e37d6f1436566d5ac798 +0 -0
  102. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/9ff120b6426a4c7a03236428f26a92772586c3e5 +0 -0
  103. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/a6917de673fc74a6cfca5133913982e54e58a7fb +0 -0
  104. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/aa4aee440d13b06b4bb05c36eee326513aa6c040 +0 -0
  105. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/b02a4d0c40fac4c7f9ea7acd7944ee8844afcedf +0 -0
  106. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/b21a02b948881426bc4dcff649fc4fba07ca34d2 +0 -0
  107. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/c10c11f9c426095ab3f504dd8b7622ad7ba7c8ed +0 -0
  108. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_2e1b3e4caed5e16ec3a087e96a7fe6e4f5ea8a82/types/cache/dc186595636217ded2d4a4cfbb789d68ea485b6b +0 -0
  109. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/code/cache/05b27cf262de47962f4beeba3d4b4f67616bdf24 +0 -1
  110. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/code/cache/26c90bc22e366b540ff134ba7de2ab3715155a20 +0 -1
  111. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/code/cache/7a2b654bed9256f52421aec7d04cd8553486335b +0 -1
  112. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/code/cache/80fdd1aafff88316e6a7f63509fb7304c94ae6d3 +0 -1
  113. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/code/cache/88c6c8bf5346a961efcdff848fba6e3f2d24b26c +0 -1
  114. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/code/cache/b2f217f16a7744eb13543dc90442443538b724b8 +0 -1
  115. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/code/cache/be60813c21c2fbc627fcf99127ca2a96a3065fba +0 -1
  116. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/semanticDiagnostics/cache/05b27cf262de47962f4beeba3d4b4f67616bdf24 +0 -1
  117. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/semanticDiagnostics/cache/26c90bc22e366b540ff134ba7de2ab3715155a20 +0 -1
  118. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/semanticDiagnostics/cache/7a2b654bed9256f52421aec7d04cd8553486335b +0 -1
  119. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/semanticDiagnostics/cache/80fdd1aafff88316e6a7f63509fb7304c94ae6d3 +0 -1
  120. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/semanticDiagnostics/cache/88c6c8bf5346a961efcdff848fba6e3f2d24b26c +0 -1
  121. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/semanticDiagnostics/cache/a8a4a8a1b06b6c8069e965f4a30a4b42013b830a +0 -1
  122. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/semanticDiagnostics/cache/b2f217f16a7744eb13543dc90442443538b724b8 +0 -1
  123. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/semanticDiagnostics/cache/be60813c21c2fbc627fcf99127ca2a96a3065fba +0 -1
  124. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/syntacticDiagnostics/cache/05b27cf262de47962f4beeba3d4b4f67616bdf24 +0 -1
  125. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/syntacticDiagnostics/cache/26c90bc22e366b540ff134ba7de2ab3715155a20 +0 -1
  126. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/syntacticDiagnostics/cache/7a2b654bed9256f52421aec7d04cd8553486335b +0 -1
  127. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/syntacticDiagnostics/cache/80fdd1aafff88316e6a7f63509fb7304c94ae6d3 +0 -1
  128. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/syntacticDiagnostics/cache/88c6c8bf5346a961efcdff848fba6e3f2d24b26c +0 -1
  129. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/syntacticDiagnostics/cache/a8a4a8a1b06b6c8069e965f4a30a4b42013b830a +0 -1
  130. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/syntacticDiagnostics/cache/b2f217f16a7744eb13543dc90442443538b724b8 +0 -1
  131. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/syntacticDiagnostics/cache/be60813c21c2fbc627fcf99127ca2a96a3065fba +0 -1
  132. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/068e7904209e205518dbc9726d632bbaf28bfc55 +0 -0
  133. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/06b75ecfe63fda3fcfaa42593fa1f22167f3a9f8 +0 -0
  134. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/2aa9d56fc4a9661ee8e3de277da5ee3f960713de +0 -0
  135. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/2c58b356be1a9572c64469d50a7a25c46f94aaeb +0 -0
  136. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/36d3fb579feb4cad7a15b7a2f509f338caf72fa0 +0 -0
  137. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/388b297c3f73fcba25b8174fda975235e5d12b5a +0 -0
  138. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/40e43895ec63e1e25aa7e278ca1e8c3adefc815d +0 -0
  139. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/645e188194be07518ebbb0a5b4304f5170fee599 +0 -0
  140. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/65515bf3a44aaf1306f589073f1c8b98be747f5f +0 -0
  141. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/6a357fe7542e07f7919ea9b22401027dd1e8a0c1 +0 -0
  142. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/72087cac150d02ed6d19e37d6f1436566d5ac798 +0 -0
  143. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/9ff120b6426a4c7a03236428f26a92772586c3e5 +0 -0
  144. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/a6917de673fc74a6cfca5133913982e54e58a7fb +0 -0
  145. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/aa4aee440d13b06b4bb05c36eee326513aa6c040 +0 -0
  146. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/b02a4d0c40fac4c7f9ea7acd7944ee8844afcedf +0 -0
  147. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/b21a02b948881426bc4dcff649fc4fba07ca34d2 +0 -0
  148. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/c10c11f9c426095ab3f504dd8b7622ad7ba7c8ed +0 -0
  149. package/src/vue/node_modules/.cache/rollup-plugin-typescript2/rpt2_6eed9deea87cc005768ee2b80168901d42458ef9/types/cache/dc186595636217ded2d4a4cfbb789d68ea485b6b +0 -0
@@ -46,11 +46,50 @@ function debounce(func, wait = 50, immediate = false) {
46
46
  }
47
47
  };
48
48
  }
49
+ function isEqual(a, b) {
50
+ return JSON.stringify(a) === JSON.stringify(b);
51
+ }
49
52
  function kebabCase(str) {
50
53
  const result = str.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g, (match) => '-' + match.toLowerCase());
51
54
  return str[0] === str[0].toUpperCase() ? result.substring(1) : result;
52
55
  }
53
56
 
57
+ class Settings {
58
+ constructor(settings) {
59
+ this.id = '';
60
+ this.style = '';
61
+ this.class = [];
62
+ this.isMultiple = false;
63
+ this.isOpen = false;
64
+ this.triggerFocus = true;
65
+ this.intervalMove = null;
66
+ if (!settings) {
67
+ settings = {};
68
+ }
69
+ this.id = 'ss-' + generateID();
70
+ this.style = settings.style || '';
71
+ this.class = settings.class || [];
72
+ this.isEnabled = settings.isEnabled !== undefined ? settings.isEnabled : true;
73
+ this.alwaysOpen = settings.alwaysOpen !== undefined ? settings.alwaysOpen : false;
74
+ this.showSearch = settings.showSearch !== undefined ? settings.showSearch : true;
75
+ this.searchPlaceholder = settings.searchPlaceholder || 'Search';
76
+ this.searchText = settings.searchText || 'No Results';
77
+ this.searchingText = settings.searchingText || 'Searching...';
78
+ this.searchHighlight = settings.searchHighlight !== undefined ? settings.searchHighlight : false;
79
+ this.closeOnSelect = settings.closeOnSelect !== undefined ? settings.closeOnSelect : true;
80
+ this.contentLocation = settings.contentLocation || document.body;
81
+ this.contentPosition = settings.contentPosition || 'absolute';
82
+ this.openPosition = settings.openPosition || 'auto';
83
+ this.placeholderText = settings.placeholderText || 'Select Value';
84
+ this.allowDeselect = settings.allowDeselect !== undefined ? settings.allowDeselect : false;
85
+ this.hideSelected = settings.hideSelected !== undefined ? settings.hideSelected : false;
86
+ this.showOptionTooltips = settings.showOptionTooltips !== undefined ? settings.showOptionTooltips : false;
87
+ this.minSelected = settings.minSelected || 0;
88
+ this.maxSelected = settings.maxSelected || 1000;
89
+ this.timeoutDelay = settings.timeoutDelay || 200;
90
+ }
91
+ }
92
+
54
93
  class Optgroup {
55
94
  constructor(optgroup) {
56
95
  this.id = !optgroup.id || optgroup.id === '' ? generateID() : optgroup.id;
@@ -230,23 +269,21 @@ class Store {
230
269
  const dataSearch = [];
231
270
  this.data.forEach((dataObj) => {
232
271
  if (dataObj instanceof Optgroup) {
233
- if (!includeOptgroup) {
234
- dataObj.options.forEach((option) => {
235
- if (filter && filter(option)) {
236
- dataSearch.push(option);
272
+ let optOptions = [];
273
+ dataObj.options.forEach((option) => {
274
+ if (!filter || filter(option)) {
275
+ if (!includeOptgroup) {
276
+ dataSearch.push(new Option(option));
237
277
  }
238
- });
239
- }
240
- else {
241
- let optOptions = [];
242
- dataObj.options.forEach((option) => {
243
- if (!filter || filter(option)) {
278
+ else {
244
279
  optOptions.push(new Option(option));
245
280
  }
246
- });
247
- if (optOptions.length > 0) {
248
- dataSearch.push(new Optgroup(dataObj));
249
281
  }
282
+ });
283
+ if (optOptions.length > 0) {
284
+ let optgroup = new Optgroup(dataObj);
285
+ optgroup.options = optOptions;
286
+ dataSearch.push(optgroup);
250
287
  }
251
288
  }
252
289
  if (dataObj instanceof Option) {
@@ -944,7 +981,6 @@ class Render {
944
981
  optgroupClosableSvg.classList.add(this.classes.arrow);
945
982
  optgroupClosable.appendChild(optgroupClosableSvg);
946
983
  const optgroupClosableArrow = document.createElementNS('http://www.w3.org/2000/svg', 'path');
947
- optgroupClosableArrow.setAttribute('d', this.classes.arrow);
948
984
  optgroupClosableSvg.appendChild(optgroupClosableArrow);
949
985
  if (d.options.some((o) => o.selected)) {
950
986
  optgroupClosable.classList.add(this.classes.open);
@@ -1197,16 +1233,19 @@ class Select {
1197
1233
  }
1198
1234
  addValueChangeListener(func) {
1199
1235
  this.onValueChange = func;
1200
- this.select.addEventListener('change', this.valueChange.bind(this));
1236
+ this.select.addEventListener('change', this.valueChange.bind(this), {
1237
+ passive: true,
1238
+ });
1201
1239
  }
1202
1240
  removeValueChangeListener() {
1203
1241
  this.onValueChange = undefined;
1204
1242
  this.select.removeEventListener('change', this.valueChange.bind(this));
1205
1243
  }
1206
1244
  valueChange(ev) {
1207
- if (this.onValueChange) {
1245
+ if (this.listen && this.onValueChange) {
1208
1246
  this.onValueChange(this.getSelectedValues());
1209
1247
  }
1248
+ return true;
1210
1249
  }
1211
1250
  observeWrapper(mutations) {
1212
1251
  if (this.onSelectChange) {
@@ -1351,6 +1390,7 @@ class Select {
1351
1390
  this.select.appendChild(this.createOption(d));
1352
1391
  }
1353
1392
  }
1393
+ this.select.dispatchEvent(new Event('change'));
1354
1394
  this.changeListen(true);
1355
1395
  }
1356
1396
  createOptgroup(optgroup) {
@@ -1410,42 +1450,6 @@ class Select {
1410
1450
  }
1411
1451
  }
1412
1452
 
1413
- class Settings {
1414
- constructor(settings) {
1415
- this.id = '';
1416
- this.style = '';
1417
- this.class = [];
1418
- this.isMultiple = false;
1419
- this.isOpen = false;
1420
- this.triggerFocus = true;
1421
- this.intervalMove = null;
1422
- if (!settings) {
1423
- settings = {};
1424
- }
1425
- this.id = 'ss-' + generateID();
1426
- this.style = settings.style || '';
1427
- this.class = settings.class || [];
1428
- this.isEnabled = settings.isEnabled !== undefined ? settings.isEnabled : true;
1429
- this.alwaysOpen = settings.alwaysOpen !== undefined ? settings.alwaysOpen : false;
1430
- this.showSearch = settings.showSearch !== undefined ? settings.showSearch : true;
1431
- this.searchPlaceholder = settings.searchPlaceholder || 'Search';
1432
- this.searchText = settings.searchText || 'No Results';
1433
- this.searchingText = settings.searchingText || 'Searching...';
1434
- this.searchHighlight = settings.searchHighlight !== undefined ? settings.searchHighlight : false;
1435
- this.closeOnSelect = settings.closeOnSelect !== undefined ? settings.closeOnSelect : true;
1436
- this.contentLocation = settings.contentLocation || document.body;
1437
- this.contentPosition = settings.contentPosition || 'absolute';
1438
- this.openPosition = settings.openPosition || 'auto';
1439
- this.placeholderText = settings.placeholderText || 'Select Value';
1440
- this.allowDeselect = settings.allowDeselect !== undefined ? settings.allowDeselect : false;
1441
- this.hideSelected = settings.hideSelected !== undefined ? settings.hideSelected : false;
1442
- this.showOptionTooltips = settings.showOptionTooltips !== undefined ? settings.showOptionTooltips : false;
1443
- this.minSelected = settings.minSelected || 0;
1444
- this.maxSelected = settings.maxSelected || 1000;
1445
- this.timeoutDelay = settings.timeoutDelay || 200;
1446
- }
1447
- }
1448
-
1449
1453
  class SlimSelect {
1450
1454
  constructor(config) {
1451
1455
  this.events = {
@@ -1578,6 +1582,7 @@ class SlimSelect {
1578
1582
  return this.store.getData();
1579
1583
  }
1580
1584
  setData(data) {
1585
+ const selected = this.store.getSelected();
1581
1586
  const err = this.store.validateDataArray(data);
1582
1587
  if (err) {
1583
1588
  if (this.events.error) {
@@ -1590,23 +1595,34 @@ class SlimSelect {
1590
1595
  this.select.updateOptions(dataClean);
1591
1596
  this.render.renderValues();
1592
1597
  this.render.renderOptions(dataClean);
1598
+ if (this.events.afterChange && !isEqual(selected, this.store.getSelected())) {
1599
+ this.events.afterChange(this.store.getSelectedOptions());
1600
+ }
1593
1601
  }
1594
1602
  getSelected() {
1595
1603
  return this.store.getSelected();
1596
1604
  }
1597
1605
  setSelected(value) {
1606
+ const selected = this.store.getSelected();
1598
1607
  this.store.setSelectedBy('value', Array.isArray(value) ? value : [value]);
1599
1608
  const data = this.store.getData();
1600
1609
  this.select.updateOptions(data);
1601
1610
  this.render.renderValues();
1602
1611
  this.render.renderOptions(data);
1612
+ if (this.events.afterChange && !isEqual(selected, this.store.getSelected())) {
1613
+ this.events.afterChange(this.store.getSelectedOptions());
1614
+ }
1603
1615
  }
1604
1616
  addOption(option) {
1617
+ const selected = this.store.getSelected();
1605
1618
  this.store.addOption(option);
1606
1619
  const data = this.store.getData();
1607
1620
  this.select.updateOptions(data);
1608
1621
  this.render.renderValues();
1609
1622
  this.render.renderOptions(data);
1623
+ if (this.events.afterChange && !isEqual(selected, this.store.getSelected())) {
1624
+ this.events.afterChange(this.store.getSelectedOptions());
1625
+ }
1610
1626
  }
1611
1627
  open() {
1612
1628
  if (!this.settings.isEnabled || this.settings.isOpen) {
@@ -1692,6 +1708,13 @@ class SlimSelect {
1692
1708
  var script = vue.defineComponent({
1693
1709
  name: 'SlimSelect',
1694
1710
  props: {
1711
+ modelValue: {
1712
+ type: [String, Array, undefined],
1713
+ },
1714
+ multiple: {
1715
+ type: Boolean,
1716
+ default: false,
1717
+ },
1695
1718
  data: {
1696
1719
  type: Array,
1697
1720
  },
@@ -1702,6 +1725,7 @@ var script = vue.defineComponent({
1702
1725
  type: Object,
1703
1726
  },
1704
1727
  },
1728
+ emits: ['update:modelValue'],
1705
1729
  data() {
1706
1730
  return {
1707
1731
  slim: null,
@@ -1720,7 +1744,24 @@ var script = vue.defineComponent({
1720
1744
  if (this.events) {
1721
1745
  config.events = this.events;
1722
1746
  }
1747
+ if (!config.events) {
1748
+ config.events = {};
1749
+ }
1750
+ const ogAfterChange = config.events.afterChange;
1751
+ config.events.afterChange = (newVal) => {
1752
+ const value = this.multiple ? newVal.map((option) => option.value) : newVal[0].value;
1753
+ if (this.value !== value) {
1754
+ this.value = value;
1755
+ }
1756
+ if (config.events && ogAfterChange) {
1757
+ ogAfterChange(newVal);
1758
+ }
1759
+ };
1723
1760
  this.slim = new SlimSelect(config);
1761
+ let selected = this.$props.multiple ? this.slim.getSelected() : this.slim.getSelected()[0];
1762
+ if (this.value !== selected) {
1763
+ this.value = selected;
1764
+ }
1724
1765
  },
1725
1766
  beforeUnmount() {
1726
1767
  if (this.slim) {
@@ -1737,6 +1778,27 @@ var script = vue.defineComponent({
1737
1778
  deep: true,
1738
1779
  },
1739
1780
  },
1781
+ computed: {
1782
+ value: {
1783
+ get() {
1784
+ const multi = this.$props.multiple;
1785
+ const val = this.$props.modelValue;
1786
+ if (val === undefined) {
1787
+ return multi ? [] : '';
1788
+ }
1789
+ if (multi && typeof val === 'string') {
1790
+ return [val];
1791
+ }
1792
+ if (!multi && Array.isArray(val)) {
1793
+ return val[0];
1794
+ }
1795
+ return multi ? [] : '';
1796
+ },
1797
+ set(value) {
1798
+ this.$emit('update:modelValue', value);
1799
+ },
1800
+ },
1801
+ },
1740
1802
  methods: {
1741
1803
  getSlimSelect() {
1742
1804
  return this.slim;
@@ -1744,12 +1806,15 @@ var script = vue.defineComponent({
1744
1806
  },
1745
1807
  });
1746
1808
 
1747
- const _hoisted_1 = { ref: "slim" };
1809
+ const _hoisted_1 = ["multiple"];
1748
1810
 
1749
1811
  function render(_ctx, _cache, $props, $setup, $data, $options) {
1750
- return (vue.openBlock(), vue.createElementBlock("select", _hoisted_1, [
1812
+ return (vue.openBlock(), vue.createElementBlock("select", {
1813
+ multiple: _ctx.multiple,
1814
+ ref: "slim"
1815
+ }, [
1751
1816
  vue.renderSlot(_ctx.$slots, "default")
1752
- ], 512 /* NEED_PATCH */))
1817
+ ], 8 /* PROPS */, _hoisted_1))
1753
1818
  }
1754
1819
 
1755
1820
  script.render = render;
@@ -2,8 +2,15 @@
2
2
  import { PropType } from 'vue';
3
3
  import SlimSelect, { Events } from '../slim-select';
4
4
  import Settings from '../slim-select/settings';
5
- import { DataArrayPartial } from '../slim-select/store';
5
+ import { DataArrayPartial, Option } from '../slim-select/store';
6
6
  declare const _default: import("vue").DefineComponent<{
7
+ modelValue: {
8
+ type: PropType<string | string[] | undefined>;
9
+ };
10
+ multiple: {
11
+ type: BooleanConstructor;
12
+ default: boolean;
13
+ };
7
14
  data: {
8
15
  type: PropType<DataArrayPartial>;
9
16
  };
@@ -15,7 +22,12 @@ declare const _default: import("vue").DefineComponent<{
15
22
  };
16
23
  }, unknown, {
17
24
  slim: SlimSelect | null;
18
- }, {}, {
25
+ }, {
26
+ value: {
27
+ get(): string | string[];
28
+ set(value: string | string[]): void;
29
+ };
30
+ }, {
19
31
  getSlimSelect(): {
20
32
  selectEl: HTMLSelectElement;
21
33
  settings: {
@@ -65,34 +77,34 @@ declare const _default: import("vue").DefineComponent<{
65
77
  removeSelectChangeListener: () => void;
66
78
  addValueChangeListener: (func: (value: string[]) => void) => void;
67
79
  removeValueChangeListener: () => void;
68
- valueChange: (ev: Event) => any;
80
+ valueChange: (ev: Event) => boolean;
69
81
  getData: () => DataArrayPartial;
70
82
  getDataFromOptgroup: (optgroup: HTMLOptGroupElement) => import("../slim-select/store").OptgroupOptional;
71
- getDataFromOption: (option: HTMLOptionElement) => import("../slim-select/store").Option;
83
+ getDataFromOption: (option: HTMLOptionElement) => Option;
72
84
  getSelectedValues: () => string[];
73
85
  setSelected: (value: string[]) => void;
74
86
  updateSelect: (id?: string | undefined, style?: string | undefined, classes?: string[] | undefined) => void;
75
87
  updateOptions: (data: import("../slim-select/store").DataArray) => void;
76
88
  createOptgroup: (optgroup: import("../slim-select/store").Optgroup) => HTMLOptGroupElement;
77
- createOption: (info: import("../slim-select/store").Option) => HTMLOptionElement;
89
+ createOption: (info: Option) => HTMLOptionElement;
78
90
  destroy: () => void;
79
91
  };
80
92
  store: {
81
93
  validateDataArray: (data: DataArrayPartial | import("../slim-select/store").DataArray) => Error | null;
82
- validateOption: (option: import("../slim-select/store").OptionOptional | import("../slim-select/store").Option) => Error | null;
94
+ validateOption: (option: import("../slim-select/store").OptionOptional | Option) => Error | null;
83
95
  partialToFullData: (data: DataArrayPartial) => import("../slim-select/store").DataArray;
84
96
  setData: (data: DataArrayPartial | import("../slim-select/store").DataArray) => void;
85
97
  getData: () => import("../slim-select/store").DataArray;
86
- getDataOptions: () => import("../slim-select/store").Option[];
98
+ getDataOptions: () => Option[];
87
99
  addOption: (option: import("../slim-select/store").OptionOptional) => void;
88
100
  setSelectedBy: (selectedType: "value" | "id", selectedValues: string[]) => void;
89
101
  getSelected: () => string[];
90
- getSelectedOptions: () => import("../slim-select/store").Option[];
102
+ getSelectedOptions: () => Option[];
91
103
  getSelectedIDs: () => string[];
92
104
  getOptgroupByID: (id: string) => import("../slim-select/store").Optgroup | null;
93
- getOptionByID: (id: string) => import("../slim-select/store").Option | null;
94
- search: (search: string, searchFilter: (opt: import("../slim-select/store").Option, search: string) => boolean) => import("../slim-select/store").DataArray;
95
- filter: (filter: ((opt: import("../slim-select/store").Option) => boolean) | null, includeOptgroup: boolean) => import("../slim-select/store").DataArray;
105
+ getOptionByID: (id: string) => Option | null;
106
+ search: (search: string, searchFilter: (opt: Option, search: string) => boolean) => import("../slim-select/store").DataArray;
107
+ filter: (filter: ((opt: Option) => boolean) | null, includeOptgroup: boolean) => import("../slim-select/store").DataArray;
96
108
  };
97
109
  render: {
98
110
  settings: {
@@ -130,30 +142,30 @@ declare const _default: import("vue").DefineComponent<{
130
142
  };
131
143
  store: {
132
144
  validateDataArray: (data: DataArrayPartial | import("../slim-select/store").DataArray) => Error | null;
133
- validateOption: (option: import("../slim-select/store").OptionOptional | import("../slim-select/store").Option) => Error | null;
145
+ validateOption: (option: import("../slim-select/store").OptionOptional | Option) => Error | null;
134
146
  partialToFullData: (data: DataArrayPartial) => import("../slim-select/store").DataArray;
135
147
  setData: (data: DataArrayPartial | import("../slim-select/store").DataArray) => void;
136
148
  getData: () => import("../slim-select/store").DataArray;
137
- getDataOptions: () => import("../slim-select/store").Option[];
149
+ getDataOptions: () => Option[];
138
150
  addOption: (option: import("../slim-select/store").OptionOptional) => void;
139
151
  setSelectedBy: (selectedType: "value" | "id", selectedValues: string[]) => void;
140
152
  getSelected: () => string[];
141
- getSelectedOptions: () => import("../slim-select/store").Option[];
153
+ getSelectedOptions: () => Option[];
142
154
  getSelectedIDs: () => string[];
143
155
  getOptgroupByID: (id: string) => import("../slim-select/store").Optgroup | null;
144
- getOptionByID: (id: string) => import("../slim-select/store").Option | null;
145
- search: (search: string, searchFilter: (opt: import("../slim-select/store").Option, search: string) => boolean) => import("../slim-select/store").DataArray;
146
- filter: (filter: ((opt: import("../slim-select/store").Option) => boolean) | null, includeOptgroup: boolean) => import("../slim-select/store").DataArray;
156
+ getOptionByID: (id: string) => Option | null;
157
+ search: (search: string, searchFilter: (opt: Option, search: string) => boolean) => import("../slim-select/store").DataArray;
158
+ filter: (filter: ((opt: Option) => boolean) | null, includeOptgroup: boolean) => import("../slim-select/store").DataArray;
147
159
  };
148
160
  callbacks: {
149
161
  open: () => void;
150
162
  close: () => void;
151
163
  addable?: ((value: string) => string | import("../slim-select/store").OptionOptional | Promise<string | import("../slim-select/store").OptionOptional>) | undefined;
152
164
  setSelected: (value: string[]) => void;
153
- addOption: (option: import("../slim-select/store").Option) => void;
165
+ addOption: (option: Option) => void;
154
166
  search: (search: string) => void;
155
- beforeChange?: ((newVal: import("../slim-select/store").Option[], oldVal: import("../slim-select/store").Option[]) => boolean | void) | undefined;
156
- afterChange?: ((newVal: import("../slim-select/store").Option[]) => void) | undefined;
167
+ beforeChange?: ((newVal: Option[], oldVal: Option[]) => boolean | void) | undefined;
168
+ afterChange?: ((newVal: Option[]) => void) | undefined;
157
169
  };
158
170
  main: {
159
171
  main: HTMLDivElement;
@@ -230,7 +242,7 @@ declare const _default: import("vue").DefineComponent<{
230
242
  mainFocus: (trigger: boolean) => void;
231
243
  placeholder: () => HTMLDivElement;
232
244
  renderValues: () => void;
233
- multipleValue: (option: import("../slim-select/store").Option) => HTMLDivElement;
245
+ multipleValue: (option: Option) => HTMLDivElement;
234
246
  contentDiv: () => import("../slim-select/render").Content;
235
247
  moveContent: () => void;
236
248
  searchDiv: () => import("../slim-select/render").Search;
@@ -241,7 +253,7 @@ declare const _default: import("vue").DefineComponent<{
241
253
  renderError: (error: string) => void;
242
254
  renderSearching: () => void;
243
255
  renderOptions: (data: import("../slim-select/store").DataArray) => void;
244
- option: (option: import("../slim-select/store").Option) => HTMLDivElement;
256
+ option: (option: Option) => HTMLDivElement;
245
257
  destroy: () => void;
246
258
  moveContentAbove: () => void;
247
259
  moveContentBelow: () => void;
@@ -250,10 +262,10 @@ declare const _default: import("vue").DefineComponent<{
250
262
  };
251
263
  events: {
252
264
  search?: ((searchValue: string, currentData: import("../slim-select/store").DataArray) => DataArrayPartial | Promise<DataArrayPartial>) | undefined;
253
- searchFilter?: ((option: import("../slim-select/store").Option, search: string) => boolean) | undefined;
265
+ searchFilter?: ((option: Option, search: string) => boolean) | undefined;
254
266
  addable?: ((value: string) => string | import("../slim-select/store").OptionOptional | Promise<string | import("../slim-select/store").OptionOptional>) | undefined;
255
- beforeChange?: ((newVal: import("../slim-select/store").Option[], oldVal: import("../slim-select/store").Option[]) => boolean | void) | undefined;
256
- afterChange?: ((newVal: import("../slim-select/store").Option[]) => void) | undefined;
267
+ beforeChange?: ((newVal: Option[], oldVal: Option[]) => boolean | void) | undefined;
268
+ afterChange?: ((newVal: Option[]) => void) | undefined;
257
269
  beforeOpen?: (() => void) | undefined;
258
270
  afterOpen?: (() => void) | undefined;
259
271
  beforeClose?: (() => void) | undefined;
@@ -272,7 +284,14 @@ declare const _default: import("vue").DefineComponent<{
272
284
  search: (value: string) => void;
273
285
  destroy: () => void;
274
286
  } | null;
275
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
287
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
288
+ modelValue: {
289
+ type: PropType<string | string[] | undefined>;
290
+ };
291
+ multiple: {
292
+ type: BooleanConstructor;
293
+ default: boolean;
294
+ };
276
295
  data: {
277
296
  type: PropType<DataArrayPartial>;
278
297
  };
@@ -282,5 +301,9 @@ declare const _default: import("vue").DefineComponent<{
282
301
  events: {
283
302
  type: PropType<Events>;
284
303
  };
285
- }>>, {}>;
304
+ }>> & {
305
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
306
+ }, {
307
+ multiple: boolean;
308
+ }>;
286
309
  export default _default;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@slim-select/vue",
3
3
  "private": false,
4
- "version": "1.1.1",
4
+ "version": "1.2.1",
5
5
  "description": "Vue integration",
6
6
  "repository": {
7
7
  "type": "git",
@@ -11,7 +11,7 @@ export default [
11
11
  file: './dist/slimselectvue.es.js',
12
12
  },
13
13
  external: ['vue', 'slim-select'],
14
- plugins: [resolve(), typescript(), vue()],
14
+ plugins: [resolve(), typescript({ clean: true }), vue()],
15
15
  },
16
16
 
17
17
  // SSR build.
@@ -23,7 +23,7 @@ export default [
23
23
  file: './dist/slimselectvue.ssr.js',
24
24
  },
25
25
  external: ['vue', 'slim-select'],
26
- plugins: [resolve(), typescript(), vue({ template: { optimizeSSR: true } })],
26
+ plugins: [resolve(), typescript({ clean: true }), vue({ template: { optimizeSSR: true } })],
27
27
  },
28
28
 
29
29
  // Browser build.
@@ -39,6 +39,6 @@ export default [
39
39
  },
40
40
  },
41
41
  external: ['vue', 'slim-select'],
42
- plugins: [resolve(), typescript(), vue()],
42
+ plugins: [resolve(), typescript({ clean: true }), vue()],
43
43
  },
44
44
  ]
@@ -3,11 +3,18 @@ import { defineComponent, PropType } from 'vue'
3
3
 
4
4
  import SlimSelect, { Config, Events } from '../slim-select'
5
5
  import Settings from '../slim-select/settings'
6
- import { DataArrayPartial } from '../slim-select/store'
6
+ import { DataArrayPartial, Option } from '../slim-select/store'
7
7
 
8
8
  export default defineComponent({
9
9
  name: 'SlimSelect',
10
10
  props: {
11
+ modelValue: {
12
+ type: [String, Array, undefined] as PropType<string | string[] | undefined>,
13
+ },
14
+ multiple: {
15
+ type: Boolean,
16
+ default: false,
17
+ },
11
18
  data: {
12
19
  type: Array as PropType<DataArrayPartial>,
13
20
  },
@@ -18,6 +25,7 @@ export default defineComponent({
18
25
  type: Object as PropType<Events>,
19
26
  },
20
27
  },
28
+ emits: ['update:modelValue'],
21
29
  data() {
22
30
  return {
23
31
  slim: null as SlimSelect | null,
@@ -42,9 +50,37 @@ export default defineComponent({
42
50
  if (this.events) {
43
51
  config.events = this.events
44
52
  }
53
+ if (!config.events) {
54
+ config.events = {}
55
+ }
56
+
57
+ // Wrap config.events.afterChange to run emitUpdateSelectedValues
58
+ const ogAfterChange = config.events.afterChange
59
+ config.events.afterChange = (newVal: Option[]) => {
60
+ const value = this.multiple ? newVal.map((option) => option.value) : newVal[0].value
61
+
62
+ // Check if value is different from modelValue
63
+ if (this.value !== value) {
64
+ this.value = value
65
+ }
66
+
67
+ // If they had an original afterChange, run it
68
+ if (config.events && ogAfterChange) {
69
+ ogAfterChange(newVal)
70
+ }
71
+ }
45
72
 
46
73
  // Initialize SlimSelect
47
74
  this.slim = new SlimSelect(config)
75
+
76
+ // Get SlimSelect selected values
77
+ let selected = this.$props.multiple ? this.slim.getSelected() : this.slim.getSelected()[0]
78
+
79
+ // Check if modelValue is the same as the value of the select
80
+ if (this.value !== selected) {
81
+ // If not, set the value of the select to the modelValue
82
+ this.value = selected
83
+ }
48
84
  },
49
85
  beforeUnmount() {
50
86
  if (this.slim) {
@@ -61,6 +97,34 @@ export default defineComponent({
61
97
  deep: true,
62
98
  },
63
99
  },
100
+ computed: {
101
+ value: {
102
+ get(): string | string[] {
103
+ const multi = this.$props.multiple
104
+ const val = this.$props.modelValue
105
+
106
+ // If modelValue is undefined, return empty string or array
107
+ if (val === undefined) {
108
+ return multi ? [] : ''
109
+ }
110
+
111
+ // If its multiple and the modelValue is a string, return an array with the string
112
+ if (multi && typeof val === 'string') {
113
+ return [val]
114
+ }
115
+
116
+ // If its not multiple and the modelValue is an array, return the first item
117
+ if (!multi && Array.isArray(val)) {
118
+ return val[0]
119
+ }
120
+
121
+ return multi ? [] : ''
122
+ },
123
+ set(value: string | string[]) {
124
+ this.$emit('update:modelValue', value)
125
+ },
126
+ },
127
+ },
64
128
  methods: {
65
129
  // This allows via a ref to call the SlimSelect methods
66
130
  getSlimSelect() {
@@ -71,7 +135,7 @@ export default defineComponent({
71
135
  </script>
72
136
 
73
137
  <template>
74
- <select ref="slim">
138
+ <select :multiple="multiple" ref="slim">
75
139
  <slot />
76
140
  </select>
77
141
  </template>