mithril-materialized 3.17.0 → 3.17.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/dist/index.esm.js +4 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +4 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -7260,12 +7260,12 @@ const Select = () => {
|
|
|
7260
7260
|
opacity: 1,
|
|
7261
7261
|
};
|
|
7262
7262
|
};
|
|
7263
|
-
const formatSelectionSummary = (attrs,
|
|
7263
|
+
const formatSelectionSummary = (attrs, selectedLabels, selectedIds, placeholder) => {
|
|
7264
7264
|
const mode = attrs.summaryMode || 'labels';
|
|
7265
7265
|
const selectedCount = selectedIds.length;
|
|
7266
7266
|
const totalCount = attrs.options.filter((option) => !option.disabled).length;
|
|
7267
7267
|
if (mode === 'labels') {
|
|
7268
|
-
return
|
|
7268
|
+
return selectedLabels.length > 0 ? selectedLabels.join(', ') : placeholder;
|
|
7269
7269
|
}
|
|
7270
7270
|
const defaultCountLabel = `${selectedCount}/${totalCount} selected`;
|
|
7271
7271
|
const formattedCount = attrs.countLabel ? attrs.countLabel(selectedCount, totalCount) : defaultCountLabel;
|
|
@@ -7419,7 +7419,8 @@ const Select = () => {
|
|
|
7419
7419
|
const shouldInlineLabel = appearance === 'outlined' && !!label;
|
|
7420
7420
|
const selectedOptionsUnsorted = options.filter((opt) => isSelected(opt.id, selectedIds));
|
|
7421
7421
|
const selectedOptions = sortOptions(selectedOptionsUnsorted, attrs.sortSelected);
|
|
7422
|
-
const
|
|
7422
|
+
const selectedLabels = selectedOptions.map((o) => o.label || o.id.toString());
|
|
7423
|
+
const triggerValue = formatSelectionSummary(attrs, selectedLabels, selectedIds, placeholder);
|
|
7423
7424
|
// Update portal dropdown when inside modal
|
|
7424
7425
|
if (state.isInsideModal) {
|
|
7425
7426
|
updatePortalDropdown(attrs, selectedIds, multiple, placeholder);
|