@tmlmobilidade/ui 20250129.1626.34 → 20250129.1710.49

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 CHANGED
@@ -912,7 +912,10 @@ function ComboboxComponent(props) {
912
912
  }
913
913
  else {
914
914
  const newValue = val;
915
- setSearch(searchable ? getLabel(val) : '');
915
+ const itemData = data.find(dataItem => getValue(dataItem) === val);
916
+ if (!itemData)
917
+ return;
918
+ setSearch(searchable ? parseComboboxItem(itemData)?.label : '');
916
919
  setValue(newValue);
917
920
  onChange?.(newValue); // Type assertion handled via discriminated union
918
921
  }
@@ -998,13 +1001,14 @@ function ComboboxComponent(props) {
998
1001
  }
999
1002
  } }) }), jsxRuntimeExports.jsx("div", { className: styles$i.pillClearButton, children: renderClearButton() })] }) }) }));
1000
1003
  }
1004
+ const itemData = data.find(dataItem => getValue(dataItem) === value);
1001
1005
  return (jsxRuntimeExports.jsx(core.Combobox.Target, { children: searchable ? (jsxRuntimeExports.jsx(core.InputBase, { className: styles$i.input, type: "text", value: search, rightSection: renderClearButton(), rightSectionPointerEvents: value === null ? 'none' : 'all', onClick: () => combobox.openDropdown(), onFocus: () => combobox.openDropdown(), onBlur: () => {
1002
1006
  combobox.closeDropdown();
1003
- setSearch(value?.toString() || '');
1007
+ setSearch(itemData ? parseComboboxItem(itemData)?.label : '');
1004
1008
  }, onChange: handleSearchChange, placeholder: "Search value" })) : (jsxRuntimeExports.jsx(core.InputBase, { className: styles$i.input, component: "button", type: "button", pointer: true, onClick: () => combobox.openDropdown(), onFocus: () => combobox.openDropdown(), onBlur: () => {
1005
1009
  combobox.closeDropdown();
1006
1010
  setSearch(value?.toString() || '');
1007
- }, rightSection: renderClearButton(), rightSectionPointerEvents: value === null ? 'none' : 'all', children: Array.isArray(value) ? (value.map((item) => getLabel(item)).join(', ')) : typeof value === 'string' ? (getLabel(value)) : (jsxRuntimeExports.jsx(core.Input.Placeholder, { className: styles$i.placeholder, children: "Pick value" })) })) }));
1011
+ }, rightSection: renderClearButton(), rightSectionPointerEvents: value === null ? 'none' : 'all', children: itemData ? parseComboboxItem(itemData)?.label : jsxRuntimeExports.jsx(core.Input.Placeholder, { className: styles$i.placeholder, children: "Pick value" }) })) }));
1008
1012
  }
1009
1013
  return (jsxRuntimeExports.jsxs("div", { className: cn(styles$i.wrapper, className), style: { width: fullWidth ? '100%' : undefined }, children: [label && jsxRuntimeExports.jsx("label", { className: styles$i.label, children: label }), description && jsxRuntimeExports.jsx("p", { className: styles$i.description, children: description }), error && jsxRuntimeExports.jsx("p", { className: styles$i.error, children: error }), jsxRuntimeExports.jsxs(core.Combobox, { store: combobox, onOptionSubmit: (val) => {
1010
1014
  updateValue(val);
@@ -1718,6 +1722,12 @@ exports.Tooltip = Tooltip;
1718
1722
  exports.useScreenSize = useScreenSize;
1719
1723
  exports.useTheme = useTheme;
1720
1724
  exports.useToast = useToast;
1725
+ Object.keys(modals).forEach(function (k) {
1726
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
1727
+ enumerable: true,
1728
+ get: function () { return modals[k]; }
1729
+ });
1730
+ });
1721
1731
  Object.keys(hooks).forEach(function (k) {
1722
1732
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
1723
1733
  enumerable: true,