streamlit-sortable-multiselect 0.7.10__tar.gz → 0.7.12__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.
Files changed (17) hide show
  1. {streamlit_sortable_multiselect-0.7.10/streamlit_sortable_multiselect.egg-info → streamlit_sortable_multiselect-0.7.12}/PKG-INFO +9 -7
  2. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/README.md +8 -6
  3. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/pyproject.toml +1 -1
  4. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/streamlit_sortable_multiselect/__init__.py +8 -5
  5. streamlit_sortable_multiselect-0.7.10/streamlit_sortable_multiselect/frontend/build/assets/index-BwjO0Ed7.js → streamlit_sortable_multiselect-0.7.12/streamlit_sortable_multiselect/frontend/build/assets/index-Yk0PW21K.js +10 -10
  6. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/streamlit_sortable_multiselect/frontend/build/index.html +1 -1
  7. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12/streamlit_sortable_multiselect.egg-info}/PKG-INFO +9 -7
  8. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/streamlit_sortable_multiselect.egg-info/SOURCES.txt +1 -1
  9. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/tests/test_calendar.py +1 -0
  10. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/tests/test_wrapper.py +1 -1
  11. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/LICENSE +0 -0
  12. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/MANIFEST.in +0 -0
  13. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/setup.cfg +0 -0
  14. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/streamlit_sortable_multiselect/frontend/build/assets/index-B3tedBLe.css +0 -0
  15. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/streamlit_sortable_multiselect.egg-info/dependency_links.txt +0 -0
  16. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/streamlit_sortable_multiselect.egg-info/requires.txt +0 -0
  17. {streamlit_sortable_multiselect-0.7.10 → streamlit_sortable_multiselect-0.7.12}/streamlit_sortable_multiselect.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamlit-sortable-multiselect
3
- Version: 0.7.10
3
+ Version: 0.7.12
4
4
  Summary: A Streamlit custom component for selecting and reordering multiple string values.
5
5
  Author: Kentaro Aoki
6
6
  License-Expression: MIT
