@xsolla/xui-multi-select 0.72.0 → 0.73.0

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/native/index.js CHANGED
@@ -1977,9 +1977,27 @@ var Tag = ({
1977
1977
  alignItems: "center",
1978
1978
  justifyContent: "center",
1979
1979
  gap: sizeStyles.gap,
1980
+ style: {
1981
+ overflow: "hidden",
1982
+ textOverflow: "ellipsis",
1983
+ whiteSpace: "nowrap"
1984
+ },
1980
1985
  children: [
1981
1986
  icon && /* @__PURE__ */ (0, import_jsx_runtime404.jsx)(Icon4, { size: sizeStyles.iconSize, color: text, children: icon }),
1982
- /* @__PURE__ */ (0, import_jsx_runtime404.jsx)(Text2, { color: text, fontSize: sizeStyles.fontSize, fontWeight: "500", children }),
1987
+ /* @__PURE__ */ (0, import_jsx_runtime404.jsx)(
1988
+ Text2,
1989
+ {
1990
+ color: text,
1991
+ fontSize: sizeStyles.fontSize,
1992
+ fontWeight: "500",
1993
+ whiteSpace: "nowrap",
1994
+ style: {
1995
+ overflow: "hidden",
1996
+ textOverflow: "ellipsis"
1997
+ },
1998
+ children
1999
+ }
2000
+ ),
1983
2001
  onRemove && /* @__PURE__ */ (0, import_jsx_runtime404.jsx)(Box3, { onPress: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime404.jsx)(X2, { size: sizeStyles.iconSize, color: text }) })
1984
2002
  ]
1985
2003
  }
@@ -2030,7 +2048,7 @@ var useMultiSelectControl = ({
2030
2048
  }),
2031
2049
  [stateList, variant, size, removeTagsButtons]
2032
2050
  );
2033
- const isWidthsDependenciesChanged = (0, import_react12.useMemo)(() => {
2051
+ const isWidthsDependenciesChanged = () => {
2034
2052
  const prev = savedWidthsRef.current?.dependencies;
2035
2053
  if (!prev) return true;
2036
2054
  if (prev.variant !== widthsDependencies.variant) return true;
@@ -2045,7 +2063,7 @@ var useMultiSelectControl = ({
2045
2063
  i++;
2046
2064
  }
2047
2065
  return false;
2048
- }, [widthsDependencies]);
2066
+ };
2049
2067
  const setPlaceholder = () => {
2050
2068
  setSelectedContent(
2051
2069
  /* @__PURE__ */ (0, import_jsx_runtime405.jsx)(
@@ -2107,10 +2125,7 @@ var useMultiSelectControl = ({
2107
2125
  if (!disabled) removeValue(item.value, e);
2108
2126
  } : void 0,
2109
2127
  style: {
2110
- overflow: "hidden",
2111
- textOverflow: "ellipsis",
2112
- whiteSpace: "nowrap",
2113
- minWidth: isReducable ? void 0 : "fit-content",
2128
+ minWidth: isReducable ? 0 : "fit-content",
2114
2129
  opacity: disabled ? 0.5 : 1,
2115
2130
  cursor: disabled || isCount ? "not-allowed" : "pointer"
2116
2131
  },
@@ -2194,7 +2209,7 @@ var useMultiSelectControl = ({
2194
2209
  setItemsRender();
2195
2210
  return;
2196
2211
  }
2197
- const needsMeasurement = !savedWidthsRef.current || isWidthsDependenciesChanged;
2212
+ const needsMeasurement = !savedWidthsRef.current || isWidthsDependenciesChanged();
2198
2213
  if (needsMeasurement) {
2199
2214
  if (itemsWidth === 0) return;
2200
2215
  displayStateRef.current = 1 /* PreRender */;
@@ -2213,7 +2228,7 @@ var useMultiSelectControl = ({
2213
2228
  size,
2214
2229
  removeTagsButtons,
2215
2230
  itemsWidth,
2216
- isWidthsDependenciesChanged,
2231
+ widthsDependencies,
2217
2232
  stateList
2218
2233
  ]);
2219
2234
  (0, import_react12.useEffect)(() => {
@@ -2364,11 +2379,17 @@ var MultiSelectControl = (0, import_react13.forwardRef)(
2364
2379
  removeAllValues();
2365
2380
  },
2366
2381
  style: { cursor: "pointer" },
2367
- children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(Icon, { size: 18, color: iconColor, children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(Remove, { size: 18, variant: "line" }) })
2382
+ children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(Remove, { size: 18, color: iconColor, variant: "line" })
2383
+ }
2384
+ ),
2385
+ isError && /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(
2386
+ ExclamationMarkCr,
2387
+ {
2388
+ size: 18,
2389
+ color: theme.colors.content.alert.primary
2368
2390
  }
2369
2391
  ),
2370
- isError && /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(Icon, { size: 18, color: theme.colors.content.alert.primary, children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(ExclamationMarkCr, { size: 18 }) }),
2371
- /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(Icon, { size: 18, color: iconColor, children: iconRight ? iconRight : isOpen ? /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(ChevronUp, { size: 18, variant: "line" }) : /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(ChevronDown, { size: 18 }) })
2392
+ iconRight ? iconRight : isOpen ? /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(ChevronUp, { size: 18, color: iconColor, variant: "line" }) : /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(ChevronDown, { size: 18, color: iconColor })
2372
2393
  ] })
2373
2394
  ]
2374
2395
  }
@@ -2533,7 +2554,7 @@ var MultiSelect = (0, import_react15.forwardRef)(
2533
2554
  const newValues = checked ? [...values, value2] : values.filter((v) => v !== value2);
2534
2555
  onChoose(newValues.map(String));
2535
2556
  };
2536
- return /* @__PURE__ */ (0, import_jsx_runtime407.jsxs)(Box, { flexDirection: "column", gap: 8, children: [
2557
+ return /* @__PURE__ */ (0, import_jsx_runtime407.jsxs)(Box, { flexDirection: "column", gap: sizeStyles.fieldGap, children: [
2537
2558
  label && /* @__PURE__ */ (0, import_jsx_runtime407.jsx)(
2538
2559
  Text,
2539
2560
  {
@@ -2585,7 +2606,8 @@ var MultiSelect = (0, import_react15.forwardRef)(
2585
2606
  left: 0,
2586
2607
  right: 0,
2587
2608
  bottom: 0,
2588
- zIndex: 999
2609
+ zIndex: 999,
2610
+ cursor: "default"
2589
2611
  },
2590
2612
  onPress: onClose
2591
2613
  }