@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-multi-select",
3
- "version": "0.72.0",
3
+ "version": "0.73.0",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -10,10 +10,10 @@
10
10
  "build:native": "PLATFORM=native tsup"
11
11
  },
12
12
  "dependencies": {
13
- "@xsolla/xui-checkbox": "0.72.0",
14
- "@xsolla/xui-core": "0.72.0",
15
- "@xsolla/xui-dropdown": "0.72.0",
16
- "@xsolla/xui-primitives-core": "0.72.0"
13
+ "@xsolla/xui-checkbox": "0.73.0",
14
+ "@xsolla/xui-core": "0.73.0",
15
+ "@xsolla/xui-dropdown": "0.73.0",
16
+ "@xsolla/xui-primitives-core": "0.73.0"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": ">=16.8.0",
package/web/index.js CHANGED
@@ -1949,9 +1949,27 @@ var Tag = ({
1949
1949
  alignItems: "center",
1950
1950
  justifyContent: "center",
1951
1951
  gap: sizeStyles.gap,
1952
+ style: {
1953
+ overflow: "hidden",
1954
+ textOverflow: "ellipsis",
1955
+ whiteSpace: "nowrap"
1956
+ },
1952
1957
  children: [
1953
1958
  icon && /* @__PURE__ */ (0, import_jsx_runtime404.jsx)(Icon4, { size: sizeStyles.iconSize, color: text, children: icon }),
1954
- /* @__PURE__ */ (0, import_jsx_runtime404.jsx)(Text2, { color: text, fontSize: sizeStyles.fontSize, fontWeight: "500", children }),
1959
+ /* @__PURE__ */ (0, import_jsx_runtime404.jsx)(
1960
+ Text2,
1961
+ {
1962
+ color: text,
1963
+ fontSize: sizeStyles.fontSize,
1964
+ fontWeight: "500",
1965
+ whiteSpace: "nowrap",
1966
+ style: {
1967
+ overflow: "hidden",
1968
+ textOverflow: "ellipsis"
1969
+ },
1970
+ children
1971
+ }
1972
+ ),
1955
1973
  onRemove && /* @__PURE__ */ (0, import_jsx_runtime404.jsx)(Box3, { onPress: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime404.jsx)(X2, { size: sizeStyles.iconSize, color: text }) })
1956
1974
  ]
1957
1975
  }
@@ -2002,7 +2020,7 @@ var useMultiSelectControl = ({
2002
2020
  }),
2003
2021
  [stateList, variant, size, removeTagsButtons]
2004
2022
  );
2005
- const isWidthsDependenciesChanged = (0, import_react12.useMemo)(() => {
2023
+ const isWidthsDependenciesChanged = () => {
2006
2024
  const prev = savedWidthsRef.current?.dependencies;
2007
2025
  if (!prev) return true;
2008
2026
  if (prev.variant !== widthsDependencies.variant) return true;
@@ -2017,7 +2035,7 @@ var useMultiSelectControl = ({
2017
2035
  i++;
2018
2036
  }
2019
2037
  return false;
2020
- }, [widthsDependencies]);
2038
+ };
2021
2039
  const setPlaceholder = () => {
2022
2040
  setSelectedContent(
2023
2041
  /* @__PURE__ */ (0, import_jsx_runtime405.jsx)(
@@ -2079,10 +2097,7 @@ var useMultiSelectControl = ({
2079
2097
  if (!disabled) removeValue(item.value, e);
2080
2098
  } : void 0,
2081
2099
  style: {
2082
- overflow: "hidden",
2083
- textOverflow: "ellipsis",
2084
- whiteSpace: "nowrap",
2085
- minWidth: isReducable ? void 0 : "fit-content",
2100
+ minWidth: isReducable ? 0 : "fit-content",
2086
2101
  opacity: disabled ? 0.5 : 1,
2087
2102
  cursor: disabled || isCount ? "not-allowed" : "pointer"
2088
2103
  },
@@ -2166,7 +2181,7 @@ var useMultiSelectControl = ({
2166
2181
  setItemsRender();
2167
2182
  return;
2168
2183
  }
2169
- const needsMeasurement = !savedWidthsRef.current || isWidthsDependenciesChanged;
2184
+ const needsMeasurement = !savedWidthsRef.current || isWidthsDependenciesChanged();
2170
2185
  if (needsMeasurement) {
2171
2186
  if (itemsWidth === 0) return;
2172
2187
  displayStateRef.current = 1 /* PreRender */;
@@ -2185,7 +2200,7 @@ var useMultiSelectControl = ({
2185
2200
  size,
2186
2201
  removeTagsButtons,
2187
2202
  itemsWidth,
2188
- isWidthsDependenciesChanged,
2203
+ widthsDependencies,
2189
2204
  stateList
2190
2205
  ]);
2191
2206
  (0, import_react12.useEffect)(() => {
@@ -2336,11 +2351,17 @@ var MultiSelectControl = (0, import_react13.forwardRef)(
2336
2351
  removeAllValues();
2337
2352
  },
2338
2353
  style: { cursor: "pointer" },
2339
- children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(Icon, { size: 18, color: iconColor, children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(Remove, { size: 18, variant: "line" }) })
2354
+ children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(Remove, { size: 18, color: iconColor, variant: "line" })
2355
+ }
2356
+ ),
2357
+ isError && /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(
2358
+ ExclamationMarkCr,
2359
+ {
2360
+ size: 18,
2361
+ color: theme.colors.content.alert.primary
2340
2362
  }
2341
2363
  ),
2342
- 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 }) }),
2343
- /* @__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 }) })
2364
+ 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 })
2344
2365
  ] })
2345
2366
  ]
2346
2367
  }
@@ -2505,7 +2526,7 @@ var MultiSelect = (0, import_react15.forwardRef)(
2505
2526
  const newValues = checked ? [...values, value2] : values.filter((v) => v !== value2);
2506
2527
  onChoose(newValues.map(String));
2507
2528
  };
2508
- return /* @__PURE__ */ (0, import_jsx_runtime407.jsxs)(Box, { flexDirection: "column", gap: 8, children: [
2529
+ return /* @__PURE__ */ (0, import_jsx_runtime407.jsxs)(Box, { flexDirection: "column", gap: sizeStyles.fieldGap, children: [
2509
2530
  label && /* @__PURE__ */ (0, import_jsx_runtime407.jsx)(
2510
2531
  Text,
2511
2532
  {
@@ -2557,7 +2578,8 @@ var MultiSelect = (0, import_react15.forwardRef)(
2557
2578
  left: 0,
2558
2579
  right: 0,
2559
2580
  bottom: 0,
2560
- zIndex: 999
2581
+ zIndex: 999,
2582
+ cursor: "default"
2561
2583
  },
2562
2584
  onPress: onClose
2563
2585
  }