@@ -105,7 +105,7 @@ display order. Calendar values use the formats in [Returned Values](#returned-va
105
105
  | `options` | `Sequence[str \| Mapping[str, Any]]` | `()` | Available options. Each option can be a plain string, or a dictionary with `label`, `value`, and optional `icon_url` and `color`. Option values must be unique. In calendar modes, optional entries supply labels, icons, and colors for matching calendar values. |
106
106
  | `default` | `Sequence[str] \| None` | `None` | Initially selected values, in the initial order. Changing the values or their order replaces the current selection. In options mode, values must exist in `options`. Calendar defaults must match the mode and bounds. Duplicates are not allowed. |
107
107
  | `default_revision` | `str \| int \| None` | `None` | Change this value to reapply `default` when its values and order are unchanged. |
108
- | `input_mode` | `str` | `"options"` | `"options"`, `"date"`, `"month"`, or `"date_month"`. Mixed mode offers one switch between date ranges and single months. Date-only and month-only modes offer Single/Range controls. |
108
+ | `input_mode` | `str` | `"options"` | `"options"`, `"date"`, `"month"`, `"date_month"`, or `"month_date"`. Mixed modes offers one switch between date ranges and single months. Date-only and month-only modes offer Single/Range controls. |
109
109
  | `min_value` | `str \| datetime.date \| None` | `None` | Inclusive lower bound in calendar modes. Accepts `YYYY-MM-DD`, `YYYY-MM`, or a date object. |
110
110
  | `max_value` | `str \| datetime.date \| None` | `None` | Inclusive upper bound in calendar modes. Accepts `YYYY-MM-DD`, `YYYY-MM`, or a date object. |
111
111
  | `max_range_days` | `int \| None` | `None` | Maximum number of days in each date range, including start and end. Must be positive. `None` means unlimited. Does not limit single values or month ranges. Requires a calendar mode. |
@@ -305,7 +305,8 @@ Adding another calendar value replaces it. A date range counts as one selected i
305
305
  | `"options"` (default) | Searchable dropdown and optional API suggestions | Values from options or API results |
306
306
  | `"date"` | Date input with a Single/Range switch | One date or one date range |
307
307
  | `"month"` | Month input with a Single/Range switch | One month or one month range |
308
- | `"date_month"` | One Date (range)/Month (single) switch | One date range or one month |
308
+ | `"date_month"` | Date (range) on the left, selected initially | One date range or one month |
309
+ | `"month_date"` | Month (single) on the left, selected initially | One month or one date range |
309
310
 
310
311
  Use `input_mode="date_month"` to add date ranges and single months to one sortable
311
312
  list. One switch selects Date (range) or Month (single). Date (range) shows Start
@@ -330,8 +331,9 @@ selected = sortable_multiselect(
330
331
  st.write("Selected order:", selected)
331
332
  ```
332
333
 
333
- Mixed mode initially shows the date-range inputs. Switching to Month (single)
334
- clears unfinished inputs and keeps items already added to the sortable list.
334
+ Use `input_mode="month_date"` to show Month (single) on the left and
335
+ Date (range) on the right. The picker opens with one month input. In both mixed
336
+ modes, switching clears unfinished inputs and keeps items already added.
335
337
 
336
338
  ### Calendar Labels
337
339
 
@@ -342,8 +344,8 @@ defaults are:
342
344
 
343
345
  | Key | Default | Used in |
344
346
  | --- | --- | --- |
345
- | `date_range` | `"Date (range)"` | `date_month` |
346
- | `month_single` | `"Month (single)"` | `date_month` |
347
+ | `date_range` | `"Date (range)"` | `date_month`, `month_date` |
348
+ | `month_single` | `"Month (single)"` | `date_month`, `month_date` |
347
349
  | `single` | `"Single"` | `date`, `month` |
348
350
  | `range` | `"Range"` | `date`, `month` |
349
351
  | `add` | `"Add"` | Add button |
@@ -77,7 +77,7 @@ display order. Calendar values use the formats in [Returned Values](#returned-va
77
77
  | `options` | `Sequence[str \| Mapping[str, Any]]` | `()` | Available options. Each option can be a plain string, or a dictionary with `label`, `value`, and optional `icon_url` and `color`. Option values must be unique. In calendar modes, optional entries supply labels, icons, and colors for matching calendar values. |
78
78
  | `default` | `Sequence[str] \| None` | `None` | Initially selected values, in the initial order. Changing the values or their order replaces the current selection. In options mode, values must exist in `options`. Calendar defaults must match the mode and bounds. Duplicates are not allowed. |
79
79
  | `default_revision` | `str \| int \| None` | `None` | Change this value to reapply `default` when its values and order are unchanged. |
80
- | `input_mode` | `str` | `"options"` | `"options"`, `"date"`, `"month"`, or `"date_month"`. Mixed mode offers one switch between date ranges and single months. Date-only and month-only modes offer Single/Range controls. |
80
+ | `input_mode` | `str` | `"options"` | `"options"`, `"date"`, `"month"`, `"date_month"`, or `"month_date"`. Mixed modes offers one switch between date ranges and single months. Date-only and month-only modes offer Single/Range controls. |
81
81
  | `min_value` | `str \| datetime.date \| None` | `None` | Inclusive lower bound in calendar modes. Accepts `YYYY-MM-DD`, `YYYY-MM`, or a date object. |
82
82
  | `max_value` | `str \| datetime.date \| None` | `None` | Inclusive upper bound in calendar modes. Accepts `YYYY-MM-DD`, `YYYY-MM`, or a date object. |
83
83
  | `max_range_days` | `int \| None` | `None` | Maximum number of days in each date range, including start and end. Must be positive. `None` means unlimited. Does not limit single values or month ranges. Requires a calendar mode. |
@@ -277,7 +277,8 @@ Adding another calendar value replaces it. A date range counts as one selected i
277
277
  | `"options"` (default) | Searchable dropdown and optional API suggestions | Values from options or API results |
278
278
  | `"date"` | Date input with a Single/Range switch | One date or one date range |
279
279
  | `"month"` | Month input with a Single/Range switch | One month or one month range |
280
- | `"date_month"` | One Date (range)/Month (single) switch | One date range or one month |
280
+ | `"date_month"` | Date (range) on the left, selected initially | One date range or one month |
281
+ | `"month_date"` | Month (single) on the left, selected initially | One month or one date range |
281
282
 
282
283
  Use `input_mode="date_month"` to add date ranges and single months to one sortable
283
284
  list. One switch selects Date (range) or Month (single). Date (range) shows Start
@@ -302,8 +303,9 @@ selected = sortable_multiselect(
302
303
  st.write("Selected order:", selected)
303
304
  ```
304
305
 
305
- Mixed mode initially shows the date-range inputs. Switching to Month (single)
306
- clears unfinished inputs and keeps items already added to the sortable list.
306
+ Use `input_mode="month_date"` to show Month (single) on the left and
307
+ Date (range) on the right. The picker opens with one month input. In both mixed
308
+ modes, switching clears unfinished inputs and keeps items already added.
307
309
 
308
310
  ### Calendar Labels
309
311
 
@@ -314,8 +316,8 @@ defaults are:
314
316
 
315
317
  | Key | Default | Used in |
316
318
  | --- | --- | --- |
317
- | `date_range` | `"Date (range)"` | `date_month` |
318
- | `month_single` | `"Month (single)"` | `date_month` |
319
+ | `date_range` | `"Date (range)"` | `date_month`, `month_date` |
320
+ | `month_single` | `"Month (single)"` | `date_month`, `month_date` |
319
321
  | `single` | `"Single"` | `date`, `month` |
320
322
  | `range` | `"Range"` | `date`, `month` |
321
323
  | `add` | `"Add"` | Add button |
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "streamlit-sortable-multiselect"
7
- version = "0.7.10"
7
+ version = "0.7.12"
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"
@@ -12,7 +12,7 @@ from urllib.parse import urlparse
12
12
 
13
13
  import streamlit.components.v1 as components
14
14
 
15
- __version__ = "0.7.10"
15
+ __version__ = "0.7.12"
16
16
  __all__ = ["COLOR_FIELDS", "COLOR_SOURCES", "ColorValue", "sortable_multiselect"]
17
17
 
18
18
  _COMPONENT_NAME = "streamlit_sortable_multiselect"
@@ -342,7 +342,7 @@ def _validate_calendar_value(
342
342
  if len(parts) not in (1, 2) or any(len(part) != len(parts[0]) for part in parts):
343
343
  raise ValueError(f"Invalid calendar value: {value!r}.")
344
344
  precision = "month" if len(parts[0]) == 7 else "date"
345
- if input_mode != "date_month" and precision != input_mode:
345
+ if input_mode in {"date", "month"} and precision != input_mode:
346
346
  raise ValueError(f"Calendar value {value!r} does not match input_mode={input_mode!r}.")
347
347
  for part in parts:
348
348
  _calendar_bound("calendar value", part, upper=False)
@@ -484,7 +484,8 @@ def sortable_multiselect(
484
484
  Change this value to reapply default even when its values and order are unchanged.
485
485
  input_mode:
486
486
  "options" for searchable options, "date" or "month" for calendar inputs,
487
- or "date_month" for one switch between date ranges and single months.
487
+ or "date_month" / "month_date" for a switch between date ranges and single
488
+ months. The first part of the mode name is the initial, leftmost choice.
488
489
  Date-only and month-only pickers offer a separate Single/Range switch.
489
490
  min_value, max_value:
490
491
  Inclusive calendar bounds as date objects, YYYY-MM-DD, or YYYY-MM strings.
@@ -526,8 +527,10 @@ def sortable_multiselect(
526
527
  raise TypeError("default_revision must be a string, an integer, or None.")
527
528
  if not isinstance(input_mode, str):
528
529
  raise TypeError("input_mode must be a string.")
529
- if input_mode not in {"options", "date", "month", "date_month"}:
530
- raise ValueError('input_mode must be "options", "date", "month", or "date_month".')
530
+ if input_mode not in {"options", "date", "month", "date_month", "month_date"}:
531
+ raise ValueError(
532
+ 'input_mode must be "options", "date", "month", "date_month", or "month_date".'
533
+ )
531
534
  calendar_mode = input_mode != "options"
532
535
  calendar_label_values = _validate_calendar_labels(calendar_labels)
533
536
  if max_range_days is not None: