mithril-materialized 3.17.0 → 3.17.2
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/core.css +3 -5
- package/dist/forms.css +3 -5
- package/dist/index.css +3 -5
- package/dist/index.esm.js +8 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.umd.js +8 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/sass/components/forms/_input-fields.scss +3 -6
package/dist/index.umd.js
CHANGED
|
@@ -3784,7 +3784,7 @@
|
|
|
3784
3784
|
}
|
|
3785
3785
|
},
|
|
3786
3786
|
view: ({ attrs }) => {
|
|
3787
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3787
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
3788
3788
|
const { className = 'col s12', dataError, dataSuccess, helperText, iconName, id = state.id, placeholder, isMandatory, label, maxLength, newRow, oninput, onchange, onkeydown, onkeypress, onkeyup, style, validate, canClear } = attrs, params = __rest(attrs, ["className", "dataError", "dataSuccess", "helperText", "iconName", "id", "placeholder", "isMandatory", "label", "maxLength", "newRow", "oninput", "onchange", "onkeydown", "onkeypress", "onkeyup", "style", "validate", "canClear"]);
|
|
3789
3789
|
// const attributes = toAttrs(params);
|
|
3790
3790
|
const cn = [newRow ? 'clear' : '', defaultClass, className].filter(Boolean).join(' ').trim() || undefined;
|
|
@@ -4018,12 +4018,14 @@
|
|
|
4018
4018
|
m('button.number-input-control.number-input-control-up[type=button]', {
|
|
4019
4019
|
'aria-label': `Increase ${label || 'value'}`,
|
|
4020
4020
|
title: 'Increase value',
|
|
4021
|
+
tabindex: -1,
|
|
4021
4022
|
onmousedown: (event) => event.preventDefault(),
|
|
4022
4023
|
onclick: () => stepNumberInput('up'),
|
|
4023
4024
|
}, m(MaterialIcon, { name: 'chevron', direction: 'up' })),
|
|
4024
4025
|
m('button.number-input-control.number-input-control-down[type=button]', {
|
|
4025
4026
|
'aria-label': `Decrease ${label || 'value'}`,
|
|
4026
4027
|
title: 'Decrease value',
|
|
4028
|
+
tabindex: -1,
|
|
4027
4029
|
onmousedown: (event) => event.preventDefault(),
|
|
4028
4030
|
onclick: () => stepNumberInput('down'),
|
|
4029
4031
|
}, m(MaterialIcon, { name: 'chevron' })),
|
|
@@ -4049,7 +4051,7 @@
|
|
|
4049
4051
|
initialValue: value !== undefined && value !== '',
|
|
4050
4052
|
helperText,
|
|
4051
4053
|
dataError: state.hasInteracted && !state.isValid ? dataError : undefined,
|
|
4052
|
-
dataSuccess: state.hasInteracted && state.isValid ? dataSuccess : undefined,
|
|
4054
|
+
dataSuccess: state.hasInteracted && state.isValid && ((_g = state.inputElement) === null || _g === void 0 ? void 0 : _g.value) ? dataSuccess : undefined,
|
|
4053
4055
|
}),
|
|
4054
4056
|
maxLength && typeof value === 'string'
|
|
4055
4057
|
? m(CharacterCounter, {
|
|
@@ -7264,12 +7266,12 @@
|
|
|
7264
7266
|
opacity: 1,
|
|
7265
7267
|
};
|
|
7266
7268
|
};
|
|
7267
|
-
const formatSelectionSummary = (attrs,
|
|
7269
|
+
const formatSelectionSummary = (attrs, selectedLabels, selectedIds, placeholder) => {
|
|
7268
7270
|
const mode = attrs.summaryMode || 'labels';
|
|
7269
7271
|
const selectedCount = selectedIds.length;
|
|
7270
7272
|
const totalCount = attrs.options.filter((option) => !option.disabled).length;
|
|
7271
7273
|
if (mode === 'labels') {
|
|
7272
|
-
return
|
|
7274
|
+
return selectedLabels.length > 0 ? selectedLabels.join(', ') : placeholder;
|
|
7273
7275
|
}
|
|
7274
7276
|
const defaultCountLabel = `${selectedCount}/${totalCount} selected`;
|
|
7275
7277
|
const formattedCount = attrs.countLabel ? attrs.countLabel(selectedCount, totalCount) : defaultCountLabel;
|
|
@@ -7423,7 +7425,8 @@
|
|
|
7423
7425
|
const shouldInlineLabel = appearance === 'outlined' && !!label;
|
|
7424
7426
|
const selectedOptionsUnsorted = options.filter((opt) => isSelected(opt.id, selectedIds));
|
|
7425
7427
|
const selectedOptions = sortOptions(selectedOptionsUnsorted, attrs.sortSelected);
|
|
7426
|
-
const
|
|
7428
|
+
const selectedLabels = selectedOptions.map((o) => o.label || o.id.toString());
|
|
7429
|
+
const triggerValue = formatSelectionSummary(attrs, selectedLabels, selectedIds, placeholder);
|
|
7427
7430
|
// Update portal dropdown when inside modal
|
|
7428
7431
|
if (state.isInsideModal) {
|
|
7429
7432
|
updatePortalDropdown(attrs, selectedIds, multiple, placeholder);
|