@xsolla/xui-multi-select 0.69.0 → 0.70.0-pr104.1769410985
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.d.mts +2 -2
- package/native/index.d.ts +2 -2
- package/native/index.js +13 -9
- package/native/index.js.map +1 -1
- package/native/index.mjs +19 -10
- package/native/index.mjs.map +1 -1
- package/package.json +5 -5
- package/web/index.d.mts +2 -2
- package/web/index.d.ts +2 -2
- package/web/index.js +13 -9
- package/web/index.js.map +1 -1
- package/web/index.mjs +19 -10
- package/web/index.mjs.map +1 -1
package/native/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
|
|
3
3
|
type MultiSelectValue = (string | number)[];
|
|
4
4
|
type MultiSelectVariant = "tag" | "text";
|
|
5
|
-
type MultiSelectSize = "xs" | "
|
|
5
|
+
type MultiSelectSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
6
6
|
type MultiSelectState = "default" | "hover" | "focus" | "disable" | "error";
|
|
7
7
|
interface MultiSelectOption {
|
|
8
8
|
label: ReactNode;
|
|
@@ -33,7 +33,7 @@ interface MultiSelectProps {
|
|
|
33
33
|
errorMessage?: string;
|
|
34
34
|
/**
|
|
35
35
|
* Property for changing the size of the control.
|
|
36
|
-
* @default "
|
|
36
|
+
* @default "md"
|
|
37
37
|
*/
|
|
38
38
|
size?: MultiSelectSize;
|
|
39
39
|
/**
|
package/native/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
|
|
3
3
|
type MultiSelectValue = (string | number)[];
|
|
4
4
|
type MultiSelectVariant = "tag" | "text";
|
|
5
|
-
type MultiSelectSize = "xs" | "
|
|
5
|
+
type MultiSelectSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
6
6
|
type MultiSelectState = "default" | "hover" | "focus" | "disable" | "error";
|
|
7
7
|
interface MultiSelectOption {
|
|
8
8
|
label: ReactNode;
|
|
@@ -33,7 +33,7 @@ interface MultiSelectProps {
|
|
|
33
33
|
errorMessage?: string;
|
|
34
34
|
/**
|
|
35
35
|
* Property for changing the size of the control.
|
|
36
|
-
* @default "
|
|
36
|
+
* @default "md"
|
|
37
37
|
*/
|
|
38
38
|
size?: MultiSelectSize;
|
|
39
39
|
/**
|
package/native/index.js
CHANGED
|
@@ -1908,7 +1908,7 @@ var TextAreaPrimitive3 = (0, import_react11.forwardRef)(
|
|
|
1908
1908
|
);
|
|
1909
1909
|
TextAreaPrimitive3.displayName = "TextAreaPrimitive";
|
|
1910
1910
|
var Tag = ({
|
|
1911
|
-
size = "
|
|
1911
|
+
size = "md",
|
|
1912
1912
|
tone = "primary",
|
|
1913
1913
|
children,
|
|
1914
1914
|
icon,
|
|
@@ -2007,7 +2007,9 @@ var useMultiSelectControl = ({
|
|
|
2007
2007
|
const savedWidthsRef = (0, import_react12.useRef)(null);
|
|
2008
2008
|
const itemsRef = (0, import_react12.useRef)(null);
|
|
2009
2009
|
const [itemsWidth, setItemsWidth] = (0, import_react12.useState)(0);
|
|
2010
|
-
const [selectedContent, setSelectedContent] = (0, import_react12.useState)(
|
|
2010
|
+
const [selectedContent, setSelectedContent] = (0, import_react12.useState)(
|
|
2011
|
+
null
|
|
2012
|
+
);
|
|
2011
2013
|
const isPlaceholder = !selectedItems || selectedItems.length === 0;
|
|
2012
2014
|
(0, import_react12.useEffect)(() => {
|
|
2013
2015
|
if (!containerRef.current) return;
|
|
@@ -2033,8 +2035,10 @@ var useMultiSelectControl = ({
|
|
|
2033
2035
|
if (!prev) return true;
|
|
2034
2036
|
if (prev.variant !== widthsDependencies.variant) return true;
|
|
2035
2037
|
if (prev.size !== widthsDependencies.size) return true;
|
|
2036
|
-
if (prev.removeTagsButtons !== widthsDependencies.removeTagsButtons)
|
|
2037
|
-
|
|
2038
|
+
if (prev.removeTagsButtons !== widthsDependencies.removeTagsButtons)
|
|
2039
|
+
return true;
|
|
2040
|
+
if (prev.stateList.length !== widthsDependencies.stateList.length)
|
|
2041
|
+
return true;
|
|
2038
2042
|
let i = 0;
|
|
2039
2043
|
for (const v of prev.stateList) {
|
|
2040
2044
|
if (v !== widthsDependencies.stateList[i]) return true;
|
|
@@ -2238,7 +2242,7 @@ var MultiSelectControl = (0, import_react13.forwardRef)(
|
|
|
2238
2242
|
onClick,
|
|
2239
2243
|
removeValue,
|
|
2240
2244
|
removeAllValues,
|
|
2241
|
-
size = "
|
|
2245
|
+
size = "md",
|
|
2242
2246
|
state: externalState,
|
|
2243
2247
|
isError = false,
|
|
2244
2248
|
isOpen = false,
|
|
@@ -2273,9 +2277,9 @@ var MultiSelectControl = (0, import_react13.forwardRef)(
|
|
|
2273
2277
|
});
|
|
2274
2278
|
const tagItemsGap = {
|
|
2275
2279
|
xs: 4,
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2280
|
+
sm: 4,
|
|
2281
|
+
md: 6,
|
|
2282
|
+
lg: 8,
|
|
2279
2283
|
xl: 10
|
|
2280
2284
|
}[size];
|
|
2281
2285
|
let backgroundColor = inputColors.bg;
|
|
@@ -2471,7 +2475,7 @@ var MultiSelect = (0, import_react15.forwardRef)(
|
|
|
2471
2475
|
options,
|
|
2472
2476
|
errorMessage,
|
|
2473
2477
|
value = [],
|
|
2474
|
-
size = "
|
|
2478
|
+
size = "md",
|
|
2475
2479
|
state: externalState,
|
|
2476
2480
|
label,
|
|
2477
2481
|
extraClear = false,
|