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