streamlit-sortable-multiselect 0.7.3__tar.gz → 0.7.4__tar.gz
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.
- {streamlit_sortable_multiselect-0.7.3/streamlit_sortable_multiselect.egg-info → streamlit_sortable_multiselect-0.7.4}/PKG-INFO +1 -1
- {streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4}/pyproject.toml +1 -1
- {streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4}/streamlit_sortable_multiselect/__init__.py +20 -6
- streamlit_sortable_multiselect-0.7.4/streamlit_sortable_multiselect/frontend/build/assets/index-BxYP2Xl8.js +67 -0
- streamlit_sortable_multiselect-0.7.4/streamlit_sortable_multiselect/frontend/build/assets/index-DFEJzS1A.css +1 -0
- {streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4}/streamlit_sortable_multiselect/frontend/build/index.html +2 -2
- {streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4/streamlit_sortable_multiselect.egg-info}/PKG-INFO +1 -1
- {streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4}/streamlit_sortable_multiselect.egg-info/SOURCES.txt +2 -2
- streamlit_sortable_multiselect-0.7.3/streamlit_sortable_multiselect/frontend/build/assets/index-DdljhZDS.js +0 -67
- streamlit_sortable_multiselect-0.7.3/streamlit_sortable_multiselect/frontend/build/assets/index-DobBL0Fg.css +0 -1
- {streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4}/LICENSE +0 -0
- {streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4}/MANIFEST.in +0 -0
- {streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4}/README.md +0 -0
- {streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4}/setup.cfg +0 -0
- {streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4}/streamlit_sortable_multiselect.egg-info/dependency_links.txt +0 -0
- {streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4}/streamlit_sortable_multiselect.egg-info/requires.txt +0 -0
- {streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4}/streamlit_sortable_multiselect.egg-info/top_level.txt +0 -0
- {streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4}/tests/test_wrapper.py +0 -0
{streamlit_sortable_multiselect-0.7.3 → streamlit_sortable_multiselect-0.7.4}/pyproject.toml
RENAMED
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "streamlit-sortable-multiselect"
|
|
7
|
-
version = "0.7.
|
|
7
|
+
version = "0.7.4"
|
|
8
8
|
description = "A Streamlit custom component for selecting and reordering multiple string values."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -8,7 +8,7 @@ from typing import Any, Iterable, Mapping, Sequence, cast
|
|
|
8
8
|
|
|
9
9
|
import streamlit.components.v1 as components
|
|
10
10
|
|
|
11
|
-
__version__ = "0.7.
|
|
11
|
+
__version__ = "0.7.4"
|
|
12
12
|
__all__ = ["sortable_multiselect"]
|
|
13
13
|
|
|
14
14
|
_COMPONENT_NAME = "streamlit_sortable_multiselect"
|
|
@@ -200,17 +200,31 @@ def sortable_multiselect(
|
|
|
200
200
|
icon_size_value = _validate_icon_size(icon_size)
|
|
201
201
|
options_max_height_value = _validate_options_max_height(options_max_height)
|
|
202
202
|
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
# Set membership keeps these checks O(n); list.count / `in list` here are
|
|
204
|
+
# O(n**2) and hang the rerun once options reaches tens of thousands.
|
|
205
|
+
seen_option_values: set[str] = set()
|
|
206
|
+
has_duplicate_options = False
|
|
207
|
+
for value in option_values:
|
|
208
|
+
if value in seen_option_values:
|
|
209
|
+
has_duplicate_options = True
|
|
210
|
+
break
|
|
211
|
+
seen_option_values.add(value)
|
|
212
|
+
if has_duplicate_options:
|
|
205
213
|
raise ValueError("options must not contain duplicate values.")
|
|
206
214
|
|
|
207
|
-
missing_defaults = [value for value in default_values if value not in
|
|
215
|
+
missing_defaults = [value for value in default_values if value not in seen_option_values]
|
|
208
216
|
if missing_defaults:
|
|
209
217
|
missing = ", ".join(repr(value) for value in missing_defaults)
|
|
210
218
|
raise ValueError(f"default contains values not present in options: {missing}.")
|
|
211
219
|
|
|
212
|
-
|
|
213
|
-
|
|
220
|
+
seen_default_values: set[str] = set()
|
|
221
|
+
has_duplicate_defaults = False
|
|
222
|
+
for value in default_values:
|
|
223
|
+
if value in seen_default_values:
|
|
224
|
+
has_duplicate_defaults = True
|
|
225
|
+
break
|
|
226
|
+
seen_default_values.add(value)
|
|
227
|
+
if has_duplicate_defaults:
|
|
214
228
|
raise ValueError("default must not contain duplicate values.")
|
|
215
229
|
|
|
216
230
|
if max_selection_count is not None and len(default_values) > max_selection_count:
|