@rafal.lemieszewski/tide-ui 0.29.0 → 0.29.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.es.js CHANGED
@@ -72850,14 +72850,24 @@ function oot({
72850
72850
  );
72851
72851
  }
72852
72852
  function Ure({ filter: e, value: t, onChange: r, onReset: n }) {
72853
- const [o, a] = y.useState(""), i = y.useMemo(() => t ? Array.isArray(t) ? t : [String(t)] : [], [t]), c = y.useMemo(() => e.groups ? o ? e.groups.map((d) => ({
72854
- ...d,
72855
- options: d.options.filter(
72856
- (u) => u.label.toLowerCase().includes(o.toLowerCase()) || u.children?.some(
72857
- (p) => p.label.toLowerCase().includes(o.toLowerCase())
72858
- )
72859
- )
72860
- })).filter((d) => d.options.length > 0) : e.groups : [], [e.groups, o]), s = (d) => {
72853
+ const [o, a] = y.useState(""), i = y.useMemo(() => t ? Array.isArray(t) ? t : [String(t)] : [], [t]), c = y.useMemo(() => {
72854
+ if (e.groups)
72855
+ return o ? e.groups.map((d) => ({
72856
+ ...d,
72857
+ options: d.options.filter(
72858
+ (u) => u.label.toLowerCase().includes(o.toLowerCase()) || u.children?.some(
72859
+ (p) => p.label.toLowerCase().includes(o.toLowerCase())
72860
+ )
72861
+ )
72862
+ })).filter((d) => d.options.length > 0) : e.groups;
72863
+ if (e.options) {
72864
+ const d = o ? e.options.filter(
72865
+ (u) => u.label.toLowerCase().includes(o.toLowerCase())
72866
+ ) : e.options;
72867
+ return d.length > 0 ? [{ label: e.label, options: d }] : [];
72868
+ }
72869
+ return [];
72870
+ }, [e.groups, e.options, e.label, o]), s = (d) => {
72861
72871
  if (e.type === "multiselect") {
72862
72872
  const u = i.includes(d) ? i.filter((p) => p !== d) : [...i, d];
72863
72873
  r(u.length > 0 ? u : void 0);