@xsolla/xui-multi-select 0.196.1 → 0.197.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 +35 -3
- package/native/index.js.map +1 -1
- package/native/index.mjs +35 -3
- package/native/index.mjs.map +1 -1
- package/package.json +6 -6
- package/web/index.js +69 -5
- package/web/index.js.map +1 -1
- package/web/index.mjs +69 -5
- package/web/index.mjs.map +1 -1
package/native/index.js
CHANGED
|
@@ -450,7 +450,11 @@ var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
|
|
|
450
450
|
"fontSize",
|
|
451
451
|
"fontWeight",
|
|
452
452
|
"fontFamily",
|
|
453
|
-
"textDecoration"
|
|
453
|
+
"textDecoration",
|
|
454
|
+
// Cross-platform layout prop that Text consumes as CSS, never as an
|
|
455
|
+
// attribute. Pinned explicitly because it is now spread into the styled
|
|
456
|
+
// component rather than destructured away before it can reach the DOM.
|
|
457
|
+
"numberOfLines"
|
|
454
458
|
]);
|
|
455
459
|
function shouldForwardProp(key) {
|
|
456
460
|
if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;
|
|
@@ -540,7 +544,11 @@ var ADDITIONAL_BLOCKED_PROPS2 = /* @__PURE__ */ new Set([
|
|
|
540
544
|
"fontSize",
|
|
541
545
|
"fontWeight",
|
|
542
546
|
"fontFamily",
|
|
543
|
-
"textDecoration"
|
|
547
|
+
"textDecoration",
|
|
548
|
+
// Cross-platform layout prop that Text consumes as CSS, never as an
|
|
549
|
+
// attribute. Pinned explicitly because it is now spread into the styled
|
|
550
|
+
// component rather than destructured away before it can reach the DOM.
|
|
551
|
+
"numberOfLines"
|
|
544
552
|
]);
|
|
545
553
|
function shouldForwardProp2(key) {
|
|
546
554
|
if (ADDITIONAL_BLOCKED_PROPS2.has(key)) return false;
|
|
@@ -741,6 +749,28 @@ var Box2 = import_react5.default.forwardRef(
|
|
|
741
749
|
}
|
|
742
750
|
);
|
|
743
751
|
Box2.displayName = "Box";
|
|
752
|
+
var truncationStyles = (numberOfLines) => {
|
|
753
|
+
if (!numberOfLines || numberOfLines < 1) return "";
|
|
754
|
+
if (numberOfLines === 1) {
|
|
755
|
+
return `
|
|
756
|
+
display: block;
|
|
757
|
+
max-width: 100%;
|
|
758
|
+
min-width: 0;
|
|
759
|
+
overflow: hidden;
|
|
760
|
+
text-overflow: ellipsis;
|
|
761
|
+
white-space: nowrap;
|
|
762
|
+
`;
|
|
763
|
+
}
|
|
764
|
+
return `
|
|
765
|
+
display: -webkit-box;
|
|
766
|
+
-webkit-box-orient: vertical;
|
|
767
|
+
-webkit-line-clamp: ${numberOfLines};
|
|
768
|
+
line-clamp: ${numberOfLines};
|
|
769
|
+
max-width: 100%;
|
|
770
|
+
min-width: 0;
|
|
771
|
+
overflow: hidden;
|
|
772
|
+
`;
|
|
773
|
+
};
|
|
744
774
|
var FilteredSpan = createFilteredElement2("span");
|
|
745
775
|
var StyledText = (0, import_styled_components3.default)(FilteredSpan)`
|
|
746
776
|
color: ${(props) => props.color || "inherit"};
|
|
@@ -751,6 +781,9 @@ var StyledText = (0, import_styled_components3.default)(FilteredSpan)`
|
|
|
751
781
|
white-space: ${(props) => props.whiteSpace || "normal"};
|
|
752
782
|
text-align: ${(props) => props.textAlign || "inherit"};
|
|
753
783
|
text-decoration: ${(props) => props.textDecoration || "none"};
|
|
784
|
+
|
|
785
|
+
/* Keep last: single-line truncation has to win over white-space above. */
|
|
786
|
+
${(props) => truncationStyles(props.numberOfLines)}
|
|
754
787
|
`;
|
|
755
788
|
var Text2 = ({
|
|
756
789
|
style,
|
|
@@ -759,7 +792,6 @@ var Text2 = ({
|
|
|
759
792
|
role,
|
|
760
793
|
testID,
|
|
761
794
|
"data-testid": dataTestId,
|
|
762
|
-
numberOfLines: _numberOfLines,
|
|
763
795
|
...props
|
|
764
796
|
}) => {
|
|
765
797
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|