@tmlmobilidade/ui 20250128.1719.49 → 20250129.1606.25
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/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/common/Combobox/index.d.ts +4 -4
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/common/Combobox/index.d.ts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/styles.css +4 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -893,7 +893,7 @@ function ComboboxComponent(props) {
|
|
|
893
893
|
if (multiple && Array.isArray(value)) {
|
|
894
894
|
let updatedValue;
|
|
895
895
|
if (value.some((v) => getValue(v) === getValue(val))) {
|
|
896
|
-
updatedValue = value.filter((v) =>
|
|
896
|
+
updatedValue = value.filter((v) => v !== getValue(val));
|
|
897
897
|
}
|
|
898
898
|
else {
|
|
899
899
|
updatedValue = [...value, val];
|
|
@@ -913,7 +913,7 @@ function ComboboxComponent(props) {
|
|
|
913
913
|
*/
|
|
914
914
|
function removeValue(val) {
|
|
915
915
|
if (multiple && Array.isArray(value)) {
|
|
916
|
-
const updatedValue = value.filter((v) =>
|
|
916
|
+
const updatedValue = value.filter((v) => v !== val);
|
|
917
917
|
setValue(updatedValue);
|
|
918
918
|
onChange?.(updatedValue); // Type assertion handled via discriminated union
|
|
919
919
|
}
|
|
@@ -957,7 +957,7 @@ function ComboboxComponent(props) {
|
|
|
957
957
|
// Render Selected Values as Pills
|
|
958
958
|
function renderValues() {
|
|
959
959
|
if (multiple && Array.isArray(value)) {
|
|
960
|
-
return value.map((item) => (jsxRuntimeExports.jsx(core.Pill, { className: styles$i.pill, withRemoveButton: true, onRemove: () => removeValue(item), children: jsxRuntimeExports.jsx("span", { children: getLabel(item) }) },
|
|
960
|
+
return value.map((item) => (jsxRuntimeExports.jsx(core.Pill, { className: styles$i.pill, withRemoveButton: true, onRemove: () => removeValue(item), children: jsxRuntimeExports.jsx("span", { children: getLabel(item) }) }, item)));
|
|
961
961
|
}
|
|
962
962
|
return null;
|
|
963
963
|
}
|